X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Fis.pl;h=314f68bc1e28f290ded0330d3d195ed099842d68;hb=c2ed42c3f435937925ef825de61f2520196d1de6;hp=53230d2b4a12faca54e55d17342b0831397fe252;hpb=a8d9f325b9a5d7b7336b8c6f16f12080a5bdba39;p=kivitendo-erp.git diff --git a/bin/mozilla/is.pl b/bin/mozilla/is.pl index 53230d2b4..314f68bc1 100644 --- a/bin/mozilla/is.pl +++ b/bin/mozilla/is.pl @@ -57,9 +57,10 @@ sub add { { $form->error("Access Denied"); } - &invoice_links; &prepare_invoice; + $form->{format} ="pdf"; + &display_form; $lxdebug->leave_sub(); @@ -67,14 +68,17 @@ sub add { sub edit { $lxdebug->enter_sub(); -print STDERR "is.pl-edit\n"; + $form->{title} = $locale->text('Edit Sales Invoice'); if ($myconfig{acs} =~ "AR--Add Sales Invoice" || $myconfig{acs} =~ "AR--AR") { $form->error("Access Denied"); } - + if ($form->{print_and_post}) { + $form->{action} = "print"; + $form->{resubmit} = 1; + } &invoice_links; &prepare_invoice; &display_form; @@ -84,7 +88,7 @@ print STDERR "is.pl-edit\n"; sub invoice_links { $lxdebug->enter_sub(); -print STDERR "is.pl-invoice_links\n"; + $form->{vc} = 'customer'; # create links @@ -184,10 +188,9 @@ print STDERR "is.pl-invoice_links\n"; sub prepare_invoice { $lxdebug->enter_sub(); -print STDERR "is.pl-prepare_invoice\n"; + $form->{type} = "invoice"; $form->{formname} = "invoice"; - $form->{format} = "html"; $form->{media} = "screen"; if ($form->{id}) { @@ -195,8 +198,8 @@ print STDERR "is.pl-prepare_invoice\n"; map { $form->{$_} =~ s/\"/"/g } qw(invnumber ordnumber quonumber shippingpoint shipvia notes intnotes); -# # get pricegroups for parts -# IS->get_pricegroups_for_parts(\%myconfig, \%$form); + # # get pricegroups for parts + # IS->get_pricegroups_for_parts(\%myconfig, \%$form); foreach $ref (@{ $form->{invoice_details} }) { $i++; @@ -210,7 +213,12 @@ print STDERR "is.pl-prepare_invoice\n"; $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); @@ -223,7 +231,7 @@ print STDERR "is.pl-prepare_invoice\n"; sub form_header { $lxdebug->enter_sub(); -print STDERR "is.pl-form_header\n"; + # set option selected foreach $item (qw(AR customer currency department employee contact)) { $form->{"select$item"} =~ s/ selected//; @@ -339,8 +347,10 @@ print STDERR "is.pl-form_header\n"; $button2 = qq|