Instead of invoices having just one PAYMENT DATE field, why not remove that, and add a RECEIVE PAYMENTS field, from which users can add an amount, and type of payment received (and maybe a note?)

If the payment received is equal to the balance due, the invoice becomes closed. If payment received is less than the balance due, the payment is applied and a new balance is calculated. For payments above the balance due, a warning will show and not allow this.

Comments

juliangb’s picture

I think this is a good suggestion - basically like negative invoice items?

tchurch’s picture

I'm not too sure about removing the payment date or storing balances in the database.

I can see the benefit of having the amount received so that you can keep track of outstanding amounts.

I think the balances should be calculated with viewing the list of invoices or an invoice node, the same with the invoice status.

I know of one customer using storm for invoices who would want to keep the date so that he can calculate (using views/reports) how long it took for customers to pay invoices.

I suggest this:
We add new column on invoice for "received amount".
We change the invoice list and invoice node view so that it displays this and a calculated "remaining balance".
On the invoice list we also have a total "remaining balance". This way you can filter the list by organization (as you can currently) and the remaining balance for that filtered list.

juliangb’s picture

If we stored it though - it'd be a lot easier if we were thinking about making views of invoices etc.

tchurch’s picture

I'm not sure. I can't see the point in storing the result of a calculation of two other columns (i.e. total - payment).

I know this would be something my customer might want to use so I'll play with views over the weekend and see what happens.

JGonzalez’s picture

I'm not saying REMOVE the date - The date can be a field within the RECEIVE PAYMENT item ( $ Amount, Date, Notes (maybe - what are thoughts on this?, and Type of Payment (Cash, Credit, etc))

As for storing the remaining balance. I see that storing the value is really just bulky as we do have the other the total, and payment columns already, and doing this on the fly would be no problem. While it would help out when creating views, would http://drupal.org/project/views_calc be able to do something like this for those that need it?

tchurch’s picture

I'm playing with views and views_calc to see what it can do what's needed. I'll let you know.

tchurch’s picture

It looks like it might work. I used views_calc, created a field containing a calculation with the invoice total and put it in a view.

We could also change the lists to show balances in the same way too.

I could work on this, if you like, after I commit #567558: Extend auto-billing to other types of Storm node into -dev (hopefully this weekend).