From: Sven Schöling Date: Fri, 1 Oct 2021 15:39:02 +0000 (+0200) Subject: DeliveryOrder: typ checks im javascript X-Git-Tag: kivitendo-mebil_0.1-0~10^2~2^2~216^2~78 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=e3a020ca1ef252ed029f85ee87e717bc45a447b7;p=kivitendo-erp.git DeliveryOrder: typ checks im javascript --- 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) });