X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;ds=sidebyside;f=bin%2Fmozilla%2Fcp.pl;h=888bf8a9f5669de2fdec483f375780eeb5c071d7;hb=505322c4b9b99beb3c0f1246edbfc54ff3a36790;hp=b3efdec57d25e0cac2dcd1763300ddb455a32f17;hpb=526095511932c413bb012aac5d6092bdb1d14c3c;p=kivitendo-erp.git
diff --git a/bin/mozilla/cp.pl b/bin/mozilla/cp.pl
index b3efdec57..888bf8a9f 100644
--- a/bin/mozilla/cp.pl
+++ b/bin/mozilla/cp.pl
@@ -36,7 +36,8 @@ use SL::IS;
use SL::IR;
use SL::AR;
use SL::AP;
-use strict ("vars", "subs");
+use Data::Dumper;
+use strict;
#use warnings;
require "bin/mozilla/arap.pl";
@@ -66,27 +67,39 @@ sub payment {
} else {
CP->get_openvc(\%myconfig, \%$form);
}
-
+ # Auswahlliste für vc zusammenbauen
+ # Erweiterung für schliessende option und erweiterung um value
+ # für bugfix 1771 (doppelte Leerzeichen werden nicht 'gepostet')
$form->{"select$form->{vc}"} = "";
if ($form->{"all_$form->{vc}"}) {
+ $form->{"select$form->{vc}"} .= "\n";
# s.o. jb 12.10.2010
$form->{"$form->{vc}_id"} = $form->{"all_$form->{vc}"}->[0]->{id};
- map { $form->{"select$form->{vc}"} .= "\n" }
@{ $form->{"all_$form->{vc}"} };
}
-
CP->paymentaccounts(\%myconfig, \%$form);
+ # Standard Konto für Umlaufvermögen
+ my $accno_arap = IS->get_standard_accno_current_assets(\%myconfig, \%$form);
+ # Entsprechend präventiv die Auswahlliste für Kontonummer
+ # auch mit value= zusammenbauen (s.a. oben bugfix 1771)
+ # Wichtig: Auch das Template anpassen, damit hidden input korrekt die "
+ # escaped.
$form->{selectaccount} = "";
$form->{"select$form->{ARAP}"} = "";
- map { $form->{selectaccount} .= "\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}"} .=
+ # "\n" } @curr;
&form_header;
@@ -112,55 +126,31 @@ sub payment {
}
sub form_header {
- $lxdebug->enter_sub();
+ $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);
-
- if ($form->{type} eq 'receipt') {
- $form->{title} = $locale->text('Receipt');
- $form->{origtitle} = "Receipt";
- }
- if ($form->{type} eq 'check') {
- $form->{title} = $locale->text('Payment');
- $form->{origtitle} = "Payment";
- }
-
- # $locale->text('Customer')
- # $locale->text('Vendor')
+ my ($vc, $arap, $exchangerate);
if ($form->{ $form->{vc} } eq "") {
map { $form->{"addr$_"} = "" } (1 .. 4);
}
- if ($form->{currency} ne $form->{defaultcurrency}) {
- $form->{exchangerate} =
- $form->format_amount(\%myconfig, $form->{exchangerate});
- if ($form->{forex}) {
- $exchangerate = qq|
-
- | . $locale->text('Exchangerate') . qq| |
- {exchangerate}>$form->{exchangerate} |
-
-|;
- } else {
- $exchangerate = qq|
-
- | . $locale->text('Exchangerate') . qq| |
- {exchangerate}> |
-
-|;
- }
+ # sometimes it happens that values in customer arrive without the signs '--'
+ # but in order to select the right option field we need values with '--'
+ if ($form->{vc} eq "customer" && $form->{"all_$form->{vc}"}){
+ my ($customername) = split /--/, $form->{ $form->{vc} };
+ $form->{ $form->{vc} } = $customername . "--" . $form->{customer_id};
}
- foreach my $item ($form->{vc}, "account", "currency", $form->{ARAP}) {
+ # bugfix 1771
+ # geändert von
+ # offen: $form->{ARAP} kann raus?
+ for my $item ($form->{vc}, "account", "currency", $form->{ARAP}) {
+ $form->{$item} = H($form->{$item});
$form->{"select$item"} =~ s/ selected//;
- $form->{"select$item"} =~
- s/option>\Q$form->{$item}\E/option selected>$form->{$item}/;
+ $form->{"select$item"} =~ s/option value="\Q$form->{$item}\E">\Q$form->{$item}\E/option selected value="$form->{$item}">$form->{$item}/;
}
$vc =
@@ -168,310 +158,51 @@ sub form_header {
? qq||
: qq|{vc} size=35 value="$form->{$form->{vc}}">|;
- if ($form->{all_vc}) {
- $allvc = "checked";
- $form->{openinvoices} = "";
- } else {
- $allvc = "";
- $form->{openinvoices} = 1;
- }
+ $form->{openinvoices} = $form->{all_vc} ? "" : 1;
# $locale->text('AR')
# $locale->text('AP')
- $form->{jsscript} = 1;
- $jsscript = "";
- if ($form->{jsscript}) {
-
- # with JavaScript Calendar
- $button1 = qq|
-
- text('button') . qq|> |
- |;
-
- #write Trigger
- $jsscript =
- 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|
-
-
-
-
-
-