X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;ds=inline;f=bin%2Fmozilla%2Fcp.pl;h=721a4a8cf9d1b95697ef3bc718fb8807120bfa92;hb=27ffa16a85221662dee49da0f210312383341240;hp=6a21edecbbf1990eed7f7a3320ebeb7d85702136;hpb=6607a7145fc56b322e1c24afd07f72f085a25465;p=kivitendo-erp.git diff --git a/bin/mozilla/cp.pl b/bin/mozilla/cp.pl index 6a21edecb..721a4a8cf 100644 --- a/bin/mozilla/cp.pl +++ b/bin/mozilla/cp.pl @@ -32,10 +32,10 @@ #====================================================================== use SL::CP; -use SL::OP; use SL::IS; use SL::IR; - +use SL::AR; +use SL::AP; use strict ("vars", "subs"); #use warnings; @@ -60,6 +60,8 @@ sub payment { # 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); @@ -68,35 +70,38 @@ 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); + # Standard Konto für Umlaufvermögen + my $accno_arap = IS->get_standard_accno_current_assets(\%myconfig, \%$form); + $form->{selectaccount} = ""; $form->{"select$form->{ARAP}"} = ""; - map { $form->{selectaccount} .= "$_->{accno}--$_->{description}\n" } - @{ $form->{PR}{"$form->{ARAP}_paid"} }; - map { - $form->{"select$form->{ARAP}"} .= - "$_->{accno}--$_->{description}\n" - } @{ $form->{PR}{ $form->{ARAP} } }; + map { $form->{selectaccount} .= "$_->{accno}--$_->{description}\n"; + $form->{account} = "$_->{accno}--$_->{description}" if ($_->{accno} eq $accno_arap) } @{ $form->{PR}{"$form->{ARAP}_paid"} }; + + # Braucht man das hier überhaupt? Erstmal auskommentieren .. jan 18.12.2010 + # map { + # $form->{"select$form->{ARAP}"} .= + # "$_->{accno}--$_->{description}\n" + # } @{ $form->{PR}{ $form->{ARAP} } }; + # ENDE LOESCHMICH in 2012 # 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} = @@ -105,7 +110,6 @@ sub payment { $form->{selectcurrency} = ""; map { $form->{selectcurrency} .= "$_\n" } @curr; - $form->{media} = "screen"; &form_header; &form_footer; @@ -118,7 +122,7 @@ sub form_header { $auth->assert('cash'); - my ($vc, $vclabel, $allvc, $arap, $department, $exchangerate); + my ($vc, $vclabel, $allvc, $arap, $exchangerate); my ($jsscript, $button1, $button2, $onload); $vclabel = ucfirst $form->{vc}; @@ -145,22 +149,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 my $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}/; @@ -235,82 +238,78 @@ 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('Account') . qq| - $form->{selectaccount} - - - - - | . $locale->text('Date') . qq| + + + + $vclabel + $vc + {vc}"}) . qq|"> + {vc}_id"}) . qq|"> + {vc}"}) . qq|"> + + + | . $locale->text('Invoice Number') . 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| - - - - - + + + | . $locale->text('Currency') . qq| + $form->{selectcurrency} + + {oldcurrency}> + + $exchangerate + + | . $locale->text('Source') . qq| + + + + | . $locale->text('Amount') . qq| + | . $form->format_amount(\%myconfig, $form->{amount}, 2) . qq| + + + + @@ -318,6 +317,19 @@ 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(); } @@ -340,9 +352,9 @@ sub list_invoices { - - $invoice - + + $invoice + |; $column_data{invnumber} = @@ -405,7 +417,7 @@ sub list_invoices { $j++; $j %= 2; print qq| - + |; map { print "$column_data{$_}\n" } @column_index; print qq| @@ -447,28 +459,6 @@ sub form_footer { $auth->assert('cash'); - my ($media, $format, $latex_templates); - - $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'); - } - print qq| @@ -480,19 +470,8 @@ sub form_footer { |; - - if ($latex_templates) { - print qq| -|; - } - - print qq| -$format -$media - - + . $locale->text('Post') . qq|"> +