@colijnit/transaction 12.1.2 → 12.1.3
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.
- package/app/component/core/base/transaction-base.component.d.ts +10 -0
- package/app/component/{shopping-cart → core}/characteristic-answer/characteristic-answer.component.d.ts +0 -0
- package/app/component/core/warehouse/warehouse.component.d.ts +35 -0
- package/app/component/service-order/service-order.component.d.ts +9 -4
- package/app/component/service-order/transaction-manager/transaction-manager.component.d.ts +63 -0
- package/app/component/shopping-cart/shopping-cart-manager/shopping-cart-manager.component.d.ts +1 -1
- package/app/service/transaction.service.d.ts +14 -8
- package/bundles/colijnit-transaction.umd.js +850 -115
- package/bundles/colijnit-transaction.umd.js.map +1 -1
- package/colijnit-transaction.d.ts +20 -18
- package/colijnit-transaction.metadata.json +1 -1
- package/esm2015/app/component/core/base/transaction-base.component.js +35 -12
- package/esm2015/app/component/core/characteristic-answer/characteristic-answer.component.js +100 -0
- package/esm2015/app/component/core/warehouse/warehouse.component.js +133 -0
- package/esm2015/app/component/service-order/ione-service-order-module.js +7 -2
- package/esm2015/app/component/service-order/service-order.component.js +35 -6
- package/esm2015/app/component/service-order/transaction-article-text/transaction-article-text.component.js +16 -5
- package/esm2015/app/component/service-order/transaction-manager/transaction-manager.component.js +305 -0
- package/esm2015/app/component/shopping-cart/ione-shopping-cart.module.js +3 -3
- package/esm2015/app/component/shopping-cart/shopping-cart-manager/shopping-cart-manager.component.js +1 -1
- package/esm2015/app/service/transaction.service.js +72 -23
- package/esm2015/assets/dictionary/text.properties.js +5 -1
- package/esm2015/colijnit-transaction.js +21 -19
- package/fesm2015/colijnit-transaction.js +584 -45
- package/fesm2015/colijnit-transaction.js.map +1 -1
- package/package.json +1 -1
- package/esm2015/app/component/shopping-cart/characteristic-answer/characteristic-answer.component.js +0 -99
|
@@ -35,13 +35,13 @@ 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
47
|
import { FlexModule } from '@angular/flex-layout';
|
|
@@ -1317,8 +1317,9 @@ IOneConnectorAdapterService.decorators = [
|
|
|
1317
1317
|
IOneConnectorAdapterService.ctorParameters = () => [];
|
|
1318
1318
|
|
|
1319
1319
|
class TransactionService {
|
|
1320
|
-
constructor(_connector) {
|
|
1320
|
+
constructor(_connector, _prompt) {
|
|
1321
1321
|
this._connector = _connector;
|
|
1322
|
+
this._prompt = _prompt;
|
|
1322
1323
|
this.transactionUpdated = new EventEmitter();
|
|
1323
1324
|
this.transactionLoaded = new EventEmitter();
|
|
1324
1325
|
this.applicationUser = false;
|
|
@@ -1364,6 +1365,11 @@ class TransactionService {
|
|
|
1364
1365
|
&& line.pendingReasonType !== PendingReasonType.NON_CRITICAL_DISCONTINUATION);
|
|
1365
1366
|
return status;
|
|
1366
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
|
+
}
|
|
1367
1373
|
getArticleFullObject(goodId) {
|
|
1368
1374
|
return __awaiter(this, void 0, void 0, function* () {
|
|
1369
1375
|
return yield this._connector.getArticleFullObject(goodId);
|
|
@@ -1444,11 +1450,10 @@ class TransactionService {
|
|
|
1444
1450
|
});
|
|
1445
1451
|
});
|
|
1446
1452
|
}
|
|
1447
|
-
resolvePendingLineReason(pendingLineValues) {
|
|
1453
|
+
resolvePendingLineReason(pendingLineValues, remember = true) {
|
|
1448
1454
|
return new Promise((resolve) => {
|
|
1449
1455
|
this._connector.resolvePendingLineReason(pendingLineValues).then((response) => __awaiter(this, void 0, void 0, function* () {
|
|
1450
|
-
this.
|
|
1451
|
-
this._rememberCurrentTransactionLineStatus(response);
|
|
1456
|
+
this._rememberResponse(remember, response);
|
|
1452
1457
|
resolve(response);
|
|
1453
1458
|
})).catch((reason) => {
|
|
1454
1459
|
resolve();
|
|
@@ -1502,6 +1507,28 @@ class TransactionService {
|
|
|
1502
1507
|
}
|
|
1503
1508
|
});
|
|
1504
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
|
+
}
|
|
1505
1532
|
addRelationToTransaction(relationId) {
|
|
1506
1533
|
return __awaiter(this, void 0, void 0, function* () {
|
|
1507
1534
|
const success = yield this._connector.addRelationToTransaction(this._currentTransaction.uuid, relationId);
|
|
@@ -1615,13 +1642,29 @@ class TransactionService {
|
|
|
1615
1642
|
});
|
|
1616
1643
|
});
|
|
1617
1644
|
}
|
|
1618
|
-
|
|
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) {
|
|
1619
1663
|
return __awaiter(this, void 0, void 0, function* () {
|
|
1620
1664
|
return new Promise((resolve, reject) => {
|
|
1621
1665
|
this._connector.addTransactionLine(this.currentTransaction.uuid, lineType, articleNo, amount, warehouseNo, commissionCode, isReturn, aboveLineNr, belowLineNr)
|
|
1622
1666
|
.then((response) => __awaiter(this, void 0, void 0, function* () {
|
|
1623
|
-
this.
|
|
1624
|
-
this._rememberCurrentTransactionLineStatus(response);
|
|
1667
|
+
this._rememberResponse(remember, response);
|
|
1625
1668
|
resolve(response);
|
|
1626
1669
|
}), (error) => {
|
|
1627
1670
|
reject(error);
|
|
@@ -1632,13 +1675,12 @@ class TransactionService {
|
|
|
1632
1675
|
});
|
|
1633
1676
|
});
|
|
1634
1677
|
}
|
|
1635
|
-
addTextLineToTransaction(showOnDocuments, text, amount, articleBound, refArticleLineNr, aboveLineNr, belowLineNr) {
|
|
1678
|
+
addTextLineToTransaction(showOnDocuments, text, amount, articleBound, refArticleLineNr, aboveLineNr, belowLineNr, remember = true) {
|
|
1636
1679
|
return __awaiter(this, void 0, void 0, function* () {
|
|
1637
1680
|
return new Promise((resolve, reject) => {
|
|
1638
1681
|
this._connector.addTextLineToTransaction(this.currentTransaction.uuid, showOnDocuments, text, amount, articleBound, refArticleLineNr, aboveLineNr, belowLineNr)
|
|
1639
1682
|
.then((response) => __awaiter(this, void 0, void 0, function* () {
|
|
1640
|
-
this.
|
|
1641
|
-
this._rememberCurrentTransactionLineStatus(response);
|
|
1683
|
+
this._rememberResponse(remember, response);
|
|
1642
1684
|
resolve(response);
|
|
1643
1685
|
}), (error) => {
|
|
1644
1686
|
reject(error);
|
|
@@ -1649,12 +1691,11 @@ class TransactionService {
|
|
|
1649
1691
|
});
|
|
1650
1692
|
});
|
|
1651
1693
|
}
|
|
1652
|
-
changeLineSequence(lineUuid, aboveLineNr, belowLineNr) {
|
|
1694
|
+
changeLineSequence(lineUuid, aboveLineNr, belowLineNr, remember = true) {
|
|
1653
1695
|
return new Promise((resolve, reject) => {
|
|
1654
1696
|
this._connector.changeLineSequence(this.currentTransaction.uuid, lineUuid, aboveLineNr, belowLineNr)
|
|
1655
1697
|
.then((response) => __awaiter(this, void 0, void 0, function* () {
|
|
1656
|
-
this.
|
|
1657
|
-
this._rememberCurrentTransactionLineStatus(response);
|
|
1698
|
+
this._rememberResponse(remember, response);
|
|
1658
1699
|
resolve(response);
|
|
1659
1700
|
}), (error) => {
|
|
1660
1701
|
reject(error);
|
|
@@ -1664,12 +1705,14 @@ class TransactionService {
|
|
|
1664
1705
|
});
|
|
1665
1706
|
});
|
|
1666
1707
|
}
|
|
1667
|
-
cancelAddTransactionLine(lineUuid) {
|
|
1708
|
+
cancelAddTransactionLine(lineUuid, remember = true) {
|
|
1668
1709
|
return __awaiter(this, void 0, void 0, function* () {
|
|
1669
1710
|
return new Promise((resolve, reject) => {
|
|
1670
1711
|
this._connector.cancelAddTransactionLine(lineUuid)
|
|
1671
1712
|
.then((response) => __awaiter(this, void 0, void 0, function* () {
|
|
1672
|
-
|
|
1713
|
+
if (remember) {
|
|
1714
|
+
this._rememberCurrentTransaction(response);
|
|
1715
|
+
}
|
|
1673
1716
|
if (response.isSuccess) {
|
|
1674
1717
|
resolve(response);
|
|
1675
1718
|
}
|
|
@@ -1683,13 +1726,12 @@ class TransactionService {
|
|
|
1683
1726
|
});
|
|
1684
1727
|
});
|
|
1685
1728
|
}
|
|
1686
|
-
deleteTransactionLine(transactionUuid, TransactionLineUuid) {
|
|
1729
|
+
deleteTransactionLine(transactionUuid, TransactionLineUuid, remember = true) {
|
|
1687
1730
|
return __awaiter(this, void 0, void 0, function* () {
|
|
1688
1731
|
return new Promise((resolve, reject) => {
|
|
1689
1732
|
this._connector.deleteTransactionLine(transactionUuid, TransactionLineUuid)
|
|
1690
1733
|
.then((response) => __awaiter(this, void 0, void 0, function* () {
|
|
1691
|
-
this.
|
|
1692
|
-
this._rememberCurrentTransactionLineStatus(response);
|
|
1734
|
+
this._rememberResponse(remember, response);
|
|
1693
1735
|
if (response.isSuccess) {
|
|
1694
1736
|
resolve(response);
|
|
1695
1737
|
}
|
|
@@ -1703,14 +1745,13 @@ class TransactionService {
|
|
|
1703
1745
|
});
|
|
1704
1746
|
});
|
|
1705
1747
|
}
|
|
1706
|
-
changeTransactionLineQuantity(lineUuid, newQuantity) {
|
|
1748
|
+
changeTransactionLineQuantity(lineUuid, newQuantity, remember = true) {
|
|
1707
1749
|
return __awaiter(this, void 0, void 0, function* () {
|
|
1708
1750
|
return new Promise((resolve) => {
|
|
1709
1751
|
this._connector.changeTransactionLineQuantity(this.currentTransaction.uuid, lineUuid, newQuantity)
|
|
1710
1752
|
.then((response) => __awaiter(this, void 0, void 0, function* () {
|
|
1711
1753
|
if (response.isSuccess) {
|
|
1712
|
-
this.
|
|
1713
|
-
this._rememberCurrentTransactionLineStatus(response);
|
|
1754
|
+
this._rememberResponse(remember, response);
|
|
1714
1755
|
}
|
|
1715
1756
|
resolve(response);
|
|
1716
1757
|
})).catch((reason) => {
|
|
@@ -1791,12 +1832,19 @@ class TransactionService {
|
|
|
1791
1832
|
transactionDeliveryOptionsRequest.invoiceAddress = this._currentTransaction.invoiceAddress.nawNr;
|
|
1792
1833
|
return transactionDeliveryOptionsRequest;
|
|
1793
1834
|
}
|
|
1835
|
+
_rememberResponse(remember, response) {
|
|
1836
|
+
if (remember) {
|
|
1837
|
+
this._rememberCurrentTransaction(response);
|
|
1838
|
+
this._rememberCurrentTransactionLineStatus(response);
|
|
1839
|
+
}
|
|
1840
|
+
}
|
|
1794
1841
|
}
|
|
1795
1842
|
TransactionService.decorators = [
|
|
1796
1843
|
{ type: Injectable }
|
|
1797
1844
|
];
|
|
1798
1845
|
TransactionService.ctorParameters = () => [
|
|
1799
|
-
{ type: IOneConnectorAdapterService }
|
|
1846
|
+
{ type: IOneConnectorAdapterService },
|
|
1847
|
+
{ type: PromptService }
|
|
1800
1848
|
];
|
|
1801
1849
|
|
|
1802
1850
|
var LanguageCode;
|
|
@@ -1892,6 +1940,7 @@ class Dictionary {
|
|
|
1892
1940
|
"ARTICLE_DESCRIPTION": "Artikelomschrijving",
|
|
1893
1941
|
"ARTICLE_IN_OUT_COLLECTION": "Status van artikel is '|~'. Weet u zeker dat u door wilt gaan?",
|
|
1894
1942
|
"ARTICLE_NR": "Artikelnummer",
|
|
1943
|
+
"ARTICLE_UNKNOWN": "Onbekend artikel",
|
|
1895
1944
|
"ASSEMBLY_COSTS": "Montagekosten",
|
|
1896
1945
|
"ASSEMBLY_DATE": "Montagedatum",
|
|
1897
1946
|
"AMOUNT": "Aantal",
|
|
@@ -2031,6 +2080,7 @@ class Dictionary {
|
|
|
2031
2080
|
"VAT": "Btw",
|
|
2032
2081
|
"VAT_AMOUNT": "BTW-bedrag",
|
|
2033
2082
|
"VALUE": "Waarde",
|
|
2083
|
+
"WHERE_ARE_YOU_LOOKING_FOR": "Waar ben je naar op zoek?",
|
|
2034
2084
|
"WAREHOUSE": "Magazijn",
|
|
2035
2085
|
"YOUR_DATA": "Uw gegevens",
|
|
2036
2086
|
},
|
|
@@ -2053,6 +2103,7 @@ class Dictionary {
|
|
|
2053
2103
|
"ARTICLE_DESCRIPTION": "Article description",
|
|
2054
2104
|
"ARTICLE_IN_OUT_COLLECTION": "Status of article is '|~'. Are you sure to proceed?",
|
|
2055
2105
|
"ARTICLE_NR": "Article number",
|
|
2106
|
+
"ARTICLE_UNKNOWN": "Article unknown",
|
|
2056
2107
|
"ASSEMBLY_COSTS": "Assembly costs",
|
|
2057
2108
|
"ASSEMBLY_DATE": "Assembly date",
|
|
2058
2109
|
"AMOUNT": "Amount",
|
|
@@ -2185,6 +2236,7 @@ class Dictionary {
|
|
|
2185
2236
|
"VAT": "VAT",
|
|
2186
2237
|
"VAT_AMOUNT": "VAT amount",
|
|
2187
2238
|
"WAREHOUSE": "Warehouse",
|
|
2239
|
+
"WHERE_ARE_YOU_LOOKING_FOR": "Where are you looking for?",
|
|
2188
2240
|
"YOUR_DATA": "Your data",
|
|
2189
2241
|
},
|
|
2190
2242
|
};
|
|
@@ -5482,6 +5534,7 @@ class CharacteristicAnswerComponent {
|
|
|
5482
5534
|
}
|
|
5483
5535
|
CharacteristicAnswerComponent.decorators = [
|
|
5484
5536
|
{ type: Component, args: [{
|
|
5537
|
+
// eslint-disable-next-line @angular-eslint/component-selector
|
|
5485
5538
|
selector: "characteristic-answer",
|
|
5486
5539
|
template: `
|
|
5487
5540
|
<co-dialog
|
|
@@ -5587,7 +5640,7 @@ IoneShoppingCartModule.decorators = [
|
|
|
5587
5640
|
entryComponents: [
|
|
5588
5641
|
IoneShoppingCartComponent
|
|
5589
5642
|
],
|
|
5590
|
-
exports: [IoneShoppingCartComponent, StockStatusIndicatorComponent],
|
|
5643
|
+
exports: [IoneShoppingCartComponent, StockStatusIndicatorComponent, CharacteristicAnswerComponent],
|
|
5591
5644
|
bootstrap: [IoneShoppingCartComponent]
|
|
5592
5645
|
},] }
|
|
5593
5646
|
];
|
|
@@ -5689,30 +5742,53 @@ class TransactionBaseComponent {
|
|
|
5689
5742
|
this.customer = NULL_CUSTOMER_FULL_OBJECT;
|
|
5690
5743
|
this._isService = false;
|
|
5691
5744
|
this.basedOnProduct = false;
|
|
5745
|
+
this._lineOperationStatuses = [];
|
|
5746
|
+
this._transactionLines = [];
|
|
5692
5747
|
}
|
|
5693
5748
|
set transaction(value) {
|
|
5694
5749
|
this._transaction = value;
|
|
5695
|
-
if (this._transaction
|
|
5696
|
-
|
|
5750
|
+
if (this._transaction) {
|
|
5751
|
+
if (this._transaction.transactionInfo) {
|
|
5752
|
+
this._transactionInfo = this._transaction.transactionInfo;
|
|
5753
|
+
this._isService = this._transaction.transactionInfo.transactionKind === TransactionKind.ServiceOrder;
|
|
5754
|
+
}
|
|
5755
|
+
if (this._transaction.transactionLines) {
|
|
5756
|
+
this.transactionLines = this._transaction.transactionLines;
|
|
5757
|
+
}
|
|
5758
|
+
if (this._transaction.transactionTotal) {
|
|
5759
|
+
this._transactionTotal = this._transaction.transactionTotal;
|
|
5760
|
+
}
|
|
5761
|
+
if (this._transaction.lineOperationStatuses) {
|
|
5762
|
+
this.lineOperationStatuses = this._transaction.lineOperationStatuses;
|
|
5763
|
+
}
|
|
5697
5764
|
}
|
|
5698
5765
|
}
|
|
5699
5766
|
get transaction() {
|
|
5700
5767
|
return this._transaction;
|
|
5701
5768
|
}
|
|
5769
|
+
set transactionInfo(value) {
|
|
5770
|
+
this._transactionInfo = value;
|
|
5771
|
+
}
|
|
5702
5772
|
get transactionInfo() {
|
|
5703
|
-
|
|
5704
|
-
|
|
5705
|
-
|
|
5773
|
+
return this._transactionInfo;
|
|
5774
|
+
}
|
|
5775
|
+
set transactionLines(value) {
|
|
5776
|
+
this._transactionLines = value;
|
|
5706
5777
|
}
|
|
5707
5778
|
get transactionLines() {
|
|
5708
|
-
|
|
5709
|
-
|
|
5710
|
-
|
|
5779
|
+
return this._transactionLines;
|
|
5780
|
+
}
|
|
5781
|
+
set transactionTotal(value) {
|
|
5782
|
+
this._transactionTotal = value;
|
|
5711
5783
|
}
|
|
5712
5784
|
get transactionTotal() {
|
|
5713
|
-
|
|
5714
|
-
|
|
5715
|
-
|
|
5785
|
+
return this._transactionTotal;
|
|
5786
|
+
}
|
|
5787
|
+
get lineOperationStatuses() {
|
|
5788
|
+
return this._lineOperationStatuses;
|
|
5789
|
+
}
|
|
5790
|
+
set lineOperationStatuses(value) {
|
|
5791
|
+
this._lineOperationStatuses = value;
|
|
5716
5792
|
}
|
|
5717
5793
|
get isService() {
|
|
5718
5794
|
return this._isService;
|
|
@@ -5798,6 +5874,13 @@ TransactionBaseComponent.propDecorators = {
|
|
|
5798
5874
|
customer: [{ type: Input }]
|
|
5799
5875
|
};
|
|
5800
5876
|
|
|
5877
|
+
// import {
|
|
5878
|
+
// ToolbarService,
|
|
5879
|
+
// LinkService,
|
|
5880
|
+
// ImageService,
|
|
5881
|
+
// HtmlEditorService,
|
|
5882
|
+
// RichTextEditor
|
|
5883
|
+
// } from '@syncfusion/ej2-angular-richtexteditor';
|
|
5801
5884
|
class TransactionArticleTextComponent extends TransactionBaseComponent {
|
|
5802
5885
|
constructor(service) {
|
|
5803
5886
|
super(service);
|
|
@@ -5863,10 +5946,12 @@ TransactionArticleTextComponent.decorators = [
|
|
|
5863
5946
|
<ng-container content>
|
|
5864
5947
|
<div class="tags-join-content" fxLayout fxLayoutGap="10px">
|
|
5865
5948
|
<div class="column-separator">
|
|
5866
|
-
|
|
5867
|
-
<!--
|
|
5868
|
-
<!--
|
|
5869
|
-
<!--
|
|
5949
|
+
<co-input-text placeholder="Titel"></co-input-text>
|
|
5950
|
+
<!-- <ejs-richtexteditor-->
|
|
5951
|
+
<!-- #rte-->
|
|
5952
|
+
<!-- id="Rte"-->
|
|
5953
|
+
<!-- >-->
|
|
5954
|
+
<!-- </ejs-richtexteditor>-->
|
|
5870
5955
|
</div>
|
|
5871
5956
|
<div style="margin-left:5px;">
|
|
5872
5957
|
<div style="margin-top:16px;">
|
|
@@ -5875,6 +5960,7 @@ TransactionArticleTextComponent.decorators = [
|
|
|
5875
5960
|
[fields]="fields"
|
|
5876
5961
|
placeholder="Standaardteksten"
|
|
5877
5962
|
></ejs-dropdownlist>
|
|
5963
|
+
|
|
5878
5964
|
</div>
|
|
5879
5965
|
<div style="margin-top:20px;">
|
|
5880
5966
|
<co-input-checkbox
|
|
@@ -5902,6 +5988,7 @@ TransactionArticleTextComponent.decorators = [
|
|
|
5902
5988
|
<co-button label="OK" (click)="onOkClick()"></co-button>
|
|
5903
5989
|
<co-button label="CANCEL" (click)="hide()"></co-button>
|
|
5904
5990
|
<co-button label="OVERVIEW" (click)="onOverview()"></co-button>
|
|
5991
|
+
<!-- <co-button label="TEST" (click)="onTest()"></co-button>-->
|
|
5905
5992
|
</div>
|
|
5906
5993
|
</ng-container>
|
|
5907
5994
|
</co-dialog>
|
|
@@ -5978,12 +6065,306 @@ TransactionArticleTextComponent.propDecorators = {
|
|
|
5978
6065
|
subHeader: [{ type: Input }]
|
|
5979
6066
|
};
|
|
5980
6067
|
|
|
6068
|
+
class TransactionManagerComponent extends TransactionBaseComponent {
|
|
6069
|
+
constructor(service, transactionEvents, promptService, _dictionaryService) {
|
|
6070
|
+
super(service);
|
|
6071
|
+
this.service = service;
|
|
6072
|
+
this.transactionEvents = transactionEvents;
|
|
6073
|
+
this.promptService = promptService;
|
|
6074
|
+
this._dictionaryService = _dictionaryService;
|
|
6075
|
+
this.linesChanged = new EventEmitter();
|
|
6076
|
+
this.articleAdded = new EventEmitter();
|
|
6077
|
+
this.columns = [];
|
|
6078
|
+
this._inOutCollection = [];
|
|
6079
|
+
this._showCharacteristic = false;
|
|
6080
|
+
this._subs = [];
|
|
6081
|
+
this._subs.push(this.service.transactionLoaded.subscribe((transactionInfoResponse) => {
|
|
6082
|
+
if (transactionInfoResponse.isSuccess) {
|
|
6083
|
+
this.transaction = transactionInfoResponse;
|
|
6084
|
+
}
|
|
6085
|
+
}));
|
|
6086
|
+
}
|
|
6087
|
+
get amountOfLines() {
|
|
6088
|
+
return NumberUtils.NrOrDefault(this.service.articleAmount, 0);
|
|
6089
|
+
}
|
|
6090
|
+
get showCharacteristicDialog() {
|
|
6091
|
+
return this._showCharacteristic;
|
|
6092
|
+
}
|
|
6093
|
+
set showCharacteristicDialog(value) {
|
|
6094
|
+
this._showCharacteristic = value;
|
|
6095
|
+
}
|
|
6096
|
+
ngOnDestroy() {
|
|
6097
|
+
this._subs.forEach(sub => sub.unsubscribe());
|
|
6098
|
+
}
|
|
6099
|
+
addArticleLine(transactionUuid, sku, amount, lineNr, beforeOrAfter) {
|
|
6100
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
6101
|
+
const goodId = yield this.service.getGoodIdFromArticleNr(sku);
|
|
6102
|
+
if (goodId) {
|
|
6103
|
+
yield this._loadArticle(goodId);
|
|
6104
|
+
yield this._handleAddArticleLineAt(amount, lineNr, beforeOrAfter);
|
|
6105
|
+
}
|
|
6106
|
+
else {
|
|
6107
|
+
this.promptService.showError(this._dictionaryService.get("ARTICLE_UNKNOWN"));
|
|
6108
|
+
}
|
|
6109
|
+
});
|
|
6110
|
+
}
|
|
6111
|
+
changeLineSequence(fromIndex, toIndex) {
|
|
6112
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
6113
|
+
let fromLine = this._getTransactionLineInfoByIndex(fromIndex);
|
|
6114
|
+
let toLine = this._getTransactionLineInfoByIndex(toIndex);
|
|
6115
|
+
let aboveLineNr;
|
|
6116
|
+
let belowLineNr;
|
|
6117
|
+
if (fromIndex > toIndex) {
|
|
6118
|
+
aboveLineNr = toLine.lineNr;
|
|
6119
|
+
}
|
|
6120
|
+
else {
|
|
6121
|
+
belowLineNr = toLine.lineNr;
|
|
6122
|
+
}
|
|
6123
|
+
yield this.service.changeLineSequence(fromLine.uuid, aboveLineNr, belowLineNr, false)
|
|
6124
|
+
.then((value) => {
|
|
6125
|
+
this.handleLineOperationStatus(value);
|
|
6126
|
+
}, (error) => this.promptService.showError(error));
|
|
6127
|
+
});
|
|
6128
|
+
}
|
|
6129
|
+
showStockManager(line) {
|
|
6130
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
6131
|
+
this.warehouse.selectedWarehouseNr = line.warehouseNumber;
|
|
6132
|
+
this.warehouse.amount = line.amount;
|
|
6133
|
+
this.warehouse.commissionCode = line.commissionCode;
|
|
6134
|
+
this.warehouse.message = this.currentOperationStatus.pendingReason;
|
|
6135
|
+
this.warehouse.show(line.articleNumber);
|
|
6136
|
+
});
|
|
6137
|
+
}
|
|
6138
|
+
warehouseOkClick() {
|
|
6139
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
6140
|
+
if (this.warehouse.commissionCode !== undefined) {
|
|
6141
|
+
this.currentReason.commissionCode = this.warehouse.commissionCode;
|
|
6142
|
+
}
|
|
6143
|
+
if (this.warehouse.amount !== undefined) {
|
|
6144
|
+
this.currentReason.quantity = this.warehouse.amount;
|
|
6145
|
+
}
|
|
6146
|
+
if (this.warehouse.selectedWarehouseNr !== undefined) {
|
|
6147
|
+
this.currentReason.warehouseNr = this.warehouse.selectedWarehouseNr;
|
|
6148
|
+
}
|
|
6149
|
+
if (this.currentReason) {
|
|
6150
|
+
yield this.service.resolvePendingLineReason(this.currentReason, false)
|
|
6151
|
+
.then((value) => {
|
|
6152
|
+
this.handleLineOperationStatus(value);
|
|
6153
|
+
});
|
|
6154
|
+
}
|
|
6155
|
+
});
|
|
6156
|
+
}
|
|
6157
|
+
warehouseCancelClick() {
|
|
6158
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
6159
|
+
if (this.currentReason) {
|
|
6160
|
+
yield this._cancelArticle(this.currentReason.lineUuid);
|
|
6161
|
+
}
|
|
6162
|
+
});
|
|
6163
|
+
}
|
|
6164
|
+
handleCharacteristicAnswerOkClick(answer) {
|
|
6165
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
6166
|
+
this.currentReason = new ResolvePendingLineReasonRequest(this.currentOperationStatus.uuid, this.currentOperationStatus.pendingReason, this.currentOperationStatus.pendingReasonType);
|
|
6167
|
+
this.currentReason.textualUserInput = answer;
|
|
6168
|
+
yield this.service.resolvePendingLineReason(this.currentReason, false)
|
|
6169
|
+
.then((value) => {
|
|
6170
|
+
this.handleLineOperationStatus(value);
|
|
6171
|
+
});
|
|
6172
|
+
});
|
|
6173
|
+
}
|
|
6174
|
+
_handleAddArticle(amount = 1) {
|
|
6175
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
6176
|
+
yield this.service.addTransactionLine(TransactionLineType.ArticleLine, this.newArticleNr, amount, this.newArticle.standardWareHouse, this.newArticle.commissionCode, false, 0, 0, false)
|
|
6177
|
+
.then((value) => {
|
|
6178
|
+
this.handleLineOperationStatus(value);
|
|
6179
|
+
}, (error) => this.promptService.showError(error));
|
|
6180
|
+
});
|
|
6181
|
+
}
|
|
6182
|
+
_handleAddArticleLineAt(amount, lineNr, beforeOrAfter) {
|
|
6183
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
6184
|
+
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)
|
|
6185
|
+
.then((value) => {
|
|
6186
|
+
this.lineOperationStatuses = value.lineOperationStatuses;
|
|
6187
|
+
this.handleLineOperationStatus(value);
|
|
6188
|
+
}, (error) => this.promptService.showError(error));
|
|
6189
|
+
});
|
|
6190
|
+
}
|
|
6191
|
+
_getWareHouseNoFromArticle() {
|
|
6192
|
+
if (this.newArticle !== undefined && this.newArticle.stockLocations !== undefined && this.newArticle.stockLocations.length) {
|
|
6193
|
+
return this.newArticle.stockLocations[0].warehouseNr;
|
|
6194
|
+
}
|
|
6195
|
+
return 0;
|
|
6196
|
+
}
|
|
6197
|
+
isLineOperationStatus(lineOperationStatuses) {
|
|
6198
|
+
this.currentOperationStatus = this.service.pendingLineOperationStatus(lineOperationStatuses);
|
|
6199
|
+
if (this.currentOperationStatus !== undefined) {
|
|
6200
|
+
return true;
|
|
6201
|
+
}
|
|
6202
|
+
return false;
|
|
6203
|
+
}
|
|
6204
|
+
_confirmAction() {
|
|
6205
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
6206
|
+
this.currentReason = new ResolvePendingLineReasonRequest(this.currentOperationStatus.uuid, this.currentOperationStatus.pendingReason, this.currentOperationStatus.pendingReasonType);
|
|
6207
|
+
const pendingReasonText = yield this._getPendingReasonText(this.currentOperationStatus.pendingReason);
|
|
6208
|
+
this.currentReason.confirmation = yield this.promptService.showYesNo(pendingReasonText, " ");
|
|
6209
|
+
yield this.service.resolvePendingLineReason(this.currentReason, false)
|
|
6210
|
+
.then((value) => {
|
|
6211
|
+
this.handleLineOperationStatus(value);
|
|
6212
|
+
});
|
|
6213
|
+
});
|
|
6214
|
+
}
|
|
6215
|
+
_showInformation() {
|
|
6216
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
6217
|
+
this.currentReason = new ResolvePendingLineReasonRequest(this.currentOperationStatus.uuid, this.currentOperationStatus.pendingReason, this.currentOperationStatus.pendingReasonType);
|
|
6218
|
+
const pendingReasonText = yield this._getPendingReasonText(this.currentOperationStatus.pendingReason);
|
|
6219
|
+
yield this.promptService.showOkModal(pendingReasonText, " ");
|
|
6220
|
+
yield this.service.resolvePendingLineReason(this.currentReason, false)
|
|
6221
|
+
.then((value) => {
|
|
6222
|
+
this.handleLineOperationStatus(value);
|
|
6223
|
+
});
|
|
6224
|
+
});
|
|
6225
|
+
}
|
|
6226
|
+
_getPendingReasonText(pendingReason) {
|
|
6227
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
6228
|
+
if (pendingReason === "ARTICLE_IS_DISCONTINUED_DO_YOU_WANT_TO_CONTINUE_PLEASE_CONFIRM") {
|
|
6229
|
+
return this._dictionaryService.get("ARTICLE_IN_OUT_COLLECTION").replace("|~", yield this.getInOutCollectionOfArticle());
|
|
6230
|
+
}
|
|
6231
|
+
return this._dictionaryService.get(pendingReason);
|
|
6232
|
+
});
|
|
6233
|
+
}
|
|
6234
|
+
getInOutCollectionOfArticle() {
|
|
6235
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
6236
|
+
if (!this._inOutCollection.length) {
|
|
6237
|
+
this._inOutCollection = yield this.service.getInOutCollection("NL");
|
|
6238
|
+
}
|
|
6239
|
+
const domainValue = this._inOutCollection.find(element => element.code === this.newArticle.inOutCollection);
|
|
6240
|
+
if (domainValue) {
|
|
6241
|
+
return domainValue.description;
|
|
6242
|
+
}
|
|
6243
|
+
return "";
|
|
6244
|
+
});
|
|
6245
|
+
}
|
|
6246
|
+
handleLineOperationStatus(lineOperationResponse) {
|
|
6247
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
6248
|
+
if (this.isLineOperationStatus(lineOperationResponse.lineOperationStatuses)) {
|
|
6249
|
+
this.transaction = lineOperationResponse;
|
|
6250
|
+
this.articleAdded.emit(this.transaction);
|
|
6251
|
+
yield this._handlePendingLine(this.currentOperationStatus.uuid).then();
|
|
6252
|
+
}
|
|
6253
|
+
else {
|
|
6254
|
+
yield this._saveTransaction();
|
|
6255
|
+
}
|
|
6256
|
+
});
|
|
6257
|
+
}
|
|
6258
|
+
_handlePendingLine(lineUuid) {
|
|
6259
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
6260
|
+
this.currentReason = new ResolvePendingLineReasonRequest(this.currentOperationStatus.uuid, this.currentOperationStatus.pendingReason, this.currentOperationStatus.pendingReasonType);
|
|
6261
|
+
this.currentPendingLine = this.transactionLines.find(l => l.uuid === lineUuid);
|
|
6262
|
+
switch (this.currentOperationStatus.pendingReasonType) {
|
|
6263
|
+
case PendingReasonType.ABORTED:
|
|
6264
|
+
case PendingReasonType.CANCELLED:
|
|
6265
|
+
yield this._cancelArticle(this.currentPendingLine.uuid);
|
|
6266
|
+
break;
|
|
6267
|
+
case PendingReasonType.CONFIRMATION_NEEDED:
|
|
6268
|
+
yield this._confirmAction();
|
|
6269
|
+
break;
|
|
6270
|
+
case PendingReasonType.INVALID_LOGISTICS:
|
|
6271
|
+
yield this.showStockManager(this.currentPendingLine);
|
|
6272
|
+
break;
|
|
6273
|
+
case PendingReasonType.NON_CRITICAL_DISCONTINUATION:
|
|
6274
|
+
yield this._showInformation();
|
|
6275
|
+
break;
|
|
6276
|
+
case PendingReasonType.CHARACTERISTICS_ANSWER_NEEDED:
|
|
6277
|
+
this.CharacteristicsAnswerNeeded();
|
|
6278
|
+
break;
|
|
6279
|
+
case PendingReasonType.NONE:
|
|
6280
|
+
default:
|
|
6281
|
+
this.currentReason = undefined;
|
|
6282
|
+
this.currentPendingLine = undefined;
|
|
6283
|
+
break;
|
|
6284
|
+
}
|
|
6285
|
+
});
|
|
6286
|
+
}
|
|
6287
|
+
_saveTransaction() {
|
|
6288
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
6289
|
+
if (this.transactionInfo) {
|
|
6290
|
+
const success = yield this.service.saveTransactionByUuid(this.transactionInfo.uuid);
|
|
6291
|
+
if (!success) {
|
|
6292
|
+
this.promptService.showError("Transaction could not be saved!");
|
|
6293
|
+
}
|
|
6294
|
+
}
|
|
6295
|
+
});
|
|
6296
|
+
}
|
|
6297
|
+
_loadArticle(goodId) {
|
|
6298
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
6299
|
+
this.newArticle = yield this.service.getArticleFullObject(goodId);
|
|
6300
|
+
this.newArticleNr = this.newArticle.articleNr;
|
|
6301
|
+
});
|
|
6302
|
+
}
|
|
6303
|
+
addEmailAddressToTransaction(emailAddress) {
|
|
6304
|
+
this.service.emailAddress = emailAddress;
|
|
6305
|
+
}
|
|
6306
|
+
CharacteristicsAnswerNeeded() {
|
|
6307
|
+
this.characteristicAnswer.question = this.currentOperationStatus.characteristic.question;
|
|
6308
|
+
this.characteristicAnswer.title = this.newArticle.description;
|
|
6309
|
+
this.characteristicAnswer.value = this.currentOperationStatus.characteristic.value;
|
|
6310
|
+
this.characteristicAnswer.characteristics = this.currentOperationStatus.characteristic.transactionLineCharacteristicChoices;
|
|
6311
|
+
setTimeout(() => {
|
|
6312
|
+
this.characteristicAnswer.open();
|
|
6313
|
+
// eslint-disable-next-line no-magic-numbers
|
|
6314
|
+
}, 1000);
|
|
6315
|
+
}
|
|
6316
|
+
_getTransactionLineInfoByIndex(index) {
|
|
6317
|
+
if (index >= 0 && index < this.transactionLines.length) {
|
|
6318
|
+
return this.service.currentLines[index];
|
|
6319
|
+
}
|
|
6320
|
+
}
|
|
6321
|
+
_cancelArticle(uuid) {
|
|
6322
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
6323
|
+
yield this.service.cancelAddTransactionLine(uuid, false)
|
|
6324
|
+
.then((response) => {
|
|
6325
|
+
this.transaction = response;
|
|
6326
|
+
this.articleAdded.emit(response);
|
|
6327
|
+
});
|
|
6328
|
+
});
|
|
6329
|
+
}
|
|
6330
|
+
}
|
|
6331
|
+
TransactionManagerComponent.decorators = [
|
|
6332
|
+
{ type: Component, args: [{
|
|
6333
|
+
// eslint-disable-next-line @angular-eslint/component-selector
|
|
6334
|
+
selector: "transaction-manager",
|
|
6335
|
+
template: `
|
|
6336
|
+
<warehouse #warehouse
|
|
6337
|
+
(okClick)="warehouseOkClick()"
|
|
6338
|
+
(cancelClick)="warehouseCancelClick()"
|
|
6339
|
+
></warehouse>
|
|
6340
|
+
<characteristic-answer
|
|
6341
|
+
#characteristicAnswer
|
|
6342
|
+
(okClick)="handleCharacteristicAnswerOkClick($event)"
|
|
6343
|
+
></characteristic-answer>
|
|
6344
|
+
`,
|
|
6345
|
+
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"]
|
|
6346
|
+
},] }
|
|
6347
|
+
];
|
|
6348
|
+
TransactionManagerComponent.ctorParameters = () => [
|
|
6349
|
+
{ type: TransactionService },
|
|
6350
|
+
{ type: TransactionEventService },
|
|
6351
|
+
{ type: PromptService },
|
|
6352
|
+
{ type: DictionaryService }
|
|
6353
|
+
];
|
|
6354
|
+
TransactionManagerComponent.propDecorators = {
|
|
6355
|
+
warehouse: [{ type: ViewChild, args: ["warehouse",] }],
|
|
6356
|
+
characteristicAnswer: [{ type: ViewChild, args: ["characteristicAnswer",] }],
|
|
6357
|
+
linesChanged: [{ type: Output }],
|
|
6358
|
+
articleAdded: [{ type: Output }]
|
|
6359
|
+
};
|
|
6360
|
+
|
|
5981
6361
|
class ServiceOrderComponent extends TransactionBaseComponent {
|
|
5982
|
-
constructor(service, transactionEvents, iconCacheService) {
|
|
6362
|
+
constructor(service, transactionEvents, iconCacheService, _promptService) {
|
|
5983
6363
|
super(service);
|
|
5984
6364
|
this.service = service;
|
|
5985
6365
|
this.transactionEvents = transactionEvents;
|
|
5986
6366
|
this.iconCacheService = iconCacheService;
|
|
6367
|
+
this._promptService = _promptService;
|
|
5987
6368
|
this.iconThickLines = CoreComponentsIcon.ThickLines;
|
|
5988
6369
|
this.iconThinLines = CoreComponentsIcon.ThinLines;
|
|
5989
6370
|
this.iconOrder = CoreComponentsIcon.Order;
|
|
@@ -5994,6 +6375,7 @@ class ServiceOrderComponent extends TransactionBaseComponent {
|
|
|
5994
6375
|
this.isRouteOptimizationConfigured = false;
|
|
5995
6376
|
this.activeViewMode = ContentViewMode.List;
|
|
5996
6377
|
this.floatButtonSelected = false;
|
|
6378
|
+
this.newArticleNr = "";
|
|
5997
6379
|
this._subs = [];
|
|
5998
6380
|
}
|
|
5999
6381
|
get inListView() {
|
|
@@ -6022,6 +6404,11 @@ class ServiceOrderComponent extends TransactionBaseComponent {
|
|
|
6022
6404
|
}));
|
|
6023
6405
|
});
|
|
6024
6406
|
}
|
|
6407
|
+
ngAfterViewInit() {
|
|
6408
|
+
this._subs.push(this._transactionManager.articleAdded.subscribe((transactionInfoResponse) => {
|
|
6409
|
+
this.transaction = transactionInfoResponse;
|
|
6410
|
+
}));
|
|
6411
|
+
}
|
|
6025
6412
|
ngOnDestroy() {
|
|
6026
6413
|
this._subs.forEach(sub => sub.unsubscribe());
|
|
6027
6414
|
}
|
|
@@ -6064,7 +6451,7 @@ class ServiceOrderComponent extends TransactionBaseComponent {
|
|
|
6064
6451
|
this._transactionArticleTextComponent.visible = this.floatButtonSelected;
|
|
6065
6452
|
}
|
|
6066
6453
|
get subHeader() {
|
|
6067
|
-
if (this._selectedTransLine
|
|
6454
|
+
if (this._selectedTransLine) {
|
|
6068
6455
|
return this._selectedTransLine.goodDescription;
|
|
6069
6456
|
}
|
|
6070
6457
|
return "";
|
|
@@ -6072,6 +6459,15 @@ class ServiceOrderComponent extends TransactionBaseComponent {
|
|
|
6072
6459
|
hideOrderTotals(event) {
|
|
6073
6460
|
this.showTotals = false;
|
|
6074
6461
|
}
|
|
6462
|
+
addArticleLine(event) {
|
|
6463
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
6464
|
+
if (event.code === "Enter") {
|
|
6465
|
+
if (this.newArticleNr && this.newArticleNr !== "") {
|
|
6466
|
+
yield this._transactionManager.addArticleLine(this.transactionInfo.uuid, this.newArticleNr, 1, 0, PositionGridRow.After);
|
|
6467
|
+
}
|
|
6468
|
+
}
|
|
6469
|
+
});
|
|
6470
|
+
}
|
|
6075
6471
|
}
|
|
6076
6472
|
ServiceOrderComponent.FLOAT_BUTTON_RIGHT_POSITION_WITHOUT_SIDEBAR = 50;
|
|
6077
6473
|
ServiceOrderComponent.FLOAT_BUTTON_RIGHT_POSITION_WITH_SIDEBAR = 350;
|
|
@@ -6080,6 +6476,7 @@ ServiceOrderComponent.decorators = [
|
|
|
6080
6476
|
// eslint-disable-next-line @angular-eslint/component-selector
|
|
6081
6477
|
selector: "service-order",
|
|
6082
6478
|
template: `
|
|
6479
|
+
<transaction-manager></transaction-manager>
|
|
6083
6480
|
<div id="transaction-general-tab" style="height:100%;">
|
|
6084
6481
|
<transaction-header-block
|
|
6085
6482
|
[relationId]="relationId"
|
|
@@ -6088,6 +6485,14 @@ ServiceOrderComponent.decorators = [
|
|
|
6088
6485
|
(planningRequestButtonClick)="handlePlanningRequest($event)"
|
|
6089
6486
|
></transaction-header-block>
|
|
6090
6487
|
<div *ngIf="!isService">
|
|
6488
|
+
<div style="display: flex; flex-direction: row; place-content: center">
|
|
6489
|
+
<co-input-text style="width: 200px;"
|
|
6490
|
+
[(model)]="newArticleNr"
|
|
6491
|
+
[placeholder]="'WHERE_ARE_YOU_LOOKING_FOR' | localize"
|
|
6492
|
+
[showClearButton]="true"
|
|
6493
|
+
(keypress)="addArticleLine($event)"
|
|
6494
|
+
></co-input-text>
|
|
6495
|
+
</div>
|
|
6091
6496
|
<div class="transaction-view" fxLayout="row" fxLayoutGap="1px" fxLayoutAlign="flex-end">
|
|
6092
6497
|
<div class="view-mode-buttons">
|
|
6093
6498
|
<co-button [iconData]="iconCacheService.getIcon(iconThickLines)"
|
|
@@ -6129,10 +6534,12 @@ ServiceOrderComponent.decorators = [
|
|
|
6129
6534
|
ServiceOrderComponent.ctorParameters = () => [
|
|
6130
6535
|
{ type: TransactionService },
|
|
6131
6536
|
{ type: TransactionEventService },
|
|
6132
|
-
{ type: IconCacheService }
|
|
6537
|
+
{ type: IconCacheService },
|
|
6538
|
+
{ type: PromptService }
|
|
6133
6539
|
];
|
|
6134
6540
|
ServiceOrderComponent.propDecorators = {
|
|
6135
|
-
_transactionArticleTextComponent: [{ type: ViewChild, args: [TransactionArticleTextComponent,
|
|
6541
|
+
_transactionArticleTextComponent: [{ type: ViewChild, args: [TransactionArticleTextComponent,] }],
|
|
6542
|
+
_transactionManager: [{ type: ViewChild, args: [TransactionManagerComponent,] }]
|
|
6136
6543
|
};
|
|
6137
6544
|
|
|
6138
6545
|
class TransactionOrderTotalsComponent extends TransactionBaseComponent {
|
|
@@ -7464,6 +7871,135 @@ DefaultOkCancelButtonsComponent.propDecorators = {
|
|
|
7464
7871
|
okButtonComp: [{ type: ViewChild, args: ["okButton",] }]
|
|
7465
7872
|
};
|
|
7466
7873
|
|
|
7874
|
+
class WarehouseComponent {
|
|
7875
|
+
constructor(service, _dictionaryService) {
|
|
7876
|
+
this.service = service;
|
|
7877
|
+
this._dictionaryService = _dictionaryService;
|
|
7878
|
+
this.message = "";
|
|
7879
|
+
this.okClick = new EventEmitter();
|
|
7880
|
+
this.cancelClick = new EventEmitter();
|
|
7881
|
+
this.commissionCodes = [];
|
|
7882
|
+
this.commissionFields = { text: "description", value: "code" };
|
|
7883
|
+
this.transactionArticleWarehouses = [];
|
|
7884
|
+
this.columns = [];
|
|
7885
|
+
this._okOrCancelClick = false;
|
|
7886
|
+
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") });
|
|
7887
|
+
}
|
|
7888
|
+
ngOnInit() {
|
|
7889
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
7890
|
+
this.commissionCodes = yield this.service.getCommissionCodes("NL");
|
|
7891
|
+
});
|
|
7892
|
+
}
|
|
7893
|
+
ngOnDestroy() {
|
|
7894
|
+
this.warehouseDialog.close();
|
|
7895
|
+
}
|
|
7896
|
+
showStockManager(line) {
|
|
7897
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
7898
|
+
this.selectedWarehouseNr = line.warehouseNumber;
|
|
7899
|
+
this.amount = line.amount;
|
|
7900
|
+
this.commissionCode = line.commissionCode;
|
|
7901
|
+
this.show(line.articleNumber);
|
|
7902
|
+
});
|
|
7903
|
+
}
|
|
7904
|
+
hide() {
|
|
7905
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
7906
|
+
if (this._okOrCancelClick) {
|
|
7907
|
+
this._okOrCancelClick = false;
|
|
7908
|
+
return;
|
|
7909
|
+
}
|
|
7910
|
+
yield this.onStockManagerCancelClick();
|
|
7911
|
+
});
|
|
7912
|
+
}
|
|
7913
|
+
show(articleNr) {
|
|
7914
|
+
this._reloadDataCollections(articleNr).then();
|
|
7915
|
+
this.warehouseGrid.selectRow(this.selectedWarehouseNr);
|
|
7916
|
+
this.warehouseDialog.targetElement = null;
|
|
7917
|
+
this.warehouseDialog.open();
|
|
7918
|
+
}
|
|
7919
|
+
handleRowsSelected(rows) {
|
|
7920
|
+
this.selectedWarehouseNr = (rows.find(x => x !== undefined)).warehouseNr;
|
|
7921
|
+
}
|
|
7922
|
+
onStockManagerCancelClick() {
|
|
7923
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
7924
|
+
this._okOrCancelClick = true;
|
|
7925
|
+
this.warehouseDialog.close();
|
|
7926
|
+
this.cancelClick.emit();
|
|
7927
|
+
});
|
|
7928
|
+
}
|
|
7929
|
+
onStockManagerOkClick() {
|
|
7930
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
7931
|
+
this._okOrCancelClick = true;
|
|
7932
|
+
this.warehouseDialog.close();
|
|
7933
|
+
this.okClick.emit();
|
|
7934
|
+
});
|
|
7935
|
+
}
|
|
7936
|
+
_reloadDataCollections(articleNr) {
|
|
7937
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
7938
|
+
const goodId = yield this.service.getGoodIdFromArticleNr(articleNr);
|
|
7939
|
+
this.transactionArticleWarehouses = yield this.service.getTransactionArticleWarehouses(goodId);
|
|
7940
|
+
});
|
|
7941
|
+
}
|
|
7942
|
+
}
|
|
7943
|
+
WarehouseComponent.decorators = [
|
|
7944
|
+
{ type: Component, args: [{
|
|
7945
|
+
// eslint-disable-next-line @angular-eslint/component-selector
|
|
7946
|
+
selector: "warehouse",
|
|
7947
|
+
template: `
|
|
7948
|
+
<co-dialog #warehouseDialog
|
|
7949
|
+
(closeClick)="hide()"
|
|
7950
|
+
(overlayClick)="onStockManagerCancelClick()"
|
|
7951
|
+
>
|
|
7952
|
+
<ng-container header>{{ 'STOCK_NOTIFICATION' | localize }}</ng-container>
|
|
7953
|
+
|
|
7954
|
+
<ng-container content>
|
|
7955
|
+
<co-form>
|
|
7956
|
+
<div class="form-content">
|
|
7957
|
+
<span *ngIf="message" class="message-field" [textContent]="message | localize"></span>
|
|
7958
|
+
<div class="commission-fields" fxLayout="row">
|
|
7959
|
+
<co-input-number-picker class="horizontal" [(model)]="amount" [min]="0" decimals="3"></co-input-number-picker>
|
|
7960
|
+
<co-input-combo-box [(model)]="commissionCode"
|
|
7961
|
+
[source]="commissionCodes"
|
|
7962
|
+
[fields]="commissionFields"
|
|
7963
|
+
[placeholder]="'COMMISSION_CODE' | localize"
|
|
7964
|
+
[required]="true"
|
|
7965
|
+
></co-input-combo-box>
|
|
7966
|
+
</div>
|
|
7967
|
+
<div>
|
|
7968
|
+
<co-grid #warehouseGrid
|
|
7969
|
+
[data]="transactionArticleWarehouses"
|
|
7970
|
+
[columns]="columns"
|
|
7971
|
+
[pagingEnabled]="'true'"
|
|
7972
|
+
[maxNumberOfRows]="'10'"
|
|
7973
|
+
(rowsSelected)="handleRowsSelected($event)"
|
|
7974
|
+
></co-grid>
|
|
7975
|
+
</div>
|
|
7976
|
+
</div>
|
|
7977
|
+
</co-form>
|
|
7978
|
+
</ng-container>
|
|
7979
|
+
|
|
7980
|
+
<ng-container footer>
|
|
7981
|
+
<div class="flex-center">
|
|
7982
|
+
<co-button [label]="'OK' | localize" (click)="onStockManagerOkClick()"></co-button>
|
|
7983
|
+
<co-button [label]="'CANCEL' | localize" (click)="onStockManagerCancelClick()"></co-button>
|
|
7984
|
+
</div>
|
|
7985
|
+
</ng-container>
|
|
7986
|
+
</co-dialog>
|
|
7987
|
+
`,
|
|
7988
|
+
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"]
|
|
7989
|
+
},] }
|
|
7990
|
+
];
|
|
7991
|
+
WarehouseComponent.ctorParameters = () => [
|
|
7992
|
+
{ type: TransactionService },
|
|
7993
|
+
{ type: DictionaryService }
|
|
7994
|
+
];
|
|
7995
|
+
WarehouseComponent.propDecorators = {
|
|
7996
|
+
warehouseDialog: [{ type: ViewChild, args: ["warehouseDialog",] }],
|
|
7997
|
+
warehouseGrid: [{ type: ViewChild, args: ["warehouseGrid",] }],
|
|
7998
|
+
message: [{ type: Input }],
|
|
7999
|
+
okClick: [{ type: Output }],
|
|
8000
|
+
cancelClick: [{ type: Output }]
|
|
8001
|
+
};
|
|
8002
|
+
|
|
7467
8003
|
class IoneServiceOrderModule {
|
|
7468
8004
|
}
|
|
7469
8005
|
IoneServiceOrderModule.decorators = [
|
|
@@ -7494,6 +8030,7 @@ IoneServiceOrderModule.decorators = [
|
|
|
7494
8030
|
IoneShoppingCartModule,
|
|
7495
8031
|
TabModule,
|
|
7496
8032
|
CommonModule,
|
|
8033
|
+
// RichTextEditorModule
|
|
7497
8034
|
],
|
|
7498
8035
|
declarations: [
|
|
7499
8036
|
TemplateWrapperDirective,
|
|
@@ -7518,11 +8055,13 @@ IoneServiceOrderModule.decorators = [
|
|
|
7518
8055
|
TransactionDeliverySummaryComponent,
|
|
7519
8056
|
TransactionProductContractSummaryComponent,
|
|
7520
8057
|
TransactionProductSummaryComponent,
|
|
8058
|
+
TransactionManagerComponent,
|
|
8059
|
+
WarehouseComponent,
|
|
7521
8060
|
],
|
|
7522
8061
|
providers: [
|
|
7523
8062
|
DictionaryService,
|
|
7524
8063
|
TransactionService,
|
|
7525
|
-
OptionsService
|
|
8064
|
+
OptionsService,
|
|
7526
8065
|
],
|
|
7527
8066
|
entryComponents: [
|
|
7528
8067
|
IoneServiceOrderComponent
|
|
@@ -7538,5 +8077,5 @@ IoneServiceOrderModule.decorators = [
|
|
|
7538
8077
|
* Generated bundle index. Do not edit.
|
|
7539
8078
|
*/
|
|
7540
8079
|
|
|
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,
|
|
8080
|
+
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
8081
|
//# sourceMappingURL=colijnit-transaction.js.map
|