Цитата: Carott ➤ Оставался вопрос - как учитывать печать товарных чеков и копий чеков. Были расхождения с реальным потреблением
В принципе, в lua можно заложить фиксирование в логах кассы печать товарных и копий чека, скажем, в скрипте receipt.lua в функции print_receipt_open вместо стандартного блока
Код:
if __header.receipt.type == ukm.core.copy then
text = text .. "*" .. ukm.center("К О П И Я Ч Е К А",width-2," ") .. "*" .. "\n";
text = text .. ukm.leftpad("*", width, "*") .. "\n";
elseif __header.receipt.type == ukm.core.duplicate_ then
text = text .. "*" .. ukm.center("Д У Б Л И К А Т Ч Е К А",width-2," ") .. "*" .. "\n";
text = text .. ukm.leftpad("*", width, "*") .. "\n";
elseif __header.receipt.type == ukm.core.restore_ then
text = text .. "*" .. ukm.center("Ч Е К В О С С Т А Н О В Л Е Н",width-2," ") .. "*" .. "\n";
text = text .. ukm.leftpad("*", width, "*") .. "\n";
elseif __header.receipt.type == ukm.core.goods_receipt then
text = text .. "*" .. ukm.center("Т О В А Р Н Ы Й Ч Е К",width-2," ") .. "*" .. "\n";
text = text .. ukm.leftpad("*", width, "*") .. "\n";
end
вставить такой:
Код:
local logtext = "";
if __header.receipt.type == ukm.core.copy then
text = text .. "*" .. ukm.center("К О П И Я Ч Е К А",width-2," ") .. "*" .. "\n";
text = text .. ukm.leftpad("*", width, "*") .. "\n";
logtext = "COPY";
elseif __header.receipt.type == ukm.core.duplicate_ then
text = text .. "*" .. ukm.center("Д У Б Л И К А Т Ч Е К А",width-2," ") .. "*" .. "\n";
text = text .. ukm.leftpad("*", width, "*") .. "\n";
logtext = "DUPLICATE";
elseif __header.receipt.type == ukm.core.restore_ then
text = text .. "*" .. ukm.center("Ч Е К В О С С Т А Н О В Л Е Н",width-2," ") .. "*" .. "\n";
text = text .. ukm.leftpad("*", width, "*") .. "\n";
logtext = "RECEIPT RECOVERY";
elseif __header.receipt.type == ukm.core.goods_receipt then
text = text .. "*" .. ukm.center("Т О В А Р Н Ы Й Ч Е К",width-2," ") .. "*" .. "\n";
text = text .. ukm.leftpad("*", width, "*") .. "\n";
logtext = "FORMAL SALES RECEIPT";
end
if logtext ~= "" then
ukm.debug("A \""..logtext.."\" has been printed by receipt No "..tostring(__header.pos) .. "." .. tostring(__header.shiftopen.number) .. "." .. tostring(__header.localnumber) .. " // " .. tostring(__header.globalnumber));
end