@hitsoft/uretim-yonetimi 1.0.42 → 1.0.44

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.
@@ -126,14 +126,12 @@ class HitHelper {
126
126
  .join('\n');
127
127
  }
128
128
  static parseQR(barkod) {
129
- // Barkod yapısı: (240)itemcode(10)partiNo(17)skt(91)tartimMiktari(21)elTerminalKodu(92)isEmriNo(93)tartimSiraNo
129
+ // Yeni barkod yapısı: (240)itemcode(10)partiNo(17)sonKullanmaTarihi(3103)miktar(21)elTerminalKodu
130
130
  const marker240 = '(240)';
131
131
  const marker10 = '(10)';
132
132
  const marker17 = '(17)';
133
- const marker91 = '(91)';
133
+ const marker3103 = '(3103)';
134
134
  const marker21 = '(21)';
135
- const marker92 = '(92)';
136
- const marker93 = '(93)';
137
135
  // 240 ile başlıyor
138
136
  if (!barkod.startsWith(marker240))
139
137
  return null;
@@ -148,36 +146,17 @@ class HitHelper {
148
146
  return null;
149
147
  const lotNo = barkod.substring(pos, idx17);
150
148
  pos = idx17 + marker17.length;
151
- const idx91 = barkod.indexOf(marker91, pos);
152
- if (idx91 === -1)
149
+ const idx3103 = barkod.indexOf(marker3103, pos);
150
+ if (idx3103 === -1)
153
151
  return null;
154
- const expDateRaw = barkod.substring(pos, idx91);
155
- pos = idx91 + marker91.length;
152
+ const expDateRaw = barkod.substring(pos, idx3103);
153
+ pos = idx3103 + marker3103.length;
156
154
  const idx21 = barkod.indexOf(marker21, pos);
157
155
  if (idx21 === -1)
158
156
  return null;
159
157
  const weightRaw = barkod.substring(pos, idx21);
160
158
  pos = idx21 + marker21.length;
161
- // (92) ve (93) opsiyonel — yoksa boş string
162
- const idx92 = barkod.indexOf(marker92, pos);
163
- let terminalCode;
164
- let workOrderNo = '';
165
- let weighingSequenceNo = '';
166
- if (idx92 !== -1) {
167
- terminalCode = barkod.substring(pos, idx92);
168
- pos = idx92 + marker92.length;
169
- const idx93 = barkod.indexOf(marker93, pos);
170
- if (idx93 !== -1) {
171
- workOrderNo = barkod.substring(pos, idx93);
172
- weighingSequenceNo = barkod.substring(idx93 + marker93.length);
173
- }
174
- else {
175
- workOrderNo = barkod.substring(pos);
176
- }
177
- }
178
- else {
179
- terminalCode = barkod.substring(pos);
180
- }
159
+ const terminalCode = barkod.substring(pos);
181
160
  // Tarihi formatla: YYMMDD -> YYYY-MM-DD
182
161
  let expirationDate = '';
183
162
  if (/^\d{6}$/.test(expDateRaw)) {
@@ -186,22 +165,18 @@ class HitHelper {
186
165
  else {
187
166
  expirationDate = expDateRaw;
188
167
  }
189
- // Ham değer / 1.000.000 = gerçek gram değeri (son 6 hane ondalık)
190
- const weightRawInt = parseInt(weightRaw, 10);
191
- const weightGr = isNaN(weightRawInt) ? 0 : weightRawInt / 1000000;
192
- return new Hammadde(itemCode, lotNo, expirationDate, weightGr, terminalCode, workOrderNo, weighingSequenceNo);
168
+ const weight = parseInt(weightRaw, 10);
169
+ return new Hammadde(itemCode, lotNo, expirationDate, weight, terminalCode);
193
170
  }
194
171
  }
195
172
  class Hammadde {
196
- constructor(chemicalCode, lotNumber, expirationDate, weightGr, terminalCode, workOrderNo = '', weighingSequenceNo = '') {
173
+ constructor(chemicalCode, lotNumber, expirationDate, weight, terminalCode) {
197
174
  this.chemicalCode = chemicalCode;
198
175
  this.lotNumber = lotNumber;
199
176
  this.expirationDate = expirationDate;
200
- this.weightGr = weightGr;
201
- this.weightKg = weightGr ? weightGr / 1000 : 0;
177
+ this.weightGr = weight; // Gram cinsinden
178
+ this.weightKg = weight ? weight / 1000 : 0; // Kilogram cinsine dönüştürülmüş hali
202
179
  this.terminalCode = terminalCode;
203
- this.workOrderNo = workOrderNo;
204
- this.weighingSequenceNo = weighingSequenceNo;
205
180
  }
206
181
  }
207
182
 
@@ -912,7 +887,6 @@ class HitIssuesForProductionsComponent {
912
887
  this.isEmriBarkoduGecerliMi = false;
913
888
  this.searcheBasildiMi = false;
914
889
  this.hammaddeQR = '';
915
- this.scannedBarcodeKeys = new Set();
916
890
  this.warehouses = [];
917
891
  this.HitHelper = HitHelper;
918
892
  }
@@ -992,21 +966,6 @@ class HitIssuesForProductionsComponent {
992
966
  });
993
967
  return;
994
968
  }
995
- // Mükerrer barkod kontrolü: aynı iş emri + tartım sıra no kombinasyonu tekrar okutulamaz
996
- if (parsed.workOrderNo && parsed.weighingSequenceNo) {
997
- const barcodeKey = `${parsed.workOrderNo}_${parsed.weighingSequenceNo}`;
998
- if (this.scannedBarcodeKeys.has(barcodeKey)) {
999
- this.confirmation.error('', 'Aynı barkod tekrar okutulamaz!', this.options).subscribe({
1000
- next: () => {
1001
- this.hammaddeQR = '';
1002
- this.focusQRInput();
1003
- }
1004
- });
1005
- this.isLoading = false;
1006
- return;
1007
- }
1008
- this.scannedBarcodeKeys.add(barcodeKey);
1009
- }
1010
969
  this.service.get(parsed.chemicalCode, this.productionOrder.absoluteEntry.toString()).subscribe({
1011
970
  next: (response) => {
1012
971
  if (response.isSuccessful) {
@@ -1098,7 +1057,6 @@ class HitIssuesForProductionsComponent {
1098
1057
  this.productionOrder = null;
1099
1058
  this.focusBarkodInput();
1100
1059
  this.unitOfMeasure = null;
1101
- this.scannedBarcodeKeys.clear();
1102
1060
  }
1103
1061
  getWarehouses() {
1104
1062
  this.isLoading = true;
@@ -1563,7 +1521,6 @@ class HitFillingControlComponent {
1563
1521
  this.qrCode = '';
1564
1522
  this.lines = [];
1565
1523
  this.isDataLoadedFromDb = false; // DB'den veri mi geldi yoksa yeni mi
1566
- this.scannedBarcodeKeys = new Set();
1567
1524
  }
1568
1525
  ngOnInit() {
1569
1526
  // Initialization logic
@@ -1638,21 +1595,6 @@ class HitFillingControlComponent {
1638
1595
  this.focusQRInput();
1639
1596
  return;
1640
1597
  }
1641
- // Mükerrer barkod kontrolü: aynı iş emri + tartım sıra no kombinasyonu tekrar okutulamaz
1642
- if (parsed.workOrderNo && parsed.weighingSequenceNo) {
1643
- const barcodeKey = `${parsed.workOrderNo}_${parsed.weighingSequenceNo}`;
1644
- if (this.scannedBarcodeKeys.has(barcodeKey)) {
1645
- this.confirmation.error('', 'Aynı barkod tekrar okutulamaz!', {
1646
- hideYesBtn: true,
1647
- cancelText: 'Kapat',
1648
- dismissible: false,
1649
- });
1650
- this.qrCode = '';
1651
- this.focusQRInput();
1652
- return;
1653
- }
1654
- this.scannedBarcodeKeys.add(barcodeKey);
1655
- }
1656
1598
  // Grid'de bu item'ı bul
1657
1599
  const line = this.lines.find(x => x.itemCode === parsed.chemicalCode);
1658
1600
  if (!line) {
@@ -1825,7 +1767,6 @@ class HitFillingControlComponent {
1825
1767
  this.lines = [];
1826
1768
  this.isDataLoadedFromDb = false;
1827
1769
  this.isSaving = false;
1828
- this.scannedBarcodeKeys.clear();
1829
1770
  this.focusOnIsEmriNo();
1830
1771
  }
1831
1772
  get showKazanDegisimiButton() {
@@ -1870,7 +1811,6 @@ class HitFillingControlComponent {
1870
1811
  // Grid'i refresh et
1871
1812
  this.dataGrid.instance.refresh();
1872
1813
  this.isDataLoadedFromDb = false; // Artık yeni veri girilecek
1873
- this.scannedBarcodeKeys.clear(); // Yeni kazan için okutulmuş barkodları sıfırla
1874
1814
  // QR input'a focus et
1875
1815
  this.focusOnQrCode();
1876
1816
  }