mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-06-01 10:24:36 -04:00
Merge pull request #4442 from beganovich/v5-delivery-notes-updates
(v5) Remove balance due & total from delivery note PDFs
This commit is contained in:
commit
b446024596
@ -843,8 +843,12 @@ class InvoiceController extends BaseController
|
|||||||
{
|
{
|
||||||
$file_path = $invoice->service()->getInvoiceDeliveryNote($invoice, $invoice->invitations->first()->contact);
|
$file_path = $invoice->service()->getInvoiceDeliveryNote($invoice, $invoice->invitations->first()->contact);
|
||||||
|
|
||||||
$file = base_path("storage/app/public/{$file_path}");
|
try {
|
||||||
|
$file = base_path("public/storage/{$file_path}");
|
||||||
|
|
||||||
return response()->download($file, basename($file));
|
return response()->download($file, basename($file));
|
||||||
|
} catch(\Exception $e) {
|
||||||
|
return response(['message' => 'Oops, something went wrong. Make sure you have symlink to storage/ in public/ directory.'], 500);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -192,6 +192,13 @@ class Design extends BaseDesign
|
|||||||
|
|
||||||
$elements = [];
|
$elements = [];
|
||||||
|
|
||||||
|
// We don't want to show account balance or invoice total on PDF.. or any amount with currency.
|
||||||
|
if ($this->type == 'delivery_note') {
|
||||||
|
$variables = array_filter($variables, function ($m) {
|
||||||
|
return !in_array($m, ['$invoice.balance_due', '$invoice.total']);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
foreach ($variables as $variable) {
|
foreach ($variables as $variable) {
|
||||||
$_variable = explode('.', $variable)[1];
|
$_variable = explode('.', $variable)[1];
|
||||||
$_customs = ['custom1', 'custom2', 'custom3', 'custom4'];
|
$_customs = ['custom1', 'custom2', 'custom3', 'custom4'];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user