X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/6670c0a6720f82726f65bfdec384563634f869c4..c8c6d6d:/bin/mozilla/is.pl diff --git a/bin/mozilla/is.pl b/bin/mozilla/is.pl index 6446cc787..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);