@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ı:
|
|
126
|
-
|
|
127
|
-
const
|
|
128
|
-
const
|
|
129
|
-
const
|
|
130
|
-
const
|
|
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(
|
|
132
|
+
if (!barkod.startsWith(marker240))
|
|
133
133
|
return null;
|
|
134
|
-
let pos =
|
|
135
|
-
const
|
|
136
|
-
if (
|
|
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,
|
|
139
|
-
pos =
|
|
140
|
-
const
|
|
141
|
-
if (
|
|
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,
|
|
144
|
-
pos =
|
|
145
|
-
const
|
|
146
|
-
if (
|
|
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,
|
|
149
|
-
pos =
|
|
150
|
-
const
|
|
151
|
-
if (
|
|
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,
|
|
154
|
-
pos =
|
|
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 = '';
|