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.

index.purchases.details.js 52KB

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