X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;ds=sidebyside;f=bin%2Fmozilla%2Fir.pl;h=264100e743b151ccd980ae0ee008b301bca22668;hb=82ee22347be2f2ee96d09a9fd0b45710f9552582;hp=caa8a0e6d511c2dbd70931afccb2d7adbbb583b9;hpb=07d71c33315605fcfc450d3b9abf0fd10e92bed5;p=kivitendo-erp.git diff --git a/bin/mozilla/ir.pl b/bin/mozilla/ir.pl index caa8a0e6d..264100e74 100644 --- a/bin/mozilla/ir.pl +++ b/bin/mozilla/ir.pl @@ -43,7 +43,7 @@ require "$form->{path}/arap.pl"; sub add { $lxdebug->enter_sub(); -print STDERR "ir.pl-add\n"; + $form->{title} = $locale->text('Add Vendor Invoice'); &invoice_links; @@ -67,7 +67,7 @@ sub edit { sub invoice_links { $lxdebug->enter_sub(); -print STDERR "ir.pl-invoice_links\n"; + # create links $form->{webdav} = $webdav; @@ -160,7 +160,7 @@ print STDERR "ir.pl-invoice_links\n"; sub prepare_invoice { $lxdebug->enter_sub(); -print STDERR "ir.pl-prepare_invoice\n"; + if ($form->{id}) { map { $form->{$_} =~ s/\"/"/g } qw(invnumber ordnumber quonumber); @@ -176,8 +176,12 @@ print STDERR "ir.pl-prepare_invoice\n"; $form->{"sellprice_$i"} = $form->format_amount(\%myconfig, $form->{"sellprice_$i"}, $decimalplaces); + + (my $dec_qty) = ($form->{"qty_$i"} =~ /\.(\d+)/); + $dec_qty = length $dec_qty; + $form->{"qty_$i"} = - $form->format_amount(\%myconfig, ($form->{"qty_$i"} * -1)); + $form->format_amount(\%myconfig, ($form->{"qty_$i"} * -1), $dec_qty); $form->{rowcount} = $i; } @@ -188,7 +192,7 @@ print STDERR "ir.pl-prepare_invoice\n"; sub form_header { $lxdebug->enter_sub(); -print STDERR "ir.pl-form_header\n"; + # set option selected foreach $item (qw(AP vendor currency department contact)) { $form->{"select$item"} =~ s/ selected//; @@ -223,15 +227,13 @@ print STDERR "ir.pl-form_header\n"; if ($form->{forex}) { $exchangerate .= qq| | - . $locale->text('Exchangerate') - . qq| + . $locale->text('Exchangerate') . qq| $form->{exchangerate}{exchangerate}> |; } else { $exchangerate .= qq| | - . $locale->text('Exchangerate') - . qq| + . $locale->text('Exchangerate') . qq| {exchangerate}> |; } @@ -270,14 +272,12 @@ print STDERR "ir.pl-form_header\n"; $button1 = qq| {invdate}> text('button') - . qq|> + . $locale->text('button') . qq|> |; $button2 = qq| {duedate}> text('button') - . qq|> + . $locale->text('button') . qq|> |; #write Trigger @@ -331,8 +331,7 @@ print STDERR "ir.pl-form_header\n"; $vendor | - . $locale->text('Contact Person') - . qq| + . $locale->text('Contact Person') . qq| $contact {vendor_id}> @@ -417,7 +416,7 @@ $jsscript sub form_footer { $lxdebug->enter_sub(); -print STDERR "ir.pl-form_footer\n"; + $form->{invtotal} = $form->{invsubtotal}; if (($rows = $form->numtextrows($form->{notes}, 25, 8)) < 2) { @@ -823,7 +822,7 @@ sub update { $form->format_amount(\%myconfig, $form->{"sellprice_$i"}, $decimalplaces); $form->{"qty_$i"} = - $form->format_amount(\%myconfig, $form->{"qty_$i"}); + $form->format_amount(\%myconfig, $form->{"qty_$i"}, $dec_qty); } &display_form;