X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/aa63ebae1c0a758ec438c594acb328b1f0e5e001..caaa17becdae3615d24ae3e36f70eebe0ede2362:/bin/mozilla/cp.pl diff --git a/bin/mozilla/cp.pl b/bin/mozilla/cp.pl index 2bc2c1aa9..9b77e5766 100644 --- a/bin/mozilla/cp.pl +++ b/bin/mozilla/cp.pl @@ -38,6 +38,7 @@ use SL::IR; use SL::AR; use SL::AP; use Data::Dumper; +use SL::Locale::String qw(t8); use strict; #use warnings; @@ -102,7 +103,7 @@ sub form_header { $auth->assert('cash'); - $::request->layout->add_javascripts("autocomplete_customer.js"); + $::request->layout->add_javascripts("kivi.CustomerVendor.js"); my ($arap, $exchangerate); @@ -126,6 +127,8 @@ sub form_header { # $locale->text('AR') # $locale->text('AP') + setup_cp_form_action_bar(can_post => !!$form->{rowcount}); + $form->header; $arap = lc $form->{ARAP}; @@ -252,8 +255,6 @@ sub update { $form->{"amount_$i"} = $ref->{amount} / $ref->{exchangerate}; $form->{"due_$i"} = ($ref->{amount} - $ref->{paid}) / $ref->{exchangerate}; - $form->{"checked_$i"} = ""; - $form->{"paid_$i"} = ""; # need to format map { @@ -396,3 +397,21 @@ sub check_form { $lxdebug->leave_sub(); } + +sub setup_cp_form_action_bar { + my (%params) = @_; + + for my $bar ($::request->layout->get('actionbar')) { + $bar->add( + action => [ + t8('Update'), + submit => [ '#form', { action => "update" } ], + accesskey => 'enter', + ], + action => [ + t8('Post'), + submit => [ '#form', { action => "post" } ], + ], + ); + } +}