From: Felix Eichler Date: Mon, 15 Apr 2019 08:15:20 +0000 (+0200) Subject: Auftragsschnellerfassung: Warnung wenn neuer Wechselkurs eingegeben X-Git-Tag: release-3.5.6.1~105 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=e8a621506e8476de38901b6b01109d73075741f2;p=kivitendo-erp.git Auftragsschnellerfassung: Warnung wenn neuer Wechselkurs eingegeben (cherry picked from commit 3825bc25c386674446879946bd73a16a2c3e3314) (cherry pick von odyn) --- diff --git a/js/kivi.Order.js b/js/kivi.Order.js index 7b06fec1a..016212875 100644 --- a/js/kivi.Order.js +++ b/js/kivi.Order.js @@ -210,6 +210,13 @@ namespace('kivi.Order', function(ns) { }); }; + ns.exchangerate_changed = function(event) { + if (kivi.parse_amount($('#order_exchangerate_as_number').val()) != kivi.parse_amount($('#old_exchangerate').val())) { + kivi.display_flash('warning', kivi.t8('You have changed the currency or exchange rate. Please update prices.')); + $('#old_exchangerate').val($('#order_exchangerate_as_number').val()); + } + }; + ns.recalc_amounts_and_taxes = function() { var data = $('#order_form').serializeArray(); data.push({ name: 'action', value: 'Order/recalc_amounts_and_taxes' }); @@ -830,6 +837,7 @@ $(function() { $('#order_currency_id').change(kivi.Order.update_exchangerate); $('#order_transdate_as_date').change(kivi.Order.update_exchangerate); + $('#order_exchangerate_as_number').change(kivi.Order.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)) });