Skip to content

Instantly share code, notes, and snippets.

@tejavarma-aln
Created August 23, 2020 05:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tejavarma-aln/7fc52dd13d6d5959969edd1fa3033a1b to your computer and use it in GitHub Desktop.
Save tejavarma-aln/7fc52dd13d6d5959969edd1fa3033a1b to your computer and use it in GitHub Desktop.
Part-1 of Web Service from TDL
<?php
class LedgerModel{
public $ledName;
public $ledGroup;
public $ledState;
public $ledAddress;
public $ledGstin;
public $ledCountry;
function __construct($name,$grp,$country,$state,$addr,$gstin){
$this->ledName = $name;
$this->ledGroup = $grp;
$this->ledState = $state;
$this->ledAddress = $addr;
$this->ledGstin = $gstin;
$this->ledCountry = $country;
}
}
$led_list = array();
array_push($led_list,new LedgerModel("Star Agencies","SundryDebtors","India","Andhrapradesh","Visakhapatnam","37ASD123GHJ789Z"));
array_push($led_list,new LedgerModel("Alliance Corporation","SundryCreditors","India","AndhraPradesh","Vijayawada","37ASD123GHJ789Z"));
array_push($led_list,new LedgerModel("Khan Enterprises","SundryDebtors","India","Andhrapradesh","Visakhapatnam","37ASD123GHJ789Z"));
array_push($led_list,new LedgerModel("Bharath gas limited","SundryCreditors","India","AndhraPradesh","Vijayawada","37ASD123GHJ789Z"));
$led_response = array();
$led_response['Ledgers'] = $led_list;
print_r(json_encode($led_response));
?>
[Collection:RemoteLedgerColl]
Data Source:HTTP JSON:"http://localhost/Ledgers.php":UTF8
[Collection:RemoteLedExtract]
Source Collection:RemoteLedgerColl
Walk:Ledgers
Compute:Name:$ledName
Compute:Group:$ledGroup
Compute:Country:$ledCountry
Compute:State:$ledState
Compute:Address:$ledAddress
Compute:Gstin:$ledGstin
[#Menu:GateWayOfTally]
Add:Item:Post Ledgers:Call:CreateLedgers
[Function:CreateLedgers]
00:Walk Collection:RemoteLedExtract
01:New Object:Ledger
02:Set Value:Name:$Name
03:Set Value:Parent:$Group
04:Set Value:Address:$Address
05:Set Value:CountryofResidence:$Country
06:Set Value:LedStateName:$State
07:Set Value:PartyGSTIN:$Gstin
08:Save Target
09:End Walk
10:Msg Box:"Success":"Ledgers Created Successfully"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment