X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;ds=inline;f=bin%2Fmozilla%2Fcp.pl;h=9b77e5766b1a7b8f273429fbb7bcb36d65c67dbf;hb=3c22e5f4b953f463a33b722d6f4f122e4a20c99a;hp=f4a9efb20eeb337b2185ee27672a372d3a5c7770;hpb=805ec79a9335179b0a3831874e606791ff027810;p=kivitendo-erp.git diff --git a/bin/mozilla/cp.pl b/bin/mozilla/cp.pl index f4a9efb20..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 @@ -34,11 +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); @@ -57,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; @@ -113,404 +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); - - 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"; - } + $::request->layout->add_javascripts("kivi.CustomerVendor.js"); - # $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| -