X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Fcp.pl;h=888bf8a9f5669de2fdec483f375780eeb5c071d7;hb=505322c4b9b99beb3c0f1246edbfc54ff3a36790;hp=ad646b1f1b1566fac53dbe3e88365de360770eb4;hpb=d1c335e9bb0a35d45acd03b29d1e759f26c5664c;p=kivitendo-erp.git
diff --git a/bin/mozilla/cp.pl b/bin/mozilla/cp.pl
index ad646b1f1..888bf8a9f 100644
--- a/bin/mozilla/cp.pl
+++ b/bin/mozilla/cp.pl
@@ -32,11 +32,18 @@
#======================================================================
use SL::CP;
-use SL::OP;
use SL::IS;
use SL::IR;
+use SL::AR;
+use SL::AP;
+use Data::Dumper;
+use strict;
+#use warnings;
-require "$form->{path}/arap.pl";
+require "bin/mozilla/arap.pl";
+require "bin/mozilla/common.pl";
+
+our ($form, %myconfig, $lxdebug, $locale, $auth);
1;
@@ -45,57 +52,72 @@ require "$form->{path}/arap.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);
}
-
+ # 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}"} };
}
-
- # departments
- if (@{ $form->{all_departments} }) {
- $form->{selectdepartment} = "\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->{media} = "screen";
&form_header;
&form_footer;
@@ -104,51 +126,31 @@ sub payment {
}
sub form_header {
- $lxdebug->enter_sub();
+ $lxdebug->enter_sub;
- $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";
- }
+ $auth->assert('cash');
- # $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 $item ($form->{vc}, account, currency, $form->{ARAP}, department) {
+ # 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 =
@@ -156,355 +158,62 @@ 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')
- $department = qq|
-
- | . $locale->text('Department') . qq| |
-
-
-
- |
-
-| if $form->{selectdepartment};
-
- $form->{jsscript} = $jscalendar;
- $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->header;
$arap = lc $form->{ARAP};
- print qq|
-
-
-
+ $::lxdebug->enter_sub;
+ $::auth->assert('cash');
-
-