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

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



Revision: 3299
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=3299&view=rev
Author:   einhverfr
Date:     2011-06-20 09:40:17 +0000 (Mon, 20 Jun 2011)

Log Message:
-----------
Employee screen now appears fully functional.

Modified Paths:
--------------
    trunk/LedgerSMB/DBObject/Employee.pm
    trunk/sql/modules/Person.sql

Added Paths:
-----------
    trunk/sql/upgrade/3299-person_functions.sql

Modified: trunk/LedgerSMB/DBObject/Employee.pm
===================================================================
--- trunk/LedgerSMB/DBObject/Employee.pm	2011-06-20 09:27:44 UTC (rev 3298)
+++ trunk/LedgerSMB/DBObject/Employee.pm	2011-06-20 09:40:17 UTC (rev 3299)
@@ -92,6 +92,16 @@
     my $self = shift @_;
     my ($ref) = $self->exec_method(funcname => 'employee__get');
     $self->merge($ref);
+    @{$self->{locations}} = $self->exec_method(
+		funcname => 'person__list_locations');
+    @{$self->{contacts}} = $self->exec_method(
+		funcname => 'person__list_contacts');
+    @{$self->{notes}} = $self->exec_method(
+		funcname => 'person__list_notes');
+    @{$self->{bank_account}} = $self->exec_method(
+		funcname => 'person__list_bank_account');
+
+    
      
 }    
 

Modified: trunk/sql/modules/Person.sql
===================================================================
--- trunk/sql/modules/Person.sql	2011-06-20 09:27:44 UTC (rev 3298)
+++ trunk/sql/modules/Person.sql	2011-06-20 09:40:17 UTC (rev 3299)
@@ -130,6 +130,36 @@
 END;
 $$ LANGUAGE PLPGSQL;
 
+CREATE OR REPLACE FUNCTION person__list_bank_account(in_entity_id int)
+RETURNS SETOF entity_bank_account AS
+$$
+DECLARE out_row entity_bank_account%ROWTYPE;
+BEGIN
+	FOR out_row IN
+		SELECT * from entity_bank_account where entity_id = in_entity_id
+	LOOP
+		RETURN NEXT out_row;
+	END LOOP;
+END;
+$$ LANGUAGE PLPGSQL;
+
+
+CREATE OR REPLACE FUNCTION person__list_notes(in_entity_id int) 
+RETURNS SETOF entity_note AS 
+$$
+DECLARE out_row record;
+BEGIN
+	FOR out_row IN
+		SELECT *
+		FROM entity_note
+		WHERE ref_key = in_entity_id
+		ORDER BY created
+	LOOP
+		RETURN NEXT out_row;
+	END LOOP;
+END;
+$$ LANGUAGE PLPGSQL;
+		
 --
 
 create or replace function person__save_location(

Added: trunk/sql/upgrade/3299-person_functions.sql
===================================================================
--- trunk/sql/upgrade/3299-person_functions.sql	                        (rev 0)
+++ trunk/sql/upgrade/3299-person_functions.sql	2011-06-20 09:40:17 UTC (rev 3299)
@@ -0,0 +1,30 @@
+CREATE OR REPLACE FUNCTION person__list_bank_account(in_entity_id int)
+RETURNS SETOF entity_bank_account AS
+$$
+DECLARE out_row entity_bank_account%ROWTYPE;
+BEGIN
+        FOR out_row IN
+                SELECT * from entity_bank_account where entity_id = in_entity_id
+        LOOP    
+                RETURN NEXT out_row;
+        END LOOP;
+END;            
+$$ LANGUAGE PLPGSQL;
+
+CREATE OR REPLACE FUNCTION person__list_notes(in_entity_id int)
+RETURNS SETOF entity_note AS
+$$
+DECLARE out_row record;
+BEGIN
+        FOR out_row IN
+                SELECT *
+                FROM entity_note
+                WHERE ref_key = in_entity_id
+                ORDER BY created
+        LOOP
+                RETURN NEXT out_row;
+        END LOOP;
+END;
+$$ LANGUAGE PLPGSQL;
+
+


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