5 replies [Last post]
ron_s's picture
Offline
Joined: 09/11/2008
Juice: 173
Was this information Helpful?

After having tested the uc_recurring and uc_roles modules extensively, I can say I disagree with how order accounting is done for recurring fees.

As it stands right now, this is what I see on my orders:

  • Customer adds in their shopping cart a $20 subscription to the site. This gives the customer an order balance of +$20 ($20 due)
  • The customer pays for the subscription, which is a $20 credit to the order, and makes the order balance $0
  • One month later, a recurring fee is processed, which is noted as a charge on the payment tab, and sets the order balance to -$20 ($20 credit)
  • However, no offseting product is added to the order. Therefore the order balance continues to sit as -$20, which is wrong.

Really the way to accomplish this through proper accounting methods would be a strict dual entry. If a customer makes a payment of $20, something of equal value needs to be added to the order to offset this and make the balance $0. What is necessary is the addition of a "order recurring fee" line item on the order products. Money is received, and product is given in exchange.

In general though I also disagree with placing recurring fees on an existing order. From an accounting standpoint these really should be new orders on the account. I would understand adding them to the existing order if the original order was being modified, but really this should be a new order that exists on its own.

Ryan's picture
Offline
Joined: 08/07/2007
Juice: 15438
Re: Disagree with the approach used for recurring fee order acco

So... it seems like one of the issues here is that Ubercart's order admin isn't suitable to be the sole accounting system of a company. I think you're spot on with you observations about how payments are currently logged. We realized it wasn't great in development but left it alone for lack of a better alternative.

One thought I have now for an intermediate solution is to allow payments to be logged for an order but not taken into consideration when an order balance is being calculated. It's far from perfect accounting, but it allows us to keep a record associated with an original order number. The alternative could just be another receipts table, but it makes sense to figure out how to keep payment tracking in a single location.

ron_s's picture
Offline
Joined: 09/11/2008
Juice: 173
Re: Re: Disagree with the approach used for recurring fee order

I'd hope that most businesses wouldn't use Ubercart as a sole accounting system! Smiling I just think it's a slippery slope ... when you put things like "order balance" on orders, and give admins the ability to add payment line items on the Payments tab, and the ability to add product line items on the Order Edit tab, there naturally is some expectations about how all of it works. The expectation is going to be a double entry bookkeeping process.

So if payments are not used when calculating order balance, what's the purpose of the order balance field? What does it then mean? I tend to believe the order tracking by itself is good, and the payment tracking by itself is good. The issue is the interaction of the two, especially when it comes to balancing out orders and providing customer refunds.

Ryan's picture
Offline
Joined: 08/07/2007
Juice: 15438
ron_s wrote:So if payments
ron_s wrote:

So if payments are not used when calculating order balance, what's the purpose of the order balance field? What does it then mean? I tend to believe the order tracking by itself is good, and the payment tracking by itself is good. The issue is the interaction of the two, especially when it comes to balancing out orders and providing customer refunds.

Yeah... basically, the order balance was put in before recurring payments were considered. It was supposed to show you at a glance if an order had been paid in full. Recurring fees don't have anything to do with the order total, really, but rather are just ongoing payments associated with an order and its user account. Even the association with the order is quite loose. After the order has been paid in full at checkout, from there it's more like billing and payments ought to be tied directly to the user account... it wouldn't make any sense for an order to have an outstanding balance once its been paid for, but a customer account having an outstanding balance due to a missed payment does make sense.

This is where it would be very helpful to change the way orders are "put together" so to speak. Right now, you have products and line items distinct from one another. However, products are really just another type of line item... and recurring fees (or even one time fees) are another type. There isn't a centralized API to handle line items of all types, and the specific APIs for both products and what we call line items now are lacking. One of my goals for UC 3.x is to expand the nature of line items so that they can swallow up products and make the core API for managing line items on orders a lot easier to use.

What I think this would accomplish is...

  1. Make it easier to work with orders during and after checkout internally speaking.
  2. Allow you to create an order that is used for the initial checkout and maybe even flag the order as such... something that a customer created through checkout.
  3. Allow you to programmatically create invoices every time a recurring payment comes due and apply the payment to it. You could flag this as a recurring payment invoice and use just a special recurring fee line item.
    1. Then you can even do things like filter on these order/invoice types in both customer and administrative views. This might be a case yet again for orders to be represented as nodes. Puzzled I'll point TR this way and see if he has any input in general.

D4V
D4V's picture
Offline
Joined: 02/13/2009
Juice: 15
Re: ron_s wrote:So if payments

Curious to know if there has been any other development on this.

I guess my chief concern here is that we are charging customers (reoccurring), and have to manually create/manage invoices for each fee.

Thanks!

David

univate@drupal.org's picture
Offline
Getting busy with the Ubercode.
Joined: 03/27/2009
Juice: 465
Re: Re: ron_s wrote:So if payments

I have made a start on proposing a fix for this, by making recurring fees a new order (so they have their own invoice, among other advantages):
http://www.ubercart.org/forum/ideas_and_suggestions/10133/uc_recurring_t...

This is always going to rely on the payment gateway in question being able to support some form of communication back to ubercart about the state of recurring fees, failed/success/expired etc... in any case I think we should be looking for solution that do provide a good api and focusing on those solutions.