Jump to content

Set Invoice Date to Date of Payment


Matt

Recommended Posts

  • WHMCS CEO

In some countries, it is required by law that in addition to the Proforma/Sequential Paid Invoice Numbering that is natively supported by WHMCS, that the invoice numbers which are sequential must also have sequential dates.

 

In order for this to happen it is necessary to update the invoice date when it gets paid and this can be done with a simple action hook. Below is the code for that hook. If you need this, just create a file in the includes/hooks/ folder (name is not important) with the code below in it:

 

<?php
function hook_update_invoice_date_on_payment($vars) {
   update_query("tblinvoices",array("date"=>"now()"),array("id"=>$vars['invoiceid']));
}
add_hook("AddInvoicePayment",1,"hook_update_invoice_date_on_payment");
?>

 

Matt

Link to comment
Share on other sites

  • 6 months later...
  • 1 month later...

I also get a blank page on multiple locations in WHMCS when I trie to use hook that Matt suggested.

 

Actually I tried with "AddInvoicePayment" hook.

 

I don't see anything wrong with the code but still it brake WHMCS when used...??

 

Is this really working for someone?

Link to comment
Share on other sites

  • 1 month later...
  • 3 weeks later...
  • 4 weeks later...

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