X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=js%2Fkivi.Order.js;h=8815d9b29ebf0222c978272054bbb693ca40a611;hb=d6fed9b55a11dca1cfd9cd6f43940a945533d318;hp=b82358b679138fc80fb93d1e6e6a0e9af8374802;hpb=11aeaa07186197c61dfe610d2a5c981754fd2e9d;p=kivitendo-erp.git diff --git a/js/kivi.Order.js b/js/kivi.Order.js index b82358b67..8815d9b29 100644 --- a/js/kivi.Order.js +++ b/js/kivi.Order.js @@ -558,7 +558,7 @@ namespace('kivi.Order', function(ns) { $.post("controller.pl", data, kivi.eval_json_result); }; - ns.update_price_source = function(item_id, source, descr, price_str, price_editable) { + ns.set_price_and_source_text = function(item_id, source, descr, price_str, price_editable) { var row = $('#item_' + item_id).parents("tbody").first(); var source_elt = $(row).find('[name="order.orderitems[].active_price_source"]'); var button_elt = $(row).find('[name="price_chooser_button"]'); @@ -587,13 +587,17 @@ namespace('kivi.Order', function(ns) { var html_elt = $(row).find('[name="sellprice_text"]'); price_elt.val(price_str); html_elt.html(price_str); - ns.recalc_amounts_and_taxes(); } + }; + + ns.update_price_source = function(item_id, source, descr, price_str, price_editable) { + ns.set_price_source_text(item_id, source, descr, price_str, price_editable); + if (price_str) ns.recalc_amounts_and_taxes(); kivi.io.close_dialog(); }; - ns.update_discount_source = function(item_id, source, descr, discount_str, price_editable) { + ns.set_discount_and_source_text = function(item_id, source, descr, discount_str, price_editable) { var row = $('#item_' + item_id).parents("tbody").first(); var source_elt = $(row).find('[name="order.orderitems[].active_discount_source"]'); var button_elt = $(row).find('[name="price_chooser_button"]'); @@ -622,9 +626,11 @@ namespace('kivi.Order', function(ns) { var html_elt = $(row).find('[name="discount_text"]'); discount_elt.val(discount_str); html_elt.html(discount_str); - ns.recalc_amounts_and_taxes(); } + }; + ns.update_discount_source = function(item_id, source, descr, discount_str, price_editable) { + if (discount_str) ns.recalc_amounts_and_taxes(); kivi.io.close_dialog(); };