From e3a020ca1ef252ed029f85ee87e717bc45a447b7 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sven=20Sch=C3=B6ling?= Date: Fri, 1 Oct 2021 17:39:02 +0200 Subject: [PATCH] DeliveryOrder: typ checks im javascript --- js/kivi.DeliveryOrder.js | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/js/kivi.DeliveryOrder.js b/js/kivi.DeliveryOrder.js index f90184fab..1552616e8 100644 --- a/js/kivi.DeliveryOrder.js +++ b/js/kivi.DeliveryOrder.js @@ -521,7 +521,7 @@ namespace('kivi.DeliveryOrder', function(ns) { var vc; var vc_id; var title; - if ($('#type').val() == 'sales_order' || $('#type').val() == 'sales_quotation' ) { + if ($('#order_customer_id').val()) { vc = 'customer'; vc_id = $('#order_customer_id').val(); title = kivi.t8('Customer details'); @@ -704,21 +704,13 @@ namespace('kivi.DeliveryOrder', function(ns) { }); $(function() { - if ($('#type').val() == 'sales_order' || $('#type').val() == 'sales_quotation' ) { - $('#order_customer_id').change(kivi.DeliveryOrder.reload_cv_dependent_selections); - } else { - $('#order_vendor_id').change(kivi.DeliveryOrder.reload_cv_dependent_selections); - } + $('#order_customer_id').change(kivi.DeliveryOrder.reload_cv_dependent_selections); + $('#order_vendor_id').change(kivi.DeliveryOrder.reload_cv_dependent_selections); $('#order_currency_id').change(kivi.DeliveryOrder.update_exchangerate); $('#order_transdate_as_date').change(kivi.DeliveryOrder.update_exchangerate); $('#order_exchangerate_as_null_number').change(kivi.DeliveryOrder.exchangerate_changed); - if ($('#type').val() == 'sales_order' || $('#type').val() == 'sales_quotation' ) { - $('#add_item_parts_id').on('set_item:PartPicker', function(e,o) { $('#add_item_sellprice_as_number').val(kivi.format_amount(o.sellprice, -2)) }); - } else { - $('#add_item_parts_id').on('set_item:PartPicker', function(e,o) { $('#add_item_sellprice_as_number').val(kivi.format_amount(o.lastcost, -2)) }); - } $('#add_item_parts_id').on('set_item:PartPicker', function(e,o) { $('#add_item_description').val(o.description) }); $('#add_item_parts_id').on('set_item:PartPicker', function(e,o) { $('#add_item_unit').val(o.unit) }); -- 2.20.1