@colijnit/transaction 12.1.153 → 12.1.154

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 (40) hide show
  1. package/bundles/colijnit-transaction.umd.js +113 -29
  2. package/bundles/colijnit-transaction.umd.js.map +1 -1
  3. package/colijnit-transaction.metadata.json +1 -1
  4. package/esm2015/lib/cache/service/business-object-cache-manager.service.js +7 -1
  5. package/esm2015/lib/cache/service/select-single-cache.service.js +7 -4
  6. package/esm2015/lib/component/checkout/checkout.component.js +5 -1
  7. package/esm2015/lib/component/deposit-payment/deposit-payment.component.js +4 -3
  8. package/esm2015/lib/component/payment/payment.component.js +54 -37
  9. package/esm2015/lib/component/payment/payment.module.js +4 -3
  10. package/esm2015/lib/component/transaction-header/transaction-header-payment/transaction-header-payment.component.js +8 -5
  11. package/esm2015/lib/component/transaction-line/transaction-purchase-order-line/transaction-purchase-order-line-base.component.js +4 -1
  12. package/esm2015/lib/component/transaction-line/transaction-purchase-order-line/transaction-purchase-order-line.component.js +2 -6
  13. package/esm2015/lib/component/transaction-line-fields/transaction-line-delivery-date-button.component.js +2 -2
  14. package/esm2015/lib/component/transaction-line-fields/transaction-line-supplier-delivery-date-button.component.js +36 -6
  15. package/esm2015/lib/component/transaction-line-purchase-confirmation/transaction-line-purchase-confirmation.component.js +5 -5
  16. package/esm2015/lib/component/transaction-quick-access/transaction-quick-access-order-confirmation/transaction-quick-access-order-confirmation.component.js +3 -3
  17. package/esm2015/lib/service/relation.service.js +19 -11
  18. package/esm2015/lib/service/transaction-base.service.js +9 -1
  19. package/esm2015/lib/transaction-version.js +3 -3
  20. package/fesm2015/colijnit-transaction.js +150 -71
  21. package/fesm2015/colijnit-transaction.js.map +1 -1
  22. package/lib/cache/service/business-object-cache-manager.service.d.ts +3 -0
  23. package/lib/cache/service/select-single-cache.service.d.ts +5 -5
  24. package/lib/component/checkout/checkout.component.d.ts +4 -0
  25. package/lib/component/deposit-payment/style/_layout.scss +3 -1
  26. package/lib/component/deposit-payment/style/_material-definition.scss +2 -2
  27. package/lib/component/payment/payment.component.d.ts +4 -1
  28. package/lib/component/payment/style/_layout.scss +64 -35
  29. package/lib/component/payment/style/_material-definition.scss +1 -1
  30. package/lib/component/payment/style/_theme.scss +0 -3
  31. package/lib/component/payment-tile/style/_layout.scss +5 -3
  32. package/lib/component/payment-to-pay/style/_layout.scss +6 -5
  33. package/lib/component/payment-to-pay/style/_material-definition.scss +4 -4
  34. package/lib/component/stepper/style/_material-definition.scss +4 -4
  35. package/lib/component/transaction/style/_layout.scss +1 -1
  36. package/lib/component/transaction-header/transaction-header-payment/style/_layout.scss +17 -0
  37. package/lib/component/transaction-line-fields/transaction-line-delivery-date-button.component.d.ts +2 -2
  38. package/lib/component/transaction-line-fields/transaction-line-supplier-delivery-date-button.component.d.ts +6 -1
  39. package/lib/service/transaction-base.service.d.ts +2 -0
  40. package/package.json +1 -1
@@ -199,8 +199,8 @@ class Version {
199
199
  constructor() {
200
200
  this.name = "@colijnit/transaction";
201
201
  this.description = "Colijn IT transaction package";
202
- this.symVer = "12.1.153";
203
- this.publishDate = "19-10-2023 15:15:35";
202
+ this.symVer = "12.1.154";
203
+ this.publishDate = "20-10-2023 19:08:26";
204
204
  }
205
205
  }
206
206
 
@@ -1251,6 +1251,12 @@ class BusinessObjectCacheManagerService {
1251
1251
  const cacheId = id.toString();
1252
1252
  return this._selectSingleCache.has(key) && this._selectSingleCache.get(key)[cacheId];
1253
1253
  }
1254
+ deleteSingleCacheItem(key, id = BusinessObjectCacheManagerService._NullBoId) {
1255
+ const cacheId = id.toString();
1256
+ if (this._selectSingleCache.has(key)) {
1257
+ this._selectSingleCache.delete(key);
1258
+ }
1259
+ }
1254
1260
  // Returns the parameterized cache item with the given key. T is the type of the cache value items requested, e.g. Color.
1255
1261
  getSelectMultipleParameterCacheItem(key) {
1256
1262
  return this._selectMultipleParameterizedCache.get(key);
@@ -4657,7 +4663,10 @@ class SelectSingleCacheService {
4657
4663
  constructor(_boCacheManager) {
4658
4664
  this._boCacheManager = _boCacheManager;
4659
4665
  }
4660
- requestCache(clazz, sourceId, loadFunction) {
4666
+ requestCache(clazz, sourceId, loadFunction, reload = false) {
4667
+ if (reload) {
4668
+ this._boCacheManager.deleteSingleCacheItem(clazz, sourceId);
4669
+ }
4661
4670
  if (!this._boCacheManager.hasSingleCacheItem(clazz, sourceId)) {
4662
4671
  this._createCacheItem(clazz, sourceId, loadFunction);
4663
4672
  }
@@ -6753,14 +6762,14 @@ class RelationService {
6753
6762
  this._boFactory = new BusinessObjectFactory();
6754
6763
  }
6755
6764
  getCustomerFullObject(relationNo) {
6756
- // return this._selectSingleCacheService.requestCache<CustomerFullObject>(CustomerFullObject, relationNo, () => {
6757
- return this._adapterService.getCustomerFullObject(relationNo);
6758
- // }).getValue();
6765
+ return this._selectSingleCacheService.requestCache(CustomerFullObject, relationNo, () => {
6766
+ return this._adapterService.getCustomerFullObject(relationNo);
6767
+ }).getValue();
6759
6768
  }
6760
6769
  getSupplierFullObject(relationNo) {
6761
- // return this._selectSingleCacheService.requestCache<SupplierFullObject>(SupplierFullObject, relationNo, () => {
6762
- return this._adapterService.getSupplierFullObject(relationNo);
6763
- // }).getValue();
6770
+ return this._selectSingleCacheService.requestCache(SupplierFullObject, relationNo, () => {
6771
+ return this._adapterService.getSupplierFullObject(relationNo);
6772
+ }).getValue();
6764
6773
  }
6765
6774
  insertAddress(address) {
6766
6775
  return this._adapterService.insertAddress(address);
@@ -6769,19 +6778,27 @@ class RelationService {
6769
6778
  return this._adapterService.updateAddress(address);
6770
6779
  }
6771
6780
  insertCustomer(relation) {
6772
- return this._adapterService.insertCustomer(relation);
6781
+ return this._selectSingleCacheService.requestCache(CustomerFullObject, relation.relationNumber, () => {
6782
+ return this._adapterService.insertCustomer(relation);
6783
+ }, true).getValue();
6773
6784
  }
6774
6785
  updateCustomer(relation) {
6775
6786
  return __awaiter(this, void 0, void 0, function* () {
6776
- return this._adapterService.updateCustomer(relation);
6787
+ return this._selectSingleCacheService.requestCache(CustomerFullObject, relation.relationNumber, () => {
6788
+ return this._adapterService.updateCustomer(relation);
6789
+ }, true).getValue();
6777
6790
  });
6778
6791
  }
6779
6792
  insertSupplier(relation) {
6780
- return this._adapterService.insertSupplier(relation);
6793
+ return this._selectSingleCacheService.requestCache(SupplierFullObject, relation.relationNumber, () => {
6794
+ return this._adapterService.insertSupplier(relation);
6795
+ }, true).getValue();
6781
6796
  }
6782
6797
  updateSupplier(relation) {
6783
6798
  return __awaiter(this, void 0, void 0, function* () {
6784
- return this._adapterService.updateSupplier(relation);
6799
+ return this._selectSingleCacheService.requestCache(SupplierFullObject, relation.relationNumber, () => {
6800
+ return this._adapterService.updateSupplier(relation);
6801
+ }, true).getValue();
6785
6802
  });
6786
6803
  }
6787
6804
  getRelationListObjects(relationRequest) {
@@ -7087,6 +7104,14 @@ class TransactionBaseService extends BaseModuleService {
7087
7104
  const clazz = this._getRelationClass(this.transactionKind);
7088
7105
  this.relation = new clazz;
7089
7106
  }
7107
+ setRelationOnTransaction(relationNr, relationKind) {
7108
+ return __awaiter(this, void 0, void 0, function* () {
7109
+ const relation = yield this.relationService.getRelation(relationKind, relationNr);
7110
+ if (relation) {
7111
+ this.relation = relation;
7112
+ }
7113
+ });
7114
+ }
7090
7115
  resetCurrentTransaction() {
7091
7116
  this.currentTransaction = new TransactionInfoResponse();
7092
7117
  this._relation = new CustomerFullObject();
@@ -9403,6 +9428,9 @@ class CheckoutComponent {
9403
9428
  this.service.transactionKind = this.transactionType;
9404
9429
  this.relationType = this.service.getRelationKindFromTransactionKind();
9405
9430
  this.service.createNewRelation();
9431
+ if (this.relationNr) {
9432
+ this.service.setRelationOnTransaction(this.relationNr, this.relationType);
9433
+ }
9406
9434
  }
9407
9435
  ngOnDestroy() {
9408
9436
  this._subs.forEach(s => s.unsubscribe());
@@ -9565,6 +9593,7 @@ CheckoutComponent.propDecorators = {
9565
9593
  checkoutDelivery: [{ type: ViewChild, args: ["checkoutDelivery",] }],
9566
9594
  checkoutPayment: [{ type: ViewChild, args: ["checkoutPayment",] }],
9567
9595
  newTransaction: [{ type: Input }],
9596
+ relationNr: [{ type: Input }],
9568
9597
  sellerId: [{ type: Input }],
9569
9598
  transactionType: [{ type: Input }],
9570
9599
  showCreateTransactionButton: [{ type: Input }],
@@ -13410,8 +13439,8 @@ class TransactionQuickAccessOrderConfirmationComponent extends TransactionBaseCo
13410
13439
  .map((line) => {
13411
13440
  const details = new PurchaseOrderConfirmationLineDetails();
13412
13441
  details.lineNumber = line.lineNr;
13413
- details.amountConfirmed = line.quantityPurchaseToConfirm;
13414
- details.confirmedDate = this.purchaseOrderConfirmation.confirmationDate;
13442
+ details.amountConfirmed = +line.purchasePortalLine.amountToBeConfirmed;
13443
+ details.confirmedDate = line.purchasePortalLine.deliveryDateConfirmed ? new Date(line.purchasePortalLine.deliveryDateConfirmed) : this.purchaseOrderConfirmation.confirmationDate;
13415
13444
  details.confirmedPrice = +line.purchasePortalLine.confirmedPrice;
13416
13445
  return details;
13417
13446
  });
@@ -15686,6 +15715,9 @@ class TransactionPurchaseOrderLineBaseComponent extends TransactionBaseComponent
15686
15715
  this._subs = [];
15687
15716
  }
15688
15717
  ngOnInit() {
15718
+ if (this.transactionLine.purchasePortalLine.amountToBeConfirmed === null || this.transactionLine.purchasePortalLine.amountToBeConfirmed === undefined) {
15719
+ this.transactionLine.purchasePortalLine.amountToBeConfirmed = this.transactionLine.amount.toString();
15720
+ }
15689
15721
  this._subs.push(this.transactionEventService.selectAllSalesOrderLinesForPurchase.subscribe((value) => {
15690
15722
  this.selected = value && this.showCheckboxForLine;
15691
15723
  this.detectChanges();
@@ -15811,28 +15843,24 @@ TransactionPurchaseOrderLineComponent.decorators = [
15811
15843
  [model]="transactionLine.purchasePortalLine.articleNoSupplier ? transactionLine.purchasePortalLine.articleNoSupplier : '-'"
15812
15844
  [leftIconData]="iconCacheService.getIcon(icons.RegularIndustryTag)"
15813
15845
  [customHeight]="true"
15814
- [tooltip]="'ARTICLE_NO_SUPPLIER' | localize"
15815
15846
  ></co-input-text>
15816
15847
  <co-transaction-line-confirmed-price class="transaction-line-confirmed-price price"
15817
15848
  [screenConfigurationObject]="cfgNames.LineConfirmedPrice"
15818
15849
  [(price)]="transactionLine.purchasePortalLine.confirmedPrice"
15819
15850
  [showLabel]="false"
15820
15851
  [defaultEditMode]="false"
15821
- [tooltip]="'CONFIRMED_PRICE' | localize"
15822
15852
  ></co-transaction-line-confirmed-price>
15823
15853
  <co-input-number-picker class="amount-number-picker"
15824
15854
  [screenConfigurationObject]="cfgNames.LineConfirmedAmount"
15825
15855
  [required]="true"
15826
- [(model)]="+transactionLine.purchasePortalLine.amountConfirmed"
15856
+ [(model)]="transactionLine.purchasePortalLine.amountToBeConfirmed"
15827
15857
  [min]="1"
15828
15858
  [max]="+transactionLine.purchasePortalLine.amountOrdered"
15829
15859
  [leftIconData]="iconCacheService.getIcon(icons.FileCircleInfoRegular)"
15830
- [tooltip]="'CONFIRMED' | localize"
15831
15860
  ></co-input-number-picker>
15832
15861
  <co-transaction-line-supplier-delivery-date-button
15833
15862
  [screenConfigurationObject]="cfgNames.LineConfirmedDate"
15834
15863
  [transactionLine]="transactionLine"
15835
- [tooltip]="'CONFIRMED_DATE' | localize"
15836
15864
  ></co-transaction-line-supplier-delivery-date-button>
15837
15865
  </div>
15838
15866
  </div>
@@ -19779,7 +19807,7 @@ TransactionLineDeliveryDateButtonComponent.decorators = [
19779
19807
  [label]="transactionLine.deliveryDate | date:'d MMM yyyy'"
19780
19808
  [rightIconData]="iconCacheService.getIcon(icons.CalendarDayRegular)"
19781
19809
  (click)="handleShowHideClick()"
19782
- ></co-transaction-button>
19810
+ ></co-transaction-button>
19783
19811
  `,
19784
19812
  providers: [
19785
19813
  OverlayService,
@@ -21767,11 +21795,12 @@ PaymentService.ctorParameters = () => [
21767
21795
  ];
21768
21796
 
21769
21797
  class PaymentComponent {
21770
- constructor(_transactionService, _sharedService, _paymentService, _transactionEventService) {
21798
+ constructor(_transactionService, _sharedService, _paymentService, _transactionEventService, iconCacheService) {
21771
21799
  this._transactionService = _transactionService;
21772
21800
  this._sharedService = _sharedService;
21773
21801
  this._paymentService = _paymentService;
21774
21802
  this._transactionEventService = _transactionEventService;
21803
+ this.iconCacheService = iconCacheService;
21775
21804
  this.icons = Icon;
21776
21805
  this.updateDepositAmount = true;
21777
21806
  this.payed = new EventEmitter();
@@ -21784,6 +21813,7 @@ class PaymentComponent {
21784
21813
  this.showPspQrCode = false;
21785
21814
  this.showLoader = true;
21786
21815
  this.amountToPay = 0;
21816
+ this.depositAmount = 0;
21787
21817
  this.statusMessage = "";
21788
21818
  this._amount = 0;
21789
21819
  this._paymentStatusPollIntervalMs = 5000;
@@ -21878,6 +21908,7 @@ class PaymentComponent {
21878
21908
  const info = yield this._paymentService.getDepositPaymentInfo(this.transactionUuid);
21879
21909
  if (info) {
21880
21910
  this.amountToPay = info.depositRemainderAmount;
21911
+ this.depositAmount = info.depositAmount;
21881
21912
  }
21882
21913
  }
21883
21914
  else {
@@ -21987,47 +22018,59 @@ PaymentComponent.decorators = [
21987
22018
  selector: "co-payment",
21988
22019
  template: `
21989
22020
  <div class="payment-wrapper">
21990
- <div class="payment-methods-header">
21991
- <span class="payment-header-title" [textContent]="'SELECT_A' | localize"></span>
21992
- <span class="payment-header-title extra" [textContent]="'FREE' | localize:false"></span>
21993
- <span class="payment-header-title" [textContent]="'PAYMENT_METHOD' | localize:false"></span>
21994
- </div>
21995
- <div class="payment-methods">
21996
- <co-loader class="loader" *ngIf="showLoader"></co-loader>
21997
- <ng-container *ngIf="!showLoader">
21998
- <co-payment-tile *ngFor="let paymentMethod of paymentMethods; let index = index"
21999
- [image]="paymentMethod.image"
22000
- [description]="paymentMethod.payment.description"
22001
- [selected]="paymentMethodIdx === index"
22002
- (selectedChange)="paymentMethodSelected(paymentMethod.payment, index)"
22003
- ></co-payment-tile>
22004
- </ng-container>
22005
- </div>
22006
- <div class="payment-cash-register-wrapper" *ngIf="showCashRegisters">
22007
- <div class="payment-cash-register-header">
22008
- <span class="payment-header-title" [textContent]="'SELECT_CASH_REGISTER' | localize"></span>
22021
+ <div class="payment-methods-register-wrapper">
22022
+ <div class="payment-methods-wrapper">
22023
+ <div class="payment-methods-header">
22024
+ <span class="payment-header-title" [textContent]="'SELECT' | localize"></span>
22025
+ <!--span class="payment-header-title extra" [textContent]="'FREE' | localize:false"></span-->
22026
+ <span class="payment-header-title" [textContent]="'PAYMENT_METHOD' | localize:false"></span>
22027
+ </div>
22028
+ <div class="payment-methods co-small-scrollbar">
22029
+ <co-loader class="loader" *ngIf="showLoader"></co-loader>
22030
+ <ng-container *ngIf="!showLoader">
22031
+ <co-payment-tile *ngFor="let paymentMethod of paymentMethods; let index = index"
22032
+ [image]="paymentMethod.image"
22033
+ [description]="paymentMethod.payment.description"
22034
+ [selected]="paymentMethodIdx === index"
22035
+ (selectedChange)="paymentMethodSelected(paymentMethod.payment, index)"
22036
+ ></co-payment-tile>
22037
+ </ng-container>
22038
+ </div>
22009
22039
  </div>
22010
- <div class="payment-methods">
22011
- <co-payment-tile *ngFor="let cashRegister of cashRegisters; let index = index"
22012
- [icon]="cashRegister.icon"
22013
- [description]="cashRegister.description"
22014
- [selected]="cashRegisterIdx === index"
22015
- (selectedChange)="cashRegisterSelected(cashRegister, index)"
22016
- ></co-payment-tile>
22040
+ <div class="payment-cash-register-wrapper" *ngIf="showCashRegisters">
22041
+ <div class="payment-cash-register-header">
22042
+ <span class="payment-header-title" [textContent]="'SELECT_CASH_REGISTER' | localize"></span>
22043
+ </div>
22044
+ <div class="payment-methods">
22045
+ <co-payment-tile *ngFor="let cashRegister of cashRegisters; let index = index"
22046
+ [icon]="cashRegister.icon"
22047
+ [description]="cashRegister.description"
22048
+ [selected]="cashRegisterIdx === index"
22049
+ (selectedChange)="cashRegisterSelected(cashRegister, index)"
22050
+ ></co-payment-tile>
22051
+ </div>
22017
22052
  </div>
22018
22053
  </div>
22019
22054
  <div class="payment-to-pay-wrapper">
22020
- <co-payment-to-pay [amountToPay]="amountToPay"></co-payment-to-pay>
22055
+ <div class="payment-to-pay-total">
22056
+ <div class="payment-to-pay-header">
22057
+ <span class="payment-header-title" [textContent]="'TOTAL_AMOUNT_TO_PAY' | localize"></span>
22058
+ <span class="payment-total-pay" [textContent]="depositAmount === 0 ? depositAmount : (depositAmount | coCurrency)"></span>
22059
+ </div>
22060
+ <div class="payment-input-button-wrapper">
22061
+ <div class="payment-input-button">
22062
+ <co-payment-to-pay [amountToPay]="amountToPay"></co-payment-to-pay>
22063
+ <div class="payment-to-pay-button">
22064
+ <co-button [iconData]="iconCacheService.getIcon(icons.CheckDuotone)" (click)="handlePayment()" [disabled]="amountToPay === 0"></co-button>
22065
+ </div>
22066
+ </div>
22067
+ <div class="payment-error-message" *ngIf="statusMessage" [textContent]="statusMessage"></div>
22068
+ </div>
22069
+ </div>
22070
+
22021
22071
  <div class="payment-deposit">
22022
22072
  <co-deposit-payment [branch]="branch" [transactionUuid]="transactionUuid"></co-deposit-payment>
22023
22073
  </div>
22024
- <div class="payment-to-pay-button">
22025
- <!--
22026
- <co-loader *ngIf="statusMessage"></co-loader>
22027
- -->
22028
- <div class="payment-error-message" *ngIf="statusMessage" [textContent]="statusMessage"></div>
22029
- <co-button [label]="'PAY' | localize" (click)="handlePayment()" [disabled]="amountToPay === 0"></co-button>
22030
- </div>
22031
22074
  <co-key-pad class="payment-to-pay-keypad"
22032
22075
  [showValue]="false"
22033
22076
  [emitModelChangeOnEnter]="false"
@@ -22050,7 +22093,8 @@ PaymentComponent.ctorParameters = () => [
22050
22093
  { type: TransactionService },
22051
22094
  { type: SharedService },
22052
22095
  { type: PaymentService },
22053
- { type: TransactionEventService }
22096
+ { type: TransactionEventService },
22097
+ { type: IconCacheService }
22054
22098
  ];
22055
22099
  PaymentComponent.propDecorators = {
22056
22100
  transId: [{ type: Input }],
@@ -22215,9 +22259,10 @@ DepositPaymentComponent.decorators = [
22215
22259
  [image]="payment.paymentMethod?.image"
22216
22260
  [description]="payment.paymentMethod?.payment.description"
22217
22261
  ></co-payment-tile>
22218
- <div class="deposit-payment-spacer"></div>
22262
+ <div class="down-payment-date-wrapper">
22263
+ <div class="down-payment-date" [textContent]="payment.depositPayment?.date | date:'d MMMM yyyy'"></div>
22264
+ </div>
22219
22265
  <div class="down-payment-amount-wrapper">
22220
- <div class="down-payment-date" [textContent]="payment.depositPayment?.date | date:'d MMMM yyyy | HH:mm'"></div>
22221
22266
  <div class="down-payment-amount" [textContent]="payment.depositPayment?.depositPaymentAmount | coCurrency"></div>
22222
22267
  </div>
22223
22268
  </div>
@@ -22316,7 +22361,8 @@ PaymentModule.decorators = [
22316
22361
  PaymentQrCodeModule,
22317
22362
  DepositPaymentModule,
22318
22363
  LoaderModule,
22319
- PaymentToPayModule
22364
+ PaymentToPayModule,
22365
+ IconModule
22320
22366
  ],
22321
22367
  declarations: [
22322
22368
  PaymentComponent
@@ -27728,10 +27774,13 @@ TransactionHeaderPaymentComponent.decorators = [
27728
27774
  </div>
27729
27775
  </co-dialog>
27730
27776
  -->
27731
- <co-dialog class="payment-dialog" [customCssClass]="'co-small-scrollbar'" *ngIf="showPaymentDialog"
27732
- [modal]="true"
27733
- (closeClick)="showPaymentDialog = false"
27734
- >
27777
+ <co-dialog class="payment-dialog" [modal]="true" [headerTemplate]="headerTemplate" *ngIf="showPaymentDialog" (closeClick)="showPaymentDialog = false">
27778
+ <ng-template #headerTemplate>
27779
+ <div class="payment-wrapper-popup-title">
27780
+ <co-icon [iconData]="iconCacheService.getIcon(icons.CreditCardRegularCheck)"></co-icon>
27781
+ <div class="co-dialog-header-title" [textContent]="'PAYMENT_METHOD' | localize"></div>
27782
+ </div>
27783
+ </ng-template>
27735
27784
  <co-payment
27736
27785
  [transId]="transactionInfo.id"
27737
27786
  [branch]="transactionInfo.branch?.relationNr"
@@ -29830,8 +29879,6 @@ class TransactionLinePurchaseConfirmationComponent extends TransactionBaseCompon
29830
29879
  existingBatch.docAmount = this.docDeliveryBatch.docAmount;
29831
29880
  existingBatch.docDate = this.docDeliveryBatch.docDate;
29832
29881
  existingBatch.reference = this.docDeliveryBatch.reference;
29833
- existingBatch.docAmountOrg = this.docDeliveryBatch.docAmountOrg;
29834
- existingBatch.docDateOrg = this.docDeliveryBatch.docDateOrg;
29835
29882
  }
29836
29883
  else { // or create a new one
29837
29884
  this.docDeliveryBatch.deleteLine = 'F';
@@ -29861,7 +29908,7 @@ class TransactionLinePurchaseConfirmationComponent extends TransactionBaseCompon
29861
29908
  }
29862
29909
  handleSelectHistoryRow(row) {
29863
29910
  this.docDeliveryBatch = row;
29864
- // this.docDeliveryBatch.docDate = new Date(row.docDate);
29911
+ this.docDeliveryBatch.docDate = new Date(row.docDate);
29865
29912
  }
29866
29913
  handleCancelClick() {
29867
29914
  this._initNewDocDeliveryBatch();
@@ -29874,7 +29921,9 @@ class TransactionLinePurchaseConfirmationComponent extends TransactionBaseCompon
29874
29921
  }
29875
29922
  _initNewDocDeliveryBatch() {
29876
29923
  this.docDeliveryBatch = new DocDeliveryBatch();
29877
- this.docDeliveryBatch.docAmount = +this.transactionLine.purchasePortalLine.amountOrdered;
29924
+ this.docDeliveryBatch.docAmount = this.transactionLine.purchasePortalLine.docBatchArray.length === 0
29925
+ ? +this.transactionLine.amount
29926
+ : +this.transactionLine.purchasePortalLine.amountOrdered;
29878
29927
  this.docDeliveryBatch.confirmedPrice = +this.transactionLine.purchasePortalLine.netOrderPrice;
29879
29928
  }
29880
29929
  }
@@ -33256,24 +33305,53 @@ class TransactionLineSupplierDeliveryDateButtonComponent extends TransactionBase
33256
33305
  this._overlayService = _overlayService;
33257
33306
  this._elementRef = _elementRef;
33258
33307
  this.icons = Icon;
33308
+ this.showCalender = false;
33259
33309
  }
33260
33310
  showClass() {
33261
33311
  return true;
33262
33312
  }
33263
- handleShowDialog(event) {
33313
+ handleShowHideClick() {
33314
+ this.showCalender = !this.showCalender;
33315
+ if (this.showCalender) {
33316
+ this._showPopup();
33317
+ }
33318
+ else {
33319
+ this._hidePopup();
33320
+ }
33321
+ }
33322
+ _showPopup() {
33323
+ this.showCalender = true;
33324
+ this._calendarPopupComponentRef = this._overlayService.createComponent(CalendarComponent, {
33325
+ parentForOverlay: this.parentComponent,
33326
+ selectedDate: new Date(this.transactionLine.purchasePortalLine.deliveryDateConfirmed
33327
+ ? this.transactionLine.purchasePortalLine.deliveryDateConfirmed
33328
+ : new Date())
33329
+ }, {
33330
+ dateSelected: (date) => this._handleDateChanged(date),
33331
+ clickedOutside: () => this.handleShowHideClick()
33332
+ });
33333
+ }
33334
+ _handleDateChanged(date) {
33335
+ this.transactionLine.purchasePortalLine.deliveryDateConfirmed = date.toDateString();
33336
+ this.handleShowHideClick();
33337
+ this.detectChanges();
33338
+ }
33339
+ _hidePopup() {
33340
+ this.showCalender = false;
33341
+ this._overlayService.removeComponent(this._calendarPopupComponentRef);
33264
33342
  }
33265
33343
  }
33266
33344
  TransactionLineSupplierDeliveryDateButtonComponent.decorators = [
33267
33345
  { type: Component, args: [{
33268
33346
  selector: 'co-transaction-line-supplier-delivery-date-button',
33269
33347
  template: `
33270
- <co-transaction-button class="big center-align"
33348
+ <co-transaction-button #parentComponent class="big center-align"
33271
33349
  [hidden]="hidden"
33272
33350
  [readonly]="readonly"
33273
33351
  [iconData]="iconCacheService.getIcon(icons.RegularIndustryClock)"
33274
33352
  [label]="transactionLine.purchasePortalLine.deliveryDateConfirmed | date:'d MMM yyyy'"
33275
33353
  [rightIconData]="iconCacheService.getIcon(icons.CalendarDayRegular)"
33276
- (click)="handleShowDialog($event)"
33354
+ (click)="handleShowHideClick()"
33277
33355
  ></co-transaction-button>
33278
33356
  `,
33279
33357
  providers: [
@@ -33298,6 +33376,7 @@ TransactionLineSupplierDeliveryDateButtonComponent.ctorParameters = () => [
33298
33376
  { type: ElementRef }
33299
33377
  ];
33300
33378
  TransactionLineSupplierDeliveryDateButtonComponent.propDecorators = {
33379
+ parentComponent: [{ type: ViewChild, args: ['parentComponent', { read: ElementRef },] }],
33301
33380
  showClass: [{ type: HostBinding, args: ['class.co-transaction-line-supplier-delivery-date-button',] }]
33302
33381
  };
33303
33382