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

SF.net SVN: ledger-smb:[6591] trunk/LedgerSMB/AA.pm



Revision: 6591
          http://sourceforge.net/p/ledger-smb/code/6591
Author:   tshvr
Date:     2014-01-21 13:56:15 +0000 (Tue, 21 Jan 2014)
Log Message:
-----------
tshvr4 trunk svn-revison 6589,$form->login seems to contain id instead of name or ,so person_id not found,thus reports with join on person_id not working,quick fix,use employee_name

Modified Paths:
--------------
    trunk/LedgerSMB/AA.pm

Modified: trunk/LedgerSMB/AA.pm
===================================================================
--- trunk/LedgerSMB/AA.pm	2014-01-21 13:38:36 UTC (rev 6590)
+++ trunk/LedgerSMB/AA.pm	2014-01-21 13:56:15 UTC (rev 6591)
@@ -299,7 +299,9 @@
 
     my ( $fxgain_accno_id, $fxloss_accno_id ) = $dbh->selectrow_array($query);
 
-    ( $null, $form->{employee_id} ) = split /--/, $form->{employee};
+    #tshvr4 trunk svn-revison 6589,$form->login seems to contain id instead of name or '',so person_id not found,thus reports with join on person_id not working,quick fix,use employee_name
+    #( $null, $form->{employee_id} ) = split /--/, $form->{employee};
+    ( $form->{employee_name}, $form->{employee_id} ) = split /--/, $form->{employee};
     unless ( $form->{employee_id} ) {
         ( $form->{employee}, $form->{employee_id} ) = $form->get_employee($dbh);
     }
@@ -351,20 +353,20 @@
         # AR/AP Transaction.
         # ~A
 
-    #tshvr4 trunk svn-revison 6589,$form->login seems to contain id instead of name,person_id not found,reports with join on person_id not working
+    #tshvr4 trunk svn-revison 6589,$form->login seems to contain id instead of name or '',so person_id not found,thus reports with join on person_id not working,quick fix,use employee_name
     $query = qq|
 			INSERT INTO $table (invnumber, person_id, 
 				entity_credit_account)
 			     VALUES (?,    (select  u.entity_id from users u
                  join entity e on(e.id = u.entity_id)
-                 where u.id=? and u.entity_id in(select p.entity_id from person p) ), ?)|;
-                 #where u.username=? and u.entity_id in(select p.entity_id from person p) ), ?)|;
+                 where u.username=? and u.entity_id in(select p.entity_id from person p) ), ?)|;
 
         # the second param is undef, as the DBI api expects a hashref of
         # attributes to pass to $dbh->prepare. This is not used here.
         # ~A
         
-    $dbh->do($query,undef,$uid,$form->{login}, $form->{"$form->{vc}_id"}) || $form->dberror($query);
+    #$dbh->do($query,undef,$uid,$form->{login}, $form->{"$form->{vc}_id"}) || $form->dberror($query);
+    $dbh->do($query,undef,$uid,$form->{employee_name}, $form->{"$form->{vc}_id"}) || $form->dberror($query);
 
     $query = qq|
 			SELECT id FROM $table

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


------------------------------------------------------------------------------
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For
Critical Workloads, Development Environments & Everything In Between.
Get a Quote or Start a Free Trial Today. 
http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk
_______________________________________________
Ledger-smb-commits mailing list
..hidden..
https://lists.sourceforge.net/lists/listinfo/ledger-smb-commits