mirror of
				https://github.com/invoiceninja/invoiceninja.git
				synced 2025-11-03 23:27:31 -05:00 
			
		
		
		
	Merge branch 'v5-develop' into v5-stable
This commit is contained in:
		
						commit
						004c07f1e6
					
				@ -196,8 +196,6 @@ class PreviewController extends BaseController
 | 
				
			|||||||
            ->design($design)
 | 
					            ->design($design)
 | 
				
			||||||
            ->build();
 | 
					            ->build();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        info($maker->getCompiledHTML(true));
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
        $file_path = PreviewPdf::dispatchNow($maker->getCompiledHTML(true), auth()->user()->company());
 | 
					        $file_path = PreviewPdf::dispatchNow($maker->getCompiledHTML(true), auth()->user()->company());
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        DB::rollBack();
 | 
					        DB::rollBack();
 | 
				
			||||||
 | 
				
			|||||||
@ -19,6 +19,7 @@ use App\Libraries\MultiDB;
 | 
				
			|||||||
use App\Models\ClientContact;
 | 
					use App\Models\ClientContact;
 | 
				
			||||||
use App\Models\Company;
 | 
					use App\Models\Company;
 | 
				
			||||||
use App\Models\Design;
 | 
					use App\Models\Design;
 | 
				
			||||||
 | 
					use App\Services\PdfMaker\Design as PdfDesignModel;
 | 
				
			||||||
use App\Models\Invoice;
 | 
					use App\Models\Invoice;
 | 
				
			||||||
use App\Services\PdfMaker\Design as PdfMakerDesign;
 | 
					use App\Services\PdfMaker\Design as PdfMakerDesign;
 | 
				
			||||||
use App\Services\PdfMaker\PdfMaker as PdfMakerService;
 | 
					use App\Services\PdfMaker\PdfMaker as PdfMakerService;
 | 
				
			||||||
@ -87,7 +88,14 @@ class CreateInvoicePdf implements ShouldQueue
 | 
				
			|||||||
        $design = Design::find($invoice_design_id);
 | 
					        $design = Design::find($invoice_design_id);
 | 
				
			||||||
        $html = new HtmlEngine(null, $this->invitation, 'invoice');
 | 
					        $html = new HtmlEngine(null, $this->invitation, 'invoice');
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        if ($design->is_custom) {
 | 
				
			||||||
 | 
					          $options = [
 | 
				
			||||||
 | 
					            'custom_partials' => json_decode(json_encode($design->design), true)
 | 
				
			||||||
 | 
					          ];
 | 
				
			||||||
 | 
					          $template = new PdfMakerDesign(PdfDesignModel::CUSTOM, $options);
 | 
				
			||||||
 | 
					        } else {
 | 
				
			||||||
          $template = new PdfMakerDesign(strtolower($design->name));
 | 
					          $template = new PdfMakerDesign(strtolower($design->name));
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        $state = [
 | 
					        $state = [
 | 
				
			||||||
            'template' => $template->elements([
 | 
					            'template' => $template->elements([
 | 
				
			||||||
@ -109,8 +117,6 @@ 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);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user