@colijnit/transaction 257.1.77 → 257.1.79

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.77";
37
- this.publishDate = "01/07/2025, 17:22:18";
36
+ this.symVer = "257.1.79";
37
+ this.publishDate = "9-7-2025 17:42:56";
38
38
  }
39
39
  return Version;
40
40
  }());
@@ -1535,6 +1535,7 @@
1535
1535
  this.transactionLineChanged = new rxjs.Subject();
1536
1536
  this.transactionLineCheckboxChanged = new rxjs.Subject();
1537
1537
  this.transactionLineRefTransactionsChanged = new rxjs.BehaviorSubject(undefined);
1538
+ this.transactionLinePurchaseRefTransactionsChanged = new rxjs.BehaviorSubject(undefined);
1538
1539
  this.transactionLineAdded = new rxjs.BehaviorSubject(undefined);
1539
1540
  this.openArticleTextOverview = new rxjs.Subject();
1540
1541
  this.addArticleText = new rxjs.Subject();
@@ -27514,6 +27515,7 @@
27514
27515
  });
27515
27516
  }
27516
27517
  _this.hasPurchaseOrder = _this.transactionLine.refTransactionsPurchase.filter(function (r) { return r.refTransactionType === transactionKind_enum.TransactionKind.PurchaseOrder; }).length > 0;
27518
+ _this.transactionEventService.transactionLinePurchaseRefTransactionsChanged.next(_this.transactionLine);
27517
27519
  _this.detectChanges();
27518
27520
  });
27519
27521
  }
@@ -27540,7 +27542,7 @@
27540
27542
  __extends(TransactionPurchaseLineComponent, _super);
27541
27543
  function TransactionPurchaseLineComponent() {
27542
27544
  var _this = _super.apply(this, __spreadArray([], __read(arguments))) || this;
27543
- _this.showConfirmedDeliveryDate = false;
27545
+ _this.showConfirmedDeliveryDate = true;
27544
27546
  _this.statusBarConfigNames = {
27545
27547
  statusBarBT: _this.cfgNames.StatusBarBT,
27546
27548
  statusBarTG: _this.cfgNames.StatusBarTG,
@@ -33902,26 +33904,26 @@
33902
33904
  return __awaiter(this, void 0, void 0, function () {
33903
33905
  var warehouseUpdateSuccess, oldWarehouse_1, oldSourceWarehouse, sourceSuccess;
33904
33906
  var _this = this;
33905
- return __generator(this, function (_a) {
33906
- switch (_a.label) {
33907
+ return __generator(this, function (_b) {
33908
+ switch (_b.label) {
33907
33909
  case 0:
33908
33910
  warehouseUpdateSuccess = true;
33909
33911
  if (this.transactionLine.warehouseNumber !== this.warehouse) {
33910
33912
  oldWarehouse_1 = this.transactionLine.warehouseNumber;
33911
33913
  this.transactionService.tryToLockTransaction(this.transactionInfo.id, this.transactionInfo.version).then(function (locked) { return __awaiter(_this, void 0, void 0, function () {
33912
33914
  var warehouseSuccess;
33913
- return __generator(this, function (_a) {
33914
- switch (_a.label) {
33915
+ return __generator(this, function (_b) {
33916
+ switch (_b.label) {
33915
33917
  case 0:
33916
33918
  if (!locked) return [3 /*break*/, 2];
33917
33919
  return [4 /*yield*/, this.transactionService.updateWarehouseTransactionLine(this.transactionService.currentTransaction.transactionInfo.uuid, this.transactionLine.uuid, this.warehouse)];
33918
33920
  case 1:
33919
- warehouseSuccess = _a.sent();
33921
+ warehouseSuccess = _b.sent();
33920
33922
  if (!warehouseSuccess) {
33921
33923
  this.transactionLine.warehouseNumber = oldWarehouse_1;
33922
33924
  warehouseUpdateSuccess = false;
33923
33925
  }
33924
- _a.label = 2;
33926
+ _b.label = 2;
33925
33927
  case 2: return [2 /*return*/];
33926
33928
  }
33927
33929
  });
@@ -33931,12 +33933,12 @@
33931
33933
  oldSourceWarehouse = this.transactionLine.interBranchSourceWarehouseNr;
33932
33934
  return [4 /*yield*/, this.transactionService.updateTransactionLineInterBranchSourceWarehouse(this.transactionService.currentTransaction.transactionInfo.uuid, this.transactionLine.uuid, this.sourceWarehouse)];
33933
33935
  case 1:
33934
- sourceSuccess = _a.sent();
33936
+ sourceSuccess = _b.sent();
33935
33937
  if (!sourceSuccess) {
33936
33938
  this.transactionLine.warehouseNumber = oldSourceWarehouse;
33937
33939
  warehouseUpdateSuccess = false;
33938
33940
  }
33939
- _a.label = 2;
33941
+ _b.label = 2;
33940
33942
  case 2:
33941
33943
  if (warehouseUpdateSuccess) {
33942
33944
  this.handleClose(AppPopupButtonType.Ok);
@@ -33949,7 +33951,7 @@
33949
33951
  DialogTransactionLineWarehouseComponent.prototype._getWarehouseListForDisplay = function () {
33950
33952
  return __awaiter(this, void 0, void 0, function () {
33951
33953
  var _this = this;
33952
- return __generator(this, function (_a) {
33954
+ return __generator(this, function (_b) {
33953
33955
  this.transactionService.getWarehouses().then(function (warehouses) {
33954
33956
  _this.warehouseDisplayList = warehouses;
33955
33957
  _this.warehouseDescription = _this._getWarehouseDescription(_this.warehouse);
@@ -33961,8 +33963,9 @@
33961
33963
  });
33962
33964
  };
33963
33965
  DialogTransactionLineWarehouseComponent.prototype._getWarehouseDescription = function (warehouseNr) {
33966
+ var _a;
33964
33967
  if (warehouseNr !== null && warehouseNr !== undefined) {
33965
- return this.warehouseDisplayList.find(function (w) { return w.warehouseNo === warehouseNr; }).description;
33968
+ return (_a = this.warehouseDisplayList.find(function (w) { return w.warehouseNo === warehouseNr; })) === null || _a === void 0 ? void 0 : _a.description;
33966
33969
  }
33967
33970
  else {
33968
33971
  return '';
@@ -37530,7 +37533,7 @@
37530
37533
  _this._overlayService = _overlayService;
37531
37534
  _this.icons = Icon;
37532
37535
  _this.showConfirmedDeliveryDateChange = new i0.EventEmitter();
37533
- _this.showConfirmedDeliveryDate = false;
37536
+ _this.showConfirmedDeliveryDate = true;
37534
37537
  _this.isConfirmedDateLater = false;
37535
37538
  _this._subs = [];
37536
37539
  _this._handled = false;
@@ -37542,7 +37545,7 @@
37542
37545
  TransactionLineConfirmedDeliveryDateButtonComponent.prototype.ngOnInit = function () {
37543
37546
  var _this = this;
37544
37547
  _super.prototype.ngOnInit.call(this);
37545
- this._subs.push(this.transactionEventService.transactionLineRefTransactionsChanged.subscribe(function (line) {
37548
+ this._subs.push(this.transactionEventService.transactionLinePurchaseRefTransactionsChanged.subscribe(function (line) {
37546
37549
  _this._checkConfirmedDeliveryDate(line);
37547
37550
  }));
37548
37551
  };
@@ -37559,24 +37562,80 @@
37559
37562
  this._checkDates();
37560
37563
  };
37561
37564
  TransactionLineConfirmedDeliveryDateButtonComponent.prototype._checkConfirmedDeliveryDate = function (line) {
37562
- var _this = this;
37563
- if (line && line.lineNr === this.transactionLine.lineNr && line.refTransactions && line.refTransactions.length === 1 &&
37564
- !this.confirmedDeliveryDate && this.visible && !this._handled) {
37565
- if (line.refTransactions[0].refTransactionType === transactionKind_enum.TransactionKind.PurchaseOrder) {
37566
- this.service.getMaxConfirmedDeliveryDateForPurchaseOrder(line.refTransactions[0].refTransactionId).then(function (date) {
37567
- if (date) {
37568
- _this.confirmedDeliveryDate = date;
37569
- _this.showConfirmedDeliveryDate = true;
37570
- _this.showConfirmedDeliveryDateChange.emit(true);
37571
- _this._checkDates();
37572
- }
37573
- else {
37574
- _this.showConfirmedDeliveryDateChange.emit(false);
37575
- }
37576
- _this._handled = true;
37577
- });
37578
- }
37579
- }
37565
+ return __awaiter(this, void 0, void 0, function () {
37566
+ var _a, _b, _c, ref, refDate, e_1_1;
37567
+ var e_1, _d;
37568
+ return __generator(this, function (_e) {
37569
+ switch (_e.label) {
37570
+ case 0:
37571
+ if (!(line && line.lineNr === this.transactionLine.lineNr && line.refTransactionsPurchase && !this.confirmedDeliveryDate && this.visible && !this._handled)) return [3 /*break*/, 13];
37572
+ this.confirmedDeliveryDate = null;
37573
+ if (!(line.refTransactionsPurchase.length === 1)) return [3 /*break*/, 2];
37574
+ _a = this;
37575
+ return [4 /*yield*/, this._getdeliveryDate(line.refTransactionsPurchase[0])];
37576
+ case 1:
37577
+ _a.confirmedDeliveryDate = _e.sent();
37578
+ return [3 /*break*/, 12];
37579
+ case 2:
37580
+ if (!(line.refTransactionsPurchase.length > 1)) return [3 /*break*/, 11];
37581
+ _e.label = 3;
37582
+ case 3:
37583
+ _e.trys.push([3, 8, 9, 10]);
37584
+ _b = __values(line.refTransactionsPurchase), _c = _b.next();
37585
+ _e.label = 4;
37586
+ case 4:
37587
+ if (!!_c.done) return [3 /*break*/, 7];
37588
+ ref = _c.value;
37589
+ return [4 /*yield*/, this._getdeliveryDate(ref)];
37590
+ case 5:
37591
+ refDate = _e.sent();
37592
+ if (refDate && (this.confirmedDeliveryDate === null || this.confirmedDeliveryDate > refDate)) {
37593
+ this.confirmedDeliveryDate = refDate;
37594
+ }
37595
+ _e.label = 6;
37596
+ case 6:
37597
+ _c = _b.next();
37598
+ return [3 /*break*/, 4];
37599
+ case 7: return [3 /*break*/, 10];
37600
+ case 8:
37601
+ e_1_1 = _e.sent();
37602
+ e_1 = { error: e_1_1 };
37603
+ return [3 /*break*/, 10];
37604
+ case 9:
37605
+ try {
37606
+ if (_c && !_c.done && (_d = _b.return)) _d.call(_b);
37607
+ }
37608
+ finally { if (e_1) throw e_1.error; }
37609
+ return [7 /*endfinally*/];
37610
+ case 10: return [3 /*break*/, 12];
37611
+ case 11:
37612
+ this.confirmedDeliveryDate = null;
37613
+ _e.label = 12;
37614
+ case 12:
37615
+ if (this.confirmedDeliveryDate) {
37616
+ this.showConfirmedDeliveryDate = true;
37617
+ this._checkDates();
37618
+ }
37619
+ else {
37620
+ this.showConfirmedDeliveryDate = false;
37621
+ }
37622
+ this.showConfirmedDeliveryDateChange.emit(this.showConfirmedDeliveryDate);
37623
+ this._handled = true;
37624
+ _e.label = 13;
37625
+ case 13: return [2 /*return*/];
37626
+ }
37627
+ });
37628
+ });
37629
+ };
37630
+ TransactionLineConfirmedDeliveryDateButtonComponent.prototype._getdeliveryDate = function (ref) {
37631
+ return __awaiter(this, void 0, void 0, function () {
37632
+ return __generator(this, function (_a) {
37633
+ switch (_a.label) {
37634
+ case 0: return [4 /*yield*/, this.service.getMaxConfirmedDeliveryDateForPurchaseOrder(ref.refTransactionId)];
37635
+ case 1: return [2 /*return*/, _a.sent()];
37636
+ }
37637
+ });
37638
+ });
37580
37639
  };
37581
37640
  TransactionLineConfirmedDeliveryDateButtonComponent.prototype._checkDates = function () {
37582
37641
  if (this.transactionInfo && this.transactionLine && this.confirmedDeliveryDate) {
@@ -37594,7 +37653,7 @@
37594
37653
  TransactionLineConfirmedDeliveryDateButtonComponent.decorators = [
37595
37654
  { type: i0.Component, args: [{
37596
37655
  selector: 'co-transaction-line-confirmed-delivery-date-button',
37597
- template: "\n <div class=\"inside-field\">\n <co-transaction-button *ngIf=\"showConfirmedDeliveryDate\"\n #parentComponent\n class=\"big center-align\"\n [hidden]=\"hidden\"\n [readonly]=\"readonly\"\n [class.transaction-red-label]=\"isConfirmedDateLater\"\n [iconData]=\"iconCacheService.getIcon(icons.RegularIndustryClock)\"\n [label]=\"confirmedDeliveryDate | date:'d MMM yyyy'\"\n [rightIconData]=\"iconCacheService.getIcon(icons.CalendarDayRegular)\"\n ></co-transaction-button>\n </div>\n\n ",
37656
+ template: "\n <div class=\"inside-field\">\n <co-transaction-button #parentComponent\n class=\"big center-align\"\n [hidden]=\"hidden\"\n [readonly]=\"readonly\"\n [class.transaction-red-label]=\"isConfirmedDateLater\"\n [iconData]=\"iconCacheService.getIcon(icons.RegularIndustryClock)\"\n [label]=\"confirmedDeliveryDate | date:'d MMM yyyy'\"\n [rightIconData]=\"iconCacheService.getIcon(icons.CalendarDayRegular)\"\n ></co-transaction-button>\n </div>\n\n ",
37598
37657
  providers: [
37599
37658
  corecomponents_v12.OverlayService,
37600
37659
  {
@@ -61880,7 +61939,7 @@
61880
61939
  TransactionLineWarehouseCcInterbranchComponent.prototype._getWarehouseListForDisplay = function () {
61881
61940
  return __awaiter(this, void 0, void 0, function () {
61882
61941
  var _this = this;
61883
- return __generator(this, function (_a) {
61942
+ return __generator(this, function (_b) {
61884
61943
  this._transactionService.getWarehouses().then(function (warehouses) {
61885
61944
  _this.warehouseDisplayList = warehouses;
61886
61945
  _this.warehouseDescription = _this._getWarehouseDescription(_this.warehouse);
@@ -61892,8 +61951,9 @@
61892
61951
  });
61893
61952
  };
61894
61953
  TransactionLineWarehouseCcInterbranchComponent.prototype._getWarehouseDescription = function (warehouseNr) {
61954
+ var _a;
61895
61955
  if (warehouseNr !== null && warehouseNr !== undefined) {
61896
- return this.warehouseDisplayList.find(function (w) { return w.warehouseNo === warehouseNr; }).description;
61956
+ return (_a = this.warehouseDisplayList.find(function (w) { return w.warehouseNo === warehouseNr; })) === null || _a === void 0 ? void 0 : _a.description;
61897
61957
  }
61898
61958
  else {
61899
61959
  return '';