[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

SF.net SVN: ledger-smb:[3712] trunk



Revision: 3712
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=3712&view=rev
Author:   einhverfr
Date:     2011-09-19 17:15:10 +0000 (Mon, 19 Sep 2011)
Log Message:
-----------
Added select all button to reconciliaiton reports
added use strict to reconciliation reports

Modified Paths:
--------------
    trunk/UI/reconciliation/report.html
    trunk/scripts/recon.pl

Modified: trunk/UI/reconciliation/report.html
===================================================================
--- trunk/UI/reconciliation/report.html	2011-09-19 16:47:24 UTC (rev 3711)
+++ trunk/UI/reconciliation/report.html	2011-09-19 17:15:10 UTC (rev 3712)
@@ -234,6 +234,12 @@
 	class = "submit"
 } ?>
 <?lsmb INCLUDE button element_data = {
+        name = "action"
+        text = text('Select All') #'
+       value = 'select_all_recons'
+       class = 'submit'
+} ?>
+<?lsmb INCLUDE button element_data = {
 	name = "action",
 	text = text('Save'),
 	value = 'save_recon_set',

Modified: trunk/scripts/recon.pl
===================================================================
--- trunk/scripts/recon.pl	2011-09-19 16:47:24 UTC (rev 3711)
+++ trunk/scripts/recon.pl	2011-09-19 17:15:10 UTC (rev 3712)
@@ -23,6 +23,7 @@
 use LedgerSMB::DBObject::Reconciliation;
 
 use Data::Dumper;
+use strict;
 
 =pod
 
@@ -79,6 +80,23 @@
     _display_report($recon);
 }
 
+=item select_all_recons
+
+Checks off all reconciliation items and updates recon set
+
+=cut
+
+sub select_all_recons {
+    my ($request) = @_;
+    my $i = 1;
+    while (my $id = $request->{"id_$i"}){
+        $request->{"cleared_$id"} = $id;
+        ++ $i;
+    }
+    update_recon_set($request);
+
+} 
+
 =item submit_recon_set
 
 Submits the recon set to be approved.
@@ -90,9 +108,9 @@
     my $recon = LedgerSMB::DBObject::Reconciliation->new(base => $request);
     $recon->submit();
     my $template = LedgerSMB::Template->new( 
-            user => $user, 
+            user => $request->{_user}, 
     	    template => 'reconciliation/submitted', 
-    	    language => $user->{language}, 
+            locale => $request->{_locale},
             format => 'HTML',
             path=>"UI");
     return $template->render($recon);
@@ -114,9 +132,9 @@
         $recon->{notice} = $recon->{_locale}->text('Data not saved.  Please update again.');
     }
     my $template = LedgerSMB::Template->new( 
-            user => $user, 
+            user => $request->{_user}, 
     	    template => 'reconciliation/search', 
-    	    language => $user->{language}, 
+            locale => $request->{_locale},
             format => 'HTML',
             path=>"UI");
     return $template->render($recon);
@@ -202,9 +220,9 @@
         $recon->{title} = $request->{_locale}->text('Reconciliation Sets');
         my $template = LedgerSMB::Template->new( 
             locale => $request->{_locale},
-            user => $user, 
+            user => $request->{_user}, 
     	    template => 'form-dynatable', 
-    	    language => $user->{language}, 
+            locale => $request->{_locale},
             format => 'HTML',
             path=>"UI");
         
@@ -239,9 +257,9 @@
         @{$recon->{account_list}} = $recon->get_accounts();
 	unshift @{$recon->{account_list}}, {id => '', name => '' };
         my $template = LedgerSMB::Template->new(
-            user => $user,
+            user => $request->{_user},
             template=>'search',
-            language=>$user->{language},
+            locale => $request->{_locale},
             format=>'HTML',
             path=>"UI/reconciliation",
         );
@@ -272,10 +290,10 @@
         $recon->add_entries($recon->import_file('csv_file')) if !$recon->{submitted};
         $recon->{can_approve} = $recon->is_allowed_role({allowed_roles => ['reconciliation_approve']});
         $recon->get();
-        $template = LedgerSMB::Template->new( 
-            user=> $user,
+        my $template = LedgerSMB::Template->new( 
+            user=> $recon->{_user},
             template => 'reconciliation/report', 
-            language => $user->{language},
+            locale => $recon->{_locale},
             format=>'HTML',
             path=>"UI"
         );
@@ -410,9 +428,9 @@
             #$recon->{error};
             
             $template = LedgerSMB::Template->new(
-                user=>$user,
+                user=>$recon->{_user},
                 template=> 'reconciliation/upload',
-                language=>$user->{language},
+                locale => $recon->{_locale},
                 format=>'HTML',
                 path=>"UI"
             );
@@ -425,9 +443,9 @@
         # we can assume we're to generate the "Make a happy new report!" page.
         @{$recon->{accounts}} = $recon->get_accounts;
         $template = LedgerSMB::Template->new( 
-            user => $user, 
+            user => $recon->{_user}, 
             template => 'reconciliation/upload', 
-            language => $user->{language}, 
+            locale => $recon->{_locale},
             format => 'HTML',
             path=>"UI"
         );
@@ -468,7 +486,7 @@
     
     if ($request->type() eq "POST") {
         
-        $resp = $recon->delete_report($request->{report_id});
+        my $resp = $recon->delete_report($request->{report_id});
         
         if ($resp) {
             
@@ -526,8 +544,9 @@
         my $code = $recon->approve($request->{report_id});
         if ($code == 0) {
 
-            $template = LedgerSMB::Template->new( user => $user, 
-        	template => 'reconciliation/approved', language => $user->{language}, 
+            $template = LedgerSMB::Template->new( user => $recon->{_user}, 
+        	template => 'reconciliation/approved', 
+                locale => $recon->{_locale},
                 format => 'HTML',
                 path=>"UI"
                 );
@@ -539,9 +558,9 @@
             # failure case
             
             $template = LedgerSMB::Template->new( 
-                user => $user, 
+                user => $recon->{_user}, 
         	    template => 'reconciliation/report', 
-        	    language => $user->{language}, 
+        	locale => $recon->{_locale},
                 format => 'HTML',
                 path=>"UI"
                 );
@@ -550,7 +569,7 @@
         }
     }
     else {
-        return $class->display_report($request);
+        return _display_report($request);
     }
 }
 
@@ -577,9 +596,9 @@
     my $template;
     
     $template= LedgerSMB::Template->new(
-        user => $user,
+        user => $request->{_user},
         template=>'reconciliation/pending',
-        language=>$user->{language},
+        locale => $request->{_locale},
         format=>'HTML',
         path=>"UI"
     );
@@ -606,9 +625,9 @@
     my $template;
     
     $template = LedgerSMB::Template->new(
-        user => $user,
+        user => $request->{_user},
         template => 'reconciliation/list',
-        language => $user->{language},
+        locale => $request->{_locale},
         format=>'HTML',
         path=>"UI"
     );

This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.