$form->{"reqdate_$i"} ||= $form->{"deliverydate_$i"};
$form->{"discount_$i"} = $form->format_amount(\%myconfig, $form->{"discount_$i"} * ($format_discounts ? 100 : 1));
$form->{"sellprice_$i"} = $form->format_amount(\%myconfig, $form->{"sellprice_$i"});
$form->{"reqdate_$i"} ||= $form->{"deliverydate_$i"};
$form->{"discount_$i"} = $form->format_amount(\%myconfig, $form->{"discount_$i"} * ($format_discounts ? 100 : 1));
$form->{"sellprice_$i"} = $form->format_amount(\%myconfig, $form->{"sellprice_$i"});
- # Container for template variables. Unfortunately this has to be visible in form_footer too, so not my.
- our %TMPL_VAR = ();
+ # Container for template variables. Unfortunately this has to be
+ # visible in form_footer too, so my at package level and not here.
+ %TMPL_VAR = ();
# select discount as customer_discount from customer
$form->{"discount_$i"} = $form->format_amount(\%myconfig, $form->{"$form->{vc}_discount"} * 100);
# select discount as customer_discount from customer
$form->{"discount_$i"} = $form->format_amount(\%myconfig, $form->{"$form->{vc}_discount"} * 100);
$form->{creditremaining} -= $amount;
$form->{"sellprice_$i"} = $form->format_amount(\%myconfig, $form->{"sellprice_$i"}, $decimalplaces);
$form->{creditremaining} -= $amount;
$form->{"sellprice_$i"} = $form->format_amount(\%myconfig, $form->{"sellprice_$i"}, $decimalplaces);
$form->{"qty_$i"} = $form->format_amount(\%myconfig, $form->{"qty_$i"}, $dec_qty);
# get pricegroups for parts
$form->{"qty_$i"} = $form->format_amount(\%myconfig, $form->{"qty_$i"}, $dec_qty);
# get pricegroups for parts
if ( $form->{sales_order_to_purchase_order} ) {
for my $i (1 .. $form->{rowcount}) {
$form->{"sellprice_${i}"} = $form->format_amount(\%myconfig,$form->{"lastcost_${i}"});
if ( $form->{sales_order_to_purchase_order} ) {
for my $i (1 .. $form->{rowcount}) {
$form->{"sellprice_${i}"} = $form->format_amount(\%myconfig,$form->{"lastcost_${i}"});
delete @{$form}{qw(id subject message cc bcc printed emailed queued creditlimit creditremaining discount tradediscount oldinvtotal closed delivered)};
for my $i (1 .. $form->{rowcount}) {
delete @{$form}{qw(id subject message cc bcc printed emailed queued creditlimit creditremaining discount tradediscount oldinvtotal closed delivered)};
for my $i (1 .. $form->{rowcount}) {