->run('row_table_scroll_down')
->run('row_set_keyboard_events_by_id', $item_id)
->on('.recalc', 'change', 'recalc_amounts_and_taxes')
+ ->on('.reformat_number', 'change', 'reformat_number')
->focus('#add_item_parts_id_name');
$self->_js_redisplay_amounts_and_taxes;
size = 10,
style='text-align:right',
disabled=(EDIT_PRICE? '' : 1),
- class="recalc") %]
+ class="recalc reformat_number") %]
</div>
<div name="not_editable_price" [%- IF EDIT_PRICE %]style="display:none"[%- END %]>
[%- L.div_tag(ITEM.sellprice_as_number, name="sellprice_text", style='text-align:right') %]
size = 5,
style='text-align:right',
disabled=(EDIT_DISCOUNT? '' : 1),
- class="recalc") %]
+ class="recalc reformat_number") %]
</div>
<div name="not_editable_discount" [%- IF EDIT_DISCOUNT %]style="display:none"[%- END %]>
[%- L.div_tag(ITEM.discount_as_percent, name="discount_text", style='text-align:right') %]
kivi.io.close_dialog();
}
+function reformat_number(event) {
+ $(event.target).val(kivi.format_amount(kivi.parse_amount($(event.target).val()), -2));
+}
+
function recalc_amounts_and_taxes() {
var data = $('#order_form').serialize();
data += '&action=Order/recalc_amounts_and_taxes';
});
row_set_keyboard_events($('.row_entry'));
$('.recalc').change(recalc_amounts_and_taxes);
+ $('.reformat_number').change(reformat_number);
});
</script>