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

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



Revision: 4330
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=4330&view=rev
Author:   einhverfr
Date:     2012-02-18 09:40:50 +0000 (Sat, 18 Feb 2012)
Log Message:
-----------
Correcting a number of load errors on db scripts and workflow scripts

Modified Paths:
--------------
    trunk/LedgerSMB/Scripts/login.pm
    trunk/LedgerSMB/Scripts/setup.pm
    trunk/LedgerSMB/Session.pm
    trunk/sql/modules/Company.sql
    trunk/sql/modules/Payment.sql

Modified: trunk/LedgerSMB/Scripts/login.pm
===================================================================
--- trunk/LedgerSMB/Scripts/login.pm	2012-02-18 06:17:00 UTC (rev 4329)
+++ trunk/LedgerSMB/Scripts/login.pm	2012-02-18 09:40:50 UTC (rev 4330)
@@ -115,7 +115,7 @@
     if (!$request->{_user}){
         __default($request);
     }
-    require "scripts/menu.pl";
+    require LedgerSMB::Scripts::menu;
     LedgerSMB::Scripts::menu::root_doc($request);
 
 }

Modified: trunk/LedgerSMB/Scripts/setup.pm
===================================================================
--- trunk/LedgerSMB/Scripts/setup.pm	2012-02-18 06:17:00 UTC (rev 4329)
+++ trunk/LedgerSMB/Scripts/setup.pm	2012-02-18 09:40:50 UTC (rev 4330)
@@ -59,24 +59,6 @@
             company_name => $request->{database},
                 password => $creds->{password}}
     );
-    my $server_info = $database->server_version;
-    my @sv_info = split '.', $server_info;
-    if (($sv_info[0] > 9)or ($sv_info[0]  == 9 and $sv_info[1] >= 1)){
-       if (! -f "$ENV{PG_CONTRIB_DIR}/tablefunc.control"){
-            $request->error($request->{_locale}->text(
-                      'Cannot find Contrib script [_1] in [_2].',
-                      "tablefunc.control", $ENV{PG_CONTRIB_DIR}
-            ));
-       }
-    } else {
-       if (! -f "$ENV{PG_CONTRIB_DIR}/tablefunc.sql"){
-            $request->error($request->{_locale}->text(
-                      'Cannot find Contrib script [_1] in [_2].',
-                      "tablefunc.sql", $ENV{PG_CONTRIB_DIR}
-            ));
-      
-       }
-    }
     
     my $version_info = $database->get_info();
     if(!$request->{dbh}){$request->{dbh}=$database->{dbh};}#allow upper stack to disconnect dbh when leaving
@@ -694,6 +676,9 @@
             company_name => $request->{database},
                 password => $creds->{password}}
     );
+    my $rc;
+    my $rc2;
+    my $temp;
 
     # ENVIRONMENT NECESSARY
     $ENV{PGUSER} = $creds->{login};

Modified: trunk/LedgerSMB/Session.pm
===================================================================
--- trunk/LedgerSMB/Session.pm	2012-02-18 06:17:00 UTC (rev 4329)
+++ trunk/LedgerSMB/Session.pm	2012-02-18 09:40:50 UTC (rev 4330)
@@ -37,7 +37,7 @@
     my $secure;
 
    if ($cookie eq 'Login'){
-        return session_create($form);
+        return create($form);
     }
     my $timeout;
 

Modified: trunk/sql/modules/Company.sql
===================================================================
--- trunk/sql/modules/Company.sql	2012-02-18 06:17:00 UTC (rev 4329)
+++ trunk/sql/modules/Company.sql	2012-02-18 09:40:50 UTC (rev 4330)
@@ -78,7 +78,7 @@
             a.id as invoice_id, a.invnumber, a.curr::text, 
             p.id AS parts_id, p.partnumber, 
             i.description, i.qty, i.unit::text, i.sellprice, i.discount, 
-            i.deliverydate, pr.id as project_id, pr.projectnumber,
+            i.deliverydate, null::int as project_id, null::text as projectnumber,
             i.serialnumber, 
             case when $16 = 1 then xr.buy else xr.sell end as exchange_rate,
             ee.id as salesperson_id, 
@@ -130,17 +130,16 @@
                   and (($17 and not closed) or ($18 and closed))
           ) a ON (a.entity_credit_account = eca.id) -- broken into unions 
                                                     -- for performance
-     JOIN ( select trans_id, parts_id, qty, description, unit, discount,
-                   deliverydate, serialnumber, project_id, sellprice
+     JOIN ( select id, trans_id, parts_id, qty, description, unit, discount,
+                   deliverydate, serialnumber, sellprice
              FROM  invoice where $13 = 'i'
             union 
-            select trans_id, parts_id, qty, description, unit, discount,
-                   reqdate, serialnumber, project_id, sellprice
+            select id, trans_id, parts_id, qty, description, unit, discount,
+                   reqdate, serialnumber, sellprice
              FROM orderitems where $13 <> 'i'
           ) i on i.trans_id = a.id
      JOIN parts p ON (p.id = i.parts_id)
 LEFT JOIN exchangerate ex ON (ex.transdate = a.transdate)
-LEFT JOIN project pr ON (pr.id = i.project_id)
 LEFT JOIN entity ee ON (a.person_id = ee.id)
 LEFT JOIN person ep ON (ep.entity_id = ee.id)
      JOIN exchangerate xr ON a.transdate = xr.transdate

Modified: trunk/sql/modules/Payment.sql
===================================================================
--- trunk/sql/modules/Payment.sql	2012-02-18 06:17:00 UTC (rev 4329)
+++ trunk/sql/modules/Payment.sql	2012-02-18 09:40:50 UTC (rev 4330)
@@ -841,47 +841,7 @@
 complex types and arrays of those (requires Pg 8.4 or higher).
 $$;
 
--- Move this to the projects module when we start on that. CT
-CREATE OR REPLACE FUNCTION project_list_open(in_date date) 
-RETURNS SETOF project AS
-$$
-DECLARE out_project project%ROWTYPE;
-BEGIN
-	FOR out_project IN
-		SELECT * from project
-		WHERE startdate <= in_date AND enddate >= in_date
-		      AND completed = 0
-	LOOP
-		return next out_project;
-	END LOOP;
-END;
-$$ language plpgsql;
 
-comment on function project_list_open(in_date date) is
-$$ This function returns all projects that were open as on the date provided as
-the argument.$$;
--- Move this to the projects module when we start on that. CT
-
-
-CREATE OR REPLACE FUNCTION department_list(in_role char)
-RETURNS SETOF department AS
-$$
-DECLARE out_department department%ROWTYPE;
-BEGIN
-       FOR out_department IN
-               SELECT * from department
-               WHERE role = coalesce(in_role, role)
-       LOOP
-               return next out_department;
-       END LOOP;
-END;
-$$ language plpgsql;
--- Move this into another module.
-
-comment on function department_list(in_role char) is
-$$ This function returns all department that match the role provided as
-the argument.$$;
-
 CREATE OR REPLACE FUNCTION payments_get_open_currencies(in_account_class int)
 RETURNS SETOF char(3) AS
 $$

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