Closed Dafafgh closed 8 months ago
Да, конечно можно. Как именно сделать?
на текущий момент PrintRecSubtotalAdjustment будет передаваться от АСУ только при наличии топлива в чеке. сейчас вижу только один признак в линии с товаром который передается всегда и который можно анализировать: DirectIO(120, 0, '02710001005000000') можно создать таблицу соответствия по "class_code":? например АСУ передает в чеке PrintRecSubtotalAdjustment. при наличии PrintRecSubtotalAdjustment драйвер считывает "class_code": по всем линиям чека и сверяет их с кодами из ранее заполненной таблицы соответствия. на первый совпавший код применяется скидка PrintRecSubtotalAdjustment
Хорошо, сейчас сделаю.
на последней версии что то сломалось. на в.42 ошибки нет
[21.03.2024 14:14:25.398 ] [00018248] [DEBUG] ToleFiscalPrinter.PrintRecTotal(20000, 20000, '0') "received_cash":1984000
[21.03.2024 14:14:25.320 ] [00018248] [DEBUG] ToleFiscalPrinter.PrintRecItem('PUMP 3:АИ92', 20160, 1120, 4, 18000, 'л') [21.03.2024 14:14:25.320 ] [00018248] [DEBUG] ToleFiscalPrinter.PrintRecItem('PUMP 3:АИ92', 20160, 1120, 4, 18000, 'л')=0 [21.03.2024 14:14:25.336 ] [00018248] [DEBUG] ToleFiscalPrinter.DirectIO(120, 0, '02710001005000000') [21.03.2024 14:14:25.336 ] [00018248] [DEBUG] ToleFiscalPrinter.DirectIO(120, 0, '02710001005000000')=0 [21.03.2024 14:14:25.336 ] [00018248] [DEBUG] ToleFiscalPrinter.DirectIO(106, 0, 'owner_type;0') [21.03.2024 14:14:25.336 ] [00018248] [DEBUG] ToleFiscalPrinter.DirectIO(106, 0, 'owner_type;0')=0 [21.03.2024 14:14:25.351 ] [00018248] [DEBUG] ToleFiscalPrinter.DirectIO(106, 0, 'package_code;0') [21.03.2024 14:14:25.351 ] [00018248] [DEBUG] ToleFiscalPrinter.DirectIO(106, 0, 'package_code;0')=0 [21.03.2024 14:14:25.367 ] [00018248] [DEBUG] ToleFiscalPrinter.PrintRecSubtotalAdjustment(1, 'Округление', 160) [21.03.2024 14:14:25.367 ] [00018248] [DEBUG] ToleFiscalPrinter.PrintRecSubtotalAdjustment(1, 'Округление', 160)=0 [21.03.2024 14:14:25.398 ] [00018248] [DEBUG] ToleFiscalPrinter.PrintRecTotal(20000, 20000, '0') [21.03.2024 14:14:25.398 ] [00018248] [DEBUG] ToleFiscalPrinter.PrintRecTotal(20000, 20000, '0')=0 [21.03.2024 14:14:25.414 ] [00018248] [DEBUG] ToleFiscalPrinter.PrintRecMessage('Operator: ts') [21.03.2024 14:14:25.414 ] [00018248] [DEBUG] ToleFiscalPrinter.PrintRecMessage('Operator: ts')=0 [21.03.2024 14:14:25.414 ] [00018248] [DEBUG] ToleFiscalPrinter.PrintRecMessage('ID: 1991 ') [21.03.2024 14:14:25.414 ] [00018248] [DEBUG] ToleFiscalPrinter.PrintRecMessage('ID: 1991 ')=0 [21.03.2024 14:14:25.430 ] [00018248] [DEBUG] ToleFiscalPrinter.DirectIO(30, 302, '1') [21.03.2024 14:14:25.430 ] [00018248] [DEBUG] ToleFiscalPrinter.DirectIO(30, 302, '1')=0 [21.03.2024 14:14:25.430 ] [00018248] [DEBUG] ToleFiscalPrinter.DirectIO(30, 300, '1991') [21.03.2024 14:14:25.430 ] [00018248] [DEBUG] ToleFiscalPrinter.DirectIO(30, 300, '1991')=0 [21.03.2024 14:14:25.445 ] [00018248] [DEBUG] ToleFiscalPrinter.EndFiscalReceipt(False) [21.03.2024 14:14:25.445 ] [00018248] [DEBUG] POST: http://fbox.ngrok.io/order/create/ [21.03.2024 14:14:25.445 ] [00018248] [DEBUG] => {"qr_code":"","number":1,"receipt_type":"order","products":[{"name":"PUMP 3:АИ92","barcode":"","amount":1120,"units":1,"unit_name":"л","price":2016000,"product_price":1800000,"vat":214286,"vat_percent":12,"discount":16000,"discount_percent":1,"other":0,"labels":[],"class_code":"02710001005000000","package_code":0,"owner_type":0,"comission_info":{"inn":"","pinfl":""}}],"time":"2024-03-21 16:14:25","cashier":"ts","received_cash":1984000,"change":0,"received_card":0,"card_type":0,"ppt_id":0,"open_cashbox":false,"send_email":false,"banners":[{"type":"text","data":"Operator: ts","cut":false},{"type":"text","data":"ID: 1991 ","cut":false}]} [21.03.2024 14:14:26.711 ] [00018248] [DEBUG] <= { "data": null, "error": { "code": 65531, "message": "cannot encode receipt", "data": "failed to make total block\n difference 16000 between 2000000 and 1984000 is larger than 10000\n math error\n" }, "is_success": false } [21.03.2024 14:14:26.711 ] [00018248] [ERROR] 65531, cannot encode receipt [21.03.2024 14:14:26.711 ] [00018248] [ERROR] OPOS_E_EXTENDED, 65531, "cannot encode receipt" [21.03.2024 14:14:26.711 ] [00018248] [DEBUG] ToleFiscalPrinter.EndFiscalReceipt(False)=114
В текущей версии скидка PrintRecSubtotalAdjustment применяется к первому товару PrintRecSubtotalAdjustment(1, 'Округление', 160) "discount":16000
На текущий момент эта скидка должна применяться только к топливу. Можно сделать, что бы скидка применялась только на топливо? например для определения топлива сделать таблицу соответствия по "class_code": или по какому либо другому признаку линии с товаром, который сейчас передается
[07.03.2024 14:35:53.699 ] [00010136] [DEBUG] ToleFiscalPrinter.SetPOSID('01', 'ts') [07.03.2024 14:35:53.729 ] [00010136] [DEBUG] ToleFiscalPrinter.SetPOSID('01', 'ts')=0 [07.03.2024 14:35:53.731 ] [00010136] [DEBUG] ToleFiscalPrinter.BeginFiscalReceipt(True) [07.03.2024 14:35:53.732 ] [00010136] [DEBUG] ToleFiscalPrinter.BeginFiscalReceipt(True)=0 [07.03.2024 14:35:53.735 ] [00010136] [DEBUG] ToleFiscalPrinter.GetPropertyNumber('PIDXFptr_PrinterState') [07.03.2024 14:35:53.736 ] [00010136] [DEBUG] ToleFiscalPrinter.GetPropertyNumber('PIDXFptr_PrinterState')=2 [07.03.2024 14:35:53.743 ] [00010136] [DEBUG] ToleFiscalPrinter.DirectIO(30, 72, '4') [07.03.2024 14:35:53.744 ] [00010136] [DEBUG] ToleFiscalPrinter.DirectIO(30, 72, '4')=0 [07.03.2024 14:35:53.747 ] [00010136] [DEBUG] ToleFiscalPrinter.DirectIO(30, 73, '1') [07.03.2024 14:35:53.748 ] [00010136] [DEBUG] ToleFiscalPrinter.DirectIO(30, 73, '1')=0 [07.03.2024 14:35:53.753 ] [00010136] [DEBUG] ToleFiscalPrinter.DirectIO(72, 0, '4005808539789') [07.03.2024 14:35:53.754 ] [00010136] [DEBUG] ToleFiscalPrinter.DirectIO(72, 0, '4005808539789')=0 [07.03.2024 14:35:53.759 ] [00010136] [DEBUG] ToleFiscalPrinter.PrintRecItem('Соқолдан кейин лосон Nivea Silver 100ml', 112688.5, 1000, 4, 112688.5, 'шт') [07.03.2024 14:35:53.760 ] [00010136] [DEBUG] ToleFiscalPrinter.PrintRecItem('Соқолдан кейин лосон Nivea Silver 100ml', 112688.5, 1000, 4, 112688.5, 'шт')=0 [07.03.2024 14:35:53.763 ] [00010136] [DEBUG] ToleFiscalPrinter.DirectIO(65, 1222, '32') [07.03.2024 14:35:53.764 ] [00010136] [DEBUG] ToleFiscalPrinter.DirectIO(65, 1222, '32')=0 [07.03.2024 14:35:53.767 ] [00010136] [DEBUG] ToleFiscalPrinter.DirectIO(66, 1224, '') [07.03.2024 14:35:53.768 ] [00010136] [DEBUG] ToleFiscalPrinter.DirectIO(66, 1224, '')=0 [07.03.2024 14:35:53.771 ] [00010136] [DEBUG] ToleFiscalPrinter.DirectIO(67, 1225, 'Поставщик воды ООО "') [07.03.2024 14:35:53.772 ] [00010136] [DEBUG] ToleFiscalPrinter.DirectIO(67, 1225, 'Поставщик воды ООО "')=0 [07.03.2024 14:35:53.774 ] [00010136] [DEBUG] ToleFiscalPrinter.DirectIO(67, 1171, '+ ( ) -') [07.03.2024 14:35:53.775 ] [00010136] [DEBUG] ToleFiscalPrinter.DirectIO(67, 1171, '+ ( ) -')=0 [07.03.2024 14:35:53.778 ] [00010136] [DEBUG] ToleFiscalPrinter.DirectIO(70, 0, '') [07.03.2024 14:35:53.778 ] [00010136] [DEBUG] ToleFiscalPrinter.DirectIO(70, 0, '')=0 [07.03.2024 14:35:53.781 ] [00010136] [DEBUG] ToleFiscalPrinter.DirectIO(65, 1226, '235751177') [07.03.2024 14:35:53.782 ] [00010136] [DEBUG] ToleFiscalPrinter.DirectIO(65, 1226, '235751177')=0 [07.03.2024 14:35:53.786 ] [00010136] [DEBUG] ToleFiscalPrinter.DirectIO(120, 0, '03304013003002007') [07.03.2024 14:35:53.787 ] [00010136] [DEBUG] ToleFiscalPrinter.DirectIO(120, 0, '03304013003002007')=0 [07.03.2024 14:35:53.792 ] [00010136] [DEBUG] ToleFiscalPrinter.DirectIO(106, 0, 'owner_type;0') [07.03.2024 14:35:53.793 ] [00010136] [DEBUG] ToleFiscalPrinter.DirectIO(106, 0, 'owner_type;0')=0 [07.03.2024 14:35:53.797 ] [00010136] [DEBUG] ToleFiscalPrinter.DirectIO(106, 0, 'package_code;1312165') [07.03.2024 14:35:53.798 ] [00010136] [DEBUG] ToleFiscalPrinter.DirectIO(106, 0, 'package_code;1312165')=0 [07.03.2024 14:35:53.841 ] [00010136] [DEBUG] ToleFiscalPrinter.DirectIO(30, 72, '4') [07.03.2024 14:35:53.842 ] [00010136] [DEBUG] ToleFiscalPrinter.DirectIO(30, 72, '4')=0 [07.03.2024 14:35:53.845 ] [00010136] [DEBUG] ToleFiscalPrinter.DirectIO(30, 73, '1') [07.03.2024 14:35:53.845 ] [00010136] [DEBUG] ToleFiscalPrinter.DirectIO(30, 73, '1')=0 [07.03.2024 14:35:53.853 ] [00010136] [DEBUG] ToleFiscalPrinter.PrintRecItem('PUMP 1:АИ92', 20160, 1120, 4, 18000, 'л') [07.03.2024 14:35:53.854 ] [00010136] [DEBUG] ToleFiscalPrinter.PrintRecItem('PUMP 1:АИ92', 20160, 1120, 4, 18000, 'л')=0 [07.03.2024 14:35:53.858 ] [00010136] [DEBUG] ToleFiscalPrinter.DirectIO(120, 0, '02710001005000000') [07.03.2024 14:35:53.859 ] [00010136] [DEBUG] ToleFiscalPrinter.DirectIO(120, 0, '02710001005000000')=0 [07.03.2024 14:35:53.864 ] [00010136] [DEBUG] ToleFiscalPrinter.DirectIO(106, 0, 'owner_type;0') [07.03.2024 14:35:53.865 ] [00010136] [DEBUG] ToleFiscalPrinter.DirectIO(106, 0, 'owner_type;0')=0 [07.03.2024 14:35:53.869 ] [00010136] [DEBUG] ToleFiscalPrinter.DirectIO(106, 0, 'package_code;0') [07.03.2024 14:35:53.870 ] [00010136] [DEBUG] ToleFiscalPrinter.DirectIO(106, 0, 'package_code;0')=0 [07.03.2024 14:35:53.887 ] [00010136] [DEBUG] ToleFiscalPrinter.PrintRecSubtotalAdjustment(1, 'Округление', 160) [07.03.2024 14:35:53.888 ] [00010136] [DEBUG] ToleFiscalPrinter.PrintRecSubtotalAdjustment(1, 'Округление', 160)=0 [07.03.2024 14:35:53.925 ] [00010136] [DEBUG] ToleFiscalPrinter.PrintRecTotal(132688.5, 132688.5, '0') [07.03.2024 14:35:53.926 ] [00010136] [DEBUG] ToleFiscalPrinter.PrintRecTotal(132688.5, 132688.5, '0')=0 [07.03.2024 14:35:53.938 ] [00010136] [DEBUG] ToleFiscalPrinter.PrintRecMessage('Operator: ts') [07.03.2024 14:35:53.939 ] [00010136] [DEBUG] ToleFiscalPrinter.PrintRecMessage('Operator: ts')=0 [07.03.2024 14:35:53.973 ] [00010136] [DEBUG] ToleFiscalPrinter.PrintRecMessage('ID: 1523 ') [07.03.2024 14:35:53.974 ] [00010136] [DEBUG] ToleFiscalPrinter.PrintRecMessage('ID: 1523 ')=0 [07.03.2024 14:35:53.977 ] [00010136] [DEBUG] ToleFiscalPrinter.DirectIO(30, 302, '1') [07.03.2024 14:35:53.978 ] [00010136] [DEBUG] ToleFiscalPrinter.DirectIO(30, 302, '1')=0 [07.03.2024 14:35:53.982 ] [00010136] [DEBUG] ToleFiscalPrinter.DirectIO(30, 300, '1523') [07.03.2024 14:35:53.983 ] [00010136] [DEBUG] ToleFiscalPrinter.DirectIO(30, 300, '1523')=0 [07.03.2024 14:35:53.993 ] [00010136] [DEBUG] ToleFiscalPrinter.EndFiscalReceipt(False) [07.03.2024 14:35:53.995 ] [00010136] [DEBUG] POST: http://fbox.ngrok.io/order/create/ [07.03.2024 14:35:53.996 ] [00010136] [DEBUG] => {"qr_code":"","number":1,"receipt_type":"order","products":[{"name":"Соқолдан кейин лосон Nivea Silver 100ml","barcode":"4005808539789","amount":1000,"units":1,"unit_name":"шт","price":11268850,"product_price":11268850,"vat":1207377,"vat_percent":12,"discount":16000,"discount_percent":0,"other":0,"labels":[],"class_code":"03304013003002007","package_code":1312165,"owner_type":0,"comission_info":{"inn":"235751177","pinfl":""}},{"name":"PUMP 1:АИ92","barcode":"","amount":1120,"units":1,"unit_name":"л","price":2016000,"product_price":1800000,"vat":216000,"vat_percent":12,"discount":0,"discount_percent":0,"other":0,"labels":[],"class_code":"02710001005000000","package_code":0,"owner_type":0,"comission_info":{"inn":"","pinfl":""}}],"time":"2024-03-07 16:35:52","cashier":"ts","received_cash":13268850,"change":0,"received_card":0,"open_cashbox":false,"send_email":false,"banners":[{"type":"text","data":"Operator: ts","cut":false},{"type":"text","data":"ID: 1523 ","cut":false}]} [07.03.2024 14:35:57.306 ] [00010136] [DEBUG] <= { "data": { "terminal_id": "LG230110019352", "receipt_count": 121, "date_time": "20240307163552", "fiscal_sign": "259019399722", "applet_version": "0323", "qr_url": "https://ofd.soliq.uz/check?t=LG230110019352&r=121&c=20240307163552&s=259019399722", "cash_box_number": null }, "error": null, "is_success": true }
SHTRIH-M-OPOS-1_2024.03.07.log