@colijnit/transaction 256.1.6 → 256.1.8

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.
Files changed (31) hide show
  1. package/bundles/colijnit-transaction.umd.js +154 -84
  2. package/bundles/colijnit-transaction.umd.js.map +1 -1
  3. package/colijnit-transaction.metadata.json +1 -1
  4. package/esm2015/lib/component/add-product/add-product.component.js +5 -5
  5. package/esm2015/lib/component/dialog/catalog/dialog-catalog/dialog-catalog.component.js +9 -2
  6. package/esm2015/lib/component/dialog/transaction-line/dialog-transaction-line-warehouse-cc/dialog-direct-sell.component.js +87 -68
  7. package/esm2015/lib/component/transaction/transaction.component.js +6 -2
  8. package/esm2015/lib/component/transaction-create-wizard/transaction-create-wizard.component.js +14 -3
  9. package/esm2015/lib/component/transaction-header-fields/transaction-header-deposit-amount.component.js +16 -11
  10. package/esm2015/lib/component/transaction-internal/transaction-internal.component.js +6 -1
  11. package/esm2015/lib/component/transaction-line/transaction-planning-line/transaction-planning-line.component.js +4 -4
  12. package/esm2015/lib/component/transaction-line-fields/transaction-line-supplier-button.component.js +2 -2
  13. package/esm2015/lib/component/transaction-search/transaction-search.component.js +8 -1
  14. package/esm2015/lib/service/transaction-connector-adapter.service.js +5 -5
  15. package/esm2015/lib/service/transaction-connector.service.js +5 -5
  16. package/esm2015/lib/service/transaction.service.js +11 -11
  17. package/esm2015/lib/transaction-version.js +3 -3
  18. package/fesm2015/colijnit-transaction.js +164 -108
  19. package/fesm2015/colijnit-transaction.js.map +1 -1
  20. package/lib/component/dialog/catalog/dialog-catalog/dialog-catalog.component.d.ts +5 -1
  21. package/lib/component/dialog/transaction-line/dialog-transaction-line-warehouse-cc/dialog-direct-sell.component.d.ts +8 -4
  22. package/lib/component/transaction/transaction.component.d.ts +5 -1
  23. package/lib/component/transaction-create-wizard/transaction-create-wizard.component.d.ts +4 -1
  24. package/lib/component/transaction-internal/transaction-internal.component.d.ts +4 -0
  25. package/lib/component/transaction-search/transaction-search.component.d.ts +2 -0
  26. package/lib/service/transaction-connector-adapter.service.d.ts +2 -2
  27. package/lib/service/transaction-connector.service.d.ts +2 -2
  28. package/lib/service/transaction.service.d.ts +5 -5
  29. package/package.json +1 -1
  30. package/colijnit-transaction-256.1.4.tgz +0 -0
  31. package/colijnit-transaction-256.1.5.tgz +0 -0
@@ -3,8 +3,8 @@ export class Version {
3
3
  constructor() {
4
4
  this.name = "@colijnit/transaction";
5
5
  this.description = "Colijn IT transaction package";
6
- this.symVer = "256.1.6";
7
- this.publishDate = "28-10-2024 10:33:24";
6
+ this.symVer = "256.1.8";
7
+ this.publishDate = "1-11-2024 08:49:24";
8
8
  }
9
9
  }
10
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHJhbnNhY3Rpb24tdmVyc2lvbi5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3Byb2plY3RzL3RyYW5zYWN0aW9uL3NyYy9saWIvdHJhbnNhY3Rpb24tdmVyc2lvbi50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSx1REFBdUQ7QUFDdkQsTUFBTSxPQUFPLE9BQU87SUFBcEI7UUFDUyxTQUFJLEdBQUcsdUJBQXVCLENBQUM7UUFDL0IsZ0JBQVcsR0FBRywrQkFBK0IsQ0FBQztRQUM5QyxXQUFNLEdBQUcsU0FBUyxDQUFDO1FBQ25CLGdCQUFXLEdBQUcscUJBQXFCLENBQUM7SUFDN0MsQ0FBQztDQUFBIiwic291cmNlc0NvbnRlbnQiOlsiLy8gdGhpcyBmaWxlIGlzIGR5bmFtaWNhbGx5IGNyZWF0ZWQsIGRvIG5vdCBjaGFuZ2UgdGhpc1xuZXhwb3J0IGNsYXNzIFZlcnNpb24ge1xuICBwdWJsaWMgbmFtZSA9IFwiQGNvbGlqbml0L3RyYW5zYWN0aW9uXCI7XG4gIHB1YmxpYyBkZXNjcmlwdGlvbiA9IFwiQ29saWpuIElUIHRyYW5zYWN0aW9uIHBhY2thZ2VcIjtcbiAgcHVibGljIHN5bVZlciA9IFwiMjU2LjEuNlwiO1xuICBwdWJsaWMgcHVibGlzaERhdGUgPSBcIjI4LTEwLTIwMjQgMTA6MzM6MjRcIjtcbn0iXX0=
10
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHJhbnNhY3Rpb24tdmVyc2lvbi5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3Byb2plY3RzL3RyYW5zYWN0aW9uL3NyYy9saWIvdHJhbnNhY3Rpb24tdmVyc2lvbi50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSx1REFBdUQ7QUFDdkQsTUFBTSxPQUFPLE9BQU87SUFBcEI7UUFDUyxTQUFJLEdBQUcsdUJBQXVCLENBQUM7UUFDL0IsZ0JBQVcsR0FBRywrQkFBK0IsQ0FBQztRQUM5QyxXQUFNLEdBQUcsU0FBUyxDQUFDO1FBQ25CLGdCQUFXLEdBQUcsb0JBQW9CLENBQUM7SUFDNUMsQ0FBQztDQUFBIiwic291cmNlc0NvbnRlbnQiOlsiLy8gdGhpcyBmaWxlIGlzIGR5bmFtaWNhbGx5IGNyZWF0ZWQsIGRvIG5vdCBjaGFuZ2UgdGhpc1xuZXhwb3J0IGNsYXNzIFZlcnNpb24ge1xuICBwdWJsaWMgbmFtZSA9IFwiQGNvbGlqbml0L3RyYW5zYWN0aW9uXCI7XG4gIHB1YmxpYyBkZXNjcmlwdGlvbiA9IFwiQ29saWpuIElUIHRyYW5zYWN0aW9uIHBhY2thZ2VcIjtcbiAgcHVibGljIHN5bVZlciA9IFwiMjU2LjEuOFwiO1xuICBwdWJsaWMgcHVibGlzaERhdGUgPSBcIjEtMTEtMjAyNCAwODo0OToyNFwiO1xufSJdfQ==
@@ -278,8 +278,8 @@ class Version {
278
278
  constructor() {
279
279
  this.name = "@colijnit/transaction";
280
280
  this.description = "Colijn IT transaction package";
281
- this.symVer = "256.1.6";
282
- this.publishDate = "28-10-2024 10:33:24";
281
+ this.symVer = "256.1.8";
282
+ this.publishDate = "1-11-2024 08:49:24";
283
283
  }
284
284
  }
285
285
 
@@ -2996,10 +2996,10 @@ class TransactionConnectorAdapterService {
2996
2996
  });
2997
2997
  });
2998
2998
  }
2999
- addTransactionLine(uuid, articleNo, quantity, aboveLineNr, belowLineNr) {
2999
+ addTransactionLine(uuid, articleNo, quantity, aboveLineNr, belowLineNr, showLoader = false) {
3000
3000
  return __awaiter(this, void 0, void 0, function* () {
3001
3001
  return new Promise((resolve, reject) => {
3002
- return this.connector.addTransactionLine(uuid, articleNo, quantity, aboveLineNr, belowLineNr).then((result) => {
3002
+ return this.connector.addTransactionLine(uuid, articleNo, quantity, aboveLineNr, belowLineNr, showLoader).then((result) => {
3003
3003
  if (result.validationResult && result.validationResult.success) {
3004
3004
  resolve(this._boFactory.makeWithRawBackendData(TransactionInfoResponse, result.resultObject));
3005
3005
  }
@@ -5738,9 +5738,9 @@ class TransactionConnectorAdapterService {
5738
5738
  }
5739
5739
  });
5740
5740
  }
5741
- addExternalCatalogArticlesToTransaction(uuid, catalogId, rawData) {
5741
+ addExternalCatalogArticlesToTransaction(uuid, catalogId, rawData, showLoader = false) {
5742
5742
  return __awaiter(this, void 0, void 0, function* () {
5743
- const response = yield this.connector.addExternalCatalogArticlesToTransaction(uuid, catalogId, rawData);
5743
+ const response = yield this.connector.addExternalCatalogArticlesToTransaction(uuid, catalogId, rawData, showLoader);
5744
5744
  if (response && response.validationResult && response.validationResult.success) {
5745
5745
  return this._boFactory.makeWithRawBackendData(TransactionInfoResponse, response.resultObject);
5746
5746
  }
@@ -6620,9 +6620,9 @@ class TransactionConnectorService {
6620
6620
  return this._adapterService.addWebSessionTransactionLine(transactionUuid, articleNumber, quantity);
6621
6621
  });
6622
6622
  }
6623
- addTransactionLine(uuid, articleNo, quantity, aboveLineNr, belowLineNr) {
6623
+ addTransactionLine(uuid, articleNo, quantity, aboveLineNr, belowLineNr, showLoader = false) {
6624
6624
  return __awaiter(this, void 0, void 0, function* () {
6625
- return this._adapterService.addTransactionLine(uuid, articleNo, quantity, aboveLineNr, belowLineNr);
6625
+ return this._adapterService.addTransactionLine(uuid, articleNo, quantity, aboveLineNr, belowLineNr, showLoader);
6626
6626
  });
6627
6627
  }
6628
6628
  addTextLineToTransaction(uuid, showOnDocuments, text, amount, articleBound, refArticleLineNr, aboveLineNr, belowLineNr) {
@@ -7650,9 +7650,9 @@ class TransactionConnectorService {
7650
7650
  return yield this._adapterService.copySalesQuotation(copyTransactionRequest);
7651
7651
  });
7652
7652
  }
7653
- addExternalCatalogArticlesToTransaction(uuid, catalogId, rawData) {
7653
+ addExternalCatalogArticlesToTransaction(uuid, catalogId, rawData, showLoader = false) {
7654
7654
  return __awaiter(this, void 0, void 0, function* () {
7655
- return yield this._adapterService.addExternalCatalogArticlesToTransaction(uuid, catalogId, rawData);
7655
+ return yield this._adapterService.addExternalCatalogArticlesToTransaction(uuid, catalogId, rawData, showLoader);
7656
7656
  });
7657
7657
  }
7658
7658
  addPaymentLineToTransaction(request) {
@@ -11272,9 +11272,9 @@ class TransactionService extends PendingReasonService {
11272
11272
  return this.connector.getArticleExtended(articleNr);
11273
11273
  });
11274
11274
  }
11275
- addArticle(articleNo, quantity = 1, aboveLineNr = 0, belowLineNr = 0, saveTransaction = true) {
11275
+ addArticle(articleNo, quantity = 1, aboveLineNr = 0, belowLineNr = 0, saveTransaction = true, showLoader = false) {
11276
11276
  return __awaiter(this, void 0, void 0, function* () {
11277
- const response = yield this.addTransactionLine(articleNo, quantity, aboveLineNr, belowLineNr);
11277
+ const response = yield this.addTransactionLine(articleNo, quantity, aboveLineNr, belowLineNr, showLoader);
11278
11278
  if (response !== null) {
11279
11279
  this.transactionDirty = true;
11280
11280
  return this.handleLineOperationStatuses(response, saveTransaction);
@@ -11284,7 +11284,7 @@ class TransactionService extends PendingReasonService {
11284
11284
  }
11285
11285
  });
11286
11286
  }
11287
- addTransactionLine(articleNo, quantity = 1, aboveLineNr = 0, belowLineNr = 0) {
11287
+ addTransactionLine(articleNo, quantity = 1, aboveLineNr = 0, belowLineNr = 0, showLoader = false) {
11288
11288
  return __awaiter(this, void 0, void 0, function* () {
11289
11289
  const created = yield this._checkAndCreateTransaction();
11290
11290
  if (!created) {
@@ -11293,7 +11293,7 @@ class TransactionService extends PendingReasonService {
11293
11293
  const lockSuccess = yield this.tryToLockTransaction(this.currentTransaction.transactionInfo.id, this.currentTransaction.transactionInfo.version);
11294
11294
  if (lockSuccess) {
11295
11295
  this.transactionLineAdded = true;
11296
- const response = yield this.connector.addTransactionLine(this.currentTransaction.transactionInfo.uuid, articleNo, quantity, aboveLineNr, belowLineNr);
11296
+ const response = yield this.connector.addTransactionLine(this.currentTransaction.transactionInfo.uuid, articleNo, quantity, aboveLineNr, belowLineNr, showLoader);
11297
11297
  return response;
11298
11298
  }
11299
11299
  else {
@@ -11309,22 +11309,22 @@ class TransactionService extends PendingReasonService {
11309
11309
  yield this.addArticle(artNr, jsonArticleObject.quantity);
11310
11310
  });
11311
11311
  }
11312
- addExternalCatalogArticle(request) {
11312
+ addExternalCatalogArticle(request, showLoader = false) {
11313
11313
  return __awaiter(this, void 0, void 0, function* () {
11314
- yield this.addExternalCatalogArticleWithRawData(request.catalogId, request.articleJson);
11314
+ yield this.addExternalCatalogArticleWithRawData(request.catalogId, request.articleJson, showLoader);
11315
11315
  });
11316
11316
  }
11317
- addExternalCatalogArticleFromGoodId(jsonArticleString) {
11317
+ addExternalCatalogArticleFromGoodId(jsonArticleString, showLoader = false) {
11318
11318
  return __awaiter(this, void 0, void 0, function* () {
11319
11319
  const jsonArticleObject = JSON.parse(jsonArticleString);
11320
- const response = yield this.addTransactionLine(jsonArticleObject.sku, jsonArticleObject.quantity);
11320
+ const response = yield this.addTransactionLine(jsonArticleObject.sku, jsonArticleObject.quantity, 0, 0, showLoader);
11321
11321
  const handled = yield this.handleLineOperationStatuses(response, true);
11322
11322
  if (handled && jsonArticleObject.price !== undefined) {
11323
11323
  yield this.updatePriceTransactionLine(response.transactionInfo.uuid, response.lineOperationStatuses[0].uuid, jsonArticleObject.price);
11324
11324
  }
11325
11325
  });
11326
11326
  }
11327
- addExternalCatalogArticleWithRawData(catalogId, jsonArticleString) {
11327
+ addExternalCatalogArticleWithRawData(catalogId, jsonArticleString, showLoader = false) {
11328
11328
  return __awaiter(this, void 0, void 0, function* () {
11329
11329
  const created = yield this._checkAndCreateTransaction();
11330
11330
  if (!created) {
@@ -11333,7 +11333,7 @@ class TransactionService extends PendingReasonService {
11333
11333
  const lockSuccess = yield this.tryToLockTransaction(this.currentTransaction.transactionInfo.id, this.currentTransaction.transactionInfo.version);
11334
11334
  if (lockSuccess) {
11335
11335
  this.transactionLineAdded = true;
11336
- const response = yield this.connector.addExternalCatalogArticlesToTransaction(this.currentTransaction.transactionInfo.uuid, catalogId, jsonArticleString);
11336
+ const response = yield this.connector.addExternalCatalogArticlesToTransaction(this.currentTransaction.transactionInfo.uuid, catalogId, jsonArticleString, showLoader);
11337
11337
  yield this.handleLineOperationStatuses(response, true);
11338
11338
  }
11339
11339
  });
@@ -24201,9 +24201,9 @@ TransactionPlanningLineComponent.decorators = [
24201
24201
  [isFirst]="isFirst"
24202
24202
  [draggable]="!linePlanned"
24203
24203
  (dragstart)="dragStarted($event)"
24204
- [checkbox]="!linePlanned && allowPartialDelivery()"
24205
- [checkboxValue]="transactionLine.selected"
24206
- [checkboxReadonly]="false"
24204
+ [checkbox]="true"
24205
+ [checkboxValue]="transactionLine.selected || !allowPartialDelivery()"
24206
+ [checkboxReadonly]="!allowPartialDelivery()"
24207
24207
  (checkboxValueChanged)="handleCheckBoxValueChanged($event, transactionLine)"
24208
24208
  (click)="handleLineClicked($event)"
24209
24209
  observeVisibility #observer=visibilityObserve
@@ -28784,7 +28784,7 @@ class TransactionLineSupplierButtonComponent extends TransactionBaseComponent {
28784
28784
  this._getSupplierDescription();
28785
28785
  }
28786
28786
  _getSupplierDescription() {
28787
- if (this.transactionLine && this.transactionLine.isArticle && this.transactionLine.supplierDescription === undefined && this.visible) {
28787
+ if (this.transactionLine && this.transactionLine.isArticle && this.transactionLine.supplierDescription === undefined) {
28788
28788
  this._relationService.getRelationById(this.transactionLine.supplierId).then((relations) => {
28789
28789
  const relation = relations && relations.length > 0 ? relations[0] : null;
28790
28790
  this.transactionLine.supplierDescription = relation ? relation.displayName : "";
@@ -36271,16 +36271,21 @@ TransactionHeaderDepositAmountComponent.decorators = [
36271
36271
  { type: Component, args: [{
36272
36272
  selector: "co-transaction-header-deposit-amount",
36273
36273
  template: `
36274
- <span *ngIf="(!editMode || headerReadonly) && !defaultEditMode" [textContent]="(transactionInfo.depositAmount | coCurrency) || '...'" [tooltip]="tooltipMessage"></span>
36275
- <co-input-text #input *ngIf="editMode || defaultEditMode"
36276
- [type]="'number'"
36277
- [placeholder]="showLabel ? ('DOWNPAYMENT' | localize) : ''"
36278
- [showSaveCancel]="!headerReadonly"
36279
- [hidden]="hidden"
36280
- [readonly]="readonly || headerReadonly"
36281
- [model]="transactionInfo.depositAmount"
36282
- (blur)="editMode = false"
36283
- ></co-input-text>
36274
+ <span
36275
+ *ngIf="(!editMode || headerReadonly) && !defaultEditMode"
36276
+ [textContent]="(transactionInfo.depositAmount | coCurrency) || '...'"
36277
+ [tooltip]="tooltipMessage">
36278
+ </span>
36279
+ <co-input-text
36280
+ #input
36281
+ *ngIf="editMode || defaultEditMode"
36282
+ [placeholder]="showLabel ? ('DOWNPAYMENT' | localize) : ''"
36283
+ [showSaveCancel]="!headerReadonly"
36284
+ [hidden]="hidden"
36285
+ [readonly]="readonly || headerReadonly"
36286
+ [model]="transactionInfo.depositAmount | coCurrency"
36287
+ (blur)="editMode = false">
36288
+ </co-input-text>
36284
36289
  `,
36285
36290
  providers: [{
36286
36291
  provide: SCREEN_CONFIG_ADAPTER_COMPONENT_INTERFACE_NAME,
@@ -37451,13 +37456,15 @@ CatalogScreenConfigurationService.ctorParameters = () => [
37451
37456
  ];
37452
37457
 
37453
37458
  class DialogCatalogComponent {
37454
- constructor(_transactionService, _catalogService, _catalogEventService, _articleService, _dialogService, _screenConfigService, iconCacheService) {
37459
+ constructor(_transactionService, _catalogService, _catalogEventService, _articleService, _dialogService, _screenConfigService, _productConnectorAdapterService, _transactionEventService, iconCacheService) {
37455
37460
  this._transactionService = _transactionService;
37456
37461
  this._catalogService = _catalogService;
37457
37462
  this._catalogEventService = _catalogEventService;
37458
37463
  this._articleService = _articleService;
37459
37464
  this._dialogService = _dialogService;
37460
37465
  this._screenConfigService = _screenConfigService;
37466
+ this._productConnectorAdapterService = _productConnectorAdapterService;
37467
+ this._transactionEventService = _transactionEventService;
37461
37468
  this.iconCacheService = iconCacheService;
37462
37469
  this.icons = Icon;
37463
37470
  this.handleAddArticleInternally = true;
@@ -37496,6 +37503,8 @@ class DialogCatalogComponent {
37496
37503
  }
37497
37504
  this._subs.push(this._catalogEventService.stockDetailsClick.subscribe((article) => {
37498
37505
  this.handleStockButtonClick(article);
37506
+ }), this._productConnectorAdapterService.showLoader.subscribe((show) => {
37507
+ this._transactionEventService.showLoader.next(show);
37499
37508
  }));
37500
37509
  });
37501
37510
  }
@@ -37721,6 +37730,8 @@ DialogCatalogComponent.ctorParameters = () => [
37721
37730
  { type: ArticleService },
37722
37731
  { type: DialogService },
37723
37732
  { type: CatalogScreenConfigurationService },
37733
+ { type: ProductConnectorAdapterService },
37734
+ { type: TransactionEventService },
37724
37735
  { type: IconCacheService }
37725
37736
  ];
37726
37737
  DialogCatalogComponent.propDecorators = {
@@ -39721,6 +39732,8 @@ class TransactionInternalComponent {
39721
39732
  this.transactionPlanning = false;
39722
39733
  this.cashRegistersDirty = false;
39723
39734
  this.relationChange = new EventEmitter();
39735
+ //This output exists for bundle purposes.
39736
+ this.serviceRequested = new EventEmitter();
39724
39737
  this.showQuickAccess = true;
39725
39738
  this.showButtonBar = true;
39726
39739
  this.activeViewMode = ContentViewMode.List;
@@ -39922,6 +39935,8 @@ class TransactionInternalComponent {
39922
39935
  /*this._transactionConnectorService.createServiceOrderWithSourceTransactionLine(request).then((result: TransactionInfoResponse) => {
39923
39936
  if(result) {*/
39924
39937
  this._transactionEventService.requestCreateServiceOrderFromTransactionLine.next({ transaction: this.transaction, lineNr: lineNr });
39938
+ //added for bundle purposes so we can pass the value along without the event service. Use the event service in all other cases.
39939
+ this.serviceRequested.emit({ transaction: this.transaction.transactionInfo.transactionNr, lineNr: lineNr });
39925
39940
  /* }
39926
39941
  });*/
39927
39942
  }
@@ -40230,6 +40245,7 @@ TransactionInternalComponent.propDecorators = {
40230
40245
  transactionPlanning: [{ type: Input }],
40231
40246
  cashRegistersDirty: [{ type: Input }],
40232
40247
  relationChange: [{ type: Output }],
40248
+ serviceRequested: [{ type: Output }],
40233
40249
  showQuickAccess: [{ type: HostBinding, args: ['class.show-quick-access',] }, { type: Input }],
40234
40250
  showButtonBar: [{ type: HostBinding, args: ['class.show-button-bar',] }, { type: Input }],
40235
40251
  showClass: [{ type: HostBinding, args: ['class.co-transaction-internal',] }],
@@ -48247,6 +48263,12 @@ class TransactionSearchComponent {
48247
48263
  this._subs = [];
48248
48264
  this._subs.push(this._transactionEventService.createTransaction.subscribe(() => this.addTransactionClick.emit()));
48249
48265
  }
48266
+ //Only use this for bundle purposes please!
48267
+ set overrideSearchType(kind) {
48268
+ if (!(kind === null || kind === undefined)) {
48269
+ this.transactionSearchService.transactionType = kind;
48270
+ }
48271
+ }
48250
48272
  showClass() {
48251
48273
  return true;
48252
48274
  }
@@ -48315,6 +48337,7 @@ TransactionSearchComponent.ctorParameters = () => [
48315
48337
  ];
48316
48338
  TransactionSearchComponent.propDecorators = {
48317
48339
  draggableTransactions: [{ type: Input }],
48340
+ overrideSearchType: [{ type: Input }],
48318
48341
  transactionClick: [{ type: Output }],
48319
48342
  addTransactionClick: [{ type: Output }],
48320
48343
  showClass: [{ type: HostBinding, args: ["class.co-transaction-search",] }]
@@ -51599,13 +51622,13 @@ class AddProductComponent {
51599
51622
  if (typeof data.article === 'string') {
51600
51623
  const article = JSON.parse(data.article);
51601
51624
  if (article.selectorData && article.selectorData.compositions) { // configured (frozen) article
51602
- yield this.transactionService.addArticle(article.selectorData.compositions[0].compositionArticleNo, data.quantity, 0, 0 /*, lastArticle*/);
51625
+ yield this.transactionService.addArticle(article.selectorData.compositions[0].compositionArticleNo, data.quantity, 0, 0, true, true);
51603
51626
  }
51604
51627
  }
51605
51628
  else { // flat (simple) article
51606
51629
  const articleNr = data.article['articleNr'] || data.article['articleNumber'] || data.article['articleNo'];
51607
51630
  if (articleNr) {
51608
- yield this.transactionService.addArticle(articleNr, data.quantity, 0, 0 /*, lastArticle*/);
51631
+ yield this.transactionService.addArticle(articleNr, data.quantity, 0, 0, true, true);
51609
51632
  }
51610
51633
  }
51611
51634
  }
@@ -51661,7 +51684,7 @@ class AddProductComponent {
51661
51684
  request.catalogId = iFrameFeedbackObject.catalog;
51662
51685
  request.catalogType = iFrameFeedbackObject.sourceType;
51663
51686
  request.articleJson = iFrameFeedbackObject.jsonString;
51664
- yield this.transactionService.addExternalCatalogArticle(request);
51687
+ yield this.transactionService.addExternalCatalogArticle(request, true);
51665
51688
  });
51666
51689
  }
51667
51690
  handleAddCatFarmArticleClick(data) {
@@ -51671,7 +51694,7 @@ class AddProductComponent {
51671
51694
  request.catalogId = data.catalog;
51672
51695
  request.catalogType = ExternalCatalogTypes.CatalogFarm;
51673
51696
  request.articleJson = data.jsonString;
51674
- yield this.transactionService.addExternalCatalogArticle(request);
51697
+ yield this.transactionService.addExternalCatalogArticle(request, true);
51675
51698
  });
51676
51699
  }
51677
51700
  _prepareCatalogRequest() {
@@ -55278,6 +55301,8 @@ class TransactionComponent {
55278
55301
  this.saveCancelMovable = false;
55279
55302
  this.transactionPlanning = false;
55280
55303
  this.cashRegistersDirty = false;
55304
+ //This output exists for bundle purposes.
55305
+ this.serviceRequested = new EventEmitter();
55281
55306
  this.screenConfigLoaded = false;
55282
55307
  this._fetching = false;
55283
55308
  }
@@ -55381,6 +55406,7 @@ TransactionComponent.decorators = [
55381
55406
  [posOrderData]="posOrderData"
55382
55407
  [transactionPlanning]="transactionPlanning"
55383
55408
  [cashRegistersDirty] = cashRegistersDirty
55409
+ (serviceRequested)="this.serviceRequested.emit($event)"
55384
55410
  ></co-transaction-internal>
55385
55411
  `,
55386
55412
  providers: [
@@ -55414,6 +55440,7 @@ TransactionComponent.propDecorators = {
55414
55440
  saveCancelMovable: [{ type: Input }],
55415
55441
  transactionPlanning: [{ type: Input }],
55416
55442
  cashRegistersDirty: [{ type: Input }],
55443
+ serviceRequested: [{ type: Output }],
55417
55444
  showClass: [{ type: HostBinding, args: ['class.co-transaction',] }],
55418
55445
  checkTransaction: [{ type: HostListener, args: ['window:beforeunload',] }],
55419
55446
  checkRollBack: [{ type: HostListener, args: ['window:unload',] }]
@@ -55604,40 +55631,9 @@ class DialogDirectSellComponent {
55604
55631
  this.showDirectSellModal = new EventEmitter();
55605
55632
  this.icons = Icon;
55606
55633
  this.directSellSuppliers = [];
55607
- this.supplierStockRowSelected = false;
55608
- this.tempObject = {
55609
- articleNumber: 'articleNumber 123',
55610
- availableStock: 10,
55611
- supplierStockForecasts: [
55612
- {
55613
- purchaseOrderNumber: 1,
55614
- amount: 11,
55615
- amountReserved: 7,
55616
- amountAvailable: 4,
55617
- deliveryDate: new Date(),
55618
- confirmedDeliveryDate: new Date(),
55619
- arrivalDate: new Date()
55620
- },
55621
- {
55622
- purchaseOrderNumber: 2,
55623
- amount: 14,
55624
- amountReserved: 7,
55625
- amountAvailable: 7,
55626
- deliveryDate: new Date(),
55627
- confirmedDeliveryDate: new Date(),
55628
- arrivalDate: new Date()
55629
- },
55630
- {
55631
- purchaseOrderNumber: 3,
55632
- amount: 5,
55633
- amountReserved: 1,
55634
- amountAvailable: 4,
55635
- deliveryDate: new Date(),
55636
- confirmedDeliveryDate: new Date(),
55637
- arrivalDate: new Date()
55638
- }
55639
- ]
55640
- };
55634
+ this.availableStockCollection = new SupplierArticleStockForecast();
55635
+ this.formValid = false;
55636
+ this.fromStock = false;
55641
55637
  }
55642
55638
  ngOnInit() {
55643
55639
  this._getDirectSellSuppliers();
@@ -55645,39 +55641,82 @@ class DialogDirectSellComponent {
55645
55641
  hideModal() {
55646
55642
  this.showDirectSellModal.emit(false);
55647
55643
  }
55648
- handleSupplierChanged(supplier) {
55644
+ handleSupplierChanged() {
55649
55645
  this._getAvailableStock();
55650
55646
  }
55651
- handleChecked(event, row, index) {
55647
+ onStockChecked(event) {
55648
+ var _a;
55652
55649
  event.preventDefault();
55653
55650
  event.stopPropagation();
55654
- const checkbox = this.checkboxes.toArray()[index];
55655
- checkbox.model = !checkbox.model;
55651
+ if (this.selectedSupplier && ((_a = this.availableStockCollection.supplierStockForecasts) === null || _a === void 0 ? void 0 : _a.length) > 0) {
55652
+ this.checkboxes.forEach(po => po.model = false);
55653
+ }
55654
+ this.fromStock = !this.fromStock;
55655
+ if (this.fromStock) {
55656
+ this.selectedForecast = null;
55657
+ }
55658
+ this.formValid = this.fromStock;
55659
+ }
55660
+ toggleStockChecked(event) {
55661
+ var _a;
55662
+ if (this.selectedSupplier && ((_a = this.availableStockCollection.supplierStockForecasts) === null || _a === void 0 ? void 0 : _a.length) > 0) {
55663
+ this.checkboxes.forEach(po => po.model = false);
55664
+ }
55665
+ this.formValid = event;
55666
+ }
55667
+ handleChecked(index, selectedForecast, event) {
55668
+ var _a;
55669
+ event.preventDefault();
55670
+ event.stopPropagation();
55671
+ if (this.selectedSupplier && ((_a = this.availableStockCollection.supplierStockForecasts) === null || _a === void 0 ? void 0 : _a.length) > 0) {
55672
+ this.checkboxes.forEach(po => po.model = false);
55673
+ }
55674
+ const selectedCheckbox = this.checkboxes.toArray()[index];
55675
+ selectedCheckbox.model = !selectedCheckbox.model;
55676
+ if (selectedCheckbox.model) {
55677
+ this.selectedForecast = selectedForecast;
55678
+ }
55679
+ this.fromStock = false;
55680
+ this.formValid = selectedCheckbox.model;
55681
+ }
55682
+ toggleForecastChecked(event) {
55683
+ var _a;
55684
+ if (this.selectedSupplier && ((_a = this.availableStockCollection.supplierStockForecasts) === null || _a === void 0 ? void 0 : _a.length) > 0) {
55685
+ this.checkboxes.forEach(po => po.model = false);
55686
+ }
55687
+ this.fromStock = false;
55688
+ this.formValid = event;
55656
55689
  }
55657
55690
  onOkClick() {
55658
55691
  const changeLineDirectSellRequest = {
55659
55692
  transactionUuid: this.transactionUuid,
55660
55693
  lineUuid: this.lineUuid,
55661
- newDirectSell: true
55694
+ newDirectSell: !this.fromStock,
55695
+ newSupplierId: this.selectedSupplier.relationId,
55696
+ newPurchaseOrderNumber: this.fromStock ? null : this.selectedForecast.purchaseOrderNumber.toString(),
55697
+ newStockForecastDeliveryDate: this.fromStock ? null : this.selectedForecast.deliveryDate
55662
55698
  };
55663
- // this.transactionService.changeLineDirectSell(changeLineDirectSellRequest).then((response) => {
55664
- // console.log(response);
55665
- // });
55699
+ this.transactionService.changeLineDirectSell(changeLineDirectSellRequest).then((response) => {
55700
+ console.log(response);
55701
+ });
55666
55702
  this.hideModal();
55667
55703
  }
55668
55704
  _getAvailableStock() {
55669
55705
  return __awaiter(this, void 0, void 0, function* () {
55670
55706
  // TODO this method doesn't retrieve any data for now, until we fix ESB instance as this is a call to a third party
55671
- // await this.transactionService.getAvailableStockForSupplier(this.goodId, this.selectedSupplier.relationId).then((availableStock) => {
55672
- // this.availableStockCollection = availableStock;
55673
- // });
55674
- // For now, we will use dummy data
55675
- this.availableStockCollection = this.tempObject;
55707
+ yield this.transactionService.getAvailableStockForSupplier(this.goodId, this.selectedSupplier.relationId).then((availableStock) => {
55708
+ if (availableStock) {
55709
+ this.availableStockCollection = availableStock;
55710
+ }
55711
+ });
55676
55712
  });
55677
55713
  }
55678
55714
  _getDirectSellSuppliers() {
55679
55715
  this._relationService.getDirectSellSuppliers().then((suppliers) => {
55680
55716
  this.directSellSuppliers = suppliers;
55717
+ if (this.directSellSuppliers.length === 1) {
55718
+ this.selectedSupplier = this.directSellSuppliers[0];
55719
+ }
55681
55720
  });
55682
55721
  }
55683
55722
  }
@@ -55695,30 +55734,37 @@ DialogDirectSellComponent.decorators = [
55695
55734
  <div class="supplier-list-wrapper flex">
55696
55735
  <co-list-of-values
55697
55736
  class="supplier-list"
55698
- label="Direct Sell Supplier"
55737
+ [label]="'FROM_SUPPLIER' | localize"
55699
55738
  [required]="true"
55700
55739
  [noClickFocus]="true"
55701
55740
  [searchPlaceholder]="'SEARCH' | localize"
55702
55741
  [collection]="directSellSuppliers"
55703
55742
  [displayField]="'supplierName'"
55704
55743
  [(model)]="selectedSupplier"
55705
- (modelChange)="handleSupplierChanged($event)">
55744
+ (modelChange)="handleSupplierChanged()">
55706
55745
  </co-list-of-values>
55707
55746
  </div>
55708
55747
 
55709
55748
  <div class="available-stock checkbox-list-wrapper" *ngIf="selectedSupplier">
55710
- <div class="checkbox-list-item">
55749
+ <div
55750
+ class="checkbox-list-item"
55751
+ [class.checked]="fromStock"
55752
+ (click)="onStockChecked($event)">
55711
55753
  <div class="cell">
55712
55754
  <div class="checkbox-wrapper">
55713
- <co-input-checkbox [model]="false"></co-input-checkbox>
55755
+ <co-input-checkbox
55756
+ [(model)]="fromStock"
55757
+ (modelChange)="toggleStockChecked($event)">
55758
+ </co-input-checkbox>
55714
55759
  </div>
55715
55760
  </div>
55716
55761
  <div class="cell">Uit vooraad</div>
55717
- <div class="cell"><strong>{{availableStockCollection.availableStock}}</strong></div>
55762
+ <div class="cell"><strong>{{ availableStockCollection.availableStock }}</strong></div>
55718
55763
  </div>
55719
55764
  </div>
55720
55765
 
55721
- <div class="forecast-table" *ngIf="selectedSupplier">
55766
+ <div class="forecast-table"
55767
+ *ngIf="selectedSupplier && availableStockCollection.supplierStockForecasts?.length > 0">
55722
55768
  <div class="forecast-table-header">
55723
55769
  <div class="cell"></div>
55724
55770
  <div class="cell">Order</div>
@@ -55734,30 +55780,34 @@ DialogDirectSellComponent.decorators = [
55734
55780
  #scrollingItem
55735
55781
  class="checkbox-list-item"
55736
55782
  [class.checked]="checkbox.model"
55737
- (click)="handleChecked($event, row, i)">
55783
+ (click)="handleChecked(i, row, $event)">
55738
55784
  <div class="cell">
55739
55785
  <div class="checkbox-wrapper">
55740
- <co-input-checkbox #checkbox [model]="false"></co-input-checkbox>
55786
+ <co-input-checkbox
55787
+ #checkbox
55788
+ [(model)]="checkbox.model"
55789
+ (modelChange)="toggleForecastChecked($event)">
55790
+ </co-input-checkbox>
55741
55791
  </div>
55742
55792
  </div>
55743
- <div class="cell">{{row.purchaseOrderNumber}}</div>
55744
- <div class="cell">{{row.amount}}</div>
55745
- <div class="cell">{{row.deliveryDate | date}}</div>
55746
- <div class="cell">{{row.confirmedDeliveryDate | date}}</div>
55747
- <div class="cell">{{row.arrivalDate | date}}</div>
55793
+ <div class="cell">{{ row.purchaseOrderNumber }}</div>
55794
+ <div class="cell">{{ row.amount }}</div>
55795
+ <div class="cell">{{ row.deliveryDate | date }}</div>
55796
+ <div class="cell">{{ row.confirmedDeliveryDate | date }}</div>
55797
+ <div class="cell">{{ row.arrivalDate | date }}</div>
55748
55798
  </div>
55749
55799
  </div>
55750
55800
  </div>
55751
55801
  </co-dialog>
55752
55802
  <ng-template #headerTemplate>
55753
55803
  <co-icon [iconData]="iconCacheService.getIcon(icons.IndustryRegular)"></co-icon>
55754
- <div class="co-dialog-header-title" [textContent]="'CASH_ON_DELIVERY' | localize"></div>
55804
+ <div class="co-dialog-header-title" [textContent]="'DIRECT_SELL' | localize"></div>
55755
55805
  </ng-template>
55756
55806
  <ng-template #footerTemplate>
55757
55807
  <div class="co-dialog-footer-button-wrapper">
55758
55808
  <co-button
55759
55809
  class="save-button"
55760
- [disabled]="true"
55810
+ [disabled]="!formValid"
55761
55811
  [iconData]="iconCacheService.getIcon(icons.CheckDuotone)"
55762
55812
  (click)="onOkClick()">
55763
55813
  </co-button>
@@ -55766,11 +55816,6 @@ DialogDirectSellComponent.decorators = [
55766
55816
  [iconData]="iconCacheService.getIcon(icons.Crossskinny)"
55767
55817
  (click)="hideModal()">
55768
55818
  </co-button>
55769
- <co-button
55770
- class="close-button"
55771
- [iconData]="iconCacheService.getIcon(icons.TrashCanLight)"
55772
- (click)="hideModal()">
55773
- </co-button>
55774
55819
  </div>
55775
55820
  </ng-template>
55776
55821
  `,
@@ -56733,6 +56778,8 @@ class TransactionCreateWizardComponent {
56733
56778
  this.transactionType = TransactionKind.ServiceOrder;
56734
56779
  this.noLockOnCustomerSet = false;
56735
56780
  this._externallyProvidedTransaction = null;
56781
+ //for bundle puroses where an new, non transaction based, service should always start with the customer already set
56782
+ this._externallyProvidedCustomer = null;
56736
56783
  }
56737
56784
  set externallyProvidedTransaction(transaction) {
56738
56785
  this._externallyProvidedTransaction = transaction;
@@ -56740,6 +56787,9 @@ class TransactionCreateWizardComponent {
56740
56787
  set externallyProvidedLineNr(lineNr) {
56741
56788
  this._externallyProvidedLineNr = lineNr;
56742
56789
  }
56790
+ set externallyProvidedCustomer(customer) {
56791
+ this._externallyProvidedCustomer = customer;
56792
+ }
56743
56793
  showClass() {
56744
56794
  return true;
56745
56795
  }
@@ -56748,7 +56798,7 @@ class TransactionCreateWizardComponent {
56748
56798
  yield this.transactionScreenConfigurationService.loadConfig(['S']);
56749
56799
  this.createService.transactionKind = this.transactionType;
56750
56800
  this.createService.createNewRelation();
56751
- this._processExternalTransactionLine();
56801
+ this._processExternalSettings();
56752
56802
  });
56753
56803
  }
56754
56804
  handleRelationValidation() {
@@ -56857,7 +56907,7 @@ class TransactionCreateWizardComponent {
56857
56907
  return valid;
56858
56908
  });
56859
56909
  }
56860
- _processExternalTransactionLine() {
56910
+ _processExternalSettings() {
56861
56911
  return __awaiter(this, void 0, void 0, function* () {
56862
56912
  if (this._externallyProvidedTransaction && !isNaN(this._externallyProvidedLineNr)) {
56863
56913
  //fetch relation and create needed transaction first.
@@ -56876,6 +56926,11 @@ class TransactionCreateWizardComponent {
56876
56926
  this.stepper.openToIndex(3);
56877
56927
  }
56878
56928
  }
56929
+ else if (this._externallyProvidedCustomer) {
56930
+ this.noLockOnCustomerSet = true;
56931
+ this.createService.relation = this._externallyProvidedCustomer;
56932
+ this.stepper.openToIndex(2);
56933
+ }
56879
56934
  });
56880
56935
  }
56881
56936
  }
@@ -56930,6 +56985,7 @@ TransactionCreateWizardComponent.propDecorators = {
56930
56985
  serviceFieldsSection: [{ type: ViewChild, args: ["serviceFieldsSection",] }],
56931
56986
  externallyProvidedTransaction: [{ type: Input }],
56932
56987
  externallyProvidedLineNr: [{ type: Input }],
56988
+ externallyProvidedCustomer: [{ type: Input }],
56933
56989
  transactionFinished: [{ type: Output }],
56934
56990
  showClass: [{ type: HostBinding, args: ["class.co-transaction-create-wizard",] }]
56935
56991
  };