Merge branch 'b-3.6.1' of ../kivitendo-erp_20220811
[kivitendo-erp.git] / bin / mozilla / rc.pl
index f1aeb47..f0ef98e 100644 (file)
@@ -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.
 #======================================================================
 #
 # Account reconciliation module
@@ -32,6 +33,7 @@
 #======================================================================
 
 use SL::RC;
+use SL::Locale::String qw(t8);
 
 require "bin/mozilla/common.pl";
 
@@ -47,6 +49,8 @@ sub reconciliation {
 
   RC->paymentaccounts(\%::myconfig, $::form);
 
+  setup_rc_reconciliation_action_bar();
+
   $::form->header;
   print $::form->parse_html_template('rc/step1', {
     selection_sub => sub { ("$_[0]{accno}--$_[0]{description}")x2 },
@@ -55,8 +59,6 @@ sub reconciliation {
   $::lxdebug->leave_sub;
 }
 
-sub continue { call_sub($::form->{"nextsub"}); }
-
 sub get_payments {
   $::lxdebug->enter_sub;
   $::auth->assert('cash');
@@ -102,6 +104,8 @@ sub display_form {
   my $statementbalance = $::form->parse_amount(\%::myconfig, $::form->{statementbalance});
   my $difference       = $statementbalance - $clearedbalance - $cleared;
 
+  setup_rc_display_form_action_bar();
+
   $::form->header;
   print $::form->parse_html_template('rc/step2', {
     is_asset         => $::form->{category} eq 'A',
@@ -145,7 +149,7 @@ sub update {
   $::lxdebug->leave_sub;
 }
 
-sub done {
+sub reconcile {
   $::lxdebug->enter_sub;
   $::auth->assert('cash');
 
@@ -159,3 +163,34 @@ sub done {
   $::lxdebug->leave_sub;
 }
 
+sub setup_rc_reconciliation_action_bar {
+  my %params = @_;
+
+  for my $bar ($::request->layout->get('actionbar')) {
+    $bar->add(
+      action => [
+        t8('Show'),
+        submit    => [ '#form', { action => "get_payments" } ],
+        accesskey => 'enter',
+      ],
+    );
+  }
+}
+
+sub setup_rc_display_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('Reconcile'),
+        submit => [ '#form', { action => "reconcile" } ],
+      ],
+    );
+  }
+}