function print_receipt_footer(__footer, __print_data) local printer = ukm.get_printer(ukm.printer_type_master()); if printer then local text = ""; local width = printer:get_width(); if (__footer.receipt.header:client_exists()) then if (__footer.receipt.header.client.saletype.type == ukm.saletype.sale_wholesale) then text = text .. ukm.center("Оптовая продажа", width, " ") .. "\n"; if (__footer.receipt.header.client.saletype:invoice_exists()) then text = text .. ukm.adjustment("Счет-фактура №", __footer.receipt.header.client.saletype.invoice.number, width, " ") .. "\n"; else text = text .. ukm.slice("Номер счета-фактуры необходимо узнать у администратора", width) .. "\n"; end end end for i=0, __footer.receipt.discounts:size()-1 do local discount = __footer.receipt.discounts:at(i); local properties_iterator = ukm.map.int.string.iterator(discount.properties); local slip_index = ukm.core.field_discount_slip_script; local discount_slip = properties_iterator:at(slip_index); if( discount_slip ~= "") then text = text .. ukm.source(ukm.mashine.handle,discount_slip); end end if __footer.result == ukm.footer.normal then -- local diff = __footer.receipt:get_clear_total() - __footer.receipt:receipt_amount(); -- if diff > ukm.currency(0) then -- text = text .. ukm.adjustment( " СКИДКА:", tostring(diff), width, " ") .. "\n"; -- end for i = 0, __footer.receipt.payments:size()-1 do local __payment = __footer.receipt.payments:at(i); if __payment.receipt.type ~= ukm.core.goods_receipt then if __payment.type == ukm.payment.void or __payment.type == ukm.payment.normal then local header_type = __payment.receipt.header:receipt_type(); if header_type == ukm.header.nonfiscal or header_type == ukm.header.sale or header_type == ukm.header.pop then paytype = "ПОЛУЧЕНО"; elseif header_type == ukm.header.returnbyreceiptnonfiscal or header_type == ukm.header.returnnonfiscal or header_type == ukm.header.creturn or header_type == ukm.header.returnbyreceipt then paytype = "ВОЗВРАТ"; end elseif __payment.type == ukm.payment.change then paytype = "СДАЧА"; end local npaytype = ""; if __payment.type == ukm.payment.cancel then npaytype = "X"; elseif __payment.type == ukm.payment.void or __payment.type == ukm.payment.change then npaytype = "-"; end if __payment.type ~= ukm.payment.change then paytype = paytype .. "," .. ukm.str_upper(__payment.paymentname); end if(ukm.str_len(paytype .. ":." .. tostring(__payment.amountwithchange) .. npaytype) > width) then local width_currency = ukm.str_len(tostring(__payment.amountwithchange) .. npaytype); text = text .. ukm.adjustment(ukm.slice(paytype .. ":.", width - width_currency), tostring(__payment.amountwithchange) .. npaytype, width*2 - width_currency,".") .. "\n"; else text = text .. ukm.adjustment(" " .. paytype .. ":.", tostring(__payment.amountwithchange) .. npaytype, width ,".") .. "\n"; end end end text = text .. ukm.center("СПАСИБО ЗА ПОКУПКУ!",width," ") .. "\n"; -- text = text .. ukm.center("www.monetka.ru",width," ") .. "\n" .. "\n"; elseif __footer.result == ukm.footer.cancel then text = text .. hw_command_alter_color; text = text .. ukm.leftpad("*", width, "*") .. "\n"; text = text .. "*" .. ukm.center("Ч Е К А Н Н У Л И Р О В А Н",width-2," ") .. "*" .. "\n"; text = text .. ukm.leftpad("*", width, "*") .. "\n"; text = text .. hw_command_normal_color; elseif __footer.result == ukm.footer.push then text = text .. hw_command_alter_color; text = text .. ukm.leftpad("*", width, "*") .. "\n"; text = text .. "*" .. ukm.center("Ч Е К О Т Л О Ж Е Н",width-2," ") .. "*" .. "\n"; text = text .. ukm.leftpad("*", width, "*") .. "\n"; text = text .. hw_command_normal_color; elseif __footer.result == ukm.footer.broken then text = text .. hw_command_alter_color; text = text .. ukm.leftpad("*", width, "*") .. "\n"; text = text .. "*" .. ukm.center("ВЫКЛЮЧЕНИЕ ПИТАНИЯ",width-2," ") .. "*" .. "\n"; text = text .. ukm.leftpad("*", width, "*") .. "\n"; text = text .. hw_command_normal_color; end if __footer.receipt.type == ukm.core.goods_receipt then text = text .. " \n" .. " \n" .. "ПРОДАВЕЦ:_____________" .. " \n" .. " \n"; text = text .. ukm.rightpad("М.П.",width," ") .. " \n" .. " \n" .. " \n"; end __print_data:add(text, ukm.printer_type_master()); end end