Jump to content

Ideas On How To Migrate Our Site To Sending Out Invoices For Monthly Fees


gutterboy

Recommended Posts

Currently our site uses an invoicing system that invoices the user for their outstanding balance each month; so if they rack up $35 of fees in month #1 they will be sent an invoice for $35; if they don't pay it and rack up another $35 in month two their next invoice will be for $70.00.

We purchased Blesta recently and I am using the API to help build it into our site and send out invoices via it.

However, Blesta seems to prefer you to send out invoices for that particular months fees; so in the above example the user would get two separate invoices for $35.

So, I'm trying to change our system to work that way, but I'm having trouble coming up with a way to correctly do it.

We have a field in our users table that holds their outstanding balance and we also have a table that holds all their associated fees for they get, tracked separately, including any refunds / credit adjustments.

I've thought of just calculating up the fees from that table for the particular month to get the invoice amount, but it won't really work because:

Consider this situation..

Say they got a $30 credit in month one, so we didn't send them an invoice for that month........ then in month #2 they spent $5...... but if we just calculate by the month we would be sending them an invoice for $5 when they still have $25 credit remaining

Then to counter that, say we only send them an invoice if their outstanding balance is in debit..... that won't work either because:

Consider this situation..

Month #1 they got $30 credit so no invoice is sent, month #2 they spent $35........ they have a balance due, so we should invoice them for $5, but their monthly spend came up to $35 so it would end up invoicing them for $35 instead

I thought of another method as well but that also had a flaw. :(

Our table that tracks all the fees/refunds structure looks like this:
 

post-2584-0-71697500-1401692584_thumb.pn

 

Any ideas here!?

Link to comment
Share on other sites

No, we have disabled the software from sending out the invoices automatically - they should only be sent when they are triggered to be sent via the API (or possibly for reminders etc).

 

Additionally, we don't have recurring costs...... we invoice our users monthly, but some months they may incur fees, some they won't; it depends how active they have been on the site and if they sold anything etc

Link to comment
Share on other sites

Worked out a way to do it I think..

 

We check their balance and see if they owe anything...

If so, we then check to see if they have any outstanding invoices via blesta and if so we take that amount from their outstanding balance and then we get the correct amount to invoice them for.

Link to comment
Share on other sites

Worked out a way to do it I think..

 

We check their balance and see if they owe anything...

If so, we then check to see if they have any outstanding invoices via blesta and if so we take that amount from their outstanding balance and then we get the correct amount to invoice them for.

Yes, With API you do what you want , just as we told before remove any service related to the invoives .

another think to make in consideration is disable the mail notification , to not send any email to your clients from blesta , that will keep the thing based in your Based API system .

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...