From: Sven Schöling Date: Fri, 13 Aug 2021 12:48:25 +0000 (+0200) Subject: DeliveryOrder: price_source feature entfernt X-Git-Tag: kivitendo-mebil_0.1-0~10^2~2^2~216^2~88 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=ea402a2c8bf7200a1ebaddec3428fb9af8e20fc0;p=kivitendo-erp.git DeliveryOrder: price_source feature entfernt --- diff --git a/js/kivi.DeliveryOrder.js b/js/kivi.DeliveryOrder.js index ea6e14ba5..c28033f98 100644 --- a/js/kivi.DeliveryOrder.js +++ b/js/kivi.DeliveryOrder.js @@ -516,74 +516,6 @@ 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) { - 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"]'); - - button_elt.val(button_elt.val().replace(/.*\|/, descr + " |")); - source_elt.val(source); - - var editable_div_elt = $(row).find('[name="editable_price"]'); - var not_editable_div_elt = $(row).find('[name="not_editable_price"]'); - if (price_editable == 1 && source === '') { - // editable - $(editable_div_elt).show(); - $(not_editable_div_elt).hide(); - $(editable_div_elt).find(':input').prop("disabled", false); - $(not_editable_div_elt).find(':input').prop("disabled", true); - } else { - // not editable - $(editable_div_elt).hide(); - $(not_editable_div_elt).show(); - $(editable_div_elt).find(':input').prop("disabled", true); - $(not_editable_div_elt).find(':input').prop("disabled", false); - } - - if (price_str) { - var price_elt = $(row).find('[name="order.orderitems[].sellprice_as_number"]'); - var html_elt = $(row).find('[name="sellprice_text"]'); - price_elt.val(price_str); - html_elt.html(price_str); - } - - kivi.io.close_dialog(); - }; - - ns.update_discount_source = 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"]'); - - button_elt.val(button_elt.val().replace(/\|.*/, "| " + descr)); - source_elt.val(source); - - var editable_div_elt = $(row).find('[name="editable_discount"]'); - var not_editable_div_elt = $(row).find('[name="not_editable_discount"]'); - if (price_editable == 1 && source === '') { - // editable - $(editable_div_elt).show(); - $(not_editable_div_elt).hide(); - $(editable_div_elt).find(':input').prop("disabled", false); - $(not_editable_div_elt).find(':input').prop("disabled", true); - } else { - // not editable - $(editable_div_elt).hide(); - $(not_editable_div_elt).show(); - $(editable_div_elt).find(':input').prop("disabled", true); - $(not_editable_div_elt).find(':input').prop("disabled", false); - } - - if (discount_str) { - var discount_elt = $(row).find('[name="order.orderitems[].discount_as_percent"]'); - var html_elt = $(row).find('[name="discount_text"]'); - discount_elt.val(discount_str); - html_elt.html(discount_str); - } - - kivi.io.close_dialog(); - }; - ns.show_vc_details_dialog = function() { if (!ns.check_cv()) return; var vc; diff --git a/templates/webpages/delivery_order/tabs/_price_sources_dialog.html b/templates/webpages/delivery_order/tabs/_price_sources_dialog.html deleted file mode 100644 index 02f1fd396..000000000 --- a/templates/webpages/delivery_order/tabs/_price_sources_dialog.html +++ /dev/null @@ -1,106 +0,0 @@ -[%- USE T8 %] -[%- USE HTML %] -[%- USE L %] -[%- USE LxERP %] -[% SET best_price = price_source.best_price %] -[% SET best_discount = price_source.best_discount %] -[% SET price_editable = 0 %] -[% IF (FORM.type == "sales_order" || FORM.type == "sales_quotation") %] - [% SET price_editable = AUTH.assert('sales_edit_prices', 1) %] -[% END %] -[% IF (FORM.type == "purchase_order" || FORM.type == "request_quotation") %] - [% SET price_editable = AUTH.assert('purchase_edit_prices', 1) %] -[% END %] -[% SET exfactor = price_source.record.exchangerate ? 1 / price_source.record.exchangerate : 1 %] -[% SET exnoshow = price_source.record.currency_id==INSTANCE_CONF.get_currency_id %] -[% SET places = exnoshow ? -2 : 5 %] -

[% 'Prices' | $T8 %]

- - - - - - - - - - - -[%- IF price_source.record_item.active_price_source %] - -[%- ELSE %] - -[%- END %] - - - - - - - [%- FOREACH price IN price_source.available_prices %] - -[%- IF price_source.record_item.active_price_source != price.source %] - -[%- ELSIF price_source.record_item.sellprice * 1 != price.price * 1 %] - -[%- ELSE %] - -[% END %] - - - -[% IF price.source == best_price.source %] - -[% ELSE %] - -[% END %] - - - [%- END %] -
[% 'Price Source' | $T8 %][% 'Price' | $T8 %] - [% 'Price' | $T8 -%]/[%- price_source.record.currency.name %] - [% 'Best Price' | $T8 %][% 'Details' | $T8 %]
[% L.button_tag('kivi.Order.update_price_source(\'' _ FORM.item_id _ '\', \'\', \'' _ LxERP.t8('None (PriceSource)') _ '\', \'\', ' _ price_editable _ ')', LxERP.t8('Select')) %][% 'Selected' | $T8 %][% 'None (PriceSource)' | $T8 %]--
[% L.button_tag('kivi.Order.update_price_source(\'' _ FORM.item_id _ '\', \'' _ price.source _ '\', \'' _ price.source_description _ '\', \'' _ LxERP.format_amount(price.price * exfactor, places) _ '\', ' _ price_editable _ ')', LxERP.t8('Select')) %][% L.button_tag('kivi.Order.update_price_source(\'' _ FORM.item_id _ '\', \'' _ price.source _ '\', \'' _ price.source_description _ '\', \'' _ LxERP.format_amount(price.price * exfactor, places) _ '\', ' _ price_editable _ ')', LxERP.t8('Update Price')) %][% 'Selected' | $T8 %][% price.source_description | html %][% price.price_as_number %] - [% LxERP.format_amount(price.price * exfactor, places) %] - [% price.description | html %]
- -

[% 'Discounts' | $T8 %]

- - - - - - - - - - -[%- IF price_source.record_item.active_discount_source %] - -[%- ELSE %] - -[%- END %] - - - - - - [%- FOREACH price IN price_source.available_discounts %] - -[%- IF price_source.record_item.active_discount_source != price.source %] - -[%- ELSIF price_source.record_item.discount * 1 != price.discount * 1 %] - -[%- ELSE %] - -[% END %] - - -[% IF price.source == best_discount.source %] - -[% ELSE %] - -[% END %] - - - [%- END %] -
[% 'Price Source' | $T8 %][% 'Discount' | $T8 %][% 'Best Discount' | $T8 %][% 'Details' | $T8 %]
[% L.button_tag('kivi.Order.update_discount_source(\'' _ FORM.item_id _ '\', \'\', \'' _ LxERP.t8('None (PriceSource Discount)') _ '\', \'\', ' _ price_editable _ ')', LxERP.t8('Select')) %][% 'Selected' | $T8 %][% 'None (PriceSource Discount)' | $T8 %]-
[% L.button_tag('kivi.Order.update_discount_source(\'' _ FORM.item_id _ '\', \'' _ price.source _ '\', \'' _ price.source_description _ '\', \'' _ price.discount_as_percent _ '\', ' _ price_editable _ ')', LxERP.t8('Select')) %][% L.button_tag('kivi.Order.update_discount_source(\'' _ FORM.item_id _ '\', \'' _ price.source _ '\', \'' _ price.source_description _ '\', \'' _ price.discount_as_percent _ '\', ' _ price_editable _ ')', LxERP.t8('Update Discount')) %][% 'Selected' | $T8 %][% price.source_description | html %][% price.discount_as_percent %] %[% price.description | html %]
diff --git a/templates/webpages/delivery_order/tabs/_row.html b/templates/webpages/delivery_order/tabs/_row.html index 60d6cf18a..648364726 100644 --- a/templates/webpages/delivery_order/tabs/_row.html +++ b/templates/webpages/delivery_order/tabs/_row.html @@ -92,11 +92,6 @@ value_key = 'name', class = 'unitselect') %] - - [%- L.button_tag("kivi.Order.price_chooser_item_row(this)", - ITEM.active_price_source.source_description _ ' | ' _ ITEM.active_discount_source.source_description, - name = "price_chooser_button") %] - [% SET RIGHT_TO_EDIT_PRICES = 0 %] [% IF (SELF.type == "sales_order" || SELF.type == "sales_quotation") %] [% SET RIGHT_TO_EDIT_PRICES = AUTH.assert('sales_edit_prices', 1) %] @@ -105,8 +100,7 @@ [% SET RIGHT_TO_EDIT_PRICES = AUTH.assert('purchase_edit_prices', 1) %] [% END %] - [%- L.hidden_tag("order.orderitems[].active_price_source", ITEM.active_price_source.source) %] - [%- SET EDIT_PRICE = (RIGHT_TO_EDIT_PRICES && ITEM.active_price_source.source == '') %] + [%- SET EDIT_PRICE = (RIGHT_TO_EDIT_PRICES) %]
[%- L.input_tag("order.orderitems[].sellprice_as_number", ITEM.sellprice_as_number, @@ -122,8 +116,7 @@
- [%- L.hidden_tag("order.orderitems[].active_discount_source", ITEM.active_discount_source.source) %] - [%- SET EDIT_DISCOUNT = (RIGHT_TO_EDIT_PRICES && ITEM.active_discount_source.source == '') %] + [%- SET EDIT_DISCOUNT = (RIGHT_TO_EDIT_PRICES) %]
[%- L.input_tag("order.orderitems[].discount_as_percent", ITEM.discount_as_percent,