X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Fcp.pl;h=5a1d2e3bc7f91257f303d6e6b66b70f9b1a2e95a;hb=637be9d46084bc19a08b91bc13ae541a6c36f9ef;hp=314b329418c552208ef546cd86169a6d4d4d96c6;hpb=d319704a66e9be64da837ccea10af6774c2b0838;p=kivitendo-erp.git diff --git a/bin/mozilla/cp.pl b/bin/mozilla/cp.pl index 314b32941..5a1d2e3bc 100644 --- a/bin/mozilla/cp.pl +++ b/bin/mozilla/cp.pl @@ -37,6 +37,7 @@ use SL::IS; use SL::IR; require "$form->{path}/arap.pl"; +require "bin/mozilla/common.pl"; 1; @@ -87,7 +88,7 @@ sub payment { } @{ $form->{PR}{ $form->{ARAP} } }; # currencies - @curr = split /:/, $form->{currencies}; + @curr = split(/:/, $form->{currencies}); chomp $curr[0]; $form->{defaultcurrency} = $form->{currency} = $form->{oldcurrency} = $curr[0]; @@ -183,29 +184,29 @@ sub form_header { # with JavaScript Calendar $button1 = qq| - + text('button') - . qq|> + . $locale->text('button') . qq|> |; #write Trigger $jsscript = - Form->write_trigger(\%myconfig, "1", "datepaid", "BL", "trigger1", "", - "", ""); + Form->write_trigger(\%myconfig, "1", "datepaid", "BL", "trigger1"); } else { # without JavaScript Calendar $button1 = qq| - |; + |; } - + $form->{javascript} .= qq||; $form->header; $arap = lc $form->{ARAP}; - + $onload = qq|focus()|; + $onload .= qq|;setupDateFormat('|. $myconfig{dateformat} .qq|', '|. $locale->text("Falsches Datumsformat!") .qq|')|; + $onload .= qq|;setupPoints('|. $myconfig{numberformat} .qq|', '|. $locale->text("wrongformat") .qq|')|; print qq| - +
{script}> @@ -307,8 +308,7 @@ sub form_header { | . $locale->text('Amount') . qq| format_amount(\%myconfig, $form->{amount}, 2) - . qq|> + . $form->format_amount(\%myconfig, $form->{amount}, 2) . qq| onBlur=\"check_right_number_format(this)\"> @@ -316,7 +316,7 @@ sub form_header { - + $jsscript |; @@ -366,7 +366,8 @@ sub list_invoices { for $i (1 .. $form->{rowcount}) { map { - $form->{"${_}_$i"} = $form->parse_amount(\%myconfig, $form->{"${_}_$i"}) + $form->{"${_}_$i"} = + $form->parse_amount(\%myconfig, $form->{"${_}_$i"}) } qw(amount due paid); $totalamount += $form->{"amount_$i"}; @@ -445,12 +446,12 @@ sub form_footer { $media = qq|
@@ -605,11 +599,15 @@ sub update { } # recalculate - $amount = $form->{amount}; + + # Modified from $amount = $form->{amount} by J.Zach to update amount to total + # payment amount in Zahlungsausgang + $amount = 0; for $i (1 .. $form->{rowcount}) { map { - $form->{"${_}_$i"} = $form->parse_amount(\%myconfig, $form->{"${_}_$i"}) + $form->{"${_}_$i"} = + $form->parse_amount(\%myconfig, $form->{"${_}_$i"}) } qw(amount due paid); if ($form->{"checked_$i"}) { @@ -619,7 +617,9 @@ sub update { $form->{"paid_$i"} = $form->{"due_$i"}; } - $amount -= $form->{"paid_$i"}; + # Modified by J.Zach, see abovev + $amount += $form->{"paid_$i"}; + } else { $form->{"paid_$i"} = ""; } @@ -631,6 +631,9 @@ sub update { } + # Line added by J.Zach, see above + $form->{amount}=$amount; + &form_header; &list_invoices; &form_footer; @@ -668,7 +671,7 @@ sub print { &check_form; - ($whole, $form->{decimal}) = split /\./, $form->{amount}; + ($whole, $form->{decimal}) = split(/\./, $form->{amount}); $form->{amount} = $form->format_amount(\%myconfig, $form->{amount}, 2); @@ -679,7 +682,7 @@ sub print { $check->init; $form->{text_amount} = $check->num2text($whole); - &{"$form->{vc}_details"}; + call_sub("$form->{vc}_details"); $form->{callback} = ""; @@ -717,10 +720,6 @@ sub print { $form->{company} = $myconfig{company}; $form->{address} = $myconfig{address}; - @a = - qw(name invnumber company address text_amount street zipcode city country memo); - $form->format_string(@a); - $form->parse_template(\%myconfig, $userspath); if ($form->{media} ne 'screen') { @@ -759,7 +758,7 @@ sub check_form { $form->{amount} = $amount; for $i (1 .. $form->{rowcount}) { - if ($form->{"paid_$i"}) { + if ($form->parse_amount(\%myconfig, $form->{"paid_$i"})) { $amount -= $form->parse_amount($myconfig, $form->{"paid_$i"}); push(@{ $form->{paid} }, $form->{"paid_$i"}); @@ -781,4 +780,3 @@ sub check_form { $lxdebug->leave_sub(); } -