update price during editing as well
This commit is contained in:
parent
62ca3cb634
commit
58de1a231b
1 changed files with 2 additions and 2 deletions
|
@ -46,12 +46,12 @@
|
||||||
|
|
||||||
:javascript
|
:javascript
|
||||||
var form = $('form.edit_article, form.new_article');
|
var form = $('form.edit_article, form.new_article');
|
||||||
$('#article_price, #article_tax, #article_deposit', form).on('change', function() {
|
$('#article_price, #article_tax, #article_deposit', form).on('change keyup', function() {
|
||||||
var price = parseFloat($('#article_price', form).val());
|
var price = parseFloat($('#article_price', form).val());
|
||||||
var tax = parseFloat($('#article_tax', form).val());
|
var tax = parseFloat($('#article_tax', form).val());
|
||||||
var deposit = parseFloat($('#article_deposit', form).val());
|
var deposit = parseFloat($('#article_deposit', form).val());
|
||||||
// Article#gross_price and Article#fc_price
|
// Article#gross_price and Article#fc_price
|
||||||
var gross_price = (price + deposit) * (tax / 100 + 1);
|
var gross_price = (price + deposit) * (tax / 100 + 1);
|
||||||
var fc_price = gross_price * (#{FoodsoftConfig[:price_markup].to_f} / 100 + 1);
|
var fc_price = gross_price * (#{FoodsoftConfig[:price_markup].to_f} / 100 + 1);
|
||||||
$('#fc_price').html(I18n.l("currency", fc_price));
|
$('#fc_price').html($.isNumeric(fc_price) ? I18n.l("currency", fc_price) : '…');
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue