--печать скидок чека for i=0, __hard_subtotal.receipt.discounts:size()-1 do local discount = __hard_subtotal.receipt.discounts:at(i); if __hard_subtotal.receipt.items:getdiscount(discount):is_initialized() and __hard_subtotal.receipt.items:getdiscount(discount):get():sign() ~= 0 then local c = ""; if discount.card_number:is_initialized() then c = discount.card_number:get(); end local p = tostring(__hard_subtotal.receipt.items:getrealpercent(discount)) .. "%"; local properties_iterator = ukm.map.int.string.iterator(discount.properties); if properties_iterator:at(ukm.core.field_discount_modificator) ~= "" then p = properties_iterator:at(ukm.core.field_discount_modificator); p = modificator_to_human(p); end text = text .. ukm.adjustment(discount.name .. " " .. c .. " " .. p, tostring(__hard_subtotal.receipt.items:getdiscount(discount):get()), width - 1, " ") .. "\n"; end end text = text .. print_netto_subtotal(__hard_subtotal.receipt.items:leavenormal()); if __hard_subtotal.receipt.type == ukm.core.goods_receipt then text = text .. "СУММА ПРОПИСЬЮ:" .. "\n"; text = text .. " " .. ukm.slice(ukm.num2txt(__hard_subtotal.receipt.subtotal.amount), width) .. "\n"; end for i = 0, __hard_subtotal.receipt.discounts:size()-1 do local discount = __hard_subtotal.receipt.discounts:at(i); for j=0,discount.disc_info:size()-1 do local info = discount.disc_info:at(j); text = text .. "Ваши накопления:" .. "\n"; text = text .. ukm.rightpad(tostring(info.amount) .. " - " ..info.name , width, " ") .. "\n"; end end __print_data:add(text, ukm.printer_type_master()); end end
c = discount.card_number:get();
c = properties_iterator:at(ukm.core.field_discount_client_name);
18:22:27: 0x00000d10: WARNING: debug#D:\DEVEL\build-br-48_sp2-2011_08_03_14_23_52\libukm\ccore.cpp(2571) CCore::ReceiptAppendPayment: При исполнении скрипта произошла ошибка: [string "line"]:324: attempt to index global 'properties_iterator' (a nil value)
text = text .. ukm.adjustment(discount.name .. " " .. properties_iterator:at(ukm.core.field_discount_client_name) .. " " .. p, tostring(__hard_subtotal.receipt.items:getdiscount(discount):get()), width - 1, " ") .. "\n";
local properties_iterator = ukm.map.int.string.iterator(discount.properties); if discount.card_number:is_initialized() then -- c = discount.card_number:get(); c = properties_iterator:at(ukm.core.field_discount_client_name); end local p = tostring(__hard_subtotal.receipt.items:getrealpercent(discount)) .. "%"; -- local properties_iterator = ukm.map.int.string.iterator(discount.properties); if properties_iterator:at(ukm.core.field_discount_modificator) ~= "" then p = properties_iterator:at(ukm.core.field_discount_modificator); p = modificator_to_human(p); end text = text .. ukm.adjustment(discount.name .. " " .. c .. " " .. p, tostring(__hard_subtotal.receipt.items:getdiscount(discount):get()), width - 1, " ") .. "\n"; end end