mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-05-24 02:14:21 -04:00
Added new labels & update designs
This commit is contained in:
parent
8381d37431
commit
f7408e1fb3
@ -48,10 +48,6 @@ class Bold extends BaseDesign
|
||||
|
||||
$this->type = $type;
|
||||
|
||||
if ($type !== 'product' || $type !== 'task') {
|
||||
throw new \Exception("Type '{$type}' is not allowed. Allowed values are 'product' or 'task'.");
|
||||
}
|
||||
|
||||
$this->setup();
|
||||
|
||||
return [
|
||||
@ -148,7 +144,7 @@ class Bold extends BaseDesign
|
||||
|
||||
$elements = [];
|
||||
|
||||
foreach ($this->context['product-table-columns'] as $column) {
|
||||
foreach ($this->context["{$this->type}-table-columns"] as $column) {
|
||||
$elements[] = ['element' => 'th', 'content' => $column . '_label', 'properties' => ['class' => 'text-xl px-4 py-2']];
|
||||
}
|
||||
|
||||
|
@ -48,10 +48,6 @@ class Business extends BaseDesign
|
||||
|
||||
$this->type = $type;
|
||||
|
||||
if ($type !== 'product' || $type !== 'task') {
|
||||
throw new \Exception("Type '{$type}' is not allowed. Allowed values are 'product' or 'task'.");
|
||||
}
|
||||
|
||||
$this->setup();
|
||||
|
||||
return [
|
||||
|
@ -48,10 +48,6 @@ class Clean extends BaseDesign
|
||||
|
||||
$this->type = $type;
|
||||
|
||||
if ($type !== 'product' || $type !== 'task') {
|
||||
throw new \Exception("Type '{$type}' is not allowed. Allowed values are 'product' or 'task'.");
|
||||
}
|
||||
|
||||
$this->setup();
|
||||
|
||||
return [
|
||||
|
@ -48,10 +48,6 @@ class Creative extends BaseDesign
|
||||
|
||||
$this->type = $type;
|
||||
|
||||
if ($type !== 'product' || $type !== 'task') {
|
||||
throw new \Exception("Type '{$type}' is not allowed. Allowed values are 'product' or 'task'.");
|
||||
}
|
||||
|
||||
$this->setup();
|
||||
|
||||
return [
|
||||
|
@ -48,10 +48,6 @@ class Elegant extends BaseDesign
|
||||
|
||||
$this->type = $type;
|
||||
|
||||
if ($type !== 'product' || $type !== 'task') {
|
||||
throw new \Exception("Type '{$type}' is not allowed. Allowed values are 'product' or 'task'.");
|
||||
}
|
||||
|
||||
$this->setup();
|
||||
|
||||
return [
|
||||
|
@ -48,10 +48,6 @@ class Hipster extends BaseDesign
|
||||
|
||||
$this->type = $type;
|
||||
|
||||
if ($type !== 'product' || $type !== 'task') {
|
||||
throw new \Exception("Type '{$type}' is not allowed. Allowed values are 'product' or 'task'.");
|
||||
}
|
||||
|
||||
$this->setup();
|
||||
|
||||
return [
|
||||
|
@ -48,10 +48,6 @@ class Modern extends BaseDesign
|
||||
|
||||
$this->type = $type;
|
||||
|
||||
if ($type !== 'product' || $type !== 'task') {
|
||||
throw new \Exception("Type '{$type}' is not allowed. Allowed values are 'product' or 'task'.");
|
||||
}
|
||||
|
||||
$this->setup();
|
||||
|
||||
return [
|
||||
|
@ -48,10 +48,6 @@ class Plain extends BaseDesign
|
||||
|
||||
$this->type = $type;
|
||||
|
||||
if ($type !== 'product' || $type !== 'task') {
|
||||
throw new \Exception("Type '{$type}' is not allowed. Allowed values are 'product' or 'task'.");
|
||||
}
|
||||
|
||||
$this->setup();
|
||||
|
||||
return [
|
||||
|
@ -48,10 +48,6 @@ class Playful extends BaseDesign
|
||||
|
||||
$this->type = $type;
|
||||
|
||||
if ($type !== 'product' || $type !== 'task') {
|
||||
throw new \Exception("Type '{$type}' is not allowed. Allowed values are 'product' or 'task'.");
|
||||
}
|
||||
|
||||
$this->setup();
|
||||
|
||||
return [
|
||||
|
@ -96,6 +96,7 @@ class HtmlEngine
|
||||
|
||||
$data = [];
|
||||
$data['$global-margin'] = ['value' => 'm-12', 'label' => ''];
|
||||
$data['$global-padding'] = ['value' => 'p-12', 'label' => ''];
|
||||
$data['$tax'] = ['value' => '', 'label' => ctrans('texts.tax')];
|
||||
$data['$app_url'] = ['value' => $this->generateAppUrl(), 'label' => ''];
|
||||
$data['$from'] = ['value' => '', 'label' => ctrans('texts.from')];
|
||||
@ -175,11 +176,11 @@ class HtmlEngine
|
||||
$data['$invoice.custom4'] = ['value' => $this->entity->custom_value4 ?: ' ', 'label' => $this->makeCustomField('invoice4')];
|
||||
$data['$invoice.public_notes'] = ['value' => $this->entity->public_notes ?: ' ', 'label' => ctrans('texts.public_notes')];
|
||||
$data['$entity.public_notes'] = &$data['$invoice.public_notes'];
|
||||
|
||||
$data['$entity_issued_to'] = ['value' => '', 'label' => ctrans("texts.{$this->entity_string}_issued_to")];
|
||||
|
||||
// $data['$your_invoice'] = ;
|
||||
// $data['$quote'] = ;
|
||||
// $data['$your_quote'] = ;
|
||||
//
|
||||
$data['$your_' . $this->entity_string] = ['value' => '', 'label' => ctrans("texts.your_{$this->entity_string}")];
|
||||
|
||||
$data['$quote.date'] = ['value' => $this->entity->date ?: ' ', 'label' => ctrans('texts.quote_date')];
|
||||
$data['$quote.number'] = ['value' => $this->entity->number ?: ' ', 'label' => ctrans('texts.quote_number')];
|
||||
$data['$quote.po_number'] = &$data['$invoice.po_number'];
|
||||
@ -297,6 +298,10 @@ class HtmlEngine
|
||||
$data['$task.line_total'] = ['value' => '', 'label' => ctrans('texts.line_total')];
|
||||
$data['$contact.signature'] = ['value' => $this->invitation->signature_base64, 'label' => ctrans('texts.signature')];
|
||||
|
||||
$data['$thanks'] = ['value' => '', 'label' => ctrans('texts.thanks')];
|
||||
$data['$from'] = ['value' => '', 'label' => ctrans('texts.from')];
|
||||
$data['$to'] = ['value' => '', 'label' => ctrans('texts.to')];
|
||||
|
||||
// $data['custom_label1'] = ['value' => '', 'label' => ctrans('texts.')];
|
||||
// $data['custom_label2'] = ['value' => '', 'label' => ctrans('texts.')];
|
||||
// $data['custom_label3'] = ['value' => '', 'label' => ctrans('texts.')];
|
||||
|
@ -44,7 +44,7 @@
|
||||
<h2
|
||||
class="text-2xl font-semibold tracking-tight text-teal-600 uppercase"
|
||||
>
|
||||
$your-invoice
|
||||
$your_entity_label
|
||||
</h2>
|
||||
<div id="client-details" class="mt-4"></div>
|
||||
</div>
|
||||
|
@ -52,7 +52,7 @@
|
||||
<!-- Client details, entity details -->
|
||||
<div class="grid grid-cols-12 gap-4 my-12">
|
||||
<div class="col-span-6">
|
||||
<p>$invoice-issued-to</p>
|
||||
<p>$entity_issued_to_label</p>
|
||||
<div id="client-details" class="mt-4 text-orange-600"></div>
|
||||
</div>
|
||||
<div class="col-span-6">
|
||||
|
@ -34,7 +34,7 @@
|
||||
</div>
|
||||
|
||||
<!-- Entity labels, client details -->
|
||||
<p class="mt-10 text-xl text-blue-500 uppercase">$entity</p>
|
||||
<p class="mt-10 text-xl text-blue-500 uppercase">$entity_label</p>
|
||||
<div class="grid grid-cols-12 px-2 py-3 mt-4 border-t border-b">
|
||||
<div class="col-span-6">
|
||||
<table id="entity-details"></table>
|
||||
|
@ -49,8 +49,8 @@
|
||||
<div class="grid grid-cols-12 mt-10">
|
||||
<!-- Entity number -->
|
||||
<div class="col-span-4 text-3xl font-semibold uppercase">
|
||||
<span>$entity</span>
|
||||
<i class="text-pink-700">#$entity-number</i>
|
||||
<span>$entity_label</span>
|
||||
<i class="text-pink-700">#$entity_number</i>
|
||||
</div>
|
||||
|
||||
<!-- Entity labels -->
|
||||
|
@ -42,7 +42,7 @@
|
||||
<table id="product-table" class="w-full mt-10 table-auto"></table>
|
||||
|
||||
<!-- Thanks label -->
|
||||
<p class="w-full pb-4 mt-10 text-2xl font-semibold text-center border-b-4 border-black">$thanks</p>
|
||||
<p class="w-full pb-4 mt-10 text-2xl font-semibold text-center border-b-4 border-black">$thanks_label</p>
|
||||
<div class="w-full border-black order-b wpy-1"></div>
|
||||
</body>
|
||||
</html>
|
||||
|
@ -17,7 +17,7 @@
|
||||
<div class="col-span-4 pl-4 border-l border-black">
|
||||
<div id="company-details">
|
||||
<p class="font-semibold text-yellow-600 uppercase">
|
||||
$from:
|
||||
$from_label:
|
||||
</p>
|
||||
</div>
|
||||
<div id="company-address" class="mt-4"></div>
|
||||
@ -26,7 +26,7 @@
|
||||
class="col-span-5 pl-4 border-l border-black"
|
||||
id="client-details"
|
||||
>
|
||||
<p class="font-semibold text-yellow-600 uppercase">$to:</p>
|
||||
<p class="font-semibold text-yellow-600 uppercase">$to_label:</p>
|
||||
</div>
|
||||
<div class="col-span-3">
|
||||
<img
|
||||
@ -39,7 +39,7 @@
|
||||
|
||||
<!-- Entity details -->
|
||||
<h1 class="mt-6 text-4xl font-semibold uppercase lg:text-5xl">
|
||||
$entity
|
||||
$entity_label
|
||||
</h1>
|
||||
<div
|
||||
id="entity-details"
|
||||
|
@ -40,7 +40,7 @@
|
||||
<!-- Company details, client details -->
|
||||
<div class="grid grid-cols-12 gap-12 mt-12">
|
||||
<div class="col-span-6">
|
||||
<p class="px-4 font-semibold text-teal-600">$to:</p>
|
||||
<p class="px-4 font-semibold text-teal-600">$to_label:</p>
|
||||
<div
|
||||
class="p-4 mt-4 border-t-4 border-b-4 border-teal-600 border-dashed"
|
||||
>
|
||||
@ -48,7 +48,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-span-6">
|
||||
<p class="px-4 font-semibold text-teal-600">$from:</p>
|
||||
<p class="px-4 font-semibold text-teal-600">$from_label:</p>
|
||||
<div
|
||||
class="flex p-4 mt-4 space-x-4 border-t-4 border-b-4 border-teal-600 border-dashed"
|
||||
>
|
||||
|
@ -3,7 +3,7 @@
|
||||
namespace Tests\Feature\PdfMaker;
|
||||
|
||||
use App\Models\Invoice;
|
||||
use App\Services\PdfMaker\Designs\Plain;
|
||||
use App\Services\PdfMaker\Designs\Playful;
|
||||
use App\Services\PdfMaker\PdfMaker;
|
||||
use App\Utils\HtmlEngine;
|
||||
use App\Utils\Traits\MakesInvoiceValues;
|
||||
@ -19,7 +19,7 @@ class ExampleIntegrationTest extends TestCase
|
||||
$invitation = $invoice->invitations()->first();
|
||||
|
||||
$engine = new HtmlEngine(null, $invitation, 'invoice');
|
||||
$design = new Plain();
|
||||
$design = new Playful();
|
||||
|
||||
$product_table_columns = json_decode(
|
||||
json_encode($invoice->company->settings->pdf_variables),
|
||||
@ -35,10 +35,10 @@ class ExampleIntegrationTest extends TestCase
|
||||
'variables' => $engine->generateLabelsAndValues(),
|
||||
];
|
||||
|
||||
$maker = new PdfMaker($state, 'product');
|
||||
$maker = new PdfMaker($state);
|
||||
|
||||
$maker
|
||||
->design(Plain::class)
|
||||
->design(Playful::class)
|
||||
->build();
|
||||
|
||||
exec('echo "" > storage/logs/laravel.log');
|
||||
|
Loading…
x
Reference in New Issue
Block a user