@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.
@@ -121,42 +121,47 @@ class HitHelper {
121
121
  .map((err, index) => `${index + 1}. ${err}`)
122
122
  .join('\n');
123
123
  }
124
- static parseQR(code) {
125
- const aiRegexMap = {
126
- '240': /^240(.+?)10/,
127
- '10': /10(.+?)17/,
128
- '17': /17(\d{6})/,
129
- '3103': /3103(\d{6})/,
130
- '21': /21([A-Z]{2}\d{8})$/,
131
- };
132
- const chemicalCodeMatch = code.match(aiRegexMap['240']);
133
- const lotNumberMatch = code.match(aiRegexMap['10']);
134
- const expDateMatch = code.match(aiRegexMap['17']);
135
- const weightMatch = code.match(aiRegexMap['3103']);
136
- const terminalCodeMatch = code.match(aiRegexMap['21']);
124
+ static parseQR(barkod) {
125
+ debugger;
126
+ const elTerminalKoduStartIndex = barkod.lastIndexOf("KM");
127
+ const elTerminalKodu = barkod.substring(elTerminalKoduStartIndex);
128
+ const sabit21Index = elTerminalKoduStartIndex - 2;
129
+ const tartimMiktar = barkod.substring(sabit21Index - 6, sabit21Index);
130
+ const sabit3103Index = sabit21Index - 6 - 4;
131
+ const sonKullanmaTarihi = barkod.substring(sabit3103Index - 6, sabit3103Index);
132
+ const sabit17Index = sabit3103Index - 6 - 2;
133
+ const kimyasalKoduStartIndex = 3;
134
+ const kimyasalKodu = barkod.substring(kimyasalKoduStartIndex, kimyasalKoduStartIndex + 14);
135
+ const sabit10Index = kimyasalKoduStartIndex + 14;
136
+ const lotNo = barkod.substring(sabit10Index + 2, sabit17Index);
137
+ const chemicalCodeMatch = kimyasalKodu;
138
+ const lotNumberMatch = lotNo;
139
+ const expDateMatch = sonKullanmaTarihi;
140
+ const weightMatch = tartimMiktar;
141
+ const terminalCodeMatch = elTerminalKodu;
137
142
  if (!chemicalCodeMatch || !lotNumberMatch || !expDateMatch || !weightMatch || !terminalCodeMatch) {
138
143
  return null;
139
144
  }
140
- var onMu = false;
141
- while (!onMu) {
142
- if (lotNumberMatch[1].substring(0, 2) == "10") {
143
- chemicalCodeMatch[1] += "10";
144
- lotNumberMatch[1] = lotNumberMatch[1].substring(2);
145
- }
146
- else {
147
- onMu = true;
148
- }
149
- }
150
- var onYediMi = false;
151
- while (!onYediMi) {
152
- if (expDateMatch[1].substring(0, 2) == "17") {
153
- lotNumberMatch[1] += "10";
154
- expDateMatch[1] = expDateMatch[1].substring(2);
155
- }
156
- else {
157
- onYediMi = true;
158
- }
159
- }
145
+ // var onMu = false;
146
+ // while(!onMu){
147
+ // if(lotNumberMatch[1].substring(0, 2) == "10"){
148
+ // chemicalCodeMatch[1] += "10";
149
+ // lotNumberMatch[1] = lotNumberMatch[1].substring(2);
150
+ // }
151
+ // else{
152
+ // onMu = true;
153
+ // }
154
+ // }
155
+ // var onYediMi = false;
156
+ // while(!onYediMi){
157
+ // if(expDateMatch[1].substring(0, 2) == "17"){
158
+ // lotNumberMatch[1] += "17";
159
+ // expDateMatch[1] = expDateMatch[1].substring(2);
160
+ // }
161
+ // else{
162
+ // onYediMi = true;
163
+ // }
164
+ // }
160
165
  if (!chemicalCodeMatch || !lotNumberMatch || !expDateMatch || !weightMatch || !terminalCodeMatch) {
161
166
  return null;
162
167
  }
@@ -300,6 +305,7 @@ class HitProductionOrdersComponent {
300
305
  }
301
306
  patchProductionOrder() {
302
307
  this.isLoading = true;
308
+ this.isEmriBarkoduGecerliMi = false;
303
309
  const productionOrderLines = this.productionOrderList.ProductionOrderLines.map(productionLine => {
304
310
  return new ProductionOrderLine$1(productionLine.ItemCode, productionLine.WarehouseCode, productionLine.Quantity, productionLine.Quantity, productionLine.Quantity, '', productionLine.BaseEntry, 0, [new BatchNumber$1(productionLine.BatchNumber, productionLine.Quantity)]);
305
311
  });
@@ -308,11 +314,11 @@ class HitProductionOrdersComponent {
308
314
  next: result => {
309
315
  if (result.isSuccessful) {
310
316
  this.confirmation.success('', 'İşlem başarılı!', this.options).subscribe(() => {
311
- this.clearAll();
312
317
  });
313
318
  }
314
319
  },
315
320
  });
321
+ this.clearAll();
316
322
  this.isLoading = false;
317
323
  }
318
324
  clearAll() {
@@ -631,6 +637,7 @@ class HitReceiptFromProductionsComponent {
631
637
  }
632
638
  async postReceiptFromProductions() {
633
639
  this.isLoading = true;
640
+ this.isProductionOrderValid = false;
634
641
  this.receiptFromProductionsPostDtoDocumentLine.batchNumbers = [
635
642
  this.receiptFromProductionsPostDtoBatchNumber,
636
643
  ];
@@ -655,6 +662,7 @@ class HitReceiptFromProductionsComponent {
655
662
  },
656
663
  error: () => {
657
664
  this.confirmation.status$.subscribe(() => {
665
+ this.clearAll();
658
666
  this.focusOnToplananMiktar();
659
667
  });
660
668
  },
@@ -990,6 +998,7 @@ class HitIssuesForProductionsComponent {
990
998
  return;
991
999
  }
992
1000
  this.isLoading = true;
1001
+ this.isEmriBarkoduGecerliMi = false;
993
1002
  this.issuesForProductionPost.DocumentLines.forEach((x) => {
994
1003
  x.BaseEntry = this.productionOrder.absoluteEntry;
995
1004
  });
@@ -1012,6 +1021,7 @@ class HitIssuesForProductionsComponent {
1012
1021
  error: (e) => {
1013
1022
  this.confirmation.status$.subscribe({
1014
1023
  next: () => {
1024
+ this.clearAll();
1015
1025
  this.focusQRInput();
1016
1026
  }
1017
1027
  });