X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;ds=inline;f=bin%2Fmozilla%2Fcp.pl;h=9b77e5766b1a7b8f273429fbb7bcb36d65c67dbf;hb=5c8a0b36440e012cd0a54e6b68eb3d1411243b1a;hp=721a4a8cf9d1b95697ef3bc718fb8807120bfa92;hpb=1e7d8e31721d592284644da88b3f03ccce98d10c;p=kivitendo-erp.git
diff --git a/bin/mozilla/cp.pl b/bin/mozilla/cp.pl
index 721a4a8cf..9b77e5766 100644
--- a/bin/mozilla/cp.pl
+++ b/bin/mozilla/cp.pl
@@ -24,7 +24,8 @@
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
-# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+# MA 02110-1335, USA.
#======================================================================
#
# Payment module
@@ -36,10 +37,11 @@ use SL::IS;
use SL::IR;
use SL::AR;
use SL::AP;
-use strict ("vars", "subs");
+use Data::Dumper;
+use SL::Locale::String qw(t8);
+use strict;
#use warnings;
-require "bin/mozilla/arap.pl";
require "bin/mozilla/common.pl";
our ($form, %myconfig, $lxdebug, $locale, $auth);
@@ -58,42 +60,20 @@ sub payment {
$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);
- }
-
- $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}"} .= "\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;
@@ -118,366 +99,75 @@ 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);
+ $::request->layout->add_javascripts("kivi.CustomerVendor.js");
- 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 ($arap, $exchangerate);
- if ($form->{ $form->{vc} } eq "") {
+ if (!$form->{ $form->{vc} . '_id' }) {
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}> |
-
-|;
- }
- }
- foreach my $item ($form->{vc}, "account", "currency", $form->{ARAP}) {
+ # bugfix 1771
+ # geändert von
+ # offen: $form->{ARAP} kann raus?
+ for my $item ("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 =
- ($form->{"select$form->{vc}"})
- ? qq||
- : qq|{vc} size=35 value="$form->{$form->{vc}}">|;
-
- if ($form->{all_vc}) {
- $allvc = "checked";
- $form->{openinvoices} = "";
- } else {
- $allvc = "";
- $form->{openinvoices} = 1;
- }
+ $form->{openinvoices} = 1;
# $locale->text('AR')
# $locale->text('AP')
- $form->{jsscript} = 1;
- $jsscript = "";
- if ($form->{jsscript}) {
+ setup_cp_form_action_bar(can_post => !!$form->{rowcount});
- # 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|
-
-
-
+ $::lxdebug->enter_sub;
+ $::auth->assert('cash');
-
-