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

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



Revision: 2883
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=2883&view=rev
Author:   einhverfr
Date:     2010-02-10 05:07:58 +0000 (Wed, 10 Feb 2010)

Log Message:
-----------
Correcting initiate.pl login errors

Modified Paths:
--------------
    trunk/LedgerSMB/IC.pm
    trunk/LedgerSMB/Initiate.pm
    trunk/bin/initiate.pl

Property Changed:
----------------
    trunk/account.pl
    trunk/initiate.pl

Modified: trunk/LedgerSMB/IC.pm
===================================================================
--- trunk/LedgerSMB/IC.pm	2010-02-10 04:43:40 UTC (rev 2882)
+++ trunk/LedgerSMB/IC.pm	2010-02-10 05:07:58 UTC (rev 2883)
@@ -33,6 +33,10 @@
 
 package IC;
 
+use LedgerSMB::Log;
+
+my $logger = Log::Log4perl->get_logger('IC');
+
 sub get_part {
     my ( $self, $myconfig, $form ) = @_;
 
@@ -95,6 +99,8 @@
 
     }
 
+    $logger->debug("item: $form->{item}");
+
     # setup accno hash for <option checked>
     # {amount} is used in create_links
     for (qw(inventory income expense)) {
@@ -162,11 +168,12 @@
 
         # get vendors
         $query = qq|
-			  SELECT v.id, v.name, pv.partnumber,
+			  SELECT v.id, e.name, pv.partnumber,
 			         pv.lastcost, pv.leadtime, 
 			         pv.curr AS vendorcurr
 			    FROM partsvendor pv
-			    JOIN vendor v ON (v.id = pv.vendor_id)
+			    JOIN vendor v ON (v.id = pv.entity_id)
+                JOIN entity e ON (e.id = pv.entity_id)
 			   WHERE pv.parts_id = ?
 			ORDER BY 2|;
 
@@ -185,13 +192,14 @@
         $query = qq|
 			   SELECT pc.pricebreak, pc.sellprice AS customerprice,
 			          pc.curr AS customercurr, pc.validfrom, 
-			          pc.validto, c.name, c.id AS cid, 
+			          pc.validto, e.name, c.id AS cid, 
 			          g.pricegroup, g.id AS gid
 			     FROM partscustomer pc
 			LEFT JOIN customer c ON (c.id = pc.customer_id)
 			LEFT JOIN pricegroup g ON (g.id = pc.pricegroup_id)
+                 JOIN entity e ON (e.id = c.entity_id)
 			    WHERE pc.parts_id = ?
-			 ORDER BY c.name, g.pricegroup, pc.pricebreak|;
+			 ORDER BY e.name, g.pricegroup, pc.pricebreak|;
         $sth = $dbh->prepare($query);
         $sth->execute( $form->{id} ) || $form->dberror($query);
 
@@ -1807,6 +1815,8 @@
 sub create_links {
     my ( $self, $module, $myconfig, $form ) = @_;
 
+    $logger->debug('start');
+
     # connect to database
     my $dbh = $form->{dbh};
 

Modified: trunk/LedgerSMB/Initiate.pm
===================================================================
--- trunk/LedgerSMB/Initiate.pm	2010-02-10 04:43:40 UTC (rev 2882)
+++ trunk/LedgerSMB/Initiate.pm	2010-02-10 05:07:58 UTC (rev 2883)
@@ -54,6 +54,9 @@
 
       if(scalar($self->{initiateon})==1)
       {
+          if (!$form->{company}){
+               $form->{company} = 'template1';
+          }
           $form->{company}=${LedgerSMB::Sysconfig::default_db};
 	  $form->{port}=${LedgerSMB::Sysconfig::port};
           $form->{host}=${LedgerSMB::Sysconfig::host};
@@ -327,6 +330,9 @@
 {
 
  	my($self,$form,$dbfile)..hidden..;
+        if ($ENV{PGDATABASE} eq 'template1'){
+           $form->error('No database specified!');
+        }
 	system("psql < $dbfile");
 }
 


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

Modified: trunk/bin/initiate.pl
===================================================================
--- trunk/bin/initiate.pl	2010-02-10 04:43:40 UTC (rev 2882)
+++ trunk/bin/initiate.pl	2010-02-10 05:07:58 UTC (rev 2883)
@@ -133,8 +133,7 @@
 			<tr class="listheading">
 				<th>$self->{title}</th>
 			</tr>
-			<tr size="5"></tr>
-			</tr>|;
+			<tr size="5"></tr>|;
     
 
     print qq|		


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


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