@colijnit/transaction 12.1.0 → 12.1.4

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 (43) hide show
  1. package/app/component/core/base/transaction-base.component.d.ts +10 -0
  2. package/app/component/{shopping-cart → core}/characteristic-answer/characteristic-answer.component.d.ts +0 -0
  3. package/app/component/core/warehouse/warehouse.component.d.ts +35 -0
  4. package/app/component/service-order/ione-service-order.component.d.ts +3 -3
  5. package/app/component/service-order/service-order.component.d.ts +9 -4
  6. package/app/component/service-order/transaction-manager/transaction-manager.component.d.ts +63 -0
  7. package/app/component/service-order/transaction-order-totals/transaction-order-totals.component.d.ts +2 -3
  8. package/app/component/shopping-cart/shopping-cart-manager/shopping-cart-manager.component.d.ts +1 -1
  9. package/app/service/dictionary.service.d.ts +1 -0
  10. package/app/service/transaction.service.d.ts +14 -8
  11. package/bundles/colijnit-transaction.umd.js +915 -162
  12. package/bundles/colijnit-transaction.umd.js.map +1 -1
  13. package/colijnit-transaction.d.ts +20 -18
  14. package/colijnit-transaction.metadata.json +1 -1
  15. package/esm2015/app/component/checkout/checkout-overview/checkout-overview.component.js +2 -2
  16. package/esm2015/app/component/checkout/ione-checkout.module.js +3 -3
  17. package/esm2015/app/component/core/base/transaction-base.component.js +35 -10
  18. package/esm2015/app/component/core/characteristic-answer/characteristic-answer.component.js +100 -0
  19. package/esm2015/app/component/core/warehouse/warehouse.component.js +134 -0
  20. package/esm2015/app/component/service-order/ione-service-order-module.js +10 -5
  21. package/esm2015/app/component/service-order/ione-service-order.component.js +12 -14
  22. package/esm2015/app/component/service-order/service-order.component.js +35 -7
  23. package/esm2015/app/component/service-order/summary/transaction-delivery-summary.component.js +5 -5
  24. package/esm2015/app/component/service-order/summary/transaction-order-summary.component.js +3 -3
  25. package/esm2015/app/component/service-order/summary/transaction-payment-info.component.js +3 -3
  26. package/esm2015/app/component/service-order/summary/transaction-service-summary.component.js +3 -3
  27. package/esm2015/app/component/service-order/transaction-article-text/transaction-article-text.component.js +16 -5
  28. package/esm2015/app/component/service-order/transaction-manager/transaction-manager.component.js +305 -0
  29. package/esm2015/app/component/service-order/transaction-order-line-view/transaction-order-line-view.component.js +1 -1
  30. package/esm2015/app/component/service-order/transaction-order-lines/transaction-order-lines.component.js +1 -1
  31. package/esm2015/app/component/service-order/transaction-order-totals/transaction-order-totals.component.js +9 -10
  32. package/esm2015/app/component/shopping-cart/ione-shopping-cart.module.js +3 -5
  33. package/esm2015/app/component/shopping-cart/shopping-cart-line/shopping-cart-line.component.js +1 -1
  34. package/esm2015/app/component/shopping-cart/shopping-cart-manager/shopping-cart-manager.component.js +1 -1
  35. package/esm2015/app/service/dictionary.service.js +20 -9
  36. package/esm2015/app/service/ione-connector-adapter.service.js +10 -5
  37. package/esm2015/app/service/transaction.service.js +72 -23
  38. package/esm2015/assets/dictionary/text.properties.js +5 -1
  39. package/esm2015/colijnit-transaction.js +21 -19
  40. package/fesm2015/colijnit-transaction.js +647 -97
  41. package/fesm2015/colijnit-transaction.js.map +1 -1
  42. package/package.json +2 -2
  43. package/esm2015/app/component/shopping-cart/characteristic-answer/characteristic-answer.component.js +0 -99
@@ -35,16 +35,15 @@ import { TransactionLineType } from '@colijnit/transactionapi/build/enum/transac
35
35
  import { LineOperationStatus } from '@colijnit/transactionapi/build/model/line-operation-status.bo';
36
36
  import { TransactionInfo } from '@colijnit/transactionapi/build/model/transaction-info.bo';
37
37
  import { PendingReasonType } from '@colijnit/transactionapi/build/enum/pending-reason-type.enum';
38
+ import { PromptService, FormComponent, CoSidebarComponent, CoreComponentsIcon, IconCacheService, IconModule, InputTextModule, InputCheckboxModule, InputRadioButtonModule, FormModule, InputComboBoxModule, InputDatePickerModule, InputNumberPickerModule, CoDialogModule, CoDialogPromptModule, ButtonModule, MultiSelectListModule, DropDownModule, PopupModule, CoSidebarModule, CoGridModule } from '@colijnit/corecomponents_v12';
38
39
  import { CommunicationType } from '@colijnit/transactionapi/build/enum/communication-type.enum';
39
40
  import { ContactOption } from '@colijnit/transactionapi/build/model/contact-option.bo';
40
41
  import { RelationNameKind } from '@colijnit/transactionapi/build/enum/relation-name-kind.enum';
41
42
  import { AddressType } from '@colijnit/transactionapi/build/enum/address-type.enum';
42
43
  import { GenderType } from '@colijnit/transactionapi/build/enum/gender-type.enum';
43
44
  import { BusinessObjectUtils } from '@colijnit/transactionapi/build/utils/business-object-utils';
44
- import { FormComponent, CoSidebarComponent, PromptService, CoreComponentsIcon, IconCacheService, IconModule, InputTextModule, InputCheckboxModule, InputRadioButtonModule, FormModule, InputComboBoxModule, InputDatePickerModule, InputNumberPickerModule, CoDialogModule, CoDialogPromptModule, ButtonModule, MultiSelectListModule, DropDownModule, PopupModule, CoSidebarModule, CoGridModule } from '@colijnit/corecomponents_v12';
45
45
  import { FunctionUtils } from '@colijnit/transactionapi/build/utils/function-utils';
46
46
  import { Address } from '@colijnit/transactionapi/build/model/address.bo';
47
- import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
48
47
  import { FlexModule } from '@angular/flex-layout';
49
48
  import { MatStepperModule } from '@angular/material/stepper';
50
49
  import { CommonModule } from '@angular/common';
@@ -857,14 +856,19 @@ class IOneConnectorAdapterService {
857
856
  return new Promise((resolve, reject) => {
858
857
  return this.connector.getSingleImage(nodeId, publication, includeMimetype, thumb).then((result) => {
859
858
  if (result.validationResult && result.validationResult.success) {
860
- if (result.resultObject.filePath !== null && result.resultObject.filePath !== "") {
859
+ if (result.resultObject && result.resultObject.filePath !== null && result.resultObject.filePath !== "") {
861
860
  return resolve(ImageUtils.getFixedImageFilepathUrl(result.resultObject.filePath));
862
861
  }
863
862
  else {
864
- if (includeMimetype) {
865
- return resolve(ImageUtils.getDocBodyWithMimeTypeDefinition(result.resultObject.fileName, thumb ? result.resultObject.thumbnailBody : result.resultObject.documentBody));
863
+ if (result.resultObject) {
864
+ if (includeMimetype) {
865
+ return resolve(ImageUtils.getDocBodyWithMimeTypeDefinition(result.resultObject.fileName, thumb ? result.resultObject.thumbnailBody : result.resultObject.documentBody));
866
+ }
867
+ return resolve(thumb ? result.resultObject.thumbnailBody : result.resultObject.documentBody);
868
+ }
869
+ else {
870
+ reject(result.validationMessagesAsString);
866
871
  }
867
- return resolve(thumb ? result.resultObject.thumbnailBody : result.resultObject.documentBody);
868
872
  }
869
873
  }
870
874
  else {
@@ -1313,8 +1317,9 @@ IOneConnectorAdapterService.decorators = [
1313
1317
  IOneConnectorAdapterService.ctorParameters = () => [];
1314
1318
 
1315
1319
  class TransactionService {
1316
- constructor(_connector) {
1320
+ constructor(_connector, _prompt) {
1317
1321
  this._connector = _connector;
1322
+ this._prompt = _prompt;
1318
1323
  this.transactionUpdated = new EventEmitter();
1319
1324
  this.transactionLoaded = new EventEmitter();
1320
1325
  this.applicationUser = false;
@@ -1360,6 +1365,11 @@ class TransactionService {
1360
1365
  && line.pendingReasonType !== PendingReasonType.NON_CRITICAL_DISCONTINUATION);
1361
1366
  return status;
1362
1367
  }
1368
+ pendingLineOperationStatus(lineOperationStatuses) {
1369
+ const status = lineOperationStatuses.find(line => line.pendingReasonType !== PendingReasonType.NONE
1370
+ && line.pendingReasonType !== PendingReasonType.NON_CRITICAL_DISCONTINUATION);
1371
+ return status;
1372
+ }
1363
1373
  getArticleFullObject(goodId) {
1364
1374
  return __awaiter(this, void 0, void 0, function* () {
1365
1375
  return yield this._connector.getArticleFullObject(goodId);
@@ -1440,11 +1450,10 @@ class TransactionService {
1440
1450
  });
1441
1451
  });
1442
1452
  }
1443
- resolvePendingLineReason(pendingLineValues) {
1453
+ resolvePendingLineReason(pendingLineValues, remember = true) {
1444
1454
  return new Promise((resolve) => {
1445
1455
  this._connector.resolvePendingLineReason(pendingLineValues).then((response) => __awaiter(this, void 0, void 0, function* () {
1446
- this._rememberCurrentTransaction(response);
1447
- this._rememberCurrentTransactionLineStatus(response);
1456
+ this._rememberResponse(remember, response);
1448
1457
  resolve(response);
1449
1458
  })).catch((reason) => {
1450
1459
  resolve();
@@ -1498,6 +1507,28 @@ class TransactionService {
1498
1507
  }
1499
1508
  });
1500
1509
  }
1510
+ saveTransactionByUuid(transactionUuid) {
1511
+ return __awaiter(this, void 0, void 0, function* () {
1512
+ return new Promise((resolve, reject) => {
1513
+ this._connector.saveTransaction(transactionUuid)
1514
+ .then((response) => __awaiter(this, void 0, void 0, function* () {
1515
+ if (response.isSuccess) {
1516
+ this.transactionLoaded.emit(response);
1517
+ resolve(true);
1518
+ }
1519
+ else {
1520
+ reject(false);
1521
+ }
1522
+ }))
1523
+ .catch((reason) => {
1524
+ if (reason) {
1525
+ this._prompt.showError(reason.getFullErrorString());
1526
+ }
1527
+ reject(false);
1528
+ });
1529
+ });
1530
+ });
1531
+ }
1501
1532
  addRelationToTransaction(relationId) {
1502
1533
  return __awaiter(this, void 0, void 0, function* () {
1503
1534
  const success = yield this._connector.addRelationToTransaction(this._currentTransaction.uuid, relationId);
@@ -1611,13 +1642,29 @@ class TransactionService {
1611
1642
  });
1612
1643
  });
1613
1644
  }
1614
- addTransactionLine(lineType, articleNo, amount, warehouseNo, commissionCode, isReturn, aboveLineNr, belowLineNr) {
1645
+ addArticleToTransaction(transactionUuid, articleNo, amount = 1, warehouseNo = 1, commissionCode = "2", isReturn = false, aboveLineNr = 0, belowLineNr = 0) {
1646
+ return __awaiter(this, void 0, void 0, function* () {
1647
+ return new Promise((resolve, reject) => {
1648
+ this._connector.addTransactionLine(transactionUuid, TransactionLineType.ArticleLine, articleNo, amount, warehouseNo, commissionCode, isReturn, aboveLineNr, belowLineNr)
1649
+ .then((response) => __awaiter(this, void 0, void 0, function* () {
1650
+ resolve(response);
1651
+ }), (error) => {
1652
+ this._prompt.showError(error);
1653
+ reject(error);
1654
+ })
1655
+ .catch((reason) => {
1656
+ this._prompt.showError(reason.getFullErrorString());
1657
+ resolve(null);
1658
+ });
1659
+ });
1660
+ });
1661
+ }
1662
+ addTransactionLine(lineType, articleNo, amount, warehouseNo, commissionCode, isReturn, aboveLineNr, belowLineNr, remember = true) {
1615
1663
  return __awaiter(this, void 0, void 0, function* () {
1616
1664
  return new Promise((resolve, reject) => {
1617
1665
  this._connector.addTransactionLine(this.currentTransaction.uuid, lineType, articleNo, amount, warehouseNo, commissionCode, isReturn, aboveLineNr, belowLineNr)
1618
1666
  .then((response) => __awaiter(this, void 0, void 0, function* () {
1619
- this._rememberCurrentTransaction(response);
1620
- this._rememberCurrentTransactionLineStatus(response);
1667
+ this._rememberResponse(remember, response);
1621
1668
  resolve(response);
1622
1669
  }), (error) => {
1623
1670
  reject(error);
@@ -1628,13 +1675,12 @@ class TransactionService {
1628
1675
  });
1629
1676
  });
1630
1677
  }
1631
- addTextLineToTransaction(showOnDocuments, text, amount, articleBound, refArticleLineNr, aboveLineNr, belowLineNr) {
1678
+ addTextLineToTransaction(showOnDocuments, text, amount, articleBound, refArticleLineNr, aboveLineNr, belowLineNr, remember = true) {
1632
1679
  return __awaiter(this, void 0, void 0, function* () {
1633
1680
  return new Promise((resolve, reject) => {
1634
1681
  this._connector.addTextLineToTransaction(this.currentTransaction.uuid, showOnDocuments, text, amount, articleBound, refArticleLineNr, aboveLineNr, belowLineNr)
1635
1682
  .then((response) => __awaiter(this, void 0, void 0, function* () {
1636
- this._rememberCurrentTransaction(response);
1637
- this._rememberCurrentTransactionLineStatus(response);
1683
+ this._rememberResponse(remember, response);
1638
1684
  resolve(response);
1639
1685
  }), (error) => {
1640
1686
  reject(error);
@@ -1645,12 +1691,11 @@ class TransactionService {
1645
1691
  });
1646
1692
  });
1647
1693
  }
1648
- changeLineSequence(lineUuid, aboveLineNr, belowLineNr) {
1694
+ changeLineSequence(lineUuid, aboveLineNr, belowLineNr, remember = true) {
1649
1695
  return new Promise((resolve, reject) => {
1650
1696
  this._connector.changeLineSequence(this.currentTransaction.uuid, lineUuid, aboveLineNr, belowLineNr)
1651
1697
  .then((response) => __awaiter(this, void 0, void 0, function* () {
1652
- this._rememberCurrentTransaction(response);
1653
- this._rememberCurrentTransactionLineStatus(response);
1698
+ this._rememberResponse(remember, response);
1654
1699
  resolve(response);
1655
1700
  }), (error) => {
1656
1701
  reject(error);
@@ -1660,12 +1705,14 @@ class TransactionService {
1660
1705
  });
1661
1706
  });
1662
1707
  }
1663
- cancelAddTransactionLine(lineUuid) {
1708
+ cancelAddTransactionLine(lineUuid, remember = true) {
1664
1709
  return __awaiter(this, void 0, void 0, function* () {
1665
1710
  return new Promise((resolve, reject) => {
1666
1711
  this._connector.cancelAddTransactionLine(lineUuid)
1667
1712
  .then((response) => __awaiter(this, void 0, void 0, function* () {
1668
- this._rememberCurrentTransaction(response);
1713
+ if (remember) {
1714
+ this._rememberCurrentTransaction(response);
1715
+ }
1669
1716
  if (response.isSuccess) {
1670
1717
  resolve(response);
1671
1718
  }
@@ -1679,13 +1726,12 @@ class TransactionService {
1679
1726
  });
1680
1727
  });
1681
1728
  }
1682
- deleteTransactionLine(transactionUuid, TransactionLineUuid) {
1729
+ deleteTransactionLine(transactionUuid, TransactionLineUuid, remember = true) {
1683
1730
  return __awaiter(this, void 0, void 0, function* () {
1684
1731
  return new Promise((resolve, reject) => {
1685
1732
  this._connector.deleteTransactionLine(transactionUuid, TransactionLineUuid)
1686
1733
  .then((response) => __awaiter(this, void 0, void 0, function* () {
1687
- this._rememberCurrentTransaction(response);
1688
- this._rememberCurrentTransactionLineStatus(response);
1734
+ this._rememberResponse(remember, response);
1689
1735
  if (response.isSuccess) {
1690
1736
  resolve(response);
1691
1737
  }
@@ -1699,14 +1745,13 @@ class TransactionService {
1699
1745
  });
1700
1746
  });
1701
1747
  }
1702
- changeTransactionLineQuantity(lineUuid, newQuantity) {
1748
+ changeTransactionLineQuantity(lineUuid, newQuantity, remember = true) {
1703
1749
  return __awaiter(this, void 0, void 0, function* () {
1704
1750
  return new Promise((resolve) => {
1705
1751
  this._connector.changeTransactionLineQuantity(this.currentTransaction.uuid, lineUuid, newQuantity)
1706
1752
  .then((response) => __awaiter(this, void 0, void 0, function* () {
1707
1753
  if (response.isSuccess) {
1708
- this._rememberCurrentTransaction(response);
1709
- this._rememberCurrentTransactionLineStatus(response);
1754
+ this._rememberResponse(remember, response);
1710
1755
  }
1711
1756
  resolve(response);
1712
1757
  })).catch((reason) => {
@@ -1787,12 +1832,19 @@ class TransactionService {
1787
1832
  transactionDeliveryOptionsRequest.invoiceAddress = this._currentTransaction.invoiceAddress.nawNr;
1788
1833
  return transactionDeliveryOptionsRequest;
1789
1834
  }
1835
+ _rememberResponse(remember, response) {
1836
+ if (remember) {
1837
+ this._rememberCurrentTransaction(response);
1838
+ this._rememberCurrentTransactionLineStatus(response);
1839
+ }
1840
+ }
1790
1841
  }
1791
1842
  TransactionService.decorators = [
1792
1843
  { type: Injectable }
1793
1844
  ];
1794
1845
  TransactionService.ctorParameters = () => [
1795
- { type: IOneConnectorAdapterService }
1846
+ { type: IOneConnectorAdapterService },
1847
+ { type: PromptService }
1796
1848
  ];
1797
1849
 
1798
1850
  var LanguageCode;
@@ -1888,6 +1940,7 @@ class Dictionary {
1888
1940
  "ARTICLE_DESCRIPTION": "Artikelomschrijving",
1889
1941
  "ARTICLE_IN_OUT_COLLECTION": "Status van artikel is '|~'. Weet u zeker dat u door wilt gaan?",
1890
1942
  "ARTICLE_NR": "Artikelnummer",
1943
+ "ARTICLE_UNKNOWN": "Onbekend artikel",
1891
1944
  "ASSEMBLY_COSTS": "Montagekosten",
1892
1945
  "ASSEMBLY_DATE": "Montagedatum",
1893
1946
  "AMOUNT": "Aantal",
@@ -2027,6 +2080,7 @@ class Dictionary {
2027
2080
  "VAT": "Btw",
2028
2081
  "VAT_AMOUNT": "BTW-bedrag",
2029
2082
  "VALUE": "Waarde",
2083
+ "WHERE_ARE_YOU_LOOKING_FOR": "Waar ben je naar op zoek?",
2030
2084
  "WAREHOUSE": "Magazijn",
2031
2085
  "YOUR_DATA": "Uw gegevens",
2032
2086
  },
@@ -2049,6 +2103,7 @@ class Dictionary {
2049
2103
  "ARTICLE_DESCRIPTION": "Article description",
2050
2104
  "ARTICLE_IN_OUT_COLLECTION": "Status of article is '|~'. Are you sure to proceed?",
2051
2105
  "ARTICLE_NR": "Article number",
2106
+ "ARTICLE_UNKNOWN": "Article unknown",
2052
2107
  "ASSEMBLY_COSTS": "Assembly costs",
2053
2108
  "ASSEMBLY_DATE": "Assembly date",
2054
2109
  "AMOUNT": "Amount",
@@ -2181,6 +2236,7 @@ class Dictionary {
2181
2236
  "VAT": "VAT",
2182
2237
  "VAT_AMOUNT": "VAT amount",
2183
2238
  "WAREHOUSE": "Warehouse",
2239
+ "WHERE_ARE_YOU_LOOKING_FOR": "Where are you looking for?",
2184
2240
  "YOUR_DATA": "Your data",
2185
2241
  },
2186
2242
  };
@@ -2207,15 +2263,18 @@ class DictionaryService {
2207
2263
  setDictionary(language) {
2208
2264
  return __awaiter(this, void 0, void 0, function* () {
2209
2265
  this._language = language || LanguageCode.Dutch;
2210
- if (!this._dictionaries.has(this._language)) {
2211
- const dictionary = new Dictionary();
2266
+ this._loadDictionary();
2267
+ });
2268
+ }
2269
+ _loadDictionary() {
2270
+ if (!this._dictionaries.has(this._language)) {
2271
+ const dictionary = new Dictionary();
2272
+ // eslint-disable-next-line no-magic-numbers
2273
+ if (dictionary.strings[this._language.substr(0, 2).toLowerCase()] !== undefined) {
2212
2274
  // eslint-disable-next-line no-magic-numbers
2213
- if (dictionary.strings[this._language.substr(0, 2).toLowerCase()] !== undefined) {
2214
- // eslint-disable-next-line no-magic-numbers
2215
- this._dictionaries.set(this._language, dictionary.strings[this._language.substr(0, 2).toLowerCase()]);
2216
- }
2275
+ this._dictionaries.set(this._language, dictionary.strings[this._language.substr(0, 2).toLowerCase()]);
2217
2276
  }
2218
- });
2277
+ }
2219
2278
  }
2220
2279
  /**
2221
2280
  * Returns the localized text for the given dictionary key.
@@ -2228,6 +2287,10 @@ class DictionaryService {
2228
2287
  if (!StringUtils.IsStringWithLength(key)) {
2229
2288
  return key || "";
2230
2289
  }
2290
+ if (this.language === undefined) {
2291
+ this._language = LanguageCode.Dutch;
2292
+ this._loadDictionary();
2293
+ }
2231
2294
  let text = this._dictionaries.get(this.language)[key];
2232
2295
  text = StringUtils.IsStringWithLength(text) ? text : key;
2233
2296
  if (upperCaseFirst) {
@@ -2242,8 +2305,11 @@ class DictionaryService {
2242
2305
  return text;
2243
2306
  }
2244
2307
  }
2308
+ DictionaryService.ɵprov = i0.ɵɵdefineInjectable({ factory: function DictionaryService_Factory() { return new DictionaryService(); }, token: DictionaryService, providedIn: "root" });
2245
2309
  DictionaryService.decorators = [
2246
- { type: Injectable }
2310
+ { type: Injectable, args: [{
2311
+ providedIn: "root"
2312
+ },] }
2247
2313
  ];
2248
2314
  DictionaryService.ctorParameters = () => [];
2249
2315
 
@@ -3258,7 +3324,7 @@ CheckoutOverviewComponent.decorators = [
3258
3324
  (editModeChange)="handleEditChangeRelation($event)">
3259
3325
  <ng-container edit-mode-content>
3260
3326
  <checkout-overview-relation-edit #relationForm
3261
- *ngIf="currentStep == steps.Relation && editMode"
3327
+ *ngIf="currentStep === steps.Relation && editMode"
3262
3328
  [relation]="relation"
3263
3329
  [transaction]="transaction"
3264
3330
  (validSubmit)="onRelationValid()"
@@ -4290,7 +4356,6 @@ class IoneCheckoutModule {
4290
4356
  IoneCheckoutModule.decorators = [
4291
4357
  { type: NgModule, args: [{
4292
4358
  imports: [
4293
- BrowserAnimationsModule,
4294
4359
  IconModule,
4295
4360
  InputTextModule,
4296
4361
  InputCheckboxModule,
@@ -4310,6 +4375,7 @@ IoneCheckoutModule.decorators = [
4310
4375
  CoSidebarModule,
4311
4376
  CoGridModule,
4312
4377
  CoreModule,
4378
+ CommonModule,
4313
4379
  ],
4314
4380
  declarations: [
4315
4381
  CheckoutComponent,
@@ -5404,7 +5470,7 @@ ShoppingCartLineComponent.decorators = [
5404
5470
  [textContent]="line.text">
5405
5471
  </div>
5406
5472
  `,
5407
- styles: ["html,body{height:100%}body{margin:0;font-family:Roboto,\"Helvetica Neue\",sans-serif}.cart-line-r .cart-line-description .cart-line-description-artnr{font-size:10px}.flex-center{display:flex}.flex-center{flex-direction:row}.flex-center{align-items:center!important;justify-content:center!important}:host{padding-bottom:20px}:host{padding-top:20px}.cart-line-r .cart-line-description,.cart-line-r .cart-line-right .cart-line-amount,.cart-line-r .cart-line-image,.cart-line-r .cart-line-right .cart-line-stock,.cart-line-r .cart-line-right .cart-line-totals{margin-top:20px}.cart-line-r .cart-line-description,.cart-line-r .cart-line-right .cart-line-amount,.cart-line-r .cart-line-image,.cart-line-r .cart-line-right .cart-line-stock,.cart-line-r .cart-line-right .cart-line-totals{margin-bottom:20px}.cart-line-r .cart-line-description,.cart-line-r .cart-line-right .cart-line-amount,.cart-line-t,.cart-line-r .cart-line-right .cart-line-totals{margin-left:20px}.cart-line-r .cart-line-description,.cart-line-r .cart-line-right .cart-line-amount,.cart-line-t{margin-right:20px}.triangle{border-radius:3px}.full-width{width:100%}.flex-center{margin:10px 0}:host{display:flex;flex-wrap:wrap;border-bottom:1px solid #DBE3E8;width:100%}:host.overlayed.is-text{display:none!important}:host.overlayed.is-selected{background-color:#add8e6}:host.overview.is-text{display:none!important}:host.overview.is-selected{background-color:#add8e6}.horizontal{display:flex;flex-direction:row-reverse}.cart-line-r{display:flex;justify-content:stretch;flex-direction:row}@media (max-width: 800px){.cart-line-r{flex-direction:column}}.cart-line-r co-button{border:0;padding:0}.cart-line-r .cart-line-image{display:flex;flex:1 0 auto!important;flex-direction:column;align-items:center;justify-content:center}.cart-line-r .cart-line-image image-display{width:6em;height:6em}.cart-line-r .cart-line-description{display:flex;flex-direction:column;width:100%}.cart-line-r .cart-line-description .cart-line-description-main{font-weight:bold}.cart-line-r .cart-line-right{justify-content:flex-end}.cart-line-r .cart-line-right .cart-line-stock{width:10em}.cart-line-r .cart-line-right .cart-line-amount{width:10em}.cart-line-r .cart-line-right .cart-line-totals{display:flex;justify-content:flex-end;min-width:100px;font-weight:bold}.cart-line-r .cart-line-right .cart-line-totals span{text-align:right}.cart-line-t.article-text{padding-left:10em}\n"]
5473
+ styles: ["html,body{height:100%}body{margin:0;font-family:Roboto,\"Helvetica Neue\",sans-serif}.cart-line-r .cart-line-description .cart-line-description-artnr{font-size:10px}.flex-center{display:flex}.flex-center{flex-direction:row}.flex-center{align-items:center!important;justify-content:center!important}:host{padding-bottom:20px}:host{padding-top:20px}.cart-line-r .cart-line-description,.cart-line-r .cart-line-right .cart-line-amount,.cart-line-r .cart-line-image,.cart-line-r .cart-line-right .cart-line-stock,.cart-line-r .cart-line-right .cart-line-totals{margin-top:20px}.cart-line-r .cart-line-description,.cart-line-r .cart-line-right .cart-line-amount,.cart-line-r .cart-line-image,.cart-line-r .cart-line-right .cart-line-stock,.cart-line-r .cart-line-right .cart-line-totals{margin-bottom:20px}.cart-line-r .cart-line-description,.cart-line-r .cart-line-right .cart-line-amount,.cart-line-t,.cart-line-r .cart-line-right .cart-line-totals{margin-left:20px}.cart-line-r .cart-line-description,.cart-line-r .cart-line-right .cart-line-amount,.cart-line-t{margin-right:20px}.triangle{border-radius:3px}.full-width{width:100%}.flex-center{margin:10px 0}:host{display:flex;flex-wrap:wrap;border-bottom:1px solid #DBE3E8;width:100%}:host.overlayed.is-text{display:none!important}:host.overlayed.is-selected{background-color:#add8e6}:host.overview.is-text{display:none!important}:host.overview.is-selected{background-color:#add8e6}.horizontal{display:flex;flex-direction:row}.cart-line-r{display:flex;justify-content:stretch;flex-direction:row}@media (max-width: 800px){.cart-line-r{flex-direction:column}}.cart-line-r co-button{border:0;padding:0}.cart-line-r .cart-line-image{display:flex;flex:1 0 auto!important;flex-direction:column;align-items:center;justify-content:center}.cart-line-r .cart-line-image image-display{width:6em;height:6em}.cart-line-r .cart-line-description{display:flex;flex-direction:column;width:100%}.cart-line-r .cart-line-description .cart-line-description-main{font-weight:bold}.cart-line-r .cart-line-right{justify-content:flex-end}.cart-line-r .cart-line-right .cart-line-stock{width:10em}.cart-line-r .cart-line-right .cart-line-amount{width:10em}.cart-line-r .cart-line-right .cart-line-totals{display:flex;justify-content:flex-end;min-width:100px;font-weight:bold}.cart-line-r .cart-line-right .cart-line-totals span{text-align:right}.cart-line-t.article-text{padding-left:10em}\n"]
5408
5474
  },] }
5409
5475
  ];
5410
5476
  ShoppingCartLineComponent.ctorParameters = () => [
@@ -5478,6 +5544,7 @@ class CharacteristicAnswerComponent {
5478
5544
  }
5479
5545
  CharacteristicAnswerComponent.decorators = [
5480
5546
  { type: Component, args: [{
5547
+ // eslint-disable-next-line @angular-eslint/component-selector
5481
5548
  selector: "characteristic-answer",
5482
5549
  template: `
5483
5550
  <co-dialog
@@ -5554,7 +5621,6 @@ IoneShoppingCartModule.decorators = [
5554
5621
  CharacteristicAnswerComponent,
5555
5622
  ],
5556
5623
  imports: [
5557
- BrowserAnimationsModule,
5558
5624
  CommonModule,
5559
5625
  IconModule,
5560
5626
  InputTextModule,
@@ -5584,7 +5650,7 @@ IoneShoppingCartModule.decorators = [
5584
5650
  entryComponents: [
5585
5651
  IoneShoppingCartComponent
5586
5652
  ],
5587
- exports: [IoneShoppingCartComponent, StockStatusIndicatorComponent],
5653
+ exports: [IoneShoppingCartComponent, StockStatusIndicatorComponent, CharacteristicAnswerComponent],
5588
5654
  bootstrap: [IoneShoppingCartComponent]
5589
5655
  },] }
5590
5656
  ];
@@ -5596,14 +5662,18 @@ class IoneServiceOrderComponent {
5596
5662
  this._connector = _connector;
5597
5663
  this._dictionary = _dictionary;
5598
5664
  this._service = _service;
5599
- this.orderNr = 0;
5600
- this.orderId = 0;
5601
5665
  this.upAndLoaded = false;
5602
5666
  this._subscriptions = [];
5603
5667
  this._remoteOptions = true;
5604
5668
  this._publicOptions = true;
5669
+ this._orderId = 0;
5605
5670
  this._subscriptions.push(this._optionsService.optionsLoaded.subscribe(loaded => this._handleSettingsLoaded(loaded)));
5606
5671
  }
5672
+ set orderId(value) {
5673
+ this._orderId = value;
5674
+ this._getTransactionById(this._orderId);
5675
+ }
5676
+ ;
5607
5677
  set options(value) {
5608
5678
  if (value) {
5609
5679
  let options;
@@ -5636,15 +5706,6 @@ class IoneServiceOrderComponent {
5636
5706
  _initConnection() {
5637
5707
  return __awaiter(this, void 0, void 0, function* () {
5638
5708
  yield this._connector.connect(this._optionsService.options);
5639
- if (this.orderNr) {
5640
- yield this._service.getTransaction(this.orderNr);
5641
- }
5642
- else if (this.orderId) {
5643
- yield this._service.getTransactionById(this.orderId);
5644
- }
5645
- else {
5646
- yield this._service.getTransaction(IoneServiceOrderComponent.TEST_ORDER_NR);
5647
- }
5648
5709
  if (this._optionsService.options.url) {
5649
5710
  this._dictionary.rootUrl = this._optionsService.options.url.replace("/ajaxservice", "");
5650
5711
  }
@@ -5654,8 +5715,12 @@ class IoneServiceOrderComponent {
5654
5715
  });
5655
5716
  });
5656
5717
  }
5718
+ _getTransactionById(orderId) {
5719
+ return __awaiter(this, void 0, void 0, function* () {
5720
+ yield this._service.getTransactionById(orderId);
5721
+ });
5722
+ }
5657
5723
  }
5658
- IoneServiceOrderComponent.TEST_ORDER_NR = 18156;
5659
5724
  IoneServiceOrderComponent.decorators = [
5660
5725
  { type: Component, args: [{
5661
5726
  // eslint-disable-next-line @angular-eslint/component-selector
@@ -5676,7 +5741,6 @@ IoneServiceOrderComponent.ctorParameters = () => [
5676
5741
  { type: TransactionService }
5677
5742
  ];
5678
5743
  IoneServiceOrderComponent.propDecorators = {
5679
- orderNr: [{ type: Input }],
5680
5744
  orderId: [{ type: Input }],
5681
5745
  options: [{ type: Input }]
5682
5746
  };
@@ -5688,28 +5752,53 @@ class TransactionBaseComponent {
5688
5752
  this.customer = NULL_CUSTOMER_FULL_OBJECT;
5689
5753
  this._isService = false;
5690
5754
  this.basedOnProduct = false;
5755
+ this._lineOperationStatuses = [];
5756
+ this._transactionLines = [];
5691
5757
  }
5692
5758
  set transaction(value) {
5693
5759
  this._transaction = value;
5694
- if (this._transaction && this._transaction.transactionInfo) {
5695
- this._isService = this._transaction.transactionInfo.transactionKind === TransactionKind.ServiceOrder;
5760
+ if (this._transaction) {
5761
+ if (this._transaction.transactionInfo) {
5762
+ this._transactionInfo = this._transaction.transactionInfo;
5763
+ this._isService = this._transaction.transactionInfo.transactionKind === TransactionKind.ServiceOrder;
5764
+ }
5765
+ if (this._transaction.transactionLines) {
5766
+ this.transactionLines = this._transaction.transactionLines;
5767
+ }
5768
+ if (this._transaction.transactionTotal) {
5769
+ this._transactionTotal = this._transaction.transactionTotal;
5770
+ }
5771
+ if (this._transaction.lineOperationStatuses) {
5772
+ this.lineOperationStatuses = this._transaction.lineOperationStatuses;
5773
+ }
5696
5774
  }
5697
5775
  }
5698
5776
  get transaction() {
5699
5777
  return this._transaction;
5700
5778
  }
5779
+ set transactionInfo(value) {
5780
+ this._transactionInfo = value;
5781
+ }
5701
5782
  get transactionInfo() {
5702
- return this._transaction.transactionInfo;
5783
+ return this._transactionInfo;
5784
+ }
5785
+ set transactionLines(value) {
5786
+ this._transactionLines = value;
5703
5787
  }
5704
5788
  get transactionLines() {
5705
- if (this._transaction) {
5706
- return this._transaction.transactionLines;
5707
- }
5789
+ return this._transactionLines;
5790
+ }
5791
+ set transactionTotal(value) {
5792
+ this._transactionTotal = value;
5708
5793
  }
5709
5794
  get transactionTotal() {
5710
- if (this._transaction) {
5711
- return this._transaction.transactionTotal;
5712
- }
5795
+ return this._transactionTotal;
5796
+ }
5797
+ get lineOperationStatuses() {
5798
+ return this._lineOperationStatuses;
5799
+ }
5800
+ set lineOperationStatuses(value) {
5801
+ this._lineOperationStatuses = value;
5713
5802
  }
5714
5803
  get isService() {
5715
5804
  return this._isService;
@@ -5795,6 +5884,13 @@ TransactionBaseComponent.propDecorators = {
5795
5884
  customer: [{ type: Input }]
5796
5885
  };
5797
5886
 
5887
+ // import {
5888
+ // ToolbarService,
5889
+ // LinkService,
5890
+ // ImageService,
5891
+ // HtmlEditorService,
5892
+ // RichTextEditor
5893
+ // } from '@syncfusion/ej2-angular-richtexteditor';
5798
5894
  class TransactionArticleTextComponent extends TransactionBaseComponent {
5799
5895
  constructor(service) {
5800
5896
  super(service);
@@ -5860,10 +5956,12 @@ TransactionArticleTextComponent.decorators = [
5860
5956
  <ng-container content>
5861
5957
  <div class="tags-join-content" fxLayout fxLayoutGap="10px">
5862
5958
  <div class="column-separator">
5863
- <co-input-text placeholder="Titel"></co-input-text>
5864
- <!--transactiontransaction-->
5865
- <!-- label="Artikeltekst"-->
5866
- <!-- ></co-text-editor>-->
5959
+ <co-input-text placeholder="Titel"></co-input-text>
5960
+ <!-- <ejs-richtexteditor-->
5961
+ <!-- #rte-->
5962
+ <!-- id="Rte"-->
5963
+ <!-- >-->
5964
+ <!-- </ejs-richtexteditor>-->
5867
5965
  </div>
5868
5966
  <div style="margin-left:5px;">
5869
5967
  <div style="margin-top:16px;">
@@ -5872,6 +5970,7 @@ TransactionArticleTextComponent.decorators = [
5872
5970
  [fields]="fields"
5873
5971
  placeholder="Standaardteksten"
5874
5972
  ></ejs-dropdownlist>
5973
+
5875
5974
  </div>
5876
5975
  <div style="margin-top:20px;">
5877
5976
  <co-input-checkbox
@@ -5899,6 +5998,7 @@ TransactionArticleTextComponent.decorators = [
5899
5998
  <co-button label="OK" (click)="onOkClick()"></co-button>
5900
5999
  <co-button label="CANCEL" (click)="hide()"></co-button>
5901
6000
  <co-button label="OVERVIEW" (click)="onOverview()"></co-button>
6001
+ <!-- <co-button label="TEST" (click)="onTest()"></co-button>-->
5902
6002
  </div>
5903
6003
  </ng-container>
5904
6004
  </co-dialog>
@@ -5975,12 +6075,306 @@ TransactionArticleTextComponent.propDecorators = {
5975
6075
  subHeader: [{ type: Input }]
5976
6076
  };
5977
6077
 
6078
+ class TransactionManagerComponent extends TransactionBaseComponent {
6079
+ constructor(service, transactionEvents, promptService, _dictionaryService) {
6080
+ super(service);
6081
+ this.service = service;
6082
+ this.transactionEvents = transactionEvents;
6083
+ this.promptService = promptService;
6084
+ this._dictionaryService = _dictionaryService;
6085
+ this.linesChanged = new EventEmitter();
6086
+ this.articleAdded = new EventEmitter();
6087
+ this.columns = [];
6088
+ this._inOutCollection = [];
6089
+ this._showCharacteristic = false;
6090
+ this._subs = [];
6091
+ this._subs.push(this.service.transactionLoaded.subscribe((transactionInfoResponse) => {
6092
+ if (transactionInfoResponse.isSuccess) {
6093
+ this.transaction = transactionInfoResponse;
6094
+ }
6095
+ }));
6096
+ }
6097
+ get amountOfLines() {
6098
+ return NumberUtils.NrOrDefault(this.service.articleAmount, 0);
6099
+ }
6100
+ get showCharacteristicDialog() {
6101
+ return this._showCharacteristic;
6102
+ }
6103
+ set showCharacteristicDialog(value) {
6104
+ this._showCharacteristic = value;
6105
+ }
6106
+ ngOnDestroy() {
6107
+ this._subs.forEach(sub => sub.unsubscribe());
6108
+ }
6109
+ addArticleLine(transactionUuid, sku, amount, lineNr, beforeOrAfter) {
6110
+ return __awaiter(this, void 0, void 0, function* () {
6111
+ const goodId = yield this.service.getGoodIdFromArticleNr(sku);
6112
+ if (goodId) {
6113
+ yield this._loadArticle(goodId);
6114
+ yield this._handleAddArticleLineAt(amount, lineNr, beforeOrAfter);
6115
+ }
6116
+ else {
6117
+ this.promptService.showError(this._dictionaryService.get("ARTICLE_UNKNOWN"));
6118
+ }
6119
+ });
6120
+ }
6121
+ changeLineSequence(fromIndex, toIndex) {
6122
+ return __awaiter(this, void 0, void 0, function* () {
6123
+ let fromLine = this._getTransactionLineInfoByIndex(fromIndex);
6124
+ let toLine = this._getTransactionLineInfoByIndex(toIndex);
6125
+ let aboveLineNr;
6126
+ let belowLineNr;
6127
+ if (fromIndex > toIndex) {
6128
+ aboveLineNr = toLine.lineNr;
6129
+ }
6130
+ else {
6131
+ belowLineNr = toLine.lineNr;
6132
+ }
6133
+ yield this.service.changeLineSequence(fromLine.uuid, aboveLineNr, belowLineNr, false)
6134
+ .then((value) => {
6135
+ this.handleLineOperationStatus(value);
6136
+ }, (error) => this.promptService.showError(error));
6137
+ });
6138
+ }
6139
+ showStockManager(line) {
6140
+ return __awaiter(this, void 0, void 0, function* () {
6141
+ this.warehouse.selectedWarehouseNr = line.warehouseNumber;
6142
+ this.warehouse.amount = line.amount;
6143
+ this.warehouse.commissionCode = line.commissionCode;
6144
+ this.warehouse.message = this.currentOperationStatus.pendingReason;
6145
+ this.warehouse.show(line.articleNumber);
6146
+ });
6147
+ }
6148
+ warehouseOkClick() {
6149
+ return __awaiter(this, void 0, void 0, function* () {
6150
+ if (this.warehouse.commissionCode !== undefined) {
6151
+ this.currentReason.commissionCode = this.warehouse.commissionCode;
6152
+ }
6153
+ if (this.warehouse.amount !== undefined) {
6154
+ this.currentReason.quantity = this.warehouse.amount;
6155
+ }
6156
+ if (this.warehouse.selectedWarehouseNr !== undefined) {
6157
+ this.currentReason.warehouseNr = this.warehouse.selectedWarehouseNr;
6158
+ }
6159
+ if (this.currentReason) {
6160
+ yield this.service.resolvePendingLineReason(this.currentReason, false)
6161
+ .then((value) => {
6162
+ this.handleLineOperationStatus(value);
6163
+ });
6164
+ }
6165
+ });
6166
+ }
6167
+ warehouseCancelClick() {
6168
+ return __awaiter(this, void 0, void 0, function* () {
6169
+ if (this.currentReason) {
6170
+ yield this._cancelArticle(this.currentReason.lineUuid);
6171
+ }
6172
+ });
6173
+ }
6174
+ handleCharacteristicAnswerOkClick(answer) {
6175
+ return __awaiter(this, void 0, void 0, function* () {
6176
+ this.currentReason = new ResolvePendingLineReasonRequest(this.currentOperationStatus.uuid, this.currentOperationStatus.pendingReason, this.currentOperationStatus.pendingReasonType);
6177
+ this.currentReason.textualUserInput = answer;
6178
+ yield this.service.resolvePendingLineReason(this.currentReason, false)
6179
+ .then((value) => {
6180
+ this.handleLineOperationStatus(value);
6181
+ });
6182
+ });
6183
+ }
6184
+ _handleAddArticle(amount = 1) {
6185
+ return __awaiter(this, void 0, void 0, function* () {
6186
+ yield this.service.addTransactionLine(TransactionLineType.ArticleLine, this.newArticleNr, amount, this.newArticle.standardWareHouse, this.newArticle.commissionCode, false, 0, 0, false)
6187
+ .then((value) => {
6188
+ this.handleLineOperationStatus(value);
6189
+ }, (error) => this.promptService.showError(error));
6190
+ });
6191
+ }
6192
+ _handleAddArticleLineAt(amount, lineNr, beforeOrAfter) {
6193
+ return __awaiter(this, void 0, void 0, function* () {
6194
+ yield this.service.addArticleToTransaction(this.transactionInfo.uuid, this.newArticleNr, amount, this.newArticle.standardWareHouse, this.newArticle.commissionCode, false, beforeOrAfter === PositionGridRow.Before ? lineNr : undefined, beforeOrAfter === PositionGridRow.After ? lineNr : undefined)
6195
+ .then((value) => {
6196
+ this.lineOperationStatuses = value.lineOperationStatuses;
6197
+ this.handleLineOperationStatus(value);
6198
+ }, (error) => this.promptService.showError(error));
6199
+ });
6200
+ }
6201
+ _getWareHouseNoFromArticle() {
6202
+ if (this.newArticle !== undefined && this.newArticle.stockLocations !== undefined && this.newArticle.stockLocations.length) {
6203
+ return this.newArticle.stockLocations[0].warehouseNr;
6204
+ }
6205
+ return 0;
6206
+ }
6207
+ isLineOperationStatus(lineOperationStatuses) {
6208
+ this.currentOperationStatus = this.service.pendingLineOperationStatus(lineOperationStatuses);
6209
+ if (this.currentOperationStatus !== undefined) {
6210
+ return true;
6211
+ }
6212
+ return false;
6213
+ }
6214
+ _confirmAction() {
6215
+ return __awaiter(this, void 0, void 0, function* () {
6216
+ this.currentReason = new ResolvePendingLineReasonRequest(this.currentOperationStatus.uuid, this.currentOperationStatus.pendingReason, this.currentOperationStatus.pendingReasonType);
6217
+ const pendingReasonText = yield this._getPendingReasonText(this.currentOperationStatus.pendingReason);
6218
+ this.currentReason.confirmation = yield this.promptService.showYesNo(pendingReasonText, " ");
6219
+ yield this.service.resolvePendingLineReason(this.currentReason, false)
6220
+ .then((value) => {
6221
+ this.handleLineOperationStatus(value);
6222
+ });
6223
+ });
6224
+ }
6225
+ _showInformation() {
6226
+ return __awaiter(this, void 0, void 0, function* () {
6227
+ this.currentReason = new ResolvePendingLineReasonRequest(this.currentOperationStatus.uuid, this.currentOperationStatus.pendingReason, this.currentOperationStatus.pendingReasonType);
6228
+ const pendingReasonText = yield this._getPendingReasonText(this.currentOperationStatus.pendingReason);
6229
+ yield this.promptService.showOkModal(pendingReasonText, " ");
6230
+ yield this.service.resolvePendingLineReason(this.currentReason, false)
6231
+ .then((value) => {
6232
+ this.handleLineOperationStatus(value);
6233
+ });
6234
+ });
6235
+ }
6236
+ _getPendingReasonText(pendingReason) {
6237
+ return __awaiter(this, void 0, void 0, function* () {
6238
+ if (pendingReason === "ARTICLE_IS_DISCONTINUED_DO_YOU_WANT_TO_CONTINUE_PLEASE_CONFIRM") {
6239
+ return this._dictionaryService.get("ARTICLE_IN_OUT_COLLECTION").replace("|~", yield this.getInOutCollectionOfArticle());
6240
+ }
6241
+ return this._dictionaryService.get(pendingReason);
6242
+ });
6243
+ }
6244
+ getInOutCollectionOfArticle() {
6245
+ return __awaiter(this, void 0, void 0, function* () {
6246
+ if (!this._inOutCollection.length) {
6247
+ this._inOutCollection = yield this.service.getInOutCollection("NL");
6248
+ }
6249
+ const domainValue = this._inOutCollection.find(element => element.code === this.newArticle.inOutCollection);
6250
+ if (domainValue) {
6251
+ return domainValue.description;
6252
+ }
6253
+ return "";
6254
+ });
6255
+ }
6256
+ handleLineOperationStatus(lineOperationResponse) {
6257
+ return __awaiter(this, void 0, void 0, function* () {
6258
+ if (this.isLineOperationStatus(lineOperationResponse.lineOperationStatuses)) {
6259
+ this.transaction = lineOperationResponse;
6260
+ this.articleAdded.emit(this.transaction);
6261
+ yield this._handlePendingLine(this.currentOperationStatus.uuid).then();
6262
+ }
6263
+ else {
6264
+ yield this._saveTransaction();
6265
+ }
6266
+ });
6267
+ }
6268
+ _handlePendingLine(lineUuid) {
6269
+ return __awaiter(this, void 0, void 0, function* () {
6270
+ this.currentReason = new ResolvePendingLineReasonRequest(this.currentOperationStatus.uuid, this.currentOperationStatus.pendingReason, this.currentOperationStatus.pendingReasonType);
6271
+ this.currentPendingLine = this.transactionLines.find(l => l.uuid === lineUuid);
6272
+ switch (this.currentOperationStatus.pendingReasonType) {
6273
+ case PendingReasonType.ABORTED:
6274
+ case PendingReasonType.CANCELLED:
6275
+ yield this._cancelArticle(this.currentPendingLine.uuid);
6276
+ break;
6277
+ case PendingReasonType.CONFIRMATION_NEEDED:
6278
+ yield this._confirmAction();
6279
+ break;
6280
+ case PendingReasonType.INVALID_LOGISTICS:
6281
+ yield this.showStockManager(this.currentPendingLine);
6282
+ break;
6283
+ case PendingReasonType.NON_CRITICAL_DISCONTINUATION:
6284
+ yield this._showInformation();
6285
+ break;
6286
+ case PendingReasonType.CHARACTERISTICS_ANSWER_NEEDED:
6287
+ this.CharacteristicsAnswerNeeded();
6288
+ break;
6289
+ case PendingReasonType.NONE:
6290
+ default:
6291
+ this.currentReason = undefined;
6292
+ this.currentPendingLine = undefined;
6293
+ break;
6294
+ }
6295
+ });
6296
+ }
6297
+ _saveTransaction() {
6298
+ return __awaiter(this, void 0, void 0, function* () {
6299
+ if (this.transactionInfo) {
6300
+ const success = yield this.service.saveTransactionByUuid(this.transactionInfo.uuid);
6301
+ if (!success) {
6302
+ this.promptService.showError("Transaction could not be saved!");
6303
+ }
6304
+ }
6305
+ });
6306
+ }
6307
+ _loadArticle(goodId) {
6308
+ return __awaiter(this, void 0, void 0, function* () {
6309
+ this.newArticle = yield this.service.getArticleFullObject(goodId);
6310
+ this.newArticleNr = this.newArticle.articleNr;
6311
+ });
6312
+ }
6313
+ addEmailAddressToTransaction(emailAddress) {
6314
+ this.service.emailAddress = emailAddress;
6315
+ }
6316
+ CharacteristicsAnswerNeeded() {
6317
+ this.characteristicAnswer.question = this.currentOperationStatus.characteristic.question;
6318
+ this.characteristicAnswer.title = this.newArticle.description;
6319
+ this.characteristicAnswer.value = this.currentOperationStatus.characteristic.value;
6320
+ this.characteristicAnswer.characteristics = this.currentOperationStatus.characteristic.transactionLineCharacteristicChoices;
6321
+ setTimeout(() => {
6322
+ this.characteristicAnswer.open();
6323
+ // eslint-disable-next-line no-magic-numbers
6324
+ }, 1000);
6325
+ }
6326
+ _getTransactionLineInfoByIndex(index) {
6327
+ if (index >= 0 && index < this.transactionLines.length) {
6328
+ return this.service.currentLines[index];
6329
+ }
6330
+ }
6331
+ _cancelArticle(uuid) {
6332
+ return __awaiter(this, void 0, void 0, function* () {
6333
+ yield this.service.cancelAddTransactionLine(uuid, false)
6334
+ .then((response) => {
6335
+ this.transaction = response;
6336
+ this.articleAdded.emit(response);
6337
+ });
6338
+ });
6339
+ }
6340
+ }
6341
+ TransactionManagerComponent.decorators = [
6342
+ { type: Component, args: [{
6343
+ // eslint-disable-next-line @angular-eslint/component-selector
6344
+ selector: "transaction-manager",
6345
+ template: `
6346
+ <warehouse #warehouse
6347
+ (okClick)="warehouseOkClick()"
6348
+ (cancelClick)="warehouseCancelClick()"
6349
+ ></warehouse>
6350
+ <characteristic-answer
6351
+ #characteristicAnswer
6352
+ (okClick)="handleCharacteristicAnswerOkClick($event)"
6353
+ ></characteristic-answer>
6354
+ `,
6355
+ styles: ["html,body{height:100%}body{margin:0;font-family:Roboto,\"Helvetica Neue\",sans-serif}.flex-center,.warehouse-line-container{display:flex}.flex-center,.warehouse-line-container{flex-direction:row}.flex-center{align-items:center!important;justify-content:center!important}::ng-deep #warehouseDialog ::ng-deep .form-content .message-field,.commission-fields{margin-left:11px}.triangle{border-radius:3px}.full-width{width:100%}.flex-center{margin:10px 0}::ng-deep #warehouseDialog{align-items:center;max-height:100%}::ng-deep #warehouseDialog ::ng-deep co-form{height:100%;width:500px}::ng-deep #warehouseDialog ::ng-deep .form-content{height:calc(100% - 80px);width:100%}::ng-deep #warehouseDialog ::ng-deep .form-content .message-field{height:20px;word-wrap:break-word;white-space:normal}co-button:not(:last-child){margin-right:10px}.commission-fields{justify-content:space-between;margin:10px 0}.warehouse-description-item{width:15rem}.warehouse-nr-item{width:5rem}co-input-number-picker co-button{max-width:20px}\n"]
6356
+ },] }
6357
+ ];
6358
+ TransactionManagerComponent.ctorParameters = () => [
6359
+ { type: TransactionService },
6360
+ { type: TransactionEventService },
6361
+ { type: PromptService },
6362
+ { type: DictionaryService }
6363
+ ];
6364
+ TransactionManagerComponent.propDecorators = {
6365
+ warehouse: [{ type: ViewChild, args: ["warehouse",] }],
6366
+ characteristicAnswer: [{ type: ViewChild, args: ["characteristicAnswer",] }],
6367
+ linesChanged: [{ type: Output }],
6368
+ articleAdded: [{ type: Output }]
6369
+ };
6370
+
5978
6371
  class ServiceOrderComponent extends TransactionBaseComponent {
5979
- constructor(service, transactionEvents, iconCacheService) {
6372
+ constructor(service, transactionEvents, iconCacheService, _promptService) {
5980
6373
  super(service);
5981
6374
  this.service = service;
5982
6375
  this.transactionEvents = transactionEvents;
5983
6376
  this.iconCacheService = iconCacheService;
6377
+ this._promptService = _promptService;
5984
6378
  this.iconThickLines = CoreComponentsIcon.ThickLines;
5985
6379
  this.iconThinLines = CoreComponentsIcon.ThinLines;
5986
6380
  this.iconOrder = CoreComponentsIcon.Order;
@@ -5991,6 +6385,7 @@ class ServiceOrderComponent extends TransactionBaseComponent {
5991
6385
  this.isRouteOptimizationConfigured = false;
5992
6386
  this.activeViewMode = ContentViewMode.List;
5993
6387
  this.floatButtonSelected = false;
6388
+ this.newArticleNr = "";
5994
6389
  this._subs = [];
5995
6390
  }
5996
6391
  get inListView() {
@@ -6019,6 +6414,11 @@ class ServiceOrderComponent extends TransactionBaseComponent {
6019
6414
  }));
6020
6415
  });
6021
6416
  }
6417
+ ngAfterViewInit() {
6418
+ this._subs.push(this._transactionManager.articleAdded.subscribe((transactionInfoResponse) => {
6419
+ this.transaction = transactionInfoResponse;
6420
+ }));
6421
+ }
6022
6422
  ngOnDestroy() {
6023
6423
  this._subs.forEach(sub => sub.unsubscribe());
6024
6424
  }
@@ -6061,7 +6461,7 @@ class ServiceOrderComponent extends TransactionBaseComponent {
6061
6461
  this._transactionArticleTextComponent.visible = this.floatButtonSelected;
6062
6462
  }
6063
6463
  get subHeader() {
6064
- if (this._selectedTransLine && this._selectedTransLine !== undefined) {
6464
+ if (this._selectedTransLine) {
6065
6465
  return this._selectedTransLine.goodDescription;
6066
6466
  }
6067
6467
  return "";
@@ -6069,6 +6469,15 @@ class ServiceOrderComponent extends TransactionBaseComponent {
6069
6469
  hideOrderTotals(event) {
6070
6470
  this.showTotals = false;
6071
6471
  }
6472
+ addArticleLine(event) {
6473
+ return __awaiter(this, void 0, void 0, function* () {
6474
+ if (event.code === "Enter") {
6475
+ if (this.newArticleNr && this.newArticleNr !== "") {
6476
+ yield this._transactionManager.addArticleLine(this.transactionInfo.uuid, this.newArticleNr, 1, 0, PositionGridRow.After);
6477
+ }
6478
+ }
6479
+ });
6480
+ }
6072
6481
  }
6073
6482
  ServiceOrderComponent.FLOAT_BUTTON_RIGHT_POSITION_WITHOUT_SIDEBAR = 50;
6074
6483
  ServiceOrderComponent.FLOAT_BUTTON_RIGHT_POSITION_WITH_SIDEBAR = 350;
@@ -6077,6 +6486,7 @@ ServiceOrderComponent.decorators = [
6077
6486
  // eslint-disable-next-line @angular-eslint/component-selector
6078
6487
  selector: "service-order",
6079
6488
  template: `
6489
+ <transaction-manager></transaction-manager>
6080
6490
  <div id="transaction-general-tab" style="height:100%;">
6081
6491
  <transaction-header-block
6082
6492
  [relationId]="relationId"
@@ -6085,6 +6495,14 @@ ServiceOrderComponent.decorators = [
6085
6495
  (planningRequestButtonClick)="handlePlanningRequest($event)"
6086
6496
  ></transaction-header-block>
6087
6497
  <div *ngIf="!isService">
6498
+ <div style="display: flex; flex-direction: row; place-content: center">
6499
+ <co-input-text style="width: 200px;"
6500
+ [(model)]="newArticleNr"
6501
+ [placeholder]="'WHERE_ARE_YOU_LOOKING_FOR' | localize"
6502
+ [showClearButton]="true"
6503
+ (keypress)="addArticleLine($event)"
6504
+ ></co-input-text>
6505
+ </div>
6088
6506
  <div class="transaction-view" fxLayout="row" fxLayoutGap="1px" fxLayoutAlign="flex-end">
6089
6507
  <div class="view-mode-buttons">
6090
6508
  <co-button [iconData]="iconCacheService.getIcon(iconThickLines)"
@@ -6115,7 +6533,6 @@ ServiceOrderComponent.decorators = [
6115
6533
  </div>
6116
6534
  </div>
6117
6535
  <transaction-order-totals *ngIf="!isService"
6118
- [transactionTotal]="transactionTotal"
6119
6536
  [ngClass]="showTotals ? 'transaction-totals-show' : 'transaction-totals-hide'"></transaction-order-totals>
6120
6537
  </div>
6121
6538
 
@@ -6127,34 +6544,37 @@ ServiceOrderComponent.decorators = [
6127
6544
  ServiceOrderComponent.ctorParameters = () => [
6128
6545
  { type: TransactionService },
6129
6546
  { type: TransactionEventService },
6130
- { type: IconCacheService }
6547
+ { type: IconCacheService },
6548
+ { type: PromptService }
6131
6549
  ];
6132
6550
  ServiceOrderComponent.propDecorators = {
6133
- _transactionArticleTextComponent: [{ type: ViewChild, args: [TransactionArticleTextComponent, { static: false },] }]
6551
+ _transactionArticleTextComponent: [{ type: ViewChild, args: [TransactionArticleTextComponent,] }],
6552
+ _transactionManager: [{ type: ViewChild, args: [TransactionManagerComponent,] }]
6134
6553
  };
6135
6554
 
6136
- class TransactionOrderTotalsComponent /*extends TransactionBaseComponent*/ {
6555
+ class TransactionOrderTotalsComponent extends TransactionBaseComponent {
6137
6556
  constructor(service) {
6557
+ super(service);
6138
6558
  this.service = service;
6139
- //super(service);
6140
6559
  }
6141
6560
  }
6142
6561
  TransactionOrderTotalsComponent.decorators = [
6143
6562
  { type: Component, args: [{
6563
+ // eslint-disable-next-line @angular-eslint/component-selector
6144
6564
  selector: "transaction-order-totals",
6145
6565
  template: `
6146
6566
  <div class="totals-wrapper">
6147
6567
  <div class="totals-item">
6148
6568
  <div class="totals-item-description" [textContent]="'SUBTOTAL' | localize"></div>
6149
- <div class="totals-item-value" [textContent]="transactionTotal.grossAmount | coCurrency | coCurrency"></div>
6569
+ <div class="totals-item-value" [textContent]="transactionTotal?.grossAmount | coCurrency | coCurrency"></div>
6150
6570
  </div>
6151
6571
  <div class="totals-item">
6152
6572
  <div class="totals-item-description" [textContent]="'VAT_AMOUNT' | localize"></div>
6153
- <div class="totals-item-value" [textContent]="transactionTotal.surchargeAmount | coCurrency"></div>
6573
+ <div class="totals-item-value" [textContent]="transactionTotal?.surchargeAmount | coCurrency"></div>
6154
6574
  </div>
6155
6575
  <div class="totals-item total">
6156
6576
  <div class="totals-item-description" [textContent]="'TRANSACTION_SUM_I' | localize"></div>
6157
- <div class="totals-item-value" [textContent]="transactionTotal.netAmount | coCurrency"></div>
6577
+ <div class="totals-item-value" [textContent]="transactionTotal?.netAmount | coCurrency"></div>
6158
6578
  </div>
6159
6579
  </div>
6160
6580
  `,
@@ -6163,10 +6583,7 @@ TransactionOrderTotalsComponent.decorators = [
6163
6583
  ];
6164
6584
  TransactionOrderTotalsComponent.ctorParameters = () => [
6165
6585
  { type: TransactionService }
6166
- ];
6167
- TransactionOrderTotalsComponent.propDecorators = {
6168
- transactionTotal: [{ type: Input }]
6169
- };
6586
+ ];
6170
6587
 
6171
6588
  class TransactionOrderLineViewComponent {
6172
6589
  constructor(_service, _eventService) {
@@ -6228,7 +6645,7 @@ TransactionOrderLineViewComponent.decorators = [
6228
6645
  </div>
6229
6646
  </div>
6230
6647
  `,
6231
- styles: ["html,body{height:100%}body{margin:0;font-family:Roboto,\"Helvetica Neue\",sans-serif}.transaction-order-line-r .transaction-order-line-description .cart-line-description-artnr{font-size:10px}.flex-center{display:flex}.flex-center{flex-direction:row}.flex-center{align-items:center!important;justify-content:center!important}.transaction-order-line-r .transaction-order-line-description,.transaction-order-line-r .transaction-order-line-right .transaction-order-line-amount,.transaction-order-line-r .transaction-order-line-image,.transaction-order-line-r .transaction-order-line-right .transaction-order-line-stock,.transaction-order-line-r .transaction-order-line-right .transaction-order-line-totals{margin-top:20px}.transaction-order-line-r .transaction-order-line-description,.transaction-order-line-r .transaction-order-line-right .transaction-order-line-amount,.transaction-order-line-r .transaction-order-line-image,.transaction-order-line-r .transaction-order-line-right .transaction-order-line-stock,.transaction-order-line-r .transaction-order-line-right .transaction-order-line-totals{margin-bottom:20px}.transaction-order-line-r .transaction-order-line-description,.transaction-order-line-r .transaction-order-line-right .transaction-order-line-amount,.transaction-order-line-r .transaction-order-line-right .transaction-order-line-totals{margin-left:20px}.transaction-order-line-r .transaction-order-line-description,.transaction-order-line-r .transaction-order-line-right .transaction-order-line-amount{margin-right:20px}.triangle{border-radius:3px}.full-width{width:100%}.flex-center{margin:10px 0}:host{display:block;padding:20px}:host ::ng-deep collapseable{width:100%!important}.horizontal{display:flex;flex-direction:row}.service-request-button-wrapper{display:flex;justify-content:center;margin-top:20px}.transaction-order-line-r{display:flex;justify-content:stretch;flex-direction:row}@media (max-width: 800px){.transaction-order-line-r{flex-direction:column}}.transaction-order-line-r .transaction-order-line-image{display:flex;flex:1 0 auto!important;flex-direction:column;align-items:center;justify-content:center;padding-right:10px}.transaction-order-line-r .transaction-order-line-image image-display{width:6em;height:6em}.transaction-order-line-r .transaction-order-line-image ::ng-deep no-image-display{display:none}.transaction-order-line-r .transaction-order-line-description{display:flex;flex-direction:column;width:auto;max-width:355px;margin-left:10px}.transaction-order-line-r .transaction-order-line-description .cart-line-description-main{font-weight:bold}.transaction-order-line-r .transaction-order-line-right{justify-content:flex-end;align-items:center}.transaction-order-line-r .transaction-order-line-right .transaction-order-line-stock{width:10em}.transaction-order-line-r .transaction-order-line-right .transaction-order-line-amount{width:10em}.transaction-order-line-r .transaction-order-line-right .transaction-order-line-totals{display:flex;justify-content:flex-end;min-width:100px;font-weight:bold}.transaction-order-line-r .transaction-order-line-right .transaction-order-line-totals span{text-align:right}\n"]
6648
+ styles: ["html,body{height:100%}body{margin:0;font-family:Roboto,\"Helvetica Neue\",sans-serif}.transaction-order-line-r .transaction-order-line-description .cart-line-description-artnr{font-size:10px}.flex-center{display:flex}.flex-center{flex-direction:row}.flex-center{align-items:center!important;justify-content:center!important}.transaction-order-line-r .transaction-order-line-description,.transaction-order-line-r .transaction-order-line-right .transaction-order-line-amount,.transaction-order-line-r .transaction-order-line-image,.transaction-order-line-r .transaction-order-line-right .transaction-order-line-stock,.transaction-order-line-r .transaction-order-line-right .transaction-order-line-totals{margin-top:20px}.transaction-order-line-r .transaction-order-line-description,.transaction-order-line-r .transaction-order-line-right .transaction-order-line-amount,.transaction-order-line-r .transaction-order-line-image,.transaction-order-line-r .transaction-order-line-right .transaction-order-line-stock,.transaction-order-line-r .transaction-order-line-right .transaction-order-line-totals{margin-bottom:20px}.transaction-order-line-r .transaction-order-line-description,.transaction-order-line-r .transaction-order-line-right .transaction-order-line-amount,.transaction-order-line-r .transaction-order-line-right .transaction-order-line-totals{margin-left:20px}.transaction-order-line-r .transaction-order-line-description,.transaction-order-line-r .transaction-order-line-right .transaction-order-line-amount{margin-right:20px}.triangle{border-radius:3px}.full-width{width:100%}.flex-center{margin:10px 0}:host{display:block;padding:20px}:host ::ng-deep collapseable{width:100%!important}.horizontal{display:flex;flex-direction:row}.service-request-button-wrapper{display:flex;justify-content:center;margin-top:20px}.transaction-order-line-r{display:flex;justify-content:stretch;flex-direction:row}@media (max-width: 800px){.transaction-order-line-r{flex-direction:column}}.transaction-order-line-r .transaction-order-line-image{display:flex;flex:1 0 auto!important;flex-direction:column;align-items:center;justify-content:center;padding-right:10px}.transaction-order-line-r .transaction-order-line-image image-display{width:6em;height:6em}.transaction-order-line-r .transaction-order-line-image ::ng-deep no-image-display{display:none}.transaction-order-line-r .transaction-order-line-description{display:flex;flex-direction:column;width:auto;max-width:355px;margin-left:10px}.transaction-order-line-r .transaction-order-line-description .cart-line-description-main{font-weight:bold}.transaction-order-line-r .transaction-order-line-right{justify-content:flex-end;align-items:center}.transaction-order-line-r .transaction-order-line-right .transaction-order-line-stock{width:10em}.transaction-order-line-r .transaction-order-line-right .transaction-order-line-amount{width:15em}.transaction-order-line-r .transaction-order-line-right .transaction-order-line-totals{display:flex;justify-content:flex-end;min-width:100px;font-weight:bold}.transaction-order-line-r .transaction-order-line-right .transaction-order-line-totals span{text-align:right}\n"]
6232
6649
  },] }
6233
6650
  ];
6234
6651
  TransactionOrderLineViewComponent.ctorParameters = () => [
@@ -6292,7 +6709,7 @@ TransactionOrderLinesComponent.decorators = [
6292
6709
  (rowsSelected)="onRowClick($event)"
6293
6710
  ></co-grid>
6294
6711
  `,
6295
- styles: ["html,body{height:100%}body{margin:0;font-family:Roboto,\"Helvetica Neue\",sans-serif}.transaction-order-line-r .transaction-order-line-description .cart-line-description-artnr{font-size:10px}.flex-center{display:flex}.flex-center{flex-direction:row}.flex-center{align-items:center!important;justify-content:center!important}.transaction-order-line-r .transaction-order-line-description,.transaction-order-line-r .transaction-order-line-right .transaction-order-line-amount,.transaction-order-line-r .transaction-order-line-image,.transaction-order-line-r .transaction-order-line-right .transaction-order-line-stock,.transaction-order-line-r .transaction-order-line-right .transaction-order-line-totals{margin-top:20px}.transaction-order-line-r .transaction-order-line-description,.transaction-order-line-r .transaction-order-line-right .transaction-order-line-amount,.transaction-order-line-r .transaction-order-line-image,.transaction-order-line-r .transaction-order-line-right .transaction-order-line-stock,.transaction-order-line-r .transaction-order-line-right .transaction-order-line-totals{margin-bottom:20px}.transaction-order-line-r .transaction-order-line-description,.transaction-order-line-r .transaction-order-line-right .transaction-order-line-amount,.transaction-order-line-r .transaction-order-line-right .transaction-order-line-totals{margin-left:20px}.transaction-order-line-r .transaction-order-line-description,.transaction-order-line-r .transaction-order-line-right .transaction-order-line-amount{margin-right:20px}.triangle{border-radius:3px}.full-width{width:100%}.flex-center{margin:10px 0}:host{display:block;padding:20px}:host ::ng-deep collapseable{width:100%!important}.service-request-button-wrapper{display:flex;justify-content:center;margin-top:20px}.transaction-order-line-r{display:flex;justify-content:stretch;flex-direction:row}@media (max-width: 800px){.transaction-order-line-r{flex-direction:column}}.transaction-order-line-r .transaction-order-line-image{display:flex;flex:1 0 auto!important;flex-direction:column;align-items:center;justify-content:center;padding-right:10px}.transaction-order-line-r .transaction-order-line-image image-display{width:6em;height:6em}.transaction-order-line-r .transaction-order-line-image ::ng-deep no-image-display{display:none}.transaction-order-line-r .transaction-order-line-description{display:flex;flex-direction:column;width:auto;max-width:355px;margin-left:10px}.transaction-order-line-r .transaction-order-line-description .cart-line-description-main{font-weight:bold}.transaction-order-line-r .transaction-order-line-right{justify-content:flex-end;align-items:center}.transaction-order-line-r .transaction-order-line-right .transaction-order-line-stock{width:10em}.transaction-order-line-r .transaction-order-line-right .transaction-order-line-amount{width:10em}.transaction-order-line-r .transaction-order-line-right .transaction-order-line-totals{display:flex;justify-content:flex-end;min-width:100px;font-weight:bold}.transaction-order-line-r .transaction-order-line-right .transaction-order-line-totals span{text-align:right}\n"]
6712
+ styles: ["html,body{height:100%}body{margin:0;font-family:Roboto,\"Helvetica Neue\",sans-serif}.transaction-order-line-r .transaction-order-line-description .cart-line-description-artnr{font-size:10px}.flex-center{display:flex}.flex-center{flex-direction:row}.flex-center{align-items:center!important;justify-content:center!important}.transaction-order-line-r .transaction-order-line-description,.transaction-order-line-r .transaction-order-line-right .transaction-order-line-amount,.transaction-order-line-r .transaction-order-line-image,.transaction-order-line-r .transaction-order-line-right .transaction-order-line-stock,.transaction-order-line-r .transaction-order-line-right .transaction-order-line-totals{margin-top:20px}.transaction-order-line-r .transaction-order-line-description,.transaction-order-line-r .transaction-order-line-right .transaction-order-line-amount,.transaction-order-line-r .transaction-order-line-image,.transaction-order-line-r .transaction-order-line-right .transaction-order-line-stock,.transaction-order-line-r .transaction-order-line-right .transaction-order-line-totals{margin-bottom:20px}.transaction-order-line-r .transaction-order-line-description,.transaction-order-line-r .transaction-order-line-right .transaction-order-line-amount,.transaction-order-line-r .transaction-order-line-right .transaction-order-line-totals{margin-left:20px}.transaction-order-line-r .transaction-order-line-description,.transaction-order-line-r .transaction-order-line-right .transaction-order-line-amount{margin-right:20px}.triangle{border-radius:3px}.full-width{width:100%}.flex-center{margin:10px 0}:host{display:block;padding:20px}:host ::ng-deep collapseable{width:100%!important}.service-request-button-wrapper{display:flex;justify-content:center;margin-top:20px}.transaction-order-line-r{display:flex;justify-content:stretch;flex-direction:row}@media (max-width: 800px){.transaction-order-line-r{flex-direction:column}}.transaction-order-line-r .transaction-order-line-image{display:flex;flex:1 0 auto!important;flex-direction:column;align-items:center;justify-content:center;padding-right:10px}.transaction-order-line-r .transaction-order-line-image image-display{width:6em;height:6em}.transaction-order-line-r .transaction-order-line-image ::ng-deep no-image-display{display:none}.transaction-order-line-r .transaction-order-line-description{display:flex;flex-direction:column;width:auto;max-width:355px;margin-left:10px}.transaction-order-line-r .transaction-order-line-description .cart-line-description-main{font-weight:bold}.transaction-order-line-r .transaction-order-line-right{justify-content:flex-end;align-items:center}.transaction-order-line-r .transaction-order-line-right .transaction-order-line-stock{width:10em}.transaction-order-line-r .transaction-order-line-right .transaction-order-line-amount{width:15em}.transaction-order-line-r .transaction-order-line-right .transaction-order-line-totals{display:flex;justify-content:flex-end;min-width:100px;font-weight:bold}.transaction-order-line-r .transaction-order-line-right .transaction-order-line-totals span{text-align:right}\n"]
6296
6713
  },] }
6297
6714
  ];
6298
6715
  TransactionOrderLinesComponent.ctorParameters = () => [
@@ -7011,9 +7428,9 @@ TransactionServiceSummaryComponent.decorators = [
7011
7428
  label="SERVICE"
7012
7429
  [icon]="iconWrench"
7013
7430
  headerLabel="SERVICE_NUMBER"
7014
- [headerValue]="transactionInfo.transactionNr"
7431
+ [headerValue]="transactionInfo?.transactionNr"
7015
7432
  subHeaderLabel="SERVICE_REQUEST_DATE"
7016
- [subHeaderValue]="transactionInfo.transactionDate | date:'shortDate'"
7433
+ [subHeaderValue]="transactionInfo?.transactionDate | date:'shortDate'"
7017
7434
  ></transaction-summary-block>
7018
7435
  `
7019
7436
  },] }
@@ -7135,9 +7552,9 @@ TransactionOrderSummaryComponent.decorators = [
7135
7552
  label="ORDER_INFO"
7136
7553
  [icon]="iconOrder"
7137
7554
  headerLabel="ORDER_NUMBER"
7138
- [headerValue]="isService ? sourceTransactionNr : transactionInfo.transactionNr"
7555
+ [headerValue]="isService ? sourceTransactionNr : transactionInfo?.transactionNr"
7139
7556
  subHeaderLabel="ORDER_DATE"
7140
- [subHeaderValue]="(isService ? sourceTransactionDate : this.transactionInfo.transactionDate) | date:'shortDate'"
7557
+ [subHeaderValue]="(isService ? sourceTransactionDate : this.transactionInfo?.transactionDate) | date:'shortDate'"
7141
7558
  ></transaction-summary-block>
7142
7559
  `
7143
7560
  },] }
@@ -7166,9 +7583,9 @@ TransactionPaymentInfoComponent.decorators = [
7166
7583
  label="PAYMENT"
7167
7584
  [icon]="euro"
7168
7585
  headerLabel="TOTAL_AMOUNT"
7169
- [headerValue]="transactionTotal.netAmount | coCurrency"
7586
+ [headerValue]="transactionTotal?.netAmount | coCurrency"
7170
7587
  subHeaderLabel="PAID_DOWN2"
7171
- [subHeaderValue]="transactionTotal.transactionDiscountAmount | coCurrency"
7588
+ [subHeaderValue]="transactionTotal?.transactionDiscountAmount | coCurrency"
7172
7589
  ></transaction-summary-block>
7173
7590
  `
7174
7591
  },] }
@@ -7258,12 +7675,12 @@ TransactionDeliverySummaryComponent.decorators = [
7258
7675
  [icon]="deliveryTruck"
7259
7676
  headerLabel="DELIVERY_METHOD2"
7260
7677
  [headerValue]="deliveryMethodDescription"
7261
- [subHeaderLabel]="transactionInfo.preferredDeliveryDate ? 'DELIVERY_DATE' : !canPlanDelivery ? 'EXPECTED_DELIVERY_WEEK' : 'EXPECTED_DELIVERY'"
7262
- [subHeaderValue]="transactionInfo.preferredDeliveryDate ? (transactionInfo.deliveryDate | date:'shortDate') : 'WEEK' | localize | append:(' ') | append:(transactionInfo.deliveryDate | date:'w')">
7678
+ [subHeaderLabel]="transactionInfo?.preferredDeliveryDate ? 'DELIVERY_DATE' : !canPlanDelivery ? 'EXPECTED_DELIVERY_WEEK' : 'EXPECTED_DELIVERY'"
7679
+ [subHeaderValue]="transactionInfo?.preferredDeliveryDate ? (transactionInfo?.deliveryDate | date:'shortDate') : 'WEEK' | localize | append:(' ') | append:(transactionInfo?.deliveryDate | date:'w')">
7263
7680
  <ng-template #subHeaderTemplate *ngIf="canPlanDelivery">
7264
7681
  <div class="planning-wrapper">
7265
- <span class="subheader" *ngIf="transactionInfo.preferredDeliveryDate"
7266
- [textContent]="(transactionInfo.preferredDeliveryDate | date:'shortDate') + ', ' + transactionInfo.preferredDeliveryDate | date: 'time' "></span>
7682
+ <span class="subheader" *ngIf="transactionInfo?.preferredDeliveryDate"
7683
+ [textContent]="(transactionInfo?.preferredDeliveryDate | date:'shortDate') + ', ' + transactionInfo?.preferredDeliveryDate | date: 'time' "></span>
7267
7684
  <!-- <arrow-link *ngIf="!transactionInfo.preferredDeliveryDate"-->
7268
7685
  <!-- label="PLAN_YOUR_DELIVERY"-->
7269
7686
  <!-- (click)="planningRequestButtonClick.emit($event)"-->
@@ -7464,12 +7881,141 @@ DefaultOkCancelButtonsComponent.propDecorators = {
7464
7881
  okButtonComp: [{ type: ViewChild, args: ["okButton",] }]
7465
7882
  };
7466
7883
 
7884
+ class WarehouseComponent {
7885
+ constructor(service, _dictionaryService) {
7886
+ this.service = service;
7887
+ this._dictionaryService = _dictionaryService;
7888
+ this.message = "";
7889
+ this.okClick = new EventEmitter();
7890
+ this.cancelClick = new EventEmitter();
7891
+ this.commissionCodes = [];
7892
+ this.commissionFields = { text: "description", value: "code" };
7893
+ this.transactionArticleWarehouses = [];
7894
+ this.columns = [];
7895
+ this._okOrCancelClick = false;
7896
+ }
7897
+ ngOnInit() {
7898
+ return __awaiter(this, void 0, void 0, function* () {
7899
+ this.commissionCodes = yield this.service.getCommissionCodes("NL");
7900
+ this.columns.push({ field: "warehouseNr", headerText: this._dictionaryService.get("WAREHOUSE"), allowFiltering: false }, { field: "warehouseDesc", headerText: this._dictionaryService.get("DESCRIPTION") }, { field: "stockAmount", headerText: this._dictionaryService.get("STOCK") });
7901
+ });
7902
+ }
7903
+ ngOnDestroy() {
7904
+ this.warehouseDialog.close();
7905
+ }
7906
+ showStockManager(line) {
7907
+ return __awaiter(this, void 0, void 0, function* () {
7908
+ this.selectedWarehouseNr = line.warehouseNumber;
7909
+ this.amount = line.amount;
7910
+ this.commissionCode = line.commissionCode;
7911
+ this.show(line.articleNumber);
7912
+ });
7913
+ }
7914
+ hide() {
7915
+ return __awaiter(this, void 0, void 0, function* () {
7916
+ if (this._okOrCancelClick) {
7917
+ this._okOrCancelClick = false;
7918
+ return;
7919
+ }
7920
+ yield this.onStockManagerCancelClick();
7921
+ });
7922
+ }
7923
+ show(articleNr) {
7924
+ this._reloadDataCollections(articleNr).then();
7925
+ this.warehouseGrid.selectRow(this.selectedWarehouseNr);
7926
+ this.warehouseDialog.targetElement = null;
7927
+ this.warehouseDialog.open();
7928
+ }
7929
+ handleRowsSelected(rows) {
7930
+ this.selectedWarehouseNr = (rows.find(x => x !== undefined)).warehouseNr;
7931
+ }
7932
+ onStockManagerCancelClick() {
7933
+ return __awaiter(this, void 0, void 0, function* () {
7934
+ this._okOrCancelClick = true;
7935
+ this.warehouseDialog.close();
7936
+ this.cancelClick.emit();
7937
+ });
7938
+ }
7939
+ onStockManagerOkClick() {
7940
+ return __awaiter(this, void 0, void 0, function* () {
7941
+ this._okOrCancelClick = true;
7942
+ this.warehouseDialog.close();
7943
+ this.okClick.emit();
7944
+ });
7945
+ }
7946
+ _reloadDataCollections(articleNr) {
7947
+ return __awaiter(this, void 0, void 0, function* () {
7948
+ const goodId = yield this.service.getGoodIdFromArticleNr(articleNr);
7949
+ this.transactionArticleWarehouses = yield this.service.getTransactionArticleWarehouses(goodId);
7950
+ });
7951
+ }
7952
+ }
7953
+ WarehouseComponent.decorators = [
7954
+ { type: Component, args: [{
7955
+ // eslint-disable-next-line @angular-eslint/component-selector
7956
+ selector: "warehouse",
7957
+ template: `
7958
+ <co-dialog #warehouseDialog
7959
+ (closeClick)="hide()"
7960
+ (overlayClick)="onStockManagerCancelClick()"
7961
+ >
7962
+ <ng-container header>{{ 'STOCK_NOTIFICATION' | localize }}</ng-container>
7963
+
7964
+ <ng-container content>
7965
+ <co-form>
7966
+ <div class="form-content">
7967
+ <span *ngIf="message" class="message-field" [textContent]="message | localize"></span>
7968
+ <div class="commission-fields" fxLayout="row">
7969
+ <co-input-number-picker class="horizontal" [(model)]="amount" [min]="0" decimals="3"></co-input-number-picker>
7970
+ <co-input-combo-box [(model)]="commissionCode"
7971
+ [source]="commissionCodes"
7972
+ [fields]="commissionFields"
7973
+ [placeholder]="'COMMISSION_CODE' | localize"
7974
+ [required]="true"
7975
+ ></co-input-combo-box>
7976
+ </div>
7977
+ <div>
7978
+ <co-grid #warehouseGrid
7979
+ [data]="transactionArticleWarehouses"
7980
+ [columns]="columns"
7981
+ [pagingEnabled]="'true'"
7982
+ [maxNumberOfRows]="'10'"
7983
+ (rowsSelected)="handleRowsSelected($event)"
7984
+ ></co-grid>
7985
+ </div>
7986
+ </div>
7987
+ </co-form>
7988
+ </ng-container>
7989
+
7990
+ <ng-container footer>
7991
+ <div class="flex-center">
7992
+ <co-button [label]="'OK' | localize" (click)="onStockManagerOkClick()"></co-button>
7993
+ <co-button [label]="'CANCEL' | localize" (click)="onStockManagerCancelClick()"></co-button>
7994
+ </div>
7995
+ </ng-container>
7996
+ </co-dialog>
7997
+ `,
7998
+ providers: [DictionaryService],
7999
+ styles: ["html,body{height:100%}body{margin:0;font-family:Roboto,\"Helvetica Neue\",sans-serif}.flex-center,.warehouse-line-container{display:flex}.flex-center,.warehouse-line-container{flex-direction:row}.flex-center{align-items:center!important;justify-content:center!important}::ng-deep #warehouseDialog ::ng-deep .form-content .message-field,.commission-fields{margin-left:11px}.triangle{border-radius:3px}.full-width{width:100%}.flex-center{margin:10px 0}::ng-deep #warehouseDialog{align-items:center;max-height:100%}::ng-deep #warehouseDialog ::ng-deep co-form{height:100%;width:500px}::ng-deep #warehouseDialog ::ng-deep .form-content{height:calc(100% - 80px);width:100%}::ng-deep #warehouseDialog ::ng-deep .form-content .message-field{height:20px;word-wrap:break-word;white-space:normal}co-button:not(:last-child){margin-right:10px}.commission-fields{justify-content:space-between;margin:10px 0}.warehouse-description-item{width:15rem}.warehouse-nr-item{width:5rem}co-input-number-picker co-button{max-width:20px}\n"]
8000
+ },] }
8001
+ ];
8002
+ WarehouseComponent.ctorParameters = () => [
8003
+ { type: TransactionService },
8004
+ { type: DictionaryService }
8005
+ ];
8006
+ WarehouseComponent.propDecorators = {
8007
+ warehouseDialog: [{ type: ViewChild, args: ["warehouseDialog",] }],
8008
+ warehouseGrid: [{ type: ViewChild, args: ["warehouseGrid",] }],
8009
+ message: [{ type: Input }],
8010
+ okClick: [{ type: Output }],
8011
+ cancelClick: [{ type: Output }]
8012
+ };
8013
+
7467
8014
  class IoneServiceOrderModule {
7468
8015
  }
7469
8016
  IoneServiceOrderModule.decorators = [
7470
8017
  { type: NgModule, args: [{
7471
8018
  imports: [
7472
- BrowserAnimationsModule,
7473
8019
  IconModule,
7474
8020
  InputTextModule,
7475
8021
  InputCheckboxModule,
@@ -7487,13 +8033,15 @@ IoneServiceOrderModule.decorators = [
7487
8033
  PopupModule.forRoot(),
7488
8034
  CoSidebarModule,
7489
8035
  CoGridModule,
7490
- CoreModule,
7491
8036
  ChipListModule,
7492
8037
  DropDownButtonModule,
7493
8038
  CheckBoxModule,
7494
8039
  DropDownListModule,
7495
8040
  IoneShoppingCartModule,
7496
8041
  TabModule,
8042
+ CoreModule,
8043
+ CommonModule,
8044
+ // RichTextEditorModule
7497
8045
  ],
7498
8046
  declarations: [
7499
8047
  TemplateWrapperDirective,
@@ -7518,11 +8066,13 @@ IoneServiceOrderModule.decorators = [
7518
8066
  TransactionDeliverySummaryComponent,
7519
8067
  TransactionProductContractSummaryComponent,
7520
8068
  TransactionProductSummaryComponent,
8069
+ TransactionManagerComponent,
8070
+ WarehouseComponent,
7521
8071
  ],
7522
8072
  providers: [
7523
8073
  DictionaryService,
7524
8074
  TransactionService,
7525
- OptionsService
8075
+ OptionsService,
7526
8076
  ],
7527
8077
  entryComponents: [
7528
8078
  IoneServiceOrderComponent
@@ -7538,5 +8088,5 @@ IoneServiceOrderModule.decorators = [
7538
8088
  * Generated bundle index. Do not edit.
7539
8089
  */
7540
8090
 
7541
- export { IoneCheckoutComponent, IoneCheckoutModule, IoneServiceOrderComponent, IoneServiceOrderModule, IoneShoppingCartComponent, IoneShoppingCartModule, RetailTransactionCheckoutComponent as ɵa, CheckoutComponent as ɵb, ShoppingCartManagerComponent as ɵba, ShoppingCartComponent as ɵbb, ShoppingCartLineComponent as ɵbc, StockStatusIndicatorComponent as ɵbd, CharacteristicAnswerComponent as ɵbe, TemplateWrapperDirective as ɵbf, DefaultOkCancelButtonsComponent as ɵbg, ServiceOrderComponent as ɵbh, TransactionBaseComponent as ɵbi, TransactionArticleTextComponent as ɵbj, TransactionOrderTotalsComponent as ɵbk, TransactionOrderLineViewComponent as ɵbl, TransactionOrderLinesComponent as ɵbm, TransactionRelationAddressComponent as ɵbn, TransactionSidebarRightComponent as ɵbo, TransactionLineAccordionComponent as ɵbp, TransactionHeaderBlockComponent as ɵbq, TransactionRelationEditComponent as ɵbr, TransactionServiceSummaryComponent as ɵbs, TransactionSummaryBlockComponent as ɵbt, TransactionServiceStatusComponent as ɵbu, TransactionOrderSummaryComponent as ɵbv, TransactionPaymentInfoComponent as ɵbw, TransactionArticleSummaryComponent as ɵbx, TransactionDeliverySummaryComponent as ɵby, TransactionProductContractSummaryComponent as ɵbz, CheckoutOverviewComponent as ɵc, TransactionProductSummaryComponent as ɵca, CheckoutOverviewBlockComponent as ɵd, CheckoutOverviewRelationEditComponent as ɵe, TransactionService as ɵf, IOneConnectorAdapterService as ɵg, CheckoutOverviewDeliveryEditComponent as ɵh, DictionaryService as ɵi, CheckoutLoginComponent as ɵj, OptionsService as ɵk, TransactionEventService as ɵl, CoreModule as ɵm, AppendPipe as ɵn, DeliveryTimePipe as ɵo, DateDurationPipe as ɵp, LocalizePipe as ɵq, CoCurrencyPipe as ɵr, SafeStylePipe as ɵs, ImageDisplayComponent as ɵt, NoImageDisplayComponent as ɵu, IconComponent as ɵv, CheckoutOverviewRelationAddressComponent as ɵw, CheckoutOverviewDeliveryAddressComponent as ɵx, CheckOutRelationSuggestionsListComponent as ɵy, CheckOutRelationSuggestionsListItemComponent as ɵz };
8091
+ export { IoneCheckoutComponent, IoneCheckoutModule, IoneServiceOrderComponent, IoneServiceOrderModule, IoneShoppingCartComponent, IoneShoppingCartModule, RetailTransactionCheckoutComponent as ɵa, CheckoutComponent as ɵb, ShoppingCartManagerComponent as ɵba, ShoppingCartComponent as ɵbb, ShoppingCartLineComponent as ɵbc, StockStatusIndicatorComponent as ɵbd, CharacteristicAnswerComponent as ɵbe, TemplateWrapperDirective as ɵbf, DefaultOkCancelButtonsComponent as ɵbg, ServiceOrderComponent as ɵbh, TransactionBaseComponent as ɵbi, TransactionArticleTextComponent as ɵbj, TransactionManagerComponent as ɵbk, TransactionOrderTotalsComponent as ɵbl, TransactionOrderLineViewComponent as ɵbm, TransactionOrderLinesComponent as ɵbn, TransactionRelationAddressComponent as ɵbo, TransactionSidebarRightComponent as ɵbp, TransactionLineAccordionComponent as ɵbq, TransactionHeaderBlockComponent as ɵbr, TransactionRelationEditComponent as ɵbs, TransactionServiceSummaryComponent as ɵbt, TransactionSummaryBlockComponent as ɵbu, TransactionServiceStatusComponent as ɵbv, TransactionOrderSummaryComponent as ɵbw, TransactionPaymentInfoComponent as ɵbx, TransactionArticleSummaryComponent as ɵby, TransactionDeliverySummaryComponent as ɵbz, CheckoutOverviewComponent as ɵc, TransactionProductContractSummaryComponent as ɵca, TransactionProductSummaryComponent as ɵcb, WarehouseComponent as ɵcc, CheckoutOverviewBlockComponent as ɵd, CheckoutOverviewRelationEditComponent as ɵe, TransactionService as ɵf, IOneConnectorAdapterService as ɵg, CheckoutOverviewDeliveryEditComponent as ɵh, DictionaryService as ɵi, CheckoutLoginComponent as ɵj, OptionsService as ɵk, TransactionEventService as ɵl, CoreModule as ɵm, AppendPipe as ɵn, DeliveryTimePipe as ɵo, DateDurationPipe as ɵp, LocalizePipe as ɵq, CoCurrencyPipe as ɵr, SafeStylePipe as ɵs, ImageDisplayComponent as ɵt, NoImageDisplayComponent as ɵu, IconComponent as ɵv, CheckoutOverviewRelationAddressComponent as ɵw, CheckoutOverviewDeliveryAddressComponent as ɵx, CheckOutRelationSuggestionsListComponent as ɵy, CheckOutRelationSuggestionsListItemComponent as ɵz };
7542
8092
  //# sourceMappingURL=colijnit-transaction.js.map