Simple patch to make BambooInvoice use OpenGoo companies for contacts. Replace "og_" with your OpenGoo table names prefix.
diff --git a/bamboo_system_files/application/models/clients_model.php b/bamboo_system_files/application/models/clients_model.php
index fc6da08..939db6c 100755
--- a/bamboo_system_files/application/models/clients_model.php
+++ b/bamboo_system_files/application/models/clients_model.php
@@ -26,8 +26,32 @@ class clients_model extends Model {
// $companies[$company->id] = $company->name;
// }
+ // goodified
+ return $this->db->query( '
+ select
+ ogc.id,
+ ogc.name,
+ ogc.address as address1,
+ ogc.address2 as address2,
+ ogc.city,
+ ogc.state as province,
+ ogc.zipcode as postal_code,
+ ogc.country as country,
+ ogc.homepage as website,
+ ogc.notes as client_notes,
+ ogts.value as tax_status,
+ ogtc.value as tax_code
+ from og_companies as ogc
+ left join (
+ select * from og_object_properties where name="tax_status"
+ ) ogts on ogts.rel_object_id = ogc.id
+ left join (
+ select * from og_object_properties where name="tax_code"
+ ) ogtc on ogtc.rel_object_id = ogc.id
+ ' );
+
+ // Originnal code
$this->db->orderby('name', 'asc');
-
return $this->db->get('clients');
}
@@ -35,6 +59,30 @@ class clients_model extends Model {
function get_client_info($id, $fields = '*')
{
+ // goodified
+ return $this->db->query( '
+ select
+ ogc.id,
+ ogc.name,
+ ogc.address as address1,
+ ogc.address2 as address2,
+ ogc.city,
+ ogc.state as province,
+ ogc.zipcode as postal_code,
+ ogc.country as country,
+ ogc.homepage as website,
+ ogc.notes as client_notes,
+ ogts.value as tax_status,
+ ogtc.value as tax_code
+ from og_companies as ogc
+ left join (
+ select * from og_object_properties where name="tax_status"
+ ) ogts on ogts.rel_object_id = ogc.id
+ left join (
+ select * from og_object_properties where name="tax_code"
+ ) ogtc on ogtc.rel_object_id = ogc.id
+ where ogc.id = ' . intval( $id ) )->row( );
+
$this->db->select($fields);
$this->db->where('id', $id);
Add "tax_code" and "tax_status" properties to OpenGoo company objects.
Then apply in bamboo invoice root with command `patch -P1 < /path/to/patch`