I am looking for a way to show tax amounts seperate on invoice pdf.
I have 2 Tax rates 21% and 6% i know i can show the total of the two but i need to show them seperate.
Anyone an idea how i can show the amounts seperate?
You would have to calculate the totals for each tax rate of items manually. Add something like
$item_tax_rates[$item->item_tax_rate_name] = $item_tax_rates[$item->item_tax_rate_name] + $item->item_tax_total;
inside the item loop and
$item_tax_rates = ; directly before the loop.
And you may get something like
array (size=2) 'Sample Tax' => float 1.51 'NY State Tax' => float 21.93
Hey @Kovah ,
I found this template it works it show them in a seperate table but once it goes to make a second page it breaks and gives an error.
Invoicetemplate.php (15.8 KB)
It gives error :
A PHP Error was encountered
Message: Undefined index: miw Filename: src/Mpdf.php Line Number: 20819 Backtrace: File: /srv/users/serverpilot/apps/invoicepilot-onstuin/public/vendor/mpdf/mpdf/src/Mpdf.php Line: 20819 Function: _error_handler File: /srv/users/serverpilot/apps/invoicepilot-onstuin/public/vendor/mpdf/mpdf/src/Tag/Table.php Line: 970 Function: shrinkTable File: /srv/users/serverpilot/apps/invoicepilot-onstuin/public/vendor/mpdf/mpdf/src/Tag.php Line: 246 Function: close File: /srv/users/serverpilot/apps/invoicepilot-onstuin/public/vendor/mpdf/mpdf/src/Mpdf.php Line: 15216 Function: CloseTag File: /srv/users/serverpilot/apps/invoicepilot-onstuin/public/application/helpers/mpdf_helper.php Line: 98 Function: WriteHTML File: /srv/users/serverpilot/apps/invoicepilot-onstuin/public/application/helpers/pdf_helper.php Line: 106 Function: pdf_create File: /srv/users/serverpilot/apps/invoicepilot-onstuin/public/application/modules/invoices/controllers/Invoices.php Line: 266 Function: generate_invoice_pdf File: /srv/users/serverpilot/apps/invoicepilot-onstuin/public/index.php Line: 325 Function: require_once
I only seem to get the error when i add 7-8 lines with items
When i only add 6 or add 9 or 10 i don’t get the error.
I get the error when the table is moving from one page to the 2nd page