@colijnit/transaction 256.1.17 → 256.1.18

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 (21) hide show
  1. package/bundles/colijnit-transaction.umd.js +84 -33
  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 +2 -1
  5. package/esm2015/lib/component/dialog/transaction-line/dialog-transaction-line-warehouse-cc/dialog-direct-sell.component.js +6 -3
  6. package/esm2015/lib/component/dialog/transaction-line/dialog-transaction-line-warehouse-cc/dialog-transaction-line-warehouse-cc.component.js +3 -1
  7. package/esm2015/lib/component/save-cancel-buttons/save-cancel-buttons.component.js +16 -7
  8. package/esm2015/lib/service/transaction-base.service.js +1 -8
  9. package/esm2015/lib/service/transaction-connector-adapter.service.js +2 -2
  10. package/esm2015/lib/service/transaction-connector.service.js +1 -1
  11. package/esm2015/lib/service/transaction.service.js +19 -4
  12. package/esm2015/lib/transaction-version.js +3 -3
  13. package/fesm2015/colijnit-transaction.js +42 -21
  14. package/fesm2015/colijnit-transaction.js.map +1 -1
  15. package/lib/component/dialog/transaction-line/dialog-transaction-line-warehouse-cc/dialog-direct-sell.component.d.ts +2 -0
  16. package/lib/component/save-cancel-buttons/save-cancel-buttons.component.d.ts +5 -3
  17. package/lib/service/transaction-base.service.d.ts +0 -1
  18. package/lib/service/transaction-connector-adapter.service.d.ts +1 -1
  19. package/lib/service/transaction-connector.service.d.ts +1 -1
  20. package/lib/service/transaction.service.d.ts +1 -1
  21. package/package.json +2 -2
@@ -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.17";
7
- this.publishDate = "25/11/2024, 12:08:56";
6
+ this.symVer = "256.1.18";
7
+ this.publishDate = "26/11/2024, 15:02:32";
8
8
  }
9
9
  }
10
- //# sourceMappingURL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JuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSx1REFBdUQ7QUFDdkQsTUFBTSxPQUFPLE9BQU87SUFBcEI7UUFDUyxTQUFJLEdBQUcsdUJBQXVCLENBQUM7UUFDL0IsZ0JBQVcsR0FBRywrQkFBK0IsQ0FBQztRQUM5QyxXQUFNLEdBQUcsVUFBVSxDQUFDO1FBQ3BCLGdCQUFXLEdBQUcsc0JBQXNCLENBQUM7SUFDOUMsQ0FBQztDQUFBIiwic291cmNlc0NvbnRlbnQiOlsiLy8gdGhpcyBmaWxlIGlzIGR5bmFtaWNhbGx5IGNyZWF0ZWQsIGRvIG5vdCBjaGFuZ2UgdGhpc1xuZXhwb3J0IGNsYXNzIFZlcnNpb24ge1xuICBwdWJsaWMgbmFtZSA9IFwiQGNvbGlqbml0L3RyYW5zYWN0aW9uXCI7XG4gIHB1YmxpYyBkZXNjcmlwdGlvbiA9IFwiQ29saWpuIElUIHRyYW5zYWN0aW9uIHBhY2thZ2VcIjtcbiAgcHVibGljIHN5bVZlciA9IFwiMjU2LjEuMThcIjtcbiAgcHVibGljIHB1Ymxpc2hEYXRlID0gXCIyNi8xMS8yMDI0LCAxNTowMjozMlwiO1xufSJdfQ==
@@ -269,6 +269,7 @@ import { WorkflowCategoryType } from '@colijnit/mainapi/build/enum/workflow-cate
269
269
  import { PdfPosReceiptRequest } from '@colijnit/transactionapi/build/model/pdf-pos-receipt-request';
270
270
  import { TransactionAddPaymentLineRequest } from '@colijnit/transactionapi/build/model/transaction-add-payment-line-request';
271
271
  import { take } from 'rxjs/operators';
272
+ import { SupplierStockForecast } from '@colijnit/transactionapi/build/model/supplier-stock-forecast';
272
273
  import { TagCategory } from '@colijnit/mainapi/build/enum/tab-category.enum';
273
274
  import { CssUtils } from '@colijnit/mainapi/build/utils/css-utils';
274
275
  import { CoDocument as CoDocument$1 } from '@colijnit/sharedapi/build/model/co-document.bo';
@@ -278,8 +279,8 @@ class Version {
278
279
  constructor() {
279
280
  this.name = "@colijnit/transaction";
280
281
  this.description = "Colijn IT transaction package";
281
- this.symVer = "256.1.17";
282
- this.publishDate = "25/11/2024, 12:08:56";
282
+ this.symVer = "256.1.18";
283
+ this.publishDate = "26/11/2024, 15:02:32";
283
284
  }
284
285
  }
285
286
 
@@ -4429,7 +4430,7 @@ class TransactionConnectorAdapterService {
4429
4430
  return __awaiter(this, void 0, void 0, function* () {
4430
4431
  const response = yield this.connector.changeLineDirectSell(request);
4431
4432
  if (response && response.validationResult && response.validationResult.success) {
4432
- return response.resultObject;
4433
+ return this._boFactory.makeWithRawBackendData(TransactionInfoResponse, response.resultObject);
4433
4434
  }
4434
4435
  else {
4435
4436
  this._handleExceptionFromResponse(response);
@@ -8846,6 +8847,8 @@ DialogTransactionLineWarehouseCcComponent.decorators = [
8846
8847
  [transactionUuid]="transactionInfo.uuid"
8847
8848
  [lineUuid]="transactionLine.uuid"
8848
8849
  [goodId]="transactionLine.goodId"
8850
+ [transactionId]="transactionInfo.id"
8851
+ [version]="transactionInfo.version"
8849
8852
  (showDirectSellModal)="showDirectSellModal($event)">
8850
8853
  </co-dialog-sell>
8851
8854
  `,
@@ -9624,7 +9627,6 @@ class TransactionBaseService extends BaseModuleService {
9624
9627
  this._transactionDirty = false;
9625
9628
  this._cashRegistersDirty = false;
9626
9629
  this._salesOrderConfirmationSent = false;
9627
- this._subs = [];
9628
9630
  }
9629
9631
  set activeRubric(value) {
9630
9632
  this._activeRubric = value;
@@ -9756,12 +9758,6 @@ class TransactionBaseService extends BaseModuleService {
9756
9758
  yield this.sharedService.init(options);
9757
9759
  yield this.relationService.init(options);
9758
9760
  yield this.connector.connect();
9759
- this._subs.push(this.transactionEventService.saveTransactionClick.subscribe(() => {
9760
- this.transactionEventService.blockScreen.next(true);
9761
- this.saveTransactionAndCommit();
9762
- }), this.transactionEventService.cancelTransactionClick.subscribe(() => {
9763
- this.rollback(true, true);
9764
- }));
9765
9761
  });
9766
9762
  }
9767
9763
  createNewRelation() {
@@ -10387,7 +10383,7 @@ class TransactionService extends PendingReasonService {
10387
10383
  }
10388
10384
  prepareJsPickingListInternalParam() {
10389
10385
  return __awaiter(this, void 0, void 0, function* () {
10390
- this.getInternalParameter(InternalParam.PickingList).then((value) => this.internalParameterJsPickingList = value);
10386
+ this.internalParameterJsPickingList = yield this.getInternalParameter(InternalParam.PickingList);
10391
10387
  });
10392
10388
  }
10393
10389
  prepareManualSaveInternalParam() {
@@ -11761,8 +11757,23 @@ class TransactionService extends PendingReasonService {
11761
11757
  return yield this.connector.getAvailableStockForSupplier(goodId, supplierRelationId);
11762
11758
  });
11763
11759
  }
11764
- changeLineDirectSell(request) {
11765
- return this.connector.changeLineDirectSell(request);
11760
+ // public changeLineDirectSell(request: ChangeLineDirectSellRequest): Promise<void> {
11761
+ // return this.connector.changeLineDirectSell(request);
11762
+ // }
11763
+ changeLineDirectSell(transactionId, version, request) {
11764
+ return __awaiter(this, void 0, void 0, function* () {
11765
+ const lockSuccess = yield this.tryToLockTransaction(transactionId, version);
11766
+ console.log('lockSuccess', lockSuccess);
11767
+ if (lockSuccess) {
11768
+ const response = yield this.connector.changeLineDirectSell(request);
11769
+ let success = true;
11770
+ if (response) {
11771
+ this.transactionDirty = true;
11772
+ success = yield this.handleHeaderOperationStatuses(response);
11773
+ }
11774
+ return success;
11775
+ }
11776
+ });
11766
11777
  }
11767
11778
  getGoodsAllocationHistory(transId, lineNr) {
11768
11779
  return __awaiter(this, void 0, void 0, function* () {
@@ -52364,6 +52375,7 @@ class AddProductComponent {
52364
52375
  // if (!this.showRelatedProductsPopup) {
52365
52376
  // this.showCatalog = false;
52366
52377
  // }
52378
+ this.showCatalog = false;
52367
52379
  if (this.handleAddArticleInternally) {
52368
52380
  if (data && data.article) {
52369
52381
  if (typeof data.article === 'string') {
@@ -56394,6 +56406,7 @@ class DialogDirectSellComponent {
56394
56406
  this.availableStockCollection = new SupplierArticleStockForecast();
56395
56407
  this.formValid = false;
56396
56408
  this.fromStock = false;
56409
+ this.selectedForecast = new SupplierStockForecast();
56397
56410
  }
56398
56411
  ngOnInit() {
56399
56412
  this._getDirectSellSuppliers();
@@ -56456,14 +56469,13 @@ class DialogDirectSellComponent {
56456
56469
  newPurchaseOrderNumber: this.fromStock ? null : this.selectedForecast.purchaseOrderNumber.toString(),
56457
56470
  newStockForecastDeliveryDate: this.fromStock ? null : this.selectedForecast.deliveryDate
56458
56471
  };
56459
- this.transactionService.changeLineDirectSell(changeLineDirectSellRequest).then((response) => {
56472
+ this.transactionService.changeLineDirectSell(this.transactionId, this.version, changeLineDirectSellRequest).then((response) => {
56460
56473
  console.log(response);
56461
56474
  });
56462
56475
  this.hideModal();
56463
56476
  }
56464
56477
  _getAvailableStock() {
56465
56478
  return __awaiter(this, void 0, void 0, function* () {
56466
- // TODO this method doesn't retrieve any data for now, until we fix ESB instance as this is a call to a third party
56467
56479
  yield this.transactionService.getAvailableStockForSupplier(this.goodId, this.selectedSupplier.relationId).then((availableStock) => {
56468
56480
  if (availableStock) {
56469
56481
  this.availableStockCollection = availableStock;
@@ -56591,6 +56603,8 @@ DialogDirectSellComponent.propDecorators = {
56591
56603
  transactionUuid: [{ type: Input }],
56592
56604
  lineUuid: [{ type: Input }],
56593
56605
  goodId: [{ type: Input }],
56606
+ transactionId: [{ type: Input }],
56607
+ version: [{ type: Input }],
56594
56608
  showDirectSellModal: [{ type: Output }],
56595
56609
  checkboxes: [{ type: ViewChildren, args: ['checkbox',] }]
56596
56610
  };
@@ -56738,9 +56752,10 @@ TransactionCashRegisterOrderReceiptDialogModule.decorators = [
56738
56752
  ];
56739
56753
 
56740
56754
  class SaveCancelButtonsComponent {
56741
- constructor(iconCacheService, _transactionEventService) {
56755
+ constructor(iconCacheService, _transactionEventService, _transactionService) {
56742
56756
  this.iconCacheService = iconCacheService;
56743
56757
  this._transactionEventService = _transactionEventService;
56758
+ this._transactionService = _transactionService;
56744
56759
  this.icons = Icon;
56745
56760
  this.showLabels = true;
56746
56761
  this.movable = false;
@@ -56778,12 +56793,17 @@ class SaveCancelButtonsComponent {
56778
56793
  }
56779
56794
  }
56780
56795
  handleSaveClick(event) {
56781
- event.preventDefault();
56782
- this._transactionEventService.saveTransactionClick.next();
56796
+ return __awaiter(this, void 0, void 0, function* () {
56797
+ event.preventDefault();
56798
+ this._transactionEventService.blockScreen.next(true);
56799
+ yield this._transactionService.saveTransactionAndCommit();
56800
+ });
56783
56801
  }
56784
56802
  handleCancelClick(event) {
56785
- event.preventDefault();
56786
- this._transactionEventService.cancelTransactionClick.next();
56803
+ return __awaiter(this, void 0, void 0, function* () {
56804
+ event.preventDefault();
56805
+ yield this._transactionService.rollback(true, true);
56806
+ });
56787
56807
  }
56788
56808
  }
56789
56809
  SaveCancelButtonsComponent.decorators = [
@@ -56824,7 +56844,8 @@ SaveCancelButtonsComponent.decorators = [
56824
56844
  ];
56825
56845
  SaveCancelButtonsComponent.ctorParameters = () => [
56826
56846
  { type: IconCacheService },
56827
- { type: TransactionEventService }
56847
+ { type: TransactionEventService },
56848
+ { type: TransactionService }
56828
56849
  ];
56829
56850
  SaveCancelButtonsComponent.propDecorators = {
56830
56851
  saveCancelButtonsWrapper: [{ type: ViewChild, args: ['saveCancelButtonsWrapper', { read: ElementRef },] }],