@colijnit/sharedcomponents 1.0.19 → 1.0.20
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/bundles/colijnit-sharedcomponents.umd.js +550 -134
- package/bundles/colijnit-sharedcomponents.umd.js.map +1 -1
- package/colijnit-sharedcomponents.d.ts +9 -7
- package/colijnit-sharedcomponents.metadata.json +1 -1
- package/esm2015/colijnit-sharedcomponents.js +10 -8
- package/esm2015/lib/assets/dictionary/text.properties.js +11 -0
- package/esm2015/lib/components/send-method-dialog/send-method-dialog.component.js +94 -23
- package/esm2015/lib/components/stock/stock-information/stock-information.component.js +1 -1
- package/esm2015/lib/components/stock/stock-information-grid/stock-information-grid.component.js +37 -29
- package/esm2015/lib/components/stock/stock-transfer/stock-transfer.component.js +1 -1
- package/esm2015/lib/components/stock/stock.component.js +18 -5
- package/esm2015/lib/components/stock/stock.module.js +3 -3
- package/esm2015/lib/enum/icon.enum.js +1 -1
- package/esm2015/lib/enum/language-code.enum.js +8 -0
- package/esm2015/lib/model/icon-svg.js +1 -1
- package/esm2015/lib/service/dictionary.service.js +76 -0
- package/esm2015/lib/service/options.service.js +71 -0
- package/esm2015/lib/service/shared-connector.service.js +262 -0
- package/esm2015/lib/service/shared.service.js +30 -0
- package/esm2015/lib/service/stock.service.js +37 -30
- package/esm2015/lib/utils/string-utils.js +64 -0
- package/esm2015/public-api.js +2 -1
- package/fesm2015/colijnit-sharedcomponents.js +462 -118
- package/fesm2015/colijnit-sharedcomponents.js.map +1 -1
- package/lib/assets/dictionary/text.properties.d.ts +3 -0
- package/lib/components/send-method-dialog/send-method-dialog.component.d.ts +24 -7
- package/lib/components/send-method-dialog/style/_layout.scss +5 -0
- package/lib/components/stock/stock-information/stock-information.component.d.ts +1 -1
- package/lib/components/stock/stock-information-grid/stock-information-grid.component.d.ts +6 -6
- package/lib/components/stock/stock-transfer/stock-transfer.component.d.ts +1 -1
- package/lib/components/stock/stock.component.d.ts +6 -2
- package/lib/components/stock/style/_layout.scss +6 -0
- package/lib/enum/language-code.enum.d.ts +6 -0
- package/lib/service/dictionary.service.d.ts +21 -0
- package/lib/service/options.service.d.ts +13 -0
- package/lib/service/{ione-connector-adapter.service.d.ts → shared-connector.service.d.ts} +9 -7
- package/lib/service/shared.service.d.ts +8 -0
- package/lib/service/stock.service.d.ts +9 -8
- package/lib/utils/string-utils.d.ts +22 -0
- package/package.json +1 -1
- package/public-api.d.ts +1 -0
- package/3rdpartylicenses.txt +0 -1116
- package/esm2015/lib/service/ione-connector-adapter.service.js +0 -251
- package/favicon.ico +0 -0
- package/index.html +0 -12
- package/main.5240c1941fea0abc7a9c.js +0 -1
- package/polyfills.4a44032b137d291298c3.js +0 -1
- package/runtime.f2046bab7c02026dc21f.js +0 -1
- package/styles.b3b98643e0f0f94bdd12.css +0 -110
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { __awaiter } from 'tslib';
|
|
2
2
|
import * as i0 from '@angular/core';
|
|
3
|
-
import { EventEmitter, Component, ViewEncapsulation, ViewChild, ElementRef, Input, Output, HostBinding, NgModule, Injectable, HostListener } from '@angular/core';
|
|
3
|
+
import { EventEmitter, Component, ViewEncapsulation, ViewChild, ElementRef, Input, Output, HostBinding, NgModule, Injectable, ChangeDetectorRef, HostListener } from '@angular/core';
|
|
4
4
|
import { trigger, state, style, transition, animate } from '@angular/animations';
|
|
5
5
|
import { PDFDocument } from 'pdf-lib';
|
|
6
6
|
import * as PDFJS from 'pdfjs-dist/legacy/build/pdf';
|
|
7
7
|
import pdfjsWorker from 'pdfjs-dist/build/pdf.worker.entry';
|
|
8
8
|
import { CommonModule } from '@angular/common';
|
|
9
9
|
import SignaturePad from 'signature_pad';
|
|
10
|
+
import { PrintStockStickers } from '@colijnit/sharedapi/build/model/print-stock-stickers';
|
|
10
11
|
import { Articles } from '@colijnit/articleapi/build/articles';
|
|
11
12
|
import { Sharedapi } from '@colijnit/sharedapi/build/sharedapi';
|
|
12
13
|
import { Printer } from '@colijnit/sharedapi/build/model/report/printer.bo';
|
|
@@ -23,21 +24,22 @@ import { MapPropertyDecorator } from '@colijnit/articleapi/build/factory/decorat
|
|
|
23
24
|
import { BooleanTextDecorator as BooleanTextDecorator$1 } from '@colijnit/articleapi/build/factory/decorators/boolean.decorator';
|
|
24
25
|
import { JsonFieldFieldDecorator } from '@colijnit/articleapi/build/factory/decorators/json.decorator';
|
|
25
26
|
import { ComplexArrayDecorator as ComplexArrayDecorator$1 } from '@colijnit/articleapi/build/factory/decorators/complex-array.decorator';
|
|
26
|
-
import {
|
|
27
|
-
import { ArticleStockBo } from '@colijnit/articleapi/build/model/article-stock.bo';
|
|
27
|
+
import { ArticleStock } from '@colijnit/articleapi/build/model/article-stock.bo';
|
|
28
28
|
import { StockHistoryBo } from '@colijnit/articleapi/build/model/stock-history.bo';
|
|
29
29
|
import { StockStickersPrintLayoutsBo } from '@colijnit/sharedapi/build/model/report/stock-stickers-print-layouts.bo';
|
|
30
30
|
import { ArticleDetailsBo } from '@colijnit/articleapi/build/model/article-details.bo';
|
|
31
31
|
import { StockStatus } from '@colijnit/articleapi/build/model/stock-status.bo';
|
|
32
32
|
import { StockManagementWarehouses } from '@colijnit/articleapi/build/model/stock-management-warehouses.bo';
|
|
33
33
|
import { StockLocation } from '@colijnit/articleapi/build/model/stock-location.bo';
|
|
34
|
-
import {
|
|
34
|
+
import { ArticleTransaction } from '@colijnit/articleapi/build/model/article-transaction.bo';
|
|
35
|
+
import { BehaviorSubject } from 'rxjs';
|
|
35
36
|
import { GetStockHistoryRequest } from '@colijnit/articleapi/build/model/get-stock-history-request';
|
|
36
|
-
import { ArticleStock } from '@colijnit/articleapi/build/model/article-stock';
|
|
37
|
+
import { ArticleStock as ArticleStock$1 } from '@colijnit/articleapi/build/model/article-stock';
|
|
37
38
|
import { CoDialogPromptModule, InputCheckboxModule, InputComboBoxModule, IconModule, InputNumberPickerModule, CoDialogWizardModule, ButtonModule, CoGridModule, InputRadioButtonModule, DropDownModule, SimpleGridModule, ImageModule, InputTextModule, InputTextareaModule } from '@colijnit/corecomponents_v12';
|
|
38
39
|
import * as i1 from '@angular/platform-browser';
|
|
39
40
|
import { DomSanitizer } from '@angular/platform-browser';
|
|
40
41
|
import { ArticleStockManagement } from '@colijnit/articleapi/build/model/article-stock-management';
|
|
42
|
+
import { ArticleTransaction as ArticleTransaction$1 } from '@colijnit/articleapi/build/model/article-transaction';
|
|
41
43
|
|
|
42
44
|
class DocsignComponent {
|
|
43
45
|
constructor() {
|
|
@@ -1048,23 +1050,234 @@ class BusinessObjectFactory {
|
|
|
1048
1050
|
}
|
|
1049
1051
|
}
|
|
1050
1052
|
|
|
1051
|
-
|
|
1053
|
+
var LanguageCode;
|
|
1054
|
+
(function (LanguageCode) {
|
|
1055
|
+
LanguageCode["Dutch"] = "nl-NL";
|
|
1056
|
+
LanguageCode["English"] = "en-GB";
|
|
1057
|
+
LanguageCode["German"] = "de-DE";
|
|
1058
|
+
LanguageCode["French"] = "fr-FR";
|
|
1059
|
+
})(LanguageCode || (LanguageCode = {}));
|
|
1060
|
+
|
|
1061
|
+
// Static utility functions holder related to strings.
|
|
1062
|
+
class StringUtils {
|
|
1063
|
+
/**
|
|
1064
|
+
* Returns a new string where given placeholder in given source string are replaced by given replacement texts.
|
|
1065
|
+
*
|
|
1066
|
+
* Example usage:
|
|
1067
|
+
*
|
|
1068
|
+
* source = "ABCDABCD"
|
|
1069
|
+
* placeholder = "BC"
|
|
1070
|
+
* replacementTexts = "Z", "Z" (REST arguments)
|
|
1071
|
+
* OUTPUT = "AZDAZD"
|
|
1072
|
+
*
|
|
1073
|
+
* @param {string} source
|
|
1074
|
+
* @param {string} placeholder
|
|
1075
|
+
* @param {string} replacementTexts If only one is given, this function replaces all placeholders with that single replacementText.
|
|
1076
|
+
* If more are given, placeholders without a corresponding replacementText will remain their original placeholder characters.
|
|
1077
|
+
*/
|
|
1078
|
+
static ReplaceOccurrencesIn(source, placeholder, ...replacementTexts) {
|
|
1079
|
+
// parameter guards
|
|
1080
|
+
if (!(source)) {
|
|
1081
|
+
return undefined;
|
|
1082
|
+
}
|
|
1083
|
+
if (!placeholder || replacementTexts.length === 0) {
|
|
1084
|
+
return source;
|
|
1085
|
+
}
|
|
1086
|
+
let outString = source;
|
|
1087
|
+
// one replacementText means replace for all
|
|
1088
|
+
if (replacementTexts.length === 1) {
|
|
1089
|
+
// "g" is the g flag to replace globally
|
|
1090
|
+
outString = outString.replace(placeholder, replacementTexts[0]);
|
|
1091
|
+
}
|
|
1092
|
+
else {
|
|
1093
|
+
// replace occurence i by replacementTexts[i], one at a time in loop (there might be a faster way..)
|
|
1094
|
+
for (let i = 0, len = replacementTexts.length; i < len; i++) {
|
|
1095
|
+
outString = outString.replace(placeholder, replacementTexts[i]);
|
|
1096
|
+
}
|
|
1097
|
+
}
|
|
1098
|
+
return outString;
|
|
1099
|
+
}
|
|
1100
|
+
// Returns the given argument as a string. Returns given defaultValue if conversion of argument to string was impossible.
|
|
1101
|
+
static ParseString(arg, defaultValue = "") {
|
|
1102
|
+
if (!StringUtils.IsString(arg)) {
|
|
1103
|
+
if (arg && typeof arg.toString === "function") {
|
|
1104
|
+
arg = arg.toString();
|
|
1105
|
+
}
|
|
1106
|
+
else {
|
|
1107
|
+
arg = defaultValue;
|
|
1108
|
+
}
|
|
1109
|
+
}
|
|
1110
|
+
return arg;
|
|
1111
|
+
}
|
|
1112
|
+
static IsString(str) {
|
|
1113
|
+
return typeof str === 'string';
|
|
1114
|
+
}
|
|
1115
|
+
// Returns whether given str is a string and has a length > 0.
|
|
1116
|
+
static IsStringWithLength(str) {
|
|
1117
|
+
return str && StringUtils.IsString(str) && str.length > 0;
|
|
1118
|
+
}
|
|
1119
|
+
// Returns given string, escaped for use as string literal in regular expressions.
|
|
1120
|
+
static _escapeRegExp(str) {
|
|
1121
|
+
return str; // .replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^$\|]/g, "\\$&");
|
|
1122
|
+
}
|
|
1123
|
+
}
|
|
1124
|
+
|
|
1125
|
+
class Dictionary {
|
|
1052
1126
|
constructor() {
|
|
1053
|
-
this.
|
|
1127
|
+
this.strings = {
|
|
1128
|
+
"nl": {},
|
|
1129
|
+
"de": {},
|
|
1130
|
+
"fr": {},
|
|
1131
|
+
"en": {},
|
|
1132
|
+
};
|
|
1133
|
+
}
|
|
1134
|
+
}
|
|
1135
|
+
|
|
1136
|
+
// The localization service, providing peers with text translation functionality.
|
|
1137
|
+
class DictionaryService {
|
|
1138
|
+
constructor() {
|
|
1139
|
+
this.dictionaryUrl = "js/browser/res/dictionary/";
|
|
1140
|
+
// private _dictionaryPromise: Map<LanguageCode, Promise<{ [key: string]: string }>> = new Map<LanguageCode, Promise<{ [key: string]: string }>>();
|
|
1141
|
+
this._dictionaries = new Map();
|
|
1142
|
+
// Some dictionary values have one or more '|~' texts in them, meant to be replaced with client-side given texts.
|
|
1143
|
+
this._placeholder = "|~";
|
|
1144
|
+
}
|
|
1145
|
+
get language() {
|
|
1146
|
+
return this._language;
|
|
1147
|
+
}
|
|
1148
|
+
set rootUrl(value) {
|
|
1149
|
+
this._rootUrl = value;
|
|
1150
|
+
this._dictBasePath = this._rootUrl + "/" + this.dictionaryUrl;
|
|
1151
|
+
}
|
|
1152
|
+
// Loads the dictionary for given language in memory.
|
|
1153
|
+
setDictionary(language) {
|
|
1154
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1155
|
+
this._language = language || LanguageCode.Dutch;
|
|
1156
|
+
this._loadDictionary();
|
|
1157
|
+
});
|
|
1158
|
+
}
|
|
1159
|
+
_loadDictionary() {
|
|
1160
|
+
if (!this._dictionaries.has(this._language)) {
|
|
1161
|
+
const dictionary = new Dictionary();
|
|
1162
|
+
// eslint-disable-next-line no-magic-numbers
|
|
1163
|
+
if (dictionary.strings[this._language.substr(0, 2).toLowerCase()] !== undefined) {
|
|
1164
|
+
// eslint-disable-next-line no-magic-numbers
|
|
1165
|
+
this._dictionaries.set(this._language, dictionary.strings[this._language.substr(0, 2).toLowerCase()]);
|
|
1166
|
+
}
|
|
1167
|
+
}
|
|
1168
|
+
}
|
|
1169
|
+
/**
|
|
1170
|
+
* Returns the localized text for the given dictionary key.
|
|
1171
|
+
* @param {string} key
|
|
1172
|
+
* @param {boolean} [upperCaseFirst = true] False for first letter lowercase, true for first letter uppercase for returned dict val
|
|
1173
|
+
* @param {string[]} replacementTexts Rest params for replacement of '|~' in returned dict value
|
|
1174
|
+
* @returns {string} The translated text for given dictionary key
|
|
1175
|
+
*/
|
|
1176
|
+
get(key, upperCaseFirst = true, ...replacementTexts) {
|
|
1177
|
+
if (!StringUtils.IsStringWithLength(key)) {
|
|
1178
|
+
return key || "";
|
|
1179
|
+
}
|
|
1180
|
+
if (this.language === undefined) {
|
|
1181
|
+
this._language = LanguageCode.Dutch;
|
|
1182
|
+
this._loadDictionary();
|
|
1183
|
+
}
|
|
1184
|
+
let text = this._dictionaries.get(this.language)[key];
|
|
1185
|
+
text = StringUtils.IsStringWithLength(text) ? text : key;
|
|
1186
|
+
if (upperCaseFirst) {
|
|
1187
|
+
text = text.charAt(0).toUpperCase() + text.slice(1);
|
|
1188
|
+
}
|
|
1189
|
+
else {
|
|
1190
|
+
text = text.charAt(0).toLowerCase() + text.slice(1);
|
|
1191
|
+
}
|
|
1192
|
+
if (replacementTexts.length > 0) {
|
|
1193
|
+
text = StringUtils.ReplaceOccurrencesIn(text, this._placeholder, ...replacementTexts);
|
|
1194
|
+
}
|
|
1195
|
+
return text;
|
|
1196
|
+
}
|
|
1197
|
+
}
|
|
1198
|
+
DictionaryService.ɵprov = i0.ɵɵdefineInjectable({ factory: function DictionaryService_Factory() { return new DictionaryService(); }, token: DictionaryService, providedIn: "root" });
|
|
1199
|
+
DictionaryService.decorators = [
|
|
1200
|
+
{ type: Injectable, args: [{
|
|
1201
|
+
providedIn: "root"
|
|
1202
|
+
},] }
|
|
1203
|
+
];
|
|
1204
|
+
DictionaryService.ctorParameters = () => [];
|
|
1205
|
+
|
|
1206
|
+
class OptionsService {
|
|
1207
|
+
constructor(_dictionary) {
|
|
1208
|
+
this._dictionary = _dictionary;
|
|
1209
|
+
this.optionsInitialized = new BehaviorSubject(false);
|
|
1210
|
+
this.optionsLoaded = new BehaviorSubject(false);
|
|
1211
|
+
}
|
|
1212
|
+
set options(value) {
|
|
1213
|
+
this._options = value;
|
|
1214
|
+
}
|
|
1215
|
+
get options() {
|
|
1216
|
+
return this._options;
|
|
1217
|
+
}
|
|
1218
|
+
createSettingsFromObject(obj) {
|
|
1219
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1220
|
+
this.options = new Object();
|
|
1221
|
+
if (obj.hasOwnProperty("url")) {
|
|
1222
|
+
this.options.url = obj["url"];
|
|
1223
|
+
}
|
|
1224
|
+
if (obj.hasOwnProperty("schema")) {
|
|
1225
|
+
this.options.schema = obj["schema"];
|
|
1226
|
+
}
|
|
1227
|
+
if (obj.hasOwnProperty("version")) {
|
|
1228
|
+
this.options.version = obj["version"];
|
|
1229
|
+
}
|
|
1230
|
+
if (obj.hasOwnProperty("languageCode")) {
|
|
1231
|
+
this.options.languageCode = obj["languageCode"];
|
|
1232
|
+
}
|
|
1233
|
+
else {
|
|
1234
|
+
this.options.languageCode = "NL";
|
|
1235
|
+
}
|
|
1236
|
+
if (obj.hasOwnProperty("username")) {
|
|
1237
|
+
this.options.username = obj["username"];
|
|
1238
|
+
}
|
|
1239
|
+
if (obj.hasOwnProperty("password")) {
|
|
1240
|
+
this.options.password = obj["password"];
|
|
1241
|
+
}
|
|
1242
|
+
if (obj.hasOwnProperty("session")) {
|
|
1243
|
+
this.options.session = obj["session"];
|
|
1244
|
+
}
|
|
1245
|
+
if (obj.hasOwnProperty("useLoginEncryption")) {
|
|
1246
|
+
this.options.useLoginEncryption = obj["useLoginEncryption"];
|
|
1247
|
+
}
|
|
1248
|
+
this.optionsLoaded.next(true);
|
|
1249
|
+
});
|
|
1054
1250
|
}
|
|
1055
|
-
|
|
1251
|
+
initialize(options) {
|
|
1056
1252
|
return __awaiter(this, void 0, void 0, function* () {
|
|
1057
|
-
if (
|
|
1058
|
-
this.options
|
|
1059
|
-
this.
|
|
1060
|
-
this.
|
|
1061
|
-
this.options.session = this.connector.session && this.sharedConnector.session;
|
|
1253
|
+
if (options) {
|
|
1254
|
+
yield this.createSettingsFromObject(options);
|
|
1255
|
+
yield this._dictionary.setDictionary(this.options.languageCode);
|
|
1256
|
+
this.optionsInitialized.next(true);
|
|
1062
1257
|
}
|
|
1063
1258
|
});
|
|
1064
1259
|
}
|
|
1065
|
-
|
|
1260
|
+
}
|
|
1261
|
+
OptionsService.ɵprov = i0.ɵɵdefineInjectable({ factory: function OptionsService_Factory() { return new OptionsService(i0.ɵɵinject(DictionaryService)); }, token: OptionsService, providedIn: "root" });
|
|
1262
|
+
OptionsService.decorators = [
|
|
1263
|
+
{ type: Injectable, args: [{
|
|
1264
|
+
providedIn: "root"
|
|
1265
|
+
},] }
|
|
1266
|
+
];
|
|
1267
|
+
OptionsService.ctorParameters = () => [
|
|
1268
|
+
{ type: DictionaryService }
|
|
1269
|
+
];
|
|
1270
|
+
|
|
1271
|
+
class SharedConnectorService {
|
|
1272
|
+
constructor(_optionsService) {
|
|
1273
|
+
this._optionsService = _optionsService;
|
|
1274
|
+
this._boFactory = new BusinessObjectFactory();
|
|
1275
|
+
}
|
|
1276
|
+
connect() {
|
|
1066
1277
|
return __awaiter(this, void 0, void 0, function* () {
|
|
1067
|
-
this.
|
|
1278
|
+
this.connector = new Articles(this._optionsService.options);
|
|
1279
|
+
this.sharedConnector = new Sharedapi(this._optionsService.options);
|
|
1280
|
+
this._optionsService.options.session = this.connector.session && this.sharedConnector.session;
|
|
1068
1281
|
});
|
|
1069
1282
|
}
|
|
1070
1283
|
getAllPrinters(showAll = true) {
|
|
@@ -1099,22 +1312,19 @@ class IoneConnectorAdapterService {
|
|
|
1099
1312
|
});
|
|
1100
1313
|
});
|
|
1101
1314
|
}
|
|
1102
|
-
getStockStickerPrintLayouts(stockStickersPrintLayoutsBo) {
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
});
|
|
1116
|
-
});
|
|
1117
|
-
}
|
|
1315
|
+
// public async getStockStickerPrintLayouts(stockStickersPrintLayoutsBo: StockStickersPrintLayoutsBo): Promise<StockStickersPrintLayoutsBo[]> {
|
|
1316
|
+
// return new Promise((resolve: Function, reject: Function) => {
|
|
1317
|
+
// return this.sharedConnector.getStockStickerPrintLayouts(stockStickersPrintLayoutsBo).then((result: DataServiceResponse) => {
|
|
1318
|
+
// if (result.validationResult && result.validationResult.success) {
|
|
1319
|
+
// if (result.resultObject) {
|
|
1320
|
+
// resolve(this._boFactory.makeWithRawBackendData(stockStickersPrintLayoutsBo, result.resultObject));
|
|
1321
|
+
// }
|
|
1322
|
+
// } else {
|
|
1323
|
+
// reject(result.validationMessagesAsString);
|
|
1324
|
+
// }
|
|
1325
|
+
// })
|
|
1326
|
+
// })
|
|
1327
|
+
// }
|
|
1118
1328
|
getArticleFullObject(goodId) {
|
|
1119
1329
|
return __awaiter(this, void 0, void 0, function* () {
|
|
1120
1330
|
return new Promise((resolve, reject) => {
|
|
@@ -1152,7 +1362,7 @@ class IoneConnectorAdapterService {
|
|
|
1152
1362
|
return this.connector.getStockInformation(data).then((result) => {
|
|
1153
1363
|
if (result.validationResult && result.validationResult.success) {
|
|
1154
1364
|
if (result.resultObjects) {
|
|
1155
|
-
resolve(this._boFactory.makeBOArrayFromRawBackendDataArray(
|
|
1365
|
+
resolve(this._boFactory.makeBOArrayFromRawBackendDataArray(ArticleStock, result.resultObjects));
|
|
1156
1366
|
}
|
|
1157
1367
|
}
|
|
1158
1368
|
else {
|
|
@@ -1272,106 +1482,161 @@ class IoneConnectorAdapterService {
|
|
|
1272
1482
|
});
|
|
1273
1483
|
});
|
|
1274
1484
|
}
|
|
1485
|
+
getArticleTransaction(data) {
|
|
1486
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1487
|
+
return new Promise((resolve, reject) => {
|
|
1488
|
+
return this.connector.getArticleTransaction(data).then((result) => {
|
|
1489
|
+
if (result.validationResult && result.validationResult.success) {
|
|
1490
|
+
if (result.resultObjects) {
|
|
1491
|
+
resolve(this._boFactory.makeBOArrayFromRawBackendDataArray(ArticleTransaction, result.resultObjects));
|
|
1492
|
+
}
|
|
1493
|
+
}
|
|
1494
|
+
else {
|
|
1495
|
+
reject(result.validationMessagesAsString);
|
|
1496
|
+
}
|
|
1497
|
+
});
|
|
1498
|
+
});
|
|
1499
|
+
});
|
|
1500
|
+
}
|
|
1275
1501
|
commit() {
|
|
1276
1502
|
return this.connector.commit();
|
|
1277
1503
|
}
|
|
1278
1504
|
}
|
|
1279
|
-
|
|
1280
|
-
|
|
1505
|
+
SharedConnectorService.ɵprov = i0.ɵɵdefineInjectable({ factory: function SharedConnectorService_Factory() { return new SharedConnectorService(i0.ɵɵinject(OptionsService)); }, token: SharedConnectorService, providedIn: "root" });
|
|
1506
|
+
SharedConnectorService.decorators = [
|
|
1507
|
+
{ type: Injectable, args: [{
|
|
1508
|
+
providedIn: "root"
|
|
1509
|
+
},] }
|
|
1510
|
+
];
|
|
1511
|
+
SharedConnectorService.ctorParameters = () => [
|
|
1512
|
+
{ type: OptionsService }
|
|
1513
|
+
];
|
|
1514
|
+
|
|
1515
|
+
class SharedService {
|
|
1516
|
+
constructor(options, connector) {
|
|
1517
|
+
this.options = options;
|
|
1518
|
+
this.connector = connector;
|
|
1519
|
+
}
|
|
1520
|
+
init(options) {
|
|
1521
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1522
|
+
yield this.options.initialize(options);
|
|
1523
|
+
this.connector.connect();
|
|
1524
|
+
});
|
|
1525
|
+
}
|
|
1526
|
+
}
|
|
1527
|
+
SharedService.ɵprov = i0.ɵɵdefineInjectable({ factory: function SharedService_Factory() { return new SharedService(i0.ɵɵinject(OptionsService), i0.ɵɵinject(SharedConnectorService)); }, token: SharedService, providedIn: "root" });
|
|
1528
|
+
SharedService.decorators = [
|
|
1281
1529
|
{ type: Injectable, args: [{
|
|
1282
1530
|
providedIn: "root"
|
|
1283
1531
|
},] }
|
|
1284
1532
|
];
|
|
1285
|
-
|
|
1533
|
+
SharedService.ctorParameters = () => [
|
|
1534
|
+
{ type: OptionsService },
|
|
1535
|
+
{ type: SharedConnectorService }
|
|
1536
|
+
];
|
|
1286
1537
|
|
|
1287
|
-
class StockService {
|
|
1288
|
-
constructor(
|
|
1289
|
-
|
|
1538
|
+
class StockService extends SharedService {
|
|
1539
|
+
constructor() {
|
|
1540
|
+
super(...arguments);
|
|
1541
|
+
this.printSticker = new PrintStockStickers();
|
|
1290
1542
|
}
|
|
1291
|
-
|
|
1292
|
-
this
|
|
1543
|
+
getPrintStockStickers(data) {
|
|
1544
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1545
|
+
yield this.connector.getPrintStockStickers(data);
|
|
1546
|
+
});
|
|
1293
1547
|
}
|
|
1294
|
-
// public async getPrintStockStickers(data: PrintStockStickers): Promise<void> {
|
|
1295
|
-
// await this._connector.getPrintStockStickers(data);
|
|
1296
|
-
// }
|
|
1297
1548
|
getAllPrinters(showAll = true) {
|
|
1298
1549
|
return __awaiter(this, void 0, void 0, function* () {
|
|
1299
|
-
return yield this.
|
|
1550
|
+
return yield this.connector.getAllPrinters(showAll);
|
|
1300
1551
|
});
|
|
1301
1552
|
}
|
|
1302
1553
|
getStockHistory(data) {
|
|
1303
1554
|
return __awaiter(this, void 0, void 0, function* () {
|
|
1304
|
-
return yield this.
|
|
1555
|
+
return yield this.connector.getStockHistory(data);
|
|
1305
1556
|
});
|
|
1306
1557
|
}
|
|
1307
1558
|
getStockInformation(data) {
|
|
1308
1559
|
return __awaiter(this, void 0, void 0, function* () {
|
|
1309
|
-
return yield this.
|
|
1310
|
-
});
|
|
1311
|
-
}
|
|
1312
|
-
getStockStickerPrintLayouts(data) {
|
|
1313
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
1314
|
-
return yield this._connector.getStockStickerPrintLayouts(data);
|
|
1560
|
+
return yield this.connector.getStockInformation(data);
|
|
1315
1561
|
});
|
|
1316
1562
|
}
|
|
1563
|
+
// public async getStockStickerPrintLayouts(data: StockStickersPrintLayoutsBo): Promise<StockStickersPrintLayoutsBo[]> {
|
|
1564
|
+
// return await this._connector.getStockStickerPrintLayouts(data);
|
|
1565
|
+
// }
|
|
1317
1566
|
getArticleDetails(data) {
|
|
1318
1567
|
return __awaiter(this, void 0, void 0, function* () {
|
|
1319
|
-
return yield this.
|
|
1568
|
+
return yield this.connector.getArticleDetails(data);
|
|
1320
1569
|
});
|
|
1321
1570
|
}
|
|
1322
1571
|
updateArticleDetails(data) {
|
|
1323
1572
|
return __awaiter(this, void 0, void 0, function* () {
|
|
1324
|
-
return yield this.
|
|
1573
|
+
return yield this.connector.updateArticleDetails(data);
|
|
1325
1574
|
});
|
|
1326
1575
|
}
|
|
1327
1576
|
getStockState() {
|
|
1328
1577
|
return __awaiter(this, void 0, void 0, function* () {
|
|
1329
|
-
return yield this.
|
|
1578
|
+
return yield this.connector.getStockStatus();
|
|
1330
1579
|
});
|
|
1331
1580
|
}
|
|
1332
1581
|
getStockStickerTemplates(data) {
|
|
1333
1582
|
return __awaiter(this, void 0, void 0, function* () {
|
|
1334
|
-
return yield this.
|
|
1583
|
+
return yield this.connector.getStockStickerTemplates(data);
|
|
1335
1584
|
});
|
|
1336
1585
|
}
|
|
1337
1586
|
getStockManagementWarehouses() {
|
|
1338
1587
|
return __awaiter(this, void 0, void 0, function* () {
|
|
1339
|
-
return yield this.
|
|
1588
|
+
return yield this.connector.getStockManagementWarehouses();
|
|
1340
1589
|
});
|
|
1341
1590
|
}
|
|
1342
1591
|
getStockManagementLocations(warehouseNo) {
|
|
1343
1592
|
return __awaiter(this, void 0, void 0, function* () {
|
|
1344
|
-
return yield this.
|
|
1593
|
+
return yield this.connector.getStockManagementLocations(warehouseNo);
|
|
1594
|
+
});
|
|
1595
|
+
}
|
|
1596
|
+
getArticleTransaction(data) {
|
|
1597
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1598
|
+
return yield this.connector.getArticleTransaction(data);
|
|
1345
1599
|
});
|
|
1346
1600
|
}
|
|
1347
1601
|
lockArticleDetails(data) {
|
|
1348
1602
|
return __awaiter(this, void 0, void 0, function* () {
|
|
1349
|
-
return yield this.
|
|
1603
|
+
return yield this.connector.lockArticleDetails(data);
|
|
1350
1604
|
});
|
|
1351
1605
|
}
|
|
1352
1606
|
commit() {
|
|
1353
|
-
return this.
|
|
1607
|
+
return this.connector.commit();
|
|
1354
1608
|
}
|
|
1355
1609
|
}
|
|
1610
|
+
StockService.ɵprov = i0.ɵɵdefineInjectable({ factory: function StockService_Factory() { return new StockService(i0.ɵɵinject(OptionsService), i0.ɵɵinject(SharedConnectorService)); }, token: StockService, providedIn: "root" });
|
|
1356
1611
|
StockService.decorators = [
|
|
1357
|
-
{ type: Injectable
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
{ type: IoneConnectorAdapterService }
|
|
1612
|
+
{ type: Injectable, args: [{
|
|
1613
|
+
providedIn: 'root',
|
|
1614
|
+
},] }
|
|
1361
1615
|
];
|
|
1362
1616
|
|
|
1363
1617
|
class StockComponent {
|
|
1364
|
-
constructor(stockService) {
|
|
1618
|
+
constructor(stockService, _optionsService) {
|
|
1365
1619
|
this.stockService = stockService;
|
|
1620
|
+
this._optionsService = _optionsService;
|
|
1366
1621
|
this.handleStickerClicked = new EventEmitter();
|
|
1367
1622
|
this.showStockInformationGrid = true;
|
|
1368
1623
|
this.showStockLocation = false;
|
|
1369
1624
|
this.showStockTransfer = false;
|
|
1370
1625
|
this.allAvailableStock = 0;
|
|
1371
1626
|
this.allTechnicalStock = 0;
|
|
1627
|
+
this._publicOptions = true;
|
|
1372
1628
|
}
|
|
1373
1629
|
set options(value) {
|
|
1374
|
-
|
|
1630
|
+
if (value) {
|
|
1631
|
+
if (typeof value === "string") {
|
|
1632
|
+
this._options = JSON.parse(value);
|
|
1633
|
+
}
|
|
1634
|
+
else {
|
|
1635
|
+
this._options = value;
|
|
1636
|
+
}
|
|
1637
|
+
this._publicOptions = true;
|
|
1638
|
+
this._optionsService.initialize(this._options).then();
|
|
1639
|
+
}
|
|
1375
1640
|
}
|
|
1376
1641
|
set article(article) {
|
|
1377
1642
|
this.articleExtended = article;
|
|
@@ -1389,7 +1654,7 @@ class StockComponent {
|
|
|
1389
1654
|
this.stockTransferArticleDetails = event;
|
|
1390
1655
|
this.showStockTransfer = !this.showStockTransfer;
|
|
1391
1656
|
this.showStockInformationGrid = !this.showStockInformationGrid;
|
|
1392
|
-
this.stockService.stockStickers = new PrintStockStickers
|
|
1657
|
+
this.stockService.stockStickers = new PrintStockStickers();
|
|
1393
1658
|
}
|
|
1394
1659
|
backToStock() {
|
|
1395
1660
|
this.showStockTransfer = !this.showStockTransfer;
|
|
@@ -1405,7 +1670,7 @@ class StockComponent {
|
|
|
1405
1670
|
}
|
|
1406
1671
|
getStockInformation(data) {
|
|
1407
1672
|
return __awaiter(this, void 0, void 0, function* () {
|
|
1408
|
-
const articleData = new ArticleStock();
|
|
1673
|
+
const articleData = new ArticleStock$1();
|
|
1409
1674
|
articleData.goodId = data.goodId.toString();
|
|
1410
1675
|
articleData.viewKind = "M";
|
|
1411
1676
|
this.stockInformation = yield this.stockService.getStockInformation(articleData);
|
|
@@ -1454,7 +1719,8 @@ StockComponent.decorators = [
|
|
|
1454
1719
|
},] }
|
|
1455
1720
|
];
|
|
1456
1721
|
StockComponent.ctorParameters = () => [
|
|
1457
|
-
{ type: StockService }
|
|
1722
|
+
{ type: StockService },
|
|
1723
|
+
{ type: OptionsService }
|
|
1458
1724
|
];
|
|
1459
1725
|
StockComponent.propDecorators = {
|
|
1460
1726
|
stock: [{ type: ViewChild, args: [StockComponent,] }],
|
|
@@ -1611,7 +1877,7 @@ class StockInformationGridComponent {
|
|
|
1611
1877
|
this.showSendMethodDialog = false;
|
|
1612
1878
|
this.hideOrShowTabs = true;
|
|
1613
1879
|
this.dataWareHouseFields = { text: "warehouseDescription", value: "warehouseNo" };
|
|
1614
|
-
this.articleStockSearchInfo = new ArticleStock();
|
|
1880
|
+
this.articleStockSearchInfo = new ArticleStock$1();
|
|
1615
1881
|
this.showChangeStockDetails = false;
|
|
1616
1882
|
this.articleDetailsInformation = new ArticleStockManagement();
|
|
1617
1883
|
this.tabs = [
|
|
@@ -1647,13 +1913,13 @@ class StockInformationGridComponent {
|
|
|
1647
1913
|
this.articleStockSearchInfo.goodId = data.goodId.toString();
|
|
1648
1914
|
this.articleStockSearchInfo.wareHouseNo = data.warehouseNo.toString();
|
|
1649
1915
|
this.articleStockSearchInfo.viewKind = "D";
|
|
1916
|
+
this.selectedWarehouse = data.warehouseNo;
|
|
1650
1917
|
if (!this.dataWareHouseCode) {
|
|
1651
1918
|
this.getStockManagementWarehouses(data);
|
|
1652
1919
|
}
|
|
1653
1920
|
this.getArticleDetails(data);
|
|
1654
1921
|
this.hideOrShowTabs = false;
|
|
1655
1922
|
this.hideOrShowLocationTab = true;
|
|
1656
|
-
console.log(this.articleDetailsInformation);
|
|
1657
1923
|
this._stockService.lockArticleDetails(this.articleDetailsInformation);
|
|
1658
1924
|
}
|
|
1659
1925
|
handleHistoryClick() {
|
|
@@ -1675,15 +1941,16 @@ class StockInformationGridComponent {
|
|
|
1675
1941
|
this.activeTab = this.tabs[0];
|
|
1676
1942
|
this.hideOrShowTabs = true;
|
|
1677
1943
|
this.hideOrShowLocationTab = false;
|
|
1944
|
+
this.articleDetails = undefined;
|
|
1678
1945
|
});
|
|
1679
1946
|
}
|
|
1680
|
-
openSendMethodDialog() {
|
|
1947
|
+
openSendMethodDialog(data) {
|
|
1948
|
+
this._stockService.printSticker.goodId = data.goodId;
|
|
1949
|
+
this._stockService.printSticker.warehouse = data.warehouseNo;
|
|
1681
1950
|
this.showSendMethodDialog = !this.showSendMethodDialog;
|
|
1682
1951
|
}
|
|
1683
1952
|
printStockStickers() {
|
|
1684
|
-
this.printSticker
|
|
1685
|
-
this.printSticker.goodId = 10;
|
|
1686
|
-
// this._stockService.getPrintStockStickers(this.printSticker);
|
|
1953
|
+
this._stockService.getPrintStockStickers(this._stockService.printSticker);
|
|
1687
1954
|
}
|
|
1688
1955
|
onOkClick() {
|
|
1689
1956
|
}
|
|
@@ -1710,8 +1977,7 @@ class StockInformationGridComponent {
|
|
|
1710
1977
|
}
|
|
1711
1978
|
onSelectWarehouse(event) {
|
|
1712
1979
|
this.articleDetailsInformation.warehouseNumber = event;
|
|
1713
|
-
|
|
1714
|
-
if (this.dataWareHouseCode != null) {
|
|
1980
|
+
if (this.selectedWarehouse || this.selectedWarehouse === 0) {
|
|
1715
1981
|
this._stockService.getArticleDetails(this.articleDetailsInformation).then((details) => {
|
|
1716
1982
|
this.articleDetails = details;
|
|
1717
1983
|
});
|
|
@@ -1719,22 +1985,23 @@ class StockInformationGridComponent {
|
|
|
1719
1985
|
}
|
|
1720
1986
|
getInOrderData() {
|
|
1721
1987
|
return __awaiter(this, void 0, void 0, function* () {
|
|
1722
|
-
const inOrderData = new
|
|
1723
|
-
inOrderData.type = "
|
|
1988
|
+
const inOrderData = new ArticleTransaction$1();
|
|
1989
|
+
inOrderData.type = "V";
|
|
1724
1990
|
inOrderData.goodId = this.articleStockInformation[0].goodId.toString();
|
|
1725
|
-
|
|
1726
|
-
this.inOrderInformation
|
|
1991
|
+
this.inOrderInformation = yield this._stockService.getArticleTransaction(inOrderData);
|
|
1992
|
+
console.log(this.inOrderInformation);
|
|
1727
1993
|
});
|
|
1728
1994
|
}
|
|
1729
1995
|
getOrderData() {
|
|
1730
1996
|
return __awaiter(this, void 0, void 0, function* () {
|
|
1731
|
-
const
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
this.orderInformation = yield this._stockService.getStockHistory(inOrderData);
|
|
1997
|
+
const orderData = new ArticleTransaction$1();
|
|
1998
|
+
orderData.type = "V";
|
|
1999
|
+
orderData.goodId = this.articleStockInformation[0].goodId.toString();
|
|
2000
|
+
this.orderInformation = yield this._stockService.getArticleTransaction(orderData);
|
|
1736
2001
|
});
|
|
1737
2002
|
}
|
|
2003
|
+
addNewRow() {
|
|
2004
|
+
}
|
|
1738
2005
|
}
|
|
1739
2006
|
StockInformationGridComponent.decorators = [
|
|
1740
2007
|
{ type: Component, args: [{
|
|
@@ -1757,6 +2024,11 @@ StockInformationGridComponent.decorators = [
|
|
|
1757
2024
|
<div class="stock-grid">
|
|
1758
2025
|
<co-simple-grid *ngIf="activeTab === tabs[0] && hideOrShowTabs"
|
|
1759
2026
|
[data]="articleStockInformation"
|
|
2027
|
+
class="simple-grid"
|
|
2028
|
+
[showAdd]="true"
|
|
2029
|
+
[showToolbar]="true"
|
|
2030
|
+
(addRow)="addNewRow()"
|
|
2031
|
+
[inlineEdit]="true"
|
|
1760
2032
|
>
|
|
1761
2033
|
<co-simple-grid-column [headerText]="'WAREHOUSE'" [field]="'warehouseNo'" [order]="10"></co-simple-grid-column>
|
|
1762
2034
|
<co-simple-grid-column [headerText]="'DESCRIPTION'" [field]="'warehouseName'" [order]="11"></co-simple-grid-column>
|
|
@@ -1772,15 +2044,15 @@ StockInformationGridComponent.decorators = [
|
|
|
1772
2044
|
|
|
1773
2045
|
<co-simple-grid *ngIf="activeTab === tabs[1]"
|
|
1774
2046
|
[data]="inOrderInformation"
|
|
2047
|
+
class="simple-grid"
|
|
1775
2048
|
>
|
|
1776
|
-
<co-simple-grid-column [headerText]="'IN_ORDER2'" [field]="'
|
|
2049
|
+
<co-simple-grid-column [headerText]="'IN_ORDER2'" [field]="'transactionNr'"></co-simple-grid-column>
|
|
1777
2050
|
<co-simple-grid-column [headerText]="'CUSTOMER'" [field]="'user'"></co-simple-grid-column>
|
|
1778
|
-
<co-simple-grid-column [headerText]="'DATE'" [field]="'
|
|
1779
|
-
<co-simple-grid-column [headerText]="'AMOUNT'" [field]="'
|
|
2051
|
+
<co-simple-grid-column [headerText]="'DATE'" [field]="'transactionDate'"></co-simple-grid-column>
|
|
2052
|
+
<co-simple-grid-column [headerText]="'AMOUNT'" [field]="'amountInOrder'"></co-simple-grid-column>
|
|
1780
2053
|
<co-simple-grid-column [headerText]="'WAREHOUSE'" [field]="'wareHouseNr'"></co-simple-grid-column>
|
|
1781
2054
|
<co-simple-grid-column [headerText]="'DESCRIPTION'" [field]="'locationNr'"></co-simple-grid-column>
|
|
1782
2055
|
<co-simple-grid-column [headerText]="'STOCK'" [field]="'amountInStock'"></co-simple-grid-column>
|
|
1783
|
-
<co-simple-grid-column [headerText]="'COMMISSION2'" [field]="'commission'"></co-simple-grid-column>
|
|
1784
2056
|
<co-simple-grid-column [headerText]="'TRANSFER'" [field]="'transfer'">
|
|
1785
2057
|
<ng-template #template let-row="row">
|
|
1786
2058
|
<co-icon class="menu-icon" [iconData]="iconCacheService.getIcon(icons.DeliveryTruck)" (click)="handleStockTransferClick($event)"></co-icon>
|
|
@@ -1788,17 +2060,18 @@ StockInformationGridComponent.decorators = [
|
|
|
1788
2060
|
</co-simple-grid-column>
|
|
1789
2061
|
<co-simple-grid-column [headerText]="'STICKER'" [field]="'sticker'">
|
|
1790
2062
|
<ng-template #template let-row="row">
|
|
1791
|
-
<co-icon class="menu-icon" [iconData]="iconCacheService.getIcon(icons.Print)" (click)="openSendMethodDialog()"></co-icon>
|
|
2063
|
+
<co-icon class="menu-icon" [iconData]="iconCacheService.getIcon(icons.Print)" (click)="openSendMethodDialog(row)"></co-icon>
|
|
1792
2064
|
</ng-template>
|
|
1793
2065
|
</co-simple-grid-column>
|
|
1794
2066
|
</co-simple-grid>
|
|
1795
2067
|
|
|
1796
2068
|
<co-simple-grid *ngIf="activeTab === tabs[2]"
|
|
1797
2069
|
[data]="orderInformation"
|
|
2070
|
+
class="simple-grid"
|
|
1798
2071
|
>
|
|
1799
|
-
<co-simple-grid-column [headerText]="'PURCHASE_ORDER_NR'" [field]="'
|
|
1800
|
-
<co-simple-grid-column [headerText]="'DATE'" [field]="'
|
|
1801
|
-
<co-simple-grid-column [headerText]="'AMOUNT'" [field]="'
|
|
2072
|
+
<co-simple-grid-column [headerText]="'PURCHASE_ORDER_NR'" [field]="'transactionNr'"></co-simple-grid-column>
|
|
2073
|
+
<co-simple-grid-column [headerText]="'DATE'" [field]="'transactionDate'"></co-simple-grid-column>
|
|
2074
|
+
<co-simple-grid-column [headerText]="'AMOUNT'" [field]="'amountInOrder'"></co-simple-grid-column>
|
|
1802
2075
|
<co-simple-grid-column [headerText]="'RESERVED'" [field]="'reserved'"></co-simple-grid-column>
|
|
1803
2076
|
<co-simple-grid-column [headerText]="'FREE_STOCK'" [field]="'freeStock'"></co-simple-grid-column>
|
|
1804
2077
|
<co-simple-grid-column [headerText]="'DELIVERY_DATE1'" [field]="'deliveryDate'"></co-simple-grid-column>
|
|
@@ -1824,6 +2097,7 @@ StockInformationGridComponent.decorators = [
|
|
|
1824
2097
|
|
|
1825
2098
|
<!-- TODO move to own component stock-location-->
|
|
1826
2099
|
<co-simple-grid [data]="articleDetails"
|
|
2100
|
+
class="simple-grid"
|
|
1827
2101
|
>
|
|
1828
2102
|
<div class="stock-location-group">
|
|
1829
2103
|
<div class="stock-location-left-group">
|
|
@@ -1853,7 +2127,7 @@ StockInformationGridComponent.decorators = [
|
|
|
1853
2127
|
</co-simple-grid-column>
|
|
1854
2128
|
<co-simple-grid-column [headerText]="'STICKER'" [field]="'sticker'">
|
|
1855
2129
|
<ng-template #template let-row="row">
|
|
1856
|
-
<co-icon class="menu-icon" [iconData]="iconCacheService.getIcon(icons.Print)" (click)="openSendMethodDialog()"></co-icon>
|
|
2130
|
+
<co-icon class="menu-icon" [iconData]="iconCacheService.getIcon(icons.Print)" (click)="openSendMethodDialog(row)"></co-icon>
|
|
1857
2131
|
</ng-template>
|
|
1858
2132
|
</co-simple-grid-column>
|
|
1859
2133
|
</co-simple-grid>
|
|
@@ -1870,6 +2144,7 @@ StockInformationGridComponent.decorators = [
|
|
|
1870
2144
|
<span class="stock-button-back" [textContent]="'BACK_TO_STOCK_LINES'" (click)="backToStockInformation()"></span>
|
|
1871
2145
|
</div>
|
|
1872
2146
|
<co-simple-grid [data]="stockHistoryInformation"
|
|
2147
|
+
class="simple-grid"
|
|
1873
2148
|
>
|
|
1874
2149
|
<co-simple-grid-column [headerText]="'MUTATION_DATE'" [field]="'mutationDate'"></co-simple-grid-column>
|
|
1875
2150
|
<co-simple-grid-column [headerText]="'MUTATION_TIME'" [field]="'mutationTime'"></co-simple-grid-column>
|
|
@@ -1887,7 +2162,7 @@ StockInformationGridComponent.decorators = [
|
|
|
1887
2162
|
<co-simple-grid-column [headerText]="'MUTATION_TYPE'" [field]="'mutationType'"></co-simple-grid-column>
|
|
1888
2163
|
<co-simple-grid-column [headerText]="'STICKER'" [field]="'sticker'">
|
|
1889
2164
|
<ng-template #template let-row="row">
|
|
1890
|
-
<co-icon class="menu-icon" [iconData]="iconCacheService.getIcon(icons.Print)" (click)="openSendMethodDialog()"></co-icon>
|
|
2165
|
+
<co-icon class="menu-icon" [iconData]="iconCacheService.getIcon(icons.Print)" (click)="openSendMethodDialog(row)"></co-icon>
|
|
1891
2166
|
</ng-template>
|
|
1892
2167
|
</co-simple-grid-column>
|
|
1893
2168
|
</co-simple-grid>
|
|
@@ -2124,46 +2399,81 @@ var SendOption;
|
|
|
2124
2399
|
})(SendOption || (SendOption = {}));
|
|
2125
2400
|
|
|
2126
2401
|
class SendMethodDialogComponent {
|
|
2127
|
-
constructor(iconCacheService,
|
|
2402
|
+
constructor(iconCacheService, stockService, _optionsService, _dictionary, _changeDetector) {
|
|
2128
2403
|
this.iconCacheService = iconCacheService;
|
|
2129
|
-
this.
|
|
2404
|
+
this.stockService = stockService;
|
|
2405
|
+
this._optionsService = _optionsService;
|
|
2406
|
+
this._dictionary = _dictionary;
|
|
2407
|
+
this._changeDetector = _changeDetector;
|
|
2130
2408
|
this.icons = Icon;
|
|
2131
2409
|
this.sendOption = SendOption;
|
|
2410
|
+
this.showEmailOption = true;
|
|
2411
|
+
this.showPrintOption = true;
|
|
2412
|
+
this.showPdfOption = true;
|
|
2413
|
+
this.showXmlOption = true;
|
|
2132
2414
|
this.sendOptions = [
|
|
2133
2415
|
{ option: SendOption.Email,
|
|
2134
|
-
iconName: this.icons.Email
|
|
2416
|
+
iconName: this.icons.Email,
|
|
2417
|
+
show: this.showEmailOption,
|
|
2418
|
+
},
|
|
2135
2419
|
{ option: SendOption.Print,
|
|
2136
|
-
iconName: this.icons.Print
|
|
2420
|
+
iconName: this.icons.Print,
|
|
2421
|
+
show: this.showPrintOption,
|
|
2422
|
+
},
|
|
2137
2423
|
{ option: SendOption.Pdf,
|
|
2138
|
-
iconName: this.icons.Pdf
|
|
2424
|
+
iconName: this.icons.Pdf,
|
|
2425
|
+
show: this.showPdfOption,
|
|
2426
|
+
},
|
|
2139
2427
|
{ option: SendOption.Xml,
|
|
2140
|
-
iconName: this.icons.Xml
|
|
2428
|
+
iconName: this.icons.Xml,
|
|
2429
|
+
show: this.showXmlOption,
|
|
2430
|
+
}
|
|
2141
2431
|
];
|
|
2142
2432
|
this.activeSendOption = SendOption.Email;
|
|
2143
|
-
this.amountToPrint = 1;
|
|
2144
2433
|
this.showStandardPrinterOptions = false;
|
|
2145
2434
|
this.showPrinterSelections = false;
|
|
2146
2435
|
this.showExitButton = true;
|
|
2147
|
-
this.printTemplatesField = { text: "name", value: "
|
|
2436
|
+
this.printTemplatesField = { text: "name", value: "reportId" };
|
|
2437
|
+
this.upAndLoaded = false;
|
|
2148
2438
|
this.emails = ['lars.vdv@colijn-it.nl', 'david@colijn-it.nl', 'ruben@colijn-it.nl'];
|
|
2149
2439
|
this.models = [false, false, true];
|
|
2150
2440
|
this.layouts = ['Layout 1', 'Layout 2', 'Layout 3'];
|
|
2151
2441
|
this.showDialog = false;
|
|
2152
2442
|
this.startSignatureClicked = new EventEmitter();
|
|
2153
2443
|
this.printButtonClicked = new EventEmitter();
|
|
2444
|
+
this._subscriptions = [];
|
|
2445
|
+
this._publicOptions = true;
|
|
2446
|
+
this._subscriptions.push(this._optionsService.optionsLoaded.subscribe(loaded => this._handleSettingsLoaded(loaded)));
|
|
2154
2447
|
}
|
|
2155
2448
|
set options(value) {
|
|
2156
|
-
|
|
2449
|
+
if (value) {
|
|
2450
|
+
if (typeof value === "string") {
|
|
2451
|
+
this._options = JSON.parse(value);
|
|
2452
|
+
}
|
|
2453
|
+
else {
|
|
2454
|
+
this._options = value;
|
|
2455
|
+
}
|
|
2456
|
+
this._publicOptions = true;
|
|
2457
|
+
this._optionsService.initialize(this._options).then();
|
|
2458
|
+
}
|
|
2459
|
+
}
|
|
2460
|
+
get options() {
|
|
2461
|
+
return this._options;
|
|
2157
2462
|
}
|
|
2463
|
+
set articleData(data) {
|
|
2464
|
+
this.stockService.printSticker.goodId = data.goodId;
|
|
2465
|
+
this.stockService.printSticker.warehouse = data.warehouseNo;
|
|
2466
|
+
}
|
|
2467
|
+
;
|
|
2158
2468
|
showClass() {
|
|
2159
2469
|
return true;
|
|
2160
2470
|
}
|
|
2161
|
-
|
|
2162
|
-
this.
|
|
2471
|
+
ngOnDestroy() {
|
|
2472
|
+
this._subscriptions.forEach(subscription => subscription.unsubscribe());
|
|
2163
2473
|
}
|
|
2164
2474
|
getPrinters() {
|
|
2165
2475
|
return __awaiter(this, void 0, void 0, function* () {
|
|
2166
|
-
return this.
|
|
2476
|
+
return this.stockService.getAllPrinters(true).then((list) => {
|
|
2167
2477
|
this.printerList = list;
|
|
2168
2478
|
});
|
|
2169
2479
|
});
|
|
@@ -2175,7 +2485,11 @@ class SendMethodDialogComponent {
|
|
|
2175
2485
|
this.startSignatureClicked.emit();
|
|
2176
2486
|
}
|
|
2177
2487
|
handlePrintClicked() {
|
|
2178
|
-
this.printButtonClicked.emit();
|
|
2488
|
+
// this.printButtonClicked.emit();
|
|
2489
|
+
console.log(this.stockService.printSticker);
|
|
2490
|
+
if (this.stockService.printSticker.printerName) {
|
|
2491
|
+
this.stockService.getPrintStockStickers(this.stockService.printSticker);
|
|
2492
|
+
}
|
|
2179
2493
|
}
|
|
2180
2494
|
togglePrinterSelection() {
|
|
2181
2495
|
this.getPrinters();
|
|
@@ -2190,12 +2504,35 @@ class SendMethodDialogComponent {
|
|
|
2190
2504
|
}
|
|
2191
2505
|
onPrinterClicked(printer) {
|
|
2192
2506
|
this.defaultPrinter = printer.name;
|
|
2507
|
+
this.stockService.printSticker.printerName = printer.name;
|
|
2193
2508
|
this.showPrinterSelections = !this.showPrinterSelections;
|
|
2194
2509
|
}
|
|
2195
2510
|
getPrintTemplates() {
|
|
2196
|
-
|
|
2197
|
-
|
|
2198
|
-
this.
|
|
2511
|
+
if (!this.printTemplates) {
|
|
2512
|
+
const data = new StockStickersPrintLayoutsBo();
|
|
2513
|
+
this.stockService.getStockStickerTemplates(data).then((templates) => {
|
|
2514
|
+
this.printTemplates = templates;
|
|
2515
|
+
});
|
|
2516
|
+
}
|
|
2517
|
+
}
|
|
2518
|
+
_handleSettingsLoaded(loaded) {
|
|
2519
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2520
|
+
if (loaded) {
|
|
2521
|
+
yield this._initConnection().then();
|
|
2522
|
+
this.upAndLoaded = true;
|
|
2523
|
+
}
|
|
2524
|
+
});
|
|
2525
|
+
}
|
|
2526
|
+
_initConnection() {
|
|
2527
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
2528
|
+
// await this._connector.connect(this._optionsService.options);
|
|
2529
|
+
if (this._optionsService.options.url) {
|
|
2530
|
+
this._dictionary.rootUrl = this._optionsService.options.url.replace("/ajaxservice", "");
|
|
2531
|
+
}
|
|
2532
|
+
yield this._dictionary.setDictionary(this._optionsService.options.languageCode);
|
|
2533
|
+
setTimeout(() => {
|
|
2534
|
+
this._changeDetector.detectChanges();
|
|
2535
|
+
});
|
|
2199
2536
|
});
|
|
2200
2537
|
}
|
|
2201
2538
|
}
|
|
@@ -2245,13 +2582,12 @@ SendMethodDialogComponent.decorators = [
|
|
|
2245
2582
|
</div>
|
|
2246
2583
|
</div>
|
|
2247
2584
|
|
|
2248
|
-
<div class="email-option-content" *ngIf="activeSendOption === sendOption.Print">
|
|
2585
|
+
<div class="email-option-content" *ngIf="activeSendOption === sendOption.Print" (click)="getPrintTemplates()">
|
|
2249
2586
|
<div class="lov-wrapper">
|
|
2250
2587
|
<co-input-combo-box
|
|
2251
|
-
[(model)]="
|
|
2588
|
+
[(model)]="stockService.printSticker.reportId"
|
|
2252
2589
|
[collection]="printTemplates"
|
|
2253
2590
|
[fields]="printTemplatesField"
|
|
2254
|
-
[forceReadonly]="true"
|
|
2255
2591
|
placeholder="Layout"
|
|
2256
2592
|
></co-input-combo-box>
|
|
2257
2593
|
</div>
|
|
@@ -2292,7 +2628,7 @@ SendMethodDialogComponent.decorators = [
|
|
|
2292
2628
|
<div class="print-footer-wrapper">
|
|
2293
2629
|
<div class="input-number-wrapper">
|
|
2294
2630
|
<co-input-number-picker class="number-picker"
|
|
2295
|
-
[step]="1" [(model)]="
|
|
2631
|
+
[step]="1" [(model)]="stockService.printSticker.amount" [min]="1"
|
|
2296
2632
|
[ngModelOptions]="{debounce: 1}">
|
|
2297
2633
|
</co-input-number-picker>
|
|
2298
2634
|
</div>
|
|
@@ -2335,13 +2671,21 @@ SendMethodDialogComponent.decorators = [
|
|
|
2335
2671
|
];
|
|
2336
2672
|
SendMethodDialogComponent.ctorParameters = () => [
|
|
2337
2673
|
{ type: IconCacheService },
|
|
2338
|
-
{ type: StockService }
|
|
2674
|
+
{ type: StockService },
|
|
2675
|
+
{ type: OptionsService },
|
|
2676
|
+
{ type: DictionaryService },
|
|
2677
|
+
{ type: ChangeDetectorRef }
|
|
2339
2678
|
];
|
|
2340
2679
|
SendMethodDialogComponent.propDecorators = {
|
|
2680
|
+
showEmailOption: [{ type: Input }],
|
|
2681
|
+
showPrintOption: [{ type: Input }],
|
|
2682
|
+
showPdfOption: [{ type: Input }],
|
|
2683
|
+
showXmlOption: [{ type: Input }],
|
|
2341
2684
|
options: [{ type: Input }],
|
|
2342
2685
|
showDialog: [{ type: Input }],
|
|
2343
2686
|
headerTitle: [{ type: Input }],
|
|
2344
2687
|
printerList: [{ type: Input }],
|
|
2688
|
+
articleData: [{ type: Input }],
|
|
2345
2689
|
startSignatureClicked: [{ type: Output }],
|
|
2346
2690
|
printButtonClicked: [{ type: Output }],
|
|
2347
2691
|
showClass: [{ type: HostBinding, args: ["class.ione-send-method-dialog",] }]
|
|
@@ -2471,7 +2815,7 @@ StockModule.decorators = [
|
|
|
2471
2815
|
],
|
|
2472
2816
|
providers: [
|
|
2473
2817
|
StockService,
|
|
2474
|
-
|
|
2818
|
+
SharedConnectorService
|
|
2475
2819
|
]
|
|
2476
2820
|
},] }
|
|
2477
2821
|
];
|
|
@@ -2807,5 +3151,5 @@ LayoutSwitcherModule.decorators = [
|
|
|
2807
3151
|
* Generated bundle index. Do not edit.
|
|
2808
3152
|
*/
|
|
2809
3153
|
|
|
2810
|
-
export { DocsignComponent, DocsignModule, KeyPadComponent, KeyPadModule, LayoutSwitcherComponent, LayoutSwitcherModule, SendMethodDialogComponent, SendMethodDialogModule, StockComponent, StockModule, SignatureComponent as ɵa, SignaturesComponent as ɵb, StockService as ɵc,
|
|
3154
|
+
export { DocsignComponent, DocsignModule, KeyPadComponent, KeyPadModule, LayoutSwitcherComponent, LayoutSwitcherModule, SendMethodDialogComponent, SendMethodDialogModule, SharedService, StockComponent, StockModule, SignatureComponent as ɵa, SignaturesComponent as ɵb, StockService as ɵc, OptionsService as ɵd, DictionaryService as ɵe, SharedConnectorService as ɵf, IconCacheService as ɵg, StockInformationComponent as ɵh, StockInformationGridComponent as ɵi, StockLocationComponent as ɵj, StockTransferComponent as ɵk, StockChangeAmountComponent as ɵl };
|
|
2811
3155
|
//# sourceMappingURL=colijnit-sharedcomponents.js.map
|