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

SF.net SVN: ledger-smb:[6504] branches/1.3



Revision: 6504
          http://sourceforge.net/p/ledger-smb/code/6504
Author:   einhverfr
Date:     2014-01-17 10:34:15 +0000 (Fri, 17 Jan 2014)
Log Message:
-----------
Fixing bug 929, problem 1, db error adding shipto to invoice

Modified Paths:
--------------
    branches/1.3/Changelog
    branches/1.3/LedgerSMB/Form.pm
    branches/1.3/LedgerSMB/OE.pm

Modified: branches/1.3/Changelog
===================================================================
--- branches/1.3/Changelog	2014-01-17 10:32:44 UTC (rev 6503)
+++ branches/1.3/Changelog	2014-01-17 10:34:15 UTC (rev 6504)
@@ -9,6 +9,7 @@
 * Fixed join projection issues in AP Outstanding (Chris T, 950)
 * Added Apache 2.4 configuration file (Chris T)
 * Fixed "save info" reporting "Draft Posted" (Chris T, 925)
+* Fixed saveto causing db error on sales invoice (Chris T, 929)
 
 Changelog for 1.3.36
 * Set default date for AP invoice creation to current date (Chris T)

Modified: branches/1.3/LedgerSMB/Form.pm
===================================================================
--- branches/1.3/LedgerSMB/Form.pm	2014-01-17 10:32:44 UTC (rev 6503)
+++ branches/1.3/LedgerSMB/Form.pm	2014-01-17 10:34:15 UTC (rev 6504)
@@ -1840,7 +1840,7 @@
 
 sub add_shipto {
   
-  	my ( $self,$dbh,$id ) = @_;
+  	my ( $self,$dbh,$id, $oe) = @_;
         if (! $self->{locationid}) {
 		return;
 	}
@@ -1851,10 +1851,18 @@
 			|;
 
         my $sth = $self->{dbh}->prepare($query) || $self->dberror($query);
-
+        my $trans_id;
+        my $oe_id;
+        if ($oe){
+           $trans_id = undef;
+           $oe_id = $id;
+        } else {
+           $trans_id = $id;
+           $oe_id = undef;
+        }  
         $sth->execute(
-                        undef,                     
-			$self->{id},
+                        $trans_id,                     
+			$oe_id,
 			$self->{locationid}
              
 		      ) || $self->dberror($query);

Modified: branches/1.3/LedgerSMB/OE.pm
===================================================================
--- branches/1.3/LedgerSMB/OE.pm	2014-01-17 10:32:44 UTC (rev 6503)
+++ branches/1.3/LedgerSMB/OE.pm	2014-01-17 10:34:15 UTC (rev 6504)
@@ -674,7 +674,7 @@
     $form->{name} = $form->{ $form->{vc} };
     $form->{name} =~ s/--$form->{"$form->{vc}_id"}//;
 
-    $form->add_shipto( $dbh, $form->{id});
+    $form->add_shipto( $dbh, $form->{id}, 1);
 
     # save printed, emailed, queued
 

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