X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;ds=sidebyside;f=bin%2Fmozilla%2Fcp.pl;h=d54137e72cc84125ae5ff798fb7024b7c87347f5;hb=7f683e50d6d550b307a1c97d071e894889039ff0;hp=c7b85c60a25079c7581b8a4d3d7f13b973a97792;hpb=8482e69b2e36af353705a84e4465668f7431dddf;p=kivitendo-erp.git diff --git a/bin/mozilla/cp.pl b/bin/mozilla/cp.pl index c7b85c60a..d54137e72 100644 --- a/bin/mozilla/cp.pl +++ b/bin/mozilla/cp.pl @@ -32,13 +32,16 @@ #====================================================================== use SL::CP; -use SL::OP; use SL::IS; use SL::IR; +use strict ("vars", "subs"); +#use warnings; require "bin/mozilla/arap.pl"; require "bin/mozilla/common.pl"; +our ($form, %myconfig, $lxdebug, $locale, $auth); + 1; # end of main @@ -46,11 +49,17 @@ require "bin/mozilla/common.pl"; sub payment { $lxdebug->enter_sub(); + $auth->assert('cash'); + + my (@curr); + $form->{ARAP} = ($form->{type} eq 'receipt') ? "AR" : "AP"; $form->{arap} = lc $form->{ARAP}; # setup customer/vendor selection for open invoices if ($form->{all_vc}) { + # Dieser Zweig funktioniert derzeit NIE. Ggf. ganz raus oder + # alle offenen Zahlungen wieder korrekt anzeigen. jb 12.10.2010 $form->all_vc(\%myconfig, $form->{vc}, $form->{ARAP}); } else { CP->get_openvc(\%myconfig, \%$form); @@ -59,22 +68,12 @@ sub payment { $form->{"select$form->{vc}"} = ""; if ($form->{"all_$form->{vc}"}) { + # s.o. jb 12.10.2010 $form->{"$form->{vc}_id"} = $form->{"all_$form->{vc}"}->[0]->{id}; map { $form->{"select$form->{vc}"} .= "$_->{name}--$_->{id}\n" } @{ $form->{"all_$form->{vc}"} }; } - # departments - if (@{ $form->{all_departments} }) { - $form->{selectdepartment} = "\n"; - $form->{department} = "$form->{department}--$form->{department_id}"; - - map { - $form->{selectdepartment} .= - "$_->{description}--$_->{id}\n" - } (@{ $form->{all_departments} }); - } - CP->paymentaccounts(\%myconfig, \%$form); $form->{selectaccount} = ""; @@ -88,6 +87,13 @@ sub payment { } @{ $form->{PR}{ $form->{ARAP} } }; # currencies + # oldcurrency ist zwar noch hier als fragment enthalten, wird aber bei + # der aktualisierung der form auch nicht mitübernommen. das konzept + # old_$FOO habe ich auch noch nicht verstanden ... + # Ok. Wenn currency übernommen werden, dann in callback-string über- + # geben und hier reinparsen, oder besser multibox oder html auslagern? + # Antwort: form->currency wird mit oldcurrency oder curr[0] überschrieben + # Wofür macht das Sinn? @curr = split(/:/, $form->{currencies}); chomp $curr[0]; $form->{defaultcurrency} = $form->{currency} = $form->{oldcurrency} = @@ -96,7 +102,6 @@ sub payment { $form->{selectcurrency} = ""; map { $form->{selectcurrency} .= "$_\n" } @curr; - $form->{media} = "screen"; &form_header; &form_footer; @@ -107,6 +112,11 @@ sub payment { sub form_header { $lxdebug->enter_sub(); + $auth->assert('cash'); + + my ($vc, $vclabel, $allvc, $arap, $exchangerate); + my ($jsscript, $button1, $button2, $onload); + $vclabel = ucfirst $form->{vc}; $vclabel = $locale->text($vclabel); @@ -131,22 +141,21 @@ sub form_header { $form->format_amount(\%myconfig, $form->{exchangerate}); if ($form->{forex}) { $exchangerate = qq| - - | . $locale->text('Exchangerate') . qq| - {exchangerate}>$form->{exchangerate} - + + | . $locale->text('Exchangerate') . qq| + {exchangerate}>$form->{exchangerate} + |; } else { $exchangerate = qq| - - | . $locale->text('Exchangerate') . qq| - {exchangerate}> - + + | . $locale->text('Exchangerate') . qq| + {exchangerate}> + |; } } - - foreach $item ($form->{vc}, account, currency, $form->{ARAP}, department) { + foreach my $item ($form->{vc}, "account", "currency", $form->{ARAP}) { $form->{"select$item"} =~ s/ selected//; $form->{"select$item"} =~ s/option>\Q$form->{$item}\E/option selected>$form->{$item}/; @@ -168,17 +177,7 @@ sub form_header { # $locale->text('AR') # $locale->text('AP') - $department = qq| - - | . $locale->text('Department') . qq| - $form->{selectdepartment} - - - - -| if $form->{selectdepartment}; - - $form->{jsscript} = $jscalendar; + $form->{jsscript} = 1; $jsscript = ""; if ($form->{jsscript}) { @@ -208,7 +207,7 @@ sub form_header { print qq| -{script}> + {defaultcurrency}> {closedto}> @@ -231,88 +230,74 @@ sub form_header { - - - - - - - | . $locale->text('All') . qq| - - - $vclabel - $vc - {vc}"}"> - {"$form->{vc}_id"}> - {vc}"}"> - - - | . $locale->text('Address') . qq| - - - - $form->{street} - - - $form->{zipcode} - - - $form->{city} - - - $form->{country} - - - - - - - - - - | . $locale->text('Memo') . qq| - - - - - - - $department - - | . $locale->text($form->{ARAP}) . qq| - {ARAP}>$form->{"select$form->{ARAP}"} - - {ARAP}"}"> - - - | . $locale->text('Account') . qq| - $form->{selectaccount} - - - - - | . $locale->text('Date') . qq| + + + + $vclabel + $vc + {vc}"}) . qq|"> + {vc}_id"}) . qq|"> + {vc}"}) . qq|"> + + + | . $locale->text('Address') . qq| + + + + $form->{street} + + + $form->{zipcode} + + + $form->{city} + + + $form->{country} + + + + + + + + + + | . $locale->text('Memo') . qq| + + + + + + + + | . $locale->text('Account') . qq| + $form->{selectaccount} + + + + + | . $locale->text('Date') . qq| $button1 - - - | . $locale->text('Currency') . qq| - $form->{selectcurrency} - - {oldcurrency}> - - $exchangerate - - | . $locale->text('Source') . qq| - - - - | . $locale->text('Amount') . qq| - format_amount(\%myconfig, $form->{amount}, 2) . qq| onBlur=\"check_right_number_format(this)\"> - - - - + + + | . $locale->text('Currency') . qq| + $form->{selectcurrency} + + {oldcurrency}> + + $exchangerate + + | . $locale->text('Source') . qq| + + + + | . $locale->text('Amount') . qq| + | . $form->format_amount(\%myconfig, $form->{amount}, 2) . qq| + + + + @@ -320,12 +305,30 @@ sub form_header { $jsscript |; + if ($form->{openinvoices_other_currencies}) { + my $warning = $form->{vc} eq 'customer' ? $::locale->text('There are #1 more open invoices for this customer with other currencies.', $form->{openinvoices_other_currencies}) + : $::locale->text('There are #1 more open invoices from this vendor with other currencies.', $form->{openinvoices_other_currencies}); + + print qq| + + + + | . $::locale->text('Note') . qq|: $warning + +|; + } + $lxdebug->leave_sub(); } sub list_invoices { $lxdebug->enter_sub(); + $auth->assert('cash'); + + my (@column_index, %column_data, $colspan, $invoice); + my ($totalamount, $totaldue, $totalpaid); + @column_index = qw(invnumber transdate amount due checked paid); $colspan = $#column_index + 1; @@ -337,9 +340,9 @@ sub list_invoices { - - $invoice - + + $invoice + |; $column_data{invnumber} = @@ -363,7 +366,9 @@ sub list_invoices { |; - for $i (1 .. $form->{rowcount}) { + for my $i (1 .. $form->{rowcount}) { + + my $j = 0; map { $form->{"${_}_$i"} = @@ -400,7 +405,7 @@ sub list_invoices { $j++; $j %= 2; print qq| - + |; map { print "$column_data{$_}\n" } @column_index; print qq| @@ -440,25 +445,7 @@ sub list_invoices { sub form_footer { $lxdebug->enter_sub(); - $form->{DF}{ $form->{format} } = "selected"; - $form->{OP}{ $form->{media} } = "selected"; - - $media = qq| - {OP}{screen}>| . $locale->text('Screen'); - - if ($myconfig{printer} && $latex_templates) { - $media .= qq| - {OP}{printer}>| - . $locale->text('Printer'); - } - if ($latex_templates) { - $media .= qq| - {OP}{queue}>| . $locale->text('Queue'); - $format .= qq| - {DF}{postscript}>| - . $locale->text('Postscript') . qq| - {DF}{pdf}>| . $locale->text('PDF'); - } + $auth->assert('cash'); print qq| @@ -467,26 +454,12 @@ sub form_footer { {rowcount}> -{login}> -{password}> - |; - - if ($latex_templates) { - print qq| -|; - } - - print qq| -$format -$media - - + . $locale->text('Post') . qq|"> +