</tr>
</table>
- <div>
- <table id="input_row_table_id">
- <thead>
- <tr class="listheading">
- <th class="listheading" nowrap >[%- 'Part' | $T8 %] </th>
- <th class="listheading" nowrap width="5" >[%- 'Qty' | $T8 %] </th>
- <th class="listheading" nowrap width="15">[%- 'Price' | $T8 %] </th>
- <th class="listheading" nowrap width="5" >[%- 'Discount' | $T8 %] </th>
- <th></th>
- </tr>
- </thead>
- <tbody>
- <tr valign="top" class="listrow">
- <td>[% L.part_picker('add_item.parts_id', '', style='width: 300px') %]</td>
- <td>[% L.input_tag('add_item.qty_as_number', '', size = 5, style='text-align:right') %]</td>
- <td>[% L.input_tag('add_item.sellprice_as_number', '', size = 10, style='text-align:right') %]</td>
- <td>[% L.input_tag('add_item.discount_as_percent', '', size = 5, style='text-align:right') %]</td>
- <td>[% L.button_tag('add_item()', LxERP.t8('Add part')) %]</td>
- </tr>
- </tbody>
- </table>
-
- </div>
+ [%- PROCESS order/tabs/_item_input.html %]
<table width="100%">
<tr>
function delete_order_item_row(clicked) {
var row = $(clicked).parents("tr").first();
$(row).remove();
+
+ recalc_amounts_and_taxes()
}
function set_item_values(event) {
$.post("controller.pl", data, kivi.eval_json_result);
}
+function recalc_amounts_and_taxes() {
+ var data = $('#order_form').serialize();
+ data += '&action=Order/recalc_amounts_and_taxes';
+ data += '&type=' + $('#type').val();
+
+ $.post("controller.pl", data, kivi.eval_json_result);
+}
+
function display_linetotal(item_id, amount) {
$('#item_' + item_id).parents("tr").first().find('[name="linetotal"]').html(amount);
}
$(function(){
$('#order_[%- cv_id %]').change(reload_cv_dependend_selections);
$('[id^="order_orderitems"][id$="parts_id"]').change(set_item_values);
+ $('.add_item_input').keydown(function(event) {
+ if(event.keyCode == 13) {
+ event.preventDefault();
+ add_item();
+ return false;
+ }
+ });
});
+
</script>