@colijnit/transaction 255.1.23 → 255.1.25

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.
@@ -219,7 +219,6 @@ import { PurchaseAdviceFilters } from '@colijnit/transactionapi/build/model/purc
219
219
  import { CatalogFilterModule, CatalogService, CatalogEventService, CatalogSearchModule, CatalogExternalSourceModule } from '@colijnit/catalog';
220
220
  import { DoPaymentRequest } from '@colijnit/transactionapi/build/model/do-payment-request';
221
221
  import { IonePaymentStatusCode } from '@colijnit/transactionapi/build/enum/ione-payment-status-code.enum';
222
- import { CashDrawersRequest } from '@colijnit/transactionapi/build/model/cash-drawers-request';
223
222
  import { GenderType } from '@colijnit/relationapi/build/enum/gender-type.enum';
224
223
  import { ContactOption } from '@colijnit/relationapi/build/model/contact-option.bo';
225
224
  import { BusinessObjectUtils } from '@colijnit/ioneconnector/build/utils/business-object-utils';
@@ -261,6 +260,7 @@ import { TransactionAddPaymentLineRequest } from '@colijnit/transactionapi/build
261
260
  import { take } from 'rxjs/operators';
262
261
  import { TagCategory } from '@colijnit/mainapi/build/enum/tab-category.enum';
263
262
  import { CssUtils } from '@colijnit/mainapi/build/utils/css-utils';
263
+ import { CashDrawersRequest } from '@colijnit/transactionapi/build/model/cash-drawers-request';
264
264
  import { CoDocument as CoDocument$1 } from '@colijnit/sharedapi/build/model/co-document.bo';
265
265
 
266
266
  // this file is dynamically created, do not change this
@@ -268,8 +268,8 @@ class Version {
268
268
  constructor() {
269
269
  this.name = "@colijnit/transaction";
270
270
  this.description = "Colijn IT transaction package";
271
- this.symVer = "255.1.23";
272
- this.publishDate = "28/08/2024, 11:01:27";
271
+ this.symVer = "255.1.25";
272
+ this.publishDate = "29/08/2024, 16:16:35";
273
273
  }
274
274
  }
275
275
 
@@ -20014,28 +20014,32 @@ TransactionPurchaseOrderLineComponent.decorators = [
20014
20014
  selector: "co-transaction-purchase-order-line",
20015
20015
  template: `
20016
20016
  <co-transaction-base-line
20017
- [transactionInfo]="transactionInfo"
20018
- [transactionLine]="transactionLine"
20019
- [preview]="preview"
20020
- [isFirst]="isFirst"
20021
- [checkbox]="showCheckboxForLine"
20022
- [checkboxValue]="transactionLine.selected"
20023
- [showColorIndicator]="showColorIndicator"
20024
- [colorIndicatorColor]="colorIndicatorColor"
20025
- (click)="handleOpenSidePanel($event)"
20026
- (checkboxValueChanged)="transactionLine.selected = $event"
20027
- (dragover)="handleDragOver($event)"
20028
- (drop)="handleDrop($event)"
20029
- (dragleave)="handleDragLeave($event)"
20030
- observeVisibility #observer=visibilityObserve (visibilityChange)="handleVisibilityChange(transactionLine, $event)">
20017
+ [transactionInfo]="transactionInfo"
20018
+ [transactionLine]="transactionLine"
20019
+ [preview]="preview"
20020
+ [isFirst]="isFirst"
20021
+ [checkbox]="showCheckboxForLine"
20022
+ [checkboxValue]="transactionLine.selected"
20023
+ [showColorIndicator]="showColorIndicator"
20024
+ [colorIndicatorColor]="colorIndicatorColor"
20025
+ (click)="handleOpenSidePanel($event)"
20026
+ (checkboxValueChanged)="transactionLine.selected = $event"
20027
+ (dragover)="handleDragOver($event)"
20028
+ (drop)="handleDrop($event)"
20029
+ (dragleave)="handleDragLeave($event)"
20030
+ observeVisibility #observer=visibilityObserve
20031
+ (visibilityChange)="handleVisibilityChange(transactionLine, $event)">
20031
20032
  <div class="transaction-line-wrapper">
20032
20033
  <div class="transaction-line-extended-wrapper">
20033
20034
  <div class="column1">
20034
- <span class="transaction-field-label" [textContent]="'WAREHOUSE_AND_STATUS' | localize" *ngIf="isFirst"></span>
20035
+ <span class="transaction-field-label" [textContent]="'WAREHOUSE_AND_STATUS' | localize"
20036
+ *ngIf="isFirst"></span>
20035
20037
  <co-transaction-line-delivery-date-button
20038
+ [class.warning]="transactionLine.deliveryDate < transactionLine.purchasePortalLine.deliveryDateConfirmed"
20036
20039
  [screenConfigurationObject]="cfgNames.DeliveryDate"
20037
20040
  [transactionLine]="transactionLine"
20038
- [transactionInfo]="transactionInfo"></co-transaction-line-delivery-date-button>
20041
+ [transactionInfo]="transactionInfo">
20042
+ </co-transaction-line-delivery-date-button>
20039
20043
  <co-transaction-line-statusbar data-action="openSidePanel"
20040
20044
  [screenConfigurationObject]="cfgNames.StatusBar"
20041
20045
  [configNames]="statusBarConfigNames"
@@ -20045,17 +20049,20 @@ TransactionPurchaseOrderLineComponent.decorators = [
20045
20049
  ></co-transaction-line-statusbar>
20046
20050
  </div>
20047
20051
  <div class="column3">
20048
- <span class="transaction-field-label" [textContent]="'TOTALS_AND_DISCOUNT' | localize" *ngIf="isFirst"></span>
20052
+ <span class="transaction-field-label" [textContent]="'TOTALS_AND_DISCOUNT' | localize"
20053
+ *ngIf="isFirst"></span>
20049
20054
  <co-transaction-line-vat-button
20050
20055
  [screenConfigurationObject]="cfgNames.LineVat"
20051
20056
  [transactionLine]="transactionLine"
20052
20057
  [transactionInfo]="transactionInfo">
20053
20058
  </co-transaction-line-vat-button>
20054
20059
  <div class="transaction-line-totals">
20055
- <co-input-text class="transaction-line-totals-price"
20056
- [model]="transactionLine.purchasePortalLine.grossOrderPrice | coCurrency: true"
20057
- [readonly]="true"
20058
- [customHeight]="true"
20060
+ <co-input-text
20061
+ class="transaction-line-totals-price"
20062
+ [class.warning]="transactionLine.purchasePortalLine.grossOrderPrice != transactionLine.purchasePortalLine.confirmedPrice"
20063
+ [model]="transactionLine.purchasePortalLine.grossOrderPrice | coCurrency: true"
20064
+ [readonly]="true"
20065
+ [customHeight]="true"
20059
20066
  ></co-input-text>
20060
20067
  <co-transaction-line-discount-button
20061
20068
  [screenConfigurationObject]="cfgNames.LineDiscount"
@@ -20064,6 +20071,7 @@ TransactionPurchaseOrderLineComponent.decorators = [
20064
20071
  ></co-transaction-line-discount-button>
20065
20072
  <div class="transaction-line-totals-amount">
20066
20073
  <co-input-text
20074
+ [class.warning]="transactionLine.amount !== transactionLine.quantityPurchaseToConfirm"
20067
20075
  [model]="transactionLine.amount"
20068
20076
  [leftIconData]="iconCacheService.getIcon(icons.CartShoppingRegular)"
20069
20077
  [readonly]="true"
@@ -20103,15 +20111,15 @@ TransactionPurchaseOrderLineComponent.decorators = [
20103
20111
  [forceReadonly]="true"
20104
20112
  [digitsOnly]="true"
20105
20113
  ></co-input-text>
20106
- <!-- <co-input-number-picker class="amount-number-picker"-->
20107
- <!-- [screenConfigurationObject]="cfgNames.LineConfirmedAmount"-->
20108
- <!-- [required]="true"-->
20109
- <!-- [(model)]="+transactionLine.quantityPurchaseToConfirm"-->
20110
- <!-- [decimals]="decimals"-->
20111
- <!-- [min]="1"-->
20112
- <!-- [max]="+transactionLine.purchasePortalLine.amountOrdered"-->
20113
- <!-- [leftIconData]="iconCacheService.getIcon(icons.FileCircleInfoRegular)"-->
20114
- <!-- ></co-input-number-picker>-->
20114
+ <!-- <co-input-number-picker class="amount-number-picker"-->
20115
+ <!-- [screenConfigurationObject]="cfgNames.LineConfirmedAmount"-->
20116
+ <!-- [required]="true"-->
20117
+ <!-- [(model)]="+transactionLine.quantityPurchaseToConfirm"-->
20118
+ <!-- [decimals]="decimals"-->
20119
+ <!-- [min]="1"-->
20120
+ <!-- [max]="+transactionLine.purchasePortalLine.amountOrdered"-->
20121
+ <!-- [leftIconData]="iconCacheService.getIcon(icons.FileCircleInfoRegular)"-->
20122
+ <!-- ></co-input-number-picker>-->
20115
20123
  </div>
20116
20124
  <co-transaction-line-confirmed-price class="transaction-line-confirmed-price price"
20117
20125
  [screenConfigurationObject]="cfgNames.LineConfirmedPrice"
@@ -30410,10 +30418,11 @@ DeliveryTypeTileModule.decorators = [
30410
30418
  ];
30411
30419
 
30412
30420
  class TransactionPaymentService {
30413
- constructor(_transactionEventService, _paymentConnectorService, _dictionaryService, _http) {
30421
+ constructor(_transactionEventService, _paymentConnectorService, _dictionaryService, _dialogService, _http) {
30414
30422
  this._transactionEventService = _transactionEventService;
30415
30423
  this._paymentConnectorService = _paymentConnectorService;
30416
30424
  this._dictionaryService = _dictionaryService;
30425
+ this._dialogService = _dialogService;
30417
30426
  this._http = _http;
30418
30427
  this.amount = 0;
30419
30428
  this.amountToPay = 0;
@@ -30453,10 +30462,20 @@ class TransactionPaymentService {
30453
30462
  request.cashRegisterNr = this.cashRegisterNr;
30454
30463
  request.cashRegisterGroupId = this.cashRegisterGroupId;
30455
30464
  request.cashRegisterDrawerId = this.cashRegisterDrawerId;
30465
+ //All payments need a cash drawer. Otherwise financial reports will be wrong.
30466
+ if (!this.cashRegisterDrawerId) {
30467
+ this._dialogService.showInformation('NEED_REGISTER_DRAWER_MESSAGE', true);
30468
+ return;
30469
+ }
30456
30470
  if (this.currentPaymentMethod && this.currentPaymentMethod.externalSourceId) { // psp payment
30457
30471
  let pspTransactionUuid = "";
30458
30472
  if (this.currentPaymentMethod.openCashDrawer) {
30459
- yield this._paymentConnectorService.openDrawer(this.printerName);
30473
+ if (this.printerName) {
30474
+ yield this._paymentConnectorService.openDrawer(this.printerName);
30475
+ }
30476
+ else {
30477
+ this._dialogService.showInformation('OPEN_DRAWER_NO_PRINTER_MESSAGE', true);
30478
+ }
30460
30479
  }
30461
30480
  if (this.currentPaymentMethod.pinTerminal) {
30462
30481
  pspTransactionUuid = yield this._paymentConnectorService.doPayment(request);
@@ -30477,7 +30496,12 @@ class TransactionPaymentService {
30477
30496
  }
30478
30497
  else {
30479
30498
  if (this.currentPaymentMethod.openCashDrawer) {
30480
- yield this._paymentConnectorService.openDrawer(this.printerName);
30499
+ if (this.printerName) {
30500
+ yield this._paymentConnectorService.openDrawer(this.printerName);
30501
+ }
30502
+ else {
30503
+ this._dialogService.showInformation('OPEN_DRAWER_NO_PRINTER_MESSAGE', true);
30504
+ }
30481
30505
  }
30482
30506
  this._paymentConnectorService.doPayment(request).then(() => __awaiter(this, void 0, void 0, function* () {
30483
30507
  yield this.preparePaymentInfo();
@@ -30609,6 +30633,7 @@ TransactionPaymentService.ctorParameters = () => [
30609
30633
  { type: TransactionEventService },
30610
30634
  { type: TransactionPaymentConnectorService },
30611
30635
  { type: DictionaryService },
30636
+ { type: DialogService },
30612
30637
  { type: HttpClient }
30613
30638
  ];
30614
30639
 
@@ -30761,6 +30786,7 @@ class TransactionPaymentBaseComponent {
30761
30786
  this.cashRegisterNr = cashRegister.nr;
30762
30787
  this.cashRegisterGroupId = cashRegister.group;
30763
30788
  this.cashRegisterDrawerId = +cashRegister.defaultDrawerNumber;
30789
+ this.paymentService.printerName = cashRegister.defaultPrinter;
30764
30790
  }
30765
30791
  handlePayment() {
30766
30792
  return this.paymentService.handlePayment();
@@ -30801,6 +30827,7 @@ class TransactionPaymentBaseComponent {
30801
30827
  this.cashRegisterGroupId = currentCashRegister.group;
30802
30828
  this.cashRegisterDrawerId = +currentCashRegister.defaultDrawerNumber;
30803
30829
  this.prepareCashDrawers(currentCashRegister.group);
30830
+ this.paymentService.printerName = currentCashRegister.defaultPrinter;
30804
30831
  }
30805
30832
  });
30806
30833
  }
@@ -30851,34 +30878,10 @@ class PaymentComponent extends TransactionPaymentBaseComponent {
30851
30878
  constructor() {
30852
30879
  super(...arguments);
30853
30880
  this.showClass = true;
30854
- this.cashDrawers = [];
30855
- }
30856
- handleDrawerChanged(cashDrawer) {
30857
- this.activeCashDrawer = cashDrawer;
30858
- this.cashRegisterDrawerId = cashDrawer.id;
30859
30881
  }
30860
30882
  cashRegisterSelected(cashRegister, index) {
30861
- this.cashRegisterIdx = index;
30862
- this.cashRegisterNr = cashRegister.nr;
30863
- this.cashRegisterGroupId = cashRegister.group;
30864
- this.cashRegisterDrawerId = +cashRegister.defaultDrawerNumber;
30883
+ super.cashRegisterSelected(cashRegister, index);
30865
30884
  this.activeCashRegister = cashRegister;
30866
- this.prepareCashDrawers(this.activeCashRegister.group).then(() => this._checkDefaultParameters(this.activeCashRegister));
30867
- }
30868
- prepareCashDrawers(group) {
30869
- return __awaiter(this, void 0, void 0, function* () {
30870
- const cashDrawersRequest = new CashDrawersRequest();
30871
- cashDrawersRequest.group = group;
30872
- this.cashDrawers = yield this.transactionService.getCashDrawers(cashDrawersRequest);
30873
- this.changeDetector.detectChanges();
30874
- });
30875
- }
30876
- _checkDefaultParameters(cashRegister) {
30877
- this.activeCashDrawer = null;
30878
- if (cashRegister.defaultDrawerNumber) {
30879
- const defaultCashDrawer = this.cashDrawers.find((drawer) => drawer.nr === cashRegister.defaultDrawerNumber);
30880
- this.activeCashDrawer = defaultCashDrawer ? defaultCashDrawer : this.activeCashDrawer;
30881
- }
30882
30885
  }
30883
30886
  }
30884
30887
  PaymentComponent.decorators = [
@@ -30917,17 +30920,6 @@ PaymentComponent.decorators = [
30917
30920
  (selectedChange)="cashRegisterSelected(cashRegister, index)"
30918
30921
  ></co-payment-tile>
30919
30922
  </div>
30920
-
30921
- <co-list-of-values [label]="'CASH_DRAWER' | localize"
30922
- [(model)]="activeCashDrawer"
30923
- [displayField]="'nr'"
30924
- [collection]="cashDrawers"
30925
- [multiselect]="false"
30926
- [required]="false"
30927
- [searchDisabled]="true"
30928
- (modelChange)="handleDrawerChanged($event)"
30929
- ></co-list-of-values>
30930
-
30931
30923
  </div>
30932
30924
  </div>
30933
30925
  <div class="payment-to-pay-wrapper">