Built files from Bizgaze WebServer
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

pricelistmanager.js 10KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172
  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 PriceListManager extends Unibase.Platform.Core.BaseManager {
  19. saveMrp(obj) {
  20. return __awaiter(this, void 0, void 0, function* () {
  21. const url = 'apis/v4/bizgaze/transact/pricelists/savemrp';
  22. return yield this.dataHelper().postAsync(url, obj).then(function (response) {
  23. return response;
  24. });
  25. });
  26. }
  27. getItem(itemid) {
  28. return __awaiter(this, void 0, void 0, function* () {
  29. const url = 'apis/v4/unibase/transact/items/getitem/itemid/' + itemid;
  30. return yield this.dataHelper().getAsync(url).then(function (response) {
  31. if (response.result !== null)
  32. response.result = JSON.parse(response.result);
  33. return response;
  34. });
  35. });
  36. }
  37. editMrp(MrpId) {
  38. return __awaiter(this, void 0, void 0, function* () {
  39. const url = 'apis/v4/bizgaze/transact/pricelists/getmrp/mrpid/' + MrpId;
  40. return yield this.dataHelper().getAsync(url).then(function (response) {
  41. if (response.result !== null)
  42. response.result = JSON.parse(response.result);
  43. return response;
  44. });
  45. });
  46. }
  47. exportList(PriceListId) {
  48. return __awaiter(this, void 0, void 0, function* () {
  49. const url = 'apis/v4/bizgaze/transact/pricelist/export/pricelistid/' + PriceListId;
  50. return yield this.dataHelper().getAsync(url).then(function (response) {
  51. if (response.result !== null)
  52. response.result = JSON.parse(response.result);
  53. return response;
  54. });
  55. });
  56. }
  57. saveBatch(obj) {
  58. return __awaiter(this, void 0, void 0, function* () {
  59. const url = 'apis/v4/bizgaze/transact/pricelists/savebatch';
  60. return yield this.dataHelper().postAsync(url, obj).then(function (response) {
  61. return response;
  62. });
  63. });
  64. }
  65. getbatch(batchid) {
  66. return __awaiter(this, void 0, void 0, function* () {
  67. const url = 'apis/v4/bizgaze/transact/pricelist/getbatch/batchid/' + batchid;
  68. return yield this.dataHelper().getAsync(url).then(function (response) {
  69. if (response.result !== null && response.result !== '')
  70. response.result = JSON.parse(response.result);
  71. return response;
  72. });
  73. });
  74. }
  75. getpricecodes(lobid) {
  76. return __awaiter(this, void 0, void 0, function* () {
  77. const url = 'apis/v4/bizgaze/transact/pricelists/pricecode/' + lobid;
  78. return yield this.dataHelper().getAsync(url).then(function (response) {
  79. return response;
  80. });
  81. });
  82. }
  83. getPriceCodeByContact(ContactId, LobId) {
  84. return __awaiter(this, void 0, void 0, function* () {
  85. const url = 'apis/v4/bizgaze/transact/pricelist/getpricecodebycontact/contactid/' + ContactId + '/lobid/' + LobId;
  86. return yield this.dataHelper().getAsync(url).then(function (response) {
  87. if (response.result !== null && response.result != "")
  88. response.result = JSON.parse(response.result);
  89. return response;
  90. });
  91. });
  92. }
  93. getpricelists(pricelistid) {
  94. return __awaiter(this, void 0, void 0, function* () {
  95. const url = 'apis/v4/bizgaze/transact/pricelists/pricelist/' + pricelistid;
  96. return yield this.dataHelper().getAsync(url).then(function (response) {
  97. return response;
  98. });
  99. });
  100. }
  101. postdatafilter(request) {
  102. return __awaiter(this, void 0, void 0, function* () {
  103. const url = 'apis/v4/bizgaze/transact/pricelists/savepricelist';
  104. return yield this.dataHelper().postAsync(url, request).then(function (response) {
  105. return response;
  106. });
  107. });
  108. }
  109. pricelistvalues(request) {
  110. return __awaiter(this, void 0, void 0, function* () {
  111. const url = 'apis/v4/bizgaze/transact/pricelists/savepricevalues';
  112. return yield this.dataHelper().postAsync(url, request).then(function (response) {
  113. Unibase.Apps.Transact.Controls.CreatePriceList.Instance().editPriceList(Number($("#gridPager2").find('.pagination').find(".active").text()) - 1, 2, "");
  114. return response;
  115. });
  116. });
  117. }
  118. CreatePriceListItems(voucherid, contactid, page, searchtext) {
  119. return __awaiter(this, void 0, void 0, function* () {
  120. const url = 'apis/v4/bizgaze/transact/pricelists/getpricelistitems/id/' + voucherid + '/page/' + page + '/rows/10/query/' + searchtext;
  121. return yield this.dataHelper().getAsync(url).then(function (response) {
  122. if (response.result !== null && response.result != "")
  123. response.result = JSON.parse(response.result);
  124. return response;
  125. });
  126. });
  127. }
  128. EditPriceListItems(voucherid, contactid, page, searchtext) {
  129. return __awaiter(this, void 0, void 0, function* () {
  130. const url = 'apis/v4/bizgaze/transact/pricelists/pricelistitems/id/' + voucherid + '/page/' + page + '/rows/10/query/' + searchtext;
  131. return yield this.dataHelper().getAsync(url).then(function (response) {
  132. return response;
  133. });
  134. });
  135. }
  136. getlobs(ContactId) {
  137. return __awaiter(this, void 0, void 0, function* () {
  138. const url = 'apis/v4/bizgaze/transact/automationrules/getruleautotaggroups/' + ContactId;
  139. return yield this.dataHelper().getAsync(url).then(function (response) {
  140. return JSON.parse(response.result);
  141. });
  142. });
  143. }
  144. saveContactDefault(obj) {
  145. return __awaiter(this, void 0, void 0, function* () {
  146. const url = 'apis/v4/bizgaze/transact/pricelists/contactdefault';
  147. return yield this.dataHelper().postAsync(url, obj).then(function (response) {
  148. return response;
  149. });
  150. });
  151. }
  152. getPriceValue(itemid) {
  153. return __awaiter(this, void 0, void 0, function* () {
  154. const url = 'apis/v4/bizgaze/transact/pricelist/getlatestpricevalue/itemid/' + itemid + '/mrpid/0/lobid/0';
  155. return yield this.dataHelper().getAsync(url).then(function (response) {
  156. if (response.result !== null && response.result !== '')
  157. response.result = JSON.parse(response.result);
  158. return response;
  159. });
  160. });
  161. }
  162. static Instance() {
  163. if (this._instance === undefined)
  164. this._instance = new Bizgaze.Apps.Transact.Managers.PriceListManager();
  165. return this._instance;
  166. }
  167. }
  168. Managers.PriceListManager = PriceListManager;
  169. })(Managers = Transact.Managers || (Transact.Managers = {}));
  170. })(Transact = Apps.Transact || (Apps.Transact = {}));
  171. })(Apps = Bizgaze.Apps || (Bizgaze.Apps = {}));
  172. })(Bizgaze || (Bizgaze = {}));