Feature Requests
Share ideas, discuss and vote on requests from other users in community
Remove addons displayed on Invoice when not purchased
Under Consideration
Currently add-ons are shown on every invoice for the product associated even if they are not purchased. Agreed they should be available as an upgrade on the back-end but with many options the invoice is cluttered with confusing garbage.
I agree, no need to show items not ordered on the invoice!
I still REALLY think this should be built in, but I have created some code we can add to fix it.
**Tested Working on our system, but use at your own risk**
invoice.tpl (Starting on Line 92 for us, within the foreach loop)
$text = preg_replace("/\:\s0\sx\s/","+",$this->_tpl_vars['invoiceitem']['description']);
$text = preg_replace("/.*\+/","+",$text);
$text = preg_replace("/\+.*/","",$text);
$this->_tpl_vars['invoiceitem']['description'] = $text;
{/php}
invoicepdf.tpl (Replace this whole foreach loop)
//These 3 lines remove 0 Quantity items, and the 4th line set the new string to the running variable
$text = preg_replace("/\:\s0\sx\s/","+",$item['description']);
$text = preg_replace("/.*\+/","+",$text);
$text = preg_replace("/\+.*(\n?)/","",$text);
$item['description'] = $text;
$rowcount = $pdf->getNumLines($item['description'], 140);
$pdf->MultiCell(140,$rowcount * 5,$item['description'],1,'L',0,0);
$pdf->MultiCell(40,$rowcount * 5,$item['amount'],1,'C',0,0);
$pdf->Ln();
}
You're Welcome : )
-Stephen
Not sure if the templates have changed since you posted this, but here is what I used of your modified code to make it work:
In viewinvoice.tpl
and in invoicepdf.tpl
These seemed to work for me on the default when I had issues just pasting your code in there. But your code got me 95% of the way there and now I know some smarty and more php.
How I do leave Quantity in place?
this really needs to be fixed!
Is there any way this can be implemented in the confirmation email? I was able to use the code above succesfully to filter the client area and the PDF but no love on the email body.
Placeholder is {$invoice_html_contents}
Can a similar regex be implemented in the email body?
This is needed, Many clients get frustrated to see all options they don't buy on the invoice.
It looks cheap and unprofessional.
I tried the fixes above on WHMCS 7.6.1 but it looks like it's not working any more.
Yes yes yes! This needs to be implemented as soon as possible. Invoices look terrible with line after line of items that weren't ordered. Please add this ASAP!
Yes, yes from me. I can't believe this issue has been outstanding for so long.
It looks REALLY unprofessional with these add ons on the invoice. Not a good look at all.
Surely something like the custom field options where you can choose where it shows up would be pretty straightforward?
Any update on this?
I figure "don't show the thing the customer didn't want" was a fairly obvious feature requirement, haha
Hard to imagine this isn't a standard option. Would be great to see it in WHMCS so we don't have to hack the code in ourselves.
This is a very important feature, it should be options like custom fields.
Comments have been locked on this page!