X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;ds=inline;f=bin%2Fmozilla%2Fcp.pl;h=6060253928121bea6f758606de0b24ff9692be3a;hb=4d261fb7ccec8e5db782c73623dfd7beba6d7e83;hp=49c7daea8e239b6cdb7962e7d53b58cdddf728c2;hpb=6354fe293411247831445f5eb9507409ad5f8e79;p=kivitendo-erp.git diff --git a/bin/mozilla/cp.pl b/bin/mozilla/cp.pl index 49c7daea8..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 @@ -34,10 +35,13 @@ use SL::CP; use SL::IS; use SL::IR; -use strict ("vars", "subs"); +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); @@ -56,54 +60,37 @@ 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}) { - $form->all_vc(\%myconfig, $form->{vc}, $form->{ARAP}); - } else { - CP->get_openvc(\%myconfig, \%$form); - } - - $form->{"select$form->{vc}"} = ""; - - if ($form->{"all_$form->{vc}"}) { - $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"} }; # currencies - @curr = split(/:/, $form->{currencies}); - chomp $curr[0]; + # oldcurrency ist zwar noch hier als fragment enthalten, wird aber bei + # der aktualisierung der form auch nicht mitübernommen. das konzept + # old_$FOO habe ich auch noch nicht verstanden ... + # Ok. Wenn currency übernommen werden, dann in callback-string über- + # geben und hier reinparsen, oder besser multibox oder html auslagern? + # Antwort: form->currency wird mit oldcurrency oder curr[0] überschrieben + # Wofür macht das Sinn? + @curr = $form->get_all_currencies(); $form->{defaultcurrency} = $form->{currency} = $form->{oldcurrency} = - $curr[0]; + $form->get_default_currency(\%myconfig); + # Entsprechend präventiv die Auswahlliste für Währungen + # auch mit value= zusammenbauen (s.a. oben bugfix 1771) $form->{selectcurrency} = ""; - map { $form->{selectcurrency} .= "\n" } @curr; - $form->{media} = "screen"; &form_header; &form_footer; @@ -112,397 +99,75 @@ sub payment { } sub form_header { - $lxdebug->enter_sub(); + $lxdebug->enter_sub; $auth->assert('cash'); - my ($vc, $vclabel, $allvc, $arap, $department, $exchangerate); - my ($jsscript, $button1, $button2, $onload); - - $vclabel = ucfirst $form->{vc}; - $vclabel = $locale->text($vclabel); + $::request->layout->add_javascripts("autocomplete_customer.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"; - } + my ($arap, $exchangerate); - # $locale->text('Customer') - # $locale->text('Vendor') - - 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| -