mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-09-20 16:31:33 +02: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
|
||||
{
|
||||
nlog($this->html);
|
||||
|
||||
if (config('ninja.phantomjs_pdf_generation') || config('ninja.pdf_generator') == 'phantom') {
|
||||
return (new Phantom)->convertHtmlToPdf($this->html);
|
||||
@ -179,11 +180,8 @@ class StubBuilder
|
||||
$html = new HtmlEngine($this->invitation);
|
||||
|
||||
$design_string = "{$this->entity_type}_design_id";
|
||||
nlog($design_string);
|
||||
|
||||
$design = DesignModel::withTrashed()->find($this->decodePrimaryKey($html->settings->{$design_string}));
|
||||
|
||||
nlog($design->toArray());
|
||||
|
||||
$template = new PdfMakerDesign(strtolower($design->name));
|
||||
|
||||
@ -200,14 +198,10 @@ class StubBuilder
|
||||
|
||||
$maker = new PdfMaker($state);
|
||||
|
||||
nlog("pre html");
|
||||
|
||||
$this->html = $maker->design($template)
|
||||
->build()
|
||||
->getCompiledHTML();
|
||||
|
||||
nlog($this->html);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
@ -292,6 +286,7 @@ class StubBuilder
|
||||
'client_id' => $this->recipient->id,
|
||||
'terms' => $this->company->settings->invoice_terms,
|
||||
'footer' => $this->company->settings->invoice_footer,
|
||||
'status_id' => Invoice::STATUS_PAID,
|
||||
]);
|
||||
|
||||
$this->invitation = InvoiceInvitation::factory()->create([
|
||||
|
@ -116,7 +116,7 @@ class HtmlEngine
|
||||
|
||||
$data['$global_margin'] = ['value' => '6.35mm', '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['$app_url'] = ['value' => $this->generateAppUrl(), 'label' => ''];
|
||||
$data['$from'] = ['value' => '', 'label' => ctrans('texts.from')];
|
||||
@ -191,10 +191,10 @@ class HtmlEngine
|
||||
$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) {
|
||||
$data['$invoice.vendor'] = ['value' => $this->entity->vendor->present()->name(), 'label' => ctrans('texts.vendor_name')];
|
||||
}
|
||||
|
@ -309,6 +309,7 @@
|
||||
opacity: 0.2;
|
||||
z-index:200 !important;
|
||||
position: fixed;
|
||||
display: $show_paid_stamp;
|
||||
}
|
||||
|
||||
.project-header {
|
||||
|
Loading…
Reference in New Issue
Block a user