@colijnit/transaction 258.1.6 → 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.
Files changed (21) hide show
  1. package/bundles/colijnit-transaction.umd.js +99 -53
  2. package/bundles/colijnit-transaction.umd.js.map +1 -1
  3. package/colijnit-transaction.metadata.json +1 -1
  4. package/esm2015/lib/component/delivery-planning/service/delivery-planning.service.js +5 -3
  5. package/esm2015/lib/component/delivery-planning-main/component/delivery-planning-overview/component/delivery-planning-overview-tile/delivery-planning-overview-tile.component.js +6 -8
  6. package/esm2015/lib/component/delivery-planning-main/component/delivery-planning-overview/delivery-planning-overview.component.js +5 -2
  7. package/esm2015/lib/component/transaction-line/transaction-planning-line/components/transaction-planning-line-planned-resource/transaction-planning-line-planned-resource.component.js +1 -2
  8. package/esm2015/lib/component/transaction-line/transaction-planning-line/transaction-planning-line.component.js +25 -12
  9. package/esm2015/lib/component/transaction-search/transaction-search-result/transaction-search-result.component.js +7 -5
  10. package/esm2015/lib/service/transaction-event.service.js +2 -1
  11. package/esm2015/lib/transaction-version.js +3 -3
  12. package/fesm2015/colijnit-transaction.js +46 -28
  13. package/fesm2015/colijnit-transaction.js.map +1 -1
  14. package/lib/component/delivery-planning/service/delivery-planning.service.d.ts +2 -2
  15. package/lib/component/delivery-planning-main/component/delivery-planning-overview/component/delivery-planning-overview-tile/delivery-planning-overview-tile.component.d.ts +2 -2
  16. package/lib/component/transaction-line/transaction-planning-line/components/transaction-planning-line-planned-resource/style/_layout.scss +1 -0
  17. package/lib/component/transaction-line/transaction-planning-line/style/_layout.scss +6 -0
  18. package/lib/component/transaction-line/transaction-planning-line/transaction-planning-line.component.d.ts +1 -0
  19. package/lib/service/transaction-event.service.d.ts +1 -0
  20. package/package.json +1 -1
  21. package/colijnit-transaction-258.1.5.tgz +0 -0
@@ -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 = "258.1.6";
37
- this.publishDate = "28-4-2025 18:16:56";
36
+ this.symVer = "258.1.8";
37
+ this.publishDate = "30-4-2025 17:18:56";
38
38
  }
39
39
  return Version;
40
40
  }());
@@ -1556,6 +1556,7 @@
1556
1556
  this.selectAllSalesOrderLinesToBePicked = new rxjs.Subject();
1557
1557
  this.togglePurchaseOrderMarginInfo = new rxjs.Subject();
1558
1558
  this.selectedTransportDay = new rxjs.Subject();
1559
+ this.resetTransportDayFilteredOrders = new rxjs.Subject();
1559
1560
  this.selectAllPurchaseOrderLinesForReceiveGoods = new rxjs.Subject();
1560
1561
  this.updatingSalesOrderGeneratePurchaseOrders = new rxjs.Subject();
1561
1562
  this.updatingSalesOrderConfirmation = new rxjs.Subject();
@@ -31122,11 +31123,13 @@
31122
31123
  // Swap positions in the array
31123
31124
  _b = __read([array[newIndex], array[index]], 2), array[index] = _b[0], array[newIndex] = _b[1];
31124
31125
  };
31125
- DeliveryPlanningService.prototype.deliveryMethodAvailabilityCheck = function (planOrder, available, transportDay) {
31126
+ DeliveryPlanningService.prototype.deliveryMethodAvailabilityCheck = function (planOrder, transportDay) {
31126
31127
  return __awaiter(this, void 0, void 0, function () {
31128
+ var available;
31127
31129
  return __generator(this, function (_b) {
31128
31130
  switch (_b.label) {
31129
31131
  case 0:
31132
+ available = true;
31130
31133
  if (!available) return [3 /*break*/, 4];
31131
31134
  if (!!planOrder.partDelivery) return [3 /*break*/, 1];
31132
31135
  if (!transportDay.deliveryMethods.find(function (method) { return method === planOrder.deliveryMethod.toString(); })) {
@@ -31148,11 +31151,11 @@
31148
31151
  });
31149
31152
  });
31150
31153
  };
31151
- DeliveryPlanningService.prototype.districtAvailabilityCheck = function (planOrder, available, transportDay) {
31154
+ DeliveryPlanningService.prototype.districtAvailabilityCheck = function (planOrder, transportDay) {
31152
31155
  return __awaiter(this, void 0, void 0, function () {
31156
+ var available;
31153
31157
  return __generator(this, function (_b) {
31154
- //If true: you can plan without rayons/districts. Orders without districts can go everywhere in this case. Does it have districts that it needs to match a district in the plan resource.
31155
- //If false: orders without district can not be planned. On a plan resource without districts you can't plan. Other than that same rules apply.
31158
+ available = true;
31156
31159
  if (available) {
31157
31160
  if (!this.planRayon) {
31158
31161
  if (!planOrder.districts || planOrder.districts.length) {
@@ -31267,26 +31270,26 @@
31267
31270
  TransactionPlanningLineComponent.prototype.handleCheckBoxValueChanged = function (value, line) {
31268
31271
  return __awaiter(this, void 0, void 0, function () {
31269
31272
  var packageResponse;
31270
- return __generator(this, function (_e) {
31271
- switch (_e.label) {
31273
+ return __generator(this, function (_f) {
31274
+ switch (_f.label) {
31272
31275
  case 0:
31273
31276
  if (!this._deliveryPlanningService.lspMode) return [3 /*break*/, 5];
31274
31277
  return [4 /*yield*/, this.transactionService.getPackageInformation(this.transactionInfo.uuid, line.uuid)];
31275
31278
  case 1:
31276
- packageResponse = _e.sent();
31279
+ packageResponse = _f.sent();
31277
31280
  if (!((packageResponse === null || packageResponse === void 0 ? void 0 : packageResponse.length) && value)) return [3 /*break*/, 3];
31278
31281
  this.changeLineValue(false);
31279
31282
  return [4 /*yield*/, this._dialog.showError("LSP_ALREADY_CREATED_FOR_THIS_LINE", true)];
31280
31283
  case 2:
31281
- _e.sent();
31284
+ _f.sent();
31282
31285
  return [3 /*break*/, 4];
31283
31286
  case 3:
31284
31287
  this.changeLineValue(value);
31285
- _e.label = 4;
31288
+ _f.label = 4;
31286
31289
  case 4: return [3 /*break*/, 6];
31287
31290
  case 5:
31288
31291
  this.changeLineValue(value);
31289
- _e.label = 6;
31292
+ _f.label = 6;
31290
31293
  case 6: return [2 /*return*/];
31291
31294
  }
31292
31295
  });
@@ -31300,34 +31303,39 @@
31300
31303
  };
31301
31304
  TransactionPlanningLineComponent.prototype.changeLineValue = function (value) {
31302
31305
  this.transactionLine.selected = value;
31306
+ if (!this.transactionLine.amountSelected) {
31307
+ this.transactionLine.amountSelected = this.planOrderLine.amountToPlan;
31308
+ }
31303
31309
  this.detectChanges();
31304
31310
  };
31305
31311
  TransactionPlanningLineComponent.prototype.dragStarted = function (ev) {
31306
- var _a, _b, _c, _d;
31312
+ var _a, _b, _c, _d, _e;
31307
31313
  return __awaiter(this, void 0, void 0, function () {
31308
31314
  var lineElement, dragBox, dragImage;
31309
- return __generator(this, function (_e) {
31310
- switch (_e.label) {
31315
+ return __generator(this, function (_f) {
31316
+ switch (_f.label) {
31311
31317
  case 0:
31312
31318
  if (!this.checkedAvailibility) {
31313
31319
  this._deliveryPlanningService.availabilityCheckEvent.emit(this.transactionService.currentPlanOrder);
31314
31320
  this.checkedAvailibility = true;
31315
31321
  }
31316
- if (!(this.transactionLine.amountSelected <= 0 || ((_a = this.planOrderLine) === null || _a === void 0 ? void 0 : _a.amountToPlan) === 0)) return [3 /*break*/, 2];
31322
+ console.log(this.transactionLine.amountSelected);
31323
+ console.log((_a = this.planOrderLine) === null || _a === void 0 ? void 0 : _a.amountToPlan);
31324
+ if (!(this.transactionLine.amountSelected <= 0 || ((_b = this.planOrderLine) === null || _b === void 0 ? void 0 : _b.amountToPlan) === 0)) return [3 /*break*/, 2];
31317
31325
  return [4 /*yield*/, this._dialog.showError(this._dictionary.get('ORDER_CAN_NOT_BE_PLANNED_ON_RESOURCE'), true)];
31318
31326
  case 1:
31319
- _e.sent();
31320
- return [2 /*return*/];
31327
+ _f.sent();
31328
+ return [3 /*break*/, 3];
31321
31329
  case 2:
31322
31330
  this._deliveryPlanningService.currentTransId = this.transactionInfo.id;
31323
- (_b = ev.dataTransfer) === null || _b === void 0 ? void 0 : _b.setData('text', 'lines');
31324
- _e.label = 3;
31331
+ (_c = ev.dataTransfer) === null || _c === void 0 ? void 0 : _c.setData('text', 'lines');
31332
+ _f.label = 3;
31325
31333
  case 3:
31326
31334
  ev.target.classList.add('dragging');
31327
31335
  lineElement = ev.target.closest('co-transaction-base-line');
31328
31336
  if (!lineElement)
31329
31337
  return [2 /*return*/];
31330
- dragBox = (_c = lineElement.querySelector('.co-transaction-line-image-and-description')) === null || _c === void 0 ? void 0 : _c.cloneNode(true);
31338
+ dragBox = (_d = lineElement.querySelector('.co-transaction-line-image-and-description')) === null || _d === void 0 ? void 0 : _d.cloneNode(true);
31331
31339
  dragImage = document.createElement('div');
31332
31340
  dragImage.style.display = 'flex';
31333
31341
  dragImage.style.flexDirection = 'row';
@@ -31350,7 +31358,7 @@
31350
31358
  dragImage.style.top = '-1000px';
31351
31359
  dragImage.style.left = '-1000px';
31352
31360
  // Set the custom drag image
31353
- (_d = ev.dataTransfer) === null || _d === void 0 ? void 0 : _d.setDragImage(dragImage, 50, 25);
31361
+ (_e = ev.dataTransfer) === null || _e === void 0 ? void 0 : _e.setDragImage(dragImage, 50, 25);
31354
31362
  // Cleanup: Remove the drag image after it's set
31355
31363
  setTimeout(function () { return document.body.removeChild(dragImage); }, 0);
31356
31364
  return [2 /*return*/];
@@ -31379,17 +31387,29 @@
31379
31387
  enumerable: false,
31380
31388
  configurable: true
31381
31389
  });
31390
+ Object.defineProperty(TransactionPlanningLineComponent.prototype, "lineFullyPlanned", {
31391
+ get: function () {
31392
+ if (this.planOrderLine) {
31393
+ return this.planOrderLine.amountToPlan === 0;
31394
+ }
31395
+ else {
31396
+ return false;
31397
+ }
31398
+ },
31399
+ enumerable: false,
31400
+ configurable: true
31401
+ });
31382
31402
  TransactionPlanningLineComponent.prototype.handleQuantityToPlanChange = function (amount) {
31383
31403
  this.transactionLine.amountSelected = amount;
31384
31404
  };
31385
31405
  TransactionPlanningLineComponent.prototype.handlePlannedResourceClicked = function (plannedResource) {
31386
31406
  return __awaiter(this, void 0, void 0, function () {
31387
31407
  var plannings;
31388
- return __generator(this, function (_e) {
31389
- switch (_e.label) {
31408
+ return __generator(this, function (_f) {
31409
+ switch (_f.label) {
31390
31410
  case 0: return [4 /*yield*/, this.transactionConnectorService.getPlanningSources()];
31391
31411
  case 1:
31392
- plannings = _e.sent();
31412
+ plannings = _f.sent();
31393
31413
  this._deliveryPlanningService.currentStartDate = plannedResource.planningStartTime;
31394
31414
  this._deliveryPlanningService.currentPlanning = plannings.find(function (planning) { return planning.planningId === plannedResource.planningId; });
31395
31415
  this.transactionEventService.openSidePanel.next(this.transactionLine);
@@ -31404,7 +31424,7 @@
31404
31424
  TransactionPlanningLineComponent.decorators = [
31405
31425
  { type: i0.Component, args: [{
31406
31426
  selector: 'co-transaction-planning-line',
31407
- template: "\n <co-transaction-base-line\n [transactionInfo]=\"transactionInfo\"\n [transactionLine]=\"transactionLine\"\n [preview]=\"preview\"\n [isFirst]=\"isFirst\"\n [draggable]=\"!linePlanned\"\n (dragstart)=\"dragStarted($event)\"\n [checkbox]=\"true\"\n [checkboxValue]=\"transactionLine.selected || !transactionInfo?.allowPartialDelivery\"\n [checkboxReadonly]=\"!transactionInfo?.allowPartialDelivery\"\n (checkboxValueChanged)=\"handleCheckBoxValueChanged($event, transactionLine)\"\n (click)=\"handleLineClicked($event)\">\n <ng-container *ngIf=\"transactionLine.isArticle\">\n <div class=\"transaction-line-wrapper\">\n <div *ngIf=!preview class=\"transaction-line-extended-wrapper\">\n <div class=\"column-full align-right\">\n <co-transaction-line-statusbar\n [screenConfigurationObject]=\"cfgNames.StatusBar\"\n [configNames]=\"statusBarConfigNames\"\n [activeCategory]=\"category.SalesOrderOverview\">\n </co-transaction-line-statusbar>\n <co-transaction-line-commission-button\n class=\"transaction-field-wrapper medium\"\n [screenConfigurationObject]=\"cfgNames.LineCommission\"\n [inputLabel]=\"true\"\n ></co-transaction-line-commission-button>\n <co-transaction-line-warehouse-button\n class=\"transaction-field-wrapper medium\"\n [screenConfigurationObject]=\"cfgNames.LineWarehouse\"\n [inputLabel]=\"true\"\n ></co-transaction-line-warehouse-button>\n <co-transaction-line-delivery-button\n class=\"transaction-field-wrapper medium\"\n [screenConfigurationObject]=\"cfgNames.LineDeliveryMethod\"\n [inputLabel]=\"true\"\n ></co-transaction-line-delivery-button>\n <co-transaction-line-delivery-date-button\n class=\"transaction-field-wrapper medium transaction-line-delivery-date two-column\"\n [screenConfigurationObject]=\"cfgNames.LineDeliveryDate\"\n [inputLabel]=\"true\"\n ></co-transaction-line-delivery-date-button>\n <co-transaction-line-vat-button\n *ngIf=\"!preview\"\n class=\"transaction-field-wrapper small\"\n [screenConfigurationObject]=\"cfgNames.LineVat\"\n [inputLabel]=\"true\"\n ></co-transaction-line-vat-button>\n <co-transaction-line-price\n class=\"transaction-field-wrapper small transaction-line-totals-price price\"\n [screenConfigurationObject]=\"cfgNames.LinePrice\"\n [showLabel]=\"false\"\n [defaultEditMode]=\"false\"\n [inputLabel]=\"true\"\n ></co-transaction-line-price>\n <co-transaction-line-discount-button\n *ngIf=\"!preview\"\n class=\"transaction-field-wrapper small\"\n [screenConfigurationObject]=\"cfgNames.LineDiscount\"\n [configNames]=\"discountConfigNames\"\n [inputLabel]=\"true\"\n ></co-transaction-line-discount-button>\n <div class=\"transaction-field-wrapper small\">\n <div class=\"inside-field\">\n <co-transaction-line-label [insideLabel]=\"'QUANTITY'\"></co-transaction-line-label>\n <co-input-number-picker class=\"amount-number-picker\"\n [min]=\"0\"\n [max]=\"planOrderLine?.amountToPlan\"\n [model]=\"planOrderLine?.amountToPlan\"\n (modelChange)=\"handleQuantityToPlanChange($event)\"></co-input-number-picker>\n </div>\n </div>\n <div class=\"transaction-field-wrapper small\" *ngIf=\"this.plannedResourceForTransactionLine?.length > 0\">\n <div class=\"inside-field\">\n <div class=\"row\">\n <co-transaction-planning-line-planned-resource\n *ngFor=\"let plannedResource of this.plannedResourceForTransactionLine\"\n [plannedResource]=\"plannedResource\"\n (plannedResourceClickedEvent)=\"handlePlannedResourceClicked($event)\">\n </co-transaction-planning-line-planned-resource>\n </div>\n </div>\n </div>\n <co-editable-label\n class=\"transaction-field-wrapper small transaction-line-totals-total price\"\n [model]=\"transactionLine.displayNetLineTotal | coCurrency: true\"\n [editModel]=\"transactionLine.displayNetLineTotal\"\n [readonly]=\"true\"\n [inputLabel]=\"true\"\n ></co-editable-label>\n </div>\n </div>\n </div>\n </ng-container>\n </co-transaction-base-line>\n ",
31427
+ template: "\n <co-transaction-base-line\n [transactionInfo]=\"transactionInfo\"\n [transactionLine]=\"transactionLine\"\n [preview]=\"preview\"\n [isFirst]=\"isFirst\"\n [draggable]=\"!lineFullyPlanned\"\n (dragstart)=\"dragStarted($event)\"\n [checkbox]=\"!lineFullyPlanned\"\n [checkboxValue]=\"transactionLine.selected || !transactionInfo?.allowPartialDelivery\"\n [checkboxReadonly]=\"!transactionInfo?.allowPartialDelivery\"\n (checkboxValueChanged)=\"handleCheckBoxValueChanged($event, transactionLine)\"\n (click)=\"handleLineClicked($event)\">\n <ng-container *ngIf=\"transactionLine.isArticle\">\n <div class=\"transaction-line-wrapper\">\n <div *ngIf=!preview class=\"transaction-line-extended-wrapper\">\n <div class=\"column-full align-right\">\n <co-transaction-line-statusbar\n [screenConfigurationObject]=\"cfgNames.StatusBar\"\n [configNames]=\"statusBarConfigNames\"\n [activeCategory]=\"category.SalesOrderOverview\">\n </co-transaction-line-statusbar>\n <co-transaction-line-commission-button\n class=\"transaction-field-wrapper medium\"\n [screenConfigurationObject]=\"cfgNames.LineCommission\"\n [inputLabel]=\"true\"\n ></co-transaction-line-commission-button>\n <co-transaction-line-warehouse-button\n class=\"transaction-field-wrapper medium\"\n [screenConfigurationObject]=\"cfgNames.LineWarehouse\"\n [inputLabel]=\"true\"\n ></co-transaction-line-warehouse-button>\n <co-transaction-line-delivery-button\n class=\"transaction-field-wrapper medium\"\n [screenConfigurationObject]=\"cfgNames.LineDeliveryMethod\"\n [inputLabel]=\"true\"\n ></co-transaction-line-delivery-button>\n <co-transaction-line-delivery-date-button\n class=\"transaction-field-wrapper medium transaction-line-delivery-date two-column\"\n [screenConfigurationObject]=\"cfgNames.LineDeliveryDate\"\n [inputLabel]=\"true\"\n ></co-transaction-line-delivery-date-button>\n <co-transaction-line-vat-button\n *ngIf=\"!preview\"\n class=\"transaction-field-wrapper small\"\n [screenConfigurationObject]=\"cfgNames.LineVat\"\n [inputLabel]=\"true\"\n ></co-transaction-line-vat-button>\n <co-transaction-line-price\n class=\"transaction-field-wrapper small transaction-line-totals-price price\"\n [screenConfigurationObject]=\"cfgNames.LinePrice\"\n [showLabel]=\"false\"\n [defaultEditMode]=\"false\"\n [inputLabel]=\"true\"\n ></co-transaction-line-price>\n <co-transaction-line-discount-button\n *ngIf=\"!preview\"\n class=\"transaction-field-wrapper small\"\n [screenConfigurationObject]=\"cfgNames.LineDiscount\"\n [configNames]=\"discountConfigNames\"\n [inputLabel]=\"true\"\n ></co-transaction-line-discount-button>\n <div class=\"transaction-field-wrapper small\">\n <div class=\"inside-field\">\n <co-transaction-line-label [insideLabel]=\"'QUANTITY'\"></co-transaction-line-label>\n <co-input-number-picker *ngIf=\"planOrderLine?.amountToPlan && planOrderLine.amountToPlan !== 0\" class=\"amount-number-picker\"\n [min]=\"0\"\n [max]=\"planOrderLine?.amountToPlan\"\n [model]=\"planOrderLine?.amountToPlan ? planOrderLine?.amountToPlan : 0\"\n (modelChange)=\"handleQuantityToPlanChange($event)\"></co-input-number-picker>\n </div>\n </div>\n <div class=\"transaction-field-wrapper small\" *ngIf=\"this.plannedResourceForTransactionLine?.length > 0\">\n <div class=\"inside-field\">\n <co-transaction-line-label [insideLabel]=\"'PLANNED'\"></co-transaction-line-label>\n <div class=\"column\">\n <co-transaction-planning-line-planned-resource\n *ngFor=\"let plannedResource of this.plannedResourceForTransactionLine\"\n [plannedResource]=\"plannedResource\"\n (plannedResourceClickedEvent)=\"handlePlannedResourceClicked($event)\">\n </co-transaction-planning-line-planned-resource>\n </div>\n </div>\n </div>\n <co-editable-label\n class=\"transaction-field-wrapper small transaction-line-totals-total price\"\n [model]=\"transactionLine.displayNetLineTotal | coCurrency: true\"\n [editModel]=\"transactionLine.displayNetLineTotal\"\n [readonly]=\"true\"\n [inputLabel]=\"true\"\n ></co-editable-label>\n </div>\n </div>\n </div>\n </ng-container>\n </co-transaction-base-line>\n ",
31408
31428
  encapsulation: i0.ViewEncapsulation.None,
31409
31429
  changeDetection: i0.ChangeDetectionStrategy.OnPush
31410
31430
  },] }
@@ -35825,7 +35845,7 @@
35825
35845
  TransactionPlanningLinePlannedResourceComponent.decorators = [
35826
35846
  { type: i0.Component, args: [{
35827
35847
  selector: "co-transaction-planning-line-planned-resource",
35828
- template: "\n <div class=\"row\" (click)=\"handlePlannedResourceClicked()\">\n <co-icon [iconData]=\"iconCacheService.getIcon(icons.TruckContainerDuo)\"></co-icon>\n <span class=\"bold\" [textContent]=\"plannedResource.planningStartTime | date: 'dd-MM-YYYY'\"></span>\n </div>\n ",
35848
+ template: "\n <div class=\"row\" (click)=\"handlePlannedResourceClicked()\">\n <span class=\"bold\" [textContent]=\"plannedResource.planningStartTime | date: 'dd-MM-YYYY'\"></span>\n </div>\n ",
35829
35849
  encapsulation: i0.ViewEncapsulation.None
35830
35850
  },] }
35831
35851
  ];
@@ -42093,18 +42113,27 @@
42093
42113
  };
42094
42114
  DeliveryPlanningOverviewTileComponent.prototype.handleAvailabilityChecked = function (planOrder) {
42095
42115
  return __awaiter(this, void 0, void 0, function () {
42096
- var available;
42097
- return __generator(this, function (_b) {
42098
- switch (_b.label) {
42116
+ var _b, _c, _d, _e, _f;
42117
+ return __generator(this, function (_g) {
42118
+ switch (_g.label) {
42099
42119
  case 0:
42100
- available = this.transportDay.availableOnDate;
42101
- return [4 /*yield*/, this.deliveryMethodAvailabilityCheck(planOrder, available)];
42120
+ _c = (_b = this.availabilityChecked).emit;
42121
+ _d = { transportDay: this.transportDay };
42122
+ _f = this.transportDay.availableOnDate;
42123
+ if (!_f) return [3 /*break*/, 2];
42124
+ return [4 /*yield*/, this.deliveryMethodAvailabilityCheck(planOrder)];
42102
42125
  case 1:
42103
- available = _b.sent();
42104
- return [4 /*yield*/, this.districtAvailabilityCheck(planOrder, available)];
42126
+ _f = (_g.sent());
42127
+ _g.label = 2;
42105
42128
  case 2:
42106
- available = _b.sent();
42107
- this.availabilityChecked.emit({ transportDay: this.transportDay, available: available });
42129
+ _e = _f;
42130
+ if (!_e) return [3 /*break*/, 4];
42131
+ return [4 /*yield*/, this.districtAvailabilityCheck(planOrder)];
42132
+ case 3:
42133
+ _e = (_g.sent());
42134
+ _g.label = 4;
42135
+ case 4:
42136
+ _c.apply(_b, [(_d.available = _e, _d)]);
42108
42137
  return [2 /*return*/];
42109
42138
  }
42110
42139
  });
@@ -42138,12 +42167,14 @@
42138
42167
  });
42139
42168
  });
42140
42169
  };
42141
- DeliveryPlanningOverviewTileComponent.prototype.deliveryMethodAvailabilityCheck = function (planOrder, available) {
42170
+ DeliveryPlanningOverviewTileComponent.prototype.deliveryMethodAvailabilityCheck = function (planOrder) {
42142
42171
  return __awaiter(this, void 0, void 0, function () {
42172
+ var available;
42143
42173
  var _this = this;
42144
42174
  return __generator(this, function (_b) {
42145
42175
  switch (_b.label) {
42146
42176
  case 0:
42177
+ available = true;
42147
42178
  if (!available) return [3 /*break*/, 4];
42148
42179
  if (!!planOrder.partDelivery) return [3 /*break*/, 1];
42149
42180
  if (!this.transportDay.deliveryMethods.find(function (method) { return method === planOrder.deliveryMethod.toString(); })) {
@@ -42165,11 +42196,11 @@
42165
42196
  });
42166
42197
  });
42167
42198
  };
42168
- DeliveryPlanningOverviewTileComponent.prototype.districtAvailabilityCheck = function (planOrder, available) {
42199
+ DeliveryPlanningOverviewTileComponent.prototype.districtAvailabilityCheck = function (planOrder) {
42169
42200
  return __awaiter(this, void 0, void 0, function () {
42201
+ var available;
42170
42202
  return __generator(this, function (_b) {
42171
- //If true: you can plan without rayons/districts. Orders without districts can go everywhere in this case. Does it have districts that it needs to match a district in the plan resource.
42172
- //If false: orders without district can not be planned. On a plan resource without districts you can't plan. Other than that same rules apply.
42203
+ available = true;
42173
42204
  if (available) {
42174
42205
  if (!this._deliveryPlanningService.planRayon) {
42175
42206
  if (!planOrder.districts || planOrder.districts.length) {
@@ -42512,7 +42543,7 @@
42512
42543
  order.tasksLoaded = true;
42513
42544
  order.lines.forEach(function (line) {
42514
42545
  line.selected = true;
42515
- if (line.amountToPlan === 0) {
42546
+ if (!line.amountToPlan || line.amountToPlan === 0) {
42516
42547
  line.amountToPlan = (line.amountInOrder - line.amountPlanned);
42517
42548
  }
42518
42549
  });
@@ -42890,6 +42921,9 @@
42890
42921
  //fire event selected outwards
42891
42922
  this.transactionEventService.selectedTransportDay.next(transportDay);
42892
42923
  }
42924
+ else {
42925
+ this.transactionEventService.resetTransportDayFilteredOrders.next();
42926
+ }
42893
42927
  };
42894
42928
  return DeliveryPlanningOverviewComponent;
42895
42929
  }());
@@ -46034,21 +46068,24 @@
46034
46068
  return __generator(this, function (_a) {
46035
46069
  switch (_a.label) {
46036
46070
  case 0: return [4 /*yield*/, Promise.all(this.searchService.transactions.map(function (order) { return __awaiter(_this, void 0, void 0, function () {
46037
- var available, planOrder;
46038
- return __generator(this, function (_a) {
46039
- switch (_a.label) {
46040
- case 0:
46041
- available = true;
46042
- return [4 /*yield*/, this.transactionService.getPlanOrder(order.transId)];
46071
+ var planOrder, isAvailable, _a;
46072
+ return __generator(this, function (_b) {
46073
+ switch (_b.label) {
46074
+ case 0: return [4 /*yield*/, this.transactionService.getPlanOrder(order.transId)];
46043
46075
  case 1:
46044
- planOrder = _a.sent();
46045
- return [4 /*yield*/, this._deliveryPlanningService.deliveryMethodAvailabilityCheck(planOrder, available, transportDay)];
46076
+ planOrder = _b.sent();
46077
+ return [4 /*yield*/, this._deliveryPlanningService.deliveryMethodAvailabilityCheck(planOrder, transportDay)];
46046
46078
  case 2:
46047
- _a.sent();
46048
- return [4 /*yield*/, this._deliveryPlanningService.districtAvailabilityCheck(planOrder, available, transportDay)];
46079
+ _a = (_b.sent());
46080
+ if (!_a) return [3 /*break*/, 4];
46081
+ return [4 /*yield*/, this._deliveryPlanningService.districtAvailabilityCheck(planOrder, transportDay)];
46049
46082
  case 3:
46050
- _a.sent();
46051
- return [2 /*return*/, available ? order : null];
46083
+ _a = (_b.sent());
46084
+ _b.label = 4;
46085
+ case 4:
46086
+ isAvailable = _a &&
46087
+ transportDay.availableOnDate;
46088
+ return [2 /*return*/, isAvailable ? order : null];
46052
46089
  }
46053
46090
  });
46054
46091
  }); }))];
@@ -46058,6 +46095,15 @@
46058
46095
  return [2 /*return*/];
46059
46096
  }
46060
46097
  });
46098
+ }); }), this.transactionEventService.resetTransportDayFilteredOrders.subscribe(function (event) { return __awaiter(_this, void 0, void 0, function () {
46099
+ return __generator(this, function (_a) {
46100
+ switch (_a.label) {
46101
+ case 0: return [4 /*yield*/, this.searchService.searchTransactions()];
46102
+ case 1:
46103
+ _a.sent();
46104
+ return [2 /*return*/];
46105
+ }
46106
+ });
46061
46107
  }); }));
46062
46108
  };
46063
46109
  TransactionSearchResultComponent.prototype.ngOnChanges = function (changes) {