Sollte evtl. auf Dialog umgestellt werden.
} } @all_objects;
}
- $::request->{layout}->use_javascript("${_}.js") for qw(kivi.SalesPurchase kivi.Order kivi.File ckeditor/ckeditor ckeditor/adapters/jquery edit_periodic_invoices_config);
+ $::request->{layout}->use_javascript("${_}.js") for qw(kivi.SalesPurchase kivi.Order kivi.File ckeditor/ckeditor ckeditor/adapters/jquery edit_periodic_invoices_config calculate_qty);
$self->_setup_edit_action_bar;
}
my $qty_dec = ($form->{"qty_$i"} =~ /\.(\d+)/) ? length $1 : 2;
$column_data{qty} = $cgi->textfield(-name => "qty_$i", -size => 5, -class => "numeric", -value => $form->format_amount(\%myconfig, $form->{"qty_$i"}, $qty_dec));
- $column_data{qty} .= $cgi->button(-onclick => "calculate_qty_selection_window('qty_$i', '', 'formel_$i')", -value => $locale->text('*/'))
+ $column_data{qty} .= $cgi->button(-onclick => "calculate_qty_selection_window('qty_$i', '', 'formel_$i', '')", -value => $locale->text('*/'))
. $cgi->hidden(-name => "formel_$i", -value => $form->{"formel_$i"})
if $form->{"formel_$i"};
return true;
};
+ ns.show_calculate_qty_dialog = function(clicked) {
+ var row = $(clicked).parents("tbody").first();
+ var input_id = $(row).find('[name="order.orderitems[].qty_as_number"]').attr('id');
+ var formula_id = $(row).find('[name="formula"]').attr('id');
+
+ calculate_qty_selection_window("", input_id, "", formula_id);
+ return true;
+ }
+
});
$(function(){
[%- END -%]
[%- L.button_tag("kivi.Order.show_longdescription_dialog(this)", LxERP.t8("L")) %]
</td>
- <td>
+ <td nowrap>
[%- L.input_tag("order.orderitems[].qty_as_number",
ITEM.qty_as_number,
size = 5,
class="recalc reformat_number numeric") %]
+ [%- IF ITEM.part.formel -%]
+ [%- L.button_tag("kivi.Order.show_calculate_qty_dialog(this)", LxERP.t8("*/")) %]
+ [%- L.hidden_tag("formula", ITEM.part.formel) -%]
+ [%- END -%]
</td>
<td>
[%- L.select_tag("order.orderitems[].price_factor_id",