@colijnit/transaction 258.1.6 → 258.1.7

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.
@@ -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.7";
37
+ this.publishDate = "29-4-2025 16:49:11";
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) {
@@ -42093,18 +42096,27 @@
42093
42096
  };
42094
42097
  DeliveryPlanningOverviewTileComponent.prototype.handleAvailabilityChecked = function (planOrder) {
42095
42098
  return __awaiter(this, void 0, void 0, function () {
42096
- var available;
42097
- return __generator(this, function (_b) {
42098
- switch (_b.label) {
42099
+ var _b, _c, _d, _e, _f;
42100
+ return __generator(this, function (_g) {
42101
+ switch (_g.label) {
42099
42102
  case 0:
42100
- available = this.transportDay.availableOnDate;
42101
- return [4 /*yield*/, this.deliveryMethodAvailabilityCheck(planOrder, available)];
42103
+ _c = (_b = this.availabilityChecked).emit;
42104
+ _d = { transportDay: this.transportDay };
42105
+ _f = this.transportDay.availableOnDate;
42106
+ if (!_f) return [3 /*break*/, 2];
42107
+ return [4 /*yield*/, this.deliveryMethodAvailabilityCheck(planOrder)];
42102
42108
  case 1:
42103
- available = _b.sent();
42104
- return [4 /*yield*/, this.districtAvailabilityCheck(planOrder, available)];
42109
+ _f = (_g.sent());
42110
+ _g.label = 2;
42105
42111
  case 2:
42106
- available = _b.sent();
42107
- this.availabilityChecked.emit({ transportDay: this.transportDay, available: available });
42112
+ _e = _f;
42113
+ if (!_e) return [3 /*break*/, 4];
42114
+ return [4 /*yield*/, this.districtAvailabilityCheck(planOrder)];
42115
+ case 3:
42116
+ _e = (_g.sent());
42117
+ _g.label = 4;
42118
+ case 4:
42119
+ _c.apply(_b, [(_d.available = _e, _d)]);
42108
42120
  return [2 /*return*/];
42109
42121
  }
42110
42122
  });
@@ -42138,12 +42150,14 @@
42138
42150
  });
42139
42151
  });
42140
42152
  };
42141
- DeliveryPlanningOverviewTileComponent.prototype.deliveryMethodAvailabilityCheck = function (planOrder, available) {
42153
+ DeliveryPlanningOverviewTileComponent.prototype.deliveryMethodAvailabilityCheck = function (planOrder) {
42142
42154
  return __awaiter(this, void 0, void 0, function () {
42155
+ var available;
42143
42156
  var _this = this;
42144
42157
  return __generator(this, function (_b) {
42145
42158
  switch (_b.label) {
42146
42159
  case 0:
42160
+ available = true;
42147
42161
  if (!available) return [3 /*break*/, 4];
42148
42162
  if (!!planOrder.partDelivery) return [3 /*break*/, 1];
42149
42163
  if (!this.transportDay.deliveryMethods.find(function (method) { return method === planOrder.deliveryMethod.toString(); })) {
@@ -42165,11 +42179,11 @@
42165
42179
  });
42166
42180
  });
42167
42181
  };
42168
- DeliveryPlanningOverviewTileComponent.prototype.districtAvailabilityCheck = function (planOrder, available) {
42182
+ DeliveryPlanningOverviewTileComponent.prototype.districtAvailabilityCheck = function (planOrder) {
42169
42183
  return __awaiter(this, void 0, void 0, function () {
42184
+ var available;
42170
42185
  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.
42186
+ available = true;
42173
42187
  if (available) {
42174
42188
  if (!this._deliveryPlanningService.planRayon) {
42175
42189
  if (!planOrder.districts || planOrder.districts.length) {
@@ -42890,6 +42904,9 @@
42890
42904
  //fire event selected outwards
42891
42905
  this.transactionEventService.selectedTransportDay.next(transportDay);
42892
42906
  }
42907
+ else {
42908
+ this.transactionEventService.resetTransportDayFilteredOrders.next();
42909
+ }
42893
42910
  };
42894
42911
  return DeliveryPlanningOverviewComponent;
42895
42912
  }());
@@ -46033,28 +46050,43 @@
46033
46050
  var _this = this;
46034
46051
  return __generator(this, function (_a) {
46035
46052
  switch (_a.label) {
46036
- 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)];
46043
- case 1:
46044
- planOrder = _a.sent();
46045
- return [4 /*yield*/, this._deliveryPlanningService.deliveryMethodAvailabilityCheck(planOrder, available, transportDay)];
46046
- case 2:
46047
- _a.sent();
46048
- return [4 /*yield*/, this._deliveryPlanningService.districtAvailabilityCheck(planOrder, available, transportDay)];
46049
- case 3:
46050
- _a.sent();
46051
- return [2 /*return*/, available ? order : null];
46052
- }
46053
- });
46054
- }); }))];
46053
+ case 0:
46054
+ console.log(this.searchService.transactions.length);
46055
+ return [4 /*yield*/, Promise.all(this.searchService.transactions.map(function (order) { return __awaiter(_this, void 0, void 0, function () {
46056
+ var planOrder, isAvailable, _a;
46057
+ return __generator(this, function (_b) {
46058
+ switch (_b.label) {
46059
+ case 0: return [4 /*yield*/, this.transactionService.getPlanOrder(order.transId)];
46060
+ case 1:
46061
+ planOrder = _b.sent();
46062
+ return [4 /*yield*/, this._deliveryPlanningService.deliveryMethodAvailabilityCheck(planOrder, transportDay)];
46063
+ case 2:
46064
+ _a = (_b.sent());
46065
+ if (!_a) return [3 /*break*/, 4];
46066
+ return [4 /*yield*/, this._deliveryPlanningService.districtAvailabilityCheck(planOrder, transportDay)];
46067
+ case 3:
46068
+ _a = (_b.sent());
46069
+ _b.label = 4;
46070
+ case 4:
46071
+ isAvailable = _a &&
46072
+ transportDay.availableOnDate;
46073
+ return [2 /*return*/, isAvailable ? order : null];
46074
+ }
46075
+ });
46076
+ }); }))];
46055
46077
  case 1:
46056
46078
  filteredTransactions = _a.sent();
46057
46079
  this.searchService.transactions = filteredTransactions.filter(function (order) { return order !== null; });
46080
+ console.log(this.searchService.transactions.length);
46081
+ return [2 /*return*/];
46082
+ }
46083
+ });
46084
+ }); }), this.transactionEventService.resetTransportDayFilteredOrders.subscribe(function (event) { return __awaiter(_this, void 0, void 0, function () {
46085
+ return __generator(this, function (_a) {
46086
+ switch (_a.label) {
46087
+ case 0: return [4 /*yield*/, this.searchService.searchTransactions()];
46088
+ case 1:
46089
+ _a.sent();
46058
46090
  return [2 /*return*/];
46059
46091
  }
46060
46092
  });