PHP code example of zoghal / holoo-client
1. Go to this page and download the library: Download zoghal/holoo-client library . Choose the download type require .
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
zoghal / holoo-client example snippets
HolooClient\Holoo;
use HolooClient\Customer;
use HolooClient\Invoice;
use HolooClient\Product;
Holoo::config('http://server-ip:8080/TncHoloo/api/','DB Name','UserName','PassWord');
Holoo::login();
$user = Customer::GetCustomer();
$user = Customer::GetCustomer(["Code" => 2756]);
$user = Customer::GetCustomerCount();
$user = Customer::NewCustomer([
'custifno' => [
'name' => 'صالح سوزنچی',
'ispurchaser' => true,
'isseller' => true,
'custtype' => true,
]
]);
$user = Customer::EditCustomer([
'custifno' => [
'erpcode=' => 'bBAPNA12dg0=',
'isblacklist' => true,
'nationalid' => '38700011122',
]
]);
print_r($user);
$invioces= Invoice::GetInvoiceList();
$invioces= Invoice::GetInvoiceList(['Code'=>123]);
$invioces= Invoice::GetInvoiceList(['type'=>4]);
print_r($invioces);
$invioces = Invoice::NewInvoice([
'invoiceinfo' => [
'id' => '978',
'type' => '1',
'customererpcode' => 'bBAPcw12cg0=',
'date' => date('Y-m-d'),
'time' => date("H:i:s") ,
'Nesiyeh' => '21000',
'comment' => 'یک فاکتور جدید',
'detailinfo' => [
[
'id' => '1',
'ProductErpCode' => 'bBALNA1mckd7QB4O',
'few' => '1',
'price' => '1000',
'Comment' => 'توضیحاتی مرتبط با یک محصول خریداری شده'
],
[
'id' => '2',
'ProductErpCode' => 'bBALNA1mckd5dh4O',
'few' => '2',
'price' => '10000',
'Comment' => 'ثبت دامنه | gogoliMagooli.miomio'
]
]
]
]);
print_r($invioces);
$preInvioces = Invoice::GetPreInvoiceList();
$preInvioces = Invoice::NewPreInvoice([
'invoiceinfo' => [
'id' => '978',
'customererpcode' => 'bBAPcw12cg0=',
'date' => date('Y-m-d'),
'time' => date("H:i:s") ,
'comment' => 'یک پیش فاکتور جدید',
'detailinfo' => [
[
'id' => '001',
'ProductErpCode' => 'bBALNA1mckd7QB4O',
'few' => '1',
'price' => '1000',
'Comment' => 'توضیحاتی مرتبط با یک محصول خریداری شده'
],
[
'id' => '002',
'ProductErpCode' => 'bBALNA1mckd5dh4O',
'few' => '21',
'price' => '10000',
'Comment' => 'ثبت دامنه | gogoliMagooli.miomio'
]
]
]
]);
print_r($preInvioces);
$product = Product::GetMainGroup();
$product = Product::GetSideGroup();
$product = Product::GetUnit();
print_r($product);
$product= Product::GetProduct();
$product= Product::GetProduct(['Code'=>64]);
$product = Product::GetProduct(['MainGroupErpCode' => 'bBALfg==']); // bug
$product= Product::GetProductCount();
print_r($product);
$product = Product::NewProduct([
'productinfo' => [
'sidegroupErpcode' => 'bBALNA1jDg0=',
'name' => 'saleh402'
]
]);
$product = Product::EditProduct([
'productinfo' => [
'erpcode' => 'bBALNA1mcgF7UB4O',
'name' => 'محصول ادیت شده'
]
]);
print_r($product);