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

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



Revision: 6508
          http://sourceforge.net/p/ledger-smb/code/6508
Author:   einhverfr
Date:     2014-01-17 10:56:44 +0000 (Fri, 17 Jan 2014)
Log Message:
-----------
Fixing bug 929, final issue, can't print shipping addresses, merge from trunk

Modified Paths:
--------------
    branches/1.3/Changelog
    branches/1.3/LedgerSMB/Form.pm
    branches/1.3/bin/io.pl

Modified: branches/1.3/Changelog
===================================================================
--- branches/1.3/Changelog	2014-01-17 10:54:59 UTC (rev 6507)
+++ branches/1.3/Changelog	2014-01-17 10:56:44 UTC (rev 6508)
@@ -9,8 +9,9 @@
 * 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)
-* Fixed saveto including all addresses (Chris T, 929)
+* Fixed shipto causing db error on sales invoice (Chris T, 929)
+* Fixed shipto including all addresses (Chris T, 929)
+* Fixed shipto address not showing on 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:54:59 UTC (rev 6507)
+++ branches/1.3/LedgerSMB/Form.pm	2014-01-17 10:56:44 UTC (rev 6508)
@@ -1874,7 +1874,33 @@
     
 }
 
+=item $form->get_shipto ($location_id)
 
+Returns the shipto record of the corresponding location, and attaches the info
+as expected for the templates
+
+=cut
+
+sub get_shipto {
+    my ($self, $location_id) = @_;
+    my $query = qq| select line_one, line_two, city, state, mail_code,
+                           c.name as country 
+                      from location l 
+                      join country c on c.id = l.country_id
+                     where l.id = ? |;
+    my $sth = $self->{dbh}->prepare($query);
+    $sth->execute($location_id);
+    my $ref = $sth->fetchrow_hashref('NAME_lc');
+    $self->{shiptoaddress1} = $ref->{line_one};
+    $self->{shiptoaddress2} = $ref->{line_two};
+    $self->{shiptocity} = $ref->{city};
+    $self->{shiptostate} = $ref->{state};
+    $self->{shiptozipcode} = $ref->{mail_code};
+    $self->{shiptocountry} = $ref->{country};
+    return $ref;    
+}
+
+
 =item $form->get_employee($dbh);
 
 Returns a list containing the name and id of the employee $form->{login}.  Any

Modified: branches/1.3/bin/io.pl
===================================================================
--- branches/1.3/bin/io.pl	2014-01-17 10:54:59 UTC (rev 6507)
+++ branches/1.3/bin/io.pl	2014-01-17 10:56:44 UTC (rev 6508)
@@ -1714,8 +1714,8 @@
       qw(name address1 address2 city state zipcode country contact phone fax email);
 
     $shipto = 1;
-
     # if there is no shipto fill it in from billto
+    $form->get_shipto($form->{locationid}) if $form->{locationid};
     foreach $item (@vars) {
         if ( $form->{"shipto$item"} ) {
             $shipto = 0;

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