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

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



Revision: 3176
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=3176&view=rev
Author:   einhverfr
Date:     2011-05-25 04:12:17 +0000 (Wed, 25 May 2011)

Log Message:
-----------
Ian's debugging patch for user management

Modified Paths:
--------------
    trunk/LedgerSMB/DBObject/Admin.pm
    trunk/LedgerSMB/IC.pm
    trunk/LedgerSMB/Sysconfig.pm
    trunk/Makefile.PL
    trunk/UI/Contact/contact.html
    trunk/sql/modules/Drafts.sql
    trunk/sql/modules/admin.sql
    trunk/sql/modules/test/Taxform.sql

Modified: trunk/LedgerSMB/DBObject/Admin.pm
===================================================================
--- trunk/LedgerSMB/DBObject/Admin.pm	2011-05-24 19:31:21 UTC (rev 3175)
+++ trunk/LedgerSMB/DBObject/Admin.pm	2011-05-25 04:12:17 UTC (rev 3176)
@@ -6,7 +6,10 @@
 use LedgerSMB::DBObject::Employee;
 use LedgerSMB::Contact;
 use LedgerSMB::DBObject::Employee;
+use LedgerSMB::Log;
 
+my $logger = Log::Log4perl->get_logger("LedgerSMB::DBObject::Admin");
+
 #[18:00:31] <aurynn> I'd like to split them employee/user and roles/prefs
 #[18:00:44] <aurynn> edit/create employee and add user features if needed.
 
@@ -105,13 +108,13 @@
     for my $role (@user_roles) {
        
        # These are our user's roles.
-       print STDERR "Have $role->{rolname}\n";
+       print STDERR "Have $role->{admin__get_roles_for_user}\n";
         
-       $active_roles{"$role->{rolname}"} = 1;
+       $active_roles{"$role->{admin__get_roles_for_user}"} = 1;
     }
     
     my $status;
-    
+
     for my $r ( @roles) {
         my $role = $r->{rolname};
         my $reqrole = $role;
@@ -249,6 +252,8 @@
     my @s_rows = $self->call_procedure(procname=>'admin__get_roles');
     my @rows;
     my $company = $self->{company};
+    $logger->debug("get_roles: company = $company");
+    $logger->debug("get_roles: self = " . Data::Dumper::Dumper($self));
     for my $role (@s_rows) {
         my $rolname = $role->{'rolname'};
         push @rows, $rolname;

Modified: trunk/LedgerSMB/IC.pm
===================================================================
--- trunk/LedgerSMB/IC.pm	2011-05-24 19:31:21 UTC (rev 3175)
+++ trunk/LedgerSMB/IC.pm	2011-05-25 04:12:17 UTC (rev 3176)
@@ -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/Sysconfig.pm
===================================================================
--- trunk/LedgerSMB/Sysconfig.pm	2011-05-24 19:31:21 UTC (rev 3175)
+++ trunk/LedgerSMB/Sysconfig.pm	2011-05-25 04:12:17 UTC (rev 3176)
@@ -74,6 +74,9 @@
 # SMTP settings
 our $smtphost   = '';
 our $smtptimout = 60;
+our $smtpuser   = '';
+our $smtppass   = '';
+our $smtpauthmethod = '';
 
 # set language for login and admin
 our $language = "";
@@ -126,7 +129,9 @@
 }
 
 # mail configuration
-for my $var (qw(sendmail smtphost smtptimeout)) {
+for my $var (qw(sendmail smtphost smtptimeout smtpuser 
+             smtppass smtpauthmethod)) 
+{
     ${$var} = $config{mail}{$var} if $config{mail}{$var};
 }
 

Modified: trunk/Makefile.PL
===================================================================
--- trunk/Makefile.PL	2011-05-24 19:31:21 UTC (rev 3175)
+++ trunk/Makefile.PL	2011-05-25 04:12:17 UTC (rev 3176)
@@ -29,6 +29,7 @@
 requires 'Cwd';
 requires 'Config::Std';
 requires 'MIME::Lite';
+requires 'Net::SMTP_auth';
 requires 'Template' => '2.14';
 requires 'Error';
 requires 'CGI::Simple';

Modified: trunk/UI/Contact/contact.html
===================================================================
--- trunk/UI/Contact/contact.html	2011-05-24 19:31:21 UTC (rev 3175)
+++ trunk/UI/Contact/contact.html	2011-05-25 04:12:17 UTC (rev 3176)
@@ -486,6 +486,7 @@
 	</tr>
 
 	<tr id="taxform-threshold-row">
+        <?lsmb taxform_list.unshift({}) ?>
 	
 	 <td> <?lsmb INCLUDE select element_data = {
 			name = "taxform_id"

Modified: trunk/sql/modules/Drafts.sql
===================================================================
--- trunk/sql/modules/Drafts.sql	2011-05-24 19:31:21 UTC (rev 3175)
+++ trunk/sql/modules/Drafts.sql	2011-05-25 04:12:17 UTC (rev 3176)
@@ -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/admin.sql
===================================================================
--- trunk/sql/modules/admin.sql	2011-05-24 19:31:21 UTC (rev 3175)
+++ trunk/sql/modules/admin.sql	2011-05-25 04:12:17 UTC (rev 3176)
@@ -621,7 +621,7 @@
 			(p.first_name = in_first_name or in_first_name is null)
 			AND (p.last_name = in_last_name or in_last_name is null)
 			AND (in_ssn is NULL or in_ssn = e.ssn) 
-			AND (e.dob = in_dob or in_dob is NULL)
+			AND (e.dob = in_dob::date or in_dob is NULL)
 	LOOP
 		RETURN NEXT t_return_row;
 	END LOOP;

Modified: trunk/sql/modules/test/Taxform.sql
===================================================================
--- trunk/sql/modules/test/Taxform.sql	2011-05-24 19:31:21 UTC (rev 3175)
+++ trunk/sql/modules/test/Taxform.sql	2011-05-25 04:12:17 UTC (rev 3176)
@@ -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.