X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/64dde83b543cc17701993dfea6afdec28f3c7e1f..c8c6d6d:/bin/mozilla/is.pl diff --git a/bin/mozilla/is.pl b/bin/mozilla/is.pl index 8e2046897..3c5282cbe 100644 --- a/bin/mozilla/is.pl +++ b/bin/mozilla/is.pl @@ -263,6 +263,8 @@ sub prepare_invoice { (my $dec_qty) = ($form->{"qty_$i"} =~ /\.(\d+)/); $dec_qty = length $dec_qty; + $form->{"lastcost_$i"} = $form->format_amount(\%myconfig, $form->{"lastcost_$i"}, $decimalplaces); + $form->{"qty_$i"} = $form->format_amount(\%myconfig, $form->{"qty_$i"}, $dec_qty); $form->{rowcount} = $i; @@ -544,7 +546,7 @@ sub update { $form->{creditremaining} -= $amount; - map { $form->{"${_}_$i"} = $form->format_amount(\%myconfig, $form->{"${_}_$i"}, $decimalplaces) } qw(sellprice listprice); + map { $form->{"${_}_$i"} = $form->format_amount(\%myconfig, $form->{"${_}_$i"}, $decimalplaces) } qw(sellprice listprice lastcost); $form->{"qty_$i"} = $form->format_amount(\%myconfig, $form->{"qty_$i"}); @@ -652,10 +654,18 @@ sub post { &update; exit; } + + if ($myconfig{mandatory_departments} && !$form->{department_id}) { + $form->{saved_message} = $::locale->text('You have to specify a department.'); + update(); + exit; + } + if ($form->{second_run}) { $form->{print_and_post} = 0; } + remove_emptied_rows(); &validate_items; my $closedto = $form->datetonum($form->{closedto}, \%myconfig); @@ -860,9 +870,6 @@ sub credit_note { my %myconfig = %main::myconfig; my $locale = $main::locale; - open(FH, ">/tmp/lx.dump"); - print FH Dumper($form); - close FH; $main::auth->assert('invoice_edit'); $form->{transdate} = $form->{invdate} = $form->current_date(\%myconfig);