mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Merge pull request #4675 from turbo124/v5-develop
Fix for presenting company logo in portal
This commit is contained in:
commit
ff203c251f
@ -88,9 +88,11 @@ class InvoiceItemSum
|
||||
return $this;
|
||||
}
|
||||
|
||||
/* Don't round the cost x qty - will allow us to use higher precision costs */
|
||||
private function sumLineItem()
|
||||
{ //todo need to support quantities less than the precision amount
|
||||
$this->setLineTotal($this->formatValue($this->item->cost, $this->currency->precision) * $this->formatValue($this->item->quantity, $this->currency->precision));
|
||||
// $this->setLineTotal($this->formatValue($this->item->cost, $this->currency->precision) * $this->formatValue($this->item->quantity, $this->currency->precision));
|
||||
$this->setLineTotal($this->item->cost * $this->item->quantity);
|
||||
|
||||
return $this;
|
||||
}
|
||||
@ -112,8 +114,8 @@ class InvoiceItemSum
|
||||
{
|
||||
$item_tax = 0;
|
||||
|
||||
// info(print_r($this->item,1));
|
||||
// info(print_r($this->invoice,1));
|
||||
// nlog(print_r($this->item,1));
|
||||
// nlog(print_r($this->invoice,1));
|
||||
|
||||
$amount = $this->item->line_total - ($this->item->line_total * ($this->invoice->discount / 100));
|
||||
$item_tax_rate1_total = $this->calcAmountLineTax($this->item->tax_rate1, $amount);
|
||||
|
@ -33,7 +33,7 @@ class SystemLogger implements ShouldQueue
|
||||
|
||||
protected $client;
|
||||
|
||||
public function __construct($log, $category_id, $event_id, $type_id, Client $client)
|
||||
public function __construct($log, $category_id, $event_id, $type_id, ?Client $client)
|
||||
{
|
||||
$this->log = $log;
|
||||
$this->category_id = $category_id;
|
||||
|
@ -10,7 +10,9 @@
|
||||
*/
|
||||
namespace App\Jobs\Util;
|
||||
|
||||
use App\Jobs\Util\SystemLogger;
|
||||
use App\Libraries\MultiDB;
|
||||
use App\Models\SystemLog;
|
||||
use App\Models\Webhook;
|
||||
use App\Transformers\ArraySerializer;
|
||||
use GuzzleHttp\Client;
|
||||
@ -113,6 +115,15 @@ class WebhookHandler implements ShouldQueue
|
||||
if ($response->getStatusCode() == 410 || $response->getStatusCode() == 200) {
|
||||
$subscription->delete();
|
||||
}
|
||||
|
||||
SystemLogger::dispatch(
|
||||
$e->getMessage(),
|
||||
SystemLog::CATEGORY_WEBHOOK,
|
||||
SystemLog::EVENT_WEBHOOK_RESPONSE,
|
||||
SystemLog::TYPE_WEBHOOK_RESPONSE,
|
||||
$this->company->clients->first(),
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
public function failed($exception)
|
||||
|
@ -36,7 +36,7 @@ class CompanyPresenter extends EntityPresenter
|
||||
$settings = $this->entity->settings;
|
||||
}
|
||||
|
||||
return (strlen($settings->company_logo) > 0) ? url($settings->company_logo) : 'https://www.invoiceninja.com/wp-content/uploads/2019/01/InvoiceNinja-Logo-Round-300x300.png';
|
||||
return (strlen($settings->company_logo) > 0) ? url('') . $settings->company_logo : 'https://www.invoiceninja.com/wp-content/uploads/2019/01/InvoiceNinja-Logo-Round-300x300.png';
|
||||
}
|
||||
|
||||
public function address($settings = null)
|
||||
|
@ -33,6 +33,8 @@ class SystemLog extends Model
|
||||
/* Category IDs */
|
||||
const CATEGORY_GATEWAY_RESPONSE = 1;
|
||||
const CATEGORY_MAIL = 2;
|
||||
const CATEGORY_WEBHOOK = 3;
|
||||
const CATEGORY_PDF = 3;
|
||||
|
||||
/* Event IDs*/
|
||||
const EVENT_PAYMENT_RECONCILIATION_FAILURE = 10;
|
||||
@ -45,6 +47,9 @@ class SystemLog extends Model
|
||||
const EVENT_MAIL_SEND = 30;
|
||||
const EVENT_MAIL_RETRY_QUEUE = 31; //we use this to queue emails that are spooled and not sent due to the email queue quota being exceeded.
|
||||
|
||||
const EVENT_WEBHOOK_RESPONSE = 40;
|
||||
const EVENT_PDF_RESPONSE = 50;
|
||||
|
||||
/*Type IDs*/
|
||||
const TYPE_PAYPAL = 300;
|
||||
const TYPE_STRIPE = 301;
|
||||
@ -56,6 +61,10 @@ class SystemLog extends Model
|
||||
const TYPE_QUOTA_EXCEEDED = 400;
|
||||
const TYPE_UPSTREAM_FAILURE = 401;
|
||||
|
||||
const TYPE_WEBHOOK_RESPONSE = 500;
|
||||
const TYPE_PDF_FAILURE = 600;
|
||||
const TYPE_PDF_SUCCESS = 601;
|
||||
|
||||
protected $fillable = [
|
||||
'client_id',
|
||||
'company_id',
|
||||
|
@ -11,10 +11,12 @@
|
||||
|
||||
namespace App\Utils\PhantomJS;
|
||||
|
||||
use App\Jobs\Util\SystemLogger;
|
||||
use App\Models\CreditInvitation;
|
||||
use App\Models\Design;
|
||||
use App\Models\InvoiceInvitation;
|
||||
use App\Models\QuoteInvitation;
|
||||
use App\Models\SystemLog;
|
||||
use App\Services\PdfMaker\Design as PdfDesignModel;
|
||||
use App\Services\PdfMaker\Design as PdfMakerDesign;
|
||||
use App\Services\PdfMaker\PdfMaker as PdfMakerService;
|
||||
@ -77,7 +79,7 @@ class Phantom
|
||||
$phantom_url = "https://phantomjscloud.com/api/browser/v2/{$key}/?request=%7Burl:%22{$url}%22,renderType:%22pdf%22%7D";
|
||||
$pdf = CurlUtils::get($phantom_url);
|
||||
|
||||
// Storage::makeDirectory($path, 0775);
|
||||
$this->checkMime($pdf, $invitation, $entity);
|
||||
|
||||
$instance = Storage::disk(config('filesystems.default'))->put($file_path, $pdf);
|
||||
|
||||
@ -101,6 +103,36 @@ class Phantom
|
||||
return $response;
|
||||
}
|
||||
|
||||
/* Check if the returning PDF is valid. */
|
||||
private function checkMime($pdf, $invitation, $entity)
|
||||
{
|
||||
|
||||
$finfo = new \finfo(FILEINFO_MIME);
|
||||
|
||||
if($finfo->buffer($pdf) != 'application/pdf; charset=binary')
|
||||
{
|
||||
SystemLogger::dispatch(
|
||||
$pdf,
|
||||
SystemLog::CATEGORY_PDF,
|
||||
SystemLog::EVENT_PDF_RESPONSE,
|
||||
SystemLog::TYPE_PDF_FAILURE,
|
||||
$invitation->contact->client
|
||||
);
|
||||
}
|
||||
else {
|
||||
|
||||
SystemLogger::dispatch(
|
||||
"Entity PDF generated sucessfully => " . $invitation->{$entity}->number,
|
||||
SystemLog::CATEGORY_PDF,
|
||||
SystemLog::EVENT_PDF_RESPONSE,
|
||||
SystemLog::TYPE_PDF_SUCCESS,
|
||||
$invitation->contact->client
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public function displayInvitation(string $entity, string $invitation_key)
|
||||
{
|
||||
$key = $entity.'_id';
|
||||
|
@ -150,11 +150,8 @@ class TemplateEngine
|
||||
|
||||
private function entityValues($contact)
|
||||
{
|
||||
//$data = $this->entity_obj->buildLabelsAndValues($contact);
|
||||
|
||||
$data = (new HtmlEngine($this->entity_obj->invitations->first()))->generateLabelsAndValues();
|
||||
// $arrKeysLength = array_map('strlen', array_keys($data));
|
||||
// array_multisort($arrKeysLength, SORT_DESC, $data);
|
||||
|
||||
$this->body = strtr($this->body, $data['labels']);
|
||||
$this->body = strtr($this->body, $data['values']);
|
||||
|
@ -3,7 +3,7 @@
|
||||
<a href="{{ $settings->website }}" style="color: #19BB40; text-decoration: underline;">
|
||||
@endif
|
||||
|
||||
<img src="{{ $company->present()->logo() }}" height="50" style="height:50px; max-width:140px; margin-left: 33px; padding-top: 2px" alt=""/>
|
||||
<img src="{{ $company->present()->logo($settings) }}" height="50" style="height:50px; max-width:140px; margin-left: 33px; padding-top: 2px" alt=""/>
|
||||
|
||||
@if ($settings->website)
|
||||
</a>
|
||||
|
@ -1,7 +1,7 @@
|
||||
@component('email.template.master', ['design' => 'dark', 'settings' => $settings, 'whitelabel' => $whitelabel])
|
||||
|
||||
@slot('header')
|
||||
@component('email.components.header', ['p' => $body, 'logo' => $settings->company_logo ?: 'https://www.invoiceninja.com/wp-content/uploads/2019/01/InvoiceNinja-Logo-Round-300x300.png'])
|
||||
@component('email.components.header', ['p' => $body, 'logo' => (strlen($settings->company_logo) > 1) ? url('') . $settings->company_logo : 'https://www.invoiceninja.com/wp-content/uploads/2019/01/InvoiceNinja-Logo-Round-300x300.png'])
|
||||
|
||||
@if(isset($title))
|
||||
{{$title}}
|
||||
|
@ -1,7 +1,7 @@
|
||||
@component('email.template.master', ['design' => 'light', 'settings' => $settings, 'whitelabel' => $whitelabel])
|
||||
|
||||
@slot('header')
|
||||
@component('email.components.header', ['p' => $body, 'logo' => $settings->company_logo ?: 'https://www.invoiceninja.com/wp-content/uploads/2019/01/InvoiceNinja-Logo-Round-300x300.png'])
|
||||
@component('email.components.header', ['p' => $body, 'logo' => (strlen($settings->company_logo) > 1) ? url('') . $settings->company_logo : 'https://www.invoiceninja.com/wp-content/uploads/2019/01/InvoiceNinja-Logo-Round-300x300.png'])
|
||||
|
||||
@if(isset($title))
|
||||
{{$title}}
|
||||
|
@ -1,137 +0,0 @@
|
||||
<body class="app header-fixed sidebar-fixed aside-menu-fixed sidebar-lg-show">
|
||||
<header class="app-header navbar">
|
||||
<button class="navbar-toggler sidebar-toggler d-lg-none mr-auto" type="button" data-toggle="sidebar-show">
|
||||
<span class="navbar-toggler-icon"></span>
|
||||
</button>
|
||||
<a class="navbar-brand" href="https://invoiceninja.com">
|
||||
<img class="navbar-brand-full" src="/images/logo.png" width="50" height="50" alt="Invoice Ninja Logo">
|
||||
<img class="navbar-brand-minimized" src="/images/logo.png" width="30" height="30" alt="Invoice Ninja Logo">
|
||||
</a>
|
||||
<button class="sidebar-minimizer brand-minimizer" type="button">
|
||||
<span class="navbar-toggler-icon"></span>
|
||||
</button>
|
||||
|
||||
<ul class="nav navbar-nav ml-auto">
|
||||
<li class="nav-item dropdown d-md-down-none" style="padding-left:20px; padding-right: 20px;">
|
||||
<a class="nav-link" data-toggle="dropdown" href="#" role="button" aria-haspopup="true" aria-expanded="false">
|
||||
<i class="icon-list"></i>
|
||||
<span class="badge badge-pill badge-warning">15</span>
|
||||
</a>
|
||||
<div class="dropdown-menu dropdown-menu-right dropdown-menu-lg">
|
||||
<div class="dropdown-header text-center">
|
||||
<strong>You have 5 pending tasks</strong>
|
||||
</div>
|
||||
<a class="dropdown-item" href="#">
|
||||
<div class="small mb-1">Mr Miyagi todos
|
||||
<span class="float-right">
|
||||
<strong>0%</strong>
|
||||
</span>
|
||||
</div>
|
||||
<span class="progress progress-xs">
|
||||
<div class="progress-bar bg-info" role="progressbar" style="width: 0%" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100"></div>
|
||||
</span>
|
||||
</a>
|
||||
<a class="dropdown-item" href="#">
|
||||
<div class="small mb-1">First, wash all car.
|
||||
<span class="float-right">
|
||||
<strong>25%</strong>
|
||||
</span>
|
||||
</div>
|
||||
<span class="progress progress-xs">
|
||||
<div class="progress-bar bg-danger" role="progressbar" style="width: 25%" aria-valuenow="25" aria-valuemin="0" aria-valuemax="100"></div>
|
||||
</span>
|
||||
</a>
|
||||
<a class="dropdown-item" href="#">
|
||||
<div class="small mb-1">Then wax. Wax on...
|
||||
<span class="float-right">
|
||||
<strong>50%</strong>
|
||||
</span>
|
||||
</div>
|
||||
<span class="progress progress-xs">
|
||||
<div class="progress-bar bg-warning" role="progressbar" style="width: 50%" aria-valuenow="50" aria-valuemin="0" aria-valuemax="100"></div>
|
||||
</span>
|
||||
</a>
|
||||
<a class="dropdown-item" href="#">
|
||||
<div class="small mb-1">No questions!
|
||||
<span class="float-right">
|
||||
<strong>75%</strong>
|
||||
</span>
|
||||
</div>
|
||||
<span class="progress progress-xs">
|
||||
<div class="progress-bar bg-info" role="progressbar" style="width: 75%" aria-valuenow="75" aria-valuemin="0" aria-valuemax="100"></div>
|
||||
</span>
|
||||
</a>
|
||||
<a class="dropdown-item" href="#">
|
||||
<div class="small mb-1">Wax on... wax off. Wax on... wax off.
|
||||
<span class="float-right">
|
||||
<strong>100%</strong>
|
||||
</span>
|
||||
</div>
|
||||
<span class="progress progress-xs">
|
||||
<div class="progress-bar bg-success" role="progressbar" style="width: 100%" aria-valuenow="100" aria-valuemin="0" aria-valuemax="100"></div>
|
||||
</span>
|
||||
</a>
|
||||
<a class="dropdown-item text-center" href="#">
|
||||
<strong>View all tasks</strong>
|
||||
</a>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
<li class="nav-item dropdown d-md-down-none" style="padding-left:20px; padding-right: 20px;">
|
||||
<a class="nav-link" data-toggle="dropdown" href="#" role="button" aria-haspopup="true" aria-expanded="false">
|
||||
<i class="fa fa-building" aria-hidden="true"></i> {{ $current_company->present()->name() }}
|
||||
</a>
|
||||
<div class="dropdown-menu dropdown-menu-right dropdown-menu-lg">
|
||||
<div class="dropdown-header text-center">
|
||||
<strong>trans('texts.manage_companies')</strong>
|
||||
</div>
|
||||
|
||||
@foreach($companies as $company) <!-- List all remaining companies here-->
|
||||
<a class="dropdown-item" href="#">
|
||||
<div class="small mb-1">{{ $company->present()->name }}
|
||||
<span class="float-right">
|
||||
</span>
|
||||
</div>
|
||||
<span class="progress progress-xs">
|
||||
<div class="progress-bar bg-info" role="progressbar" style="width: 0%" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100"></div>
|
||||
</span>
|
||||
</a>
|
||||
@endforeach
|
||||
|
||||
<div class="dropdown-divider"></div>
|
||||
|
||||
<!-- Add Company-->
|
||||
@if(count($companies) < 5)
|
||||
<a class="dropdown-item" href="{{ route('user.logout') }}">
|
||||
<i class="fa fa-plus"></i> trans('texts.add_company')</a>
|
||||
@endif
|
||||
</div>
|
||||
</li>
|
||||
|
||||
<li class="nav-item dropdown">
|
||||
<a class="nav-link" data-toggle="dropdown" href="#" role="button" aria-haspopup="true" aria-expanded="false">
|
||||
<img class="img-avatar" src="/images/logo.png" alt=""> {{ auth()->user()->present()->name }}
|
||||
</a>
|
||||
<div class="dropdown-menu dropdown-menu-right">
|
||||
<div class="dropdown-header text-center">
|
||||
<strong>Settings</strong>
|
||||
</div>
|
||||
<a class="dropdown-item" href="#">
|
||||
<i class="fa fa-user"></i> Profile</a>
|
||||
<a class="dropdown-item" href="{{ route('user.settings') }}">
|
||||
<i class="fa fa-wrench"></i> trans('texts.settings')</a>
|
||||
|
||||
<div class="dropdown-divider"></div>
|
||||
<a class="dropdown-item" href="{{ route('user.logout') }}">
|
||||
<i class="fa fa-lock"></i> Logout</a>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
<button class="navbar-toggler aside-menu-toggler d-md-down-none" type="button" data-toggle="aside-menu-lg-show">
|
||||
<span class="navbar-toggler-icon"></span>
|
||||
</button>
|
||||
<button class="navbar-toggler aside-menu-toggler d-lg-none" type="button" data-toggle="aside-menu-show">
|
||||
<span class="navbar-toggler-icon"></span>
|
||||
</button>
|
||||
</header>
|
||||
<div class="app-body">
|
@ -2,7 +2,7 @@
|
||||
<div class="flex flex-col w-64">
|
||||
<div class="flex items-center h-16 flex-shrink-0 px-4 bg-primary-darken justify-center">
|
||||
<a href="{{ route('client.dashboard') }}">
|
||||
<img class="h-8 w-auto" src="{!! $settings->company_logo ?: asset('images/invoiceninja-white-logo.png') !!}" alt="{{ config('app.name') }}" />
|
||||
<img class="h-8 w-auto" src="{!! url('') . $settings->company_logo ?: asset('images/invoiceninja-white-logo.png') !!}" alt="{{ config('app.name') }}" />
|
||||
</a>
|
||||
</div>
|
||||
<div class="h-0 flex-1 flex flex-col overflow-y-auto">
|
||||
|
@ -9,7 +9,7 @@
|
||||
</button>
|
||||
</div>
|
||||
<div class="flex-shrink-0 flex items-center px-4">
|
||||
<img class="h-6 w-auto" src="{!! $settings->company_logo ?: asset('images/invoiceninja-white-logo.png') !!}" alt="{{ config('app.name') }}" />
|
||||
<img class="h-6 w-auto" src="{!! url($settings->company_logo) ?: asset('images/invoiceninja-white-logo.png') !!}" alt="{{ config('app.name') }}" />
|
||||
</div>
|
||||
<div class="mt-5 flex-1 h-0 overflow-y-auto">
|
||||
<nav class="flex-1 py-4 bg-primary">
|
||||
|
@ -1,68 +0,0 @@
|
||||
<div class="sidebar">
|
||||
<nav class="sidebar-nav">
|
||||
<ul class="nav">
|
||||
|
||||
<li class="nav-item ">
|
||||
<a class="nav-link" href="{{ route('dashboard.index') }}">
|
||||
<i class="nav-icon icon-speedometer"></i> @lang('texts.dashboard')
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="/clients">
|
||||
<i class="nav-icon icon-user"></i> @lang('texts.clients')</a>
|
||||
</li>
|
||||
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="{{ route('invoices.index') }}">
|
||||
<i class="nav-icon icon-notebook"></i> @lang('texts.invoices')</a>
|
||||
</li>
|
||||
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="typography.html">
|
||||
<i class="nav-icon icon-wallet"></i> @lang('texts.payments')</a>
|
||||
</li>
|
||||
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="typography.html">
|
||||
<i class="nav-icon icon-docs"></i> @lang('texts.recurring')</a>
|
||||
</li>
|
||||
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="typography.html">
|
||||
<i class="nav-icon icon-badge"></i> @lang('texts.credits')</a>
|
||||
</li>
|
||||
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="typography.html">
|
||||
<i class="nav-icon icon-vector"></i> @lang('texts.quotes')</a>
|
||||
</li>
|
||||
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="typography.html">
|
||||
<i class="nav-icon icon-wrench"></i> @lang('texts.projects')</a>
|
||||
</li>
|
||||
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="typography.html">
|
||||
<i class="nav-icon icon-grid"></i> @lang('texts.tasks')</a>
|
||||
</li>
|
||||
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="typography.html">
|
||||
<i class="nav-icon icon-envelope-open"></i> @lang('texts.expenses')</a>
|
||||
</li>
|
||||
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="typography.html">
|
||||
<i class="nav-icon icon-bell"></i> @lang('texts.vendors')</a>
|
||||
</li>
|
||||
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="typography.html">
|
||||
<i class="nav-icon icon-printer"></i> @lang('texts.reports')</a>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
<button class="sidebar-minimizer brand-minimizer" type="button"></button>
|
||||
</div>
|
47
tests/Unit/Phantom/PhantomJsTest.php
Normal file
47
tests/Unit/Phantom/PhantomJsTest.php
Normal file
@ -0,0 +1,47 @@
|
||||
<?php
|
||||
/**
|
||||
* Invoice Ninja (https://invoiceninja.com).
|
||||
*
|
||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||
*
|
||||
* @copyright Copyright (c) 2021. Invoice Ninja LLC (https://invoiceninja.com)
|
||||
*
|
||||
* @license https://opensource.org/licenses/AAL
|
||||
*/
|
||||
namespace Tests\Unit\Phantom;
|
||||
|
||||
use Tests\TestCase;
|
||||
|
||||
/**
|
||||
* @test
|
||||
* @covers App\Utils\PhantomJS\Phantom
|
||||
*/
|
||||
class PhantomJsTest extends TestCase
|
||||
{
|
||||
public function setUp() :void
|
||||
{
|
||||
parent::setUp();
|
||||
}
|
||||
|
||||
public function testValidPdfMime()
|
||||
{
|
||||
$pdf = file_get_contents(base_path('/tests/Unit/Phantom/valid.pdf'));
|
||||
|
||||
$finfo = new \finfo(FILEINFO_MIME);
|
||||
|
||||
$this->assertEquals('application/pdf; charset=binary', $finfo->buffer($pdf));
|
||||
|
||||
}
|
||||
|
||||
public function testInValidPdfMime()
|
||||
{
|
||||
|
||||
$pdf = file_get_contents(base_path('/tests/Unit/Phantom/invalid.pdf'));
|
||||
|
||||
$finfo = new \finfo(FILEINFO_MIME);
|
||||
|
||||
$this->assertNotEquals('application/pdf; charset=binary', $finfo->buffer($pdf));
|
||||
|
||||
}
|
||||
|
||||
}
|
483
tests/Unit/Phantom/invalid.pdf
Normal file
483
tests/Unit/Phantom/invalid.pdf
Normal file
@ -0,0 +1,483 @@
|
||||
<title>$number</title>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
<meta http-equiv="x-ua-compatible" content="ie=edge">
|
||||
<link href="http://ninja.test:8000/css/tailwind-1.2.0.css" rel="stylesheet">
|
||||
<style>
|
||||
body {font-size:90%}
|
||||
.table_header_thead_class {text-align:left; text-align:left; color:#fff; background-color:#1a202c;}
|
||||
.table_header_td_class {padding-left:1rem;padding-right:1rem; padding-top:.5rem;padding-bottom:.5rem}
|
||||
.table_body_td_class {border-top-width:1px; border-bottom-width:1px; border-color:#1a202c; padding-left:1rem;padding-right:1rem; padding-top:1rem;padding-bottom:1rem;}
|
||||
|
||||
|
||||
.header, .header-space {
|
||||
height: 160px;
|
||||
}
|
||||
|
||||
.footer, .footer-space {
|
||||
height: 160px;
|
||||
}
|
||||
|
||||
.footer {
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.header {
|
||||
position: fixed;
|
||||
top: 0mm;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
@media print {
|
||||
thead {display: table-header-group;}
|
||||
tfoot {display: table-footer-group;}
|
||||
button {display: none;}
|
||||
body {margin: 0;}
|
||||
}';
|
||||
|
||||
$header = '
|
||||
.header, .header-space {
|
||||
height: 160px;
|
||||
}
|
||||
|
||||
.header {
|
||||
position: fixed;
|
||||
top: 0mm;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
@media print {
|
||||
thead {display: table-header-group;}
|
||||
button {display: none;}
|
||||
body {margin: 0;}
|
||||
}';
|
||||
|
||||
$footer = '
|
||||
|
||||
.footer, .footer-space {
|
||||
height: 160px;
|
||||
}
|
||||
|
||||
.footer {
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
@media print {
|
||||
tfoot {display: table-footer-group;}
|
||||
button {display: none;}
|
||||
body {margin: 0;}
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
|
||||
<div class="header bg-orange-600 flex justify-between py-12 px-12" style="page-break-inside: avoid;">
|
||||
<div class="grid grid-cols-6 gap-1">
|
||||
<div class="col-span-2 p-3">
|
||||
<h1 class="text-white font-bold text-3xl">$company.name</h1>
|
||||
</div>
|
||||
<div class="col-span-2 p-3 flex flex-col text-white flex-wrap">
|
||||
$company_details
|
||||
</div>
|
||||
<div class="col-span-2 p-3 flex flex-col text-white flex-wrap">
|
||||
$entity_details
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<table class="container"><thead><tr><td><div class="header-space"></div></td></tr></thead>
|
||||
<tbody><tr><td>
|
||||
<div class="grid grid-cols-5 gap-1 px-12 pt-12">
|
||||
<div class="col-span-2 p-3">
|
||||
$company_logo
|
||||
</div>
|
||||
<div class="col-span-3 p-3 flex flex-col flex-wrap">
|
||||
$client_details
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="px-12 pt-5 pb-20">
|
||||
<table class="w-full table-auto mt-8">
|
||||
<thead class="text-left text-white bg-gray-900 display: table-header-group;">
|
||||
<tr>
|
||||
<th>Firstname</th>
|
||||
<th>Lastname</th>
|
||||
<th>Age</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="whitespace-pre-line">
|
||||
|
||||
<tr>
|
||||
<td>Jill</td>
|
||||
<td>Smith</td>
|
||||
<td>50</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Eve</td>
|
||||
<td>Jackson</td>
|
||||
<td>94</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Eve</td>
|
||||
<td>Jackson</td>
|
||||
<td>94</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Eve</td>
|
||||
<td>Jackson</td>
|
||||
<td>94</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Eve</td>
|
||||
<td>Jackson</td>
|
||||
<td>94</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Eve</td>
|
||||
<td>Jackson</td>
|
||||
<td>94</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Eve</td>
|
||||
<td>Jackson</td>
|
||||
<td>94</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Eve</td>
|
||||
<td>Jackson</td>
|
||||
<td>94</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Eve</td>
|
||||
<td>Jackson</td>
|
||||
<td>94</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Eve</td>
|
||||
<td>Jackson</td>
|
||||
<td>94</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Eve</td>
|
||||
<td>Jackson</td>
|
||||
<td>94</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Eve</td>
|
||||
<td>Jackson</td>
|
||||
<td>94</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Eve</td>
|
||||
<td>Jackson</td>
|
||||
<td>94</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Eve</td>
|
||||
<td>Jackson</td>
|
||||
<td>94</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Eve</td>
|
||||
<td>Jackson</td>
|
||||
<td>94</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Eve</td>
|
||||
<td>Jackson</td>
|
||||
<td>94</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Eve</td>
|
||||
<td>Jackson</td>
|
||||
<td>94</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Eve</td>
|
||||
<td>Jackson</td>
|
||||
<td>94</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Eve</td>
|
||||
<td>Jackson</td>
|
||||
<td>94</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Eve</td>
|
||||
<td>Jackson</td>
|
||||
<td>94</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Eve</td>
|
||||
<td>Jackson</td>
|
||||
<td>94</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Eve</td>
|
||||
<td>Jackson</td>
|
||||
<td>94</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Eve</td>
|
||||
<td>Jackson</td>
|
||||
<td>94</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Eve</td>
|
||||
<td>Jackson</td>
|
||||
<td>94</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Eve</td>
|
||||
<td>Jackson</td>
|
||||
<td>94</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Eve</td>
|
||||
<td>Jackson</td>
|
||||
<td>94</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Eve</td>
|
||||
<td>Jackson</td>
|
||||
<td>94</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Eve</td>
|
||||
<td>Jackson</td>
|
||||
<td>94</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Eve</td>
|
||||
<td>Jackson</td>
|
||||
<td>94</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Eve</td>
|
||||
<td>Jackson</td>
|
||||
<td>94</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Eve</td>
|
||||
<td>Jackson</td>
|
||||
<td>94</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Eve</td>
|
||||
<td>Jackson</td>
|
||||
<td>94</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Eve</td>
|
||||
<td>Jackson</td>
|
||||
<td>94</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Eve</td>
|
||||
<td>Jackson</td>
|
||||
<td>94</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Eve</td>
|
||||
<td>Jackson</td>
|
||||
<td>94</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Eve</td>
|
||||
<td>Jackson</td>
|
||||
<td>94</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Eve</td>
|
||||
<td>Jackson</td>
|
||||
<td>94</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Eve</td>
|
||||
<td>Jackson</td>
|
||||
<td>94</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Eve</td>
|
||||
<td>Jackson</td>
|
||||
<td>94</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Eve</td>
|
||||
<td>Jackson</td>
|
||||
<td>94</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Eve</td>
|
||||
<td>Jackson</td>
|
||||
<td>94</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Eve</td>
|
||||
<td>Jackson</td>
|
||||
<td>94</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Eve</td>
|
||||
<td>Jackson</td>
|
||||
<td>94</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Eve</td>
|
||||
<td>Jackson</td>
|
||||
<td>94</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Eve</td>
|
||||
<td>Jackson</td>
|
||||
<td>94</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Eve</td>
|
||||
<td>Jackson</td>
|
||||
<td>94</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Eve</td>
|
||||
<td>Jackson</td>
|
||||
<td>94</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Eve</td>
|
||||
<td>Jackson</td>
|
||||
<td>94</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Eve</td>
|
||||
<td>Jackson</td>
|
||||
<td>94</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Eve</td>
|
||||
<td>Jackson</td>
|
||||
<td>94</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Eve</td>
|
||||
<td>Jackson</td>
|
||||
<td>94</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Eve</td>
|
||||
<td>Jackson</td>
|
||||
<td>94</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Eve</td>
|
||||
<td>Jackson</td>
|
||||
<td>94</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Eve</td>
|
||||
<td>Jackson</td>
|
||||
<td>94</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Eve</td>
|
||||
<td>Jackson</td>
|
||||
<td>94</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Eve</td>
|
||||
<td>Jackson</td>
|
||||
<td>94</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Eve</td>
|
||||
<td>Jackson</td>
|
||||
<td>94</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Eve</td>
|
||||
<td>Jackson</td>
|
||||
<td>94</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Eve</td>
|
||||
<td>Jackson</td>
|
||||
<td>94</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Eve</td>
|
||||
<td>Jackson</td>
|
||||
<td>94</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Eve</td>
|
||||
<td>Jackson</td>
|
||||
<td>94</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Eve</td>
|
||||
<td>Jackson</td>
|
||||
<td>94</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Eve</td>
|
||||
<td>Jackson</td>
|
||||
<td>94</td>
|
||||
</tr>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<div class="flex px-4 mt-6 w-full" style="page-break-inside: avoid;">
|
||||
<div class="w-1/2">
|
||||
$entity.public_notes
|
||||
</div>
|
||||
<div class="w-1/2 flex" style="page-break-inside: avoid;">
|
||||
<div class="w-1/2 text-right flex flex-col" style="page-break-inside: avoid;">
|
||||
$discount_label
|
||||
$total_tax_labels
|
||||
$line_tax_labels
|
||||
</div>
|
||||
<div class="w-1/2 text-right flex flex-col" style="page-break-inside: avoid;">
|
||||
$discount
|
||||
$total_tax_values
|
||||
$line_tax_values
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div style="page-break-inside: avoid;">
|
||||
<div class="flex px-4 mt-4 w-full items-end mt-5" >
|
||||
<div class="w-1/2" style="page-break-inside: avoid;">
|
||||
<p class="font-semibold">$terms_label</p>
|
||||
$terms
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mt-8 px-4 py-2 bg-gray-900 text-white" style="">
|
||||
<div class="w-1/2"></div>
|
||||
<div class="w-auto flex justify-end" style="page-break-inside: avoid;">
|
||||
<div class="w-56" style="page-break-inside: avoid;">
|
||||
<p class="font-bold">$balance_due_label</p>
|
||||
</div>
|
||||
<p>$balance_due</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</td></tr></tbody><tfoot><tr><td><div class="footer-space"></div></td></tr></tfoot></table>
|
||||
|
||||
|
||||
<div class="footer bg-orange-600 flex justify-between py-8 px-12" style="page-break-inside: avoid;">
|
||||
<div class="grid grid-cols-12 gap-4">
|
||||
<div class="col-start-4 col-span-4 p-3 flex flex-col text-white text-right flex-wrap">
|
||||
$company_details
|
||||
</div>
|
||||
<div class="col-span-4 p-3 flex flex-col text-white text-right flex-wrap">
|
||||
$company_address
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
BIN
tests/Unit/Phantom/valid.pdf
Normal file
BIN
tests/Unit/Phantom/valid.pdf
Normal file
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user