@colijnit/transaction 257.1.33 → 257.1.34

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.33";
37
- this.publishDate = "25/03/2025, 17:30:02";
36
+ this.symVer = "257.1.34";
37
+ this.publishDate = "26-3-2025 18:58:50";
38
38
  }
39
39
  return Version;
40
40
  }());
@@ -23595,6 +23595,8 @@
23595
23595
  TransactionLineImageAndDescriptionComponent.prototype.transactionLineSet = function () {
23596
23596
  _super.prototype.transactionLineSet.call(this);
23597
23597
  this._loadLineImage();
23598
+ // @ts-ignore
23599
+ this.transactionLine.configurationReadable = this.transactionLine.configurationReadable.replaceAll('\n', '<br>');
23598
23600
  };
23599
23601
  TransactionLineImageAndDescriptionComponent.prototype.visibilitySet = function () {
23600
23602
  _super.prototype.visibilitySet.call(this);
@@ -23619,7 +23621,7 @@
23619
23621
  TransactionLineImageAndDescriptionComponent.decorators = [
23620
23622
  { type: i0.Component, args: [{
23621
23623
  selector: "co-transaction-line-image-and-description",
23622
- template: "\n <div *ngIf=\"!transactionLine.isPayment\" class=\"transaction-line-image\" [class.preview]=\"preview\" [screenConfigurationObject]=\"imageAndDescriptionConfigNames?.image\" screenConfigNativeElement>\n <co-image-display [model]=\"image\"></co-image-display>\n </div>\n <co-icon *ngIf=\"transactionLine.isPayment\" class=\"payment-line-icon\" [iconData]=\"iconCacheService.getIcon(icons.UpFromLineRegular)\">\n </co-icon>\n\n <div class=\"transaction-line-description\">\n <div class=\"description-wrapper\">\n <div class=\"colorBlock\" *ngIf=\"transactionLine.color\" [style.background-color]=\"transactionLine.color\"></div>\n <co-transaction-line-description class=\"transaction-line-description-description\"\n [configNames]=\"imageAndDescriptionConfigNames\"\n [defaultEditMode]=\"false\"\n [showLabel]=\"false\"\n [showPurchaseDesc]=\"showPurchaseDesc\"\n [customerPortal]=\"customerPortal\"\n ></co-transaction-line-description>\n <div class=\"transaction-line-article-number-wrapper\" *ngIf=\"!popUpView && !customerPortal\">\n <span *ngIf=\"showDivider\">|</span>\n <span [textContent]=\"transactionLine.articleNumber\" [screenConfigurationObject]=\"imageAndDescriptionConfigNames?.articleNr\" screenConfigNativeElement></span>\n <co-icon class=\"delete-icon\" [iconData]=\"iconCacheService.getIcon(icons.TrashCanLight)\"\n [screenConfigurationObject]=\"imageAndDescriptionConfigNames?.deleteBtn\" screenConfigNativeElement\n (click)=\"deleteTransactionLineClick($event)\"></co-icon>\n </div>\n\n </div>\n <div *ngIf=\"!preview && !popUpView && (transactionLine.articleBoundConcatenatedText || transactionLine.configurationReadable)\"\n class=\"article-text-wrapper\"\n [screenConfigurationObject]=\"imageAndDescriptionConfigNames?.articleText\"\n screenConfigNativeElement>\n <div [ngClass]=\"{'article-text-expand': true, 'large-article': !expanded && !customerPortal}\" class=\"co-small-scrollbar\">\n <div class=\"article-text\" *ngFor=\"let text of transactionLine.articleTextAsArray\">\n <span [innerHTML]=\"text | safeHtml\" (dblclick)=\"handleOpenArticleText()\"></span>\n </div>\n <div *ngIf=\"!popUpView && transactionLine.configurationReadable\" class=\"configuration-text\">\n <span [innerHTML]=\"transactionLine.configurationReadable\"></span>\n </div>\n </div>\n <div class=\"expand-wrapper\" (click)=\"expandClicked()\" *ngIf=\"!customerPortal\">\n <span class=\"expand-text\" [textContent]=\"!expanded ? ('SHOW_MORE' | localize) : ('SHOW_LESS' | localize)\"></span>\n <co-icon [iconData]=\"expanded ? iconCacheService.getIcon(icons.ChevronUpRegular) : iconCacheService.getIcon(icons.ChevronDownRegular) \"></co-icon>\n </div>\n </div>\n </div>\n ",
23624
+ template: "\n <div *ngIf=\"!transactionLine.isPayment\" class=\"transaction-line-image\" [class.preview]=\"preview\" [screenConfigurationObject]=\"imageAndDescriptionConfigNames?.image\" screenConfigNativeElement>\n <co-image-display [model]=\"image\"></co-image-display>\n </div>\n <co-icon *ngIf=\"transactionLine.isPayment\" class=\"payment-line-icon\" [iconData]=\"iconCacheService.getIcon(icons.UpFromLineRegular)\">\n </co-icon>\n\n <div class=\"transaction-line-description\">\n <div class=\"description-wrapper\">\n <div class=\"colorBlock\" *ngIf=\"transactionLine.color\" [style.background-color]=\"transactionLine.color\"></div>\n <co-transaction-line-description class=\"transaction-line-description-description\"\n [configNames]=\"imageAndDescriptionConfigNames\"\n [defaultEditMode]=\"false\"\n [showLabel]=\"false\"\n [showPurchaseDesc]=\"showPurchaseDesc\"\n [customerPortal]=\"customerPortal\"\n ></co-transaction-line-description>\n <div class=\"transaction-line-article-number-wrapper\" *ngIf=\"!popUpView && !customerPortal\">\n <span *ngIf=\"showDivider\">|</span>\n <span [textContent]=\"transactionLine.articleNumber\" [screenConfigurationObject]=\"imageAndDescriptionConfigNames?.articleNr\" screenConfigNativeElement></span>\n <co-icon class=\"delete-icon\" [iconData]=\"iconCacheService.getIcon(icons.TrashCanLight)\"\n [screenConfigurationObject]=\"imageAndDescriptionConfigNames?.deleteBtn\" screenConfigNativeElement\n (click)=\"deleteTransactionLineClick($event)\"></co-icon>\n </div>\n\n </div>\n <div *ngIf=\"!preview && !popUpView && (transactionLine.articleBoundConcatenatedText || transactionLine.configurationReadable)\"\n class=\"article-text-wrapper\"\n [screenConfigurationObject]=\"imageAndDescriptionConfigNames?.articleText\"\n screenConfigNativeElement>\n <div [ngClass]=\"{'article-text-expand': true, 'large-article': !expanded && !customerPortal}\" class=\"co-small-scrollbar\">\n <div class=\"article-text\" *ngFor=\"let text of transactionLine.articleTextAsArray\">\n <div [innerHTML]=\"text | safeHtml\" (dblclick)=\"handleOpenArticleText()\"></div>\n </div>\n <div *ngIf=\"!popUpView && transactionLine.configurationReadable\" class=\"configuration-text\">\n <div [innerHTML]=\"transactionLine.configurationReadable\"></div>\n </div>\n </div>\n <div class=\"expand-wrapper\" (click)=\"expandClicked()\" *ngIf=\"!customerPortal\">\n <span class=\"expand-text\" [textContent]=\"!expanded ? ('SHOW_MORE' | localize) : ('SHOW_LESS' | localize)\"></span>\n <co-icon [iconData]=\"expanded ? iconCacheService.getIcon(icons.ChevronUpRegular) : iconCacheService.getIcon(icons.ChevronDownRegular) \"></co-icon>\n </div>\n </div>\n </div>\n ",
23623
23625
  providers: [{
23624
23626
  provide: corecomponents_v12.SCREEN_CONFIG_ADAPTER_COMPONENT_INTERFACE_NAME,
23625
23627
  useExisting: i0.forwardRef(function () { return TransactionLineImageAndDescriptionComponent; })
@@ -26656,8 +26658,11 @@
26656
26658
  _this.reportDocumentPrintRequest = new reportingDocumentPrintSignDocBaseRequest.ReportingDocumentPrintSignDocBaseRequest();
26657
26659
  _this.reportDocumentPdfRequest = new reportingDocumentPdfBaseRequest.ReportingDocumentPdfBaseRequest();
26658
26660
  _this.batchTransactionSendingRequest = new batchTransactionSendingRequest.BatchTransactionSendingRequest();
26661
+ _this.printPurchaseOrderForSalesOrderRequest = new printPurchaseOrderForSalesOrderRequest.PrintPurchaseOrderForSalesOrderRequest();
26659
26662
  _this.useDefaultLayout = false;
26660
26663
  _this.useDefaultShippingMethods = false;
26664
+ _this.saveDefaultPrinterForUser = false;
26665
+ _this.saveDefaultPrinterForAllUsers = false;
26661
26666
  _this.printerList = [];
26662
26667
  _this.defaultSendMethodInitialized = false;
26663
26668
  _this._subs = [];
@@ -26705,43 +26710,45 @@
26705
26710
  TransactionQuickAccessOrderPurchaseComponent.prototype.handleSendMethodOkClick = function (methodData) {
26706
26711
  var _a, _b, _c, _d;
26707
26712
  return __awaiter(this, void 0, void 0, function () {
26708
- var methodString;
26709
26713
  return __generator(this, function (_e) {
26710
26714
  switch (_e.label) {
26711
26715
  case 0:
26712
26716
  this.showSendMethodDialog = false;
26713
- if (!(methodData.sendMethod === 'COMBINED')) return [3 /*break*/, 2];
26714
26717
  this.useDefaultLayout = methodData.useDefaultLayout;
26715
26718
  this.useDefaultShippingMethods = methodData.useDefaultShippingMethods;
26719
+ this.saveDefaultPrinterForUser = methodData.saveDefaultPrinterForUser;
26720
+ this.saveDefaultPrinterForAllUsers = methodData.saveDefaultPrinterForAllUsers;
26716
26721
  if (!this.useDefaultShippingMethods) {
26717
26722
  this.overruledEmail = methodData.overruledEmail;
26718
26723
  this.overruledEdi = methodData.overruledEdi;
26719
26724
  this.overruledPrint = methodData.overruledPrint;
26720
26725
  }
26726
+ if (!this.useDefaultLayout) {
26727
+ this.reportIdForPrinting = methodData.reportIdForPrinting.reportId;
26728
+ this.reportIdForEmail = methodData.reportIdForEmail.reportId;
26729
+ }
26721
26730
  if (methodData.printerName) {
26722
26731
  this.selectedPrinter = this.printerList.find(function (p) { return p.name === methodData.printerName; }) || null;
26723
26732
  }
26724
- this.batchTransactionSendingRequest.useRelationSpecificReports = this.useDefaultLayout;
26725
- this.batchTransactionSendingRequest.useRelationSpecificSendMethods = this.useDefaultShippingMethods;
26726
- this.batchTransactionSendingRequest.printerName = ((_a = this.selectedPrinter) === null || _a === void 0 ? void 0 : _a.name) || null;
26733
+ this.printPurchaseOrderForSalesOrderRequest.useRelationSpecificReports = this.useDefaultLayout;
26734
+ this.printPurchaseOrderForSalesOrderRequest.useRelationSpecificSendMethods = this.useDefaultShippingMethods;
26735
+ this.printPurchaseOrderForSalesOrderRequest.saveDefaultPrinterForUser = this.saveDefaultPrinterForUser;
26736
+ this.printPurchaseOrderForSalesOrderRequest.saveDefaultPrinterForAllUsers = this.saveDefaultPrinterForAllUsers;
26737
+ this.printPurchaseOrderForSalesOrderRequest.printerName = ((_a = this.selectedPrinter) === null || _a === void 0 ? void 0 : _a.name) || null;
26727
26738
  if (!this.useDefaultShippingMethods) {
26728
- this.batchTransactionSendingRequest.overruleSendMethodForEmail = (_b = this.overruledEmail) === null || _b === void 0 ? void 0 : _b.code;
26729
- this.batchTransactionSendingRequest.overruleSendMethodForPrinting = (_c = this.overruledPrint) === null || _c === void 0 ? void 0 : _c.code;
26730
- this.batchTransactionSendingRequest.overruleSendMethodForEDI = (_d = this.overruledEdi) === null || _d === void 0 ? void 0 : _d.code;
26739
+ this.printPurchaseOrderForSalesOrderRequest.overruleSendMethodForEmail = (_b = this.overruledEmail) === null || _b === void 0 ? void 0 : _b.code;
26740
+ this.printPurchaseOrderForSalesOrderRequest.overruleSendMethodForPrinting = (_c = this.overruledPrint) === null || _c === void 0 ? void 0 : _c.code;
26741
+ this.printPurchaseOrderForSalesOrderRequest.overruleSendMethodForEDI = (_d = this.overruledEdi) === null || _d === void 0 ? void 0 : _d.code;
26742
+ }
26743
+ if (!this.useDefaultLayout) {
26744
+ this.printPurchaseOrderForSalesOrderRequest.reportIdForPrinting = this.reportIdForPrinting;
26745
+ this.printPurchaseOrderForSalesOrderRequest.reportIdForEmail = this.reportIdForEmail;
26731
26746
  }
26732
26747
  return [4 /*yield*/, this.printDocument(this.reportDocumentPrintRequest)];
26733
26748
  case 1:
26734
26749
  _e.sent();
26735
26750
  this._setDefaultMethod(this.defaultSendMethod);
26736
- return [3 /*break*/, 4];
26737
- case 2:
26738
- methodString = methodData.toString();
26739
- return [4 /*yield*/, this.printDocument(this.reportDocumentPrintRequest)];
26740
- case 3:
26741
- _e.sent();
26742
- this._setDefaultMethod(methodString);
26743
- _e.label = 4;
26744
- case 4: return [2 /*return*/];
26751
+ return [2 /*return*/];
26745
26752
  }
26746
26753
  });
26747
26754
  });
@@ -26832,8 +26839,15 @@
26832
26839
  switch (_e.label) {
26833
26840
  case 0:
26834
26841
  printPurchaseOrderForSalesOrderRequest$1 = Object.assign(new printPurchaseOrderForSalesOrderRequest.PrintPurchaseOrderForSalesOrderRequest(), request);
26835
- (_a = printPurchaseOrderForSalesOrderRequest$1.useRelationSpecificReports) !== null && _a !== void 0 ? _a : (printPurchaseOrderForSalesOrderRequest$1.useRelationSpecificReports = true);
26836
- (_b = printPurchaseOrderForSalesOrderRequest$1.useRelationSpecificSendMethods) !== null && _b !== void 0 ? _b : (printPurchaseOrderForSalesOrderRequest$1.useRelationSpecificSendMethods = true);
26842
+ printPurchaseOrderForSalesOrderRequest$1.useRelationSpecificReports = (_a = this.printPurchaseOrderForSalesOrderRequest.useRelationSpecificReports) !== null && _a !== void 0 ? _a : true;
26843
+ printPurchaseOrderForSalesOrderRequest$1.useRelationSpecificSendMethods = (_b = this.printPurchaseOrderForSalesOrderRequest.useRelationSpecificSendMethods) !== null && _b !== void 0 ? _b : true;
26844
+ printPurchaseOrderForSalesOrderRequest$1.reportIdForPrinting = this.printPurchaseOrderForSalesOrderRequest.reportIdForPrinting;
26845
+ printPurchaseOrderForSalesOrderRequest$1.reportIdForEmail = this.printPurchaseOrderForSalesOrderRequest.reportIdForEmail;
26846
+ printPurchaseOrderForSalesOrderRequest$1.overruleSendMethodForEmail = this.printPurchaseOrderForSalesOrderRequest.overruleSendMethodForEmail;
26847
+ printPurchaseOrderForSalesOrderRequest$1.overruleSendMethodForPrinting = this.printPurchaseOrderForSalesOrderRequest.overruleSendMethodForPrinting;
26848
+ printPurchaseOrderForSalesOrderRequest$1.overruleSendMethodForEDI = this.printPurchaseOrderForSalesOrderRequest.overruleSendMethodForEDI;
26849
+ printPurchaseOrderForSalesOrderRequest$1.saveDefaultPrinterForUser = this.printPurchaseOrderForSalesOrderRequest.saveDefaultPrinterForUser;
26850
+ printPurchaseOrderForSalesOrderRequest$1.saveDefaultPrinterForAllUsers = this.printPurchaseOrderForSalesOrderRequest.saveDefaultPrinterForAllUsers;
26837
26851
  return [4 /*yield*/, this.transactionService.generateAndSendPurchaseOrdersForSalesOrder(printPurchaseOrderForSalesOrderRequest$1, this.transactionInfo.version)];
26838
26852
  case 1:
26839
26853
  _e.sent();
@@ -26847,7 +26861,7 @@
26847
26861
  TransactionQuickAccessOrderPurchaseComponent.decorators = [
26848
26862
  { type: i0.Component, args: [{
26849
26863
  selector: 'co-transaction-quick-access-order-purchase',
26850
- template: "\n <div class=\"quick-access-content-wrapper\" *ngIf=\"canGenerate && transactionInfo.transactionDefinitive\">\n <div class=\"select-all-wrapper\">\n <co-input-checkbox\n [label]=\"'SELECT_ALL_LINES' | localize\"\n (modelChange)=\"handleSelectAllLines($event)\">\n </co-input-checkbox>\n </div>\n <co-quick-send-button\n [defaultMethodIcon]=\"defaultSendMethodIcon\"\n [showLoader]=\"showLoader\"\n (sendIconClicked)=\"handleSend(defaultSendMethod)\"\n (openSendMethodDialog)=\"openSendDialog()\">\n </co-quick-send-button>\n\n <span class=\"button\" [class.selected]=\"transactionHeaderService.reservationMode\">\n <co-icon (click)=\"handleReservationModeClick()\" [iconData]=\"iconCacheService.getIcon(icons.PalletBoxesRotate)\"></co-icon>\n </span>\n </div>\n\n <co-send-method-dialog *ngIf=\"showSendMethodDialog\"\n [headerTitle]=\"'CREATE_PURCHASE_ORDER' | localize\"\n [printerList]=\"printerList\"\n [defaultSendMethod]=\"defaultSendMethod\"\n [visibleMethods]=\"[sendMethodType.Print, sendMethodType.Email]\"\n [emailAddresses]=\"emailAddresses\"\n [emailLayouts]=\"emailLayouts\"\n [printLayouts]=\"printLayouts\"\n [defaultPrinterName]=\"defaultPrinterName\"\n [isDocSignEnabled]=\"true\"\n [pdfDoc]=\"pdfDoc\"\n [(reportingDocumentEmailRequest)]=\"reportDocumentEmailRequest\"\n [(reportingDocumentPrintRequest)]=\"reportDocumentPrintRequest\"\n [(reportingDocumentPdfRequest)]=\"reportDocumentPdfRequest\"\n (closeClick)=\"showSendMethodDialog = false\"\n (okClick)=\"handleSendMethodOkClick($event)\"\n [usePurchaseSendMethod]=\"true\"\n ></co-send-method-dialog>\n ",
26864
+ template: "\n <div class=\"quick-access-content-wrapper\" *ngIf=\"canGenerate && transactionInfo.transactionDefinitive\">\n <div class=\"select-all-wrapper\">\n <co-input-checkbox\n [label]=\"'SELECT_ALL_LINES' | localize\"\n (modelChange)=\"handleSelectAllLines($event)\">\n </co-input-checkbox>\n </div>\n <co-quick-send-button\n [defaultMethodIcon]=\"defaultSendMethodIcon\"\n [showLoader]=\"showLoader\"\n (sendIconClicked)=\"handleSend(defaultSendMethod)\"\n (openSendMethodDialog)=\"openSendDialog()\">\n </co-quick-send-button>\n\n <span class=\"button\" [class.selected]=\"transactionHeaderService.reservationMode\">\n <co-icon (click)=\"handleReservationModeClick()\" [iconData]=\"iconCacheService.getIcon(icons.PalletBoxesRotate)\"></co-icon>\n </span>\n </div>\n\n <co-send-method-dialog *ngIf=\"showSendMethodDialog\"\n [headerTitle]=\"'CREATE_PURCHASE_ORDER' | localize\"\n [printerList]=\"printerList\"\n [defaultSendMethod]=\"defaultSendMethod\"\n [visibleMethods]=\"[sendMethodType.Print, sendMethodType.Email]\"\n [emailAddresses]=\"emailAddresses\"\n [emailLayouts]=\"emailLayouts\"\n [printLayouts]=\"printLayouts\"\n [defaultPrinterName]=\"defaultPrinterName\"\n [disablePdfPreview]=\"true\"\n [isDocSignEnabled]=\"true\"\n [pdfDoc]=\"pdfDoc\"\n [(reportingDocumentEmailRequest)]=\"reportDocumentEmailRequest\"\n [(reportingDocumentPrintRequest)]=\"reportDocumentPrintRequest\"\n [(reportingDocumentPdfRequest)]=\"reportDocumentPdfRequest\"\n (closeClick)=\"showSendMethodDialog = false\"\n (okClick)=\"handleSendMethodOkClick($event)\"\n [usePurchaseSendMethod]=\"true\"\n ></co-send-method-dialog>\n ",
26851
26865
  encapsulation: i0.ViewEncapsulation.None
26852
26866
  },] }
26853
26867
  ];
@@ -27292,7 +27306,7 @@
27292
27306
  TransactionQuickAccessPurchaseOrderOverviewComponent.decorators = [
27293
27307
  { type: i0.Component, args: [{
27294
27308
  selector: "co-transaction-quick-access-purchase-order-overview",
27295
- template: "\n <co-quick-send-button\n [defaultMethodIcon]=\"defaultSendMethodIcon\"\n [showLoader]=\"showLoader\"\n (sendIconClicked)=\"handleSend(defaultSendMethod)\"\n (openSendMethodDialog)=\"showSendMethodDialog = true\"\n ></co-quick-send-button>\n <co-transaction-send-documents\n [historicReports]=\"historicReports\"\n [transactionTypeCategory]=\"transactionTypeCategory.PurchaseOrderOverview\"\n ></co-transaction-send-documents>\n <co-dialog-catalog *ngIf=\"showCatalog\"\n [options]=\"catalogOptions\"\n [parameters]=\"catalogParameters\"\n [showNavigation]=\"true\"\n (closeClick)=\"showCatalog = false\"\n (articleClicked)=\"handleCatalogArticleClick($event)\"\n >\n </co-dialog-catalog>\n <co-send-method-dialog *ngIf=\"showSendMethodDialog\"\n [headerTitle]=\"'Verzendmethode'\"\n [printerList]=\"printerList\"\n [defaultSendMethod]=\"defaultSendMethod\"\n [visibleMethods]=\"[sendMethodType.Print, sendMethodType.Email, sendMethodType.Pdf, sendMethodType.WebService]\"\n [emailAddresses]=\"emailAddresses\"\n [emailLayouts]=\"emailLayouts\"\n [printLayouts]=\"printLayouts\"\n [isDocSignEnabled]=\"true\"\n [(reportingDocumentEmailRequest)]=\"reportDocumentEmailRequest\"\n [(reportingDocumentPrintRequest)]=\"reportDocumentPrintRequest\"\n [(reportingDocumentPdfRequest)]=\"reportDocumentPdfRequest\"\n (closeClick)=\"showSendMethodDialog = false\"\n (okClick)=\"handleSendMethodOkClick($event)\"\n ></co-send-method-dialog>\n ",
27309
+ template: "\n <co-quick-send-button\n [defaultMethodIcon]=\"defaultSendMethodIcon\"\n [showLoader]=\"showLoader\"\n (sendIconClicked)=\"handleSend(defaultSendMethod)\"\n (openSendMethodDialog)=\"showSendMethodDialog = true\"\n ></co-quick-send-button>\n <co-transaction-send-documents\n [historicReports]=\"historicReports\"\n [transactionTypeCategory]=\"transactionTypeCategory.PurchaseOrderOverview\"\n ></co-transaction-send-documents>\n <co-dialog-catalog *ngIf=\"showCatalog\"\n [options]=\"catalogOptions\"\n [parameters]=\"catalogParameters\"\n [showNavigation]=\"true\"\n (closeClick)=\"showCatalog = false\"\n (articleClicked)=\"handleCatalogArticleClick($event)\"\n >\n </co-dialog-catalog>\n <co-send-method-dialog *ngIf=\"showSendMethodDialog\"\n [headerTitle]=\"'Verzendmethode'\"\n [printerList]=\"printerList\"\n [defaultSendMethod]=\"defaultSendMethod\"\n [visibleMethods]=\"[sendMethodType.Print, sendMethodType.Email, sendMethodType.Pdf, sendMethodType.WebService]\"\n [emailAddresses]=\"emailAddresses\"\n [emailLayouts]=\"emailLayouts\"\n [printLayouts]=\"printLayouts\"\n [disablePdfPreview]=\"true\"\n [isDocSignEnabled]=\"true\"\n [(reportingDocumentEmailRequest)]=\"reportDocumentEmailRequest\"\n [(reportingDocumentPrintRequest)]=\"reportDocumentPrintRequest\"\n [(reportingDocumentPdfRequest)]=\"reportDocumentPdfRequest\"\n (closeClick)=\"showSendMethodDialog = false\"\n (okClick)=\"handleSendMethodOkClick($event)\"\n ></co-send-method-dialog>\n ",
27296
27310
  encapsulation: i0.ViewEncapsulation.None
27297
27311
  },] }
27298
27312
  ];
@@ -57854,6 +57868,7 @@
57854
57868
  this.showRelatedProductsPopup = false;
57855
57869
  this.cartPlusIcon = this.iconService.getIcon(this.icons.CartPlusRegular);
57856
57870
  this.cartMinIcon = this.iconService.getIcon(this.icons.CartMinusRegular);
57871
+ this.pendingAddArticleAction = false;
57857
57872
  this._showCatalog = false;
57858
57873
  this._subs = [];
57859
57874
  }
@@ -57893,7 +57908,9 @@
57893
57908
  }
57894
57909
  this.searchText = text;
57895
57910
  this._prepareCatalogRequest();
57896
- this.searchText = undefined;
57911
+ this._changeDetector.detectChanges();
57912
+ this.searchText = "";
57913
+ if (!!this.pendingAddArticleAction) return [3 /*break*/, 13];
57897
57914
  return [4 /*yield*/, this.transactionService.getArticleListWithBarcodeArticleNrEanCode(text)];
57898
57915
  case 1:
57899
57916
  fullMatchSearch = _a.sent();
@@ -57904,7 +57921,9 @@
57904
57921
  if (!(article.goodType === "B")) return [3 /*break*/, 3];
57905
57922
  this.showCatalogDialog();
57906
57923
  return [3 /*break*/, 5];
57907
- case 3: return [4 /*yield*/, this.handleAddArticle(article)];
57924
+ case 3:
57925
+ this.pendingAddArticleAction = true;
57926
+ return [4 /*yield*/, this.handleAddArticle(article)];
57908
57927
  case 4:
57909
57928
  _a.sent();
57910
57929
  _a.label = 5;
@@ -57919,7 +57938,9 @@
57919
57938
  if (!(article.goodType === "B")) return [3 /*break*/, 9];
57920
57939
  this.showCatalogDialog();
57921
57940
  return [3 /*break*/, 11];
57922
- case 9: return [4 /*yield*/, this.handleAddArticle(article)];
57941
+ case 9:
57942
+ this.pendingAddArticleAction = true;
57943
+ return [4 /*yield*/, this.handleAddArticle(article)];
57923
57944
  case 10:
57924
57945
  _a.sent();
57925
57946
  _a.label = 11;
@@ -57945,9 +57966,13 @@
57945
57966
  return [4 /*yield*/, this.transactionService.addArticle(article.articleNumber, this.return ? -1 : 1)];
57946
57967
  case 1:
57947
57968
  success = _a.sent();
57948
- if (!success) {
57969
+ if (success) {
57970
+ this.searchText = "";
57971
+ }
57972
+ else {
57949
57973
  this.transactionService.rollback();
57950
57974
  }
57975
+ this.pendingAddArticleAction = false;
57951
57976
  return [3 /*break*/, 3];
57952
57977
  case 2:
57953
57978
  this.addArticle.next({
@@ -57957,6 +57982,7 @@
57957
57982
  belowLineNr: 0,
57958
57983
  lastArticle: true
57959
57984
  });
57985
+ this.pendingAddArticleAction = false;
57960
57986
  _a.label = 3;
57961
57987
  case 3: return [2 /*return*/];
57962
57988
  }
@@ -57965,7 +57991,6 @@
57965
57991
  };
57966
57992
  AddProductComponent.prototype.handleAddArticleClick = function (data) {
57967
57993
  return __awaiter(this, void 0, void 0, function () {
57968
- var article, articleNr;
57969
57994
  return __generator(this, function (_a) {
57970
57995
  switch (_a.label) {
57971
57996
  case 0:
@@ -57973,18 +57998,65 @@
57973
57998
  // this.showCatalog = false;
57974
57999
  // }
57975
58000
  this.showCatalog = false;
57976
- if (!this.handleAddArticleInternally) return [3 /*break*/, 8];
58001
+ if (!this.handleAddArticleInternally) return [3 /*break*/, 2];
58002
+ return [4 /*yield*/, this._handleArticleTypeOnAdd(data)];
58003
+ case 1:
58004
+ _a.sent();
58005
+ return [3 /*break*/, 3];
58006
+ case 2:
58007
+ if (data && data.article instanceof articleExtended_bo.ArticleExtended) {
58008
+ this.addArticle.next({
58009
+ article: data.article,
58010
+ quantity: this.getActualQuantity(data.quantity),
58011
+ aboveLineNr: 0,
58012
+ belowLineNr: 0,
58013
+ lastArticle: true
58014
+ });
58015
+ }
58016
+ _a.label = 3;
58017
+ case 3: return [2 /*return*/];
58018
+ }
58019
+ });
58020
+ });
58021
+ };
58022
+ AddProductComponent.prototype._tryAddArticle = function (articleNr, quantity) {
58023
+ return __awaiter(this, void 0, void 0, function () {
58024
+ var success;
58025
+ return __generator(this, function (_a) {
58026
+ switch (_a.label) {
58027
+ case 0: return [4 /*yield*/, this.transactionService.addArticle(articleNr, quantity, 0, 0, true, true)];
58028
+ case 1:
58029
+ success = _a.sent();
58030
+ console.log(success);
58031
+ if (success) {
58032
+ this.searchText = "";
58033
+ }
58034
+ else {
58035
+ // keep the search text
58036
+ this.searchText = this.inputSearchText.model;
58037
+ }
58038
+ return [2 /*return*/];
58039
+ }
58040
+ });
58041
+ });
58042
+ };
58043
+ AddProductComponent.prototype._handleArticleTypeOnAdd = function (data) {
58044
+ return __awaiter(this, void 0, void 0, function () {
58045
+ var article, articleNr;
58046
+ return __generator(this, function (_a) {
58047
+ switch (_a.label) {
58048
+ case 0:
57977
58049
  if (!(data && data.article)) return [3 /*break*/, 7];
57978
58050
  if (!(typeof data.article === 'string')) return [3 /*break*/, 5];
57979
58051
  article = JSON.parse(data.article);
57980
58052
  if (!article.selectorData.compositions) return [3 /*break*/, 2];
57981
- return [4 /*yield*/, this.transactionService.addArticle(article.selectorData.compositions[0].compositionArticleNo, data.quantity, 0, 0, true, true)];
58053
+ return [4 /*yield*/, this._tryAddArticle(article.selectorData.compositions[0].compositionArticleNo, data.quantity)];
57982
58054
  case 1:
57983
58055
  _a.sent();
57984
58056
  return [3 /*break*/, 4];
57985
58057
  case 2:
57986
58058
  if (!article.selectorData.articleNr) return [3 /*break*/, 4];
57987
- return [4 /*yield*/, this.transactionService.addArticle(article.selectorData.articleNr, data.quantity, 0, 0, true, true)];
58059
+ return [4 /*yield*/, this._tryAddArticle(article.selectorData.articleNr, data.quantity)];
57988
58060
  case 3:
57989
58061
  _a.sent();
57990
58062
  _a.label = 4;
@@ -57998,23 +58070,11 @@
57998
58070
  articleNr = data.article.hasOwnProperty('articleNr') ? data.article['articleNr'] : data.article['articleNo'];
57999
58071
  }
58000
58072
  if (!articleNr) return [3 /*break*/, 7];
58001
- return [4 /*yield*/, this.transactionService.addArticle(articleNr, data.quantity, 0, 0, true, true)];
58073
+ return [4 /*yield*/, this._tryAddArticle(articleNr, data.quantity)];
58002
58074
  case 6:
58003
58075
  _a.sent();
58004
58076
  _a.label = 7;
58005
- case 7: return [3 /*break*/, 9];
58006
- case 8:
58007
- if (data && data.article instanceof articleExtended_bo.ArticleExtended) {
58008
- this.addArticle.next({
58009
- article: data.article,
58010
- quantity: this.getActualQuantity(data.quantity),
58011
- aboveLineNr: 0,
58012
- belowLineNr: 0,
58013
- lastArticle: true
58014
- });
58015
- }
58016
- _a.label = 9;
58017
- case 9: return [2 /*return*/];
58077
+ case 7: return [2 /*return*/];
58018
58078
  }
58019
58079
  });
58020
58080
  });
@@ -58044,6 +58104,11 @@
58044
58104
  };
58045
58105
  AddProductComponent.prototype.showCatalogDialog = function () {
58046
58106
  this.showCatalog = true;
58107
+ this.pendingAddArticleAction = false;
58108
+ };
58109
+ AddProductComponent.prototype.handleCloseCatalogueClick = function () {
58110
+ this.showCatalog = false;
58111
+ this.searchText = "";
58047
58112
  };
58048
58113
  AddProductComponent.prototype.handleCartIconClick = function (event) {
58049
58114
  this.return = !this.return;
@@ -58053,7 +58118,7 @@
58053
58118
  this.searchText = this.inputSearchText.model;
58054
58119
  }
58055
58120
  this._prepareCatalogRequest();
58056
- this.searchText = undefined;
58121
+ // this.searchText = undefined;
58057
58122
  this.showCatalogDialog();
58058
58123
  };
58059
58124
  AddProductComponent.prototype.handleIFrameFeedback = function (iFrameFeedbackObject) {
@@ -58110,7 +58175,7 @@
58110
58175
  AddProductComponent.decorators = [
58111
58176
  { type: i0.Component, args: [{
58112
58177
  selector: 'co-add-product',
58113
- template: "\n <co-input-scanner\n #inputSearch\n [customCssClass]=\"'no-focus-line'\"\n [(model)]=\"searchText\"\n [placeholder]=\"'SEARCH_ADD_ARTICLE' | localize\"\n [centerLabel]=\"true\"\n [useLeftIcon]=\"true\"\n [leftIconData]=\"return ? cartMinIcon : cartPlusIcon\"\n [useRightIcon]=\"true\"\n (leftIconClick)=\"handleCartIconClick($event)\"\n (rightIconClick)=\"handleSearchIconClick()\"\n (barCodeScanned)=\"handleSearch($event)\"\n (search)=\"handleSearch($event)\"\n (isFocused)=\"handleInputFocus($event)\"\n ></co-input-scanner>\n <co-dialog-catalog *ngIf=\"showCatalog\"\n [options]=\"catalogOptions\"\n [parameters]=\"catalogParameters\"\n [handleAddArticleInternally]=\"handleAddArticleInternally\"\n [showNavigation]=\"true\"\n [isReturn]=\"return\"\n [showRelatedProductsPopup]=\"showRelatedProductsPopup\"\n [transaction]=\"transactionService.currentTransaction\"\n (closeClick)=\"showCatalog = false\"\n (articleClicked)=\"handleCatalogArticleClick($event)\"\n (addArticleClicked)=\"handleAddArticleClick($event)\"\n (addCatFarmArticleClicked)=\"handleAddCatFarmArticleClick($event)\"\n (iFrameFeedback)=\"handleIFrameFeedback($event)\"\n >\n </co-dialog-catalog>\n ",
58178
+ template: "\n <co-input-scanner\n #inputSearch\n [customCssClass]=\"'no-focus-line'\"\n [(model)]=\"searchText\"\n [placeholder]=\"'SEARCH_ADD_ARTICLE' | localize\"\n [centerLabel]=\"true\"\n [useLeftIcon]=\"true\"\n [leftIconData]=\"return ? cartMinIcon : cartPlusIcon\"\n [useRightIcon]=\"true\"\n (leftIconClick)=\"handleCartIconClick($event)\"\n (rightIconClick)=\"handleSearchIconClick()\"\n (barCodeScanned)=\"handleSearch($event)\"\n (search)=\"handleSearch($event)\"\n (isFocused)=\"handleInputFocus($event)\"\n ></co-input-scanner>\n <co-dialog-catalog *ngIf=\"showCatalog\"\n [options]=\"catalogOptions\"\n [parameters]=\"catalogParameters\"\n [handleAddArticleInternally]=\"handleAddArticleInternally\"\n [showNavigation]=\"true\"\n [isReturn]=\"return\"\n [showRelatedProductsPopup]=\"showRelatedProductsPopup\"\n [transaction]=\"transactionService.currentTransaction\"\n (closeClick)=\"handleCloseCatalogueClick()\"\n (articleClicked)=\"handleCatalogArticleClick($event)\"\n (addArticleClicked)=\"handleAddArticleClick($event)\"\n (addCatFarmArticleClicked)=\"handleAddCatFarmArticleClick($event)\"\n (iFrameFeedback)=\"handleIFrameFeedback($event)\"\n >\n </co-dialog-catalog>\n ",
58114
58179
  encapsulation: i0.ViewEncapsulation.None
58115
58180
  },] }
58116
58181
  ];