mirror of
				https://github.com/invoiceninja/invoiceninja.git
				synced 2025-10-31 05:07:31 -04:00 
			
		
		
		
	Fixes for page numbering in previews
This commit is contained in:
		
							parent
							
								
									a4a16eb02c
								
							
						
					
					
						commit
						df9e1f902d
					
				| @ -41,6 +41,7 @@ use App\Utils\Ninja; | ||||
| use App\Utils\PhantomJS\Phantom; | ||||
| use App\Utils\Traits\MakesHash; | ||||
| use App\Utils\Traits\MakesInvoiceHtml; | ||||
| use App\Utils\Traits\Pdf\PageNumbering; | ||||
| use Illuminate\Support\Facades\App; | ||||
| use Illuminate\Support\Facades\DB; | ||||
| use Illuminate\Support\Facades\Lang; | ||||
| @ -51,6 +52,8 @@ class PreviewController extends BaseController | ||||
| { | ||||
|     use MakesHash; | ||||
|     use MakesInvoiceHtml; | ||||
|     use PageNumbering; | ||||
| 
 | ||||
| 
 | ||||
|     public function __construct() | ||||
|     { | ||||
| @ -157,7 +160,15 @@ class PreviewController extends BaseController | ||||
|             } | ||||
|              | ||||
|             if(config('ninja.invoiceninja_hosted_pdf_generation') || config('ninja.pdf_generator') == 'hosted_ninja'){ | ||||
|                 return (new NinjaPdf())->build($maker->getCompiledHTML(true)); | ||||
|                 $pdf = (new NinjaPdf())->build($maker->getCompiledHTML(true)); | ||||
| 
 | ||||
|                 $numbered_pdf = $this->pageNumbering($pdf, auth()->user()->company()); | ||||
| 
 | ||||
|                 if($numbered_pdf) | ||||
|                     $pdf = $numbered_pdf; | ||||
| 
 | ||||
|                 return $pdf; | ||||
| 
 | ||||
|             } | ||||
| 
 | ||||
|             //else
 | ||||
| @ -285,7 +296,14 @@ class PreviewController extends BaseController | ||||
|             } | ||||
|              | ||||
|             if(config('ninja.invoiceninja_hosted_pdf_generation') || config('ninja.pdf_generator') == 'hosted_ninja'){ | ||||
|                 return (new NinjaPdf())->build($maker->getCompiledHTML(true)); | ||||
|                 $pdf = (new NinjaPdf())->build($maker->getCompiledHTML(true)); | ||||
| 
 | ||||
|                 $numbered_pdf = $this->pageNumbering($pdf, auth()->user()->company()); | ||||
| 
 | ||||
|                 if($numbered_pdf) | ||||
|                     $pdf = $numbered_pdf; | ||||
| 
 | ||||
|                 return $pdf; | ||||
|             } | ||||
| 
 | ||||
|             $file_path = PreviewPdf::dispatchNow($maker->getCompiledHTML(true), $company); | ||||
| @ -354,7 +372,14 @@ class PreviewController extends BaseController | ||||
|         } | ||||
| 
 | ||||
|         if(config('ninja.invoiceninja_hosted_pdf_generation') || config('ninja.pdf_generator') == 'hosted_ninja'){ | ||||
|             return (new NinjaPdf())->build($maker->getCompiledHTML(true)); | ||||
|             $pdf =  (new NinjaPdf())->build($maker->getCompiledHTML(true)); | ||||
| 
 | ||||
|             $numbered_pdf = $this->pageNumbering($pdf, auth()->user()->company()); | ||||
| 
 | ||||
|                 if($numbered_pdf) | ||||
|                     $pdf = $numbered_pdf; | ||||
| 
 | ||||
|                 return $pdf; | ||||
|         } | ||||
|              | ||||
|         $file_path = PreviewPdf::dispatchNow($maker->getCompiledHTML(true), auth()->user()->company()); | ||||
| @ -443,7 +468,14 @@ class PreviewController extends BaseController | ||||
|         } | ||||
| 
 | ||||
|         if(config('ninja.invoiceninja_hosted_pdf_generation') || config('ninja.pdf_generator') == 'hosted_ninja'){ | ||||
|             return (new NinjaPdf())->build($maker->getCompiledHTML(true)); | ||||
|             $pdf = (new NinjaPdf())->build($maker->getCompiledHTML(true)); | ||||
| 
 | ||||
|             $numbered_pdf = $this->pageNumbering($pdf, auth()->user()->company()); | ||||
| 
 | ||||
|                 if($numbered_pdf) | ||||
|                     $pdf = $numbered_pdf; | ||||
| 
 | ||||
|                 return $pdf; | ||||
|         } | ||||
|              | ||||
|         $file_path = PreviewPdf::dispatchNow($maker->getCompiledHTML(true), auth()->user()->company()); | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user