@colijnit/sharedcomponents 1.0.51 → 1.0.52

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.
@@ -24,7 +24,9 @@ import { SendMethod as SendMethod$1 } from '@colijnit/mainapi/build/model/send-m
24
24
  import { BusinessObjectFactory } from '@colijnit/ioneconnector/build/service/business-object-factory';
25
25
  import { TagTreeItem } from '@colijnit/mainapi/build/model/tag-tree-item.bo';
26
26
  import { PrintStockStickers } from '@colijnit/sharedapi/build/model/print-stock-stickers';
27
+ import { ArticleExtended } from '@colijnit/articleapi/build/model/article-extended.bo';
27
28
  import { ArticleStock as ArticleStock$1 } from '@colijnit/articleapi/build/model/article-stock';
29
+ import { ArticleExtendedRequest } from '@colijnit/articleapi/build/model/article-extended-request';
28
30
  import { IconModule, InputCheckboxModule, CoDialogModule, ButtonModule, ListOfValuesModule, OverlayService, ClickoutsideModule, OverlayModule, InputRadioButtonModule, SimpleGridModule, ImageModule, InputTextModule, InputNumberPickerModule, CoDialogWizardModule, InputTextareaModule, PopupModule, ResponsiveTextModule, InputDatePickerModule, InputSearchModule } from '@colijnit/corecomponents_v12';
29
31
  import * as i1 from '@angular/platform-browser';
30
32
  import { DomSanitizer } from '@angular/platform-browser';
@@ -788,6 +790,38 @@ class SharedConnectorService {
788
790
  });
789
791
  });
790
792
  }
793
+ getArticleFlat(sku) {
794
+ return __awaiter(this, void 0, void 0, function* () {
795
+ return new Promise((resolve, reject) => {
796
+ return this.articleConnector.getArticleFlat(sku).then((result) => {
797
+ if (result.validationResult && result.validationResult.success) {
798
+ if (result.resultObject) {
799
+ resolve(result.resultObject);
800
+ }
801
+ }
802
+ else {
803
+ reject(result.validationMessagesAsString);
804
+ }
805
+ });
806
+ });
807
+ });
808
+ }
809
+ searchArticles(request) {
810
+ return __awaiter(this, void 0, void 0, function* () {
811
+ return new Promise((resolve, reject) => {
812
+ return this.articleConnector.searchArticles(request, false).then((result) => {
813
+ if (result.validationResult && result.validationResult.success) {
814
+ if (result.resultObjects) {
815
+ resolve(this._boFactory.makeBOArrayFromRawBackendDataArray(StockManagementWarehouses, result.resultObjects));
816
+ }
817
+ }
818
+ else {
819
+ reject(result.validationMessagesAsString);
820
+ }
821
+ });
822
+ });
823
+ });
824
+ }
791
825
  getStockManagementWarehouses() {
792
826
  return __awaiter(this, void 0, void 0, function* () {
793
827
  return new Promise((resolve, reject) => {
@@ -1064,6 +1098,16 @@ class StockService {
1064
1098
  commit() {
1065
1099
  return this._sharedService.commit();
1066
1100
  }
1101
+ getArticleFlat(sku) {
1102
+ return __awaiter(this, void 0, void 0, function* () {
1103
+ return yield this._sharedService.getArticleFlat(sku);
1104
+ });
1105
+ }
1106
+ searchArticles(request) {
1107
+ return __awaiter(this, void 0, void 0, function* () {
1108
+ return yield this._sharedService.searchArticles(request);
1109
+ });
1110
+ }
1067
1111
  }
1068
1112
  StockService.ɵprov = i0.ɵɵdefineInjectable({ factory: function StockService_Factory() { return new StockService(i0.ɵɵinject(SharedConnectorService)); }, token: StockService, providedIn: "root" });
1069
1113
  StockService.decorators = [
@@ -1107,15 +1151,17 @@ LocalizeService.decorators = [
1107
1151
  ];
1108
1152
 
1109
1153
  class StockComponent {
1110
- constructor(stockService, _optionsService, _dictionary, _changeDetector, _localizeService) {
1111
- this.stockService = stockService;
1154
+ constructor(_stockService, _optionsService, _dictionary, _changeDetector, _localizeService, _connector) {
1155
+ this._stockService = _stockService;
1112
1156
  this._optionsService = _optionsService;
1113
1157
  this._dictionary = _dictionary;
1114
1158
  this._changeDetector = _changeDetector;
1115
1159
  this._localizeService = _localizeService;
1160
+ this._connector = _connector;
1116
1161
  this.handleStickerClicked = new EventEmitter();
1117
1162
  this.okButtonClicked = new EventEmitter();
1118
1163
  this.cancelButtonClicked = new EventEmitter();
1164
+ this.loaded = false;
1119
1165
  this.showStockInformationGrid = true;
1120
1166
  this.showStockTransfer = false;
1121
1167
  this.allAvailableStock = 0;
@@ -1128,9 +1174,13 @@ class StockComponent {
1128
1174
  this._localizeService.translation = value;
1129
1175
  this._changeDetector.markForCheck();
1130
1176
  }
1131
- set article(article) {
1132
- this.articleExtended = article;
1133
- this.getStockInformation(article);
1177
+ set article(articleOrGoodId) {
1178
+ if (articleOrGoodId instanceof ArticleExtended) {
1179
+ this.articleExtended = articleOrGoodId;
1180
+ }
1181
+ else if (typeof articleOrGoodId === "number") {
1182
+ this._goodId = articleOrGoodId;
1183
+ }
1134
1184
  }
1135
1185
  ;
1136
1186
  showClass() {
@@ -1140,14 +1190,12 @@ class StockComponent {
1140
1190
  this._subscriptions.forEach(subscription => subscription.unsubscribe());
1141
1191
  }
1142
1192
  ngOnInit() {
1143
- this.getArtStockStatus();
1144
- this.getStockManagementWarehouses();
1145
1193
  }
1146
1194
  handleStockTransferClick(event) {
1147
1195
  this.stockTransferArticleDetails = event;
1148
1196
  this.showStockTransfer = !this.showStockTransfer;
1149
1197
  this.showStockInformationGrid = !this.showStockInformationGrid;
1150
- this.stockService.stockStickers = new PrintStockStickers();
1198
+ this._stockService.stockStickers = new PrintStockStickers();
1151
1199
  }
1152
1200
  handleSendMethodClick(event) {
1153
1201
  this.showSendMethodDialog = true;
@@ -1156,23 +1204,23 @@ class StockComponent {
1156
1204
  this.showStockTransfer = !this.showStockTransfer;
1157
1205
  this.showStockInformationGrid = !this.showStockInformationGrid;
1158
1206
  }
1159
- getStockInformation(data) {
1160
- return __awaiter(this, void 0, void 0, function* () {
1161
- const articleData = new ArticleStock$1();
1162
- articleData.goodId = data.goodId.toString();
1163
- articleData.viewKind = "M";
1164
- this.stockInformation = yield this.stockService.getStockInformation(articleData);
1207
+ getStockInformation(goodId) {
1208
+ const articleData = new ArticleStock$1();
1209
+ articleData.goodId = goodId.toString();
1210
+ articleData.viewKind = "M";
1211
+ this._stockService.getStockInformation(articleData).then(result => {
1212
+ this.stockInformation = result;
1165
1213
  this.stockInformation.forEach((articleStock) => this.allAvailableStock += articleStock.availableStock);
1166
1214
  this.stockInformation.forEach((articleStock) => this.allTechnicalStock += articleStock.technicalStock);
1167
1215
  });
1168
1216
  }
1169
1217
  getArtStockStatus() {
1170
- return __awaiter(this, void 0, void 0, function* () {
1171
- this.articleStockState = yield this.stockService.getArtStockStatus(this.articleExtended.goodId);
1218
+ this._stockService.getArtStockStatus(this.articleExtended ? this.articleExtended.goodId : this._goodId).then(result => {
1219
+ this.articleStockState = result;
1172
1220
  });
1173
1221
  }
1174
1222
  getStockManagementWarehouses() {
1175
- this.stockService.getStockManagementWarehouses().then((warehouses) => {
1223
+ this._stockService.getStockManagementWarehouses().then((warehouses) => {
1176
1224
  this.warehouses = warehouses;
1177
1225
  });
1178
1226
  }
@@ -1185,7 +1233,7 @@ class StockComponent {
1185
1233
  }
1186
1234
  _initConnection() {
1187
1235
  return __awaiter(this, void 0, void 0, function* () {
1188
- // await this._connector.connect(this._optionsService.options);
1236
+ yield this._connector.connect();
1189
1237
  if (this._optionsService.options.url) {
1190
1238
  this._dictionary.rootUrl = this._optionsService.options.url.replace("/ajaxservice", "");
1191
1239
  }
@@ -1193,14 +1241,31 @@ class StockComponent {
1193
1241
  setTimeout(() => {
1194
1242
  this._changeDetector.detectChanges();
1195
1243
  });
1244
+ this.loaded = true;
1245
+ this.loadData();
1196
1246
  });
1197
1247
  }
1248
+ loadData() {
1249
+ if (this.loaded) {
1250
+ let request = new ArticleExtendedRequest();
1251
+ request.goodId = this._goodId;
1252
+ this._stockService.searchArticles(request).then((articleExtended) => {
1253
+ this.articleExtended = articleExtended[0];
1254
+ this._stockService.getArticleFlat(articleExtended[0].articleNumber).then(result => {
1255
+ this.articleFlat = result;
1256
+ });
1257
+ });
1258
+ this.getArtStockStatus();
1259
+ this.getStockManagementWarehouses();
1260
+ this.getStockInformation(this.articleExtended ? this.articleExtended.goodId : this._goodId);
1261
+ }
1262
+ }
1198
1263
  }
1199
1264
  StockComponent.decorators = [
1200
1265
  { type: Component, args: [{
1201
1266
  selector: "co-stock",
1202
1267
  template: `
1203
- <div class="stock-info-container">
1268
+ <div class="stock-info-container" *ngIf="loaded && articleExtended">
1204
1269
  <co-stock-information [article]="articleExtended"
1205
1270
  [articleStockState]="articleStockState"
1206
1271
  [allAvailableStockInformation]="allAvailableStock"
@@ -1210,6 +1275,7 @@ StockComponent.decorators = [
1210
1275
  <hr>
1211
1276
  <co-stock-tabs [stockInformation]="stockInformation"
1212
1277
  [article]="articleExtended"
1278
+ [articleFlat]="articleFlat"
1213
1279
  (transferIconClicked)="handleStockTransferClick($event)"
1214
1280
  (sendMethodDialogClicked)="handleSendMethodClick($event)"
1215
1281
  [warehouses]="warehouses"
@@ -1240,10 +1306,10 @@ StockComponent.ctorParameters = () => [
1240
1306
  { type: OptionsService },
1241
1307
  { type: DictionaryService },
1242
1308
  { type: ChangeDetectorRef },
1243
- { type: LocalizeService }
1309
+ { type: LocalizeService },
1310
+ { type: SharedConnectorService }
1244
1311
  ];
1245
1312
  StockComponent.propDecorators = {
1246
- stock: [{ type: ViewChild, args: [StockComponent,] }],
1247
1313
  translation: [{ type: Input }],
1248
1314
  handleStickerClicked: [{ type: Output }],
1249
1315
  article: [{ type: Input }],
@@ -1885,10 +1951,9 @@ class StockTransferComponent {
1885
1951
  this.getStockState();
1886
1952
  }
1887
1953
  handleOkClick(data) {
1888
- return __awaiter(this, void 0, void 0, function* () {
1889
- data.selected = true;
1890
- data.entryDate = new Date;
1891
- yield this._stockService.updateArticleDetails(data);
1954
+ data.selected = true;
1955
+ data.entryDate = new Date;
1956
+ this._stockService.updateArticleDetails(data).then(result => {
1892
1957
  this.handleClick.emit();
1893
1958
  });
1894
1959
  }
@@ -1907,10 +1972,8 @@ class StockTransferComponent {
1907
1972
  this.articleToTransfer.stockStateId = event.stockStateId;
1908
1973
  }
1909
1974
  handleStickerClick() {
1910
- return __awaiter(this, void 0, void 0, function* () {
1911
- this.handleStickerClicked.emit();
1912
- this.showSendMethodDialog = true;
1913
- });
1975
+ this.handleStickerClicked.emit();
1976
+ this.showSendMethodDialog = true;
1914
1977
  }
1915
1978
  getStockManagementWarehouses() {
1916
1979
  this._stockService.getStockManagementWarehouses().then((warehouses) => {
@@ -2954,78 +3017,78 @@ class StockTabsComponent {
2954
3017
  this.handleWarehouseSelected(this.selectedWarehouse);
2955
3018
  }
2956
3019
  getStockHistory() {
2957
- return __awaiter(this, void 0, void 0, function* () {
2958
- if (!this.stockHistory) {
2959
- const stockHistoryInformation = new GetStockHistoryRequest();
2960
- stockHistoryInformation.type = "V";
2961
- stockHistoryInformation.goodId = this.article.goodId;
2962
- this.stockHistory = yield this._stockService.getStockHistory(stockHistoryInformation);
2963
- }
2964
- });
3020
+ if (!this.stockHistory) {
3021
+ const stockHistoryInformation = new GetStockHistoryRequest();
3022
+ stockHistoryInformation.type = "V";
3023
+ stockHistoryInformation.goodId = this.article.goodId.toString();
3024
+ this._stockService.getStockHistory(stockHistoryInformation).then(result => {
3025
+ this.stockHistory = result;
3026
+ });
3027
+ }
2965
3028
  }
2966
3029
  getOrderSupplyStockHistory() {
2967
- return __awaiter(this, void 0, void 0, function* () {
2968
- if (!this.orderSupplyStockHistory) {
2969
- const stockHistoryInformation = new GetStockHistoryRequest();
2970
- stockHistoryInformation.type = "O";
2971
- stockHistoryInformation.goodId = this.article.goodId;
2972
- this.orderSupplyStockHistory = yield this._stockService.getStockHistory(stockHistoryInformation);
2973
- }
2974
- });
3030
+ if (!this.orderSupplyStockHistory) {
3031
+ const stockHistoryInformation = new GetStockHistoryRequest();
3032
+ stockHistoryInformation.type = "O";
3033
+ stockHistoryInformation.goodId = this.article.goodId.toString();
3034
+ this._stockService.getStockHistory(stockHistoryInformation).then(result => {
3035
+ this.orderSupplyStockHistory = result;
3036
+ });
3037
+ }
2975
3038
  }
2976
3039
  getOrderCommissionStockHistory() {
2977
- return __awaiter(this, void 0, void 0, function* () {
2978
- if (!this.orderCommissionStockHistory) {
2979
- const stockHistoryInformation = new GetStockHistoryRequest();
2980
- stockHistoryInformation.type = "C";
2981
- stockHistoryInformation.goodId = this.article.goodId;
2982
- this.orderCommissionStockHistory = yield this._stockService.getStockHistory(stockHistoryInformation);
2983
- }
2984
- });
3040
+ if (!this.orderCommissionStockHistory) {
3041
+ const stockHistoryInformation = new GetStockHistoryRequest();
3042
+ stockHistoryInformation.type = "C";
3043
+ stockHistoryInformation.goodId = this.article.goodId.toString();
3044
+ this._stockService.getStockHistory(stockHistoryInformation).then(result => {
3045
+ this.orderCommissionStockHistory = result;
3046
+ });
3047
+ }
2985
3048
  }
2986
3049
  getOrderStockHistory() {
2987
- return __awaiter(this, void 0, void 0, function* () {
2988
- if (!this.orderStockHistory) {
2989
- const stockHistoryInformation = new GetStockHistoryRequest();
2990
- stockHistoryInformation.type = "B";
2991
- stockHistoryInformation.goodId = this.article.goodId;
2992
- this.orderStockHistory = yield this._stockService.getStockHistory(stockHistoryInformation);
2993
- }
2994
- });
3050
+ if (!this.orderStockHistory) {
3051
+ const stockHistoryInformation = new GetStockHistoryRequest();
3052
+ stockHistoryInformation.type = "B";
3053
+ stockHistoryInformation.goodId = this.article.goodId.toString();
3054
+ this._stockService.getStockHistory(stockHistoryInformation).then(result => {
3055
+ this.orderStockHistory = result;
3056
+ });
3057
+ }
2995
3058
  }
2996
3059
  getAllocationStockHistory() {
2997
- return __awaiter(this, void 0, void 0, function* () {
2998
- if (!this.orderAllocationStockHistory) {
2999
- const stockHistoryInformation = new GetStockHistoryRequest();
3000
- stockHistoryInformation.type = "T";
3001
- stockHistoryInformation.goodId = this.article.goodId;
3002
- this.orderAllocationStockHistory = yield this._stockService.getStockHistory(stockHistoryInformation);
3003
- }
3004
- });
3060
+ if (!this.orderAllocationStockHistory) {
3061
+ const stockHistoryInformation = new GetStockHistoryRequest();
3062
+ stockHistoryInformation.type = "T";
3063
+ stockHistoryInformation.goodId = this.article.goodId.toString();
3064
+ this._stockService.getStockHistory(stockHistoryInformation).then(result => {
3065
+ this.orderAllocationStockHistory = result;
3066
+ });
3067
+ }
3005
3068
  }
3006
3069
  getInOrderData() {
3007
- return __awaiter(this, void 0, void 0, function* () {
3008
- if (!this.inOrderInformation) {
3009
- const inOrderData = new ArticleTransaction$1();
3010
- inOrderData.type = "V";
3011
- inOrderData.goodId = this.stockInformation[0].goodId.toString();
3012
- this.inOrderInformation = yield this._stockService.getArticleTransaction(inOrderData);
3013
- }
3014
- });
3070
+ if (!this.inOrderInformation) {
3071
+ const inOrderData = new ArticleTransaction$1();
3072
+ inOrderData.type = "V";
3073
+ inOrderData.goodId = this.stockInformation[0].goodId.toString();
3074
+ this._stockService.getArticleTransaction(inOrderData).then(result => {
3075
+ this.inOrderInformation = result;
3076
+ });
3077
+ }
3015
3078
  }
3016
3079
  getOrderData() {
3017
- return __awaiter(this, void 0, void 0, function* () {
3018
- if (!this.orderInformation) {
3019
- const orderData = new ArticleTransaction$1();
3020
- orderData.type = "I";
3021
- orderData.goodId = this.stockInformation[0].goodId.toString();
3022
- this.orderInformation = yield this._stockService.getArticleTransaction(orderData);
3023
- }
3024
- });
3080
+ if (!this.orderInformation) {
3081
+ const orderData = new ArticleTransaction$1();
3082
+ orderData.type = "I";
3083
+ orderData.goodId = this.stockInformation[0].goodId.toString();
3084
+ this._stockService.getArticleTransaction(orderData).then(result => {
3085
+ this.orderInformation = result;
3086
+ });
3087
+ }
3025
3088
  }
3026
3089
  getStockPrognose(warehouseNo) {
3027
- return __awaiter(this, void 0, void 0, function* () {
3028
- this.stockPrognose = yield this._stockService.stockPrognose(this.article.goodId, warehouseNo);
3090
+ this._stockService.stockPrognose(this.article.goodId, warehouseNo).then(result => {
3091
+ this.stockPrognose = result;
3029
3092
  });
3030
3093
  }
3031
3094
  handleWarehouseSelected(event) {
@@ -3036,7 +3099,7 @@ class StockTabsComponent {
3036
3099
  }
3037
3100
  if (this.tabs[2].active) {
3038
3101
  this.articleDetailsInformation.warehouseNumber = event.warehouseNo;
3039
- this.articleDetailsInformation.goodId = this.article.goodId;
3102
+ this.articleDetailsInformation.goodId = this.article.goodId.toString();
3040
3103
  this._stockService.getArticleDetails(this.articleDetailsInformation).then((details) => {
3041
3104
  this.articleDetails = details;
3042
3105
  });
@@ -3074,11 +3137,11 @@ StockTabsComponent.decorators = [
3074
3137
  [articleStockInfo]="articleDetails"
3075
3138
  [articleStockInformation]="stockInformation"
3076
3139
  [article]="article"
3140
+ [articleFlat]="articleFlat"
3077
3141
  [selectedWarehouse]="selectedWarehouse"
3078
3142
  [dataWareHouseCode]="warehouses"
3079
3143
  (transferIconClicked)="transferIconClicked.emit($event)"
3080
3144
  (sendMethodDialogClicked)="sendMethodDialogClicked.emit($event)"
3081
- (locationAddedOrUpdated)="articleDetails = $event"
3082
3145
 
3083
3146
  ></co-stock-location>
3084
3147
 
@@ -3124,6 +3187,7 @@ StockTabsComponent.ctorParameters = () => [
3124
3187
  StockTabsComponent.propDecorators = {
3125
3188
  stockInformation: [{ type: Input }],
3126
3189
  article: [{ type: Input }],
3190
+ articleFlat: [{ type: Input }],
3127
3191
  warehouses: [{ type: Input }],
3128
3192
  transferIconClicked: [{ type: Output }],
3129
3193
  sendMethodDialogClicked: [{ type: Output }]
@@ -3210,24 +3274,28 @@ class StockLocationComponent {
3210
3274
  this.icons = Icon;
3211
3275
  this.transferIconClicked = new EventEmitter();
3212
3276
  this.sendMethodDialogClicked = new EventEmitter();
3213
- this.locationAddedOrUpdated = new EventEmitter();
3214
3277
  this.showConfirmationDialog = false;
3215
3278
  this.articleDetailsInformation = new ArticleStockManagement();
3216
3279
  this.stockStatus = [];
3217
3280
  this.selectedArticleDetailsData = new ArticleDetailsBo();
3218
3281
  this._subs = [];
3219
3282
  }
3283
+ set article(article) {
3284
+ }
3285
+ ;
3220
3286
  ngOnInit() {
3221
- return __awaiter(this, void 0, void 0, function* () {
3222
- this.stockStatus = yield this._stockService.getStockState();
3223
- this._subs.push(this._stockService.warehouseSelected.subscribe((selectedWarehouse) => __awaiter(this, void 0, void 0, function* () {
3224
- this.stockLocations = yield this._stockService.getStockManagementLocations(selectedWarehouse.warehouseNo);
3225
- })));
3287
+ this._stockService.getStockState().then(result => {
3288
+ this.stockStatus = result;
3226
3289
  });
3290
+ this._subs.push(this._stockService.warehouseSelected.subscribe(selectedWarehouse => {
3291
+ this._stockService.getStockManagementLocations(selectedWarehouse.warehouseNo).then(result => {
3292
+ this.stockLocations = result;
3293
+ });
3294
+ }));
3227
3295
  }
3228
3296
  lockSelectedRow(row) {
3229
- return __awaiter(this, void 0, void 0, function* () {
3230
- this.stockLocations = yield this._stockService.getStockManagementLocations(this.selectedWarehouse.warehouseNo);
3297
+ this._stockService.getStockManagementLocations(this.selectedWarehouse.warehouseNo).then(result => {
3298
+ this.stockLocations = result;
3231
3299
  this.selectedLocationNo = row.locationNo;
3232
3300
  this._stockService.lockArticleDetails(row);
3233
3301
  this.selectedArticleDetailsData = row;
@@ -3252,25 +3320,23 @@ class StockLocationComponent {
3252
3320
  this.transferIconClicked.emit(event);
3253
3321
  }
3254
3322
  onOkClickSendLocations() {
3255
- return __awaiter(this, void 0, void 0, function* () {
3256
- this.showConfirmationDialog = true;
3257
- });
3323
+ this.showConfirmationDialog = true;
3258
3324
  }
3259
3325
  handleOkClick() {
3260
- var _a, _b;
3261
- return __awaiter(this, void 0, void 0, function* () {
3262
- this.selectedArticleDetailsData.selected = true;
3263
- this.selectedArticleDetailsData.goodId = this.article.goodId;
3264
- this.selectedArticleDetailsData.entryDate = new Date();
3265
- this.selectedArticleDetailsData.warehouseNo = this.selectedWarehouse.warehouseNo;
3266
- this.selectedArticleDetailsData.locationNo = (_a = this.selectedLocationNo) === null || _a === void 0 ? void 0 : _a.toString();
3267
- yield this._stockService.updateArticleDetails(this.selectedArticleDetailsData);
3268
- this.articleDetailsInformation.goodId = (_b = this.selectedArticleDetailsData.goodId) === null || _b === void 0 ? void 0 : _b.toString();
3326
+ var _a;
3327
+ this.selectedArticleDetailsData.selected = true;
3328
+ this.selectedArticleDetailsData.goodId = this.articleFlat.goodId;
3329
+ this.selectedArticleDetailsData.entryDate = new Date();
3330
+ this.selectedArticleDetailsData.warehouseNo = this.selectedWarehouse.warehouseNo;
3331
+ this.selectedArticleDetailsData.locationNo = (_a = this.selectedLocationNo) === null || _a === void 0 ? void 0 : _a.toString();
3332
+ this._stockService.updateArticleDetails(this.selectedArticleDetailsData).then(result => {
3333
+ var _a;
3334
+ this.articleDetailsInformation.goodId = (_a = this.selectedArticleDetailsData.goodId) === null || _a === void 0 ? void 0 : _a.toString();
3269
3335
  this.articleDetailsInformation.warehouseNumber = this.selectedArticleDetailsData.warehouseNo;
3270
- yield this._stockService.getArticleDetails(this.articleDetailsInformation).then((details) => {
3336
+ this._stockService.getArticleDetails(this.articleDetailsInformation).then((details) => {
3271
3337
  this.showConfirmationDialog = false;
3272
3338
  this._changeDetector.detectChanges();
3273
- this.locationAddedOrUpdated.emit(details);
3339
+ this.articleStockInfo = details;
3274
3340
  });
3275
3341
  });
3276
3342
  }
@@ -3332,9 +3398,10 @@ StockLocationComponent.decorators = [
3332
3398
  (keydown.enter)="onOkClickSendLocations()"
3333
3399
 
3334
3400
  >
3335
- <co-simple-grid-column [headerText]="'LOCATION' | localize" [field]="'locationNo'">
3401
+ <co-simple-grid-column *ngIf="articleFlat?.locationRegistered" [headerText]="'LOCATION' | localize" [field]="'locationNo'">
3336
3402
  <ng-template #editTemplate let-row="row">
3337
- <co-list-of-values [model]="locationForNumber(row['locationNo'])"
3403
+ <co-list-of-values
3404
+ [model]="locationForNumber(row['locationNo'])"
3338
3405
  [collection]="stockLocations"
3339
3406
  [displayField]="'description'"
3340
3407
  [label]="'LOCATION' | localize"
@@ -3344,23 +3411,25 @@ StockLocationComponent.decorators = [
3344
3411
  ></co-list-of-values>
3345
3412
  </ng-template>
3346
3413
  </co-simple-grid-column>
3347
- <co-simple-grid-column *ngIf="articleDetails" [headerText]="'BATCH' | localize" [field]="'batchNo'">
3414
+ <co-simple-grid-column [headerText]="'BATCH' | localize" [field]="'batchNo'">
3348
3415
  <ng-template #editTemplate let-row="row">
3349
- <co-input-text [(model)]="row.batchNo"
3416
+ <co-input-text *ngIf="articleFlat?.batch" [model]="selectedArticleDetailsData.batchNo"
3350
3417
  [placeholder]="'BATCH' | localize"
3418
+ (modelChange)="row['batchNo'] = $event"
3351
3419
  ></co-input-text>
3352
3420
  </ng-template>
3353
3421
  </co-simple-grid-column>
3354
- <co-simple-grid-column *ngIf="articleDetails" [headerText]="'SERIAL_NO' | localize" [field]="'serialNo'">
3422
+ <co-simple-grid-column [headerText]="'SERIAL_NO' | localize" [field]="'serialNo'">
3355
3423
  <ng-template #editTemplate let-row="row">
3356
- <co-input-text [(model)]="row.serialNo"
3424
+ <co-input-text *ngIf="articleFlat?.serial" [model]="selectedArticleDetailsData.serialNo"
3357
3425
  [placeholder]="'SERIAL_NO' | localize"
3426
+ (modelChange)="row['serialNo'] = $event"
3358
3427
  ></co-input-text>
3359
3428
  </ng-template>
3360
3429
  </co-simple-grid-column>
3361
3430
  <co-simple-grid-column [headerText]="'STOCK' | localize" [field]="'amountInStock'">
3362
3431
  <ng-template #editTemplate let-row="row">
3363
- <co-input-text [(model)]="row.amountInStock"
3432
+ <co-input-text [(model)]="row['amountInStock']"
3364
3433
  [label]="'STOCK' | localize"
3365
3434
  (modelChange)="amountInStockChanged($event)"
3366
3435
  ></co-input-text>
@@ -3368,27 +3437,27 @@ StockLocationComponent.decorators = [
3368
3437
  </co-simple-grid-column>
3369
3438
  <co-simple-grid-column [headerText]="'ALLOCATED' | localize" [field]="'stockAssigned'">
3370
3439
  <ng-template #editTemplate let-row="row">
3371
- <span [textContent]="row.stockAssigned"></span>
3440
+ <span [textContent]="row['stockAssigned']"></span>
3372
3441
  </ng-template>
3373
3442
  </co-simple-grid-column>
3374
3443
  <co-simple-grid-column [headerText]="'AVAILABLE_STOCK' | localize" [field]="'amountInStockFree'">
3375
3444
  <ng-template #editTemplate let-row="row">
3376
- <span [textContent]="row.amountInStockFree"></span>
3445
+ <span [textContent]="row['amountInStockFree']"></span>
3377
3446
  </ng-template>
3378
3447
  </co-simple-grid-column>
3379
3448
  <co-simple-grid-column [headerText]="'VALUTA' | localize" [field]="'currency'">
3380
3449
  <ng-template #editTemplate let-row="row">
3381
- <span [textContent]="row.currency"></span>
3450
+ <span [textContent]="row['currency']"></span>
3382
3451
  </ng-template>
3383
3452
  </co-simple-grid-column>
3384
3453
  <co-simple-grid-column [headerText]="'PURCHASE_PRICE' | localize" [field]="'purchasePrice'">
3385
3454
  <ng-template #editTemplate let-row="row">
3386
- <span [textContent]="row.purchasePrice"></span>
3455
+ <span [textContent]="row['purchasePrice']"></span>
3387
3456
  </ng-template>
3388
3457
  </co-simple-grid-column>
3389
3458
  <co-simple-grid-column [headerText]="'SUPPLIERNR' | localize" [field]="'supplierNo'">
3390
3459
  <ng-template #editTemplate let-row="row">
3391
- <span [textContent]="row.supplierNo"></span>
3460
+ <span [textContent]="row['supplierNo']"></span>
3392
3461
  </ng-template>
3393
3462
  </co-simple-grid-column>
3394
3463
  <co-simple-grid-column [headerText]="'TRANSFER' | localize" [field]="'transfer'">
@@ -3396,12 +3465,14 @@ StockLocationComponent.decorators = [
3396
3465
  <co-icon class="menu-icon" [iconData]="iconCacheService.getIcon(icons.DeliveryTruck)"
3397
3466
  (click)="handleStockTransferClick(row)"></co-icon>
3398
3467
  </ng-template>
3468
+ <ng-template #editTemplate></ng-template>
3399
3469
  </co-simple-grid-column>
3400
3470
  <co-simple-grid-column [headerText]="'STICKER' | localize" [field]="'sticker'">
3401
3471
  <ng-template #template let-row="row">
3402
3472
  <co-icon class="menu-icon" [iconData]="iconCacheService.getIcon(icons.Print)"
3403
3473
  (click)="openSendMethodDialog(row)"></co-icon>
3404
3474
  </ng-template>
3475
+ <ng-template #editTemplate></ng-template>
3405
3476
  </co-simple-grid-column>
3406
3477
  </co-simple-grid>
3407
3478
  </div>
@@ -3418,10 +3489,10 @@ StockLocationComponent.propDecorators = {
3418
3489
  articleStockInfo: [{ type: Input }],
3419
3490
  articleStockInformation: [{ type: Input }],
3420
3491
  article: [{ type: Input }],
3492
+ articleFlat: [{ type: Input }],
3421
3493
  dataWareHouseCode: [{ type: Input }],
3422
3494
  transferIconClicked: [{ type: Output }],
3423
3495
  sendMethodDialogClicked: [{ type: Output }],
3424
- locationAddedOrUpdated: [{ type: Output }],
3425
3496
  selectedWarehouse: [{ type: Input }]
3426
3497
  };
3427
3498