Paying off invoices under a billing account

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Paying off invoices under a billing account

Bob Morley
My hope is that someone has some knowledge about how billing accounts are supposed to work in the system.  Here is our scenario:

a) User creates an order and elects to pay with their billing account.  This ultimately creates a completed order with an order payment preference of typing EXT_BILLACT and status "PAYMENT_NOT_RECEIVED".  The status is the result of logic that checks for payment method types that start with "EXT" (deeming them external) and remarks that because it is external a notification of receipt is required.

b) This completed order creates an invoice with the total amount due for the customer.

c) Using the BillingAccountWorker one can invoke the "getBillingAccountBalance" which effectively takes the account limit subtracts any order payment preferences (to billing account, not cancelled/rejected, payment not settled, receivd, declined, cancelled) and adds any payment applications to the billing account that are not specific tied to an invoice.

Ok so things look pretty good ... you have an outstanding order payment perference which is reducing the available amount on the billing account and the dude has an invoice to pay.

NOW -- here is the fun part ...

a) I go and create a payment and apply it to my invoice.  Invoice goes into PAID status.
b) Money is not freed up under the billing account.  The chief reason here is that the status on the order payment preference is still NOT_RECEIVED -- nothing goes to change this status.

QUESTION --

It seems to me the proper thing to do is when payments are applied to the invoice (from an order under the billing account) that (if the full amount is paid on the invoice) the order payment preference should be moved to PAYMENT_RECEIVED status.  If only a partial is applied, then the order payment preference should be split into two order payment preferences by the amount being applied and the applied order payment perference should be PAYMENT_RECEIVED with the other portion still awaiting ...

The other three options that I can come up with are ...

a) Change the billing account worker calculation to no longer exclude billing account applications to invoices (this would add the applied amount to the account balance, effectly netting out the amount subtracted from the order).

b) Change the billing account worker to exclude completed orders from the calculation and start including the outstanding amount on invoices tied to the billing account.

c) Putting an exclude in for billing accounts so that their order payment preferences are immediately marked as RECEIVED (but remain as is for all other EXT* payment method types).

Does anyone have any knowledge around billing accounts and perhaps point me in the proper direction.  For our internal project I am going to apply the initial solution I suggested.  I am more than happy to contribute this back if it makes sense, but if the business rules or my assumptions are incorrect I would be more than happy to do something else.
Reply | Threaded
Open this post in threaded view
|

Re: Paying off invoices under a billing account

Sharan-F
Hi Bob

I'm no expert but I wrote the online help for the billing account screens.

I've got a question from a process point of view. If your customer pays on an invoice by invoice basis then why use a billing account? The standard invoice payment process functionality (with agreements if you want to give them a grace period in which to pay) can handle this.

I would say that if your customer wants to consolidate more than one invoice into a statement that you could issue to them and then they make say one payment at the end of the month that will cover multiple invoices then the billing account would be the way to go.

I've done some testing this morning and something has changed (ie. Isnt working anymore) in the billing accounts functionality since I wrote the help screens because I went through and tested everything at the time.

Anyway when it was working this is what you could do:

If you use the billing account screens to input the payment (instead of the payment screens) then you have the option to apply all or some of that payment to the outstanding invoices on the billing account – so partial payment of invoices are catered for.

The 'Capture' button next to the invoice would do the invoice application of the payment plus create any partial and outstanding applications. (And it's the 'Capture' button that's stopped working)

Not sure if this helps you much but I'd be very interested to see any other responses you get about this as it will help me to update the documentation. In the mean time I'll see if I can track down this new bug (if thats what it is)  and report it on a Jira.

Thanks
Sharan
Reply | Threaded
Open this post in threaded view
|

Re: Paying off invoices under a billing account

Ean Schuessler
Sharan-F wrote:

> I've got a question from a process point of view. If your customer pays on
> an invoice by invoice basis then why use a billing account? The standard
> invoice payment process functionality (with agreements if you want to give
> them a grace period in which to pay) can handle this.
>
> I would say that if your customer wants to consolidate more than one invoice
> into a statement that you could issue to them and then they make say one
> payment at the end of the month that will cover multiple invoices then the
> billing account would be the way to go.
>
> I've done some testing this morning and something has changed (ie. Isnt
> working anymore) in the billing accounts functionality since I wrote the
> help screens because I went through and tested everything at the time.
>
> Anyway when it was working this is what you could do:
>
> If you use the billing account screens to input the payment (instead of the
> payment screens) then you have the option to apply all or some of that
> payment to the outstanding invoices on the billing account – so partial
> payment of invoices are catered for.
>
> The 'Capture' button next to the invoice would do the invoice application of
> the payment plus create any partial and outstanding applications. (And it's
> the 'Capture' button that's stopped working)
>  
The double apply/capture process was confusing one of my clients to
bits. Sadly I can't see any really easy way to deal with this other
than, perhaps, some kind of "auto-capture" ECA on the billing account
that tries to make a best-guess on closing out invoices. It would also
be convenient if you could see the customer's billing account balances
from the payment application screen and choose to apply some of a
payment to the billing account from there (single point of control).

The real confusion we're seeing is in handling purchase return credit
since you have to have a financial account to deal with those credits
(if that process even works for you).

--
Ean Schuessler, CTO
[hidden email]
214-720-0700 x 315
Brainfood, Inc.
http://www.brainfood.com

Reply | Threaded
Open this post in threaded view
|

Re: Paying off invoices under a billing account

Bob Morley
Our standard use case here is retail POS; so billing account is used as a "line of credit" with high-end customers.  In our "POS" when they place an order we present the available payment methods.  If they have been approved for a billing account it shows up with their available balance.  Basically I am saying that when the teller is ringing the customer through they really have no notion of the Invoice at all; they just say "do you want to put this on account?"

I think if it was for a services sector where I am going to say give you a quote to do some lawn work, then ultimately invoice the customer I would definitely avoid the whole billing account situation.

After digging a bit more and talking with a co-worker, we elected to go a slightly different direction (in terms of the potential solutions I documented).  Effectively, it did not make sense that you calculate the balance or the available balance on the billing account based on orders.  It really should be based on non-applied balances on related invoices.  Effectively, I changed the main calculations in the BillingAccountWorker to work on this premise.

What this meant was I created four main balance methods:

getBalance = how much has the guy used (outstanding invoices +/- any adhoc pmt applications)
getReservedBalance = how much has the guy used/reserved (above plus amounts from open orders) **  
getAvailableBalance = limit - getBalance
getUnreservedBalance = limit - getReservedBalance (think how much can I put on the billing account if I complete all my reserved orders).

** I changed open orders to exclude completed orders; but these orders have cut an invoice that is now being included in the balance / available balance calcs.

After doing this I found that everything worked and calculated as expected; the only missing piece was that when an invoice is completely paid, the associated order payment preference was not moving from PAYMENT_NOT_RECEIVED to PAYMENT_RECEIVED.  I added this into the SECA that is invoked each time an invoice related payment application is created.  When it is moving to PAID I find those order payment preferences and mark them received.

Does anyone think I should patch up this work for review and potential inclusion?  I blasted through the existing Ofbiz artifacts and wired things up to my new method names which (my hope) are more clear than the batch that was there before.