mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-08 22:44:30 -04:00
Merge pull request #4189 from beganovich/v2-fix-for-invoice-customs
(v5) Fixes for invoice custom fields
This commit is contained in:
commit
b347cc75e2
@ -196,7 +196,7 @@ class PreviewController extends BaseController
|
|||||||
->design($design)
|
->design($design)
|
||||||
->build();
|
->build();
|
||||||
|
|
||||||
// info($maker->getCompiledHTML(true));
|
info($maker->getCompiledHTML(true));
|
||||||
|
|
||||||
$file_path = PreviewPdf::dispatchNow($maker->getCompiledHTML(true), auth()->user()->company());
|
$file_path = PreviewPdf::dispatchNow($maker->getCompiledHTML(true), auth()->user()->company());
|
||||||
|
|
||||||
|
@ -109,6 +109,8 @@ class CreateInvoicePdf implements ShouldQueue
|
|||||||
->design($template)
|
->design($template)
|
||||||
->build();
|
->build();
|
||||||
|
|
||||||
|
info($maker->getCompiledHTML());
|
||||||
|
|
||||||
//todo - move this to the client creation stage so we don't keep hitting this unnecessarily
|
//todo - move this to the client creation stage so we don't keep hitting this unnecessarily
|
||||||
Storage::makeDirectory($path, 0775);
|
Storage::makeDirectory($path, 0775);
|
||||||
|
|
||||||
|
@ -168,10 +168,20 @@ class Design extends BaseDesign
|
|||||||
$elements = [];
|
$elements = [];
|
||||||
|
|
||||||
foreach ($variables as $variable) {
|
foreach ($variables as $variable) {
|
||||||
$elements[] = ['element' => 'tr', 'properties' => ['hidden' => $this->entityVariableCheck($variable)], 'elements' => [
|
$_variable = explode('.', $variable)[1];
|
||||||
['element' => 'th', 'content' => $variable . '_label'],
|
$_customs = ['custom1', 'custom2', 'custom3', 'custom4'];
|
||||||
['element' => 'th', 'content' => $variable],
|
|
||||||
]];
|
if (in_array($_variable, $_customs)) {
|
||||||
|
$elements[] = ['element' => 'tr', 'elements' => [
|
||||||
|
['element' => 'th', 'content' => $variable . '_label'],
|
||||||
|
['element' => 'th', 'content' => $variable],
|
||||||
|
]];
|
||||||
|
} else {
|
||||||
|
$elements[] = ['element' => 'tr', 'properties' => ['hidden' => $this->entityVariableCheck($variable)], 'elements' => [
|
||||||
|
['element' => 'th', 'content' => $variable . '_label'],
|
||||||
|
['element' => 'th', 'content' => $variable],
|
||||||
|
]];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return $elements;
|
return $elements;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user