mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-05-24 02:14:21 -04:00
Working on Setup workflow (#3509)
* Refactor designs to remove whitespace * enable dummy data for templating * Insert faker data into templates * Fixes for user deletion * Documentation on User controller: * Working on app setup * Files for app setup * Working on Setup * Final fixes for setup controller * Fixes for setup * Fixes for first install * Minor fixes
This commit is contained in:
parent
115281be87
commit
4c23d43138
@ -39,6 +39,8 @@ MAIL_PORT=2525
|
||||
MAIL_USERNAME=null
|
||||
MAIL_PASSWORD=null
|
||||
MAIL_ENCRYPTION=null
|
||||
MAIL_FROM_ADDRESS='user@example.com'
|
||||
MAIL_FROM_NAME='Self Hosted User'
|
||||
|
||||
POSTMARK_API_TOKEN=
|
||||
|
||||
@ -46,4 +48,5 @@ GOOGLE_MAPS_API_KEY=
|
||||
API_SECRET=superdoopersecrethere
|
||||
ERROR_EMAIL=
|
||||
|
||||
NINJA_ENVIRONMENT=selfhost
|
||||
NINJA_ENVIRONMENT=selfhost
|
||||
HASH_SALT=
|
@ -9,7 +9,6 @@ use App\Models\Company;
|
||||
use App\Models\CompanyToken;
|
||||
use App\Models\User;
|
||||
use App\Utils\Traits\MakesHash;
|
||||
use Faker\Factory;
|
||||
use Illuminate\Console\Command;
|
||||
|
||||
class ImportMigrations extends Command
|
||||
@ -41,7 +40,8 @@ class ImportMigrations extends Command
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->faker = Factory::create();
|
||||
|
||||
$this->faker = \Faker\Factory::create();
|
||||
|
||||
parent::__construct();
|
||||
}
|
||||
|
@ -38,7 +38,7 @@ class Kernel extends ConsoleKernel
|
||||
// $schedule->command('inspire')
|
||||
// ->hourly();
|
||||
|
||||
$schedule->job(new RecurringInvoicesCron)->hourly();
|
||||
//$schedule->job(new RecurringInvoicesCron)->hourly();
|
||||
$schedule->job(new VersionCheck)->daily();
|
||||
}
|
||||
|
||||
|
@ -19,82 +19,73 @@ class Bold extends AbstractDesign
|
||||
|
||||
public function includes()
|
||||
{
|
||||
return '
|
||||
<head>
|
||||
<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:1.5rem; 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;}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
';
|
||||
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:1.5rem; 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;}
|
||||
</style>';
|
||||
}
|
||||
|
||||
public function header() {
|
||||
|
||||
return '
|
||||
<div class="flex static bg-gray-800 p-12">
|
||||
<div class="w-1/2">
|
||||
<div class="absolute bg-white pt-10 px-10 pb-4 inline-block align-middle">
|
||||
$company_logo
|
||||
</div>
|
||||
</div>
|
||||
<div class="w-1/2 flex">
|
||||
<div class="w-64 flex flex-col text-white">
|
||||
$company_details
|
||||
</div>
|
||||
<div class="flex flex-col text-white">
|
||||
$company_address
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
';
|
||||
return '<div class="flex static bg-gray-800 p-12">
|
||||
<div class="w-1/2">
|
||||
<div class="absolute bg-white pt-10 px-10 pb-4 inline-block align-middle">
|
||||
$company_logo
|
||||
</div>
|
||||
</div>
|
||||
<div class="w-1/2 flex">
|
||||
<div class="w-64 flex flex-col text-white">
|
||||
$company_details
|
||||
</div>
|
||||
<div class="flex flex-col text-white">
|
||||
$company_address
|
||||
</div>
|
||||
</div>
|
||||
</div>';
|
||||
|
||||
}
|
||||
|
||||
public function body() {
|
||||
|
||||
return '
|
||||
<div class="flex mt-32 pl-12">
|
||||
<div class="w-1/2 mr-40 flex flex-col">
|
||||
<h2 class="text-2xl uppercase font-semibold text-teal-600 tracking-tight">$entity_label</h2> $client_details
|
||||
</div>
|
||||
<div class="w-1/2">
|
||||
<div class="w-full bg-teal-600 px-5 py-3 text-white flex">
|
||||
<div class="w-48 flex flex-col text-white">
|
||||
$entity_labels
|
||||
</div>
|
||||
<div class="w-32 flex flex-col text-white">
|
||||
$entity_details
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
return '<div class="flex mt-32 pl-12">
|
||||
<div class="w-1/2 mr-40 flex flex-col">
|
||||
<h2 class="text-2xl uppercase font-semibold text-teal-600 tracking-tight">$entity_label</h2> $client_details
|
||||
</div>
|
||||
<div class="w-1/2">
|
||||
<div class="w-full bg-teal-600 px-5 py-3 text-white flex">
|
||||
<div class="w-48 flex flex-col text-white">
|
||||
$entity_labels
|
||||
</div>
|
||||
<table class="w-full table-auto mt-8">
|
||||
<thead class="text-left">
|
||||
$product_table_header
|
||||
</thead>
|
||||
<tbody>
|
||||
$product_table_body
|
||||
</tbody>
|
||||
</table>
|
||||
<table class="w-full table-auto mt-8">
|
||||
<thead class="text-left">
|
||||
$task_table_header
|
||||
</thead>
|
||||
<tbody>
|
||||
$task_table_body
|
||||
</tbody>
|
||||
</table>
|
||||
';
|
||||
<div class="w-32 flex flex-col text-white">
|
||||
$entity_details
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<table class="w-full table-auto mt-8">
|
||||
<thead class="text-left">
|
||||
$product_table_header
|
||||
</thead>
|
||||
<tbody>
|
||||
$product_table_body
|
||||
</tbody>
|
||||
</table>
|
||||
<table class="w-full table-auto mt-8">
|
||||
<thead class="text-left">
|
||||
$task_table_header
|
||||
</thead>
|
||||
<tbody>
|
||||
$task_table_body
|
||||
</tbody>
|
||||
</table>';
|
||||
|
||||
}
|
||||
|
||||
@ -108,36 +99,34 @@ class Bold extends AbstractDesign
|
||||
|
||||
public function footer() {
|
||||
|
||||
return '
|
||||
<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>
|
||||
return '<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">
|
||||
<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 class="text-2xl font-semibold">$balance_due_label</span>
|
||||
</div>
|
||||
<div class="w-1/2 text-right flex flex-col">
|
||||
<span class="text-2xl text-teal-600 font-semibold">$balance_due</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
';
|
||||
<div class="flex px-4 mt-4 w-full items-end px-12">
|
||||
<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 class="text-2xl font-semibold">$balance_due_label</span>
|
||||
</div>
|
||||
<div class="w-1/2 text-right flex flex-col">
|
||||
<span class="text-2xl text-teal-600 font-semibold">$balance_due</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>';
|
||||
|
||||
}
|
||||
|
||||
|
@ -20,98 +20,89 @@ class Business extends AbstractDesign
|
||||
|
||||
public function includes()
|
||||
{
|
||||
return '
|
||||
<head>
|
||||
<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">
|
||||
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: #edf2f7; }
|
||||
<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: #edf2f7; }
|
||||
|
||||
</style>
|
||||
</head>
|
||||
|
||||
';
|
||||
</style>';
|
||||
}
|
||||
|
||||
public function header()
|
||||
{
|
||||
|
||||
return '
|
||||
<div class="my-16 mx-10">
|
||||
<div class="flex justify-between">
|
||||
<div class="w-1/2">
|
||||
$company_logo
|
||||
</div>
|
||||
<div class="w-1/2 flex justify-end">
|
||||
<div class="flex flex-col text-gray-600">
|
||||
$company_details
|
||||
</div>
|
||||
<div class="flex flex-col text-gray-600 ml-8">
|
||||
$company_address
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
';
|
||||
return '<div class="my-16 mx-10">
|
||||
<div class="flex justify-between">
|
||||
<div class="w-1/2">
|
||||
$company_logo
|
||||
</div>
|
||||
<div class="w-1/2 flex justify-end">
|
||||
<div class="flex flex-col text-gray-600">
|
||||
$company_details
|
||||
</div>
|
||||
<div class="flex flex-col text-gray-600 ml-8">
|
||||
$company_address
|
||||
</div>
|
||||
</div>
|
||||
</div>';
|
||||
|
||||
}
|
||||
|
||||
public function body()
|
||||
{
|
||||
|
||||
return '
|
||||
<div class="flex items-center justify-between mt-20">
|
||||
<div class="w-1/2 flex flex-col">
|
||||
<span>$entity_label</span>
|
||||
<section class="flex flex-col text-orange-600 mt-2">
|
||||
$client_details
|
||||
</section>
|
||||
</div>
|
||||
<div class="w-1/2 ml-40 bg-orange-600 px-4 py-4 h-auto rounded-lg">
|
||||
<div class="flex text-white">
|
||||
<section class="w-1/2 flex flex-col">
|
||||
$entity_labels
|
||||
</section>
|
||||
<section class="flex flex-col">
|
||||
$entity_details
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<table class="w-full table-auto mt-20">
|
||||
<thead class="text-left">
|
||||
$product_table_header
|
||||
</thead>
|
||||
<tbody>
|
||||
$product_table_body
|
||||
</tbody>
|
||||
</table>
|
||||
<table class="w-full table-auto mt-20">
|
||||
<thead class="text-left">
|
||||
$task_table_header
|
||||
</thead>
|
||||
<tbody>
|
||||
$task_table_body
|
||||
</tbody>
|
||||
</table>
|
||||
';
|
||||
return '<div class="flex items-center justify-between mt-20">
|
||||
<div class="w-1/2 flex flex-col">
|
||||
<span>$entity_label</span>
|
||||
<section class="flex flex-col text-orange-600 mt-2">
|
||||
$client_details
|
||||
</section>
|
||||
</div>
|
||||
<div class="w-1/2 ml-40 bg-orange-600 px-4 py-4 h-auto rounded-lg">
|
||||
<div class="flex text-white">
|
||||
<section class="w-1/2 flex flex-col">
|
||||
$entity_labels
|
||||
</section>
|
||||
<section class="flex flex-col">
|
||||
$entity_details
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<table class="w-full table-auto mt-20">
|
||||
<thead class="text-left">
|
||||
$product_table_header
|
||||
</thead>
|
||||
<tbody>
|
||||
$product_table_body
|
||||
</tbody>
|
||||
</table>
|
||||
<table class="w-full table-auto mt-20">
|
||||
<thead class="text-left">
|
||||
$task_table_header
|
||||
</thead>
|
||||
<tbody>
|
||||
$task_table_body
|
||||
</tbody>
|
||||
</table>';
|
||||
|
||||
}
|
||||
|
||||
@ -128,46 +119,44 @@ class Business extends AbstractDesign
|
||||
public function footer()
|
||||
{
|
||||
|
||||
return '
|
||||
<div class="flex items-center justify-between px-4 pb-4 bg-gray-200 rounded py-2">
|
||||
<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 bg-blue-900 px-4 py-3 rounded text-white">
|
||||
<p class="w-1/2">$balance_due_label</p>
|
||||
<p class="text-right w-1/2">$balance_due</p>
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
';
|
||||
return '<div class="flex items-center justify-between px-4 pb-4 bg-gray-200 rounded py-2">
|
||||
<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 bg-blue-900 px-4 py-3 rounded text-white">
|
||||
<p class="w-1/2">$balance_due_label</p>
|
||||
<p class="text-right w-1/2">$balance_due</p>
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>';
|
||||
|
||||
}
|
||||
|
||||
|
@ -20,89 +20,81 @@ class Clean extends AbstractDesign
|
||||
|
||||
public function includes()
|
||||
{
|
||||
return '
|
||||
<head>
|
||||
<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;}
|
||||
</style>
|
||||
</head>
|
||||
';
|
||||
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;}
|
||||
</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">
|
||||
$company_details
|
||||
</div>
|
||||
<div class="ml-5 text-gray-600 flex flex-col">
|
||||
$company_address
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
';
|
||||
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">
|
||||
$company_details
|
||||
</div>
|
||||
<div class="ml-5 text-gray-600 flex flex-col">
|
||||
$company_address
|
||||
</div>
|
||||
</div>
|
||||
</div>';
|
||||
}
|
||||
|
||||
public function body() {
|
||||
|
||||
return '
|
||||
<h1 class="mt-12 uppercase text-2xl text-blue-500 ml-4">
|
||||
$entity_label
|
||||
</h1>
|
||||
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="border-b border-gray-400"></div>
|
||||
|
||||
<div class="ml-4 py-4">
|
||||
<div class="flex">
|
||||
<div class="w-40 flex flex-col">
|
||||
$entity_labels
|
||||
</div>
|
||||
<div class="w-48 flex flex-col">
|
||||
$entity_details
|
||||
</div>
|
||||
<div class="w-56 flex flex-col">
|
||||
$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>
|
||||
$product_table_body
|
||||
</tbody>
|
||||
</table>
|
||||
<table class="w-full table-auto mt-8">
|
||||
<thead class="text-left">
|
||||
$task_table_header
|
||||
</thead>
|
||||
<tbody>
|
||||
$task_table_body
|
||||
</tbody>
|
||||
</table>
|
||||
';
|
||||
<div class="ml-4 py-4">
|
||||
<div class="flex">
|
||||
<div class="w-40 flex flex-col">
|
||||
$entity_labels
|
||||
</div>
|
||||
<div class="w-48 flex flex-col">
|
||||
$entity_details
|
||||
</div>
|
||||
<div class="w-56 flex flex-col">
|
||||
$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>
|
||||
$product_table_body
|
||||
</tbody>
|
||||
</table>
|
||||
<table class="w-full table-auto mt-8">
|
||||
<thead class="text-left">
|
||||
$task_table_header
|
||||
</thead>
|
||||
<tbody>
|
||||
$task_table_body
|
||||
</tbody>
|
||||
</table>';
|
||||
|
||||
}
|
||||
|
||||
@ -118,42 +110,41 @@ class Clean extends AbstractDesign
|
||||
|
||||
public function footer() {
|
||||
|
||||
return '
|
||||
<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>
|
||||
return '<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>
|
||||
</body>
|
||||
</html>';
|
||||
<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>
|
||||
</body>
|
||||
</html>';
|
||||
|
||||
}
|
||||
|
||||
|
@ -23,87 +23,77 @@ class Creative extends AbstractDesign
|
||||
|
||||
public function includes()
|
||||
{
|
||||
return '
|
||||
<head>
|
||||
<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">
|
||||
</head>
|
||||
<body>
|
||||
<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; padding: 1.25rem 1rem; font-weight: 500 }
|
||||
.table_body_td_class { padding: 1rem;}
|
||||
</style>
|
||||
|
||||
';
|
||||
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; padding: 1.25rem 1rem; font-weight: 500 }
|
||||
.table_body_td_class { padding: 1rem;}
|
||||
</style>';
|
||||
}
|
||||
|
||||
|
||||
public function header() {
|
||||
|
||||
return '
|
||||
<div class="py-16 mx-16">
|
||||
<div class="flex justify-between">
|
||||
<div class="w-2/3 flex">
|
||||
<div class="flex flex-col">
|
||||
$client_details
|
||||
</div>
|
||||
<div class="ml-6 flex flex-col">
|
||||
$company_details
|
||||
</div>
|
||||
<div class="ml-6 flex flex-col mr-4">
|
||||
$company_address
|
||||
</div>
|
||||
</div>
|
||||
$company_logo
|
||||
</div>
|
||||
';
|
||||
return '<div class="py-16 mx-16">
|
||||
<div class="flex justify-between">
|
||||
<div class="w-2/3 flex">
|
||||
<div class="flex flex-col">
|
||||
$client_details
|
||||
</div>
|
||||
<div class="ml-6 flex flex-col">
|
||||
$company_details
|
||||
</div>
|
||||
<div class="ml-6 flex flex-col mr-4">
|
||||
$company_address
|
||||
</div>
|
||||
</div>
|
||||
$company_logo
|
||||
</div>';
|
||||
|
||||
}
|
||||
|
||||
public function body() {
|
||||
|
||||
return '
|
||||
<div class="flex justify-between mt-8">
|
||||
<div class="w-2/3 flex flex-col">
|
||||
<h1 class="text-5xl uppercase font-semibold">$entity_label</h1>
|
||||
<i class="ml-4 text-5xl text-pink-700">$entity_number</i>
|
||||
</div>
|
||||
<div class="flex">
|
||||
<div class="flex justify-between flex-col">
|
||||
$entity_labels
|
||||
</div>
|
||||
<div class="flex flex-col text-right">
|
||||
$entity_details
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<table class="w-full table-auto mt-12 border-t-4 border-pink-700 bg-white">
|
||||
<thead class="text-left rounded-lg">
|
||||
$product_table_header
|
||||
</thead>
|
||||
<tbody>
|
||||
$product_table_body
|
||||
</tbody>
|
||||
</table>
|
||||
<table class="w-full table-auto mt-12 border-t-4 border-pink-700 bg-white">
|
||||
<thead class="text-left rounded-lg">
|
||||
$task_table_header
|
||||
</thead>
|
||||
<tbody>
|
||||
$task_table_body
|
||||
</tbody>
|
||||
</table>
|
||||
';
|
||||
return '<div class="flex justify-between mt-8">
|
||||
<div class="w-2/3 flex flex-col">
|
||||
<h1 class="text-5xl uppercase font-semibold">$entity_label</h1>
|
||||
<i class="ml-4 text-5xl text-pink-700">$entity_number</i>
|
||||
</div>
|
||||
<div class="flex">
|
||||
<div class="flex justify-between flex-col">
|
||||
$entity_labels
|
||||
</div>
|
||||
<div class="flex flex-col text-right">
|
||||
$entity_details
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<table class="w-full table-auto mt-12 border-t-4 border-pink-700 bg-white">
|
||||
<thead class="text-left rounded-lg">
|
||||
$product_table_header
|
||||
</thead>
|
||||
<tbody>
|
||||
$product_table_body
|
||||
</tbody>
|
||||
</table>
|
||||
<table class="w-full table-auto mt-12 border-t-4 border-pink-700 bg-white">
|
||||
<thead class="text-left rounded-lg">
|
||||
$task_table_header
|
||||
</thead>
|
||||
<tbody>
|
||||
$task_table_body
|
||||
</tbody>
|
||||
</table>';
|
||||
}
|
||||
|
||||
public function task() {
|
||||
@ -118,47 +108,44 @@ class Creative extends AbstractDesign
|
||||
|
||||
public function footer() {
|
||||
|
||||
return '
|
||||
<div class="border-b-4 border-pink-700">
|
||||
<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">
|
||||
<span>$subtotal_label</span>
|
||||
<span>$discount_label</span>
|
||||
<span>$paid_to_date_label</span>
|
||||
</section>
|
||||
<section class="w-1/2 text-right flex flex-col">
|
||||
<span>$subtotal</span>
|
||||
<span>$discount</span>
|
||||
<span>$paid_to_date</span>
|
||||
</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>N21</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
return '<div class="border-b-4 border-pink-700">
|
||||
<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 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>
|
||||
<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">
|
||||
<span>$subtotal_label</span>
|
||||
<span>$discount_label</span>
|
||||
<span>$paid_to_date_label</span>
|
||||
</section>
|
||||
<section class="w-1/2 text-right flex flex-col">
|
||||
<span>$subtotal</span>
|
||||
<span>$discount</span>
|
||||
<span>$paid_to_date</span>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>';
|
||||
</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>
|
||||
</body>
|
||||
</html>';
|
||||
|
||||
}
|
||||
|
||||
|
@ -20,82 +20,74 @@ class Elegant extends AbstractDesign
|
||||
|
||||
public function includes()
|
||||
{
|
||||
return '
|
||||
<head>
|
||||
<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; }
|
||||
</style>
|
||||
</head>
|
||||
';
|
||||
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; }
|
||||
</style>';
|
||||
}
|
||||
|
||||
|
||||
public function header() {
|
||||
|
||||
return '
|
||||
<div class="py-16 px-8">
|
||||
<div class="flex flex justify-between border-b-4 border-black">
|
||||
<div style="margin-bottom: 15px">
|
||||
$company_logo
|
||||
</div>
|
||||
<div class="flex">
|
||||
<div class="flex flex-col mr-5">
|
||||
$entity_labels
|
||||
</div>
|
||||
<div class="flex flex-col text-right">
|
||||
$entity_details
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="p-px border-b border-black mt-1"></div>
|
||||
';
|
||||
return '<div class="py-16 px-8">
|
||||
<div class="flex flex justify-between border-b-4 border-black">
|
||||
<div style="margin-bottom: 15px">
|
||||
$company_logo
|
||||
</div>
|
||||
<div class="flex">
|
||||
<div class="flex flex-col mr-5">
|
||||
$entity_labels
|
||||
</div>
|
||||
<div class="flex flex-col text-right">
|
||||
$entity_details
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="p-px border-b border-black mt-1"></div>';
|
||||
|
||||
}
|
||||
|
||||
public function body() {
|
||||
|
||||
return '
|
||||
<div class="flex mt-8">
|
||||
<div class="w-1/3 mr-6 flex flex-col pr-2 border-r border-dashed border-black">
|
||||
$client_details
|
||||
</div>
|
||||
<div class="flex flex-col mr-6">
|
||||
$company_details
|
||||
</div>
|
||||
<div class="flex flex-col">
|
||||
$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>
|
||||
$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">
|
||||
$product_table_header
|
||||
</thead>
|
||||
<tbody>
|
||||
$product_table_body
|
||||
</tbody>
|
||||
</table>
|
||||
';
|
||||
return '<div class="flex mt-8">
|
||||
<div class="w-1/3 mr-6 flex flex-col pr-2 border-r border-dashed border-black">
|
||||
$client_details
|
||||
</div>
|
||||
<div class="flex flex-col mr-6">
|
||||
$company_details
|
||||
</div>
|
||||
<div class="flex flex-col">
|
||||
$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>
|
||||
$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">
|
||||
$product_table_header
|
||||
</thead>
|
||||
<tbody>
|
||||
$product_table_body
|
||||
</tbody>
|
||||
</table>';
|
||||
|
||||
}
|
||||
|
||||
@ -110,47 +102,46 @@ class Elegant extends AbstractDesign
|
||||
|
||||
public function footer() {
|
||||
|
||||
return '
|
||||
<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>';
|
||||
return '<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>';
|
||||
|
||||
}
|
||||
|
||||
|
@ -20,96 +20,88 @@ class Hipster extends AbstractDesign
|
||||
|
||||
public function includes()
|
||||
{
|
||||
return '
|
||||
<head>
|
||||
<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;
|
||||
}
|
||||
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; }
|
||||
</style>
|
||||
</head>
|
||||
';
|
||||
.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; }
|
||||
</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">
|
||||
$company_details
|
||||
</div>
|
||||
<div class="flex flex-col">
|
||||
$company_address
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="w-1/3 border-l pl-4 border-black flex flex-col">
|
||||
<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>
|
||||
';
|
||||
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">
|
||||
$company_details
|
||||
</div>
|
||||
<div class="flex flex-col">
|
||||
$company_address
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="w-1/3 border-l pl-4 border-black flex flex-col">
|
||||
<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>
|
||||
$product_table_body
|
||||
</tbody>
|
||||
</table>
|
||||
<table class="w-full table-auto mt-24">
|
||||
<thead class="text-left">
|
||||
$task_table_header
|
||||
</thead>
|
||||
<tbody>
|
||||
$task_table_body
|
||||
</tbody>
|
||||
</table>
|
||||
';
|
||||
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>
|
||||
$product_table_body
|
||||
</tbody>
|
||||
</table>
|
||||
<table class="w-full table-auto mt-24">
|
||||
<thead class="text-left">
|
||||
$task_table_header
|
||||
</thead>
|
||||
<tbody>
|
||||
$task_table_body
|
||||
</tbody>
|
||||
</table>';
|
||||
|
||||
}
|
||||
|
||||
@ -124,39 +116,38 @@ class Hipster extends AbstractDesign
|
||||
|
||||
public function footer() {
|
||||
|
||||
return '
|
||||
<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>
|
||||
</body>
|
||||
</html>';
|
||||
return '<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>
|
||||
</body>
|
||||
</html>';
|
||||
|
||||
}
|
||||
|
||||
|
@ -20,105 +20,98 @@ class Modern extends AbstractDesign
|
||||
|
||||
public function includes()
|
||||
{
|
||||
return '
|
||||
<head>
|
||||
<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;}
|
||||
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;}
|
||||
|
||||
@media screen {
|
||||
div.div_header {
|
||||
display: flex;
|
||||
}
|
||||
div.div_footer {
|
||||
display: flex;
|
||||
}
|
||||
}
|
||||
@media print {
|
||||
div.div_footer {
|
||||
display: flex;
|
||||
position: running(footer);
|
||||
width: 100%;
|
||||
}
|
||||
div.div_header {
|
||||
display: flex;
|
||||
position: running(header);
|
||||
width:100%;
|
||||
}
|
||||
}
|
||||
@media screen {
|
||||
div.div_header {
|
||||
display: flex;
|
||||
}
|
||||
div.div_footer {
|
||||
display: flex;
|
||||
}
|
||||
}
|
||||
@media print {
|
||||
div.div_footer {
|
||||
display: flex;
|
||||
position: running(footer);
|
||||
width: 100%;
|
||||
}
|
||||
div.div_header {
|
||||
display: flex;
|
||||
position: running(header);
|
||||
width:100%;
|
||||
}
|
||||
}
|
||||
|
||||
footer, header, hgroup, menu, nav, section {
|
||||
display: block;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
';
|
||||
footer, header, hgroup, menu, nav, section {
|
||||
display: block;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>';
|
||||
}
|
||||
|
||||
|
||||
public function header() {
|
||||
|
||||
return '
|
||||
<div class="div_header bg-orange-600 flex justify-between py-12 px-12" style="page-break-inside: avoid;">
|
||||
<div class="w-1/2">
|
||||
<h1 class="text-white font-bold text-5xl">$company.name</h1>
|
||||
</div>
|
||||
<div class="w-1/2 flex justify-end">
|
||||
<div class="w-56 flex flex-col text-white">
|
||||
$entity_labels
|
||||
</div>
|
||||
<div class="w-32 flex flex-col text-left text-white">
|
||||
$entity_details
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
';
|
||||
return '<div class="div_header bg-orange-600 flex justify-between py-12 px-12" style="page-break-inside: avoid;">
|
||||
<div class="w-1/2">
|
||||
<h1 class="text-white font-bold text-5xl">$company.name</h1>
|
||||
</div>
|
||||
<div class="w-1/2 flex justify-end">
|
||||
<div class="w-56 flex flex-col text-white">
|
||||
$entity_labels
|
||||
</div>
|
||||
<div class="w-32 flex flex-col text-left text-white">
|
||||
$entity_details
|
||||
</div>
|
||||
</div>
|
||||
</div>';
|
||||
|
||||
}
|
||||
|
||||
public function body() {
|
||||
|
||||
return '
|
||||
<section>
|
||||
<div class="flex justify-between px-12 pt-12">
|
||||
<div class="w-1/2">
|
||||
$company_logo
|
||||
</div>
|
||||
<div class="w-1/2 flex justify-end">
|
||||
<div class="w-56 flex flex-col">
|
||||
$client_details
|
||||
</div>
|
||||
<div class="w-32">
|
||||
<!-- -->
|
||||
</div>
|
||||
</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>
|
||||
$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>
|
||||
$task_table_body
|
||||
</tbody>
|
||||
</table>
|
||||
';
|
||||
return '<section>
|
||||
<div class="flex justify-between px-12 pt-12">
|
||||
<div class="w-1/2">
|
||||
$company_logo
|
||||
</div>
|
||||
<div class="w-1/2 flex justify-end">
|
||||
<div class="w-56 flex flex-col">
|
||||
$client_details
|
||||
</div>
|
||||
<div class="w-32">
|
||||
<!-- -->
|
||||
</div>
|
||||
</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>
|
||||
$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>
|
||||
$task_table_body
|
||||
</tbody>
|
||||
</table>';
|
||||
|
||||
}
|
||||
|
||||
|
@ -20,93 +20,85 @@ class Photo extends AbstractDesign
|
||||
|
||||
public function includes()
|
||||
{
|
||||
return '
|
||||
<head>
|
||||
<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;
|
||||
}
|
||||
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; }
|
||||
</style>
|
||||
</head>
|
||||
';
|
||||
.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; }
|
||||
</style>';
|
||||
}
|
||||
|
||||
|
||||
|
||||
public function header() {
|
||||
|
||||
return '
|
||||
<div class="px-16 py-10">
|
||||
<div class="flex items-center justify-between mt-2s">
|
||||
<div ref="logo">
|
||||
$company_logo
|
||||
</div>
|
||||
<div class="flex">
|
||||
<div class="flex flex-col mr-5">
|
||||
$entity_labels
|
||||
</div>
|
||||
<div class="flex flex-col text-right">
|
||||
$entity_details
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
';
|
||||
return '<div class="px-16 py-10">
|
||||
<div class="flex items-center justify-between mt-2s">
|
||||
<div ref="logo">
|
||||
$company_logo
|
||||
</div>
|
||||
<div class="flex">
|
||||
<div class="flex flex-col mr-5">
|
||||
$entity_labels
|
||||
</div>
|
||||
<div class="flex flex-col text-right">
|
||||
$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">
|
||||
$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">
|
||||
$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>
|
||||
$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>
|
||||
$task_table_body
|
||||
</tbody>
|
||||
</table>
|
||||
';
|
||||
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">
|
||||
$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">
|
||||
$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>
|
||||
$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>
|
||||
$task_table_body
|
||||
</tbody>
|
||||
</table>';
|
||||
|
||||
}
|
||||
|
||||
@ -121,47 +113,46 @@ class Photo extends AbstractDesign
|
||||
|
||||
public function footer() {
|
||||
|
||||
return '
|
||||
<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>
|
||||
return '<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>
|
||||
</body>
|
||||
</html>';
|
||||
</div>
|
||||
</body>
|
||||
</html>';
|
||||
|
||||
}
|
||||
|
||||
|
@ -20,76 +20,68 @@ class Plain extends AbstractDesign
|
||||
|
||||
public function includes()
|
||||
{
|
||||
return '
|
||||
<head>
|
||||
<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 }
|
||||
</style>
|
||||
</head>
|
||||
';
|
||||
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 }
|
||||
</style>';
|
||||
}
|
||||
|
||||
|
||||
public function header() {
|
||||
|
||||
return '
|
||||
<div class="px-12 py-8">
|
||||
<div class="flex justify-between">
|
||||
$company_logo
|
||||
<div class="flex flex-col">
|
||||
$company_details
|
||||
</div>
|
||||
<div class="flex flex-col">
|
||||
<div class="flex px-3">
|
||||
<section class="flex align-end flex-col">
|
||||
$entity_details
|
||||
</section>
|
||||
</div>
|
||||
<section class="flex bg-gray-300 px-3">
|
||||
<p class="w-1/2 mr-4">$balance_due_label</p>
|
||||
<p>$0.00</p>
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
';
|
||||
return ' <div class="px-12 py-8">
|
||||
<div class="flex justify-between">
|
||||
$company_logo
|
||||
<div class="flex flex-col">
|
||||
$company_details
|
||||
</div>
|
||||
<div class="flex flex-col">
|
||||
<div class="flex px-3">
|
||||
<section class="flex align-end flex-col">
|
||||
$entity_details
|
||||
</section>
|
||||
</div>
|
||||
<section class="flex bg-gray-300 px-3">
|
||||
<p class="w-1/2 mr-4">$balance_due_label</p>
|
||||
<p>$0.00</p>
|
||||
</section>
|
||||
</div>
|
||||
</div>';
|
||||
|
||||
}
|
||||
|
||||
public function body() {
|
||||
|
||||
return '
|
||||
<div class="flex flex-col mt-8">
|
||||
$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>
|
||||
';
|
||||
return '<div class="flex flex-col mt-8">
|
||||
$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>';
|
||||
|
||||
}
|
||||
|
||||
@ -104,39 +96,38 @@ class Plain extends AbstractDesign
|
||||
|
||||
public function footer() {
|
||||
|
||||
return '
|
||||
<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-gray-300 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>
|
||||
return '<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-gray-300 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>
|
||||
</body>
|
||||
</html>';
|
||||
</div>
|
||||
</body>
|
||||
</html>';
|
||||
|
||||
}
|
||||
|
||||
|
@ -20,93 +20,86 @@ class Playful extends AbstractDesign
|
||||
|
||||
public function includes()
|
||||
{
|
||||
return '
|
||||
<head>
|
||||
<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; }
|
||||
.table_body_td_class { padding: 1rem; border-bottom-width: 4px; border-style: dashed; border-color: #319795 }
|
||||
</style>
|
||||
</head>
|
||||
';
|
||||
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; }
|
||||
.table_body_td_class { padding: 1rem; border-bottom-width: 4px; border-style: dashed; border-color: #319795 }
|
||||
</style>';
|
||||
}
|
||||
|
||||
|
||||
public function header() {
|
||||
|
||||
return '
|
||||
<div class="my-12 mx-16">
|
||||
<div class="flex items-center justify-between">
|
||||
<div class="w-1/2">
|
||||
$company_logo
|
||||
</div>
|
||||
<div class="bg-teal-600 p-5">
|
||||
<div class="flex">
|
||||
<div class="flex justify-between text-white flex-col mr-8">
|
||||
$entity_labels
|
||||
</div>
|
||||
<div class="flex flex-col text-right text-white">
|
||||
$entity_details
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>';
|
||||
return '<div class="my-12 mx-16">
|
||||
<div class="flex items-center justify-between">
|
||||
<div class="w-1/2">
|
||||
$company_logo
|
||||
</div>
|
||||
<div class="bg-teal-600 p-5">
|
||||
<div class="flex">
|
||||
<div class="flex justify-between text-white flex-col mr-8">
|
||||
$entity_labels
|
||||
</div>
|
||||
<div class="flex flex-col text-right text-white">
|
||||
$entity_details
|
||||
</div>
|
||||
</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">$entity_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">
|
||||
$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">
|
||||
$company_details
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
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">$entity_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">
|
||||
$client_details
|
||||
</section>
|
||||
</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>
|
||||
$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>
|
||||
$task_table_body
|
||||
</tbody>
|
||||
</table>
|
||||
';
|
||||
</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">
|
||||
$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>
|
||||
$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>
|
||||
$task_table_body
|
||||
</tbody>
|
||||
</table>';
|
||||
|
||||
}
|
||||
|
||||
@ -121,47 +114,46 @@ class Playful extends AbstractDesign
|
||||
|
||||
public function footer() {
|
||||
|
||||
return '
|
||||
<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-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>
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
return '<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-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>
|
||||
</section>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</body>
|
||||
</html>';
|
||||
</div>
|
||||
</body>
|
||||
</html>';
|
||||
|
||||
}
|
||||
|
||||
|
@ -17,6 +17,7 @@ use App\Models\User;
|
||||
use App\Transformers\ArraySerializer;
|
||||
use App\Transformers\EntityTransformer;
|
||||
use App\Utils\Statics;
|
||||
use App\Utils\Traits\AppSetup;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use Illuminate\Support\Facades\Request as Input;
|
||||
@ -31,7 +32,7 @@ use League\Fractal\Serializer\JsonApiSerializer;
|
||||
*/
|
||||
class BaseController extends Controller
|
||||
{
|
||||
|
||||
use AppSetup;
|
||||
/**
|
||||
* Passed from the parent when we need to force
|
||||
* includes internally rather than externally via
|
||||
@ -154,7 +155,7 @@ class BaseController extends Controller
|
||||
if ($this->entity_type == Company::class || $this->entity_type == Design::class ) {
|
||||
//no user keys exist on the company table, so we need to skip
|
||||
} elseif ($this->entity_type == User::class) {
|
||||
$query->where('id', '=', auth()->user()->id);
|
||||
//$query->where('id', '=', auth()->user()->id); @todo why?
|
||||
} else {
|
||||
$query->where('user_id', '=', auth()->user()->id);
|
||||
}
|
||||
@ -348,6 +349,11 @@ class BaseController extends Controller
|
||||
|
||||
public function flutterRoute()
|
||||
{
|
||||
return redirect('/index.html');
|
||||
|
||||
if(!$this->checkAppSetup());
|
||||
return redirect('/setup');
|
||||
|
||||
return view('index.index');
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -13,6 +13,7 @@ namespace App\Http\Controllers;
|
||||
|
||||
use App\Models\Account;
|
||||
use App\Utils\CurlUtils;
|
||||
use App\Utils\Ninja;
|
||||
use Illuminate\Foundation\Bus\DispatchesJobs;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
@ -83,11 +84,11 @@ class LicenseController extends BaseController
|
||||
{
|
||||
|
||||
/* Catch claim license requests */
|
||||
if(config('ninja.environment') == 'selfhost' && $request->has('license_key') && $request->has('product_id') )
|
||||
if(config('ninja.environment') == 'selfhost' && $request->has('license_key'))
|
||||
{
|
||||
|
||||
$license_key = $request->input('license_key');
|
||||
$product_id = $request->input('product_id');
|
||||
$product_id = 3;
|
||||
|
||||
$url = config('ninja.license_url') . "/claim_license?license_key={$license_key}&product_id={$product_id}&get_date=true";
|
||||
$data = trim(CurlUtils::get($url));
|
||||
@ -153,4 +154,5 @@ class LicenseController extends BaseController
|
||||
return response()->json($error, 400);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
92
app/Http/Controllers/SetupController.php
Normal file
92
app/Http/Controllers/SetupController.php
Normal file
@ -0,0 +1,92 @@
|
||||
<?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\Http\Controllers;
|
||||
|
||||
use App\Http\Requests\Setup\StoreSetupRequest;
|
||||
use App\Models\Account;
|
||||
use App\Utils\SystemHealth;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Artisan;
|
||||
|
||||
|
||||
/**
|
||||
* Class SetupController
|
||||
*/
|
||||
class SetupController extends Controller
|
||||
{
|
||||
|
||||
public function index()
|
||||
{
|
||||
|
||||
$system_health = SystemHealth::check();
|
||||
|
||||
return view();
|
||||
|
||||
}
|
||||
|
||||
public function doSetup(StoreSetupRequest $request)
|
||||
{
|
||||
|
||||
$_ENV['APP_URL'] = $request->input('url');
|
||||
$_ENV['APP_DEBUG'] = $request->input('debug') ? 'true' : 'false';
|
||||
$_ENV['REQUIRE_HTTPS'] = $request->input('https') ? 'true' : 'false';
|
||||
$_ENV['DB_TYPE'] = 'mysql';
|
||||
$_ENV['DB_HOST1'] = $request->input('host');
|
||||
$_ENV['DB_DATABASE1'] = $request->input('db_username');
|
||||
$_ENV['DB_USERNAME1'] = $request->input('db_password');
|
||||
$_ENV['DB_PASSWORD1'] = $request->input('db_password');
|
||||
$_ENV['MAIL_DRIVER'] = $request->input('mail_driver');
|
||||
$_ENV['MAIL_PORT'] = $request->input('port');
|
||||
$_ENV['MAIL_ENCRYPTION'] = $request->input('encryption');
|
||||
$_ENV['MAIL_HOST'] = $request->input('mail_host');
|
||||
$_ENV['MAIL_USERNAME'] = $request->input('mail_username');
|
||||
$_ENV['MAIL_FROM_NAME'] = $request->input('mail_name');
|
||||
$_ENV['MAIL_FROM_ADDRESS'] = $request->input('mail_address');
|
||||
$_ENV['MAIL_PASSWORD'] = $request->input('mail_password');
|
||||
$_ENV['NINJA_ENVIRONMENT'] = 'selfhost';
|
||||
$_ENV['SELF_UPDATER_REPO_VENDOR'] = 'invoiceninja';
|
||||
$_ENV['SELF_UPDATER_REPO_NAME'] = 'invoiceninja';
|
||||
$_ENV['SELF_UPDATER_USE_BRANCH'] = 'v2';
|
||||
$_ENV['SELF_UPDATER_MAILTO_ADDRESS'] = $request->input('mail_address');
|
||||
$_ENV['SELF_UPDATER_MAILTO_NAME'] = $request->input('mail_name');
|
||||
$_ENV['DB_CONNECTION'] = 'db-ninja-01';
|
||||
$_ENV['APP_DEBUG'] = false;
|
||||
|
||||
$config = '';
|
||||
|
||||
foreach ($_ENV as $key => $val) {
|
||||
if (is_array($val)) {
|
||||
continue;
|
||||
}
|
||||
if (preg_match('/\s/', $val)) {
|
||||
$val = "'{$val}'";
|
||||
}
|
||||
$config .= "{$key}={$val}\n";
|
||||
}
|
||||
|
||||
$filePath = base_path().'/.env';
|
||||
$fp = fopen($filePath, 'w');
|
||||
fwrite($fp, $config);
|
||||
fclose($fp);
|
||||
|
||||
Artisan::call('optimize');
|
||||
Artisan::call('migrate');
|
||||
Artisan::call('db:seed');
|
||||
|
||||
if(Account::count() == 0)
|
||||
$account = CreateAccount::dispatchNow($request->all());
|
||||
|
||||
return view('index.index');
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -12,11 +12,13 @@
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Utils\Traits\MakesHash;
|
||||
use App\Utils\Traits\MakesTemplateData;
|
||||
use League\CommonMark\CommonMarkConverter;
|
||||
|
||||
class TemplateController extends BaseController
|
||||
{
|
||||
use MakesHash;
|
||||
use MakesTemplateData;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
@ -109,8 +111,14 @@ class TemplateController extends BaseController
|
||||
$subject = request()->input('subject') ?: '';
|
||||
$body = request()->input('body') ?: '';
|
||||
|
||||
$labels = $this->makeFakerLabels();
|
||||
$values = $this->makeFakerValues();
|
||||
|
||||
$body = str_replace(array_keys($labels), array_values($labels), $body);
|
||||
$body = str_replace(array_keys($values), array_values($values), $body);
|
||||
|
||||
$converter = new CommonMarkConverter([
|
||||
'html_input' => 'strip',
|
||||
//'html_input' => 'strip',
|
||||
'allow_unsafe_links' => false,
|
||||
]);
|
||||
|
||||
|
@ -501,19 +501,35 @@ class UserController extends BaseController
|
||||
*/
|
||||
public function bulk()
|
||||
{
|
||||
|
||||
$action = request()->input('action');
|
||||
|
||||
$ids = request()->input('ids');
|
||||
|
||||
$users = User::withTrashed()->find($this->transformKeys($ids));
|
||||
|
||||
$users->each(function ($user, $key) use ($action) {
|
||||
/*
|
||||
* In case a user maliciously sends keys which do not belong to them, we push
|
||||
* each user through the Policy sieve and only return users that they
|
||||
* have access to
|
||||
*/
|
||||
|
||||
$return_user_collection = collect();
|
||||
|
||||
$users->each(function ($user, $key) use ($action, $return_user_collection) {
|
||||
|
||||
if (auth()->user()->can('edit', $user)) {
|
||||
$this->user_repo->{$action}($user);
|
||||
|
||||
$user = $this->user_repo->{$action}($user);
|
||||
|
||||
$return_user_collection->push($user->id);
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
return $this->listResponse(User::withTrashed()->whereIn('id', $this->transformKeys($ids)));
|
||||
return $this->listResponse(User::withTrashed()->whereIn('id', $return_user_collection));
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
68
app/Http/Requests/Setup/StoreSetupRequest.php
Normal file
68
app/Http/Requests/Setup/StoreSetupRequest.php
Normal file
@ -0,0 +1,68 @@
|
||||
<?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\Http\Requests\Setup;
|
||||
|
||||
use App\Http\Requests\Request;
|
||||
|
||||
class StoreSetupRequest extends Request
|
||||
{
|
||||
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
|
||||
public function authorize() : bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
/*System*/
|
||||
'url' => 'required',
|
||||
'debug' => 'required',
|
||||
'https' => 'required',
|
||||
/*Database*/
|
||||
'host' => 'required',
|
||||
'database' => 'required',
|
||||
'db_username' => 'required',
|
||||
'db_password' => 'required',
|
||||
/*Mail driver*/
|
||||
'mail_driver' => 'required',
|
||||
'encryption' => 'required',
|
||||
'mail_host' => 'required',
|
||||
'mail_username' => 'required',
|
||||
'mail_name' => 'required',
|
||||
'mail_address' => 'required',
|
||||
'mail_password' => 'required',
|
||||
/*user registration*/
|
||||
'privacy_policy' => 'required',
|
||||
'terms_of_service' => 'required',
|
||||
'first_name' => 'required',
|
||||
'last_name' => 'required',
|
||||
'email' => 'required',
|
||||
'password' => 'required'
|
||||
];
|
||||
}
|
||||
|
||||
protected function prepareForValidation()
|
||||
{
|
||||
$input = $this->all();
|
||||
|
||||
$input['user_agent'] = request()->server('HTTP_USER_AGENT');
|
||||
|
||||
$this->replace($input);
|
||||
}
|
||||
}
|
@ -29,8 +29,6 @@ class VersionCheck implements ShouldQueue
|
||||
|
||||
$version_file = file_get_contents(config('ninja.version_url'));
|
||||
|
||||
\Log::error($version_file);
|
||||
|
||||
if($version_file)
|
||||
Account::whereNotNull('id')->update(['latest_version' => $version_file]);
|
||||
|
||||
|
@ -13,6 +13,7 @@ namespace App\Listeners;
|
||||
|
||||
use App\Libraries\MultiDB;
|
||||
use App\Notifications\Ninja\VerifyUser;
|
||||
use App\Utils\Ninja;
|
||||
use Illuminate\Broadcasting\InteractsWithSockets;
|
||||
use Illuminate\Contracts\Broadcasting\ShouldBroadcast;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
@ -48,5 +49,6 @@ class SendVerificationNotification implements ShouldQueue
|
||||
|
||||
$event->user->notify(new VerifyUser($event->user));
|
||||
|
||||
Ninja::registerNinjaUser($event->user);
|
||||
}
|
||||
}
|
||||
|
42
app/Mail/TestMailServer.php
Normal file
42
app/Mail/TestMailServer.php
Normal file
@ -0,0 +1,42 @@
|
||||
<?php
|
||||
|
||||
namespace App\Mail;
|
||||
|
||||
use App\Utils\Ninja;
|
||||
use Illuminate\Bus\Queueable;
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
use Illuminate\Mail\Mailable;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
|
||||
class TestMailServer extends Mailable
|
||||
{
|
||||
use Queueable, SerializesModels;
|
||||
|
||||
public $message;
|
||||
|
||||
public $from_email;
|
||||
|
||||
public function __construct($message, $from_email)
|
||||
{
|
||||
$this->message = $message;
|
||||
$this->from_email = $from_email;
|
||||
}
|
||||
|
||||
/**
|
||||
* Build the message.
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function build()
|
||||
{
|
||||
|
||||
return $this->from($this->from_email) //todo this needs to be fixed to handle the hosted version
|
||||
->subject(ctrans('texts.email'))
|
||||
->markdown('email.support.message', [
|
||||
'message' => $this->message,
|
||||
'system_info' => '',
|
||||
'laravel_log' => []
|
||||
]);
|
||||
|
||||
}
|
||||
}
|
@ -358,7 +358,10 @@ class Company extends BaseModel
|
||||
|
||||
public function domain()
|
||||
{
|
||||
return $this->subdomain . config('ninja.app_domain');
|
||||
if(Ninja::isNinja())
|
||||
return $this->subdomain . config('ninja.app_domain');
|
||||
|
||||
return config('ninja.app_url');
|
||||
}
|
||||
|
||||
public function notification(Notification $notification)
|
||||
@ -368,9 +371,7 @@ class Company extends BaseModel
|
||||
|
||||
public function routeNotificationForSlack($notification)
|
||||
{
|
||||
//todo need to return the company channel here for hosted users
|
||||
//else the env variable for selfhosted
|
||||
//
|
||||
|
||||
return $this->slack_webhook_url;
|
||||
|
||||
}
|
||||
|
@ -19,6 +19,7 @@ use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
use Illuminate\Support\Carbon;
|
||||
|
||||
class InvoiceInvitation extends BaseModel {
|
||||
|
||||
use MakesDates;
|
||||
use SoftDeletes;
|
||||
use Inviteable;
|
||||
|
@ -101,4 +101,27 @@ class UserRepository extends BaseRepository
|
||||
|
||||
}
|
||||
|
||||
public function delete($user)
|
||||
{
|
||||
|
||||
$company = auth()->user()->company();
|
||||
|
||||
$cu = CompanyUser::whereUserId($user->id)
|
||||
->whereCompanyId($company->id)
|
||||
->first();
|
||||
|
||||
if($cu)
|
||||
{
|
||||
$cu->tokens()->delete();
|
||||
$cu->delete();
|
||||
}
|
||||
|
||||
$user->is_deleted=true;
|
||||
$user->save();
|
||||
$user->delete();
|
||||
|
||||
return $user->fresh();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -38,6 +38,11 @@ class Ninja
|
||||
return config('ninja.production');
|
||||
}
|
||||
|
||||
public static function isNinjaDev()
|
||||
{
|
||||
return config('ninja.app_env') == 'development';
|
||||
}
|
||||
|
||||
public static function getDebugInfo()
|
||||
{
|
||||
$mysql_version = DB::select(DB::raw("select version() as version"))[0]->version;
|
||||
@ -78,11 +83,11 @@ class Ninja
|
||||
|
||||
public static function registerNinjaUser($user)
|
||||
{
|
||||
if (! $user || $user->email == self::TEST_USERNAME) {
|
||||
if (! $user || $user->email == self::TEST_USERNAME || self::isNinjaDev()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$url = (Utils::isNinjaDev() ? SITE_URL : NINJA_APP_URL) . '/signup/register';
|
||||
$url = config('ninja.license_url') . '/signup/register';
|
||||
$data = '';
|
||||
$fields = [
|
||||
'first_name' => urlencode($user->first_name),
|
||||
|
@ -12,7 +12,9 @@
|
||||
namespace App\Utils;
|
||||
|
||||
use App\Libraries\MultiDB;
|
||||
use App\Mail\TestMailServer;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\Mail;
|
||||
|
||||
/**
|
||||
* Class SystemHealth.
|
||||
@ -51,6 +53,9 @@ class SystemHealth
|
||||
'php_version' => phpversion(),
|
||||
'min_php_version' => self::$php_version,
|
||||
'dbs' => self::dbCheck(),
|
||||
'mail' => self::testMailServer(),
|
||||
'env_writable' => self::checkEnvWritable(),
|
||||
'env_exists'
|
||||
];
|
||||
}
|
||||
|
||||
@ -95,4 +100,32 @@ class SystemHealth
|
||||
return $result;
|
||||
|
||||
}
|
||||
|
||||
private static function checkDbConnection()
|
||||
{
|
||||
return DB::connection()->getPdo();
|
||||
}
|
||||
|
||||
private static function testMailServer()
|
||||
{
|
||||
|
||||
try {
|
||||
Mail::to(config('mail.from.address'))
|
||||
->send(new TestMailServer('Email Server Works!', config('mail.from.address')));
|
||||
}
|
||||
catch(\Exception $e) {
|
||||
|
||||
return $e->getMessage();
|
||||
}
|
||||
|
||||
if(count(Mail::failures()) > 0)
|
||||
return Mail::failures();
|
||||
|
||||
return [];
|
||||
}
|
||||
|
||||
private static function checkEnvWritable()
|
||||
{
|
||||
return @fopen(base_path().'/.env', 'w');
|
||||
}
|
||||
}
|
||||
|
30
app/Utils/Traits/AppSetup.php
Normal file
30
app/Utils/Traits/AppSetup.php
Normal file
@ -0,0 +1,30 @@
|
||||
<?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\Utils\Traits;
|
||||
|
||||
use App\Utils\Ninja;
|
||||
use App\Utils\SystemHealth;
|
||||
|
||||
trait AppSetup
|
||||
{
|
||||
|
||||
public function checkAppSetup()
|
||||
{
|
||||
|
||||
if(Ninja::isNinja()) // Is this the invoice ninja production system?
|
||||
return true;
|
||||
|
||||
return SystemHealth::check()['system_health']; // Do the system tests pass?
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -1,5 +1,13 @@
|
||||
<?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\Utils\Traits;
|
||||
|
||||
|
@ -27,7 +27,9 @@ trait MakesHash
|
||||
*/
|
||||
public function createHash() : string
|
||||
{
|
||||
|
||||
return \Illuminate\Support\Str::random(config('ninja.key_length'));
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@ -38,7 +40,9 @@ trait MakesHash
|
||||
*/
|
||||
public function createDbHash($db) : string
|
||||
{
|
||||
|
||||
return $this->getDbCode($db) . '-' . \Illuminate\Support\Str::random(config('ninja.key_length'));
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@ -47,29 +51,30 @@ trait MakesHash
|
||||
*/
|
||||
public function getDbCode($db) : string
|
||||
{
|
||||
$hashids = new Hashids('', 10);
|
||||
|
||||
$hashids = new Hashids(config('ninja.hash_salt'), 10);
|
||||
|
||||
return $hashids->encode(str_replace(MultiDB::DB_PREFIX, "", $db));
|
||||
|
||||
}
|
||||
|
||||
public function encodePrimaryKey($value) : string
|
||||
{
|
||||
$hashids = new Hashids('', 10);
|
||||
|
||||
$hashids = new Hashids(config('ninja.hash_salt'), 10);
|
||||
|
||||
return $hashids->encode($value);
|
||||
|
||||
}
|
||||
|
||||
public function decodePrimaryKey($value) : string
|
||||
{
|
||||
// \Log::error("pre decode = {$value}");
|
||||
|
||||
try {
|
||||
$hashids = new Hashids('', 10);
|
||||
$hashids = new Hashids(config('ninja.hash_salt'), 10);
|
||||
|
||||
$decoded_array = $hashids->decode($value);
|
||||
|
||||
// \Log::error($decoded_array);
|
||||
|
||||
if(!is_array($decoded_array))
|
||||
throw new ModelNotFoundException("Resource not found", 1);
|
||||
|
||||
@ -77,10 +82,12 @@ trait MakesHash
|
||||
} catch (\Exception $e) {
|
||||
return response()->json(['error'=>'Invalid primary key'], 400);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public function transformKeys($keys)
|
||||
{
|
||||
|
||||
if (is_array($keys)) {
|
||||
foreach ($keys as &$value) {
|
||||
$value = $this->decodePrimaryKey($value);
|
||||
@ -90,5 +97,7 @@ trait MakesHash
|
||||
} else {
|
||||
return $this->decodePrimaryKey($keys);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
265
app/Utils/Traits/MakesTemplateData.php
Normal file
265
app/Utils/Traits/MakesTemplateData.php
Normal file
@ -0,0 +1,265 @@
|
||||
<?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\Utils\Traits;
|
||||
|
||||
/**
|
||||
* Class MakesTemplateData
|
||||
* @package App\Utils\Traits
|
||||
*/
|
||||
|
||||
trait MakesTemplateData
|
||||
{
|
||||
|
||||
public function makeFakerLabels() :array
|
||||
{
|
||||
$data = [];
|
||||
|
||||
$values = $this->getFakerData();
|
||||
|
||||
foreach($values as $key => $value)
|
||||
{
|
||||
$data[$key.'_label'] = $value['label'];
|
||||
}
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
/**
|
||||
* Transforms all placeholders
|
||||
* to invoice values
|
||||
*
|
||||
* @return array returns an array
|
||||
* of keyed labels (appended with _label)
|
||||
*/
|
||||
public function makeFakerValues() :array
|
||||
{
|
||||
$data = [];
|
||||
|
||||
$values = $this->getFakerData();
|
||||
|
||||
foreach($values as $key => $value)
|
||||
{
|
||||
$data[$key] = $value['value'];
|
||||
}
|
||||
|
||||
return $data;
|
||||
}
|
||||
|
||||
|
||||
public function getFakerData()
|
||||
{
|
||||
$data = [];
|
||||
|
||||
$data['$tax'] = ['value' => '', 'label' => ctrans('texts.tax')];
|
||||
$data['$app_url'] = ['value' => 'https://example.com', 'label' => ''];
|
||||
$data['$from'] = ['value' => '', 'label' => ctrans('texts.from')];
|
||||
$data['$to'] = ['value' => '', 'label' => ctrans('texts.to')];
|
||||
$data['$total_tax_labels'] = ['value' => '<span>VAT</span>', 'label' => ctrans('texts.taxes')];
|
||||
$data['$total_tax_values'] = ['value' => '<span>17.5%</span>', 'label' => ctrans('texts.taxes')];
|
||||
$data['$line_tax_labels'] = ['value' => '<span>VAT</span>', 'label' => ctrans('texts.taxes')];
|
||||
$data['$line_tax_values'] = ['value' => '<span>17.5%</span>', 'label' => ctrans('texts.taxes')];
|
||||
$data['$date'] = ['value' => '2010-02-02', 'label' => ctrans('texts.date')];
|
||||
$data['$invoice_date'] = ['value' => '2010-02-02', 'label' => ctrans('texts.invoice_date')];
|
||||
$data['$invoice.date'] = &$data['$date'];
|
||||
$data['$due_date'] = ['value' => '2010-02-02', 'label' => ctrans('texts.due_date')];
|
||||
$data['$invoice.due_date'] = &$data['$due_date'];
|
||||
$data['$invoice.number'] = ['value' => '#INV-20293', 'label' => ctrans('texts.invoice_number')];
|
||||
$data['$invoice.invoice_number'] = &$data['$invoice.number'];
|
||||
$data['$invoice_number'] = &$data['$invoice.number'];
|
||||
$data['$po_number'] = ['value' => '#PO-12322', 'label' => ctrans('texts.po_number')];
|
||||
$data['$invoice.po_number'] = &$data['$po_number'];
|
||||
$data['$line_taxes'] = &$data['$line_tax_labels'];
|
||||
$data['$invoice.line_taxes'] = &$data['$line_tax_labels'];
|
||||
$data['$total_taxes'] = &$data['$line_tax_labels'];
|
||||
$data['$invoice.total_taxes'] = &$data['$total_taxes'];
|
||||
$data['$entity_label'] = ['value' => '', 'label' => ctrans('texts.invoice')];
|
||||
$data['$number'] = ['value' => '#ENT-292', 'label' => ctrans('texts.invoice_number')];
|
||||
$data['$entity.terms'] = ['value' => 'The terms and conditions are listed below and are non negotiable', 'label' => ctrans('texts.invoice_terms')];
|
||||
$data['$terms'] = &$data['$entity.terms'];
|
||||
$data['$entity_number'] = &$data['$number'];
|
||||
$data['$discount'] = ['value' => '$10.00', 'label' => ctrans('texts.discount')];
|
||||
$data['$invoice.discount'] = &$data['$discount'];
|
||||
$data['$subtotal'] = ['value' => '$20.00', 'label' => ctrans('texts.subtotal')];
|
||||
$data['$invoice.subtotal'] = &$data['$subtotal'];
|
||||
$data['$balance_due'] = ['value' => '$5.00', 'label' => ctrans('texts.balance_due')];
|
||||
$data['$invoice.balance_due'] = &$data['$balance_due'];
|
||||
$data['$partial_due'] = ['value' => '$5.00', 'label' => ctrans('texts.partial_due')];
|
||||
$data['$invoice.partial_due'] = &$data['$partial_due'];
|
||||
$data['$total'] = ['value' => '$100.00', 'label' => ctrans('texts.total')];
|
||||
$data['$invoice.total'] = ['value' => '$100.00', 'label' => ctrans('texts.invoice_total')];
|
||||
$data['$amount'] = &$data['$total'];
|
||||
$data['$invoice_total'] = &$data['$total'];
|
||||
$data['$invoice.amount'] = &$data['$total'];
|
||||
$data['$quote_total'] = ['value' => '$100.00', 'label' => ctrans('texts.quote_total')];
|
||||
$data['$quote.amount'] = &$data['$quote_total'];
|
||||
$data['$credit_total'] = ['value' => '$100.00', 'label' => ctrans('texts.credit_total')];
|
||||
$data['$credit.amount'] = &$data['$credit_total'];
|
||||
$data['$balance'] = ['value' => '$100.00', 'label' => ctrans('texts.balance')];
|
||||
$data['$invoice.balance'] = &$data['$balance'];
|
||||
$data['$taxes'] = ['value' => '$10.00', 'label' => ctrans('texts.taxes')];
|
||||
$data['$invoice.taxes'] = &$data['$taxes'];
|
||||
$data['$invoice1'] = ['value' => '10', 'label' => 'invoice1'];
|
||||
$data['$invoice2'] = ['value' => '10', 'label' => 'invoice2'];
|
||||
$data['$invoice3'] = ['value' => '10', 'label' => 'invoice3'];
|
||||
$data['$invoice4'] = ['value' => '10', 'label' => 'invoice4'];
|
||||
$data['$invoice.public_notes'] = ['value' => '10', 'label' => ctrans('texts.public_notes')];
|
||||
$data['$entity.public_notes'] = &$data['$invoice.public_notes'];
|
||||
$data['$quote_date'] = ['value' => '2010-02-03', 'label' => ctrans('texts.quote_date')];
|
||||
$data['$quote_number'] = ['value' => '#QUOTE-19338', 'label' => ctrans('texts.quote_number')];
|
||||
$data['$quote.quote_number'] = &$data['$quote_number'];
|
||||
$data['$quote_no'] = &$data['$quote_number'];
|
||||
$data['$quote.quote_no'] = &$data['$quote_number'];
|
||||
$data['$valid_until'] = ['value' => '2010-02-03', 'label' => ctrans('texts.valid_until')];
|
||||
$data['$quote_total'] = ['value' => '$20.00', 'label' => ctrans('texts.quote_total')];
|
||||
$data['$credit_amount'] = ['value' => '$15.00', 'label' => ctrans('texts.credit_amount')];
|
||||
$data['$credit_balance'] = ['value' => '$12.00', 'label' => ctrans('texts.credit_balance')];;
|
||||
$data['$credit_number'] = &$data['$number'];
|
||||
$data['$credit_no'] = &$data['$number'];
|
||||
$data['$credit.credit_no'] = &$data['$number'];
|
||||
$data['$invoice_no'] = &$data['$number'];
|
||||
$data['$invoice.invoice_no'] = &$data['$number'];
|
||||
$data['$client1'] = ['value' => 'Client Custom Values', 'label' => 'client 1'];
|
||||
$data['$client2'] = ['value' => 'Client Custom Values', 'label' => 'client 2'];
|
||||
$data['$client3'] = ['value' => 'Client Custom Values', 'label' => 'client 3'];
|
||||
$data['$client4'] = ['value' => 'Client Custom Values', 'label' => 'client 4'];
|
||||
$data['$address1'] = ['value' => '5 Jimbuckeroo Way', 'label' => ctrans('texts.address1')];
|
||||
$data['$address2'] = ['value' => 'Kalamazoo', 'label' => ctrans('texts.address2')];
|
||||
$data['$id_number'] = ['value' => 'ID Number', 'label' => ctrans('texts.id_number')];
|
||||
$data['$vat_number'] = ['value' => '555-434-324', 'label' => ctrans('texts.vat_number')];
|
||||
$data['$website'] = ['value' => 'https://www.invoiceninja.com', 'label' => ctrans('texts.website')];
|
||||
$data['$phone'] = ['value' => '555-12321', 'label' => ctrans('texts.phone')];
|
||||
$data['$country'] = ['value' => 'USA', 'label' => ctrans('texts.country')];
|
||||
$data['$email'] = ['value' => 'user@example.com', 'label' => ctrans('texts.email')];
|
||||
$data['$client_name'] = ['value' => 'Joe Denkins', 'label' => ctrans('texts.client_name')];
|
||||
$data['$client.name'] = &$data['$client_name'];
|
||||
$data['$client.address1'] = &$data['$address1'];
|
||||
$data['$client.address2'] = &$data['$address2'];
|
||||
$data['$client_address'] = ['value' => '5 Kalamazoo Way\n Jimbuckeroo\n USA 90210', 'label' => ctrans('texts.address')];
|
||||
$data['$client.address'] = &$data['$client_address'];
|
||||
$data['$client.id_number'] = &$data['$id_number'];
|
||||
$data['$client.vat_number'] = &$data['$vat_number'];
|
||||
$data['$client.website'] = &$data['$website'];
|
||||
$data['$client.phone'] = &$data['$phone'];
|
||||
$data['$city_state_postal'] = ['value' => 'Los Angeles, CA, 90210', 'label' => ctrans('texts.city_state_postal')];
|
||||
$data['$client.city_state_postal'] = &$data['$city_state_postal'];
|
||||
$data['$postal_city_state'] = ['value' => '90210, Los Angeles, CA', 'label' => ctrans('texts.postal_city_state')];
|
||||
$data['$client.postal_city_state'] = &$data['$postal_city_state'];
|
||||
$data['$client.country'] = &$data['$country'];
|
||||
$data['$client.email'] = &$data['$email'];
|
||||
$data['$contact_name'] = ['value' => 'Jimmy Nadel', 'label' => ctrans('texts.contact_name')];
|
||||
$data['$contact.name'] = &$data['$contact_name'];
|
||||
$data['$contact1'] = ['value' => 'Custom Contact Values', 'label' => 'contact 1'];
|
||||
$data['$contact2'] = ['value' => 'Custom Contact Values', 'label' => 'contact 2'];
|
||||
$data['$contact3'] = ['value' => 'Custom Contact Values', 'label' => 'contact 3'];
|
||||
$data['$contact4'] = ['value' => 'Custom Contact Values', 'label' => 'contact 4'];
|
||||
$data['$company.city_state_postal'] = ['value' => 'Los Angeles, CA, 90210', 'label' => ctrans('texts.city_state_postal')];
|
||||
$data['$company.postal_city_state'] = ['value' => '90210, Los Angeles, CA', 'label' => ctrans('texts.postal_city_state')];
|
||||
$data['$company.name'] = ['value' => 'ACME co', 'label' => ctrans('texts.company_name')];
|
||||
$data['$company.company_name'] = &$data['$company.name'];
|
||||
$data['$company.address1'] = ['value' => '5 Jimbuckeroo Way', 'label' => ctrans('texts.address1')];
|
||||
$data['$company.address2'] = ['value' => 'Kalamazoo', 'label' => ctrans('texts.address2')];
|
||||
$data['$company.city'] = ['value' => 'Los Angeles', 'label' => ctrans('texts.city')];
|
||||
$data['$company.state'] = ['value' => 'CA', 'label' => ctrans('texts.state')];
|
||||
$data['$company.postal_code'] = ['value' => '90210', 'label' => ctrans('texts.postal_code')];
|
||||
$data['$company.country'] = ['value' => 'USA', 'label' => ctrans('texts.country')];
|
||||
$data['$company.phone'] = ['value' => '555-3432', 'label' => ctrans('texts.phone')];
|
||||
$data['$company.email'] = ['value' => 'user@example.com', 'label' => ctrans('texts.email')];
|
||||
$data['$company.vat_number'] = ['value' => 'VAT-3344-223', 'label' => ctrans('texts.vat_number')];
|
||||
$data['$company.id_number'] = ['value' => 'ID-NO-#434', 'label' => ctrans('texts.id_number')];
|
||||
$data['$company.website'] = ['value' => 'https://invoiceninja.com', 'label' => ctrans('texts.website')];
|
||||
$data['$company.address'] = ['value' => '5 Kalamazoo Way\n Jimbuckeroo\n USA 90210', 'label' => ctrans('texts.address')];
|
||||
$data['$company.logo'] = ['value' => "<img src='https://raw.githubusercontent.com/hillelcoren/invoice-ninja/master/public/images/round_logo.png' class='w-48' alt='logo'>" ?: ' ', 'label' => ctrans('texts.logo')];
|
||||
$data['$company_logo'] = &$data['$company.logo'];
|
||||
$data['$company1'] = ['value' => 'Company Custom Value 1', 'label' => 'company label1'];
|
||||
$data['$company2'] = ['value' => 'Company Custom Value 2', 'label' => 'company label2'];
|
||||
$data['$company3'] = ['value' => 'Company Custom Value 3', 'label' => 'company label3'];
|
||||
$data['$company4'] = ['value' => 'Company Custom Value 4', 'label' => 'company label4'];
|
||||
$data['$product.date'] = ['value' => '2010-02-03', 'label' => ctrans('texts.date')];
|
||||
$data['$product.discount'] = ['value' => '5%', 'label' => ctrans('texts.discount')];
|
||||
$data['$product.product_key'] = ['value' => 'key', 'label' => ctrans('texts.product_key')];
|
||||
$data['$product.notes'] = ['value' => 'Product Stuff', 'label' => ctrans('texts.notes')];
|
||||
$data['$product.cost'] = ['value' => '$10.00', 'label' => ctrans('texts.cost')];
|
||||
$data['$product.quantity'] = ['value' => '1', 'label' => ctrans('texts.quantity')];
|
||||
$data['$product.tax_name1'] = ['value' => 'GST', 'label' => ctrans('texts.tax')];
|
||||
$data['$product.tax_name2'] = ['value' => 'VAT', 'label' => ctrans('texts.tax')];
|
||||
$data['$product.tax_name3'] = ['value' => 'Sales TAX', 'label' => ctrans('texts.tax')];
|
||||
$data['$product.line_total'] = ['value' => '$20.00', 'label' => ctrans('texts.line_total')];
|
||||
$data['$task.date'] = ['value' => '2010-02-03', 'label' => ctrans('texts.date')];
|
||||
$data['$task.discount'] = ['value' => '5%', 'label' => ctrans('texts.discount')];
|
||||
$data['$task.product_key'] = ['value' => 'key', 'label' => ctrans('texts.product_key')];
|
||||
$data['$task.notes'] = ['value' => 'Note for Tasks', 'label' => ctrans('texts.notes')];
|
||||
$data['$task.cost'] = ['value' => '$100.00', 'label' => ctrans('texts.cost')];
|
||||
$data['$task.quantity'] = ['value' => '1', 'label' => ctrans('texts.quantity')];
|
||||
$data['$task.tax_name1'] = ['value' => 'GST', 'label' => ctrans('texts.tax')];
|
||||
$data['$task.tax_name2'] = ['value' => 'VAT', 'label' => ctrans('texts.tax')];
|
||||
$data['$task.tax_name3'] = ['value' => 'CA Sales Tax', 'label' => ctrans('texts.tax')];
|
||||
$data['$task.line_total'] = ['value' => '$100.00', 'label' => ctrans('texts.line_total')];
|
||||
|
||||
//$data['$paid_to_date'] = ;
|
||||
// $data['$your_invoice'] = ;
|
||||
// $data['$quote'] = ;
|
||||
// $data['$your_quote'] = ;
|
||||
// $data['$invoice_issued_to'] = ;
|
||||
// $data['$quote_issued_to'] = ;
|
||||
// $data['$rate'] = ;
|
||||
// $data['$hours'] = ;
|
||||
// $data['$from'] = ;
|
||||
// $data['$to'] = ;
|
||||
// $data['$invoice_to'] = ;
|
||||
// $data['$quote_to'] = ;
|
||||
// $data['$details'] = ;
|
||||
// $data['custom_label1'] = ['value' => '', 'label' => ctrans('texts.')];
|
||||
// $data['custom_label2'] = ['value' => '', 'label' => ctrans('texts.')];
|
||||
// $data['custom_label3'] = ['value' => '', 'label' => ctrans('texts.')];
|
||||
// $data['custom_label4'] = ['value' => '', 'label' => ctrans('texts.')];
|
||||
//$data['$blank'] = ;
|
||||
//$data['$surcharge'] = ;
|
||||
/*
|
||||
$data['$tax_invoice'] =
|
||||
$data['$tax_quote'] =
|
||||
$data['$statement'] = ;
|
||||
$data['$statement_date'] = ;
|
||||
$data['$your_statement'] = ;
|
||||
$data['$statement_issued_to'] = ;
|
||||
$data['$statement_to'] = ;
|
||||
$data['$credit_note'] = ;
|
||||
$data['$credit_date'] = ;
|
||||
$data['$credit_issued_to'] = ;
|
||||
$data['$credit_to'] = ;
|
||||
$data['$your_credit'] = ;
|
||||
$data['$phone'] = ;
|
||||
|
||||
$data['$outstanding'] = ;
|
||||
$data['$invoice_due_date'] = ;
|
||||
$data['$quote_due_date'] = ;
|
||||
$data['$service'] = ;
|
||||
$data['$product_key'] = ;
|
||||
$data['$unit_cost'] = ;
|
||||
$data['$custom_value1'] = ;
|
||||
$data['$custom_value2'] = ;
|
||||
$data['$delivery_note'] = ;
|
||||
$data['$date'] = ;
|
||||
$data['$method'] = ;
|
||||
$data['$payment_date'] = ;
|
||||
$data['$reference'] = ;
|
||||
$data['$amount'] = ;
|
||||
$data['$amount_paid'] =;
|
||||
*/
|
||||
|
||||
$arrKeysLength = array_map('strlen', array_keys($data));
|
||||
array_multisort($arrKeysLength, SORT_DESC, $data);
|
||||
|
||||
return $data;
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -1,4 +1,13 @@
|
||||
<?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\Utils\Traits\Payment;
|
||||
|
||||
|
@ -1,4 +1,14 @@
|
||||
<?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\Utils\Traits;
|
||||
|
||||
use App\Models\ClientContact;
|
||||
|
@ -1,5 +1,13 @@
|
||||
<?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\Utils\Traits\Pdf;
|
||||
|
||||
|
@ -1,4 +1,14 @@
|
||||
<?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\Utils\Traits;
|
||||
|
||||
use App\Models\ClientContact;
|
||||
|
@ -20,7 +20,6 @@
|
||||
"require": {
|
||||
"php": ">=7.3",
|
||||
"ext-json": "*",
|
||||
"anahkiasen/former": "^4.2",
|
||||
"asgrim/ofxparser": "^1.2",
|
||||
"codedge/laravel-selfupdater": "2.5.1",
|
||||
"composer/composer": "^1.10",
|
||||
@ -35,7 +34,6 @@
|
||||
"laravel/slack-notification-channel": "^2.0",
|
||||
"laravel/socialite": "^4.0",
|
||||
"laravel/tinker": "^1.0",
|
||||
"laravelcollective/html": "^6",
|
||||
"league/fractal": "^0.17.0",
|
||||
"league/omnipay": "^3.0",
|
||||
"maennchen/zipstream-php": "^1.2",
|
||||
@ -49,17 +47,18 @@
|
||||
"stripe/stripe-php": "^7.0",
|
||||
"superbalist/laravel-google-cloud-storage": "^2.2",
|
||||
"webpatser/laravel-countries": "dev-master#75992ad",
|
||||
"wildbit/postmark-php": "^2.6",
|
||||
"yajra/laravel-datatables-html": "^4.0",
|
||||
"yajra/laravel-datatables-oracle": "~9.0"
|
||||
"fzaninotto/faker": "^1.4"
|
||||
},
|
||||
"require-dev": {
|
||||
"ext-json": "*",
|
||||
"laravelcollective/html": "^6",
|
||||
"wildbit/postmark-php": "^2.6",
|
||||
"yajra/laravel-datatables-html": "^4.0",
|
||||
"anahkiasen/former": "^4.2",
|
||||
"yajra/laravel-datatables-oracle": "~9.0",
|
||||
"barryvdh/laravel-debugbar": "^3.2",
|
||||
"beyondcode/laravel-dump-server": "^1.0",
|
||||
"darkaonline/l5-swagger": "^6.0",
|
||||
"filp/whoops": "^2.0",
|
||||
"fzaninotto/faker": "^1.4",
|
||||
"laravel/dusk": "^5.0",
|
||||
"mockery/mockery": "^1.0",
|
||||
"nunomaduro/collision": "^2.0",
|
||||
@ -92,11 +91,14 @@
|
||||
"@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
|
||||
],
|
||||
"post-create-project-cmd": [
|
||||
"@php artisan key:generate --ansi"
|
||||
"@php -r \"file_exists('.env') || copy('.env.example', '.env');\"",
|
||||
"@php artisan key:generate"
|
||||
],
|
||||
"post-autoload-dump": [
|
||||
"Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
|
||||
"@php -r \"file_exists('.env') || copy('.env.example', '.env');\"",
|
||||
"@php artisan package:discover --ansi",
|
||||
"php artisan key:generate",
|
||||
"@php artisan storage:link"
|
||||
]
|
||||
},
|
||||
@ -107,4 +109,4 @@
|
||||
},
|
||||
"minimum-stability": "dev",
|
||||
"prefer-stable": true
|
||||
}
|
||||
}
|
@ -6,14 +6,14 @@ return [
|
||||
'license_url' => 'https://app.invoiceninja.com',
|
||||
'production' => env('NINJA_PROD', false),
|
||||
'license' => env('NINJA_LICENSE', ''),
|
||||
'app_name' => env('APP_NAME'),
|
||||
'version_url' => 'https://raw.githubusercontent.com/invoiceninja/invoiceninja/v2/VERSION.txt',
|
||||
'app_name' => env('APP_NAME'),
|
||||
'app_env' => env('APP_ENV', 'local'),
|
||||
'app_url' => env('APP_URL', ''),
|
||||
'app_domain' => env('APP_DOMAIN', 'invoicing.co'),
|
||||
'app_domain' => env('APP_DOMAIN', ''),
|
||||
'app_version' => '0.0.1',
|
||||
'api_version' => '0.0.1',
|
||||
'terms_version' => '1.0.1',
|
||||
'app_env' => env('APP_ENV', 'development'),
|
||||
'api_secret' => env('API_SECRET', ''),
|
||||
'google_maps_api_key' => env('GOOGLE_MAPS_API_KEY'),
|
||||
'key_length' => 64,
|
||||
@ -22,6 +22,7 @@ return [
|
||||
'daily_email_limit' => 300,
|
||||
'error_email' => env('ERROR_EMAIL', ''),
|
||||
'company_id' => 0,
|
||||
'hash_salt' => env('HASH_SALT', ''),
|
||||
|
||||
'environment' => env('NINJA_ENVIRONMENT', 'selfhost'), // 'hosted', 'development', 'selfhost', 'reseller'
|
||||
|
||||
@ -51,7 +52,7 @@ return [
|
||||
'datetime_format_id' => env('DEFAULT_DATETIME_FORMAT_ID', '1'),
|
||||
'locale' => env('DEFAULT_LOCALE', 'en'),
|
||||
'map_zoom' => env('DEFAULT_MAP_ZOOM', 10),
|
||||
'payment_terms' => env('DEFAULT_PAYMENT_TERMS', 1),
|
||||
'payment_terms' => env('DEFAULT_PAYMENT_TERMS', -1),
|
||||
'military_time' => env('MILITARY_TIME', 0),
|
||||
'first_day_of_week' => env('FIRST_DATE_OF_WEEK',0),
|
||||
'first_month_of_year' => env('FIRST_MONTH_OF_YEAR', '2000-01-01')
|
||||
|
@ -70,7 +70,7 @@ class RandomDataSeeder extends Seeder
|
||||
|
||||
Eloquent::unguard();
|
||||
|
||||
$faker = Faker\Factory::create();
|
||||
$faker = \Faker\Factory::create();
|
||||
|
||||
$account = factory(\App\Models\Account::class)->create();
|
||||
$company = factory(\App\Models\Company::class)->create([
|
||||
|
@ -24,7 +24,7 @@ class UsersTableSeeder extends Seeder
|
||||
|
||||
Eloquent::unguard();
|
||||
|
||||
$faker = Faker\Factory::create();
|
||||
$faker = \Faker\Factory::create();
|
||||
|
||||
$account = factory(\App\Models\Account::class)->create();
|
||||
$company = factory(\App\Models\Company::class)->create([
|
||||
|
@ -3141,4 +3141,5 @@ return [
|
||||
'entity_number_placeholder' => ':entity # :entity_number',
|
||||
'email_link_not_working' => 'If button above isn\'t working for you, please click on the link',
|
||||
'credit_terms' => 'Credit Terms',
|
||||
'display_log' => 'Display Log',
|
||||
];
|
||||
|
@ -12,13 +12,14 @@ Header Title
|
||||
|
||||
{!! str_replace('\n', '<br>', $system_info) !!}
|
||||
|
||||
@if(@count($laravel_log) > 0)
|
||||
<details>
|
||||
<summary>{{ ctrans('texts.display_log') }}</summary>
|
||||
@foreach($laravel_log as $log_line)
|
||||
<small>{{ $log_line }}</small> <br>
|
||||
@endforeach
|
||||
</details>
|
||||
|
||||
@endif
|
||||
{{-- Subcopy --}}
|
||||
@isset($subcopy)
|
||||
@slot('subcopy')
|
||||
|
@ -2,7 +2,7 @@
|
||||
<html lang="{!! $lang !!}">
|
||||
{!! $includes !!}
|
||||
<body>
|
||||
{!! $header !!}
|
||||
<head>{!! $header !!}</head>
|
||||
{!! $body !!}
|
||||
{!! $footer !!}
|
||||
</body>
|
||||
|
@ -144,6 +144,7 @@ Route::group(['middleware' => ['api_db', 'token_auth', 'locale'], 'prefix' => 'a
|
||||
Route::group(['middleware' => ['api_db', 'locale'], 'prefix' => 'api/v1', 'as' => 'api.'], function () {
|
||||
|
||||
Route::get('claim_license', 'LicenseController@index')->name('license.index');
|
||||
//Route::post('register_user', 'LicenseController@registerNinjaUser')->name('license.register_ninja_user');
|
||||
|
||||
});
|
||||
|
||||
|
@ -1,30 +1,11 @@
|
||||
<?php
|
||||
/*
|
||||
* Authentication Routes Laravel Defaults... replaces //Auth::routes();
|
||||
*/
|
||||
|
||||
// Route::get('login', 'Auth\LoginController@showLoginForm')->name('login');
|
||||
// Route::post('login', 'Auth\LoginController@login');
|
||||
// Route::post('logout', 'Auth\LoginController@logout')->name('logout');
|
||||
|
||||
/*
|
||||
* Signup Routes
|
||||
*/
|
||||
|
||||
Route::get('/', 'BaseController@flutterRoute')->middleware('guest');
|
||||
|
||||
|
||||
Route::group(['middleware' => ['invite_db'], 'prefix' => '', 'as' => ''], function () {
|
||||
|
||||
/*Invitation catches*/
|
||||
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
||||
// Route::get('signup', 'AccountController@index')->name('signup');
|
||||
// Route::post('signup', 'AccountController@store')->name('signup.submit');
|
||||
Route::get('setup', 'SetupController@index')->middleware('guest');
|
||||
Route::post('setup', 'SetupController@doSetup')->middleware('guest');
|
||||
|
||||
/*
|
||||
* Password Reset Routes...
|
||||
@ -42,57 +23,6 @@ Route::post('password/reset', 'Auth\ResetPasswordController@reset')->name('passw
|
||||
// Route::get('auth/{provider}', 'Auth\LoginController@redirectToProvider');
|
||||
// Route::get('auth/{provider}/create', 'Auth\LoginController@redirectToProviderAndCreate');
|
||||
|
||||
/*
|
||||
* Authenticated User Routes
|
||||
*/
|
||||
/*
|
||||
Route::group(['middleware' => ['auth:user', 'web_db']], function () {
|
||||
|
||||
Route::resource('dashboard', 'DashboardController'); // name = (dashboard. index / create / show / update / destroy / edit
|
||||
|
||||
Route::get('logout', 'Auth\LoginController@logout')->name('user.logout');
|
||||
|
||||
Route::resource('invoices', 'InvoiceController'); // name = (invoices. index / create / show / update / destroy / edit
|
||||
|
||||
Route::post('invoices/bulk', 'InvoiceController@bulk')->name('invoices.bulk');
|
||||
|
||||
Route::resource('quotes', 'QuoteController'); // name = (quotes. index / create / show / update / destroy / edit
|
||||
|
||||
Route::post('quotes/bulk', 'QuoteController@bulk')->name('quotes.bulk');
|
||||
|
||||
Route::resource('recurring_invoices', 'RecurringInvoiceController'); // name = (recurring_invoices. index / create / show / update / destroy / edit
|
||||
|
||||
Route::post('recurring_invoices/bulk', 'RecurringInvoiceController@bulk')->name('recurring_invoices.bulk');
|
||||
|
||||
Route::resource('clients', 'ClientController'); // name = (clients. index / create / show / update / destroy / edit
|
||||
|
||||
Route::post('clients/bulk', 'ClientController@bulk')->name('clients.bulk');
|
||||
|
||||
Route::resource('client_statement', 'ClientStatementController@statement'); // name = (client_statement. index / create / show / update / destroy / edit
|
||||
|
||||
Route::resource('tasks', 'TaskController'); // name = (tasks. index / create / show / update / destroy / edit
|
||||
|
||||
Route::post('tasks/bulk', 'TaskController@bulk')->name('tasks.bulk');
|
||||
|
||||
Route::resource('payments', 'PaymentController'); // name = (payments. index / create / show / update / destroy / edit
|
||||
|
||||
Route::post('payments/bulk', 'PaymentController@bulk')->name('payments.bulk');
|
||||
|
||||
Route::resource('credits', 'CreditController'); // name = (credits. index / create / show / update / destroy / edit
|
||||
|
||||
Route::post('credits/bulk', 'CreditController@bulk')->name('credits.bulk');
|
||||
|
||||
Route::resource('expenses', 'ExpenseController'); // name = (expenses. index / create / show / update / destroy / edit
|
||||
|
||||
Route::post('expenses/bulk', 'ExpenseController@bulk')->name('expenses.bulk');
|
||||
|
||||
Route::resource('user', 'UserProfileController'); // name = (clients. index / create / show / update / destroy / edit
|
||||
|
||||
Route::get('settings', 'SettingsController@index')->name('user.settings');
|
||||
|
||||
|
||||
});
|
||||
*/
|
||||
/*
|
||||
* Inbound routes requiring DB Lookup
|
||||
*/
|
||||
@ -100,11 +30,4 @@ Route::group(['middleware' => ['url_db']], function () {
|
||||
|
||||
Route::get('/user/confirm/{confirmation_code}', 'UserController@confirm');
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Injects users translation strings in json format for frontend consumption.
|
||||
*/
|
||||
//Route::get('js/lang.js', 'TranslationController@index')->name('assets.lang');
|
||||
});
|
@ -47,7 +47,7 @@ class CompareObjectTest extends TestCase
|
||||
|
||||
$this->assertEquals($build_client_settings->timezone_id, 1);
|
||||
$this->assertEquals($build_client_settings->language_id, 1);
|
||||
$this->assertEquals($build_client_settings->payment_terms, 1);
|
||||
$this->assertEquals($build_client_settings->payment_terms, -1);
|
||||
}
|
||||
|
||||
public function testDirectClientSettingsBuild()
|
||||
@ -56,7 +56,7 @@ class CompareObjectTest extends TestCase
|
||||
|
||||
$this->assertEquals($settings->timezone_id, 1);
|
||||
$this->assertEquals($settings->language_id, 1);
|
||||
$this->assertEquals($settings->payment_terms, 1);
|
||||
$this->assertEquals($settings->payment_terms, -1);
|
||||
$this->assertFalse($settings->send_portal_password);
|
||||
}
|
||||
|
||||
|
@ -36,8 +36,7 @@ class SystemHealthTest extends TestCase
|
||||
$this->assertTrue($results['extensions'][2]['curl']);
|
||||
$this->assertTrue($results['extensions'][3]['zip']);
|
||||
|
||||
|
||||
// $this->assertTrue($results['dbs'][0]['db-ninja-01']);
|
||||
// \Log::error(print_r($results,1));
|
||||
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user