mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-06-01 00:34:35 -04:00
Update DesignUpdate with new namespace
This commit is contained in:
parent
1d7e4fd6c9
commit
5ebe60c78e
@ -39,16 +39,17 @@ class DesignUpdate extends Command
|
|||||||
public function handle()
|
public function handle()
|
||||||
{
|
{
|
||||||
foreach (Design::whereIsCustom(false)->get() as $design) {
|
foreach (Design::whereIsCustom(false)->get() as $design) {
|
||||||
$class = 'App\Designs\\'.$design->name;
|
$class = 'App\Services\PdfMaker\Designs\\'.$design->name;
|
||||||
$invoice_design = new $class();
|
$invoice_design = new $class();
|
||||||
|
$invoice_design->document();
|
||||||
|
|
||||||
$design_object = new \stdClass;
|
$design_object = new \stdClass;
|
||||||
$design_object->includes = $invoice_design->includes() ?: '';
|
$design_object->includes = $invoice_design->getSectionHTML('includes');
|
||||||
$design_object->header = $invoice_design->header() ?: '';
|
$design_object->header = $invoice_design->getSectionHTML('head', false);
|
||||||
$design_object->body = $invoice_design->body() ?: '';
|
$design_object->body = $invoice_design->getSectionHTML('body', false);
|
||||||
$design_object->product = $invoice_design->product() ?: '';
|
$design_object->product = $invoice_design->getSectionHTML('product-table');
|
||||||
$design_object->task = $invoice_design->task() ?: '';
|
$design_object->task = $invoice_design->getSectionHTML('task-table');
|
||||||
$design_object->footer = $invoice_design->footer() ?: '';
|
$design_object->footer = $invoice_design->getSectionHTML('footer', false);
|
||||||
|
|
||||||
$design->design = $design_object;
|
$design->design = $design_object;
|
||||||
$design->save();
|
$design->save();
|
||||||
|
45
app/Services/PdfMaker/Designs/Photo.php
Normal file
45
app/Services/PdfMaker/Designs/Photo.php
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Invoice Ninja (https://invoiceninja.com)
|
||||||
|
*
|
||||||
|
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||||
|
*
|
||||||
|
* @copyright Copyright (c) 2020. Invoice Ninja LLC (https://invoiceninja.com)
|
||||||
|
*
|
||||||
|
* @license https://opensource.org/licenses/AAL
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace App\Services\PdfMaker\Designs;
|
||||||
|
|
||||||
|
use App\Services\PdfMaker\Designs\Utilities\BaseDesign;
|
||||||
|
use App\Services\PdfMaker\Designs\Utilities\DesignHelpers;
|
||||||
|
use App\Utils\Traits\MakesInvoiceValues;
|
||||||
|
|
||||||
|
/** @deprecated */
|
||||||
|
class Photo extends BaseDesign
|
||||||
|
{
|
||||||
|
use MakesInvoiceValues, DesignHelpers;
|
||||||
|
|
||||||
|
/** Global list of table elements, @var array */
|
||||||
|
public $elements;
|
||||||
|
|
||||||
|
/** @var App\Models\Client */
|
||||||
|
public $client;
|
||||||
|
|
||||||
|
/** @var App\Models\Invoice || @var App\Models\Quote */
|
||||||
|
public $entity;
|
||||||
|
|
||||||
|
/** Global state of the design, @var array */
|
||||||
|
public $context;
|
||||||
|
|
||||||
|
/** Type of entity => product||task */
|
||||||
|
public $type;
|
||||||
|
|
||||||
|
public function html()
|
||||||
|
{
|
||||||
|
return file_get_contents(
|
||||||
|
base_path('resources/views/pdf-designs/bold.html')
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user