X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;ds=inline;f=bin%2Fmozilla%2Fcp.pl;h=6060253928121bea6f758606de0b24ff9692be3a;hb=4d261fb7ccec8e5db782c73623dfd7beba6d7e83;hp=ee49181315eeb0f763f6e217f2e5e8faab84f2d2;hpb=4275966729691b3ae94efeeee829fa24cbf85e93;p=kivitendo-erp.git
diff --git a/bin/mozilla/cp.pl b/bin/mozilla/cp.pl
index ee4918131..606025392 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,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;
@@ -122,41 +103,40 @@ sub form_header {
$auth->assert('cash');
- my ($vc, $arap, $exchangerate);
- my ($onload);
+ $::request->layout->add_javascripts("autocomplete_customer.js");
+
+ my ($arap, $exchangerate);
- if ($form->{ $form->{vc} } eq "") {
+ if (!$form->{ $form->{vc} . '_id' }) {
map { $form->{"addr$_"} = "" } (1 .. 4);
}
- for 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}}">|;
-
- $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;
@@ -195,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";
@@ -205,105 +183,64 @@ 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}"} .=
- "