@colijnit/transaction 255.1.40 → 255.1.41

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -33,8 +33,8 @@
33
33
  function Version() {
34
34
  this.name = "@colijnit/transaction";
35
35
  this.description = "Colijn IT transaction package";
36
- this.symVer = "255.1.40";
37
- this.publishDate = "23-9-2024 18:21:43";
36
+ this.symVer = "255.1.41";
37
+ this.publishDate = "25-9-2024 17:27:58";
38
38
  }
39
39
  return Version;
40
40
  }());
@@ -15410,27 +15410,24 @@
15410
15410
  };
15411
15411
  TransactionService.prototype.createSalesOrder = function (request) {
15412
15412
  return __awaiter(this, void 0, void 0, function () {
15413
- var _this = this;
15413
+ var response;
15414
15414
  return __generator(this, function (_a) {
15415
- return [2 /*return*/, new Promise(function (resolve, reject) { return __awaiter(_this, void 0, void 0, function () {
15416
- var _this = this;
15417
- return __generator(this, function (_a) {
15418
- switch (_a.label) {
15419
- case 0: return [4 /*yield*/, this.checkBranch()];
15420
- case 1:
15421
- _a.sent();
15422
- if (!this.currentBranch) {
15423
- return [2 /*return*/, reject()];
15424
- }
15425
- request.branchNr = this.currentBranch;
15426
- this.connector.createSalesOrder(request).then(function (response) {
15427
- _this.rememberCurrentTransaction(response);
15428
- resolve(true);
15429
- });
15430
- return [2 /*return*/];
15431
- }
15432
- });
15433
- }); })];
15415
+ switch (_a.label) {
15416
+ case 0: return [4 /*yield*/, this.checkBranch()];
15417
+ case 1:
15418
+ _a.sent();
15419
+ if (!this.currentBranch) {
15420
+ return [2 /*return*/, Promise.reject()];
15421
+ }
15422
+ request.branchNr = this.currentBranch;
15423
+ return [4 /*yield*/, this.connector.createSalesOrder(request)];
15424
+ case 2:
15425
+ response = _a.sent();
15426
+ return [4 /*yield*/, this.rememberCurrentTransaction(response)];
15427
+ case 3:
15428
+ _a.sent();
15429
+ return [2 /*return*/, true];
15430
+ }
15434
15431
  });
15435
15432
  });
15436
15433
  };
@@ -15461,27 +15458,24 @@
15461
15458
  };
15462
15459
  TransactionService.prototype.createPurchaseOrder = function (request) {
15463
15460
  return __awaiter(this, void 0, void 0, function () {
15464
- var _this = this;
15461
+ var response;
15465
15462
  return __generator(this, function (_a) {
15466
- return [2 /*return*/, new Promise(function (resolve, reject) { return __awaiter(_this, void 0, void 0, function () {
15467
- var _this = this;
15468
- return __generator(this, function (_a) {
15469
- switch (_a.label) {
15470
- case 0: return [4 /*yield*/, this.checkBranch()];
15471
- case 1:
15472
- _a.sent();
15473
- if (!this.currentBranch) {
15474
- return [2 /*return*/, reject()];
15475
- }
15476
- request.branchNr = this.currentBranch;
15477
- this.connector.createPurchaseOrder(request).then(function (response) {
15478
- _this.rememberCurrentTransaction(response);
15479
- resolve(true);
15480
- });
15481
- return [2 /*return*/];
15482
- }
15483
- });
15484
- }); })];
15463
+ switch (_a.label) {
15464
+ case 0: return [4 /*yield*/, this.checkBranch()];
15465
+ case 1:
15466
+ _a.sent();
15467
+ if (!this.currentBranch) {
15468
+ return [2 /*return*/, Promise.reject()];
15469
+ }
15470
+ request.branchNr = this.currentBranch;
15471
+ return [4 /*yield*/, this.connector.createPurchaseOrder(request)];
15472
+ case 2:
15473
+ response = _a.sent();
15474
+ return [4 /*yield*/, this.rememberCurrentTransaction(response)];
15475
+ case 3:
15476
+ _a.sent();
15477
+ return [2 /*return*/, true];
15478
+ }
15485
15479
  });
15486
15480
  });
15487
15481
  };
@@ -15561,27 +15555,24 @@
15561
15555
  };
15562
15556
  TransactionService.prototype.createSalesQuotation = function (request) {
15563
15557
  return __awaiter(this, void 0, void 0, function () {
15564
- var _this = this;
15558
+ var response;
15565
15559
  return __generator(this, function (_a) {
15566
- return [2 /*return*/, new Promise(function (resolve, reject) { return __awaiter(_this, void 0, void 0, function () {
15567
- var _this = this;
15568
- return __generator(this, function (_a) {
15569
- switch (_a.label) {
15570
- case 0: return [4 /*yield*/, this.checkBranch()];
15571
- case 1:
15572
- _a.sent();
15573
- if (!this.currentBranch) {
15574
- return [2 /*return*/, reject()];
15575
- }
15576
- request.branchNr = this.currentBranch;
15577
- this.connector.createSalesQuotation(request).then(function (response) {
15578
- _this.rememberCurrentTransaction(response);
15579
- resolve(true);
15580
- });
15581
- return [2 /*return*/];
15582
- }
15583
- });
15584
- }); })];
15560
+ switch (_a.label) {
15561
+ case 0: return [4 /*yield*/, this.checkBranch()];
15562
+ case 1:
15563
+ _a.sent();
15564
+ if (!this.currentBranch) {
15565
+ return [2 /*return*/, Promise.reject()];
15566
+ }
15567
+ request.branchNr = this.currentBranch;
15568
+ return [4 /*yield*/, this.connector.createSalesQuotation(request)];
15569
+ case 2:
15570
+ response = _a.sent();
15571
+ return [4 /*yield*/, this.rememberCurrentTransaction(response)];
15572
+ case 3:
15573
+ _a.sent();
15574
+ return [2 /*return*/, true];
15575
+ }
15585
15576
  });
15586
15577
  });
15587
15578
  };
@@ -17899,30 +17890,29 @@
17899
17890
  };
17900
17891
  TransactionService.prototype._checkAndCreateTransaction = function () {
17901
17892
  return __awaiter(this, void 0, void 0, function () {
17902
- var createMethod_1;
17893
+ var createMethod, request;
17903
17894
  return __generator(this, function (_a) {
17904
- if (!this.currentTransaction || !this.currentTransaction.transactionInfo || !this.currentTransaction.transactionInfo.transactionNr) {
17905
- createMethod_1 = this._createTransactionMethods.get(this.transactionKind);
17906
- if (createMethod_1) {
17907
- return [2 /*return*/, new Promise(function (resolve) {
17908
- var request = new createTransactionRequest.CreateTransactionRequest();
17909
- createMethod_1(request)
17910
- .then(function () {
17911
- resolve(true);
17912
- })
17913
- .catch(function () {
17914
- resolve(false);
17915
- });
17895
+ switch (_a.label) {
17896
+ case 0:
17897
+ if (!(!this.currentTransaction || !this.currentTransaction.transactionInfo || !this.currentTransaction.transactionInfo.transactionNr)) return [3 /*break*/, 4];
17898
+ createMethod = this._createTransactionMethods.get(this.transactionKind || transactionKind_enum.TransactionKind.SalesOrder);
17899
+ if (!createMethod) return [3 /*break*/, 2];
17900
+ request = new createTransactionRequest.CreateTransactionRequest();
17901
+ return [4 /*yield*/, createMethod(request)
17902
+ .then(function () {
17903
+ return true;
17904
+ })
17905
+ .catch(function () {
17906
+ return false;
17916
17907
  })];
17917
- }
17918
- else {
17908
+ case 1: return [2 /*return*/, _a.sent()];
17909
+ case 2:
17919
17910
  rxjs.throwError("Failed to create transaction");
17920
- }
17921
- }
17922
- else {
17923
- return [2 /*return*/, Promise.resolve(true)];
17911
+ _a.label = 3;
17912
+ case 3: return [3 /*break*/, 5];
17913
+ case 4: return [2 /*return*/, Promise.resolve(true)];
17914
+ case 5: return [2 /*return*/];
17924
17915
  }
17925
- return [2 /*return*/];
17926
17916
  });
17927
17917
  });
17928
17918
  };
@@ -22873,7 +22863,7 @@
22873
22863
  TransactionSendDocumentsComponent.decorators = [
22874
22864
  { type: i0.Component, args: [{
22875
22865
  selector: "co-transaction-send-documents",
22876
- template: "\n <div class=\"send-documents-wrapper\" *ngIf=\"historicReports.length > 0\">\n <div class=\"amount-send-indicator\">\n <span [textContent]=\"historicReports.length\"></span>\n </div>\n <div class=\"send-button\" [class.no-pointer]=\"historicReports.length === 0\"\n [class.selected]=\"selected\"\n (click)=\"toggleSendDocumentsDialog()\">\n <co-icon [iconData]=\"iconCacheService.getIcon(icons.FileCircleInfoSolid)\"></co-icon>\n <span [textContent]=\"'SENT' | localize\"></span>\n </div>\n <co-dialog-wizard *ngIf=\"showDialog\" (closeClick)=\"showDialog = false\">\n <ng-container header>\n <div class=\"dialog-title\" [textContent]=\"'ALREADY_SENT' | localize\"></div>\n </ng-container>\n <div class=\"dialog-container\">\n <div class=\"historic-report-line\" *ngFor=\"let report of historicReports\" (click)=\"handleShowHistoricDocumentLines(report)\">\n <co-icon [iconData]=\"iconCacheService.getIcon(getSendMethodIcon(report))\"></co-icon>\n <span [textContent]=\"report.reportId + ' ' + (report.reportCreationDate | date)\"></span>\n </div>\n </div>\n </co-dialog-wizard>\n </div>\n ",
22866
+ template: "\n <div class=\"send-documents-wrapper\" *ngIf=\"historicReports?.length > 0\">\n <div class=\"amount-send-indicator\">\n <span [textContent]=\"historicReports.length\"></span>\n </div>\n <div class=\"send-button\" [class.no-pointer]=\"historicReports.length === 0\"\n [class.selected]=\"selected\"\n (click)=\"toggleSendDocumentsDialog()\">\n <co-icon [iconData]=\"iconCacheService.getIcon(icons.FileCircleInfoSolid)\"></co-icon>\n <span [textContent]=\"'SENT' | localize\"></span>\n </div>\n <co-dialog-wizard *ngIf=\"showDialog\" (closeClick)=\"showDialog = false\">\n <ng-container header>\n <div class=\"dialog-title\" [textContent]=\"'ALREADY_SENT' | localize\"></div>\n </ng-container>\n <div class=\"dialog-container\">\n <div class=\"historic-report-line\" *ngFor=\"let report of historicReports\" (click)=\"handleShowHistoricDocumentLines(report)\">\n <co-icon [iconData]=\"iconCacheService.getIcon(getSendMethodIcon(report))\"></co-icon>\n <span [textContent]=\"report.reportId + ' ' + (report.reportCreationDate | date)\"></span>\n </div>\n </div>\n </co-dialog-wizard>\n </div>\n ",
22877
22867
  encapsulation: i0.ViewEncapsulation.None
22878
22868
  },] }
22879
22869
  ];
@@ -43018,7 +43008,7 @@
43018
43008
  TransactionUndoDeliveryComponent.decorators = [
43019
43009
  { type: i0.Component, args: [{
43020
43010
  selector: "co-undo-delivery",
43021
- template: "\n <div class=\"send-documents-wrapper\" *ngIf=\"historicReports.length > 0 && allowToUndoDelivery\">\n <div class=\"amount-send-indicator\">\n <span [textContent]=\"historicReports.length\"></span>\n </div>\n <div class=\"send-button\" [class.no-pointer]=\"historicReports.length === 0\"\n [class.selected]=\"selected\"\n (click)=\"toggleUndoDeliveryDialog()\">\n <co-icon [iconData]=\"iconCacheService.getIcon(icons.SyncAlt)\"></co-icon>\n <span [textContent]=\"'UNDO_DELIVERY' | localize\"></span>\n </div>\n <co-dialog-wizard *ngIf=\"showDialog\" (closeClick)=\"showDialog = false\">\n <ng-container header>\n <div class=\"dialog-title\" [textContent]=\"'DELIVERY_NOTE' | localize\"></div>\n </ng-container>\n <div class=\"dialog-container\">\n <div class=\"historic-report-line\" *ngFor=\"let report of historicReports\"\n (click)=\"undoDelivery(report.reportId)\">\n <span [textContent]=\"report.reportId + ' ' + (report.reportCreationDate | date)\"></span>\n <co-icon [iconData]=\"iconCacheService.getIcon(icons.TrashBin)\"></co-icon>\n </div>\n </div>\n <co-loader *ngIf=\"showUndoLoader\"></co-loader>\n </co-dialog-wizard>\n </div>\n ",
43011
+ template: "\n <div class=\"send-documents-wrapper\" *ngIf=\"historicReports?.length > 0 && allowToUndoDelivery\">\n <div class=\"amount-send-indicator\">\n <span [textContent]=\"historicReports.length\"></span>\n </div>\n <div class=\"send-button\" [class.no-pointer]=\"historicReports.length === 0\"\n [class.selected]=\"selected\"\n (click)=\"toggleUndoDeliveryDialog()\">\n <co-icon [iconData]=\"iconCacheService.getIcon(icons.SyncAlt)\"></co-icon>\n <span [textContent]=\"'UNDO_DELIVERY' | localize\"></span>\n </div>\n <co-dialog-wizard *ngIf=\"showDialog\" (closeClick)=\"showDialog = false\">\n <ng-container header>\n <div class=\"dialog-title\" [textContent]=\"'DELIVERY_NOTE' | localize\"></div>\n </ng-container>\n <div class=\"dialog-container\">\n <div class=\"historic-report-line\" *ngFor=\"let report of historicReports\"\n (click)=\"undoDelivery(report.reportId)\">\n <span [textContent]=\"report.reportId + ' ' + (report.reportCreationDate | date)\"></span>\n <co-icon [iconData]=\"iconCacheService.getIcon(icons.TrashBin)\"></co-icon>\n </div>\n </div>\n <co-loader *ngIf=\"showUndoLoader\"></co-loader>\n </co-dialog-wizard>\n </div>\n ",
43022
43012
  encapsulation: i0.ViewEncapsulation.None
43023
43013
  },] }
43024
43014
  ];