-
Notifications
You must be signed in to change notification settings - Fork 5
/
test.php
53 lines (39 loc) · 1.05 KB
/
test.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<?php
require_once("src/tallyIntegration.php");
$host = "10.1.30.95:9000";
$tally = new TallyIntegration($host);
//parametrs from application
$billing_user = "Imran2222";
$aa = array();
$aa["state_name"] = "New Delhi";
$aa["ledger_name"] = $billing_user ;
$aa["parent"] = "Sundry Debtors";
$aa["ledger_description"] = "aaaa bbbb cccc dddd eee ffff gggg hhhh jjjjjj";
$aa["ledger_address"] = "14 wea, karol bagh";
$aa["ledger_city"] = "New Delhi";
$aa["pin_code"] = "110006";
$aa["country"] = "India";
$aa["is_affect_stock"] = "Yes";
$aa["ledger_contact"] = "Imraan";
$res = $tally->getAllLedger();
if ($res !== NULL){
// check ledger is avvailable in tally or not
if (in_array("$billing_user", $res))
{
//enter a voucher
echo "Match found";
//echo $voucher_entry;die();
$vcentry = xml_execute($url, $voucher_entry);
print_r($vcentry);
}
else
{
// create ledger
// enter a voucher
echo "Match not found...";
echo "Creating New Ledger...";
$ledger = $tally->CreateLedger($aa);
print_r($ledger);
}
}
?>