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

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



Revision: 3150
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=3150&view=rev
Author:   einhverfr
Date:     2011-05-22 19:32:19 +0000 (Sun, 22 May 2011)

Log Message:
-----------
Fixing user email detection in Template.pm

Modified Paths:
--------------
    trunk/CONTRIBUTORS
    trunk/LedgerSMB/Company_Config.pm
    trunk/LedgerSMB/IC.pm
    trunk/LedgerSMB/Template.pm
    trunk/UI/Contact/contact.html
    trunk/sql/modules/Company.sql
    trunk/sql/modules/Drafts.sql
    trunk/sql/modules/Roles.sql
    trunk/sql/modules/test/Taxform.sql

Property Changed:
----------------
    trunk/journal.pl

Modified: trunk/CONTRIBUTORS
===================================================================
--- trunk/CONTRIBUTORS	2011-05-22 19:15:33 UTC (rev 3149)
+++ trunk/CONTRIBUTORS	2011-05-22 19:32:19 UTC (rev 3150)
@@ -20,6 +20,10 @@
 re-engineered the localization framework.  She has also provided support for 
 Excel, ODS, and other formats for reports.
 
+Other Committers:
+==================
+Jeff Kowalczyk [email omitted] contributed the ledger-smb-smallgray.css and has submitted numerous bug fixes.
+
 Other Contributors:
 ========================
 Dave van Ginneken <davevg @ gmail.com> fixed many HTML errors and has patched 
@@ -50,7 +54,6 @@
 
 Chifung Fan [email omitted] contributed bugfixes.
 
-Jeff Kowalczyk [email omitted] contributed the ledger-smb-smallgray.css
 
 Matt S Trout, <mst @ shadowcatsystems.co.uk> CPAN: MSTROUT, 
 IRC: mst#irc.perl.org contributed the initial Makefile.PL
@@ -81,6 +84,8 @@
 
 Ian Goodacre [email omitted] has provided numerous bugfixes.
 
+Erik Huelsmann <ehuels @ gmail.com> has provided bugfixes.
+
 Original Authors of SQL-Ledger:
 ===================================
 Dieter Simader <dsimader @ sql-ledger.com>

Modified: trunk/LedgerSMB/Company_Config.pm
===================================================================
--- trunk/LedgerSMB/Company_Config.pm	2011-05-22 19:15:33 UTC (rev 3149)
+++ trunk/LedgerSMB/Company_Config.pm	2011-05-22 19:32:19 UTC (rev 3150)
@@ -42,16 +42,14 @@
 
 sub initialize{
    my ($self) = @_;
-   for my $k (keys %$settings){
-       delete $settings->{$k};
-   }
-   for my $setting (@company_settings){
+   $settings= {}; # In case code is cached
+   for my $key (@company_settings){
        my ($ref) = LedgerSMB::call_procedure($self, procname => 'setting_get', 
-                  args => [$setting]);
+                  args => [$key ]);
        if ($ref->{setting_key} eq 'curr'){
-          $settings->{$setting} = split /:/, $ref->{value};
+          $settings->{$key } = split /:/, $ref->{value};
        } else {
-          $settings->{$setting} = $ref->{value};
+          $settings->{$key } = $ref->{value};
        }
    }
 }

Modified: trunk/LedgerSMB/IC.pm
===================================================================
--- trunk/LedgerSMB/IC.pm	2011-05-22 19:15:33 UTC (rev 3149)
+++ trunk/LedgerSMB/IC.pm	2011-05-22 19:32:19 UTC (rev 3150)
@@ -172,8 +172,9 @@
 			         pv.lastcost, pv.leadtime, 
 			         pv.curr AS vendorcurr
 			    FROM partsvendor pv
-			    JOIN vendor v ON (v.id = pv.credit_id)
-                JOIN entity e ON (e.id = pv.entity_id)
+			    JOIN entity_credit_account v 
+                                 ON (v.id = pv.credit_id)
+                            JOIN entity e ON (e.id = v.entity_id)
 			   WHERE pv.parts_id = ?
 			ORDER BY 2|;
 

Modified: trunk/LedgerSMB/Template.pm
===================================================================
--- trunk/LedgerSMB/Template.pm	2011-05-22 19:15:33 UTC (rev 3149)
+++ trunk/LedgerSMB/Template.pm	2011-05-22 19:32:19 UTC (rev 3150)
@@ -364,6 +364,9 @@
 		@mailmime = ('contenttype', $self->{mimeytype});
 	}
 
+        # User default for email from
+        $args->{from} ||= $self->{user}->{email};
+
         # Default addresses
         my $csettings = $LedgerSMB::Company_Config::settings;
         $args->{from} ||= $csettings->{default_email_from};
@@ -371,9 +374,10 @@
         $args->{cc} ||= $csettings->{default_email_cc};
         $args->{bcc} ||= $csettings->{default_email_bcc};
 
+
         # Mailer stuff
 	my $mail = new LedgerSMB::Mailer(
-		from => $args->{from} || $self->{user}->{email},
+		from => $args->{from},
 		to => $args->{to},
 		cc => $args->{cc},
 		bcc => $args->{bcc},

Modified: trunk/UI/Contact/contact.html
===================================================================
--- trunk/UI/Contact/contact.html	2011-05-22 19:15:33 UTC (rev 3149)
+++ trunk/UI/Contact/contact.html	2011-05-22 19:32:19 UTC (rev 3150)
@@ -486,6 +486,7 @@
 	</tr>
 
 	<tr id="taxform-threshold-row">
+        <?lsmb taxform_list.unshift({}) ?>
 	
 	 <td> <?lsmb INCLUDE select element_data = {
 			name = "taxform_id"


Property changes on: trunk/journal.pl
___________________________________________________________________
Added: svn:executable
   + *

Modified: trunk/sql/modules/Company.sql
===================================================================
--- trunk/sql/modules/Company.sql	2011-05-22 19:15:33 UTC (rev 3149)
+++ trunk/sql/modules/Company.sql	2011-05-22 19:32:19 UTC (rev 3150)
@@ -42,7 +42,7 @@
                        WHERE meta_number = in_meta_number
                       UNION ALL
                       SELECT * from entity_credit_account
-                       WHERE meta_number IS NULL) ec ON (ec.entity_id = e.id)
+                       WHERE in_meta_number IS NULL) ec ON (ec.entity_id = e.id)
 		LEFT JOIN business b ON (ec.business_id = b.id)
 		WHERE ec.entity_class = in_account_class
 			AND (c.id IN (select company_id FROM company_to_contact

Modified: trunk/sql/modules/Drafts.sql
===================================================================
--- trunk/sql/modules/Drafts.sql	2011-05-22 19:15:33 UTC (rev 3149)
+++ trunk/sql/modules/Drafts.sql	2011-05-22 19:32:19 UTC (rev 3150)
@@ -25,7 +25,7 @@
 			    END) as amount
 		FROM (
 			SELECT id, transdate, reference, 
-				(SELECT name FROM eca__get_entity(entity_credit_account)),
+				description,
                                 approved from gl
 			WHERE lower(in_type) = 'gl'
 			UNION

Modified: trunk/sql/modules/Roles.sql
===================================================================
--- trunk/sql/modules/Roles.sql	2011-05-22 19:15:33 UTC (rev 3149)
+++ trunk/sql/modules/Roles.sql	2011-05-22 19:32:19 UTC (rev 3150)
@@ -602,8 +602,10 @@
 GRANT SELECT, INSERT ON acc_trans TO "lsmb_<?lsmb dbname ?>__payment_process";
 GRANT ALL ON acc_trans_entry_id_seq TO "lsmb_<?lsmb dbname ?>__payment_process";
 GRANT UPDATE ON ap TO "lsmb_<?lsmb dbname ?>__payment_process";
+GRANT ALL ON payment, payment_id_seq TO "lsmb_<?lsmb dbname ?>__payment_process";
 
 
+
 INSERT INTO menu_acl (node_id, acl_type, role_name)
 values (35, 'allow', 'lsmb_<?lsmb dbname ?>__payment_process');
 INSERT INTO menu_acl (node_id, acl_type, role_name)

Modified: trunk/sql/modules/test/Taxform.sql
===================================================================
--- trunk/sql/modules/test/Taxform.sql	2011-05-22 19:15:33 UTC (rev 3149)
+++ trunk/sql/modules/test/Taxform.sql	2011-05-22 19:32:19 UTC (rev 3150)
@@ -25,6 +25,7 @@
 
 INSERT INTO account_heading(id, accno ) VALUES (-255, '-billion');
 INSERT INTO account (id, accno, category, heading ) VALUES (-255, '-billion', 'T', -255);
+INSERT INTO account (id, accno, category, heading ) VALUES (-256, '-billiontest', 'T', -255);
 
 -- New account is created.
 
@@ -58,20 +59,46 @@
 INSERT INTO ap (id, amount, approved, entity_credit_account, curr) VALUES (-258, -2500, 't'::bool, -255, 'USD');
 INSERT INTO acc_trans (trans_id, chart_id, amount, approved, entry_id) VALUES (-258, -255, -2500, 't'::bool, -1003);
 
+INSERT INTO ap (id, amount, approved, entity_credit_account, curr) VALUES (-259, 5000, 't'::bool, -255, 'USD');
 
+INSERT INTO acc_trans (trans_id, chart_id, amount, approved, entry_id) VALUES (-259, -255, 5000, 't'::bool, -1004);
+
+-- Set up the paid transactions
+
+INSERT INTO ap (id, amount, approved, entity_credit_account, curr) VALUES (-260, -1000, 't'::bool, -255, 'USD');
+INSERT INTO acc_trans (trans_id, chart_id, amount, approved, entry_id) VALUES (-260, -255, -1000, 't'::bool, -1005);
+INSERT INTO acc_trans (trans_id, chart_id, amount, approved, entry_id) VALUES (-260, -256, 1000, 't'::bool, -1006);
+
+INSERT INTO ap (id, amount, approved, entity_credit_account, curr) VALUES (-261, -1500, 't'::bool, -255, 'USD');
+INSERT INTO acc_trans (trans_id, chart_id, amount, approved, entry_id) VALUES (-261, -255, -1500, 't'::bool, -1007);
+INSERT INTO acc_trans (trans_id, chart_id, amount, approved, entry_id) VALUES (-261, -256, 1500, 't'::bool, -1008);
+
+INSERT INTO ap (id, amount, approved, entity_credit_account, curr) VALUES (-262, -2500, 't'::bool, -255, 'USD');
+
+INSERT INTO acc_trans (trans_id, chart_id, amount, approved, entry_id) VALUES (-262, -255, -2500, 't'::bool, -1009);
+INSERT INTO acc_trans (trans_id, chart_id, amount, approved, entry_id) VALUES (-262, -256, 2500, 't'::bool, -1010);
+
 -- Now we set up the invoice entries themselves.
 
 
 INSERT INTO invoice (id, trans_id, sellprice, qty) VALUES (-1000, -256, 250, 4);
 INSERT INTO invoice (id, trans_id, sellprice, qty) VALUES (-1001, -257, 750, 2);
 INSERT INTO invoice (id, trans_id, sellprice, qty) VALUES (-1002, -258, 500, 5);
+INSERT INTO invoice (id, trans_id, sellprice, qty) VALUES (-1003, -260, 250, 4);
+INSERT INTO invoice (id, trans_id, sellprice, qty) VALUES (-1004, -261, 750, 2);
+INSERT INTO invoice (id, trans_id, sellprice, qty) VALUES (-1005, -262, 500, 5);
 
+
 -- And finally, the tax_form references
 
 INSERT INTO invoice_tax_form (invoice_id, reportable) VALUES (-1000, TRUE);
 INSERT INTO invoice_tax_form (invoice_id, reportable) VALUES (-1001, TRUE);
 INSERT INTO invoice_tax_form (invoice_id, reportable) VALUES (-1002, TRUE);
+INSERT INTO invoice_tax_form (invoice_id, reportable) VALUES (-1003, TRUE);
+INSERT INTO invoice_tax_form (invoice_id, reportable) VALUES (-1004, TRUE);
+INSERT INTO invoice_tax_form (invoice_id, reportable) VALUES (-1005, TRUE);
 
+
 --
 -- Finally, we test if the entries are showing up 
 --


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