Accounting-Companion / TallyConnector

You can use Tally Connector to Connect your desktop/Mobile Applications with Tally seamlessly.
47 stars 29 forks source link

Alter Ledger #6

Closed sanketgroup closed 3 years ago

sanketgroup commented 3 years ago

What is the way to alter the ledger?

For e.g Source had the name "ABC" sent to Tally successfully as "ABC"

But, source changed name from "ABC" to "XYZ", how could it be altered in Tally to "XYZ" ?

I think MasterID is not working for Ledgers and Masters, if I am not wrong.

Thanks

saivineeth100 commented 3 years ago

I Already covered this in Reade Me

//To Get Full Object from Tally use Specific methods like GetGroup, GetLedger, GetCostCategory,GetCostCenter ..etc.,
//For Ex. For getting Group by name
Group TGrp = await Ctally.GetGroup(GroupName);

//To Create/Alter/Delete/Cancel Group,Ledger,Voucher from Tally use Specific methods like PostGroup, PostLedger, PostCostCategory,PostCostCenter ..etc.,
//For Ex. To create group
await Ctally.PostGroup(Group);
//For Ex. To Delete group we need to Set Group.Action to Delete and use the same method
await Ctally.PostGroup(Group); 
sanketgroup commented 3 years ago

Can you please share code lines to alter the ledger? Let's say Name already changed from ABC to XYZ in Excel or Database. How will I instruct Tally to Alter the name from ABC to XYZ ?

because I do not have old name in my database anymore, someone has already overwritten/renamed ledger name in Excel/Database.

saivineeth100 commented 3 years ago

Remember the code I used in your pc to delete voucher I send voucher object not voucher number To alter ledger first you need to intiate ledger object with previous values

In your case since name is already changed create ledger object with changed details(assuming you have master id) in database Send the ledger in postledger method If you don't have previous name and master id we can't alter using plane xml also

sanketgroup commented 3 years ago

Creating a new ledger is not sending back MasterID (like as in Voucher). I read somewhere that creating Ledger does not return MasterID.

saivineeth100 commented 3 years ago

Yes correct We will not get master ID as response for objects other than voucher But if use getledger method it will return ledger object with master id you can save that in database

sanketgroup commented 3 years ago

You mean TallyID? because I do not see anything like MasterID when use GetLedger method.

saivineeth100 commented 3 years ago

Yes TallyId will store masterid