From: Sven Schöling <s.schoeling@linet-services.de> Date: Tue, 27 Oct 2009 12:22:13 +0000 (+0100) Subject: is form_footer: Fixes, Hooks und hiddens. X-Git-Tag: release-2.6.1beta1~113^2~10 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=cb0dfa9a11519db929421ddc704a1f25b6a50668;p=kivitendo-erp.git is form_footer: Fixes, Hooks und hiddens. --- diff --git a/bin/mozilla/is.pl b/bin/mozilla/is.pl index 5dc3b1a1f..5708ac407 100644 --- a/bin/mozilla/is.pl +++ b/bin/mozilla/is.pl @@ -437,14 +437,8 @@ sub form_footer { # format amounts $totalpaid += $form->{"paid_$i"}; - if ($form->{"paid_$i"}) { - $form->{"paid_$i"} = $form->format_amount(\%myconfig, $form->{"paid_$i"}, 2); - } - $form->{"exchangerate_$i"} = $form->format_amount(\%myconfig, $form->{"exchangerate_$i"}); - $form->{"exchangerate_$i"} ||= ""; } - $form->{print_options} = print_options(inline => 1); print $form->parse_html_template('is/form_footer'); diff --git a/templates/webpages/is/_payments_de.html b/templates/webpages/is/_payments_de.html index 048569fd8..0c5b764dd 100644 --- a/templates/webpages/is/_payments_de.html +++ b/templates/webpages/is/_payments_de.html @@ -23,41 +23,44 @@ </tr> -[% paidaccounts %] - [% FOREACH i = paid_indices %] -[% SET row = {} %] - [% SET row.datepaid = 'datepaid_' _ i %] - [% SET row.source = 'source_' _ i %] - [% SET row.memo = 'memo_' _ i %] - [% SET row.paid = 'paid_' _ i %] + [% SET datepaid = 'datepaid_' _ i %] + [% SET source = 'source_' _ i %] + [% SET memo = 'memo_' _ i %] + [% SET paid = 'paid_' _ i %] + [% SET selectAR_paid_ref = 'selectAR_paid_' _ i %] <tr> <td align="center"> - <input id="datepaid_[% i %]" name="datepaid_[% i %]" size="11" title="$myconfig{dateformat}" value="[% row.datepaid %]" onBlur=\"check_right_date_format(this)\"> + <input id="datepaid_[% i %]" name="datepaid_[% i %]" size="11" title="[% dateformat %]" value="[% $datepaid %]"> <input type="button" name="datepaid_[% i %]" id="trigger_datepaid_[% i %]" value="?"> </td> - <td align=center><input name="source_[% i %]" size="11" value="[% row.source %]"></td>|; - <td align="center"><input name="memo_[% i %]" size="11" value="[% row.memo %]"></td>|; - <td align="center"><input name="paid_[% i %]" size="11" value="[% row.paid %]" onBlur=\"check_right_number_format(this)\"></td>|; - <td align="center"> + <td align=center><input name="source_[% i %]" size="11" value="[% $source %]"></td> + <td align="center"><input name="memo_[% i %]" size="11" value="[% $memo %]"></td> + <td align="center"><input name="paid_[% i %]" size="11" value="[% LxERP.format_amount($paid, 2, 1) %]"></td> [% IF show_exchangerate %] + <td align="center"> [% SET row.forex = 'forex_' _ i %] [% SET row.exchangerate = 'exchangerate_' _ i %] [% IF row.forex %] - <input type="hidden" name="exchangerate_[% i %]" value="[% row.exchangerate %]"> - [% row.exchangerate | html %] + <input type="hidden" name="exchangerate_[% i %]" value="[% LxERP.format_amount($exchangerate, 2) %]"> + [% LxERP.format_amount(row.exchangerate, 2) %] [% ELSE %] - <input name="exchangerate_[% i %]" size="10" value="[% row.exchangerate %]"> + <input name="exchangerate_[% i %]" size="10" value="[% LxERP.format_amount($exchangerate, 2, 1) %]"> [% END %] - <input type="hidden" name="forex_[% i %]" value="[% row.forex %]">; -[% END %] + <input type="hidden" name="forex_[% i %]" value="[% $forex %]">; </td> - <td align="center"><select name="AR_paid_$i">$form->{"selectAR_paid_$i"}</select></td>|; +[% END %] + <td align="center"><select name="AR_paid_$i">[% $selectAR_paid_ref %]</select></td> </tr> [%# push(@triggers, "datepaid_$i", "BL", "trigger_datepaid_$i"); %] + <script type='text/javascript'> + Calendar.setup({ inputField : "datepaid_[% i %]", ifFormat :"[% myconfig_jsc_dateformat %]", align : "TR", button : "trigger_datepaid_[% i %]" }); + $('input[name="paid_[% i %]"]').blur(function(){ check_right_number_format(this) }); + $('#datepaid_[% i %]').blur(function(){ check_right_date_format(this) }); + </script> [% END # foreach %] @@ -74,11 +77,11 @@ <td align="center">[% LxERP.format_amount(paid_missing, 2) | html %]</td> </tr> - <input type="hidden" name="paidaccounts" value="[% paidaccounts %]"> - <input type="hidden" name="selectAR_paid" value="[% selectAR_paid %]"> - <input type="hidden" name="oldinvtotal" value="[% rowcount %]"> + <input type="hidden" name="paidaccounts" value="[% paidaccounts %]"> + <input type="hidden" name="selectAR_paid" value="[% selectAR_paid %]"> + <input type="hidden" name="oldinvtotal" value="[% rowcount %]"> - <input type="hidden" name="oldtotalpaid" value="$totalpaid"> + <input type="hidden" name="oldtotalpaid" value="$totalpaid"> </table> </td> diff --git a/templates/webpages/is/_payments_master.html b/templates/webpages/is/_payments_master.html index 0549e2805..ff60265cc 100644 --- a/templates/webpages/is/_payments_master.html +++ b/templates/webpages/is/_payments_master.html @@ -23,41 +23,44 @@ </tr> -[% paidaccounts %] - [% FOREACH i = paid_indices %] -[% SET row = {} %] - [% SET row.datepaid = 'datepaid_' _ i %] - [% SET row.source = 'source_' _ i %] - [% SET row.memo = 'memo_' _ i %] - [% SET row.paid = 'paid_' _ i %] + [% SET datepaid = 'datepaid_' _ i %] + [% SET source = 'source_' _ i %] + [% SET memo = 'memo_' _ i %] + [% SET paid = 'paid_' _ i %] + [% SET selectAR_paid_ref = 'selectAR_paid_' _ i %] <tr> <td align="center"> - <input id="datepaid_[% i %]" name="datepaid_[% i %]" size="11" title="$myconfig{dateformat}" value="[% row.datepaid %]" onBlur=\"check_right_date_format(this)\"> + <input id="datepaid_[% i %]" name="datepaid_[% i %]" size="11" title="[% dateformat %]" value="[% $datepaid %]"> <input type="button" name="datepaid_[% i %]" id="trigger_datepaid_[% i %]" value="?"> </td> - <td align=center><input name="source_[% i %]" size="11" value="[% row.source %]"></td>|; - <td align="center"><input name="memo_[% i %]" size="11" value="[% row.memo %]"></td>|; - <td align="center"><input name="paid_[% i %]" size="11" value="[% row.paid %]" onBlur=\"check_right_number_format(this)\"></td>|; - <td align="center"> + <td align=center><input name="source_[% i %]" size="11" value="[% $source %]"></td> + <td align="center"><input name="memo_[% i %]" size="11" value="[% $memo %]"></td> + <td align="center"><input name="paid_[% i %]" size="11" value="[% LxERP.format_amount($paid, 2, 1) %]"></td> [% IF show_exchangerate %] + <td align="center"> [% SET row.forex = 'forex_' _ i %] [% SET row.exchangerate = 'exchangerate_' _ i %] [% IF row.forex %] - <input type="hidden" name="exchangerate_[% i %]" value="[% row.exchangerate %]"> - [% row.exchangerate | html %] + <input type="hidden" name="exchangerate_[% i %]" value="[% LxERP.format_amount($exchangerate, 2) %]"> + [% LxERP.format_amount(row.exchangerate, 2) %] [% ELSE %] - <input name="exchangerate_[% i %]" size="10" value="[% row.exchangerate %]"> + <input name="exchangerate_[% i %]" size="10" value="[% LxERP.format_amount($exchangerate, 2, 1) %]"> [% END %] - <input type="hidden" name="forex_[% i %]" value="[% row.forex %]">; -[% END %] + <input type="hidden" name="forex_[% i %]" value="[% $forex %]">; </td> - <td align="center"><select name="AR_paid_$i">$form->{"selectAR_paid_$i"}</select></td>|; +[% END %] + <td align="center"><select name="AR_paid_$i">[% $selectAR_paid_ref %]</select></td> </tr> [%# push(@triggers, "datepaid_$i", "BL", "trigger_datepaid_$i"); %] + <script type='text/javascript'> + Calendar.setup({ inputField : "datepaid_[% i %]", ifFormat :"[% myconfig_jsc_dateformat %]", align : "TR", button : "trigger_datepaid_[% i %]" }); + $('input[name="paid_[% i %]"]').blur(function(){ check_right_number_format(this) }); + $('#datepaid_[% i %]').blur(function(){ check_right_date_format(this) }); + </script> [% END # foreach %] @@ -74,11 +77,11 @@ <td align="center">[% LxERP.format_amount(paid_missing, 2) | html %]</td> </tr> - <input type="hidden" name="paidaccounts" value="[% paidaccounts %]"> - <input type="hidden" name="selectAR_paid" value="[% selectAR_paid %]"> - <input type="hidden" name="oldinvtotal" value="[% rowcount %]"> + <input type="hidden" name="paidaccounts" value="[% paidaccounts %]"> + <input type="hidden" name="selectAR_paid" value="[% selectAR_paid %]"> + <input type="hidden" name="oldinvtotal" value="[% rowcount %]"> - <input type="hidden" name="oldtotalpaid" value="$totalpaid"> + <input type="hidden" name="oldtotalpaid" value="$totalpaid"> </table> </td>