mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-12 22:22:32 +01:00
commit
4d29d73a6b
2
.gitignore
vendored
2
.gitignore
vendored
@ -19,6 +19,7 @@ yarn-error.log
|
||||
local_version.txt
|
||||
.env
|
||||
.phpunit.result.cache
|
||||
_ide_helper.php
|
||||
|
||||
/resources/assets/bower
|
||||
/public/logo
|
||||
@ -34,3 +35,4 @@ nbproject
|
||||
public/test.pdf
|
||||
public/storage/test.pdf
|
||||
/Modules
|
||||
_ide_helper_models.php
|
@ -1 +1 @@
|
||||
5.5.74
|
||||
5.5.75
|
158
_ide_helper.php
158
_ide_helper.php
@ -4193,7 +4193,7 @@
|
||||
*/
|
||||
public static function lock($name, $seconds = 0, $owner = null)
|
||||
{
|
||||
/** @var \Illuminate\Cache\FileStore $instance */
|
||||
/** @var \Illuminate\Cache\RedisStore $instance */
|
||||
return $instance->lock($name, $seconds, $owner);
|
||||
}
|
||||
/**
|
||||
@ -4206,7 +4206,7 @@
|
||||
*/
|
||||
public static function restoreLock($name, $owner)
|
||||
{
|
||||
/** @var \Illuminate\Cache\FileStore $instance */
|
||||
/** @var \Illuminate\Cache\RedisStore $instance */
|
||||
return $instance->restoreLock($name, $owner);
|
||||
}
|
||||
/**
|
||||
@ -4217,30 +4217,65 @@
|
||||
*/
|
||||
public static function flush()
|
||||
{
|
||||
/** @var \Illuminate\Cache\FileStore $instance */
|
||||
/** @var \Illuminate\Cache\RedisStore $instance */
|
||||
return $instance->flush();
|
||||
}
|
||||
/**
|
||||
* Get the Filesystem instance.
|
||||
* Get the Redis connection instance.
|
||||
*
|
||||
* @return \Illuminate\Filesystem\Filesystem
|
||||
* @return \Illuminate\Redis\Connections\Connection
|
||||
* @static
|
||||
*/
|
||||
public static function getFilesystem()
|
||||
public static function connection()
|
||||
{
|
||||
/** @var \Illuminate\Cache\FileStore $instance */
|
||||
return $instance->getFilesystem();
|
||||
/** @var \Illuminate\Cache\RedisStore $instance */
|
||||
return $instance->connection();
|
||||
}
|
||||
/**
|
||||
* Get the working directory of the cache.
|
||||
* Get the Redis connection instance that should be used to manage locks.
|
||||
*
|
||||
* @return string
|
||||
* @return \Illuminate\Redis\Connections\Connection
|
||||
* @static
|
||||
*/
|
||||
public static function getDirectory()
|
||||
public static function lockConnection()
|
||||
{
|
||||
/** @var \Illuminate\Cache\FileStore $instance */
|
||||
return $instance->getDirectory();
|
||||
/** @var \Illuminate\Cache\RedisStore $instance */
|
||||
return $instance->lockConnection();
|
||||
}
|
||||
/**
|
||||
* Specify the name of the connection that should be used to store data.
|
||||
*
|
||||
* @param string $connection
|
||||
* @return void
|
||||
* @static
|
||||
*/
|
||||
public static function setConnection($connection)
|
||||
{
|
||||
/** @var \Illuminate\Cache\RedisStore $instance */
|
||||
$instance->setConnection($connection);
|
||||
}
|
||||
/**
|
||||
* Specify the name of the connection that should be used to manage locks.
|
||||
*
|
||||
* @param string $connection
|
||||
* @return \Illuminate\Cache\RedisStore
|
||||
* @static
|
||||
*/
|
||||
public static function setLockConnection($connection)
|
||||
{
|
||||
/** @var \Illuminate\Cache\RedisStore $instance */
|
||||
return $instance->setLockConnection($connection);
|
||||
}
|
||||
/**
|
||||
* Get the Redis database instance.
|
||||
*
|
||||
* @return \Illuminate\Contracts\Redis\Factory
|
||||
* @static
|
||||
*/
|
||||
public static function getRedis()
|
||||
{
|
||||
/** @var \Illuminate\Cache\RedisStore $instance */
|
||||
return $instance->getRedis();
|
||||
}
|
||||
/**
|
||||
* Get the cache key prefix.
|
||||
@ -4250,8 +4285,20 @@
|
||||
*/
|
||||
public static function getPrefix()
|
||||
{
|
||||
/** @var \Illuminate\Cache\FileStore $instance */
|
||||
/** @var \Illuminate\Cache\RedisStore $instance */
|
||||
return $instance->getPrefix();
|
||||
}
|
||||
/**
|
||||
* Set the cache key prefix.
|
||||
*
|
||||
* @param string $prefix
|
||||
* @return void
|
||||
* @static
|
||||
*/
|
||||
public static function setPrefix($prefix)
|
||||
{
|
||||
/** @var \Illuminate\Cache\RedisStore $instance */
|
||||
$instance->setPrefix($prefix);
|
||||
}
|
||||
|
||||
}
|
||||
@ -9854,45 +9901,44 @@
|
||||
return $instance->setConnectionName($name);
|
||||
}
|
||||
/**
|
||||
* Release a reserved job back onto the queue after (n) seconds.
|
||||
* Migrate the delayed jobs that are ready to the regular queue.
|
||||
*
|
||||
* @param string $queue
|
||||
* @param \Illuminate\Queue\Jobs\DatabaseJobRecord $job
|
||||
* @param int $delay
|
||||
* @return mixed
|
||||
* @param string $from
|
||||
* @param string $to
|
||||
* @param int $limit
|
||||
* @return array
|
||||
* @static
|
||||
*/
|
||||
public static function release($queue, $job, $delay)
|
||||
public static function migrateExpiredJobs($from, $to)
|
||||
{
|
||||
/** @var \Illuminate\Queue\DatabaseQueue $instance */
|
||||
return $instance->release($queue, $job, $delay);
|
||||
/** @var \Illuminate\Queue\RedisQueue $instance */
|
||||
return $instance->migrateExpiredJobs($from, $to);
|
||||
}
|
||||
/**
|
||||
* Delete a reserved job from the queue.
|
||||
*
|
||||
* @param string $queue
|
||||
* @param string $id
|
||||
* @param \Illuminate\Queue\Jobs\RedisJob $job
|
||||
* @return void
|
||||
* @throws \Throwable
|
||||
* @static
|
||||
*/
|
||||
public static function deleteReserved($queue, $id)
|
||||
public static function deleteReserved($queue, $job)
|
||||
{
|
||||
/** @var \Illuminate\Queue\DatabaseQueue $instance */
|
||||
$instance->deleteReserved($queue, $id);
|
||||
/** @var \Illuminate\Queue\RedisQueue $instance */
|
||||
$instance->deleteReserved($queue, $job);
|
||||
}
|
||||
/**
|
||||
* Delete a reserved job from the reserved queue and release it.
|
||||
*
|
||||
* @param string $queue
|
||||
* @param \Illuminate\Queue\Jobs\DatabaseJob $job
|
||||
* @param \Illuminate\Queue\Jobs\RedisJob $job
|
||||
* @param int $delay
|
||||
* @return void
|
||||
* @static
|
||||
*/
|
||||
public static function deleteAndRelease($queue, $job, $delay)
|
||||
{
|
||||
/** @var \Illuminate\Queue\DatabaseQueue $instance */
|
||||
/** @var \Illuminate\Queue\RedisQueue $instance */
|
||||
$instance->deleteAndRelease($queue, $job, $delay);
|
||||
}
|
||||
/**
|
||||
@ -9904,7 +9950,7 @@
|
||||
*/
|
||||
public static function clear($queue)
|
||||
{
|
||||
/** @var \Illuminate\Queue\DatabaseQueue $instance */
|
||||
/** @var \Illuminate\Queue\RedisQueue $instance */
|
||||
return $instance->clear($queue);
|
||||
}
|
||||
/**
|
||||
@ -9916,19 +9962,30 @@
|
||||
*/
|
||||
public static function getQueue($queue)
|
||||
{
|
||||
/** @var \Illuminate\Queue\DatabaseQueue $instance */
|
||||
/** @var \Illuminate\Queue\RedisQueue $instance */
|
||||
return $instance->getQueue($queue);
|
||||
}
|
||||
/**
|
||||
* Get the underlying database instance.
|
||||
* Get the connection for the queue.
|
||||
*
|
||||
* @return \Illuminate\Database\Connection
|
||||
* @return \Illuminate\Redis\Connections\Connection
|
||||
* @static
|
||||
*/
|
||||
public static function getDatabase()
|
||||
public static function getConnection()
|
||||
{
|
||||
/** @var \Illuminate\Queue\DatabaseQueue $instance */
|
||||
return $instance->getDatabase();
|
||||
/** @var \Illuminate\Queue\RedisQueue $instance */
|
||||
return $instance->getConnection();
|
||||
}
|
||||
/**
|
||||
* Get the underlying Redis instance.
|
||||
*
|
||||
* @return \Illuminate\Contracts\Redis\Factory
|
||||
* @static
|
||||
*/
|
||||
public static function getRedis()
|
||||
{
|
||||
/** @var \Illuminate\Queue\RedisQueue $instance */
|
||||
return $instance->getRedis();
|
||||
}
|
||||
/**
|
||||
* Get the backoff for an object-based queue handler.
|
||||
@ -9939,7 +9996,7 @@
|
||||
*/
|
||||
public static function getJobBackoff($job)
|
||||
{ //Method inherited from \Illuminate\Queue\Queue
|
||||
/** @var \Illuminate\Queue\DatabaseQueue $instance */
|
||||
/** @var \Illuminate\Queue\RedisQueue $instance */
|
||||
return $instance->getJobBackoff($job);
|
||||
}
|
||||
/**
|
||||
@ -9951,7 +10008,7 @@
|
||||
*/
|
||||
public static function getJobExpiration($job)
|
||||
{ //Method inherited from \Illuminate\Queue\Queue
|
||||
/** @var \Illuminate\Queue\DatabaseQueue $instance */
|
||||
/** @var \Illuminate\Queue\RedisQueue $instance */
|
||||
return $instance->getJobExpiration($job);
|
||||
}
|
||||
/**
|
||||
@ -9963,7 +10020,7 @@
|
||||
*/
|
||||
public static function createPayloadUsing($callback)
|
||||
{ //Method inherited from \Illuminate\Queue\Queue
|
||||
\Illuminate\Queue\DatabaseQueue::createPayloadUsing($callback);
|
||||
\Illuminate\Queue\RedisQueue::createPayloadUsing($callback);
|
||||
}
|
||||
/**
|
||||
* Get the container instance being used by the connection.
|
||||
@ -9973,7 +10030,7 @@
|
||||
*/
|
||||
public static function getContainer()
|
||||
{ //Method inherited from \Illuminate\Queue\Queue
|
||||
/** @var \Illuminate\Queue\DatabaseQueue $instance */
|
||||
/** @var \Illuminate\Queue\RedisQueue $instance */
|
||||
return $instance->getContainer();
|
||||
}
|
||||
/**
|
||||
@ -9985,7 +10042,7 @@
|
||||
*/
|
||||
public static function setContainer($container)
|
||||
{ //Method inherited from \Illuminate\Queue\Queue
|
||||
/** @var \Illuminate\Queue\DatabaseQueue $instance */
|
||||
/** @var \Illuminate\Queue\RedisQueue $instance */
|
||||
$instance->setContainer($container);
|
||||
}
|
||||
|
||||
@ -17797,25 +17854,6 @@
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @method static void createSubscription(array|string $channels, \Closure $callback, string $method = 'subscribe')
|
||||
* @method static \Illuminate\Redis\Limiters\ConcurrencyLimiterBuilder funnel(string $name)
|
||||
* @method static \Illuminate\Redis\Limiters\DurationLimiterBuilder throttle(string $name)
|
||||
* @method static mixed client()
|
||||
* @method static void subscribe(array|string $channels, \Closure $callback)
|
||||
* @method static void psubscribe(array|string $channels, \Closure $callback)
|
||||
* @method static mixed command(string $method, array $parameters = [])
|
||||
* @method static void listen(\Closure $callback)
|
||||
* @method static string|null getName()
|
||||
* @method static \Illuminate\Redis\Connections\Connection setName(string $name)
|
||||
* @method static \Illuminate\Contracts\Events\Dispatcher getEventDispatcher()
|
||||
* @method static void setEventDispatcher(\Illuminate\Contracts\Events\Dispatcher $events)
|
||||
* @method static void unsetEventDispatcher()
|
||||
* @method static void macro(string $name, object|callable $macro)
|
||||
* @method static void mixin(object $mixin, bool $replace = true)
|
||||
* @method static bool hasMacro(string $name)
|
||||
* @method static void flushMacros()
|
||||
* @method static mixed macroCall(string $method, array $parameters)
|
||||
* @see \Illuminate\Redis\RedisManager
|
||||
*/
|
||||
class Redis {
|
||||
/**
|
||||
|
@ -22,7 +22,7 @@ class ClientContactFactory
|
||||
$client_contact->first_name = '';
|
||||
$client_contact->user_id = $user_id;
|
||||
$client_contact->company_id = $company_id;
|
||||
$client_contact->contact_key = Str::random(40);
|
||||
$client_contact->contact_key = Str::random(32);
|
||||
$client_contact->id = 0;
|
||||
$client_contact->send_email = true;
|
||||
|
||||
|
@ -22,7 +22,7 @@ class VendorContactFactory
|
||||
$vendor_contact->first_name = '';
|
||||
$vendor_contact->user_id = $user_id;
|
||||
$vendor_contact->company_id = $company_id;
|
||||
$vendor_contact->contact_key = Str::random(40);
|
||||
$vendor_contact->contact_key = Str::random(32);
|
||||
$vendor_contact->id = 0;
|
||||
|
||||
return $vendor_contact;
|
||||
|
@ -100,7 +100,6 @@ class PaymentFilters extends QueryFilters
|
||||
if (count($payment_filters) >0) {
|
||||
$query->whereIn('status_id', $payment_filters);
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
return $this->builder;
|
||||
|
65
app/Filters/SchedulerFilters.php
Normal file
65
app/Filters/SchedulerFilters.php
Normal file
@ -0,0 +1,65 @@
|
||||
<?php
|
||||
/**
|
||||
* Invoice Ninja (https://invoiceninja.com).
|
||||
*
|
||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||
*
|
||||
* @copyright Copyright (c) 2023. Invoice Ninja LLC (https://invoiceninja.com)
|
||||
*
|
||||
* @license https://www.elastic.co/licensing/elastic-license
|
||||
*/
|
||||
|
||||
namespace App\Filters;
|
||||
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
|
||||
/**
|
||||
* SchedulerFilters.
|
||||
*/
|
||||
class SchedulerFilters extends QueryFilters
|
||||
{
|
||||
/**
|
||||
* Filter based on search text.
|
||||
*
|
||||
* @param string query filter
|
||||
* @return Builder
|
||||
* @deprecated
|
||||
*/
|
||||
public function filter(string $filter = ''): Builder
|
||||
{
|
||||
if (strlen($filter) == 0) {
|
||||
return $this->builder;
|
||||
}
|
||||
|
||||
return $this->builder->where(function ($query) use ($filter) {
|
||||
$query->where('name', 'like', '%'.$filter.'%');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Sorts the list based on $sort.
|
||||
*
|
||||
* @param string sort formatted as column|asc
|
||||
* @return Builder
|
||||
*/
|
||||
public function sort(string $sort = ''): Builder
|
||||
{
|
||||
$sort_col = explode('|', $sort);
|
||||
|
||||
if (!is_array($sort_col) || count($sort_col) != 2) {
|
||||
return $this->builder;
|
||||
}
|
||||
|
||||
return $this->builder->orderBy($sort_col[0], $sort_col[1]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Filters the query by the users company ID.
|
||||
*
|
||||
* @return Builder
|
||||
*/
|
||||
public function entityFilter(): Builder
|
||||
{
|
||||
return $this->builder->company();
|
||||
}
|
||||
}
|
@ -50,9 +50,9 @@ class ContactHashLoginController extends Controller
|
||||
public function errorPage()
|
||||
{
|
||||
return render('generic.error', [
|
||||
'title' => session()->get('title'),
|
||||
'notification' => session()->get('notification'),
|
||||
'account' => auth()->guard('contact')?->user()?->user?->account,
|
||||
'title' => session()->get('title'),
|
||||
'notification' => session()->get('notification'),
|
||||
'account' => auth()->guard('contact')?->user()?->user?->account,
|
||||
'company' => auth()->guard('contact')?->user()?->user?->company
|
||||
]);
|
||||
}
|
||||
|
@ -12,21 +12,24 @@
|
||||
|
||||
namespace App\Http\Controllers\ClientPortal;
|
||||
|
||||
use App\Factory\PaymentFactory;
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Http\Requests\ClientPortal\Payments\PaymentResponseRequest;
|
||||
use App\Models\CompanyGateway;
|
||||
use App\Models\Invoice;
|
||||
use App\Models\Payment;
|
||||
use Illuminate\View\View;
|
||||
use App\Models\GatewayType;
|
||||
use App\Models\PaymentHash;
|
||||
use App\Models\PaymentType;
|
||||
use Illuminate\Http\Request;
|
||||
use App\Models\CompanyGateway;
|
||||
use App\Factory\PaymentFactory;
|
||||
use App\Utils\Traits\MakesHash;
|
||||
use App\Utils\Traits\MakesDates;
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Http\RedirectResponse;
|
||||
use Illuminate\Contracts\View\Factory;
|
||||
use App\PaymentDrivers\Stripe\BankTransfer;
|
||||
use App\Services\ClientPortal\InstantPayment;
|
||||
use App\Services\Subscription\SubscriptionService;
|
||||
use App\Utils\Traits\MakesDates;
|
||||
use App\Utils\Traits\MakesHash;
|
||||
use Illuminate\Contracts\View\Factory;
|
||||
use Illuminate\Http\RedirectResponse;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\View\View;
|
||||
use App\Http\Requests\ClientPortal\Payments\PaymentResponseRequest;
|
||||
|
||||
/**
|
||||
* Class PaymentController.
|
||||
@ -56,9 +59,35 @@ class PaymentController extends Controller
|
||||
public function show(Request $request, Payment $payment)
|
||||
{
|
||||
$payment->load('invoices');
|
||||
$bank_details = false;
|
||||
$payment_intent = false;
|
||||
$data = false;
|
||||
$gateway = false;
|
||||
|
||||
if($payment->gateway_type_id == GatewayType::DIRECT_DEBIT && $payment->type_id == PaymentType::DIRECT_DEBIT){
|
||||
|
||||
if (method_exists($payment->company_gateway->driver($payment->client), 'getPaymentIntent')) {
|
||||
$stripe = $payment->company_gateway->driver($payment->client);
|
||||
$payment_intent = $stripe->getPaymentIntent($payment->transaction_reference);
|
||||
|
||||
$bt = new BankTransfer($stripe);
|
||||
|
||||
match($payment->currency->code){
|
||||
'MXN' => $data = $bt->formatDataforMx($payment_intent),
|
||||
'EUR' => $data = $bt->formatDataforEur($payment_intent),
|
||||
'JPY' => $data = $bt->formatDataforJp($payment_intent),
|
||||
'GBP' => $data = $bt->formatDataforUk($payment_intent),
|
||||
};
|
||||
|
||||
$gateway = $stripe;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return $this->render('payments.show', [
|
||||
'payment' => $payment,
|
||||
'bank_details' => $payment_intent ? $data : false,
|
||||
'currency' => strtolower($payment->currency->code),
|
||||
]);
|
||||
}
|
||||
|
||||
|
@ -32,10 +32,12 @@ use App\Repositories\CreditRepository;
|
||||
use App\Repositories\InvoiceRepository;
|
||||
use App\Repositories\QuoteRepository;
|
||||
use App\Repositories\RecurringInvoiceRepository;
|
||||
use App\Services\Pdf\PdfMock;
|
||||
use App\Services\PdfMaker\Design;
|
||||
use App\Services\PdfMaker\Design as PdfDesignModel;
|
||||
use App\Services\PdfMaker\Design as PdfMakerDesign;
|
||||
use App\Services\PdfMaker\PdfMaker;
|
||||
use App\Services\Preview\StubBuilder;
|
||||
use App\Utils\HostedPDF\NinjaPdf;
|
||||
use App\Utils\HtmlEngine;
|
||||
use App\Utils\Ninja;
|
||||
@ -177,162 +179,13 @@ class PreviewController extends BaseController
|
||||
|
||||
public function design(DesignPreviewRequest $request)
|
||||
{
|
||||
if (Ninja::isHosted() && in_array($request->getHost(), ['preview.invoicing.co','staging.invoicing.co'])) {
|
||||
if (Ninja::isHosted() && !in_array($request->getHost(), ['preview.invoicing.co','staging.invoicing.co'])) {
|
||||
return response()->json(['message' => 'This server cannot handle this request.'], 400);
|
||||
}
|
||||
|
||||
$company = auth()->user()->company();
|
||||
$pdf = (new PdfMock($request->all(), auth()->user()->company()))->build()->getPdf();
|
||||
|
||||
MultiDB::setDb($company->db);
|
||||
|
||||
if ($request->input('entity') == 'quote') {
|
||||
$repo = new QuoteRepository();
|
||||
$entity_obj = QuoteFactory::create($company->id, auth()->user()->id);
|
||||
$class = Quote::class;
|
||||
} elseif ($request->input('entity') == 'credit') {
|
||||
$repo = new CreditRepository();
|
||||
$entity_obj = CreditFactory::create($company->id, auth()->user()->id);
|
||||
$class = Credit::class;
|
||||
} elseif ($request->input('entity') == 'recurring_invoice') {
|
||||
$repo = new RecurringInvoiceRepository();
|
||||
$entity_obj = RecurringInvoiceFactory::create($company->id, auth()->user()->id);
|
||||
$class = RecurringInvoice::class;
|
||||
} else { //assume it is either an invoice or a null object
|
||||
$repo = new InvoiceRepository();
|
||||
$entity_obj = InvoiceFactory::create($company->id, auth()->user()->id);
|
||||
$class = Invoice::class;
|
||||
}
|
||||
|
||||
try {
|
||||
DB::connection(config('database.default'))->beginTransaction();
|
||||
|
||||
if ($request->has('entity_id')) {
|
||||
$entity_obj = $class::on(config('database.default'))
|
||||
->with('client.company')
|
||||
->where('id', $this->decodePrimaryKey($request->input('entity_id')))
|
||||
->where('company_id', $company->id)
|
||||
->withTrashed()
|
||||
->first();
|
||||
}
|
||||
|
||||
if ($request->has('client_id')) {
|
||||
$client = Client::withTrashed()->find($this->decodePrimaryKey($request->client_id));
|
||||
if ($request->settings_type == 'client') {
|
||||
$client->settings = $request->settings;
|
||||
$client->save();
|
||||
}
|
||||
}
|
||||
|
||||
if ($request->has('group_id')) {
|
||||
$group = GroupSetting::withTrashed()->find($this->decodePrimaryKey($request->group_id));
|
||||
if ($request->settings_type == 'group') {
|
||||
$group->settings = $request->settings;
|
||||
$group->save();
|
||||
}
|
||||
}
|
||||
|
||||
if ($request->settings_type == 'company') {
|
||||
$company->settings = $request->settings;
|
||||
$company->save();
|
||||
}
|
||||
|
||||
if ($request->has('footer') && !$request->filled('footer') && $request->input('entity') == 'recurring_invoice') {
|
||||
$request->merge(['footer' => $company->settings->invoice_footer]);
|
||||
}
|
||||
|
||||
if ($request->has('terms') && !$request->filled('terms') && $request->input('entity') == 'recurring_invoice') {
|
||||
$request->merge(['terms' => $company->settings->invoice_terms]);
|
||||
}
|
||||
|
||||
$entity_obj = $repo->save($request->all(), $entity_obj);
|
||||
|
||||
if (! $request->has('entity_id')) {
|
||||
$entity_obj->service()->fillDefaults()->save();
|
||||
}
|
||||
|
||||
App::forgetInstance('translator');
|
||||
$t = app('translator');
|
||||
App::setLocale($entity_obj->client->locale());
|
||||
$t->replace(Ninja::transformTranslations($entity_obj->client->getMergedSettings()));
|
||||
|
||||
$html = new HtmlEngine($entity_obj->invitations()->first());
|
||||
|
||||
$design = \App\Models\Design::find($entity_obj->design_id);
|
||||
|
||||
/* Catch all in case migration doesn't pass back a valid design */
|
||||
if (! $design) {
|
||||
$design = \App\Models\Design::find(2);
|
||||
}
|
||||
|
||||
if ($design->is_custom) {
|
||||
$options = [
|
||||
'custom_partials' => json_decode(json_encode($design->design), true),
|
||||
];
|
||||
$template = new PdfMakerDesign(PdfDesignModel::CUSTOM, $options);
|
||||
} else {
|
||||
$template = new PdfMakerDesign(strtolower($design->name));
|
||||
}
|
||||
|
||||
$variables = $html->generateLabelsAndValues();
|
||||
|
||||
$state = [
|
||||
'template' => $template->elements([
|
||||
'client' => $entity_obj->client,
|
||||
'entity' => $entity_obj,
|
||||
'pdf_variables' => (array) $entity_obj->company->settings->pdf_variables,
|
||||
'$product' => $design->design->product,
|
||||
'variables' => $variables,
|
||||
]),
|
||||
'variables' => $variables,
|
||||
'options' => [
|
||||
'all_pages_header' => $entity_obj->client->getSetting('all_pages_header'),
|
||||
'all_pages_footer' => $entity_obj->client->getSetting('all_pages_footer'),
|
||||
],
|
||||
'process_markdown' => $entity_obj->client->company->markdown_enabled,
|
||||
];
|
||||
|
||||
$maker = new PdfMaker($state);
|
||||
|
||||
$maker
|
||||
->design($template)
|
||||
->build();
|
||||
|
||||
DB::connection(config('database.default'))->rollBack();
|
||||
|
||||
if (request()->query('html') == 'true') {
|
||||
nlog($maker->getCompiledHTML());
|
||||
return $maker->getCompiledHTML();
|
||||
}
|
||||
} catch(\Exception $e) {
|
||||
nlog($e->getMessage());
|
||||
DB::connection(config('database.default'))->rollBack();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
//if phantom js...... inject here..
|
||||
if (config('ninja.phantomjs_pdf_generation') || config('ninja.pdf_generator') == 'phantom') {
|
||||
return (new Phantom)->convertHtmlToPdf($maker->getCompiledHTML(true));
|
||||
}
|
||||
|
||||
if (config('ninja.invoiceninja_hosted_pdf_generation') || config('ninja.pdf_generator') == 'hosted_ninja') {
|
||||
$pdf = (new NinjaPdf())->build($maker->getCompiledHTML(true));
|
||||
|
||||
$numbered_pdf = $this->pageNumbering($pdf, auth()->user()->company());
|
||||
|
||||
|
||||
$numbered_pdf = $this->pageNumbering($pdf, auth()->user()->company());
|
||||
|
||||
if ($numbered_pdf) {
|
||||
$pdf = $numbered_pdf;
|
||||
}
|
||||
|
||||
return $pdf;
|
||||
}
|
||||
|
||||
$file_path = (new PreviewPdf($maker->getCompiledHTML(true), $company))->handle();
|
||||
|
||||
$response = Response::make($file_path, 200);
|
||||
$response = Response::make($pdf, 200);
|
||||
$response->header('Content-Type', 'application/pdf');
|
||||
|
||||
return $response;
|
||||
@ -340,10 +193,11 @@ class PreviewController extends BaseController
|
||||
|
||||
public function live(PreviewInvoiceRequest $request)
|
||||
{
|
||||
if (Ninja::isHosted() && !in_array($request->getHost(), ['preview.invoicing.co', 'staging.invoicing.co'])) {
|
||||
if (Ninja::isHosted() && !in_array($request->getHost(), ['preview.invoicing.co','staging.invoicing.co'])) {
|
||||
return response()->json(['message' => 'This server cannot handle this request.'], 400);
|
||||
}
|
||||
|
||||
|
||||
$company = auth()->user()->company();
|
||||
|
||||
MultiDB::setDb($company->db);
|
||||
|
@ -208,9 +208,7 @@ class SetupController extends Controller
|
||||
public function checkPdf(Request $request)
|
||||
{
|
||||
try {
|
||||
|
||||
return response(['url' => ''], 200);
|
||||
|
||||
} catch (Exception $e) {
|
||||
nlog($e->getMessage());
|
||||
|
||||
|
@ -12,6 +12,7 @@
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Factory\SchedulerFactory;
|
||||
use App\Filters\SchedulerFilters;
|
||||
use App\Http\Requests\TaskScheduler\DestroySchedulerRequest;
|
||||
use App\Http\Requests\TaskScheduler\CreateSchedulerRequest;
|
||||
use App\Http\Requests\TaskScheduler\ShowSchedulerRequest;
|
||||
@ -58,9 +59,9 @@ class TaskSchedulerController extends BaseController
|
||||
* ),
|
||||
* )
|
||||
*/
|
||||
public function index()
|
||||
public function index(SchedulerFilters $filters)
|
||||
{
|
||||
$schedulers = Scheduler::where('company_id', auth()->user()->company()->id);
|
||||
$schedulers = Scheduler::filter($filters);
|
||||
|
||||
return $this->listResponse($schedulers);
|
||||
}
|
||||
|
@ -91,7 +91,7 @@ class InvitationController extends Controller
|
||||
|
||||
$file_name = $invitation->purchase_order->numberFormatter().'.pdf';
|
||||
|
||||
$file = (new CreatePurchaseOrderPdf($invitation))->rawPdf();
|
||||
$file = (new CreatePurchaseOrderPdf($invitation))->handle();
|
||||
|
||||
$headers = ['Content-Type' => 'application/pdf'];
|
||||
|
||||
|
@ -29,8 +29,15 @@ class UploadBankIntegrationRequest extends Request
|
||||
{
|
||||
$rules = [];
|
||||
|
||||
if ($this->input('documents')) {
|
||||
$rules['documents'] = 'file|mimes:csv,png,ai,jpeg,tiff,pdf,gif,psd,txt,doc,xls,ppt,xlsx,docx,pptx|max:2000000';
|
||||
if($this->file('documents') && is_array($this->file('documents')))
|
||||
$rules['documents.*'] = $this->file_validation;
|
||||
elseif($this->file('documents'))
|
||||
$rules['documents'] = $this->file_validation;
|
||||
|
||||
if ($this->file('file') && is_array($this->file('file'))) {
|
||||
$rules['file.*'] = $this->file_validation;
|
||||
} elseif ($this->file('file')) {
|
||||
$rules['file'] = $this->file_validation;
|
||||
}
|
||||
|
||||
return $rules;
|
||||
|
@ -29,8 +29,15 @@ class UploadBankTransactionRequest extends Request
|
||||
{
|
||||
$rules = [];
|
||||
|
||||
if ($this->input('documents')) {
|
||||
$rules['documents'] = 'file|mimes:csv,png,ai,jpeg,tiff,pdf,gif,psd,txt,doc,xls,ppt,xlsx,docx,pptx|max:2000000';
|
||||
if($this->file('documents') && is_array($this->file('documents')))
|
||||
$rules['documents.*'] = $this->file_validation;
|
||||
elseif($this->file('documents'))
|
||||
$rules['documents'] = $this->file_validation;
|
||||
|
||||
if ($this->file('file') && is_array($this->file('file'))) {
|
||||
$rules['file.*'] = $this->file_validation;
|
||||
} elseif ($this->file('file')) {
|
||||
$rules['file'] = $this->file_validation;
|
||||
}
|
||||
|
||||
return $rules;
|
||||
|
@ -38,14 +38,15 @@ class StoreClientRequest extends Request
|
||||
|
||||
public function rules()
|
||||
{
|
||||
if ($this->input('documents') && is_array($this->input('documents'))) {
|
||||
$documents = count($this->input('documents'));
|
||||
if($this->file('documents') && is_array($this->file('documents')))
|
||||
$rules['documents.*'] = $this->file_validation;
|
||||
elseif($this->file('documents'))
|
||||
$rules['documents'] = $this->file_validation;
|
||||
|
||||
foreach (range(0, $documents) as $index) {
|
||||
$rules['documents.'.$index] = 'file|mimes:png,ai,jpeg,tiff,pdf,gif,psd,txt,doc,xls,ppt,xlsx,docx,pptx|max:20000';
|
||||
}
|
||||
} elseif ($this->input('documents')) {
|
||||
$rules['documents'] = 'file|mimes:png,ai,jpeg,tiff,pdf,gif,psd,txt,doc,xls,ppt,xlsx,docx,pptx|max:20000';
|
||||
if ($this->file('file') && is_array($this->file('file'))) {
|
||||
$rules['file.*'] = $this->file_validation;
|
||||
} elseif ($this->file('file')) {
|
||||
$rules['file'] = $this->file_validation;
|
||||
}
|
||||
|
||||
if (isset($this->number)) {
|
||||
|
@ -38,14 +38,15 @@ class UpdateClientRequest extends Request
|
||||
{
|
||||
/* Ensure we have a client name, and that all emails are unique*/
|
||||
|
||||
if ($this->input('documents') && is_array($this->input('documents'))) {
|
||||
$documents = count($this->input('documents'));
|
||||
if($this->file('documents') && is_array($this->file('documents')))
|
||||
$rules['documents.*'] = $this->file_validation;
|
||||
elseif($this->file('documents'))
|
||||
$rules['documents'] = $this->file_validation;
|
||||
|
||||
foreach (range(0, $documents) as $index) {
|
||||
$rules['documents.'.$index] = 'file|mimes:png,ai,jpeg,tiff,pdf,gif,psd,txt,doc,xls,ppt,xlsx,docx,pptx|max:20000';
|
||||
}
|
||||
} elseif ($this->input('documents')) {
|
||||
$rules['documents'] = 'file|mimes:png,ai,jpeg,tiff,pdf,gif,psd,txt,doc,xls,ppt,xlsx,docx,pptx|max:20000';
|
||||
if ($this->file('file') && is_array($this->file('file'))) {
|
||||
$rules['file.*'] = $this->file_validation;
|
||||
} elseif ($this->file('file')) {
|
||||
$rules['file'] = $this->file_validation;
|
||||
}
|
||||
|
||||
$rules['company_logo'] = 'mimes:jpeg,jpg,png,gif|max:10000';
|
||||
|
@ -29,8 +29,15 @@ class UploadClientRequest extends Request
|
||||
{
|
||||
$rules = [];
|
||||
|
||||
if ($this->input('documents')) {
|
||||
$rules['documents'] = 'file|mimes:csv,png,ai,jpeg,tiff,pdf,gif,psd,txt,doc,xls,ppt,xlsx,docx,pptx|max:2000000';
|
||||
if($this->file('documents') && is_array($this->file('documents')))
|
||||
$rules['documents.*'] = $this->file_validation;
|
||||
elseif($this->file('documents'))
|
||||
$rules['documents'] = $this->file_validation;
|
||||
|
||||
if ($this->file('file') && is_array($this->file('file'))) {
|
||||
$rules['file.*'] = $this->file_validation;
|
||||
} elseif ($this->file('file')) {
|
||||
$rules['file'] = $this->file_validation;
|
||||
}
|
||||
|
||||
return $rules;
|
||||
|
@ -29,8 +29,15 @@ class UploadCompanyRequest extends Request
|
||||
{
|
||||
$rules = [];
|
||||
|
||||
if ($this->input('documents')) {
|
||||
$rules['documents'] = 'file|mimes:png,ai,jpeg,tiff,pdf,gif,psd,txt,doc,xls,ppt,xlsx,docx,pptx|max:20000';
|
||||
if($this->file('documents') && is_array($this->file('documents')))
|
||||
$rules['documents.*'] = $this->file_validation;
|
||||
elseif($this->file('documents'))
|
||||
$rules['documents'] = $this->file_validation;
|
||||
|
||||
if ($this->file('file') && is_array($this->file('file'))) {
|
||||
$rules['file.*'] = $this->file_validation;
|
||||
} elseif ($this->file('file')) {
|
||||
$rules['file'] = $this->file_validation;
|
||||
}
|
||||
|
||||
return $rules;
|
||||
|
@ -43,14 +43,15 @@ class StoreCreditRequest extends Request
|
||||
{
|
||||
$rules = [];
|
||||
|
||||
if ($this->input('documents') && is_array($this->input('documents'))) {
|
||||
$documents = count($this->input('documents'));
|
||||
if($this->file('documents') && is_array($this->file('documents')))
|
||||
$rules['documents.*'] = $this->file_validation;
|
||||
elseif($this->file('documents'))
|
||||
$rules['documents'] = $this->file_validation;
|
||||
|
||||
foreach (range(0, $documents) as $index) {
|
||||
$rules['documents.'.$index] = 'file|mimes:png,ai,jpeg,tiff,pdf,gif,psd,txt,doc,xls,ppt,xlsx,docx,pptx|max:20000';
|
||||
}
|
||||
} elseif ($this->input('documents')) {
|
||||
$rules['documents'] = 'file|mimes:png,ai,jpeg,tiff,pdf,gif,psd,txt,doc,xls,ppt,xlsx,docx,pptx|max:20000';
|
||||
if ($this->file('file') && is_array($this->file('file'))) {
|
||||
$rules['file.*'] = $this->file_validation;
|
||||
} elseif ($this->file('file')) {
|
||||
$rules['file'] = $this->file_validation;
|
||||
}
|
||||
|
||||
$rules['client_id'] = 'required|exists:clients,id,company_id,'.auth()->user()->company()->id;
|
||||
|
@ -41,15 +41,16 @@ class UpdateCreditRequest extends Request
|
||||
public function rules()
|
||||
{
|
||||
$rules = [];
|
||||
|
||||
if($this->file('documents') && is_array($this->file('documents')))
|
||||
$rules['documents.*'] = $this->file_validation;
|
||||
elseif($this->file('documents'))
|
||||
$rules['documents'] = $this->file_validation;
|
||||
|
||||
if ($this->input('documents') && is_array($this->input('documents'))) {
|
||||
$documents = count($this->input('documents'));
|
||||
|
||||
foreach (range(0, $documents) as $index) {
|
||||
$rules['documents.'.$index] = 'file|mimes:png,ai,jpeg,tiff,pdf,gif,psd,txt,doc,xls,ppt,xlsx,docx,pptx|max:20000';
|
||||
}
|
||||
} elseif ($this->input('documents')) {
|
||||
$rules['documents'] = 'file|mimes:png,ai,jpeg,tiff,pdf,gif,psd,txt,doc,xls,ppt,xlsx,docx,pptx|max:20000';
|
||||
if ($this->file('file') && is_array($this->file('file'))) {
|
||||
$rules['file.*'] = $this->file_validation;
|
||||
} elseif ($this->file('file')) {
|
||||
$rules['file'] = $this->file_validation;
|
||||
}
|
||||
|
||||
if ($this->number) {
|
||||
|
@ -29,8 +29,15 @@ class UploadCreditRequest extends Request
|
||||
{
|
||||
$rules = [];
|
||||
|
||||
if ($this->input('documents')) {
|
||||
$rules['documents'] = 'file|mimes:csv,png,ai,jpeg,tiff,pdf,gif,psd,txt,doc,xls,ppt,xlsx,docx,pptx|max:2000000';
|
||||
if($this->file('documents') && is_array($this->file('documents')))
|
||||
$rules['documents.*'] = $this->file_validation;
|
||||
elseif($this->file('documents'))
|
||||
$rules['documents'] = $this->file_validation;
|
||||
|
||||
if ($this->file('file') && is_array($this->file('file'))) {
|
||||
$rules['file.*'] = $this->file_validation;
|
||||
} elseif ($this->file('file')) {
|
||||
$rules['file'] = $this->file_validation;
|
||||
}
|
||||
|
||||
return $rules;
|
||||
|
@ -29,8 +29,15 @@ class UploadExpenseRequest extends Request
|
||||
{
|
||||
$rules = [];
|
||||
|
||||
if ($this->input('documents')) {
|
||||
$rules['documents'] = 'file|mimes:csv,png,ai,jpeg,tiff,pdf,gif,psd,txt,doc,xls,ppt,xlsx,docx,pptx|max:2000000';
|
||||
if($this->file('documents') && is_array($this->file('documents')))
|
||||
$rules['documents.*'] = $this->file_validation;
|
||||
elseif($this->file('documents'))
|
||||
$rules['documents'] = $this->file_validation;
|
||||
|
||||
if ($this->file('file') && is_array($this->file('file'))) {
|
||||
$rules['file.*'] = $this->file_validation;
|
||||
} elseif ($this->file('file')) {
|
||||
$rules['file'] = $this->file_validation;
|
||||
}
|
||||
|
||||
return $rules;
|
||||
|
@ -29,10 +29,17 @@ class UploadGroupSettingRequest extends Request
|
||||
{
|
||||
$rules = [];
|
||||
|
||||
if ($this->input('documents')) {
|
||||
$rules['documents'] = 'file|mimes:csv,png,ai,jpeg,tiff,pdf,gif,psd,txt,doc,xls,ppt,xlsx,docx,pptx|max:2000000';
|
||||
}
|
||||
if($this->file('documents') && is_array($this->file('documents')))
|
||||
$rules['documents.*'] = $this->file_validation;
|
||||
elseif($this->file('documents'))
|
||||
$rules['documents'] = $this->file_validation;
|
||||
|
||||
if ($this->file('file') && is_array($this->file('file'))) {
|
||||
$rules['file.*'] = $this->file_validation;
|
||||
} elseif ($this->file('file')) {
|
||||
$rules['file'] = $this->file_validation;
|
||||
}
|
||||
|
||||
return $rules;
|
||||
}
|
||||
}
|
||||
|
@ -37,24 +37,15 @@ class StoreInvoiceRequest extends Request
|
||||
{
|
||||
$rules = [];
|
||||
|
||||
if ($this->input('documents') && is_array($this->input('documents'))) {
|
||||
$documents = count($this->input('documents'));
|
||||
if($this->file('documents') && is_array($this->file('documents')))
|
||||
$rules['documents.*'] = $this->file_validation;
|
||||
elseif($this->file('documents'))
|
||||
$rules['documents'] = $this->file_validation;
|
||||
|
||||
foreach (range(0, $documents) as $index) {
|
||||
$rules['documents.'.$index] = 'file|mimes:png,ai,jpeg,tiff,pdf,gif,psd,txt,doc,xls,ppt,xlsx,docx,pptx|max:20000';
|
||||
}
|
||||
} elseif ($this->input('documents')) {
|
||||
$rules['documents'] = 'file|mimes:png,ai,jpeg,tiff,pdf,gif,psd,txt,doc,xls,ppt,xlsx,docx,pptx|max:20000';
|
||||
}
|
||||
|
||||
if ($this->input('file') && is_array($this->input('file'))) {
|
||||
$documents = count($this->input('file'));
|
||||
|
||||
foreach (range(0, $documents) as $index) {
|
||||
$rules['file.'.$index] = 'file|mimes:png,ai,jpeg,tiff,pdf,gif,psd,txt,doc,xls,ppt,xlsx,docx,pptx|max:20000';
|
||||
}
|
||||
} elseif ($this->input('file')) {
|
||||
$rules['file'] = 'file|mimes:png,ai,jpeg,tiff,pdf,gif,psd,txt,doc,xls,ppt,xlsx,docx,pptx|max:20000';
|
||||
if ($this->file('file') && is_array($this->file('file'))) {
|
||||
$rules['file.*'] = $this->file_validation;
|
||||
} elseif ($this->file('file')) {
|
||||
$rules['file'] = $this->file_validation;
|
||||
}
|
||||
|
||||
$rules['client_id'] = 'bail|required|exists:clients,id,company_id,'.auth()->user()->company()->id.',is_deleted,0';
|
||||
|
@ -39,14 +39,15 @@ class UpdateInvoiceRequest extends Request
|
||||
{
|
||||
$rules = [];
|
||||
|
||||
if ($this->input('documents') && is_array($this->input('documents'))) {
|
||||
$documents = count($this->input('documents'));
|
||||
if($this->file('documents') && is_array($this->file('documents')))
|
||||
$rules['documents.*'] = $this->file_validation;
|
||||
elseif($this->file('documents'))
|
||||
$rules['documents'] = $this->file_validation;
|
||||
|
||||
foreach (range(0, $documents) as $index) {
|
||||
$rules['documents.'.$index] = 'file|mimes:png,ai,jpeg,tiff,pdf,gif,psd,txt,doc,xls,ppt,xlsx,docx,pptx|max:20000';
|
||||
}
|
||||
} elseif ($this->input('documents')) {
|
||||
$rules['documents'] = 'file|mimes:png,ai,jpeg,tiff,pdf,gif,psd,txt,doc,xls,ppt,xlsx,docx,pptx|max:20000';
|
||||
if ($this->file('file') && is_array($this->file('file'))) {
|
||||
$rules['file.*'] = $this->file_validation;
|
||||
} elseif ($this->file('file')) {
|
||||
$rules['file'] = $this->file_validation;
|
||||
}
|
||||
|
||||
$rules['id'] = new LockedInvoiceRule($this->invoice);
|
||||
|
@ -29,14 +29,22 @@ class UploadInvoiceRequest extends Request
|
||||
{
|
||||
$rules = [];
|
||||
|
||||
if ($this->input('documents')) {
|
||||
$rules['documents'] = 'file|mimes:csv,png,ai,jpeg,tiff,pdf,gif,psd,txt,doc,xls,ppt,xlsx,docx,pptx|max:2000000';
|
||||
}
|
||||
if($this->file('documents') && is_array($this->file('documents')))
|
||||
$rules['documents.*'] = $this->file_validation;
|
||||
elseif($this->file('documents'))
|
||||
$rules['documents'] = $this->file_validation;
|
||||
|
||||
if ($this->input('file')) {
|
||||
$rules['file'] = 'file|mimes:csv,png,ai,jpeg,tiff,pdf,gif,psd,txt,doc,xls,ppt,xlsx,docx,pptx|max:2000000';
|
||||
if ($this->file('file') && is_array($this->file('file'))) {
|
||||
$rules['file.*'] = $this->file_validation;
|
||||
} elseif ($this->file('file')) {
|
||||
$rules['file'] = $this->file_validation;
|
||||
}
|
||||
|
||||
return $rules;
|
||||
}
|
||||
|
||||
public function prepareForValidation()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -113,16 +113,17 @@ class StorePaymentRequest extends Request
|
||||
|
||||
];
|
||||
|
||||
if ($this->input('documents') && is_array($this->input('documents'))) {
|
||||
$documents = count($this->input('documents'));
|
||||
if($this->file('documents') && is_array($this->file('documents')))
|
||||
$rules['documents.*'] = $this->file_validation;
|
||||
elseif($this->file('documents'))
|
||||
$rules['documents'] = $this->file_validation;
|
||||
|
||||
foreach (range(0, $documents) as $index) {
|
||||
$rules['documents.'.$index] = 'file|mimes:png,ai,jpeg,tiff,pdf,gif,psd,txt,doc,xls,ppt,xlsx,docx,pptx|max:20000';
|
||||
}
|
||||
} elseif ($this->input('documents')) {
|
||||
$rules['documents'] = 'file|mimes:png,ai,jpeg,tiff,pdf,gif,psd,txt,doc,xls,ppt,xlsx,docx,pptx|max:20000';
|
||||
if ($this->file('file') && is_array($this->file('file'))) {
|
||||
$rules['file.*'] = $this->file_validation;
|
||||
} elseif ($this->file('file')) {
|
||||
$rules['file'] = $this->file_validation;
|
||||
}
|
||||
|
||||
|
||||
return $rules;
|
||||
}
|
||||
}
|
||||
|
@ -38,23 +38,23 @@ class UpdatePaymentRequest extends Request
|
||||
$rules = [
|
||||
'invoices' => ['array', new PaymentAppliedValidAmount, new ValidCreditsPresentRule($this->all())],
|
||||
'invoices.*.invoice_id' => 'distinct',
|
||||
'documents' => 'mimes:png,ai,jpeg,tiff,pdf,gif,psd,txt,doc,xls,ppt,xlsx,docx,pptx',
|
||||
];
|
||||
|
||||
if ($this->number) {
|
||||
$rules['number'] = Rule::unique('payments')->where('company_id', auth()->user()->company()->id)->ignore($this->payment->id);
|
||||
}
|
||||
|
||||
if ($this->input('documents') && is_array($this->input('documents'))) {
|
||||
$documents = count($this->input('documents'));
|
||||
if($this->file('documents') && is_array($this->file('documents')))
|
||||
$rules['documents.*'] = $this->file_validation;
|
||||
elseif($this->file('documents'))
|
||||
$rules['documents'] = $this->file_validation;
|
||||
|
||||
foreach (range(0, $documents) as $index) {
|
||||
$rules['documents.'.$index] = 'file|mimes:png,ai,jpeg,tiff,pdf,gif,psd,txt,doc,xls,ppt,xlsx,docx,pptx|max:20000';
|
||||
}
|
||||
} elseif ($this->input('documents')) {
|
||||
$rules['documents'] = 'file|mimes:png,ai,jpeg,tiff,pdf,gif,psd,txt,doc,xls,ppt,xlsx,docx,pptx|max:20000';
|
||||
if ($this->file('file') && is_array($this->file('file'))) {
|
||||
$rules['file.*'] = $this->file_validation;
|
||||
} elseif ($this->file('file')) {
|
||||
$rules['file'] = $this->file_validation;
|
||||
}
|
||||
|
||||
|
||||
return $rules;
|
||||
}
|
||||
|
||||
|
@ -29,8 +29,15 @@ class UploadPaymentRequest extends Request
|
||||
{
|
||||
$rules = [];
|
||||
|
||||
if ($this->input('documents')) {
|
||||
$rules['documents'] = 'file|mimes:csv,png,ai,jpeg,tiff,pdf,gif,psd,txt,doc,xls,ppt,xlsx,docx,pptx|max:2000000';
|
||||
if($this->file('documents') && is_array($this->file('documents')))
|
||||
$rules['documents.*'] = $this->file_validation;
|
||||
elseif($this->file('documents'))
|
||||
$rules['documents'] = $this->file_validation;
|
||||
|
||||
if ($this->file('file') && is_array($this->file('file'))) {
|
||||
$rules['file.*'] = $this->file_validation;
|
||||
} elseif ($this->file('file')) {
|
||||
$rules['file'] = $this->file_validation;
|
||||
}
|
||||
|
||||
return $rules;
|
||||
|
@ -42,8 +42,7 @@ class DesignPreviewRequest extends Request
|
||||
public function rules()
|
||||
{
|
||||
$rules = [
|
||||
'entity' => 'bail|sometimes|string',
|
||||
'entity_id' => 'bail|sometimes|string',
|
||||
'entity_type' => 'bail|required|in:invoice,quote,credit,purchase_order',
|
||||
'settings_type' => 'bail|required|in:company,group,client',
|
||||
'settings' => 'sometimes',
|
||||
'group_id' => 'sometimes',
|
||||
|
@ -28,14 +28,15 @@ class StoreProductRequest extends Request
|
||||
|
||||
public function rules()
|
||||
{
|
||||
if ($this->input('documents') && is_array($this->input('documents'))) {
|
||||
$documents = count($this->input('documents'));
|
||||
if($this->file('documents') && is_array($this->file('documents')))
|
||||
$rules['documents.*'] = $this->file_validation;
|
||||
elseif($this->file('documents'))
|
||||
$rules['documents'] = $this->file_validation;
|
||||
|
||||
foreach (range(0, $documents) as $index) {
|
||||
$rules['documents.'.$index] = 'file|mimes:png,ai,jpeg,tiff,pdf,gif,psd,txt,doc,xls,ppt,xlsx,docx,pptx|max:20000';
|
||||
}
|
||||
} elseif ($this->input('documents')) {
|
||||
$rules['documents'] = 'file|mimes:png,ai,jpeg,tiff,pdf,gif,psd,txt,doc,xls,ppt,xlsx,docx,pptx|max:20000';
|
||||
if ($this->file('file') && is_array($this->file('file'))) {
|
||||
$rules['file.*'] = $this->file_validation;
|
||||
} elseif ($this->file('file')) {
|
||||
$rules['file'] = $this->file_validation;
|
||||
}
|
||||
|
||||
$rules['cost'] = 'sometimes|numeric';
|
||||
|
@ -31,16 +31,17 @@ class UpdateProductRequest extends Request
|
||||
|
||||
public function rules()
|
||||
{
|
||||
if ($this->input('documents') && is_array($this->input('documents'))) {
|
||||
$documents = count($this->input('documents'));
|
||||
if($this->file('documents') && is_array($this->file('documents')))
|
||||
$rules['documents.*'] = $this->file_validation;
|
||||
elseif($this->file('documents'))
|
||||
$rules['documents'] = $this->file_validation;
|
||||
|
||||
foreach (range(0, $documents) as $index) {
|
||||
$rules['documents.'.$index] = 'file|mimes:png,ai,jpeg,tiff,pdf,gif,psd,txt,doc,xls,ppt,xlsx,docx,pptx|max:20000';
|
||||
}
|
||||
} elseif ($this->input('documents')) {
|
||||
$rules['documents'] = 'file|mimes:png,ai,jpeg,tiff,pdf,gif,psd,txt,doc,xls,ppt,xlsx,docx,pptx|max:20000';
|
||||
if ($this->file('file') && is_array($this->file('file'))) {
|
||||
$rules['file.*'] = $this->file_validation;
|
||||
} elseif ($this->file('file')) {
|
||||
$rules['file'] = $this->file_validation;
|
||||
}
|
||||
|
||||
|
||||
$rules['cost'] = 'numeric';
|
||||
$rules['price'] = 'numeric';
|
||||
$rules['quantity'] = 'numeric';
|
||||
|
@ -28,9 +28,15 @@ class UploadProductRequest extends Request
|
||||
public function rules()
|
||||
{
|
||||
$rules = [];
|
||||
if($this->file('documents') && is_array($this->file('documents')))
|
||||
$rules['documents.*'] = $this->file_validation;
|
||||
elseif($this->file('documents'))
|
||||
$rules['documents'] = $this->file_validation;
|
||||
|
||||
if ($this->input('documents')) {
|
||||
$rules['documents'] = 'file|mimes:csv,png,ai,jpeg,tiff,pdf,gif,psd,txt,doc,xls,ppt,xlsx,docx,pptx|max:2000000';
|
||||
if ($this->file('file') && is_array($this->file('file'))) {
|
||||
$rules['file.*'] = $this->file_validation;
|
||||
} elseif ($this->file('file')) {
|
||||
$rules['file'] = $this->file_validation;
|
||||
}
|
||||
|
||||
return $rules;
|
||||
|
@ -11,6 +11,7 @@
|
||||
|
||||
namespace App\Http\Requests\Project;
|
||||
|
||||
use App\Models\Project;
|
||||
use App\Http\Requests\Request;
|
||||
|
||||
class CreateProjectRequest extends Request
|
||||
@ -22,6 +23,7 @@ class CreateProjectRequest extends Request
|
||||
*/
|
||||
public function authorize() : bool
|
||||
{
|
||||
return auth()->user()->isAdmin();
|
||||
return auth()->user()->can('create', Project::class);
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -22,6 +22,6 @@ class DestroyProjectRequest extends Request
|
||||
*/
|
||||
public function authorize() : bool
|
||||
{
|
||||
return auth()->user()->isAdmin();
|
||||
return auth()->user()->can('edit', $this->project);
|
||||
}
|
||||
}
|
||||
|
@ -22,7 +22,7 @@ class EditProjectRequest extends Request
|
||||
*/
|
||||
public function authorize() : bool
|
||||
{
|
||||
return auth()->user()->isAdmin();
|
||||
return auth()->user()->can('edit', $this->project);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -22,7 +22,9 @@ class ShowProjectRequest extends Request
|
||||
*/
|
||||
public function authorize() : bool
|
||||
{
|
||||
return auth()->user()->isAdmin();
|
||||
// return auth()->user()->isAdmin();
|
||||
return auth()->user()->can('view', $this->project);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -42,6 +42,17 @@ class StoreProjectRequest extends Request
|
||||
$rules['number'] = Rule::unique('projects')->where('company_id', auth()->user()->company()->id);
|
||||
}
|
||||
|
||||
if($this->file('documents') && is_array($this->file('documents')))
|
||||
$rules['documents.*'] = $this->file_validation;
|
||||
elseif($this->file('documents'))
|
||||
$rules['documents'] = $this->file_validation;
|
||||
|
||||
if ($this->file('file') && is_array($this->file('file'))) {
|
||||
$rules['file.*'] = $this->file_validation;
|
||||
} elseif ($this->file('file')) {
|
||||
$rules['file'] = $this->file_validation;
|
||||
}
|
||||
|
||||
return $this->globalRules($rules);
|
||||
}
|
||||
|
||||
|
@ -37,6 +37,17 @@ class UpdateProjectRequest extends Request
|
||||
$rules['number'] = Rule::unique('projects')->where('company_id', auth()->user()->company()->id)->ignore($this->project->id);
|
||||
}
|
||||
|
||||
if($this->file('documents') && is_array($this->file('documents')))
|
||||
$rules['documents.*'] = $this->file_validation;
|
||||
elseif($this->file('documents'))
|
||||
$rules['documents'] = $this->file_validation;
|
||||
|
||||
if ($this->file('file') && is_array($this->file('file'))) {
|
||||
$rules['file.*'] = $this->file_validation;
|
||||
} elseif ($this->file('file')) {
|
||||
$rules['file'] = $this->file_validation;
|
||||
}
|
||||
|
||||
return $this->globalRules($rules);
|
||||
}
|
||||
|
||||
|
@ -29,8 +29,15 @@ class UploadProjectRequest extends Request
|
||||
{
|
||||
$rules = [];
|
||||
|
||||
if ($this->input('documents')) {
|
||||
$rules['documents'] = 'file|mimes:csv,png,ai,jpeg,tiff,pdf,gif,psd,txt,doc,xls,ppt,xlsx,docx,pptx|max:2000000';
|
||||
if($this->file('documents') && is_array($this->file('documents')))
|
||||
$rules['documents.*'] = $this->file_validation;
|
||||
elseif($this->file('documents'))
|
||||
$rules['documents'] = $this->file_validation;
|
||||
|
||||
if ($this->file('file') && is_array($this->file('file'))) {
|
||||
$rules['file.*'] = $this->file_validation;
|
||||
} elseif ($this->file('file')) {
|
||||
$rules['file'] = $this->file_validation;
|
||||
}
|
||||
|
||||
return $rules;
|
||||
|
@ -47,6 +47,17 @@ class StorePurchaseOrderRequest extends Request
|
||||
$rules['is_amount_discount'] = ['boolean'];
|
||||
$rules['line_items'] = 'array';
|
||||
|
||||
if($this->file('documents') && is_array($this->file('documents')))
|
||||
$rules['documents.*'] = $this->file_validation;
|
||||
elseif($this->file('documents'))
|
||||
$rules['documents'] = $this->file_validation;
|
||||
|
||||
if ($this->file('file') && is_array($this->file('file'))) {
|
||||
$rules['file.*'] = $this->file_validation;
|
||||
} elseif ($this->file('file')) {
|
||||
$rules['file'] = $this->file_validation;
|
||||
}
|
||||
|
||||
return $rules;
|
||||
}
|
||||
|
||||
|
@ -50,6 +50,17 @@ class UpdatePurchaseOrderRequest extends Request
|
||||
$rules['discount'] = 'sometimes|numeric';
|
||||
$rules['is_amount_discount'] = ['boolean'];
|
||||
|
||||
if($this->file('documents') && is_array($this->file('documents')))
|
||||
$rules['documents.*'] = $this->file_validation;
|
||||
elseif($this->file('documents'))
|
||||
$rules['documents'] = $this->file_validation;
|
||||
|
||||
if ($this->file('file') && is_array($this->file('file'))) {
|
||||
$rules['file.*'] = $this->file_validation;
|
||||
} elseif ($this->file('file')) {
|
||||
$rules['file'] = $this->file_validation;
|
||||
}
|
||||
|
||||
return $rules;
|
||||
}
|
||||
|
||||
|
@ -29,10 +29,17 @@ class UploadPurchaseOrderRequest extends Request
|
||||
{
|
||||
$rules = [];
|
||||
|
||||
if ($this->input('documents')) {
|
||||
$rules['documents'] = 'file|mimes:csv,png,ai,jpeg,tiff,pdf,gif,psd,txt,doc,xls,ppt,xlsx,docx,pptx|max:2000000';
|
||||
}
|
||||
if($this->file('documents') && is_array($this->file('documents')))
|
||||
$rules['documents.*'] = $this->file_validation;
|
||||
elseif($this->file('documents'))
|
||||
$rules['documents'] = $this->file_validation;
|
||||
|
||||
if ($this->file('file') && is_array($this->file('file'))) {
|
||||
$rules['file.*'] = $this->file_validation;
|
||||
} elseif ($this->file('file')) {
|
||||
$rules['file'] = $this->file_validation;
|
||||
}
|
||||
|
||||
return $rules;
|
||||
}
|
||||
}
|
||||
|
@ -39,16 +39,17 @@ class StoreQuoteRequest extends Request
|
||||
|
||||
$rules['client_id'] = 'required|exists:clients,id,company_id,'.auth()->user()->company()->id;
|
||||
|
||||
if ($this->input('documents') && is_array($this->input('documents'))) {
|
||||
$documents = count($this->input('documents'));
|
||||
if($this->file('documents') && is_array($this->file('documents')))
|
||||
$rules['documents.*'] = $this->file_validation;
|
||||
elseif($this->file('documents'))
|
||||
$rules['documents'] = $this->file_validation;
|
||||
|
||||
foreach (range(0, $documents) as $index) {
|
||||
$rules['documents.'.$index] = 'file|mimes:png,ai,jpeg,tiff,pdf,gif,psd,txt,doc,xls,ppt,xlsx,docx,pptx|max:20000';
|
||||
}
|
||||
} elseif ($this->input('documents')) {
|
||||
$rules['documents'] = 'file|mimes:png,ai,jpeg,tiff,pdf,gif,psd,txt,doc,xls,ppt,xlsx,docx,pptx|max:20000';
|
||||
if ($this->file('file') && is_array($this->file('file'))) {
|
||||
$rules['file.*'] = $this->file_validation;
|
||||
} elseif ($this->file('file')) {
|
||||
$rules['file'] = $this->file_validation;
|
||||
}
|
||||
|
||||
|
||||
$rules['number'] = ['nullable', Rule::unique('quotes')->where('company_id', auth()->user()->company()->id)];
|
||||
$rules['discount'] = 'sometimes|numeric';
|
||||
|
||||
|
@ -37,16 +37,18 @@ class UpdateQuoteRequest extends Request
|
||||
{
|
||||
$rules = [];
|
||||
|
||||
if ($this->input('documents') && is_array($this->input('documents'))) {
|
||||
$documents = count($this->input('documents'));
|
||||
if($this->file('documents') && is_array($this->file('documents')))
|
||||
$rules['documents.*'] = $this->file_validation;
|
||||
elseif($this->file('documents'))
|
||||
$rules['documents'] = $this->file_validation;
|
||||
|
||||
foreach (range(0, $documents) as $index) {
|
||||
$rules['documents.'.$index] = 'file|mimes:png,ai,jpeg,tiff,pdf,gif,psd,txt,doc,xls,ppt,xlsx,docx,pptx|max:20000';
|
||||
}
|
||||
} elseif ($this->input('documents')) {
|
||||
$rules['documents'] = 'file|mimes:png,ai,jpeg,tiff,pdf,gif,psd,txt,doc,xls,ppt,xlsx,docx,pptx|max:20000';
|
||||
if ($this->file('file') && is_array($this->file('file'))) {
|
||||
$rules['file.*'] = $this->file_validation;
|
||||
} elseif ($this->file('file')) {
|
||||
$rules['file'] = $this->file_validation;
|
||||
}
|
||||
|
||||
|
||||
if ($this->number) {
|
||||
$rules['number'] = Rule::unique('quotes')->where('company_id', auth()->user()->company()->id)->ignore($this->quote->id);
|
||||
}
|
||||
|
@ -28,9 +28,16 @@ class UploadQuoteRequest extends Request
|
||||
public function rules()
|
||||
{
|
||||
$rules = [];
|
||||
|
||||
if($this->file('documents') && is_array($this->file('documents')))
|
||||
$rules['documents.*'] = $this->file_validation;
|
||||
elseif($this->file('documents'))
|
||||
$rules['documents'] = $this->file_validation;
|
||||
|
||||
if ($this->input('documents')) {
|
||||
$rules['documents'] = 'file|mimes:csv,png,ai,jpeg,tiff,pdf,gif,psd,txt,doc,xls,ppt,xlsx,docx,pptx|max:2000000';
|
||||
if ($this->file('file') && is_array($this->file('file'))) {
|
||||
$rules['file.*'] = $this->file_validation;
|
||||
} elseif ($this->file('file')) {
|
||||
$rules['file'] = $this->file_validation;
|
||||
}
|
||||
|
||||
return $rules;
|
||||
|
@ -48,6 +48,17 @@ class StoreRecurringExpenseRequest extends Request
|
||||
$rules['tax_amount2'] = 'numeric';
|
||||
$rules['tax_amount3'] = 'numeric';
|
||||
|
||||
if($this->file('documents') && is_array($this->file('documents')))
|
||||
$rules['documents.*'] = $this->file_validation;
|
||||
elseif($this->file('documents'))
|
||||
$rules['documents'] = $this->file_validation;
|
||||
|
||||
if ($this->file('file') && is_array($this->file('file'))) {
|
||||
$rules['file.*'] = $this->file_validation;
|
||||
} elseif ($this->file('file')) {
|
||||
$rules['file'] = $this->file_validation;
|
||||
}
|
||||
|
||||
return $this->globalRules($rules);
|
||||
}
|
||||
|
||||
|
@ -48,6 +48,17 @@ class UpdateRecurringExpenseRequest extends Request
|
||||
$rules['tax_amount3'] = 'numeric';
|
||||
$rules['category_id'] = 'bail|nullable|sometimes|exists:expense_categories,id,company_id,'.auth()->user()->company()->id.',is_deleted,0';
|
||||
|
||||
if($this->file('documents') && is_array($this->file('documents')))
|
||||
$rules['documents.*'] = $this->file_validation;
|
||||
elseif($this->file('documents'))
|
||||
$rules['documents'] = $this->file_validation;
|
||||
|
||||
if ($this->file('file') && is_array($this->file('file'))) {
|
||||
$rules['file.*'] = $this->file_validation;
|
||||
} elseif ($this->file('file')) {
|
||||
$rules['file'] = $this->file_validation;
|
||||
}
|
||||
|
||||
return $this->globalRules($rules);
|
||||
}
|
||||
|
||||
|
@ -29,8 +29,15 @@ class UploadRecurringExpenseRequest extends Request
|
||||
{
|
||||
$rules = [];
|
||||
|
||||
if ($this->input('documents')) {
|
||||
$rules['documents'] = 'file|mimes:csv,png,ai,jpeg,tiff,pdf,gif,psd,txt,doc,xls,ppt,xlsx,docx,pptx|max:2000000';
|
||||
if($this->file('documents') && is_array($this->file('documents')))
|
||||
$rules['documents.*'] = $this->file_validation;
|
||||
elseif($this->file('documents'))
|
||||
$rules['documents'] = $this->file_validation;
|
||||
|
||||
if ($this->file('file') && is_array($this->file('file'))) {
|
||||
$rules['file.*'] = $this->file_validation;
|
||||
} elseif ($this->file('file')) {
|
||||
$rules['file'] = $this->file_validation;
|
||||
}
|
||||
|
||||
return $rules;
|
||||
|
@ -38,14 +38,15 @@ class StoreRecurringInvoiceRequest extends Request
|
||||
{
|
||||
$rules = [];
|
||||
|
||||
if ($this->input('documents') && is_array($this->input('documents'))) {
|
||||
$documents = count($this->input('documents'));
|
||||
if($this->file('documents') && is_array($this->file('documents')))
|
||||
$rules['documents.*'] = $this->file_validation;
|
||||
elseif($this->file('documents'))
|
||||
$rules['documents'] = $this->file_validation;
|
||||
|
||||
foreach (range(0, $documents) as $index) {
|
||||
$rules['documents.'.$index] = 'file|mimes:png,ai,jpeg,tiff,pdf,gif,psd,txt,doc,xls,ppt,xlsx,docx,pptx|max:20000';
|
||||
}
|
||||
} elseif ($this->input('documents')) {
|
||||
$rules['documents'] = 'file|mimes:png,ai,jpeg,tiff,pdf,gif,psd,txt,doc,xls,ppt,xlsx,docx,pptx|max:20000';
|
||||
if ($this->file('file') && is_array($this->file('file'))) {
|
||||
$rules['file.*'] = $this->file_validation;
|
||||
} elseif ($this->file('file')) {
|
||||
$rules['file'] = $this->file_validation;
|
||||
}
|
||||
|
||||
$rules['client_id'] = 'required|exists:clients,id,company_id,'.auth()->user()->company()->id;
|
||||
|
@ -38,14 +38,15 @@ class UpdateRecurringInvoiceRequest extends Request
|
||||
{
|
||||
$rules = [];
|
||||
|
||||
if ($this->input('documents') && is_array($this->input('documents'))) {
|
||||
$documents = count($this->input('documents'));
|
||||
if($this->file('documents') && is_array($this->file('documents')))
|
||||
$rules['documents.*'] = $this->file_validation;
|
||||
elseif($this->file('documents'))
|
||||
$rules['documents'] = $this->file_validation;
|
||||
|
||||
foreach (range(0, $documents) as $index) {
|
||||
$rules['documents.'.$index] = 'file|mimes:png,ai,jpeg,tiff,pdf,gif,psd,txt,doc,xls,ppt,xlsx,docx,pptx|max:20000';
|
||||
}
|
||||
} elseif ($this->input('documents')) {
|
||||
$rules['documents'] = 'file|mimes:png,ai,jpeg,tiff,pdf,gif,psd,txt,doc,xls,ppt,xlsx,docx,pptx|max:20000';
|
||||
if ($this->file('file') && is_array($this->file('file'))) {
|
||||
$rules['file.*'] = $this->file_validation;
|
||||
} elseif ($this->file('file')) {
|
||||
$rules['file'] = $this->file_validation;
|
||||
}
|
||||
|
||||
if ($this->number) {
|
||||
|
@ -29,10 +29,17 @@ class UploadRecurringInvoiceRequest extends Request
|
||||
{
|
||||
$rules = [];
|
||||
|
||||
if ($this->input('documents')) {
|
||||
$rules['documents'] = 'file|mimes:csv,png,ai,jpeg,tiff,pdf,gif,psd,txt,doc,xls,ppt,xlsx,docx,pptx|max:2000000';
|
||||
}
|
||||
if($this->file('documents') && is_array($this->file('documents')))
|
||||
$rules['documents.*'] = $this->file_validation;
|
||||
elseif($this->file('documents'))
|
||||
$rules['documents'] = $this->file_validation;
|
||||
|
||||
if ($this->file('file') && is_array($this->file('file'))) {
|
||||
$rules['file.*'] = $this->file_validation;
|
||||
} elseif ($this->file('file')) {
|
||||
$rules['file'] = $this->file_validation;
|
||||
}
|
||||
|
||||
return $rules;
|
||||
}
|
||||
}
|
||||
|
@ -36,15 +36,16 @@ class StoreRecurringQuoteRequest extends Request
|
||||
public function rules()
|
||||
{
|
||||
$rules = [];
|
||||
|
||||
if($this->file('documents') && is_array($this->file('documents')))
|
||||
$rules['documents.*'] = $this->file_validation;
|
||||
elseif($this->file('documents'))
|
||||
$rules['documents'] = $this->file_validation;
|
||||
|
||||
if ($this->input('documents') && is_array($this->input('documents'))) {
|
||||
$documents = count($this->input('documents'));
|
||||
|
||||
foreach (range(0, $documents) as $index) {
|
||||
$rules['documents.'.$index] = 'file|mimes:png,ai,jpeg,tiff,pdf,gif,psd,txt,doc,xls,ppt,xlsx,docx,pptx|max:20000';
|
||||
}
|
||||
} elseif ($this->input('documents')) {
|
||||
$rules['documents'] = 'file|mimes:png,ai,jpeg,tiff,pdf,gif,psd,txt,doc,xls,ppt,xlsx,docx,pptx|max:20000';
|
||||
if ($this->file('file') && is_array($this->file('file'))) {
|
||||
$rules['file.*'] = $this->file_validation;
|
||||
} elseif ($this->file('file')) {
|
||||
$rules['file'] = $this->file_validation;
|
||||
}
|
||||
|
||||
$rules['client_id'] = 'required|exists:clients,id,company_id,'.auth()->user()->company()->id;
|
||||
|
@ -37,16 +37,17 @@ class UpdateRecurringQuoteRequest extends Request
|
||||
{
|
||||
$rules = [];
|
||||
|
||||
if ($this->input('documents') && is_array($this->input('documents'))) {
|
||||
$documents = count($this->input('documents'));
|
||||
if($this->file('documents') && is_array($this->file('documents')))
|
||||
$rules['documents.*'] = $this->file_validation;
|
||||
elseif($this->file('documents'))
|
||||
$rules['documents'] = $this->file_validation;
|
||||
|
||||
foreach (range(0, $documents) as $index) {
|
||||
$rules['documents.'.$index] = 'file|mimes:png,ai,jpeg,tiff,pdf,gif,psd,txt,doc,xls,ppt,xlsx,docx,pptx|max:20000';
|
||||
}
|
||||
} elseif ($this->input('documents')) {
|
||||
$rules['documents'] = 'file|mimes:png,ai,jpeg,tiff,pdf,gif,psd,txt,doc,xls,ppt,xlsx,docx,pptx|max:20000';
|
||||
if ($this->file('file') && is_array($this->file('file'))) {
|
||||
$rules['file.*'] = $this->file_validation;
|
||||
} elseif ($this->file('file')) {
|
||||
$rules['file'] = $this->file_validation;
|
||||
}
|
||||
|
||||
|
||||
if ($this->number) {
|
||||
$rules['number'] = Rule::unique('recurring_quotes')->where('company_id', auth()->user()->company()->id)->ignore($this->recurring_quote->id);
|
||||
}
|
||||
|
@ -29,10 +29,17 @@ class UploadRecurringQuoteRequest extends Request
|
||||
{
|
||||
$rules = [];
|
||||
|
||||
if ($this->input('documents')) {
|
||||
$rules['documents'] = 'file|mimes:csv,png,ai,jpeg,tiff,pdf,gif,psd,txt,doc,xls,ppt,xlsx,docx,pptx|max:2000000';
|
||||
}
|
||||
if($this->file('documents') && is_array($this->file('documents')))
|
||||
$rules['documents.*'] = $this->file_validation;
|
||||
elseif($this->file('documents'))
|
||||
$rules['documents'] = $this->file_validation;
|
||||
|
||||
if ($this->file('file') && is_array($this->file('file'))) {
|
||||
$rules['file.*'] = $this->file_validation;
|
||||
} elseif ($this->file('file')) {
|
||||
$rules['file'] = $this->file_validation;
|
||||
}
|
||||
|
||||
return $rules;
|
||||
}
|
||||
}
|
||||
|
@ -20,6 +20,7 @@ class Request extends FormRequest
|
||||
use MakesHash;
|
||||
use RuntimeFormRequest;
|
||||
|
||||
protected $file_validation = 'sometimes|file|mimes:png,ai,jpeg,tiff,pdf,gif,psd,txt,doc,xls,ppt,xlsx,docx,pptx|max:20000';
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
|
@ -58,6 +58,17 @@ class StoreTaskRequest extends Request
|
||||
$fail('Please correct overlapping values');
|
||||
}
|
||||
}];
|
||||
|
||||
if($this->file('documents') && is_array($this->file('documents')))
|
||||
$rules['documents.*'] = $this->file_validation;
|
||||
elseif($this->file('documents'))
|
||||
$rules['documents'] = $this->file_validation;
|
||||
|
||||
if ($this->file('file') && is_array($this->file('file'))) {
|
||||
$rules['file.*'] = $this->file_validation;
|
||||
} elseif ($this->file('file')) {
|
||||
$rules['file'] = $this->file_validation;
|
||||
}
|
||||
|
||||
|
||||
return $this->globalRules($rules);
|
||||
|
@ -30,7 +30,6 @@ class UpdateTaskRequest extends Request
|
||||
*/
|
||||
public function authorize() : bool
|
||||
{
|
||||
nlog("oioi");
|
||||
//prevent locked tasks from updating
|
||||
if ($this->task->invoice_id && $this->task->company->invoice_task_lock) {
|
||||
return false;
|
||||
@ -67,6 +66,17 @@ class UpdateTaskRequest extends Request
|
||||
}
|
||||
}];
|
||||
|
||||
if($this->file('documents') && is_array($this->file('documents')))
|
||||
$rules['documents.*'] = $this->file_validation;
|
||||
elseif($this->file('documents'))
|
||||
$rules['documents'] = $this->file_validation;
|
||||
|
||||
if ($this->file('file') && is_array($this->file('file'))) {
|
||||
$rules['file.*'] = $this->file_validation;
|
||||
} elseif ($this->file('file')) {
|
||||
$rules['file'] = $this->file_validation;
|
||||
}
|
||||
|
||||
return $this->globalRules($rules);
|
||||
}
|
||||
|
||||
|
@ -11,8 +11,8 @@
|
||||
namespace App\Http\Requests\TaskScheduler;
|
||||
|
||||
use App\Http\Requests\Request;
|
||||
use Illuminate\Validation\Rule;
|
||||
use App\Http\ValidationRules\Scheduler\ValidClientIds;
|
||||
use Illuminate\Validation\Rule;
|
||||
|
||||
class UpdateSchedulerRequest extends Request
|
||||
{
|
||||
|
10
app/Http/Requests/Vendor/StoreVendorRequest.php
vendored
10
app/Http/Requests/Vendor/StoreVendorRequest.php
vendored
@ -47,6 +47,16 @@ class StoreVendorRequest extends Request
|
||||
|
||||
$rules['currency_id'] = 'bail|required|exists:currencies,id';
|
||||
|
||||
if($this->file('documents') && is_array($this->file('documents')))
|
||||
$rules['documents.*'] = $this->file_validation;
|
||||
elseif($this->file('documents'))
|
||||
$rules['documents'] = $this->file_validation;
|
||||
|
||||
if ($this->file('file') && is_array($this->file('file'))) {
|
||||
$rules['file.*'] = $this->file_validation;
|
||||
} elseif ($this->file('file')) {
|
||||
$rules['file'] = $this->file_validation;
|
||||
}
|
||||
|
||||
return $rules;
|
||||
}
|
||||
|
11
app/Http/Requests/Vendor/UpdateVendorRequest.php
vendored
11
app/Http/Requests/Vendor/UpdateVendorRequest.php
vendored
@ -44,6 +44,17 @@ class UpdateVendorRequest extends Request
|
||||
$rules['contacts.*.email'] = 'nullable|distinct';
|
||||
$rules['currency_id'] = 'bail|sometimes|exists:currencies,id';
|
||||
|
||||
if($this->file('documents') && is_array($this->file('documents')))
|
||||
$rules['documents.*'] = $this->file_validation;
|
||||
elseif($this->file('documents'))
|
||||
$rules['documents'] = $this->file_validation;
|
||||
|
||||
if ($this->file('file') && is_array($this->file('file'))) {
|
||||
$rules['file.*'] = $this->file_validation;
|
||||
} elseif ($this->file('file')) {
|
||||
$rules['file'] = $this->file_validation;
|
||||
}
|
||||
|
||||
return $rules;
|
||||
}
|
||||
|
||||
|
11
app/Http/Requests/Vendor/UploadVendorRequest.php
vendored
11
app/Http/Requests/Vendor/UploadVendorRequest.php
vendored
@ -29,8 +29,15 @@ class UploadVendorRequest extends Request
|
||||
{
|
||||
$rules = [];
|
||||
|
||||
if ($this->input('documents')) {
|
||||
$rules['documents'] = 'file|mimes:csv,png,ai,jpeg,tiff,pdf,gif,psd,txt,doc,xls,ppt,xlsx,docx,pptx|max:2000000';
|
||||
if($this->file('documents') && is_array($this->file('documents')))
|
||||
$rules['documents.*'] = $this->file_validation;
|
||||
elseif($this->file('documents'))
|
||||
$rules['documents'] = $this->file_validation;
|
||||
|
||||
if ($this->file('file') && is_array($this->file('file'))) {
|
||||
$rules['file.*'] = $this->file_validation;
|
||||
} elseif ($this->file('file')) {
|
||||
$rules['file'] = $this->file_validation;
|
||||
}
|
||||
|
||||
return $rules;
|
||||
|
@ -26,8 +26,9 @@ class ValidCompanyQuantity implements Rule
|
||||
*/
|
||||
public function passes($attribute, $value)
|
||||
{
|
||||
if(config('ninja.testvars.travis'))
|
||||
if (config('ninja.testvars.travis')) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (Ninja::isSelfHost()) {
|
||||
return auth()->user()->company()->account->companies->count() < 10;
|
||||
|
@ -611,8 +611,9 @@ class NinjaMailerJob implements ShouldQueue
|
||||
|
||||
public function failed($exception = null)
|
||||
{
|
||||
if($exception)
|
||||
if ($exception) {
|
||||
nlog($exception->getMessage());
|
||||
}
|
||||
|
||||
config(['queue.failed.driver' => null]);
|
||||
}
|
||||
|
@ -22,14 +22,8 @@ class UnlinkFile implements ShouldQueue
|
||||
{
|
||||
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
|
||||
|
||||
protected $file_path;
|
||||
|
||||
protected $disk;
|
||||
|
||||
public function __construct(string $disk, ?string $file_path)
|
||||
public function __construct(protected string $disk = '', protected ?string $file_path = '')
|
||||
{
|
||||
$this->file_path = $file_path;
|
||||
$this->disk = $disk;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -40,7 +34,12 @@ class UnlinkFile implements ShouldQueue
|
||||
public function handle()
|
||||
{
|
||||
/* Do not delete files if we are on the sync queue*/
|
||||
if (config('queue.default') == 'sync' || ! $this->file_path) {
|
||||
if (config('queue.default') == 'sync') {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if (!$this->file_path) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -77,7 +77,6 @@ class PaymentNotification implements ShouldQueue
|
||||
(new NinjaMailerJob($nmo))->handle();
|
||||
|
||||
$nmo = null;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -11,16 +11,16 @@
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Support\Str;
|
||||
use Illuminate\Support\Carbon;
|
||||
use App\Utils\Traits\MakesHash;
|
||||
use App\DataMapper\ClientSettings;
|
||||
use App\Jobs\Util\WebhookHandler;
|
||||
use App\Models\Traits\Excludable;
|
||||
use App\DataMapper\ClientSettings;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use App\Utils\Traits\MakesHash;
|
||||
use App\Utils\Traits\UserSessionAttributes;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\ModelNotFoundException as ModelNotFoundException;
|
||||
use Illuminate\Support\Carbon;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
/**
|
||||
* Class BaseModel
|
||||
|
@ -327,21 +327,6 @@ class Client extends BaseModel implements HasLocalePreference
|
||||
return $this->service()->updateBalance($amount);
|
||||
}
|
||||
|
||||
/**
|
||||
* Adjusts client "balances" when a client
|
||||
* makes a payment that goes on file, but does
|
||||
* not effect the client.balance record.
|
||||
*
|
||||
* @param float $amount Adjustment amount
|
||||
* @return Client
|
||||
*/
|
||||
// public function processUnappliedPayment($amount) :Client
|
||||
// {
|
||||
// return $this->service()->updatePaidToDate($amount)
|
||||
// ->adjustCreditBalance($amount)
|
||||
// ->save();
|
||||
// }
|
||||
|
||||
/**
|
||||
* Returns the entire filtered set
|
||||
* of settings which have been merged from
|
||||
|
@ -32,7 +32,8 @@ use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
class Scheduler extends BaseModel
|
||||
{
|
||||
use SoftDeletes;
|
||||
|
||||
use Filterable;
|
||||
|
||||
protected $fillable = [
|
||||
'name',
|
||||
'frequency_id',
|
||||
|
@ -11,8 +11,8 @@
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use App\Utils\Traits\MakesHash;
|
||||
use App\Models\Traits\Excludable;
|
||||
use App\Utils\Traits\MakesHash;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\ModelNotFoundException as ModelNotFoundException;
|
||||
|
||||
|
@ -486,15 +486,15 @@ class User extends Authenticatable implements MustVerifyEmail
|
||||
|
||||
/**
|
||||
* Used when we need to filter permissions carefully.
|
||||
*
|
||||
*
|
||||
* For instance, users that have view_client permissions should not
|
||||
* see the client balance, however if they also have
|
||||
* see the client balance, however if they also have
|
||||
* view_invoice or view_all etc, then they should be able to see the balance.
|
||||
*
|
||||
*
|
||||
* First we pass over the excluded permissions and return false if we find a match.
|
||||
*
|
||||
*
|
||||
* If those permissions are not hit, then we can iterate through the matched_permissions and search for a hit.
|
||||
*
|
||||
*
|
||||
* Note, returning FALSE here means the user does NOT have the permission we want to exclude
|
||||
*
|
||||
* @param array $matched_permission
|
||||
@ -513,7 +513,7 @@ class User extends Authenticatable implements MustVerifyEmail
|
||||
}
|
||||
}
|
||||
|
||||
foreach($matched_permission as $permission) {
|
||||
foreach ($matched_permission as $permission) {
|
||||
if ($this->hasExactPermission($permission)) {
|
||||
return true;
|
||||
}
|
||||
|
@ -169,6 +169,11 @@ class Vendor extends BaseModel
|
||||
return '';
|
||||
}
|
||||
|
||||
public function getMergedSettings() :object
|
||||
{
|
||||
return $this->company->settings;
|
||||
}
|
||||
|
||||
public function purchase_order_filepath($invitation)
|
||||
{
|
||||
$contact_key = $invitation->contact->contact_key;
|
||||
|
@ -12,16 +12,17 @@
|
||||
|
||||
namespace App\PaymentDrivers\Stripe;
|
||||
|
||||
use App\Models\Payment;
|
||||
use App\Models\SystemLog;
|
||||
use Stripe\PaymentIntent;
|
||||
use App\Models\GatewayType;
|
||||
use App\Models\PaymentType;
|
||||
use App\Jobs\Util\SystemLogger;
|
||||
use App\Utils\Traits\MakesHash;
|
||||
use App\Exceptions\PaymentFailed;
|
||||
use App\PaymentDrivers\StripePaymentDriver;
|
||||
use App\Http\Requests\ClientPortal\Payments\PaymentResponseRequest;
|
||||
use App\Jobs\Util\SystemLogger;
|
||||
use App\Models\GatewayType;
|
||||
use App\Models\Payment;
|
||||
use App\Models\PaymentType;
|
||||
use App\Models\SystemLog;
|
||||
use App\PaymentDrivers\StripePaymentDriver;
|
||||
use App\Utils\Number;
|
||||
use App\Utils\Traits\MakesHash;
|
||||
use Stripe\PaymentIntent;
|
||||
|
||||
class BankTransfer
|
||||
{
|
||||
@ -68,7 +69,7 @@ class BankTransfer
|
||||
$data['return_url'] = $this->buildReturnUrl();
|
||||
$data['gateway'] = $this->stripe;
|
||||
$data['client_secret'] = $intent ? $intent->client_secret : false;
|
||||
|
||||
|
||||
return render('gateways.stripe.bank_transfer.pay', $data);
|
||||
}
|
||||
|
||||
@ -79,14 +80,12 @@ class BankTransfer
|
||||
*/
|
||||
private function resolveBankType()
|
||||
{
|
||||
|
||||
return match($this->stripe->client->currency()->code){
|
||||
return match ($this->stripe->client->currency()->code) {
|
||||
'GBP' => ['type' => 'gb_bank_transfer'],
|
||||
'EUR' => ['type' => 'eu_bank_transfer', 'eu_bank_transfer' => ['country' => $this->stripe->client->country->iso_3166_2]],
|
||||
'JPY' => ['type' => 'jp_bank_transfer'],
|
||||
'MXN' => ['type' =>'mx_bank_transfer'],
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@ -103,59 +102,145 @@ class BankTransfer
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* paymentResponse
|
||||
*
|
||||
* @param mixed $request
|
||||
* @return void
|
||||
*/
|
||||
public function paymentResponse(PaymentResponseRequest $request)
|
||||
{
|
||||
|
||||
$this->stripe->init();
|
||||
|
||||
$this->stripe->setPaymentHash($request->getPaymentHash());
|
||||
$this->stripe->client = $this->stripe->payment_hash->fee_invoice->client;
|
||||
|
||||
if($request->payment_intent){
|
||||
|
||||
if ($request->payment_intent) {
|
||||
$pi = \Stripe\PaymentIntent::retrieve(
|
||||
$request->payment_intent,
|
||||
$this->stripe->stripe_connect_auth
|
||||
);
|
||||
|
||||
if (in_array($pi->status, ['succeeded', 'processing'])) {
|
||||
return $this->processSuccesfulRedirect($pi);
|
||||
$payment = $this->processSuccesfulRedirect($pi);
|
||||
redirect()->route('client.payments.show', ['payment' => $this->stripe->encodePrimaryKey($payment->id)]);
|
||||
}
|
||||
|
||||
/* Create a pending payment */
|
||||
if($pi->status == 'requires_action') {
|
||||
if ($pi->status == 'requires_action' && $pi->next_action->type == 'display_bank_transfer_instructions') {
|
||||
match ($pi->next_action->display_bank_transfer_instructions->currency) {
|
||||
'mxn' => $data['bank_details'] = $this->formatDataforMx($pi),
|
||||
'gbp' => $data['bank_details'] = $this->formatDataforUk($pi),
|
||||
'eur' => $data['bank_details'] = $this->formatDataforEur($pi),
|
||||
'jpy' => $data['bank_details'] = $this->formatDataforJp($pi),
|
||||
};
|
||||
|
||||
$payment = $this->processSuccesfulRedirect($pi);
|
||||
|
||||
$data = [
|
||||
'payment_method' => $pi->payment_method,
|
||||
'payment_type' => PaymentType::DIRECT_DEBIT,
|
||||
'amount' => $this->stripe->convertFromStripeAmount($this->stripe->payment_hash->data->stripe_amount, $this->stripe->client->currency()->precision, $this->stripe->client->currency()),
|
||||
'transaction_reference' => $pi->id,
|
||||
'gateway_type_id' => GatewayType::DIRECT_DEBIT,
|
||||
return render('gateways.stripe.bank_transfer.bank_details_container', $data);
|
||||
}
|
||||
|
||||
return $this->processUnsuccesfulRedirect();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* formatDataForUk
|
||||
*
|
||||
* @param PaymentIntent $pi
|
||||
* @return array
|
||||
*/
|
||||
public function formatDataForUk(PaymentIntent $pi): array
|
||||
{
|
||||
return [
|
||||
'amount' => Number::formatMoney($this->stripe->convertFromStripeAmount($pi->next_action->display_bank_transfer_instructions->amount_remaining, $this->stripe->client->currency()->precision, $this->stripe->client->currency()), $this->stripe->client),
|
||||
'account_holder_name' => $pi->next_action->display_bank_transfer_instructions->financial_addresses[0]->sort_code->account_holder_name,
|
||||
'account_number' => $pi->next_action->display_bank_transfer_instructions->financial_addresses[0]->sort_code->account_number,
|
||||
'sort_code' => $pi->next_action->display_bank_transfer_instructions->financial_addresses[0]->sort_code->sort_code,
|
||||
'reference' => $pi->next_action->display_bank_transfer_instructions->reference,
|
||||
'description' => $pi->description,
|
||||
'gateway' => $this->stripe->company_gateway,
|
||||
'currency' => $pi->next_action->display_bank_transfer_instructions->currency,
|
||||
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* formatDataforMx
|
||||
*
|
||||
* @param PaymentIntent $pi
|
||||
* @return array
|
||||
*/
|
||||
public function formatDataforMx(PaymentIntent $pi): array
|
||||
{
|
||||
return [
|
||||
'amount' => Number::formatMoney($this->stripe->convertFromStripeAmount($pi->next_action->display_bank_transfer_instructions->amount_remaining, $this->stripe->client->currency()->precision, $this->stripe->client->currency()), $this->stripe->client),
|
||||
'account_holder_name' => $pi->next_action->display_bank_transfer_instructions->financial_addresses[0]->spei->bank_name,
|
||||
'account_number' => $pi->next_action->display_bank_transfer_instructions->financial_addresses[0]->spei->bank_code,
|
||||
'sort_code' => $pi->next_action->display_bank_transfer_instructions->financial_addresses[0]->spei->clabe,
|
||||
'reference' => $pi->next_action->display_bank_transfer_instructions->reference,
|
||||
'description' => $pi->description,
|
||||
'gateway' => $this->stripe->company_gateway,
|
||||
'currency' => $pi->next_action->display_bank_transfer_instructions->currency,
|
||||
|
||||
$payment = $this->stripe->createPayment($data, Payment::STATUS_PENDING);
|
||||
|
||||
SystemLogger::dispatch(
|
||||
['response' => $this->stripe->payment_hash->data, 'data' => $data],
|
||||
SystemLog::CATEGORY_GATEWAY_RESPONSE,
|
||||
SystemLog::EVENT_GATEWAY_SUCCESS,
|
||||
SystemLog::TYPE_STRIPE,
|
||||
$this->stripe->client,
|
||||
$this->stripe->client->company,
|
||||
);
|
||||
|
||||
return redirect($pi->next_action->display_bank_transfer_instructions->hosted_instructions_url);
|
||||
|
||||
}
|
||||
return $this->processUnsuccesfulRedirect();
|
||||
|
||||
}
|
||||
|
||||
];
|
||||
}
|
||||
|
||||
public function processSuccesfulRedirect($payment_intent)
|
||||
|
||||
/**
|
||||
* formatDataforEur
|
||||
*
|
||||
* @param mixed $pi
|
||||
* @return array
|
||||
*/
|
||||
public function formatDataforEur(PaymentIntent $pi): array
|
||||
{
|
||||
return [
|
||||
'amount' => Number::formatMoney($this->stripe->convertFromStripeAmount($pi->next_action->display_bank_transfer_instructions->amount_remaining, $this->stripe->client->currency()->precision, $this->stripe->client->currency()), $this->stripe->client),
|
||||
'account_holder_name' => $pi->next_action->display_bank_transfer_instructions->financial_addresses[0]->iban->account_holder_name,
|
||||
'account_number' => $pi->next_action->display_bank_transfer_instructions->financial_addresses[0]->iban->iban,
|
||||
'sort_code' => $pi->next_action->display_bank_transfer_instructions->financial_addresses[0]->iban->bic,
|
||||
'reference' => $pi->next_action->display_bank_transfer_instructions->reference,
|
||||
'description' => $pi->description,
|
||||
'gateway' => $this->stripe->company_gateway,
|
||||
'currency' => $pi->next_action->display_bank_transfer_instructions->currency,
|
||||
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param PaymentIntent $pi
|
||||
* @return array
|
||||
*/
|
||||
public function formatDataforJp(PaymentIntent $pi): array
|
||||
{
|
||||
return [
|
||||
'amount' => Number::formatMoney($this->stripe->convertFromStripeAmount($pi->next_action->display_bank_transfer_instructions->amount_remaining, $this->stripe->client->currency()->precision, $this->stripe->client->currency()), $this->stripe->client),
|
||||
'account_holder_name' => $pi->next_action->display_bank_transfer_instructions->financial_addresses[0]->zengin->account_holder_name,
|
||||
'account_number' => $pi->next_action->display_bank_transfer_instructions->financial_addresses[0]->zengin->account_number,
|
||||
'account_type' =>$pi->next_action->display_bank_transfer_instructions->financial_addresses[0]->zengin->account_type,
|
||||
'bank_code' =>$pi->next_action->display_bank_transfer_instructions->financial_addresses[0]->zengin->bank_code,
|
||||
'bank_name' =>$pi->next_action->display_bank_transfer_instructions->financial_addresses[0]->zengin->bank_name,
|
||||
'branch_code' =>$pi->next_action->display_bank_transfer_instructions->financial_addresses[0]->zengin->branch_code,
|
||||
'branch_name' =>$pi->next_action->display_bank_transfer_instructions->financial_addresses[0]->zengin->branch_name,
|
||||
'reference' => $pi->next_action->display_bank_transfer_instructions->reference,
|
||||
'description' => $pi->description,
|
||||
'gateway' => $this->stripe->company_gateway,
|
||||
'currency' => $pi->next_action->display_bank_transfer_instructions->currency,
|
||||
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* processSuccesfulRedirect
|
||||
*
|
||||
* @param PaymentIntent $payment_intent
|
||||
* @return Payment
|
||||
*/
|
||||
public function processSuccesfulRedirect(PaymentIntent $payment_intent): Payment
|
||||
{
|
||||
$this->stripe->init();
|
||||
|
||||
@ -168,7 +253,7 @@ class BankTransfer
|
||||
|
||||
];
|
||||
|
||||
$payment = $this->stripe->createPayment($data, $payment_intent->status == 'processing' ? Payment::STATUS_PENDING : Payment::STATUS_COMPLETED);
|
||||
$payment = $this->stripe->createPayment($data, $payment_intent->status == 'succeeded' ? Payment::STATUS_COMPLETED : Payment::STATUS_PENDING);
|
||||
|
||||
SystemLogger::dispatch(
|
||||
['response' => $this->stripe->payment_hash->data, 'data' => $data],
|
||||
@ -179,9 +264,14 @@ class BankTransfer
|
||||
$this->stripe->client->company,
|
||||
);
|
||||
|
||||
return redirect()->route('client.payments.show', ['payment' => $this->stripe->encodePrimaryKey($payment->id)]);
|
||||
return $payment;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* processUnsuccesfulRedirect
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function processUnsuccesfulRedirect()
|
||||
{
|
||||
$server_response = $this->stripe->payment_hash->data;
|
||||
@ -204,6 +294,4 @@ class BankTransfer
|
||||
|
||||
throw new PaymentFailed('Failed to process the payment.', 500);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -76,23 +76,20 @@ class UpdatePaymentMethods
|
||||
$this->importBankAccounts($customer, $client);
|
||||
|
||||
$this->importPMBankAccounts($customer, $client);
|
||||
|
||||
}
|
||||
|
||||
/* ACH may also be nested inside Payment Methods.*/
|
||||
/* ACH may also be nested inside Payment Methods.*/
|
||||
public function importPMBankAccounts($customer, $client)
|
||||
{
|
||||
$bank_methods = \Stripe\PaymentMethod::all(
|
||||
[
|
||||
'customer' => $customer->id,
|
||||
'type' => 'us_bank_account',
|
||||
],
|
||||
],
|
||||
$this->stripe->stripe_connect_auth
|
||||
);
|
||||
|
||||
foreach($bank_methods->data as $method)
|
||||
{
|
||||
|
||||
foreach ($bank_methods->data as $method) {
|
||||
$token_exists = ClientGatewayToken::where([
|
||||
'gateway_customer_reference' => $customer->id,
|
||||
'token' => $method->id,
|
||||
@ -126,9 +123,7 @@ class UpdatePaymentMethods
|
||||
}
|
||||
|
||||
$this->stripe->storeGatewayToken($data, $additional_data);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public function importBankAccounts($customer, $client)
|
||||
|
@ -260,7 +260,12 @@ class StripePaymentDriver extends BaseDriver
|
||||
if (
|
||||
$this->client
|
||||
&& isset($this->client->country)
|
||||
&& in_array($this->client->country->iso_3166_2, ['FR', 'IE', 'NL', 'GB', 'DE', 'ES', 'JP', 'MX'])
|
||||
&& (
|
||||
(in_array($this->client->country->iso_3166_2, ['FR', 'IE', 'NL', 'DE', 'ES']) && $this->client->currency()->code == 'EUR') ||
|
||||
($this->client->country->iso_3166_2 == 'JP' && $this->client->currency()->code == 'JPY') ||
|
||||
($this->client->country->iso_3166_2 == 'MX' && $this->client->currency()->code == 'MXN') ||
|
||||
($this->client->country->iso_3166_2 == 'GB' && $this->client->currency()->code == 'GBP')
|
||||
)
|
||||
) {
|
||||
$types[] = GatewayType::DIRECT_DEBIT;
|
||||
}
|
||||
@ -433,6 +438,17 @@ class StripePaymentDriver extends BaseDriver
|
||||
return PaymentIntent::create($data, array_merge($meta, ['idempotency_key' => uniqid("st", true)]));
|
||||
}
|
||||
|
||||
public function getPaymentIntent($payment_intent_id): ?PaymentIntent
|
||||
{
|
||||
$this->init();
|
||||
|
||||
return PaymentIntent::retrieve(
|
||||
$payment_intent_id,
|
||||
$this->stripe_connect_auth
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a setup intent that allows the user
|
||||
* to enter card details without initiating a transaction.
|
||||
|
1601
app/Services/Pdf/PdfBuilder.php
Normal file
1601
app/Services/Pdf/PdfBuilder.php
Normal file
File diff suppressed because it is too large
Load Diff
348
app/Services/Pdf/PdfConfiguration.php
Normal file
348
app/Services/Pdf/PdfConfiguration.php
Normal file
@ -0,0 +1,348 @@
|
||||
<?php
|
||||
/**
|
||||
* Invoice Ninja (https://invoiceninja.com).
|
||||
*
|
||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||
*
|
||||
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
|
||||
*
|
||||
* @license https://www.elastic.co/licensing/elastic-license
|
||||
*/
|
||||
|
||||
namespace App\Services\Pdf;
|
||||
|
||||
use App\DataMapper\CompanySettings;
|
||||
use App\Models\Client;
|
||||
use App\Models\ClientContact;
|
||||
use App\Models\Country;
|
||||
use App\Models\Credit;
|
||||
use App\Models\CreditInvitation;
|
||||
use App\Models\Currency;
|
||||
use App\Models\Design;
|
||||
use App\Models\Invoice;
|
||||
use App\Models\InvoiceInvitation;
|
||||
use App\Models\PurchaseOrder;
|
||||
use App\Models\PurchaseOrderInvitation;
|
||||
use App\Models\Quote;
|
||||
use App\Models\QuoteInvitation;
|
||||
use App\Models\RecurringInvoiceInvitation;
|
||||
use App\Models\Vendor;
|
||||
use App\Models\VendorContact;
|
||||
use App\Utils\Ninja;
|
||||
use App\Utils\Traits\AppSetup;
|
||||
use App\Utils\Traits\MakesHash;
|
||||
use Illuminate\Support\Collection;
|
||||
use Illuminate\Support\Facades\App;
|
||||
use Illuminate\Support\Facades\Cache;
|
||||
|
||||
class PdfConfiguration
|
||||
{
|
||||
use MakesHash, AppSetup;
|
||||
|
||||
public ?Client $client;
|
||||
|
||||
public ?ClientContact $contact;
|
||||
|
||||
public Country $country;
|
||||
|
||||
public Currency $currency;
|
||||
|
||||
public Client | Vendor $currency_entity;
|
||||
|
||||
public Design $design;
|
||||
|
||||
public Invoice | Credit | Quote | PurchaseOrder $entity;
|
||||
|
||||
public string $entity_design_id;
|
||||
|
||||
public string $entity_string;
|
||||
|
||||
public ?string $path;
|
||||
|
||||
public array $pdf_variables;
|
||||
|
||||
public object $settings;
|
||||
|
||||
public $settings_object;
|
||||
|
||||
public ?Vendor $vendor;
|
||||
|
||||
public ?VendorContact $vendor_contact;
|
||||
|
||||
public string $date_format;
|
||||
|
||||
public string $locale;
|
||||
|
||||
public Collection $tax_map;
|
||||
|
||||
public ?array $total_tax_map;
|
||||
/**
|
||||
* __construct
|
||||
*
|
||||
* @param PdfService $service
|
||||
* @return void
|
||||
*/
|
||||
public function __construct(public PdfService $service)
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* init
|
||||
*
|
||||
* @return self
|
||||
*/
|
||||
public function init(): self
|
||||
{
|
||||
$this->setEntityType()
|
||||
->setDateFormat()
|
||||
->setPdfVariables()
|
||||
->setDesign()
|
||||
->setCurrencyForPdf()
|
||||
->setLocale();
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* setLocale
|
||||
*
|
||||
* @return self
|
||||
*/
|
||||
private function setLocale(): self
|
||||
{
|
||||
App::forgetInstance('translator');
|
||||
|
||||
$t = app('translator');
|
||||
|
||||
App::setLocale($this->settings_object->locale());
|
||||
|
||||
$t->replace(Ninja::transformTranslations($this->settings));
|
||||
|
||||
$this->locale = $this->settings_object->locale();
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* setCurrency
|
||||
*
|
||||
* @return self
|
||||
*/
|
||||
private function setCurrencyForPdf(): self
|
||||
{
|
||||
$this->currency = $this->client ? $this->client->currency() : $this->vendor->currency();
|
||||
|
||||
$this->currency_entity = $this->client ? $this->client : $this->vendor;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* setPdfVariables
|
||||
*
|
||||
* @return self
|
||||
*/
|
||||
public function setPdfVariables() :self
|
||||
{
|
||||
$default = (array) CompanySettings::getEntityVariableDefaults();
|
||||
|
||||
// $variables = (array)$this->service->company->settings->pdf_variables;
|
||||
$variables = (array)$this->settings->pdf_variables;
|
||||
|
||||
foreach ($default as $property => $value) {
|
||||
if (array_key_exists($property, $variables)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$variables[$property] = $value;
|
||||
}
|
||||
|
||||
$this->pdf_variables = $variables;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* setEntityType
|
||||
*
|
||||
* @return self
|
||||
*/
|
||||
private function setEntityType(): self
|
||||
{
|
||||
$entity_design_id = '';
|
||||
|
||||
if ($this->service->invitation instanceof InvoiceInvitation) {
|
||||
$this->entity = $this->service->invitation->invoice;
|
||||
$this->entity_string = 'invoice';
|
||||
$this->client = $this->entity->client;
|
||||
$this->contact = $this->service->invitation->contact;
|
||||
$this->path = $this->client->invoice_filepath($this->service->invitation);
|
||||
$this->entity_design_id = 'invoice_design_id';
|
||||
$this->settings = $this->client->getMergedSettings();
|
||||
$this->settings_object = $this->client;
|
||||
$this->country = $this->client->country;
|
||||
} elseif ($this->service->invitation instanceof QuoteInvitation) {
|
||||
$this->entity = $this->service->invitation->quote;
|
||||
$this->entity_string = 'quote';
|
||||
$this->client = $this->entity->client;
|
||||
$this->contact = $this->service->invitation->contact;
|
||||
$this->path = $this->client->quote_filepath($this->service->invitation);
|
||||
$this->entity_design_id = 'quote_design_id';
|
||||
$this->settings = $this->client->getMergedSettings();
|
||||
$this->settings_object = $this->client;
|
||||
$this->country = $this->client->country;
|
||||
} elseif ($this->service->invitation instanceof CreditInvitation) {
|
||||
$this->entity = $this->service->invitation->credit;
|
||||
$this->entity_string = 'credit';
|
||||
$this->client = $this->entity->client;
|
||||
$this->contact = $this->service->invitation->contact;
|
||||
$this->path = $this->client->credit_filepath($this->service->invitation);
|
||||
$this->entity_design_id = 'credit_design_id';
|
||||
$this->settings = $this->client->getMergedSettings();
|
||||
$this->settings_object = $this->client;
|
||||
$this->country = $this->client->country;
|
||||
} elseif ($this->service->invitation instanceof RecurringInvoiceInvitation) {
|
||||
$this->entity = $this->service->invitation->recurring_invoice;
|
||||
$this->entity_string = 'recurring_invoice';
|
||||
$this->client = $this->entity->client;
|
||||
$this->contact = $this->service->invitation->contact;
|
||||
$this->path = $this->client->recurring_invoice_filepath($this->service->invitation);
|
||||
$this->entity_design_id = 'invoice_design_id';
|
||||
$this->settings = $this->client->getMergedSettings();
|
||||
$this->settings_object = $this->client;
|
||||
$this->country = $this->client->country;
|
||||
} elseif ($this->service->invitation instanceof PurchaseOrderInvitation) {
|
||||
$this->entity = $this->service->invitation->purchase_order;
|
||||
$this->entity_string = 'purchase_order';
|
||||
$this->vendor = $this->entity->vendor;
|
||||
$this->vendor_contact = $this->service->invitation->contact;
|
||||
$this->path = $this->vendor->purchase_order_filepath($this->service->invitation);
|
||||
$this->entity_design_id = 'invoice_design_id';
|
||||
$this->entity_design_id = 'purchase_order_design_id';
|
||||
$this->settings = $this->vendor->company->settings;
|
||||
$this->settings_object = $this->vendor;
|
||||
$this->client = null;
|
||||
$this->country = $this->vendor->country ?: $this->vendor->company->country();
|
||||
} else {
|
||||
throw new \Exception('Unable to resolve entity', 500);
|
||||
}
|
||||
|
||||
$this->setTaxMap($this->entity->calc()->getTaxMap());
|
||||
$this->setTotalTaxMap($this->entity->calc()->getTotalTaxMap());
|
||||
|
||||
$this->path = $this->path.$this->entity->numberFormatter().'.pdf';
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setTaxMap($map): self
|
||||
{
|
||||
$this->tax_map = $map;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setTotalTaxMap($map): self
|
||||
{
|
||||
$this->total_tax_map = $map;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setCurrency(Currency $currency): self
|
||||
{
|
||||
$this->currency = $currency;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setCountry(Country $country): self
|
||||
{
|
||||
$this->country = $country;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* setDesign
|
||||
*
|
||||
* @return self
|
||||
*/
|
||||
private function setDesign(): self
|
||||
{
|
||||
$design_id = $this->entity->design_id ? : $this->decodePrimaryKey($this->settings_object->getSetting($this->entity_design_id));
|
||||
|
||||
$this->design = Design::find($design_id ?: 2);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* formatMoney
|
||||
*
|
||||
* @param float $value
|
||||
* @return string
|
||||
*/
|
||||
public function formatMoney($value): string
|
||||
{
|
||||
$value = floatval($value);
|
||||
|
||||
$thousand = $this->currency->thousand_separator;
|
||||
$decimal = $this->currency->decimal_separator;
|
||||
$precision = $this->currency->precision;
|
||||
$code = $this->currency->code;
|
||||
$swapSymbol = $this->currency->swap_currency_symbol;
|
||||
|
||||
if (isset($this->country->thousand_separator) && strlen($this->country->thousand_separator) >= 1) {
|
||||
$thousand = $this->country->thousand_separator;
|
||||
}
|
||||
|
||||
if (isset($this->country->decimal_separator) && strlen($this->country->decimal_separator) >= 1) {
|
||||
$decimal = $this->country->decimal_separator;
|
||||
}
|
||||
|
||||
if (isset($this->country->swap_currency_symbol) && strlen($this->country->swap_currency_symbol) >= 1) {
|
||||
$swapSymbol = $this->country->swap_currency_symbol;
|
||||
}
|
||||
|
||||
$value = number_format($value, $precision, $decimal, $thousand);
|
||||
$symbol = $this->currency->symbol;
|
||||
|
||||
if ($this->settings->show_currency_code === true && $this->currency->code == 'CHF') {
|
||||
return "{$code} {$value}";
|
||||
} elseif ($this->settings->show_currency_code === true) {
|
||||
return "{$value} {$code}";
|
||||
} elseif ($swapSymbol) {
|
||||
return "{$value} ".trim($symbol);
|
||||
} elseif ($this->settings->show_currency_code === false) {
|
||||
return "{$symbol}{$value}";
|
||||
} else {
|
||||
$value = floatval($value);
|
||||
$thousand = $this->currency->thousand_separator;
|
||||
$decimal = $this->currency->decimal_separator;
|
||||
$precision = $this->currency->precision;
|
||||
|
||||
return number_format($value, $precision, $decimal, $thousand);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* date_format
|
||||
*
|
||||
* @return self
|
||||
*/
|
||||
public function setDateFormat(): self
|
||||
{
|
||||
$date_formats = Cache::get('date_formats');
|
||||
|
||||
if (! $date_formats) {
|
||||
$this->buildCache(true);
|
||||
}
|
||||
|
||||
$this->date_format = $date_formats->filter(function ($item) {
|
||||
return $item->id == $this->settings->date_format_id;
|
||||
})->first()->format;
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
73
app/Services/Pdf/PdfDesigner.php
Normal file
73
app/Services/Pdf/PdfDesigner.php
Normal file
@ -0,0 +1,73 @@
|
||||
<?php
|
||||
/**
|
||||
* Invoice Ninja (https://invoiceninja.com).
|
||||
*
|
||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||
*
|
||||
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
|
||||
*
|
||||
* @license https://www.elastic.co/licensing/elastic-license
|
||||
*/
|
||||
|
||||
namespace App\Services\Pdf;
|
||||
|
||||
class PdfDesigner
|
||||
{
|
||||
const BOLD = 'bold';
|
||||
const BUSINESS = 'business';
|
||||
const CLEAN = 'clean';
|
||||
const CREATIVE = 'creative';
|
||||
const ELEGANT = 'elegant';
|
||||
const HIPSTER = 'hipster';
|
||||
const MODERN = 'modern';
|
||||
const PLAIN = 'plain';
|
||||
const PLAYFUL = 'playful';
|
||||
const CUSTOM = 'custom';
|
||||
const CALM = 'calm';
|
||||
|
||||
const DELIVERY_NOTE = 'delivery_note';
|
||||
const STATEMENT = 'statement';
|
||||
const PURCHASE_ORDER = 'purchase_order';
|
||||
|
||||
public string $template;
|
||||
|
||||
public function __construct(public PdfService $service)
|
||||
{
|
||||
}
|
||||
|
||||
public function build() :self
|
||||
{
|
||||
/*If the design is custom*/
|
||||
if ($this->service->config->design->is_custom) {
|
||||
$this->template = $this->composeFromPartials(json_decode(json_encode($this->service->config->design->design), true));
|
||||
} else {
|
||||
$this->template = file_get_contents(config('ninja.designs.base_path') . strtolower($this->service->config->design->name) . '.html');
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* If the user has implemented a custom design, then we need to rebuild the design at this point
|
||||
*/
|
||||
|
||||
/**
|
||||
* Returns the custom HTML design as
|
||||
* a string
|
||||
*
|
||||
* @param array
|
||||
* @return string
|
||||
*
|
||||
*/
|
||||
private function composeFromPartials(array $partials) :string
|
||||
{
|
||||
$html = '';
|
||||
|
||||
$html .= $partials['includes'];
|
||||
$html .= $partials['header'];
|
||||
$html .= $partials['body'];
|
||||
$html .= $partials['footer'];
|
||||
|
||||
return $html;
|
||||
}
|
||||
}
|
758
app/Services/Pdf/PdfMock.php
Normal file
758
app/Services/Pdf/PdfMock.php
Normal file
@ -0,0 +1,758 @@
|
||||
<?php
|
||||
/**
|
||||
* Invoice Ninja (https://invoiceninja.com).
|
||||
*
|
||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||
*
|
||||
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
|
||||
*
|
||||
* @license https://www.elastic.co/licensing/elastic-license
|
||||
*/
|
||||
|
||||
namespace App\Services\Pdf;
|
||||
|
||||
use App\DataMapper\ClientSettings;
|
||||
use App\Models\Client;
|
||||
use App\Models\Company;
|
||||
use App\Models\Country;
|
||||
use App\Models\Credit;
|
||||
use App\Models\Currency;
|
||||
use App\Models\Design;
|
||||
use App\Models\Invoice;
|
||||
use App\Models\InvoiceInvitation;
|
||||
use App\Models\PurchaseOrder;
|
||||
use App\Models\Quote;
|
||||
use App\Models\Vendor;
|
||||
use App\Utils\Traits\MakesHash;
|
||||
|
||||
class PdfMock
|
||||
{
|
||||
use MakesHash;
|
||||
|
||||
private mixed $mock;
|
||||
|
||||
public object $settings;
|
||||
|
||||
public function __construct(public array $request, public Company $company)
|
||||
{
|
||||
}
|
||||
|
||||
public function getPdf(): mixed
|
||||
{
|
||||
$pdf_service = new PdfService($this->mock->invitation);
|
||||
|
||||
$pdf_config = (new PdfConfiguration($pdf_service));
|
||||
$pdf_config->entity = $this->mock;
|
||||
$pdf_config->entity_string = $this->request['entity_type'];
|
||||
$pdf_config->setTaxMap($this->mock->tax_map);
|
||||
$pdf_config->setTotalTaxMap($this->mock->total_tax_map);
|
||||
$pdf_config->client = $this->mock->client;
|
||||
$pdf_config->settings_object = $this->mock->client;
|
||||
$pdf_config->settings = $this->getMergedSettings();
|
||||
$this->settings = $pdf_config->settings;
|
||||
$pdf_config->entity_design_id = $pdf_config->settings->{"{$pdf_config->entity_string}_design_id"};
|
||||
$pdf_config->setPdfVariables();
|
||||
$pdf_config->setCurrency(Currency::find($this->settings->currency_id));
|
||||
$pdf_config->setCountry(Country::find($this->settings->country_id));
|
||||
$pdf_config->design = Design::find($this->decodePrimaryKey($pdf_config->entity_design_id));
|
||||
$pdf_config->currency_entity = $this->mock->client;
|
||||
|
||||
$pdf_service->config = $pdf_config;
|
||||
|
||||
$pdf_designer = (new PdfDesigner($pdf_service))->build();
|
||||
$pdf_service->designer = $pdf_designer;
|
||||
|
||||
$pdf_service->html_variables = $this->getStubVariables();
|
||||
|
||||
$pdf_builder = (new PdfBuilder($pdf_service))->build();
|
||||
$pdf_service->builder = $pdf_builder;
|
||||
|
||||
$html = $pdf_service->getHtml();
|
||||
|
||||
return $pdf_service->resolvePdfEngine($html);
|
||||
}
|
||||
|
||||
public function build(): self
|
||||
{
|
||||
$this->mock = $this->initEntity();
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function initEntity(): mixed
|
||||
{
|
||||
match ($this->request['entity_type']) {
|
||||
'invoice' => $entity = Invoice::factory()->make(),
|
||||
'quote' => $entity = Quote::factory()->make(),
|
||||
'credit' => $entity = Credit::factory()->make(),
|
||||
'purchase_order' => $entity = PurchaseOrder::factory()->make(),
|
||||
default => $entity = Invoice::factory()->make()
|
||||
};
|
||||
|
||||
if ($this->request['entity_type'] == PurchaseOrder::class) {
|
||||
$entity->vendor = Vendor::factory()->make();
|
||||
} else {
|
||||
$entity->client = Client::factory()->make();
|
||||
}
|
||||
|
||||
$entity->tax_map = $this->getTaxMap();
|
||||
$entity->total_tax_map = $this->getTotalTaxMap();
|
||||
$entity->invitation = InvoiceInvitation::factory()->make();
|
||||
$entity->invitation->company = $this->company;
|
||||
|
||||
return $entity;
|
||||
}
|
||||
|
||||
public function getMergedSettings() :object
|
||||
{
|
||||
match ($this->request['settings_type']) {
|
||||
'group' => $settings = ClientSettings::buildClientSettings($this->company->settings, $this->request['settings']),
|
||||
'client' => $settings = ClientSettings::buildClientSettings($this->company->settings, $this->request['settings']),
|
||||
'company' => $settings = (object)$this->request['settings'],
|
||||
default => $settings = $this->company->settings,
|
||||
};
|
||||
|
||||
return $settings;
|
||||
}
|
||||
|
||||
|
||||
private function getTaxMap()
|
||||
{
|
||||
return collect([['name' => 'GST', 'total' => 10]]);
|
||||
}
|
||||
|
||||
private function getTotalTaxMap()
|
||||
{
|
||||
return [['name' => 'GST', 'total' => 10]];
|
||||
}
|
||||
|
||||
public function getStubVariables()
|
||||
{
|
||||
return ['values' =>
|
||||
[
|
||||
|
||||
'$client.shipping_postal_code' => '46420',
|
||||
'$client.billing_postal_code' => '11243',
|
||||
'$company.city_state_postal' => 'Beveley Hills, CA, 90210',
|
||||
'$company.postal_city_state' => 'CA',
|
||||
'$company.postal_city' => '90210, CA',
|
||||
'$product.gross_line_total' => '100',
|
||||
'$client.postal_city_state' => '11243 Aufderharchester, North Carolina',
|
||||
'$client.postal_city' => '11243 Aufderharchester, North Carolina',
|
||||
'$client.shipping_address1' => '453',
|
||||
'$client.shipping_address2' => '66327 Waters Trail',
|
||||
'$client.city_state_postal' => 'Aufderharchester, North Carolina 11243',
|
||||
'$client.shipping_address' => '453<br/>66327 Waters Trail<br/>Aufderharchester, North Carolina 11243<br/>Afghanistan<br/>',
|
||||
'$client.billing_address2' => '63993 Aiyana View',
|
||||
'$client.billing_address1' => '8447',
|
||||
'$client.shipping_country' => 'USA',
|
||||
'$invoiceninja.whitelabel' => 'https://raw.githubusercontent.com/invoiceninja/invoiceninja/v5-develop/public/images/new_logo.png',
|
||||
'$client.billing_address' => '8447<br/>63993 Aiyana View<br/>Aufderharchester, North Carolina 11243<br/>Afghanistan<br/>',
|
||||
'$client.billing_country' => 'USA',
|
||||
'$task.gross_line_total' => '100',
|
||||
'$contact.portal_button' => '<a class="button" href="http://ninja.test:8000/client/key_login/zJJEjlUtXPiNnnnyO2tcYia64PSwauidy61eDnMU?client_hash=nzikYQITs1kyUK61GScTNW67JwhTRkOBVdvsHzIv">View client portal</a>',
|
||||
'$client.shipping_state' => 'Delaware',
|
||||
'$invoice.public_notes' => 'These are some public notes for your document',
|
||||
'$client.shipping_city' => 'Kesslerport',
|
||||
'$client.billing_state' => 'North Carolina',
|
||||
'$product.description' => 'A Product Description',
|
||||
'$product.product_key' => 'A Product Key',
|
||||
'$entity.public_notes' => 'Entity Public notes',
|
||||
'$invoice.balance_due' => '$0.00',
|
||||
'$client.public_notes' => ' ',
|
||||
'$company.postal_code' => $this->settings->postal_code,
|
||||
'$client.billing_city' => 'Aufderharchester',
|
||||
'$secondary_font_name' => $this->settings->primary_font,
|
||||
'$product.line_total' => '',
|
||||
'$product.tax_amount' => '',
|
||||
'$company.vat_number' => $this->settings->vat_number,
|
||||
'$invoice.invoice_no' => '0029',
|
||||
'$quote.quote_number' => '0029',
|
||||
'$client.postal_code' => '11243',
|
||||
'$contact.first_name' => 'Benedict',
|
||||
'$secondary_font_url' => 'https://fonts.googleapis.com/css2?family=Roboto&display=swap',
|
||||
'$contact.signature' => '',
|
||||
'$company_logo_size' => $this->settings->company_logo_size ?: '65%',
|
||||
'$product.tax_name1' => '',
|
||||
'$product.tax_name2' => '',
|
||||
'$product.tax_name3' => '',
|
||||
'$product.unit_cost' => '',
|
||||
'$quote.valid_until' => '2023-10-24',
|
||||
'$custom_surcharge1' => '$0.00',
|
||||
'$custom_surcharge2' => '$0.00',
|
||||
'$custom_surcharge3' => '$0.00',
|
||||
'$custom_surcharge4' => '$0.00',
|
||||
'$quote.balance_due' => '$0.00',
|
||||
'$company.id_number' => $this->settings->id_number,
|
||||
'$invoice.po_number' => 'PO12345',
|
||||
'$invoice_total_raw' => 0.0,
|
||||
'$postal_city_state' => '11243 Aufderharchester, North Carolina',
|
||||
'$client.vat_number' => '975977515',
|
||||
'$city_state_postal' => 'Aufderharchester, North Carolina 11243',
|
||||
'$contact.full_name' => 'Benedict Eichmann',
|
||||
'$contact.last_name' => 'Eichmann',
|
||||
'$company.country_2' => 'US',
|
||||
'$product.product1' => '',
|
||||
'$product.product2' => '',
|
||||
'$product.product3' => '',
|
||||
'$product.product4' => '',
|
||||
'$statement_amount' => '',
|
||||
'$task.description' => '',
|
||||
'$product.discount' => '',
|
||||
'$entity_issued_to' => 'Bob JOnes',
|
||||
'$assigned_to_user' => '',
|
||||
'$product.quantity' => '',
|
||||
'$total_tax_labels' => '',
|
||||
'$total_tax_values' => '',
|
||||
'$invoice.discount' => '$0.00',
|
||||
'$invoice.subtotal' => '$0.00',
|
||||
'$company.address2' => $this->settings->address2,
|
||||
'$partial_due_date' => ' ',
|
||||
'$invoice.due_date' => '2023-10-24',
|
||||
'$client.id_number' => 'CLI-2023-1234',
|
||||
'$credit.po_number' => 'PO12345',
|
||||
'$company.address1' => $this->settings->address1,
|
||||
'$credit.credit_no' => '0029',
|
||||
'$invoice.datetime' => '25/Feb/2023 1:10 am',
|
||||
'$contact.custom1' => null,
|
||||
'$contact.custom2' => null,
|
||||
'$contact.custom3' => null,
|
||||
'$contact.custom4' => null,
|
||||
'$task.line_total' => '',
|
||||
'$line_tax_labels' => '',
|
||||
'$line_tax_values' => '',
|
||||
'$secondary_color' => $this->settings->secondary_color,
|
||||
'$invoice.balance' => '$0.00',
|
||||
'$invoice.custom1' => 'custom value',
|
||||
'$invoice.custom2' => 'custom value',
|
||||
'$invoice.custom3' => 'custom value',
|
||||
'$invoice.custom4' => 'custom value',
|
||||
'$company.custom1' => 'custom value',
|
||||
'$company.custom2' => 'custom value',
|
||||
'$company.custom3' => 'custom value',
|
||||
'$company.custom4' => 'custom value',
|
||||
'$quote.po_number' => 'PO12345',
|
||||
'$company.website' => $this->settings->website,
|
||||
'$balance_due_raw' => '0.00',
|
||||
'$entity.datetime' => '25/Feb/2023 1:10 am',
|
||||
'$credit.datetime' => '25/Feb/2023 1:10 am',
|
||||
'$client.address2' => '63993 Aiyana View',
|
||||
'$client.address1' => '8447',
|
||||
'$user.first_name' => 'Derrick Monahan DDS',
|
||||
'$created_by_user' => 'Derrick Monahan DDS Erna Wunsch',
|
||||
'$client.currency' => 'USD',
|
||||
'$company.country' => 'United States',
|
||||
'$company.address' => 'United States<br/>',
|
||||
'$tech_hero_image' => 'http://ninja.test:8000/images/pdf-designs/tech-hero-image.jpg',
|
||||
'$task.tax_name1' => '',
|
||||
'$task.tax_name2' => '',
|
||||
'$task.tax_name3' => '',
|
||||
'$client.balance' => '$0.00',
|
||||
'$client_balance' => '$0.00',
|
||||
'$credit.balance' => '$0.00',
|
||||
'$credit_balance' => '$0.00',
|
||||
'$gross_subtotal' => '$0.00',
|
||||
'$invoice.amount' => '$0.00',
|
||||
'$client.custom1' => 'custom value',
|
||||
'$client.custom2' => 'custom value',
|
||||
'$client.custom3' => 'custom value',
|
||||
'$client.custom4' => 'custom value',
|
||||
'$emailSignature' => 'A email signature.',
|
||||
'$invoice.number' => '0029',
|
||||
'$quote.quote_no' => '0029',
|
||||
'$quote.datetime' => '25/Feb/2023 1:10 am',
|
||||
'$client_address' => '8447<br/>63993 Aiyana View<br/>Aufderharchester, North Carolina 11243<br/>Afghanistan<br/>',
|
||||
'$client.address' => '8447<br/>63993 Aiyana View<br/>Aufderharchester, North Carolina 11243<br/>Afghanistan<br/>',
|
||||
'$payment_button' => '<a class="button" href="http://ninja.test:8000/client/pay/UAUY8vIPuno72igmXbbpldwo5BDDKIqs">Pay Now</a>',
|
||||
'$payment_qrcode' => '<svg class=\'pqrcode\' viewBox=\'0 0 200 200\' width=\'200\' height=\'200\' x=\'0\' y=\'0\' xmlns=\'http://www.w3.org/2000/svg\'>
|
||||
<rect x=\'0\' y=\'0\' width=\'100%\'\' height=\'100%\' /><?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="200" height="200" viewBox="0 0 200 200"><rect x="0" y="0" width="200" height="200" fill="#fefefe"/><g transform="scale(4.878)"><g transform="translate(4,4)"><path fill-rule="evenodd" d="M9 0L9 1L8 1L8 2L9 2L9 3L8 3L8 4L10 4L10 7L11 7L11 4L12 4L12 5L13 5L13 4L12 4L12 2L14 2L14 7L15 7L15 6L16 6L16 8L15 8L15 10L14 10L14 11L16 11L16 12L14 12L14 13L15 13L15 14L14 14L14 15L15 15L15 14L17 14L17 15L16 15L16 16L14 16L14 17L15 17L15 18L14 18L14 19L13 19L13 18L11 18L11 15L8 15L8 12L9 12L9 13L10 13L10 14L11 14L11 13L12 13L12 14L13 14L13 13L12 13L12 11L13 11L13 10L11 10L11 11L10 11L10 9L11 9L11 8L6 8L6 9L5 9L5 8L0 8L0 10L1 10L1 12L2 12L2 11L3 11L3 10L4 10L4 11L5 11L5 12L3 12L3 13L7 13L7 14L6 14L6 15L5 15L5 14L1 14L1 15L0 15L0 19L1 19L1 20L0 20L0 25L1 25L1 20L2 20L2 19L3 19L3 20L4 20L4 21L5 21L5 20L6 20L6 21L8 21L8 23L7 23L7 22L5 22L5 24L4 24L4 25L8 25L8 27L10 27L10 28L11 28L11 29L9 29L9 28L8 28L8 33L9 33L9 30L11 30L11 29L12 29L12 32L13 32L13 33L14 33L14 32L15 32L15 33L17 33L17 32L19 32L19 31L18 31L18 30L16 30L16 28L17 28L17 29L18 29L18 28L19 28L19 27L18 27L18 26L17 26L17 27L16 27L16 26L15 26L15 25L16 25L16 24L18 24L18 25L19 25L19 23L18 23L18 22L19 22L19 20L17 20L17 19L20 19L20 25L21 25L21 26L22 26L22 28L21 28L21 27L20 27L20 33L21 33L21 30L24 30L24 32L25 32L25 33L27 33L27 32L29 32L29 33L32 33L32 32L33 32L33 31L31 31L31 32L29 32L29 30L32 30L32 29L33 29L33 27L32 27L32 26L31 26L31 25L32 25L32 24L31 24L31 25L30 25L30 23L29 23L29 21L30 21L30 22L31 22L31 21L32 21L32 22L33 22L33 21L32 21L32 20L33 20L33 18L32 18L32 20L31 20L31 21L30 21L30 19L29 19L29 18L28 18L28 17L25 17L25 16L28 16L28 15L30 15L30 14L31 14L31 17L30 17L30 18L31 18L31 17L32 17L32 16L33 16L33 15L32 15L32 14L31 14L31 13L32 13L32 12L33 12L33 11L32 11L32 10L31 10L31 9L32 9L32 8L31 8L31 9L30 9L30 8L29 8L29 10L28 10L28 11L30 11L30 14L29 14L29 12L27 12L27 11L26 11L26 10L25 10L25 9L26 9L26 8L25 8L25 9L23 9L23 8L24 8L24 7L25 7L25 5L23 5L23 3L24 3L24 4L25 4L25 3L24 3L24 2L25 2L25 0L24 0L24 1L23 1L23 0L21 0L21 1L20 1L20 4L21 4L21 5L22 5L22 7L23 7L23 8L22 8L22 9L18 9L18 8L19 8L19 6L20 6L20 8L21 8L21 6L20 6L20 5L19 5L19 6L18 6L18 5L17 5L17 2L18 2L18 1L19 1L19 0L18 0L18 1L17 1L17 0L16 0L16 1L17 1L17 2L16 2L16 3L15 3L15 2L14 2L14 1L15 1L15 0L14 0L14 1L11 1L11 2L10 2L10 0ZM21 1L21 2L22 2L22 3L23 3L23 2L22 2L22 1ZM10 3L10 4L11 4L11 3ZM15 4L15 5L16 5L16 4ZM8 5L8 7L9 7L9 5ZM12 6L12 9L14 9L14 8L13 8L13 6ZM17 6L17 7L18 7L18 6ZM23 6L23 7L24 7L24 6ZM16 8L16 9L17 9L17 10L16 10L16 11L17 11L17 10L18 10L18 11L20 11L20 10L18 10L18 9L17 9L17 8ZM27 8L27 9L28 9L28 8ZM1 9L1 10L2 10L2 9ZM4 9L4 10L5 10L5 11L6 11L6 12L7 12L7 11L9 11L9 10L8 10L8 9L6 9L6 10L5 10L5 9ZM22 9L22 10L21 10L21 11L22 11L22 10L23 10L23 11L24 11L24 12L23 12L23 13L22 13L22 14L21 14L21 12L18 12L18 13L17 13L17 12L16 12L16 13L17 13L17 14L21 14L21 15L20 15L20 16L19 16L19 15L17 15L17 16L16 16L16 18L21 18L21 19L22 19L22 18L21 18L21 17L22 17L22 16L23 16L23 19L25 19L25 18L24 18L24 16L23 16L23 13L24 13L24 14L25 14L25 12L26 12L26 15L27 15L27 14L28 14L28 13L27 13L27 12L26 12L26 11L24 11L24 10L23 10L23 9ZM6 10L6 11L7 11L7 10ZM30 10L30 11L31 11L31 10ZM10 12L10 13L11 13L11 12ZM1 15L1 17L2 17L2 18L1 18L1 19L2 19L2 18L3 18L3 19L4 19L4 20L5 20L5 19L6 19L6 20L8 20L8 21L10 21L10 23L8 23L8 24L10 24L10 27L11 27L11 26L14 26L14 25L15 25L15 24L16 24L16 23L17 23L17 22L18 22L18 21L17 21L17 20L16 20L16 19L14 19L14 21L13 21L13 19L12 19L12 21L10 21L10 20L11 20L11 18L10 18L10 17L8 17L8 15L6 15L6 16L7 16L7 17L5 17L5 16L4 16L4 15ZM12 15L12 17L13 17L13 15ZM3 16L3 18L4 18L4 19L5 19L5 17L4 17L4 16ZM17 16L17 17L18 17L18 16ZM20 16L20 17L21 17L21 16ZM6 18L6 19L7 19L7 18ZM8 18L8 20L9 20L9 19L10 19L10 18ZM26 18L26 19L27 19L27 20L26 20L26 21L25 21L25 22L24 22L24 20L22 20L22 22L21 22L21 23L22 23L22 25L23 25L23 28L22 28L22 29L24 29L24 30L25 30L25 32L27 32L27 31L28 31L28 30L27 30L27 31L26 31L26 29L24 29L24 24L23 24L23 23L27 23L27 24L29 24L29 23L27 23L27 20L29 20L29 19L27 19L27 18ZM15 20L15 21L14 21L14 23L12 23L12 25L13 25L13 24L14 24L14 23L16 23L16 22L15 22L15 21L16 21L16 20ZM2 21L2 22L3 22L3 23L4 23L4 22L3 22L3 21ZM12 21L12 22L13 22L13 21ZM22 22L22 23L23 23L23 22ZM6 23L6 24L7 24L7 23ZM10 23L10 24L11 24L11 23ZM2 24L2 25L3 25L3 24ZM25 25L25 28L28 28L28 25ZM26 26L26 27L27 27L27 26ZM29 26L29 27L30 27L30 28L29 28L29 29L32 29L32 27L31 27L31 26ZM12 27L12 28L13 28L13 30L14 30L14 29L15 29L15 28L16 28L16 27L15 27L15 28L14 28L14 27ZM17 27L17 28L18 28L18 27ZM15 30L15 31L16 31L16 30ZM10 31L10 32L11 32L11 31ZM13 31L13 32L14 32L14 31ZM22 32L22 33L23 33L23 32ZM0 0L0 7L7 7L7 0ZM1 1L1 6L6 6L6 1ZM2 2L2 5L5 5L5 2ZM26 0L26 7L33 7L33 0ZM27 1L27 6L32 6L32 1ZM28 2L28 5L31 5L31 2ZM0 26L0 33L7 33L7 26ZM1 27L1 32L6 32L6 27ZM2 28L2 31L5 31L5 28Z" fill="#000000"/></g></g></svg>
|
||||
</svg>',
|
||||
'$client.country' => 'Afghanistan',
|
||||
'$user.last_name' => 'Erna Wunsch',
|
||||
'$client.website' => 'http://www.parisian.org/',
|
||||
'$dir_text_align' => 'left',
|
||||
'$entity_images' => '',
|
||||
'$task.discount' => '',
|
||||
'$contact.email' => 'bob@gmail.com',
|
||||
'$primary_color' => $this->settings->primary_color,
|
||||
'$credit_amount' => '$0.00',
|
||||
'$invoice.total' => '$0.00',
|
||||
'$invoice.taxes' => '$0.00',
|
||||
'$quote.custom1' => 'custom value',
|
||||
'$quote.custom2' => 'custom value',
|
||||
'$quote.custom3' => 'custom value',
|
||||
'$quote.custom4' => 'custom value',
|
||||
'$company.email' => $this->settings->email,
|
||||
'$client.number' => '12345',
|
||||
'$company.phone' => $this->settings->phone,
|
||||
'$company.state' => $this->settings->state,
|
||||
'$credit.number' => '0029',
|
||||
'$entity_number' => '0029',
|
||||
'$credit_number' => '0029',
|
||||
'$global_margin' => '6.35mm',
|
||||
'$contact.phone' => '681-480-9828',
|
||||
'$portal_button' => '<a class="button" href="http://ninja.test:8000/client/key_login/zJJEjlUtXPiNnnnyO2tcYia64PSwauidy61eDnMU?client_hash=nzikYQITs1kyUK61GScTNW67JwhTRkOBVdvsHzIv">View client portal</a>',
|
||||
'$paymentButton' => '<a class="button" href="http://ninja.test:8000/client/pay/UAUY8vIPuno72igmXbbpldwo5BDDKIqs">Pay Now</a>',
|
||||
'$entity_footer' => 'Default invoice footer',
|
||||
'$client.lang_2' => 'en',
|
||||
'$product.date' => '',
|
||||
'$client.email' => 'client@gmail.com',
|
||||
'$product.item' => '',
|
||||
'$public_notes' => 'These are very public notes',
|
||||
'$task.service' => '',
|
||||
'$credit.total' => '$0.00',
|
||||
'$net_subtotal' => '$0.00',
|
||||
'$paid_to_date' => '$0.00',
|
||||
'$quote.amount' => '$0.00',
|
||||
'$company.city' => $this->settings->city,
|
||||
'$payment.date' => '2022-10-10',
|
||||
'$client.phone' => '555-123-3212',
|
||||
'$number_short' => '0029',
|
||||
'$quote.number' => '0029',
|
||||
'$invoice.date' => '25/Feb/2023',
|
||||
'$company.name' => $this->settings->name,
|
||||
'$portalButton' => '<a class="button" href="http://ninja.test:8000/client/key_login/zJJEjlUtXPiNnnnyO2tcYia64PSwauidy61eDnMU?client_hash=nzikYQITs1kyUK61GScTNW67JwhTRkOBVdvsHzIv">View client portal</a>',
|
||||
'$contact.name' => 'Benedict Eichmann',
|
||||
'$entity.terms' => 'Default company invoice terms',
|
||||
'$client.state' => 'North Carolina',
|
||||
'$company.logo' => $this->settings->company_logo,
|
||||
'$company_logo' => $this->settings->company_logo,
|
||||
'$payment_link' => 'http://ninja.test:8000/client/pay/UAUY8vIPuno72igmXbbpldwo5BDDKIqs',
|
||||
'$status_logo' => '',
|
||||
'$description' => '',
|
||||
'$product.tax' => '',
|
||||
'$valid_until' => '',
|
||||
'$your_entity' => '',
|
||||
'$shipping' => '',
|
||||
'$balance_due' => '$0.00',
|
||||
'$outstanding' => '$0.00',
|
||||
'$partial_due' => '$0.00',
|
||||
'$quote.total' => '$0.00',
|
||||
'$payment_due' => ' ',
|
||||
'$credit.date' => '25/Feb/2023',
|
||||
'$invoiceDate' => '25/Feb/2023',
|
||||
'$view_button' => '<a class="button" href="http://ninja.test:8000/client/invoice/UAUY8vIPuno72igmXbbpldwo5BDDKIqs">View Invoice</a>',
|
||||
'$client.city' => 'Aufderharchester',
|
||||
'$spc_qr_code' => 'SPC
|
||||
0200
|
||||
1
|
||||
|
||||
K
|
||||
434343
|
||||
|
||||
|
||||
|
||||
|
||||
CH
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
0.000000
|
||||
USD
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
NON
|
||||
|
||||
0029
|
||||
EPD
|
||||
',
|
||||
'$client_name' => 'A Client Called Bob',
|
||||
'$client.name' => 'A Client Called Bob',
|
||||
'$paymentLink' => 'http://ninja.test:8000/client/pay/UAUY8vIPuno72igmXbbpldwo5BDDKIqs',
|
||||
'$payment_url' => 'http://ninja.test:8000/client/pay/UAUY8vIPuno72igmXbbpldwo5BDDKIqs',
|
||||
'$page_layout' => $this->settings->page_layout,
|
||||
'$task.task1' => '',
|
||||
'$task.task2' => '',
|
||||
'$task.task3' => '',
|
||||
'$task.task4' => '',
|
||||
'$task.hours' => '',
|
||||
'$amount_due' => '$0.00',
|
||||
'$amount_raw' => '0.00',
|
||||
'$invoice_no' => '0029',
|
||||
'$quote.date' => '25/Feb/2023',
|
||||
'$vat_number' => '975977515',
|
||||
'$viewButton' => '<a class="button" href="http://ninja.test:8000/client/invoice/UAUY8vIPuno72igmXbbpldwo5BDDKIqs">View Invoice</a>',
|
||||
'$portal_url' => 'http://ninja.test:8000/client/',
|
||||
'$task.date' => '',
|
||||
'$task.rate' => '',
|
||||
'$task.cost' => '',
|
||||
'$statement' => '',
|
||||
'$user_iban' => ' ',
|
||||
'$signature' => ' ',
|
||||
'$id_number' => 'ID Number',
|
||||
'$credit_no' => '0029',
|
||||
'$font_size' => $this->settings->font_size,
|
||||
'$view_link' => '<a class="button" href="http://ninja.test:8000/client/invoice/UAUY8vIPuno72igmXbbpldwo5BDDKIqs">View Invoice</a>',
|
||||
'$page_size' => $this->settings->page_size,
|
||||
'$country_2' => 'AF',
|
||||
'$firstName' => 'Benedict',
|
||||
'$user.name' => 'Derrick Monahan DDS Erna Wunsch',
|
||||
'$font_name' => 'Roboto',
|
||||
'$auto_bill' => 'This invoice will automatically be billed to your credit card on file on the due date.',
|
||||
'$payments' => '',
|
||||
'$task.tax' => '',
|
||||
'$discount' => '$0.00',
|
||||
'$subtotal' => '$0.00',
|
||||
'$company1' => 'custom value',
|
||||
'$company2' => 'custom value',
|
||||
'$company3' => 'custom value',
|
||||
'$company4' => 'custom value',
|
||||
'$due_date' => '2022-01-01',
|
||||
'$poNumber' => 'PO-123456',
|
||||
'$quote_no' => '0029',
|
||||
'$address2' => '63993 Aiyana View',
|
||||
'$address1' => '8447',
|
||||
'$viewLink' => '<a class="button" href="http://ninja.test:8000/client/invoice/UAUY8vIPuno72igmXbbpldwo5BDDKIqs">View Invoice</a>',
|
||||
'$autoBill' => 'This invoice will automatically be billed to your credit card on file on the due date.',
|
||||
'$view_url' => 'http://ninja.test:8000/client/invoice/UAUY8vIPuno72igmXbbpldwo5BDDKIqs',
|
||||
'$font_url' => 'https://fonts.googleapis.com/css2?family=Roboto&display=swap',
|
||||
'$details' => '',
|
||||
'$balance' => '$0.00',
|
||||
'$partial' => '$0.00',
|
||||
'$client1' => 'custom value',
|
||||
'$client2' => 'custom value',
|
||||
'$client3' => 'custom value',
|
||||
'$client4' => 'custom value',
|
||||
'$dueDate' => '2022-01-01',
|
||||
'$invoice' => '0029',
|
||||
'$account' => '434343',
|
||||
'$country' => 'United States',
|
||||
'$contact' => 'Benedict Eichmann',
|
||||
'$app_url' => 'http://ninja.test:8000',
|
||||
'$website' => 'http://www.parisian.org/',
|
||||
'$entity' => '',
|
||||
'$thanks' => 'Thanks!',
|
||||
'$amount' => '$0.00',
|
||||
'$method' => ' ',
|
||||
'$number' => '0029',
|
||||
'$footer' => 'Default invoice footer',
|
||||
'$client' => 'The Client Name',
|
||||
'$email' => 'email@invoiceninja.net',
|
||||
'$notes' => '',
|
||||
'_rate1' => '',
|
||||
'_rate2' => '',
|
||||
'_rate3' => '',
|
||||
'$taxes' => '$0.00',
|
||||
'$total' => '$0.00',
|
||||
'$phone' => ' ',
|
||||
'$terms' => 'Default company invoice terms',
|
||||
'$from' => 'Bob Jones',
|
||||
'$item' => '',
|
||||
'$date' => '25/Feb/2023',
|
||||
'$tax' => '',
|
||||
'$dir' => 'ltr',
|
||||
'$to' => 'Jimmy Giggles',
|
||||
'$show_paid_stamp' => $this->settings->show_paid_stamp ? 'flex' : 'none',
|
||||
'$status_logo' => '<div class="stamp is-paid"> ' . ctrans('texts.paid') .'</div>',
|
||||
'$show_shipping_address' => $this->settings->show_shipping_address ? 'flex' : 'none',
|
||||
'$show_shipping_address_block' => $this->settings->show_shipping_address ? 'block' : 'none',
|
||||
'$show_shipping_address_visibility' => $this->settings->show_shipping_address ? 'visible' : 'hidden',
|
||||
],
|
||||
'labels' =>
|
||||
[
|
||||
'$client.shipping_postal_code_label' => 'Shipping Postal Code',
|
||||
'$client.billing_postal_code_label' => 'Postal Code',
|
||||
'$company.city_state_postal_label' => 'City/State/Postal',
|
||||
'$company.postal_city_state_label' => 'Postal/City/State',
|
||||
'$company.postal_city_label' => 'Postal/City',
|
||||
'$product.gross_line_total_label' => 'Gross line total',
|
||||
'$client.postal_city_state_label' => 'Postal/City/State',
|
||||
'$client.postal_city_label' => 'Postal/City',
|
||||
'$client.shipping_address1_label' => 'Shipping Street',
|
||||
'$client.shipping_address2_label' => 'Shipping Apt/Suite',
|
||||
'$client.city_state_postal_label' => 'City/State/Postal',
|
||||
'$client.shipping_address_label' => 'Shipping Address',
|
||||
'$client.billing_address2_label' => 'Apt/Suite',
|
||||
'$client.billing_address1_label' => 'Street',
|
||||
'$client.shipping_country_label' => 'Shipping Country',
|
||||
'$invoiceninja.whitelabel_label' => '',
|
||||
'$client.billing_address_label' => 'Address',
|
||||
'$client.billing_country_label' => 'Country',
|
||||
'$task.gross_line_total_label' => 'Gross line total',
|
||||
'$contact.portal_button_label' => 'view_client_portal',
|
||||
'$client.shipping_state_label' => 'Shipping State/Province',
|
||||
'$invoice.public_notes_label' => 'Public Notes',
|
||||
'$client.shipping_city_label' => 'Shipping City',
|
||||
'$client.billing_state_label' => 'State/Province',
|
||||
'$product.description_label' => 'Description',
|
||||
'$product.product_key_label' => 'Product',
|
||||
'$entity.public_notes_label' => 'Public Notes',
|
||||
'$invoice.balance_due_label' => 'Balance Due',
|
||||
'$client.public_notes_label' => 'Notes',
|
||||
'$company.postal_code_label' => 'Postal Code',
|
||||
'$client.billing_city_label' => 'City',
|
||||
'$secondary_font_name_label' => '',
|
||||
'$product.line_total_label' => 'Line Total',
|
||||
'$product.tax_amount_label' => 'Tax',
|
||||
'$company.vat_number_label' => 'VAT Number',
|
||||
'$invoice.invoice_no_label' => 'Invoice Number',
|
||||
'$quote.quote_number_label' => 'Quote Number',
|
||||
'$client.postal_code_label' => 'Postal Code',
|
||||
'$contact.first_name_label' => 'First Name',
|
||||
'$secondary_font_url_label' => '',
|
||||
'$contact.signature_label' => '',
|
||||
'$company_logo_size_label' => '',
|
||||
'$product.tax_name1_label' => 'Tax',
|
||||
'$product.tax_name2_label' => 'Tax',
|
||||
'$product.tax_name3_label' => 'Tax',
|
||||
'$product.unit_cost_label' => 'Unit Cost',
|
||||
'$quote.valid_until_label' => 'Valid Until',
|
||||
'$custom_surcharge1_label' => '',
|
||||
'$custom_surcharge2_label' => '',
|
||||
'$custom_surcharge3_label' => '',
|
||||
'$custom_surcharge4_label' => '',
|
||||
'$quote.balance_due_label' => 'Balance Due',
|
||||
'$company.id_number_label' => 'ID Number',
|
||||
'$invoice.po_number_label' => 'PO Number',
|
||||
'$invoice_total_raw_label' => 'Invoice Total',
|
||||
'$postal_city_state_label' => 'Postal/City/State',
|
||||
'$client.vat_number_label' => 'VAT Number',
|
||||
'$city_state_postal_label' => 'City/State/Postal',
|
||||
'$contact.full_name_label' => 'Name',
|
||||
'$contact.last_name_label' => 'Last Name',
|
||||
'$company.country_2_label' => 'Country',
|
||||
'$product.product1_label' => '',
|
||||
'$product.product2_label' => '',
|
||||
'$product.product3_label' => '',
|
||||
'$product.product4_label' => '',
|
||||
'$statement_amount_label' => 'Amount',
|
||||
'$task.description_label' => 'Description',
|
||||
'$product.discount_label' => 'Discount',
|
||||
'$entity_issued_to_label' => 'Invoice issued to',
|
||||
'$assigned_to_user_label' => 'Name',
|
||||
'$product.quantity_label' => 'Quantity',
|
||||
'$total_tax_labels_label' => 'Taxes',
|
||||
'$total_tax_values_label' => 'Taxes',
|
||||
'$invoice.discount_label' => 'Discount',
|
||||
'$invoice.subtotal_label' => 'Subtotal',
|
||||
'$company.address2_label' => 'Apt/Suite',
|
||||
'$partial_due_date_label' => 'Due Date',
|
||||
'$invoice.due_date_label' => 'Due Date',
|
||||
'$client.id_number_label' => 'ID Number',
|
||||
'$credit.po_number_label' => 'PO Number',
|
||||
'$company.address1_label' => 'Street',
|
||||
'$credit.credit_no_label' => 'Invoice Number',
|
||||
'$invoice.datetime_label' => 'Date',
|
||||
'$contact.custom1_label' => '',
|
||||
'$contact.custom2_label' => '',
|
||||
'$contact.custom3_label' => '',
|
||||
'$contact.custom4_label' => '',
|
||||
'$task.line_total_label' => 'Line Total',
|
||||
'$line_tax_labels_label' => 'Taxes',
|
||||
'$line_tax_values_label' => 'Taxes',
|
||||
'$secondary_color_label' => '',
|
||||
'$invoice.balance_label' => 'Balance',
|
||||
'$invoice.custom1_label' => '',
|
||||
'$invoice.custom2_label' => '',
|
||||
'$invoice.custom3_label' => '',
|
||||
'$invoice.custom4_label' => '',
|
||||
'$company.custom1_label' => '',
|
||||
'$company.custom2_label' => '',
|
||||
'$company.custom3_label' => '',
|
||||
'$company.custom4_label' => '',
|
||||
'$quote.po_number_label' => 'PO Number',
|
||||
'$company.website_label' => 'Website',
|
||||
'$balance_due_raw_label' => 'Balance Due',
|
||||
'$entity.datetime_label' => 'Date',
|
||||
'$credit.datetime_label' => 'Date',
|
||||
'$client.address2_label' => 'Apt/Suite',
|
||||
'$client.address1_label' => 'Street',
|
||||
'$user.first_name_label' => 'First Name',
|
||||
'$created_by_user_label' => 'Name',
|
||||
'$client.currency_label' => '',
|
||||
'$company.country_label' => 'Country',
|
||||
'$company.address_label' => 'Address',
|
||||
'$tech_hero_image_label' => '',
|
||||
'$task.tax_name1_label' => 'Tax',
|
||||
'$task.tax_name2_label' => 'Tax',
|
||||
'$task.tax_name3_label' => 'Tax',
|
||||
'$client.balance_label' => 'Account balance',
|
||||
'$client_balance_label' => 'Account balance',
|
||||
'$credit.balance_label' => 'Balance',
|
||||
'$credit_balance_label' => 'Credit Balance',
|
||||
'$gross_subtotal_label' => 'Subtotal',
|
||||
'$invoice.amount_label' => 'Total',
|
||||
'$client.custom1_label' => '',
|
||||
'$client.custom2_label' => '',
|
||||
'$client.custom3_label' => '',
|
||||
'$client.custom4_label' => '',
|
||||
'$emailSignature_label' => '',
|
||||
'$invoice.number_label' => 'Invoice Number',
|
||||
'$quote.quote_no_label' => 'Quote Number',
|
||||
'$quote.datetime_label' => 'Date',
|
||||
'$client_address_label' => 'Address',
|
||||
'$client.address_label' => 'Address',
|
||||
'$payment_button_label' => 'Pay Now',
|
||||
'$payment_qrcode_label' => 'Pay Now',
|
||||
'$client.country_label' => 'Country',
|
||||
'$user.last_name_label' => 'Last Name',
|
||||
'$client.website_label' => 'Website',
|
||||
'$dir_text_align_label' => '',
|
||||
'$entity_images_label' => '',
|
||||
'$task.discount_label' => 'Discount',
|
||||
'$contact.email_label' => 'Email',
|
||||
'$primary_color_label' => '',
|
||||
'$credit_amount_label' => 'Credit Amount',
|
||||
'$invoice.total_label' => 'Invoice Total',
|
||||
'$invoice.taxes_label' => 'Taxes',
|
||||
'$quote.custom1_label' => '',
|
||||
'$quote.custom2_label' => '',
|
||||
'$quote.custom3_label' => '',
|
||||
'$quote.custom4_label' => '',
|
||||
'$company.email_label' => 'Email',
|
||||
'$client.number_label' => 'Number',
|
||||
'$company.phone_label' => 'Phone',
|
||||
'$company.state_label' => 'State/Province',
|
||||
'$credit.number_label' => 'Credit Number',
|
||||
'$entity_number_label' => 'Invoice Number',
|
||||
'$credit_number_label' => 'Invoice Number',
|
||||
'$global_margin_label' => '',
|
||||
'$contact.phone_label' => 'Phone',
|
||||
'$portal_button_label' => 'view_client_portal',
|
||||
'$paymentButton_label' => 'Pay Now',
|
||||
'$entity_footer_label' => '',
|
||||
'$client.lang_2_label' => '',
|
||||
'$product.date_label' => 'Date',
|
||||
'$client.email_label' => 'Email',
|
||||
'$product.item_label' => 'Item',
|
||||
'$public_notes_label' => 'Public Notes',
|
||||
'$task.service_label' => 'Service',
|
||||
'$credit.total_label' => 'Credit Total',
|
||||
'$net_subtotal_label' => 'Net',
|
||||
'$paid_to_date_label' => 'Paid to Date',
|
||||
'$quote.amount_label' => 'Quote Total',
|
||||
'$company.city_label' => 'City',
|
||||
'$payment.date_label' => 'Payment Date',
|
||||
'$client.phone_label' => 'Phone',
|
||||
'$number_short_label' => 'Invoice #',
|
||||
'$quote.number_label' => 'Quote Number',
|
||||
'$invoice.date_label' => 'Invoice Date',
|
||||
'$company.name_label' => 'Company Name',
|
||||
'$portalButton_label' => 'view_client_portal',
|
||||
'$contact.name_label' => 'Contact Name',
|
||||
'$entity.terms_label' => 'Invoice Terms',
|
||||
'$client.state_label' => 'State/Province',
|
||||
'$company.logo_label' => 'Logo',
|
||||
'$company_logo_label' => 'Logo',
|
||||
'$payment_link_label' => 'Pay Now',
|
||||
'$status_logo_label' => '',
|
||||
'$description_label' => 'Description',
|
||||
'$product.tax_label' => 'Tax',
|
||||
'$valid_until_label' => 'Valid Until',
|
||||
'$your_entity_label' => 'Your Invoice',
|
||||
'$shipping_label' => 'Shipping',
|
||||
'$balance_due_label' => 'Balance Due',
|
||||
'$outstanding_label' => 'Balance Due',
|
||||
'$partial_due_label' => 'Partial Due',
|
||||
'$quote.total_label' => 'Total',
|
||||
'$payment_due_label' => 'Payment due',
|
||||
'$credit.date_label' => 'Credit Date',
|
||||
'$invoiceDate_label' => 'Invoice Date',
|
||||
'$view_button_label' => 'View Invoice',
|
||||
'$client.city_label' => 'City',
|
||||
'$spc_qr_code_label' => '',
|
||||
'$client_name_label' => 'Client Name',
|
||||
'$client.name_label' => 'Client Name',
|
||||
'$paymentLink_label' => 'Pay Now',
|
||||
'$payment_url_label' => 'Pay Now',
|
||||
'$page_layout_label' => '',
|
||||
'$task.task1_label' => '',
|
||||
'$task.task2_label' => '',
|
||||
'$task.task3_label' => '',
|
||||
'$task.task4_label' => '',
|
||||
'$task.hours_label' => 'Hours',
|
||||
'$amount_due_label' => 'Amount due',
|
||||
'$amount_raw_label' => 'Amount',
|
||||
'$invoice_no_label' => 'Invoice Number',
|
||||
'$quote.date_label' => 'Quote Date',
|
||||
'$vat_number_label' => 'VAT Number',
|
||||
'$viewButton_label' => 'View Invoice',
|
||||
'$portal_url_label' => '',
|
||||
'$task.date_label' => 'Date',
|
||||
'$task.rate_label' => 'Rate',
|
||||
'$task.cost_label' => 'Rate',
|
||||
'$statement_label' => 'Statement',
|
||||
'$user_iban_label' => '',
|
||||
'$signature_label' => '',
|
||||
'$id_number_label' => 'ID Number',
|
||||
'$credit_no_label' => 'Invoice Number',
|
||||
'$font_size_label' => '',
|
||||
'$view_link_label' => 'View Invoice',
|
||||
'$page_size_label' => '',
|
||||
'$country_2_label' => 'Country',
|
||||
'$firstName_label' => 'First Name',
|
||||
'$user.name_label' => 'Name',
|
||||
'$font_name_label' => '',
|
||||
'$auto_bill_label' => '',
|
||||
'$payments_label' => 'Payments',
|
||||
'$task.tax_label' => 'Tax',
|
||||
'$discount_label' => 'Discount',
|
||||
'$subtotal_label' => 'Subtotal',
|
||||
'$company1_label' => '',
|
||||
'$company2_label' => '',
|
||||
'$company3_label' => '',
|
||||
'$company4_label' => '',
|
||||
'$due_date_label' => 'Due Date',
|
||||
'$poNumber_label' => 'PO Number',
|
||||
'$quote_no_label' => 'Quote Number',
|
||||
'$address2_label' => 'Apt/Suite',
|
||||
'$address1_label' => 'Street',
|
||||
'$viewLink_label' => 'View Invoice',
|
||||
'$autoBill_label' => '',
|
||||
'$view_url_label' => 'View Invoice',
|
||||
'$font_url_label' => '',
|
||||
'$details_label' => 'Details',
|
||||
'$balance_label' => 'Balance',
|
||||
'$partial_label' => 'Partial Due',
|
||||
'$client1_label' => '',
|
||||
'$client2_label' => '',
|
||||
'$client3_label' => '',
|
||||
'$client4_label' => '',
|
||||
'$dueDate_label' => 'Due Date',
|
||||
'$invoice_label' => 'Invoice Number',
|
||||
'$account_label' => 'Company Name',
|
||||
'$country_label' => 'Country',
|
||||
'$contact_label' => 'Name',
|
||||
'$app_url_label' => '',
|
||||
'$website_label' => 'Website',
|
||||
'$entity_label' => 'Invoice',
|
||||
'$thanks_label' => 'Thanks',
|
||||
'$amount_label' => 'Total',
|
||||
'$method_label' => 'Method',
|
||||
'$number_label' => 'Invoice Number',
|
||||
'$footer_label' => '',
|
||||
'$client_label' => 'Client Name',
|
||||
'$email_label' => 'Email',
|
||||
'$notes_label' => 'Public Notes',
|
||||
'_rate1_label' => 'Tax',
|
||||
'_rate2_label' => 'Tax',
|
||||
'_rate3_label' => 'Tax',
|
||||
'$taxes_label' => 'Taxes',
|
||||
'$total_label' => 'Total',
|
||||
'$phone_label' => 'Phone',
|
||||
'$terms_label' => 'Invoice Terms',
|
||||
'$from_label' => 'From',
|
||||
'$item_label' => 'Item',
|
||||
'$date_label' => 'Invoice Date',
|
||||
'$tax_label' => 'Tax',
|
||||
'$dir_label' => '',
|
||||
'$to_label' => 'To',
|
||||
'$show_paid_stamp_label' => '',
|
||||
'$status_logo_label' => '',
|
||||
'$show_shipping_address_label' => '',
|
||||
'$show_shipping_address_block_label' => '',
|
||||
'$show_shipping_address_visibility_label' => '',
|
||||
],
|
||||
];
|
||||
}
|
||||
}
|
145
app/Services/Pdf/PdfService.php
Normal file
145
app/Services/Pdf/PdfService.php
Normal file
@ -0,0 +1,145 @@
|
||||
<?php
|
||||
/**
|
||||
* Invoice Ninja (https://invoiceninja.com).
|
||||
*
|
||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||
*
|
||||
* @copyright Copyright (c) 2022. Invoice Ninja LLC (https://invoiceninja.com)
|
||||
*
|
||||
* @license https://www.elastic.co/licensing/elastic-license
|
||||
*/
|
||||
|
||||
namespace App\Services\Pdf;
|
||||
|
||||
use App\Models\Account;
|
||||
use App\Models\Company;
|
||||
use App\Models\CreditInvitation;
|
||||
use App\Models\InvoiceInvitation;
|
||||
use App\Models\PurchaseOrderInvitation;
|
||||
use App\Models\QuoteInvitation;
|
||||
use App\Models\RecurringInvoiceInvitation;
|
||||
use App\Utils\HostedPDF\NinjaPdf;
|
||||
use App\Utils\HtmlEngine;
|
||||
use App\Utils\PhantomJS\Phantom;
|
||||
use App\Utils\Traits\Pdf\PageNumbering;
|
||||
use App\Utils\Traits\Pdf\PdfMaker;
|
||||
use App\Utils\VendorHtmlEngine;
|
||||
|
||||
class PdfService
|
||||
{
|
||||
use PdfMaker, PageNumbering;
|
||||
|
||||
public InvoiceInvitation | QuoteInvitation | CreditInvitation | RecurringInvoiceInvitation | PurchaseOrderInvitation $invitation;
|
||||
|
||||
public Company $company;
|
||||
|
||||
public PdfConfiguration $config;
|
||||
|
||||
public PdfBuilder $builder;
|
||||
|
||||
public PdfDesigner $designer;
|
||||
|
||||
public array $html_variables;
|
||||
|
||||
public string $document_type;
|
||||
|
||||
public array $options;
|
||||
|
||||
const DELIVERY_NOTE = 'delivery_note';
|
||||
const STATEMENT = 'statement';
|
||||
const PURCHASE_ORDER = 'purchase_order';
|
||||
const PRODUCT = 'product';
|
||||
|
||||
public function __construct($invitation, $document_type = 'product', $options = [])
|
||||
{
|
||||
$this->invitation = $invitation;
|
||||
|
||||
$this->company = $invitation->company;
|
||||
|
||||
$this->document_type = $document_type;
|
||||
|
||||
$this->options = $options;
|
||||
}
|
||||
|
||||
/**
|
||||
* Resolves the PDF generation type and
|
||||
* attempts to generate a PDF from the HTML
|
||||
* string.
|
||||
*
|
||||
* @return mixed | Exception
|
||||
*
|
||||
*/
|
||||
public function getPdf()
|
||||
{
|
||||
try {
|
||||
$pdf = $this->resolvePdfEngine($this->getHtml());
|
||||
|
||||
$numbered_pdf = $this->pageNumbering($pdf, $this->company);
|
||||
|
||||
if ($numbered_pdf) {
|
||||
$pdf = $numbered_pdf;
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
nlog(print_r($e->getMessage(), 1));
|
||||
throw new \Exception($e->getMessage(), $e->getCode());
|
||||
}
|
||||
|
||||
return $pdf;
|
||||
}
|
||||
|
||||
/**
|
||||
* Renders the dom document to HTML
|
||||
*
|
||||
* @return string
|
||||
*
|
||||
*/
|
||||
public function getHtml(): string
|
||||
{
|
||||
$html = $this->builder->getCompiledHTML();
|
||||
|
||||
if (config('ninja.log_pdf_html')) {
|
||||
info($html);
|
||||
}
|
||||
|
||||
return $html;
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialize all the services to build the PDF
|
||||
*
|
||||
* @return self
|
||||
*/
|
||||
public function init(): self
|
||||
{
|
||||
$this->config = (new PdfConfiguration($this))->init();
|
||||
|
||||
|
||||
$this->html_variables = $this->config->client ?
|
||||
(new HtmlEngine($this->invitation))->generateLabelsAndValues() :
|
||||
(new VendorHtmlEngine($this->invitation))->generateLabelsAndValues();
|
||||
|
||||
$this->designer = (new PdfDesigner($this))->build();
|
||||
|
||||
$this->builder = (new PdfBuilder($this))->build();
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* resolvePdfEngine
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
public function resolvePdfEngine(string $html): mixed
|
||||
{
|
||||
if (config('ninja.phantomjs_pdf_generation') || config('ninja.pdf_generator') == 'phantom') {
|
||||
$pdf = (new Phantom)->convertHtmlToPdf($html);
|
||||
} elseif (config('ninja.invoiceninja_hosted_pdf_generation') || config('ninja.pdf_generator') == 'hosted_ninja') {
|
||||
$pdf = (new NinjaPdf())->build($html);
|
||||
} else {
|
||||
$pdf = $this->makePdf(null, null, $html);
|
||||
}
|
||||
|
||||
return $pdf;
|
||||
}
|
||||
}
|
@ -121,6 +121,10 @@ class Design extends BaseDesign
|
||||
'id' => 'client-details',
|
||||
'elements' => $this->clientDetails(),
|
||||
],
|
||||
'shipping-details' => [
|
||||
'id' => 'shipping-details',
|
||||
'elements' => $this->shippingDetails(),
|
||||
],
|
||||
'vendor-details' => [
|
||||
'id' => 'vendor-details',
|
||||
'elements' => $this->vendorDetails(),
|
||||
@ -171,10 +175,6 @@ class Design extends BaseDesign
|
||||
$this->sharedFooterElements(),
|
||||
],
|
||||
],
|
||||
// 'swiss-qr' => [
|
||||
// 'id' => 'swiss-qr',
|
||||
// 'elements' => $this->swissQrCodeElement(),
|
||||
// ]
|
||||
];
|
||||
}
|
||||
|
||||
@ -237,6 +237,34 @@ class Design extends BaseDesign
|
||||
return $elements;
|
||||
}
|
||||
|
||||
public function shippingDetails(): array
|
||||
{
|
||||
$elements = [];
|
||||
|
||||
if (!$this->client) {
|
||||
return $elements;
|
||||
}
|
||||
|
||||
$elements = [
|
||||
['element' => 'p', 'content' => ctrans('texts.shipping_address'), 'properties' => ['data-ref' => 'shipping_address-label', 'style' => 'font-weight: bold; text-transform: uppercase']],
|
||||
['element' => 'p', 'content' => $this->client->name, 'show_empty' => false, 'properties' => ['data-ref' => 'shipping_address-client.name']],
|
||||
['element' => 'p', 'content' => $this->client->shipping_address1, 'show_empty' => false, 'properties' => ['data-ref' => 'shipping_address-client.shipping_address1']],
|
||||
['element' => 'p', 'content' => $this->client->shipping_address2, 'show_empty' => false, 'properties' => ['data-ref' => 'shipping_address-client.shipping_address2']],
|
||||
['element' => 'p', 'show_empty' => false, 'elements' => [
|
||||
['element' => 'span', 'content' => "{$this->client->shipping_city} ", 'properties' => ['ref' => 'shipping_address-client.shipping_city']],
|
||||
['element' => 'span', 'content' => "{$this->client->shipping_state} ", 'properties' => ['ref' => 'shipping_address-client.shipping_state']],
|
||||
['element' => 'span', 'content' => "{$this->client->shipping_postal_code} ", 'properties' => ['ref' => 'shipping_address-client.shipping_postal_code']],
|
||||
]],
|
||||
['element' => 'p', 'content' => optional($this->client->shipping_country)->name, 'show_empty' => false],
|
||||
];
|
||||
|
||||
// if (!is_null($this->context['contact'])) {
|
||||
// $elements[] = ['element' => 'p', 'content' => $this->context['contact']->email, 'show_empty' => false, 'properties' => ['data-ref' => 'delivery_note-contact.email']];
|
||||
// }
|
||||
|
||||
return $elements;
|
||||
}
|
||||
|
||||
public function clientDetails(): array
|
||||
{
|
||||
$elements = [];
|
||||
@ -275,6 +303,72 @@ class Design extends BaseDesign
|
||||
return $elements;
|
||||
}
|
||||
|
||||
public function entityDetailsx(): array
|
||||
{
|
||||
if ($this->type === 'statement') {
|
||||
$s_date = $this->translateDate($this->options['start_date'], $this->client->date_format(), $this->client->locale()) . " - " . $this->translateDate($this->options['end_date'], $this->client->date_format(), $this->client->locale());
|
||||
|
||||
return [
|
||||
['element' => 'p', 'content' => "<h2>".ctrans('texts.statement')."</h2>", 'properties' => ['data-ref' => 'statement-label']],
|
||||
['element' => 'p', 'content' => ctrans('texts.statement_date'), 'properties' => ['data-ref' => 'statement-label'],'elements' =>
|
||||
['element' => 'span', 'content' => "{$s_date} "]
|
||||
],
|
||||
['element' => 'p', 'content' => '$balance_due_label', 'properties' => ['data-ref' => 'statement-label'],'elements' =>
|
||||
['element' => 'span', 'content' => Number::formatMoney($this->invoices->sum('balance'), $this->client)]
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
$variables = $this->context['pdf_variables']['invoice_details'];
|
||||
|
||||
if ($this->entity instanceof Quote) {
|
||||
$variables = $this->context['pdf_variables']['quote_details'];
|
||||
|
||||
if ($this->entity->partial > 0) {
|
||||
$variables[] = '$quote.balance_due';
|
||||
}
|
||||
}
|
||||
|
||||
if ($this->entity instanceof Credit) {
|
||||
$variables = $this->context['pdf_variables']['credit_details'];
|
||||
}
|
||||
|
||||
if ($this->vendor) {
|
||||
$variables = $this->context['pdf_variables']['purchase_order_details'];
|
||||
}
|
||||
|
||||
$elements = [];
|
||||
|
||||
// We don't want to show account balance or invoice total on PDF.. or any amount with currency.
|
||||
if ($this->type == self::DELIVERY_NOTE) {
|
||||
$variables = array_filter($variables, function ($m) {
|
||||
return !in_array($m, ['$invoice.balance_due', '$invoice.total']);
|
||||
});
|
||||
}
|
||||
|
||||
foreach ($variables as $variable) {
|
||||
$_variable = explode('.', $variable)[1];
|
||||
$_customs = ['custom1', 'custom2', 'custom3', 'custom4'];
|
||||
|
||||
/* 2/7/2022 don't show custom values if they are empty */
|
||||
$var = str_replace("custom", "custom_value", $_variable);
|
||||
|
||||
if (in_array($_variable, $_customs) && !empty($this->entity->{$var})) {
|
||||
$elements[] = ['element' => 'div', 'properties' => ['style' => "display: table-row; visibility: {$this->entityVariableCheck($_variable)};"],'elements' => [
|
||||
['element' => 'div', 'content' => $variable . '_label', 'properties' => ['class' => 'entity-details-cell', 'data-ref' => 'entity_details-' . substr($variable, 1) . '_label']],
|
||||
['element' => 'div', 'content' => $variable, 'properties' => ['class' => 'entity-details-cell', 'data-ref' => 'entity_details-' . substr($variable, 1)]],
|
||||
]];
|
||||
} else {
|
||||
$elements[] = ['element' => 'div', 'properties' => ['style' => "display: table-row; visibility: {$this->entityVariableCheck($variable)};"], 'elements' => [
|
||||
['element' => 'div', 'content' => $variable . '_label', 'properties' => ['class' => 'entity-details-cell','data-ref' => 'entity_details-' . substr($variable, 1) . '_label']],
|
||||
['element' => 'div', 'content' => $variable, 'properties' => ['class' => 'entity-details-cell','data-ref' => 'entity_details-' . substr($variable, 1)]],
|
||||
]];
|
||||
}
|
||||
}
|
||||
|
||||
return $elements;
|
||||
}
|
||||
|
||||
public function entityDetails(): array
|
||||
{
|
||||
if ($this->type === 'statement') {
|
||||
@ -348,6 +442,7 @@ class Design extends BaseDesign
|
||||
return $elements;
|
||||
}
|
||||
|
||||
|
||||
public function deliveryNoteTable(): array
|
||||
{
|
||||
if ($this->type !== self::DELIVERY_NOTE) {
|
||||
|
@ -246,6 +246,7 @@ trait DesignHelpers
|
||||
]];
|
||||
}
|
||||
|
||||
|
||||
public function entityVariableCheck(string $variable): bool
|
||||
{
|
||||
// Extract $invoice.date => date
|
||||
@ -282,6 +283,43 @@ trait DesignHelpers
|
||||
return false;
|
||||
}
|
||||
|
||||
public function entityVariableCheckx(string $variable): string
|
||||
{
|
||||
// Extract $invoice.date => date
|
||||
// so we can append date as $entity->date and not $entity->$invoice.date;
|
||||
|
||||
// When it comes to invoice balance, we'll always show it.
|
||||
if ($variable == '$invoice.total') {
|
||||
return 'visible';
|
||||
}
|
||||
|
||||
// Some variables don't map 1:1 to table columns. This gives us support for such cases.
|
||||
$aliases = [
|
||||
'$quote.balance_due' => 'partial',
|
||||
];
|
||||
|
||||
try {
|
||||
$_variable = explode('.', $variable)[1];
|
||||
} catch (Exception $e) {
|
||||
nlog("Company settings seems to be broken. Could not resolve {$variable} type.");
|
||||
return 'collapse';
|
||||
}
|
||||
|
||||
if (\in_array($variable, \array_keys($aliases))) {
|
||||
$_variable = $aliases[$variable];
|
||||
}
|
||||
|
||||
if (is_null($this->entity->{$_variable})) {
|
||||
return 'collapse';
|
||||
}
|
||||
|
||||
if (empty($this->entity->{$_variable})) {
|
||||
return 'collapse';
|
||||
}
|
||||
|
||||
return 'visible';
|
||||
}
|
||||
|
||||
public function composeFromPartials(array $partials)
|
||||
{
|
||||
$html = '';
|
||||
|
@ -178,7 +178,7 @@ trait PdfMakerUtilities
|
||||
foreach ($children as $key => &$child) {
|
||||
if (isset($child['content']) && isset($child['show_empty']) && $child['show_empty'] === false) {
|
||||
$value = strtr($child['content'], $variables['values']);
|
||||
if ($value === '' || $value === ' ') {
|
||||
if ($value === '' || $value === ' ' || $value === ' '){
|
||||
$child['is_empty'] = true;
|
||||
}
|
||||
}
|
||||
|
309
app/Services/Preview/StubBuilder.php
Normal file
309
app/Services/Preview/StubBuilder.php
Normal file
@ -0,0 +1,309 @@
|
||||
<?php
|
||||
/**
|
||||
* Invoice Ninja (https://invoiceninja.com).
|
||||
*
|
||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||
*
|
||||
* @copyright Copyright (c) 2023. Invoice Ninja LLC (https://invoiceninja.com)
|
||||
*
|
||||
* @license https://www.elastic.co/licensing/elastic-license
|
||||
*/
|
||||
|
||||
namespace App\Services\Preview;
|
||||
|
||||
use App\Factory\GroupSettingFactory;
|
||||
use App\Jobs\Util\PreviewPdf;
|
||||
use App\Models\Client;
|
||||
use App\Models\ClientContact;
|
||||
use App\Models\Company;
|
||||
use App\Models\Design as DesignModel;
|
||||
use App\Models\Invoice;
|
||||
use App\Models\InvoiceInvitation;
|
||||
use App\Models\User;
|
||||
use App\Models\Vendor;
|
||||
use App\Models\VendorContact;
|
||||
use App\Services\PdfMaker\Design as PdfMakerDesign;
|
||||
use App\Services\PdfMaker\PdfMaker;
|
||||
use App\Utils\HostedPDF\NinjaPdf;
|
||||
use App\Utils\HtmlEngine;
|
||||
use App\Utils\PhantomJS\Phantom;
|
||||
use App\Utils\Traits\MakesHash;
|
||||
use App\Utils\Traits\Pdf\PageNumbering;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
//@deprecated version
|
||||
class StubBuilder
|
||||
{
|
||||
use PageNumbering;
|
||||
use MakesHash;
|
||||
|
||||
public $entity;
|
||||
|
||||
public $entity_type;
|
||||
|
||||
public mixed $recipient;
|
||||
|
||||
public mixed $contact;
|
||||
|
||||
public mixed $invitation;
|
||||
|
||||
public string $recipient_string;
|
||||
|
||||
public string $html;
|
||||
|
||||
public string $dynamic_settings_type;
|
||||
|
||||
public array $settings;
|
||||
|
||||
public function __construct(public Company $company, public User $user)
|
||||
{
|
||||
}
|
||||
|
||||
public function setEntityType($entity_type)
|
||||
{
|
||||
$this->entity_type = $entity_type;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function build(): self
|
||||
{
|
||||
try {
|
||||
DB::connection(config('database.default'))->transaction(function () {
|
||||
$this->createRecipient()
|
||||
->initializeSettings()
|
||||
->createEntity()
|
||||
->linkRelations()
|
||||
->buildHtml();
|
||||
});
|
||||
} catch (\Throwable $throwable) {
|
||||
nlog("DB ERROR " . $throwable->getMessage());
|
||||
|
||||
if (DB::connection(config('database.default'))->transactionLevel() > 0) {
|
||||
DB::connection(config('database.default'))->rollBack();
|
||||
}
|
||||
} catch(\Exception $e) {
|
||||
nlog($e->getMessage());
|
||||
|
||||
if (DB::connection(config('database.default'))->transactionLevel() > 0) {
|
||||
DB::connection(config('database.default'))->rollBack();
|
||||
}
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getPdf(): mixed
|
||||
{
|
||||
if (config('ninja.phantomjs_pdf_generation') || config('ninja.pdf_generator') == 'phantom') {
|
||||
return (new Phantom)->convertHtmlToPdf($this->html);
|
||||
}
|
||||
|
||||
if (config('ninja.invoiceninja_hosted_pdf_generation') || config('ninja.pdf_generator') == 'hosted_ninja') {
|
||||
$pdf = (new NinjaPdf())->build($this->html);
|
||||
|
||||
$numbered_pdf = $this->pageNumbering($pdf, $this->company);
|
||||
|
||||
if ($numbered_pdf) {
|
||||
$pdf = $numbered_pdf;
|
||||
}
|
||||
|
||||
return $pdf;
|
||||
}
|
||||
|
||||
return (new PreviewPdf($this->html, $this->company))->handle();
|
||||
}
|
||||
|
||||
private function initializeSettings(): self
|
||||
{
|
||||
$this->dynamic_settings_type = 'company';
|
||||
|
||||
match ($this->dynamic_settings_type) {
|
||||
'company' => $this->setCompanySettings(),
|
||||
'client' => $this->setClientSettings(),
|
||||
'group' => $this->setGroupSettings(),
|
||||
};
|
||||
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
private function setCompanySettings(): self
|
||||
{
|
||||
$this->company->settings = $this->settings;
|
||||
$this->company->save();
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
private function setClientSettings(): self
|
||||
{
|
||||
$this->recipient->settings = $this->settings;
|
||||
$this->recipient->save();
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
private function setGroupSettings(): self
|
||||
{
|
||||
$g = GroupSettingFactory::create($this->company->id, $this->user->id);
|
||||
$g->name = Str::random(10);
|
||||
$g->settings = $this->settings;
|
||||
$g->save();
|
||||
|
||||
$this->recipient->group_settings_id = $g->id;
|
||||
$this->recipient->save();
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setSettings($settings): self
|
||||
{
|
||||
$this->settings = $settings;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setSettingsType($type): self
|
||||
{
|
||||
$this->dynamic_settings_type = $type;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
private function buildHtml(): self
|
||||
{
|
||||
$html = new HtmlEngine($this->invitation);
|
||||
|
||||
$design_string = "{$this->entity_type}_design_id";
|
||||
|
||||
$design = DesignModel::withTrashed()->find($this->decodePrimaryKey($html->settings->{$design_string}));
|
||||
|
||||
$template = new PdfMakerDesign(strtolower($design->name));
|
||||
|
||||
$state = [
|
||||
'template' => $template->elements([
|
||||
'client' => $this->recipient,
|
||||
'entity' => $this->entity,
|
||||
'pdf_variables' => (array) $html->settings->pdf_variables,
|
||||
'$product' => $design->design->product,
|
||||
]),
|
||||
'variables' => $html->generateLabelsAndValues(),
|
||||
'process_markdown' => $this->company->markdown_enabled,
|
||||
];
|
||||
|
||||
$maker = new PdfMaker($state);
|
||||
|
||||
$this->html = $maker->design($template)
|
||||
->build()
|
||||
->getCompiledHTML();
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
private function linkRelations(): self
|
||||
{
|
||||
$this->entity->setRelation('invitations', $this->invitation);
|
||||
$this->entity->setRelation($this->recipient_string, $this->recipient);
|
||||
$this->entity->setRelation('company', $this->company);
|
||||
$this->entity->load("{$this->recipient_string}.company");
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
private function createRecipient(): self
|
||||
{
|
||||
match ($this->entity_type) {
|
||||
'invoice' => $this->createClient(),
|
||||
'quote' => $this->createClient(),
|
||||
'credit' => $this->createClient(),
|
||||
'purchase_order' => $this->createVendor(),
|
||||
};
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
private function createClient(): self
|
||||
{
|
||||
$this->recipient = Client::factory()->create([
|
||||
'user_id' => $this->user->id,
|
||||
'company_id' => $this->company->id,
|
||||
]);
|
||||
|
||||
$this->contact = ClientContact::factory()->create([
|
||||
'user_id' => $this->user->id,
|
||||
'company_id' => $this->company->id,
|
||||
'client_id' => $this->recipient->id,
|
||||
]);
|
||||
|
||||
$this->recipient_string = 'client';
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
private function createVendor(): self
|
||||
{
|
||||
$this->recipient = Vendor::factory()->create([
|
||||
'user_id' => $this->user->id,
|
||||
'company_id' => $this->user->company()->id,
|
||||
]);
|
||||
|
||||
$this->contact = VendorContact::factory()->create([
|
||||
'user_id' => $this->user->id,
|
||||
'company_id' => $this->company->id,
|
||||
'vendor_id' => $this->recipient->id,
|
||||
]);
|
||||
|
||||
$this->recipient_string = 'vendor';
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
||||
private function createEntity(): self
|
||||
{
|
||||
match ($this->entity_type) {
|
||||
'invoice' => $this->createInvoice(),
|
||||
'quote' => $this->createQuote(),
|
||||
'credit' => $this->createCredit(),
|
||||
'purchase_order' => $this->createPurchaseOrder(),
|
||||
};
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
private function createInvoice()
|
||||
{
|
||||
$this->entity = Invoice::factory()->create([
|
||||
'user_id' => $this->user->id,
|
||||
'company_id' => $this->company->id,
|
||||
'client_id' => $this->recipient->id,
|
||||
'terms' => $this->company->settings->invoice_terms,
|
||||
'footer' => $this->company->settings->invoice_footer,
|
||||
'status_id' => Invoice::STATUS_PAID,
|
||||
]);
|
||||
|
||||
$this->invitation = InvoiceInvitation::factory()->create([
|
||||
'user_id' => $this->user->id,
|
||||
'company_id' => $this->company->id,
|
||||
'invoice_id' => $this->entity->id,
|
||||
'client_contact_id' => $this->contact->id,
|
||||
]);
|
||||
}
|
||||
|
||||
private function createQuote()
|
||||
{
|
||||
$this->entity->save();
|
||||
}
|
||||
|
||||
private function createCredit()
|
||||
{
|
||||
$this->entity->save();
|
||||
}
|
||||
|
||||
private function createPurchaseOrder()
|
||||
{
|
||||
$this->entity->save();
|
||||
}
|
||||
}
|
@ -105,7 +105,7 @@ class Helpers
|
||||
* Process reserved keywords on PDF.
|
||||
*
|
||||
* @param string $value
|
||||
* @param Client|Company $entity
|
||||
* @param Client|Company|Vendor $entity
|
||||
* @param null|Carbon $currentDateTime
|
||||
* @return null|string
|
||||
*/
|
||||
|
@ -116,6 +116,10 @@ class HtmlEngine
|
||||
|
||||
$data['$global_margin'] = ['value' => '6.35mm', 'label' => ''];
|
||||
$data['$company_logo_size'] = ['value' => $this->resolveCompanyLogoSize(), 'label' => ''];
|
||||
$data['$show_shipping_address'] = ['value' => $this->settings?->show_shipping_address ? 'flex' : 'none', 'label' => ''];
|
||||
$data['$show_shipping_address_block'] = ['value' => $this->settings?->show_shipping_address ? 'block' : 'none', 'label' => ''];
|
||||
$data['$show_shipping_address_visibility'] = ['value' => $this->settings?->show_shipping_address ? 'visible' : 'hidden', 'label' => ''];
|
||||
|
||||
$data['$tax'] = ['value' => '', 'label' => ctrans('texts.tax')];
|
||||
$data['$app_url'] = ['value' => $this->generateAppUrl(), 'label' => ''];
|
||||
$data['$from'] = ['value' => '', 'label' => ctrans('texts.from')];
|
||||
@ -124,21 +128,21 @@ class HtmlEngine
|
||||
$data['$total_tax_values'] = ['value' => $this->totalTaxValues(), 'label' => ctrans('texts.taxes')];
|
||||
$data['$line_tax_labels'] = ['value' => $this->lineTaxLabels(), 'label' => ctrans('texts.taxes')];
|
||||
$data['$line_tax_values'] = ['value' => $this->lineTaxValues(), 'label' => ctrans('texts.taxes')];
|
||||
$data['$date'] = ['value' => $this->translateDate($this->entity->date, $this->client->date_format(), $this->client->locale()) ?: ' ', 'label' => ctrans('texts.date')];
|
||||
$data['$date'] = ['value' => $this->translateDate($this->entity->date, $this->client->date_format(), $this->client->locale()) ?: ' ', 'label' => ctrans('texts.date')];
|
||||
$data['$status_logo'] = ['value' => '', 'label' => ''];
|
||||
|
||||
$data['$invoice.date'] = &$data['$date'];
|
||||
$data['$invoiceDate'] = &$data['$date'];
|
||||
$data['$due_date'] = ['value' => $this->translateDate($this->entity->due_date, $this->client->date_format(), $this->client->locale()) ?: ' ', 'label' => ctrans('texts.'.$this->entity_string.'_due_date')];
|
||||
$data['$due_date'] = ['value' => $this->translateDate($this->entity->due_date, $this->client->date_format(), $this->client->locale()) ?: ' ', 'label' => ctrans('texts.'.$this->entity_string.'_due_date')];
|
||||
|
||||
$data['$partial_due_date'] = ['value' => $this->translateDate($this->entity->partial_due_date, $this->client->date_format(), $this->client->locale()) ?: ' ', 'label' => ctrans('texts.'.$this->entity_string.'_due_date')];
|
||||
$data['$partial_due_date'] = ['value' => $this->translateDate($this->entity->partial_due_date, $this->client->date_format(), $this->client->locale()) ?: ' ', 'label' => ctrans('texts.'.$this->entity_string.'_due_date')];
|
||||
|
||||
$data['$dueDate'] = &$data['$due_date'];
|
||||
|
||||
$data['$payment_due'] = ['value' => $this->translateDate($this->entity->due_date, $this->client->date_format(), $this->client->locale()) ?: ' ', 'label' => ctrans('texts.payment_due')];
|
||||
$data['$payment_due'] = ['value' => $this->translateDate($this->entity->due_date, $this->client->date_format(), $this->client->locale()) ?: ' ', 'label' => ctrans('texts.payment_due')];
|
||||
$data['$invoice.due_date'] = &$data['$due_date'];
|
||||
$data['$invoice.number'] = ['value' => $this->entity->number ?: ' ', 'label' => ctrans('texts.invoice_number')];
|
||||
$data['$invoice.po_number'] = ['value' => $this->entity->po_number ?: ' ', 'label' => ctrans('texts.po_number')];
|
||||
$data['$invoice.number'] = ['value' => $this->entity->number ?: ' ', 'label' => ctrans('texts.invoice_number')];
|
||||
$data['$invoice.po_number'] = ['value' => $this->entity->po_number ?: ' ', 'label' => ctrans('texts.po_number')];
|
||||
$data['$poNumber'] = &$data['$invoice.po_number'];
|
||||
$data['$po_number'] = &$data['$invoice.po_number'];
|
||||
$data['$entity.datetime'] = ['value' => $this->formatDatetime($this->entity->created_at, $this->client->date_format(), $this->client->locale()), 'label' => ctrans('texts.date')];
|
||||
@ -148,13 +152,13 @@ class HtmlEngine
|
||||
$data['$payment_button'] = ['value' => $this->buildViewButton($this->invitation->getPaymentLink(), ctrans('texts.pay_now')), 'label' => ctrans('texts.pay_now')];
|
||||
$data['$payment_link'] = ['value' => $this->invitation->getPaymentLink(), 'label' => ctrans('texts.pay_now')];
|
||||
$data['$payment_qrcode'] = ['value' => $this->invitation->getPaymentQrCode(), 'label' => ctrans('texts.pay_now')];
|
||||
$data['$exchange_rate'] = ['value' => $this->entity->exchange_rate ?: ' ', 'label' => ctrans('texts.exchange_rate')];
|
||||
$data['$exchange_rate'] = ['value' => $this->entity->exchange_rate ?: ' ', 'label' => ctrans('texts.exchange_rate')];
|
||||
|
||||
if ($this->entity_string == 'invoice' || $this->entity_string == 'recurring_invoice') {
|
||||
$data['$entity'] = ['value' => '', 'label' => ctrans('texts.invoice')];
|
||||
$data['$number'] = ['value' => $this->entity->number ?: ' ', 'label' => ctrans('texts.invoice_number')];
|
||||
$data['$invoice'] = ['value' => $this->entity->number ?: ' ', 'label' => ctrans('texts.invoice_number')];
|
||||
$data['$number_short'] = ['value' => $this->entity->number ?: ' ', 'label' => ctrans('texts.invoice_number_short')];
|
||||
$data['$number'] = ['value' => $this->entity->number ?: ' ', 'label' => ctrans('texts.invoice_number')];
|
||||
$data['$invoice'] = ['value' => $this->entity->number ?: ' ', 'label' => ctrans('texts.invoice_number')];
|
||||
$data['$number_short'] = ['value' => $this->entity->number ?: ' ', 'label' => ctrans('texts.invoice_number_short')];
|
||||
$data['$entity.terms'] = ['value' => Helpers::processReservedKeywords(\nl2br($this->entity->terms ?: ''), $this->client) ?: '', 'label' => ctrans('texts.invoice_terms')];
|
||||
$data['$terms'] = &$data['$entity.terms'];
|
||||
$data['$view_link'] = ['value' => $this->buildViewButton($this->invitation->getLink(), ctrans('texts.view_invoice')), 'label' => ctrans('texts.view_invoice')];
|
||||
@ -163,12 +167,12 @@ class HtmlEngine
|
||||
$data['$view_button'] = &$data['$view_link'];
|
||||
$data['$paymentButton'] = &$data['$payment_button'];
|
||||
$data['$view_url'] = ['value' => $this->invitation->getLink(), 'label' => ctrans('texts.view_invoice')];
|
||||
$data['$date'] = ['value' => $this->translateDate($this->entity->date, $this->client->date_format(), $this->client->locale()) ?: ' ', 'label' => ctrans('texts.invoice_date')];
|
||||
$data['$date'] = ['value' => $this->translateDate($this->entity->date, $this->client->date_format(), $this->client->locale()) ?: ' ', 'label' => ctrans('texts.invoice_date')];
|
||||
|
||||
$data['$invoice.custom1'] = ['value' => $this->helpers->formatCustomFieldValue($this->company->custom_fields, 'invoice1', $this->entity->custom_value1, $this->client) ?: ' ', 'label' => $this->helpers->makeCustomField($this->company->custom_fields, 'invoice1')];
|
||||
$data['$invoice.custom2'] = ['value' => $this->helpers->formatCustomFieldValue($this->company->custom_fields, 'invoice2', $this->entity->custom_value2, $this->client) ?: ' ', 'label' => $this->helpers->makeCustomField($this->company->custom_fields, 'invoice2')];
|
||||
$data['$invoice.custom3'] = ['value' => $this->helpers->formatCustomFieldValue($this->company->custom_fields, 'invoice3', $this->entity->custom_value3, $this->client) ?: ' ', 'label' => $this->helpers->makeCustomField($this->company->custom_fields, 'invoice3')];
|
||||
$data['$invoice.custom4'] = ['value' => $this->helpers->formatCustomFieldValue($this->company->custom_fields, 'invoice4', $this->entity->custom_value4, $this->client) ?: ' ', 'label' => $this->helpers->makeCustomField($this->company->custom_fields, 'invoice4')];
|
||||
$data['$invoice.custom1'] = ['value' => $this->helpers->formatCustomFieldValue($this->company->custom_fields, 'invoice1', $this->entity->custom_value1, $this->client) ?: ' ', 'label' => $this->helpers->makeCustomField($this->company->custom_fields, 'invoice1')];
|
||||
$data['$invoice.custom2'] = ['value' => $this->helpers->formatCustomFieldValue($this->company->custom_fields, 'invoice2', $this->entity->custom_value2, $this->client) ?: ' ', 'label' => $this->helpers->makeCustomField($this->company->custom_fields, 'invoice2')];
|
||||
$data['$invoice.custom3'] = ['value' => $this->helpers->formatCustomFieldValue($this->company->custom_fields, 'invoice3', $this->entity->custom_value3, $this->client) ?: ' ', 'label' => $this->helpers->makeCustomField($this->company->custom_fields, 'invoice3')];
|
||||
$data['$invoice.custom4'] = ['value' => $this->helpers->formatCustomFieldValue($this->company->custom_fields, 'invoice4', $this->entity->custom_value4, $this->client) ?: ' ', 'label' => $this->helpers->makeCustomField($this->company->custom_fields, 'invoice4')];
|
||||
|
||||
$data['$custom1'] = &$data['$invoice.custom1'];
|
||||
$data['$custom2'] = &$data['$invoice.custom2'];
|
||||
@ -190,10 +194,10 @@ class HtmlEngine
|
||||
$data['$invoice.project'] = &$data['$project.name'];
|
||||
}
|
||||
|
||||
if ($this->entity->status_id == 4) {
|
||||
$data['$status_logo'] = ['value' => '<div class="stamp is-paid"> ' . ctrans('texts.paid') .'</div>', 'label' => ''];
|
||||
}
|
||||
$data['$status_logo'] = ['value' => '<div class="stamp is-paid"> ' . ctrans('texts.paid') .'</div>', 'label' => ''];
|
||||
|
||||
$data['$show_paid_stamp'] = ['value' => $this->entity->status_id == 4 && $this->settings?->show_paid_stamp ? 'flex' : 'none', 'label' => ''];
|
||||
|
||||
if ($this->entity->vendor) {
|
||||
$data['$invoice.vendor'] = ['value' => $this->entity->vendor->present()->name(), 'label' => ctrans('texts.vendor_name')];
|
||||
}
|
||||
@ -219,12 +223,12 @@ class HtmlEngine
|
||||
$data['$view_button'] = &$data['$view_link'];
|
||||
$data['$approveButton'] = ['value' => $this->buildViewButton($this->invitation->getLink(), ctrans('texts.view_quote')), 'label' => ctrans('texts.approve')];
|
||||
$data['$view_url'] = ['value' => $this->invitation->getLink(), 'label' => ctrans('texts.view_quote')];
|
||||
$data['$date'] = ['value' => $this->translateDate($this->entity->date, $this->client->date_format(), $this->client->locale()) ?: ' ', 'label' => ctrans('texts.quote_date')];
|
||||
$data['$date'] = ['value' => $this->translateDate($this->entity->date, $this->client->date_format(), $this->client->locale()) ?: ' ', 'label' => ctrans('texts.quote_date')];
|
||||
|
||||
$data['$quote.custom1'] = ['value' => $this->helpers->formatCustomFieldValue($this->company->custom_fields, 'invoice1', $this->entity->custom_value1, $this->client) ?: ' ', 'label' => $this->helpers->makeCustomField($this->company->custom_fields, 'invoice1')];
|
||||
$data['$quote.custom2'] = ['value' => $this->helpers->formatCustomFieldValue($this->company->custom_fields, 'invoice2', $this->entity->custom_value2, $this->client) ?: ' ', 'label' => $this->helpers->makeCustomField($this->company->custom_fields, 'invoice2')];
|
||||
$data['$quote.custom3'] = ['value' => $this->helpers->formatCustomFieldValue($this->company->custom_fields, 'invoice3', $this->entity->custom_value3, $this->client) ?: ' ', 'label' => $this->helpers->makeCustomField($this->company->custom_fields, 'invoice3')];
|
||||
$data['$quote.custom4'] = ['value' => $this->helpers->formatCustomFieldValue($this->company->custom_fields, 'invoice4', $this->entity->custom_value4, $this->client) ?: ' ', 'label' => $this->helpers->makeCustomField($this->company->custom_fields, 'invoice4')];
|
||||
$data['$quote.custom1'] = ['value' => $this->helpers->formatCustomFieldValue($this->company->custom_fields, 'invoice1', $this->entity->custom_value1, $this->client) ?: ' ', 'label' => $this->helpers->makeCustomField($this->company->custom_fields, 'invoice1')];
|
||||
$data['$quote.custom2'] = ['value' => $this->helpers->formatCustomFieldValue($this->company->custom_fields, 'invoice2', $this->entity->custom_value2, $this->client) ?: ' ', 'label' => $this->helpers->makeCustomField($this->company->custom_fields, 'invoice2')];
|
||||
$data['$quote.custom3'] = ['value' => $this->helpers->formatCustomFieldValue($this->company->custom_fields, 'invoice3', $this->entity->custom_value3, $this->client) ?: ' ', 'label' => $this->helpers->makeCustomField($this->company->custom_fields, 'invoice3')];
|
||||
$data['$quote.custom4'] = ['value' => $this->helpers->formatCustomFieldValue($this->company->custom_fields, 'invoice4', $this->entity->custom_value4, $this->client) ?: ' ', 'label' => $this->helpers->makeCustomField($this->company->custom_fields, 'invoice4')];
|
||||
|
||||
$data['$custom1'] = &$data['$quote.custom1'];
|
||||
$data['$custom2'] = &$data['$quote.custom2'];
|
||||
@ -263,12 +267,12 @@ class HtmlEngine
|
||||
$data['$viewLink'] = &$data['$view_link'];
|
||||
$data['$view_url'] = ['value' => $this->invitation->getLink(), 'label' => ctrans('texts.view_credit')];
|
||||
// $data['$view_link'] = ['value' => $this->invitation->getLink(), 'label' => ctrans('texts.view_credit')];
|
||||
$data['$date'] = ['value' => $this->translateDate($this->entity->date, $this->client->date_format(), $this->client->locale()) ?: ' ', 'label' => ctrans('texts.credit_date')];
|
||||
$data['$date'] = ['value' => $this->translateDate($this->entity->date, $this->client->date_format(), $this->client->locale()) ?: ' ', 'label' => ctrans('texts.credit_date')];
|
||||
|
||||
$data['$credit.custom1'] = ['value' => $this->helpers->formatCustomFieldValue($this->company->custom_fields, 'credit1', $this->entity->custom_value1, $this->client) ?: ' ', 'label' => $this->helpers->makeCustomField($this->company->custom_fields, 'invoice1')];
|
||||
$data['$credit.custom2'] = ['value' => $this->helpers->formatCustomFieldValue($this->company->custom_fields, 'credit2', $this->entity->custom_value2, $this->client) ?: ' ', 'label' => $this->helpers->makeCustomField($this->company->custom_fields, 'invoice2')];
|
||||
$data['$credit.custom3'] = ['value' => $this->helpers->formatCustomFieldValue($this->company->custom_fields, 'credit3', $this->entity->custom_value3, $this->client) ?: ' ', 'label' => $this->helpers->makeCustomField($this->company->custom_fields, 'invoice3')];
|
||||
$data['$credit.custom4'] = ['value' => $this->helpers->formatCustomFieldValue($this->company->custom_fields, 'credit4', $this->entity->custom_value4, $this->client) ?: ' ', 'label' => $this->helpers->makeCustomField($this->company->custom_fields, 'invoice4')];
|
||||
$data['$credit.custom1'] = ['value' => $this->helpers->formatCustomFieldValue($this->company->custom_fields, 'credit1', $this->entity->custom_value1, $this->client) ?: ' ', 'label' => $this->helpers->makeCustomField($this->company->custom_fields, 'invoice1')];
|
||||
$data['$credit.custom2'] = ['value' => $this->helpers->formatCustomFieldValue($this->company->custom_fields, 'credit2', $this->entity->custom_value2, $this->client) ?: ' ', 'label' => $this->helpers->makeCustomField($this->company->custom_fields, 'invoice2')];
|
||||
$data['$credit.custom3'] = ['value' => $this->helpers->formatCustomFieldValue($this->company->custom_fields, 'credit3', $this->entity->custom_value3, $this->client) ?: ' ', 'label' => $this->helpers->makeCustomField($this->company->custom_fields, 'invoice3')];
|
||||
$data['$credit.custom4'] = ['value' => $this->helpers->formatCustomFieldValue($this->company->custom_fields, 'credit4', $this->entity->custom_value4, $this->client) ?: ' ', 'label' => $this->helpers->makeCustomField($this->company->custom_fields, 'invoice4')];
|
||||
|
||||
$data['$custom1'] = &$data['$credit.custom1'];
|
||||
$data['$custom2'] = &$data['$credit.custom2'];
|
||||
@ -289,32 +293,32 @@ class HtmlEngine
|
||||
$data['$portal_url'] = ['value' => $this->invitation->getPortalLink(), 'label' =>''];
|
||||
|
||||
$data['$entity_number'] = &$data['$number'];
|
||||
$data['$invoice.discount'] = ['value' => Number::formatMoney($this->entity_calc->getTotalDiscount(), $this->client) ?: ' ', 'label' => ($this->entity->is_amount_discount) ? ctrans('texts.discount') : ctrans('texts.discount').' '.$this->entity->discount.'%'];
|
||||
$data['$invoice.discount'] = ['value' => Number::formatMoney($this->entity_calc->getTotalDiscount(), $this->client) ?: ' ', 'label' => ($this->entity->is_amount_discount) ? ctrans('texts.discount') : ctrans('texts.discount').' '.$this->entity->discount.'%'];
|
||||
$data['$discount'] = &$data['$invoice.discount'];
|
||||
$data['$subtotal'] = ['value' => Number::formatMoney($this->entity_calc->getSubTotal(), $this->client) ?: ' ', 'label' => ctrans('texts.subtotal')];
|
||||
$data['$gross_subtotal'] = ['value' => Number::formatMoney($this->entity_calc->getGrossSubTotal(), $this->client) ?: ' ', 'label' => ctrans('texts.subtotal')];
|
||||
$data['$subtotal'] = ['value' => Number::formatMoney($this->entity_calc->getSubTotal(), $this->client) ?: ' ', 'label' => ctrans('texts.subtotal')];
|
||||
$data['$gross_subtotal'] = ['value' => Number::formatMoney($this->entity_calc->getGrossSubTotal(), $this->client) ?: ' ', 'label' => ctrans('texts.subtotal')];
|
||||
|
||||
if ($this->entity->uses_inclusive_taxes) {
|
||||
$data['$net_subtotal'] = ['value' => Number::formatMoney(($this->entity_calc->getSubTotal() - $this->entity->total_taxes - $this->entity_calc->getTotalDiscount()), $this->client) ?: ' ', 'label' => ctrans('texts.net_subtotal')];
|
||||
$data['$net_subtotal'] = ['value' => Number::formatMoney(($this->entity_calc->getSubTotal() - $this->entity->total_taxes - $this->entity_calc->getTotalDiscount()), $this->client) ?: ' ', 'label' => ctrans('texts.net_subtotal')];
|
||||
} else {
|
||||
$data['$net_subtotal'] = ['value' => Number::formatMoney($this->entity_calc->getSubTotal() - $this->entity_calc->getTotalDiscount(), $this->client) ?: ' ', 'label' => ctrans('texts.net_subtotal')];
|
||||
$data['$net_subtotal'] = ['value' => Number::formatMoney($this->entity_calc->getSubTotal() - $this->entity_calc->getTotalDiscount(), $this->client) ?: ' ', 'label' => ctrans('texts.net_subtotal')];
|
||||
}
|
||||
|
||||
$data['$invoice.subtotal'] = &$data['$subtotal'];
|
||||
|
||||
/* Do not change the order of these */
|
||||
if ($this->entity->partial > 0) {
|
||||
$data['$balance_due'] = ['value' => Number::formatMoney($this->entity->partial, $this->client) ?: ' ', 'label' => ctrans('texts.partial_due')];
|
||||
$data['$balance_due'] = ['value' => Number::formatMoney($this->entity->partial, $this->client) ?: ' ', 'label' => ctrans('texts.partial_due')];
|
||||
$data['$balance_due_raw'] = ['value' => $this->entity->partial, 'label' => ctrans('texts.partial_due')];
|
||||
$data['$amount_raw'] = ['value' => $this->entity->partial, 'label' => ctrans('texts.partial_due')];
|
||||
$data['$due_date'] = ['value' => $this->translateDate($this->entity->partial_due_date, $this->client->date_format(), $this->client->locale()) ?: ' ', 'label' => ctrans('texts.'.$this->entity_string.'_due_date')];
|
||||
$data['$due_date'] = ['value' => $this->translateDate($this->entity->partial_due_date, $this->client->date_format(), $this->client->locale()) ?: ' ', 'label' => ctrans('texts.'.$this->entity_string.'_due_date')];
|
||||
} else {
|
||||
if ($this->entity->status_id == 1) {
|
||||
$data['$balance_due'] = ['value' => Number::formatMoney($this->entity->amount, $this->client) ?: ' ', 'label' => ctrans('texts.balance_due')];
|
||||
$data['$balance_due'] = ['value' => Number::formatMoney($this->entity->amount, $this->client) ?: ' ', 'label' => ctrans('texts.balance_due')];
|
||||
$data['$balance_due_raw'] = ['value' => $this->entity->amount, 'label' => ctrans('texts.balance_due')];
|
||||
$data['$amount_raw'] = ['value' => $this->entity->amount, 'label' => ctrans('texts.amount')];
|
||||
} else {
|
||||
$data['$balance_due'] = ['value' => Number::formatMoney($this->entity->balance, $this->client) ?: ' ', 'label' => ctrans('texts.balance_due')];
|
||||
$data['$balance_due'] = ['value' => Number::formatMoney($this->entity->balance, $this->client) ?: ' ', 'label' => ctrans('texts.balance_due')];
|
||||
$data['$balance_due_raw'] = ['value' => $this->entity->balance, 'label' => ctrans('texts.balance_due')];
|
||||
$data['$amount_raw'] = ['value' => $this->entity->amount, 'label' => ctrans('texts.amount')];
|
||||
}
|
||||
@ -325,13 +329,13 @@ class HtmlEngine
|
||||
|
||||
|
||||
if ($this->entity_string == 'credit') {
|
||||
$data['$balance_due'] = ['value' => Number::formatMoney($this->entity->balance, $this->client) ?: ' ', 'label' => ctrans('texts.credit_balance')];
|
||||
$data['$balance_due'] = ['value' => Number::formatMoney($this->entity->balance, $this->client) ?: ' ', 'label' => ctrans('texts.credit_balance')];
|
||||
$data['$balance_due_raw'] = ['value' => $this->entity->balance, 'label' => ctrans('texts.credit_balance')];
|
||||
$data['$amount_raw'] = ['value' => $this->entity->amount, 'label' => ctrans('texts.amount')];
|
||||
}
|
||||
|
||||
if ($this->entity_string == 'credit' && $this->entity->status_id == 1) {
|
||||
$data['$balance_due'] = ['value' => Number::formatMoney($this->entity->amount, $this->client) ?: ' ', 'label' => ctrans('texts.credit_balance')];
|
||||
$data['$balance_due'] = ['value' => Number::formatMoney($this->entity->amount, $this->client) ?: ' ', 'label' => ctrans('texts.credit_balance')];
|
||||
$data['$balance_due_raw'] = ['value' => $this->entity->amount, 'label' => ctrans('texts.credit_balance')];
|
||||
$data['$amount_raw'] = ['value' => $this->entity->amount, 'label' => ctrans('texts.amount')];
|
||||
}
|
||||
@ -339,27 +343,27 @@ class HtmlEngine
|
||||
/* Do not change the order of these */
|
||||
|
||||
$data['$outstanding'] = &$data['$balance_due'];
|
||||
$data['$partial_due'] = ['value' => Number::formatMoney($this->entity->partial, $this->client) ?: ' ', 'label' => ctrans('texts.partial_due')];
|
||||
$data['$partial_due'] = ['value' => Number::formatMoney($this->entity->partial, $this->client) ?: ' ', 'label' => ctrans('texts.partial_due')];
|
||||
$data['$partial'] = &$data['$partial_due'];
|
||||
|
||||
$data['$total'] = ['value' => Number::formatMoney($this->entity_calc->getTotal(), $this->client) ?: ' ', 'label' => ctrans('texts.total')];
|
||||
$data['$total'] = ['value' => Number::formatMoney($this->entity_calc->getTotal(), $this->client) ?: ' ', 'label' => ctrans('texts.total')];
|
||||
$data['$amount'] = &$data['$total'];
|
||||
$data['$amount_due'] = ['value' => &$data['$total']['value'], 'label' => ctrans('texts.amount_due')];
|
||||
$data['$quote.total'] = &$data['$total'];
|
||||
$data['$invoice.total'] = ['value' => Number::formatMoney($this->entity_calc->getTotal(), $this->client) ?: ' ', 'label' => ctrans('texts.invoice_total')];
|
||||
$data['$invoice.total'] = ['value' => Number::formatMoney($this->entity_calc->getTotal(), $this->client) ?: ' ', 'label' => ctrans('texts.invoice_total')];
|
||||
$data['$invoice_total_raw'] = ['value' => $this->entity_calc->getTotal(), 'label' => ctrans('texts.invoice_total')];
|
||||
$data['$invoice.amount'] = &$data['$total'];
|
||||
$data['$quote.amount'] = ['value' => Number::formatMoney($this->entity_calc->getTotal(), $this->client) ?: ' ', 'label' => ctrans('texts.quote_total')];
|
||||
$data['$credit.total'] = ['value' => Number::formatMoney($this->entity_calc->getTotal(), $this->client) ?: ' ', 'label' => ctrans('texts.credit_total')];
|
||||
$data['$credit.number'] = ['value' => $this->entity->number ?: ' ', 'label' => ctrans('texts.credit_number')];
|
||||
$data['$quote.amount'] = ['value' => Number::formatMoney($this->entity_calc->getTotal(), $this->client) ?: ' ', 'label' => ctrans('texts.quote_total')];
|
||||
$data['$credit.total'] = ['value' => Number::formatMoney($this->entity_calc->getTotal(), $this->client) ?: ' ', 'label' => ctrans('texts.credit_total')];
|
||||
$data['$credit.number'] = ['value' => $this->entity->number ?: ' ', 'label' => ctrans('texts.credit_number')];
|
||||
$data['$credit.total'] = &$data['$credit.total'];
|
||||
$data['$credit.po_number'] = &$data['$invoice.po_number'];
|
||||
$data['$credit.date'] = ['value' => $this->translateDate($this->entity->date, $this->client->date_format(), $this->client->locale()), 'label' => ctrans('texts.credit_date')];
|
||||
$data['$balance'] = ['value' => Number::formatMoney($this->entity_calc->getBalance(), $this->client) ?: ' ', 'label' => ctrans('texts.balance')];
|
||||
$data['$balance'] = ['value' => Number::formatMoney($this->entity_calc->getBalance(), $this->client) ?: ' ', 'label' => ctrans('texts.balance')];
|
||||
$data['$credit.balance'] = &$data['$balance'];
|
||||
|
||||
$data['$invoice.balance'] = &$data['$balance'];
|
||||
$data['$taxes'] = ['value' => Number::formatMoney($this->entity_calc->getItemTotalTaxes(), $this->client) ?: ' ', 'label' => ctrans('texts.taxes')];
|
||||
$data['$taxes'] = ['value' => Number::formatMoney($this->entity_calc->getItemTotalTaxes(), $this->client) ?: ' ', 'label' => ctrans('texts.taxes')];
|
||||
$data['$invoice.taxes'] = &$data['$taxes'];
|
||||
|
||||
$data['$user.name'] = ['value' => $this->entity->user->present()->name(), 'label' => ctrans('texts.name')];
|
||||
@ -368,7 +372,7 @@ class HtmlEngine
|
||||
$data['$created_by_user'] = &$data['$user.name'];
|
||||
$data['$assigned_to_user'] = ['value' => $this->entity->assigned_user ? $this->entity->assigned_user->present()->name() : '', 'label' => ctrans('texts.name')];
|
||||
|
||||
$data['$user_iban'] = ['value' => $this->helpers->formatCustomFieldValue($this->company->custom_fields, 'company1', $this->settings->custom_value1, $this->client) ?: ' ', 'label' => $this->helpers->makeCustomField($this->company->custom_fields, 'company1')];
|
||||
$data['$user_iban'] = ['value' => $this->helpers->formatCustomFieldValue($this->company->custom_fields, 'company1', $this->settings->custom_value1, $this->client) ?: ' ', 'label' => $this->helpers->makeCustomField($this->company->custom_fields, 'company1')];
|
||||
|
||||
|
||||
$data['$invoice.public_notes'] = ['value' => Helpers::processReservedKeywords(\nl2br($this->entity->public_notes ?: ''), $this->client) ?: '', 'label' => ctrans('texts.public_notes')];
|
||||
@ -379,16 +383,16 @@ class HtmlEngine
|
||||
$data['$entity_issued_to'] = ['value' => '', 'label' => ctrans("texts.{$this->entity_string}_issued_to")];
|
||||
$data['$your_entity'] = ['value' => '', 'label' => ctrans("texts.your_{$this->entity_string}")];
|
||||
|
||||
$data['$quote.date'] = ['value' => $this->translateDate($this->entity->date, $this->client->date_format(), $this->client->locale()) ?: ' ', 'label' => ctrans('texts.quote_date')];
|
||||
$data['$quote.number'] = ['value' => $this->entity->number ?: ' ', 'label' => ctrans('texts.quote_number')];
|
||||
$data['$quote.date'] = ['value' => $this->translateDate($this->entity->date, $this->client->date_format(), $this->client->locale()) ?: ' ', 'label' => ctrans('texts.quote_date')];
|
||||
$data['$quote.number'] = ['value' => $this->entity->number ?: ' ', 'label' => ctrans('texts.quote_number')];
|
||||
$data['$quote.po_number'] = &$data['$invoice.po_number'];
|
||||
$data['$quote.quote_number'] = &$data['$quote.number'];
|
||||
$data['$quote_no'] = &$data['$quote.number'];
|
||||
$data['$quote.quote_no'] = &$data['$quote.number'];
|
||||
$data['$quote.valid_until'] = ['value' => $this->translateDate($this->entity->due_date, $this->client->date_format(), $this->client->locale()), 'label' => ctrans('texts.valid_until')];
|
||||
$data['$valid_until'] = &$data['$quote.valid_until'];
|
||||
$data['$credit_amount'] = ['value' => Number::formatMoney($this->entity_calc->getTotal(), $this->client) ?: ' ', 'label' => ctrans('texts.credit_amount')];
|
||||
$data['$credit_balance'] = ['value' => Number::formatMoney($this->entity->balance, $this->client) ?: ' ', 'label' => ctrans('texts.credit_balance')];
|
||||
$data['$credit_amount'] = ['value' => Number::formatMoney($this->entity_calc->getTotal(), $this->client) ?: ' ', 'label' => ctrans('texts.credit_amount')];
|
||||
$data['$credit_balance'] = ['value' => Number::formatMoney($this->entity->balance, $this->client) ?: ' ', 'label' => ctrans('texts.credit_balance')];
|
||||
|
||||
|
||||
$data['$credit_number'] = &$data['$number'];
|
||||
@ -397,21 +401,21 @@ class HtmlEngine
|
||||
|
||||
$data['$invoice_no'] = &$data['$number'];
|
||||
$data['$invoice.invoice_no'] = &$data['$number'];
|
||||
$data['$client1'] = ['value' => $this->helpers->formatCustomFieldValue($this->company->custom_fields, 'client1', $this->client->custom_value1, $this->client) ?: ' ', 'label' => $this->helpers->makeCustomField($this->company->custom_fields, 'client1')];
|
||||
$data['$client2'] = ['value' => $this->helpers->formatCustomFieldValue($this->company->custom_fields, 'client2', $this->client->custom_value2, $this->client) ?: ' ', 'label' => $this->helpers->makeCustomField($this->company->custom_fields, 'client2')];
|
||||
$data['$client3'] = ['value' => $this->helpers->formatCustomFieldValue($this->company->custom_fields, 'client3', $this->client->custom_value3, $this->client) ?: ' ', 'label' => $this->helpers->makeCustomField($this->company->custom_fields, 'client3')];
|
||||
$data['$client4'] = ['value' => $this->helpers->formatCustomFieldValue($this->company->custom_fields, 'client4', $this->client->custom_value4, $this->client) ?: ' ', 'label' => $this->helpers->makeCustomField($this->company->custom_fields, 'client4')];
|
||||
$data['$client1'] = ['value' => $this->helpers->formatCustomFieldValue($this->company->custom_fields, 'client1', $this->client->custom_value1, $this->client) ?: ' ', 'label' => $this->helpers->makeCustomField($this->company->custom_fields, 'client1')];
|
||||
$data['$client2'] = ['value' => $this->helpers->formatCustomFieldValue($this->company->custom_fields, 'client2', $this->client->custom_value2, $this->client) ?: ' ', 'label' => $this->helpers->makeCustomField($this->company->custom_fields, 'client2')];
|
||||
$data['$client3'] = ['value' => $this->helpers->formatCustomFieldValue($this->company->custom_fields, 'client3', $this->client->custom_value3, $this->client) ?: ' ', 'label' => $this->helpers->makeCustomField($this->company->custom_fields, 'client3')];
|
||||
$data['$client4'] = ['value' => $this->helpers->formatCustomFieldValue($this->company->custom_fields, 'client4', $this->client->custom_value4, $this->client) ?: ' ', 'label' => $this->helpers->makeCustomField($this->company->custom_fields, 'client4')];
|
||||
$data['$client.custom1'] = &$data['$client1'];
|
||||
$data['$client.custom2'] = &$data['$client2'];
|
||||
$data['$client.custom3'] = &$data['$client3'];
|
||||
$data['$client.custom4'] = &$data['$client4'];
|
||||
$data['$address1'] = ['value' => $this->client->address1 ?: ' ', 'label' => ctrans('texts.address1')];
|
||||
$data['$address2'] = ['value' => $this->client->address2 ?: ' ', 'label' => ctrans('texts.address2')];
|
||||
$data['$id_number'] = ['value' => $this->client->id_number ?: ' ', 'label' => ctrans('texts.id_number')];
|
||||
$data['$client.number'] = ['value' => $this->client->number ?: ' ', 'label' => ctrans('texts.number')];
|
||||
$data['$vat_number'] = ['value' => $this->client->vat_number ?: ' ', 'label' => ctrans('texts.vat_number')];
|
||||
$data['$website'] = ['value' => $this->client->present()->website() ?: ' ', 'label' => ctrans('texts.website')];
|
||||
$data['$phone'] = ['value' => $this->client->present()->phone() ?: ' ', 'label' => ctrans('texts.phone')];
|
||||
$data['$address1'] = ['value' => $this->client->address1 ?: ' ', 'label' => ctrans('texts.address1')];
|
||||
$data['$address2'] = ['value' => $this->client->address2 ?: ' ', 'label' => ctrans('texts.address2')];
|
||||
$data['$id_number'] = ['value' => $this->client->id_number ?: ' ', 'label' => ctrans('texts.id_number')];
|
||||
$data['$client.number'] = ['value' => $this->client->number ?: ' ', 'label' => ctrans('texts.number')];
|
||||
$data['$vat_number'] = ['value' => $this->client->vat_number ?: ' ', 'label' => ctrans('texts.vat_number')];
|
||||
$data['$website'] = ['value' => $this->client->present()->website() ?: ' ', 'label' => ctrans('texts.website')];
|
||||
$data['$phone'] = ['value' => $this->client->present()->phone() ?: ' ', 'label' => ctrans('texts.phone')];
|
||||
$data['$country'] = ['value' => isset($this->client->country->name) ? ctrans('texts.country_' . $this->client->country->name) : '', 'label' => ctrans('texts.country')];
|
||||
$data['$country_2'] = ['value' => isset($this->client->country) ? $this->client->country->iso_3166_2 : '', 'label' => ctrans('texts.country')];
|
||||
$data['$email'] = ['value' => isset($this->contact) ? $this->contact->email : 'no contact email on record', 'label' => ctrans('texts.email')];
|
||||
@ -420,27 +424,27 @@ class HtmlEngine
|
||||
$data['$email'] = ['value' => '', 'label' => ctrans('texts.email')];
|
||||
}
|
||||
|
||||
$data['$client_name'] = ['value' => $this->entity->present()->clientName() ?: ' ', 'label' => ctrans('texts.client_name')];
|
||||
$data['$client_name'] = ['value' => $this->entity->present()->clientName() ?: ' ', 'label' => ctrans('texts.client_name')];
|
||||
$data['$client.name'] = &$data['$client_name'];
|
||||
$data['$client'] = &$data['$client_name'];
|
||||
|
||||
$data['$client.address1'] = &$data['$address1'];
|
||||
$data['$client.address2'] = &$data['$address2'];
|
||||
$data['$client_address'] = ['value' => $this->client->present()->address() ?: ' ', 'label' => ctrans('texts.address')];
|
||||
$data['$client_address'] = ['value' => $this->client->present()->address() ?: ' ', 'label' => ctrans('texts.address')];
|
||||
$data['$client.address'] = &$data['$client_address'];
|
||||
$data['$client.postal_code'] = ['value' => $this->client->postal_code ?: ' ', 'label' => ctrans('texts.postal_code')];
|
||||
$data['$client.public_notes'] = ['value' => $this->client->public_notes ?: ' ', 'label' => ctrans('texts.notes')];
|
||||
$data['$client.city'] = ['value' => $this->client->city ?: ' ', 'label' => ctrans('texts.city')];
|
||||
$data['$client.state'] = ['value' => $this->client->state ?: ' ', 'label' => ctrans('texts.state')];
|
||||
$data['$client.postal_code'] = ['value' => $this->client->postal_code ?: ' ', 'label' => ctrans('texts.postal_code')];
|
||||
$data['$client.public_notes'] = ['value' => $this->client->public_notes ?: ' ', 'label' => ctrans('texts.notes')];
|
||||
$data['$client.city'] = ['value' => $this->client->city ?: ' ', 'label' => ctrans('texts.city')];
|
||||
$data['$client.state'] = ['value' => $this->client->state ?: ' ', 'label' => ctrans('texts.state')];
|
||||
$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' => $this->entity->present()->cityStateZip($this->client->city, $this->client->state, $this->client->postal_code, false) ?: ' ', 'label' => ctrans('texts.city_state_postal')];
|
||||
$data['$city_state_postal'] = ['value' => $this->entity->present()->cityStateZip($this->client->city, $this->client->state, $this->client->postal_code, false) ?: ' ', 'label' => ctrans('texts.city_state_postal')];
|
||||
$data['$client.city_state_postal'] = &$data['$city_state_postal'];
|
||||
$data['$postal_city_state'] = ['value' => $this->entity->present()->cityStateZip($this->client->city, $this->client->state, $this->client->postal_code, true) ?: ' ', 'label' => ctrans('texts.postal_city_state')];
|
||||
$data['$postal_city_state'] = ['value' => $this->entity->present()->cityStateZip($this->client->city, $this->client->state, $this->client->postal_code, true) ?: ' ', 'label' => ctrans('texts.postal_city_state')];
|
||||
$data['$client.postal_city_state'] = &$data['$postal_city_state'];
|
||||
$data['$postal_city'] = ['value' => $this->entity->present()->cityStateZip($this->client->city, null, $this->client->postal_code, true) ?: ' ', 'label' => ctrans('texts.postal_city')];
|
||||
$data['$postal_city'] = ['value' => $this->entity->present()->cityStateZip($this->client->city, null, $this->client->postal_code, true) ?: ' ', 'label' => ctrans('texts.postal_city')];
|
||||
$data['$client.postal_city'] = &$data['$postal_city'];
|
||||
$data['$client.country'] = &$data['$country'];
|
||||
$data['$client.email'] = &$data['$email'];
|
||||
@ -453,12 +457,12 @@ class HtmlEngine
|
||||
$data['$client.billing_postal_code'] = &$data['$client.postal_code'];
|
||||
$data['$client.billing_country'] = &$data['$client.country'];
|
||||
|
||||
$data['$client.shipping_address'] = ['value' => $this->client->present()->shipping_address() ?: ' ', 'label' => ctrans('texts.shipping_address')];
|
||||
$data['$client.shipping_address1'] = ['value' => $this->client->shipping_address1 ?: ' ', 'label' => ctrans('texts.shipping_address1')];
|
||||
$data['$client.shipping_address2'] = ['value' => $this->client->shipping_address2 ?: ' ', 'label' => ctrans('texts.shipping_address2')];
|
||||
$data['$client.shipping_city'] = ['value' => $this->client->shipping_city ?: ' ', 'label' => ctrans('texts.shipping_city')];
|
||||
$data['$client.shipping_state'] = ['value' => $this->client->shipping_state ?: ' ', 'label' => ctrans('texts.shipping_state')];
|
||||
$data['$client.shipping_postal_code'] = ['value' => $this->client->shipping_postal_code ?: ' ', 'label' => ctrans('texts.shipping_postal_code')];
|
||||
$data['$client.shipping_address'] = ['value' => $this->client->present()->shipping_address() ?: ' ', 'label' => ctrans('texts.shipping_address')];
|
||||
$data['$client.shipping_address1'] = ['value' => $this->client->shipping_address1 ?: ' ', 'label' => ctrans('texts.shipping_address1')];
|
||||
$data['$client.shipping_address2'] = ['value' => $this->client->shipping_address2 ?: ' ', 'label' => ctrans('texts.shipping_address2')];
|
||||
$data['$client.shipping_city'] = ['value' => $this->client->shipping_city ?: ' ', 'label' => ctrans('texts.shipping_city')];
|
||||
$data['$client.shipping_state'] = ['value' => $this->client->shipping_state ?: ' ', 'label' => ctrans('texts.shipping_state')];
|
||||
$data['$client.shipping_postal_code'] = ['value' => $this->client->shipping_postal_code ?: ' ', 'label' => ctrans('texts.shipping_postal_code')];
|
||||
$data['$client.shipping_country'] = ['value' => isset($this->client->shipping_country->name) ? ctrans('texts.country_' . $this->client->shipping_country->name) : '', 'label' => ctrans('texts.shipping_country')];
|
||||
|
||||
$data['$client.currency'] = ['value' => $this->client->currency()->code, 'label' => ''];
|
||||
@ -485,54 +489,54 @@ class HtmlEngine
|
||||
$data['$contact.portal_button'] = &$data['$portal_button'];
|
||||
$data['$portalButton'] = &$data['$portal_button'];
|
||||
|
||||
$data['$contact.custom1'] = ['value' => isset($this->contact) ? $this->contact->custom_value1 : ' ', 'label' => $this->helpers->makeCustomField($this->company->custom_fields, 'contact1')];
|
||||
$data['$contact.custom2'] = ['value' => isset($this->contact) ? $this->contact->custom_value2 : ' ', 'label' => $this->helpers->makeCustomField($this->company->custom_fields, 'contact2')];
|
||||
$data['$contact.custom3'] = ['value' => isset($this->contact) ? $this->contact->custom_value3 : ' ', 'label' => $this->helpers->makeCustomField($this->company->custom_fields, 'contact3')];
|
||||
$data['$contact.custom4'] = ['value' => isset($this->contact) ? $this->contact->custom_value4 : ' ', 'label' => $this->helpers->makeCustomField($this->company->custom_fields, 'contact4')];
|
||||
$data['$contact.custom1'] = ['value' => isset($this->contact) ? $this->contact->custom_value1 : ' ', 'label' => $this->helpers->makeCustomField($this->company->custom_fields, 'contact1')];
|
||||
$data['$contact.custom2'] = ['value' => isset($this->contact) ? $this->contact->custom_value2 : ' ', 'label' => $this->helpers->makeCustomField($this->company->custom_fields, 'contact2')];
|
||||
$data['$contact.custom3'] = ['value' => isset($this->contact) ? $this->contact->custom_value3 : ' ', 'label' => $this->helpers->makeCustomField($this->company->custom_fields, 'contact3')];
|
||||
$data['$contact.custom4'] = ['value' => isset($this->contact) ? $this->contact->custom_value4 : ' ', 'label' => $this->helpers->makeCustomField($this->company->custom_fields, 'contact4')];
|
||||
|
||||
$data['$company.city_state_postal'] = ['value' => $this->company->present()->cityStateZip($this->settings->city, $this->settings->state, $this->settings->postal_code, false) ?: ' ', 'label' => ctrans('texts.city_state_postal')];
|
||||
$data['$company.postal_city_state'] = ['value' => $this->company->present()->cityStateZip($this->settings->city, $this->settings->state, $this->settings->postal_code, true) ?: ' ', 'label' => ctrans('texts.postal_city_state')];
|
||||
$data['$company.postal_city'] = ['value' => $this->company->present()->cityStateZip($this->settings->city, null, $this->settings->postal_code, true) ?: ' ', 'label' => ctrans('texts.postal_city')];
|
||||
$data['$company.city_state_postal'] = ['value' => $this->company->present()->cityStateZip($this->settings->city, $this->settings->state, $this->settings->postal_code, false) ?: ' ', 'label' => ctrans('texts.city_state_postal')];
|
||||
$data['$company.postal_city_state'] = ['value' => $this->company->present()->cityStateZip($this->settings->city, $this->settings->state, $this->settings->postal_code, true) ?: ' ', 'label' => ctrans('texts.postal_city_state')];
|
||||
$data['$company.postal_city'] = ['value' => $this->company->present()->cityStateZip($this->settings->city, null, $this->settings->postal_code, true) ?: ' ', 'label' => ctrans('texts.postal_city')];
|
||||
$data['$company.name'] = ['value' => $this->settings->name ?: ctrans('texts.untitled_account'), 'label' => ctrans('texts.company_name')];
|
||||
$data['$account'] = &$data['$company.name'];
|
||||
|
||||
$data['$company.address1'] = ['value' => $this->settings->address1 ?: ' ', 'label' => ctrans('texts.address1')];
|
||||
$data['$company.address2'] = ['value' => $this->settings->address2 ?: ' ', 'label' => ctrans('texts.address2')];
|
||||
$data['$company.city'] = ['value' => $this->settings->city ?: ' ', 'label' => ctrans('texts.city')];
|
||||
$data['$company.state'] = ['value' => $this->settings->state ?: ' ', 'label' => ctrans('texts.state')];
|
||||
$data['$company.postal_code'] = ['value' => $this->settings->postal_code ?: ' ', 'label' => ctrans('texts.postal_code')];
|
||||
$data['$company.address1'] = ['value' => $this->settings->address1 ?: ' ', 'label' => ctrans('texts.address1')];
|
||||
$data['$company.address2'] = ['value' => $this->settings->address2 ?: ' ', 'label' => ctrans('texts.address2')];
|
||||
$data['$company.city'] = ['value' => $this->settings->city ?: ' ', 'label' => ctrans('texts.city')];
|
||||
$data['$company.state'] = ['value' => $this->settings->state ?: ' ', 'label' => ctrans('texts.state')];
|
||||
$data['$company.postal_code'] = ['value' => $this->settings->postal_code ?: ' ', 'label' => ctrans('texts.postal_code')];
|
||||
$data['$company.country'] = ['value' => $this->getCountryName(), 'label' => ctrans('texts.country')];
|
||||
$data['$company.country_2'] = ['value' => $this->getCountryCode(), 'label' => ctrans('texts.country')];
|
||||
$data['$company.phone'] = ['value' => $this->settings->phone ?: ' ', 'label' => ctrans('texts.phone')];
|
||||
$data['$company.email'] = ['value' => $this->settings->email ?: ' ', 'label' => ctrans('texts.email')];
|
||||
$data['$company.vat_number'] = ['value' => $this->settings->vat_number ?: ' ', 'label' => ctrans('texts.vat_number')];
|
||||
$data['$company.id_number'] = ['value' => $this->settings->id_number ?: ' ', 'label' => ctrans('texts.id_number')];
|
||||
$data['$company.website'] = ['value' => $this->settings->website ?: ' ', 'label' => ctrans('texts.website')];
|
||||
$data['$company.address'] = ['value' => $this->company->present()->address($this->settings) ?: ' ', 'label' => ctrans('texts.address')];
|
||||
$data['$company.phone'] = ['value' => $this->settings->phone ?: ' ', 'label' => ctrans('texts.phone')];
|
||||
$data['$company.email'] = ['value' => $this->settings->email ?: ' ', 'label' => ctrans('texts.email')];
|
||||
$data['$company.vat_number'] = ['value' => $this->settings->vat_number ?: ' ', 'label' => ctrans('texts.vat_number')];
|
||||
$data['$company.id_number'] = ['value' => $this->settings->id_number ?: ' ', 'label' => ctrans('texts.id_number')];
|
||||
$data['$company.website'] = ['value' => $this->settings->website ?: ' ', 'label' => ctrans('texts.website')];
|
||||
$data['$company.address'] = ['value' => $this->company->present()->address($this->settings) ?: ' ', 'label' => ctrans('texts.address')];
|
||||
|
||||
$data['$signature'] = ['value' => $this->settings->email_signature ?: ' ', 'label' => ''];
|
||||
$data['$signature'] = ['value' => $this->settings->email_signature ?: ' ', 'label' => ''];
|
||||
$data['$emailSignature'] = &$data['$signature'];
|
||||
|
||||
$data['$spc_qr_code'] = ['value' => $this->company->present()->getSpcQrCode($this->client->currency()->code, $this->entity->number, $this->entity->balance, $this->helpers->formatCustomFieldValue($this->company->custom_fields, 'company1', $this->settings->custom_value1, $this->client)), 'label' => ''];
|
||||
|
||||
$logo = $this->company->present()->logo_base64($this->settings);
|
||||
|
||||
$data['$company.logo'] = ['value' => $logo ?: ' ', 'label' => ctrans('texts.logo')];
|
||||
$data['$company.logo'] = ['value' => $logo ?: ' ', 'label' => ctrans('texts.logo')];
|
||||
$data['$company_logo'] = &$data['$company.logo'];
|
||||
$data['$company1'] = ['value' => $this->helpers->formatCustomFieldValue($this->company->custom_fields, 'company1', $this->settings->custom_value1, $this->client) ?: ' ', 'label' => $this->helpers->makeCustomField($this->company->custom_fields, 'company1')];
|
||||
$data['$company2'] = ['value' => $this->helpers->formatCustomFieldValue($this->company->custom_fields, 'company2', $this->settings->custom_value2, $this->client) ?: ' ', 'label' => $this->helpers->makeCustomField($this->company->custom_fields, 'company2')];
|
||||
$data['$company3'] = ['value' => $this->helpers->formatCustomFieldValue($this->company->custom_fields, 'company3', $this->settings->custom_value3, $this->client) ?: ' ', 'label' => $this->helpers->makeCustomField($this->company->custom_fields, 'company3')];
|
||||
$data['$company4'] = ['value' => $this->helpers->formatCustomFieldValue($this->company->custom_fields, 'company4', $this->settings->custom_value4, $this->client) ?: ' ', 'label' => $this->helpers->makeCustomField($this->company->custom_fields, 'company4')];
|
||||
$data['$company1'] = ['value' => $this->helpers->formatCustomFieldValue($this->company->custom_fields, 'company1', $this->settings->custom_value1, $this->client) ?: ' ', 'label' => $this->helpers->makeCustomField($this->company->custom_fields, 'company1')];
|
||||
$data['$company2'] = ['value' => $this->helpers->formatCustomFieldValue($this->company->custom_fields, 'company2', $this->settings->custom_value2, $this->client) ?: ' ', 'label' => $this->helpers->makeCustomField($this->company->custom_fields, 'company2')];
|
||||
$data['$company3'] = ['value' => $this->helpers->formatCustomFieldValue($this->company->custom_fields, 'company3', $this->settings->custom_value3, $this->client) ?: ' ', 'label' => $this->helpers->makeCustomField($this->company->custom_fields, 'company3')];
|
||||
$data['$company4'] = ['value' => $this->helpers->formatCustomFieldValue($this->company->custom_fields, 'company4', $this->settings->custom_value4, $this->client) ?: ' ', 'label' => $this->helpers->makeCustomField($this->company->custom_fields, 'company4')];
|
||||
|
||||
$data['$company.custom1'] = &$data['$company1'];
|
||||
$data['$company.custom2'] = &$data['$company2'];
|
||||
$data['$company.custom3'] = &$data['$company3'];
|
||||
$data['$company.custom4'] = &$data['$company4'];
|
||||
|
||||
$data['$custom_surcharge1'] = ['value' => Number::formatMoney($this->entity->custom_surcharge1, $this->client) ?: ' ', 'label' => $this->helpers->makeCustomField($this->company->custom_fields, 'surcharge1')];
|
||||
$data['$custom_surcharge2'] = ['value' => Number::formatMoney($this->entity->custom_surcharge2, $this->client) ?: ' ', 'label' => $this->helpers->makeCustomField($this->company->custom_fields, 'surcharge2')];
|
||||
$data['$custom_surcharge3'] = ['value' => Number::formatMoney($this->entity->custom_surcharge3, $this->client) ?: ' ', 'label' => $this->helpers->makeCustomField($this->company->custom_fields, 'surcharge3')];
|
||||
$data['$custom_surcharge4'] = ['value' => Number::formatMoney($this->entity->custom_surcharge4, $this->client) ?: ' ', 'label' => $this->helpers->makeCustomField($this->company->custom_fields, 'surcharge4')];
|
||||
$data['$custom_surcharge1'] = ['value' => Number::formatMoney($this->entity->custom_surcharge1, $this->client) ?: ' ', 'label' => $this->helpers->makeCustomField($this->company->custom_fields, 'surcharge1')];
|
||||
$data['$custom_surcharge2'] = ['value' => Number::formatMoney($this->entity->custom_surcharge2, $this->client) ?: ' ', 'label' => $this->helpers->makeCustomField($this->company->custom_fields, 'surcharge2')];
|
||||
$data['$custom_surcharge3'] = ['value' => Number::formatMoney($this->entity->custom_surcharge3, $this->client) ?: ' ', 'label' => $this->helpers->makeCustomField($this->company->custom_fields, 'surcharge3')];
|
||||
$data['$custom_surcharge4'] = ['value' => Number::formatMoney($this->entity->custom_surcharge4, $this->client) ?: ' ', 'label' => $this->helpers->makeCustomField($this->company->custom_fields, 'surcharge4')];
|
||||
|
||||
$data['$product.item'] = ['value' => '', 'label' => ctrans('texts.item')];
|
||||
$data['$product.date'] = ['value' => '', 'label' => ctrans('texts.date')];
|
||||
@ -584,13 +588,15 @@ class HtmlEngine
|
||||
$data['$thanks'] = ['value' => '', 'label' => ctrans('texts.thanks')];
|
||||
$data['$from'] = ['value' => '', 'label' => ctrans('texts.from')];
|
||||
$data['$to'] = ['value' => '', 'label' => ctrans('texts.to')];
|
||||
$data['$shipping'] = ['value' => '', 'label' => ctrans('texts.ship_to')];
|
||||
|
||||
$data['$details'] = ['value' => '', 'label' => ctrans('texts.details')];
|
||||
|
||||
$data['_rate1'] = ['value' => '', 'label' => ctrans('texts.tax')];
|
||||
$data['_rate2'] = ['value' => '', 'label' => ctrans('texts.tax')];
|
||||
$data['_rate3'] = ['value' => '', 'label' => ctrans('texts.tax')];
|
||||
|
||||
$data['$font_size'] = ['value' => $this->settings->font_size . 'px', 'label' => ''];
|
||||
$data['$font_size'] = ['value' => $this->settings->font_size . 'px !important;', 'label' => ''];
|
||||
$data['$font_name'] = ['value' => Helpers::resolveFont($this->settings->primary_font)['name'], 'label' => ''];
|
||||
$data['$font_url'] = ['value' => Helpers::resolveFont($this->settings->primary_font)['url'], 'label' => ''];
|
||||
|
||||
@ -623,8 +629,8 @@ class HtmlEngine
|
||||
$data['$dir'] = ['value' => in_array(optional($this->client->language())->locale, ['ar', 'he']) ? 'rtl' : 'ltr', 'label' => ''];
|
||||
$data['$dir_text_align'] = ['value' => in_array(optional($this->client->language())->locale, ['ar', 'he']) ? 'right' : 'left', 'label' => ''];
|
||||
|
||||
$data['$payment.date'] = ['value' => ' ', 'label' => ctrans('texts.payment_date')];
|
||||
$data['$method'] = ['value' => ' ', 'label' => ctrans('texts.method')];
|
||||
$data['$payment.date'] = ['value' => ' ', 'label' => ctrans('texts.payment_date')];
|
||||
$data['$method'] = ['value' => ' ', 'label' => ctrans('texts.method')];
|
||||
|
||||
$data['$statement_amount'] = ['value' => '', 'label' => ctrans('texts.amount')];
|
||||
$data['$statement'] = ['value' => '', 'label' => ctrans('texts.statement')];
|
||||
@ -745,7 +751,7 @@ class HtmlEngine
|
||||
return ctrans('texts.country_' . $country->name);
|
||||
}
|
||||
|
||||
return ' ';
|
||||
return ' ';
|
||||
}
|
||||
|
||||
|
||||
@ -760,7 +766,7 @@ class HtmlEngine
|
||||
// return ctrans('texts.country_' . $country->iso_3166_2);
|
||||
// }
|
||||
|
||||
return ' ';
|
||||
return ' ';
|
||||
}
|
||||
/**
|
||||
* Due to the way we are compiling the blade template we
|
||||
|
@ -32,6 +32,7 @@ class SystemHealth
|
||||
'mbstring',
|
||||
'xml',
|
||||
'bcmath',
|
||||
'iconv',
|
||||
];
|
||||
|
||||
private static $php_version = 8.1;
|
||||
|
@ -14,8 +14,8 @@ return [
|
||||
'require_https' => env('REQUIRE_HTTPS', true),
|
||||
'app_url' => rtrim(env('APP_URL', ''), '/'),
|
||||
'app_domain' => env('APP_DOMAIN', 'invoicing.co'),
|
||||
'app_version' => '5.5.74',
|
||||
'app_tag' => '5.5.74',
|
||||
'app_version' => '5.5.75',
|
||||
'app_tag' => '5.5.75',
|
||||
'minimum_client_version' => '5.0.16',
|
||||
'terms_version' => '1.0.1',
|
||||
'api_secret' => env('API_SECRET', ''),
|
||||
|
@ -30,11 +30,11 @@ class ClientFactory extends Factory
|
||||
'balance' => 0,
|
||||
'paid_to_date' => 0,
|
||||
'vat_number' => $this->faker->numberBetween(123456789, 987654321),
|
||||
'id_number' => '',
|
||||
'custom_value1' => '',
|
||||
'custom_value2' => '',
|
||||
'custom_value3' => '',
|
||||
'custom_value4' => '',
|
||||
'id_number' => $this->faker->iban(),
|
||||
'custom_value1' => $this->faker->dateTime(),
|
||||
'custom_value2' => $this->faker->colorName(),
|
||||
'custom_value3' => $this->faker->word(),
|
||||
'custom_value4' => $this->faker->email(),
|
||||
'address1' => $this->faker->buildingNumber(),
|
||||
'address2' => $this->faker->streetAddress(),
|
||||
'city' => $this->faker->city(),
|
||||
|
@ -35,10 +35,10 @@ class InvoiceFactory extends Factory
|
||||
'tax_rate2' => 17.5,
|
||||
//'tax_name3' => 'THIRDTAX',
|
||||
//'tax_rate3' => 5,
|
||||
// 'custom_value1' => $this->faker->date(),
|
||||
//'custom_value2' => rand(0, 1) ? 'yes' : 'no',
|
||||
// 'custom_value3' => $this->faker->numberBetween(1,4),
|
||||
// 'custom_value4' => $this->faker->numberBetween(1,4),
|
||||
'custom_value1' => $this->faker->date(),
|
||||
'custom_value2' => rand(0, 1) ? 'yes' : 'no',
|
||||
'custom_value3' => $this->faker->numberBetween(1,4),
|
||||
'custom_value4' => $this->faker->numberBetween(1,4),
|
||||
'is_deleted' => false,
|
||||
'po_number' => $this->faker->text(10),
|
||||
'date' => $this->faker->date(),
|
||||
|
@ -26,7 +26,12 @@ class VendorContactFactory extends Factory
|
||||
'first_name' => $this->faker->firstName(),
|
||||
'last_name' => $this->faker->lastName(),
|
||||
'phone' => $this->faker->phoneNumber(),
|
||||
'email_verified_at' => now(),
|
||||
'email' => $this->faker->unique()->safeEmail(),
|
||||
'send_email' => true,
|
||||
'password' => bcrypt('password'),
|
||||
'remember_token' => \Illuminate\Support\Str::random(10),
|
||||
'contact_key' => \Illuminate\Support\Str::random(32),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
@ -2189,7 +2189,6 @@ $LANG = array(
|
||||
'logo_warning_too_large' => 'The image file is too large.',
|
||||
'logo_warning_fileinfo' => 'Warning: To support gifs the fileinfo PHP extension needs to be enabled.',
|
||||
'logo_warning_invalid' => 'There was a problem reading the image file, please try a different format.',
|
||||
|
||||
'error_refresh_page' => 'An error occurred, please refresh the page and try again.',
|
||||
'data' => 'Data',
|
||||
'imported_settings' => 'Successfully imported settings',
|
||||
@ -5002,6 +5001,13 @@ $LANG = array(
|
||||
'gateway_payment_text_no_invoice' => 'Payment with no invoice for amount :amount for client :client',
|
||||
'click_to_variables' => 'Client here to see all variables.',
|
||||
'ship_to' => 'Ship to',
|
||||
'stripe_direct_debit_details' => 'Please transfer into the nominated bank account above.',
|
||||
'branch_name' => 'Branch Name',
|
||||
'branch_code' => 'Branch Code',
|
||||
'bank_name' => 'Bank Name',
|
||||
'bank_code' => 'Bank Code',
|
||||
'bic' => 'BIC',
|
||||
|
||||
);
|
||||
|
||||
|
||||
|
@ -4,7 +4,7 @@
|
||||
:root {
|
||||
--primary-color: $primary_color;
|
||||
--secondary-color: $secondary_color;
|
||||
--line-height: 1.6;
|
||||
--line-height: 1.4;
|
||||
}
|
||||
|
||||
body {
|
||||
@ -58,13 +58,13 @@
|
||||
|
||||
#header, #header-spacer {
|
||||
height: 160px;
|
||||
padding: 3rem;
|
||||
padding: 2rem;
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
.company-logo {
|
||||
height: 100%;
|
||||
max-width: 100%;
|
||||
/* max-width: $company_logo_size;*/
|
||||
/* height: 100%;*/
|
||||
/* max-width: 100%;*/
|
||||
max-width: $company_logo_size;
|
||||
object-fit: contain;
|
||||
object-position: left center;
|
||||
}
|
||||
@ -82,10 +82,17 @@
|
||||
}
|
||||
|
||||
#client-details {
|
||||
margin: 2rem;
|
||||
padding-right:1rem;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
line-height: var(--line-height);
|
||||
line-height: var(--line-height) !important;
|
||||
padding-left: 2rem;
|
||||
}
|
||||
|
||||
#shipping-details {
|
||||
display: $show_shipping_address;
|
||||
flex-direction: column;
|
||||
line-height: var(--line-height) !important;
|
||||
}
|
||||
|
||||
#client-details > :first-child {
|
||||
@ -94,9 +101,13 @@
|
||||
|
||||
.client-entity-wrapper {
|
||||
display: grid;
|
||||
grid-template-columns: 1.5fr 1fr;
|
||||
grid-template-columns: 2fr 1fr;
|
||||
padding-left: 1rem;
|
||||
}
|
||||
|
||||
.client-wrapper-left-side {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.entity-details-wrapper {
|
||||
background-color: var(--primary-color);
|
||||
@ -112,7 +123,7 @@
|
||||
#entity-details > tr,
|
||||
#entity-details th {
|
||||
font-weight: normal;
|
||||
padding-bottom: 0.5rem;
|
||||
line-height: var(--line-height) !important;
|
||||
}
|
||||
|
||||
[data-ref="table"] {
|
||||
@ -325,6 +336,7 @@
|
||||
opacity: 0.2;
|
||||
z-index:200 !important;
|
||||
position: fixed;
|
||||
display: $show_paid_stamp;
|
||||
}
|
||||
|
||||
.project-header {
|
||||
@ -393,14 +405,21 @@
|
||||
<td>
|
||||
<div class="client-entity-wrapper">
|
||||
<div class="client-wrapper-left-side">
|
||||
<h4 class="entity-label">$entity_label</h4>
|
||||
<div id="client-details" cellspacing="0"></div>
|
||||
<div id="vendor-details" cellspacing="0"></div>
|
||||
<div>
|
||||
<h4 class="entity-label" style="margin-top:0px; margin-bottom:10px;">$entity_label</h4>
|
||||
<div id="client-details" cellspacing="0" cellpadding="0" ></div>
|
||||
<div id="vendor-details" cellspacing="0" cellpadding="0"></div>
|
||||
</div>
|
||||
<div>
|
||||
<h4 class="entity-label" style="opacity: 0; margin-top:0px; margin-bottom:10px;">&</h4>
|
||||
<div id="shipping-details" cellspacing="0" cellpadding="0"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="entity-details-wrapper-right-side">
|
||||
<h4 class="entity-label" style="margin-top:0px; margin-bottom:10px; color:transparent;">$entity_label</h4>
|
||||
<div class="entity-details-wrapper">
|
||||
<table id="entity-details" dir="$dir"></table>
|
||||
<table id="entity-details" dir="$dir" cellspacing="0" cellpadding="0"></table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -419,7 +438,7 @@
|
||||
|
||||
<table id="statement-aging-table" cellspacing="0" data-ref="table"></table>
|
||||
<div id="statement-aging-table-totals" data-ref="statement-totals"></div>
|
||||
<div id="table-totals" cellspacing="0"></div>
|
||||
<div id="table-totals" cellspacing="0">$status_logo</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
@ -25,7 +25,6 @@
|
||||
font-size: $font_size !important;
|
||||
}
|
||||
|
||||
|
||||
@page {
|
||||
margin-left: $global_margin;
|
||||
margin-right: $global_margin;
|
||||
@ -43,11 +42,12 @@
|
||||
display: grid;
|
||||
grid-template-columns: 1.8fr 1fr 1fr;
|
||||
grid-gap: 20px;
|
||||
margin-bottom: 2rem;
|
||||
}
|
||||
|
||||
.company-logo {
|
||||
max-width: 65%;
|
||||
/* max-width: $company_logo_size;*/
|
||||
/* max-width: 65%;*/
|
||||
max-width: $company_logo_size;
|
||||
}
|
||||
|
||||
.header-container > span {
|
||||
@ -69,7 +69,7 @@
|
||||
}
|
||||
|
||||
.entity-issued-to {
|
||||
margin-top: 2rem;
|
||||
/* margin-top: 2rem; */
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
@ -77,17 +77,26 @@
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
gap: 20px;
|
||||
margin-bottom: 2rem;
|
||||
}
|
||||
|
||||
#client-details {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
margin-top: 1rem;
|
||||
line-height: var(--line-height);
|
||||
vertical-align: top;
|
||||
margin-left: 1rem;
|
||||
}
|
||||
|
||||
#client-details > p:nth-child(1) {
|
||||
#client-details > p:nth-child(2) {
|
||||
color: var(--primary-color);
|
||||
font-size: 120%;
|
||||
}
|
||||
|
||||
#shipping-details {
|
||||
display: $show_shipping_address;
|
||||
flex-direction: column;
|
||||
line-height: var(--line-height);
|
||||
}
|
||||
|
||||
#entity-details {
|
||||
@ -112,7 +121,7 @@
|
||||
|
||||
[data-ref="table"] {
|
||||
margin-top: 0.5rem;
|
||||
margin-bottom: 50px;
|
||||
margin-bottom: 5px;
|
||||
min-width: 100%;
|
||||
table-layout: fixed;
|
||||
overflow-wrap: break-word;
|
||||
@ -174,14 +183,13 @@
|
||||
}
|
||||
|
||||
#table-totals {
|
||||
margin-top: 0.5rem;
|
||||
margin-top: 0rem;
|
||||
display: grid;
|
||||
grid-template-columns: 2fr 1fr;
|
||||
gap: 80px;
|
||||
padding-left: 1rem;
|
||||
padding-top: 0.5rem;
|
||||
padding-bottom: 0.8rem;
|
||||
margin-right: .5rem;
|
||||
padding-left: 0.7rem;
|
||||
page-break-inside:auto;
|
||||
overflow: visible !important;
|
||||
}
|
||||
@ -205,7 +213,7 @@
|
||||
|
||||
#table-totals>.totals-table-right-side>*> :nth-child(2) {
|
||||
text-align: right;
|
||||
padding-right: 7px;
|
||||
padding-right: 17px;
|
||||
}
|
||||
|
||||
#table-totals
|
||||
@ -230,7 +238,7 @@
|
||||
}
|
||||
|
||||
[data-ref="total_table-footer"] {
|
||||
padding-left: 1rem
|
||||
padding-left: 0.8rem
|
||||
}
|
||||
|
||||
#footer {
|
||||
@ -311,6 +319,7 @@
|
||||
opacity: 0.2;
|
||||
z-index:200 !important;
|
||||
position: fixed;
|
||||
display: $show_paid_stamp;
|
||||
}
|
||||
|
||||
.project-header {
|
||||
@ -378,10 +387,10 @@
|
||||
<div id="company-details"></div>
|
||||
<div id="company-address"></div>
|
||||
</div>
|
||||
<p class="entity-issued-to">$entity_issued_to_label:</p>
|
||||
<div class="client-and-entity-wrapper">
|
||||
<div id="client-details"></div>
|
||||
<div id="client-details"><p class="entity-issued-to">$entity_issued_to_label:</p></div>
|
||||
<div id="vendor-details"></div>
|
||||
<div id="shipping-details"></div>
|
||||
<div class="entity-details-wrapper">
|
||||
<table id="entity-details" cellspacing="0" dir="$dir"></table>
|
||||
</div>
|
||||
@ -395,7 +404,7 @@
|
||||
<div id="statement-payment-table-totals" data-ref="statement-totals"></div>
|
||||
<table id="statement-aging-table" cellspacing="0" data-ref="table"></table>
|
||||
<div id="statement-aging-table-totals" data-ref="statement-totals"></div>
|
||||
<div id="table-totals" cellspacing="0"></div>
|
||||
<div id="table-totals" cellspacing="0">$status_logo</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
@ -39,22 +39,40 @@
|
||||
|
||||
.header-wrapper {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 0.5fr;
|
||||
line-height: var(--line-height);
|
||||
margin-top: 2rem;
|
||||
gap: 20px;
|
||||
grid-template-columns: 2fr 1fr 1fr;
|
||||
grid-template-areas: "a b c";
|
||||
grid-auto-columns: minmax(0, 5fr);
|
||||
grid-auto-flow: column;
|
||||
justify-content: left;
|
||||
}
|
||||
|
||||
.header-wrapper2 {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 0.5fr;
|
||||
margin-top: 2rem;
|
||||
min-width: 100%;
|
||||
gap: 20px;
|
||||
grid-template-columns: 2fr 2fr auto;
|
||||
grid-template-areas: "a b c";
|
||||
grid-auto-columns: minmax(0, 5fr);
|
||||
grid-auto-flow: column;
|
||||
justify-content: left;
|
||||
}
|
||||
|
||||
.company-logo {
|
||||
max-width: 65%;
|
||||
/* max-width: $company_logo_size;*/
|
||||
/* max-width: 65%;*/
|
||||
max-width: $company_logo_size;
|
||||
}
|
||||
|
||||
.logo-container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.company-container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
.client-and-entity-wrapper {
|
||||
display: flex;
|
||||
padding: 1rem;
|
||||
@ -68,18 +86,23 @@
|
||||
line-height: var(--line-height);
|
||||
}
|
||||
|
||||
.header-wrapper #company-details {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
line-height: var(--line-height);
|
||||
}
|
||||
|
||||
.header-wrapper #entity-details {
|
||||
margin-top: 0.5rem;
|
||||
padding-right: 0.5rem;
|
||||
text-align: left;
|
||||
line-height: var(--line-height);
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.header-wrapper #entity-details > tr,
|
||||
.header-wrapper #entity-details th {
|
||||
font-weight: normal;
|
||||
padding-left: 0.9rem;
|
||||
padding-top: 0.3rem;
|
||||
padding-bottom: 0.3rem;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.header-wrapper
|
||||
@ -91,12 +114,29 @@
|
||||
background-color: #e6e6e6;
|
||||
}
|
||||
|
||||
#entity-details {
|
||||
text-align: left;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
#entity-details th {
|
||||
font-weight:normal;
|
||||
line-height: 1.5rem;
|
||||
padding-right: 2rem;
|
||||
}
|
||||
|
||||
#client-details {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
line-height: var(--line-height);
|
||||
}
|
||||
|
||||
#shipping-details {
|
||||
visibility: $show_shipping_address_visibility;
|
||||
flex-direction: column;
|
||||
line-height: var(--line-height);
|
||||
}
|
||||
|
||||
[data-ref="table"] {
|
||||
margin-top: 2rem;
|
||||
min-width: 100%;
|
||||
@ -171,17 +211,6 @@
|
||||
padding-right: 0px;
|
||||
}
|
||||
|
||||
|
||||
#entity-details {
|
||||
text-align: left;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
#entity-details th {
|
||||
font-weight:normal;
|
||||
line-height: 1.5rem;
|
||||
}
|
||||
|
||||
#table-totals
|
||||
> *
|
||||
[data-element='total-table-balance-due-label'],
|
||||
@ -270,6 +299,10 @@
|
||||
[data-ref="total_table-public_notes"] { font-weight: normal; }
|
||||
[data-ref="total_table-terms"] { font-weight: normal; }
|
||||
|
||||
/* [data-ref="shipping_address-label"] {
|
||||
display: none;
|
||||
} */
|
||||
|
||||
.stamp {
|
||||
transform: rotate(12deg);
|
||||
color: #555;
|
||||
@ -298,6 +331,7 @@
|
||||
opacity: 0.2;
|
||||
z-index:200 !important;
|
||||
position: fixed;
|
||||
display: $show_paid_stamp;
|
||||
}
|
||||
|
||||
.project-header {
|
||||
@ -355,24 +389,22 @@
|
||||
<tr>
|
||||
<td>
|
||||
<div id="">
|
||||
<div class="header-wrapper">
|
||||
<div>
|
||||
<img class="company-logo" src="$company.logo" alt="$company.name logo">
|
||||
</div>
|
||||
<div style="float:right; width:100%;">
|
||||
<div id="company-details"></div>
|
||||
<div id="company-address" style="margin-top:10px;"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="header-wrapper2">
|
||||
<div id="client-details"></div>
|
||||
<div id="vendor-details"></div>
|
||||
|
||||
<div>
|
||||
<p class="entity-label" style="font-size:32px; font-weight: bold; color:$primary_color;">$entity_label</p>
|
||||
<table id="entity-details" cellspacing="0" dir="ltr"></table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="header-wrapper">
|
||||
<div class="logo-container">
|
||||
<img class="company-logo" src="$company.logo" alt="$company.name logo">
|
||||
</div>
|
||||
<div id="company-details"></div>
|
||||
<div id="company-address"></div>
|
||||
</div>
|
||||
<div class="header-wrapper2">
|
||||
<div id="client-details"></div>
|
||||
<div id="vendor-details"></div>
|
||||
<div id="shipping-details"></div>
|
||||
<div>
|
||||
<p class="entity-label" style="font-size:32px; font-weight: bold; color:$primary_color;">$entity_label</p>
|
||||
<table id="entity-details" cellspacing="0" cellpadding="0" dir="ltr"></table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<table id="product-table" cellspacing="0" data-ref="table"></table>
|
||||
<table id="task-table" cellspacing="0" data-ref="table"></table>
|
||||
@ -383,7 +415,7 @@
|
||||
<div id="statement-payment-table-totals" data-ref="statement-totals"></div>
|
||||
<table id="statement-aging-table" cellspacing="0" data-ref="table"></table>
|
||||
<div id="statement-aging-table-totals" data-ref="statement-totals"></div>
|
||||
<div id="table-totals" cellspacing="0"></div>
|
||||
<div id="table-totals" cellspacing="0">$status_logo</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
@ -55,9 +55,12 @@
|
||||
gap: 20px;
|
||||
}
|
||||
|
||||
.company-logo-container {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
.company-logo {
|
||||
max-width: 65%;
|
||||
/* max-width: $company_logo_size;*/
|
||||
max-width: $company_logo_size;
|
||||
}
|
||||
|
||||
#company-details {
|
||||
@ -86,35 +89,45 @@
|
||||
}
|
||||
|
||||
.client-and-entity-wrapper {
|
||||
display: flex;
|
||||
/* display: flex;*/
|
||||
padding: 1rem;
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr 1fr;
|
||||
border-top: 1px solid #d8d8d8;
|
||||
border-bottom: 1px solid #d8d8d8;
|
||||
}
|
||||
|
||||
#entity-details {
|
||||
display:flex;
|
||||
text-align: left;
|
||||
margin-right: 20px;
|
||||
line-height: var(--line-height) !important;
|
||||
}
|
||||
|
||||
#entity-details > tr,
|
||||
#entity-details th {
|
||||
font-weight: normal;
|
||||
padding-right: 15px;
|
||||
padding-top: 2.5px;
|
||||
padding-bottom: 2.5px;
|
||||
line-height: var(--line-height) !important;
|
||||
}
|
||||
|
||||
#client-details {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
line-height: var(--line-height);
|
||||
padding-right:30px;
|
||||
}
|
||||
|
||||
#client-details > :first-child {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
#shipping-details {
|
||||
display: $show_shipping_address;
|
||||
flex-direction: column;
|
||||
line-height: var(--line-height);
|
||||
}
|
||||
|
||||
[data-ref="table"] {
|
||||
margin-top: 1rem;
|
||||
margin-bottom: 5px;
|
||||
@ -166,8 +179,9 @@
|
||||
margin-top: 0rem;
|
||||
display: grid;
|
||||
grid-template-columns: 2fr 1fr;
|
||||
padding-top: .5rem;
|
||||
padding-top: 0rem;
|
||||
padding-right: 1rem;
|
||||
padding-left: 1rem;
|
||||
gap: 80px;
|
||||
page-break-inside:avoid;
|
||||
overflow: visible !important;
|
||||
@ -210,11 +224,12 @@
|
||||
|
||||
#table-totals > * > :last-child {
|
||||
text-align: right;
|
||||
padding-right: 1rem;
|
||||
padding-right: 0.5rem;
|
||||
}
|
||||
|
||||
#footer {
|
||||
margin-top: 10px;
|
||||
margin-left: 1rem;
|
||||
}
|
||||
|
||||
/** Markdown-specific styles. **/
|
||||
@ -225,12 +240,6 @@
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.company-logo-container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: flex-end;
|
||||
}
|
||||
|
||||
[data-ref="statement-totals"] {
|
||||
margin-top: 1rem;
|
||||
text-align: right;
|
||||
@ -277,6 +286,8 @@
|
||||
z-index:200 !important;
|
||||
position: fixed;
|
||||
text-align: center;
|
||||
float:right;
|
||||
|
||||
}
|
||||
|
||||
.is-paid {
|
||||
@ -290,6 +301,7 @@
|
||||
opacity: 0.2;
|
||||
z-index:200 !important;
|
||||
position: fixed;
|
||||
display: $show_paid_stamp;
|
||||
}
|
||||
|
||||
.project-header {
|
||||
@ -359,10 +371,11 @@
|
||||
<p class="entity-label">$entity_label</p>
|
||||
<div class="client-and-entity-wrapper">
|
||||
<div>
|
||||
<table id="entity-details" cellspacing="0" dir="$dir"></table>
|
||||
<table id="entity-details" cellspacing="0" cellpadding="0" dir="$dir"></table>
|
||||
</div>
|
||||
<div id="client-details"></div>
|
||||
<div id="vendor-details"></div>
|
||||
<div id="shipping-details"></div>
|
||||
</div>
|
||||
<table id="product-table" cellspacing="0" data-ref="table"></table>
|
||||
<table id="task-table" cellspacing="0" data-ref="table"></table>
|
||||
@ -373,7 +386,7 @@
|
||||
<div id="statement-payment-table-totals" data-ref="statement-totals"></div>
|
||||
<table id="statement-aging-table" cellspacing="0" data-ref="table"></table>
|
||||
<div id="statement-aging-table-totals" data-ref="statement-totals"></div>
|
||||
<div id="table-totals" cellspacing="0"></div>
|
||||
<div id="table-totals" cellspacing="0">$status_logo</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@ -402,7 +415,7 @@ $entity_images
|
||||
'product-table', 'task-table', 'delivery-note-table',
|
||||
'statement-invoice-table', 'statement-payment-table', 'statement-aging-table-totals',
|
||||
'statement-invoice-table-totals', 'statement-payment-table-totals', 'statement-aging-table',
|
||||
'client-details','vendor-details', 'swiss-qr'
|
||||
'client-details','vendor-details', 'swiss-qr','shipping-details'
|
||||
];
|
||||
|
||||
tables.forEach((tableIdentifier) => {
|
||||
@ -415,4 +428,4 @@ $entity_images
|
||||
});
|
||||
</script>
|
||||
|
||||
</div>
|
||||
</div>
|
@ -40,23 +40,43 @@
|
||||
|
||||
.header-wrapper {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr 1fr;
|
||||
grid-template-rows:0.5fr;
|
||||
grid-template-columns: auto auto auto auto;
|
||||
grid-template-areas: "a b c d e";
|
||||
grid-auto-columns: minmax(0, 1fr);
|
||||
grid-auto-flow: column;
|
||||
justify-content:left;
|
||||
gap: 20px;
|
||||
line-height: var(--line-height);
|
||||
}
|
||||
|
||||
.company-logo {
|
||||
max-width: 65%;
|
||||
/* max-width: $company_logo_size;*/
|
||||
max-width: $company_logo_size;
|
||||
float:right;
|
||||
}
|
||||
|
||||
#entity-details p { margin-top: 5px; }
|
||||
,logo-wrapper {
|
||||
grid-area: e;
|
||||
align-content: right;
|
||||
border:1px solid #000;
|
||||
}
|
||||
|
||||
#entity-details {
|
||||
width: 100%;
|
||||
white-space: nowrap;
|
||||
margin-right: 3rem;
|
||||
}
|
||||
|
||||
#entity-details p {
|
||||
margin-top: 5px;
|
||||
}
|
||||
|
||||
.header-wrapper #client-details,
|
||||
.header-wrapper #company-details,
|
||||
.header-wrapper #company-address {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
line-height: var(--line-height) !important;
|
||||
}
|
||||
|
||||
[data-ref="company_details-company.name"] {
|
||||
@ -70,11 +90,12 @@
|
||||
|
||||
.header-wrapper .company-info-wrapper > * {
|
||||
margin-bottom: 1rem;
|
||||
grid-row-end: 4;
|
||||
}
|
||||
|
||||
.entity-label-wrapper {
|
||||
display: grid;
|
||||
grid-template-columns: 2fr 1fr;
|
||||
grid-template-columns: 3fr 1fr;
|
||||
margin-top: 1rem;
|
||||
}
|
||||
|
||||
@ -95,13 +116,19 @@
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
#shipping-details {
|
||||
display: $show_shipping_address;
|
||||
flex-direction: column;
|
||||
line-height: var(--line-height) !important;
|
||||
}
|
||||
|
||||
.entity-label-wrapper #entity-details > tr,
|
||||
.entity-label-wrapper #entity-details th {
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
[data-ref="table"] {
|
||||
margin-bottom: 50px;
|
||||
margin-bottom: 5px;
|
||||
min-width: 100%;
|
||||
table-layout: fixed;
|
||||
overflow-wrap: break-word;
|
||||
@ -182,7 +209,7 @@
|
||||
}
|
||||
|
||||
#table-totals > * > * {
|
||||
padding-left: 1rem;
|
||||
padding-left: 0.5rem;
|
||||
}
|
||||
|
||||
#table-totals > * > :last-child {
|
||||
@ -191,7 +218,8 @@
|
||||
}
|
||||
|
||||
[data-ref="total_table-footer"] {
|
||||
padding-left: 1rem
|
||||
padding-left: 0.5rem;
|
||||
padding-right:0.8rem;
|
||||
}
|
||||
|
||||
#footer {
|
||||
@ -263,6 +291,8 @@
|
||||
opacity: 0.2;
|
||||
z-index:200 !important;
|
||||
position: fixed;
|
||||
display: $show_paid_stamp;
|
||||
|
||||
}
|
||||
|
||||
.project-header {
|
||||
@ -325,22 +355,28 @@
|
||||
<div class="header-wrapper">
|
||||
<div id="client-details"></div>
|
||||
<div id="vendor-details"></div>
|
||||
<div id="shipping-details"></div>
|
||||
|
||||
<div class="company-info-wrapper">
|
||||
<div id="company-details"></div>
|
||||
<div id="company-address"></div>
|
||||
</div>
|
||||
<div class="logo-wrapper">
|
||||
<img
|
||||
class="company-logo"
|
||||
src="$company.logo"
|
||||
alt="$company.name logo"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="entity-label-wrapper">
|
||||
<h1 class="entity-label">
|
||||
<span>$entity_label</span>
|
||||
<span>#$entity_number</span>
|
||||
</h1>
|
||||
<table id="entity-details" cellspacing="0" dir="$dir"></table>
|
||||
<div class="entity-details-wrapper">
|
||||
<table id="entity-details" cellspacing="0" dir="$dir"></table>
|
||||
</div>
|
||||
</div>
|
||||
<table id="product-table" cellspacing="0" data-ref="table"></table>
|
||||
<table id="task-table" cellspacing="0" data-ref="table"></table>
|
||||
@ -351,7 +387,7 @@
|
||||
<div id="statement-payment-table-totals" data-ref="statement-totals"></div>
|
||||
<table id="statement-aging-table" cellspacing="0" data-ref="table"></table>
|
||||
<div id="statement-aging-table-totals" data-ref="statement-totals"></div>
|
||||
<div id="table-totals" cellspacing="0"></div>
|
||||
<div id="table-totals" cellspacing="0">$status_logo</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
@ -35,8 +35,8 @@
|
||||
}
|
||||
|
||||
.company-logo {
|
||||
max-width: 55%;
|
||||
/* max-width: $company_logo_size;*/
|
||||
/* max-width: 55%;*/
|
||||
max-width: $company_logo_size;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
display: block;
|
||||
@ -55,31 +55,53 @@
|
||||
display: flex;
|
||||
margin-top: 1rem;
|
||||
gap: 20px;
|
||||
margin-left: 10px;
|
||||
line-height: var(--line-height);
|
||||
margin-left: 0px;
|
||||
line-height: var(--line-height) !important;
|
||||
}
|
||||
|
||||
#entity-details p { margin-right: 20px; margin-top: 5px; }
|
||||
|
||||
#entity-details p {
|
||||
margin-right: 0px;
|
||||
margin-top: 0px;
|
||||
white-space: nowrap;
|
||||
line-height: var(--line-height) !important;
|
||||
}
|
||||
|
||||
.client-entity-wrapper .wrapper-info-text {
|
||||
display: block;
|
||||
font-size: 1.5rem;
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
.client-entity-wrapper .shipping-info-text {
|
||||
display: block;
|
||||
font-size: 1.5rem;
|
||||
font-weight: normal;
|
||||
display: $show_shipping_address;
|
||||
}
|
||||
|
||||
.client-entity-wrapper .wrapper-left-side {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr;
|
||||
grid-template-columns: auto auto ;
|
||||
grid-template-areas: "a b c d";
|
||||
grid-auto-columns: minmax(0, 1fr);
|
||||
grid-auto-flow: column;
|
||||
justify-content:left;
|
||||
}
|
||||
|
||||
.text-with-client { margin-right: 15px; }
|
||||
.text-with-client { margin-right: 1px; }
|
||||
|
||||
.client-entity-wrapper .wrapper-left-side #client-details,
|
||||
.client-entity-wrapper .wrapper-left-side #company-details,
|
||||
.client-entity-wrapper .wrapper-left-side #company-address {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
margin-top: 0.5rem;
|
||||
margin-right: 5px;
|
||||
}
|
||||
|
||||
.client-entity-wrapper .wrapper-left-side #shipping-details {
|
||||
display: $show_shipping_address;
|
||||
flex-direction: column;
|
||||
margin-right: 5px;
|
||||
}
|
||||
|
||||
.client-entity-wrapper .wrapper-left-side .company-info {
|
||||
@ -89,18 +111,21 @@
|
||||
|
||||
.client-entity-wrapper #entity-details {
|
||||
text-align: left;
|
||||
margin-top: 0.5rem;
|
||||
min-width: 100%;
|
||||
line-height: var(--line-height) !important;
|
||||
}
|
||||
|
||||
.client-entity-wrapper #entity-details > tr,
|
||||
.client-entity-wrapper #entity-details th {
|
||||
font-weight: normal;
|
||||
padding-right:8px;
|
||||
line-height: var(--line-height) !important;
|
||||
}
|
||||
|
||||
[data-ref="table"] {
|
||||
margin-top: 3rem;
|
||||
margin-bottom: 50px;
|
||||
margin-bottom: 5
|
||||
px;
|
||||
min-width: 100%;
|
||||
table-layout: fixed;
|
||||
overflow-wrap: break-word;
|
||||
@ -126,6 +151,7 @@
|
||||
|
||||
[data-ref="table"] > thead > tr > th:last-child {
|
||||
text-align: right;
|
||||
padding-right: 1rem;
|
||||
}
|
||||
|
||||
[data-ref="table"] > tbody > tr > td {
|
||||
@ -140,6 +166,11 @@
|
||||
|
||||
[data-ref="table"] > tbody > tr > td:last-child {
|
||||
text-align: right;
|
||||
padding-right: 1rem;
|
||||
}
|
||||
|
||||
[data-ref="shipping_address-label"] {
|
||||
display: none;
|
||||
}
|
||||
|
||||
#table-totals {
|
||||
@ -267,6 +298,8 @@
|
||||
opacity: 0.2;
|
||||
z-index:200 !important;
|
||||
position: fixed;
|
||||
display: $show_paid_stamp;
|
||||
|
||||
}
|
||||
|
||||
.project-header {
|
||||
@ -329,23 +362,27 @@
|
||||
<img class="company-logo" src="$company.logo" alt="$company.name logo">
|
||||
</div>
|
||||
<hr class="double-border">
|
||||
<div class="client-entity-wrapper">
|
||||
<div class="client-entity-wrapper" style="">
|
||||
<div class="wrapper-left-side">
|
||||
<div class="text-with-client">
|
||||
<h2 class="wrapper-info-text">$to_label</h2>
|
||||
<div id="client-details"></div>
|
||||
<div id="vendor-details"></div>
|
||||
</div>
|
||||
<div class="company-info">
|
||||
<div class="shipping-info" style="">
|
||||
<h2 class="shipping-info-text">$shipping_label</h2>
|
||||
<div id="shipping-details"></div>
|
||||
</div>
|
||||
<div class="company-info" style="">
|
||||
<h2 class="wrapper-info-text">$from_label</h2>
|
||||
<div id="company-details"></div>
|
||||
<div id="company-address"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="wrapper-right-side">
|
||||
<h2 class="wrapper-info-text">$details_label</h2>
|
||||
<table id="entity-details" cellspacing="0" dir="$dir"></table>
|
||||
</div>
|
||||
<div class="wrapper-right-side">
|
||||
<h2 class="wrapper-info-text">$details_label</h2>
|
||||
<table id="entity-details" cellspacing="0" cellpadding="0" dir="$dir"></table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<table id="product-table" cellspacing="0" data-ref="table"></table>
|
||||
<table id="task-table" cellspacing="0" data-ref="table"></table>
|
||||
@ -356,7 +393,7 @@
|
||||
<div id="statement-payment-table-totals" data-ref="statement-totals"></div>
|
||||
<table id="statement-aging-table" cellspacing="0" data-ref="table"></table>
|
||||
<div id="statement-aging-table-totals" data-ref="statement-totals"></div>
|
||||
<div id="table-totals" cellspacing="0"></div>
|
||||
<div id="table-totals" cellspacing="0">$status_logo</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
@ -36,7 +36,7 @@
|
||||
|
||||
.header-wrapper {
|
||||
display: grid;
|
||||
grid-template-columns: 1.2fr 1.8fr;
|
||||
grid-template-columns: 0.5fr 1.5fr;
|
||||
gap: 20px;
|
||||
line-height: var(--line-height);
|
||||
}
|
||||
@ -67,10 +67,17 @@
|
||||
|
||||
.header-wrapper .header-right-side-wrapper {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr;
|
||||
/* grid-template-columns: 1fr 1fr; */
|
||||
gap: 10px;
|
||||
border-left: 1px solid #303030;
|
||||
padding-left: 1rem;
|
||||
|
||||
grid-template-columns: auto auto auto;
|
||||
grid-template-areas: "a b c";
|
||||
grid-auto-columns: minmax(0, 1fr);
|
||||
grid-auto-flow: column;
|
||||
justify-content:left;
|
||||
|
||||
}
|
||||
|
||||
.header-wrapper .header-right-side-wrapper #client-details {
|
||||
@ -79,13 +86,26 @@
|
||||
margin-top: 0.8rem;
|
||||
}
|
||||
|
||||
.header-wrapper .header-right-side-wrapper #shipping-details {
|
||||
display: $show_shipping_address;
|
||||
flex-direction: column;
|
||||
margin-top: 0.8rem;
|
||||
}
|
||||
|
||||
.shipping-text-label {
|
||||
font-size: 1.1rem;
|
||||
color: var(--primary-color);
|
||||
text-transform: uppercase;
|
||||
font-weight: bold;
|
||||
display: $show_shipping_address;
|
||||
}
|
||||
|
||||
.header-wrapper {
|
||||
margin-left: auto;
|
||||
}
|
||||
|
||||
.company-logo {
|
||||
max-width: 65%;
|
||||
/* max-width: $company_logo_size;*/
|
||||
max-width: $company_logo_size;
|
||||
}
|
||||
|
||||
.entity-label {
|
||||
@ -96,6 +116,14 @@
|
||||
|
||||
.entity-details-wrapper > * {
|
||||
margin-right: 1.5rem;
|
||||
direction: $dir;
|
||||
}
|
||||
|
||||
.entity-details-wrapper {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
direction: $dir;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.entity-details-wrapper .entity-property-label {
|
||||
@ -110,9 +138,13 @@
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
[data-ref="shipping_address-label"] {
|
||||
display: none;
|
||||
}
|
||||
|
||||
[data-ref="table"] {
|
||||
margin-top: 1rem;
|
||||
margin-bottom: 50px;
|
||||
margin-bottom: 5px;
|
||||
min-width: 100%;
|
||||
table-layout: fixed;
|
||||
overflow-wrap: break-word;
|
||||
@ -139,6 +171,12 @@
|
||||
|
||||
[data-ref="table"] > thead > tr > th:last-child {
|
||||
text-align: right;
|
||||
padding-right: 1rem;
|
||||
}
|
||||
|
||||
[data-ref="table"] > thead > tr > th:nth-last-child(2) {
|
||||
text-align: right;
|
||||
padding-right: 1rem;
|
||||
}
|
||||
|
||||
[data-ref="table"] > tbody > tr > td {
|
||||
@ -155,7 +193,7 @@
|
||||
display: grid;
|
||||
grid-template-columns: 2fr 1fr;
|
||||
padding-top: 0.5rem;
|
||||
margin-right: .75rem;
|
||||
margin-right: 1rem;
|
||||
gap: 80px;
|
||||
page-break-inside:auto;
|
||||
overflow: visible !important;
|
||||
@ -211,16 +249,6 @@
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.entity-details-wrapper > * {
|
||||
direction: $dir;
|
||||
}
|
||||
|
||||
.entity-details-wrapper {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
direction: $dir;
|
||||
}
|
||||
|
||||
[data-ref="product_table-product.unit_cost-td"] { text-align: right; }
|
||||
|
||||
[data-ref="totals_table-outstanding"] { color: var(--primary-color); }
|
||||
@ -284,6 +312,7 @@
|
||||
opacity: 0.2;
|
||||
z-index:200 !important;
|
||||
position: fixed;
|
||||
display: $show_paid_stamp;
|
||||
}
|
||||
|
||||
.project-header {
|
||||
@ -354,6 +383,10 @@
|
||||
<div id="client-details"></div>
|
||||
<div id="vendor-details"></div>
|
||||
</div>
|
||||
<div class="header-right-side-wrapper-left">
|
||||
<p class="shipping-text-label">$shipping_label:</p>
|
||||
<div id="shipping-details"></div>
|
||||
</div>
|
||||
<div class="header-right-side-wrapper-right">
|
||||
<img
|
||||
class="company-logo"
|
||||
@ -397,7 +430,7 @@
|
||||
<div id="statement-payment-table-totals" data-ref="statement-totals"></div>
|
||||
<table id="statement-aging-table" cellspacing="0" data-ref="table"></table>
|
||||
<div id="statement-aging-table-totals" data-ref="statement-totals"></div>
|
||||
<div id="table-totals" cellspacing="0"></div>
|
||||
<div id="table-totals" cellspacing="0">$status_logo</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user