Built files from Bizgaze WebServer
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

estimatemanager.js 8.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  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 EstimateManager extends Unibase.Platform.Core.BaseManager {
  19. getEstimateItems(EstimateId) {
  20. return __awaiter(this, void 0, void 0, function* () {
  21. const url = 'apis/v4/bizgaze/transact/estimates/getestimateitembyid/estimateid/' + EstimateId;
  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. getEstimateItem(EstimateItemId) {
  30. return __awaiter(this, void 0, void 0, function* () {
  31. const url = 'apis/v4/bizgaze/transact/estimates/getestimateitem/estimateitemid/' + EstimateItemId;
  32. return yield this.dataHelper().getAsync(url).then(function (response) {
  33. if (response.result !== null)
  34. response.result = JSON.parse(response.result);
  35. return response;
  36. });
  37. });
  38. }
  39. managePrice(obj) {
  40. return __awaiter(this, void 0, void 0, function* () {
  41. const url = 'apis/v4/bizgaze/transact/estimates/manageprice';
  42. return yield this.dataHelper().postAsync(url, obj).then(function (response) {
  43. return response;
  44. });
  45. });
  46. }
  47. getEstimate(EstimateId) {
  48. return __awaiter(this, void 0, void 0, function* () {
  49. const url = 'apis/v4/bizgaze/transact/estimates/getestimate/id/' + EstimateId;
  50. return yield this.dataHelper().getAsync(url).then(function (response) {
  51. if (response.result != "" && response.result !== null)
  52. response.result = JSON.parse(response.result);
  53. return response;
  54. });
  55. });
  56. }
  57. estimatePrint(EstimateId, TemplateId) {
  58. return __awaiter(this, void 0, void 0, function* () {
  59. const url = 'apis/v4/bizgaze/transact/estimate/getestimatehtml/estimateid/' + EstimateId + '/templateid/' + TemplateId;
  60. return yield this.dataHelper().getAsync(url).then(function (response) {
  61. if (response.result !== null && response.result !== "")
  62. response.result = JSON.parse(response.result);
  63. return response;
  64. });
  65. });
  66. }
  67. getEstimatePermissions() {
  68. return __awaiter(this, void 0, void 0, function* () {
  69. const url = 'apis/v4/bizgaze/transact/estimates/getsalesestimatepermissions';
  70. return yield this.dataHelper().getAsync(url).then(function (response) {
  71. if (response.result !== null)
  72. response.result = JSON.parse(response.result);
  73. return response;
  74. });
  75. });
  76. }
  77. adjustEstimateItem(EstimateItemId) {
  78. return __awaiter(this, void 0, void 0, function* () {
  79. const url = 'apis/v4/bizgaze/transact/estimates/adjustestimateitem/estimateitemid/' + EstimateItemId;
  80. return yield this.dataHelper().postAsync(url, EstimateItemId).then(function (response) {
  81. if (response.result !== null && response.result != "")
  82. response.result = JSON.parse(response.result);
  83. return response;
  84. });
  85. });
  86. }
  87. voidEstimate(EstimateId) {
  88. return __awaiter(this, void 0, void 0, function* () {
  89. const url = 'apis/v4/bizgaze/transact/estimates/voidestimate/estimateid/' + EstimateId;
  90. return yield this.dataHelper().postAsync(url, EstimateId).then(function (response) {
  91. if (response.result !== null && response.result != "")
  92. response.result = JSON.parse(response.result);
  93. return response;
  94. });
  95. });
  96. }
  97. confirmEstimate(EstimateId) {
  98. return __awaiter(this, void 0, void 0, function* () {
  99. const url = 'apis/v4/bizgaze/transact/estimates/confirmestimate/estimateid/' + EstimateId;
  100. return yield this.dataHelper().postAsync(url, EstimateId).then(function (response) {
  101. if (response.result !== null && response.result != "")
  102. response.result = JSON.parse(response.result);
  103. return response;
  104. });
  105. });
  106. }
  107. getLeadDetails(LeadId, LobId, OrderTypeId) {
  108. return __awaiter(this, void 0, void 0, function* () {
  109. const url = 'apis/v4/bizgaze/transact/estimates/getleaddetails/leadid/' + LeadId + '/lobid/' + LobId + '/ordertypeid/' + OrderTypeId + '/branchid/0';
  110. return yield this.dataHelper().getAsync(url).then(function (response) {
  111. if (response.result != null && response.result != "")
  112. response.result = JSON.parse(response.result);
  113. return response;
  114. });
  115. });
  116. }
  117. getLeadByLeadId(LeadId) {
  118. return __awaiter(this, void 0, void 0, function* () {
  119. const url = 'apis/v4/bizgaze/crm/leads/getleadbyleadid/leadid/' + LeadId;
  120. return yield this.dataHelper().getAsync(url).then(function (response) {
  121. if (response.result != null && response.result != "")
  122. response.result = JSON.parse(response.result);
  123. return response;
  124. });
  125. });
  126. }
  127. static Instance() {
  128. if (this._instance === undefined)
  129. this._instance = new EstimateManager();
  130. return this._instance;
  131. }
  132. }
  133. Managers.EstimateManager = EstimateManager;
  134. })(Managers = Transact.Managers || (Transact.Managers = {}));
  135. })(Transact = Apps.Transact || (Apps.Transact = {}));
  136. })(Apps = Bizgaze.Apps || (Bizgaze.Apps = {}));
  137. })(Bizgaze || (Bizgaze = {}));