Feng Forum

Other Topics => Development => Applications => Topic started by: gylf on October 07, 2008, 06:26:31 pm

Title: Billing
Post by: gylf on October 07, 2008, 06:26:31 pm
For your next addition to the "Goo" I would request looking at some billing programs out there to integrate.  I highly recommend keeping it simple; not an application with too many features (like inventory tracking, vendors, etc), just something basic which would allow tracked time to be converted to invoices.

One great solution out there is http://www.bambooinvoice.org/
It is GPL and simply does billing (and does it very well).  I have not looked at the DB structure but on the surface it looks similar in principle to OpenGoo.

Just an idea for post v1.0... I think it would make an excellent addition to the Goo! 
Title: Re: Billing
Post by: conrado on October 08, 2008, 08:55:15 am
Indeed it would!

Thanks!

PS: I'm moving this topic to the Applications (http://forums.opengoo.org/index.php?board=6.0) board.
Title: Re: Billing
Post by: savagephp on October 16, 2008, 12:12:31 am
Any chance this could get incorporated soon? I've been unhappy with every commercial and open source time keeping application I've looked at so I had to make my own. But to have it incorporated into a collaboration system like opengoo would make it that much better. If a timekeeping/billing/invoicing application were to be included in opengoo, that would make it everything I (and I'm sure others) would need. This is the only thing missing for me.

Great job guys!
Title: Re: Billing
Post by: conrado on October 16, 2008, 09:19:11 am
Unfortunately, as much as I would like to see this addition too, I do not see this happening soon (at least not with the current pace of community growth).

Over the next months I feel we should focus on improving the usability and robustness of what we already have, before adding new applications.

This is not to say that if someone comes with the addition we wouldn't happily goo-it in. There should already be some simple GPL billing apps that could be re-used to achieve this without starting from scratch.

Another possibility is finding someone interested in sponsoring this, so that we can add more coders to the team.

Ideas?
Title: Re: Billing
Post by: savagephp on October 16, 2008, 11:46:59 pm
How much of a sponsorship would you need to make this happen?
Title: Re: Billing
Post by: conrado on October 17, 2008, 09:34:23 am
Hum. That would depend on the specific requirements. Billing systems could easily become very complex.

Do you have a set of specs already?
Title: Re: Billing
Post by: Capitan on November 28, 2008, 06:16:41 pm
I'm also using bamboo invoices alongside opengoo.  It would be great if they could, at the least, exchange contact information with each other.

Very interested in the future of this
Title: Re: Billing
Post by: jesuspresley on June 07, 2009, 02:13:14 pm
I would be interested in an invoicing module, too.
Can donate 40 $ if that helps.
Also, I hereby offer my help to translate it.
Title: Re: Billing
Post by: soj on June 25, 2009, 06:52:50 am
Me too!

Pls pls pls!!!!  ;D
Title: Re: Billing
Post by: conrado on June 28, 2009, 07:48:48 am
There is a billing module already!  :D
Title: Re: Billing
Post by: Capitan on June 28, 2009, 12:45:59 pm
yes. but something to create invoices is what we need:)
Title: Re: Billing
Post by: conrado on June 29, 2009, 08:23:56 pm
Oh, that's right. Well, the main problem with invoicing is that it is affected by country laws.
Title: Re: Billing
Post by: Capitan on June 29, 2009, 08:26:07 pm
as far as taxes, you mean?

If you could just generate a module that can create/print invoices without tax support, that would still be close to where it should be.  Some people provide services, like medical or legal, that do not really have the tax or vat included.
Title: Re: Billing
Post by: conrado on June 30, 2009, 12:23:56 pm
Yes, but not only taxes. I believe invoice numbering and paper size is also conditioned by law sometimes.
Title: Re: Billing
Post by: Capitan on June 30, 2009, 05:12:28 pm
I see.  I don't think that bamboo deals with any of that, so I think you could easily add the same functionality to ogoo so we, who love ogoo, can ditch bamboo:)
Title: Re: Billing
Post by: mencom on August 13, 2009, 05:48:34 pm
Yes, but not only taxes. I believe invoice numbering and paper size is also conditioned by law sometimes.

Too bad, it would be great to have an invoice application in OpenGoo. I think that's the only thing that's really missing at the moment.

Title: Re: Billing
Post by: Capitan on August 13, 2009, 05:50:19 pm
I agree.  I'm a bit confused at why, if there's a billing/invoice feature in place, it requires things that bamboo invoices doesn't even do. 
Title: Re: Billing
Post by: mrmango on November 10, 2009, 09:39:41 am
Not looked at the data structure for either, but a data link between the two, should be fairly easy. I could write one and have it in Java, as a scheduled task.

Cheers
Title: Re: Billing
Post by: jpic on November 19, 2009, 03:36:40 pm
Simple patch to make BambooInvoice use OpenGoo companies for contacts. Replace "og_" with your OpenGoo table names prefix.

Code: [Select]
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`
Title: Re: Billing
Post by: Capitan on November 19, 2009, 07:23:11 pm
I appreciate the patch, but I think a lot of people do not use each entry as a company.

For instance, myself, I have a workspace called "Clients" with all of the subworkspaces for different clients, etc.  The clients workspace has all the contacts I have.

Each contact is not a company.  I think many people would not have every single contact as a different "company."  What could we do?
Title: Re: Billing
Post by: jpic on November 20, 2009, 06:17:28 am
I appreciate the patch, but I think a lot of people do not use each entry as a company.
True for b2c, this version supports billing individuals as a company.

Each contact is not a company.  I think many people would not have every single contact as a different "company."  What could we do?
Actually i just did this as an exercise to evaluate BambooInvoice; we only do b2b so we never bill contacts although this version supports it.

http://pub.ocpsys.com/opengoo/bamboo_b2c/bamboo_system_files/application/models/clients_model.txt

But it looks better to consider a simple bridge design for b2b: OG companies for BI clients, and OG contacts for BI contacts.

Also, the SQL might break OpenGoo. So i'm unsure that we can have a unique in object_properties table with columns rel_object_id, rel_object_manager, name. Try it out on:
http://goo.ocpsys.com/ user: jpic pass: demo
http://boo.ocpsys.com/ user:demo@example.com pass: demo

For instance, myself, I have a workspace called "Clients" with all of the subworkspaces for different clients, etc.  The clients workspace has all the contacts I have.
In that case, joinning tables project_contacts and project_companies looks trivial to implement.
I'm running out of free time, i'll implement next time.

In any case, Capitan, thanks for your input. If you don't mind, please elaborate more next time.
Title: Re: Billing
Post by: Capitan on November 20, 2009, 11:05:43 am
Thanks!  I look forward to future versions that may support my type of setup so I can start using it.
I really hate having to create a duplicate entry for clients in bamboo after i created them already in opengoo.
Title: Re: Billing
Post by: jpic on November 20, 2009, 12:27:08 pm
My bad, i wasn't very clear.

The first version posted as a patch inside the forum post on November 19 only supports OG companies to be used for BI clients.

The second version posted as a link in the forum post on November 20 supports using OG companies and clients for the BI clients. Additionnaly, it supports 2-way updating in a way that looks safe to me.

Feel free to try the second version online with the demo credentials provided, and report bugs or see if it fits your needs or not - it's open source.

Again, thanks Capitan for your help  8)
Title: Re: Billing
Post by: Capitan on November 22, 2009, 05:43:35 am
Well, Im wondering if I should backup my opengoo db first;)

im a bit scared of the two way writing!

Is this the one I should use?

http://pub.ocpsys.com/opengoo/bamboo_b2c/bamboo_system_files/application/models/clients_model.txt
Title: Re: Billing
Post by: jpic on November 22, 2009, 07:50:31 am
Derek Allard kindly uploaded BambooInvoice sources on github which makes it easier to hack the fork.

Writing on OpenGoo table can be disabled with version b2c0.1, feel free to consult the complete changelog (http://github.com/jpic/BambooInvoice/commits/b2c/).

Consider the full documentation on http://github.com/jpic/BambooInvoice/tree/b2c0.1 (http://github.com/jpic/BambooInvoice/tree/b2c0.1).
Title: Re: Billing
Post by: Capitan on November 22, 2009, 01:37:31 pm
I tried creating a new contact called mister client and put as his email, foo@ba2r.com.

It didn't copy his email over to bamboo.

Also, what will this do with existing clients/invoices in bamboo?   As in, as soon as I implement this patch, will I have duplicates because I had manually created the same people in bamboo before and invoices for them.
Title: Re: Billing
Post by: jpic on November 22, 2009, 02:06:35 pm
Quote
I tried creating a new contact called mister client and put as his email, foo@ba2r.com.

Thanks for testing and giving feedback! I really appreciate.

About update OpenGoo company or contacts database, it is useful to set "tax class" and "tax code" from BI, so that might not be something you want to deactivate after all.

Quote
Also, what will this do with existing clients/invoices in bamboo?
It doesn't make any change in Bamboo database.

Quote
As in, as soon as I implement this patch, will I have duplicates because I had manually created the same people in bamboo before and invoices for them.
You will not see BI clients at all anymore, so there should be no duplicate. Relations between clients and invoices should be broken because "id" of OG companies/contacts is not the same as the "id" of BI clients. Don't worry, invoices is the objective of the next version.

Quote
It didn't copy his email over to bamboo.
There is no email field in BI clients... Only in BI clientcontact.

Where do you put client email in BI? (url)
How many BI clients and BI clientcontacts do you have approximately?
Title: Re: Billing
Post by: Capitan on November 22, 2009, 02:11:01 pm
I click "add contact" in BI to add an email address, so I can email invoices to people.

What will happen to my existing invoice relationships when they are broken, then?  Do I need to wait till next version to properly assign them to the correct client?

thanks!
Title: Re: Billing
Post by: jpic on November 22, 2009, 02:17:31 pm
I understand how to fix the invoice and email contact problem, for new clients.

How do you suggest to find the OpenGoo company or contact for existing BI clients? That's all i need to know then i can fix old relations ...
Title: Re: Billing
Post by: Capitan on November 22, 2009, 03:38:06 pm
I really don't know short of some interactive option.   I don't think bamboo allows moving invoices to different clients?
Title: Re: Billing
Post by: Capitan on November 25, 2009, 08:33:22 pm
I want to go ahead and try your patch, but I don't know how to assign the old invoices to new clients it creates, etc.

Also, I had to upgrade to .9.0 of bi because I upgraded to new php with fedora 12

http://forums.bambooinvoice.org/index.php/forums/viewthread/1011/
Title: Re: Billing
Post by: jpic on November 26, 2009, 07:13:35 am
It is better to wait for the next version, please.
Title: Re: Billing
Post by: Capitan on January 27, 2010, 04:01:37 am
I don't know when that is going to be:(

Any other options for billing/invoicing?
Title: Re: Billing
Post by: jpic on January 27, 2010, 09:26:00 am
I don't know when that is going to be:(

Right, it seems i can't go further without budget until march. It would be nice if another programmer would contribute a day or two on this or another solution (click "fork" on github).