mirror of
				https://github.com/invoiceninja/invoiceninja.git
				synced 2025-11-03 23:27:31 -05: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,11 +168,21 @@ class Design extends BaseDesign
 | 
			
		||||
        $elements = [];
 | 
			
		||||
 | 
			
		||||
        foreach ($variables as $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…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user