Built files from Bizgaze WebServer
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

invoicemanager.js 44KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701
  1. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  2. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  3. return new (P || (P = Promise))(function (resolve, reject) {
  4. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  5. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  6. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  7. step((generator = generator.apply(thisArg, _arguments || [])).next());
  8. });
  9. };
  10. var Bizgaze;
  11. (function (Bizgaze) {
  12. let Apps;
  13. (function (Apps) {
  14. let Transact;
  15. (function (Transact) {
  16. let Managers;
  17. (function (Managers) {
  18. class InvoiceManager extends Unibase.Platform.Core.BaseManager {
  19. getItemById(itemid) {
  20. return __awaiter(this, void 0, void 0, function* () {
  21. const url = 'apis/v4/unibase/transact/items/getitem/itemid/' + itemid;
  22. return yield this.dataHelper().getAsync(url).then(function (response) {
  23. if (response.result !== null)
  24. response.result = JSON.parse(response.result);
  25. return response;
  26. });
  27. });
  28. }
  29. getLatestMrpByItemId(itemid) {
  30. return __awaiter(this, void 0, void 0, function* () {
  31. const url = 'apis/v4/bizgaze/transact/pricelists/getlatestmrp/itemid/' + itemid;
  32. return yield this.dataHelper().getAsync(url).then(function (response) {
  33. if (response.result != "" && response.result !== null)
  34. response.result = JSON.parse(response.result);
  35. return response;
  36. });
  37. });
  38. }
  39. getMrpById(mrpid) {
  40. return __awaiter(this, void 0, void 0, function* () {
  41. const url = 'apis/v4/bizgaze/transact/pricelists/getmrp/mrpid/' + mrpid;
  42. return yield this.dataHelper().getAsync(url).then(function (response) {
  43. if (response.result !== null)
  44. response.result = JSON.parse(response.result);
  45. return response;
  46. });
  47. });
  48. }
  49. getlobsummary() {
  50. return __awaiter(this, void 0, void 0, function* () {
  51. const url = 'apis/v4/bizgaze/transact/invoices/loboutstandingsummary';
  52. return yield this.dataHelper().getAsync(url).then(function (response) {
  53. if (response.result != "" && response.result !== null)
  54. response.result = JSON.parse(response.result);
  55. return response;
  56. });
  57. });
  58. }
  59. GetMrpandBatchQty(url) {
  60. return __awaiter(this, void 0, void 0, function* () {
  61. return yield this.dataHelper().getAsync(url).then(function (response) {
  62. if (response.result !== null)
  63. response.result = JSON.parse(response.result);
  64. return response;
  65. });
  66. });
  67. }
  68. getItemDetails(obj) {
  69. return __awaiter(this, void 0, void 0, function* () {
  70. const url = 'apis/v4/bizgaze/transact/invoices/getItemDetails';
  71. return yield this.dataHelper().postAsync(url, obj).then(function (response) {
  72. if (response.result !== null)
  73. response.result = JSON.parse(response.result);
  74. return response;
  75. });
  76. });
  77. }
  78. getItemDetailsList(obj) {
  79. return __awaiter(this, void 0, void 0, function* () {
  80. const url = 'apis/v4/bizgaze/transact/invoices/getItemDetailsList/List';
  81. return yield this.dataHelper().postAsync(url, obj).then(function (response) {
  82. if (response.result !== null)
  83. response.result = JSON.parse(response.result);
  84. return response;
  85. });
  86. });
  87. }
  88. gettaxpercentages(taxgroupid, branchid) {
  89. return __awaiter(this, void 0, void 0, function* () {
  90. const url = 'apis/v4/bizgaze/transact/tax/gettaxpercentages/taxgroupid/' + taxgroupid + '/branchid/' + branchid;
  91. return yield this.dataHelper().getAsync(url).then(function (response) {
  92. if (response.result !== null)
  93. response.result = JSON.parse(response.result);
  94. return response;
  95. });
  96. });
  97. }
  98. getPendingSalesInvoicesByContactId(ContactId, IsOverDue) {
  99. return __awaiter(this, void 0, void 0, function* () {
  100. const url = 'apis/v4/bizgaze/transact/invoices/getpendingsalesinvoicesbycontactid/contactid/' + ContactId + '/isoverdue/' + IsOverDue;
  101. return yield this.dataHelper().getAsync(url).then(function (response) {
  102. if (response.result != "" && response.result !== null)
  103. response.result = JSON.parse(response.result);
  104. return response;
  105. });
  106. });
  107. }
  108. getCreditNotesByContactId(ContactId) {
  109. return __awaiter(this, void 0, void 0, function* () {
  110. const url = 'apis/v4/bizgaze/transact/invoices/getcreditnotesbycontactid/contactid/' + ContactId;
  111. return yield this.dataHelper().getAsync(url).then(function (response) {
  112. if (response.result != "" && response.result !== null)
  113. response.result = JSON.parse(response.result);
  114. return response;
  115. });
  116. });
  117. }
  118. getRecentFiveInvoicesBySpocId(OrgContactId) {
  119. return __awaiter(this, void 0, void 0, function* () {
  120. const url = 'apis/v4/bizgaze/transact/invoices/getrecentfiveinvoicesbyspocid/orgcontactid/' + OrgContactId;
  121. return yield this.dataHelper().getAsync(url).then(function (response) {
  122. if (response.result != "" && response.result !== null)
  123. response.result = JSON.parse(response.result);
  124. return response;
  125. });
  126. });
  127. }
  128. getLastFiveClearedInvoices(OrgContactId, OrgId) {
  129. return __awaiter(this, void 0, void 0, function* () {
  130. const url = 'apis/v4/bizgaze/transact/invoices/getlastfiveclearedinvoices/orgcontactid/' + OrgContactId + '/orgid/' + OrgId;
  131. return yield this.dataHelper().getAsync(url).then(function (response) {
  132. if (response.result != "" && response.result !== null)
  133. response.result = JSON.parse(response.result);
  134. return response;
  135. });
  136. });
  137. }
  138. getorganization(OrgId) {
  139. return __awaiter(this, void 0, void 0, function* () {
  140. const url = 'apis/v4/bizgaze/crm/organization/getorganization/organizationid/' + OrgId;
  141. return yield this.dataHelper().getAsync(url).then(function (response) {
  142. if (response.result !== null && response.result != "")
  143. response.result = JSON.parse(response.result);
  144. return response;
  145. });
  146. });
  147. }
  148. getorgcontact(orgcontactid) {
  149. return __awaiter(this, void 0, void 0, function* () {
  150. const url = 'apis/v4/bizgaze/crm/orgcontacts/getorgcontact/orgcontactid/' + orgcontactid;
  151. return yield this.dataHelper().getAsync(url).then(function (response) {
  152. if (response.result !== null && response.result != "")
  153. response.result = JSON.parse(response.result);
  154. return response;
  155. });
  156. });
  157. }
  158. getbranche(branchid) {
  159. return __awaiter(this, void 0, void 0, function* () {
  160. const url = 'apis/v4/bizgaze/crm/companies/getbranchbybranchid/branchid/' + branchid;
  161. return yield this.dataHelper().getAsync(url).then(function (response) {
  162. if (response.result !== null)
  163. response.result = JSON.parse(response.result);
  164. return response;
  165. });
  166. });
  167. }
  168. getInvoiceDetails(invoiceid) {
  169. return __awaiter(this, void 0, void 0, function* () {
  170. const url = 'apis/v4/bizgaze/transact/invoices/getinvoice/invoiceid/' + invoiceid;
  171. return yield this.dataHelper().getAsync(url).then(function (response) {
  172. if (response.result !== null)
  173. response.result = JSON.parse(response.result);
  174. return response;
  175. });
  176. });
  177. }
  178. getInvoiceItems(url) {
  179. return __awaiter(this, void 0, void 0, function* () {
  180. return yield this.dataHelper().getAsync(url).then(function (response) {
  181. if (response.result !== null)
  182. response.result = JSON.parse(response.result);
  183. return response;
  184. });
  185. });
  186. }
  187. getMrps(itemid, dctypeid, branchid) {
  188. return __awaiter(this, void 0, void 0, function* () {
  189. const url = 'apis/v4/bizgaze/transact/pricelist/getmrpslistbyitemid/itemid/' + itemid + '/dctype/' + dctypeid + "/branchid/" + branchid;
  190. return yield this.dataHelper().getAsync(url).then(function (response) {
  191. if (response.result !== null)
  192. response.result = JSON.parse(response.result);
  193. return response;
  194. });
  195. });
  196. }
  197. getBatches(itemid, dctypeid, branchid) {
  198. return __awaiter(this, void 0, void 0, function* () {
  199. const url = 'apis/v4/bizgaze/transact/pricelist/getbatchlistbyitemid/itemid/' + itemid + '/dctype/' + dctypeid + "/branchid/" + branchid;
  200. return yield this.dataHelper().getAsync(url).then(function (response) {
  201. if (response.result !== null)
  202. response.result = JSON.parse(response.result);
  203. return response;
  204. });
  205. });
  206. }
  207. getPendingDiscountsForInvoice(dcid) {
  208. return __awaiter(this, void 0, void 0, function* () {
  209. const url = 'apis/v4/bizgaze/transact/invoices/getpendingdiscountsforinvoice/dcid/' + dcid;
  210. return yield this.dataHelper().getAsync(url).then(function (response) {
  211. if (response.result !== null)
  212. response.result = JSON.parse(response.result);
  213. return response;
  214. });
  215. });
  216. }
  217. getOrderDcDetails(url) {
  218. return __awaiter(this, void 0, void 0, function* () {
  219. return yield this.dataHelper().getAsync(url).then(function (response) {
  220. if (response.result !== null)
  221. response.result = JSON.parse(response.result);
  222. return response;
  223. });
  224. });
  225. }
  226. getorderbranchsettings(OrderId) {
  227. return __awaiter(this, void 0, void 0, function* () {
  228. const url = 'apis/v4/bizgaze/transact/orders/getordersettings/orderid/' + OrderId;
  229. return yield this.dataHelper().getAsync(url).then(function (response) {
  230. if (response.result !== null)
  231. response.result = JSON.parse(response.result);
  232. return response;
  233. });
  234. });
  235. }
  236. getItemSetting(itemid, branchid, typeid) {
  237. return __awaiter(this, void 0, void 0, function* () {
  238. const url = 'apis/v4/bizgaze/transact/items/getitemsetting/itemid/' + itemid + '/branchid/' + branchid + '/type/' + typeid;
  239. return yield this.dataHelper().getAsync(url).then(function (response) {
  240. if (response.result !== null)
  241. response.result = JSON.parse(response.result);
  242. return response;
  243. });
  244. });
  245. }
  246. GetSampleInvoiceNo(invoiceNo, invidate, seriesid) {
  247. return __awaiter(this, void 0, void 0, function* () {
  248. const url = 'apis/v4/bizgaze/transact/invoices/getsampleinvoiceno/invoiceno/' + invoiceNo + "/invoicedate/" + invidate + "/seriesid/" + seriesid;
  249. return yield this.dataHelper().getAsync(url).then(function (response) {
  250. return response;
  251. });
  252. });
  253. }
  254. gettemplates(installedappid) {
  255. return __awaiter(this, void 0, void 0, function* () {
  256. const url = 'apis/v4/unibase/platform/templates/gettemplatesbyapp/installedappid/' + installedappid;
  257. return yield this.dataHelper().getAsync(url).then(function (response) {
  258. if (response.result !== null)
  259. response.result = JSON.parse(response.result);
  260. return response;
  261. });
  262. });
  263. }
  264. GetTemplateSetting(installedappid, branchid, lobid) {
  265. return __awaiter(this, void 0, void 0, function* () {
  266. const url = 'apis/v4/bizgaze/transact/automationrules/gettemplatesetting/installedappid/' + installedappid + '/branchid/' + branchid + '/lobid/' + lobid;
  267. return yield this.dataHelper().getAsync(url).then(function (response) {
  268. if (response.result !== null)
  269. response.result = JSON.parse(response.result);
  270. return response;
  271. });
  272. });
  273. }
  274. getTempNextNumber(SeriesId, date) {
  275. return __awaiter(this, void 0, void 0, function* () {
  276. const url = 'apis/v4/bizgaze/transact/invoices/getinvoicenextnumber/seriesid/' + SeriesId + '/invoicedate/' + date;
  277. return yield this.dataHelper().getAsync(url).then(function (response) {
  278. if (response.result !== "" && response.result !== null) {
  279. response.result = JSON.parse(response.result);
  280. }
  281. return response;
  282. });
  283. });
  284. }
  285. getprintinvoice(invoiceid, isprintpreview, ispos) {
  286. return __awaiter(this, void 0, void 0, function* () {
  287. const url = 'apis/v4/bizgaze/transact/invoices/getprintinvoice/invoiceid/' + invoiceid + '/isprintpreview/' + isprintpreview + '/ispos/' + ispos;
  288. return yield this.dataHelper().getAsync(url).then(function (response) {
  289. if (response.result !== null) {
  290. response.result = JSON.parse(response.result);
  291. }
  292. return response;
  293. });
  294. });
  295. }
  296. updateinvoiceseries(invoiceid, seriesid, invoiceno, templateid) {
  297. return __awaiter(this, void 0, void 0, function* () {
  298. const url = 'apis/v4/bizgaze/transact/invoices/updateinvoiceseries/invoiceid/' + invoiceid + '/seriesid/' + seriesid + '/invoiceno/' + invoiceno + '/templateid/' + templateid;
  299. return yield this.dataHelper().postAsync(url, null).then(function (response) {
  300. if (response.result !== null) {
  301. response.result = JSON.parse(response.result);
  302. }
  303. return response;
  304. });
  305. });
  306. }
  307. Updateconnecteddc(dcid, invoiceid) {
  308. return __awaiter(this, void 0, void 0, function* () {
  309. const url = 'apis/v4/bizgaze/transact/invoices/Updateconnecteddc/dcid/' + dcid + '/invoiceid/' + invoiceid;
  310. return yield this.dataHelper().postAsync(url, null).then(function (response) {
  311. if (response.result !== null) {
  312. response.result = JSON.parse(response.result);
  313. }
  314. return response;
  315. });
  316. });
  317. }
  318. UpdateInvoice(InvoiceId, salespersonid) {
  319. return __awaiter(this, void 0, void 0, function* () {
  320. const url = 'apis/v4/bizgaze/transact/invoices/updateinvoicesalesperson/invoiceid/' + InvoiceId + '/salespersonid/' + salespersonid;
  321. return yield this.dataHelper().postAsync(url, null).then(function (response) {
  322. if (response.result !== null) {
  323. response.result = JSON.parse(response.result);
  324. }
  325. return response;
  326. });
  327. });
  328. }
  329. UpdateInvoiceItemTaxAllocs(obj) {
  330. return __awaiter(this, void 0, void 0, function* () {
  331. const url = 'apis/v4/bizgaze/transact/invoices/updateinvoiceitemtaxallocs';
  332. return yield this.dataHelper().postAsync(url, obj).then(function (response) {
  333. if (response.result !== null) {
  334. response.result = JSON.parse(response.result);
  335. }
  336. return response;
  337. });
  338. });
  339. }
  340. getinvoiceitems(invoiceid, itemid) {
  341. return __awaiter(this, void 0, void 0, function* () {
  342. const url = 'apis/v4/bizgaze/transact/invoices/getinvoiceitemsbyinvoiceid/invoiceid/' + invoiceid + '/isreturn/false/itemid' + itemid;
  343. return yield this.dataHelper().getAsync(url).then(function (response) {
  344. if (response.result !== null) {
  345. response.result = JSON.parse(response.result);
  346. }
  347. return response;
  348. });
  349. });
  350. }
  351. getBatchByBatchId(BatchId) {
  352. return __awaiter(this, void 0, void 0, function* () {
  353. const url = 'apis/v4/bizgaze/transact/pricelists/getbatch/batchid/' + BatchId;
  354. return yield this.dataHelper().getAsync(url).then(function (response) {
  355. if (response.result !== null) {
  356. response.result = JSON.parse(response.result);
  357. }
  358. return response;
  359. });
  360. });
  361. }
  362. getPlanVolume(ItemId, OrganizationId, InvoiceApplyType) {
  363. return __awaiter(this, void 0, void 0, function* () {
  364. const url = 'apis/v4/bizgaze/transact/offers/getplanvolumebyitem/itemid/' + ItemId + '/organizationid/' + OrganizationId + '/type/' + InvoiceApplyType;
  365. return yield this.dataHelper().getAsync(url).then(function (response) {
  366. if (response.result !== null) {
  367. response.result = JSON.parse(response.result);
  368. }
  369. return response;
  370. });
  371. });
  372. }
  373. getJournalWallets(invoicedate, invoiceid, contactid, invoicetype, lobId) {
  374. return __awaiter(this, void 0, void 0, function* () {
  375. const url = 'apis/v4/bizgaze/transact/invoices/getjournalwallets/invoicedate/' + invoicedate + '/invoiceid/' + invoiceid + '/contactid/' + contactid + '/invoicetype/' + invoicetype + '/lobid/' + lobId;
  376. return yield this.dataHelper().getAsync(url).then(function (response) {
  377. if (response.result !== null && response.result !== "") {
  378. response.result = JSON.parse(response.result);
  379. }
  380. return response;
  381. });
  382. });
  383. }
  384. getJournalAllocs(invoiceid) {
  385. return __awaiter(this, void 0, void 0, function* () {
  386. const url = 'apis/v4/bizgaze/transact/invoices/getjournalallocs/invoiceid/' + invoiceid;
  387. return yield this.dataHelper().getAsync(url).then(function (response) {
  388. if (response.result !== null) {
  389. response.result = JSON.parse(response.result);
  390. }
  391. return response;
  392. });
  393. });
  394. }
  395. getSeries(installedappid, branchid, lobid) {
  396. return __awaiter(this, void 0, void 0, function* () {
  397. const url = 'apis/v4/bizgaze/transact/seriessettings/getseriessettings/lobid/' + lobid + '/branchid/' + branchid + '/installedappid/' + installedappid;
  398. return yield this.dataHelper().getAsync(url).then(function (response) {
  399. if (response.result !== null) {
  400. response.result = JSON.parse(response.result);
  401. }
  402. return response;
  403. });
  404. });
  405. }
  406. getInvoiceItemDetails(invoiceitemid, taxgroupid) {
  407. return __awaiter(this, void 0, void 0, function* () {
  408. const url = 'apis/v4/bizgaze/transact/invoices/getinvoiceitemdetails/invoiceitemid/' + invoiceitemid + '/taxgroupid/' + taxgroupid;
  409. return yield this.dataHelper().getAsync(url).then(function (response) {
  410. if (response.result !== null) {
  411. response.result = JSON.parse(response.result);
  412. }
  413. return response;
  414. });
  415. });
  416. }
  417. getCustomerTurnOver(organizationid, excludeinvoiceid, invoicedate, applytype) {
  418. return __awaiter(this, void 0, void 0, function* () {
  419. const url = 'apis/v4/bizgaze/transact/invoices/getcustomerturnover/organizationid/' + organizationid + '/excludeinvoiceid/' + excludeinvoiceid + "/invoicedate/" + invoicedate + "/applytype/" + applytype;
  420. return yield this.dataHelper().getAsync(url).then(function (response) {
  421. if (response.result !== null) {
  422. response.result = JSON.parse(response.result);
  423. }
  424. return response;
  425. });
  426. });
  427. }
  428. getTcsDeclaration(partitionid) {
  429. return __awaiter(this, void 0, void 0, function* () {
  430. const url = 'apis/v4/bizgaze/transact/invoices/gettcsdeclarationbypartitionid/partitionid/' + partitionid;
  431. return yield this.dataHelper().getAsync(url).then(function (response) {
  432. if (response.result !== null && response.result !== "") {
  433. response.result = JSON.parse(response.result);
  434. }
  435. return response;
  436. });
  437. });
  438. }
  439. saveTcsDeclaration(obj) {
  440. return __awaiter(this, void 0, void 0, function* () {
  441. const url = 'apis/v4/bizgaze/transact/invoices/savetcsdeclaration';
  442. return yield this.dataHelper().postAsync(url, obj).then(function (response) {
  443. if (response.result !== null) {
  444. response.result = JSON.parse(response.result);
  445. }
  446. return response;
  447. });
  448. });
  449. }
  450. GetInvoicePermissions(invoicetypeid) {
  451. return __awaiter(this, void 0, void 0, function* () {
  452. const url = 'apis/v4/bizgaze/transact/invoices/getinvoicepermissions/invoicetypeid/' + invoicetypeid;
  453. return yield this.dataHelper().getAsync(url).then(function (response) {
  454. if (response.result !== null) {
  455. response.result = JSON.parse(response.result);
  456. }
  457. return response;
  458. });
  459. });
  460. }
  461. GetTenants(tenantid) {
  462. return __awaiter(this, void 0, void 0, function* () {
  463. const url = 'apis/v4/bizgaze/transact/invoices/gettenant/tenantid/' + tenantid;
  464. return yield this.dataHelper().getAsync(url).then(function (response) {
  465. if (response.result !== null) {
  466. response.result = JSON.parse(response.result);
  467. }
  468. return response;
  469. });
  470. });
  471. }
  472. refreshInvoiceTypes() {
  473. return __awaiter(this, void 0, void 0, function* () {
  474. const url = 'apis/v4/bizgaze/transact/invoices/refreshinvoicetypes/np';
  475. return yield this.dataHelper().postAsync(url, "{}").then(function (response) {
  476. if (response.result !== null) {
  477. response.result = JSON.parse(response.result);
  478. }
  479. return response;
  480. });
  481. });
  482. }
  483. GetTCSTaxgroupforReturn(invoiceid) {
  484. return __awaiter(this, void 0, void 0, function* () {
  485. const url = 'apis/v4/bizgaze/transact/invoices/gettcstaxgroupforreturn/invoiceid/' + invoiceid;
  486. return yield this.dataHelper().getAsync(url).then(function (response) {
  487. if (response.result !== null) {
  488. response.result = JSON.parse(response.result);
  489. }
  490. return response;
  491. });
  492. });
  493. }
  494. GetFirstPendingInvoicesBySalesPerson(salespersonid) {
  495. return __awaiter(this, void 0, void 0, function* () {
  496. const url = 'apis/v4/bizgaze/transact/invoices/getfirstpendinginvoices/salespersionid/' + salespersonid;
  497. return yield this.dataHelper().getAsync(url).then(function (response) {
  498. if (response.result !== null) {
  499. response.result = JSON.parse(response.result);
  500. }
  501. return response;
  502. });
  503. });
  504. }
  505. changeManagers(postdata) {
  506. return __awaiter(this, void 0, void 0, function* () {
  507. const url = 'apis/v4/bizgaze/transact/invoices/changemanagers';
  508. return yield this.dataHelper().postAsync(url, postdata).then(function (response) {
  509. if (response.result !== null)
  510. response.result = JSON.parse(response.result);
  511. return response;
  512. });
  513. });
  514. }
  515. changeManager(obj) {
  516. return __awaiter(this, void 0, void 0, function* () {
  517. const url = 'apis/v4/bizgaze/transact/invoices/updatemanagerdetails';
  518. return yield this.dataHelper().postAsync(url, obj).then(function (response) {
  519. if (response.result !== null)
  520. response.result = JSON.parse(response.result);
  521. return response;
  522. });
  523. });
  524. }
  525. getdcbydcno(dcno) {
  526. return __awaiter(this, void 0, void 0, function* () {
  527. const url = 'apis/v4/bizgaze/transact/dc/getdcbydcno/dcno/' + dcno;
  528. return yield this.dataHelper().getAsync(url).then(function (response) {
  529. if (response.result !== null && response.result !== '')
  530. response.result = JSON.parse(response.result);
  531. return response;
  532. });
  533. });
  534. }
  535. getproductsbyLobid(lobid) {
  536. return __awaiter(this, void 0, void 0, function* () {
  537. const url = 'apis/v4/bizgaze/transact/items/getproductsbylobid/lobid/' + lobid;
  538. return yield this.dataHelper().getAsync(url).then(function (response) {
  539. if (response.result !== null)
  540. response.result = JSON.parse(response.result);
  541. return response;
  542. });
  543. });
  544. }
  545. getItemsUnitPriceByProductId(productId, contactId, term) {
  546. return __awaiter(this, void 0, void 0, function* () {
  547. const url = 'apis/v4/bizgaze/transact/items/getitemsunitpricebyproductid/productid/' + productId + '/contactid/' + contactId + '/term/' + term;
  548. return yield this.dataHelper().getAsync(url).then(function (response) {
  549. if (response.result !== null)
  550. response.result = JSON.parse(response.result);
  551. return response;
  552. });
  553. });
  554. }
  555. getpricebyProductId(itemid, lobid, productId) {
  556. return __awaiter(this, void 0, void 0, function* () {
  557. const url = 'apis/v4/bizgaze/transact/pricelists/getlatestprices/itemids/' + itemid + '/lobid/' + lobid + '/productid/' + productId;
  558. return yield this.dataHelper().getAsync(url).then(function (response) {
  559. if (response.result !== null)
  560. response.result = JSON.parse(response.result);
  561. return response;
  562. });
  563. });
  564. }
  565. getitemname(searchtext) {
  566. return __awaiter(this, void 0, void 0, function* () {
  567. const url = 'apis/v4/bizgaze/transact/items/getitemsbyterm/term/' + searchtext;
  568. return yield this.dataHelper().getAsync(url).then(function (response) {
  569. if (response.result !== null)
  570. response.result = JSON.parse(response.result);
  571. return response;
  572. });
  573. });
  574. }
  575. getOffersByItemIdWithPrice(postdata) {
  576. return __awaiter(this, void 0, void 0, function* () {
  577. const url = 'apis/v4/bizgaze/transact/items/getrelatedofferwithprice';
  578. return yield this.dataHelper().postAsync(url, postdata).then(function (response) {
  579. if (response.result !== null)
  580. response.result = JSON.parse(response.result);
  581. return response;
  582. });
  583. });
  584. }
  585. getInvoiceByDc(DcId) {
  586. return __awaiter(this, void 0, void 0, function* () {
  587. const url = 'apis/v4/bizgaze/transact/invoices/getinvoicebydc/dcid/' + DcId;
  588. return yield this.dataHelper().getAsync(url).then(function (response) {
  589. if (response.result !== null && response.result !== "") {
  590. response.result = JSON.parse(response.result);
  591. }
  592. return response;
  593. });
  594. });
  595. }
  596. loadEbs(url1) {
  597. return __awaiter(this, void 0, void 0, function* () {
  598. const url = url1;
  599. return yield this.dataHelper().getAsync(url).then(function (response) {
  600. if (response.result != "" && response.result !== null)
  601. response.result = JSON.parse(response.result);
  602. return response;
  603. });
  604. });
  605. }
  606. getIsEnableSalesPipeline(url) {
  607. return __awaiter(this, void 0, void 0, function* () {
  608. return yield this.dataHelper().getAsync(url).then(function (response) {
  609. if (response.result !== null)
  610. response.result = JSON.parse(response.result);
  611. return response;
  612. });
  613. });
  614. }
  615. getPendingInvoicesByOrganizationName(OrganizationName) {
  616. return __awaiter(this, void 0, void 0, function* () {
  617. const url = 'apis/v4/bizgaze/transact/invoices/getpendinginvoicesbyorganizationname/organizationname/' + OrganizationName;
  618. return yield this.dataHelper().getAsync(url).then(function (response) {
  619. if (response.result != "" && response.result !== null)
  620. response.result = JSON.parse(response.result);
  621. return response;
  622. });
  623. });
  624. }
  625. getGSTRReport(gstno) {
  626. return __awaiter(this, void 0, void 0, function* () {
  627. var fromdate = Unibase.Platform.Helpers.NavigationHelper.commonFilter_FromDate;
  628. var todate = Unibase.Platform.Helpers.NavigationHelper.commonFilter_ToDate;
  629. var fromdatestring = moment(fromdate, "YYYY/MM/DD").format("YYYY-MM-DD");
  630. var todatestring = moment(todate, "YYYY/MM/DD").format("YYYY-MM-DD");
  631. const url = 'apis/v4/bizgaze/transact/invoices/exportgstr1returndetails/gstno/' + gstno + '/fromdate/' + fromdatestring + '/todate/' + todatestring;
  632. return yield this.dataHelper().getAsync(url).then(function (response) {
  633. if (response.result !== null) {
  634. response.result = JSON.parse(response.result);
  635. }
  636. return response;
  637. });
  638. });
  639. }
  640. refreshTaxclassifications() {
  641. return __awaiter(this, void 0, void 0, function* () {
  642. var fromdate = Unibase.Platform.Helpers.NavigationHelper.commonFilter_FromDate;
  643. var todate = Unibase.Platform.Helpers.NavigationHelper.commonFilter_ToDate;
  644. var fromdatestring = moment(fromdate, "YYYY/MM/DD").format("YYYY-MM-DD");
  645. var todatestring = moment(todate, "YYYY/MM/DD").format("YYYY-MM-DD");
  646. const url = 'apis/v4/bizgaze/transact/invoices/refreshtaxclassificaions/fromdate/' + fromdatestring + '/todate/' + todatestring;
  647. return yield this.dataHelper().postAsync(url, null).then(function (response) {
  648. if (response.result !== null) {
  649. response.result = JSON.parse(response.result);
  650. }
  651. return response;
  652. });
  653. });
  654. }
  655. RefreshEInvoice(irn) {
  656. return __awaiter(this, void 0, void 0, function* () {
  657. const url = 'apis/v4/bizgaze/transactintegrations/einvoice/refresheinvoices/irn/' + irn;
  658. return yield this.dataHelper().postAsync(url, null).then(function (response) {
  659. if (response.result !== null)
  660. response.result = JSON.parse(response.result);
  661. return response;
  662. });
  663. });
  664. }
  665. getInvoiceByorder(orderid) {
  666. return __awaiter(this, void 0, void 0, function* () {
  667. const url = 'apis/v4/bizgaze/transact/invoices/getinvoicesbyorderid/orderid/' + orderid;
  668. return yield this.dataHelper().getAsync(url).then(function (response) {
  669. if (response.result !== null && response.result !== "") {
  670. response.result = JSON.parse(response.result);
  671. }
  672. return response;
  673. });
  674. });
  675. }
  676. getbulkprint(fromdate, todate, salespersonid, organizationid, invoicetype) {
  677. return __awaiter(this, void 0, void 0, function* () {
  678. debugger;
  679. var fromdatestring = moment(fromdate, "YYYY/MM/DD").format("YYYY-MM-DD");
  680. var todatestring = moment(todate, "YYYY/MM/DD").format("YYYY-MM-DD");
  681. const url = 'apis/v4/bizgaze/transact/invoices/getbulkinvoiceprint/organizationid/' + organizationid + '/salespersonid/' + salespersonid + '/fromdate/' + fromdatestring + '/todate/' + todatestring + '/invoicetype/' + invoicetype;
  682. return yield this.dataHelper().getAsync(url).then(function (response) {
  683. debugger;
  684. if (response.result !== null) {
  685. response.result = JSON.parse(response.result);
  686. }
  687. return response;
  688. });
  689. });
  690. }
  691. static Instance() {
  692. if (this._instance === undefined)
  693. this._instance = new InvoiceManager();
  694. return this._instance;
  695. }
  696. }
  697. Managers.InvoiceManager = InvoiceManager;
  698. })(Managers = Transact.Managers || (Transact.Managers = {}));
  699. })(Transact = Apps.Transact || (Apps.Transact = {}));
  700. })(Apps = Bizgaze.Apps || (Bizgaze.Apps = {}));
  701. })(Bizgaze || (Bizgaze = {}));