@colijnit/sharedcomponents 1.0.13 → 1.0.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (28) hide show
  1. package/bundles/colijnit-sharedcomponents.umd.js +485 -129
  2. package/bundles/colijnit-sharedcomponents.umd.js.map +1 -1
  3. package/colijnit-sharedcomponents.d.ts +1 -0
  4. package/colijnit-sharedcomponents.metadata.json +1 -1
  5. package/esm2015/colijnit-sharedcomponents.js +2 -1
  6. package/esm2015/lib/components/send-method-dialog/send-method-dialog.component.js +14 -7
  7. package/esm2015/lib/components/stock/stock-information/stock-information.component.js +6 -7
  8. package/esm2015/lib/components/stock/stock-information-grid/stock-information-grid.component.js +137 -56
  9. package/esm2015/lib/components/stock/stock-location/stock-location.component.js +7 -13
  10. package/esm2015/lib/components/stock/stock-transfer/stock-change-amount.component.js +68 -0
  11. package/esm2015/lib/components/stock/stock-transfer/stock-transfer.component.js +52 -20
  12. package/esm2015/lib/components/stock/stock.component.js +23 -22
  13. package/esm2015/lib/components/stock/stock.module.js +9 -4
  14. package/esm2015/lib/service/ione-connector-adapter.service.js +121 -32
  15. package/esm2015/lib/service/stock.service.js +48 -10
  16. package/fesm2015/colijnit-sharedcomponents.js +473 -165
  17. package/fesm2015/colijnit-sharedcomponents.js.map +1 -1
  18. package/lib/components/send-method-dialog/send-method-dialog.component.d.ts +8 -4
  19. package/lib/components/stock/stock-information/stock-information.component.d.ts +2 -3
  20. package/lib/components/stock/stock-information-grid/stock-information-grid.component.d.ts +23 -10
  21. package/lib/components/stock/stock-location/stock-location.component.d.ts +4 -5
  22. package/lib/components/stock/stock-transfer/stock-change-amount.component.d.ts +18 -0
  23. package/lib/components/stock/stock-transfer/stock-transfer.component.d.ts +18 -3
  24. package/lib/components/stock/stock.component.d.ts +7 -5
  25. package/lib/components/stock/style/_layout.scss +4 -30
  26. package/lib/service/ione-connector-adapter.service.d.ts +19 -6
  27. package/lib/service/stock.service.d.ts +18 -3
  28. package/package.json +1 -1
@@ -23,16 +23,21 @@ import { MapPropertyDecorator } from '@colijnit/articleapi/build/factory/decorat
23
23
  import { BooleanTextDecorator as BooleanTextDecorator$1 } from '@colijnit/articleapi/build/factory/decorators/boolean.decorator';
24
24
  import { JsonFieldFieldDecorator } from '@colijnit/articleapi/build/factory/decorators/json.decorator';
25
25
  import { ComplexArrayDecorator as ComplexArrayDecorator$1 } from '@colijnit/articleapi/build/factory/decorators/complex-array.decorator';
26
- import { PrintStockStickers } from '@colijnit/articleapi/build/model/print-stock-stickers';
27
- import { ArticleFlat } from '@colijnit/articleapi/build/model/article-flat.bo';
28
- import { ArticlesPublic } from '@colijnit/articleapi/build/articles-public';
29
- import { PrintJob } from '@colijnit/sharedapi/build/model/report/print-job';
26
+ import { PrintStockStickers } from '@colijnit/sharedapi/build/model/print-stock-stickers';
30
27
  import { ArticleStockBo } from '@colijnit/articleapi/build/model/article-stock.bo';
28
+ import { StockHistoryBo } from '@colijnit/articleapi/build/model/stock-history.bo';
29
+ import { StockStickersPrintLayoutsBo } from '@colijnit/sharedapi/build/model/report/stock-stickers-print-layouts.bo';
30
+ import { ArticleDetailsBo } from '@colijnit/articleapi/build/model/article-details.bo';
31
+ import { StockStatus } from '@colijnit/articleapi/build/model/stock-status.bo';
32
+ import { StockManagementWarehouses } from '@colijnit/articleapi/build/model/stock-management-warehouses.bo';
33
+ import { StockLocation } from '@colijnit/articleapi/build/model/stock-location.bo';
34
+ import { PrintStockStickers as PrintStockStickers$1 } from '@colijnit/articleapi/build/model/print-stock-stickers';
35
+ import { GetStockHistoryRequest } from '@colijnit/articleapi/build/model/get-stock-history-request';
31
36
  import { ArticleStock } from '@colijnit/articleapi/build/model/article-stock';
32
- import { CoDialogPromptModule, InputCheckboxModule, InputComboBoxModule, IconModule, InputNumberPickerModule, CoDialogWizardModule, ButtonModule, CoGridModule, InputRadioButtonModule, DropDownModule, SimpleGridModule, ImageModule, InputTextModule } from '@colijnit/corecomponents_v12';
37
+ import { CoDialogPromptModule, InputCheckboxModule, InputComboBoxModule, IconModule, InputNumberPickerModule, CoDialogWizardModule, ButtonModule, CoGridModule, InputRadioButtonModule, DropDownModule, SimpleGridModule, ImageModule, InputTextModule, InputTextareaModule } from '@colijnit/corecomponents_v12';
33
38
  import * as i1 from '@angular/platform-browser';
34
39
  import { DomSanitizer } from '@angular/platform-browser';
35
- import { PrintStockStickers as PrintStockStickers$1 } from '@colijnit/sharedapi/build/model/print-stock-stickers';
40
+ import { ArticleStockManagement } from '@colijnit/articleapi/build/model/article-stock-management';
36
41
 
37
42
  class DocsignComponent {
38
43
  constructor() {
@@ -1049,10 +1054,12 @@ class IoneConnectorAdapterService {
1049
1054
  }
1050
1055
  connect(options) {
1051
1056
  return __awaiter(this, void 0, void 0, function* () {
1052
- this.options = options;
1053
- this.connector = new Articles(options);
1054
- this.sharedConnector = new Sharedapi(options);
1055
- this.options.session = this.connector.session && this.sharedConnector.session;
1057
+ if (this.options === undefined) {
1058
+ this.options = options;
1059
+ this.connector = new Articles(options);
1060
+ this.sharedConnector = new Sharedapi(options);
1061
+ this.options.session = this.connector.session && this.sharedConnector.session;
1062
+ }
1056
1063
  });
1057
1064
  }
1058
1065
  disconnect() {
@@ -1092,26 +1099,13 @@ class IoneConnectorAdapterService {
1092
1099
  });
1093
1100
  });
1094
1101
  }
1095
- // public async getPrintLayouts(defaultPrinterName: PrintJob): Promise<PrintJob> {
1096
- // return new Promise((resolve: Function, reject: Function) => {
1097
- // return this.sharedConnector.getPrintTemplates(defaultPrinterName).then((result: DataServiceResponse) => {
1098
- // if (result.validationResult && result.validationResult.success) {
1099
- // if (result.resultObject) {
1100
- // resolve(this._boFactory.makeWithRawBackendData(PrintJob, result.resultObject));
1101
- // }
1102
- // } else {
1103
- // reject(result.validationMessagesAsString);
1104
- // }
1105
- // })
1106
- // })
1107
- // }
1108
- getStockHistory(request) {
1102
+ getStockStickerPrintLayouts(stockStickersPrintLayoutsBo) {
1109
1103
  return __awaiter(this, void 0, void 0, function* () {
1110
1104
  return new Promise((resolve, reject) => {
1111
- return this.connector.getStockHistory(request).then((result) => {
1105
+ return this.sharedConnector.getStockStickerPrintLayouts(stockStickersPrintLayoutsBo).then((result) => {
1112
1106
  if (result.validationResult && result.validationResult.success) {
1113
1107
  if (result.resultObject) {
1114
- resolve(this._boFactory.makeWithRawBackendData(PrintJob, result.resultObject));
1108
+ resolve(this._boFactory.makeWithRawBackendData(stockStickersPrintLayoutsBo, result.resultObject));
1115
1109
  }
1116
1110
  }
1117
1111
  else {
@@ -1136,13 +1130,13 @@ class IoneConnectorAdapterService {
1136
1130
  });
1137
1131
  });
1138
1132
  }
1139
- getArticleFlatObject(goodId) {
1133
+ getStockHistory(request) {
1140
1134
  return __awaiter(this, void 0, void 0, function* () {
1141
1135
  return new Promise((resolve, reject) => {
1142
- return this.connector.getArticleFullObject(goodId).then((result) => {
1136
+ return this.connector.getStockHistory(request).then((result) => {
1143
1137
  if (result.validationResult && result.validationResult.success) {
1144
- if (result.resultObject) {
1145
- resolve(this._boFactory.makeWithRawBackendData(ArticleFlat, result.resultObject));
1138
+ if (result.resultObject && result.resultObject.hasOwnProperty("stockHistory")) {
1139
+ resolve(this._boFactory.makeBOArrayFromRawBackendDataArray(StockHistoryBo, result.resultObject.stockHistory));
1146
1140
  }
1147
1141
  }
1148
1142
  else {
@@ -1168,13 +1162,107 @@ class IoneConnectorAdapterService {
1168
1162
  });
1169
1163
  });
1170
1164
  }
1171
- getWarehouses(goodId) {
1165
+ getStockManagementWarehouses() {
1166
+ return __awaiter(this, void 0, void 0, function* () {
1167
+ return new Promise((resolve, reject) => {
1168
+ return this.connector.getStockManagementWarehouses().then((result) => {
1169
+ if (result.validationResult && result.validationResult.success) {
1170
+ if (result.resultObjects) {
1171
+ resolve(this._boFactory.makeBOArrayFromRawBackendDataArray(StockManagementWarehouses, result.resultObjects));
1172
+ }
1173
+ }
1174
+ else {
1175
+ reject(result.validationMessagesAsString);
1176
+ }
1177
+ });
1178
+ });
1179
+ });
1180
+ }
1181
+ getStockManagementLocations(warehouseNo) {
1182
+ return __awaiter(this, void 0, void 0, function* () {
1183
+ return new Promise((resolve, reject) => {
1184
+ return this.connector.getStockManagementLocations(warehouseNo).then((result) => {
1185
+ if (result.validationResult && result.validationResult.success) {
1186
+ if (result.resultObjects) {
1187
+ resolve(this._boFactory.makeBOArrayFromRawBackendDataArray(StockLocation, result.resultObjects));
1188
+ }
1189
+ }
1190
+ else {
1191
+ reject(result.validationMessagesAsString);
1192
+ }
1193
+ });
1194
+ });
1195
+ });
1196
+ }
1197
+ getArticleDetails(data) {
1198
+ return __awaiter(this, void 0, void 0, function* () {
1199
+ return new Promise((resolve, reject) => {
1200
+ return this.connector.getArticleDetails(data).then((result) => {
1201
+ if (result.validationResult && result.validationResult.success) {
1202
+ if (result.resultObjects) {
1203
+ resolve(this._boFactory.makeBOArrayFromRawBackendDataArray(ArticleDetailsBo, result.resultObjects));
1204
+ }
1205
+ }
1206
+ else {
1207
+ reject(result.validationMessagesAsString);
1208
+ }
1209
+ });
1210
+ });
1211
+ });
1212
+ }
1213
+ updateArticleDetails(data) {
1172
1214
  return __awaiter(this, void 0, void 0, function* () {
1173
1215
  return new Promise((resolve, reject) => {
1174
- return this.connector.getWarehouses(goodId).then((result) => {
1216
+ return this.connector.updateArticleDetails(data).then((result) => __awaiter(this, void 0, void 0, function* () {
1217
+ if (result.validationResult && result.validationResult.success) {
1218
+ yield this.commit();
1219
+ resolve(true);
1220
+ }
1221
+ else {
1222
+ reject(result.validationMessagesAsString);
1223
+ }
1224
+ }));
1225
+ });
1226
+ });
1227
+ }
1228
+ lockArticleDetails(data) {
1229
+ return __awaiter(this, void 0, void 0, function* () {
1230
+ return new Promise((resolve, reject) => {
1231
+ return this.connector.lockArticleDetails(data).then((result) => __awaiter(this, void 0, void 0, function* () {
1232
+ if (result.validationResult && result.validationResult.success) {
1233
+ yield this.commit();
1234
+ resolve(true);
1235
+ }
1236
+ else {
1237
+ reject(result.validationMessagesAsString);
1238
+ }
1239
+ }));
1240
+ });
1241
+ });
1242
+ }
1243
+ getStockStatus() {
1244
+ return __awaiter(this, void 0, void 0, function* () {
1245
+ return new Promise((resolve, reject) => {
1246
+ return this.connector.getStockState().then((result) => {
1247
+ if (result.validationResult && result.validationResult.success) {
1248
+ if (result.resultObjects) {
1249
+ resolve(this._boFactory.makeBOArrayFromRawBackendDataArray(StockStatus, result.resultObjects));
1250
+ }
1251
+ }
1252
+ else {
1253
+ reject(result.validationMessagesAsString);
1254
+ }
1255
+ });
1256
+ });
1257
+ });
1258
+ }
1259
+ getStockStickerTemplates(data) {
1260
+ return __awaiter(this, void 0, void 0, function* () {
1261
+ return new Promise((resolve, reject) => {
1262
+ return this.sharedConnector.getStockStickerPrintLayouts(data).then((result) => {
1175
1263
  if (result.validationResult && result.validationResult.success) {
1176
1264
  if (result.resultObject) {
1177
- resolve(this._boFactory.makeWithRawBackendData(ArticlesPublic, result.resultObject));
1265
+ resolve(this._boFactory.makeBOArrayFromRawBackendDataArray(StockStickersPrintLayoutsBo, result.resultObject));
1178
1266
  }
1179
1267
  }
1180
1268
  else {
@@ -1184,6 +1272,9 @@ class IoneConnectorAdapterService {
1184
1272
  });
1185
1273
  });
1186
1274
  }
1275
+ commit() {
1276
+ return this.connector.commit();
1277
+ }
1187
1278
  }
1188
1279
  IoneConnectorAdapterService.ɵprov = i0.ɵɵdefineInjectable({ factory: function IoneConnectorAdapterService_Factory() { return new IoneConnectorAdapterService(); }, token: IoneConnectorAdapterService, providedIn: "root" });
1189
1280
  IoneConnectorAdapterService.decorators = [
@@ -1200,22 +1291,17 @@ class StockService {
1200
1291
  connectConnector(options) {
1201
1292
  this._connector.connect(options);
1202
1293
  }
1203
- getPrintStockStickers(data) {
1204
- return __awaiter(this, void 0, void 0, function* () {
1205
- yield this._connector.getPrintStockStickers(data);
1206
- });
1207
- }
1294
+ // public async getPrintStockStickers(data: PrintStockStickers): Promise<void> {
1295
+ // await this._connector.getPrintStockStickers(data);
1296
+ // }
1208
1297
  getAllPrinters(showAll = true) {
1209
1298
  return __awaiter(this, void 0, void 0, function* () {
1210
1299
  return yield this._connector.getAllPrinters(showAll);
1211
1300
  });
1212
1301
  }
1213
- // public async getPrintTemplates(defaultPrinterName: PrintJob): Promise<PrintJob> {
1214
- // return await this._connector.getPrintLayouts(defaultPrinterName);
1215
- // }
1216
1302
  getStockHistory(data) {
1217
1303
  return __awaiter(this, void 0, void 0, function* () {
1218
- yield this._connector.getStockHistory(data);
1304
+ return yield this._connector.getStockHistory(data);
1219
1305
  });
1220
1306
  }
1221
1307
  getStockInformation(data) {
@@ -1223,6 +1309,49 @@ class StockService {
1223
1309
  return yield this._connector.getStockInformation(data);
1224
1310
  });
1225
1311
  }
1312
+ getStockStickerPrintLayouts(data) {
1313
+ return __awaiter(this, void 0, void 0, function* () {
1314
+ return yield this._connector.getStockStickerPrintLayouts(data);
1315
+ });
1316
+ }
1317
+ getArticleDetails(data) {
1318
+ return __awaiter(this, void 0, void 0, function* () {
1319
+ return yield this._connector.getArticleDetails(data);
1320
+ });
1321
+ }
1322
+ updateArticleDetails(data) {
1323
+ return __awaiter(this, void 0, void 0, function* () {
1324
+ return yield this._connector.updateArticleDetails(data);
1325
+ });
1326
+ }
1327
+ getStockState() {
1328
+ return __awaiter(this, void 0, void 0, function* () {
1329
+ return yield this._connector.getStockStatus();
1330
+ });
1331
+ }
1332
+ getStockStickerTemplates(data) {
1333
+ return __awaiter(this, void 0, void 0, function* () {
1334
+ return yield this._connector.getStockStickerTemplates(data);
1335
+ });
1336
+ }
1337
+ getStockManagementWarehouses() {
1338
+ return __awaiter(this, void 0, void 0, function* () {
1339
+ return yield this._connector.getStockManagementWarehouses();
1340
+ });
1341
+ }
1342
+ getStockManagementLocations(warehouseNo) {
1343
+ return __awaiter(this, void 0, void 0, function* () {
1344
+ return yield this._connector.getStockManagementLocations(warehouseNo);
1345
+ });
1346
+ }
1347
+ lockArticleDetails(data) {
1348
+ return __awaiter(this, void 0, void 0, function* () {
1349
+ return yield this._connector.lockArticleDetails(data);
1350
+ });
1351
+ }
1352
+ commit() {
1353
+ return this._connector.commit();
1354
+ }
1226
1355
  }
1227
1356
  StockService.decorators = [
1228
1357
  { type: Injectable }
@@ -1238,6 +1367,8 @@ class StockComponent {
1238
1367
  this.showStockInformationGrid = true;
1239
1368
  this.showStockLocation = false;
1240
1369
  this.showStockTransfer = false;
1370
+ this.allAvailableStock = 0;
1371
+ this.allTechnicalStock = 0;
1241
1372
  }
1242
1373
  set options(value) {
1243
1374
  this.stockService.connectConnector(value);
@@ -1250,30 +1381,27 @@ class StockComponent {
1250
1381
  showClass() {
1251
1382
  return true;
1252
1383
  }
1253
- // ngAfterViewInit() {
1254
- // if(this.article) {
1255
- // this.getStockInformation(this.article as any);
1256
- // }
1257
- // }
1258
1384
  backToStockLinesClicked() {
1259
1385
  this.showStockLocation = false;
1260
1386
  this.showStockInformationGrid = true;
1261
1387
  }
1262
1388
  handleStockTransferClick(event) {
1263
- this.stockTransferArticle = event;
1389
+ this.stockTransferArticleDetails = event;
1264
1390
  this.showStockTransfer = !this.showStockTransfer;
1265
1391
  this.showStockInformationGrid = !this.showStockInformationGrid;
1266
- this.stockService.stockStickers = new PrintStockStickers();
1392
+ this.stockService.stockStickers = new PrintStockStickers$1();
1267
1393
  }
1268
1394
  backToStock() {
1269
1395
  this.showStockTransfer = !this.showStockTransfer;
1270
1396
  this.showStockInformationGrid = !this.showStockInformationGrid;
1271
1397
  }
1272
- loadStockHistory(data) {
1273
- this.stockService.getStockHistory(data);
1274
- }
1275
- buttonClick() {
1276
- this.getStockInformation(this.article);
1398
+ getStockHistory() {
1399
+ return __awaiter(this, void 0, void 0, function* () {
1400
+ const stockHistoryInformation = new GetStockHistoryRequest();
1401
+ stockHistoryInformation.type = "B";
1402
+ stockHistoryInformation.goodId = this.articleExtended.goodId.toString();
1403
+ this.stockHistory = yield this.stockService.getStockHistory(stockHistoryInformation);
1404
+ });
1277
1405
  }
1278
1406
  getStockInformation(data) {
1279
1407
  return __awaiter(this, void 0, void 0, function* () {
@@ -1281,12 +1409,8 @@ class StockComponent {
1281
1409
  articleData.goodId = data.goodId.toString();
1282
1410
  articleData.viewKind = "M";
1283
1411
  this.stockInformation = yield this.stockService.getStockInformation(articleData);
1284
- // const allAvailableStock = this.stockInformation.reduce((a, b) => a.availableStock + b.availableStock ? a : b);
1285
- });
1286
- }
1287
- getStockLocationInformation(data) {
1288
- return __awaiter(this, void 0, void 0, function* () {
1289
- this.stockLocationInformation = yield this.stockService.getStockInformation(data);
1412
+ this.stockInformation.forEach((articleStock) => this.allAvailableStock += articleStock.availableStock);
1413
+ this.stockInformation.forEach((articleStock) => this.allTechnicalStock += articleStock.technicalStock);
1290
1414
  });
1291
1415
  }
1292
1416
  }
@@ -1296,15 +1420,19 @@ StockComponent.decorators = [
1296
1420
  template: `
1297
1421
  <div class="stock-info-container">
1298
1422
  <co-stock-information [article]="articleExtended"
1299
- [articleStock]="">
1300
-
1423
+ [articleStock]=""
1424
+ [allAvailableStockInformation]="allAvailableStock"
1425
+ [allTechnicalStockInformation]="allTechnicalStock"
1426
+ >
1301
1427
  </co-stock-information>
1302
1428
  <hr>
1303
1429
  <co-stock-information-grid *ngIf="showStockInformationGrid"
1304
1430
  [stockLocationData]="stockLocationInformation"
1305
- (locationLineClicked)="getStockLocationInformation($event)"
1306
1431
  [articleStockInformation]="stockInformation"
1307
- (transferIconClicked)="handleStockTransferClick($event)">
1432
+ (transferIconClicked)="handleStockTransferClick($event)"
1433
+ (historyClicked)="getStockHistory()"
1434
+ [stockHistoryInformation]="stockHistory"
1435
+ >
1308
1436
  </co-stock-information-grid>
1309
1437
  <co-stock-location *ngIf="showStockLocation"
1310
1438
  (backToStockLines)="backToStockLinesClicked()">
@@ -1313,6 +1441,7 @@ StockComponent.decorators = [
1313
1441
  <co-stock-transfer *ngIf="showStockTransfer"
1314
1442
  (handleCancelClicked)="backToStock()"
1315
1443
  [article]="stockTransferArticle"
1444
+ [articleToTransfer]="stockTransferArticleDetails"
1316
1445
  [stockSticker]="stockService.stockStickers"
1317
1446
  (handleStickerClicked)="handleStickerClicked.emit($event)"
1318
1447
  [articleWarehouse]="articleWarehouse"
@@ -1339,9 +1468,6 @@ StockComponent.propDecorators = {
1339
1468
 
1340
1469
  class StockInformationComponent {
1341
1470
  constructor() {
1342
- this.stockStatus = "medium";
1343
- this.show = false;
1344
- this.hideOrShowLocationTab = false;
1345
1471
  }
1346
1472
  }
1347
1473
  StockInformationComponent.decorators = [
@@ -1370,11 +1496,11 @@ StockInformationComponent.decorators = [
1370
1496
  </div>
1371
1497
  <div class="stock-status">
1372
1498
  <label [textContent]="'AMOUNT_IN_STOCK'"></label>
1373
- <span [textContent]="article.stockAvailable"></span>
1499
+ <span [textContent]="allTechnicalStockInformation"></span>
1374
1500
  </div>
1375
1501
  <div class="stock-status">
1376
1502
  <label [textContent]="'AMOUNT_AVAILABLE'"></label>
1377
- <span [textContent]=""></span>
1503
+ <span [textContent]="allAvailableStockInformation"></span>
1378
1504
  </div>
1379
1505
  <div class="stock-status">
1380
1506
  <label [textContent]="'AMOUNT_LATER_AVAILABLE'"></label>
@@ -1388,7 +1514,9 @@ StockInformationComponent.decorators = [
1388
1514
  StockInformationComponent.ctorParameters = () => [];
1389
1515
  StockInformationComponent.propDecorators = {
1390
1516
  article: [{ type: Input }],
1391
- articleStock: [{ type: Input }]
1517
+ articleStock: [{ type: Input }],
1518
+ allAvailableStockInformation: [{ type: Input }],
1519
+ allTechnicalStockInformation: [{ type: Input }]
1392
1520
  };
1393
1521
 
1394
1522
  /** AUTO GENERATED FILE. DO NOT CHANGE.. OR YOU WILL SUFFER THE CONSEQUENCES OF YOUR ACTIONS **/
@@ -1487,27 +1615,17 @@ class StockInformationGridComponent {
1487
1615
  this.iconCacheService = iconCacheService;
1488
1616
  this._stockService = _stockService;
1489
1617
  this.icons = Icon;
1490
- this.locationLineClicked = new EventEmitter();
1491
1618
  this.transferIconClicked = new EventEmitter();
1619
+ this.historyClicked = new EventEmitter();
1492
1620
  this.show = false;
1493
1621
  this.hideOrShowLocationTab = false;
1494
1622
  this.showStockHistory = false;
1495
1623
  this.showSendMethodDialog = false;
1496
- this.data = [
1497
- { test: "test" }
1498
- ];
1499
- this.inOrderInformation = [
1500
- { inOrder: "275432", customer: "Test customer", orderDate: "date", orderAmount: "2", warehouseNumber: "8", warehouseDescription: "A nice warehouse", amountInStock: "17", commission: "4014321" },
1501
- { inOrder: "275432", customer: "Test customer", orderDate: "date", orderAmount: "2", warehouseNumber: "8", warehouseDescription: "A nice warehouse", amountInStock: "17", commission: "4014321" },
1502
- { inOrder: "275432", customer: "Test customer", orderDate: "date", orderAmount: "2", warehouseNumber: "8", warehouseDescription: "A nice warehouse", amountInStock: "17", commission: "4014321" },
1503
- { inOrder: "275432", customer: "Test customer", orderDate: "date", orderAmount: "2", warehouseNumber: "8", warehouseDescription: "A nice warehouse", amountInStock: "17", commission: "4014321" },
1504
- { inOrder: "275432", customer: "Test customer", orderDate: "date", orderAmount: "2", warehouseNumber: "8", warehouseDescription: "A nice warehouse", amountInStock: "17", commission: "4014321" },
1505
- ];
1506
- this.orderInformation = [];
1507
1624
  this.hideOrShowTabs = true;
1508
- this.dataWareHouseCode = 0;
1509
- this.dataWareHouseFields = { text: "warehouseDescription", value: "warehouseNumber" };
1625
+ this.dataWareHouseFields = { text: "warehouseDescription", value: "warehouseNo" };
1510
1626
  this.articleStockSearchInfo = new ArticleStock();
1627
+ this.showChangeStockDetails = false;
1628
+ this.articleDetailsInformation = new ArticleStockManagement();
1511
1629
  this.tabs = [
1512
1630
  "STOCK",
1513
1631
  "IN_ORDER2",
@@ -1528,25 +1646,38 @@ class StockInformationGridComponent {
1528
1646
  }
1529
1647
  }
1530
1648
  handleTabClick(tabData) {
1649
+ console.log(tabData);
1531
1650
  this.activeTab = tabData;
1651
+ if (this.activeTab === "IN_ORDER2") {
1652
+ this.getInOrderData();
1653
+ }
1654
+ if (this.activeTab === "ORDERS1") {
1655
+ this.getOrderData();
1656
+ }
1532
1657
  }
1533
1658
  onLocationClick(data) {
1534
1659
  this.articleStockSearchInfo.goodId = data.goodId.toString();
1535
1660
  this.articleStockSearchInfo.wareHouseNo = data.warehouseNo.toString();
1536
1661
  this.articleStockSearchInfo.viewKind = "D";
1537
- this.locationLineClicked.emit(this.articleStockSearchInfo);
1662
+ if (!this.dataWareHouseCode) {
1663
+ this.getStockManagementWarehouses(data);
1664
+ }
1665
+ this.getArticleDetails(data);
1538
1666
  this.hideOrShowTabs = false;
1539
1667
  this.hideOrShowLocationTab = true;
1540
- }
1541
- onPopupClose() {
1542
- this.show = false;
1668
+ console.log(this.articleDetailsInformation);
1669
+ this._stockService.lockArticleDetails(this.articleDetailsInformation);
1543
1670
  }
1544
1671
  handleHistoryClick() {
1545
- // console.warn('Not yet implemented');
1546
- // this.showStockHistory = true;
1672
+ this.historyClicked.emit();
1673
+ this.hideOrShowLocationTab = false;
1674
+ this.showChangeStockDetails = false;
1675
+ this.hideOrShowTabs = false;
1676
+ this.showStockHistory = true;
1547
1677
  }
1548
- handleCloseClick() {
1549
- this.onPopupClose();
1678
+ backToStockInformation() {
1679
+ this.showStockHistory = false;
1680
+ this.hideOrShowTabs = true;
1550
1681
  }
1551
1682
  handleStockTransferClick(event) {
1552
1683
  this.transferIconClicked.emit(event);
@@ -1562,14 +1693,60 @@ class StockInformationGridComponent {
1562
1693
  this.showSendMethodDialog = !this.showSendMethodDialog;
1563
1694
  }
1564
1695
  printStockStickers() {
1565
- this.printSticker = new PrintStockStickers$1();
1696
+ this.printSticker = new PrintStockStickers();
1566
1697
  this.printSticker.goodId = 10;
1567
- this._stockService.getPrintStockStickers(this.printSticker);
1698
+ // this._stockService.getPrintStockStickers(this.printSticker);
1568
1699
  }
1569
1700
  onOkClick() {
1570
1701
  }
1571
1702
  onCancelClick() {
1572
1703
  }
1704
+ openDialogClick(data) {
1705
+ this.selectedArticleDetailsData = data;
1706
+ this.showChangeStockDetails = true;
1707
+ }
1708
+ getArticleDetails(data) {
1709
+ // const info = new ArticleStockManagement();
1710
+ this.articleDetailsInformation.goodId = data.goodId;
1711
+ this.articleDetailsInformation.lineId = data.lineId;
1712
+ this.articleDetailsInformation.warehouseNumber = data.warehouseNo;
1713
+ this._stockService.getArticleDetails(this.articleDetailsInformation).then((details) => {
1714
+ this.articleDetails = details;
1715
+ });
1716
+ }
1717
+ getStockManagementWarehouses(data) {
1718
+ this._stockService.getStockManagementWarehouses().then((warehouses) => {
1719
+ this.dataWareHouseCode = warehouses;
1720
+ this.selectedWarehouse = data.warehouseNo;
1721
+ });
1722
+ }
1723
+ onSelectWarehouse(event) {
1724
+ this.articleDetailsInformation.warehouseNumber = event;
1725
+ console.log(event);
1726
+ if (this.dataWareHouseCode != null) {
1727
+ this._stockService.getArticleDetails(this.articleDetailsInformation).then((details) => {
1728
+ this.articleDetails = details;
1729
+ });
1730
+ }
1731
+ }
1732
+ getInOrderData() {
1733
+ return __awaiter(this, void 0, void 0, function* () {
1734
+ const inOrderData = new GetStockHistoryRequest();
1735
+ inOrderData.type = "O";
1736
+ inOrderData.goodId = this.articleStockInformation[0].goodId.toString();
1737
+ // inOrderData.wareHouseNr = Number(this.articleStockInformation[0].warehouseNo);
1738
+ this.inOrderInformation = yield this._stockService.getStockHistory(inOrderData);
1739
+ });
1740
+ }
1741
+ getOrderData() {
1742
+ return __awaiter(this, void 0, void 0, function* () {
1743
+ const inOrderData = new GetStockHistoryRequest();
1744
+ inOrderData.type = "B";
1745
+ inOrderData.goodId = this.articleStockInformation[0].goodId.toString();
1746
+ // inOrderData.wareHouseNr = Number(this.articleStockInformation[0].warehouseNo);
1747
+ this.orderInformation = yield this._stockService.getStockHistory(inOrderData);
1748
+ });
1749
+ }
1573
1750
  }
1574
1751
  StockInformationGridComponent.decorators = [
1575
1752
  { type: Component, args: [{
@@ -1593,14 +1770,14 @@ StockInformationGridComponent.decorators = [
1593
1770
  <co-simple-grid *ngIf="activeTab === tabs[0] && hideOrShowTabs"
1594
1771
  [data]="articleStockInformation"
1595
1772
  >
1596
- <co-simple-grid-column [headerText]="'WAREHOUSE'" [field]="'warehouseNo'"></co-simple-grid-column>
1597
- <co-simple-grid-column [headerText]="'DESCRIPTION'" [field]="'warehouseName'"></co-simple-grid-column>
1598
- <co-simple-grid-column [headerText]="'STOCK'" [field]="'technicalStock'"></co-simple-grid-column>
1599
- <co-simple-grid-column [headerText]="'AVAILABLE_STOCK'" [field]="'availableStock'"></co-simple-grid-column>
1600
- <co-simple-grid-column [headerText]="'ECONOMICAL_STOCK'" [field]="'economicalStock'"></co-simple-grid-column>
1601
- <co-simple-grid-column [headerText]="'LOCATION'" [field]="'locationNo'">
1773
+ <co-simple-grid-column [headerText]="'WAREHOUSE'" [field]="'warehouseNo'" [order]="10"></co-simple-grid-column>
1774
+ <co-simple-grid-column [headerText]="'DESCRIPTION'" [field]="'warehouseName'" [order]="11"></co-simple-grid-column>
1775
+ <co-simple-grid-column [headerText]="'STOCK'" [field]="'technicalStock'" [order]="12"></co-simple-grid-column>
1776
+ <co-simple-grid-column [headerText]="'AVAILABLE_STOCK'" [field]="'availableStock'" [order]="13"></co-simple-grid-column>
1777
+ <co-simple-grid-column [headerText]="'ECONOMICAL_STOCK'" [field]="'economicalStock'" [order]="14"></co-simple-grid-column>
1778
+ <co-simple-grid-column [headerText]="'LOCATION'" [field]="'locationNo'" [order]="15">
1602
1779
  <ng-template #template let-row="row">
1603
- <span [textContent]="'bekijken'" (click)="onLocationClick(row)"></span>
1780
+ <span [textContent]="'Bekijken'" (click)="onLocationClick(row)"></span>
1604
1781
  </ng-template>
1605
1782
  </co-simple-grid-column>
1606
1783
  </co-simple-grid>
@@ -1608,12 +1785,12 @@ StockInformationGridComponent.decorators = [
1608
1785
  <co-simple-grid *ngIf="activeTab === tabs[1]"
1609
1786
  [data]="inOrderInformation"
1610
1787
  >
1611
- <co-simple-grid-column [headerText]="'IN_ORDER2'" [field]="'inOrder'"></co-simple-grid-column>
1612
- <co-simple-grid-column [headerText]="'CUSTOMER'" [field]="'customer'"></co-simple-grid-column>
1613
- <co-simple-grid-column [headerText]="'DATE'" [field]="'orderDate'"></co-simple-grid-column>
1614
- <co-simple-grid-column [headerText]="'AMOUNT'" [field]="'orderAmount'"></co-simple-grid-column>
1615
- <co-simple-grid-column [headerText]="'WAREHOUSE'" [field]="'warehouseNumber'"></co-simple-grid-column>
1616
- <co-simple-grid-column [headerText]="'DESCRIPTION'" [field]="'warehouseDescription'"></co-simple-grid-column>
1788
+ <co-simple-grid-column [headerText]="'IN_ORDER2'" [field]="'amount'"></co-simple-grid-column>
1789
+ <co-simple-grid-column [headerText]="'CUSTOMER'" [field]="'user'"></co-simple-grid-column>
1790
+ <co-simple-grid-column [headerText]="'DATE'" [field]="'mutationDate'"></co-simple-grid-column>
1791
+ <co-simple-grid-column [headerText]="'AMOUNT'" [field]="'amount'"></co-simple-grid-column>
1792
+ <co-simple-grid-column [headerText]="'WAREHOUSE'" [field]="'wareHouseNr'"></co-simple-grid-column>
1793
+ <co-simple-grid-column [headerText]="'DESCRIPTION'" [field]="'locationNr'"></co-simple-grid-column>
1617
1794
  <co-simple-grid-column [headerText]="'STOCK'" [field]="'amountInStock'"></co-simple-grid-column>
1618
1795
  <co-simple-grid-column [headerText]="'COMMISSION2'" [field]="'commission'"></co-simple-grid-column>
1619
1796
  <co-simple-grid-column [headerText]="'TRANSFER'" [field]="'transfer'">
@@ -1631,9 +1808,9 @@ StockInformationGridComponent.decorators = [
1631
1808
  <co-simple-grid *ngIf="activeTab === tabs[2]"
1632
1809
  [data]="orderInformation"
1633
1810
  >
1634
- <co-simple-grid-column [headerText]="'PURCHASE_ORDER_NR'" [field]="'purchaseOrderNo'"></co-simple-grid-column>
1635
- <co-simple-grid-column [headerText]="'DATE'" [field]="'orderDate'"></co-simple-grid-column>
1636
- <co-simple-grid-column [headerText]="'AMOUNT'" [field]="'orderAmount'"></co-simple-grid-column>
1811
+ <co-simple-grid-column [headerText]="'PURCHASE_ORDER_NR'" [field]="'seriesNr'"></co-simple-grid-column>
1812
+ <co-simple-grid-column [headerText]="'DATE'" [field]="'mutationDate'"></co-simple-grid-column>
1813
+ <co-simple-grid-column [headerText]="'AMOUNT'" [field]="'amount'"></co-simple-grid-column>
1637
1814
  <co-simple-grid-column [headerText]="'RESERVED'" [field]="'reserved'"></co-simple-grid-column>
1638
1815
  <co-simple-grid-column [headerText]="'FREE_STOCK'" [field]="'freeStock'"></co-simple-grid-column>
1639
1816
  <co-simple-grid-column [headerText]="'DELIVERY_DATE1'" [field]="'deliveryDate'"></co-simple-grid-column>
@@ -1647,28 +1824,40 @@ StockInformationGridComponent.decorators = [
1647
1824
  <span class="stock-button-back" [textContent]="'BACK_TO_STOCK_LINES'" (click)="handleBackToStockClick()"></span>
1648
1825
  </div>
1649
1826
  <div class="stock-location-right-group">
1650
- <co-input-combo-box [(model)]="dataWareHouseCode"
1827
+ <co-drop-down-list [(model)]="selectedWarehouse"
1828
+ [collection]="dataWareHouseCode"
1651
1829
  [fields]="dataWareHouseFields"
1652
1830
  [placeholder]="'WAREHOUSE'"
1831
+ (modelChange)="onSelectWarehouse($event)"
1653
1832
  [required]="true"
1654
- ></co-input-combo-box>
1833
+ ></co-drop-down-list>
1655
1834
  </div>
1656
1835
  </div>
1657
1836
 
1658
1837
  <!-- TODO move to own component stock-location-->
1659
- <co-simple-grid [data]="stockLocationData"
1838
+ <co-simple-grid [data]="articleDetails"
1660
1839
  >
1661
1840
  <div class="stock-location-group">
1662
1841
  <div class="stock-location-left-group">
1663
1842
  <co-button class="stock-lines-button" [textContent]="'BACK_TO_STOCK_LINES'" (click)="handleBackToStockClick()"></co-button>
1664
1843
  </div>
1665
1844
  </div>
1666
- <co-simple-grid-column [headerText]="'WAREHOUSE'" [field]="'warehouseName'"></co-simple-grid-column>
1845
+ <co-simple-grid-column [headerText]="'WAREHOUSE'" [field]="'warehouseDescription'"></co-simple-grid-column>
1667
1846
  <co-simple-grid-column [headerText]="'BATCH'" [field]="'batchNo'"></co-simple-grid-column>
1668
1847
  <co-simple-grid-column [headerText]="'SERIAL_NO'" [field]="'serialNo'"></co-simple-grid-column>
1669
- <co-simple-grid-column [headerText]="'STOCK'" [field]="'notAssignedStock'"></co-simple-grid-column>
1670
- <co-simple-grid-column [headerText]="'ALLOCATED'" [field]="'economicalStock'"></co-simple-grid-column>
1671
- <co-simple-grid-column [headerText]="'AVAILABLE_STOCK'" [field]="'availableStock'"></co-simple-grid-column>
1848
+ <co-simple-grid-column [headerText]="'STOCK'" [field]="'amountInStock'">
1849
+ <ng-template #template let-row="row">
1850
+ <co-input-number-picker (keyup.enter)="openDialogClick(row)" [(model)]="row['amountInStock']">
1851
+
1852
+ </co-input-number-picker>
1853
+ </ng-template>
1854
+ </co-simple-grid-column>
1855
+ <co-simple-grid-column [headerText]="'ALLOCATED'" [field]="'amountInStockFree'"></co-simple-grid-column>
1856
+ <co-simple-grid-column [headerText]="'AVAILABLE_STOCK'" [field]="'perceptibleStorage'"></co-simple-grid-column>
1857
+ <co-simple-grid-column [headerText]="'PHYSICAL_STOCK'" [field]="'amountInStockOriginal'"></co-simple-grid-column>
1858
+ <co-simple-grid-column [headerText]="'VALUTA'" [field]="'currency'"></co-simple-grid-column>
1859
+ <co-simple-grid-column [headerText]="'PURCHASE_PRICE'" [field]="'purchasePrice'"></co-simple-grid-column>
1860
+ <co-simple-grid-column [headerText]="'SUPPLIER_NUMBER'" [field]="'supplierNo'"></co-simple-grid-column>
1672
1861
  <co-simple-grid-column [headerText]="'TRANSFER'" [field]="'transfer'">
1673
1862
  <ng-template #template let-row="row">
1674
1863
  <co-icon class="menu-icon" [iconData]="iconCacheService.getIcon(icons.DeliveryTruck)" (click)="handleStockTransferClick(row)"></co-icon>
@@ -1682,15 +1871,32 @@ StockInformationGridComponent.decorators = [
1682
1871
  </co-simple-grid>
1683
1872
  </div>
1684
1873
 
1874
+ <co-stock-change-amount *ngIf="showChangeStockDetails"
1875
+ (closeStockChangeAmount)="showChangeStockDetails = false"
1876
+ [selectedArticleDetailsData]="selectedArticleDetailsData"
1877
+ >
1878
+ </co-stock-change-amount>
1879
+
1685
1880
  <div class="stock-grid" *ngIf="showStockHistory">
1881
+ <div class="stock-button-left-group">
1882
+ <span class="stock-button-back" [textContent]="'BACK_TO_STOCK_LINES'" (click)="backToStockInformation()"></span>
1883
+ </div>
1686
1884
  <co-simple-grid [data]="stockHistoryInformation"
1687
1885
  >
1688
- <co-simple-grid-column [headerText]="'WAREHOUSE'" [field]="'location'"></co-simple-grid-column>
1689
- <co-simple-grid-column [headerText]="'BATCH'" [field]="'batch'"></co-simple-grid-column>
1690
- <co-simple-grid-column [headerText]="'SERIAL_NO'" [field]="'serialNo'"></co-simple-grid-column>
1691
- <co-simple-grid-column [headerText]="'STOCK'" [field]="'amountInStock'"></co-simple-grid-column>
1692
- <co-simple-grid-column [headerText]="'ALLOCATED'" [field]="'allocated'"></co-simple-grid-column>
1693
- <co-simple-grid-column [headerText]="'AVAILABLE_STOCK'" [field]="'amountAvailable'"></co-simple-grid-column>
1886
+ <co-simple-grid-column [headerText]="'MUTATION_DATE'" [field]="'mutationDate'"></co-simple-grid-column>
1887
+ <co-simple-grid-column [headerText]="'MUTATION_TIME'" [field]="'mutationTime'"></co-simple-grid-column>
1888
+ <co-simple-grid-column [headerText]="'AMOUNT'" [field]="'amount'"></co-simple-grid-column>
1889
+ <co-simple-grid-column [headerText]="'WAREHOUSE'" [field]="'wareHouseNr'"></co-simple-grid-column>
1890
+ <co-simple-grid-column [headerText]="'LOCATION'" [field]="'locationNr'"></co-simple-grid-column>
1891
+ <co-simple-grid-column [headerText]="'TRANSACTION_TYPE'" [field]="'transType'"></co-simple-grid-column>
1892
+ <co-simple-grid-column [headerText]="'DOCUMENT_NUMBER'" [field]="'docNr'"></co-simple-grid-column>
1893
+ <co-simple-grid-column [headerText]="'LINE'" [field]="'posLineNr'"></co-simple-grid-column>
1894
+ <co-simple-grid-column [headerText]="'STOCK_STATE'" [field]="'stockStateId'"></co-simple-grid-column>
1895
+ <co-simple-grid-column [headerText]="'STOCK_REMARK'" [field]="'stockStateRemarkId'"></co-simple-grid-column>
1896
+ <co-simple-grid-column [headerText]="'VALUTA'" [field]="'currencyCode'"></co-simple-grid-column>
1897
+ <co-simple-grid-column [headerText]="'RELATION_ID'" [field]="'relationId'"></co-simple-grid-column>
1898
+ <co-simple-grid-column [headerText]="'USER'" [field]="'user'"></co-simple-grid-column>
1899
+ <co-simple-grid-column [headerText]="'MUTATION_TYPE'" [field]="'mutationType'"></co-simple-grid-column>
1694
1900
  <co-simple-grid-column [headerText]="'STICKER'" [field]="'sticker'">
1695
1901
  <ng-template #template let-row="row">
1696
1902
  <co-icon class="menu-icon" [iconData]="iconCacheService.getIcon(icons.Print)" (click)="openSendMethodDialog()"></co-icon>
@@ -1713,6 +1919,7 @@ StockInformationGridComponent.decorators = [
1713
1919
  </div>
1714
1920
  </div>
1715
1921
  <ione-send-method-dialog
1922
+ *ngIf="showSendMethodDialog"
1716
1923
  [showDialog]="showSendMethodDialog"
1717
1924
  (printButtonClicked)="printStockStickers()"
1718
1925
  ></ione-send-method-dialog>
@@ -1727,31 +1934,22 @@ StockInformationGridComponent.ctorParameters = () => [
1727
1934
  StockInformationGridComponent.propDecorators = {
1728
1935
  stock: [{ type: ViewChild, args: [StockInformationGridComponent,] }],
1729
1936
  articleStockInformation: [{ type: Input }],
1730
- stockHistoryInformation: [{ type: Input }],
1731
1937
  stockLocationData: [{ type: Input }],
1732
- locationLineClicked: [{ type: Output }],
1733
- transferIconClicked: [{ type: Output }]
1938
+ stockHistoryInformation: [{ type: Input }],
1939
+ transferIconClicked: [{ type: Output }],
1940
+ historyClicked: [{ type: Output }]
1734
1941
  };
1735
1942
 
1736
1943
  class StockLocationComponent {
1737
- constructor() {
1944
+ constructor(_stockService) {
1945
+ this._stockService = _stockService;
1738
1946
  this.backToStockLines = new EventEmitter();
1739
- this.MAX_GRID_ROWS = 10;
1740
1947
  this.stockLocationColumns = [];
1741
- this.stockLocation = [
1742
- { location: "title 1", batch: "1", serieNo: "1", amountInStock: "1", allocated: "1", amountAvailable: "1" },
1743
- { location: "title 2", amountInStock: "2" },
1744
- { location: "title 3", amountInStock: "3" },
1745
- { location: "title 4", amountInStock: "4" },
1746
- { location: "title 5", amountInStock: "5" },
1747
- ];
1748
1948
  this.stockLocationColumns.push({ field: "location", headerText: "WAREHOUSE", editType: "none" }, { field: "batch", headerText: "BATCH" }, { field: "serieNo", headerText: "SERIAL_NO" }, { field: "amountInStock", headerText: "STOCK", textAlign: "Right", editType: "numericEdit" }, { field: "allocated", headerText: "ALLOCATED", textAlign: "Right" }, { field: "amountAvailable", headerText: "AVAILABLE_STOCK", textAlign: "Right" }, { field: "PhysicalStock", headerText: "PHYSICAL_STOCK", textAlign: "Right" }, { field: "Valuta", headerText: "VALUTA", textAlign: "Right" }, { field: "PurchasePrice", headerText: "PURSCHASE_PRICE", textAlign: "Right" }, { field: "SupplierNo", headerText: "SUPPLIER_NO", textAlign: "Right" }, { field: "Transfer", headerText: "TRANSFER" }, { field: "sticker", headerText: "STICKER" });
1749
1949
  }
1750
1950
  backToStockInformation() {
1751
1951
  this.backToStockLines.emit();
1752
1952
  }
1753
- onStickerClick(event) {
1754
- }
1755
1953
  onOkClick() {
1756
1954
  }
1757
1955
  onCancelClick() {
@@ -1794,7 +1992,9 @@ StockLocationComponent.decorators = [
1794
1992
  encapsulation: ViewEncapsulation.None
1795
1993
  },] }
1796
1994
  ];
1797
- StockLocationComponent.ctorParameters = () => [];
1995
+ StockLocationComponent.ctorParameters = () => [
1996
+ { type: StockService }
1997
+ ];
1798
1998
  StockLocationComponent.propDecorators = {
1799
1999
  stockLocationInformation: [{ type: Input }],
1800
2000
  backToStockLines: [{ type: Output }]
@@ -1805,15 +2005,29 @@ class StockTransferComponent {
1805
2005
  this._stockService = _stockService;
1806
2006
  this.handleCancelClicked = new EventEmitter();
1807
2007
  this.handleStickerClicked = new EventEmitter();
1808
- this.allWarehousesDropdownFields = { value: "warehouseNo", text: "description" };
2008
+ this.allWarehousesDropdownFields = { text: "warehouseDescription", value: "warehouseNo" };
2009
+ this.allLocationDropdownFields = { text: "locationNo", value: "locationNo" };
1809
2010
  this.showSendMethodDialog = false;
2011
+ this.stockState = [];
2012
+ this.stockStateDropdownField = { text: "stateDescription", value: "stockStateId" };
1810
2013
  }
1811
- handleOkClick() {
2014
+ ngAfterViewInit() {
2015
+ this.getStockManagementWarehouses();
2016
+ this.getStockState();
2017
+ }
2018
+ handleOkClick(data) {
2019
+ return __awaiter(this, void 0, void 0, function* () {
2020
+ data.selected = true;
2021
+ data.entryDate = new Date;
2022
+ yield this._stockService.updateArticleDetails(data);
2023
+ });
1812
2024
  }
1813
2025
  handleCancelClick() {
1814
2026
  this.handleCancelClicked.emit();
1815
2027
  }
1816
2028
  handleSelectedWarehouse(event) {
2029
+ this.selectedWarehouse = event;
2030
+ this.getStockManagementLocations(this.selectedWarehouse);
1817
2031
  }
1818
2032
  handleStickerClick() {
1819
2033
  return __awaiter(this, void 0, void 0, function* () {
@@ -1821,6 +2035,21 @@ class StockTransferComponent {
1821
2035
  this.showSendMethodDialog = true;
1822
2036
  });
1823
2037
  }
2038
+ getStockManagementWarehouses() {
2039
+ this._stockService.getStockManagementWarehouses().then((warehouses) => {
2040
+ this.warehouses = warehouses;
2041
+ });
2042
+ }
2043
+ getStockManagementLocations(data) {
2044
+ this._stockService.getStockManagementLocations(data).then((locations) => {
2045
+ this.locations = locations;
2046
+ });
2047
+ }
2048
+ getStockState() {
2049
+ this._stockService.getStockState().then((state) => {
2050
+ this.stockState = state;
2051
+ });
2052
+ }
1824
2053
  }
1825
2054
  StockTransferComponent.decorators = [
1826
2055
  { type: Component, args: [{
@@ -1828,16 +2057,15 @@ StockTransferComponent.decorators = [
1828
2057
  template: `
1829
2058
  <div class="stock-transfer">
1830
2059
  <div class="stock-transfer-columns">
1831
- <h1 [textContent]="'Nog niet geimplmenteerd'"></h1>
1832
- <div *ngIf="article" class="stock-transfer-left-column">
2060
+ <div *ngIf="articleToTransfer" class="stock-transfer-left-column">
1833
2061
  <co-input-text disabled
1834
- [(model)]="article.warehouseNo"
1835
- [textContent]="article.warehouseNo"
2062
+ [(model)]="articleToTransfer.warehouseDescription"
2063
+ [textContent]="articleToTransfer.warehouseDescription"
1836
2064
  [placeholder]="'Standaard magazijn'">
1837
2065
  </co-input-text>
1838
2066
  <co-input-text disabled
1839
- [(model)]="article.locationNo"
1840
- [textContent]="article.locationNo"
2067
+ [(model)]="articleToTransfer.locationNo"
2068
+ [textContent]="articleToTransfer.locationNo"
1841
2069
  [placeholder]="'Standaard locatie'">
1842
2070
  </co-input-text>
1843
2071
  <co-input-text disabled
@@ -1849,32 +2077,35 @@ StockTransferComponent.decorators = [
1849
2077
  [placeholder]="'Serie'">
1850
2078
  </co-input-text>
1851
2079
  <co-input-text
1852
- [(model)]="article.amountAssigned"
2080
+ [(model)]="articleToTransfer.amountTransfer"
1853
2081
  [placeholder]="'Aantal'">
1854
-
1855
2082
  </co-input-text>
1856
2083
  </div>
1857
2084
 
1858
2085
  <div class="stock-transfer-right-column">
1859
- <co-drop-down-list [collection]="allWarehouses"
2086
+ <co-drop-down-list [collection]="warehouses"
1860
2087
  [fields]="allWarehousesDropdownFields"
1861
2088
  (modelChange)="handleSelectedWarehouse($event)"
2089
+ [(model)]="articleToTransfer.targetWarehouse">
2090
+ </co-drop-down-list>
2091
+ <co-drop-down-list [collection]="locations"
2092
+ [fields]="allLocationDropdownFields"
2093
+ [(model)]="articleToTransfer.targetLocation"
1862
2094
  >
1863
2095
  </co-drop-down-list>
1864
- <co-drop-down-list>
1865
-
2096
+ <co-drop-down-list [collection]="stockState"
2097
+ [fields]="stockStateDropdownField"
2098
+ [placeholder]="'Voorraadstatus'"
2099
+ [(model)]="articleToTransfer.stockStateId">
1866
2100
  </co-drop-down-list>
1867
- <co-input-text [placeholder]="'Voorraadstatus'">
1868
-
1869
- </co-input-text>
1870
- <co-input-text [placeholder]="'Omschrijving'">
1871
-
2101
+ <co-input-text [placeholder]="'Omschrijving'"
2102
+ [(model)]="articleToTransfer.stockStateRemark">
1872
2103
  </co-input-text>
1873
2104
  </div>
1874
2105
  </div>
1875
2106
 
1876
2107
  <div class="ok-cancel-buttons">
1877
- <co-button [textContent]="'Ok'" (click)="handleOkClick()"></co-button>
2108
+ <co-button [textContent]="'Ok'" (click)="handleOkClick(articleToTransfer)"></co-button>
1878
2109
  <co-button [textContent]="'Annuleren'" (click)="handleCancelClick()"></co-button>
1879
2110
  <co-button [textContent]="'Sticker'" (click)="handleStickerClick()"></co-button>
1880
2111
  </div>
@@ -1889,6 +2120,7 @@ StockTransferComponent.ctorParameters = () => [
1889
2120
  StockTransferComponent.propDecorators = {
1890
2121
  stockSticker: [{ type: Input }],
1891
2122
  article: [{ type: Input }],
2123
+ articleToTransfer: [{ type: Input }],
1892
2124
  articleWarehouse: [{ type: Input }],
1893
2125
  allWarehouses: [{ type: Input }],
1894
2126
  handleCancelClicked: [{ type: Output }],
@@ -1924,6 +2156,7 @@ class SendMethodDialogComponent {
1924
2156
  this.showStandardPrinterOptions = false;
1925
2157
  this.showPrinterSelections = false;
1926
2158
  this.showExitButton = true;
2159
+ this.printTemplatesField = { text: "name", value: "name" };
1927
2160
  this.emails = ['lars.vdv@colijn-it.nl', 'david@colijn-it.nl', 'ruben@colijn-it.nl'];
1928
2161
  this.models = [false, false, true];
1929
2162
  this.layouts = ['Layout 1', 'Layout 2', 'Layout 3'];
@@ -1934,6 +2167,9 @@ class SendMethodDialogComponent {
1934
2167
  showClass() {
1935
2168
  return true;
1936
2169
  }
2170
+ ngAfterViewInit() {
2171
+ this.getPrintTemplates();
2172
+ }
1937
2173
  getPrinters() {
1938
2174
  return __awaiter(this, void 0, void 0, function* () {
1939
2175
  return this._stockService.getAllPrinters(true).then((list) => {
@@ -1961,14 +2197,16 @@ class SendMethodDialogComponent {
1961
2197
  this.headerTitle = 'Verzendopties';
1962
2198
  }
1963
2199
  }
1964
- loadLayouts() {
1965
- const printJob = new PrintJob();
1966
- // this.printLayouts = this._stockService.getPrintTemplates(printJob);
1967
- }
1968
2200
  onPrinterClicked(printer) {
1969
2201
  this.defaultPrinter = printer.name;
1970
2202
  this.showPrinterSelections = !this.showPrinterSelections;
1971
2203
  }
2204
+ getPrintTemplates() {
2205
+ const data = new StockStickersPrintLayoutsBo();
2206
+ this._stockService.getStockStickerTemplates(data).then((templates) => {
2207
+ this.printTemplates = templates;
2208
+ });
2209
+ }
1972
2210
  }
1973
2211
  SendMethodDialogComponent.decorators = [
1974
2212
  { type: Component, args: [{
@@ -2020,7 +2258,8 @@ SendMethodDialogComponent.decorators = [
2020
2258
  <div class="lov-wrapper">
2021
2259
  <co-input-combo-box
2022
2260
  [(model)]="selectedLayout"
2023
- [collection]="layouts"
2261
+ [collection]="printTemplates"
2262
+ [fields]="printTemplatesField"
2024
2263
  [forceReadonly]="true"
2025
2264
  placeholder="Layout"
2026
2265
  ></co-input-combo-box>
@@ -2139,6 +2378,71 @@ SendMethodDialogModule.decorators = [
2139
2378
  },] }
2140
2379
  ];
2141
2380
 
2381
+ class StockChangeAmountComponent {
2382
+ constructor(_stockService) {
2383
+ this._stockService = _stockService;
2384
+ this.closeStockChangeAmount = new EventEmitter();
2385
+ this.stockState = [];
2386
+ this.stockStateDropdownField = { text: "stateDescription", value: "stockStateId" };
2387
+ }
2388
+ ngAfterViewInit() {
2389
+ this.getStockState();
2390
+ }
2391
+ closeDialogClick() {
2392
+ this.closeStockChangeAmount.emit();
2393
+ }
2394
+ handleOkClick(data) {
2395
+ return __awaiter(this, void 0, void 0, function* () {
2396
+ yield this._stockService.updateArticleDetails(data);
2397
+ });
2398
+ }
2399
+ handleCancelClick() {
2400
+ this.closeStockChangeAmount.emit();
2401
+ }
2402
+ getStockState() {
2403
+ this._stockService.getStockState().then((state) => {
2404
+ this.stockState = state;
2405
+ });
2406
+ }
2407
+ }
2408
+ StockChangeAmountComponent.decorators = [
2409
+ { type: Component, args: [{
2410
+ selector: "co-stock-change-amount",
2411
+ template: `
2412
+ <div class="stock-transfer">
2413
+ <co-dialog-wizard [showCloseIcon]="true" (closeClick)="closeDialogClick()">
2414
+ <ng-container header>
2415
+ <span [textContent]="'STOCK_CHANGE_REASON'"></span>
2416
+ </ng-container>
2417
+ <div class="popup-wrapper">
2418
+ <co-drop-down-list [collection]="stockState"
2419
+ [fields]="stockStateDropdownField"
2420
+ [placeholder]="'STOCK_STATE'"
2421
+ [(model)]="selectedArticleDetailsData.stockStateId"
2422
+ ></co-drop-down-list>
2423
+
2424
+ <co-input-textarea [(model)]="selectedArticleDetailsData.stockStateRemark"
2425
+
2426
+ ></co-input-textarea>
2427
+ <div class="ok-cancel-buttons">
2428
+ <co-button [textContent]="'Ok'" (click)="handleOkClick(selectedArticleDetailsData)"></co-button>
2429
+ <co-button [textContent]="'Annuleren'" (click)="handleCancelClick()"></co-button>
2430
+ </div>
2431
+ </div>
2432
+ </co-dialog-wizard>
2433
+ </div>
2434
+ `,
2435
+ encapsulation: ViewEncapsulation.None
2436
+ },] }
2437
+ ];
2438
+ StockChangeAmountComponent.ctorParameters = () => [
2439
+ { type: StockService }
2440
+ ];
2441
+ StockChangeAmountComponent.propDecorators = {
2442
+ selectedArticleDetailsData: [{ type: Input }],
2443
+ closeStockChangeAmount: [{ type: Output }]
2444
+ };
2445
+
2142
2446
  class StockModule {
2143
2447
  }
2144
2448
  StockModule.decorators = [
@@ -2154,14 +2458,18 @@ StockModule.decorators = [
2154
2458
  ImageModule,
2155
2459
  InputTextModule,
2156
2460
  SendMethodDialogModule,
2157
- IconModule
2461
+ IconModule,
2462
+ InputNumberPickerModule,
2463
+ CoDialogWizardModule,
2464
+ InputTextareaModule
2158
2465
  ],
2159
2466
  declarations: [
2160
2467
  StockComponent,
2161
2468
  StockInformationComponent,
2162
2469
  StockInformationGridComponent,
2163
2470
  StockLocationComponent,
2164
- StockTransferComponent
2471
+ StockTransferComponent,
2472
+ StockChangeAmountComponent
2165
2473
  ],
2166
2474
  exports: [
2167
2475
  StockComponent
@@ -2181,5 +2489,5 @@ StockModule.decorators = [
2181
2489
  * Generated bundle index. Do not edit.
2182
2490
  */
2183
2491
 
2184
- export { DocsignComponent, DocsignModule, SendMethodDialogComponent, SendMethodDialogModule, StockComponent, StockModule, SignatureComponent as ɵa, SignaturesComponent as ɵb, StockService as ɵc, IoneConnectorAdapterService as ɵd, IconCacheService as ɵe, StockInformationComponent as ɵf, StockInformationGridComponent as ɵg, StockLocationComponent as ɵh, StockTransferComponent as ɵi };
2492
+ export { DocsignComponent, DocsignModule, SendMethodDialogComponent, SendMethodDialogModule, StockComponent, StockModule, SignatureComponent as ɵa, SignaturesComponent as ɵb, StockService as ɵc, IoneConnectorAdapterService as ɵd, IconCacheService as ɵe, StockInformationComponent as ɵf, StockInformationGridComponent as ɵg, StockLocationComponent as ɵh, StockTransferComponent as ɵi, StockChangeAmountComponent as ɵj };
2185
2493
  //# sourceMappingURL=colijnit-sharedcomponents.js.map