@colijnit/transaction 12.1.179 → 12.1.180

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 (27) hide show
  1. package/bundles/colijnit-transaction.umd.js +71 -25
  2. package/bundles/colijnit-transaction.umd.js.map +1 -1
  3. package/colijnit-transaction.metadata.json +1 -1
  4. package/esm2015/lib/component/checkout/checkout-overview-relation-edit/checkout-overview-relation-edit.component.js +1 -1
  5. package/esm2015/lib/component/transaction-header-fields/transaction-header-administrative-relation.component.js +4 -4
  6. package/esm2015/lib/component/transaction-header-fields/transaction-header-currency.component.js +4 -4
  7. package/esm2015/lib/component/transaction-header-fields/transaction-header-delivery-method.component.js +4 -1
  8. package/esm2015/lib/component/transaction-header-fields/transaction-header-sales-person.component.js +4 -4
  9. package/esm2015/lib/component/transaction-line/transaction-invoice-line/transaction-invoice-line-base.component.js +2 -1
  10. package/esm2015/lib/component/transaction-line/transaction-order-delivery-line/transaction-order-delivery-line-base.component.js +2 -1
  11. package/esm2015/lib/component/transaction-quick-access/transaction-quick-access-invoice/transaction-quick-access-invoice.component.js +2 -2
  12. package/esm2015/lib/component/transaction-quick-access/transaction-quick-access-order-delivery/transaction-quick-access-order-delivery.component.js +2 -2
  13. package/esm2015/lib/component/transaction-tags/transaction-tags.component.js +17 -13
  14. package/esm2015/lib/service/transaction-connector-adapter.service.js +17 -1
  15. package/esm2015/lib/service/transaction-connector.service.js +6 -1
  16. package/esm2015/lib/service/transaction.service.js +7 -7
  17. package/esm2015/lib/transaction-version.js +3 -3
  18. package/fesm2015/colijnit-transaction.js +53 -23
  19. package/fesm2015/colijnit-transaction.js.map +1 -1
  20. package/lib/component/transaction-header-fields/transaction-header-administrative-relation.component.d.ts +1 -1
  21. package/lib/component/transaction-header-fields/transaction-header-currency.component.d.ts +1 -1
  22. package/lib/component/transaction-header-fields/transaction-header-sales-person.component.d.ts +1 -1
  23. package/lib/component/transaction-tags/transaction-tags.component.d.ts +9 -7
  24. package/lib/service/transaction-connector-adapter.service.d.ts +1 -0
  25. package/lib/service/transaction-connector.service.d.ts +1 -0
  26. package/lib/service/transaction.service.d.ts +1 -1
  27. package/package.json +1 -1
@@ -31,8 +31,8 @@
31
31
  function Version() {
32
32
  this.name = "@colijnit/transaction";
33
33
  this.description = "Colijn IT transaction package";
34
- this.symVer = "12.1.179";
35
- this.publishDate = "28-12-2023 18:39:19";
34
+ this.symVer = "12.1.180";
35
+ this.publishDate = "29-12-2023 17:08:18";
36
36
  }
37
37
  return Version;
38
38
  }());
@@ -4522,6 +4522,31 @@
4522
4522
  });
4523
4523
  });
4524
4524
  };
4525
+ TransactionConnectorAdapterService.prototype.changeHeaderTransactionCurrency = function (uuid, currencyCode) {
4526
+ return __awaiter(this, void 0, void 0, function () {
4527
+ var request, response;
4528
+ return __generator(this, function (_a) {
4529
+ switch (_a.label) {
4530
+ case 0:
4531
+ request = {
4532
+ transactionUuid: uuid,
4533
+ newCurrencyCode: currencyCode
4534
+ };
4535
+ return [4 /*yield*/, this.connector.changeHeaderCurrency(request)];
4536
+ case 1:
4537
+ response = _a.sent();
4538
+ if (response && response.validationResult && response.validationResult.success) {
4539
+ return [2 /*return*/, this._boFactory.makeWithRawBackendData(transactionInfoResponse_bo.TransactionInfoResponse, response.resultObject)];
4540
+ }
4541
+ else {
4542
+ this._handleExceptionFromResponse(response);
4543
+ return [2 /*return*/, null];
4544
+ }
4545
+ return [2 /*return*/];
4546
+ }
4547
+ });
4548
+ });
4549
+ };
4525
4550
  TransactionConnectorAdapterService.prototype.changeHeaderTransactionMarketing = function (uuid, code) {
4526
4551
  return __awaiter(this, void 0, void 0, function () {
4527
4552
  var request, response;
@@ -7781,6 +7806,13 @@
7781
7806
  });
7782
7807
  });
7783
7808
  };
7809
+ TransactionConnectorService.prototype.changeHeaderTransactionCurrency = function (uuid, currencyCode) {
7810
+ return __awaiter(this, void 0, void 0, function () {
7811
+ return __generator(this, function (_a) {
7812
+ return [2 /*return*/, this._adapterService.changeHeaderTransactionCurrency(uuid, currencyCode)];
7813
+ });
7814
+ });
7815
+ };
7784
7816
  TransactionConnectorService.prototype.changeHeaderTransactionMarketing = function (uuid, code) {
7785
7817
  return __awaiter(this, void 0, void 0, function () {
7786
7818
  return __generator(this, function (_a) {
@@ -11593,15 +11625,20 @@
11593
11625
  });
11594
11626
  });
11595
11627
  };
11596
- TransactionService.prototype.updateHeaderTransactionCurrency = function (uuid, currencyId, saveTransaction) {
11628
+ TransactionService.prototype.updateHeaderTransactionCurrency = function (uuid, currencyCode, saveTransaction) {
11597
11629
  return __awaiter(this, void 0, void 0, function () {
11630
+ var response;
11598
11631
  return __generator(this, function (_a) {
11599
- // not in middletier yet
11600
- // const response: TransactionInfoResponse | boolean = await this.connector.changeHeaderTransactionCurrency(uuid, currencyId);
11601
- // if (response) {
11602
- // return this.handleHeaderOperationStatuses(response);
11603
- // }
11604
- return [2 /*return*/, true];
11632
+ switch (_a.label) {
11633
+ case 0: return [4 /*yield*/, this.connector.changeHeaderTransactionCurrency(uuid, currencyCode)];
11634
+ case 1:
11635
+ response = _a.sent();
11636
+ if (response) {
11637
+ this.transactionDirty = true;
11638
+ return [2 /*return*/, this.handleHeaderOperationStatuses(response, saveTransaction)];
11639
+ }
11640
+ return [2 /*return*/, true];
11641
+ }
11605
11642
  });
11606
11643
  });
11607
11644
  };
@@ -19052,6 +19089,7 @@
19052
19089
  this.showCheckbox = this.canAllLinesBeDelivered && !this.lineIsDelivered;
19053
19090
  this.selected = true;
19054
19091
  this.checkboxReadonly = true;
19092
+ this.transactionEventService.lineSelectedForDelivery.next({ lineUuid: this.transactionLine.uuid, selected: this.transactionLine.selected });
19055
19093
  }
19056
19094
  this.detectChanges();
19057
19095
  }
@@ -19117,7 +19155,7 @@
19117
19155
  this._subs.push(this.transactionEventService.allLinesSelectedForDelivery.subscribe(function () { return __awaiter(_this, void 0, void 0, function () {
19118
19156
  return __generator(this, function (_a) {
19119
19157
  switch (_a.label) {
19120
- case 0: return [4 /*yield*/, this.transactionService.updateQuantitySelectedForAllLines(this.transaction, this.allSelected)];
19158
+ case 0: return [4 /*yield*/, this.transactionService.updateQuantitySelectedForAllLines(this.transaction, this.allSelected || !this.transactionInfo.allowPartialDelivery)];
19121
19159
  case 1:
19122
19160
  _a.sent();
19123
19161
  return [2 /*return*/];
@@ -20270,7 +20308,7 @@
20270
20308
  this._subs.push(this.transactionEventService.allLinesSelectedForInvoice.subscribe(function () { return __awaiter(_this, void 0, void 0, function () {
20271
20309
  return __generator(this, function (_a) {
20272
20310
  switch (_a.label) {
20273
- case 0: return [4 /*yield*/, this.transactionService.updateQuantitySelectedForAllLines(this.transaction, this.allSelected)];
20311
+ case 0: return [4 /*yield*/, this.transactionService.updateQuantitySelectedForAllLines(this.transaction, this.allSelected || !this.transactionInfo.allowPartialDelivery)];
20274
20312
  case 1:
20275
20313
  _a.sent();
20276
20314
  return [2 /*return*/];
@@ -20485,6 +20523,7 @@
20485
20523
  this.showCheckbox = this.canAllLinesBeInvoiced && !this.lineIsInvoiced;
20486
20524
  this.selected = true;
20487
20525
  this.checkboxReadonly = true;
20526
+ this.transactionEventService.lineSelectedForInvoice.next({ lineUuid: this.transactionLine.uuid, selected: this.transactionLine.selected });
20488
20527
  }
20489
20528
  this.detectChanges();
20490
20529
  }
@@ -29400,6 +29439,9 @@
29400
29439
  };
29401
29440
  TransactionHeaderDeliveryMethodComponent.prototype.transactionInfoSet = function () {
29402
29441
  _super.prototype.transactionInfoSet.call(this);
29442
+ if (!this.transactionInfo.headerInfoStatus) {
29443
+ return;
29444
+ }
29403
29445
  this.headerReadonly = this.headerReadonly || this.transactionInfo.headerInfoStatus.isFullyDelivered || this.transactionInfo.headerInfoStatus.isFullyInvoiced;
29404
29446
  if (this.transactionInfo.headerInfoStatus.isFullyDelivered) {
29405
29447
  this.addHeaderTooltipMessage(this.dictionaryService.get("COMPLETELY_DELIVERED"));
@@ -30631,13 +30673,13 @@
30631
30673
  return __generator(this, function (_a) {
30632
30674
  switch (_a.label) {
30633
30675
  case 0:
30634
- if (!(this.transactionInfo.salesPerson !== relation)) return [3 /*break*/, 2];
30676
+ if (!(this.transactionInfo.salesPerson !== relation.relationId)) return [3 /*break*/, 2];
30635
30677
  oldSalesPerson = this.transactionInfo.salesPerson;
30636
- return [4 /*yield*/, this.transactionService.updateHeaderTransactionSalesPerson(this.transactionInfo.uuid, relation, this.lockAndSave)];
30678
+ return [4 /*yield*/, this.transactionService.updateHeaderTransactionSalesPerson(this.transactionInfo.uuid, relation.relationId, this.lockAndSave)];
30637
30679
  case 1:
30638
30680
  success = _a.sent();
30639
30681
  if (!success) {
30640
- this.transactionInfo.salesPerson = relation;
30682
+ this.transactionInfo.salesPerson = relation.relationId;
30641
30683
  this._setSalesPerson();
30642
30684
  return [2 /*return*/, success];
30643
30685
  }
@@ -30721,13 +30763,13 @@
30721
30763
  return __generator(this, function (_a) {
30722
30764
  switch (_a.label) {
30723
30765
  case 0:
30724
- if (!(this.transactionInfo.admCoordinator !== relation)) return [3 /*break*/, 2];
30766
+ if (!(this.transactionInfo.admCoordinator !== relation.relationId)) return [3 /*break*/, 2];
30725
30767
  oldAdm = this.transactionInfo.admCoordinator;
30726
- return [4 /*yield*/, this.transactionService.updateHeaderTransactionAdmCoordinator(this.transactionInfo.uuid, relation, this.lockAndSave)];
30768
+ return [4 /*yield*/, this.transactionService.updateHeaderTransactionAdmCoordinator(this.transactionInfo.uuid, relation.relationId, this.lockAndSave)];
30727
30769
  case 1:
30728
30770
  success = _a.sent();
30729
30771
  if (!success) {
30730
- this.transactionInfo.admCoordinator = relation;
30772
+ this.transactionInfo.admCoordinator = relation.relationId;
30731
30773
  this._setRelationModel();
30732
30774
  return [2 /*return*/, success];
30733
30775
  }
@@ -30910,12 +30952,12 @@
30910
30952
  return __generator(this, function (_a) {
30911
30953
  switch (_a.label) {
30912
30954
  case 0:
30913
- if (!(this.transactionInfo.currencyId !== currency)) return [3 /*break*/, 2];
30914
- return [4 /*yield*/, this.transactionService.updateHeaderTransactionCurrency(this.transactionInfo.uuid, currency, this.lockAndSave)];
30955
+ if (!(this.transactionInfo.currencyId !== currency.id)) return [3 /*break*/, 2];
30956
+ return [4 /*yield*/, this.transactionService.updateHeaderTransactionCurrency(this.transactionInfo.uuid, currency.code, this.lockAndSave)];
30915
30957
  case 1:
30916
30958
  success = _a.sent();
30917
30959
  if (!success) {
30918
- this.transactionInfo.currencyId = currency;
30960
+ this.transactionInfo.currencyId = currency.id;
30919
30961
  this._setCurrencyModel();
30920
30962
  return [2 /*return*/, success];
30921
30963
  }
@@ -41816,7 +41858,6 @@
41816
41858
 
41817
41859
  var TransactionTagsComponent = /** @class */ (function () {
41818
41860
  function TransactionTagsComponent(_transactionService, _transactionEventService, _transactionConnectorService, iconCacheService) {
41819
- var _this = this;
41820
41861
  this._transactionService = _transactionService;
41821
41862
  this._transactionEventService = _transactionEventService;
41822
41863
  this._transactionConnectorService = _transactionConnectorService;
@@ -41829,6 +41870,13 @@
41829
41870
  this._table = tableName_enum.TableName.Transactions;
41830
41871
  this._subs = [];
41831
41872
  this._loaded = false;
41873
+ this._loading = false;
41874
+ }
41875
+ TransactionTagsComponent.prototype.showClass = function () {
41876
+ return true;
41877
+ };
41878
+ TransactionTagsComponent.prototype.ngOnInit = function () {
41879
+ var _this = this;
41832
41880
  this._subs.push(this._transactionEventService.transactionSet.subscribe(function (transaction) {
41833
41881
  if (transaction && transaction.transactionInfo.id) {
41834
41882
  _this._key = transaction.transactionInfo.transactionNr.toString();
@@ -41840,16 +41888,14 @@
41840
41888
  _this._getJoinedTags();
41841
41889
  }
41842
41890
  }));
41843
- }
41844
- TransactionTagsComponent.prototype.showClass = function () {
41845
- return true;
41846
41891
  };
41847
41892
  TransactionTagsComponent.prototype.ngOnDestroy = function () {
41848
41893
  this._subs.forEach(function (s) { return s.unsubscribe(); });
41849
41894
  };
41850
41895
  TransactionTagsComponent.prototype._getJoinedTags = function () {
41851
41896
  var _this = this;
41852
- if (this._key && this._loaded && this.tags.length === 0) {
41897
+ if (this._key && this._loaded && this.tags.length === 0 && !this._loading) {
41898
+ this._loading = true;
41853
41899
  this._transactionService.getJoinedTags(this._table, this._key).then(function (tags) {
41854
41900
  _this.tags = tags;
41855
41901
  _this.editingTags = __spreadArray([], __read(tags));