@colijnit/transaction 261.20.66 → 261.20.68

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.
@@ -354,8 +354,8 @@ import { DateField } from '@colijnit/ioneconnector/build/factory/decorators/date
354
354
  class Version {
355
355
  name = "@colijnit/transaction";
356
356
  description = "Colijn IT transaction package";
357
- symVer = "261.20.66";
358
- publishDate = "18-8-2026, 18:32:02";
357
+ symVer = "261.20.68";
358
+ publishDate = "25-8-2026, 13:43:33";
359
359
  }
360
360
 
361
361
  class CheckoutModuleService extends BaseModuleService {
@@ -2024,6 +2024,7 @@ class TransactionEventService {
2024
2024
  removeFromContainerRequested = new Subject;
2025
2025
  removeFromContainerSuccess = new Subject;
2026
2026
  requestFocusOnArticleField = new Subject;
2027
+ transportNotificationsSet = new Subject;
2027
2028
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: TransactionEventService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
2028
2029
  static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: TransactionEventService, providedIn: "root" });
2029
2030
  }
@@ -13049,7 +13050,9 @@ class TransactionService extends PendingReasonService {
13049
13050
  request = this.addSelectedLineDetailsToTransportNotificationRequest(request);
13050
13051
  const response = await this.connector.setTransportNotificationOnSelectedLines(request);
13051
13052
  this.transactionDirty = true;
13052
- return this.handleLineOperationStatuses(response, true);
13053
+ const result = await this.handleLineOperationStatuses(response, true);
13054
+ this.transactionEventService.transportNotificationsSet.next();
13055
+ return result;
13053
13056
  }
13054
13057
  else {
13055
13058
  return false;
@@ -13215,14 +13218,17 @@ class TransactionService extends PendingReasonService {
13215
13218
  if (transactionId && analysisId && lines && lines.length > 0) {
13216
13219
  const selectedLinesForAI = lines.filter(l => l.linkedAnalysisResultId !== null && l.linkedAnalysisResultId !== undefined);
13217
13220
  const orderConfirmationTransactionLinks = [];
13218
- selectedLinesForAI.forEach(l => {
13219
- const orderConfirmationTransactionLink = new OrderConfirmationTransactionLink();
13220
- orderConfirmationTransactionLink.transactionId = transactionId;
13221
- orderConfirmationTransactionLink.transactionLineNumber = l.lineNr;
13222
- orderConfirmationTransactionLink.orderConfirmationAnalysisResultId = l.linkedAnalysisResultId;
13223
- orderConfirmationTransactionLinks.push(orderConfirmationTransactionLink);
13224
- });
13225
- return this.connector.linkTransactionToOrderConfirmation(analysisId, orderConfirmationTransactionLinks);
13221
+ //You can have an analysis available and still decide to not actually confirm any lines via AI.
13222
+ if (selectedLinesForAI.length > 0) {
13223
+ selectedLinesForAI.forEach(l => {
13224
+ const orderConfirmationTransactionLink = new OrderConfirmationTransactionLink();
13225
+ orderConfirmationTransactionLink.transactionId = transactionId;
13226
+ orderConfirmationTransactionLink.transactionLineNumber = l.lineNr;
13227
+ orderConfirmationTransactionLink.orderConfirmationAnalysisResultId = l.linkedAnalysisResultId;
13228
+ orderConfirmationTransactionLinks.push(orderConfirmationTransactionLink);
13229
+ });
13230
+ return this.connector.linkTransactionToOrderConfirmation(analysisId, orderConfirmationTransactionLinks);
13231
+ }
13226
13232
  }
13227
13233
  return Promise.resolve(true);
13228
13234
  }
@@ -14337,13 +14343,15 @@ class TransactionBaseComponent {
14337
14343
  ngOnDestroy() {
14338
14344
  }
14339
14345
  handleCommit = async (value) => {
14340
- if (this.readonly || this.forceReadonly) {
14346
+ if (this.readonly || this.forceReadonly || this.committing) {
14341
14347
  return;
14342
14348
  }
14343
14349
  if (await this.lockTransaction()) {
14344
14350
  this.committing = true;
14351
+ this.detectChanges();
14345
14352
  const response = await this.commit(value);
14346
14353
  this.committing = false;
14354
+ this.detectChanges();
14347
14355
  return response;
14348
14356
  }
14349
14357
  else {
@@ -53488,7 +53496,7 @@ class TransactionOverviewLineComponent extends TransactionLineBaseComponent {
53488
53496
  if (!this.transactionLine.orderLineSetCode) {
53489
53497
  //We are now allowed to actually add new lines to a composition.
53490
53498
  //If we're looking at members of a composition set don't show a checkbox for lines we can't add anyway.
53491
- return isNaN(this.orderLineSetService.currentCompositionId);
53499
+ return (isNaN(this.orderLineSetService.currentCompositionId) || this.orderLineSetService.currentCompositionId === null);
53492
53500
  }
53493
53501
  if (this.orderLineSetService.currentOrderLineSetCode === this.transactionLine.orderLineSetCode) {
53494
53502
  return true;
@@ -53499,7 +53507,7 @@ class TransactionOverviewLineComponent extends TransactionLineBaseComponent {
53499
53507
  return false;
53500
53508
  }
53501
53509
  checkboxValue() {
53502
- if (isNaN(this.orderLineSetService.currentCompositionId)) {
53510
+ if (isNaN(this.orderLineSetService.currentCompositionId) || this.orderLineSetService.currentCompositionId === null) {
53503
53511
  return (this.orderLineSetService.currentOrderLineSetCode === this.transactionLine.orderLineSetCode);
53504
53512
  }
53505
53513
  else {
@@ -53537,7 +53545,7 @@ class TransactionOverviewLineComponent extends TransactionLineBaseComponent {
53537
53545
  [isFirst]="isFirst"
53538
53546
  [checkbox]="canShowCheckbox()"
53539
53547
  [checkboxValue]="checkboxValue()"
53540
- [checkboxReadonly]="!isNaN(orderLineSetService.currentCompositionId)"
53548
+ [checkboxReadonly]="(!isNaN(orderLineSetService.currentCompositionId) && orderLineSetService.currentCompositionId !== null)"
53541
53549
  (checkboxValueChanged)="handleCheckBoxValueChanged($event)">
53542
53550
  <ng-container *ngIf="transactionLine.isArticle">
53543
53551
  <div class="transaction-line-wrapper">
@@ -53648,7 +53656,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImpo
53648
53656
  [isFirst]="isFirst"
53649
53657
  [checkbox]="canShowCheckbox()"
53650
53658
  [checkboxValue]="checkboxValue()"
53651
- [checkboxReadonly]="!isNaN(orderLineSetService.currentCompositionId)"
53659
+ [checkboxReadonly]="(!isNaN(orderLineSetService.currentCompositionId) && orderLineSetService.currentCompositionId !== null)"
53652
53660
  (checkboxValueChanged)="handleCheckBoxValueChanged($event)">
53653
53661
  <ng-container *ngIf="transactionLine.isArticle">
53654
53662
  <div class="transaction-line-wrapper">
@@ -62473,7 +62481,7 @@ class TransactionSalesOrderQuotationLineComponent extends TransactionLineBaseCom
62473
62481
  if (!this.transactionLine.orderLineSetCode) {
62474
62482
  //We are now allowed to actually add new lines to a composition.
62475
62483
  //If we're looking at members of a composition set don't show a checkbox for lines we can't add anyway.
62476
- return isNaN(this.orderLineSetService.currentCompositionId);
62484
+ return (isNaN(this.orderLineSetService.currentCompositionId) || this.orderLineSetService.currentCompositionId === null);
62477
62485
  }
62478
62486
  if (this.orderLineSetService.currentOrderLineSetCode === this.transactionLine.orderLineSetCode) {
62479
62487
  return true;
@@ -62484,7 +62492,7 @@ class TransactionSalesOrderQuotationLineComponent extends TransactionLineBaseCom
62484
62492
  return false;
62485
62493
  }
62486
62494
  checkboxValue() {
62487
- if (isNaN(this.orderLineSetService.currentCompositionId)) {
62495
+ if (isNaN(this.orderLineSetService.currentCompositionId) || this.orderLineSetService.currentCompositionId === null) {
62488
62496
  return (this.orderLineSetService.currentOrderLineSetCode === this.transactionLine.orderLineSetCode);
62489
62497
  }
62490
62498
  else {
@@ -62519,7 +62527,7 @@ class TransactionSalesOrderQuotationLineComponent extends TransactionLineBaseCom
62519
62527
  [selected]="selected"
62520
62528
  [checkbox]="canShowCheckbox()"
62521
62529
  [checkboxValue]="checkboxValue()"
62522
- [checkboxReadonly]="!isNaN(orderLineSetService.currentCompositionId)"
62530
+ [checkboxReadonly]="(!isNaN(orderLineSetService.currentCompositionId) && orderLineSetService.currentCompositionId !== null)"
62523
62531
  (checkboxValueChanged)="handleCheckBoxValueChanged($event)">
62524
62532
  @if (transactionLine.isArticle && !preview) {
62525
62533
  <div class="transaction-line-wrapper">
@@ -62583,7 +62591,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImpo
62583
62591
  [selected]="selected"
62584
62592
  [checkbox]="canShowCheckbox()"
62585
62593
  [checkboxValue]="checkboxValue()"
62586
- [checkboxReadonly]="!isNaN(orderLineSetService.currentCompositionId)"
62594
+ [checkboxReadonly]="(!isNaN(orderLineSetService.currentCompositionId) && orderLineSetService.currentCompositionId !== null)"
62587
62595
  (checkboxValueChanged)="handleCheckBoxValueChanged($event)">
62588
62596
  @if (transactionLine.isArticle && !preview) {
62589
62597
  <div class="transaction-line-wrapper">
@@ -80731,17 +80739,40 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImpo
80731
80739
  }] } });
80732
80740
 
80733
80741
  class TransactionPurchaseTransportLineComponent extends TransactionPurchaseTransportLineBaseComponent {
80734
- lineIndex;
80735
80742
  showClass() {
80736
80743
  return true;
80737
80744
  }
80745
+ lineIndex;
80738
80746
  totals = new TransportNotificationTotals();
80747
+ _sub;
80739
80748
  async handleVisibilityChange(visible) {
80740
80749
  if (visible) {
80741
- this.totals = await this.transactionService.getTransportNotificationTotalsByTransactionLine(this.transactionLine.uuid);
80742
- this.changeDetector.detectChanges();
80750
+ this.addTranportNotificationSub();
80751
+ await this.getTotals();
80752
+ }
80753
+ else {
80754
+ this.removeTranportNotificationSub();
80743
80755
  }
80744
80756
  }
80757
+ addTranportNotificationSub() {
80758
+ this._sub = this.transactionEventService.transportNotificationsSet.subscribe(() => {
80759
+ this.getTotals();
80760
+ });
80761
+ this.subs.push(this._sub);
80762
+ }
80763
+ removeTranportNotificationSub() {
80764
+ if (this._sub) {
80765
+ this._sub.unsubscribe();
80766
+ const index = this.subs.indexOf(this._sub);
80767
+ if (index !== -1) {
80768
+ this.subs.splice(index, 1);
80769
+ }
80770
+ }
80771
+ }
80772
+ async getTotals() {
80773
+ this.totals = await this.transactionService.getTransportNotificationTotalsByTransactionLine(this.transactionLine.uuid);
80774
+ this.changeDetector.detectChanges();
80775
+ }
80745
80776
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.16", ngImport: i0, type: TransactionPurchaseTransportLineComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
80746
80777
  static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.16", type: TransactionPurchaseTransportLineComponent, isStandalone: false, selector: "co-transaction-purchase-transport-line", inputs: { lineIndex: "lineIndex" }, host: { properties: { "class.co-transaction-purchase-order-line": "this.showClass" } }, usesInheritance: true, ngImport: i0, template: `
80747
80778
  <co-transaction-base-line
@@ -80964,11 +80995,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.16", ngImpo
80964
80995
  changeDetection: ChangeDetectionStrategy.OnPush,
80965
80996
  standalone: false
80966
80997
  }]
80967
- }], propDecorators: { lineIndex: [{
80968
- type: Input
80969
- }], showClass: [{
80998
+ }], propDecorators: { showClass: [{
80970
80999
  type: HostBinding,
80971
81000
  args: ["class.co-transaction-purchase-order-line"]
81001
+ }], lineIndex: [{
81002
+ type: Input
80972
81003
  }] } });
80973
81004
 
80974
81005
  class TransactionLineDateButtonModule {