@hitsoft/uretim-yonetimi 1.0.13 → 1.0.15

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.
@@ -122,42 +122,47 @@ class HitHelper {
122
122
  .map((err, index) => `${index + 1}. ${err}`)
123
123
  .join('\n');
124
124
  }
125
- static parseQR(code) {
126
- const aiRegexMap = {
127
- '240': /^240(.+?)10/,
128
- '10': /10(.+?)17/,
129
- '17': /17(\d{6})/,
130
- '3103': /3103(\d{6})/,
131
- '21': /21([A-Z]{2}\d{8})$/,
132
- };
133
- const chemicalCodeMatch = code.match(aiRegexMap['240']);
134
- const lotNumberMatch = code.match(aiRegexMap['10']);
135
- const expDateMatch = code.match(aiRegexMap['17']);
136
- const weightMatch = code.match(aiRegexMap['3103']);
137
- const terminalCodeMatch = code.match(aiRegexMap['21']);
125
+ static parseQR(barkod) {
126
+ debugger;
127
+ const elTerminalKoduStartIndex = barkod.lastIndexOf("KM");
128
+ const elTerminalKodu = barkod.substring(elTerminalKoduStartIndex);
129
+ const sabit21Index = elTerminalKoduStartIndex - 2;
130
+ const tartimMiktar = barkod.substring(sabit21Index - 6, sabit21Index);
131
+ const sabit3103Index = sabit21Index - 6 - 4;
132
+ const sonKullanmaTarihi = barkod.substring(sabit3103Index - 6, sabit3103Index);
133
+ const sabit17Index = sabit3103Index - 6 - 2;
134
+ const kimyasalKoduStartIndex = 3;
135
+ const kimyasalKodu = barkod.substring(kimyasalKoduStartIndex, kimyasalKoduStartIndex + 14);
136
+ const sabit10Index = kimyasalKoduStartIndex + 14;
137
+ const lotNo = barkod.substring(sabit10Index + 2, sabit17Index);
138
+ const chemicalCodeMatch = kimyasalKodu;
139
+ const lotNumberMatch = lotNo;
140
+ const expDateMatch = sonKullanmaTarihi;
141
+ const weightMatch = tartimMiktar;
142
+ const terminalCodeMatch = elTerminalKodu;
138
143
  if (!chemicalCodeMatch || !lotNumberMatch || !expDateMatch || !weightMatch || !terminalCodeMatch) {
139
144
  return null;
140
145
  }
141
- var onMu = false;
142
- while (!onMu) {
143
- if (lotNumberMatch[1].substring(0, 2) == "10") {
144
- chemicalCodeMatch[1] += "10";
145
- lotNumberMatch[1] = lotNumberMatch[1].substring(2);
146
- }
147
- else {
148
- onMu = true;
149
- }
150
- }
151
- var onYediMi = false;
152
- while (!onYediMi) {
153
- if (expDateMatch[1].substring(0, 2) == "17") {
154
- lotNumberMatch[1] += "10";
155
- expDateMatch[1] = expDateMatch[1].substring(2);
156
- }
157
- else {
158
- onYediMi = true;
159
- }
160
- }
146
+ // var onMu = false;
147
+ // while(!onMu){
148
+ // if(lotNumberMatch[1].substring(0, 2) == "10"){
149
+ // chemicalCodeMatch[1] += "10";
150
+ // lotNumberMatch[1] = lotNumberMatch[1].substring(2);
151
+ // }
152
+ // else{
153
+ // onMu = true;
154
+ // }
155
+ // }
156
+ // var onYediMi = false;
157
+ // while(!onYediMi){
158
+ // if(expDateMatch[1].substring(0, 2) == "17"){
159
+ // lotNumberMatch[1] += "17";
160
+ // expDateMatch[1] = expDateMatch[1].substring(2);
161
+ // }
162
+ // else{
163
+ // onYediMi = true;
164
+ // }
165
+ // }
161
166
  if (!chemicalCodeMatch || !lotNumberMatch || !expDateMatch || !weightMatch || !terminalCodeMatch) {
162
167
  return null;
163
168
  }
@@ -305,6 +310,7 @@ class HitProductionOrdersComponent {
305
310
  }
306
311
  patchProductionOrder() {
307
312
  this.isLoading = true;
313
+ this.isEmriBarkoduGecerliMi = false;
308
314
  const productionOrderLines = this.productionOrderList.ProductionOrderLines.map(productionLine => {
309
315
  return new ProductionOrderLine$1(productionLine.ItemCode, productionLine.WarehouseCode, productionLine.Quantity, productionLine.Quantity, productionLine.Quantity, '', productionLine.BaseEntry, 0, [new BatchNumber$1(productionLine.BatchNumber, productionLine.Quantity)]);
310
316
  });
@@ -313,11 +319,11 @@ class HitProductionOrdersComponent {
313
319
  next: result => {
314
320
  if (result.isSuccessful) {
315
321
  this.confirmation.success('', 'İşlem başarılı!', this.options).subscribe(() => {
316
- this.clearAll();
317
322
  });
318
323
  }
319
324
  },
320
325
  });
326
+ this.clearAll();
321
327
  this.isLoading = false;
322
328
  }
323
329
  clearAll() {
@@ -639,6 +645,7 @@ class HitReceiptFromProductionsComponent {
639
645
  postReceiptFromProductions() {
640
646
  return __awaiter(this, void 0, void 0, function* () {
641
647
  this.isLoading = true;
648
+ this.isProductionOrderValid = false;
642
649
  this.receiptFromProductionsPostDtoDocumentLine.batchNumbers = [
643
650
  this.receiptFromProductionsPostDtoBatchNumber,
644
651
  ];
@@ -663,6 +670,7 @@ class HitReceiptFromProductionsComponent {
663
670
  },
664
671
  error: () => {
665
672
  this.confirmation.status$.subscribe(() => {
673
+ this.clearAll();
666
674
  this.focusOnToplananMiktar();
667
675
  });
668
676
  },
@@ -1006,6 +1014,7 @@ class HitIssuesForProductionsComponent {
1006
1014
  return;
1007
1015
  }
1008
1016
  this.isLoading = true;
1017
+ this.isEmriBarkoduGecerliMi = false;
1009
1018
  this.issuesForProductionPost.DocumentLines.forEach((x) => {
1010
1019
  x.BaseEntry = this.productionOrder.absoluteEntry;
1011
1020
  });
@@ -1028,6 +1037,7 @@ class HitIssuesForProductionsComponent {
1028
1037
  error: (e) => {
1029
1038
  this.confirmation.status$.subscribe({
1030
1039
  next: () => {
1040
+ this.clearAll();
1031
1041
  this.focusQRInput();
1032
1042
  }
1033
1043
  });