mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Fixes for paid stamp display AND show shipping address
This commit is contained in:
parent
87690df25f
commit
2665640c25
@ -94,6 +94,7 @@ class StubBuilder
|
|||||||
|
|
||||||
public function getPdf(): mixed
|
public function getPdf(): mixed
|
||||||
{
|
{
|
||||||
|
nlog($this->html);
|
||||||
|
|
||||||
if (config('ninja.phantomjs_pdf_generation') || config('ninja.pdf_generator') == 'phantom') {
|
if (config('ninja.phantomjs_pdf_generation') || config('ninja.pdf_generator') == 'phantom') {
|
||||||
return (new Phantom)->convertHtmlToPdf($this->html);
|
return (new Phantom)->convertHtmlToPdf($this->html);
|
||||||
@ -179,12 +180,9 @@ class StubBuilder
|
|||||||
$html = new HtmlEngine($this->invitation);
|
$html = new HtmlEngine($this->invitation);
|
||||||
|
|
||||||
$design_string = "{$this->entity_type}_design_id";
|
$design_string = "{$this->entity_type}_design_id";
|
||||||
nlog($design_string);
|
|
||||||
|
|
||||||
$design = DesignModel::withTrashed()->find($this->decodePrimaryKey($html->settings->{$design_string}));
|
$design = DesignModel::withTrashed()->find($this->decodePrimaryKey($html->settings->{$design_string}));
|
||||||
|
|
||||||
nlog($design->toArray());
|
|
||||||
|
|
||||||
$template = new PdfMakerDesign(strtolower($design->name));
|
$template = new PdfMakerDesign(strtolower($design->name));
|
||||||
|
|
||||||
$state = [
|
$state = [
|
||||||
@ -200,14 +198,10 @@ class StubBuilder
|
|||||||
|
|
||||||
$maker = new PdfMaker($state);
|
$maker = new PdfMaker($state);
|
||||||
|
|
||||||
nlog("pre html");
|
|
||||||
|
|
||||||
$this->html = $maker->design($template)
|
$this->html = $maker->design($template)
|
||||||
->build()
|
->build()
|
||||||
->getCompiledHTML();
|
->getCompiledHTML();
|
||||||
|
|
||||||
nlog($this->html);
|
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -292,6 +286,7 @@ class StubBuilder
|
|||||||
'client_id' => $this->recipient->id,
|
'client_id' => $this->recipient->id,
|
||||||
'terms' => $this->company->settings->invoice_terms,
|
'terms' => $this->company->settings->invoice_terms,
|
||||||
'footer' => $this->company->settings->invoice_footer,
|
'footer' => $this->company->settings->invoice_footer,
|
||||||
|
'status_id' => Invoice::STATUS_PAID,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$this->invitation = InvoiceInvitation::factory()->create([
|
$this->invitation = InvoiceInvitation::factory()->create([
|
||||||
|
@ -116,7 +116,7 @@ class HtmlEngine
|
|||||||
|
|
||||||
$data['$global_margin'] = ['value' => '6.35mm', 'label' => ''];
|
$data['$global_margin'] = ['value' => '6.35mm', 'label' => ''];
|
||||||
$data['$company_logo_size'] = ['value' => $this->resolveCompanyLogoSize(), 'label' => ''];
|
$data['$company_logo_size'] = ['value' => $this->resolveCompanyLogoSize(), 'label' => ''];
|
||||||
$data['show_shipping_address'] = ['value' => $this->settings?->show_shipping_address ? 'flex' : 'none', 'label' => ''];
|
$data['$show_shipping_address'] = ['value' => $this->settings?->show_shipping_address ? 'flex' : 'none', 'label' => ''];
|
||||||
$data['$tax'] = ['value' => '', 'label' => ctrans('texts.tax')];
|
$data['$tax'] = ['value' => '', 'label' => ctrans('texts.tax')];
|
||||||
$data['$app_url'] = ['value' => $this->generateAppUrl(), 'label' => ''];
|
$data['$app_url'] = ['value' => $this->generateAppUrl(), 'label' => ''];
|
||||||
$data['$from'] = ['value' => '', 'label' => ctrans('texts.from')];
|
$data['$from'] = ['value' => '', 'label' => ctrans('texts.from')];
|
||||||
@ -191,9 +191,9 @@ class HtmlEngine
|
|||||||
$data['$invoice.project'] = &$data['$project.name'];
|
$data['$invoice.project'] = &$data['$project.name'];
|
||||||
}
|
}
|
||||||
|
|
||||||
if($this->entity->status_id == 4 && $this->settings->show_paid_stamp) {
|
|
||||||
$data['$status_logo'] = ['value' => '<div class="stamp is-paid"> ' . ctrans('texts.paid') .'</div>', 'label' => ''];
|
$data['$status_logo'] = ['value' => '<div class="stamp is-paid"> ' . ctrans('texts.paid') .'</div>', 'label' => ''];
|
||||||
}
|
|
||||||
|
$data['$show_paid_stamp'] = ['value' => $this->entity->status_id == 4 && $this->settings?->show_paid_stamp ? 'flex' : 'none', 'label' => ''];
|
||||||
|
|
||||||
if ($this->entity->vendor) {
|
if ($this->entity->vendor) {
|
||||||
$data['$invoice.vendor'] = ['value' => $this->entity->vendor->present()->name(), 'label' => ctrans('texts.vendor_name')];
|
$data['$invoice.vendor'] = ['value' => $this->entity->vendor->present()->name(), 'label' => ctrans('texts.vendor_name')];
|
||||||
|
@ -309,6 +309,7 @@
|
|||||||
opacity: 0.2;
|
opacity: 0.2;
|
||||||
z-index:200 !important;
|
z-index:200 !important;
|
||||||
position: fixed;
|
position: fixed;
|
||||||
|
display: $show_paid_stamp;
|
||||||
}
|
}
|
||||||
|
|
||||||
.project-header {
|
.project-header {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user