mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-10 21:22:58 +01: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)
|
||||
->build();
|
||||
|
||||
// info($maker->getCompiledHTML(true));
|
||||
info($maker->getCompiledHTML(true));
|
||||
|
||||
$file_path = PreviewPdf::dispatchNow($maker->getCompiledHTML(true), auth()->user()->company());
|
||||
|
||||
|
@ -109,6 +109,8 @@ class CreateInvoicePdf implements ShouldQueue
|
||||
->design($template)
|
||||
->build();
|
||||
|
||||
info($maker->getCompiledHTML());
|
||||
|
||||
//todo - move this to the client creation stage so we don't keep hitting this unnecessarily
|
||||
Storage::makeDirectory($path, 0775);
|
||||
|
||||
|
@ -168,10 +168,20 @@ class Design extends BaseDesign
|
||||
$elements = [];
|
||||
|
||||
foreach ($variables as $variable) {
|
||||
$elements[] = ['element' => 'tr', 'properties' => ['hidden' => $this->entityVariableCheck($variable)], 'elements' => [
|
||||
['element' => 'th', 'content' => $variable . '_label'],
|
||||
['element' => 'th', 'content' => $variable],
|
||||
]];
|
||||
$_variable = explode('.', $variable)[1];
|
||||
$_customs = ['custom1', 'custom2', 'custom3', 'custom4'];
|
||||
|
||||
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;
|
||||
|
Loading…
Reference in New Issue
Block a user