X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Fcp.pl;h=9b77e5766b1a7b8f273429fbb7bcb36d65c67dbf;hb=22f2c3e86aeea63b9e25b6ba249ca9062ae337f8;hp=1f061ad8e6c44bad3a660e10471c9882fa0176bc;hpb=6c27e6e48268d1a70e581d75f97446007bbedc68;p=kivitendo-erp.git
diff --git a/bin/mozilla/cp.pl b/bin/mozilla/cp.pl
index 1f061ad8e..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 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,31 +60,11 @@ 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);
- }
- # 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}"}) {
- # 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
+ # 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.
@@ -92,13 +74,6 @@ sub payment {
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;
@@ -129,45 +103,40 @@ sub form_header {
$auth->assert('cash');
- my ($vc, $arap, $exchangerate);
- my ($onload);
+ $::request->layout->add_javascripts("kivi.CustomerVendor.js");
- if ($form->{ $form->{vc} } eq "") {
+ my ($arap, $exchangerate);
+
+ if (!$form->{ $form->{vc} . '_id' }) {
map { $form->{"addr$_"} = "" } (1 .. 4);
}
+
# bugfix 1771
# geändert von
# offen: $form->{ARAP} kann raus?
- for my $item ($form->{vc}, "account", "currency", $form->{ARAP}) {
+ for my $item ("account", "currency", $form->{ARAP}) {
+ $form->{$item} = H($form->{$item});
$form->{"select$item"} =~ s/ selected//;
$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}}">|;
-
- $form->{openinvoices} = $form->{all_vc} ? "" : 1;
+ $form->{openinvoices} = 1;
# $locale->text('AR')
# $locale->text('AP')
+ setup_cp_form_action_bar(can_post => !!$form->{rowcount});
+
$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 $::form->parse_html_template('cp/form_header', {
is_customer => $form->{vc} eq 'customer',
is_receipt => $form->{type} eq 'receipt',
- onload => $onload,
arap => $arap,
- vccontent => $vc,
});
$lxdebug->leave_sub;
@@ -206,9 +175,7 @@ sub update {
$auth->assert('cash');
- my ($new_name_selected) = @_;
-
- my ($buysell, $newvc, $updated, $exchangerate, $amount);
+ my ($buysell, $updated, $exchangerate, $amount);
if ($form->{vc} eq 'customer') {
$buysell = "buy";
@@ -216,51 +183,13 @@ sub update {
$buysell = "sell";
}
- # if we switched to all_vc
- # funktioniert derzeit nicht 12.10.2010 jb
- if ($form->{all_vc} ne $form->{oldall_vc}) {
-
- $form->{openinvoices} = ($form->{all_vc}) ? 0 : 1;
-
- $form->{"select$form->{vc}"} = "";
-
- if ($form->{all_vc}) {
- $form->all_vc(\%myconfig, $form->{vc}, $form->{ARAP});
-
- if ($form->{"all_$form->{vc}"}) {
- map {
- $form->{"select$form->{vc}"} .=
- "