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

SF.net SVN: ledger-smb:[4924] addons/1.3



Revision: 4924
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=4924&view=rev
Author:   einhverfr
Date:     2012-06-19 13:28:05 +0000 (Tue, 19 Jun 2012)
Log Message:
-----------
Nested partsgroups backport

Modified Paths:
--------------
    addons/1.3/colombia_general/trunk/LedgerSMB/ScriptLib/Company_Co.pm
    addons/1.3/colombia_general/trunk/UI/Contact/divs/colombia_company.html

Added Paths:
-----------
    addons/1.3/nested_partsgroups/
    addons/1.3/nested_partsgroups/trunk/
    addons/1.3/nested_partsgroups/trunk/patches/
    addons/1.3/nested_partsgroups/trunk/sql/
    addons/1.3/nested_partsgroups/trunk/sql/nested_partsgroups/
    addons/1.3/nested_partsgroups/trunk/sql/nested_partsgroups/install.sql

Modified: addons/1.3/colombia_general/trunk/LedgerSMB/ScriptLib/Company_Co.pm
===================================================================
--- addons/1.3/colombia_general/trunk/LedgerSMB/ScriptLib/Company_Co.pm	2012-06-19 13:18:32 UTC (rev 4923)
+++ addons/1.3/colombia_general/trunk/LedgerSMB/ScriptLib/Company_Co.pm	2012-06-19 13:28:05 UTC (rev 4924)
@@ -54,6 +54,10 @@
     @{$request->{city_list}} = $request->call_procedure(
             procname => 'entity__get_municipalities'
     );
+    my ($entity) = $dbhandle->call_procedure(procname => 'entity__get_entity',
+                                                 args => [$request->{entity_id}]
+    );
+    $request->merge($entity);
     my @persons = $dbhandle->exec_method({funcname => 'entity__get_persons'});
     $request->merge(shift @persons);
     LedgerSMB::ScriptLib::Company::get($request);
@@ -76,7 +80,11 @@
         #$logger->debug("\$company = " . Data::Dumper::Dumper($company));
         $company->save();
         $company->exec_method({funcname => 'person__save'}) if $request->{first_name} and $request->{last_name};
-        $company->exec_method({funcname => 'entity__set_muni_province'});
+        $company->exec_method({funcname => 'entity__set_muni_province',
+                               args => [$company->{entity_id},
+                                        $company->{province_id},
+                                        $company->{municipality_id}]});
+        $company->{dbh}->commit;
     }
     get($request);
 }

Modified: addons/1.3/colombia_general/trunk/UI/Contact/divs/colombia_company.html
===================================================================
--- addons/1.3/colombia_general/trunk/UI/Contact/divs/colombia_company.html	2012-06-19 13:18:32 UTC (rev 4923)
+++ addons/1.3/colombia_general/trunk/UI/Contact/divs/colombia_company.html	2012-06-19 13:28:05 UTC (rev 4924)
@@ -112,9 +112,9 @@
 		<?lsmb INCLUDE select element_data = {
 			text_attr = "name"
 			value_attr = "id"
-			default_values = [province_id]
+			default_values = [municipality_id]
 			options = city_list
-			name = "city_id"
+			name = "municipality_id"
 			label = text('City') 
 	} ?> 
 </div>

Added: addons/1.3/nested_partsgroups/trunk/sql/nested_partsgroups/install.sql
===================================================================
--- addons/1.3/nested_partsgroups/trunk/sql/nested_partsgroups/install.sql	                        (rev 0)
+++ addons/1.3/nested_partsgroups/trunk/sql/nested_partsgroups/install.sql	2012-06-19 13:28:05 UTC (rev 4924)
@@ -0,0 +1,2 @@
+alter table partsgroup add parent int references partsgroup(id);
+

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