use SL::IC;
use SL::IO;
use SL::TransNumber;
+use SL::DB::Chart;
use SL::DB::Default;
use SL::DB::Draft;
use SL::DB::Tax;
my $basefactor;
my $baseqty;
+ if ($form->{type} eq 'invoice_for_advance_payment') {
+ $form->{"income_accno_$i"} = SL::DB::Chart->new(id => $::instance_conf->get_advance_payment_clearing_chart_id)->load->accno;
+ }
+
$form->{"marge_percent_$i"} = $form->parse_amount($myconfig, $form->{"marge_percent_$i"}) * 1;
$form->{"marge_absolut_$i"} = $form->parse_amount($myconfig, $form->{"marge_absolut_$i"}) * 1;
$form->{"lastcost_$i"} = $form->parse_amount($myconfig, $form->{"lastcost_$i"}) * 1;
}
}
+ if ($form->{type} eq 'invoice_for_advance_payment') {
+ # invoice for advance payment show tax but does not account it.
+ # tax has to be accounted on payment
+ foreach my $item (split(/ /, $form->{taxaccounts})) {
+ delete $form->{amount}{ $form->{id} }{$item};
+ }
+
+ $tax = 0;
+ }
+
# Invoice Summary includes Rounding
my $grossamount = $netamount + $tax;
my $rounding = $form->round_amount(