Форум OlegON > Программы и оборудование для автоматизации торговли > Кассовые программы > УКМ-4

Как убрать общую информацию о скидке в чеке? : УКМ-4

19.04.2024 16:02


06.11.2014 08:26
Helpsysone
 
HELP! Убрать общую информацию о скидке в чеке. И поставить скидку на против каждой позиции на которую распространяется скидка. со знаком "-" и пометкой на против "скидка". Это реально? реализовать?
06.11.2014 08:36
akonev
 
реально. только обычно не напротив рисуют, а следующей строкой. а то же совсем название не влезет.
покажи здесь, как ты хочешь, чтобы чек выглядел.

технически - тебе надо будет отредактировать скрипт receipt.lua
там должен быть готовый код для печати и налогов скидок, только он закомментирован.
06.11.2014 08:50
Helpsysone
 
честно, в скрипт receipt.lua никогда не лез,
примерно так:
чек на продажу
************************
* магазин *
************************
122011-00007 сыр
*1.000*15,00 15.00
скидка -5,00
120333-02132 пакет
1.000*3.00 3.00
---------------------------------
товаров в чеке: 2
к оплате:....13.00
---------------------------------
итого к оплате 13.00


примерно так=)
06.11.2014 08:58
akonev
 
значит уже пора залезать :)

открываешь, находишь комментарий "--печать скидок чека"
ниже этого комментария цикл for
вот его весь надо закомментировать.

это ты отключишь печать скидок внутри футера чека.

сохрани и проверь, что чеки печатаются.
06.11.2014 09:01
akonev
 
у меня он такой
печать скидок в футере чека:
Код:
--печать скидок чека

      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) ~= nil and __hard_subtotal.receipt.items:getdiscount(discount):sign() ~= 0 then

            if __hard_subtotal.receipt.items:getdiscount(discount):sign() == -1 then
                 if ukm.str_len("Наценка: " .. ukm.rightpad(ukm.left(discount.name, width-28),width-28,".") .. " " .. tostring(__hard_subtotal.receipt.items:getrealpercent(discount)) .. "% " .. " " .. tostring(__hard_subtotal.receipt.items:getdiscount(discount)*ukm.currency(-1))) < width then
                    text = text .. ukm.adjustment("Наценка: " .. ukm.rightpad(ukm.left(discount.name, width-28),width-28,".") .. " " .. tostring(__hard_subtotal.receipt.items:getrealpercent(discount)) .. "% ", tostring(__hard_subtotal.receipt.items:getdiscount(discount)*ukm.currency(-1)), width-1, ".") .. "\n";
                 else
                    text = text .. ukm.rightpad("Наценка: " .. ukm.rightpad(ukm.left(discount.name, width-28),width-28,".") .. " " .. tostring(__hard_subtotal.receipt.items:getrealpercent(discount)) .. "% ", width-1, ".") .. "\n";
                    text = text .. ukm.leftpad(tostring(__hard_subtotal.receipt.items:getdiscount(discount)*ukm.currency(-1)),width-1,".") .. "\n";
                 end
            else
                 if ukm.str_len("Скидка: " .. ukm.rightpad(ukm.left(discount.name, width-28),width-28,".") .. " " .. tostring(__hard_subtotal.receipt.items:getrealpercent(discount)) .. "% " .. " " .. tostring(__hard_subtotal.receipt.items:getdiscount(discount))) < width then
                    text = text .. ukm.adjustment("Скидка: " .. ukm.rightpad(ukm.left(discount.name, width-28),width-28,".") .. " " .. tostring(__hard_subtotal.receipt.items:getrealpercent(discount)) .. "% ", tostring(__hard_subtotal.receipt.items:getdiscount(discount)), width-1, ".") .. "\n";
                 else
                    text = text .. ukm.rightpad("Скидка: " .. ukm.rightpad(ukm.left(discount.name, width-28),width-28,".") .. " " .. tostring(__hard_subtotal.receipt.items:getrealpercent(discount)) .. "% ", width-1, ".") .. "\n";
                    text = text .. ukm.leftpad(tostring(__hard_subtotal.receipt.items:getdiscount(discount)),width-1,".") .. "\n";
                 end
            end

            local properties_iterator = ukm.map.int.string.iterator(discount.properties);
            if properties_iterator:at(ukm.core.field_discount_modificator) ~= "" then
                 local modif = "возможное значение ";
--выполнение парсинга значения модификатора, и преобразование сохранённых в базе значений в строковый вид для печати
                 local modificator = properties_iterator:at(ukm.core.field_discount_modificator);
                 local human_modificator = modificator_to_human(modificator);
                 if properties_iterator:at(ukm.core.field_discount_client_name) ~= "" then
                      text = text .. ukm.rightpad(ukm.left(properties_iterator:at(ukm.core.field_discount_client_name), width - ukm.str_len(human_modificator) - 2) .. ", " .. human_modificator, width, " ") .. "\n";
                 else
                      text = text .. ukm.adjustment(human_modificator, " ", width, " ") .. "\n";
                 end
            end
         end
      end
06.11.2014 09:03
Helpsysone
 
этот цыкл:
Код:
--печать скидок чека

      --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

            --if __hard_subtotal.receipt.items:getdiscount(discount):get():sign() == -1 then
                --if ukm.str_len("Наценка: " .. ukm.rightpad(ukm.left(discount.name, width-28),width-28,".") .. " " .. tostring(__hard_subtotal.receipt.items:getrealpercent(discount)) .. "% " .. " " .. tostring(__hard_subtotal.receipt.items:getdiscount(discount):get()*ukm.currency(-1))) < width then
                    --text = text .. ukm.adjustment("Наценка: " .. ukm.rightpad(ukm.left(discount.name, width-28),width-28,".") .. " " .. tostring(__hard_subtotal.receipt.items:getrealpercent(discount)) .. "% ", tostring(__hard_subtotal.receipt.items:getdiscount(discount):get()*ukm.currency(-1)), width-1, ".") .. "\n";
                 --else
                    --text = text .. ukm.rightpad("Наценка: " .. ukm.rightpad(ukm.left(discount.name, width-28),width-28,".") .. " " .. tostring(__hard_subtotal.receipt.items:getrealpercent(discount)) .. "% ", width-1, ".") .. "\n";
                    --text = text .. ukm.leftpad(tostring(__hard_subtotal.receipt.items:getdiscount(discount):get()*ukm.currency(-1)),width-1,".") .. "\n";
                 --end
            --else
                 --if ukm.str_len("Скидка: " .. ukm.rightpad(ukm.left(discount.name, width-28),width-28,".") .. " " .. tostring(__hard_subtotal.receipt.items:getrealpercent(discount)) .. "% " .. " " .. tostring(__hard_subtotal.receipt.items:getdiscount(discount):get())) < width then
                    text = text .. ukm.adjustment("Скидка: " .. ukm.rightpad(ukm.left(discount.name, width-28),width-28,".") .. " " .. tostring(__hard_subtotal.receipt.items:getrealpercent(discount)) .. "% ", tostring(__hard_subtotal.receipt.items:getdiscount(discount):get()), width-1, ".") .. "\n";
                 ---else
                    --text = text .. ukm.rightpad("Скидка: " .. ukm.rightpad(ukm.left(discount.name, width-28),width-28,".") .. " " .. tostring(__hard_subtotal.receipt.items:getrealpercent(discount)) .. "% ", width-1, ".") .. "\n";
                    --text = text .. ukm.leftpad(tostring(__hard_subtotal.receipt.items:getdiscount(discount):get()),width-1,".") .. "\n";
                 --end
            --end

            local properties_iterator = ukm.map.int.string.iterator(discount.properties);
            if properties_iterator:at(ukm.core.field_discount_modificator) ~= "" then
                 local modif = "возможное значение ";
правильно?
06.11.2014 09:06
akonev
 
потом ищи "-- Закоментированная возможность печати налогов и скидок сразу после товарной позиции в теле чека"

там две части кода
печать налогов:
Код:
--        if compresed_print == false then
--           local taxes = ukm.taxes(__item.receipt);
--            taxes:create(__item);
--            for i=0, taxes.itemtaxes:size()-1 do
--                local tax = taxes.itemtaxes:at(i);
--                text = text .. ukm.adjustment(" " .. tax.name .. ", " .. tax.percent, tostring(tax.amount) .. " ", width, " ") .. "\n";
--            end
--        else
--            for key, tax in pairs(__item.tax_item) do
--                text = text .. ukm.adjustment(" " .. tax.name .. ", " .. tax.percent, tostring(tax.amount) .. " ", width, " ") .. "\n";
--            end
--        end

печать скидок:
Код:
--        if compresed_print == false then
--           for i=0,__item.discounts:size()-1 do
--             local discount = __item.discounts:at(i);
--               if discount.increment:sign() ~= 0 then
--                 if discount.increment:sign() == 1 then
--                    text = text .. ukm.adjustment(" " .. discount.receiptdiscount.name, tostring(discount.increment) .. " ", width, " ") .. "\n";
--                 else
--                    text = text .. ukm.adjustment(" " .. discount.receiptdiscount.name, tostring(discount.increment*ukm.currency(-1)) .. " ", width, " ") .. "\n";
--                 end
--               end
--           end
--        else
--           for key, discount in pairs(__item.discounts) do
--                if discount.increment:sign() ~= 0 then
--                   if discount.increment:sign() == 1 then
--                      text = text .. ukm.adjustment(" " .. discount.name, tostring(discount.increment) .. " ", width, " ") .. "\n";
--                   else
--                      text = text .. ukm.adjustment(" " .. discount.name, tostring(discount.increment*ukm.currency(-1)) .. " ", width, " ") .. "\n";
--                   end
--                end
--           end
--        end

тебе, понятно, надо раскомментировать только вторую часть.
06.11.2014 09:08
akonev
 
Цитата:
Helpsysone этот цыкл:

правильно?
этот, но ты его не весь зацепил. после комментария ещё кусок. сравни с моим, последние строки тоже нужно убрать.
06.11.2014 09:10
akonev
 
под окошком ответа есть кнопка "расширеный режим".
там более функциональный редактор. в нем есть кнопка с решеткой - вставляет теги CODE для лучшей читаемости.
а то у тебя форматирование теряется и читать код трудно
06.11.2014 09:12
Helpsysone
 
Код:
--выполнение парсинга значения модификатора, и преобразование сохранённых в базе значений в строковый вид для печати
                 local modificator = properties_iterator:at(ukm.core.field_discount_modificator);
                 local human_modificator = modificator_to_human(modificator);
                 if properties_iterator:at(ukm.core.field_discount_client_name) ~= "" then
                      text = text .. ukm.rightpad(ukm.left(properties_iterator:at(ukm.core.field_discount_client_name), width - ukm.str_len(human_modificator) - 2) .. ", " .. human_modificator, width, " ") .. "\n";
                 else
                      text = text .. ukm.adjustment(human_modificator, " ", width, " ") .. "\n";
                 end
            end
         end
      end
так все понятно.
этот цыкл не комментировать правильно?
Часовой пояс GMT +3, время: 16:02.

Форум на базе vBulletin®
Copyright © Jelsoft Enterprises Ltd.
В случае заимствования информации гипертекстовая индексируемая ссылка на Форум обязательна.