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

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



Revision: 2471
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=2471&view=rev
Author:   einhverfr
Date:     2009-03-04 18:44:26 +0000 (Wed, 04 Mar 2009)

Log Message:
-----------
New reconciliation report search enhancements

Modified Paths:
--------------
    trunk/LedgerSMB.pm
    trunk/scripts/recon.pl
    trunk/sql/modules/Person.sql
    trunk/sql/modules/Reconciliaton.sql
    trunk/sql/modules/test/data/Reconciliation.sql
    trunk/t/63-lwp.t

Modified: trunk/LedgerSMB.pm
===================================================================
--- trunk/LedgerSMB.pm	2009-02-27 19:05:45 UTC (rev 2470)
+++ trunk/LedgerSMB.pm	2009-03-04 18:44:26 UTC (rev 2471)
@@ -614,7 +614,7 @@
             return 1;
         }
     }
-    return 0; # TODO change to 0 when the role system is implmented
+    return 0; 
 }
 
 # This should probably be moved to User too...

Modified: trunk/scripts/recon.pl
===================================================================
--- trunk/scripts/recon.pl	2009-02-27 19:05:45 UTC (rev 2470)
+++ trunk/scripts/recon.pl	2009-03-04 18:44:26 UTC (rev 2471)
@@ -134,19 +134,20 @@
         }
         my $base_url = "recon.pl?action=update_recon_set";
         $columns = {
-            "select" => $request->{_locale}->text('Select'),	
-            account     => $request->{_locale}->text('Account'),	
-            their_total => $request->{_locale}->text('Balance'),
-            end_date    => $request->{_locale}->text('Statement Date'),
-            submitted   => $request->{_locale}->text('Submitted'),
-            approved    => $request->{_locale}->text('Approved'), 
+            "select"         => $request->{_locale}->text('Select'),	
+            account          => $request->{_locale}->text('Account'),	
+            their_total      => $request->{_locale}->text('Balance'),
+            end_date         => $request->{_locale}->text('Statement Date'),
+            submitted        => $request->{_locale}->text('Submitted'),
+            approved         => $request->{_locale}->text('Approved'), 
+            updated          => $request->{_locale}->text('Last Updated'), 
+            entered_username => $request->{_locale}->text('Username'), 
         };
 	my $cols = [];
 	my @acts = $search->get_accounts;
-	@$cols = qw(select account end_date their_total approved submitted);
+	@$cols = qw(select account end_date their_total approved submitted updated entered_username);
 	my $recon =$search;
 	for my $row(@results){
-            
             my $act = undef;
             for (@acts){
                 if ($_->{id} == $row->{chart_id}){

Modified: trunk/sql/modules/Person.sql
===================================================================
--- trunk/sql/modules/Person.sql	2009-02-27 19:05:45 UTC (rev 2470)
+++ trunk/sql/modules/Person.sql	2009-03-04 18:44:26 UTC (rev 2471)
@@ -1,5 +1,10 @@
 begin;
 
+CREATE OR REPLACE FUNCTION person__get_my_entity_id() RETURNS INT AS
+$$
+	SELECT entity_id from users where username = SESSION_USER;
+$$ LANGUAGE SQL;
+
 CREATE OR REPLACE FUNCTION person__save
 (in_entity_id integer, in_salutation_id int, 
 in_first_name text, in_middle_name text, in_last_name text    

Modified: trunk/sql/modules/Reconciliaton.sql
===================================================================
--- trunk/sql/modules/Reconciliaton.sql	2009-02-27 19:05:45 UTC (rev 2470)
+++ trunk/sql/modules/Reconciliaton.sql	2009-03-04 18:44:26 UTC (rev 2471)
@@ -4,7 +4,10 @@
     their_total numeric not null,
     approved boolean not null default 'f',
     submitted boolean not null default 'f',
-    end_date date not null default now()
+    end_date date not null default now(),
+    updated timestamp not null default now(),
+    entered_by int not null default person__get_my_entity_id() references entity(id),
+    entered_username text not null default SESSION_USER
 );
 
 create table cr_approval (
@@ -280,6 +283,8 @@
 		GROUP BY gl.ref, ac.source, ac.transdate,
 			ac.memo, ac.voucher_id, gl.table
 		HAVING count(rl.id) = 0;
+
+		UPDATE cr_report set updated = now() where id = in_report_id;
     RETURN in_report_id;
     END;
 $$ LANGUAGE plpgsql;

Modified: trunk/sql/modules/test/data/Reconciliation.sql
===================================================================
--- trunk/sql/modules/test/data/Reconciliation.sql	2009-02-27 19:05:45 UTC (rev 2470)
+++ trunk/sql/modules/test/data/Reconciliation.sql	2009-03-04 18:44:26 UTC (rev 2471)
@@ -23,6 +23,7 @@
 INSERT INTO gl (id, reference, transdate) values (-203, 'Recon gl test 2', '1000-01-01');
 INSERT INTO gl (id, reference, transdate) values (-210, 'Recon gl test 3', '1000-01-03');
 INSERT INTO gl (id, reference, transdate) values (-211, 'Recon gl test 4', '1000-01-03');
+INSERT INTO gl (id, reference, transdate) values (-212, 'Cleared gl trans', '1000-01-03');
 
 INSERT INTO acc_trans (trans_id, chart_id, transdate, amount, source) values (-200, -200, '1000-01-01', -10, '1');
 INSERT INTO acc_trans (trans_id, chart_id, transdate, amount, source) values (-200, -201, '1000-01-01', 10, '1');
@@ -48,3 +49,5 @@
 INSERT INTO acc_trans (trans_id, chart_id, transdate, amount, source) values (-210, -201, '1000-01-03', 10, '1');
 INSERT INTO acc_trans (trans_id, chart_id, transdate, amount, source) values (-211, -200, '1000-01-03', -10, '1');
 INSERT INTO acc_trans (trans_id, chart_id, transdate, amount, source) values (-211, -201, '1000-01-03', 10, '1');
+INSERT INTO acc_trans (trans_id, chart_id, transdate, amount, source, cleared) values (-212, -200, '1000-01-03', -10, '1', true);
+INSERT INTO acc_trans (trans_id, chart_id, transdate, amount, source, cleared) values (-212, -201, '1000-01-03', 10, '1', true);

Modified: trunk/t/63-lwp.t
===================================================================
--- trunk/t/63-lwp.t	2009-02-27 19:05:45 UTC (rev 2470)
+++ trunk/t/63-lwp.t	2009-03-04 18:44:26 UTC (rev 2471)
@@ -63,4 +63,8 @@
 	if (ref($lwp_tests->{"$test->{_test_id}"}) eq 'CODE'){
 		&$lwp_tests->{"$test->{_test_id}"};
 	}
+	#cmp_ok(($response->content =~ /Error/), 'eq', "$test->{_lwp_error}", "No Error on Request $test->{_test_id}");
+	#if ($response->content =~ /Error/){
+	#	print STDERR $response->content;
+	#}
 }


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