@colijnit/transaction 257.1.46 → 257.1.48

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 = "257.1.46";
37
- this.publishDate = "09/04/2025, 11:44:07";
36
+ this.symVer = "257.1.48";
37
+ this.publishDate = "9-4-2025 17:53:48";
38
38
  }
39
39
  return Version;
40
40
  }());
@@ -9544,7 +9544,7 @@
9544
9544
  case 1:
9545
9545
  response = _a.sent();
9546
9546
  if (response && response.validationResult && response.validationResult.success) {
9547
- return [2 /*return*/, response.resultObject];
9547
+ return [2 /*return*/, this._boFactory.makeWithRawBackendData(transactionInfoResponse_bo.TransactionInfoResponse, response.resultObject)];
9548
9548
  }
9549
9549
  else {
9550
9550
  this._handleExceptionFromResponse(response);
@@ -20065,10 +20065,19 @@
20065
20065
  };
20066
20066
  TransactionService.prototype.processReservation = function (request) {
20067
20067
  return __awaiter(this, void 0, void 0, function () {
20068
+ var lockSuccess, response;
20068
20069
  return __generator(this, function (_a) {
20069
20070
  switch (_a.label) {
20070
- case 0: return [4 /*yield*/, this.connector.processReservation(request)];
20071
- case 1: return [2 /*return*/, _a.sent()];
20071
+ case 0: return [4 /*yield*/, this.tryToLockTransaction(this.currentTransaction.transactionInfo.id, this.currentTransaction.transactionInfo.version)];
20072
+ case 1:
20073
+ lockSuccess = _a.sent();
20074
+ if (!lockSuccess) return [3 /*break*/, 3];
20075
+ return [4 /*yield*/, this.connector.processReservation(request)];
20076
+ case 2:
20077
+ response = _a.sent();
20078
+ this.transactionDirty = true;
20079
+ return [2 /*return*/, this.handleLineOperationStatuses(response)];
20080
+ case 3: return [2 /*return*/, false];
20072
20081
  }
20073
20082
  });
20074
20083
  });
@@ -26629,16 +26638,16 @@
26629
26638
  }
26630
26639
  TransactionSalesReservationService.prototype.getSalesOrderLines = function (salesOrderId) {
26631
26640
  return __awaiter(this, void 0, void 0, function () {
26632
- var _b;
26633
- return __generator(this, function (_c) {
26634
- switch (_c.label) {
26641
+ var _a;
26642
+ return __generator(this, function (_b) {
26643
+ switch (_b.label) {
26635
26644
  case 0:
26636
26645
  if (!salesOrderId) return [3 /*break*/, 2];
26637
- _b = this;
26646
+ _a = this;
26638
26647
  return [4 /*yield*/, this._transaction.getSalesOrderLines(this.makeGetSalesOrderLinesRequest(salesOrderId))];
26639
26648
  case 1:
26640
- _b.purchaseReservations = _c.sent();
26641
- _c.label = 2;
26649
+ _a.purchaseReservations = _b.sent();
26650
+ _b.label = 2;
26642
26651
  case 2: return [2 /*return*/];
26643
26652
  }
26644
26653
  });
@@ -26669,11 +26678,10 @@
26669
26678
  }
26670
26679
  };
26671
26680
  TransactionSalesReservationService.prototype.processReservation = function (reservationLines, transId) {
26672
- var _a;
26673
26681
  return __awaiter(this, void 0, void 0, function () {
26674
- var request, response;
26675
- return __generator(this, function (_b) {
26676
- switch (_b.label) {
26682
+ var request, success;
26683
+ return __generator(this, function (_a) {
26684
+ switch (_a.label) {
26677
26685
  case 0:
26678
26686
  request = new processOrderReservationRequest_bo.ProcessOrderReservationRequest();
26679
26687
  request.transId = transId;
@@ -26681,42 +26689,26 @@
26681
26689
  request.reservationLines = reservationLines;
26682
26690
  return [4 /*yield*/, this._transaction.processReservation(request)];
26683
26691
  case 1:
26684
- response = _b.sent();
26685
- if (!((_a = response === null || response === void 0 ? void 0 : response.transactionInfo) === null || _a === void 0 ? void 0 : _a.id)) return [3 /*break*/, 7];
26686
- this._transaction.currentTransaction = response;
26687
- return [4 /*yield*/, this._transaction.saveTransaction(true)];
26692
+ success = _a.sent();
26693
+ if (!success) return [3 /*break*/, 3];
26694
+ return [4 /*yield*/, this.getSalesOrderLines(request.transId)];
26688
26695
  case 2:
26689
- _b.sent();
26690
- return [4 /*yield*/, this._transaction.commit()];
26691
- case 3:
26692
- _b.sent();
26693
- if (!this._transaction.currentTransaction.transactionInfo.id) return [3 /*break*/, 5];
26694
- return [4 /*yield*/, this._transaction.getTransactionById(this._transaction.currentTransaction.transactionInfo.id)];
26695
- case 4:
26696
- _b.sent();
26697
- _b.label = 5;
26698
- case 5: return [4 /*yield*/, this.getSalesOrderLines(request.transId)];
26699
- case 6:
26700
- _b.sent();
26696
+ _a.sent();
26701
26697
  this.resetLineData();
26702
26698
  return [2 /*return*/, true];
26703
- case 7: return [2 /*return*/, false];
26699
+ case 3: return [2 /*return*/, false];
26704
26700
  }
26705
26701
  });
26706
26702
  });
26707
26703
  };
26708
26704
  TransactionSalesReservationService.prototype.resetLineData = function () {
26709
- this.salesReservationLines = [];
26710
26705
  this.salesReservationLines = [];
26711
26706
  this.lineNr = undefined;
26712
26707
  };
26713
26708
  return TransactionSalesReservationService;
26714
26709
  }());
26715
- TransactionSalesReservationService.ɵprov = i0__namespace.ɵɵdefineInjectable({ factory: function TransactionSalesReservationService_Factory() { return new TransactionSalesReservationService(i0__namespace.ɵɵinject(TransactionService)); }, token: TransactionSalesReservationService, providedIn: "root" });
26716
26710
  TransactionSalesReservationService.decorators = [
26717
- { type: i0.Injectable, args: [{
26718
- providedIn: "root"
26719
- },] }
26711
+ { type: i0.Injectable }
26720
26712
  ];
26721
26713
  TransactionSalesReservationService.ctorParameters = function () { return [
26722
26714
  { type: TransactionService }
@@ -26908,6 +26900,7 @@
26908
26900
  TransactionQuickAccessOrderPurchaseComponent.prototype.ngOnInit = function () {
26909
26901
  var _this = this;
26910
26902
  _super.prototype.ngOnInit.call(this);
26903
+ this.transactionHeaderService.reservationMode = false;
26911
26904
  this._subs.push(this.transactionEventService.transactionLineChanged.subscribe(function () { return _this._checkPurchaseOrders(); }));
26912
26905
  var transItem = this.transaction;
26913
26906
  this.selectedTransactions.push(transItem);
@@ -56061,7 +56054,8 @@
56061
56054
  selector: 'co-transaction-internal',
56062
56055
  template: "\n <ng-container *ngIf=\"loaded && customerPortal\">\n <div class=\"transaction-lines-wrapper\"\n *ngIf=\"transaction.transactionInfo.transactionKind !== 'S'\">\n <co-transaction-header-customer-portal [showPreferredPlanning]=\"showPreferredPlanning\" [transaction]=\"transaction\"></co-transaction-header-customer-portal>\n <co-transaction-lines\n [activeCategory]=\"activeCategory\"\n (saveTransactionLine)=\"saveTransactionLineText($event)\"\n [customerPortal]=\"customerPortal\">\n </co-transaction-lines>\n </div>\n <div class=\"transaction-lines-wrapper\" *ngIf=\"transaction && transaction.transactionInfo && transaction.transactionInfo.transactionKind === 'S'\">\n <co-transaction-service-overview\n [posOrderData]=\"posOrderData\">\n </co-transaction-service-overview>\n </div>\n\n </ng-container>\n <ng-container *ngIf=\"loaded && !customerPortal\">\n <co-click-block></co-click-block>\n <co-transaction-header *ngIf=\"showHeader\" [transaction]=\"transaction\"></co-transaction-header>\n <div class=\"transaction-lines-header\">\n <co-transaction-quick-access *ngIf=\"showQuickAccess\" class=\"transaction-lines-header-item\"\n [transactionKind]=\"transaction.transactionInfo.transactionKind\"\n [activeCategory]=\"activeCategory\"\n >\n </co-transaction-quick-access>\n <co-transaction-button-bar *ngIf=\"showButtonBar\"\n class=\"transaction-lines-header-item\"\n [selectedCategory]=\"activeCategory\"\n (buttonClicked)=\"handleButtonBarButtonClicked($event)\">\n </co-transaction-button-bar>\n\n <div class=\"transaction-lines-header-item right\">\n <co-avatar\n class=\"transaction-sales-avatar\"\n [relationId]=\"transaction.transactionInfo.handledBy\"\n [screenConfigurationObject]=\"cfgNames.HeaderHandledBy\"\n screenConfigNativeElement>\n </co-avatar>\n <co-avatar\n class=\"transaction-sales-avatar\"\n [relationId]=\"transaction.transactionInfo.branch?.relationId\"\n [screenConfigurationObject]=\"cfgNames.HeaderBranch\"\n screenConfigNativeElement>\n </co-avatar>\n <co-view-mode-buttons *ngIf=\"!shouldShowTiles() && showViewModeButtons\"\n [showViewModes]=\"[viewModes.List, viewModes.Tiles]\"\n (viewModeChange)=\"handleViewModeChange($event)\">\n </co-view-mode-buttons>\n </div>\n </div>\n\n <div class=\"transaction-lines-content-wrapper\">\n <!--<co-transaction-document-button-bar [transaction]=\"transaction\"></co-transaction-document-button-bar>-->\n <div class=\"transaction-lines-content\">\n <div *ngIf=\"activeCategory === category.ServiceOrderService && transaction && transaction.transactionInfo && transaction.transactionInfo.transactionKind === 'S'\">\n <co-transaction-service-overview [posOrderData]=\"posOrderData\"></co-transaction-service-overview>\n </div>\n <div class=\"transaction-tiles-wrapper\" *ngIf=\"activeViewMode === viewModes.Tiles || shouldShowTiles() || transactionPlanning\">\n <co-transaction-cards\n [activeCategory]=\"activeCategory\"\n [class.planning-cards]=\"transactionPlanning\">\n </co-transaction-cards>\n </div>\n <div class=\"transaction-lines-wrapper\"\n *ngIf=\"(activeViewMode === viewModes.List && !shouldShowTiles()) && activeCategory !== category.ServiceOrderService && !transactionPlanning\">\n <co-transaction-lines\n [activeCategory]=\"activeCategory\"\n (saveTransactionLine)=\"saveTransactionLineText($event)\">\n </co-transaction-lines>\n </div>\n <div class=\"transaction-footer-wrapper\">\n <div class=\"transaction-footer-left\">\n <co-add-product\n *ngIf=\"activeCategory === categories.SalesOrderCashRegister ||\n activeCategory === categories.SalesOrderOverview ||\n activeCategory === categories.PurchaseOrderOverview ||\n activeCategory === categories.SalesOrderQuotation ||\n activeCategory === categories.ServiceOrderOverview\">\n </co-add-product>\n <co-transaction-button *ngIf=\"activeCategory === categories.SalesOrderCashRegister ||\n activeCategory === categories.SalesOrderOverview ||\n activeCategory === categories.PurchaseOrderOverview ||\n activeCategory === categories.SalesOrderQuotation ||\n activeCategory === categories.ServiceOrderOverview\"\n class=\"custom-width text-rule\"\n [iconData]=\"iconCacheService.getIcon(icons.TextSolid)\"\n (click)=\"handleTransactionText()\">\n </co-transaction-button>\n </div>\n\n <div class=\"transaction-footer-center\">\n <co-transaction-margin *ngIf=\"activeCategory === categories.SalesOrderMarginInfo\"></co-transaction-margin>\n </div>\n <co-transaction-totals *ngIf=\"(activeCategory !== category.ServiceOrderService && activeCategory !== category.SalesOrderPurchase)\"\n [showDiscount]=\"true\">\n </co-transaction-totals>\n </div>\n </div>\n\n <co-transaction-lines-side-panel *ngIf=\"transaction && (transaction.transactionInfo.transactionKind === transactionKind.CashDesk && !fullyInvoiced())\"\n [posOrderData]=\"posOrderData\"\n [transaction]=\"transaction\">\n </co-transaction-lines-side-panel>\n\n <!-- <co-transaction-line-side-panel *ngIf=\"showSidePanel\"-->\n <!-- [transaction]=\"transaction\"-->\n <!-- [transactionInfo]=\"transaction.transactionInfo\"-->\n <!-- [transactionLine]=\"sidePanelTransactionLine\"-->\n <!-- [activeCategory]=\"activeCategory\"-->\n <!-- (cancelClick)=\"showSidePanel = false\">-->\n <!-- </co-transaction-line-side-panel>-->\n\n\n <co-transaction-sales-reservation-popup *ngIf=\"showReservationPopup\" [transactionId]=\"transaction.transactionInfo.id\"></co-transaction-sales-reservation-popup>\n <!--Popup voor wijzigen volgorde van tekstregels-->\n <co-transaction-article-text-overview *ngIf=\"showArticleTextOverview\"\n [transactionInfo]=\"transaction.transactionInfo\"\n [transactionLine]=\"transactionLine\"\n (closeClick)=\"closeArticleTextOverview()\"\n (cancelClick)=\"closeArticleTextOverview()\">\n </co-transaction-article-text-overview>\n\n <!--Popup voor aanmaken en updaten transactietekstregels-->\n <co-transaction-article-text *ngIf=\"showTransactionText\"\n [header]=\"'ORDER_TEXT_LINE' | localize\"\n [transactionUuid]=\"transaction.transactionInfo.uuid\"\n [editText]=\"textToEdit\"\n [orderLineSetDTO]=\"selectedOrderLineSetDTO\"\n [transactionLine]=\"transactionLine\"\n (saveClick)=\"saveTransactionLineText($event)\"\n (closeClick)=\"closeTransactionText()\"\n (cancelClick)=\"closeTransactionText()\"\n (saveOrderLineSetClick)=\"saveOrderLineSet($event)\">\n </co-transaction-article-text>\n\n <!--Popup voor aanmaken en updaten artikeltekstregels-->\n <co-transaction-article-text *ngIf=\"showArticleText\"\n [header]=\"'PRODUCT_DESCRIPTION_AND_TEXTS' | localize\"\n [transactionUuid]=\"transaction.transactionInfo.uuid\"\n [showArticleImageDescription]=\"transactionLine.articleBound\"\n [showImage]=\"false\"\n [articleLineNr]=\"transactionLine.lineNr\"\n [articleRef]=\"transactionLine.articleNumber\"\n [transactionLine]=\"transactionLine\"\n [editText]=\"textToEdit\"\n (saveClick)=\"saveArticleLineText($event)\"\n (closeClick)=\"closeArticleText()\"\n (cancelClick)=\"closeArticleText()\">\n </co-transaction-article-text>\n\n <co-transaction-copy-order *ngIf=\"showCopyOrderDialog\"\n (closeDialog)=\"showCopyOrderDialog = false\">\n </co-transaction-copy-order>\n\n <!-- Pop up voor voorraad-->\n <co-transaction-article-stock-dialog\n *ngIf=\"showArticleStockPopup\"\n [article]=\"stockGoodId\"\n (closeClick)=\"closeArticleStockPopup()\">\n </co-transaction-article-stock-dialog>\n\n </div>\n </ng-container>\n ",
56063
56056
  providers: [
56064
- TransactionHeaderService
56057
+ TransactionHeaderService,
56058
+ TransactionSalesReservationService
56065
56059
  ],
56066
56060
  encapsulation: i0.ViewEncapsulation.None
56067
56061
  },] }
@@ -58435,24 +58429,27 @@
58435
58429
  AddProductComponent.prototype.ngOnDestroy = function () {
58436
58430
  this._subs.forEach(function (s) { return s.unsubscribe(); });
58437
58431
  };
58432
+ /**
58433
+ * First check if there's a single article found
58434
+ * This is a two check step:
58435
+ * Check if there is an exact match on barcode, ean or articlenumber
58436
+ * If not: check with search like
58437
+ * Else open catalogus
58438
+ * @param text
58439
+ */
58438
58440
  AddProductComponent.prototype.handleSearch = function (text) {
58439
58441
  return __awaiter(this, void 0, void 0, function () {
58440
58442
  var fullMatchSearch, article, foundArticles, article;
58441
58443
  return __generator(this, function (_a) {
58442
58444
  switch (_a.label) {
58443
58445
  case 0:
58444
- console.log('searching: ' + text);
58445
58446
  this.searchText = text;
58446
58447
  this._prepareCatalogRequest();
58447
- this.searchText = "";
58448
- this._changeDetector.detectChanges();
58449
58448
  if (!!this.pendingAddArticleAction) return [3 /*break*/, 13];
58450
- console.log('no Pending Action ' + text);
58451
58449
  return [4 /*yield*/, this.transactionService.getArticleListWithBarcodeArticleNrEanCode(text)];
58452
58450
  case 1:
58453
58451
  fullMatchSearch = _a.sent();
58454
58452
  if (!(fullMatchSearch && fullMatchSearch.length === 1)) return [3 /*break*/, 6];
58455
- console.log('Match' + text);
58456
58453
  return [4 /*yield*/, this.transactionService.getArticleExtended(fullMatchSearch[0].articleNr)];
58457
58454
  case 2:
58458
58455
  article = _a.sent();
@@ -58466,13 +58463,10 @@
58466
58463
  _a.sent();
58467
58464
  _a.label = 5;
58468
58465
  case 5: return [3 /*break*/, 13];
58469
- case 6:
58470
- console.log('No Match' + text);
58471
- return [4 /*yield*/, this.transactionService.getArticles(this.catalogParameters)];
58466
+ case 6: return [4 /*yield*/, this.transactionService.getArticles(this.catalogParameters)];
58472
58467
  case 7:
58473
58468
  foundArticles = _a.sent();
58474
58469
  if (!(foundArticles && foundArticles.length === 1)) return [3 /*break*/, 12];
58475
- console.log('Found Article ' + text);
58476
58470
  return [4 /*yield*/, this.transactionService.getArticleExtended(foundArticles[0].articleNumber)];
58477
58471
  case 8:
58478
58472
  article = _a.sent();
@@ -58487,10 +58481,11 @@
58487
58481
  _a.label = 11;
58488
58482
  case 11: return [3 /*break*/, 13];
58489
58483
  case 12:
58490
- console.log('No Found Article ' + text);
58491
58484
  this.showCatalogDialog();
58492
58485
  _a.label = 13;
58493
- case 13: return [2 /*return*/];
58486
+ case 13:
58487
+ this.searchText = "";
58488
+ return [2 /*return*/];
58494
58489
  }
58495
58490
  });
58496
58491
  });
@@ -58566,7 +58561,6 @@
58566
58561
  case 0: return [4 /*yield*/, this.transactionService.addArticle(articleNr, quantity, 0, 0, true, true)];
58567
58562
  case 1:
58568
58563
  success = _a.sent();
58569
- console.log(success);
58570
58564
  if (success) {
58571
58565
  this.searchText = "";
58572
58566
  }