@hitsoft/uretim-yonetimi 1.0.19 → 1.0.20

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,36 +122,36 @@ class HitHelper {
122
122
  .join('\n');
123
123
  }
124
124
  static parseQR(barkod) {
125
- // Yeni barkod yapısı: {240}itemcode{GS10}partiNo{GS17}sonKullanmaTarihi{GS3103}miktar{GS21}elTerminalKodu
126
- debugger;
127
- const gs10 = 'GS10';
128
- const gs17 = 'GS17';
129
- const gs3103 = 'GS3103';
130
- const gs21 = 'GS21';
125
+ // Yeni barkod yapısı: (240)itemcode(10)partiNo(17)sonKullanmaTarihi(3103)miktar(21)elTerminalKodu
126
+ const marker240 = '(240)';
127
+ const marker10 = '(10)';
128
+ const marker17 = '(17)';
129
+ const marker3103 = '(3103)';
130
+ const marker21 = '(21)';
131
131
  // 240 ile başlıyor
132
- if (!barkod.startsWith('240'))
132
+ if (!barkod.startsWith(marker240))
133
133
  return null;
134
- let pos = 3;
135
- const gs10Index = barkod.indexOf(gs10, pos);
136
- if (gs10Index === -1)
134
+ let pos = marker240.length;
135
+ const idx10 = barkod.indexOf(marker10, pos);
136
+ if (idx10 === -1)
137
137
  return null;
138
- const itemCode = barkod.substring(pos, gs10Index);
139
- pos = gs10Index + gs10.length;
140
- const gs17Index = barkod.indexOf(gs17, pos);
141
- if (gs17Index === -1)
138
+ const itemCode = barkod.substring(pos, idx10);
139
+ pos = idx10 + marker10.length;
140
+ const idx17 = barkod.indexOf(marker17, pos);
141
+ if (idx17 === -1)
142
142
  return null;
143
- const lotNo = barkod.substring(pos, gs17Index);
144
- pos = gs17Index + gs17.length;
145
- const gs3103Index = barkod.indexOf(gs3103, pos);
146
- if (gs3103Index === -1)
143
+ const lotNo = barkod.substring(pos, idx17);
144
+ pos = idx17 + marker17.length;
145
+ const idx3103 = barkod.indexOf(marker3103, pos);
146
+ if (idx3103 === -1)
147
147
  return null;
148
- const expDateRaw = barkod.substring(pos, gs3103Index);
149
- pos = gs3103Index + gs3103.length;
150
- const gs21Index = barkod.indexOf(gs21, pos);
151
- if (gs21Index === -1)
148
+ const expDateRaw = barkod.substring(pos, idx3103);
149
+ pos = idx3103 + marker3103.length;
150
+ const idx21 = barkod.indexOf(marker21, pos);
151
+ if (idx21 === -1)
152
152
  return null;
153
- const weightRaw = barkod.substring(pos, gs21Index);
154
- pos = gs21Index + gs21.length;
153
+ const weightRaw = barkod.substring(pos, idx21);
154
+ pos = idx21 + marker21.length;
155
155
  const terminalCode = barkod.substring(pos);
156
156
  // Tarihi formatla: YYMMDD -> YYYY-MM-DD
157
157
  let expirationDate = '';