Revision e3a020ca
Von Sven Schöling vor fast 3 Jahren hinzugefügt
js/kivi.DeliveryOrder.js | ||
---|---|---|
521 | 521 |
var vc; |
522 | 522 |
var vc_id; |
523 | 523 |
var title; |
524 |
if ($('#type').val() == 'sales_order' || $('#type').val() == 'sales_quotation' ) {
|
|
524 |
if ($('#order_customer_id').val()) {
|
|
525 | 525 |
vc = 'customer'; |
526 | 526 |
vc_id = $('#order_customer_id').val(); |
527 | 527 |
title = kivi.t8('Customer details'); |
... | ... | |
704 | 704 |
}); |
705 | 705 |
|
706 | 706 |
$(function() { |
707 |
if ($('#type').val() == 'sales_order' || $('#type').val() == 'sales_quotation' ) { |
|
708 |
$('#order_customer_id').change(kivi.DeliveryOrder.reload_cv_dependent_selections); |
|
709 |
} else { |
|
710 |
$('#order_vendor_id').change(kivi.DeliveryOrder.reload_cv_dependent_selections); |
|
711 |
} |
|
707 |
$('#order_customer_id').change(kivi.DeliveryOrder.reload_cv_dependent_selections); |
|
708 |
$('#order_vendor_id').change(kivi.DeliveryOrder.reload_cv_dependent_selections); |
|
712 | 709 |
|
713 | 710 |
$('#order_currency_id').change(kivi.DeliveryOrder.update_exchangerate); |
714 | 711 |
$('#order_transdate_as_date').change(kivi.DeliveryOrder.update_exchangerate); |
715 | 712 |
$('#order_exchangerate_as_null_number').change(kivi.DeliveryOrder.exchangerate_changed); |
716 | 713 |
|
717 |
if ($('#type').val() == 'sales_order' || $('#type').val() == 'sales_quotation' ) { |
|
718 |
$('#add_item_parts_id').on('set_item:PartPicker', function(e,o) { $('#add_item_sellprice_as_number').val(kivi.format_amount(o.sellprice, -2)) }); |
|
719 |
} else { |
|
720 |
$('#add_item_parts_id').on('set_item:PartPicker', function(e,o) { $('#add_item_sellprice_as_number').val(kivi.format_amount(o.lastcost, -2)) }); |
|
721 |
} |
|
722 | 714 |
$('#add_item_parts_id').on('set_item:PartPicker', function(e,o) { $('#add_item_description').val(o.description) }); |
723 | 715 |
$('#add_item_parts_id').on('set_item:PartPicker', function(e,o) { $('#add_item_unit').val(o.unit) }); |
724 | 716 |
|
Auch abrufbar als: Unified diff
DeliveryOrder: typ checks im javascript