Jump to content

credit management according to european fiscal law - a project


Recommended Posts

The way WHMCS currently manages user credit is disrespectful of general European fiscal laws (and IMHO the way that WHMCS manages the credit is crazy and far from any logic).

In this thread I'm looking to find the best way to fix this problem, interfering as little as possible with current WHMCS automations.
Any idea and any suggestion will be welcome.

The way it currently works:

- The user pays 100 as credit; no invoice is issued, no VAT is charged, the user has 100 as credit in its account
- the user makes an order of 10 + VAT 22%, and pays it using credit
- the system issues the following invoice:
amount:       10
VAT               2,20
total:            12,20
credit:          -12,20
grand total:    0
and removes 12,20 from the user’s credit
- the user has an invoice with no reference to the payment he did in the past, and a credit of 100-12,20 = 87,80

How it should works:

- the user pays 100 as credit; the system issues an invoice for 81,97 + VAT 22%, the user has 81,97 as credit
- the user makes an order of 10 + VAT 22%, and pays it using credit
- the system issues the following invoice:
amount:       10
credit:         -10
subtotal:        0
VAT               0
total:             0
- the system removes 10,00 from the user’s credit
- the user has the original invoice for his payment, and a second zero-value invoice for the operation he did
- the user has a credit of 81,97 - 10 = 71,97

There may be a few variations, according to national laws:
- the zero-amount invoice may be not issued, or issued just like a “proforma invoice”, or as an internal receipt 
- the zero-amount invoice may be issued, but may be not registered

How to manage it? (loud thinking and brainstorming: your ideas will be appreciated)

Credit payment:
Bypassing all current WHMCS credit payment process (disabling the original one), and creating an add-on module that allows the creation of a service named “credit”.
The base price of this service is (i.e.) 10,00, and the user can order multiple items (up to, ie. 100)
The system issues an invoice, the user pays it, and the module at the activation of the order adds the credit to the user's account

Credit usage:
When a user pays an invoice using credit, a hook (  maybe InvoicePaidPreEmail: https://developers.whmcs.com/hooks-reference/invoices-and-quotes/#invoicepaidpreemail 😞
- check if credit has been used
- check if the user is subjected to VAT
- if subjected to VAT: correct the invoice as required, and credit to the user credit the VAT amount that WHMCS wrongly subtracted; thi can be done using AddCredit API (https://developers.whmcs.com/api-reference/addcredit/ )

Special case: invoice paid partly with credit, and partly with a different gateway
(I guess the best fix could be not allow such kind of operations: a user can pay using credit only if he has sufficient available credit to pay the invoice in full with credit)


 

 

Edited by Remitur
Link to comment
Share on other sites

Hello,

 

Thanks a lot for the detailed explanation of the issue with the whmcs credit system. I think I will an adoon module to handle this case,

so when this addon module is installed, it will handle the credit payments as you explained.

 

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated