Jump to content

Hook when "Create Add Funds Invoice"

Recommended Posts


I created a function that when called via Hook renames the invoices that are created, this allows me to have my own name without using the IDs.

This function almost always works correctly, except in one case: when I enter the customer profile from the administrator area, and click on "Create Add Funds Invoice". In this case the function does not start.
What Hook should I use in this case? I am attaching my function and also the hooks I used to call it.


function DN_writeNUMproforma($vars) {

	$inv_id = $vars['invoiceid'];

	$invoicenum_db = Capsule::table('tblinvoices')->where('id', $inv_id)->value('invoicenum');

    if ($invoicenum_db == null) {

    	$proforma_num = 'FP-' . date('Y') . '-' . date('m') . $inv_id . rand(0,9);

	        ->where('id', $inv_id)
	                'invoicenum' => $proforma_num,

// =========================================================================
// Hook
// =========================================================================

add_hook('InvoiceCreationAdminArea', 1,'DN_writeNUMproforma');


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.

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