From: Sven Schöling Date: Tue, 27 Oct 2009 13:54:44 +0000 (+0100) Subject: is form_footer: weitere exportierte variablen X-Git-Tag: release-2.6.1beta1~113^2~9 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=de6cead5597b9a1f7491f7b73a13f824589364b5;p=kivitendo-erp.git is form_footer: weitere exportierte variablen --- diff --git a/bin/mozilla/is.pl b/bin/mozilla/is.pl index 5708ac407..024dce289 100644 --- a/bin/mozilla/is.pl +++ b/bin/mozilla/is.pl @@ -385,17 +385,19 @@ sub form_footer { my $form = $main::form; my %myconfig = %main::myconfig; my $locale = $main::locale; - my $cgi = $main::cgi; $main::auth->assert('invoice_edit'); - $form->{invtotal} = $form->{invsubtotal}; + $form->{invtotal} = $form->{invsubtotal}; + $form->{oldinvtotal} = $form->{invtotal}; + + # note rows + $form->{rows} = max 2, + $form->numtextrows($form->{notes}, 26, 8), + $form->numtextrows($form->{intnotes}, 35, 8); - my ($rows, $introws); - if (($rows = $form->numtextrows($form->{notes}, 26, 8)) < 2) { $rows = 2; } - if (($introws = $form->numtextrows($form->{intnotes}, 35, 8)) < 2) { $introws = 2; } - $form->{rows} = ($rows > $introws) ? $rows : $introws; + # tax, total and subtotal calculations my ($tax, $subtotal); $form->{taxaccounts_array} = [ split / /, $form->{taxaccounts} ]; @@ -412,8 +414,6 @@ sub form_footer { } } - $form->{oldinvtotal} = $form->{invtotal}; - # unfortunately locales doesn't support extended syntax if ($form->{id}) { my $follow_ups = FU->follow_ups('trans_id' => $form->{id}); @@ -424,25 +424,26 @@ sub form_footer { } } - -# payments + # payments my $totalpaid = 0; - $form->{paidaccounts}++ if ($form->{"paid_$form->{paidaccounts}"}); $form->{paid_indices} = [ 1 .. $form->{paidaccounts} ]; for my $i (1 .. $form->{paidaccounts}) { $form->{"selectAR_paid_$i"} = $form->{selectAR_paid}; $form->{"selectAR_paid_$i"} =~ s/option>\Q$form->{"AR_paid_$i"}\E/option selected>$form->{"AR_paid_$i"}/; - - # format amounts $totalpaid += $form->{"paid_$i"}; } - $form->{print_options} = print_options(inline => 1); - - print $form->parse_html_template('is/form_footer'); -# print $form->parse_html_template('is/_payments'); # parser + print $form->parse_html_template('is/form_footer', { + is_type_credit_note => ($form->{type} eq "credit_note"), + totalpaid => $totalpaid, + paid_missing => $form->{invtotal} - $totalpaid, + print_options => print_options(inline => 1), + show_storno => $form->{id} && !$form->{storno} && !IS->has_storno(\%myconfig, $form, "ar") && !$totalpaid, + show_delete => ($form->current_date(\%myconfig) eq $form->{gldate}), + }); +##print $form->parse_html_template('is/_payments'); # parser diff --git a/templates/webpages/is/_payments_de.html b/templates/webpages/is/_payments_de.html index 0c5b764dd..51dee5189 100644 --- a/templates/webpages/is/_payments_de.html +++ b/templates/webpages/is/_payments_de.html @@ -3,7 +3,7 @@ -[% IF is_credit_note %] +[% IF is_type_credit_note %] [% ELSE %] diff --git a/templates/webpages/is/_payments_master.html b/templates/webpages/is/_payments_master.html index ff60265cc..6cfdb5790 100644 --- a/templates/webpages/is/_payments_master.html +++ b/templates/webpages/is/_payments_master.html @@ -3,7 +3,7 @@
ZahlungsausgängeZahlungseingänge -[% IF is_credit_note %] +[% IF is_type_credit_note %] [% ELSE %] diff --git a/templates/webpages/is/form_footer_de.html b/templates/webpages/is/form_footer_de.html index cc974d56a..6d32a51cf 100644 --- a/templates/webpages/is/form_footer_de.html +++ b/templates/webpages/is/form_footer_de.html @@ -148,7 +148,7 @@ -[% IF id && is_credit_note %] +[% IF id && is_type_credit_note %] [% END %] [% IF show_delete %] diff --git a/templates/webpages/is/form_footer_master.html b/templates/webpages/is/form_footer_master.html index b7548d7ea..8981a17a4 100644 --- a/templates/webpages/is/form_footer_master.html +++ b/templates/webpages/is/form_footer_master.html @@ -148,7 +148,7 @@ -[% IF id && is_credit_note %] +[% IF id && is_type_credit_note %] [% END %] [% IF show_delete %]
PaymentsIncoming Payments