Govind Lumia

Govind Lumia

  • NA
  • 27
  • 1.1k

I want to import stock purchase order to tally from excel.

Jun 19 2019 8:04 AM
Hi,
 
I am creating a .net application for import PO and SO excel data into tally by XML
 
my code is below. The XML I use is export from the tally. I don't know its correct or not but when I runt that code its give error 1.
  1. try  
  2. {  
  3. string xmlpo = "<ENVELOPE>" + "\r\n";  
  4. xmlpo += "<HEADER>" + "\r\n";  
  5. xmlpo += "<TALLYREQUEST>Import Data</TALLYREQUEST>" + "\r\n";  
  6. xmlpo += "</HEADER>" + "\r\n";  
  7. xmlpo += "<BODY>" + "\r\n";  
  8. xmlpo += "<IMPORTDATA>" + "\r\n";  
  9. xmlpo += "<REQUESTDESC>" + "\r\n";  
  10. xmlpo += "<REPORTNAME>Vouchers</REPORTNAME>" + "\r\n";  
  11. xmlpo += "<STATICVARIABLES>" + "\r\n";  
  12. xmlpo += "<SVCURRENTCOMPANY>Abc</SVCURRENTCOMPANY>" + "\r\n";  
  13. xmlpo += "</STATICVARIABLES>" + "\r\n";  
  14. xmlpo += "</REQUESTDESC>" + "\r\n";  
  15. xmlpo += "<REQUESTDATA>" + "\r\n";  
  16. xmlpo += "<TALLYMESSAGE xmlns:UDF='TallyUDF'>" + "\r\n";  
  17. xmlpo += "<VOUCHER REMOTEID='9536a79f - d21d - 48d5 - 968c - ecfe2j5c91cb - 00000678' VCHKEY='9536a79f - d21v - 48d5 - 968c - ecfe2e5c91cb - 0000aa44: 00000078' VCHTYPE='Purchase Order' ACTION='Create' OBJVIEW='Invoice Voucher View'>" + "\r\n";  
  18. xmlpo += "<ADDRESS.LIST TYPE='String'>" + "\r\n";  
  19. xmlpo += "<ADDRESS>testaddress1</ADDRESS>" + "\r\n";  
  20. xmlpo += "<ADDRESS>testaddress2</ADDRESS>" + "\r\n";  
  21. xmlpo += "</ADDRESS.LIST>" + "\r\n";  
  22. xmlpo += "<BASICBUYERADDRESS.LIST TYPE='String'>" + "\r\n";  
  23. xmlpo += "<BASICBUYERADDRESS>Warehouse Complex,</BASICBUYERADDRESS>" + "\r\n";  
  24. xmlpo += "<BASICBUYERADDRESS>Mumbai</BASICBUYERADDRESS>" + "\r\n";  
  25. xmlpo += "</BASICBUYERADDRESS.LIST>" + "\r\n";  
  26. xmlpo += "<OLDAUDITENTRYIDS.LIST TYPE='Number'>" + "\r\n";  
  27. xmlpo += "<OLDAUDITENTRYIDS> 201124739</OLDAUDITENTRYIDS>" + "\r\n";  
  28. xmlpo += "<OLDAUDITENTRYIDS>-1</OLDAUDITENTRYIDS>" + "\r\n";  
  29. xmlpo += "</OLDAUDITENTRYIDS.LIST>" + "\r\n";  
  30. xmlpo += "<DATE>20190504</DATE>" + "\r\n";  
  31. xmlpo += "<GUID>9536a79f-d51d-48d5-968c-ecfe2e5c91cb-00000678</GUID>" + "\r\n";  
  32. xmlpo += "<NARRATION>being items ordered to HQ</NARRATION>" + "\r\n";  
  33. xmlpo += "<COUNTRYOFRESIDENCE>Delhi</COUNTRYOFRESIDENCE>" + "\r\n";  
  34. xmlpo += "<PARTYNAME>Easy Co. Ltd.</PARTYNAME>" + "\r\n";  
  35. xmlpo += "<VOUCHERTYPENAME>Purchase Order</VOUCHERTYPENAME>" + "\r\n";  
  36. xmlpo += "<REFERENCE>LGM0119058523</REFERENCE>" + "\r\n";  
  37. xmlpo += "<VOUCHERNUMBER>99</VOUCHERNUMBER>" + "\r\n";  
  38. xmlpo += "<PARTYLEDGERNAME>Easy Co. Ltd.</PARTYLEDGERNAME>" + "\r\n";  
  39. xmlpo += "<BASICBASEPARTYNAME>Easy Co. Ltd.</BASICBASEPARTYNAME>" + "\r\n";  
  40. xmlpo += "<CSTFORMISSUETYPE/>" + "\r\n";  
  41. xmlpo += "<CSTFORMRECVTYPE/>" + "\r\n";  
  42. xmlpo += "<FBTPAYMENTTYPE>Default</FBTPAYMENTTYPE>" + "\r\n";  
  43. xmlpo += "<PERSISTEDVIEW>Invoice Voucher View</PERSISTEDVIEW>" + "\r\n";  
  44. xmlpo += "<CONSIGNEEGSTIN>27AANCS6E3ZP</CONSIGNEEGSTIN>" + "\r\n";  
  45. xmlpo += "<BASICBUYERNAME>ABC" + "\r\n";  
  46. xmlpo += "<BASICDUEDATEOFPYMT>180 Days</BASICDUEDATEOFPYMT>" + "\r\n";  
  47. xmlpo += "<VCHGSTCLASS/>" + "\r\n";  
  48. xmlpo += "<CONSIGNEESTATENAME>Palam</CONSIGNEESTATENAME>" + "\r\n";  
  49. xmlpo += "<ENTEREDBY>[email protected]</ENTEREDBY>" + "\r\n";  
  50. xmlpo += "<DIFFACTUALQTY>No</DIFFACTUALQTY>" + "\r\n";  
  51. xmlpo += "<ISMSTFROMSYNC>No</ISMSTFROMSYNC>" + "\r\n";  
  52. xmlpo += "<ASORIGINAL>No</ASORIGINAL>" + "\r\n";  
  53. xmlpo += "<AUDITED>No</AUDITED>" + "\r\n";  
  54. xmlpo += "<FORJOBCOSTING>No</FORJOBCOSTING>" + "\r\n";  
  55. xmlpo += "<ISOPTIONAL>No</ISOPTIONAL>" + "\r\n";  
  56. xmlpo += "<EFFECTIVEDATE>20190504</EFFECTIVEDATE>" + "\r\n";  
  57. xmlpo += "<USEFOREXCISE>No</USEFOREXCISE>" + "\r\n";  
  58. xmlpo += "<ISFORJOBWORKIN>No</ISFORJOBWORKIN>" + "\r\n";  
  59. xmlpo += "<ALLOWCONSUMPTION>No</ALLOWCONSUMPTION>" + "\r\n";  
  60. xmlpo += "<USEFORINTEREST>No</USEFORINTEREST>" + "\r\n";  
  61. xmlpo += "<USEFORGAINLOSS>No</USEFORGAINLOSS>" + "\r\n";  
  62. xmlpo += "<USEFORGODOWNTRANSFER>No</USEFORGODOWNTRANSFER>" + "\r\n";  
  63. xmlpo += "<USEFORCOMPOUND>No</USEFORCOMPOUND>" + "\r\n";  
  64. xmlpo += "<USEFORSERVICETAX>No</USEFORSERVICETAX>" + "\r\n";  
  65. xmlpo += "<ISEXCISEVOUCHER>No</ISEXCISEVOUCHER>" + "\r\n";  
  66. xmlpo += "<EXCISETAXOVERRIDE>No</EXCISETAXOVERRIDE>" + "\r\n";  
  67. xmlpo += "<USEFORTAXUNITTRANSFER>No</USEFORTAXUNITTRANSFER>" + "\r\n";  
  68. xmlpo += "<IGNOREPOSVALIDATION>No</IGNOREPOSVALIDATION>" + "\r\n";  
  69. xmlpo += "<EXCISEOPENING>No</EXCISEOPENING>" + "\r\n";  
  70. xmlpo += "<USEFORFINALPRODUCTION>No</USEFORFINALPRODUCTION>" + "\r\n";  
  71. xmlpo += "<ISTDSOVERRIDDEN>No</ISTDSOVERRIDDEN>" + "\r\n";  
  72. xmlpo += "<ISTCSOVERRIDDEN>No</ISTCSOVERRIDDEN>" + "\r\n";  
  73. xmlpo += "<ISTDSTCSCASHVCH>No</ISTDSTCSCASHVCH>" + "\r\n";  
  74. xmlpo += "<INCLUDEADVPYMTVCH>No</INCLUDEADVPYMTVCH>" + "\r\n";  
  75. xmlpo += "<ISSUBWORKSCONTRACT>No</ISSUBWORKSCONTRACT>" + "\r\n";  
  76. xmlpo += "<ISVATOVERRIDDEN>No</ISVATOVERRIDDEN>" + "\r\n";  
  77. xmlpo += "<IGNOREORIGVCHDATE>No</IGNOREORIGVCHDATE>" + "\r\n";  
  78. xmlpo += "<ISVATPAIDATCUSTOMS>No</ISVATPAIDATCUSTOMS>" + "\r\n";  
  79. xmlpo += "<ISDECLAREDTOCUSTOMS>No</ISDECLAREDTOCUSTOMS>" + "\r\n";  
  80. xmlpo += "<ISSERVICETAXOVERRIDDEN>No</ISSERVICETAXOVERRIDDEN>" + "\r\n";  
  81. xmlpo += "<ISISDVOUCHER>No</ISISDVOUCHER>" + "\r\n";  
  82. xmlpo += "<ISEXCISEOVERRIDDEN>No</ISEXCISEOVERRIDDEN>" + "\r\n";  
  83. xmlpo += "<ISEXCISESUPPLYVCH>No</ISEXCISESUPPLYVCH>" + "\r\n";  
  84. xmlpo += "<ISGSTOVERRIDDEN>No</ISGSTOVERRIDDEN>" + "\r\n";  
  85. xmlpo += "<GSTNOTEXPORTED>No</GSTNOTEXPORTED>" + "\r\n";  
  86. xmlpo += "<IGNOREGSTINVALIDATION>No</IGNOREGSTINVALIDATION>" + "\r\n";  
  87. xmlpo += "<ISVATPRINCIPALACCOUNT>No</ISVATPRINCIPALACCOUNT>" + "\r\n";  
  88. xmlpo += "<ISBOENOTAPPLICABLE>No</ISBOENOTAPPLICABLE>" + "\r\n";  
  89. xmlpo += "<ISSHIPPINGWITHINSTATE>No</ISSHIPPINGWITHINSTATE>" + "\r\n";  
  90. xmlpo += "<ISOVERSEASTOURISTTRANS>No</ISOVERSEASTOURISTTRANS>" + "\r\n";  
  91. xmlpo += "<ISDESIGNATEDZONEPARTY>No</ISDESIGNATEDZONEPARTY>" + "\r\n";  
  92. xmlpo += "<ISCANCELLED>No</ISCANCELLED>" + "\r\n";  
  93. xmlpo += "<HASCASHFLOW>No</HASCASHFLOW>" + "\r\n";  
  94. xmlpo += "<ISPOSTDATED>No</ISPOSTDATED>" + "\r\n";  
  95. xmlpo += "<USETRACKINGNUMBER>No</USETRACKINGNUMBER>" + "\r\n";  
  96. xmlpo += "<ISINVOICE>No</ISINVOICE>" + "\r\n";  
  97. xmlpo += "<MFGJOURNAL>No</MFGJOURNAL>" + "\r\n";  
  98. xmlpo += "<HASDISCOUNTS>No</HASDISCOUNTS>" + "\r\n";  
  99. xmlpo += "<ASPAYSLIP>No</ASPAYSLIP>" + "\r\n";  
  100. xmlpo += "<ISCOSTCENTRE>No</ISCOSTCENTRE>" + "\r\n";  
  101. xmlpo += "<ISSTXNONREALIZEDVCH>No</ISSTXNONREALIZEDVCH>" + "\r\n";  
  102. xmlpo += "<ISEXCISEMANUFACTURERON>No</ISEXCISEMANUFACTURERON>" + "\r\n";  
  103. xmlpo += "<ISBLANKCHEQUE>No</ISBLANKCHEQUE>" + "\r\n";  
  104. xmlpo += "<ISVOID>No</ISVOID>" + "\r\n";  
  105. xmlpo += "<ISONHOLD>No</ISONHOLD>" + "\r\n";  
  106. xmlpo += "<ORDERLINESTATUS>No</ORDERLINESTATUS>" + "\r\n";  
  107. xmlpo += "<VATISAGNSTCANCSALES>No</VATISAGNSTCANCSALES>" + "\r\n";  
  108. xmlpo += "<VATISPURCEXEMPTED>No</VATISPURCEXEMPTED>" + "\r\n";  
  109. xmlpo += "<ISVATRESTAXINVOICE>No</ISVATRESTAXINVOICE>" + "\r\n";  
  110. xmlpo += "<VATISASSESABLECALCVCH>No</VATISASSESABLECALCVCH>" + "\r\n";  
  111. xmlpo += "<ISVATDUTYPAID>Yes</ISVATDUTYPAID>" + "\r\n";  
  112. xmlpo += "<ISDELIVERYSAMEASCONSIGNEE>No</ISDELIVERYSAMEASCONSIGNEE>" + "\r\n";  
  113. xmlpo += "<ISDISPATCHSAMEASCONSIGNOR>No</ISDISPATCHSAMEASCONSIGNOR>" + "\r\n";  
  114. xmlpo += "<ISDELETED>No</ISDELETED>" + "\r\n";  
  115. xmlpo += "<CHANGEVCHMODE>No</CHANGEVCHMODE>" + "\r\n";  
  116. xmlpo += "<ALTERID> 4209</ALTERID>" + "\r\n";  
  117. xmlpo += "<MASTERID> 166</MASTERID>" + "\r\n";  
  118. xmlpo += "<VOUCHERKEY>25874159</VOUCHERKEY>" + "\r\n";  
  119. xmlpo += "<EXCLUDEDTAXATIONS.LIST> </EXCLUDEDTAXATIONS.LIST>" + "\r\n";  
  120. xmlpo += "<OLDAUDITENTRIES.LIST> </OLDAUDITENTRIES.LIST>" + "\r\n";  
  121. xmlpo += "<ACCOUNTAUDITENTRIES.LIST> </ACCOUNTAUDITENTRIES.LIST>" + "\r\n";  
  122. xmlpo += "<AUDITENTRIES.LIST> </AUDITENTRIES.LIST>" + "\r\n";  
  123. xmlpo += "<DUTYHEADDETAILS.LIST> </DUTYHEADDETAILS.LIST>" + "\r\n";  
  124. xmlpo += "<SUPPLEMENTARYDUTYHEADDETAILS.LIST> </SUPPLEMENTARYDUTYHEADDETAILS.LIST>" + "\r\n";  
  125. xmlpo += "<EWAYBILLDETAILS.LIST> </EWAYBILLDETAILS.LIST>" + "\r\n";  
  126. xmlpo += "<INVOICEDELNOTES.LIST> </INVOICEDELNOTES.LIST>" + "\r\n";  
  127. xmlpo += "<INVOICEORDERLIST.LIST> </INVOICEORDERLIST.LIST>" + "\r\n";  
  128. xmlpo += "<INVOICEINDENTLIST.LIST> </INVOICEINDENTLIST.LIST>" + "\r\n";  
  129. xmlpo += "<ATTENDANCEENTRIES.LIST> </ATTENDANCEENTRIES.LIST>" + "\r\n";  
  130. xmlpo += "<ORIGINVOICEDETAILS.LIST> </ORIGINVOICEDETAILS.LIST>" + "\r\n";  
  131. xmlpo += "<INVOICEEXPORTLIST.LIST> </INVOICEEXPORTLIST.LIST>" + "\r\n";  
  132. xmlpo += "<LEDGERENTRIES.LIST>" + "\r\n";  
  133. xmlpo += "<OLDAUDITENTRYIDS.LIST TYPE='Number'>" + "\r\n";  
  134. xmlpo += "<OLDAUDITENTRYIDS> 201724369</OLDAUDITENTRYIDS>" + "\r\n";  
  135. xmlpo += "<OLDAUDITENTRYIDS>-1</OLDAUDITENTRYIDS>" + "\r\n";  
  136. xmlpo += "</OLDAUDITENTRYIDS.LIST>" + "\r\n";  
  137. xmlpo += "<LEDGERNAME>Easy Co. Ltd.</LEDGERNAME>" + "\r\n";  
  138. xmlpo += "<GSTCLASS/>" + "\r\n";  
  139. xmlpo += "<ISDEEMEDPOSITIVE>No</ISDEEMEDPOSITIVE>" + "\r\n";  
  140. xmlpo += "<LEDGERFROMITEM>No</LEDGERFROMITEM>" + "\r\n";  
  141. xmlpo += "<REMOVEZEROENTRIES>No</REMOVEZEROENTRIES>" + "\r\n";  
  142. xmlpo += "<ISPARTYLEDGER>Yes</ISPARTYLEDGER>" + "\r\n";  
  143. xmlpo += "<ISLASTDEEMEDPOSITIVE>No</ISLASTDEEMEDPOSITIVE>" + "\r\n";  
  144. xmlpo += "<ISCAPVATTAXALTERED>No</ISCAPVATTAXALTERED>" + "\r\n";  
  145. xmlpo += "<ISCAPVATNOTCLAIMED>No</ISCAPVATNOTCLAIMED>" + "\r\n";  
  146. xmlpo += "<AMOUNT>28.22 USD @ ₹ 69.9001/ USD = ₹ 1972.58</AMOUNT>" + "\r\n";  
  147. xmlpo += "<SERVICETAXDETAILS.LIST> </SERVICETAXDETAILS.LIST>" + "\r\n";  
  148. xmlpo += "<BANKALLOCATIONS.LIST> </BANKALLOCATIONS.LIST>" + "\r\n";  
  149. xmlpo += "<BILLALLOCATIONS.LIST> </BILLALLOCATIONS.LIST>" + "\r\n";  
  150. xmlpo += "<INTERESTCOLLECTION.LIST> </INTERESTCOLLECTION.LIST>" + "\r\n";  
  151. xmlpo += "<OLDAUDITENTRIES.LIST> </OLDAUDITENTRIES.LIST>" + "\r\n";  
  152. xmlpo += "<ACCOUNTAUDITENTRIES.LIST> </ACCOUNTAUDITENTRIES.LIST>" + "\r\n";  
  153. xmlpo += "<AUDITENTRIES.LIST> </AUDITENTRIES.LIST>" + "\r\n";  
  154. xmlpo += "<INPUTCRALLOCS.LIST> </INPUTCRALLOCS.LIST>" + "\r\n";  
  155. xmlpo += "<DUTYHEADDETAILS.LIST> </DUTYHEADDETAILS.LIST>" + "\r\n";  
  156. xmlpo += "<EXCISEDUTYHEADDETAILS.LIST> </EXCISEDUTYHEADDETAILS.LIST>" + "\r\n";  
  157. xmlpo += "<RATEDETAILS.LIST> </RATEDETAILS.LIST>" + "\r\n";  
  158. xmlpo += "<SUMMARYALLOCS.LIST> </SUMMARYALLOCS.LIST>" + "\r\n";  
  159. xmlpo += "<STPYMTDETAILS.LIST> </STPYMTDETAILS.LIST>" + "\r\n";  
  160. xmlpo += "<EXCISEPAYMENTALLOCATIONS.LIST> </EXCISEPAYMENTALLOCATIONS.LIST>" + "\r\n";  
  161. xmlpo += "<TAXBILLALLOCATIONS.LIST> </TAXBILLALLOCATIONS.LIST>" + "\r\n";  
  162. xmlpo += "<TAXOBJECTALLOCATIONS.LIST> </TAXOBJECTALLOCATIONS.LIST>" + "\r\n";  
  163. xmlpo += "<TDSEXPENSEALLOCATIONS.LIST> </TDSEXPENSEALLOCATIONS.LIST>" + "\r\n";  
  164. xmlpo += "<VATSTATUTORYDETAILS.LIST> </VATSTATUTORYDETAILS.LIST>" + "\r\n";  
  165. xmlpo += "<COSTTRACKALLOCATIONS.LIST> </COSTTRACKALLOCATIONS.LIST>" + "\r\n";  
  166. xmlpo += "<REFVOUCHERDETAILS.LIST> </REFVOUCHERDETAILS.LIST>" + "\r\n";  
  167. xmlpo += "<INVOICEWISEDETAILS.LIST> </INVOICEWISEDETAILS.LIST>" + "\r\n";  
  168. xmlpo += "<VATITCDETAILS.LIST> </VATITCDETAILS.LIST>" + "\r\n";  
  169. xmlpo += "<ADVANCETAXDETAILS.LIST> </ADVANCETAXDETAILS.LIST>" + "\r\n";  
  170. xmlpo += "</LEDGERENTRIES.LIST>" + "\r\n";  
  171. xmlpo += "<ALLINVENTORYENTRIES.LIST>" + "\r\n";  
  172. xmlpo += "<STOCKITEMNAME>football</STOCKITEMNAME>" + "\r\n";  
  173. xmlpo += "<ISDEEMEDPOSITIVE>Yes</ISDEEMEDPOSITIVE>" + "\r\n";  
  174. xmlpo += "<ISLASTDEEMEDPOSITIVE>Yes</ISLASTDEEMEDPOSITIVE>" + "\r\n";  
  175. xmlpo += "<ISAUTONEGATE>No</ISAUTONEGATE>" + "\r\n";  
  176. xmlpo += "<ISCUSTOMSCLEARANCE>No</ISCUSTOMSCLEARANCE>" + "\r\n";  
  177. xmlpo += "<ISTRACKCOMPONENT>No</ISTRACKCOMPONENT>" + "\r\n";  
  178. xmlpo += "<ISTRACKPRODUCTION>No</ISTRACKPRODUCTION>" + "\r\n";  
  179. xmlpo += "<ISPRIMARYITEM>No</ISPRIMARYITEM>" + "\r\n";  
  180. xmlpo += "<ISSCRAP>No</ISSCRAP>" + "\r\n";  
  181. xmlpo += "<RATE>4.36 USD = ₹ 304.76/pcs</RATE>" + "\r\n";  
  182. xmlpo += "<AMOUNT>-17.44 USD @ ₹ 69.90/ USD = -₹ 1219.06</AMOUNT>" + "\r\n";  
  183. xmlpo += "<ACTUALQTY> 4 pcs</ACTUALQTY>" + "\r\n";  
  184. xmlpo += "<BILLEDQTY> 4 pcs</BILLEDQTY>" + "\r\n";  
  185. xmlpo += "<BATCHALLOCATIONS.LIST>" + "\r\n";  
  186. xmlpo += "<GODOWNNAME>Main Location</GODOWNNAME>" + "\r\n";  
  187. xmlpo += "<BATCHNAME>Primary Batch</BATCHNAME>" + "\r\n";  
  188. xmlpo += "<DESTINATIONGODOWNNAME>Main Location</DESTINATIONGODOWNNAME>" + "\r\n";  
  189. xmlpo += "<INDENTNO/>" + "\r\n";  
  190. xmlpo += "<ORDERNO>LGM011905925184</ORDERNO>" + "\r\n";  
  191. xmlpo += "<TRACKINGNUMBER/>" + "\r\n";  
  192. xmlpo += "<DYNAMICCSTISCLEARED>No</DYNAMICCSTISCLEARED>" + "\r\n";  
  193. xmlpo += "<AMOUNT>-17.44 USD @ ₹ 69.90/ USD = -₹ 1219.06</AMOUNT>" + "\r\n";  
  194. xmlpo += "<ADDLEXPENSEAMOUNT>0.00 USD @ ₹ 69.90/ USD = -₹ 0.00</ADDLEXPENSEAMOUNT>" + "\r\n";  
  195. xmlpo += "<ACTUALQTY> 4 pcs</ACTUALQTY>" + "\r\n";  
  196. xmlpo += "<BILLEDQTY> 4 pcs</BILLEDQTY>" + "\r\n";  
  197. xmlpo += "<ORDERDUEDATE JD='43588' P='180 Days'>180 Days</ORDERDUEDATE>" + "\r\n";  
  198. xmlpo += "<ADDITIONALDETAILS.LIST> </ADDITIONALDETAILS.LIST>" + "\r\n";  
  199. xmlpo += "<VOUCHERCOMPONENTLIST.LIST> </VOUCHERCOMPONENTLIST.LIST>" + "\r\n";  
  200. xmlpo += "</BATCHALLOCATIONS.LIST>" + "\r\n";  
  201. xmlpo += "<ACCOUNTINGALLOCATIONS.LIST>" + "\r\n";  
  202. xmlpo += "<OLDAUDITENTRYIDS.LIST TYPE='Number'>" + "\r\n";  
  203. xmlpo += "<OLDAUDITENTRYIDS> 201724739</OLDAUDITENTRYIDS>" + "\r\n";  
  204. xmlpo += "<OLDAUDITENTRYIDS>-1</OLDAUDITENTRYIDS>" + "\r\n";  
  205. xmlpo += "</OLDAUDITENTRYIDS.LIST>" + "\r\n";  
  206. xmlpo += "<LEDGERNAME>Purchase Import</LEDGERNAME>" + "\r\n";  
  207. xmlpo += "<GSTCLASS/>" + "\r\n";  
  208. xmlpo += "<ISDEEMEDPOSITIVE>Yes</ISDEEMEDPOSITIVE>" + "\r\n";  
  209. xmlpo += "<LEDGERFROMITEM>No</LEDGERFROMITEM>" + "\r\n";  
  210. xmlpo += "<REMOVEZEROENTRIES>No</REMOVEZEROENTRIES>" + "\r\n";  
  211. xmlpo += "<ISPARTYLEDGER>No</ISPARTYLEDGER>" + "\r\n";  
  212. xmlpo += "<ISLASTDEEMEDPOSITIVE>Yes</ISLASTDEEMEDPOSITIVE>" + "\r\n";  
  213. xmlpo += "<ISCAPVATTAXALTERED>No</ISCAPVATTAXALTERED>" + "\r\n";  
  214. xmlpo += "<ISCAPVATNOTCLAIMED>No</ISCAPVATNOTCLAIMED>" + "\r\n";  
  215. xmlpo += "<AMOUNT>-17.44 USD @ ₹ 69.90/ USD = -₹ 1219.06</AMOUNT>" + "\r\n";  
  216. xmlpo += "<SERVICETAXDETAILS.LIST> </SERVICETAXDETAILS.LIST>" + "\r\n";  
  217. xmlpo += "<BANKALLOCATIONS.LIST> </BANKALLOCATIONS.LIST>" + "\r\n";  
  218. xmlpo += "<BILLALLOCATIONS.LIST> </BILLALLOCATIONS.LIST>" + "\r\n";  
  219. xmlpo += "<INTERESTCOLLECTION.LIST> </INTERESTCOLLECTION.LIST>" + "\r\n";  
  220. xmlpo += "<OLDAUDITENTRIES.LIST> </OLDAUDITENTRIES.LIST>" + "\r\n";  
  221. xmlpo += "<ACCOUNTAUDITENTRIES.LIST> </ACCOUNTAUDITENTRIES.LIST>" + "\r\n";  
  222. xmlpo += "<AUDITENTRIES.LIST> </AUDITENTRIES.LIST>" + "\r\n";  
  223. xmlpo += "<INPUTCRALLOCS.LIST> </INPUTCRALLOCS.LIST>" + "\r\n";  
  224. xmlpo += "<DUTYHEADDETAILS.LIST> </DUTYHEADDETAILS.LIST>" + "\r\n";  
  225. xmlpo += "<EXCISEDUTYHEADDETAILS.LIST> </EXCISEDUTYHEADDETAILS.LIST>" + "\r\n";  
  226. xmlpo += "<RATEDETAILS.LIST> </RATEDETAILS.LIST>" + "\r\n";  
  227. xmlpo += "<SUMMARYALLOCS.LIST> </SUMMARYALLOCS.LIST>" + "\r\n";  
  228. xmlpo += "<STPYMTDETAILS.LIST> </STPYMTDETAILS.LIST>" + "\r\n";  
  229. xmlpo += "<EXCISEPAYMENTALLOCATIONS.LIST> </EXCISEPAYMENTALLOCATIONS.LIST>" + "\r\n";  
  230. xmlpo += "<TAXBILLALLOCATIONS.LIST> </TAXBILLALLOCATIONS.LIST>" + "\r\n";  
  231. xmlpo += "<TAXOBJECTALLOCATIONS.LIST> </TAXOBJECTALLOCATIONS.LIST>" + "\r\n";  
  232. xmlpo += "<TDSEXPENSEALLOCATIONS.LIST> </TDSEXPENSEALLOCATIONS.LIST>" + "\r\n";  
  233. xmlpo += "<VATSTATUTORYDETAILS.LIST> </VATSTATUTORYDETAILS.LIST>" + "\r\n";  
  234. xmlpo += "<COSTTRACKALLOCATIONS.LIST> </COSTTRACKALLOCATIONS.LIST>" + "\r\n";  
  235. xmlpo += "<REFVOUCHERDETAILS.LIST> </REFVOUCHERDETAILS.LIST>" + "\r\n";  
  236. xmlpo += "<INVOICEWISEDETAILS.LIST> </INVOICEWISEDETAILS.LIST>" + "\r\n";  
  237. xmlpo += "<VATITCDETAILS.LIST> </VATITCDETAILS.LIST>" + "\r\n";  
  238. xmlpo += "<ADVANCETAXDETAILS.LIST> </ADVANCETAXDETAILS.LIST>" + "\r\n";  
  239. xmlpo += "</ACCOUNTINGALLOCATIONS.LIST>" + "\r\n";  
  240. xmlpo += "<DUTYHEADDETAILS.LIST> </DUTYHEADDETAILS.LIST>" + "\r\n";  
  241. xmlpo += "<SUPPLEMENTARYDUTYHEADDETAILS.LIST> </SUPPLEMENTARYDUTYHEADDETAILS.LIST>" + "\r\n";  
  242. xmlpo += "<TAXOBJECTALLOCATIONS.LIST> </TAXOBJECTALLOCATIONS.LIST>" + "\r\n";  
  243. xmlpo += "<REFVOUCHERDETAILS.LIST> </REFVOUCHERDETAILS.LIST>" + "\r\n";  
  244. xmlpo += "<EXCISEALLOCATIONS.LIST> </EXCISEALLOCATIONS.LIST>" + "\r\n";  
  245. xmlpo += "<EXPENSEALLOCATIONS.LIST> </EXPENSEALLOCATIONS.LIST>" + "\r\n";  
  246. xmlpo += "</ALLINVENTORYENTRIES.LIST>" + "\r\n";  
  247. xmlpo += "<ALLINVENTORYENTRIES.LIST>" + "\r\n";  
  248. xmlpo += "<STOCKITEMNAME>Hockey</STOCKITEMNAME>" + "\r\n";  
  249. xmlpo += "<ISDEEMEDPOSITIVE>Yes</ISDEEMEDPOSITIVE>" + "\r\n";  
  250. xmlpo += "<ISLASTDEEMEDPOSITIVE>Yes</ISLASTDEEMEDPOSITIVE>" + "\r\n";  
  251. xmlpo += "<ISAUTONEGATE>No</ISAUTONEGATE>" + "\r\n";  
  252. xmlpo += "<ISCUSTOMSCLEARANCE>No</ISCUSTOMSCLEARANCE>" + "\r\n";  
  253. xmlpo += "<ISTRACKCOMPONENT>No</ISTRACKCOMPONENT>" + "\r\n";  
  254. xmlpo += "<ISTRACKPRODUCTION>No</ISTRACKPRODUCTION>" + "\r\n";  
  255. xmlpo += "<ISPRIMARYITEM>No</ISPRIMARYITEM>" + "\r\n";  
  256. xmlpo += "<ISSCRAP>No</ISSCRAP>" + "\r\n";  
  257. xmlpo += "<RATE>10.78 USD = ₹ 753.52/pcs</RATE>" + "\r\n";  
  258. xmlpo += "<AMOUNT>-10.78 USD @ ₹ 69.90/ USD = -₹ 753.52</AMOUNT>" + "\r\n";  
  259. xmlpo += "<ACTUALQTY> 1 pcs</ACTUALQTY>" + "\r\n";  
  260. xmlpo += "<BILLEDQTY> 1 pcs</BILLEDQTY>" + "\r\n";  
  261. xmlpo += "<BATCHALLOCATIONS.LIST>" + "\r\n";  
  262. xmlpo += "<GODOWNNAME>Main Location</GODOWNNAME>" + "\r\n";  
  263. xmlpo += "<BATCHNAME>Primary Batch</BATCHNAME>" + "\r\n";  
  264. xmlpo += "<DESTINATIONGODOWNNAME>Main Location</DESTINATIONGODOWNNAME>" + "\r\n";  
  265. xmlpo += "<INDENTNO/>" + "\r\n";  
  266. xmlpo += "<ORDERNO>LGM0119058547</ORDERNO>" + "\r\n";  
  267. xmlpo += "<TRACKINGNUMBER/>" + "\r\n";  
  268. xmlpo += "<DYNAMICCSTISCLEARED>No</DYNAMICCSTISCLEARED>" + "\r\n";  
  269. xmlpo += "<AMOUNT>-10.78 USD @ ₹ 69.90/ USD = -₹ 753.52</AMOUNT>" + "\r\n";  
  270. xmlpo += "<ADDLEXPENSEAMOUNT>0.00 USD @ ₹ 69.90/ USD = ₹ 0.00</ADDLEXPENSEAMOUNT>" + "\r\n";  
  271. xmlpo += "<ACTUALQTY> 1 pcs</ACTUALQTY>" + "\r\n";  
  272. xmlpo += "<BILLEDQTY> 1 pcs</BILLEDQTY>" + "\r\n";  
  273. xmlpo += "<ORDERDUEDATE JD='43588' P='180 Days'>180 Days</ORDERDUEDATE>" + "\r\n";  
  274. xmlpo += "<ADDITIONALDETAILS.LIST> </ADDITIONALDETAILS.LIST>" + "\r\n";  
  275. xmlpo += "<VOUCHERCOMPONENTLIST.LIST> </VOUCHERCOMPONENTLIST.LIST>" + "\r\n";  
  276. xmlpo += "</BATCHALLOCATIONS.LIST>" + "\r\n";  
  277. xmlpo += "<ACCOUNTINGALLOCATIONS.LIST>" + "\r\n";  
  278. xmlpo += "<OLDAUDITENTRYIDS.LIST TYPE='Number'>" + "\r\n";  
  279. xmlpo += "<OLDAUDITENTRYIDS> 201724739</OLDAUDITENTRYIDS>" + "\r\n";  
  280. xmlpo += "<OLDAUDITENTRYIDS>-1</OLDAUDITENTRYIDS>" + "\r\n";  
  281. xmlpo += "</OLDAUDITENTRYIDS.LIST>" + "\r\n";  
  282. xmlpo += "<LEDGERNAME>Purchase Import</LEDGERNAME>" + "\r\n";  
  283. xmlpo += "<GSTCLASS/>" + "\r\n";  
  284. xmlpo += "<ISDEEMEDPOSITIVE>Yes</ISDEEMEDPOSITIVE>" + "\r\n";  
  285. xmlpo += "<LEDGERFROMITEM>No</LEDGERFROMITEM>" + "\r\n";  
  286. xmlpo += "<REMOVEZEROENTRIES>No</REMOVEZEROENTRIES>" + "\r\n";  
  287. xmlpo += "<ISPARTYLEDGER>No</ISPARTYLEDGER>" + "\r\n";  
  288. xmlpo += "<ISLASTDEEMEDPOSITIVE>Yes</ISLASTDEEMEDPOSITIVE>" + "\r\n";  
  289. xmlpo += "<ISCAPVATTAXALTERED>No</ISCAPVATTAXALTERED>" + "\r\n";  
  290. xmlpo += "<ISCAPVATNOTCLAIMED>No</ISCAPVATNOTCLAIMED>" + "\r\n";  
  291. xmlpo += "<AMOUNT>-10.78 USD @ ₹ 69.90/ USD = -₹ 753.52</AMOUNT>" + "\r\n";  
  292. xmlpo += "<SERVICETAXDETAILS.LIST> </SERVICETAXDETAILS.LIST>" + "\r\n";  
  293. xmlpo += "<BANKALLOCATIONS.LIST> </BANKALLOCATIONS.LIST>" + "\r\n";  
  294. xmlpo += "<BILLALLOCATIONS.LIST> </BILLALLOCATIONS.LIST>" + "\r\n";  
  295. xmlpo += "<INTERESTCOLLECTION.LIST> </INTERESTCOLLECTION.LIST>" + "\r\n";  
  296. xmlpo += "<OLDAUDITENTRIES.LIST> </OLDAUDITENTRIES.LIST>" + "\r\n";  
  297. xmlpo += "<ACCOUNTAUDITENTRIES.LIST> </ACCOUNTAUDITENTRIES.LIST>" + "\r\n";  
  298. xmlpo += "<AUDITENTRIES.LIST> </AUDITENTRIES.LIST>" + "\r\n";  
  299. xmlpo += "<INPUTCRALLOCS.LIST> </INPUTCRALLOCS.LIST>" + "\r\n";  
  300. xmlpo += "<DUTYHEADDETAILS.LIST> </DUTYHEADDETAILS.LIST>" + "\r\n";  
  301. xmlpo += "<EXCISEDUTYHEADDETAILS.LIST> </EXCISEDUTYHEADDETAILS.LIST>" + "\r\n";  
  302. xmlpo += "<RATEDETAILS.LIST> </RATEDETAILS.LIST>" + "\r\n";  
  303. xmlpo += "<SUMMARYALLOCS.LIST> </SUMMARYALLOCS.LIST>" + "\r\n";  
  304. xmlpo += "<STPYMTDETAILS.LIST> </STPYMTDETAILS.LIST>" + "\r\n";  
  305. xmlpo += "<EXCISEPAYMENTALLOCATIONS.LIST> </EXCISEPAYMENTALLOCATIONS.LIST>" + "\r\n";  
  306. xmlpo += "<TAXBILLALLOCATIONS.LIST> </TAXBILLALLOCATIONS.LIST>" + "\r\n";  
  307. xmlpo += "<TAXOBJECTALLOCATIONS.LIST> </TAXOBJECTALLOCATIONS.LIST>" + "\r\n";  
  308. xmlpo += "<TDSEXPENSEALLOCATIONS.LIST> </TDSEXPENSEALLOCATIONS.LIST>" + "\r\n";  
  309. xmlpo += "<VATSTATUTORYDETAILS.LIST> </VATSTATUTORYDETAILS.LIST>" + "\r\n";  
  310. xmlpo += "<COSTTRACKALLOCATIONS.LIST> </COSTTRACKALLOCATIONS.LIST>" + "\r\n";  
  311. xmlpo += "<REFVOUCHERDETAILS.LIST> </REFVOUCHERDETAILS.LIST>" + "\r\n";  
  312. xmlpo += "<INVOICEWISEDETAILS.LIST> </INVOICEWISEDETAILS.LIST>" + "\r\n";  
  313. xmlpo += "<VATITCDETAILS.LIST> </VATITCDETAILS.LIST>" + "\r\n";  
  314. xmlpo += "<ADVANCETAXDETAILS.LIST> </ADVANCETAXDETAILS.LIST>" + "\r\n";  
  315. xmlpo += "</ACCOUNTINGALLOCATIONS.LIST>" + "\r\n";  
  316. xmlpo += "<DUTYHEADDETAILS.LIST> </DUTYHEADDETAILS.LIST>" + "\r\n";  
  317. xmlpo += "<SUPPLEMENTARYDUTYHEADDETAILS.LIST> </SUPPLEMENTARYDUTYHEADDETAILS.LIST>" + "\r\n";  
  318. xmlpo += "<TAXOBJECTALLOCATIONS.LIST> </TAXOBJECTALLOCATIONS.LIST>" + "\r\n";  
  319. xmlpo += "<REFVOUCHERDETAILS.LIST> </REFVOUCHERDETAILS.LIST>" + "\r\n";  
  320. xmlpo += "<EXCISEALLOCATIONS.LIST> </EXCISEALLOCATIONS.LIST>" + "\r\n";  
  321. xmlpo += "<EXPENSEALLOCATIONS.LIST> </EXPENSEALLOCATIONS.LIST>" + "\r\n";  
  322. xmlpo += "</ALLINVENTORYENTRIES.LIST>" + "\r\n";  
  323. xmlpo += "<PAYROLLMODEOFPAYMENT.LIST> </PAYROLLMODEOFPAYMENT.LIST>" + "\r\n";  
  324. xmlpo += "<ATTDRECORDS.LIST> </ATTDRECORDS.LIST>" + "\r\n";  
  325. xmlpo += "<GSTEWAYCONSIGNORADDRESS.LIST> </GSTEWAYCONSIGNORADDRESS.LIST>" + "\r\n";  
  326. xmlpo += "<GSTEWAYCONSIGNEEADDRESS.LIST> </GSTEWAYCONSIGNEEADDRESS.LIST>" + "\r\n";  
  327. xmlpo += "<TEMPGSTRATEDETAILS.LIST> </TEMPGSTRATEDETAILS.LIST>" + "\r\n";  
  328. xmlpo += "</VOUCHER>" + "\r\n";  
  329. xmlpo += "</TALLYMESSAGE>" + "\r\n";  
  330. xmlpo += "<TALLYMESSAGE xmlns:UDF='TallyUDF'>" + "\r\n";  
  331. xmlpo += "<COMPANY>" + "\r\n";  
  332. xmlpo += "<REMOTECMPINFO.LIST MERGE='Yes'>" + "\r\n";  
  333. xmlpo += "<NAME>9536a79f-d21d-48d5-968c-evbfg2e5c91cb</NAME>" + "\r\n";  
  334. xmlpo += "<REMOTECMPNAME>ABC</REMOTECMPNAME>" + "\r\n";  
  335. xmlpo += "<REMOTECMPSTATE>Maharashtra</REMOTECMPSTATE>" + "\r\n";  
  336. xmlpo += "</REMOTECMPINFO.LIST>" + "\r\n";  
  337. xmlpo += "<REMOTECMPINFO.LIST MERGE='Yes'>" + "\r\n";  
  338. xmlpo += "<NAME>d775d1ad-cd56-4a75-b8c9-gt21b4c05d0e</NAME>" + "\r\n";  
  339. xmlpo += "<REMOTECMPNAME>ABC</REMOTECMPNAME>" + "\r\n";  
  340. xmlpo += "<REMOTECMPSTATE>Maharashtra</REMOTECMPSTATE>" + "\r\n";  
  341. xmlpo += "</REMOTECMPINFO.LIST>" + "\r\n";  
  342. xmlpo += "</COMPANY>" + "\r\n";  
  343. xmlpo += "</TALLYMESSAGE>" + "\r\n";  
  344. xmlpo += "<TALLYMESSAGE xmlns:UDF='TallyUDF'>" + "\r\n";  
  345. xmlpo += "<COMPANY>" + "\r\n";  
  346. xmlpo += "<REMOTECMPINFO.LIST MERGE='Yes'>" + "\r\n";  
  347. xmlpo += "<NAME>9536a79f-d21d-48d5-968c-ecfe2e5c91cb</NAME>" + "\r\n";  
  348. xmlpo += "<REMOTECMPNAME>ABC</REMOTECMPNAME>" + "\r\n";  
  349. xmlpo += "<REMOTECMPSTATE>Maharashtra</REMOTECMPSTATE>" + "\r\n";  
  350. xmlpo += "</REMOTECMPINFO.LIST>" + "\r\n";  
  351. xmlpo += "<REMOTECMPINFO.LIST MERGE='Yes'>" + "\r\n";  
  352. xmlpo += "<NAME>d775d1ad-cd56-4a75-b8c9-cb21b4c05d0e</NAME>" + "\r\n";  
  353. xmlpo += "<REMOTECMPNAME>ABC</REMOTECMPNAME>" + "\r\n";  
  354. xmlpo += "<REMOTECMPSTATE>Maharashtra</REMOTECMPSTATE>" + "\r\n";  
  355. xmlpo += "</REMOTECMPINFO.LIST>" + "\r\n";  
  356. xmlpo += "</COMPANY>" + "\r\n";  
  357. xmlpo += "</TALLYMESSAGE>" + "\r\n";  
  358. xmlpo += "</REQUESTDATA>" + "\r\n";  
  359. xmlpo += "</IMPORTDATA>" + "\r\n";  
  360. xmlpo += "</BODY>" + "\r\n";  
  361. xmlpo += "</ENVELOPE>" + "\r\n";  
  362. HttpWebRequest httpWebRequest = (HttpWebRequest)WebRequest.Create("http://localhost:9000/");  
  363. httpWebRequest.Method = "POST";  
  364. httpWebRequest.ContentLength = xmlpo.Length;  
  365. httpWebRequest.ContentType = "application/x-www-form-urlencoded";  
  366. StreamWriter streamWriter = new StreamWriter(httpWebRequest.GetRequestStream());  
  367. streamWriter.Write(xmlpo);  
  368. streamWriter.Close();  
  369. string result;  
  370. HttpWebResponse objResponse = (HttpWebResponse)httpWebRequest.GetResponse();  
  371. using (StreamReader sr = new StreamReader(objResponse.GetResponseStream()))  
  372. {  
  373. result = sr.ReadToEnd();  
  374. sr.Close();  
  375. }  
  376. MessageBox.Show(result);  
  377. }  
  378. catch (Exception ex)  
  379. {  
  380. MessageBox.Show(ex.Message, ex.StackTrace);  
  381. }  
If this XML is wrong please suggest a correct one or where I can find the XML formate for other tally import entries.

Answers (1)