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

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



Revision: 5595
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=5595&view=rev
Author:   einhverfr
Date:     2013-01-16 09:38:30 +0000 (Wed, 16 Jan 2013)
Log Message:
-----------
Fixed lines 2-3 not showing up on address list for customer or vendor

Modified Paths:
--------------
    trunk/Changelog
    trunk/LedgerSMB/Scripts/contact.pm
    trunk/UI/Contact/divs/address.html

Modified: trunk/Changelog
===================================================================
--- trunk/Changelog	2013-01-16 09:14:07 UTC (rev 5594)
+++ trunk/Changelog	2013-01-16 09:38:30 UTC (rev 5595)
@@ -100,6 +100,7 @@
 Robert C)
 * Fixed contact info addition workflow.  Now entering multiple contact records 
 is not a total pain(Chris T)
+* Fixed lines 2 and 3 not showing on address div for contacts (Chris T)
 
 Changelog for 1.3.28
 * Added db list to setup.pl when no db is entered and credentials allow login

Modified: trunk/LedgerSMB/Scripts/contact.pm
===================================================================
--- trunk/LedgerSMB/Scripts/contact.pm	2013-01-16 09:14:07 UTC (rev 5594)
+++ trunk/LedgerSMB/Scripts/contact.pm	2013-01-16 09:38:30 UTC (rev 5595)
@@ -528,11 +528,13 @@
 sub save_location {
     my ($request) = @_;
 
+    my $credit_id = $request->{credit_id};
+    if ($request->{attach_to} == 1){
+       delete $request->{credit_id};
+    }
     my $location = LedgerSMB::Entity::Location->new(%$request);
-    if ($request->{attach_to} eq '1'){
-       $location->credit_id(undef);
-    }
-    $location->id($request->{location_id});
+    $request->{credit_id} = $credit_id;
+    $location->id($request->{location_id}) if $request->{location_id};
     $location->save;
     $request->{target_div} = 'address_div';
     get($request);

Modified: trunk/UI/Contact/divs/address.html
===================================================================
--- trunk/UI/Contact/divs/address.html	2013-01-16 09:14:07 UTC (rev 5594)
+++ trunk/UI/Contact/divs/address.html	2013-01-16 09:38:30 UTC (rev 5595)
@@ -55,6 +55,17 @@
              DISPLAY = LOC;
         END;
     END; ?><?lsmb
+
+    FOREACH loc IN locations;
+         loc.address = loc.line_one;
+         IF loc.line_two;
+            loc.address = loc.address _ '<br />' _ loc.line_two;
+         END;
+         IF loc.line_three;
+            loc.address = loc.address _ '<br />' _ loc.line_three;
+         END;
+    END;
+
     PROCESS dynatable 
                tbody = {rows = locations}
           attributes = {id = 'location_table'
@@ -62,7 +73,7 @@
              columns = [
        {col_id = 'is_for_credit', type = 'text', name = text('This Account') } #'
        {col_id = 'type', type = 'text', name=text('Type') }
-       {col_id = 'line_one', type='text', name=text('Address1') }
+       {col_id = 'address', type='text', name=text('Address') }
        {col_id = 'city', type='text', name=text('City') }
        {col_id = 'state', type='text', name=text('State/Province') }
        {col_id = 'mail_code', type='text', name=text('Zip/Post Code') } #'

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