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

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



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

Log Message:
-----------
John Locke's extended info for reconciliation patch
Updating Erik's schema update script to drop unused copy of function
Misc employee fixes

Modified Paths:
--------------
    trunk/LedgerSMB/DBObject/Employee.pm
    trunk/LedgerSMB/DBObject/Reconciliation.pm
    trunk/UI/Contact/contact.css
    trunk/UI/Contact/contact.html
    trunk/UI/reconciliation/report.html
    trunk/UI/users/preferences.html
    trunk/dists/source/build.sh
    trunk/scripts/recon.pl
    trunk/sql/modules/Reconciliation.sql
    trunk/sql/upgrade/3290-tax-account.sql

Added Paths:
-----------
    trunk/sql/upgrade/3293-recon_payee.sql

Modified: trunk/LedgerSMB/DBObject/Employee.pm
===================================================================
--- trunk/LedgerSMB/DBObject/Employee.pm	2011-06-19 20:30:10 UTC (rev 3292)
+++ trunk/LedgerSMB/DBObject/Employee.pm	2011-06-20 06:44:36 UTC (rev 3293)
@@ -24,7 +24,7 @@
 
     $self->{country_id} = $self->{country_code};
 
-    my ($ref) = $self->exec_method(funcname => 'person__location_save');
+    my ($ref) = $self->exec_method(funcname => 'person__save_location');
     my @vals = values %$ref;
     $self->{location_id} = $vals[0];
 

Modified: trunk/LedgerSMB/DBObject/Reconciliation.pm
===================================================================
--- trunk/LedgerSMB/DBObject/Reconciliation.pm	2011-06-19 20:30:10 UTC (rev 3292)
+++ trunk/LedgerSMB/DBObject/Reconciliation.pm	2011-06-20 06:44:36 UTC (rev 3293)
@@ -326,7 +326,7 @@
         $self->{dbh}->commit;
     }
     @{$self->{report_lines}} = $self->exec_method(
-		funcname=>'reconciliation__report_details'
+		funcname=>'reconciliation__report_details_payee'
     );
     ($ref) = $self->exec_method(funcname=>'account_get', 
                                 args => [$self->{chart_id}]);

Modified: trunk/UI/Contact/contact.css
===================================================================
--- trunk/UI/Contact/contact.css	2011-06-19 20:30:10 UTC (rev 3292)
+++ trunk/UI/Contact/contact.css	2011-06-20 06:44:36 UTC (rev 3293)
@@ -1,7 +1,7 @@
 label {
 	text-align: right;
 	margin-left: auto;
-	margin-right: 0em;
+        margin-right: 1em
 }
 
 input { margin-left: 0em;
@@ -43,16 +43,50 @@
         overflow: auto;
 }
 
-#hr_div div.input_group {
+div.input_group {
         display: block;
         float: left;
-        width: 25em;
 }
+div.input_group1 {
+        display: block;
+        float: left;
+}
+div.input_group2 {
+        display: block;
+        float: left;
+}
+div.input_group3 {
+        display: block;
+        float: left;
+}
 
+#hr_div div.input_group {
+        width: 28em;
+}
+
 #hr_div label {
         float: left;
         display: block;
         width: 9em;
         text-align: right;
-        margin-right: 1em
 }
+
+#company_div div.input_group1 {
+        width: 25em;
+}
+
+#company_div div.input_group2 {
+        width: 28em;
+}
+
+#company_div label {
+	float: left;
+	display: block;
+	width: 8em;
+	text-align: right;
+}
+
+#company_div div.input_group2 label {
+	width: 6em;
+}
+

Modified: trunk/UI/Contact/contact.html
===================================================================
--- trunk/UI/Contact/contact.html	2011-06-19 20:30:10 UTC (rev 3292)
+++ trunk/UI/Contact/contact.html	2011-06-20 06:44:36 UTC (rev 3293)
@@ -238,6 +238,8 @@
 		name = "account_class"
 		value = account_class
 	} ?>	
+<div class="input_line">
+<div class="input_group1">
 	<?lsmb PROCESS input element_data = {
 		label = text('Control Code:') #'
 		type= "text"
@@ -248,6 +250,8 @@
 	<?lsmb IF !created_as_class;
 		created_as_class = entity_class;
 	END; # IF !created_as_class ?> 
+</div>
+<div class="input_group2">
 	<?lsmb PROCESS select element_data = {
 		name = "created_as_class"
 		options = entity_classes
@@ -257,12 +261,16 @@
 		label = text('Class:')
 	} ?>
 	<?lsmb PROCESS button element_data = {
-		text = text('Generate Control Code')
+		text = text('Generate Control Code') #'
 		type = "submit"
 		name = "action"
 		value = "generate_control_code"
 		class = "submit"
-        } ?><br/>
+        } ?>
+</div>
+</div>
+<div class="input_line">
+<div class="input_group1">
 	<?lsmb PROCESS input element_data = {
 		label = text('Name:')
 		type= "text"
@@ -270,7 +278,8 @@
 		value = name
 		size = "20"
 	} ?>
-
+</div>
+<div class="input_group2">
        <?lsmb IF !country_id_t; country_id_t = default_country; END -?>
        <?lsmb country_list.unshift({}) ?>
 		<?lsmb INCLUDE select element_data = {
@@ -280,11 +289,11 @@
 			options = country_list
 			name = "country_id_t"
 			label = text('Country:') 
-	} ?> <br/>
-        <table>
-        <tr>
-            
-            <td>
+	} ?> 
+</div>
+</div>
+<div class="input_line">
+<div class="input_group1">
 		<?lsmb INCLUDE input element_data = {
 			label = text('Tax Number/SSN:'),
 			name = "tax_id",
@@ -292,8 +301,8 @@
 			type = "text",
 			size = "19"
 		} #' ?>
-            </td>
-            <td>
+</div>
+<div class="input_group2">
 		<?lsmb INCLUDE input element_data = {
 			label = text('SIC:'),
 			name = "sic_code",
@@ -302,11 +311,11 @@
 			size = "19",
 			class = 'sic'
 		} ?>
-            </td>
-        </tr>
-    </table>
-
+</div>
+</div>
+<div class="input_line">
             <hr/>
+<div class="input_group1">
 		<?lsmb INCLUDE button element_data = {
 			text = text('Save'),
 			class="submit" 
@@ -316,7 +325,8 @@
 			accesskey="S" 
 			title="Save [Alt-S]"
 		} ?>
-    </form>
+</div>
+</div>
 <?lsmb FOREACH n = notes ?>
 <div class="note">
 <div class="note_contents"><?lsmb n.note ?></div>

Modified: trunk/UI/reconciliation/report.html
===================================================================
--- trunk/UI/reconciliation/report.html	2011-06-19 20:30:10 UTC (rev 3292)
+++ trunk/UI/reconciliation/report.html	2011-06-20 06:44:36 UTC (rev 3293)
@@ -60,7 +60,7 @@
 <?lsmb i = 1 ?>
 <table border=0 id="cleared-table">
 	<tr class="listtop">
-		<th colspan=9><?lsmb text('Cleared Transactions') ?></th>
+		<th colspan="10"><?lsmb text('Cleared Transactions') ?></th>
 	</tr>
 	<tr class="listheading">
 		<th><?lsmb text('Cleared') ?></th>
@@ -68,6 +68,7 @@
 		<th><?lsmb text('Clear date') ?></th>
 		<th><?lsmb text('Source') ?></th>
 		<th><?lsmb text('Posted Date') ?></th>
+		<th><?lsmb text('Payee') ?></th>
 		<th><?lsmb text('Our Debits') ?></th>
 		<th><?lsmb text('Our Credits') ?></th>
 		<th><?lsmb text('Their Debits') ?></th>
@@ -97,6 +98,7 @@
 			<td><?lsmb row.clear_time ?></td>
 			<td><?lsmb row.scn ?> </td>
 			<td><?lsmb row.post_date ?></td>
+			<td><?lsmb row.payee ?></td>
 			<td><?lsmb row.our_debits ?></td>
 			<td><?lsmb row.our_credits ?></td>
 			<td><?lsmb row.their_debits ?></td>
@@ -113,7 +115,7 @@
 	</table>
 <table border=0 id="error-table">
 	<tr class="listtop">
-		<th colspan=9><?lsmb text('Mismatched Transactions (From Upload)') ?></th>
+		<th colspan="10"><?lsmb text('Mismatched Transactions (From Upload)') ?></th>
 	</tr>
 	<tr class="listheading">
 		<th><?lsmb text('Cleared') ?></th>
@@ -121,6 +123,7 @@
 		<th><?lsmb text('Clear date') ?></th>
 		<th><?lsmb text('Source') ?></th>
 		<th><?lsmb text('Posted Date') ?></th>
+		<th><?lsmb text('Payee') ?></th>
 		<th><?lsmb text('Our Debits') ?></th>
 		<th><?lsmb text('Our Credits') ?></th>
 		<th><?lsmb text('Their Debits') ?></th>
@@ -146,6 +149,7 @@
 			<td><?lsmb row.clear_time ?></td>
 			<td><?lsmb row.scn ?> </td>
 			<td><?lsmb row.post_date ?></td>
+			<td><?lsmb row.payee ?></td>
 			<td><?lsmb row.our_debits ?></td>
 			<td><?lsmb row.our_credits ?></td>
 			<td><?lsmb row.their_debits ?></td>
@@ -164,12 +168,13 @@
 	</table>
 	<table id="outstanding-table">
 	<tr class="listtop">
-		<th colspan=5><?lsmb text('Outstanding Transactions') ?></th>
+		<th colspan="6"><?lsmb text('Outstanding Transactions') ?></th>
 	</tr>
 	<tr class="listheading">
 		<th><?lsmb text('Cleared') ?></th>
 		<th><?lsmb text('Source') ?></th>
 		<th><?lsmb text('Posted Date') ?></th>
+		<th><?lsmb text('Payee') ?></th>
 		<th><?lsmb text('Our Debits') ?></th>
 		<th><?lsmb text('Our Credits') ?></th>
 	</tr>
@@ -190,6 +195,7 @@
 			?></td>
 			<td><?lsmb row.scn ?> </td>
 			<td><?lsmb row.post_date ?></td>
+			<td><?lsmb row.payee ?></td>
 			<td><?lsmb row.our_debits ?></td>
 			<td><?lsmb row.our_credits ?></td>
 		</tr>

Modified: trunk/UI/users/preferences.html
===================================================================
--- trunk/UI/users/preferences.html	2011-06-19 20:30:10 UTC (rev 3292)
+++ trunk/UI/users/preferences.html	2011-06-20 06:44:36 UTC (rev 3293)
@@ -69,7 +69,7 @@
 	      <tr>
 		<th align="right"><?lsmb text('Stylesheet') ?></th>
 		<td><?lsmb PROCESS select element_data={
-                      name = 'css'
+                      name = 'stylesheet'
                       options = cssfiles
                       default_values = [stylesheet]
                       text_attr = 'file'

Modified: trunk/dists/source/build.sh
===================================================================
--- trunk/dists/source/build.sh	2011-06-19 20:30:10 UTC (rev 3292)
+++ trunk/dists/source/build.sh	2011-06-20 06:44:36 UTC (rev 3293)
@@ -2,7 +2,7 @@
 
 # Simple script to prepare for release
 
-version="1.3.0_snapshot20110614";
+version="1.3.0_snapshot20110619";
 build_d="../release";
 
 if test -d $build_d/ledgersmb; then

Modified: trunk/scripts/recon.pl
===================================================================
--- trunk/scripts/recon.pl	2011-06-19 20:30:10 UTC (rev 3292)
+++ trunk/scripts/recon.pl	2011-06-20 06:44:36 UTC (rev 3293)
@@ -132,7 +132,7 @@
         my @accounts = $search->get_accounts();
         my $act_hash = {};
         for my $act (@accounts){
-            $act_hash->{"$act->{id}"} = $act->{account};
+            $act_hash->{"$act->{id}"} = $act->{name};
         }
         for my $row (@results){
             $row->{account} = $act_hash->{"$row->{chart_id}"};
@@ -336,7 +336,7 @@
         $recon->close_form;
         $recon->open_form({commit => 1});
         $recon->add_entries($recon->import_file('csv_file')) if !$recon->{submitted};
-        $recon->{can_approve} = $recon->is_allowed_role({allowed_roles => ['recon_supervisor']});
+        $recon->{can_approve} = $recon->is_allowed_role({allowed_roles => ['reconciliation_approve']});
         $recon->get();
         $template = LedgerSMB::Template->new( 
             user=> $user,

Modified: trunk/sql/modules/Reconciliation.sql
===================================================================
--- trunk/sql/modules/Reconciliation.sql	2011-06-19 20:30:10 UTC (rev 3292)
+++ trunk/sql/modules/Reconciliation.sql	2011-06-20 06:44:36 UTC (rev 3293)
@@ -86,7 +86,7 @@
            FROM cr_report 
           WHERE id = in_report_id 
             AND submitted = TRUE
-            AND entered_by = people__get_my_entity_id();
+            AND entered_by = person__get_my_entity_id();
         
         IF FOUND THEN
             -- Creators cannot delete their own reports if they've been submitted.
@@ -95,7 +95,7 @@
         
         UPDATE cr_report
            SET deleted = TRUE,
-               deleted_by = people__get_my_entity_id()
+               deleted_by = person__get_my_entity_id()
          WHERE id = in_report_id;
          
         return TRUE;
@@ -489,3 +489,35 @@
 	RETURN outval;
 END;
 $$ language plpgsql;
+
+CREATE OR REPLACE VIEW recon_payee AS
+ SELECT n.name AS payee, rr.id, rr.report_id, rr.scn, rr.their_balance, rr.our_balance, rr.errorcode, rr."user", rr.clear_time, rr.insert_time, rr.trans_type, rr.post_date, rr.ledger_id, rr.voucher_id, rr.overlook, rr.cleared
+   FROM cr_report_line rr
+   LEFT JOIN acc_trans ac ON rr.ledger_id = ac.entry_id
+   LEFT JOIN gl ON ac.trans_id = gl.id
+   LEFT JOIN (( SELECT ap.id, e.name
+   FROM ap
+   JOIN entity_credit_account eca ON ap.entity_credit_account = eca.id
+   JOIN entity e ON eca.entity_id = e.id
+UNION 
+ SELECT ar.id, e.name
+   FROM ar
+   JOIN entity_credit_account eca ON ar.entity_credit_account = eca.id
+   JOIN entity e ON eca.entity_id = e.id)
+UNION 
+ SELECT gl.id, gl.description
+   FROM gl) n ON n.id = ac.trans_id;
+
+
+CREATE OR REPLACE FUNCTION reconciliation__report_details_payee (in_report_id INT) RETURNS setof recon_payee as $$
+   DECLARE
+        row recon_payee;
+    BEGIN    
+        FOR row IN 
+        	select * from recon_payee where report_id = in_report_id 
+        	order by scn, post_date
+        LOOP
+          RETURN NEXT row;
+        END LOOP;    
+    END;
+$$ language 'plpgsql';
\ No newline at end of file

Modified: trunk/sql/upgrade/3290-tax-account.sql
===================================================================
--- trunk/sql/upgrade/3290-tax-account.sql	2011-06-19 20:30:10 UTC (rev 3292)
+++ trunk/sql/upgrade/3290-tax-account.sql	2011-06-20 06:44:36 UTC (rev 3293)
@@ -10,6 +10,9 @@
               SELECT chart_id
               FROM tax);
 
+DROP FUNCTION account_save
+(in_id int, in_accno text, in_description text, in_category char(1),
+in_gifi_accno text, in_heading int, in_contra bool, in_link text[]);
 
 CREATE OR REPLACE FUNCTION account_save
 (in_id int, in_accno text, in_description text, in_category char(1),

Added: trunk/sql/upgrade/3293-recon_payee.sql
===================================================================
--- trunk/sql/upgrade/3293-recon_payee.sql	                        (rev 0)
+++ trunk/sql/upgrade/3293-recon_payee.sql	2011-06-20 06:44:36 UTC (rev 3293)
@@ -0,0 +1,32 @@
+
+CREATE OR REPLACE VIEW recon_payee AS
+ SELECT n.name AS payee, rr.id, rr.report_id, rr.scn, rr.their_balance, rr.our_balance, rr.errorcode, rr."user", rr.clear_time, rr.insert_time, rr.trans_type, rr.post_date, rr.ledger_id, rr.voucher_id, rr.overlook, rr.cleared
+   FROM cr_report_line rr
+   LEFT JOIN acc_trans ac ON rr.ledger_id = ac.entry_id
+   LEFT JOIN gl ON ac.trans_id = gl.id
+   LEFT JOIN (( SELECT ap.id, e.name
+   FROM ap
+   JOIN entity_credit_account eca ON ap.entity_credit_account = eca.id
+   JOIN entity e ON eca.entity_id = e.id
+UNION 
+ SELECT ar.id, e.name
+   FROM ar
+   JOIN entity_credit_account eca ON ar.entity_credit_account = eca.id
+   JOIN entity e ON eca.entity_id = e.id)
+UNION 
+ SELECT gl.id, gl.description
+   FROM gl) n ON n.id = ac.trans_id;
+
+
+CREATE OR REPLACE FUNCTION reconciliation__report_details_payee (in_report_id INT) RETURNS setof recon_payee as $$
+   DECLARE
+        row recon_payee;
+    BEGIN    
+        FOR row IN 
+        	select * from recon_payee where report_id = in_report_id 
+        	order by scn, post_date
+        LOOP
+          RETURN NEXT row;
+        END LOOP;    
+    END;
+$$ language 'plpgsql';
\ No newline at end of file


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