@colijnit/transaction 258.1.7 → 258.1.8

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.
@@ -293,8 +293,8 @@ class Version {
293
293
  constructor() {
294
294
  this.name = "@colijnit/transaction";
295
295
  this.description = "Colijn IT transaction package";
296
- this.symVer = "258.1.7";
297
- this.publishDate = "29-4-2025 16:49:11";
296
+ this.symVer = "258.1.8";
297
+ this.publishDate = "30-4-2025 17:18:56";
298
298
  }
299
299
  }
300
300
 
@@ -27234,28 +27234,32 @@ class TransactionPlanningLineComponent extends TransactionLineBaseComponent {
27234
27234
  }
27235
27235
  changeLineValue(value) {
27236
27236
  this.transactionLine.selected = value;
27237
+ if (!this.transactionLine.amountSelected) {
27238
+ this.transactionLine.amountSelected = this.planOrderLine.amountToPlan;
27239
+ }
27237
27240
  this.detectChanges();
27238
27241
  }
27239
27242
  dragStarted(ev) {
27240
- var _a, _b, _c, _d;
27243
+ var _a, _b, _c, _d, _e;
27241
27244
  return __awaiter(this, void 0, void 0, function* () {
27242
27245
  if (!this.checkedAvailibility) {
27243
27246
  this._deliveryPlanningService.availabilityCheckEvent.emit(this.transactionService.currentPlanOrder);
27244
27247
  this.checkedAvailibility = true;
27245
27248
  }
27246
- if (this.transactionLine.amountSelected <= 0 || ((_a = this.planOrderLine) === null || _a === void 0 ? void 0 : _a.amountToPlan) === 0) {
27249
+ console.log(this.transactionLine.amountSelected);
27250
+ console.log((_a = this.planOrderLine) === null || _a === void 0 ? void 0 : _a.amountToPlan);
27251
+ if (this.transactionLine.amountSelected <= 0 || ((_b = this.planOrderLine) === null || _b === void 0 ? void 0 : _b.amountToPlan) === 0) {
27247
27252
  yield this._dialog.showError(this._dictionary.get('ORDER_CAN_NOT_BE_PLANNED_ON_RESOURCE'), true);
27248
- return;
27249
27253
  }
27250
27254
  else {
27251
27255
  this._deliveryPlanningService.currentTransId = this.transactionInfo.id;
27252
- (_b = ev.dataTransfer) === null || _b === void 0 ? void 0 : _b.setData('text', 'lines');
27256
+ (_c = ev.dataTransfer) === null || _c === void 0 ? void 0 : _c.setData('text', 'lines');
27253
27257
  }
27254
27258
  ev.target.classList.add('dragging');
27255
27259
  const lineElement = ev.target.closest('co-transaction-base-line');
27256
27260
  if (!lineElement)
27257
27261
  return;
27258
- const dragBox = (_c = lineElement.querySelector('.co-transaction-line-image-and-description')) === null || _c === void 0 ? void 0 : _c.cloneNode(true);
27262
+ const dragBox = (_d = lineElement.querySelector('.co-transaction-line-image-and-description')) === null || _d === void 0 ? void 0 : _d.cloneNode(true);
27259
27263
  const dragImage = document.createElement('div');
27260
27264
  dragImage.style.display = 'flex';
27261
27265
  dragImage.style.flexDirection = 'row';
@@ -27278,7 +27282,7 @@ class TransactionPlanningLineComponent extends TransactionLineBaseComponent {
27278
27282
  dragImage.style.top = '-1000px';
27279
27283
  dragImage.style.left = '-1000px';
27280
27284
  // Set the custom drag image
27281
- (_d = ev.dataTransfer) === null || _d === void 0 ? void 0 : _d.setDragImage(dragImage, 50, 25);
27285
+ (_e = ev.dataTransfer) === null || _e === void 0 ? void 0 : _e.setDragImage(dragImage, 50, 25);
27282
27286
  // Cleanup: Remove the drag image after it's set
27283
27287
  setTimeout(() => document.body.removeChild(dragImage), 0);
27284
27288
  });
@@ -27299,6 +27303,14 @@ class TransactionPlanningLineComponent extends TransactionLineBaseComponent {
27299
27303
  }
27300
27304
  return !((_b = (_a = this._deliveryPlanningService.linesPlanOrder) === null || _a === void 0 ? void 0 : _a.lines) === null || _b === void 0 ? void 0 : _b.find(line => line.originalLineNr === this.transactionLine.lineNr));
27301
27305
  }
27306
+ get lineFullyPlanned() {
27307
+ if (this.planOrderLine) {
27308
+ return this.planOrderLine.amountToPlan === 0;
27309
+ }
27310
+ else {
27311
+ return false;
27312
+ }
27313
+ }
27302
27314
  handleQuantityToPlanChange(amount) {
27303
27315
  this.transactionLine.amountSelected = amount;
27304
27316
  }
@@ -27321,9 +27333,9 @@ TransactionPlanningLineComponent.decorators = [
27321
27333
  [transactionLine]="transactionLine"
27322
27334
  [preview]="preview"
27323
27335
  [isFirst]="isFirst"
27324
- [draggable]="!linePlanned"
27336
+ [draggable]="!lineFullyPlanned"
27325
27337
  (dragstart)="dragStarted($event)"
27326
- [checkbox]="true"
27338
+ [checkbox]="!lineFullyPlanned"
27327
27339
  [checkboxValue]="transactionLine.selected || !transactionInfo?.allowPartialDelivery"
27328
27340
  [checkboxReadonly]="!transactionInfo?.allowPartialDelivery"
27329
27341
  (checkboxValueChanged)="handleCheckBoxValueChanged($event, transactionLine)"
@@ -27380,16 +27392,17 @@ TransactionPlanningLineComponent.decorators = [
27380
27392
  <div class="transaction-field-wrapper small">
27381
27393
  <div class="inside-field">
27382
27394
  <co-transaction-line-label [insideLabel]="'QUANTITY'"></co-transaction-line-label>
27383
- <co-input-number-picker class="amount-number-picker"
27395
+ <co-input-number-picker *ngIf="planOrderLine?.amountToPlan && planOrderLine.amountToPlan !== 0" class="amount-number-picker"
27384
27396
  [min]="0"
27385
27397
  [max]="planOrderLine?.amountToPlan"
27386
- [model]="planOrderLine?.amountToPlan"
27398
+ [model]="planOrderLine?.amountToPlan ? planOrderLine?.amountToPlan : 0"
27387
27399
  (modelChange)="handleQuantityToPlanChange($event)"></co-input-number-picker>
27388
27400
  </div>
27389
27401
  </div>
27390
27402
  <div class="transaction-field-wrapper small" *ngIf="this.plannedResourceForTransactionLine?.length > 0">
27391
27403
  <div class="inside-field">
27392
- <div class="row">
27404
+ <co-transaction-line-label [insideLabel]="'PLANNED'"></co-transaction-line-label>
27405
+ <div class="column">
27393
27406
  <co-transaction-planning-line-planned-resource
27394
27407
  *ngFor="let plannedResource of this.plannedResourceForTransactionLine"
27395
27408
  [plannedResource]="plannedResource"
@@ -32381,7 +32394,6 @@ TransactionPlanningLinePlannedResourceComponent.decorators = [
32381
32394
  selector: "co-transaction-planning-line-planned-resource",
32382
32395
  template: `
32383
32396
  <div class="row" (click)="handlePlannedResourceClicked()">
32384
- <co-icon [iconData]="iconCacheService.getIcon(icons.TruckContainerDuo)"></co-icon>
32385
32397
  <span class="bold" [textContent]="plannedResource.planningStartTime | date: 'dd-MM-YYYY'"></span>
32386
32398
  </div>
32387
32399
  `,
@@ -39677,7 +39689,7 @@ class DeliveryPlanningOverviewComponent {
39677
39689
  order.tasksLoaded = true;
39678
39690
  order.lines.forEach(line => {
39679
39691
  line.selected = true;
39680
- if (line.amountToPlan === 0) {
39692
+ if (!line.amountToPlan || line.amountToPlan === 0) {
39681
39693
  line.amountToPlan = (line.amountInOrder - line.amountPlanned);
39682
39694
  }
39683
39695
  });
@@ -43966,7 +43978,6 @@ class TransactionSearchResultComponent {
43966
43978
  this.markSelectedTransactions();
43967
43979
  }
43968
43980
  }), this.transactionEventService.selectedTransportDay.subscribe((transportDay) => __awaiter(this, void 0, void 0, function* () {
43969
- console.log(this.searchService.transactions.length);
43970
43981
  const filteredTransactions = yield Promise.all(this.searchService.transactions.map((order) => __awaiter(this, void 0, void 0, function* () {
43971
43982
  const planOrder = yield this.transactionService.getPlanOrder(order.transId);
43972
43983
  const isAvailable = (yield this._deliveryPlanningService.deliveryMethodAvailabilityCheck(planOrder, transportDay)) &&
@@ -43975,7 +43986,6 @@ class TransactionSearchResultComponent {
43975
43986
  return isAvailable ? order : null;
43976
43987
  })));
43977
43988
  this.searchService.transactions = filteredTransactions.filter((order) => order !== null);
43978
- console.log(this.searchService.transactions.length);
43979
43989
  })), this.transactionEventService.resetTransportDayFilteredOrders.subscribe((event) => __awaiter(this, void 0, void 0, function* () {
43980
43990
  yield this.searchService.searchTransactions();
43981
43991
  })));