Jump to content

disabling "0 value" invoices


Recommended Posts

NOTE: in this community there's a number of previous (and also ancient) threads about disabling/deleting/cancelling invoices of 0 value.

(note: in some countries issuing 0 invoice may be unlawful; in every country of the world it's useless and annoying)

Does exist a hook which prevents email sending to the customer of any "zero value" invoice:  http://www.whmcsjet.com/how-to-disable-invoice-generation-for-0-00-invoices/

(I didn't checked it, but I suppose it works)

It should be sufficient to add an UpdateInvoice to put it as "cancelled" but...  still exoist an issue:

  • paid invoice have a different sequence number
  • when the "paid" zero-value invoice is created, it got a number and so the counter increment +1
  • if I cancel that invoice, the result will be an invoicenumber missing (which may be whorst thant issuing a zero-value invoice)

The number of paid invoices can me managed and set in setuo => general settings => invoices ("next paid invoice number")
And ot's stored in SequentialInvoiceNumberValue in the table tblconfiguration ... so the last step would be decrement this value by one.

So it seems easy, but the question is: how can i manage the value  SequentialInvoiceNumberValue, in order to get it from tblconfiguration , and then store the new value again in  tblconfiguration ?!?!

@brian! ?

Link to comment
Share on other sites

On 5/1/2018 at 10:27, Remitur said:

Does exist a hook which prevents email sending to the customer of any "zero value" invoice:  http://www.whmcsjet.com/how-to-disable-invoice-generation-for-0-00-invoices/

(I didn't checked it, but I suppose it works)

it worked when I checked it a month or two ago... I can't think of any reason why it wouldn't work in the latest version too.

On 5/1/2018 at 10:27, Remitur said:

So it seems easy, but the question is: how can i manage the value SequentialInvoiceNumberValue, in order to get it from tblconfiguration , and then store the new value again in tblconfiguration ?!?!

that's not the bit that worries me - you're just pulling a value from the database; manipulating the value (e.g subtract it by 1) and then updating the database with the new value...

what worries me is that you may end up with two (or more) invoices in the database using the same sequential number - one will be cancelled, another will be paid (and may be to a different client)... surely that could lead to issues too... would the tax authorities want to see multiple different invoices using the same number ??

Link to comment
Share on other sites

9 hours ago, brian! said:

what worries me is that you may end up with two (or more) invoices in the database using the same sequential number - one will be cancelled, another will be paid (and may be to a different client)... surely that could lead to issues too... would the tax authorities want to see multiple different invoices using the same number ??

The (paid) invoice number isdifferent from invoiceid, and is not an index... it's a sort of "free text field", which may be also empty (and it's so for any unpaid invoice).

So, just to be sure: with the UpsateInvoice function, is needed not only cancel the invoice, but also delete the invoice number field.

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