mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-10 21:22:58 +01:00
Merge pull request #4249 from turbo124/v5-stable
Tasks + Expenses + Migration works
This commit is contained in:
commit
d42dc9a3a5
1
.env.ci
1
.env.ci
@ -19,3 +19,4 @@ DB_HOST=127.0.0.1
|
||||
NINJA_ENVIRONMENT=hosted
|
||||
COMPOSER_AUTH='{"github-oauth": {"github.com": "${{ secrets.GITHUB_TOKEN }}"}}'
|
||||
TRAVIS=true
|
||||
API_SECRET=superdoopersecrethere
|
||||
|
@ -55,10 +55,5 @@ NINJA_ENVIRONMENT=selfhost
|
||||
PHANTOMJS_KEY='a-demo-key-with-low-quota-per-ip-address'
|
||||
PHANTOMJS_SECRET=
|
||||
|
||||
SELF_UPDATER_REPO_VENDOR = invoiceninja
|
||||
SELF_UPDATER_REPO_NAME = invoiceninja
|
||||
SELF_UPDATER_USE_BRANCH = v2
|
||||
SELF_UPDATER_MAILTO_ADDRESS = user@example.com
|
||||
SELF_UPDATER_MAILTO_NAME = "John Doe"
|
||||
COMPOSER_AUTH='{"github-oauth": {"github.com": "${{ secrets.GITHUB_TOKEN }}"}}'
|
||||
SENTRY_LARAVEL_DSN=https://cc7e8e2c678041689e53e409b7dba236@sentry.invoicing.co/5
|
3
.github/workflows/release.yml
vendored
3
.github/workflows/release.yml
vendored
@ -41,8 +41,7 @@ jobs:
|
||||
- name: Cleanup Builds
|
||||
run: |
|
||||
sudo rm -rf bootstrap/cache/*
|
||||
sudo rm public/index.html
|
||||
|
||||
|
||||
- name: Build project # This would actually build your project, using zip for an example artifact
|
||||
run: |
|
||||
zip -r ./invoiceninja.zip ./
|
||||
|
@ -1 +1 @@
|
||||
5.0.22
|
||||
5.0.23
|
||||
|
@ -322,7 +322,7 @@ class CheckData extends Command
|
||||
$total_invoice_payments = 0;
|
||||
|
||||
foreach ($client->invoices as $invoice) {
|
||||
$total_amount = $invoice->payments->sum('pivot.amount');
|
||||
$total_amount = $invoice->payments->sum('pivot.amount');
|
||||
$total_refund = $invoice->payments->sum('pivot.refunded');
|
||||
|
||||
$total_invoice_payments += ($total_amount - $total_refund);
|
||||
@ -330,7 +330,7 @@ class CheckData extends Command
|
||||
|
||||
foreach($client->payments as $payment)
|
||||
{
|
||||
$credit_total_applied += $payment->paymentables->where('paymentable_type', App\Models\Credit::class)->sum(\DB::raw('amount'));
|
||||
$credit_total_applied += $payment->paymentables->where('paymentable_type', App\Models\Credit::class)->sum(DB::raw('amount'));
|
||||
}
|
||||
|
||||
if($credit_total_applied < 0)
|
||||
@ -484,9 +484,9 @@ class CheckData extends Command
|
||||
} else {
|
||||
$company_id = 'company_id';
|
||||
}
|
||||
$records = \DB::table($table)
|
||||
$records = DB::table($table)
|
||||
->join($tableName, "{$tableName}.id", '=', "{$table}.{$field}_id")
|
||||
->where("{$table}.{$company_id}", '!=', \DB::raw("{$tableName}.company_id"))
|
||||
->where("{$table}.{$company_id}", '!=', DB::raw("{$tableName}.company_id"))
|
||||
->get(["{$table}.id"]);
|
||||
|
||||
if ($records->count()) {
|
||||
|
@ -11,8 +11,6 @@
|
||||
|
||||
namespace App\Console\Commands;
|
||||
|
||||
use App\Console\Commands\TestData\CreateTestCreditJob;
|
||||
use App\Console\Commands\TestData\CreateTestQuoteJob;
|
||||
use App\DataMapper\CompanySettings;
|
||||
use App\DataMapper\DefaultSettings;
|
||||
use App\Events\Invoice\InvoiceWasCreated;
|
||||
@ -73,10 +71,11 @@ class CreateSingleAccount extends Command
|
||||
protected $count;
|
||||
|
||||
protected $gateway;
|
||||
|
||||
/**
|
||||
* Create a new command instance.
|
||||
*
|
||||
* @return void
|
||||
* @param InvoiceRepository $invoice_repo
|
||||
*/
|
||||
public function __construct(InvoiceRepository $invoice_repo)
|
||||
{
|
||||
@ -112,7 +111,6 @@ class CreateSingleAccount extends Command
|
||||
$company = Company::factory()->create([
|
||||
'account_id' => $account->id,
|
||||
'slack_webhook_url' => config('ninja.notification.slack'),
|
||||
'use_credits_payment' => 'always',
|
||||
]);
|
||||
|
||||
$account->default_company_id = $company->id;
|
||||
@ -242,6 +240,8 @@ class CreateSingleAccount extends Command
|
||||
|
||||
$settings = $client->settings;
|
||||
$settings->currency_id = "1";
|
||||
$settings->use_credits_payment = "always";
|
||||
|
||||
$client->settings = $settings;
|
||||
|
||||
$country = Country::all()->random();
|
||||
@ -300,7 +300,7 @@ class CreateSingleAccount extends Command
|
||||
private function createInvoice($client)
|
||||
{
|
||||
|
||||
$faker = \Faker\Factory::create();
|
||||
$faker = Factory::create();
|
||||
|
||||
$invoice = InvoiceFactory::create($client->company->id, $client->user->id); //stub the company and user_id
|
||||
$invoice->client_id = $client->id;
|
||||
@ -349,7 +349,7 @@ class CreateSingleAccount extends Command
|
||||
|
||||
private function createCredit($client)
|
||||
{
|
||||
$faker = \Faker\Factory::create();
|
||||
$faker = Factory::create();
|
||||
|
||||
$credit = Credit::factory()->create(['user_id' => $client->user->id, 'company_id' => $client->company->id, 'client_id' => $client->id]);
|
||||
|
||||
@ -374,7 +374,7 @@ class CreateSingleAccount extends Command
|
||||
private function createQuote($client)
|
||||
{
|
||||
|
||||
$faker = \Faker\Factory::create();
|
||||
$faker = Factory::create();
|
||||
|
||||
$quote = Quote::factory()->create(['user_id' => $client->user->id, 'company_id' => $client->company->id, 'client_id' => $client->id]);
|
||||
$quote->date = $faker->date();
|
||||
@ -433,7 +433,7 @@ class CreateSingleAccount extends Command
|
||||
$item->custom_value4 = $product->custom_value4;
|
||||
|
||||
$line_items[] = $item;
|
||||
|
||||
|
||||
|
||||
return $line_items;
|
||||
}
|
||||
|
@ -11,8 +11,6 @@
|
||||
|
||||
namespace App\Console\Commands;
|
||||
|
||||
use App\Console\Commands\TestData\CreateTestCreditJob;
|
||||
use App\Console\Commands\TestData\CreateTestQuoteJob;
|
||||
use App\DataMapper\CompanySettings;
|
||||
use App\DataMapper\DefaultSettings;
|
||||
use App\Events\Invoice\InvoiceWasCreated;
|
||||
@ -72,7 +70,7 @@ class CreateTestData extends Command
|
||||
/**
|
||||
* Create a new command instance.
|
||||
*
|
||||
* @return void
|
||||
* @param InvoiceRepository $invoice_repo
|
||||
*/
|
||||
public function __construct(InvoiceRepository $invoice_repo)
|
||||
{
|
||||
@ -474,7 +472,7 @@ class CreateTestData extends Command
|
||||
private function createInvoice($client)
|
||||
{
|
||||
|
||||
$faker = \Faker\Factory::create();
|
||||
$faker = Factory::create();
|
||||
|
||||
$invoice = InvoiceFactory::create($client->company->id, $client->user->id); //stub the company and user_id
|
||||
$invoice->client_id = $client->id;
|
||||
@ -524,12 +522,8 @@ class CreateTestData extends Command
|
||||
|
||||
private function createCredit($client)
|
||||
{
|
||||
// for($x=0; $x<$this->count; $x++){
|
||||
|
||||
// dispatch(new CreateTestCreditJob($client));
|
||||
|
||||
// }
|
||||
$faker = \Faker\Factory::create();
|
||||
$faker = Factory::create();
|
||||
|
||||
$credit = Credit::factory()->create(['user_id' => $client->user->id, 'company_id' => $client->company->id, 'client_id' => $client->id]);
|
||||
|
||||
@ -568,11 +562,8 @@ class CreateTestData extends Command
|
||||
|
||||
private function createQuote($client)
|
||||
{
|
||||
// for($x=0; $x<$this->count; $x++){
|
||||
|
||||
// dispatch(new CreateTestQuoteJob($client));
|
||||
// }
|
||||
$faker = \Faker\Factory::create();
|
||||
$faker = Factory::create();
|
||||
|
||||
//$quote = QuoteFactory::create($client->company->id, $client->user->id);//stub the company and user_id
|
||||
$quote = Quote::factory()->create(['user_id' => $client->user->id, 'company_id' => $client->company->id, 'client_id' => $client->id]);
|
||||
|
@ -57,8 +57,6 @@ class DemoMode extends Command
|
||||
{
|
||||
use MakesHash, GeneratesCounter;
|
||||
|
||||
private $count;
|
||||
|
||||
protected $name = 'ninja:demo-mode';
|
||||
/**
|
||||
* The name and signature of the console command.
|
||||
@ -266,7 +264,7 @@ class DemoMode extends Command
|
||||
// }
|
||||
|
||||
$client = $company->clients->random();
|
||||
$this->createExpense($client, $u2->id);
|
||||
$this->createExpense($client);
|
||||
|
||||
//$this->info("creating expense for client #".$client->id);
|
||||
|
||||
@ -439,11 +437,7 @@ class DemoMode extends Command
|
||||
|
||||
private function createCredit($client, $assigned_user_id = null)
|
||||
{
|
||||
// for($x=0; $x<$this->count; $x++){
|
||||
|
||||
// dispatch(new CreateTestCreditJob($client));
|
||||
|
||||
// }
|
||||
$faker = \Faker\Factory::create();
|
||||
|
||||
$credit = Credit::factory()->create(['user_id' => $client->user->id, 'company_id' => $client->company->id, 'client_id' => $client->id]);
|
||||
|
@ -13,6 +13,7 @@ namespace App\Console\Commands;
|
||||
|
||||
use App\Models\Design;
|
||||
use Illuminate\Console\Command;
|
||||
use stdClass;
|
||||
|
||||
class DesignUpdate extends Command
|
||||
{
|
||||
@ -52,7 +53,7 @@ class DesignUpdate extends Command
|
||||
$invoice_design = new $class();
|
||||
$invoice_design->document();
|
||||
|
||||
$design_object = new \stdClass;
|
||||
$design_object = new stdClass;
|
||||
$design_object->includes = $invoice_design->getSectionHTML('style');
|
||||
$design_object->header = $invoice_design->getSectionHTML('header');
|
||||
$design_object->body = $invoice_design->getSectionHTML('body');
|
||||
|
@ -18,7 +18,11 @@ use App\Models\Company;
|
||||
use App\Models\CompanyToken;
|
||||
use App\Models\User;
|
||||
use App\Utils\Traits\MakesHash;
|
||||
use DirectoryIterator;
|
||||
use Faker\Factory;
|
||||
use Faker\Generator;
|
||||
use Illuminate\Console\Command;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
class ImportMigrations extends Command
|
||||
{
|
||||
@ -38,7 +42,7 @@ class ImportMigrations extends Command
|
||||
protected $description = 'Massively import the migrations.';
|
||||
|
||||
/**
|
||||
* @var \Faker\Generator
|
||||
* @var Generator
|
||||
*/
|
||||
private $faker;
|
||||
|
||||
@ -49,7 +53,7 @@ class ImportMigrations extends Command
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->faker = \Faker\Factory::create();
|
||||
$this->faker = Factory::create();
|
||||
|
||||
parent::__construct();
|
||||
}
|
||||
@ -63,7 +67,7 @@ class ImportMigrations extends Command
|
||||
{
|
||||
$path = $this->option('path') ?? storage_path('migrations/import');
|
||||
|
||||
$directory = new \DirectoryIterator($path);
|
||||
$directory = new DirectoryIterator($path);
|
||||
|
||||
foreach ($directory as $file) {
|
||||
if ($file->getExtension() === 'zip') {
|
||||
@ -89,7 +93,7 @@ class ImportMigrations extends Command
|
||||
'company_id' => $company->id,
|
||||
'account_id' => $account->id,
|
||||
'name' => 'test token',
|
||||
'token' => \Illuminate\Support\Str::random(64),
|
||||
'token' => Str::random(64),
|
||||
]);
|
||||
|
||||
$user->companies()->attach($company->id, [
|
||||
|
@ -18,6 +18,7 @@ use Composer\Installer;
|
||||
use Composer\IO\NullIO;
|
||||
use Illuminate\Console\Command;
|
||||
use Illuminate\Support\Facades\Artisan;
|
||||
use Log;
|
||||
use Symfony\Component\Console\Input\ArrayInput;
|
||||
|
||||
class PostUpdate extends Command
|
||||
@ -41,10 +42,11 @@ class PostUpdate extends Command
|
||||
* Execute the console command.
|
||||
*
|
||||
* @return mixed
|
||||
* @throws \Exception
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
|
||||
|
||||
set_time_limit(0);
|
||||
|
||||
info('running post update');
|
||||
@ -52,13 +54,13 @@ class PostUpdate extends Command
|
||||
try {
|
||||
Artisan::call('migrate', ['--force' => true]);
|
||||
} catch (Exception $e) {
|
||||
\Log::error("I wasn't able to migrate the data.");
|
||||
Log::error("I wasn't able to migrate the data.");
|
||||
}
|
||||
|
||||
try {
|
||||
Artisan::call('optimize');
|
||||
} catch (Exception $e) {
|
||||
\Log::error("I wasn't able to optimize.");
|
||||
Log::error("I wasn't able to optimize.");
|
||||
}
|
||||
|
||||
/* For the following to work, the web user (www-data) must own all the directories */
|
||||
@ -67,7 +69,7 @@ class PostUpdate extends Command
|
||||
|
||||
$input = new ArrayInput(array('command' => 'install', '--no-dev' => 'true'));
|
||||
$application = new Application();
|
||||
$application->setAutoExit(false);
|
||||
$application->setAutoExit(false);
|
||||
$application->run($input);
|
||||
|
||||
echo "Done.";
|
||||
|
@ -18,7 +18,7 @@ use App\Factory\CompanyUserFactory;
|
||||
use App\Factory\InvoiceFactory;
|
||||
use App\Factory\InvoiceInvitationFactory;
|
||||
use App\Helpers\Email\InvoiceEmail;
|
||||
use App\Jobs\Invoice\CreateInvoicePdf;
|
||||
use App\Jobs\Invoice\CreateEntityPdf;
|
||||
use App\Mail\TemplateEmail;
|
||||
use App\Models\Account;
|
||||
use App\Models\Client;
|
||||
@ -26,6 +26,7 @@ use App\Models\ClientContact;
|
||||
use App\Models\Company;
|
||||
use App\Models\Invoice;
|
||||
use App\Models\User;
|
||||
use Faker\Factory;
|
||||
use Illuminate\Console\Command;
|
||||
use Illuminate\Support\Carbon;
|
||||
use Illuminate\Support\Facades\Mail;
|
||||
@ -70,7 +71,7 @@ class SendTestEmails extends Command
|
||||
|
||||
private function sendTemplateEmails($template)
|
||||
{
|
||||
$faker = \Faker\Factory::create();
|
||||
$faker = Factory::create();
|
||||
|
||||
$message = [
|
||||
'title' => 'Invoice XJ-3838',
|
||||
@ -82,7 +83,7 @@ class SendTestEmails extends Command
|
||||
$user = User::whereEmail('user@example.com')->first();
|
||||
|
||||
if (! $user) {
|
||||
|
||||
|
||||
$account = Account::factory()->create();
|
||||
|
||||
$user = User::factory()->create([
|
||||
@ -149,7 +150,7 @@ class SendTestEmails extends Command
|
||||
$invoice->setRelation('invitations', $ii);
|
||||
$invoice->service()->markSent()->save();
|
||||
|
||||
CreateInvoicePdf::dispatch($invoice->invitations()->first());
|
||||
CreateEntityPdf::dispatch($invoice->invitations()->first());
|
||||
|
||||
$cc_emails = [config('ninja.testvars.test_email')];
|
||||
$bcc_emails = [config('ninja.testvars.test_email')];
|
||||
|
@ -1,136 +0,0 @@
|
||||
<?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\Console\Commands\TestData;
|
||||
|
||||
use App\Events\Invoice\InvoiceWasCreated;
|
||||
use App\Events\Payment\PaymentWasCreated;
|
||||
use App\Factory\InvoiceFactory;
|
||||
use App\Factory\InvoiceItemFactory;
|
||||
use App\Factory\PaymentFactory;
|
||||
use App\Helpers\Invoice\InvoiceSum;
|
||||
use App\Listeners\Credit\CreateCreditInvitation;
|
||||
use App\Models\Client;
|
||||
use App\Models\Payment;
|
||||
use App\Models\PaymentType;
|
||||
use App\Models\Product;
|
||||
use App\Utils\Ninja;
|
||||
use App\Utils\Traits\MakesHash;
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Foundation\Bus\Dispatchable;
|
||||
use Illuminate\Queue\InteractsWithQueue;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
use Illuminate\Support\Carbon;
|
||||
|
||||
class CreateTestCreditJob implements ShouldQueue
|
||||
{
|
||||
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels, MakesHash;
|
||||
|
||||
protected $client;
|
||||
|
||||
/**
|
||||
* Create a new job instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(Client $client)
|
||||
{
|
||||
$this->client = $client;
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute the job.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
$faker = \Faker\Factory::create();
|
||||
|
||||
$credit = Credit::factory()->create(['user_id' => $this->client->user->id, 'company_id' => $this->client->company->id, 'client_id' => $this->client->id]);
|
||||
|
||||
//$invoice = InvoiceFactory::create($this->client->company->id, $this->client->user->id);//stub the company and user_id
|
||||
//$invoice->client_id = $this->client->id;
|
||||
// $invoice->date = $faker->date();
|
||||
$dateable = Carbon::now()->subDays(rand(0, 90));
|
||||
$credit->date = $dateable;
|
||||
|
||||
$credit->line_items = $this->buildLineItems(rand(1, 10));
|
||||
$credit->uses_inclusive_taxes = false;
|
||||
|
||||
if (rand(0, 1)) {
|
||||
$credit->tax_name1 = 'GST';
|
||||
$credit->tax_rate1 = 10.00;
|
||||
}
|
||||
|
||||
if (rand(0, 1)) {
|
||||
$credit->tax_name2 = 'VAT';
|
||||
$credit->tax_rate2 = 17.50;
|
||||
}
|
||||
|
||||
if (rand(0, 1)) {
|
||||
$credit->tax_name3 = 'CA Sales Tax';
|
||||
$credit->tax_rate3 = 5;
|
||||
}
|
||||
|
||||
$credit->save();
|
||||
|
||||
$invoice_calc = new InvoiceSum($credit);
|
||||
$invoice_calc->build();
|
||||
|
||||
$credit = $invoice_calc->getCredit();
|
||||
|
||||
$credit->save();
|
||||
|
||||
event(new CreateCreditInvitation($credit, $credit->company, Ninja::eventVars()));
|
||||
}
|
||||
|
||||
private function buildLineItems($count = 1)
|
||||
{
|
||||
$line_items = [];
|
||||
|
||||
for ($x = 0; $x < $count; $x++) {
|
||||
$item = InvoiceItemFactory::create();
|
||||
$item->quantity = 1;
|
||||
//$item->cost = 10;
|
||||
|
||||
if (rand(0, 1)) {
|
||||
$item->tax_name1 = 'GST';
|
||||
$item->tax_rate1 = 10.00;
|
||||
}
|
||||
|
||||
if (rand(0, 1)) {
|
||||
$item->tax_name1 = 'VAT';
|
||||
$item->tax_rate1 = 17.50;
|
||||
}
|
||||
|
||||
if (rand(0, 1)) {
|
||||
$item->tax_name1 = 'Sales Tax';
|
||||
$item->tax_rate1 = 5;
|
||||
}
|
||||
|
||||
$product = Product::all()->random();
|
||||
|
||||
$item->cost = (float) $product->cost;
|
||||
$item->product_key = $product->product_key;
|
||||
$item->notes = $product->notes;
|
||||
$item->custom_value1 = $product->custom_value1;
|
||||
$item->custom_value2 = $product->custom_value2;
|
||||
$item->custom_value3 = $product->custom_value3;
|
||||
$item->custom_value4 = $product->custom_value4;
|
||||
|
||||
$line_items[] = $item;
|
||||
}
|
||||
|
||||
return $line_items;
|
||||
}
|
||||
}
|
@ -1,129 +0,0 @@
|
||||
<?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\Console\Commands\TestData;
|
||||
|
||||
use App\Events\Invoice\InvoiceWasCreated;
|
||||
use App\Events\Payment\PaymentWasCreated;
|
||||
use App\Factory\InvoiceFactory;
|
||||
use App\Factory\InvoiceItemFactory;
|
||||
use App\Factory\PaymentFactory;
|
||||
use App\Helpers\Invoice\InvoiceSum;
|
||||
use App\Jobs\Quote\CreateQuoteInvitations;
|
||||
use App\Models\Client;
|
||||
use App\Models\Payment;
|
||||
use App\Models\PaymentType;
|
||||
use App\Models\Product;
|
||||
use App\Utils\Traits\MakesHash;
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Foundation\Bus\Dispatchable;
|
||||
use Illuminate\Queue\InteractsWithQueue;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
use Illuminate\Support\Carbon;
|
||||
|
||||
class CreateTestQuoteJob implements ShouldQueue
|
||||
{
|
||||
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels, MakesHash;
|
||||
|
||||
protected $client;
|
||||
|
||||
/**
|
||||
* Create a new job instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(Client $client)
|
||||
{
|
||||
$this->client = $client;
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute the job.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
$faker = \Faker\Factory::create();
|
||||
|
||||
$quote = Quote::factory()->create(['user_id' => $this->client->user->id, 'company_id' => $this->client->company->id, 'client_id' => $this->client->id]);
|
||||
$quote->date = $faker->date();
|
||||
|
||||
$quote->line_items = $this->buildLineItems(rand(1, 10));
|
||||
$quote->uses_inclusive_taxes = false;
|
||||
|
||||
if (rand(0, 1)) {
|
||||
$quote->tax_name1 = 'GST';
|
||||
$quote->tax_rate1 = 10.00;
|
||||
}
|
||||
|
||||
if (rand(0, 1)) {
|
||||
$quote->tax_name2 = 'VAT';
|
||||
$quote->tax_rate2 = 17.50;
|
||||
}
|
||||
|
||||
if (rand(0, 1)) {
|
||||
$quote->tax_name3 = 'CA Sales Tax';
|
||||
$quote->tax_rate3 = 5;
|
||||
}
|
||||
|
||||
$quote->save();
|
||||
|
||||
$quote_calc = new InvoiceSum($quote);
|
||||
$quote_calc->build();
|
||||
|
||||
$quote = $quote_calc->getQuote();
|
||||
$quote->service()->markSent()->save();
|
||||
|
||||
CreateQuoteInvitations::dispatch($quote, $quote->company);
|
||||
}
|
||||
|
||||
private function buildLineItems($count = 1)
|
||||
{
|
||||
$line_items = [];
|
||||
|
||||
for ($x = 0; $x < $count; $x++) {
|
||||
$item = InvoiceItemFactory::create();
|
||||
$item->quantity = 1;
|
||||
//$item->cost = 10;
|
||||
|
||||
if (rand(0, 1)) {
|
||||
$item->tax_name1 = 'GST';
|
||||
$item->tax_rate1 = 10.00;
|
||||
}
|
||||
|
||||
if (rand(0, 1)) {
|
||||
$item->tax_name1 = 'VAT';
|
||||
$item->tax_rate1 = 17.50;
|
||||
}
|
||||
|
||||
if (rand(0, 1)) {
|
||||
$item->tax_name1 = 'Sales Tax';
|
||||
$item->tax_rate1 = 5;
|
||||
}
|
||||
|
||||
$product = Product::all()->random();
|
||||
|
||||
$item->cost = (float) $product->cost;
|
||||
$item->product_key = $product->product_key;
|
||||
$item->notes = $product->notes;
|
||||
$item->custom_value1 = $product->custom_value1;
|
||||
$item->custom_value2 = $product->custom_value2;
|
||||
$item->custom_value3 = $product->custom_value3;
|
||||
$item->custom_value4 = $product->custom_value4;
|
||||
|
||||
$line_items[] = $item;
|
||||
}
|
||||
|
||||
return $line_items;
|
||||
}
|
||||
}
|
@ -38,7 +38,7 @@ class Kernel extends ConsoleKernel
|
||||
/**
|
||||
* Define the application's command schedule.
|
||||
*
|
||||
* @param \Illuminate\Console\Scheduling\Schedule $schedule
|
||||
* @param Schedule $schedule
|
||||
* @return void
|
||||
*/
|
||||
protected function schedule(Schedule $schedule)
|
||||
|
@ -15,6 +15,7 @@ use App\DataMapper\ClientSettings;
|
||||
use App\DataMapper\CompanySettings;
|
||||
use App\Models\Client;
|
||||
use App\Utils\TranslationHelper;
|
||||
use stdClass;
|
||||
|
||||
/**
|
||||
* ClientSettings.
|
||||
@ -44,7 +45,7 @@ class ClientSettings extends BaseSettings
|
||||
* prevents missing properties from not being returned
|
||||
* and always ensure an up to date class is returned.
|
||||
*
|
||||
* @return \stdClass
|
||||
* @param $obj
|
||||
*/
|
||||
public function __construct($obj)
|
||||
{
|
||||
@ -54,9 +55,9 @@ class ClientSettings extends BaseSettings
|
||||
/**
|
||||
* Default Client Settings scaffold.
|
||||
*
|
||||
* @return \stdClass
|
||||
* @return stdClass
|
||||
*/
|
||||
public static function defaults() : \stdClass
|
||||
public static function defaults() : stdClass
|
||||
{
|
||||
$data = (object) [
|
||||
'entity' => (string) Client::class,
|
||||
@ -70,9 +71,9 @@ class ClientSettings extends BaseSettings
|
||||
/**
|
||||
* Merges settings from Company to Client.
|
||||
*
|
||||
* @param \stdClass $company_settings
|
||||
* @param \stdClass $client_settings
|
||||
* @return \stdClass of merged settings
|
||||
* @param stdClass $company_settings
|
||||
* @param stdClass $client_settings
|
||||
* @return stdClass of merged settings
|
||||
*/
|
||||
public static function buildClientSettings($company_settings, $client_settings)
|
||||
{
|
||||
|
@ -13,6 +13,7 @@ namespace App\DataMapper;
|
||||
|
||||
use App\DataMapper\CompanySettings;
|
||||
use App\Utils\Traits\MakesHash;
|
||||
use stdClass;
|
||||
|
||||
/**
|
||||
* CompanySettings.
|
||||
@ -189,6 +190,7 @@ class CompanySettings extends BaseSettings
|
||||
public $enable_reminder1 = false;
|
||||
public $enable_reminder2 = false;
|
||||
public $enable_reminder3 = false;
|
||||
public $enable_reminder_endless = false;
|
||||
|
||||
public $num_days_reminder1 = 0;
|
||||
public $num_days_reminder2 = 0;
|
||||
@ -253,7 +255,11 @@ class CompanySettings extends BaseSettings
|
||||
public $client_portal_under_payment_minimum = 0;
|
||||
public $client_portal_allow_over_payment = false;
|
||||
|
||||
public $use_credits_payment = 'off'; //always, option, off
|
||||
|
||||
public static $casts = [
|
||||
'enable_reminder_endless' => 'bool',
|
||||
'use_credits_payment' => 'string',
|
||||
'recurring_invoice_number_pattern' => 'string',
|
||||
'recurring_invoice_number_counter' => 'int',
|
||||
'client_portal_under_payment_minimum'=> 'float',
|
||||
@ -492,7 +498,7 @@ class CompanySettings extends BaseSettings
|
||||
* prevents missing properties from not being returned
|
||||
* and always ensure an up to date class is returned.
|
||||
*
|
||||
* @return \stdClass
|
||||
* @param $obj
|
||||
*/
|
||||
public function __construct($obj)
|
||||
{
|
||||
@ -501,9 +507,9 @@ class CompanySettings extends BaseSettings
|
||||
|
||||
/**
|
||||
* Provides class defaults on init.
|
||||
* @return object
|
||||
* @return stdClass
|
||||
*/
|
||||
public static function defaults():\stdClass
|
||||
public static function defaults(): stdClass
|
||||
{
|
||||
$config = json_decode(config('ninja.settings'));
|
||||
|
||||
@ -532,9 +538,10 @@ class CompanySettings extends BaseSettings
|
||||
* need to provide a fallback catch on old settings objects which will
|
||||
* set new properties to the object prior to being returned.
|
||||
*
|
||||
* @param object $data The settings object to be checked
|
||||
* @param $settings
|
||||
* @return stdClass
|
||||
*/
|
||||
public static function setProperties($settings):\stdClass
|
||||
public static function setProperties($settings): stdClass
|
||||
{
|
||||
$company_settings = (object) get_class_vars(self::class);
|
||||
|
||||
@ -549,7 +556,7 @@ class CompanySettings extends BaseSettings
|
||||
|
||||
public static function notificationDefaults()
|
||||
{
|
||||
$notification = new \stdClass;
|
||||
$notification = new stdClass;
|
||||
$notification->email = ['all_notifications'];
|
||||
|
||||
return $notification;
|
||||
|
@ -13,6 +13,7 @@ namespace App\DataMapper;
|
||||
|
||||
use App\Models\Client;
|
||||
use App\Models\User;
|
||||
use stdClass;
|
||||
|
||||
/**
|
||||
* Class DefaultSettings.
|
||||
@ -25,11 +26,11 @@ class DefaultSettings extends BaseSettings
|
||||
public static $per_page = 25;
|
||||
|
||||
/**
|
||||
* @return \stdClass
|
||||
* @return stdClass
|
||||
*
|
||||
* //todo user specific settings / preferences.
|
||||
*/
|
||||
public static function userSettings() : \stdClass
|
||||
public static function userSettings() : stdClass
|
||||
{
|
||||
return (object) [
|
||||
// class_basename(User::class) => self::userSettingsObject(),
|
||||
@ -37,9 +38,9 @@ class DefaultSettings extends BaseSettings
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \stdClass
|
||||
* @return stdClass
|
||||
*/
|
||||
private static function userSettingsObject() : \stdClass
|
||||
private static function userSettingsObject() : stdClass
|
||||
{
|
||||
return (object) [
|
||||
// 'per_page' => self::$per_page,
|
||||
|
@ -124,11 +124,6 @@ class EmailTemplateDefaults
|
||||
|
||||
public static function emailInvoiceTemplate()
|
||||
{
|
||||
$converter = new CommonMarkConverter([
|
||||
'html_input' => 'strip',
|
||||
'allow_unsafe_links' => false,
|
||||
]);
|
||||
|
||||
$invoice_message = '<p>'.self::transformText('invoice_message').'</p><br><br><p>$view_link</p>';
|
||||
|
||||
return $invoice_message;
|
||||
@ -141,12 +136,9 @@ class EmailTemplateDefaults
|
||||
|
||||
public static function emailQuoteTemplate()
|
||||
{
|
||||
$converter = new CommonMarkConverter([
|
||||
'html_input' => 'strip',
|
||||
'allow_unsafe_links' => false,
|
||||
]);
|
||||
$quote_message = '<p>'.self::transformText('quote_message').'</p><br><br><p>$view_link</p>';
|
||||
|
||||
return $converter->convertToHtml(self::transformText('quote_message'));
|
||||
return $quote_message;
|
||||
}
|
||||
|
||||
public static function emailPaymentSubject()
|
||||
@ -156,34 +148,27 @@ class EmailTemplateDefaults
|
||||
|
||||
public static function emailPaymentTemplate()
|
||||
{
|
||||
$converter = new CommonMarkConverter([
|
||||
'html_input' => 'strip',
|
||||
'allow_unsafe_links' => false,
|
||||
]);
|
||||
|
||||
return $converter->convertToHtml(self::transformText('payment_message'));
|
||||
$payment_message = '<p>'.self::transformText('payment_message').'</p><br><br><p>$view_link</p>';
|
||||
|
||||
return $payment_message;
|
||||
|
||||
}
|
||||
|
||||
public static function emailCreditTemplate()
|
||||
{
|
||||
$converter = new CommonMarkConverter([
|
||||
'html_input' => 'strip',
|
||||
'allow_unsafe_links' => false,
|
||||
]);
|
||||
|
||||
return $converter->convertToHtml(self::transformText('credit_message'));
|
||||
$credit_message = '<p>'.self::transformText('credit_message').'</p><br><br><p>$view_link</p>';
|
||||
|
||||
return $credit_message;
|
||||
}
|
||||
|
||||
public static function emailPaymentPartialTemplate()
|
||||
{
|
||||
$converter = new CommonMarkConverter([
|
||||
'html_input' => 'strip',
|
||||
'allow_unsafe_links' => false,
|
||||
]);
|
||||
|
||||
return $converter->convertToHtml(self::transformText('payment_message'));
|
||||
$payment_message = '<p>'.self::transformText('payment_message').'</p><br><br><p>$view_link</p>';
|
||||
|
||||
return $payment_message;
|
||||
|
||||
}
|
||||
|
||||
public static function emailPaymentPartialSubject()
|
||||
|
@ -13,6 +13,7 @@ namespace App\DataMapper;
|
||||
|
||||
use App\DataMapper\CompanySettings;
|
||||
use App\Utils\Traits\MakesHash;
|
||||
use stdClass;
|
||||
|
||||
/**
|
||||
* FreeCompanySettings.
|
||||
@ -140,7 +141,7 @@ class FreeCompanySettings extends BaseSettings
|
||||
* prevents missing properties from not being returned
|
||||
* and always ensure an up to date class is returned.
|
||||
*
|
||||
* @return \stdClass
|
||||
* @param $obj
|
||||
*/
|
||||
public function __construct($obj)
|
||||
{
|
||||
@ -148,9 +149,9 @@ class FreeCompanySettings extends BaseSettings
|
||||
|
||||
/**
|
||||
* Provides class defaults on init.
|
||||
* @return object
|
||||
* @return stdClass
|
||||
*/
|
||||
public static function defaults():\stdClass
|
||||
public static function defaults(): stdClass
|
||||
{
|
||||
$config = json_decode(config('ninja.settings'));
|
||||
|
||||
|
@ -13,13 +13,18 @@ namespace App\DataMapper;
|
||||
|
||||
class PaymentMethodMeta
|
||||
{
|
||||
/** @var string */
|
||||
public $exp_month;
|
||||
|
||||
/** @var string */
|
||||
public $exp_year;
|
||||
|
||||
/** @var string */
|
||||
public $brand;
|
||||
|
||||
/** @var string */
|
||||
public $last4;
|
||||
|
||||
/** @var int */
|
||||
public $type;
|
||||
}
|
||||
|
@ -1,27 +0,0 @@
|
||||
<?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\Designs;
|
||||
|
||||
abstract class AbstractDesign
|
||||
{
|
||||
abstract public function includes();
|
||||
|
||||
abstract public function header();
|
||||
|
||||
abstract public function body();
|
||||
|
||||
abstract public function product();
|
||||
|
||||
abstract public function task();
|
||||
|
||||
abstract public function footer();
|
||||
}
|
@ -1,141 +0,0 @@
|
||||
<?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\Designs;
|
||||
|
||||
class Bold extends AbstractDesign
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
}
|
||||
|
||||
public function includes()
|
||||
{
|
||||
return '<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="$app_url/css/tailwind-1.2.0.css" rel="stylesheet">
|
||||
<style>
|
||||
body {font-size:90%}
|
||||
@page: not(:first-of-type) { size: auto; margin-top: 5mm; }
|
||||
.table_header_thead_class {text-align:left;}
|
||||
.table_header_td_class {padding-left:3rem; padding-right:3rem; font-size:1rem; padding-left:1rem;padding-right:1rem; padding-top:.5rem;padding-bottom:.5rem}
|
||||
.table_body_td_class {background-color:#edf2f7; adding-top:1.25rem;padding-bottom:1.25rem; padding-left:3rem;}
|
||||
$custom_css
|
||||
</style>';
|
||||
}
|
||||
|
||||
public function header()
|
||||
{
|
||||
return '<div class="bg-gray-800 p-12">
|
||||
<div class="grid grid-cols-6 gap-1">
|
||||
<div class="col-span-2 p-3">
|
||||
<div class="p-1 rounded-lg">
|
||||
$company_logo
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-span-2 p-3 text-white flex flex-col flex-wrap">
|
||||
$company_details
|
||||
</div>
|
||||
<div class="col-span-2 p-3 text-white flex flex-col flex-wrap">
|
||||
$company_address
|
||||
</div>
|
||||
</div>
|
||||
</div>';
|
||||
}
|
||||
|
||||
public function body()
|
||||
{
|
||||
return '<div class="bg-white mt-16 pl-10">
|
||||
<div class="grid grid-cols-12 gap-2">
|
||||
<div class="col-span-7">
|
||||
<h2 class="text-2xl uppercase font-semibold text-teal-600 tracking-tight">$entity_label</h2>
|
||||
<div class="flex flex-col flex-wrap">$client_details</div>
|
||||
</div>
|
||||
<div class="col-span-5">
|
||||
<div class="bg-teal-600 px-5 py-3 text-white">
|
||||
<div class="w-80 flex flex-col text-white flex-wrap">
|
||||
$entity_details
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mx-10 mt-8">
|
||||
<table class="w-full table-auto mt-8">
|
||||
<thead class="text-left">
|
||||
$product_table_header
|
||||
</thead>
|
||||
<tbody class="whitespace-pre-line">
|
||||
$product_table_body
|
||||
</tbody>
|
||||
</table>
|
||||
<table class="w-full table-auto mt-8">
|
||||
<thead class="text-left">
|
||||
$task_table_header
|
||||
</thead>
|
||||
<tbody class="whitespace-pre-line">
|
||||
$task_table_body
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="flex px-4 mt-6 w-full px-12">
|
||||
<div class="w-1/2">
|
||||
$entity.public_notes
|
||||
</div>
|
||||
<div class="w-1/2 flex">
|
||||
<div class="w-1/2 text-right flex flex-col">
|
||||
$subtotal_label $discount_label $total_tax_labels $line_tax_labels
|
||||
</div>
|
||||
<div class="w-1/2 text-right flex flex-col">
|
||||
$subtotal $discount $total_tax_values $line_tax_values
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex px-4 mt-4 w-full items-end px-12">
|
||||
<div class="w-1/2 flex flex-col flex-wrap">
|
||||
<p class="font-semibold">$terms_label</p>
|
||||
$terms
|
||||
</div>
|
||||
<div class="w-1/2 flex">
|
||||
<div class="w-1/2 text-right flex flex-col flex-wrap">
|
||||
<span class="text-xl font-semibold">$balance_due_label</span>
|
||||
</div>
|
||||
<div class="w-1/2 text-right flex flex-col flex-wrap">
|
||||
<span class="text-xl text-teal-600 font-semibold">$balance_due</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
';
|
||||
}
|
||||
|
||||
public function task()
|
||||
{
|
||||
return '';
|
||||
}
|
||||
|
||||
public function product()
|
||||
{
|
||||
return '';
|
||||
}
|
||||
|
||||
public function footer()
|
||||
{
|
||||
return '
|
||||
<footer>
|
||||
<div class="div_footer flex justify-between py-8 px-12" style="page-break-inside: avoid;">
|
||||
</div>
|
||||
</footer>';
|
||||
}
|
||||
}
|
@ -1,149 +0,0 @@
|
||||
<?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\Designs;
|
||||
|
||||
class Business extends AbstractDesign
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
}
|
||||
|
||||
public function includes()
|
||||
{
|
||||
return '<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="$app_url/css/tailwind-1.2.0.css" rel="stylesheet">
|
||||
|
||||
<style>
|
||||
body { font-size:90% }
|
||||
@page
|
||||
{
|
||||
size: auto;
|
||||
margin-top: 5mm;
|
||||
}
|
||||
thead th:first-child {
|
||||
border-top-left-radius: 0.5rem;
|
||||
}
|
||||
thead th:last-child {
|
||||
border-top-right-radius: 0.5rem;
|
||||
}
|
||||
.table_header_thead_class { border-top-left-radius: .5rem; text-align: left }
|
||||
.table_header_td_class { color: white; padding: .5rem 1rem; font-weight: 800; background-color: #2a4365; }
|
||||
.table_body_td_class { color: #c05621; padding: 1rem; border-width: 4px; border-color: white; background-color: white; }
|
||||
$custom_css
|
||||
</style>';
|
||||
}
|
||||
|
||||
public function header()
|
||||
{
|
||||
return '<div class="m-10">
|
||||
<div class="grid grid-cols-6 gap-1">
|
||||
<div class="col-span-2 p-3">
|
||||
$company_logo
|
||||
</div>
|
||||
<div class="flex flex-col flex-wrap col-span-2 p-3">
|
||||
$company_details
|
||||
</div>
|
||||
<div class="flex flex-col flex-wrap col-span-2 p-3">
|
||||
$company_address
|
||||
</div>
|
||||
</div>';
|
||||
}
|
||||
|
||||
public function body()
|
||||
{
|
||||
return '<div class="grid grid-cols-12 gap-1 mt-8">
|
||||
<div class="flex flex-col flex-wrap col-span-7 p-3">
|
||||
$client_details
|
||||
</div>
|
||||
<div class="flex flex-col h-auto col-span-5 p-3 px-4 py-4 bg-orange-600 rounded-lg">
|
||||
<div class="flex flex-col flex-wrap text-white">
|
||||
$entity_details
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<table class="w-full mt-20 table-auto">
|
||||
<thead class="text-left">
|
||||
$product_table_header
|
||||
</thead>
|
||||
<tbody class="whitespace-pre-line bg-gray-200">
|
||||
$product_table_body
|
||||
</tbody>
|
||||
</table>
|
||||
<table class="w-full mt-20 table-auto">
|
||||
<thead class="text-left">
|
||||
$task_table_header
|
||||
</thead>
|
||||
<tbody class="whitespace-pre-line bg-gray-200">
|
||||
$task_table_body
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="flex items-center justify-between px-4 py-2 pb-4 bg-gray-200 rounded">
|
||||
<div class="w-1/2">
|
||||
<div class="flex flex-col">
|
||||
<p>$entity.public_notes</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex flex-col w-1/3">
|
||||
<div class="flex px-3 mt-2">
|
||||
<section class="flex flex-col w-1/2 text-right">
|
||||
$discount_label
|
||||
$total_tax_labels
|
||||
$line_tax_labels
|
||||
</section>
|
||||
<section class="flex flex-col w-1/2 text-right">
|
||||
$discount
|
||||
$total_tax_values
|
||||
$line_tax_values
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-center justify-between px-4 pb-4 mt-4">
|
||||
<div class="w-1/2">
|
||||
<div class="flex flex-col">
|
||||
<p class="font-semibold">$terms_label</p>
|
||||
<p>$terms</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex flex-col w-2/5">
|
||||
<section class="flex px-4 py-2 py-3 text-white bg-blue-900 rounded">
|
||||
<p class="w-1/2">$balance_due_label</p>
|
||||
<p class="w-1/2 text-right">$balance_due</p>
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
</div>';
|
||||
}
|
||||
|
||||
public function task()
|
||||
{
|
||||
return '';
|
||||
}
|
||||
|
||||
public function product()
|
||||
{
|
||||
return '';
|
||||
}
|
||||
|
||||
public function footer()
|
||||
{
|
||||
return '
|
||||
<footer>
|
||||
<div class="flex justify-between px-12 py-8 div_footer" style="page-break-inside: avoid;">
|
||||
</div>
|
||||
</footer>';
|
||||
}
|
||||
}
|
@ -1,150 +0,0 @@
|
||||
<?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\Designs;
|
||||
|
||||
class Clean extends AbstractDesign
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
}
|
||||
|
||||
public function includes()
|
||||
{
|
||||
return '<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="$app_url/css/tailwind-1.2.0.css" rel="stylesheet">
|
||||
<style>
|
||||
body {font-size:90%}
|
||||
@page
|
||||
{
|
||||
size: auto;
|
||||
margin-top: 5mm;
|
||||
}
|
||||
.table_header_thead_class { text-align: left; }
|
||||
.table_header_td_class { padding: .5rem 1rem;}
|
||||
.table_body_td_class { border-bottom-width: 1px; border-top-width: 1px; border-color: #cbd5e0; padding: 1rem;}
|
||||
$custom_css
|
||||
</style>';
|
||||
}
|
||||
|
||||
public function header()
|
||||
{
|
||||
return '<div class="px-12 my-10">
|
||||
<div class="flex items-center">
|
||||
<div class="w-1/3">
|
||||
<div class="h-14 w-14">$company_logo</div>
|
||||
</div>
|
||||
<div class="w-auto flex">
|
||||
<div class="mr-10 text-gray-600 flex flex-col flex-wrap">
|
||||
$company_details
|
||||
</div>
|
||||
<div class="ml-5 text-gray-600 flex flex-col flex-wrap">
|
||||
$company_address
|
||||
</div>
|
||||
</div>
|
||||
</div>';
|
||||
}
|
||||
|
||||
public function body()
|
||||
{
|
||||
return '<h1 class="mt-12 uppercase text-2xl text-blue-500 ml-4">
|
||||
$entity_label
|
||||
</h1>
|
||||
|
||||
<div class="border-b border-gray-400"></div>
|
||||
|
||||
<div class="ml-4 py-4">
|
||||
<div class="flex">
|
||||
<div class="w-40 flex flex-col flex-wrap">
|
||||
$entity_labels
|
||||
</div>
|
||||
<div class="w-48 flex flex-col flex-wrap">
|
||||
$entity_details
|
||||
</div>
|
||||
<div class="w-56 flex flex-col flex-wrap">
|
||||
$client_details
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="border-b border-gray-400"></div>
|
||||
<table class="w-full table-auto mt-8">
|
||||
<thead class="text-left">
|
||||
$product_table_header
|
||||
</thead>
|
||||
<tbody class="whitespace-pre-line">
|
||||
$product_table_body
|
||||
</tbody>
|
||||
</table>
|
||||
<table class="w-full table-auto mt-8">
|
||||
<thead class="text-left">
|
||||
$task_table_header
|
||||
</thead>
|
||||
<tbody class="whitespace-pre-line">
|
||||
$task_table_body
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="flex px-4 mt-6 w-full">
|
||||
<div class="w-1/2">
|
||||
$entity.public_notes
|
||||
</div>
|
||||
<div class="w-1/2 flex">
|
||||
<div class="w-1/2 text-right flex flex-col">
|
||||
$discount_label
|
||||
$total_tax_labels
|
||||
$line_tax_labels
|
||||
</div>
|
||||
<div class="w-1/2 text-right flex flex-col">
|
||||
$discount
|
||||
$total_tax_values
|
||||
$line_tax_values
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex px-4 mt-4 w-full items-end">
|
||||
<div class="w-1/2">
|
||||
<p class="font-semibold">$terms_label</p>
|
||||
$terms
|
||||
</div>
|
||||
<div class="w-1/2 flex">
|
||||
<div class="w-1/2 text-right flex flex-col">
|
||||
<span>$balance_due_label</span>
|
||||
</div>
|
||||
<div class="w-1/2 text-right flex flex-col">
|
||||
<span class="text-blue-600">$balance_due</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>';
|
||||
}
|
||||
|
||||
public function task()
|
||||
{
|
||||
return '';
|
||||
}
|
||||
|
||||
public function product()
|
||||
{
|
||||
return '';
|
||||
}
|
||||
|
||||
public function footer()
|
||||
{
|
||||
return '
|
||||
<footer>
|
||||
<div class="div_footer flex justify-between py-8 px-12" style="page-break-inside: avoid;">
|
||||
</div>
|
||||
</footer>';
|
||||
}
|
||||
}
|
@ -1,128 +0,0 @@
|
||||
<?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\Designs;
|
||||
|
||||
/**
|
||||
* @wip: Table margins act weird.
|
||||
*/
|
||||
class Creative extends AbstractDesign
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
}
|
||||
|
||||
public function includes()
|
||||
{
|
||||
return '<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="$app_url/css/tailwind-1.2.0.css" rel="stylesheet">
|
||||
<style>
|
||||
body {font-size:90%}
|
||||
@page
|
||||
{
|
||||
size: auto;
|
||||
margin-top: 6mm;
|
||||
}
|
||||
.table_header_thead_class { text-align: left; border-radius: .5rem; }
|
||||
.table_header_td_class { text-transform: uppercase; font-size: 1.25rem; color: #b83280; font-weight: 500 }
|
||||
.table_body_td_class { padding: 1rem;}
|
||||
$custom_css
|
||||
</style>';
|
||||
}
|
||||
|
||||
public function header()
|
||||
{
|
||||
return '<div class="m-12">
|
||||
<div class="grid grid-cols-12 gap-4">
|
||||
<div class="col-span-3 flex flex-col flex-wrap break-all">$client_details</div>
|
||||
<div class="col-span-3 flex flex-col flex-wrap break-all">$company_details</div>
|
||||
<div class="col-span-3 flex flex-col flex-wrap break-all">$company_address</div>
|
||||
<div class="col-span-3 flex flex-wrap">$company_logo</div>
|
||||
</div>';
|
||||
}
|
||||
|
||||
public function body()
|
||||
{
|
||||
return '<div class="grid grid-cols-12 mt-8">
|
||||
<div class="col-span-7">
|
||||
<p class="text-4xl text-pink-700">#$entity_number</p>
|
||||
</div>
|
||||
<div class="col-span-5 flex flex-col flex-wrap">$entity_details</div>
|
||||
</div>
|
||||
|
||||
<table class="w-full table-auto border-t-4 border-pink-700 bg-white mt-8">
|
||||
<thead class="text-left rounded-lg">
|
||||
$product_table_header
|
||||
</thead>
|
||||
<tbody class="whitespace-pre-line">
|
||||
$product_table_body
|
||||
</tbody>
|
||||
</table>
|
||||
<table class="w-full table-auto border-t-4 border-pink-700 bg-white">
|
||||
<thead class="text-left rounded-lg">
|
||||
$task_table_header
|
||||
</thead>
|
||||
<tbody class="whitespace-pre-line">
|
||||
$task_table_body
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="border-b-4 border-pink-700 mt-8">
|
||||
<div class="grid grid-cols-12 mt-2 px-4 pb-4">
|
||||
<div class="col-span-7 flex flex-col">
|
||||
<p>$entity.public_notes</p>
|
||||
</div>
|
||||
<div class="col-span-5 flex px-3 mt-2">
|
||||
<div class="w-1/2 text-right flex flex-col">
|
||||
$subtotal_label $discount_label $total_tax_labels $line_tax_labels
|
||||
</div>
|
||||
<div class="w-1/2 text-right flex flex-col">
|
||||
$subtotal $discount $total_tax_values $line_tax_values
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-center justify-between mt-4 pb-4 px-4">
|
||||
<div class="w-1/2">
|
||||
<div class="flex flex-col">
|
||||
<p class="font-semibold">$terms_label</p>
|
||||
<p>N21</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="w-full flex justify-end mt-4">
|
||||
<p>$balance_due_label</p>
|
||||
<p class="ml-8 text-pink-700 font-semibold">$balance</p>
|
||||
</div>
|
||||
</div>';
|
||||
}
|
||||
|
||||
public function task()
|
||||
{
|
||||
return '';
|
||||
}
|
||||
|
||||
public function product()
|
||||
{
|
||||
return '';
|
||||
}
|
||||
|
||||
public function footer()
|
||||
{
|
||||
return '
|
||||
<footer>
|
||||
<div class="div_footer flex justify-between py-8 px-12" style="page-break-inside: avoid;">
|
||||
</div>
|
||||
</footer>';
|
||||
}
|
||||
}
|
@ -1,46 +0,0 @@
|
||||
<?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\Designs;
|
||||
|
||||
class Custom
|
||||
{
|
||||
public $includes;
|
||||
|
||||
public $header;
|
||||
|
||||
public $body;
|
||||
|
||||
public $product;
|
||||
|
||||
public $task;
|
||||
|
||||
public $footer;
|
||||
|
||||
public $name;
|
||||
|
||||
public function __construct($design)
|
||||
{
|
||||
$this->name = $design->name;
|
||||
|
||||
$this->includes = $design->design->includes;
|
||||
|
||||
$this->header = $design->design->header;
|
||||
|
||||
$this->body = $design->design->body;
|
||||
|
||||
$this->product = $design->design->product;
|
||||
|
||||
$this->task = $design->design->task;
|
||||
|
||||
$this->footer = $design->design->footer;
|
||||
}
|
||||
}
|
@ -1,396 +0,0 @@
|
||||
<?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\Designs;
|
||||
|
||||
use App\Models\Company;
|
||||
use App\Models\Invoice;
|
||||
|
||||
class Designer
|
||||
{
|
||||
public $design;
|
||||
|
||||
protected $input_variables;
|
||||
|
||||
protected $exported_variables;
|
||||
|
||||
protected $html;
|
||||
|
||||
protected $entity_string;
|
||||
|
||||
protected $entity;
|
||||
|
||||
private static $custom_fields = [
|
||||
'invoice1',
|
||||
'invoice2',
|
||||
'invoice3',
|
||||
'invoice4',
|
||||
'surcharge1',
|
||||
'surcharge2',
|
||||
'surcharge3',
|
||||
'surcharge4',
|
||||
'client1',
|
||||
'client2',
|
||||
'client3',
|
||||
'client4',
|
||||
'contact1',
|
||||
'contact2',
|
||||
'contact3',
|
||||
'contact4',
|
||||
'company1',
|
||||
'company2',
|
||||
'company3',
|
||||
'company4',
|
||||
];
|
||||
|
||||
public function __construct($entity, $design, $input_variables, $entity_string)
|
||||
{
|
||||
$this->entity = $entity;
|
||||
|
||||
$this->design = $design->design;
|
||||
|
||||
$this->input_variables = json_decode(json_encode($input_variables), 1);
|
||||
|
||||
$this->entity_string = $entity_string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the design
|
||||
* formatted HTML.
|
||||
* @return string The HTML design built
|
||||
*/
|
||||
public function build():self
|
||||
{
|
||||
$this->setHtml()
|
||||
->exportVariables()
|
||||
->setDesign($this->getSection('includes'))
|
||||
->setDesign($this->getSection('header'))
|
||||
->setDesign($this->getSection('body'))
|
||||
->setDesign($this->getSection('footer'));
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function init()
|
||||
{
|
||||
$this->setHtml()
|
||||
->exportVariables();
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getIncludes()
|
||||
{
|
||||
return $this->getSection('includes');
|
||||
}
|
||||
|
||||
public function getHeader()
|
||||
{
|
||||
return $this->getSection('header');
|
||||
}
|
||||
|
||||
public function getFooter()
|
||||
{
|
||||
$div = '
|
||||
%s <!-- Placeholder for getSection(footer) -->
|
||||
<div class="flex items-center justify-between m-12">
|
||||
%s <!-- Placeholder for signature -->
|
||||
%s <!-- Placehoder for Invoice Ninja logo -->
|
||||
</div>';
|
||||
|
||||
$signature = '<img class="h-40" src="$contact.signature" />';
|
||||
$logo = '<div></div>';
|
||||
|
||||
if (! $this->entity->user->account->isPaid()) {
|
||||
$logo = '<img class="h-32" src="$app_url/images/created-by-invoiceninja-new.png" />';
|
||||
}
|
||||
|
||||
return sprintf($div, $this->getSection('footer'), $signature, $logo);
|
||||
}
|
||||
|
||||
public function getBody()
|
||||
{
|
||||
return $this->getSection('body');
|
||||
}
|
||||
|
||||
public function getHtml():string
|
||||
{
|
||||
return $this->html;
|
||||
}
|
||||
|
||||
public function setHtml()
|
||||
{
|
||||
$this->html = '';
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
private function setDesign($section)
|
||||
{
|
||||
$this->html .= $section;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the template section on with the
|
||||
* stacked variables replaced with single variables.
|
||||
*
|
||||
* @param string $section the method name to be executed ie header/body/table/footer
|
||||
* @return string The HTML of the template section
|
||||
*/
|
||||
public function getSection($section):string
|
||||
{
|
||||
return strtr($this->design->{$section}, $this->exported_variables);
|
||||
// return str_replace(array_keys($this->exported_variables), array_values($this->exported_variables), $this->design->{$section});
|
||||
}
|
||||
|
||||
private function exportVariables()
|
||||
{
|
||||
//$s = microtime(true);
|
||||
$company = $this->entity->company;
|
||||
|
||||
$this->exported_variables['$custom_css'] = $this->entity->generateCustomCSS();
|
||||
$this->exported_variables['$app_url'] = $this->entity->generateAppUrl();
|
||||
$this->exported_variables['$client_details'] = $this->processVariables($this->input_variables['client_details'], $this->clientDetails($company));
|
||||
$this->exported_variables['$company_details'] = $this->processVariables($this->input_variables['company_details'], $this->companyDetails($company));
|
||||
$this->exported_variables['$company_address'] = $this->processVariables($this->input_variables['company_address'], $this->companyAddress($company));
|
||||
|
||||
if ($this->entity_string == 'invoice') {
|
||||
//$this->exported_variables['$entity_labels'] = $this->processLabels($this->input_variables['invoice_details'], $this->invoiceDetails($company));
|
||||
$this->exported_variables['$entity_details'] = $this->processVariables($this->input_variables['invoice_details'], $this->invoiceDetails($company));
|
||||
} elseif ($this->entity_string == 'credit') {
|
||||
//$this->exported_variables['$entity_labels'] = $this->processLabels($this->input_variables['credit_details'], $this->creditDetails($company));
|
||||
$this->exported_variables['$entity_details'] = $this->processVariables($this->input_variables['credit_details'], $this->creditDetails($company));
|
||||
} elseif ($this->entity_string == 'quote') {
|
||||
//$this->exported_variables['$entity_labels'] = $this->processLabels($this->input_variables['quote_details'], $this->quoteDetails($company));
|
||||
$this->exported_variables['$entity_details'] = $this->processVariables($this->input_variables['quote_details'], $this->quoteDetails($company));
|
||||
} else {
|
||||
$this->exported_variables['$entity_details'] = $this->processVariables($this->input_variables['invoice_details'], $this->quoteDetails($company));
|
||||
}
|
||||
|
||||
$this->exported_variables['$product_table_header'] = $this->entity->buildTableHeader($this->input_variables['product_columns']);
|
||||
$this->exported_variables['$product_table_body'] = $this->entity->buildTableBody($this->input_variables['product_columns'], $this->design->product, '$product');
|
||||
$this->exported_variables['$task_table_header'] = $this->entity->buildTableHeader($this->input_variables['task_columns']);
|
||||
$this->exported_variables['$task_table_body'] = $this->entity->buildTableBody($this->input_variables['task_columns'], $this->design->task, '$task');
|
||||
|
||||
if (strlen($this->exported_variables['$task_table_body']) == 0) {
|
||||
$this->exported_variables['$task_table_header'] = '';
|
||||
}
|
||||
|
||||
if (strlen($this->exported_variables['$product_table_body']) == 0) {
|
||||
$this->exported_variables['$product_table_header'] = '';
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
private function processVariables($input_variables, $variables):string
|
||||
{
|
||||
$output = '';
|
||||
|
||||
foreach (array_values($input_variables) as $value) {
|
||||
if (array_key_exists($value, $variables)) {
|
||||
$output .= $variables[$value];
|
||||
}
|
||||
}
|
||||
|
||||
return $output;
|
||||
}
|
||||
|
||||
private function processLabels($input_variables, $variables):string
|
||||
{
|
||||
$output = '';
|
||||
|
||||
foreach (array_keys($input_variables) as $value) {
|
||||
if (array_key_exists($value, $variables)) {
|
||||
//$tmp = str_replace("</span>", "_label</span>", $variables[$value]);
|
||||
$tmp = strtr($variables[$value], '</span>', '_label</span>');
|
||||
$output .= $tmp;
|
||||
}
|
||||
}
|
||||
|
||||
return $output;
|
||||
}
|
||||
|
||||
private function clientDetails(Company $company)
|
||||
{
|
||||
$data = [
|
||||
'$client.name' => '<p>$client.name</p>',
|
||||
'$client.id_number' => '<p>$client.id_number</p>',
|
||||
'$client.vat_number' => '<p>$client.vat_number</p>',
|
||||
'$client.address1' => '<p>$client.address1</p>',
|
||||
'$client.address2' => '<p>$client.address2</p>',
|
||||
'$client.city_state_postal' => '<p>$client.city_state_postal</p>',
|
||||
'$client.postal_city_state' => '<p>$client.postal_city_state</p>',
|
||||
'$client.country' => '<p>$client.country</p>',
|
||||
'$contact.email' => '<p>$client.email</p>',
|
||||
'$client.custom1' => '<p>$client.custom1</p>',
|
||||
'$client.custom2' => '<p>$client.custom2</p>',
|
||||
'$client.custom3' => '<p>$client.custom3</p>',
|
||||
'$client.custom4' => '<p>$client.custom4</p>',
|
||||
'$contact.contact1' => '<p>$contact.custom1</p>',
|
||||
'$contact.contact2' => '<p>$contact.custom2</p>',
|
||||
'$contact.contact3' => '<p>$contact.custom3</p>',
|
||||
'$contact.contact4' => '<p>$contact.custom4</p>',
|
||||
];
|
||||
|
||||
return $this->processCustomFields($company, $data);
|
||||
}
|
||||
|
||||
private function companyDetails(Company $company)
|
||||
{
|
||||
$data = [
|
||||
'$company.name' => '<span>$company.name</span>',
|
||||
'$company.id_number' => '<span>$company.id_number</span>',
|
||||
'$company.vat_number' => '<span>$company.vat_number</span>',
|
||||
'$company.website' => '<span>$company.website</span>',
|
||||
'$company.email' => '<span>$company.email</span>',
|
||||
'$company.phone' => '<span>$company.phone</span>',
|
||||
'$company.company1' => '<span>$company1</span>',
|
||||
'$company.company2' => '<span>$company2</span>',
|
||||
'$company.company3' => '<span>$company3</span>',
|
||||
'$company.company4' => '<span>$company4</span>',
|
||||
];
|
||||
|
||||
return $this->processCustomFields($company, $data);
|
||||
}
|
||||
|
||||
private function companyAddress(Company $company)
|
||||
{
|
||||
$data = [
|
||||
'$company.address1' => '<span>$company.address1</span>',
|
||||
'$company.address2' => '<span>$company.address2</span>',
|
||||
'$company.city_state_postal' => '<span>$company.city_state_postal</span>',
|
||||
'$company.postal_city_state' => '<span>$company.postal_city_state</span>',
|
||||
'$company.country' => '<span>$company.country</span>',
|
||||
'$company.company1' => '<span>$company1</span>',
|
||||
'$company.company2' => '<span>$company2</span>',
|
||||
'$company.company3' => '<span>$company3</span>',
|
||||
'$company.company4' => '<span>$company4</span>',
|
||||
];
|
||||
|
||||
return $this->processCustomFields($company, $data);
|
||||
}
|
||||
|
||||
private function invoiceDetails(Company $company)
|
||||
{
|
||||
$data = [
|
||||
'$invoice.number' => '<span class="flex justify-between items-center"><span>$invoice.number_label:</span><span> $invoice.number</span></span>',
|
||||
'$invoice.po_number' => '<span class="flex justify-between items-center"><span>$invoice.po_number_label:</span><span> $invoice.po_number</span></span>',
|
||||
'$invoice.date' => '<span class="flex justify-between items-center"><span>$invoice.date_label:</span><span> $invoice.date</span></span>',
|
||||
'$invoice.due_date' => '<span class="flex justify-between items-center"><span>$invoice.due_date_label:</span><span> $invoice.due_date</span></span>',
|
||||
'$invoice.balance_due' => '<span class="flex justify-between items-center"><span>$invoice.balance_due_label:</span><span> $invoice.balance_due</span></span>',
|
||||
'$invoice.total' => '<span class="flex justify-between items-center"><span>$invoice.total_label:</span><span> $invoice.total</span></span>',
|
||||
'$invoice.partial_due' => '<span class="flex justify-between items-center"><span>$invoice.partial_due_label:</span><span> $invoice.partial_due</span></span>',
|
||||
'$invoice.custom1' => '<span class="flex justify-between items-center"><span>$invoice1_label:</span><span> $invoice.custom1</span></span>',
|
||||
'$invoice.custom2' => '<span class="flex justify-between items-center"><span>$invoice2_label:</span><span> $invoice.custom2</span></span>',
|
||||
'$invoice.custom3' => '<span class="flex justify-between items-center"><span>$invoice3_label:</span><span> $invoice.custom3</span></span>',
|
||||
'$invoice.custom4' => '<span class="flex justify-between items-center"><span>$invoice4_label:</span><span> $invoice.custom4</span></span>',
|
||||
'$surcharge1' => '<span class="flex justify-between items-center"><span>$surcharge1_label:</span><span> $surcharge1</span></span>',
|
||||
'$surcharge2' => '<span class="flex justify-between items-center"><span>$surcharge2_label:</span><span> $surcharge2</span></span>',
|
||||
'$surcharge3' => '<span class="flex justify-between items-center"><span>$surcharge3_label:</span><span> $surcharge3</span></span>',
|
||||
'$surcharge4' => '<span class="flex justify-between items-center"><span>$surcharge4_label:</span><span> $surcharge4</span></span>',
|
||||
|
||||
];
|
||||
|
||||
return $this->processCustomFields($company, $data);
|
||||
}
|
||||
|
||||
private function quoteDetails(Company $company)
|
||||
{
|
||||
$data = [
|
||||
'$quote.quote_number' => '<span class="flex flex-wrap justify-between items-center"><span>$quote.number_label:</span><span> $quote.number</span></span>',
|
||||
'$quote.po_number' => '<span class="flex flex-wrap justify-between items-center"><span>$quote.po_number_label:</span><span> $quote.po_number</span></span>',
|
||||
'$quote.quote_date' => '<span class="flex flex-wrap justify-between items-center"><span>$quote.date_label:</span><span> $quote.date</span></span>',
|
||||
'$quote.valid_until' => '<span class="flex flex-wrap justify-between items-center"><span>$quote.valid_until_label:</span><span> $quote.valid_until</span></span>',
|
||||
'$quote.balance_due' => '<span class="flex flex-wrap justify-between items-center"><span>$quote.balance_due_label:</span><span> $quote.balance_due</span></span>',
|
||||
'$quote.quote_total' => '<span class="flex flex-wrap justify-between items-center"><span>$quote.total_label:</span><span> $quote.total</span></span>',
|
||||
'$quote.partial_due' => '<span class="flex flex-wrap justify-between items-center"><span>$quote.partial_due_label:</span><span> $quote.partial_due</span></span>',
|
||||
'$quote.custom1' => '<span class="flex flex-wrap justify-between items-center"><span>$quote.custom1_label:</span><span> $quote.custom1</span></span>',
|
||||
'$quote.custom2' => '<span class="flex flex-wrap justify-between items-center"><span>$quote.custom2_label:</span><span> $quote.custom2</span></span>',
|
||||
'$quote.custom3' => '<span class="flex flex-wrap justify-between items-center"><span>$quote.custom3_label:</span><span> $quote.custom3</span></span>',
|
||||
'$quote.custom4' => '<span class="flex flex-wrap justify-between items-center"><span>$quote.custom4_label:</span><span> $quote.custom4</span></span>',
|
||||
'$quote.surcharge1' => '<span class="flex flex-wrap justify-between items-center"><span>$surcharge1_label:</span><span> $surcharge1</span></span>',
|
||||
'$quote.surcharge2' => '<span class="flex flex-wrap justify-between items-center"><span>$surcharge2_label:</span><span> $surcharge2</span></span>',
|
||||
'$quote.surcharge3' => '<span class="flex flex-wrap justify-between items-center"><span>$surcharge3_label:</span><span> $surcharge3</span></span>',
|
||||
'$quote.surcharge4' => '<span class="flex flex-wrap justify-between items-center"><span>$surcharge4_label:</span><span> $surcharge4</span></span>',
|
||||
|
||||
];
|
||||
|
||||
return $this->processCustomFields($company, $data);
|
||||
}
|
||||
|
||||
private function creditDetails(Company $company)
|
||||
{
|
||||
$data = [
|
||||
'$credit.number' => '<span class="flex justify-between items-center">$credit.number_label<span></span><span>$credit.number</span></span>',
|
||||
'$credit.po_number' => '<span class="flex justify-between items-center">$credit.po_number_label<span></span><span>$credit.po_number</span></span>',
|
||||
'$credit.date' => '<span class="flex justify-between items-center">$credit.date_label<span></span><span>$credit.date</span></span>',
|
||||
'$credit.balance' => '<span class="flex justify-between items-center">$credit.balance_label<span></span><span>$credit.balance</span></span>',
|
||||
'$credit.total' => '<span class="flex justify-between items-center">$credit.total_label<span></span><span>$credit.total</span></span>',
|
||||
'$credit.partial_due' => '<span class="flex justify-between items-center">$credit.partial_due_label<span></span><span>$credit.partial_due</span></span>',
|
||||
'$credit.custom1' => '<span class="flex justify-between items-center">$credit.custom1_label<span></span><span>$credit.custom1</span></span>',
|
||||
'$credit.custom2' => '<span class="flex justify-between items-center">$credit.custom2_label<span></span><span>$credit.custom2</span></span>',
|
||||
'$credit.custom3' => '<span class="flex justify-between items-center">$credit.custom3_label<span></span><span>$credit.custom3</span></span>',
|
||||
'$credit.custom4' => '<span class="flex justify-between items-center">$credit.custom4_label<span></span><span>$credit.custom4</span></span>',
|
||||
'$credit.surcharge1' => '<span class="flex justify-between items-center">$surcharge1_label<span></span><span>$surcharge1_label: $surcharge1</span></span>',
|
||||
'$credit.surcharge2' => '<span class="flex justify-between items-center">$surcharge2_label<span></span><span>$surcharge2_label: $surcharge2</span></span>',
|
||||
'$credit.surcharge3' => '<span class="flex justify-between items-center">$surcharge3_label<span></span><span>$surcharge3_label: $surcharge3</span></span>',
|
||||
'$credit.surcharge4' => '<span class="flex justify-between items-center">$surcharge4_label<span></span><span>$surcharge4_label: $surcharge4</span></span>',
|
||||
|
||||
];
|
||||
|
||||
return $this->processCustomFields($company, $data);
|
||||
}
|
||||
|
||||
private function processCustomFields(Company $company, $data)
|
||||
{
|
||||
$custom_fields = $company->custom_fields;
|
||||
|
||||
if (! $custom_fields) {
|
||||
return $data;
|
||||
}
|
||||
|
||||
foreach (self::$custom_fields as $cf) {
|
||||
if (! property_exists($custom_fields, $cf) || (strlen($custom_fields->{$cf}) == 0)) {
|
||||
unset($data[$cf]);
|
||||
}
|
||||
}
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
// private function processInputVariables($company, $variables)
|
||||
// {
|
||||
// if(is_object($variables))
|
||||
// $variables = json_decode(json_encode($variables),true);
|
||||
|
||||
// $custom_fields = $company->custom_fields;
|
||||
|
||||
// $matches = array_intersect(self::$custom_fields, $variables);
|
||||
|
||||
// foreach ($matches as $match) {
|
||||
|
||||
// if (!property_exists($custom_fields, $match) || (strlen($custom_fields->{$match}) == 0)) {
|
||||
// foreach ($variables as $key => $value) {
|
||||
// if ($value == $match) {
|
||||
// unset($variables[$key]);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
// }
|
||||
|
||||
// return $variables;
|
||||
|
||||
// }
|
||||
}
|
@ -1,144 +0,0 @@
|
||||
<?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\Designs;
|
||||
|
||||
class Elegant extends AbstractDesign
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
}
|
||||
|
||||
public function includes()
|
||||
{
|
||||
return '<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="$app_url/css/tailwind-1.2.0.css" rel="stylesheet">
|
||||
<style>
|
||||
body {font-size:90%}
|
||||
@page
|
||||
{
|
||||
size: auto;
|
||||
margin-top: 5mm;
|
||||
}
|
||||
.table_header_thead_class { text-align: left; border-bottom-width: 1px; border-style: dashed; border-color: black; }
|
||||
.table_header_td_class { font-weight: normal; color: #2f855a; padding: .5rem 1rem; }
|
||||
.table_body_td_class { padding: 1rem; }
|
||||
$custom_css
|
||||
</style>';
|
||||
}
|
||||
|
||||
public function header()
|
||||
{
|
||||
return '<div class="m-10">
|
||||
<div class="grid grid-cols-12 border-b-4 border-black pb-6">
|
||||
<div class="col-span-8">
|
||||
$company_logo
|
||||
</div>
|
||||
<div class="col-span-4 flex flex-col flex-wrap">
|
||||
$entity_details
|
||||
</div>
|
||||
</div>
|
||||
<div class="p-px border-b border-black mt-1"></div>';
|
||||
}
|
||||
|
||||
public function body()
|
||||
{
|
||||
return '<div class="grid grid-cols-12 gap-4 mt-8">
|
||||
<div class="col-span-4 mr-6 flex flex-col pr-2 border-r border-dashed border-black flex-wrap">
|
||||
$client_details
|
||||
</div>
|
||||
<div class="col-span-4 flex flex-col mr-6 flex-wrap">
|
||||
$company_details
|
||||
</div>
|
||||
<div class="col-span-4 flex flex-col flex-wrap">
|
||||
$company_address
|
||||
</div>
|
||||
</div>
|
||||
<table class="w-full table-auto mb-6 mt-16">
|
||||
<thead class="text-left border-dashed border-b border-black">
|
||||
$product_table_header
|
||||
</thead>
|
||||
<tbody class="whitespace-pre-line">
|
||||
$product_table_body
|
||||
</tbody>
|
||||
</table>
|
||||
<table class="w-full table-auto mb-6 mt-16">
|
||||
<thead class="text-left border-dashed border-b border-black">
|
||||
$task_table_header
|
||||
</thead>
|
||||
<tbody class="whitespace-pre-line">
|
||||
$task_table_body
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="flex items-center justify-between mt-2 px-4 pb-4">
|
||||
<div class="w-1/2">
|
||||
<div class="flex flex-col">
|
||||
<p>$entity.public_notes</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="w-1/3 flex flex-col">
|
||||
<div class="flex px-3 mt-2">
|
||||
<section class="w-1/2 text-right flex flex-col">
|
||||
$discount_label
|
||||
$total_tax_labels
|
||||
$line_tax_labels
|
||||
</section>
|
||||
<section class="w-1/2 text-right flex flex-col">
|
||||
$discount
|
||||
$total_tax_values
|
||||
$line_tax_values
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-center justify-between mt-4 pb-4 px-4">
|
||||
<div class="w-1/2">
|
||||
<div class="flex flex-col">
|
||||
<p class="font-semibold">$terms_label</p>
|
||||
<p>$terms</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex w-2/5 flex-col">
|
||||
<section class="flex py-2 text-green-700 border-t border-b border-dashed border-black px-2 mt-1">
|
||||
<p class="w-1/2">$balance_due_label</p>
|
||||
<p class="text-right w-1/2">$balance</p>
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex justify-center border-b-4 border-black mt-6">
|
||||
<h4 class="text-2xl font-semibold mb-4">Thanks</h4>
|
||||
</div>
|
||||
<div class="p-px border-b border-black mt-1"></div>
|
||||
</div>';
|
||||
}
|
||||
|
||||
public function task()
|
||||
{
|
||||
return '';
|
||||
}
|
||||
|
||||
public function product()
|
||||
{
|
||||
return '';
|
||||
}
|
||||
|
||||
public function footer()
|
||||
{
|
||||
return '
|
||||
<footer>
|
||||
<div class="div_footer flex justify-between py-8 px-12" style="page-break-inside: avoid;">
|
||||
</div>
|
||||
</footer>';
|
||||
}
|
||||
}
|
@ -1,153 +0,0 @@
|
||||
<?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\Designs;
|
||||
|
||||
class Hipster extends AbstractDesign
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
}
|
||||
|
||||
public function includes()
|
||||
{
|
||||
return '<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="$app_url/css/tailwind-1.2.0.css" rel="stylesheet">
|
||||
<style>
|
||||
body {font-size:90%}
|
||||
@page
|
||||
{
|
||||
size: auto;
|
||||
margin-top: 5mm;
|
||||
}
|
||||
|
||||
.table_header_thead_class { text-align: left }
|
||||
.table_header_td_class { text-transform: uppercase; padding: .5rem 1rem; font-weight: 600; border-color: black; }
|
||||
.table_body_td_class { border-left-width: 2px; border-color: black; padding: 1rem; }
|
||||
$custom_css
|
||||
</style>';
|
||||
}
|
||||
|
||||
public function header()
|
||||
{
|
||||
return '<div class="px-12 py-16">
|
||||
<div class="flex">
|
||||
<div class="w-1/2 border-l pl-4 border-black mr-4">
|
||||
<p class="font-semibold uppercase text-yellow-600">From:</p>
|
||||
<div class="flex">
|
||||
<div class="flex flex-col mr-5 flex-wrap">
|
||||
$company_details
|
||||
</div>
|
||||
<div class="flex flex-col flex-wrap">
|
||||
$company_address
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="w-1/3 border-l pl-4 border-black flex flex-col flex-wrap">
|
||||
<p class="font-semibold uppercase text-yellow-600">To:</p>
|
||||
$client_details
|
||||
</div>
|
||||
<div class="w-1/3 mt-5 h-16">
|
||||
$company_logo
|
||||
</div>
|
||||
</div>';
|
||||
}
|
||||
|
||||
public function body()
|
||||
{
|
||||
return '<div class="flex flex-col mx-6 mt-10">
|
||||
<h1 class="font-semibold uppercase text-6xl">$entity_label</h1>
|
||||
<div class="flex mt-1">
|
||||
<span class="font-semibold uppercase text-yellow-600">$entity_number</span>
|
||||
<div class="ml-4">
|
||||
<span class="uppercase">$date_label</span>
|
||||
<span>$date</span>
|
||||
</div>
|
||||
<div class="ml-10">
|
||||
<span class="uppercase">$due_date_label</span>
|
||||
<span>$due_date</span>
|
||||
</div>
|
||||
<div class="ml-4">
|
||||
<span class="uppercase">$balance_due_label</span>
|
||||
<span class="text-yellow-600">$balance_due</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<table class="w-full table-auto mt-24">
|
||||
<thead class="text-left">
|
||||
$product_table_header
|
||||
</thead>
|
||||
<tbody class="whitespace-pre-line">
|
||||
$product_table_body
|
||||
</tbody>
|
||||
</table>
|
||||
<table class="w-full table-auto mt-24">
|
||||
<thead class="text-left">
|
||||
$task_table_header
|
||||
</thead>
|
||||
<tbody class="whitespace-pre-line">
|
||||
$task_table_body
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="flex justify-between mt-8">
|
||||
<div class="w-1/2">
|
||||
<div class="flex flex-col">
|
||||
<p>$entity.public_notes</p>
|
||||
<div class="pt-4">
|
||||
<p class="font-bold">$terms_label</p>
|
||||
<p>$terms</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="w-1/3 flex flex-col">
|
||||
<div class="flex px-3 mt-6">
|
||||
<section class="w-1/2 text-right flex flex-col">
|
||||
$discount_label
|
||||
$total_tax_labels
|
||||
$line_tax_labels
|
||||
</section>
|
||||
<section class="w-1/2 text-right flex flex-col">
|
||||
$discount
|
||||
$total_tax_values
|
||||
$line_tax_values
|
||||
</section>
|
||||
</div>
|
||||
<section class="flex bg-black text-white px-3 mt-1">
|
||||
<p class="w-1/2 text-right">$balance_due_label</p>
|
||||
<p class="text-right w-1/2">$balance_due</p>
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
</div>';
|
||||
}
|
||||
|
||||
public function task()
|
||||
{
|
||||
return '';
|
||||
}
|
||||
|
||||
public function product()
|
||||
{
|
||||
return '';
|
||||
}
|
||||
|
||||
public function footer()
|
||||
{
|
||||
return '
|
||||
<footer>
|
||||
<div class="div_footer flex justify-between py-8 px-12" style="page-break-inside: avoid;">
|
||||
</div>
|
||||
</footer>';
|
||||
}
|
||||
}
|
@ -1,151 +0,0 @@
|
||||
<?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\Designs;
|
||||
|
||||
class Modern extends AbstractDesign
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
}
|
||||
|
||||
public function includes()
|
||||
{
|
||||
return '<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="$app_url/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;}
|
||||
$custom_css
|
||||
</style>
|
||||
</head>
|
||||
<body>';
|
||||
}
|
||||
|
||||
public function header()
|
||||
{
|
||||
return '
|
||||
<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>';
|
||||
}
|
||||
|
||||
public function body()
|
||||
{
|
||||
return '
|
||||
<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;">
|
||||
$product_table_header
|
||||
</thead>
|
||||
<tbody class="whitespace-pre-line">
|
||||
$product_table_body
|
||||
</tbody>
|
||||
</table>
|
||||
<table class="w-full table-auto mt-8">
|
||||
<thead class="text-left text-white bg-gray-900 display: table-header-group;">
|
||||
$task_table_header
|
||||
</thead>
|
||||
<tbody class="whitespace-pre-line">
|
||||
$task_table_body
|
||||
</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>
|
||||
';
|
||||
}
|
||||
|
||||
public function task()
|
||||
{
|
||||
return '';
|
||||
}
|
||||
|
||||
public function product()
|
||||
{
|
||||
return '';
|
||||
}
|
||||
|
||||
public function footer()
|
||||
{
|
||||
return '
|
||||
<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>';
|
||||
}
|
||||
}
|
@ -1,154 +0,0 @@
|
||||
<?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\Designs;
|
||||
|
||||
class Photo extends AbstractDesign
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
}
|
||||
|
||||
public function includes()
|
||||
{
|
||||
return '<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="$app_url/css/tailwind-1.2.0.css" rel="stylesheet">
|
||||
<style>
|
||||
body {font-size:90%}
|
||||
@page {
|
||||
size: auto;
|
||||
margin-top: 5mm;
|
||||
}
|
||||
#imageContainer {
|
||||
background-image: url();
|
||||
background-size: cover;
|
||||
}
|
||||
|
||||
.table_header_thead_class { text-align: left; border-bottom-width: 4px; border-color: black; }
|
||||
.table_header_td_class { font-weight: 400; text-transform: uppercase; padding: 1rem .5rem; }
|
||||
.table_body_td_class { padding: 1rem; }
|
||||
$custom_css
|
||||
</style>';
|
||||
}
|
||||
|
||||
public function header()
|
||||
{
|
||||
return '<div class="px-16 py-10">
|
||||
<div class="grid grid-cols-12 mt-2">
|
||||
<div class="col-span-7">
|
||||
$company_logo
|
||||
</div>
|
||||
<div class="col-span-5">
|
||||
<div class="flex flex-col flex-wrap">
|
||||
$entity_details
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>';
|
||||
}
|
||||
|
||||
public function body()
|
||||
{
|
||||
return '<div class="flex content-center flex-wrap bg-gray-200 h-auto p-16" id="imageContainer">
|
||||
<div class="flex flex-col">
|
||||
<div class="flex">
|
||||
<p class="uppercase text-orange-800">$to_label:</p>
|
||||
<div class="flex flex-col ml-2 flex-wrap">
|
||||
$client_details
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex mt-5">
|
||||
<p class="uppercase text-orange-800">$from_label:</p>
|
||||
<div class="flex flex-col ml-2 flex-wrap">
|
||||
$company_details
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="px-16 py-16">
|
||||
<table class="w-full table-auto">
|
||||
<thead class="text-left border-b-4 border-black">
|
||||
$product_table_header
|
||||
</thead>
|
||||
<tbody class="whitespace-pre-line">
|
||||
$product_table_body
|
||||
</tbody>
|
||||
</table>
|
||||
<table class="w-full table-auto">
|
||||
<thead class="text-left border-b-4 border-black">
|
||||
$task_table_header
|
||||
</thead>
|
||||
<tbody class="whitespace-pre-line">
|
||||
$task_table_body
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="flex items-center justify-between mt-2 px-4 pb-4">
|
||||
<div class="w-1/2">
|
||||
<div class="flex flex-col">
|
||||
<p>$entity.public_notes</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="w-1/3 flex flex-col">
|
||||
<div class="flex px-3 mt-2">
|
||||
<section class="w-1/2 text-right flex flex-col">
|
||||
$discount_label
|
||||
$total_tax_labels
|
||||
$line_tax_labels
|
||||
</section>
|
||||
<section class="w-1/2 text-right flex flex-col">
|
||||
$discount
|
||||
$total_tax_values
|
||||
$line_tax_values
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-center justify-between mt-4 pb-4 px-4">
|
||||
<div class="w-1/2">
|
||||
<div class="flex flex-col">
|
||||
<p class="font-semibold">$terms_label</p>
|
||||
<p>$terms</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex w-2/5 flex-col">
|
||||
<section class="flex bg-orange-700 py-2 text-white px-2 mt-1">
|
||||
<p class="w-1/2">$balance_due_label</p>
|
||||
<p class="text-right w-1/2">$balance_due</p>
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>';
|
||||
}
|
||||
|
||||
public function task()
|
||||
{
|
||||
return '';
|
||||
}
|
||||
|
||||
public function product()
|
||||
{
|
||||
return '';
|
||||
}
|
||||
|
||||
public function footer()
|
||||
{
|
||||
return '
|
||||
<footer>
|
||||
<div class="div_footer flex justify-between py-8 px-12" style="page-break-inside: avoid;">
|
||||
</div>
|
||||
</footer>';
|
||||
}
|
||||
}
|
@ -1,131 +0,0 @@
|
||||
<?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\Designs;
|
||||
|
||||
class Plain extends AbstractDesign
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
}
|
||||
|
||||
public function includes()
|
||||
{
|
||||
return '<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="$app_url/css/tailwind-1.2.0.css" rel="stylesheet">
|
||||
<style>
|
||||
body {font-size:90%}
|
||||
@page {
|
||||
size: auto;
|
||||
margin-top: 5mm;
|
||||
}
|
||||
.table_header_thead_class { text-align: left; background-color: #e2e8f0 }
|
||||
.table_header_td_class { padding: 1rem .5rem; }
|
||||
.table_body_td_class { padding: 1rem; border-bottom-width: 1px; border-top-width: 2px; border-color: #e2e8f0 }
|
||||
$custom_css
|
||||
</style>';
|
||||
}
|
||||
|
||||
public function header()
|
||||
{
|
||||
return '<div class="px-12 py-8">
|
||||
<div class="grid grid-cols-6 gap-1">
|
||||
<div class="col-span-2 p-3">
|
||||
$company_logo
|
||||
</div>
|
||||
<div class="col-span-2 p-3 flex flex-col flex-wrap">
|
||||
$company_details
|
||||
</div>
|
||||
<div class="col-span-2 p-3 flex flex-col flex-wrap">
|
||||
$entity_details
|
||||
</div>
|
||||
</div>';
|
||||
}
|
||||
|
||||
public function body()
|
||||
{
|
||||
return '<div class="flex flex-col mt-8 flex-wrap">
|
||||
$client_details
|
||||
</div>
|
||||
<table class="w-full table-auto mt-8">
|
||||
<thead class="text-left bg-gray-300">
|
||||
$product_table_header
|
||||
</thead>
|
||||
<tbody>
|
||||
$product_table_body
|
||||
</tbody>
|
||||
</table>
|
||||
<table class="w-full table-auto mt-8">
|
||||
<thead class="text-left bg-gray-300">
|
||||
$task_table_header
|
||||
</thead>
|
||||
<tbody>
|
||||
$task_table_body
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<div class="grid grid-cols-12 gap-1">
|
||||
<div class="col-span-6 p-3">
|
||||
<div class="flex flex-col">
|
||||
<p>$entity.public_notes</p>
|
||||
<div class="pt-4">
|
||||
<p class="font-bold">$terms_label</p>
|
||||
<p>$terms</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-span-6 p-3">
|
||||
<div class="grid grid-cols-2 gap-1">
|
||||
<div class="col-span-1 text-right flex flex-col">
|
||||
$discount_label
|
||||
$total_tax_labels
|
||||
$line_tax_labels
|
||||
</div>
|
||||
<div class="col-span-1 text-right flex flex-col">
|
||||
$discount
|
||||
$total_tax_values
|
||||
$line_tax_values
|
||||
</div>
|
||||
</div>
|
||||
<div class="grid grid-cols-2 gap-1 bg-gray-300">
|
||||
<div class="col-span-1 text-right flex flex-col">
|
||||
$balance_due_label
|
||||
</div>
|
||||
<div class="col-span-1 text-right flex flex-col">
|
||||
$balance_due
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div';
|
||||
}
|
||||
|
||||
public function task()
|
||||
{
|
||||
return '';
|
||||
}
|
||||
|
||||
public function product()
|
||||
{
|
||||
return '';
|
||||
}
|
||||
|
||||
public function footer()
|
||||
{
|
||||
return '
|
||||
<footer>
|
||||
<div class="div_footer flex justify-between py-8 px-12" style="page-break-inside: avoid;">
|
||||
</div>
|
||||
</footer>';
|
||||
}
|
||||
}
|
@ -1,143 +0,0 @@
|
||||
<?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\Designs;
|
||||
|
||||
class Playful extends AbstractDesign
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
}
|
||||
|
||||
public function includes()
|
||||
{
|
||||
return '<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="$app_url/css/tailwind-1.2.0.css" rel="stylesheet">
|
||||
<style>
|
||||
body {font-size:90%}
|
||||
@page
|
||||
{
|
||||
size: auto;
|
||||
margin-top: 5mm;
|
||||
}
|
||||
.table_header_thead_class { text-align: left; background-color: #319795; border-radius: .5rem; }
|
||||
.table_header_td_class { padding: .75rem 1rem; font-weight: 600; color: white; }
|
||||
.table_body_td_class { padding: 1rem; border-bottom-width: 4px; border-style: dashed; border-color: #319795; color: black }
|
||||
$custom_css
|
||||
</style>';
|
||||
}
|
||||
|
||||
public function header()
|
||||
{
|
||||
return '<div class="my-12 mx-16">
|
||||
<div class="grid grid-cols-12 items-center justify-between">
|
||||
<div class="col-span-7">
|
||||
$company_logo
|
||||
</div>
|
||||
<div class="col-span-5 bg-teal-600 p-5 text-white">
|
||||
<div class="flex flex-col flex-wrap">
|
||||
$entity_details
|
||||
</div>
|
||||
</div>
|
||||
</div>';
|
||||
}
|
||||
|
||||
public function body()
|
||||
{
|
||||
return '<div class="flex mt-16">
|
||||
<div class="w-1/2">
|
||||
<div class="flex flex-col">
|
||||
<p class="font-semibold text-teal-600 pl-4">$to_label:</p>
|
||||
<div class="flex border-dashed border-t-4 border-b-4 border-teal-600 py-4 mt-4 pl-4">
|
||||
<section class="flex flex-col flex-wrap">
|
||||
$client_details
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="w-1/2 ml-24">
|
||||
<div class="flex flex-col">
|
||||
<p class="font-semibold text-teal-600 pl-4">$from_label:</p>
|
||||
<div class="flex border-dashed border-t-4 border-b-4 border-teal-600 py-4 mt-4 pl-4">
|
||||
<section class="flex flex-col flex-wrap">
|
||||
$company_details
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<table class="w-full table-auto mt-20 mb-8">
|
||||
<thead class="text-left bg-teal-600 rounded-lg">
|
||||
$product_table_header
|
||||
</thead>
|
||||
<tbody class="whitespace-pre-line">
|
||||
$product_table_body
|
||||
</tbody>
|
||||
</table>
|
||||
<table class="w-full table-auto mt-20 mb-8">
|
||||
<thead class="text-left bg-teal-600 rounded-lg">
|
||||
$task_table_header
|
||||
</thead>
|
||||
<tbody class="whitespace-pre-line">
|
||||
$task_table_body
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="grid grid-cols-12 gap-4">
|
||||
<div class="col-span-7 flex flex-col">
|
||||
$entity.public_notes
|
||||
</div>
|
||||
<div class="col-span-5 flex">
|
||||
<section class="w-1/2 text-right flex flex-col">
|
||||
$discount_label
|
||||
$total_tax_labels
|
||||
$line_tax_labels
|
||||
</section>
|
||||
<section class="w-1/2 text-right flex flex-col">
|
||||
$discount
|
||||
$total_tax_values
|
||||
$line_tax_values
|
||||
</section>
|
||||
</div>
|
||||
<div class="col-span-7">
|
||||
<p class="font-semibold">$terms_label</p>
|
||||
<p>$terms</p>
|
||||
</div>
|
||||
<div class="col-span-5">
|
||||
<div class="flex bg-teal-600 py-3 px-4 text-white">
|
||||
<p class="w-1/2">$balance_due_label</p>
|
||||
<p class="text-right w-1/2">$balance_due</p>
|
||||
</div>
|
||||
</div>
|
||||
<div>';
|
||||
}
|
||||
|
||||
public function task()
|
||||
{
|
||||
return '';
|
||||
}
|
||||
|
||||
public function product()
|
||||
{
|
||||
return '';
|
||||
}
|
||||
|
||||
public function footer()
|
||||
{
|
||||
return '
|
||||
<footer>
|
||||
<div class="div_footer flex justify-between py-8 px-12" style="page-break-inside: avoid;">
|
||||
</div>
|
||||
</footer>';
|
||||
}
|
||||
}
|
@ -38,7 +38,9 @@ class AccountCreated
|
||||
/**
|
||||
* Create a new event instance.
|
||||
*
|
||||
* @return void
|
||||
* @param $user
|
||||
* @param $company
|
||||
* @param $event_vars
|
||||
*/
|
||||
public function __construct($user, $company, $event_vars)
|
||||
{
|
||||
@ -50,7 +52,7 @@ class AccountCreated
|
||||
/**
|
||||
* Get the channels the event should broadcast on.
|
||||
*
|
||||
* @return \Illuminate\Broadcasting\Channel|array
|
||||
* @return Channel|array
|
||||
*/
|
||||
public function broadcastOn()
|
||||
{
|
||||
|
@ -41,6 +41,8 @@ class ClientWasArchived
|
||||
* Create a new event instance.
|
||||
*
|
||||
* @param Client $client
|
||||
* @param Company $company
|
||||
* @param array $event_vars
|
||||
*/
|
||||
public function __construct(Client $client, Company $company, array $event_vars)
|
||||
{
|
||||
@ -52,7 +54,7 @@ class ClientWasArchived
|
||||
/**
|
||||
* Get the channels the event should broadcast on.
|
||||
*
|
||||
* @return \Illuminate\Broadcasting\Channel|array
|
||||
* @return Channel|array
|
||||
*/
|
||||
public function broadcastOn()
|
||||
{
|
||||
|
@ -35,6 +35,8 @@ class ClientWasCreated
|
||||
* Create a new event instance.
|
||||
*
|
||||
* @param Client $client
|
||||
* @param Company $company
|
||||
* @param array $event_vars
|
||||
*/
|
||||
public function __construct(Client $client, Company $company, array $event_vars)
|
||||
{
|
||||
|
@ -34,6 +34,8 @@ class ClientWasDeleted
|
||||
* Create a new event instance.
|
||||
*
|
||||
* @param Client $client
|
||||
* @param Company $company
|
||||
* @param array $event_vars
|
||||
*/
|
||||
public function __construct(Client $client, Company $company, array $event_vars)
|
||||
{
|
||||
|
@ -34,6 +34,8 @@ class ClientWasRestored
|
||||
* Create a new event instance.
|
||||
*
|
||||
* @param Client $client
|
||||
* @param Company $company
|
||||
* @param array $event_vars
|
||||
*/
|
||||
public function __construct(Client $client, Company $company, array $event_vars)
|
||||
{
|
||||
|
@ -34,6 +34,8 @@ class ClientWasUpdated
|
||||
* Create a new event instance.
|
||||
*
|
||||
* @param Client $client
|
||||
* @param Company $company
|
||||
* @param array $event_vars
|
||||
*/
|
||||
public function __construct(Client $client, Company $company, array $event_vars)
|
||||
{
|
||||
|
@ -42,7 +42,7 @@ class CompanyDocumentsDeleted
|
||||
/**
|
||||
* Get the channels the event should broadcast on.
|
||||
*
|
||||
* @return \Illuminate\Broadcasting\Channel|array
|
||||
* @return Channel|array
|
||||
*/
|
||||
public function broadcastOn()
|
||||
{
|
||||
|
@ -39,7 +39,9 @@ class ContactLoggedIn
|
||||
/**
|
||||
* Create a new event instance.
|
||||
*
|
||||
* @return void
|
||||
* @param ClientContact $client_contact
|
||||
* @param $company
|
||||
* @param $event_vars
|
||||
*/
|
||||
public function __construct(ClientContact $client_contact, $company, $event_vars)
|
||||
{
|
||||
@ -51,7 +53,7 @@ class ContactLoggedIn
|
||||
/**
|
||||
* Get the channels the event should broadcast on.
|
||||
*
|
||||
* @return \Illuminate\Broadcasting\Channel|array
|
||||
* @return Channel|array
|
||||
*/
|
||||
public function broadcastOn()
|
||||
{
|
||||
|
@ -31,6 +31,8 @@ class CreditWasArchived
|
||||
* Create a new event instance.
|
||||
*
|
||||
* @param Credit $credit
|
||||
* @param Company $company
|
||||
* @param array $event_vars
|
||||
*/
|
||||
public function __construct(Credit $credit, Company $company, array $event_vars)
|
||||
{
|
||||
|
@ -31,6 +31,8 @@ class CreditWasCreated
|
||||
* Create a new event instance.
|
||||
*
|
||||
* @param Credit $credit
|
||||
* @param Company $company
|
||||
* @param array $event_vars
|
||||
*/
|
||||
public function __construct(Credit $credit, Company $company, array $event_vars)
|
||||
{
|
||||
|
@ -31,6 +31,8 @@ class CreditWasDeleted
|
||||
* Create a new event instance.
|
||||
*
|
||||
* @param Credit $credit
|
||||
* @param Company $company
|
||||
* @param array $event_vars
|
||||
*/
|
||||
public function __construct(Credit $credit, Company $company, array $event_vars)
|
||||
{
|
||||
|
@ -30,6 +30,8 @@ class CreditWasEmailed
|
||||
* Create a new event instance.
|
||||
*
|
||||
* @param Credit $credit
|
||||
* @param Company $company
|
||||
* @param array $event_vars
|
||||
*/
|
||||
public function __construct(Credit $credit, Company $company, array $event_vars)
|
||||
{
|
||||
|
@ -34,6 +34,8 @@ class CreditWasMarkedSent
|
||||
* Create a new event instance.
|
||||
*
|
||||
* @param Credit $credit
|
||||
* @param Company $company
|
||||
* @param array $event_vars
|
||||
*/
|
||||
public function __construct(Credit $credit, Company $company, array $event_vars)
|
||||
{
|
||||
|
@ -33,7 +33,9 @@ class CreditWasRestored
|
||||
/**
|
||||
* Create a new event instance.
|
||||
*
|
||||
* @param Client $client
|
||||
* @param Credit $credit
|
||||
* @param Company $company
|
||||
* @param array $event_vars
|
||||
*/
|
||||
public function __construct(Credit $credit, Company $company, array $event_vars)
|
||||
{
|
||||
|
@ -31,6 +31,8 @@ class CreditWasUpdated
|
||||
* Create a new event instance.
|
||||
*
|
||||
* @param Credit $credit
|
||||
* @param Company $company
|
||||
* @param array $event_vars
|
||||
*/
|
||||
public function __construct(Credit $credit, Company $company, array $event_vars)
|
||||
{
|
||||
|
@ -12,7 +12,6 @@
|
||||
namespace App\Events\Credit;
|
||||
|
||||
use App\Models\Company;
|
||||
use App\Models\CreditWasViewed;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
|
||||
/**
|
||||
|
@ -41,6 +41,8 @@ class DesignWasArchived
|
||||
* Create a new event instance.
|
||||
*
|
||||
* @param Design $design
|
||||
* @param Company $company
|
||||
* @param array $event_vars
|
||||
*/
|
||||
public function __construct(Design $design, Company $company, array $event_vars)
|
||||
{
|
||||
@ -54,7 +56,7 @@ class DesignWasArchived
|
||||
/**
|
||||
* Get the channels the event should broadcast on.
|
||||
*
|
||||
* @return \Illuminate\Broadcasting\Channel|array
|
||||
* @return Channel|array
|
||||
*/
|
||||
public function broadcastOn()
|
||||
{
|
||||
|
@ -13,6 +13,7 @@ namespace App\Events\Design;
|
||||
|
||||
use App\Models\Company;
|
||||
use App\Models\Design;
|
||||
use Illuminate\Broadcasting\Channel;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
|
||||
/**
|
||||
@ -35,6 +36,8 @@ class DesignWasCreated
|
||||
* Create a new event instance.
|
||||
*
|
||||
* @param Design $design
|
||||
* @param Company $company
|
||||
* @param array $event_vars
|
||||
*/
|
||||
public function __construct(Design $design, Company $company, array $event_vars)
|
||||
{
|
||||
@ -48,7 +51,7 @@ class DesignWasCreated
|
||||
/**
|
||||
* Get the channels the event should broadcast on.
|
||||
*
|
||||
* @return \Illuminate\Broadcasting\Channel|array
|
||||
* @return PrivateChannel
|
||||
*/
|
||||
public function broadcastOn()
|
||||
{
|
||||
|
@ -13,6 +13,7 @@ namespace App\Events\Design;
|
||||
|
||||
use App\Models\Company;
|
||||
use App\Models\Design;
|
||||
use Illuminate\Broadcasting\Channel;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
|
||||
/**
|
||||
@ -35,6 +36,8 @@ class DesignWasDeleted
|
||||
* Create a new event instance.
|
||||
*
|
||||
* @param Design $design
|
||||
* @param Company $company
|
||||
* @param array $event_vars
|
||||
*/
|
||||
public function __construct(Design $design, Company $company, array $event_vars)
|
||||
{
|
||||
@ -48,7 +51,7 @@ class DesignWasDeleted
|
||||
/**
|
||||
* Get the channels the event should broadcast on.
|
||||
*
|
||||
* @return \Illuminate\Broadcasting\Channel|array
|
||||
* @return PrivateChannel
|
||||
*/
|
||||
public function broadcastOn()
|
||||
{
|
||||
|
@ -13,6 +13,7 @@ namespace App\Events\Design;
|
||||
|
||||
use App\Models\Company;
|
||||
use App\Models\Design;
|
||||
use Illuminate\Broadcasting\Channel;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
|
||||
/**
|
||||
@ -35,6 +36,8 @@ class DesignWasRestored
|
||||
* Create a new event instance.
|
||||
*
|
||||
* @param Design $design
|
||||
* @param Company $company
|
||||
* @param array $event_vars
|
||||
*/
|
||||
public function __construct(Design $design, Company $company, array $event_vars)
|
||||
{
|
||||
@ -48,7 +51,7 @@ class DesignWasRestored
|
||||
/**
|
||||
* Get the channels the event should broadcast on.
|
||||
*
|
||||
* @return \Illuminate\Broadcasting\Channel|array
|
||||
* @return PrivateChannel
|
||||
*/
|
||||
public function broadcastOn()
|
||||
{
|
||||
|
@ -13,6 +13,7 @@ namespace App\Events\Design;
|
||||
|
||||
use App\Models\Company;
|
||||
use App\Models\Design;
|
||||
use Illuminate\Broadcasting\Channel;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
|
||||
/**
|
||||
@ -35,6 +36,8 @@ class DesignWasUpdated
|
||||
* Create a new event instance.
|
||||
*
|
||||
* @param Design $design
|
||||
* @param Company $company
|
||||
* @param array $event_vars
|
||||
*/
|
||||
public function __construct(Design $design, Company $company, array $event_vars)
|
||||
{
|
||||
@ -48,7 +51,7 @@ class DesignWasUpdated
|
||||
/**
|
||||
* Get the channels the event should broadcast on.
|
||||
*
|
||||
* @return \Illuminate\Broadcasting\Channel|array
|
||||
* @return PrivateChannel
|
||||
*/
|
||||
public function broadcastOn()
|
||||
{
|
||||
|
@ -41,6 +41,8 @@ class DocumentWasArchived
|
||||
* Create a new event instance.
|
||||
*
|
||||
* @param Document $document
|
||||
* @param Company $company
|
||||
* @param array $event_vars
|
||||
*/
|
||||
public function __construct(Document $document, Company $company, array $event_vars)
|
||||
{
|
||||
@ -52,7 +54,7 @@ class DocumentWasArchived
|
||||
/**
|
||||
* Get the channels the event should broadcast on.
|
||||
*
|
||||
* @return \Illuminate\Broadcasting\Channel|array
|
||||
* @return Channel|array
|
||||
*/
|
||||
public function broadcastOn()
|
||||
{
|
||||
|
@ -35,6 +35,8 @@ class DocumentWasCreated
|
||||
* Create a new event instance.
|
||||
*
|
||||
* @param Document $document
|
||||
* @param Company $company
|
||||
* @param array $event_vars
|
||||
*/
|
||||
public function __construct(Document $document, Company $company, array $event_vars)
|
||||
{
|
||||
|
@ -35,6 +35,8 @@ class DocumentWasDeleted
|
||||
* Create a new event instance.
|
||||
*
|
||||
* @param Document $document
|
||||
* @param Company $company
|
||||
* @param array $event_vars
|
||||
*/
|
||||
public function __construct(Document $document, Company $company, array $event_vars)
|
||||
{
|
||||
|
@ -35,6 +35,8 @@ class DocumentWasRestored
|
||||
* Create a new event instance.
|
||||
*
|
||||
* @param Document $document
|
||||
* @param Company $company
|
||||
* @param array $event_vars
|
||||
*/
|
||||
public function __construct(Document $document, Company $company, array $event_vars)
|
||||
{
|
||||
|
@ -35,6 +35,8 @@ class DocumentWasUpdated
|
||||
* Create a new event instance.
|
||||
*
|
||||
* @param Document $document
|
||||
* @param Company $company
|
||||
* @param array $event_vars
|
||||
*/
|
||||
public function __construct(Document $document, Company $company, array $event_vars)
|
||||
{
|
||||
|
@ -35,6 +35,8 @@ class ExpenseWasArchived
|
||||
* Create a new event instance.
|
||||
*
|
||||
* @param Expense $expense
|
||||
* @param Company $company
|
||||
* @param array $event_vars
|
||||
*/
|
||||
public function __construct(Expense $expense, Company $company, array $event_vars)
|
||||
{
|
||||
|
@ -35,6 +35,8 @@ class ExpenseWasCreated
|
||||
* Create a new event instance.
|
||||
*
|
||||
* @param Expense $expense
|
||||
* @param Company $company
|
||||
* @param array $event_vars
|
||||
*/
|
||||
public function __construct(Expense $expense, Company $company, array $event_vars)
|
||||
{
|
||||
|
@ -35,6 +35,8 @@ class ExpenseWasDeleted
|
||||
* Create a new event instance.
|
||||
*
|
||||
* @param Expense $expense
|
||||
* @param Company $company
|
||||
* @param array $event_vars
|
||||
*/
|
||||
public function __construct(Expense $expense, Company $company, array $event_vars)
|
||||
{
|
||||
|
@ -35,6 +35,8 @@ class ExpenseWasRestored
|
||||
* Create a new event instance.
|
||||
*
|
||||
* @param Expense $expense
|
||||
* @param Company $company
|
||||
* @param array $event_vars
|
||||
*/
|
||||
public function __construct(Expense $expense, Company $company, array $event_vars)
|
||||
{
|
||||
|
@ -35,6 +35,8 @@ class ExpenseWasUpdated
|
||||
* Create a new event instance.
|
||||
*
|
||||
* @param Expense $expense
|
||||
* @param Company $company
|
||||
* @param array $event_vars
|
||||
*/
|
||||
public function __construct(Expense $expense, Company $company, array $event_vars)
|
||||
{
|
||||
|
@ -35,6 +35,8 @@ class InvoiceWasArchived
|
||||
* Create a new event instance.
|
||||
*
|
||||
* @param Invoice $invoice
|
||||
* @param Company $company
|
||||
* @param array $event_vars
|
||||
*/
|
||||
public function __construct(Invoice $invoice, Company $company, array $event_vars)
|
||||
{
|
||||
|
@ -35,6 +35,8 @@ class InvoiceWasCancelled
|
||||
* Create a new event instance.
|
||||
*
|
||||
* @param Invoice $invoice
|
||||
* @param Company $company
|
||||
* @param array $event_vars
|
||||
*/
|
||||
public function __construct(Invoice $invoice, Company $company, array $event_vars)
|
||||
{
|
||||
|
@ -35,6 +35,8 @@ class InvoiceWasCreated
|
||||
* Create a new event instance.
|
||||
*
|
||||
* @param Invoice $invoice
|
||||
* @param Company $company
|
||||
* @param array $event_vars
|
||||
*/
|
||||
public function __construct(Invoice $invoice, Company $company, array $event_vars)
|
||||
{
|
||||
|
@ -35,6 +35,8 @@ class InvoiceWasDeleted
|
||||
* Create a new event instance.
|
||||
*
|
||||
* @param Invoice $invoice
|
||||
* @param Company $company
|
||||
* @param array $event_vars
|
||||
*/
|
||||
public function __construct(Invoice $invoice, Company $company, array $event_vars)
|
||||
{
|
||||
|
@ -34,7 +34,9 @@ class InvoiceWasEmailed
|
||||
/**
|
||||
* Create a new event instance.
|
||||
*
|
||||
* @param Invoice $invoice
|
||||
* @param InvoiceInvitation $invitation
|
||||
* @param Company $company
|
||||
* @param array $event_vars
|
||||
*/
|
||||
public function __construct(InvoiceInvitation $invitation, Company $company, array $event_vars)
|
||||
{
|
||||
|
@ -40,6 +40,9 @@ class InvoiceWasEmailedAndFailed
|
||||
* Create a new event instance.
|
||||
*
|
||||
* @param Invoice $invoice
|
||||
* @param Company $company
|
||||
* @param string $errors
|
||||
* @param array $event_vars
|
||||
*/
|
||||
public function __construct(Invoice $invoice, Company $company, string $errors, array $event_vars)
|
||||
{
|
||||
|
@ -35,6 +35,8 @@ class InvoiceWasMarkedSent
|
||||
* Create a new event instance.
|
||||
*
|
||||
* @param Invoice $invoice
|
||||
* @param Company $company
|
||||
* @param array $event_vars
|
||||
*/
|
||||
public function __construct(Invoice $invoice, Company $company, array $event_vars)
|
||||
{
|
||||
|
@ -35,6 +35,8 @@ class InvoiceWasPaid
|
||||
* Create a new event instance.
|
||||
*
|
||||
* @param Invoice $invoice
|
||||
* @param Company $company
|
||||
* @param array $event_vars
|
||||
*/
|
||||
public function __construct(Invoice $invoice, Company $company, array $event_vars)
|
||||
{
|
||||
|
@ -38,6 +38,8 @@ class InvoiceWasRestored
|
||||
*
|
||||
* @param Invoice $invoice
|
||||
* @param $fromDeleted
|
||||
* @param Company $company
|
||||
* @param array $event_vars
|
||||
*/
|
||||
public function __construct(Invoice $invoice, $fromDeleted, Company $company, array $event_vars)
|
||||
{
|
||||
|
@ -35,6 +35,8 @@ class InvoiceWasReversed
|
||||
* Create a new event instance.
|
||||
*
|
||||
* @param Invoice $invoice
|
||||
* @param Company $company
|
||||
* @param array $event_vars
|
||||
*/
|
||||
public function __construct(Invoice $invoice, Company $company, array $event_vars)
|
||||
{
|
||||
|
@ -37,6 +37,8 @@ class InvoiceWasUpdated
|
||||
* Create a new event instance.
|
||||
*
|
||||
* @param Invoice $invoice
|
||||
* @param Company $company
|
||||
* @param array $event_vars
|
||||
*/
|
||||
public function __construct(Invoice $invoice, Company $company, array $event_vars)
|
||||
{
|
||||
|
@ -34,7 +34,9 @@ class InvoiceWasViewed
|
||||
/**
|
||||
* Create a new event instance.
|
||||
*
|
||||
* @param Invoice $invoice
|
||||
* @param InvoiceInvitation $invitation
|
||||
* @param Company $company
|
||||
* @param array $event_vars
|
||||
*/
|
||||
public function __construct(InvoiceInvitation $invitation, Company $company, array $event_vars)
|
||||
{
|
||||
|
@ -35,7 +35,10 @@ class InvitationWasViewed
|
||||
/**
|
||||
* Create a new event instance.
|
||||
*
|
||||
* @param Invoice $invoice
|
||||
* @param $entity
|
||||
* @param $invitation
|
||||
* @param $company
|
||||
* @param $event_vars
|
||||
*/
|
||||
public function __construct($entity, $invitation, $company, $event_vars)
|
||||
{
|
||||
|
@ -38,6 +38,8 @@ class MethodDeleted
|
||||
* Create a new event instance.
|
||||
*
|
||||
* @param ClientGatewayToken $payment_method
|
||||
* @param Company $company
|
||||
* @param array $event_vars
|
||||
*/
|
||||
public function __construct(ClientGatewayToken $payment_method, Company $company, array $event_vars)
|
||||
{
|
||||
@ -49,7 +51,7 @@ class MethodDeleted
|
||||
/**
|
||||
* Get the channels the event should broadcast on.
|
||||
*
|
||||
* @return \Illuminate\Broadcasting\Channel|array
|
||||
* @return Channel|array
|
||||
*/
|
||||
public function broadcastOn()
|
||||
{
|
||||
|
@ -35,6 +35,8 @@ class PaymentCompleted
|
||||
* Create a new event instance.
|
||||
*
|
||||
* @param Payment $payment
|
||||
* @param Company $company
|
||||
* @param array $event_vars
|
||||
*/
|
||||
public function __construct(Payment $payment, Company $company, array $event_vars)
|
||||
{
|
||||
|
@ -35,6 +35,8 @@ class PaymentFailed
|
||||
* Create a new event instance.
|
||||
*
|
||||
* @param Payment $payment
|
||||
* @param Company $company
|
||||
* @param array $event_vars
|
||||
*/
|
||||
public function __construct(Payment $payment, Company $company, array $event_vars)
|
||||
{
|
||||
|
@ -35,6 +35,8 @@ class PaymentWasArchived
|
||||
* Create a new event instance.
|
||||
*
|
||||
* @param Payment $payment
|
||||
* @param Company $company
|
||||
* @param array $event_vars
|
||||
*/
|
||||
public function __construct(Payment $payment, Company $company, array $event_vars)
|
||||
{
|
||||
|
@ -35,6 +35,8 @@ class PaymentWasCreated
|
||||
* Create a new event instance.
|
||||
*
|
||||
* @param Payment $payment
|
||||
* @param Company $company
|
||||
* @param array $event_vars
|
||||
*/
|
||||
public function __construct(Payment $payment, Company $company, array $event_vars)
|
||||
{
|
||||
|
@ -35,6 +35,8 @@ class PaymentWasDeleted
|
||||
* Create a new event instance.
|
||||
*
|
||||
* @param Payment $payment
|
||||
* @param Company $company
|
||||
* @param array $event_vars
|
||||
*/
|
||||
public function __construct(Payment $payment, Company $company, array $event_vars)
|
||||
{
|
||||
|
@ -35,6 +35,8 @@ class PaymentWasEmailed
|
||||
* Create a new event instance.
|
||||
*
|
||||
* @param Payment $payment
|
||||
* @param Company $company
|
||||
* @param array $event_vars
|
||||
*/
|
||||
public function __construct(Payment $payment, Company $company, array $event_vars)
|
||||
{
|
||||
|
@ -35,7 +35,9 @@ class PaymentWasEmailedAndFailed
|
||||
/**
|
||||
* PaymentWasEmailedAndFailed constructor.
|
||||
* @param Payment $payment
|
||||
* @param $company
|
||||
* @param array $errors
|
||||
* @param array $event_vars
|
||||
*/
|
||||
public function __construct(Payment $payment, $company, array $errors, array $event_vars)
|
||||
{
|
||||
|
@ -37,7 +37,9 @@ class PaymentWasRefunded
|
||||
* Create a new event instance.
|
||||
*
|
||||
* @param Payment $payment
|
||||
* @param $refund_amount
|
||||
* @param float $refund_amount
|
||||
* @param Company $company
|
||||
* @param array $event_vars
|
||||
*/
|
||||
public function __construct(Payment $payment, float $refund_amount, Company $company, array $event_vars)
|
||||
{
|
||||
|
@ -35,6 +35,8 @@ class PaymentWasRestored
|
||||
*
|
||||
* @param Payment $payment
|
||||
* @param $fromDeleted
|
||||
* @param Company $company
|
||||
* @param array $event_vars
|
||||
*/
|
||||
public function __construct(Payment $payment, $fromDeleted, Company $company, array $event_vars)
|
||||
{
|
||||
|
@ -35,6 +35,8 @@ class PaymentWasUpdated
|
||||
* Create a new event instance.
|
||||
*
|
||||
* @param Payment $payment
|
||||
* @param Company $company
|
||||
* @param array $event_vars
|
||||
*/
|
||||
public function __construct(Payment $payment, Company $company, array $event_vars)
|
||||
{
|
||||
|
@ -35,6 +35,8 @@ class PaymentWasVoided
|
||||
* Create a new event instance.
|
||||
*
|
||||
* @param Payment $payment
|
||||
* @param Company $company
|
||||
* @param array $event_vars
|
||||
*/
|
||||
public function __construct(Payment $payment, Company $company, array $event_vars)
|
||||
{
|
||||
|
@ -30,7 +30,9 @@ class ProductWasArchived
|
||||
/**
|
||||
* Create a new event instance.
|
||||
*
|
||||
* @return void
|
||||
* @param Product $product
|
||||
* @param Company $company
|
||||
* @param array $event_vars
|
||||
*/
|
||||
public function __construct(Product $product, Company $company, array $event_vars)
|
||||
{
|
||||
|
@ -33,7 +33,10 @@ class ProductWasCreated
|
||||
/**
|
||||
* Create a new event instance.
|
||||
*
|
||||
* @return void
|
||||
* @param Product $product
|
||||
* @param $input
|
||||
* @param Company $company
|
||||
* @param array $event_vars
|
||||
*/
|
||||
public function __construct(Product $product, $input, Company $company, array $event_vars)
|
||||
{
|
||||
|
@ -31,7 +31,9 @@ class ProductWasDeleted
|
||||
/**
|
||||
* Create a new event instance.
|
||||
*
|
||||
* @return void
|
||||
* @param Product $product
|
||||
* @param Company $company
|
||||
* @param array $event_vars
|
||||
*/
|
||||
public function __construct(Product $product, Company $company, array $event_vars)
|
||||
{
|
||||
|
@ -30,7 +30,9 @@ class ProductWasUpdated
|
||||
/**
|
||||
* Create a new event instance.
|
||||
*
|
||||
* @return void
|
||||
* @param Product $product
|
||||
* @param Company $company
|
||||
* @param array $event_vars
|
||||
*/
|
||||
public function __construct(Product $product, Company $company, array $event_vars)
|
||||
{
|
||||
|
@ -37,7 +37,10 @@ class QuoteWasApproved
|
||||
/**
|
||||
* Create a new event instance.
|
||||
*
|
||||
* @return void
|
||||
* @param ClientContact $contact
|
||||
* @param Quote $quote
|
||||
* @param Company $company
|
||||
* @param array $event_vars
|
||||
*/
|
||||
public function __construct(ClientContact $contact, Quote $quote, Company $company, array $event_vars)
|
||||
{
|
||||
|
@ -27,7 +27,9 @@ class QuoteWasArchived
|
||||
/**
|
||||
* Create a new event instance.
|
||||
*
|
||||
* @return void
|
||||
* @param Quote $quote
|
||||
* @param Company $company
|
||||
* @param array $event_vars
|
||||
*/
|
||||
public function __construct(Quote $quote, Company $company, array $event_vars)
|
||||
{
|
||||
|
@ -30,7 +30,9 @@ class QuoteWasCreated
|
||||
/**
|
||||
* Create a new event instance.
|
||||
*
|
||||
* @return void
|
||||
* @param Quote $quote
|
||||
* @param Company $company
|
||||
* @param array $event_vars
|
||||
*/
|
||||
public function __construct(Quote $quote, Company $company, array $event_vars)
|
||||
{
|
||||
|
@ -30,7 +30,9 @@ class QuoteWasDeleted
|
||||
/**
|
||||
* Create a new event instance.
|
||||
*
|
||||
* @return void
|
||||
* @param Quote $quote
|
||||
* @param Company $company
|
||||
* @param array $event_vars
|
||||
*/
|
||||
public function __construct(Quote $quote, Company $company, array $event_vars)
|
||||
{
|
||||
|
@ -33,7 +33,10 @@ class QuoteWasEmailed
|
||||
/**
|
||||
* Create a new event instance.
|
||||
*
|
||||
* @param $quote
|
||||
* @param Quote $quote
|
||||
* @param string $notes
|
||||
* @param Company $company
|
||||
* @param array $event_vars
|
||||
*/
|
||||
public function __construct(Quote $quote, string $notes, Company $company, array $event_vars)
|
||||
{
|
||||
|
@ -37,6 +37,8 @@ class QuoteWasEmailedAndFailed
|
||||
* QuoteWasEmailedAndFailed constructor.
|
||||
* @param Quote $quote
|
||||
* @param array $errors
|
||||
* @param Company $company
|
||||
* @param array $event_vars
|
||||
*/
|
||||
public function __construct(Quote $quote, array $errors, Company $company, array $event_vars)
|
||||
{
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user