Jump to content

how to add extra note on the bottom of the invoice if Tax Exempt is set for client?


dbosnj35

Recommended Posts

how to add extra note on the bottom of the invoice if Tax Exempt is set for the client? Can someone help me with right code for invoicepdf.tpl file.

I would like to set "if" contidion and that note to be visible only if the tax exempt is set to yes for the client and not on the invoices for other clients. Its the tax law in my country.

 

Tx.

Link to comment
Share on other sites

  • 10 years later...

I wrote this hook for you, this will help you

 

add_hook('InvoiceCreated', 1, function($vars) {
    $invoice_ID = $vars['invoiceid'];
	$invoice = Capsule::table('tblinvoices')->WHERE('id', $invoice_ID)->first();
	$userid = $invoice->userid;
	$command = 'GetClientsDetails';
    $postData = array(
    'clientid' => $userid,
    'stats' => true,
    );
    $results = localAPI($command, $postData);
    $taxexempt = $results["client"]["taxexempt"];

    if ($taxexempt) $note =  "This Customer is taxexempt";
    else            $note =  "This Customer is Not taxexempt";
 
    $command = 'UpdateInvoice';
    $postData = array(
    'invoiceid' => $invoice_ID,
    'notes' => $note,
    );
    $results = localAPI($command, $postData);
});

 

Edited by AladdinJ
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