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

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



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

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

Modified: trunk/Changelog
===================================================================
--- trunk/Changelog	2014-01-17 10:39:35 UTC (rev 6506)
+++ trunk/Changelog	2014-01-17 10:54:59 UTC (rev 6507)
@@ -109,8 +109,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: trunk/LedgerSMB/Form.pm
===================================================================
--- trunk/LedgerSMB/Form.pm	2014-01-17 10:39:35 UTC (rev 6506)
+++ trunk/LedgerSMB/Form.pm	2014-01-17 10:54:59 UTC (rev 6507)
@@ -1740,7 +1740,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: trunk/bin/io.pl
===================================================================
--- trunk/bin/io.pl	2014-01-17 10:39:35 UTC (rev 6506)
+++ trunk/bin/io.pl	2014-01-17 10:54:59 UTC (rev 6507)
@@ -1791,8 +1791,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