@colijnit/transaction 255.1.36 → 255.1.37

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 (32) hide show
  1. package/bundles/colijnit-transaction.umd.js +234 -30
  2. package/bundles/colijnit-transaction.umd.js.map +1 -1
  3. package/colijnit-transaction.d.ts +10 -8
  4. package/colijnit-transaction.metadata.json +1 -1
  5. package/esm2015/colijnit-transaction.js +11 -9
  6. package/esm2015/lib/component/save-cancel-buttons/save-cancel-buttons.component.js +102 -0
  7. package/esm2015/lib/component/save-cancel-buttons/save-cancel-buttons.module.js +24 -0
  8. package/esm2015/lib/component/transaction/transaction.component.js +35 -7
  9. package/esm2015/lib/component/transaction/transaction.module.js +4 -2
  10. package/esm2015/lib/component/transaction-header/transaction-header-popup/transaction-header-popup-base.component.js +2 -2
  11. package/esm2015/lib/service/pending-reason.service.js +5 -3
  12. package/esm2015/lib/service/transaction-base.service.js +19 -3
  13. package/esm2015/lib/service/transaction-connector-adapter.service.js +4 -1
  14. package/esm2015/lib/service/transaction-connector.service.js +4 -1
  15. package/esm2015/lib/service/transaction-event.service.js +4 -2
  16. package/esm2015/lib/service/transaction.service.js +54 -12
  17. package/esm2015/lib/transaction-version.js +3 -3
  18. package/fesm2015/colijnit-transaction.js +229 -17
  19. package/fesm2015/colijnit-transaction.js.map +1 -1
  20. package/lib/component/save-cancel-buttons/save-cancel-buttons.component.d.ts +28 -0
  21. package/lib/component/save-cancel-buttons/save-cancel-buttons.module.d.ts +2 -0
  22. package/lib/component/save-cancel-buttons/style/_layout.scss +41 -0
  23. package/lib/component/save-cancel-buttons/style/_material-definition.scss +15 -0
  24. package/lib/component/save-cancel-buttons/style/_theme.scss +42 -0
  25. package/lib/component/save-cancel-buttons/style/material.scss +4 -0
  26. package/lib/component/transaction/transaction.component.d.ts +13 -3
  27. package/lib/service/transaction-base.service.d.ts +4 -1
  28. package/lib/service/transaction-connector-adapter.service.d.ts +1 -0
  29. package/lib/service/transaction-connector.service.d.ts +1 -0
  30. package/lib/service/transaction-event.service.d.ts +3 -1
  31. package/lib/service/transaction.service.d.ts +20 -19
  32. package/package.json +5 -5
@@ -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 = "255.1.36";
37
- this.publishDate = "10-9-2024 22:23:01";
36
+ this.symVer = "255.1.37";
37
+ this.publishDate = "11-9-2024 10:43:26";
38
38
  }
39
39
  return Version;
40
40
  }());
@@ -1289,7 +1289,7 @@
1289
1289
  this.scrollContent = new rxjs.Subject();
1290
1290
  // public readonly commitReceivePurchaseOrders: Subject<{date: Date, id: string}> = new Subject<{date: Date, id: string}>();
1291
1291
  this.selectAllLines = new rxjs.Subject();
1292
- this.transactionHeaderDirty = new rxjs.Subject();
1292
+ this.transactionDirty = new rxjs.Subject();
1293
1293
  this.transactionLineChanged = new rxjs.Subject();
1294
1294
  this.transactionLineCheckboxChanged = new rxjs.Subject();
1295
1295
  this.transactionLineRefTransactionsChanged = new rxjs.BehaviorSubject(undefined);
@@ -1369,6 +1369,8 @@
1369
1369
  this.reservationSalesOrderLineClicked = new rxjs.Subject();
1370
1370
  this.requestCreateServiceOrderFromTransactionLine = new rxjs.Subject();
1371
1371
  this.blockScreen = new rxjs.BehaviorSubject(false);
1372
+ this.saveTransactionClick = new rxjs.Subject();
1373
+ this.cancelTransactionClick = new rxjs.Subject();
1372
1374
  }
1373
1375
  return TransactionEventService;
1374
1376
  }());
@@ -3521,6 +3523,9 @@
3521
3523
  });
3522
3524
  });
3523
3525
  };
3526
+ TransactionConnectorAdapterService.prototype.rollbackBeacon = function () {
3527
+ return this.connector.rollbackBeacon();
3528
+ };
3524
3529
  TransactionConnectorAdapterService.prototype.createTransaction = function (kind, branchNr) {
3525
3530
  var _this = this;
3526
3531
  return new Promise(function (resolve, reject) {
@@ -9135,6 +9140,9 @@
9135
9140
  TransactionConnectorService.prototype.rollback = function () {
9136
9141
  return this._adapterService.rollback();
9137
9142
  };
9143
+ TransactionConnectorService.prototype.rollbackBeacon = function () {
9144
+ return this._adapterService.rollbackBeacon();
9145
+ };
9138
9146
  TransactionConnectorService.prototype.saveTransaction = function (uuid, showLoader) {
9139
9147
  if (showLoader === void 0) { showLoader = false; }
9140
9148
  return this._adapterService.saveTransaction(uuid, showLoader);
@@ -12934,6 +12942,7 @@
12934
12942
  _this.transactionKindSet = new rxjs.BehaviorSubject(false);
12935
12943
  _this.currentBranch = "1"; // current user branch, needs to be set before we can do anything with transactions
12936
12944
  _this.autoSave = false;
12945
+ _this.manualSaveParam = false;
12937
12946
  _this.applicationUser = false;
12938
12947
  _this.invoiceAddressSameAsDelivery = true;
12939
12948
  _this.getRelationOnRememberCurrentTransaction = true;
@@ -12964,6 +12973,7 @@
12964
12973
  _this._alreadyLocked = false;
12965
12974
  _this._transactionDirty = false;
12966
12975
  _this._salesOrderConfirmationSent = false;
12976
+ _this._subs = [];
12967
12977
  return _this;
12968
12978
  }
12969
12979
  Object.defineProperty(TransactionBaseService.prototype, "activeRubric", {
@@ -13132,7 +13142,7 @@
13132
13142
  },
13133
13143
  set: function (value) {
13134
13144
  this._transactionDirty = value;
13135
- this.transactionEventService.transactionHeaderDirty.next(this._transactionDirty);
13145
+ this.transactionEventService.transactionDirty.next(this._transactionDirty);
13136
13146
  },
13137
13147
  enumerable: false,
13138
13148
  configurable: true
@@ -13147,6 +13157,7 @@
13147
13157
  TransactionBaseService.prototype.init = function (options, resetCurrentTransaction) {
13148
13158
  if (resetCurrentTransaction === void 0) { resetCurrentTransaction = true; }
13149
13159
  return __awaiter(this, void 0, void 0, function () {
13160
+ var _this = this;
13150
13161
  return __generator(this, function (_a) {
13151
13162
  switch (_a.label) {
13152
13163
  case 0:
@@ -13165,6 +13176,12 @@
13165
13176
  return [4 /*yield*/, this.connector.connect()];
13166
13177
  case 4:
13167
13178
  _a.sent();
13179
+ this._subs.push(this.transactionEventService.saveTransactionClick.subscribe(function () {
13180
+ _this.transactionEventService.blockScreen.next(true);
13181
+ _this.saveTransactionAndCommit();
13182
+ }), this.transactionEventService.cancelTransactionClick.subscribe(function () {
13183
+ _this.rollback(true, true);
13184
+ }));
13168
13185
  return [2 /*return*/];
13169
13186
  }
13170
13187
  });
@@ -13231,14 +13248,18 @@
13231
13248
  this.resetLockTransaction();
13232
13249
  return this.connector.commit();
13233
13250
  };
13234
- TransactionBaseService.prototype.rollback = function (refresh) {
13251
+ TransactionBaseService.prototype.rollback = function (refresh, force) {
13235
13252
  if (refresh === void 0) { refresh = false; }
13253
+ if (force === void 0) { force = false; }
13236
13254
  return __awaiter(this, void 0, void 0, function () {
13237
13255
  var rollbackSuccess;
13238
13256
  return __generator(this, function (_a) {
13239
13257
  switch (_a.label) {
13240
13258
  case 0:
13241
13259
  this.transactionEventService.blockScreen.next(false);
13260
+ if (this.manualSaveParam && !force) {
13261
+ return [2 /*return*/, true];
13262
+ }
13242
13263
  return [4 /*yield*/, this.connector.rollback()];
13243
13264
  case 1:
13244
13265
  rollbackSuccess = _a.sent();
@@ -13253,6 +13274,18 @@
13253
13274
  });
13254
13275
  });
13255
13276
  };
13277
+ TransactionBaseService.prototype.rollbackBeacon = function () {
13278
+ return __awaiter(this, void 0, void 0, function () {
13279
+ return __generator(this, function (_a) {
13280
+ switch (_a.label) {
13281
+ case 0: return [4 /*yield*/, this.connector.rollbackBeacon()];
13282
+ case 1:
13283
+ _a.sent();
13284
+ return [2 /*return*/];
13285
+ }
13286
+ });
13287
+ });
13288
+ };
13256
13289
  TransactionBaseService.prototype.searchTransactions = function (request) {
13257
13290
  return this.connector.searchTransactions(request);
13258
13291
  };
@@ -13685,10 +13718,11 @@
13685
13718
  case 5:
13686
13719
  hasPendingReasons = response.headerOperationStatuses.filter(function (los) { return los.pendingReason !== "REASON_NONE"; }).length > 0;
13687
13720
  if (!!hasPendingReasons) return [3 /*break*/, 8];
13688
- if (!((this.autoSave && saveTransaction) || overrideSave)) return [3 /*break*/, 6];
13721
+ if (!((this.autoSave && saveTransaction && !this.manualSaveParam) || overrideSave)) return [3 /*break*/, 6];
13689
13722
  return [2 /*return*/, this.saveTransactionAndCommit(response)];
13690
- case 6: // just replace transaction object
13691
- return [4 /*yield*/, this.rememberCurrentTransaction(response)];
13723
+ case 6:
13724
+ this.transactionEventService.blockScreen.next(false);
13725
+ return [4 /*yield*/, this.rememberCurrentTransaction(response)];
13692
13726
  case 7:
13693
13727
  _b.sent();
13694
13728
  _b.label = 8;
@@ -13748,9 +13782,10 @@
13748
13782
  }
13749
13783
  this.transactionLineAdded = false;
13750
13784
  }
13751
- if (!(this.autoSave && saveTransaction)) return [3 /*break*/, 5];
13785
+ if (!(this.autoSave && saveTransaction && !this.manualSaveParam)) return [3 /*break*/, 5];
13752
13786
  return [2 /*return*/, this.saveTransactionAndCommit(response)];
13753
13787
  case 5:
13788
+ this.transactionEventService.blockScreen.next(false);
13754
13789
  if (!rememberTransaction) return [3 /*break*/, 7];
13755
13790
  return [4 /*yield*/, this.rememberCurrentTransaction(response)];
13756
13791
  case 6:
@@ -14074,17 +14109,30 @@
14074
14109
  return __generator(this, function (_b) {
14075
14110
  switch (_b.label) {
14076
14111
  case 0:
14077
- // @ts-ignore
14078
14112
  _a = this;
14079
- return [4 /*yield*/, this.getInternalParameter('JS_PICKINGLIJST')];
14113
+ return [4 /*yield*/, this.getInternalParameter(internalParam_enum.InternalParam.PickingList)];
14080
14114
  case 1:
14081
- // @ts-ignore
14082
14115
  _a.internalParameterJsPickingList = _b.sent();
14083
14116
  return [2 /*return*/];
14084
14117
  }
14085
14118
  });
14086
14119
  });
14087
14120
  };
14121
+ TransactionService.prototype.prepareManualSaveInternalParam = function () {
14122
+ return __awaiter(this, void 0, void 0, function () {
14123
+ var _a;
14124
+ return __generator(this, function (_b) {
14125
+ switch (_b.label) {
14126
+ case 0:
14127
+ _a = this;
14128
+ return [4 /*yield*/, this.getInternalParameter(internalParam_enum.InternalParam.TransManualSave)];
14129
+ case 1:
14130
+ _a.manualSaveParam = _b.sent();
14131
+ return [2 /*return*/];
14132
+ }
14133
+ });
14134
+ });
14135
+ };
14088
14136
  TransactionService.prototype.prepareDropShipmentInternalParam = function () {
14089
14137
  var _this = this;
14090
14138
  this.getInternalParameter(internalParam_enum.InternalParam.DropShipment).then(function (value) { return _this.internalParameterAllowsDropShipment = value; });
@@ -14245,6 +14293,7 @@
14245
14293
  case 1:
14246
14294
  response = _a.sent();
14247
14295
  if (response) {
14296
+ this.transactionDirty = true;
14248
14297
  return [2 /*return*/, this.handleHeaderOperationStatuses(response, saveTransaction)];
14249
14298
  }
14250
14299
  return [2 /*return*/, false];
@@ -14262,6 +14311,7 @@
14262
14311
  case 1:
14263
14312
  response = _a.sent();
14264
14313
  if (response) {
14314
+ this.transactionDirty = true;
14265
14315
  return [2 /*return*/, this.handleHeaderOperationStatuses(response, saveTransaction)];
14266
14316
  }
14267
14317
  return [2 /*return*/, false];
@@ -14972,6 +15022,7 @@
14972
15022
  case 1:
14973
15023
  response = _a.sent();
14974
15024
  if (response) {
15025
+ this.transactionDirty = true;
14975
15026
  return [2 /*return*/, this.handleLineOperationStatuses(response)];
14976
15027
  }
14977
15028
  return [2 /*return*/, false];
@@ -14988,6 +15039,7 @@
14988
15039
  case 1:
14989
15040
  response = _a.sent();
14990
15041
  if (response) {
15042
+ this.transactionDirty = true;
14991
15043
  return [2 /*return*/, this.handleLineOperationStatuses(response)];
14992
15044
  }
14993
15045
  return [2 /*return*/, false];
@@ -15004,6 +15056,7 @@
15004
15056
  case 1:
15005
15057
  response = _a.sent();
15006
15058
  if (response) {
15059
+ this.transactionDirty = true;
15007
15060
  return [2 /*return*/, this.handleLineOperationStatuses(response)];
15008
15061
  }
15009
15062
  return [2 /*return*/, false];
@@ -15020,6 +15073,7 @@
15020
15073
  case 1:
15021
15074
  response = _a.sent();
15022
15075
  if (response) {
15076
+ this.transactionDirty = true;
15023
15077
  return [2 /*return*/, this.handleLineOperationStatuses(response)];
15024
15078
  }
15025
15079
  return [2 /*return*/, false];
@@ -15036,6 +15090,7 @@
15036
15090
  case 1:
15037
15091
  response = _a.sent();
15038
15092
  if (response) {
15093
+ this.transactionDirty = true;
15039
15094
  return [2 /*return*/, this.handleLineOperationStatuses(response)];
15040
15095
  }
15041
15096
  return [2 /*return*/, false];
@@ -15052,6 +15107,7 @@
15052
15107
  case 1:
15053
15108
  response = _a.sent();
15054
15109
  if (response) {
15110
+ this.transactionDirty = true;
15055
15111
  return [2 /*return*/, this.handleLineOperationStatuses(response)];
15056
15112
  }
15057
15113
  return [2 /*return*/, false];
@@ -15082,6 +15138,7 @@
15082
15138
  case 1:
15083
15139
  response = _a.sent();
15084
15140
  if (!response) return [3 /*break*/, 3];
15141
+ this.transactionDirty = true;
15085
15142
  return [4 /*yield*/, this.handleLineOperationStatuses(response, false, false)];
15086
15143
  case 2:
15087
15144
  _a.sent();
@@ -15103,6 +15160,7 @@
15103
15160
  case 1:
15104
15161
  response = _a.sent();
15105
15162
  if (!response) return [3 /*break*/, 3];
15163
+ this.transactionDirty = true;
15106
15164
  return [4 /*yield*/, this.handleLineOperationStatuses(response, saveTransaction, rememberTransaction)];
15107
15165
  case 2:
15108
15166
  _a.sent();
@@ -15122,6 +15180,7 @@
15122
15180
  case 1:
15123
15181
  response = _a.sent();
15124
15182
  if (response) {
15183
+ this.transactionDirty = true;
15125
15184
  return [2 /*return*/, this.handleLineOperationStatuses(response)];
15126
15185
  }
15127
15186
  return [2 /*return*/, false];
@@ -15138,6 +15197,7 @@
15138
15197
  case 1:
15139
15198
  response = _a.sent();
15140
15199
  if (response) {
15200
+ this.transactionDirty = true;
15141
15201
  return [2 /*return*/, this.handleLineOperationStatuses(response)];
15142
15202
  }
15143
15203
  return [2 /*return*/, false];
@@ -15154,6 +15214,7 @@
15154
15214
  case 1:
15155
15215
  response = _a.sent();
15156
15216
  if (response) {
15217
+ this.transactionDirty = true;
15157
15218
  return [2 /*return*/, this.handleLineOperationStatuses(response)];
15158
15219
  }
15159
15220
  return [2 /*return*/, false];
@@ -15170,6 +15231,7 @@
15170
15231
  case 1:
15171
15232
  response = _a.sent();
15172
15233
  if (response) {
15234
+ this.transactionDirty = true;
15173
15235
  return [2 /*return*/, this.handleLineOperationStatuses(response)];
15174
15236
  }
15175
15237
  return [2 /*return*/, false];
@@ -15186,6 +15248,7 @@
15186
15248
  case 1:
15187
15249
  response = _a.sent();
15188
15250
  if (response) {
15251
+ this.transactionDirty = true;
15189
15252
  return [2 /*return*/, this.handleLineOperationStatuses(response)];
15190
15253
  }
15191
15254
  return [2 /*return*/, false];
@@ -15202,6 +15265,7 @@
15202
15265
  case 1:
15203
15266
  response = _a.sent();
15204
15267
  if (response) {
15268
+ this.transactionDirty = true;
15205
15269
  return [2 /*return*/, this.handleLineOperationStatuses(response)];
15206
15270
  }
15207
15271
  return [2 /*return*/, false];
@@ -15218,6 +15282,7 @@
15218
15282
  case 1:
15219
15283
  response = _a.sent();
15220
15284
  if (response) {
15285
+ this.transactionDirty = true;
15221
15286
  return [2 /*return*/, this.handleLineOperationStatuses(response)];
15222
15287
  }
15223
15288
  return [2 /*return*/, false];
@@ -15236,6 +15301,7 @@
15236
15301
  case 1:
15237
15302
  response = _a.sent();
15238
15303
  if (response) {
15304
+ this.transactionDirty = true;
15239
15305
  return [2 /*return*/, this.handleLineOperationStatuses(response)];
15240
15306
  }
15241
15307
  return [2 /*return*/, false];
@@ -15252,6 +15318,7 @@
15252
15318
  case 1:
15253
15319
  response = _a.sent();
15254
15320
  if (response) {
15321
+ this.transactionDirty = true;
15255
15322
  return [2 /*return*/, this.handleLineOperationStatuses(response)];
15256
15323
  }
15257
15324
  return [2 /*return*/, false];
@@ -15516,6 +15583,7 @@
15516
15583
  case 2:
15517
15584
  response = _a.sent();
15518
15585
  if (response) {
15586
+ this.transactionDirty = true;
15519
15587
  return [2 /*return*/, this.handleHeaderOperationStatuses(response)];
15520
15588
  }
15521
15589
  return [2 /*return*/, false];
@@ -15614,6 +15682,7 @@
15614
15682
  case 1:
15615
15683
  response = _a.sent();
15616
15684
  if (response !== null) {
15685
+ this.transactionDirty = true;
15617
15686
  return [2 /*return*/, this.handleLineOperationStatuses(response, saveTransaction)];
15618
15687
  }
15619
15688
  else {
@@ -15780,6 +15849,7 @@
15780
15849
  return [4 /*yield*/, this.connector.addTextLineToTransaction(this.currentTransaction.transactionInfo.uuid, showOnDocuments, text, amount, articleBound, refArticleLineNr, aboveLineNr, belowLineNr)];
15781
15850
  case 3:
15782
15851
  response = _a.sent();
15852
+ this.transactionDirty = true;
15783
15853
  return [2 /*return*/, this.handleLineOperationStatuses(response)];
15784
15854
  case 4: return [2 /*return*/, false];
15785
15855
  }
@@ -15798,6 +15868,7 @@
15798
15868
  return [4 /*yield*/, this.connector.updateTextLine(uuid, lineUuid, showOnDocuments, text)];
15799
15869
  case 2:
15800
15870
  response = _a.sent();
15871
+ this.transactionDirty = true;
15801
15872
  return [2 /*return*/, this.handleLineOperationStatuses(response)];
15802
15873
  case 3: return [2 /*return*/, false];
15803
15874
  }
@@ -15816,6 +15887,7 @@
15816
15887
  return [4 /*yield*/, this.connector.changeLineSequence(this.currentTransaction.transactionInfo.uuid, lineUuid, aboveLineNr, belowLineNr)];
15817
15888
  case 2:
15818
15889
  response = _a.sent();
15890
+ this.transactionDirty = true;
15819
15891
  return [2 /*return*/, this.handleLineOperationStatuses(response)];
15820
15892
  case 3: return [2 /*return*/, false];
15821
15893
  }
@@ -15830,6 +15902,7 @@
15830
15902
  case 0: return [4 /*yield*/, this.connector.deleteTransactionLine(transactionUuid, TransactionLineUuid)];
15831
15903
  case 1:
15832
15904
  response = _a.sent();
15905
+ this.transactionDirty = true;
15833
15906
  return [2 /*return*/, this.handleLineOperationStatuses(response)];
15834
15907
  }
15835
15908
  });
@@ -15843,6 +15916,7 @@
15843
15916
  case 0: return [4 /*yield*/, this.connector.changeTransactionLineQuantity(transactionUuid, lineUuid, newQuantity)];
15844
15917
  case 1:
15845
15918
  response = _a.sent();
15919
+ this.transactionDirty = true;
15846
15920
  return [2 /*return*/, this.handleLineOperationStatuses(response)];
15847
15921
  }
15848
15922
  });
@@ -15874,6 +15948,7 @@
15874
15948
  this.transactionEventService.updatingPurchaseOrderReceiveGoods.next(false);
15875
15949
  success = true;
15876
15950
  if (!response) return [3 /*break*/, 4];
15951
+ this.transactionDirty = true;
15877
15952
  return [4 /*yield*/, this.handleHeaderOperationStatuses(response)];
15878
15953
  case 3:
15879
15954
  success = _a.sent();
@@ -15900,6 +15975,7 @@
15900
15975
  this.transactionEventService.updatingPurchaseOrderReceiveGoods.next(false);
15901
15976
  success = true;
15902
15977
  if (!response) return [3 /*break*/, 4];
15978
+ this.transactionDirty = true;
15903
15979
  return [4 /*yield*/, this.handleHeaderOperationStatuses(response)];
15904
15980
  case 3:
15905
15981
  success = _a.sent();
@@ -15926,6 +16002,7 @@
15926
16002
  this.transactionEventService.updatingPurchaseOrderAllocateGoods.next(false);
15927
16003
  success = true;
15928
16004
  if (!response) return [3 /*break*/, 4];
16005
+ this.transactionDirty = true;
15929
16006
  return [4 /*yield*/, this.handleHeaderOperationStatuses(response)];
15930
16007
  case 3:
15931
16008
  success = _a.sent();
@@ -15952,6 +16029,7 @@
15952
16029
  this.transactionEventService.updatingPurchaseOrderAllocateGoods.next(false);
15953
16030
  success = true;
15954
16031
  if (!response) return [3 /*break*/, 4];
16032
+ this.transactionDirty = true;
15955
16033
  return [4 /*yield*/, this.handleHeaderOperationStatuses(response)];
15956
16034
  case 3:
15957
16035
  success = _a.sent();
@@ -15978,6 +16056,7 @@
15978
16056
  this.transactionEventService.updatingSalesOrderGoodsToBePicked.next(false);
15979
16057
  success = true;
15980
16058
  if (!response) return [3 /*break*/, 4];
16059
+ this.transactionDirty = true;
15981
16060
  return [4 /*yield*/, this.handleHeaderOperationStatuses(response)];
15982
16061
  case 3:
15983
16062
  success = _a.sent();
@@ -16004,6 +16083,7 @@
16004
16083
  this.transactionEventService.updatingSalesOrderGoodsPicked.next(false);
16005
16084
  success = true;
16006
16085
  if (!response) return [3 /*break*/, 4];
16086
+ this.transactionDirty = true;
16007
16087
  return [4 /*yield*/, this.handleHeaderOperationStatuses(response)];
16008
16088
  case 3:
16009
16089
  success = _a.sent();
@@ -16028,6 +16108,7 @@
16028
16108
  response = _a.sent();
16029
16109
  success = true;
16030
16110
  if (!response) return [3 /*break*/, 4];
16111
+ this.transactionDirty = true;
16031
16112
  return [4 /*yield*/, this.handleHeaderOperationStatuses(response)];
16032
16113
  case 3:
16033
16114
  success = _a.sent();
@@ -16052,6 +16133,7 @@
16052
16133
  response = _a.sent();
16053
16134
  success = true;
16054
16135
  if (!response) return [3 /*break*/, 4];
16136
+ this.transactionDirty = true;
16055
16137
  return [4 /*yield*/, this.handleHeaderOperationStatuses(response)];
16056
16138
  case 3:
16057
16139
  success = _a.sent();
@@ -17221,6 +17303,7 @@
17221
17303
  case 2: return [4 /*yield*/, _a.sent()];
17222
17304
  case 3:
17223
17305
  response = _a.sent();
17306
+ this.transactionDirty = true;
17224
17307
  return [2 /*return*/, this.handleLineOperationStatuses(response)];
17225
17308
  case 4: return [2 /*return*/, false];
17226
17309
  }
@@ -17240,6 +17323,7 @@
17240
17323
  case 2: return [4 /*yield*/, _a.sent()];
17241
17324
  case 3:
17242
17325
  response = _a.sent();
17326
+ this.transactionDirty = true;
17243
17327
  return [2 /*return*/, this.handleLineOperationStatuses(response)];
17244
17328
  case 4: return [2 /*return*/, false];
17245
17329
  }
@@ -17259,6 +17343,7 @@
17259
17343
  case 2:
17260
17344
  response = _a.sent();
17261
17345
  if (response) {
17346
+ this.transactionDirty = true;
17262
17347
  return [2 /*return*/, this.handleLineOperationStatuses(response)];
17263
17348
  }
17264
17349
  return [2 /*return*/, false];
@@ -17748,11 +17833,14 @@
17748
17833
  return __awaiter(this, void 0, void 0, function () {
17749
17834
  return __generator(this, function (_a) {
17750
17835
  switch (_a.label) {
17751
- case 0: return [4 /*yield*/, this.prepareMLocatInternalParam()];
17836
+ case 0: return [4 /*yield*/, this.prepareManualSaveInternalParam()];
17752
17837
  case 1:
17753
17838
  _a.sent();
17754
- return [4 /*yield*/, this.preparePakBinnenInternalParam()];
17839
+ return [4 /*yield*/, this.prepareMLocatInternalParam()];
17755
17840
  case 2:
17841
+ _a.sent();
17842
+ return [4 /*yield*/, this.preparePakBinnenInternalParam()];
17843
+ case 3:
17756
17844
  _a.sent();
17757
17845
  return [2 /*return*/];
17758
17846
  }
@@ -36104,7 +36192,7 @@
36104
36192
  if (_this.form.formGroup.dirty) {
36105
36193
  _this.setFormDirty();
36106
36194
  }
36107
- }), this.transactionEventService.transactionHeaderDirty.subscribe(function (dirty) {
36195
+ }), this.transactionEventService.transactionDirty.subscribe(function (dirty) {
36108
36196
  if (dirty) {
36109
36197
  _this.setFormDirty();
36110
36198
  }
@@ -53216,18 +53304,22 @@
53216
53304
  ];
53217
53305
 
53218
53306
  var TransactionComponent = /** @class */ (function () {
53219
- function TransactionComponent(service, _transactionConnectorService, _screenConfigurationService, _changeDetector, _purchaseConfirmationService) {
53307
+ function TransactionComponent(service, _transactionConnectorService, _screenConfigurationService, _changeDetector, _purchaseConfirmationService, _dictionaryService, _dialogService) {
53220
53308
  this.service = service;
53221
53309
  this._transactionConnectorService = _transactionConnectorService;
53222
53310
  this._screenConfigurationService = _screenConfigurationService;
53223
53311
  this._changeDetector = _changeDetector;
53224
53312
  this._purchaseConfirmationService = _purchaseConfirmationService;
53313
+ this._dictionaryService = _dictionaryService;
53314
+ this._dialogService = _dialogService;
53225
53315
  this.cfgNames = exports.TransactionCfgName;
53226
53316
  this.relation = new customerFullObject_bo.CustomerFullObject();
53227
53317
  this.showHeader = true;
53228
53318
  this.showViewModeButtons = true;
53229
53319
  this.showQuickAccess = true;
53230
53320
  this.showButtonBar = true;
53321
+ this.showSaveCancelLabels = false;
53322
+ this.saveCancelMovable = false;
53231
53323
  this.screenConfigLoaded = false;
53232
53324
  }
53233
53325
  Object.defineProperty(TransactionComponent.prototype, "confirmationAnalysisId", {
@@ -53270,13 +53362,21 @@
53270
53362
  TransactionComponent.prototype.showClass = function () {
53271
53363
  return true;
53272
53364
  };
53365
+ TransactionComponent.prototype.checkTransaction = function () {
53366
+ return this._checkTransactionDirty();
53367
+ };
53368
+ TransactionComponent.prototype.checkRollBack = function () {
53369
+ if (this.service.transactionDirty && this.service.manualSaveParam) {
53370
+ this.service.rollbackBeacon();
53371
+ }
53372
+ };
53273
53373
  TransactionComponent.prototype.ngOnChanges = function (changes) {
53274
53374
  if (changes && changes.hasOwnProperty('confirmationAnalysisId')) {
53275
53375
  this._changeDetector.markForCheck();
53276
53376
  }
53277
53377
  };
53278
- TransactionComponent.prototype.addExternalOrderLines = function (request) {
53279
- this.service.addExternalCatalogArticle(request);
53378
+ TransactionComponent.prototype._checkTransactionDirty = function () {
53379
+ return !(this.service.transactionDirty && this.service.manualSaveParam);
53280
53380
  };
53281
53381
  TransactionComponent.prototype._getTransaction = function () {
53282
53382
  var _this = this;
@@ -53317,7 +53417,7 @@
53317
53417
  TransactionComponent.decorators = [
53318
53418
  { type: i0.Component, args: [{
53319
53419
  selector: 'co-transaction',
53320
- template: "\n <co-transaction-internal *ngIf=\"screenConfigLoaded\"\n [(relation)]=\"relation\"\n [showHeader]=\"showHeader\"\n [showQuickAccess]=\"showQuickAccess\"\n [showButtonBar]=\"showButtonBar\"\n [showViewModeButtons]=\"showViewModeButtons\"\n [confirmationAnalysisId]=\"confirmationAnalysisId\"\n [posOrderData]=\"posOrderData\"\n ></co-transaction-internal>\n ",
53420
+ template: "\n <co-save-cancel-buttons *ngIf=\"service.manualSaveParam\"\n [saveIconData]=\"saveIconData\"\n [cancelIconData]=\"cancelIconData\"\n [showLabels]=\"showSaveCancelLabels\"\n [movable]=\"saveCancelMovable\"\n ></co-save-cancel-buttons>\n <co-transaction-internal *ngIf=\"screenConfigLoaded\"\n [(relation)]=\"relation\"\n [showHeader]=\"showHeader\"\n [showQuickAccess]=\"showQuickAccess\"\n [showButtonBar]=\"showButtonBar\"\n [showViewModeButtons]=\"showViewModeButtons\"\n [confirmationAnalysisId]=\"confirmationAnalysisId\"\n [posOrderData]=\"posOrderData\"\n ></co-transaction-internal>\n ",
53321
53421
  providers: [
53322
53422
  { provide: corecomponents_v12.BaseModuleScreenConfigService, useExisting: TransactionScreenConfigurationService }
53323
53423
  ],
@@ -53329,7 +53429,9 @@
53329
53429
  { type: TransactionConnectorService },
53330
53430
  { type: TransactionScreenConfigurationService },
53331
53431
  { type: i0.ChangeDetectorRef },
53332
- { type: PurchaseConfirmationService }
53432
+ { type: PurchaseConfirmationService },
53433
+ { type: DictionaryService },
53434
+ { type: DialogService }
53333
53435
  ]; };
53334
53436
  TransactionComponent.propDecorators = {
53335
53437
  relation: [{ type: i0.Input }],
@@ -53341,7 +53443,13 @@
53341
53443
  showViewModeButtons: [{ type: i0.Input }],
53342
53444
  showQuickAccess: [{ type: i0.Input }],
53343
53445
  showButtonBar: [{ type: i0.Input }],
53344
- showClass: [{ type: i0.HostBinding, args: ['class.co-transaction',] }]
53446
+ saveIconData: [{ type: i0.Input }],
53447
+ cancelIconData: [{ type: i0.Input }],
53448
+ showSaveCancelLabels: [{ type: i0.Input }],
53449
+ saveCancelMovable: [{ type: i0.Input }],
53450
+ showClass: [{ type: i0.HostBinding, args: ['class.co-transaction',] }],
53451
+ checkTransaction: [{ type: i0.HostListener, args: ['window:beforeunload',] }],
53452
+ checkRollBack: [{ type: i0.HostListener, args: ['window:unload',] }]
53345
53453
  };
53346
53454
 
53347
53455
  /**
@@ -53774,6 +53882,99 @@
53774
53882
  },] }
53775
53883
  ];
53776
53884
 
53885
+ var SaveCancelButtonsComponent = /** @class */ (function () {
53886
+ function SaveCancelButtonsComponent(iconCacheService, _transactionEventService) {
53887
+ var _this = this;
53888
+ this.iconCacheService = iconCacheService;
53889
+ this._transactionEventService = _transactionEventService;
53890
+ this.icons = Icon;
53891
+ this.showLabels = true;
53892
+ this.movable = false;
53893
+ this.show = false;
53894
+ this._mouseDown = false;
53895
+ // @HostBinding('style.top.px')
53896
+ this._top = 0;
53897
+ // @HostBinding('style.left.px')
53898
+ this._left = 0;
53899
+ this._subs = [];
53900
+ this._subs.push(this._transactionEventService.transactionDirty.subscribe(function (dirty) { return _this.show = dirty; }));
53901
+ }
53902
+ SaveCancelButtonsComponent.prototype.showClass = function () {
53903
+ return true;
53904
+ };
53905
+ SaveCancelButtonsComponent.prototype.ngOnDestroy = function () {
53906
+ this._subs.forEach(function (s) { return s.unsubscribe(); });
53907
+ this.saveCancelButtonsWrapper = undefined;
53908
+ };
53909
+ SaveCancelButtonsComponent.prototype.handleMouseDown = function (event) {
53910
+ this._mouseDown = this.movable;
53911
+ // if (this.saveCancelButtonsWrapper && this.saveCancelButtonsWrapper.nativeElement && this._mouseDown) {
53912
+ // const rect = this.saveCancelButtonsWrapper.nativeElement.getBoundingClientRect();
53913
+ // this._top = rect.top;
53914
+ // this._left = rect.left;
53915
+ // }
53916
+ };
53917
+ SaveCancelButtonsComponent.prototype.handleMouseUp = function (event) {
53918
+ this._mouseDown = false;
53919
+ };
53920
+ SaveCancelButtonsComponent.prototype.handleMouseMove = function (event) {
53921
+ if (this._mouseDown) {
53922
+ // this._top = this._top + event.movementY;
53923
+ // this._left = this._left + event.movementX;
53924
+ }
53925
+ };
53926
+ SaveCancelButtonsComponent.prototype.handleSaveClick = function (event) {
53927
+ event.preventDefault();
53928
+ this._transactionEventService.saveTransactionClick.next();
53929
+ };
53930
+ SaveCancelButtonsComponent.prototype.handleCancelClick = function (event) {
53931
+ event.preventDefault();
53932
+ this._transactionEventService.cancelTransactionClick.next();
53933
+ };
53934
+ return SaveCancelButtonsComponent;
53935
+ }());
53936
+ SaveCancelButtonsComponent.decorators = [
53937
+ { type: i0.Component, args: [{
53938
+ selector: 'co-save-cancel-buttons',
53939
+ template: "\n <ng-container *ngIf=\"show\">\n <div class=\"save-cancel-buttons-wrapper\" #saveCancelButtonsWrapper\n [class.movable]=\"movable\"\n (mousedown)=\"handleMouseDown($event)\"\n (mouseup)=\"handleMouseUp($event)\"\n (mousemove)=\"handleMouseMove($event)\">\n <ng-container *ngIf=\"showLabels\">\n <co-button class=\"save-button\" [label]=\"'SAVE' | localize\" [title]=\"'SAVE' | localize\"\n [iconData]=\"saveIconData || iconCacheService.getIcon(icons.CheckThin)\"\n (onClick)=\"handleSaveClick($event)\"></co-button>\n <co-button class=\"cancel-button\" [label]=\"'CANCEL' | localize\" [title]=\"'CANCEL' | localize\"\n [iconData]=\"cancelIconData || iconCacheService.getIcon(icons.Crossskinny)\"\n (onClick)=\"handleCancelClick($event)\"></co-button>\n </ng-container>\n <ng-container *ngIf=\"!showLabels\">\n <div class=\"icon-wrapper save-icon\">\n <co-icon [title]=\"'SAVE' | localize\"\n [iconData]=\"saveIconData || iconCacheService.getIcon(icons.CheckThin)\"\n (click)=\"handleSaveClick($event)\"></co-icon>\n </div>\n <div class=\"icon-wrapper cancel-icon\">\n <co-icon [title]=\"'CANCEL' | localize\"\n [iconData]=\"cancelIconData || iconCacheService.getIcon(icons.Crossskinny)\"\n (click)=\"handleCancelClick($event)\"></co-icon>\n </div>\n </ng-container>\n </div>\n </ng-container>\n ",
53940
+ encapsulation: i0.ViewEncapsulation.None
53941
+ },] }
53942
+ ];
53943
+ SaveCancelButtonsComponent.ctorParameters = function () { return [
53944
+ { type: IconCacheService },
53945
+ { type: TransactionEventService }
53946
+ ]; };
53947
+ SaveCancelButtonsComponent.propDecorators = {
53948
+ saveCancelButtonsWrapper: [{ type: i0.ViewChild, args: ['saveCancelButtonsWrapper', { read: i0.ElementRef },] }],
53949
+ saveIconData: [{ type: i0.Input }],
53950
+ cancelIconData: [{ type: i0.Input }],
53951
+ showLabels: [{ type: i0.Input }],
53952
+ movable: [{ type: i0.Input }],
53953
+ showClass: [{ type: i0.HostBinding, args: ['class.co-save-cancel-buttons',] }]
53954
+ };
53955
+
53956
+ var SaveCancelButtonsModule = /** @class */ (function () {
53957
+ function SaveCancelButtonsModule() {
53958
+ }
53959
+ return SaveCancelButtonsModule;
53960
+ }());
53961
+ SaveCancelButtonsModule.decorators = [
53962
+ { type: i0.NgModule, args: [{
53963
+ imports: [
53964
+ common.CommonModule,
53965
+ corecomponents_v12.ButtonModule,
53966
+ PipeModule,
53967
+ corecomponents_v12.IconModule
53968
+ ],
53969
+ declarations: [
53970
+ SaveCancelButtonsComponent
53971
+ ],
53972
+ exports: [
53973
+ SaveCancelButtonsComponent
53974
+ ]
53975
+ },] }
53976
+ ];
53977
+
53777
53978
  var TransactionModule = /** @class */ (function () {
53778
53979
  function TransactionModule() {
53779
53980
  }
@@ -53786,7 +53987,8 @@
53786
53987
  CoreModule,
53787
53988
  TransactionInternalModule,
53788
53989
  TransactionGridModule,
53789
- TransactionCashRegisterOrderReceiptDialogModule
53990
+ TransactionCashRegisterOrderReceiptDialogModule,
53991
+ SaveCancelButtonsModule
53790
53992
  ],
53791
53993
  declarations: [
53792
53994
  TransactionComponent
@@ -56282,14 +56484,16 @@
56282
56484
  exports["ɵyf"] = TransactionGridComponent;
56283
56485
  exports["ɵyg"] = TransactionCashRegisterOrderReceiptDialogModule;
56284
56486
  exports["ɵyh"] = TransactionCashRegisterOrderReceiptDialogComponent;
56285
- exports["ɵyi"] = TransactionTagComponent;
56286
- exports["ɵyj"] = CheckoutSimpleModule;
56287
- exports["ɵyk"] = CheckoutSimpleComponent;
56288
- exports["ɵyl"] = CheckoutSimpleOverviewRelationEditComponent;
56289
- exports["ɵym"] = CheckoutSimpleOverviewDeliveryEditComponent;
56290
- exports["ɵyn"] = CheckoutSimpleOverviewPaymentComponent;
56291
- exports["ɵyo"] = SimpleVerticalStepperModule;
56292
- exports["ɵyp"] = SimpleVerticalStepperComponent;
56487
+ exports["ɵyi"] = SaveCancelButtonsModule;
56488
+ exports["ɵyj"] = SaveCancelButtonsComponent;
56489
+ exports["ɵyk"] = TransactionTagComponent;
56490
+ exports["ɵyl"] = CheckoutSimpleModule;
56491
+ exports["ɵym"] = CheckoutSimpleComponent;
56492
+ exports["ɵyn"] = CheckoutSimpleOverviewRelationEditComponent;
56493
+ exports["ɵyo"] = CheckoutSimpleOverviewDeliveryEditComponent;
56494
+ exports["ɵyp"] = CheckoutSimpleOverviewPaymentComponent;
56495
+ exports["ɵyq"] = SimpleVerticalStepperModule;
56496
+ exports["ɵyr"] = SimpleVerticalStepperComponent;
56293
56497
  exports["ɵz"] = CharacteristicAnswerComponent;
56294
56498
 
56295
56499
  Object.defineProperty(exports, '__esModule', { value: true });