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');
});
$(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) });