use SL::IS;
use SL::PE;
+use Data::Dumper;
require "$form->{path}/io.pl";
require "$form->{path}/arap.pl";
map { $form->{$_} =~ s/\"/"/g }
qw(invnumber ordnumber quonumber shippingpoint shipvia notes intnotes);
+ # # get pricegroups for parts
+ # IS->get_pricegroups_for_parts(\%myconfig, \%$form);
+
foreach $ref (@{ $form->{invoice_details} }) {
$i++;
map { $form->{"${_}_$i"} = $ref->{$_} } keys %{$ref};
$form->{"discount_$i"} =
$form->format_amount(\%myconfig, $form->{"discount_$i"} * 100);
-
($dec) = ($form->{"sellprice_$i"} =~ /\.(\d+)/);
$dec = length $dec;
$decimalplaces = ($dec > 2) ? $dec : 2;
$form->{"sellprice_$i"} =
$form->format_amount(\%myconfig, $form->{"sellprice_$i"},
$decimalplaces);
- $form->{"qty_$i"} = $form->format_amount(\%myconfig, $form->{"qty_$i"});
+
+ (my $dec_qty) = ($form->{"qty_$i"} =~ /\.(\d+)/);
+ $dec_qty = length $dec_qty;
+
+ $form->{"qty_$i"} =
+ $form->format_amount(\%myconfig, $form->{"qty_$i"}, $dec_qty);
map { $form->{"${_}_$i"} =~ s/\"/"/g }
qw(partnumber description unit partnotes);
$form->{rowcount} = $i;
+
}
}
$lxdebug->leave_sub();
<tr>
<th align=right nowrap>| . $locale->text('Customer') . qq|</th>
<td colspan=3>$customer</td>
+ <input type=hidden name=customer_klass value=$form->{customer_klass}>
<input type=hidden name=customer_id value=$form->{customer_id}>
<input type=hidden name=oldcustomer value="$form->{oldcustomer}">
<th align=richt nowrap>|
map { $form->{$_} = $form->parse_amount(\%myconfig, $form->{$_}) }
qw(exchangerate creditlimit creditremaining);
-
+ if ($form->{second_run}) {
+ $form->{print_and_post} = 0;
+ }
&check_name(customer);
&check_project;
}
}
+ # get pricegroups for parts
+ IS->get_pricegroups_for_parts(\%myconfig, \%$form);
+
+ # build up html code for prices_$i
+ &set_pricegroup($i);
}
&display_form;
sub post {
$lxdebug->enter_sub();
-
$form->isblank("invdate", $locale->text('Invoice Date missing!'));
$form->isblank("customer", $locale->text('Customer missing!'));
&update;
exit;
}
+ if ($form->{second_run}) {
+ $form->{print_and_post} = 0;
+ }
&validate_items;
$print_post = 1;
$form->{print_and_post} = 1;
&post();
+
&display_form();
$lxdebug->leave_sub();
sub delete {
$lxdebug->enter_sub();
-
+ if ($form->{second_run}) {
+ $form->{print_and_post} = 0;
+ }
$form->header;
print qq|