mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-07 10:34:30 -04:00
Merge pull request #8998 from turbo124/v5-develop
Stubs for extensions.
This commit is contained in:
commit
fd86accec7
@ -12,7 +12,6 @@
|
|||||||
namespace App\Console\Commands;
|
namespace App\Console\Commands;
|
||||||
|
|
||||||
use App;
|
use App;
|
||||||
use App\DataMapper\ClientSettings;
|
|
||||||
use App\Factory\ClientContactFactory;
|
use App\Factory\ClientContactFactory;
|
||||||
use App\Factory\VendorContactFactory;
|
use App\Factory\VendorContactFactory;
|
||||||
use App\Jobs\Company\CreateCompanyToken;
|
use App\Jobs\Company\CreateCompanyToken;
|
||||||
|
@ -11,54 +11,53 @@
|
|||||||
|
|
||||||
namespace App\Console\Commands;
|
namespace App\Console\Commands;
|
||||||
|
|
||||||
use stdClass;
|
use App\DataMapper\ClientRegistrationFields;
|
||||||
use Carbon\Carbon;
|
use App\DataMapper\CompanySettings;
|
||||||
use Faker\Factory;
|
use App\DataMapper\FeesAndLimits;
|
||||||
use App\Models\Task;
|
use App\Events\Invoice\InvoiceWasCreated;
|
||||||
use App\Models\User;
|
use App\Events\RecurringInvoice\RecurringInvoiceWasCreated;
|
||||||
use App\Utils\Ninja;
|
use App\Factory\GroupSettingFactory;
|
||||||
use App\Models\Quote;
|
use App\Factory\InvoiceFactory;
|
||||||
use App\Models\Client;
|
use App\Factory\InvoiceItemFactory;
|
||||||
use App\Models\Credit;
|
use App\Factory\RecurringInvoiceFactory;
|
||||||
use App\Models\Vendor;
|
use App\Factory\SubscriptionFactory;
|
||||||
|
use App\Helpers\Invoice\InvoiceSum;
|
||||||
|
use App\Jobs\Company\CreateCompanyTaskStatuses;
|
||||||
|
use App\Libraries\MultiDB;
|
||||||
use App\Models\Account;
|
use App\Models\Account;
|
||||||
|
use App\Models\BankIntegration;
|
||||||
|
use App\Models\BankTransaction;
|
||||||
|
use App\Models\BankTransactionRule;
|
||||||
|
use App\Models\Client;
|
||||||
|
use App\Models\ClientContact;
|
||||||
use App\Models\Company;
|
use App\Models\Company;
|
||||||
|
use App\Models\CompanyGateway;
|
||||||
|
use App\Models\CompanyToken;
|
||||||
use App\Models\Country;
|
use App\Models\Country;
|
||||||
|
use App\Models\Credit;
|
||||||
use App\Models\Expense;
|
use App\Models\Expense;
|
||||||
use App\Models\Gateway;
|
|
||||||
use App\Models\Invoice;
|
use App\Models\Invoice;
|
||||||
use App\Models\Product;
|
use App\Models\Product;
|
||||||
use App\Models\Project;
|
use App\Models\Project;
|
||||||
use App\Models\TaxRate;
|
use App\Models\Quote;
|
||||||
use App\Libraries\MultiDB;
|
|
||||||
use App\Models\TaskStatus;
|
|
||||||
use App\Models\CompanyToken;
|
|
||||||
use App\Models\ClientContact;
|
|
||||||
use App\Models\VendorContact;
|
|
||||||
use App\Models\CompanyGateway;
|
|
||||||
use App\Factory\InvoiceFactory;
|
|
||||||
use App\Models\BankIntegration;
|
|
||||||
use App\Models\BankTransaction;
|
|
||||||
use App\Utils\Traits\MakesHash;
|
|
||||||
use Illuminate\Console\Command;
|
|
||||||
use App\Models\RecurringInvoice;
|
use App\Models\RecurringInvoice;
|
||||||
use App\DataMapper\FeesAndLimits;
|
use App\Models\Task;
|
||||||
use App\DataMapper\CompanySettings;
|
use App\Models\TaskStatus;
|
||||||
use App\Factory\InvoiceItemFactory;
|
use App\Models\TaxRate;
|
||||||
use App\Helpers\Invoice\InvoiceSum;
|
use App\Models\User;
|
||||||
use App\Models\BankTransactionRule;
|
use App\Models\Vendor;
|
||||||
use App\Factory\GroupSettingFactory;
|
use App\Models\VendorContact;
|
||||||
use App\Factory\SubscriptionFactory;
|
|
||||||
use Illuminate\Support\Facades\Hash;
|
|
||||||
use Illuminate\Support\Facades\Cache;
|
|
||||||
use App\Utils\Traits\GeneratesCounter;
|
|
||||||
use Illuminate\Support\Facades\Schema;
|
|
||||||
use App\Repositories\InvoiceRepository;
|
use App\Repositories\InvoiceRepository;
|
||||||
use App\Factory\RecurringInvoiceFactory;
|
use App\Utils\Ninja;
|
||||||
use App\Events\Invoice\InvoiceWasCreated;
|
use App\Utils\Traits\GeneratesCounter;
|
||||||
use App\DataMapper\ClientRegistrationFields;
|
use App\Utils\Traits\MakesHash;
|
||||||
use App\Jobs\Company\CreateCompanyTaskStatuses;
|
use Carbon\Carbon;
|
||||||
use App\Events\RecurringInvoice\RecurringInvoiceWasCreated;
|
use Faker\Factory;
|
||||||
|
use Illuminate\Console\Command;
|
||||||
|
use Illuminate\Support\Facades\Cache;
|
||||||
|
use Illuminate\Support\Facades\Hash;
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
use stdClass;
|
||||||
|
|
||||||
class CreateSingleAccount extends Command
|
class CreateSingleAccount extends Command
|
||||||
{
|
{
|
||||||
|
@ -11,17 +11,17 @@
|
|||||||
|
|
||||||
namespace App\Export\CSV;
|
namespace App\Export\CSV;
|
||||||
|
|
||||||
|
use App\Export\Decorators\Decorator;
|
||||||
|
use App\Libraries\MultiDB;
|
||||||
|
use App\Models\Client;
|
||||||
|
use App\Models\Company;
|
||||||
|
use App\Transformers\ClientContactTransformer;
|
||||||
|
use App\Transformers\ClientTransformer;
|
||||||
use App\Utils\Ninja;
|
use App\Utils\Ninja;
|
||||||
use App\Utils\Number;
|
use App\Utils\Number;
|
||||||
use App\Models\Client;
|
|
||||||
use League\Csv\Writer;
|
|
||||||
use App\Models\Company;
|
|
||||||
use App\Libraries\MultiDB;
|
|
||||||
use Illuminate\Support\Facades\App;
|
|
||||||
use App\Export\Decorators\Decorator;
|
|
||||||
use App\Transformers\ClientTransformer;
|
|
||||||
use Illuminate\Database\Eloquent\Builder;
|
use Illuminate\Database\Eloquent\Builder;
|
||||||
use App\Transformers\ClientContactTransformer;
|
use Illuminate\Support\Facades\App;
|
||||||
|
use League\Csv\Writer;
|
||||||
|
|
||||||
class ClientExport extends BaseExport
|
class ClientExport extends BaseExport
|
||||||
{
|
{
|
||||||
|
@ -11,15 +11,15 @@
|
|||||||
|
|
||||||
namespace App\Export\CSV;
|
namespace App\Export\CSV;
|
||||||
|
|
||||||
use App\Utils\Ninja;
|
use App\Export\Decorators\Decorator;
|
||||||
use League\Csv\Writer;
|
use App\Libraries\MultiDB;
|
||||||
use App\Models\Company;
|
use App\Models\Company;
|
||||||
use App\Models\Payment;
|
use App\Models\Payment;
|
||||||
use App\Libraries\MultiDB;
|
|
||||||
use Illuminate\Support\Facades\App;
|
|
||||||
use App\Transformers\PaymentTransformer;
|
use App\Transformers\PaymentTransformer;
|
||||||
|
use App\Utils\Ninja;
|
||||||
use Illuminate\Database\Eloquent\Builder;
|
use Illuminate\Database\Eloquent\Builder;
|
||||||
use App\Export\Decorators\Decorator;
|
use Illuminate\Support\Facades\App;
|
||||||
|
use League\Csv\Writer;
|
||||||
|
|
||||||
class PaymentExport extends BaseExport
|
class PaymentExport extends BaseExport
|
||||||
{
|
{
|
||||||
|
@ -23,8 +23,7 @@ class ClientDecorator extends Decorator implements DecoratorInterface
|
|||||||
|
|
||||||
if($entity instanceof Client) {
|
if($entity instanceof Client) {
|
||||||
$client = $entity;
|
$client = $entity;
|
||||||
}
|
} elseif($entity->client) {
|
||||||
elseif($entity->client) {
|
|
||||||
$client = $entity->client;
|
$client = $entity->client;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -35,141 +34,192 @@ class ClientDecorator extends Decorator implements DecoratorInterface
|
|||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
public function name(Client $client) {
|
public function name(Client $client)
|
||||||
|
{
|
||||||
return $client->present()->name();
|
return $client->present()->name();
|
||||||
}
|
}
|
||||||
public function number(Client $client) {
|
|
||||||
|
public function number(Client $client)
|
||||||
|
{
|
||||||
return $client->number ?? '';
|
return $client->number ?? '';
|
||||||
}
|
}
|
||||||
public function user(Client $client) {
|
|
||||||
|
public function user(Client $client)
|
||||||
|
{
|
||||||
return $client->user->present()->name();
|
return $client->user->present()->name();
|
||||||
}
|
}
|
||||||
public function assigned_user(Client $client) {
|
|
||||||
|
public function assigned_user(Client $client)
|
||||||
|
{
|
||||||
return $client->assigned_user ? $client->user->present()->name() : '';
|
return $client->assigned_user ? $client->user->present()->name() : '';
|
||||||
}
|
}
|
||||||
public function balance(Client $client) {
|
|
||||||
|
public function balance(Client $client)
|
||||||
|
{
|
||||||
return $client->balance ?? 0;
|
return $client->balance ?? 0;
|
||||||
}
|
}
|
||||||
public function paid_to_date(Client $client) {
|
|
||||||
|
public function paid_to_date(Client $client)
|
||||||
|
{
|
||||||
return $client->paid_to_date ?? 0;
|
return $client->paid_to_date ?? 0;
|
||||||
}
|
}
|
||||||
public function currency_id(Client $client) {
|
|
||||||
|
public function currency_id(Client $client)
|
||||||
|
{
|
||||||
return $client->currency() ? $client->currency()->code : $client->company->currency()->code;
|
return $client->currency() ? $client->currency()->code : $client->company->currency()->code;
|
||||||
}
|
}
|
||||||
public function website(Client $client) {
|
|
||||||
|
public function website(Client $client)
|
||||||
|
{
|
||||||
return $client->website ?? '';
|
return $client->website ?? '';
|
||||||
}
|
}
|
||||||
public function private_notes(Client $client) {
|
|
||||||
|
public function private_notes(Client $client)
|
||||||
|
{
|
||||||
return $client->private_notes ?? '';
|
return $client->private_notes ?? '';
|
||||||
}
|
}
|
||||||
public function industry_id(Client $client) {
|
|
||||||
|
public function industry_id(Client $client)
|
||||||
|
{
|
||||||
return $client->industry ? ctrans("texts.industry_{$client->industry->name}") : '';
|
return $client->industry ? ctrans("texts.industry_{$client->industry->name}") : '';
|
||||||
}
|
}
|
||||||
public function size_id(Client $client) {
|
|
||||||
|
public function size_id(Client $client)
|
||||||
|
{
|
||||||
return $client->size ? ctrans("texts.size_{$client->size->name}") : '';
|
return $client->size ? ctrans("texts.size_{$client->size->name}") : '';
|
||||||
}
|
}
|
||||||
public function phone(Client $client) {
|
|
||||||
|
public function phone(Client $client)
|
||||||
|
{
|
||||||
return $client->phone ?? '';
|
return $client->phone ?? '';
|
||||||
}
|
}
|
||||||
public function address1(Client $client) {
|
|
||||||
|
public function address1(Client $client)
|
||||||
|
{
|
||||||
return $client->address1 ?? '';
|
return $client->address1 ?? '';
|
||||||
}
|
}
|
||||||
public function address2(Client $client) {
|
|
||||||
|
public function address2(Client $client)
|
||||||
|
{
|
||||||
return $client->address2 ?? '';
|
return $client->address2 ?? '';
|
||||||
}
|
}
|
||||||
public function city(Client $client) {
|
|
||||||
|
public function city(Client $client)
|
||||||
|
{
|
||||||
return $client->city ?? '';
|
return $client->city ?? '';
|
||||||
}
|
}
|
||||||
public function state(Client $client) {
|
|
||||||
|
public function state(Client $client)
|
||||||
|
{
|
||||||
return $client->state ?? '';
|
return $client->state ?? '';
|
||||||
}
|
}
|
||||||
public function postal_code(Client $client) {
|
|
||||||
|
public function postal_code(Client $client)
|
||||||
|
{
|
||||||
return $client->postal_code ?? '';
|
return $client->postal_code ?? '';
|
||||||
}
|
}
|
||||||
public function country_id(Client $client) {
|
|
||||||
|
public function country_id(Client $client)
|
||||||
|
{
|
||||||
return $client->country ? ctrans("texts.country_{$client->country->name}") : '';
|
return $client->country ? ctrans("texts.country_{$client->country->name}") : '';
|
||||||
}
|
}
|
||||||
public function shipping_address1(Client $client) {
|
|
||||||
|
public function shipping_address1(Client $client)
|
||||||
|
{
|
||||||
return $client->shipping_address1 ?? '';
|
return $client->shipping_address1 ?? '';
|
||||||
}
|
}
|
||||||
public function shipping_address2(Client $client) {
|
|
||||||
|
public function shipping_address2(Client $client)
|
||||||
|
{
|
||||||
return $client->shipping_address2 ?? '';
|
return $client->shipping_address2 ?? '';
|
||||||
}
|
}
|
||||||
public function shipping_city(Client $client) {
|
|
||||||
|
public function shipping_city(Client $client)
|
||||||
|
{
|
||||||
return $client->shipping_city ?? '';
|
return $client->shipping_city ?? '';
|
||||||
}
|
}
|
||||||
public function shipping_state(Client $client) {
|
|
||||||
|
public function shipping_state(Client $client)
|
||||||
|
{
|
||||||
return $client->shipping_state ?? '';
|
return $client->shipping_state ?? '';
|
||||||
}
|
}
|
||||||
public function shipping_postal_code(Client $client) {
|
|
||||||
|
public function shipping_postal_code(Client $client)
|
||||||
|
{
|
||||||
return $client->shipping_postal_code ?? '';
|
return $client->shipping_postal_code ?? '';
|
||||||
}
|
}
|
||||||
public function shipping_country_id(Client $client) {
|
|
||||||
|
public function shipping_country_id(Client $client)
|
||||||
|
{
|
||||||
return $client->shipping_country ? ctrans("texts.country_{$client->shipping_country->name}") : '';
|
return $client->shipping_country ? ctrans("texts.country_{$client->shipping_country->name}") : '';
|
||||||
}
|
}
|
||||||
public function payment_terms(Client $client) {
|
|
||||||
|
public function payment_terms(Client $client)
|
||||||
|
{
|
||||||
return $client?->settings?->payment_terms ?? $client->company->settings->payment_terms;
|
return $client?->settings?->payment_terms ?? $client->company->settings->payment_terms;
|
||||||
}
|
}
|
||||||
public function vat_number(Client $client) {
|
|
||||||
|
public function vat_number(Client $client)
|
||||||
|
{
|
||||||
return $client->vat_number ?? '';
|
return $client->vat_number ?? '';
|
||||||
}
|
}
|
||||||
public function id_number(Client $client) {
|
|
||||||
|
public function id_number(Client $client)
|
||||||
|
{
|
||||||
return $client->id_number ?? '';
|
return $client->id_number ?? '';
|
||||||
}
|
}
|
||||||
public function public_notes(Client $client) {
|
|
||||||
|
public function public_notes(Client $client)
|
||||||
|
{
|
||||||
return $client->public_notes ?? '';
|
return $client->public_notes ?? '';
|
||||||
}
|
}
|
||||||
public function custom_value1(Client $client) {
|
|
||||||
|
public function custom_value1(Client $client)
|
||||||
|
{
|
||||||
return $client->custom_value1 ?? '';
|
return $client->custom_value1 ?? '';
|
||||||
}
|
}
|
||||||
public function custom_value2(Client $client) {
|
|
||||||
|
public function custom_value2(Client $client)
|
||||||
|
{
|
||||||
return $client->custom_value2 ?? '';
|
return $client->custom_value2 ?? '';
|
||||||
}
|
}
|
||||||
public function custom_value3(Client $client) {
|
|
||||||
|
public function custom_value3(Client $client)
|
||||||
|
{
|
||||||
return $client->custom_value3 ?? '';
|
return $client->custom_value3 ?? '';
|
||||||
}
|
}
|
||||||
public function custom_value4(Client $client) {
|
|
||||||
|
public function custom_value4(Client $client)
|
||||||
|
{
|
||||||
return $client->custom_value4 ?? '';
|
return $client->custom_value4 ?? '';
|
||||||
}
|
}
|
||||||
public function payment_balance(Client $client) {
|
|
||||||
|
public function payment_balance(Client $client)
|
||||||
|
{
|
||||||
return $client->payment_balance ?? 0;
|
return $client->payment_balance ?? 0;
|
||||||
}
|
}
|
||||||
public function credit_balance(Client $client) {
|
|
||||||
|
public function credit_balance(Client $client)
|
||||||
|
{
|
||||||
return $client->credit_balance ?? 0;
|
return $client->credit_balance ?? 0;
|
||||||
}
|
}
|
||||||
public function classification(Client $client) {
|
|
||||||
|
public function classification(Client $client)
|
||||||
|
{
|
||||||
ctrans("texts.{$client->classification}") ?? '';
|
ctrans("texts.{$client->classification}") ?? '';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function status(Client $client)
|
||||||
|
{
|
||||||
|
if ($client->is_deleted) {
|
||||||
|
return ctrans('texts.deleted');
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($client->deleted_at) {
|
||||||
|
return ctrans('texts.archived');
|
||||||
|
}
|
||||||
|
|
||||||
////////contact details/////////////////
|
return ctrans('texts.active');
|
||||||
/*
|
}
|
||||||
public function phone(Client $client) {
|
|
||||||
|
|
||||||
}
|
|
||||||
public function first_name(Client $client) {
|
|
||||||
|
|
||||||
}
|
|
||||||
public function last_name(Client $client) {
|
|
||||||
|
|
||||||
}
|
|
||||||
public function email(Client $client) {
|
|
||||||
|
|
||||||
}
|
|
||||||
public function custom_value1(Client $client) {
|
|
||||||
|
|
||||||
}
|
|
||||||
public function custom_value2(Client $client) {
|
|
||||||
|
|
||||||
}
|
|
||||||
public function custom_value3(Client $client) {
|
|
||||||
|
|
||||||
}
|
|
||||||
public function custom_value4(Client $client) {
|
|
||||||
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -11,10 +11,59 @@
|
|||||||
|
|
||||||
namespace App\Export\Decorators;
|
namespace App\Export\Decorators;
|
||||||
|
|
||||||
|
use App\Models\ClientContact;
|
||||||
|
|
||||||
class ContactDecorator implements DecoratorInterface
|
class ContactDecorator implements DecoratorInterface
|
||||||
{
|
{
|
||||||
public function transform(string $key, mixed $entity): mixed
|
public function transform(string $key, mixed $entity): mixed
|
||||||
{
|
{
|
||||||
return 'Payment Decorator';
|
$contact = false;
|
||||||
|
|
||||||
|
if($entity instanceof ClientContact) {
|
||||||
|
$contact = $entity;
|
||||||
|
} elseif($entity->contacts) {
|
||||||
|
$contact = $entity->contacts()->first();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if($contact && method_exists($this, $key)) {
|
||||||
|
return $this->{$key}($contact);
|
||||||
|
}
|
||||||
|
|
||||||
|
return '';
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public function phone(ClientContact $contact)
|
||||||
|
{
|
||||||
|
return $contact->phone ?? '';
|
||||||
|
}
|
||||||
|
public function first_name(ClientContact $contact)
|
||||||
|
{
|
||||||
|
return $contact->first_name ?? '';
|
||||||
|
}
|
||||||
|
public function last_name(ClientContact $contact)
|
||||||
|
{
|
||||||
|
return $contact->last_name ?? '';
|
||||||
|
}
|
||||||
|
public function email(ClientContact $contact)
|
||||||
|
{
|
||||||
|
return $contact->email ?? '';
|
||||||
|
}
|
||||||
|
public function custom_value1(ClientContact $contact)
|
||||||
|
{
|
||||||
|
return $contact->custom_value1 ?? '';
|
||||||
|
}
|
||||||
|
public function custom_value2(ClientContact $contact)
|
||||||
|
{
|
||||||
|
return $contact->custom_value2 ?? '';
|
||||||
|
}
|
||||||
|
public function custom_value3(ClientContact $contact)
|
||||||
|
{
|
||||||
|
return $contact->custom_value3 ?? '';
|
||||||
|
}
|
||||||
|
public function custom_value4(ClientContact $contact)
|
||||||
|
{
|
||||||
|
return $contact->custom_value4 ?? '';
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -11,10 +11,143 @@
|
|||||||
|
|
||||||
namespace App\Export\Decorators;
|
namespace App\Export\Decorators;
|
||||||
|
|
||||||
|
use App\Models\Credit;
|
||||||
|
|
||||||
class CreditDecorator implements DecoratorInterface
|
class CreditDecorator implements DecoratorInterface
|
||||||
{
|
{
|
||||||
public function transform(string $key, mixed $entity): mixed
|
public function transform(string $key, mixed $entity): mixed
|
||||||
{
|
{
|
||||||
return 'Payment Decorator';
|
$credit = false;
|
||||||
|
|
||||||
|
if($entity instanceof Credit) {
|
||||||
|
$credit = $entity;
|
||||||
|
} elseif($entity->credit) {
|
||||||
|
$credit = $entity->credit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if($credit && method_exists($this, $key)) {
|
||||||
|
return $this->{$key}($credit);
|
||||||
|
}
|
||||||
|
|
||||||
|
return '';
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public function number(Credit $credit)
|
||||||
|
{
|
||||||
|
return $credit->number ?? '';
|
||||||
|
}
|
||||||
|
public function amount(Credit $credit)
|
||||||
|
{
|
||||||
|
return $credit->amount ?? 0;
|
||||||
|
}
|
||||||
|
public function balance(Credit $credit)
|
||||||
|
{
|
||||||
|
return $credit->balance ?? 0;
|
||||||
|
}
|
||||||
|
public function paid_to_date(Credit $credit)
|
||||||
|
{
|
||||||
|
return $credit->paid_to_date ?? 0;
|
||||||
|
}
|
||||||
|
public function po_number(Credit $credit)
|
||||||
|
{
|
||||||
|
return $credit->po_number ?? '';
|
||||||
|
}
|
||||||
|
public function date(Credit $credit)
|
||||||
|
{
|
||||||
|
return $credit->date ?? '';
|
||||||
|
}
|
||||||
|
public function due_date(Credit $credit)
|
||||||
|
{
|
||||||
|
return $credit->due_date ?? '';
|
||||||
|
}
|
||||||
|
public function terms(Credit $credit)
|
||||||
|
{
|
||||||
|
return $credit->terms ?? '';
|
||||||
|
}
|
||||||
|
public function discount(Credit $credit)
|
||||||
|
{
|
||||||
|
return $credit->discount ?? 0;
|
||||||
|
}
|
||||||
|
public function footer(Credit $credit)
|
||||||
|
{
|
||||||
|
return $credit->footer ?? '';
|
||||||
|
}
|
||||||
|
public function status(Credit $credit)
|
||||||
|
{
|
||||||
|
return $credit->stringStatus($credit->status_id);
|
||||||
|
}
|
||||||
|
public function public_notes(Credit $credit)
|
||||||
|
{
|
||||||
|
return $credit->public_notes ?? '';
|
||||||
|
}
|
||||||
|
public function private_notes(Credit $credit)
|
||||||
|
{
|
||||||
|
return $credit->private_notes ?? '';
|
||||||
|
}
|
||||||
|
public function uses_inclusive_taxes(Credit $credit)
|
||||||
|
{
|
||||||
|
return $credit->uses_inclusive_taxes ? ctrans('texts.yes') : ctrans('texts.no');
|
||||||
|
}
|
||||||
|
public function is_amount_discount(Credit $credit)
|
||||||
|
{
|
||||||
|
return $credit->is_amount_discount ? ctrans('texts.yes') : ctrans('texts.no');
|
||||||
|
}
|
||||||
|
public function partial(Credit $credit)
|
||||||
|
{
|
||||||
|
return $credit->partial ?? 0;
|
||||||
|
}
|
||||||
|
public function partial_due_date(Credit $credit)
|
||||||
|
{
|
||||||
|
return $credit->partial_due_date ?? '';
|
||||||
|
}
|
||||||
|
public function custom_surcharge1(Credit $credit)
|
||||||
|
{
|
||||||
|
return $credit->custom_surcharge1 ?? 0;
|
||||||
|
}
|
||||||
|
public function custom_surcharge2(Credit $credit)
|
||||||
|
{
|
||||||
|
return $credit->custom_surcharge2 ?? 0;
|
||||||
|
}
|
||||||
|
public function custom_surcharge3(Credit $credit)
|
||||||
|
{
|
||||||
|
return $credit->custom_surcharge3 ?? 0;
|
||||||
|
}
|
||||||
|
public function custom_surcharge4(Credit $credit)
|
||||||
|
{
|
||||||
|
return $credit->custom_surcharge4 ?? 0;
|
||||||
|
}
|
||||||
|
public function custom_value1(Credit $credit)
|
||||||
|
{
|
||||||
|
return $credit->custom_value1 ?? '';
|
||||||
|
}
|
||||||
|
public function custom_value2(Credit $credit)
|
||||||
|
{
|
||||||
|
return $credit->custom_value2 ?? '';
|
||||||
|
}
|
||||||
|
public function custom_value3(Credit $credit)
|
||||||
|
{
|
||||||
|
return $credit->custom_value3 ?? '';
|
||||||
|
}
|
||||||
|
public function custom_value4(Credit $credit)
|
||||||
|
{
|
||||||
|
return $credit->custom_value4 ?? '';
|
||||||
|
}
|
||||||
|
public function exchange_rate(Credit $credit)
|
||||||
|
{
|
||||||
|
return $credit->exchange_rate ?? 0;
|
||||||
|
}
|
||||||
|
public function total_taxes(Credit $credit)
|
||||||
|
{
|
||||||
|
return $credit->total_taxes ?? 0;
|
||||||
|
}
|
||||||
|
public function assigned_user_id(Credit $credit)
|
||||||
|
{
|
||||||
|
return $credit->assigned_user ? $credit->assigned_user->present()->name(): '';
|
||||||
|
}
|
||||||
|
public function user_id(Credit $credit)
|
||||||
|
{
|
||||||
|
return $credit->user ? $credit->user->present()->name(): '';
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -11,22 +11,8 @@
|
|||||||
|
|
||||||
namespace App\Export\Decorators;
|
namespace App\Export\Decorators;
|
||||||
|
|
||||||
|
class Decorator implements DecoratorInterface
|
||||||
use App\Models\Task;
|
{
|
||||||
use App\Models\Quote;
|
|
||||||
use App\Models\Client;
|
|
||||||
use App\Models\Credit;
|
|
||||||
use App\Models\Vendor;
|
|
||||||
use App\Models\Expense;
|
|
||||||
use App\Models\Invoice;
|
|
||||||
use App\Models\Payment;
|
|
||||||
use App\Models\Product;
|
|
||||||
use App\Models\Project;
|
|
||||||
use App\Models\PurchaseOrder;
|
|
||||||
use App\Models\RecurringInvoice;
|
|
||||||
use App\Export\Decorators\DecoratorInterface;
|
|
||||||
|
|
||||||
class Decorator implements DecoratorInterface{
|
|
||||||
|
|
||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
|
@ -11,6 +11,7 @@
|
|||||||
|
|
||||||
namespace App\Export\Decorators;
|
namespace App\Export\Decorators;
|
||||||
|
|
||||||
interface DecoratorInterface {
|
interface DecoratorInterface
|
||||||
|
{
|
||||||
public function transform(string $key, mixed $entity): mixed;
|
public function transform(string $key, mixed $entity): mixed;
|
||||||
}
|
}
|
||||||
|
@ -11,10 +11,155 @@
|
|||||||
|
|
||||||
namespace App\Export\Decorators;
|
namespace App\Export\Decorators;
|
||||||
|
|
||||||
|
use App\Models\Expense;
|
||||||
|
|
||||||
class ExpenseDecorator implements DecoratorInterface
|
class ExpenseDecorator implements DecoratorInterface
|
||||||
{
|
{
|
||||||
public function transform(string $key, mixed $entity): mixed
|
public function transform(string $key, mixed $entity): mixed
|
||||||
{
|
{
|
||||||
return 'Payment Decorator';
|
$expense = false;
|
||||||
|
|
||||||
|
if($entity instanceof Expense) {
|
||||||
|
$expense = $entity;
|
||||||
|
} elseif($entity->expense) {
|
||||||
|
$expense = $entity->expense;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if($expense && method_exists($this, $key)) {
|
||||||
|
return $this->{$key}($expense);
|
||||||
|
}
|
||||||
|
|
||||||
|
return '';
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public function amount(Expense $expense)
|
||||||
|
{
|
||||||
|
return $expense->amount ?? 0;
|
||||||
|
}
|
||||||
|
public function category_id(Expense $expense)
|
||||||
|
{
|
||||||
|
return $expense->category ? $expense->category->name : '';
|
||||||
|
}
|
||||||
|
public function client_id(Expense $expense)
|
||||||
|
{
|
||||||
|
return $expense->client ? $expense->client->present()->name() : '';
|
||||||
|
}
|
||||||
|
public function custom_value1(Expense $expense)
|
||||||
|
{
|
||||||
|
return $expense->custom_value1 ?? '';
|
||||||
|
}
|
||||||
|
public function custom_value2(Expense $expense)
|
||||||
|
{
|
||||||
|
return $expense->custom_value2 ?? '';
|
||||||
|
}
|
||||||
|
public function custom_value3(Expense $expense)
|
||||||
|
{
|
||||||
|
return $expense->custom_value3 ?? '';
|
||||||
|
}
|
||||||
|
public function custom_value4(Expense $expense)
|
||||||
|
{
|
||||||
|
return $expense->custom_value4 ?? '';
|
||||||
|
}
|
||||||
|
public function currency_id(Expense $expense)
|
||||||
|
{
|
||||||
|
return $expense->currency ? $expense->currency->code : $expense->company->currency()->code;
|
||||||
|
}
|
||||||
|
public function date(Expense $expense)
|
||||||
|
{
|
||||||
|
return $expense->date ?? '';
|
||||||
|
}
|
||||||
|
public function exchange_rate(Expense $expense)
|
||||||
|
{
|
||||||
|
return $expense->exchange_rate ?? 0;
|
||||||
|
}
|
||||||
|
public function foreign_amount(Expense $expense)
|
||||||
|
{
|
||||||
|
return $expense->foreign_amount ?? 0;
|
||||||
|
}
|
||||||
|
public function invoice_currency_id(Expense $expense)
|
||||||
|
{
|
||||||
|
return $expense->invoice_currency ? $expense->invoice_currency->code : $expense->company->currency()->code;
|
||||||
|
}
|
||||||
|
public function payment_date(Expense $expense)
|
||||||
|
{
|
||||||
|
return $expense->payment_date ?? '';
|
||||||
|
}
|
||||||
|
public function number(Expense $expense)
|
||||||
|
{
|
||||||
|
return $expense->number ?? '';
|
||||||
|
}
|
||||||
|
public function payment_type_id(Expense $expense)
|
||||||
|
{
|
||||||
|
return $expense->payment_type ? $expense->payment_type->name : '';
|
||||||
|
}
|
||||||
|
public function private_notes(Expense $expense)
|
||||||
|
{
|
||||||
|
return $expense->private_notes ?? '';
|
||||||
|
}
|
||||||
|
public function project_id(Expense $expense)
|
||||||
|
{
|
||||||
|
return $expense->project ? $expense->project->name : '';
|
||||||
|
}
|
||||||
|
public function public_notes(Expense $expense)
|
||||||
|
{
|
||||||
|
return $expense->public_notes ?? '';
|
||||||
|
}
|
||||||
|
public function tax_amount1(Expense $expense)
|
||||||
|
{
|
||||||
|
return $expense->tax_amount1 ?? 0;
|
||||||
|
}
|
||||||
|
public function tax_amount2(Expense $expense)
|
||||||
|
{
|
||||||
|
return $expense->tax_amount2 ?? 0;
|
||||||
|
}
|
||||||
|
public function tax_amount3(Expense $expense)
|
||||||
|
{
|
||||||
|
return $expense->tax_amount3 ?? 0;
|
||||||
|
}
|
||||||
|
public function tax_name1(Expense $expense)
|
||||||
|
{
|
||||||
|
return $expense->tax_name1 ?? '';
|
||||||
|
}
|
||||||
|
public function tax_name2(Expense $expense)
|
||||||
|
{
|
||||||
|
return $expense->tax_name2 ?? '';
|
||||||
|
}
|
||||||
|
public function tax_name3(Expense $expense)
|
||||||
|
{
|
||||||
|
return $expense->tax_name3 ?? '';
|
||||||
|
}
|
||||||
|
public function tax_rate1(Expense $expense)
|
||||||
|
{
|
||||||
|
return $expense->tax_rate1 ?? 0;
|
||||||
|
}
|
||||||
|
public function tax_rate2(Expense $expense)
|
||||||
|
{
|
||||||
|
return $expense->tax_rate2 ?? 0;
|
||||||
|
}
|
||||||
|
public function tax_rate3(Expense $expense)
|
||||||
|
{
|
||||||
|
return $expense->tax_rate3 ?? 0;
|
||||||
|
}
|
||||||
|
public function transaction_reference(Expense $expense)
|
||||||
|
{
|
||||||
|
return $expense->transaction_reference ?? '';
|
||||||
|
}
|
||||||
|
public function vendor_id(Expense $expense)
|
||||||
|
{
|
||||||
|
return $expense->vendor ? $expense->vendor->name : '';
|
||||||
|
}
|
||||||
|
public function invoice_id(Expense $expense)
|
||||||
|
{
|
||||||
|
return $expense->invoice ? $expense->invoice->number : '';
|
||||||
|
}
|
||||||
|
public function user(Expense $expense)
|
||||||
|
{
|
||||||
|
return $expense->user ? $expense->user->present()->name() : '';
|
||||||
|
}
|
||||||
|
public function assigned_user(Expense $expense)
|
||||||
|
{
|
||||||
|
return $expense->assigned_user ? $expense->assigned_user->present()->name() : '';
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -11,10 +11,175 @@
|
|||||||
|
|
||||||
namespace App\Export\Decorators;
|
namespace App\Export\Decorators;
|
||||||
|
|
||||||
|
use App\Models\Invoice;
|
||||||
|
|
||||||
class InvoiceDecorator extends Decorator implements DecoratorInterface
|
class InvoiceDecorator extends Decorator implements DecoratorInterface
|
||||||
{
|
{
|
||||||
public function transform(string $key, mixed $entity): mixed
|
public function transform(string $key, mixed $entity): mixed
|
||||||
{
|
{
|
||||||
return 'Payment Decorator';
|
$invoice = false;
|
||||||
|
|
||||||
|
if($entity instanceof Invoice) {
|
||||||
|
$invoice = $entity;
|
||||||
|
} elseif($entity->invoice) {
|
||||||
|
$invoice = $entity->invoice;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if($invoice && method_exists($this, $key)) {
|
||||||
|
return $this->{$key}($invoice);
|
||||||
|
}
|
||||||
|
|
||||||
|
return '';
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public function number(Invoice $invoice)
|
||||||
|
{
|
||||||
|
return $invoice->number ?? '';
|
||||||
|
}
|
||||||
|
public function amount(Invoice $invoice)
|
||||||
|
{
|
||||||
|
return $invoice->amount ?? 0;
|
||||||
|
}
|
||||||
|
public function balance(Invoice $invoice)
|
||||||
|
{
|
||||||
|
return $invoice->balance ?? 0;
|
||||||
|
}
|
||||||
|
public function paid_to_date(Invoice $invoice)
|
||||||
|
{
|
||||||
|
return $invoice->paid_to_date ?? 0;
|
||||||
|
}
|
||||||
|
public function po_number(Invoice $invoice)
|
||||||
|
{
|
||||||
|
return $invoice->po_number ?? '';
|
||||||
|
}
|
||||||
|
public function date(Invoice $invoice)
|
||||||
|
{
|
||||||
|
return $invoice->date ?? '';
|
||||||
|
}
|
||||||
|
public function due_date(Invoice $invoice)
|
||||||
|
{
|
||||||
|
return $invoice->due_date ?? '';
|
||||||
|
}
|
||||||
|
public function terms(Invoice $invoice)
|
||||||
|
{
|
||||||
|
return $invoice->terms ?? '';
|
||||||
|
}
|
||||||
|
public function footer(Invoice $invoice)
|
||||||
|
{
|
||||||
|
return $invoice->footer ?? '';
|
||||||
|
}
|
||||||
|
public function status(Invoice $invoice)
|
||||||
|
{
|
||||||
|
return $invoice->stringStatus($invoice->status_id);
|
||||||
|
}
|
||||||
|
public function public_notes(Invoice $invoice)
|
||||||
|
{
|
||||||
|
return $invoice->public_notes ?? '';
|
||||||
|
}
|
||||||
|
public function private_notes(Invoice $invoice)
|
||||||
|
{
|
||||||
|
return $invoice->private_notes ?? '';
|
||||||
|
}
|
||||||
|
public function uses_inclusive_taxes(Invoice $invoice)
|
||||||
|
{
|
||||||
|
return $invoice->uses_inclusive_taxes ? ctrans('texts.yes') : ctrans('texts.no');
|
||||||
|
}
|
||||||
|
public function is_amount_discount(Invoice $invoice)
|
||||||
|
{
|
||||||
|
return $invoice->is_amount_discount ? ctrans('texts.yes') : ctrans('texts.no');
|
||||||
|
}
|
||||||
|
public function discount(Invoice $invoice)
|
||||||
|
{
|
||||||
|
return $invoice->discount ?? 0;
|
||||||
|
}
|
||||||
|
public function partial(Invoice $invoice)
|
||||||
|
{
|
||||||
|
return $invoice->partial ?? 0;
|
||||||
|
}
|
||||||
|
public function partial_due_date(Invoice $invoice)
|
||||||
|
{
|
||||||
|
return $invoice->partial_due_date ?? '';
|
||||||
|
}
|
||||||
|
public function custom_surcharge1(Invoice $invoice)
|
||||||
|
{
|
||||||
|
return $invoice->custom_surcharge1 ?? 0;
|
||||||
|
}
|
||||||
|
public function custom_surcharge2(Invoice $invoice)
|
||||||
|
{
|
||||||
|
return $invoice->custom_surcharge2 ?? 0;
|
||||||
|
}
|
||||||
|
public function custom_surcharge3(Invoice $invoice)
|
||||||
|
{
|
||||||
|
return $invoice->custom_surcharge3 ?? 0;
|
||||||
|
}
|
||||||
|
public function custom_surcharge4(Invoice $invoice)
|
||||||
|
{
|
||||||
|
return $invoice->custom_surcharge4 ?? 0;
|
||||||
|
}
|
||||||
|
public function exchange_rate(Invoice $invoice)
|
||||||
|
{
|
||||||
|
return $invoice->exchange_rate ?? 0;
|
||||||
|
}
|
||||||
|
public function total_taxes(Invoice $invoice)
|
||||||
|
{
|
||||||
|
return $invoice->total_taxes ?? 0;
|
||||||
|
}
|
||||||
|
public function assigned_user_id(Invoice $invoice)
|
||||||
|
{
|
||||||
|
return $invoice->assigned_user ? $invoice->assigned_user->present()->name(): '';
|
||||||
|
}
|
||||||
|
public function user_id(Invoice $invoice)
|
||||||
|
{
|
||||||
|
return $invoice->user ? $invoice->user->present()->name(): '';
|
||||||
|
}
|
||||||
|
public function custom_value1(Invoice $invoice)
|
||||||
|
{
|
||||||
|
return $invoice->custom_value1 ?? '';
|
||||||
|
}
|
||||||
|
public function custom_value2(Invoice $invoice)
|
||||||
|
{
|
||||||
|
return $invoice->custom_value2 ?? '';
|
||||||
|
}
|
||||||
|
public function custom_value3(Invoice $invoice)
|
||||||
|
{
|
||||||
|
return $invoice->custom_value3 ?? '';
|
||||||
|
}
|
||||||
|
public function custom_value4(Invoice $invoice)
|
||||||
|
{
|
||||||
|
return $invoice->custom_value4 ?? '';
|
||||||
|
}
|
||||||
|
public function tax_name1(Invoice $invoice)
|
||||||
|
{
|
||||||
|
return $invoice->tax_name1 ?? '';
|
||||||
|
}
|
||||||
|
public function tax_name2(Invoice $invoice)
|
||||||
|
{
|
||||||
|
return $invoice->tax_name2 ?? '';
|
||||||
|
}
|
||||||
|
public function tax_name3(Invoice $invoice)
|
||||||
|
{
|
||||||
|
return $invoice->tax_name3 ?? '';
|
||||||
|
}
|
||||||
|
public function tax_rate1(Invoice $invoice)
|
||||||
|
{
|
||||||
|
return $invoice->tax_rate1 ?? 0;
|
||||||
|
}
|
||||||
|
public function tax_rate2(Invoice $invoice)
|
||||||
|
{
|
||||||
|
return $invoice->tax_rate2 ?? 0;
|
||||||
|
}
|
||||||
|
public function tax_rate3(Invoice $invoice)
|
||||||
|
{
|
||||||
|
return $invoice->tax_rate3 ?? 0;
|
||||||
|
}
|
||||||
|
public function recurring_id(Invoice $invoice)
|
||||||
|
{
|
||||||
|
return $invoice->recurring_invoice ? $invoice->recurring_invoice->number : '';
|
||||||
|
}
|
||||||
|
public function auto_bill_enabled(Invoice $invoice)
|
||||||
|
{
|
||||||
|
return $invoice->auto_bill_enabled ? ctrans('texts.yes') : ctrans('texts.no');
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -13,7 +13,8 @@ namespace App\Export\Decorators;
|
|||||||
|
|
||||||
use App\Models\Payment;
|
use App\Models\Payment;
|
||||||
|
|
||||||
class PaymentDecorator extends Decorator implements DecoratorInterface{
|
class PaymentDecorator extends Decorator implements DecoratorInterface
|
||||||
|
{
|
||||||
|
|
||||||
private $entity_key = 'payment';
|
private $entity_key = 'payment';
|
||||||
|
|
||||||
@ -23,18 +24,15 @@ class PaymentDecorator extends Decorator implements DecoratorInterface{
|
|||||||
|
|
||||||
if($entity instanceof Payment) {
|
if($entity instanceof Payment) {
|
||||||
$payment = $entity;
|
$payment = $entity;
|
||||||
}
|
} elseif($entity->payment) {
|
||||||
elseif($entity->payment) {
|
|
||||||
$payment = $entity->payment;
|
$payment = $entity->payment;
|
||||||
}
|
}
|
||||||
|
|
||||||
if($key == 'amount' && (!$entity instanceof Payment)) {
|
if($key == 'amount' && (!$entity instanceof Payment)) {
|
||||||
return $entity->payments()->exists() ? $entity->payments()->withoutTrashed()->sum('paymentables.amount') : ctrans('texts.unpaid');
|
return $entity->payments()->exists() ? $entity->payments()->withoutTrashed()->sum('paymentables.amount') : ctrans('texts.unpaid');
|
||||||
}
|
} elseif($key == 'refunded' && (!$entity instanceof Payment)) {
|
||||||
elseif($key == 'refunded' && (!$entity instanceof Payment)) {
|
|
||||||
return $entity->payments()->exists() ? $entity->payments()->withoutTrashed()->sum('paymentables.refunded') : '';
|
return $entity->payments()->exists() ? $entity->payments()->withoutTrashed()->sum('paymentables.refunded') : '';
|
||||||
}
|
} elseif($key == 'applied' && (!$entity instanceof Payment)) {
|
||||||
elseif($key == 'applied' && (!$entity instanceof Payment)) {
|
|
||||||
$refunded = $entity->payments()->withoutTrashed()->sum('paymentables.refunded');
|
$refunded = $entity->payments()->withoutTrashed()->sum('paymentables.refunded');
|
||||||
$amount = $entity->payments()->withoutTrashed()->sum('paymentables.amount');
|
$amount = $entity->payments()->withoutTrashed()->sum('paymentables.amount');
|
||||||
return $entity->payments()->withoutTrashed()->exists() ? ($amount - $refunded) : '';
|
return $entity->payments()->withoutTrashed()->exists() ? ($amount - $refunded) : '';
|
||||||
@ -47,95 +45,118 @@ class PaymentDecorator extends Decorator implements DecoratorInterface{
|
|||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
public function date(Payment $payment) {
|
public function date(Payment $payment)
|
||||||
|
{
|
||||||
return $payment->date ?? '';
|
return $payment->date ?? '';
|
||||||
}
|
}
|
||||||
|
|
||||||
public function amount(Payment $payment) {
|
public function amount(Payment $payment)
|
||||||
|
{
|
||||||
return $payment->amount ?? '';
|
return $payment->amount ?? '';
|
||||||
}
|
}
|
||||||
|
|
||||||
public function refunded(Payment $payment) {
|
public function refunded(Payment $payment)
|
||||||
|
{
|
||||||
return $payment->refunded ?? '';
|
return $payment->refunded ?? '';
|
||||||
}
|
}
|
||||||
|
|
||||||
public function applied(Payment $payment) {
|
public function applied(Payment $payment)
|
||||||
|
{
|
||||||
return $payment->applied ?? '';
|
return $payment->applied ?? '';
|
||||||
}
|
}
|
||||||
public function transaction_reference(Payment $payment) {
|
public function transaction_reference(Payment $payment)
|
||||||
|
{
|
||||||
return $payment->transaction_reference ?? '';
|
return $payment->transaction_reference ?? '';
|
||||||
}
|
}
|
||||||
public function currency(Payment $payment) {
|
public function currency(Payment $payment)
|
||||||
|
{
|
||||||
return $payment->currency()->exists() ? $payment->currency->code : $payment->company->currency()->code;
|
return $payment->currency()->exists() ? $payment->currency->code : $payment->company->currency()->code;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function exchange_rate(Payment $payment) {
|
public function exchange_rate(Payment $payment)
|
||||||
|
{
|
||||||
return $payment->exchange_rate ?? 1;
|
return $payment->exchange_rate ?? 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function number(Payment $payment) {
|
public function number(Payment $payment)
|
||||||
|
{
|
||||||
return $payment->number ?? '';
|
return $payment->number ?? '';
|
||||||
}
|
}
|
||||||
|
|
||||||
public function method(Payment $payment) {
|
public function method(Payment $payment)
|
||||||
|
{
|
||||||
return $payment->translatedType();
|
return $payment->translatedType();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function status(Payment $payment) {
|
public function status(Payment $payment)
|
||||||
|
{
|
||||||
return $payment->stringStatus($payment->status_id);
|
return $payment->stringStatus($payment->status_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function private_notes(Payment $payment) {
|
public function private_notes(Payment $payment)
|
||||||
|
{
|
||||||
return strip_tags($payment->private_notes) ?? '';
|
return strip_tags($payment->private_notes) ?? '';
|
||||||
}
|
}
|
||||||
|
|
||||||
public function custom_value1(Payment $payment) {
|
public function custom_value1(Payment $payment)
|
||||||
|
{
|
||||||
return $payment->custom_value1 ?? '';
|
return $payment->custom_value1 ?? '';
|
||||||
}
|
}
|
||||||
|
|
||||||
public function custom_value2(Payment $payment) {
|
public function custom_value2(Payment $payment)
|
||||||
|
{
|
||||||
return $payment->custom_value2 ?? '';
|
return $payment->custom_value2 ?? '';
|
||||||
}
|
}
|
||||||
|
|
||||||
public function custom_value3(Payment $payment) {
|
public function custom_value3(Payment $payment)
|
||||||
|
{
|
||||||
return $payment->custom_value3 ?? '';
|
return $payment->custom_value3 ?? '';
|
||||||
}
|
}
|
||||||
|
|
||||||
public function custom_value4(Payment $payment) {
|
public function custom_value4(Payment $payment)
|
||||||
|
{
|
||||||
return $payment->custom_value4 ?? '';
|
return $payment->custom_value4 ?? '';
|
||||||
}
|
}
|
||||||
|
|
||||||
public function user_id(Payment $payment) {
|
public function user_id(Payment $payment)
|
||||||
|
{
|
||||||
return $payment->user ? $payment->user->present()->name() : '';
|
return $payment->user ? $payment->user->present()->name() : '';
|
||||||
}
|
}
|
||||||
|
|
||||||
public function assigned_user_id(Payment $payment) {
|
public function assigned_user_id(Payment $payment)
|
||||||
|
{
|
||||||
return $payment->assigned_user ? $payment->assigned_user->present()->name() : '';
|
return $payment->assigned_user ? $payment->assigned_user->present()->name() : '';
|
||||||
}
|
}
|
||||||
|
|
||||||
public function project_id(Payment $payment) {
|
public function project_id(Payment $payment)
|
||||||
|
{
|
||||||
return $payment->project()->exists() ? $payment->project->name : '';
|
return $payment->project()->exists() ? $payment->project->name : '';
|
||||||
}
|
}
|
||||||
|
|
||||||
///////////////////////////////////////////////////
|
///////////////////////////////////////////////////
|
||||||
|
|
||||||
public function vendor_id(Payment $payment){
|
public function vendor_id(Payment $payment)
|
||||||
|
{
|
||||||
return $payment->vendor()->exists() ? $payment->vendor->name : '';
|
return $payment->vendor()->exists() ? $payment->vendor->name : '';
|
||||||
}
|
}
|
||||||
|
|
||||||
public function exchange_currency(Payment $payment){
|
public function exchange_currency(Payment $payment)
|
||||||
|
{
|
||||||
return $payment->exchange_currency()->exists() ? $payment->exchange_currency->code : '';
|
return $payment->exchange_currency()->exists() ? $payment->exchange_currency->code : '';
|
||||||
}
|
}
|
||||||
|
|
||||||
public function gateway_type_id(Payment $payment) {
|
public function gateway_type_id(Payment $payment)
|
||||||
|
{
|
||||||
return $payment->gateway_type ? $payment->gateway_type->name : 'Unknown Type';
|
return $payment->gateway_type ? $payment->gateway_type->name : 'Unknown Type';
|
||||||
}
|
}
|
||||||
|
|
||||||
public function client_id(Payment $payment) {
|
public function client_id(Payment $payment)
|
||||||
|
{
|
||||||
return $payment->client->present()->name();
|
return $payment->client->present()->name();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function type_id(Payment $payment) {
|
public function type_id(Payment $payment)
|
||||||
|
{
|
||||||
return $payment->translatedType();
|
return $payment->translatedType();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -11,10 +11,60 @@
|
|||||||
|
|
||||||
namespace App\Export\Decorators;
|
namespace App\Export\Decorators;
|
||||||
|
|
||||||
|
use App\Models\Product;
|
||||||
|
|
||||||
class ProductDecorator implements DecoratorInterface
|
class ProductDecorator implements DecoratorInterface
|
||||||
{
|
{
|
||||||
public function transform(string $key, mixed $entity): mixed
|
public function transform(string $key, mixed $entity): mixed
|
||||||
{
|
{
|
||||||
return 'Payment Decorator';
|
$product = false;
|
||||||
|
|
||||||
|
if($entity instanceof Product) {
|
||||||
|
$product = $entity;
|
||||||
|
} elseif($entity->product) {
|
||||||
|
$product = $entity->product;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if($product && method_exists($this, $key)) {
|
||||||
|
return $this->{$key}($product);
|
||||||
|
} elseif($product->{$key}) {
|
||||||
|
return $product->{$key} ?? '';
|
||||||
|
}
|
||||||
|
|
||||||
|
return '';
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
public const PRODUCT_TYPE_PHYSICAL = 1;
|
||||||
|
public const PRODUCT_TYPE_SERVICE = 2;
|
||||||
|
public const PRODUCT_TYPE_DIGITAL = 3;
|
||||||
|
public const PRODUCT_TYPE_SHIPPING = 4;
|
||||||
|
public const PRODUCT_TYPE_EXEMPT = 5;
|
||||||
|
public const PRODUCT_TYPE_REDUCED_TAX = 6;
|
||||||
|
public const PRODUCT_TYPE_OVERRIDE_TAX = 7;
|
||||||
|
public const PRODUCT_TYPE_ZERO_RATED = 8;
|
||||||
|
public const PRODUCT_TYPE_REVERSE_TAX = 9;
|
||||||
|
*/
|
||||||
|
public function tax_category(Product $product)
|
||||||
|
{
|
||||||
|
|
||||||
|
$category = ctrans('texts.physical_goods');
|
||||||
|
|
||||||
|
match($product->tax_id) {
|
||||||
|
1 => $category = ctrans('texts.physical_goods'),
|
||||||
|
2 => $category = ctrans('texts.services'),
|
||||||
|
3 => $category = ctrans('texts.digital_products'),
|
||||||
|
4 => $category = ctrans('texts.shipping'),
|
||||||
|
5 => $category = ctrans('texts.tax_exempt'),
|
||||||
|
6 => $category = ctrans('texts.reduced_tax'),
|
||||||
|
7 => $category = ctrans('texts.override_tax'),
|
||||||
|
8 => $category = ctrans('texts.zero_rated'),
|
||||||
|
9 => $category = ctrans('texts.reverse_tax'),
|
||||||
|
default => $category = ctrans('texts.physical_goods'),
|
||||||
|
};
|
||||||
|
|
||||||
|
return $category;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -11,10 +11,38 @@
|
|||||||
|
|
||||||
namespace App\Export\Decorators;
|
namespace App\Export\Decorators;
|
||||||
|
|
||||||
|
use App\Models\PurchaseOrder;
|
||||||
|
|
||||||
class PurchaseOrderDecorator extends Decorator implements DecoratorInterface
|
class PurchaseOrderDecorator extends Decorator implements DecoratorInterface
|
||||||
{
|
{
|
||||||
public function transform(string $key, mixed $entity): mixed
|
public function transform(string $key, mixed $entity): mixed
|
||||||
{
|
{
|
||||||
return 'Payment Decorator';
|
$purchase_order = false;
|
||||||
|
|
||||||
|
if($entity instanceof PurchaseOrder) {
|
||||||
|
$purchase_order = $entity;
|
||||||
|
} elseif($entity->purchase_order) {
|
||||||
|
$purchase_order = $entity->purchase_order;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if($purchase_order && method_exists($this, $key)) {
|
||||||
|
return $this->{$key}($purchase_order);
|
||||||
|
} elseif($purchase_order->{$key}) {
|
||||||
|
return $purchase_order->{$key} ?? '';
|
||||||
|
}
|
||||||
|
|
||||||
|
return '';
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public function status(PurchaseOrder $purchase_order)
|
||||||
|
{
|
||||||
|
return $purchase_order->stringStatus($purchase_order->status_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function currency_id(PurchaseOrder $purchase_order)
|
||||||
|
{
|
||||||
|
return $purchase_order->currency ? $purchase_order->currency->code : $purchase_order->company->currency()->code;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -11,10 +11,53 @@
|
|||||||
|
|
||||||
namespace App\Export\Decorators;
|
namespace App\Export\Decorators;
|
||||||
|
|
||||||
|
use App\Models\Quote;
|
||||||
|
|
||||||
class QuoteDecorator extends Decorator implements DecoratorInterface
|
class QuoteDecorator extends Decorator implements DecoratorInterface
|
||||||
{
|
{
|
||||||
public function transform(string $key, mixed $entity): mixed
|
public function transform(string $key, mixed $entity): mixed
|
||||||
{
|
{
|
||||||
return 'Payment Decorator';
|
$quote = false;
|
||||||
|
|
||||||
|
if($entity instanceof Quote) {
|
||||||
|
$quote = $entity;
|
||||||
|
} elseif($entity->quote) {
|
||||||
|
$quote = $entity->quote;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if($quote && method_exists($this, $key)) {
|
||||||
|
return $this->{$key}($quote);
|
||||||
|
} elseif($quote->{$key}) {
|
||||||
|
return $quote->{$key} ?? '';
|
||||||
|
}
|
||||||
|
|
||||||
|
return '';
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public function status(Quote $quote)
|
||||||
|
{
|
||||||
|
return $quote->stringStatus($quote->status_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function uses_inclusive_taxes(Quote $quote)
|
||||||
|
{
|
||||||
|
return $quote->uses_inclusive_taxes ? ctrans('texts.yes') : ctrans('texts.no');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function is_amount_discount(Quote $quote)
|
||||||
|
{
|
||||||
|
return $quote->is_amount_discount ? ctrans('texts.yes') : ctrans('texts.no');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function assigned_user_id(Quote $quote)
|
||||||
|
{
|
||||||
|
return $quote->assigned_user ? $quote->assigned_user->present()->name() : '';
|
||||||
|
}
|
||||||
|
|
||||||
|
public function user_id(Quote $quote)
|
||||||
|
{
|
||||||
|
return $quote->user->present()->name();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -11,10 +11,68 @@
|
|||||||
|
|
||||||
namespace App\Export\Decorators;
|
namespace App\Export\Decorators;
|
||||||
|
|
||||||
|
use App\Models\RecurringInvoice;
|
||||||
|
|
||||||
class RecurringInvoiceDecorator extends Decorator implements DecoratorInterface
|
class RecurringInvoiceDecorator extends Decorator implements DecoratorInterface
|
||||||
{
|
{
|
||||||
public function transform(string $key, mixed $entity): mixed
|
public function transform(string $key, mixed $entity): mixed
|
||||||
{
|
{
|
||||||
return 'Payment Decorator';
|
$recurring_invoice = false;
|
||||||
|
|
||||||
|
if($entity instanceof RecurringInvoice) {
|
||||||
|
$recurring_invoice = $entity;
|
||||||
|
} elseif($entity->recurring_invoice) {
|
||||||
|
$recurring_invoice = $entity->recurring_invoice;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if($recurring_invoice && method_exists($this, $key)) {
|
||||||
|
return $this->{$key}($recurring_invoice);
|
||||||
|
} elseif($recurring_invoice->{$key}) {
|
||||||
|
return $recurring_invoice->{$key} ?? '';
|
||||||
|
}
|
||||||
|
|
||||||
|
return '';
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public function status(RecurringInvoice $recurring_invoice)
|
||||||
|
{
|
||||||
|
return $recurring_invoice->stringStatus($recurring_invoice->status_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function uses_inclusive_taxes(RecurringInvoice $recurring_invoice)
|
||||||
|
{
|
||||||
|
return $recurring_invoice->uses_inclusive_taxes ? ctrans('texts.yes') : ctrans('texts.no');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function is_amount_discount(RecurringInvoice $recurring_invoice)
|
||||||
|
{
|
||||||
|
return $recurring_invoice->is_amount_discount ? ctrans('texts.yes') : ctrans('texts.no');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function assigned_user_id(RecurringInvoice $recurring_invoice)
|
||||||
|
{
|
||||||
|
return $recurring_invoice->assigned_user ? $recurring_invoice->assigned_user->present()->name() : '';
|
||||||
|
}
|
||||||
|
|
||||||
|
public function user_id(RecurringInvoice $recurring_invoice)
|
||||||
|
{
|
||||||
|
return $recurring_invoice->user->present()->name() ?? '';
|
||||||
|
}
|
||||||
|
|
||||||
|
public function frequency_id(RecurringInvoice $recurring_invoice)
|
||||||
|
{
|
||||||
|
return $recurring_invoice->frequency_id ? $recurring_invoice->frequencyForKey($recurring_invoice->frequency_id) : '';
|
||||||
|
}
|
||||||
|
|
||||||
|
public function auto_bill(RecurringInvoice $recurring_invoice)
|
||||||
|
{
|
||||||
|
return $recurring_invoice->auto_bill ? ctrans("texts.{$recurring_invoice->auto_bill}") : '';
|
||||||
|
}
|
||||||
|
|
||||||
|
public function auto_bill_enabled(RecurringInvoice $recurring_invoice)
|
||||||
|
{
|
||||||
|
return $recurring_invoice->auto_bill_enabled ? ctrans('texts.yes') : ctrans('texts.no');
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -11,10 +11,104 @@
|
|||||||
|
|
||||||
namespace App\Export\Decorators;
|
namespace App\Export\Decorators;
|
||||||
|
|
||||||
|
use App\Models\DateFormat;
|
||||||
|
use App\Models\Task;
|
||||||
|
use App\Models\Timezone;
|
||||||
|
use Carbon\Carbon;
|
||||||
|
|
||||||
class TaskDecorator extends Decorator implements DecoratorInterface
|
class TaskDecorator extends Decorator implements DecoratorInterface
|
||||||
{
|
{
|
||||||
public function transform(string $key, mixed $entity): mixed
|
public function transform(string $key, mixed $entity): mixed
|
||||||
{
|
{
|
||||||
return 'Payment Decorator';
|
$task = false;
|
||||||
|
|
||||||
|
if($entity instanceof Task) {
|
||||||
|
$task = $entity;
|
||||||
|
} elseif($entity->task) {
|
||||||
|
$task = $entity->task;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if($task && method_exists($this, $key)) {
|
||||||
|
return $this->{$key}($task);
|
||||||
|
} elseif($task->{$key}) {
|
||||||
|
return $task->{$key} ?? '';
|
||||||
|
}
|
||||||
|
|
||||||
|
return '';
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public function start_date(Task $task)
|
||||||
|
{
|
||||||
|
|
||||||
|
$timezone = Timezone::find($task->company->settings->timezone_id);
|
||||||
|
$timezone_name = 'US/Eastern';
|
||||||
|
|
||||||
|
if ($timezone) {
|
||||||
|
$timezone_name = $timezone->name;
|
||||||
|
}
|
||||||
|
|
||||||
|
$logs = json_decode($task->time_log, 1);
|
||||||
|
|
||||||
|
$date_format_default = 'Y-m-d';
|
||||||
|
|
||||||
|
$date_format = DateFormat::find($task->company->settings->date_format_id);
|
||||||
|
|
||||||
|
if ($date_format) {
|
||||||
|
$date_format_default = $date_format->format;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(is_array($logs)) {
|
||||||
|
$item = $logs[0];
|
||||||
|
return Carbon::createFromTimeStamp($item[0])->setTimezone($timezone_name)->format($date_format_default);
|
||||||
|
}
|
||||||
|
|
||||||
|
return '';
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public function end_date(Task $task)
|
||||||
|
{
|
||||||
|
|
||||||
|
$timezone = Timezone::find($task->company->settings->timezone_id);
|
||||||
|
$timezone_name = 'US/Eastern';
|
||||||
|
|
||||||
|
if ($timezone) {
|
||||||
|
$timezone_name = $timezone->name;
|
||||||
|
}
|
||||||
|
|
||||||
|
$logs = json_decode($task->time_log, 1);
|
||||||
|
|
||||||
|
$date_format_default = 'Y-m-d';
|
||||||
|
|
||||||
|
$date_format = DateFormat::find($task->company->settings->date_format_id);
|
||||||
|
|
||||||
|
if ($date_format) {
|
||||||
|
$date_format_default = $date_format->format;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(is_array($logs)) {
|
||||||
|
$item = $logs[1];
|
||||||
|
return Carbon::createFromTimeStamp($item[1])->setTimezone($timezone_name)->format($date_format_default);
|
||||||
|
}
|
||||||
|
|
||||||
|
return '';
|
||||||
|
|
||||||
|
}
|
||||||
|
public function duration(Task $task)
|
||||||
|
{
|
||||||
|
return $task->calcDuration();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function status_id(Task $task)
|
||||||
|
{
|
||||||
|
return $task->status()->exists() ? $task->status->name : '';
|
||||||
|
}
|
||||||
|
|
||||||
|
public function project_id(Task $task)
|
||||||
|
{
|
||||||
|
return $task->project()->exists() ? $task->project->name : '';
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -11,10 +11,29 @@
|
|||||||
|
|
||||||
namespace App\Export\Decorators;
|
namespace App\Export\Decorators;
|
||||||
|
|
||||||
|
use App\Models\VendorContact;
|
||||||
|
|
||||||
class VendorContactDecorator implements DecoratorInterface
|
class VendorContactDecorator implements DecoratorInterface
|
||||||
{
|
{
|
||||||
public function transform(string $key, mixed $entity): mixed
|
public function transform(string $key, mixed $entity): mixed
|
||||||
{
|
{
|
||||||
return 'Payment Decorator';
|
$contact = false;
|
||||||
|
|
||||||
|
if($entity instanceof VendorContact) {
|
||||||
|
$contact = $entity;
|
||||||
|
} elseif($entity->contacts) {
|
||||||
|
$contact = $entity->contacts()->first();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if($contact && method_exists($this, $key)) {
|
||||||
|
return $this->{$key}($contact);
|
||||||
|
} elseif($contact->{$key}) {
|
||||||
|
return $contact->{$key} ?? '';
|
||||||
|
}
|
||||||
|
|
||||||
|
return '';
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -11,10 +11,61 @@
|
|||||||
|
|
||||||
namespace App\Export\Decorators;
|
namespace App\Export\Decorators;
|
||||||
|
|
||||||
|
use App\Models\Vendor;
|
||||||
|
|
||||||
class VendorDecorator extends Decorator implements DecoratorInterface
|
class VendorDecorator extends Decorator implements DecoratorInterface
|
||||||
{
|
{
|
||||||
public function transform(string $key, mixed $entity): mixed
|
public function transform(string $key, mixed $entity): mixed
|
||||||
{
|
{
|
||||||
return 'Payment Decorator';
|
$vendor = false;
|
||||||
|
|
||||||
|
if($entity instanceof Vendor) {
|
||||||
|
$vendor = $entity;
|
||||||
|
} elseif($entity->vendor) {
|
||||||
|
$vendor = $entity->vendor;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if($vendor && method_exists($this, $key)) {
|
||||||
|
return $this->{$key}($vendor);
|
||||||
|
} elseif($vendor->{$key}) {
|
||||||
|
return $vendor->{$key} ?? '';
|
||||||
|
}
|
||||||
|
|
||||||
|
return '';
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public function country_id(Vendor $vendor)
|
||||||
|
{
|
||||||
|
return $vendor->country ? $vendor->country->name : '';
|
||||||
|
}
|
||||||
|
|
||||||
|
public function name(Vendor $vendor)
|
||||||
|
{
|
||||||
|
return $vendor->present()->name();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function currency(Vendor $vendor)
|
||||||
|
{
|
||||||
|
return $vendor->currency_id ? $vendor->currency()->code : $vendor->company->currency()->code;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function classification(Vendor $vendor)
|
||||||
|
{
|
||||||
|
ctrans("texts.{$vendor->classification}") ?? '';
|
||||||
|
}
|
||||||
|
|
||||||
|
public function status(Vendor $vendor)
|
||||||
|
{
|
||||||
|
if ($vendor->is_deleted) {
|
||||||
|
return ctrans('texts.deleted');
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($vendor->deleted_at) {
|
||||||
|
return ctrans('texts.archived');
|
||||||
|
}
|
||||||
|
|
||||||
|
return ctrans('texts.active');
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -11,13 +11,13 @@
|
|||||||
|
|
||||||
namespace App\Factory;
|
namespace App\Factory;
|
||||||
|
|
||||||
use App\Utils\Ninja;
|
|
||||||
use App\Models\Company;
|
|
||||||
use App\Libraries\MultiDB;
|
|
||||||
use App\Utils\Traits\MakesHash;
|
|
||||||
use App\DataMapper\Tax\TaxModel;
|
|
||||||
use App\DataMapper\CompanySettings;
|
|
||||||
use App\DataMapper\ClientRegistrationFields;
|
use App\DataMapper\ClientRegistrationFields;
|
||||||
|
use App\DataMapper\CompanySettings;
|
||||||
|
use App\DataMapper\Tax\TaxModel;
|
||||||
|
use App\Libraries\MultiDB;
|
||||||
|
use App\Models\Company;
|
||||||
|
use App\Utils\Ninja;
|
||||||
|
use App\Utils\Traits\MakesHash;
|
||||||
|
|
||||||
class CompanyFactory
|
class CompanyFactory
|
||||||
{
|
{
|
||||||
|
@ -97,6 +97,16 @@ class TaskFilters extends QueryFilters
|
|||||||
return $this->builder->where('project_id', $this->decodePrimaryKey($project));
|
return $this->builder->where('project_id', $this->decodePrimaryKey($project));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function hash(string $hash = ''): Builder
|
||||||
|
{
|
||||||
|
if (strlen($hash) == 0) {
|
||||||
|
return $this->builder;
|
||||||
|
}
|
||||||
|
|
||||||
|
return $this->builder->where('hash', $hash);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
public function number(string $number = ''): Builder
|
public function number(string $number = ''): Builder
|
||||||
{
|
{
|
||||||
if (strlen($number) == 0) {
|
if (strlen($number) == 0) {
|
||||||
|
@ -529,8 +529,7 @@ class LoginController extends BaseController
|
|||||||
$user = $google->getTokenResponse(request()->input('id_token'));
|
$user = $google->getTokenResponse(request()->input('id_token'));
|
||||||
} elseif(request()->has('access_token')) {
|
} elseif(request()->has('access_token')) {
|
||||||
$user = $google->harvestUser(request()->input('access_token'));
|
$user = $google->harvestUser(request()->input('access_token'));
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
return response()->json(['message' => 'Illegal request'], 403);
|
return response()->json(['message' => 'Illegal request'], 403);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -928,7 +928,11 @@ class BaseController extends Controller
|
|||||||
} //allows us to selective display bank integrations back to the user if they can view / create bank transactions but without the bank balance being present in the response
|
} //allows us to selective display bank integrations back to the user if they can view / create bank transactions but without the bank balance being present in the response
|
||||||
elseif($this->entity_type == TaxRate::class && $user->hasIntersectPermissions(['create_invoice','edit_invoice','create_quote','edit_quote','create_purchase_order','edit_purchase_order'])) {
|
elseif($this->entity_type == TaxRate::class && $user->hasIntersectPermissions(['create_invoice','edit_invoice','create_quote','edit_quote','create_purchase_order','edit_purchase_order'])) {
|
||||||
// need to show tax rates if the user has the ability to create documents.
|
// need to show tax rates if the user has the ability to create documents.
|
||||||
} else {
|
}
|
||||||
|
elseif($this->entity_type == ExpenseCategory::class && $user->hasPermission('create_expense')) {
|
||||||
|
// need to show expense categories if the user has the ability to create expenses.
|
||||||
|
}
|
||||||
|
else {
|
||||||
$query->where('user_id', '=', $user->id);
|
$query->where('user_id', '=', $user->id);
|
||||||
}
|
}
|
||||||
} elseif (in_array($this->entity_type, [Design::class, GroupSetting::class, PaymentTerm::class, TaskStatus::class])) {
|
} elseif (in_array($this->entity_type, [Design::class, GroupSetting::class, PaymentTerm::class, TaskStatus::class])) {
|
||||||
|
@ -11,37 +11,37 @@
|
|||||||
|
|
||||||
namespace App\Http\Controllers;
|
namespace App\Http\Controllers;
|
||||||
|
|
||||||
use App\Utils\Ninja;
|
|
||||||
use App\Models\Client;
|
|
||||||
use App\Models\Account;
|
|
||||||
use App\Models\Company;
|
|
||||||
use App\Models\SystemLog;
|
|
||||||
use Postmark\PostmarkClient;
|
|
||||||
use Illuminate\Http\Response;
|
|
||||||
use App\Factory\ClientFactory;
|
|
||||||
use App\Filters\ClientFilters;
|
|
||||||
use App\Utils\Traits\MakesHash;
|
|
||||||
use App\Utils\Traits\Uploadable;
|
|
||||||
use App\Utils\Traits\BulkOptions;
|
|
||||||
use App\Jobs\Client\UpdateTaxData;
|
|
||||||
use App\Utils\Traits\SavesDocuments;
|
|
||||||
use App\Repositories\ClientRepository;
|
|
||||||
use App\Events\Client\ClientWasCreated;
|
use App\Events\Client\ClientWasCreated;
|
||||||
use App\Events\Client\ClientWasUpdated;
|
use App\Events\Client\ClientWasUpdated;
|
||||||
use App\Transformers\ClientTransformer;
|
use App\Factory\ClientFactory;
|
||||||
use Illuminate\Support\Facades\Storage;
|
use App\Filters\ClientFilters;
|
||||||
use App\Services\Template\TemplateAction;
|
|
||||||
use App\Jobs\PostMark\ProcessPostmarkWebhook;
|
|
||||||
use App\Http\Requests\Client\BulkClientRequest;
|
use App\Http\Requests\Client\BulkClientRequest;
|
||||||
use App\Http\Requests\Client\EditClientRequest;
|
|
||||||
use App\Http\Requests\Client\ShowClientRequest;
|
|
||||||
use App\Http\Requests\Client\PurgeClientRequest;
|
|
||||||
use App\Http\Requests\Client\StoreClientRequest;
|
|
||||||
use App\Http\Requests\Client\CreateClientRequest;
|
use App\Http\Requests\Client\CreateClientRequest;
|
||||||
|
use App\Http\Requests\Client\DestroyClientRequest;
|
||||||
|
use App\Http\Requests\Client\EditClientRequest;
|
||||||
|
use App\Http\Requests\Client\PurgeClientRequest;
|
||||||
|
use App\Http\Requests\Client\ReactivateClientEmailRequest;
|
||||||
|
use App\Http\Requests\Client\ShowClientRequest;
|
||||||
|
use App\Http\Requests\Client\StoreClientRequest;
|
||||||
use App\Http\Requests\Client\UpdateClientRequest;
|
use App\Http\Requests\Client\UpdateClientRequest;
|
||||||
use App\Http\Requests\Client\UploadClientRequest;
|
use App\Http\Requests\Client\UploadClientRequest;
|
||||||
use App\Http\Requests\Client\DestroyClientRequest;
|
use App\Jobs\Client\UpdateTaxData;
|
||||||
use App\Http\Requests\Client\ReactivateClientEmailRequest;
|
use App\Jobs\PostMark\ProcessPostmarkWebhook;
|
||||||
|
use App\Models\Account;
|
||||||
|
use App\Models\Client;
|
||||||
|
use App\Models\Company;
|
||||||
|
use App\Models\SystemLog;
|
||||||
|
use App\Repositories\ClientRepository;
|
||||||
|
use App\Services\Template\TemplateAction;
|
||||||
|
use App\Transformers\ClientTransformer;
|
||||||
|
use App\Utils\Ninja;
|
||||||
|
use App\Utils\Traits\BulkOptions;
|
||||||
|
use App\Utils\Traits\MakesHash;
|
||||||
|
use App\Utils\Traits\SavesDocuments;
|
||||||
|
use App\Utils\Traits\Uploadable;
|
||||||
|
use Illuminate\Http\Response;
|
||||||
|
use Illuminate\Support\Facades\Storage;
|
||||||
|
use Postmark\PostmarkClient;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class ClientController.
|
* Class ClientController.
|
||||||
|
@ -30,7 +30,6 @@ use Illuminate\Contracts\View\Factory;
|
|||||||
use Illuminate\Http\RedirectResponse;
|
use Illuminate\Http\RedirectResponse;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
use Illuminate\Support\Facades\Cache;
|
use Illuminate\Support\Facades\Cache;
|
||||||
use Illuminate\Support\Facades\Storage;
|
|
||||||
use Illuminate\View\View;
|
use Illuminate\View\View;
|
||||||
|
|
||||||
class InvoiceController extends Controller
|
class InvoiceController extends Controller
|
||||||
|
@ -206,11 +206,11 @@ class CompanyGatewayController extends BaseController
|
|||||||
|
|
||||||
$fees_and_limits = $company_gateway->fees_and_limits;
|
$fees_and_limits = $company_gateway->fees_and_limits;
|
||||||
|
|
||||||
foreach($gateway_types as $key => $gateway_type)
|
foreach($gateway_types as $key => $gateway_type) {
|
||||||
{
|
if(!property_exists($fees_and_limits, $key)) {
|
||||||
if(!property_exists($fees_and_limits, $key))
|
|
||||||
$fees_and_limits->{$key} = new FeesAndLimits;
|
$fees_and_limits->{$key} = new FeesAndLimits;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$company_gateway->fees_and_limits = $fees_and_limits;
|
$company_gateway->fees_and_limits = $fees_and_limits;
|
||||||
$company_gateway->save();
|
$company_gateway->save();
|
||||||
|
@ -11,36 +11,36 @@
|
|||||||
|
|
||||||
namespace App\Http\Controllers;
|
namespace App\Http\Controllers;
|
||||||
|
|
||||||
use App\Utils\Ninja;
|
|
||||||
use App\Models\Client;
|
|
||||||
use App\Models\Credit;
|
|
||||||
use App\Models\Account;
|
|
||||||
use App\Models\Invoice;
|
|
||||||
use Illuminate\Http\Response;
|
|
||||||
use App\Factory\CreditFactory;
|
|
||||||
use App\Filters\CreditFilters;
|
|
||||||
use App\Jobs\Credit\ZipCredits;
|
|
||||||
use App\Utils\Traits\MakesHash;
|
|
||||||
use App\Jobs\Entity\EmailEntity;
|
|
||||||
use App\Factory\CloneCreditFactory;
|
|
||||||
use App\Services\PdfMaker\PdfMerge;
|
|
||||||
use Illuminate\Support\Facades\App;
|
|
||||||
use App\Utils\Traits\SavesDocuments;
|
|
||||||
use App\Repositories\CreditRepository;
|
|
||||||
use App\Events\Credit\CreditWasCreated;
|
use App\Events\Credit\CreditWasCreated;
|
||||||
use App\Events\Credit\CreditWasUpdated;
|
use App\Events\Credit\CreditWasUpdated;
|
||||||
use App\Transformers\CreditTransformer;
|
use App\Factory\CloneCreditFactory;
|
||||||
use Illuminate\Support\Facades\Storage;
|
use App\Factory\CreditFactory;
|
||||||
use App\Services\Template\TemplateAction;
|
use App\Filters\CreditFilters;
|
||||||
|
use App\Http\Requests\Credit\ActionCreditRequest;
|
||||||
use App\Http\Requests\Credit\BulkCreditRequest;
|
use App\Http\Requests\Credit\BulkCreditRequest;
|
||||||
|
use App\Http\Requests\Credit\CreateCreditRequest;
|
||||||
|
use App\Http\Requests\Credit\DestroyCreditRequest;
|
||||||
use App\Http\Requests\Credit\EditCreditRequest;
|
use App\Http\Requests\Credit\EditCreditRequest;
|
||||||
use App\Http\Requests\Credit\ShowCreditRequest;
|
use App\Http\Requests\Credit\ShowCreditRequest;
|
||||||
use App\Http\Requests\Credit\StoreCreditRequest;
|
use App\Http\Requests\Credit\StoreCreditRequest;
|
||||||
use App\Http\Requests\Credit\ActionCreditRequest;
|
|
||||||
use App\Http\Requests\Credit\CreateCreditRequest;
|
|
||||||
use App\Http\Requests\Credit\UpdateCreditRequest;
|
use App\Http\Requests\Credit\UpdateCreditRequest;
|
||||||
use App\Http\Requests\Credit\UploadCreditRequest;
|
use App\Http\Requests\Credit\UploadCreditRequest;
|
||||||
use App\Http\Requests\Credit\DestroyCreditRequest;
|
use App\Jobs\Credit\ZipCredits;
|
||||||
|
use App\Jobs\Entity\EmailEntity;
|
||||||
|
use App\Models\Account;
|
||||||
|
use App\Models\Client;
|
||||||
|
use App\Models\Credit;
|
||||||
|
use App\Models\Invoice;
|
||||||
|
use App\Repositories\CreditRepository;
|
||||||
|
use App\Services\PdfMaker\PdfMerge;
|
||||||
|
use App\Services\Template\TemplateAction;
|
||||||
|
use App\Transformers\CreditTransformer;
|
||||||
|
use App\Utils\Ninja;
|
||||||
|
use App\Utils\Traits\MakesHash;
|
||||||
|
use App\Utils\Traits\SavesDocuments;
|
||||||
|
use Illuminate\Http\Response;
|
||||||
|
use Illuminate\Support\Facades\App;
|
||||||
|
use Illuminate\Support\Facades\Storage;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class CreditController.
|
* Class CreditController.
|
||||||
|
@ -71,8 +71,9 @@ class EmailController extends BaseController
|
|||||||
|
|
||||||
if ($request->cc_email && (Ninja::isSelfHost() || $user->account->isPaidHostedClient())) {
|
if ($request->cc_email && (Ninja::isSelfHost() || $user->account->isPaidHostedClient())) {
|
||||||
|
|
||||||
foreach($request->cc_email as $email)
|
foreach($request->cc_email as $email) {
|
||||||
$mo->cc[] = new Address($email);
|
$mo->cc[] = new Address($email);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -11,28 +11,28 @@
|
|||||||
|
|
||||||
namespace App\Http\Controllers;
|
namespace App\Http\Controllers;
|
||||||
|
|
||||||
use App\Utils\Ninja;
|
|
||||||
use App\Models\Account;
|
|
||||||
use App\Models\Expense;
|
|
||||||
use Illuminate\Http\Response;
|
|
||||||
use App\Factory\ExpenseFactory;
|
|
||||||
use App\Filters\ExpenseFilters;
|
|
||||||
use App\Utils\Traits\MakesHash;
|
|
||||||
use App\Utils\Traits\Uploadable;
|
|
||||||
use App\Utils\Traits\BulkOptions;
|
|
||||||
use App\Utils\Traits\SavesDocuments;
|
|
||||||
use App\Repositories\ExpenseRepository;
|
|
||||||
use App\Transformers\ExpenseTransformer;
|
|
||||||
use App\Events\Expense\ExpenseWasCreated;
|
use App\Events\Expense\ExpenseWasCreated;
|
||||||
use App\Events\Expense\ExpenseWasUpdated;
|
use App\Events\Expense\ExpenseWasUpdated;
|
||||||
|
use App\Factory\ExpenseFactory;
|
||||||
|
use App\Filters\ExpenseFilters;
|
||||||
use App\Http\Requests\Expense\BulkExpenseRequest;
|
use App\Http\Requests\Expense\BulkExpenseRequest;
|
||||||
|
use App\Http\Requests\Expense\CreateExpenseRequest;
|
||||||
|
use App\Http\Requests\Expense\DestroyExpenseRequest;
|
||||||
use App\Http\Requests\Expense\EditExpenseRequest;
|
use App\Http\Requests\Expense\EditExpenseRequest;
|
||||||
use App\Http\Requests\Expense\ShowExpenseRequest;
|
use App\Http\Requests\Expense\ShowExpenseRequest;
|
||||||
use App\Http\Requests\Expense\StoreExpenseRequest;
|
use App\Http\Requests\Expense\StoreExpenseRequest;
|
||||||
use App\Http\Requests\Expense\CreateExpenseRequest;
|
|
||||||
use App\Http\Requests\Expense\UpdateExpenseRequest;
|
use App\Http\Requests\Expense\UpdateExpenseRequest;
|
||||||
use App\Http\Requests\Expense\UploadExpenseRequest;
|
use App\Http\Requests\Expense\UploadExpenseRequest;
|
||||||
use App\Http\Requests\Expense\DestroyExpenseRequest;
|
use App\Models\Account;
|
||||||
|
use App\Models\Expense;
|
||||||
|
use App\Repositories\ExpenseRepository;
|
||||||
|
use App\Transformers\ExpenseTransformer;
|
||||||
|
use App\Utils\Ninja;
|
||||||
|
use App\Utils\Traits\BulkOptions;
|
||||||
|
use App\Utils\Traits\MakesHash;
|
||||||
|
use App\Utils\Traits\SavesDocuments;
|
||||||
|
use App\Utils\Traits\Uploadable;
|
||||||
|
use Illuminate\Http\Response;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class ExpenseController.
|
* Class ExpenseController.
|
||||||
|
@ -11,27 +11,27 @@
|
|||||||
|
|
||||||
namespace App\Http\Controllers;
|
namespace App\Http\Controllers;
|
||||||
|
|
||||||
use App\Utils\Ninja;
|
use App\Events\Payment\PaymentWasUpdated;
|
||||||
use App\Models\Account;
|
|
||||||
use App\Models\Payment;
|
|
||||||
use Illuminate\Http\Response;
|
|
||||||
use App\Factory\PaymentFactory;
|
use App\Factory\PaymentFactory;
|
||||||
use App\Filters\PaymentFilters;
|
use App\Filters\PaymentFilters;
|
||||||
use App\Utils\Traits\MakesHash;
|
use App\Http\Requests\Payment\BulkActionPaymentRequest;
|
||||||
use App\Utils\Traits\SavesDocuments;
|
use App\Http\Requests\Payment\CreatePaymentRequest;
|
||||||
use App\Repositories\PaymentRepository;
|
use App\Http\Requests\Payment\DestroyPaymentRequest;
|
||||||
use App\Transformers\PaymentTransformer;
|
|
||||||
use App\Events\Payment\PaymentWasUpdated;
|
|
||||||
use App\Services\Template\TemplateAction;
|
|
||||||
use App\Http\Requests\Payment\EditPaymentRequest;
|
use App\Http\Requests\Payment\EditPaymentRequest;
|
||||||
|
use App\Http\Requests\Payment\RefundPaymentRequest;
|
||||||
use App\Http\Requests\Payment\ShowPaymentRequest;
|
use App\Http\Requests\Payment\ShowPaymentRequest;
|
||||||
use App\Http\Requests\Payment\StorePaymentRequest;
|
use App\Http\Requests\Payment\StorePaymentRequest;
|
||||||
use App\Http\Requests\Payment\CreatePaymentRequest;
|
|
||||||
use App\Http\Requests\Payment\RefundPaymentRequest;
|
|
||||||
use App\Http\Requests\Payment\UpdatePaymentRequest;
|
use App\Http\Requests\Payment\UpdatePaymentRequest;
|
||||||
use App\Http\Requests\Payment\UploadPaymentRequest;
|
use App\Http\Requests\Payment\UploadPaymentRequest;
|
||||||
use App\Http\Requests\Payment\DestroyPaymentRequest;
|
use App\Models\Account;
|
||||||
use App\Http\Requests\Payment\BulkActionPaymentRequest;
|
use App\Models\Payment;
|
||||||
|
use App\Repositories\PaymentRepository;
|
||||||
|
use App\Services\Template\TemplateAction;
|
||||||
|
use App\Transformers\PaymentTransformer;
|
||||||
|
use App\Utils\Ninja;
|
||||||
|
use App\Utils\Traits\MakesHash;
|
||||||
|
use App\Utils\Traits\SavesDocuments;
|
||||||
|
use Illuminate\Http\Response;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class PaymentController.
|
* Class PaymentController.
|
||||||
|
@ -11,33 +11,31 @@
|
|||||||
|
|
||||||
namespace App\Http\Controllers;
|
namespace App\Http\Controllers;
|
||||||
|
|
||||||
use App\Utils\Ninja;
|
|
||||||
use App\Models\Client;
|
|
||||||
use App\Models\Invoice;
|
|
||||||
use App\Utils\HtmlEngine;
|
|
||||||
use Twig\Error\SyntaxError;
|
|
||||||
use App\Jobs\Util\PreviewPdf;
|
|
||||||
use App\Models\ClientContact;
|
|
||||||
use App\Services\Pdf\PdfMock;
|
|
||||||
use App\Utils\Traits\MakesHash;
|
|
||||||
use App\Services\Pdf\PdfService;
|
|
||||||
use App\Utils\PhantomJS\Phantom;
|
|
||||||
use App\Models\InvoiceInvitation;
|
|
||||||
use App\Services\PdfMaker\Design;
|
|
||||||
use App\Utils\HostedPDF\NinjaPdf;
|
|
||||||
use Illuminate\Support\Facades\DB;
|
|
||||||
use App\Services\PdfMaker\PdfMaker;
|
|
||||||
use Illuminate\Support\Facades\App;
|
|
||||||
use App\Utils\Traits\MakesInvoiceHtml;
|
|
||||||
use Turbo124\Beacon\Facades\LightLogs;
|
|
||||||
use App\Utils\Traits\Pdf\PageNumbering;
|
|
||||||
use Illuminate\Support\Facades\Response;
|
|
||||||
use App\DataMapper\Analytics\LivePreview;
|
use App\DataMapper\Analytics\LivePreview;
|
||||||
use App\Services\Template\TemplateService;
|
|
||||||
use App\Http\Requests\Preview\DesignPreviewRequest;
|
use App\Http\Requests\Preview\DesignPreviewRequest;
|
||||||
use App\Services\PdfMaker\Design as PdfDesignModel;
|
|
||||||
use App\Services\PdfMaker\Design as PdfMakerDesign;
|
|
||||||
use App\Http\Requests\Preview\PreviewInvoiceRequest;
|
use App\Http\Requests\Preview\PreviewInvoiceRequest;
|
||||||
|
use App\Jobs\Util\PreviewPdf;
|
||||||
|
use App\Models\Client;
|
||||||
|
use App\Models\ClientContact;
|
||||||
|
use App\Models\Invoice;
|
||||||
|
use App\Models\InvoiceInvitation;
|
||||||
|
use App\Services\Pdf\PdfMock;
|
||||||
|
use App\Services\Pdf\PdfService;
|
||||||
|
use App\Services\PdfMaker\Design;
|
||||||
|
use App\Services\PdfMaker\PdfMaker;
|
||||||
|
use App\Services\Template\TemplateService;
|
||||||
|
use App\Utils\HostedPDF\NinjaPdf;
|
||||||
|
use App\Utils\HtmlEngine;
|
||||||
|
use App\Utils\Ninja;
|
||||||
|
use App\Utils\PhantomJS\Phantom;
|
||||||
|
use App\Utils\Traits\MakesHash;
|
||||||
|
use App\Utils\Traits\MakesInvoiceHtml;
|
||||||
|
use App\Utils\Traits\Pdf\PageNumbering;
|
||||||
|
use Illuminate\Support\Facades\App;
|
||||||
|
use Illuminate\Support\Facades\DB;
|
||||||
|
use Illuminate\Support\Facades\Response;
|
||||||
|
use Turbo124\Beacon\Facades\LightLogs;
|
||||||
|
use Twig\Error\SyntaxError;
|
||||||
|
|
||||||
class PreviewController extends BaseController
|
class PreviewController extends BaseController
|
||||||
{
|
{
|
||||||
|
@ -11,33 +11,33 @@
|
|||||||
|
|
||||||
namespace App\Http\Controllers;
|
namespace App\Http\Controllers;
|
||||||
|
|
||||||
use App\Utils\Ninja;
|
|
||||||
use App\Models\Client;
|
|
||||||
use App\Models\Vendor;
|
|
||||||
use App\Libraries\MultiDB;
|
|
||||||
use App\Jobs\Util\PreviewPdf;
|
|
||||||
use App\Models\PurchaseOrder;
|
|
||||||
use App\Models\VendorContact;
|
|
||||||
use App\Utils\Traits\MakesHash;
|
|
||||||
use App\Utils\VendorHtmlEngine;
|
|
||||||
use App\Services\Pdf\PdfService;
|
|
||||||
use App\Utils\PhantomJS\Phantom;
|
|
||||||
use App\Services\PdfMaker\Design;
|
|
||||||
use App\Utils\HostedPDF\NinjaPdf;
|
|
||||||
use Illuminate\Support\Facades\DB;
|
|
||||||
use App\Services\PdfMaker\PdfMaker;
|
|
||||||
use Illuminate\Support\Facades\App;
|
|
||||||
use App\Factory\PurchaseOrderFactory;
|
|
||||||
use App\Utils\Traits\MakesInvoiceHtml;
|
|
||||||
use Turbo124\Beacon\Facades\LightLogs;
|
|
||||||
use App\Models\PurchaseOrderInvitation;
|
|
||||||
use App\Utils\Traits\Pdf\PageNumbering;
|
|
||||||
use Illuminate\Support\Facades\Response;
|
|
||||||
use App\DataMapper\Analytics\LivePreview;
|
use App\DataMapper\Analytics\LivePreview;
|
||||||
|
use App\Factory\PurchaseOrderFactory;
|
||||||
|
use App\Http\Requests\Preview\PreviewPurchaseOrderRequest;
|
||||||
|
use App\Jobs\Util\PreviewPdf;
|
||||||
|
use App\Libraries\MultiDB;
|
||||||
|
use App\Models\Client;
|
||||||
|
use App\Models\PurchaseOrder;
|
||||||
|
use App\Models\PurchaseOrderInvitation;
|
||||||
|
use App\Models\Vendor;
|
||||||
|
use App\Models\VendorContact;
|
||||||
use App\Repositories\PurchaseOrderRepository;
|
use App\Repositories\PurchaseOrderRepository;
|
||||||
|
use App\Services\Pdf\PdfService;
|
||||||
|
use App\Services\PdfMaker\Design;
|
||||||
use App\Services\PdfMaker\Design as PdfDesignModel;
|
use App\Services\PdfMaker\Design as PdfDesignModel;
|
||||||
use App\Services\PdfMaker\Design as PdfMakerDesign;
|
use App\Services\PdfMaker\Design as PdfMakerDesign;
|
||||||
use App\Http\Requests\Preview\PreviewPurchaseOrderRequest;
|
use App\Services\PdfMaker\PdfMaker;
|
||||||
|
use App\Utils\HostedPDF\NinjaPdf;
|
||||||
|
use App\Utils\Ninja;
|
||||||
|
use App\Utils\PhantomJS\Phantom;
|
||||||
|
use App\Utils\Traits\MakesHash;
|
||||||
|
use App\Utils\Traits\MakesInvoiceHtml;
|
||||||
|
use App\Utils\Traits\Pdf\PageNumbering;
|
||||||
|
use App\Utils\VendorHtmlEngine;
|
||||||
|
use Illuminate\Support\Facades\App;
|
||||||
|
use Illuminate\Support\Facades\DB;
|
||||||
|
use Illuminate\Support\Facades\Response;
|
||||||
|
use Turbo124\Beacon\Facades\LightLogs;
|
||||||
|
|
||||||
class PreviewPurchaseOrderController extends BaseController
|
class PreviewPurchaseOrderController extends BaseController
|
||||||
{
|
{
|
||||||
|
@ -11,25 +11,25 @@
|
|||||||
|
|
||||||
namespace App\Http\Controllers;
|
namespace App\Http\Controllers;
|
||||||
|
|
||||||
use App\Models\Account;
|
|
||||||
use App\Models\Project;
|
|
||||||
use Illuminate\Http\Response;
|
|
||||||
use App\Factory\ProjectFactory;
|
use App\Factory\ProjectFactory;
|
||||||
use App\Filters\ProjectFilters;
|
use App\Filters\ProjectFilters;
|
||||||
use App\Utils\Traits\MakesHash;
|
use App\Http\Requests\Project\BulkProjectRequest;
|
||||||
use App\Utils\Traits\SavesDocuments;
|
use App\Http\Requests\Project\CreateProjectRequest;
|
||||||
use App\Utils\Traits\GeneratesCounter;
|
use App\Http\Requests\Project\DestroyProjectRequest;
|
||||||
use App\Repositories\ProjectRepository;
|
|
||||||
use App\Transformers\ProjectTransformer;
|
|
||||||
use App\Services\Template\TemplateAction;
|
|
||||||
use App\Http\Requests\Project\EditProjectRequest;
|
use App\Http\Requests\Project\EditProjectRequest;
|
||||||
use App\Http\Requests\Project\ShowProjectRequest;
|
use App\Http\Requests\Project\ShowProjectRequest;
|
||||||
use App\Http\Requests\Project\StoreProjectRequest;
|
use App\Http\Requests\Project\StoreProjectRequest;
|
||||||
use App\Http\Requests\Project\CreateProjectRequest;
|
|
||||||
use App\Http\Requests\Project\UpdateProjectRequest;
|
use App\Http\Requests\Project\UpdateProjectRequest;
|
||||||
use App\Http\Requests\Project\UploadProjectRequest;
|
use App\Http\Requests\Project\UploadProjectRequest;
|
||||||
use App\Http\Requests\Project\DestroyProjectRequest;
|
use App\Models\Account;
|
||||||
use App\Http\Requests\Project\BulkProjectRequest;
|
use App\Models\Project;
|
||||||
|
use App\Repositories\ProjectRepository;
|
||||||
|
use App\Services\Template\TemplateAction;
|
||||||
|
use App\Transformers\ProjectTransformer;
|
||||||
|
use App\Utils\Traits\GeneratesCounter;
|
||||||
|
use App\Utils\Traits\MakesHash;
|
||||||
|
use App\Utils\Traits\SavesDocuments;
|
||||||
|
use Illuminate\Http\Response;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class ProjectController.
|
* Class ProjectController.
|
||||||
|
@ -11,34 +11,34 @@
|
|||||||
|
|
||||||
namespace App\Http\Controllers;
|
namespace App\Http\Controllers;
|
||||||
|
|
||||||
use App\Utils\Ninja;
|
|
||||||
use App\Models\Client;
|
|
||||||
use App\Models\Account;
|
|
||||||
use App\Models\PurchaseOrder;
|
|
||||||
use Illuminate\Http\Response;
|
|
||||||
use App\Utils\Traits\MakesHash;
|
|
||||||
use App\Jobs\Entity\CreateRawPdf;
|
|
||||||
use App\Services\PdfMaker\PdfMerge;
|
|
||||||
use App\Utils\Traits\SavesDocuments;
|
|
||||||
use App\Factory\PurchaseOrderFactory;
|
|
||||||
use App\Filters\PurchaseOrderFilters;
|
|
||||||
use Illuminate\Support\Facades\Storage;
|
|
||||||
use App\Services\Template\TemplateAction;
|
|
||||||
use App\Jobs\PurchaseOrder\ZipPurchaseOrders;
|
|
||||||
use App\Repositories\PurchaseOrderRepository;
|
|
||||||
use App\Jobs\PurchaseOrder\PurchaseOrderEmail;
|
|
||||||
use App\Transformers\PurchaseOrderTransformer;
|
|
||||||
use App\Events\PurchaseOrder\PurchaseOrderWasCreated;
|
use App\Events\PurchaseOrder\PurchaseOrderWasCreated;
|
||||||
use App\Events\PurchaseOrder\PurchaseOrderWasUpdated;
|
use App\Events\PurchaseOrder\PurchaseOrderWasUpdated;
|
||||||
|
use App\Factory\PurchaseOrderFactory;
|
||||||
|
use App\Filters\PurchaseOrderFilters;
|
||||||
|
use App\Http\Requests\PurchaseOrder\ActionPurchaseOrderRequest;
|
||||||
use App\Http\Requests\PurchaseOrder\BulkPurchaseOrderRequest;
|
use App\Http\Requests\PurchaseOrder\BulkPurchaseOrderRequest;
|
||||||
|
use App\Http\Requests\PurchaseOrder\CreatePurchaseOrderRequest;
|
||||||
|
use App\Http\Requests\PurchaseOrder\DestroyPurchaseOrderRequest;
|
||||||
use App\Http\Requests\PurchaseOrder\EditPurchaseOrderRequest;
|
use App\Http\Requests\PurchaseOrder\EditPurchaseOrderRequest;
|
||||||
use App\Http\Requests\PurchaseOrder\ShowPurchaseOrderRequest;
|
use App\Http\Requests\PurchaseOrder\ShowPurchaseOrderRequest;
|
||||||
use App\Http\Requests\PurchaseOrder\StorePurchaseOrderRequest;
|
use App\Http\Requests\PurchaseOrder\StorePurchaseOrderRequest;
|
||||||
use App\Http\Requests\PurchaseOrder\ActionPurchaseOrderRequest;
|
|
||||||
use App\Http\Requests\PurchaseOrder\CreatePurchaseOrderRequest;
|
|
||||||
use App\Http\Requests\PurchaseOrder\UpdatePurchaseOrderRequest;
|
use App\Http\Requests\PurchaseOrder\UpdatePurchaseOrderRequest;
|
||||||
use App\Http\Requests\PurchaseOrder\UploadPurchaseOrderRequest;
|
use App\Http\Requests\PurchaseOrder\UploadPurchaseOrderRequest;
|
||||||
use App\Http\Requests\PurchaseOrder\DestroyPurchaseOrderRequest;
|
use App\Jobs\Entity\CreateRawPdf;
|
||||||
|
use App\Jobs\PurchaseOrder\PurchaseOrderEmail;
|
||||||
|
use App\Jobs\PurchaseOrder\ZipPurchaseOrders;
|
||||||
|
use App\Models\Account;
|
||||||
|
use App\Models\Client;
|
||||||
|
use App\Models\PurchaseOrder;
|
||||||
|
use App\Repositories\PurchaseOrderRepository;
|
||||||
|
use App\Services\PdfMaker\PdfMerge;
|
||||||
|
use App\Services\Template\TemplateAction;
|
||||||
|
use App\Transformers\PurchaseOrderTransformer;
|
||||||
|
use App\Utils\Ninja;
|
||||||
|
use App\Utils\Traits\MakesHash;
|
||||||
|
use App\Utils\Traits\SavesDocuments;
|
||||||
|
use Illuminate\Http\Response;
|
||||||
|
use Illuminate\Support\Facades\Storage;
|
||||||
|
|
||||||
class PurchaseOrderController extends BaseController
|
class PurchaseOrderController extends BaseController
|
||||||
{
|
{
|
||||||
|
@ -11,41 +11,41 @@
|
|||||||
|
|
||||||
namespace App\Http\Controllers;
|
namespace App\Http\Controllers;
|
||||||
|
|
||||||
use App\Utils\Ninja;
|
|
||||||
use App\Models\Quote;
|
|
||||||
use App\Models\Client;
|
|
||||||
use App\Models\Account;
|
|
||||||
use App\Models\Invoice;
|
|
||||||
use App\Models\Project;
|
|
||||||
use Illuminate\Http\Request;
|
|
||||||
use App\Factory\QuoteFactory;
|
|
||||||
use App\Filters\QuoteFilters;
|
|
||||||
use App\Jobs\Quote\ZipQuotes;
|
|
||||||
use Illuminate\Http\Response;
|
|
||||||
use App\Utils\Traits\MakesHash;
|
|
||||||
use App\Factory\CloneQuoteFactory;
|
|
||||||
use App\Services\PdfMaker\PdfMerge;
|
|
||||||
use Illuminate\Support\Facades\App;
|
|
||||||
use App\Utils\Traits\SavesDocuments;
|
|
||||||
use App\Events\Quote\QuoteWasCreated;
|
use App\Events\Quote\QuoteWasCreated;
|
||||||
use App\Events\Quote\QuoteWasUpdated;
|
use App\Events\Quote\QuoteWasUpdated;
|
||||||
use App\Repositories\QuoteRepository;
|
use App\Factory\CloneQuoteFactory;
|
||||||
use App\Transformers\QuoteTransformer;
|
|
||||||
use App\Utils\Traits\GeneratesCounter;
|
|
||||||
use Illuminate\Support\Facades\Storage;
|
|
||||||
use App\Transformers\InvoiceTransformer;
|
|
||||||
use App\Transformers\ProjectTransformer;
|
|
||||||
use App\Services\Template\TemplateAction;
|
|
||||||
use App\Factory\CloneQuoteToInvoiceFactory;
|
use App\Factory\CloneQuoteToInvoiceFactory;
|
||||||
|
use App\Factory\QuoteFactory;
|
||||||
|
use App\Filters\QuoteFilters;
|
||||||
|
use App\Http\Requests\Quote\ActionQuoteRequest;
|
||||||
|
use App\Http\Requests\Quote\BulkActionQuoteRequest;
|
||||||
|
use App\Http\Requests\Quote\CreateQuoteRequest;
|
||||||
|
use App\Http\Requests\Quote\DestroyQuoteRequest;
|
||||||
use App\Http\Requests\Quote\EditQuoteRequest;
|
use App\Http\Requests\Quote\EditQuoteRequest;
|
||||||
use App\Http\Requests\Quote\ShowQuoteRequest;
|
use App\Http\Requests\Quote\ShowQuoteRequest;
|
||||||
use App\Http\Requests\Quote\StoreQuoteRequest;
|
use App\Http\Requests\Quote\StoreQuoteRequest;
|
||||||
use App\Http\Requests\Quote\ActionQuoteRequest;
|
|
||||||
use App\Http\Requests\Quote\CreateQuoteRequest;
|
|
||||||
use App\Http\Requests\Quote\UpdateQuoteRequest;
|
use App\Http\Requests\Quote\UpdateQuoteRequest;
|
||||||
use App\Http\Requests\Quote\UploadQuoteRequest;
|
use App\Http\Requests\Quote\UploadQuoteRequest;
|
||||||
use App\Http\Requests\Quote\DestroyQuoteRequest;
|
use App\Jobs\Quote\ZipQuotes;
|
||||||
use App\Http\Requests\Quote\BulkActionQuoteRequest;
|
use App\Models\Account;
|
||||||
|
use App\Models\Client;
|
||||||
|
use App\Models\Invoice;
|
||||||
|
use App\Models\Project;
|
||||||
|
use App\Models\Quote;
|
||||||
|
use App\Repositories\QuoteRepository;
|
||||||
|
use App\Services\PdfMaker\PdfMerge;
|
||||||
|
use App\Services\Template\TemplateAction;
|
||||||
|
use App\Transformers\InvoiceTransformer;
|
||||||
|
use App\Transformers\ProjectTransformer;
|
||||||
|
use App\Transformers\QuoteTransformer;
|
||||||
|
use App\Utils\Ninja;
|
||||||
|
use App\Utils\Traits\GeneratesCounter;
|
||||||
|
use App\Utils\Traits\MakesHash;
|
||||||
|
use App\Utils\Traits\SavesDocuments;
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
use Illuminate\Http\Response;
|
||||||
|
use Illuminate\Support\Facades\App;
|
||||||
|
use Illuminate\Support\Facades\Storage;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class QuoteController.
|
* Class QuoteController.
|
||||||
|
@ -11,12 +11,12 @@
|
|||||||
|
|
||||||
namespace App\Http\Controllers\Reports;
|
namespace App\Http\Controllers\Reports;
|
||||||
|
|
||||||
use App\Utils\Traits\MakesHash;
|
|
||||||
use App\Jobs\Report\SendToAdmin;
|
|
||||||
use App\Jobs\Report\PreviewReport;
|
|
||||||
use App\Services\Report\ARDetailReport;
|
|
||||||
use App\Http\Controllers\BaseController;
|
use App\Http\Controllers\BaseController;
|
||||||
use App\Http\Requests\Report\GenericReportRequest;
|
use App\Http\Requests\Report\GenericReportRequest;
|
||||||
|
use App\Jobs\Report\PreviewReport;
|
||||||
|
use App\Jobs\Report\SendToAdmin;
|
||||||
|
use App\Services\Report\ARDetailReport;
|
||||||
|
use App\Utils\Traits\MakesHash;
|
||||||
|
|
||||||
class ARDetailReportController extends BaseController
|
class ARDetailReportController extends BaseController
|
||||||
{
|
{
|
||||||
|
@ -11,12 +11,12 @@
|
|||||||
|
|
||||||
namespace App\Http\Controllers\Reports;
|
namespace App\Http\Controllers\Reports;
|
||||||
|
|
||||||
use App\Utils\Traits\MakesHash;
|
|
||||||
use App\Jobs\Report\SendToAdmin;
|
|
||||||
use App\Jobs\Report\PreviewReport;
|
|
||||||
use App\Http\Controllers\BaseController;
|
use App\Http\Controllers\BaseController;
|
||||||
use App\Services\Report\ARSummaryReport;
|
|
||||||
use App\Http\Requests\Report\GenericReportRequest;
|
use App\Http\Requests\Report\GenericReportRequest;
|
||||||
|
use App\Jobs\Report\PreviewReport;
|
||||||
|
use App\Jobs\Report\SendToAdmin;
|
||||||
|
use App\Services\Report\ARSummaryReport;
|
||||||
|
use App\Utils\Traits\MakesHash;
|
||||||
|
|
||||||
class ARSummaryReportController extends BaseController
|
class ARSummaryReportController extends BaseController
|
||||||
{
|
{
|
||||||
|
@ -11,12 +11,12 @@
|
|||||||
|
|
||||||
namespace App\Http\Controllers\Reports;
|
namespace App\Http\Controllers\Reports;
|
||||||
|
|
||||||
use App\Utils\Traits\MakesHash;
|
|
||||||
use App\Jobs\Report\SendToAdmin;
|
|
||||||
use App\Jobs\Report\PreviewReport;
|
|
||||||
use App\Http\Controllers\BaseController;
|
use App\Http\Controllers\BaseController;
|
||||||
use App\Services\Report\ClientBalanceReport;
|
|
||||||
use App\Http\Requests\Report\GenericReportRequest;
|
use App\Http\Requests\Report\GenericReportRequest;
|
||||||
|
use App\Jobs\Report\PreviewReport;
|
||||||
|
use App\Jobs\Report\SendToAdmin;
|
||||||
|
use App\Services\Report\ClientBalanceReport;
|
||||||
|
use App\Utils\Traits\MakesHash;
|
||||||
|
|
||||||
class ClientBalanceReportController extends BaseController
|
class ClientBalanceReportController extends BaseController
|
||||||
{
|
{
|
||||||
|
@ -11,12 +11,12 @@
|
|||||||
|
|
||||||
namespace App\Http\Controllers\Reports;
|
namespace App\Http\Controllers\Reports;
|
||||||
|
|
||||||
use App\Utils\Traits\MakesHash;
|
|
||||||
use App\Jobs\Report\SendToAdmin;
|
|
||||||
use App\Jobs\Report\PreviewReport;
|
|
||||||
use App\Http\Controllers\BaseController;
|
use App\Http\Controllers\BaseController;
|
||||||
use App\Services\Report\ClientSalesReport;
|
|
||||||
use App\Http\Requests\Report\GenericReportRequest;
|
use App\Http\Requests\Report\GenericReportRequest;
|
||||||
|
use App\Jobs\Report\PreviewReport;
|
||||||
|
use App\Jobs\Report\SendToAdmin;
|
||||||
|
use App\Services\Report\ClientSalesReport;
|
||||||
|
use App\Utils\Traits\MakesHash;
|
||||||
|
|
||||||
class ClientSalesReportController extends BaseController
|
class ClientSalesReportController extends BaseController
|
||||||
{
|
{
|
||||||
|
@ -11,14 +11,14 @@
|
|||||||
|
|
||||||
namespace App\Http\Controllers\Reports;
|
namespace App\Http\Controllers\Reports;
|
||||||
|
|
||||||
use App\Models\Client;
|
|
||||||
use Illuminate\Http\Response;
|
|
||||||
use App\Utils\Traits\MakesHash;
|
|
||||||
use App\Jobs\Report\SendToAdmin;
|
|
||||||
use App\Jobs\Report\PreviewReport;
|
|
||||||
use App\Export\CSV\ProductSalesExport;
|
use App\Export\CSV\ProductSalesExport;
|
||||||
use App\Http\Controllers\BaseController;
|
use App\Http\Controllers\BaseController;
|
||||||
use App\Http\Requests\Report\ProductSalesReportRequest;
|
use App\Http\Requests\Report\ProductSalesReportRequest;
|
||||||
|
use App\Jobs\Report\PreviewReport;
|
||||||
|
use App\Jobs\Report\SendToAdmin;
|
||||||
|
use App\Models\Client;
|
||||||
|
use App\Utils\Traits\MakesHash;
|
||||||
|
use Illuminate\Http\Response;
|
||||||
|
|
||||||
class ProductSalesReportController extends BaseController
|
class ProductSalesReportController extends BaseController
|
||||||
{
|
{
|
||||||
|
@ -11,14 +11,14 @@
|
|||||||
|
|
||||||
namespace App\Http\Controllers\Reports;
|
namespace App\Http\Controllers\Reports;
|
||||||
|
|
||||||
use App\Models\Client;
|
|
||||||
use Illuminate\Http\Response;
|
|
||||||
use App\Utils\Traits\MakesHash;
|
|
||||||
use App\Jobs\Report\SendToAdmin;
|
|
||||||
use App\Jobs\Report\PreviewReport;
|
|
||||||
use App\Services\Report\ProfitLoss;
|
|
||||||
use App\Http\Controllers\BaseController;
|
use App\Http\Controllers\BaseController;
|
||||||
use App\Http\Requests\Report\ProfitLossRequest;
|
use App\Http\Requests\Report\ProfitLossRequest;
|
||||||
|
use App\Jobs\Report\PreviewReport;
|
||||||
|
use App\Jobs\Report\SendToAdmin;
|
||||||
|
use App\Models\Client;
|
||||||
|
use App\Services\Report\ProfitLoss;
|
||||||
|
use App\Utils\Traits\MakesHash;
|
||||||
|
use Illuminate\Http\Response;
|
||||||
|
|
||||||
class ProfitAndLossController extends BaseController
|
class ProfitAndLossController extends BaseController
|
||||||
{
|
{
|
||||||
|
@ -11,12 +11,12 @@
|
|||||||
|
|
||||||
namespace App\Http\Controllers\Reports;
|
namespace App\Http\Controllers\Reports;
|
||||||
|
|
||||||
use App\Utils\Traits\MakesHash;
|
|
||||||
use App\Jobs\Report\SendToAdmin;
|
|
||||||
use App\Jobs\Report\PreviewReport;
|
|
||||||
use App\Http\Controllers\BaseController;
|
use App\Http\Controllers\BaseController;
|
||||||
use App\Services\Report\TaxSummaryReport;
|
|
||||||
use App\Http\Requests\Report\GenericReportRequest;
|
use App\Http\Requests\Report\GenericReportRequest;
|
||||||
|
use App\Jobs\Report\PreviewReport;
|
||||||
|
use App\Jobs\Report\SendToAdmin;
|
||||||
|
use App\Services\Report\TaxSummaryReport;
|
||||||
|
use App\Utils\Traits\MakesHash;
|
||||||
|
|
||||||
class TaxSummaryReportController extends BaseController
|
class TaxSummaryReportController extends BaseController
|
||||||
{
|
{
|
||||||
|
@ -11,12 +11,12 @@
|
|||||||
|
|
||||||
namespace App\Http\Controllers\Reports;
|
namespace App\Http\Controllers\Reports;
|
||||||
|
|
||||||
use App\Utils\Traits\MakesHash;
|
|
||||||
use App\Jobs\Report\SendToAdmin;
|
|
||||||
use App\Jobs\Report\PreviewReport;
|
|
||||||
use App\Http\Controllers\BaseController;
|
use App\Http\Controllers\BaseController;
|
||||||
use App\Services\Report\UserSalesReport;
|
|
||||||
use App\Http\Requests\Report\GenericReportRequest;
|
use App\Http\Requests\Report\GenericReportRequest;
|
||||||
|
use App\Jobs\Report\PreviewReport;
|
||||||
|
use App\Jobs\Report\SendToAdmin;
|
||||||
|
use App\Services\Report\UserSalesReport;
|
||||||
|
use App\Utils\Traits\MakesHash;
|
||||||
|
|
||||||
class UserSalesReportController extends BaseController
|
class UserSalesReportController extends BaseController
|
||||||
{
|
{
|
||||||
|
@ -65,12 +65,10 @@ class SearchController extends Controller
|
|||||||
$client->contacts->each(function ($contact) {
|
$client->contacts->each(function ($contact) {
|
||||||
$this->client_contacts[] = [
|
$this->client_contacts[] = [
|
||||||
'name' => $contact->present()->search_display(),
|
'name' => $contact->present()->search_display(),
|
||||||
'type' => '/client_contact',
|
'type' => '/client',
|
||||||
'id' => $contact->hashed_id,
|
'id' => $contact->client->hashed_id,
|
||||||
'path' => "/clients/{$contact->hashed_id}"
|
'path' => "/clients/{$contact->client->hashed_id}"
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -11,31 +11,31 @@
|
|||||||
|
|
||||||
namespace App\Http\Controllers;
|
namespace App\Http\Controllers;
|
||||||
|
|
||||||
use App\Models\Task;
|
|
||||||
use App\Utils\Ninja;
|
|
||||||
use App\Models\Account;
|
|
||||||
use App\Models\TaskStatus;
|
|
||||||
use App\Factory\TaskFactory;
|
|
||||||
use App\Filters\TaskFilters;
|
|
||||||
use Illuminate\Http\Response;
|
|
||||||
use App\Utils\Traits\MakesHash;
|
|
||||||
use App\Utils\Traits\Uploadable;
|
|
||||||
use App\Utils\Traits\BulkOptions;
|
|
||||||
use App\Events\Task\TaskWasCreated;
|
use App\Events\Task\TaskWasCreated;
|
||||||
use App\Events\Task\TaskWasUpdated;
|
use App\Events\Task\TaskWasUpdated;
|
||||||
use App\Repositories\TaskRepository;
|
use App\Factory\TaskFactory;
|
||||||
use App\Utils\Traits\SavesDocuments;
|
use App\Filters\TaskFilters;
|
||||||
use App\Transformers\TaskTransformer;
|
|
||||||
use App\Services\Template\TemplateAction;
|
|
||||||
use App\Http\Requests\Task\BulkTaskRequest;
|
use App\Http\Requests\Task\BulkTaskRequest;
|
||||||
|
use App\Http\Requests\Task\CreateTaskRequest;
|
||||||
|
use App\Http\Requests\Task\DestroyTaskRequest;
|
||||||
use App\Http\Requests\Task\EditTaskRequest;
|
use App\Http\Requests\Task\EditTaskRequest;
|
||||||
use App\Http\Requests\Task\ShowTaskRequest;
|
use App\Http\Requests\Task\ShowTaskRequest;
|
||||||
use App\Http\Requests\Task\SortTaskRequest;
|
use App\Http\Requests\Task\SortTaskRequest;
|
||||||
use App\Http\Requests\Task\StoreTaskRequest;
|
use App\Http\Requests\Task\StoreTaskRequest;
|
||||||
use App\Http\Requests\Task\CreateTaskRequest;
|
|
||||||
use App\Http\Requests\Task\UpdateTaskRequest;
|
use App\Http\Requests\Task\UpdateTaskRequest;
|
||||||
use App\Http\Requests\Task\UploadTaskRequest;
|
use App\Http\Requests\Task\UploadTaskRequest;
|
||||||
use App\Http\Requests\Task\DestroyTaskRequest;
|
use App\Models\Account;
|
||||||
|
use App\Models\Task;
|
||||||
|
use App\Models\TaskStatus;
|
||||||
|
use App\Repositories\TaskRepository;
|
||||||
|
use App\Services\Template\TemplateAction;
|
||||||
|
use App\Transformers\TaskTransformer;
|
||||||
|
use App\Utils\Ninja;
|
||||||
|
use App\Utils\Traits\BulkOptions;
|
||||||
|
use App\Utils\Traits\MakesHash;
|
||||||
|
use App\Utils\Traits\SavesDocuments;
|
||||||
|
use App\Utils\Traits\Uploadable;
|
||||||
|
use Illuminate\Http\Response;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class TaskController.
|
* Class TaskController.
|
||||||
|
@ -11,23 +11,23 @@
|
|||||||
|
|
||||||
namespace App\Http\Controllers\VendorPortal;
|
namespace App\Http\Controllers\VendorPortal;
|
||||||
|
|
||||||
use App\Utils\Ninja;
|
|
||||||
use Illuminate\View\View;
|
|
||||||
use App\Models\PurchaseOrder;
|
|
||||||
use App\Utils\Traits\MakesHash;
|
|
||||||
use App\Utils\Traits\MakesDates;
|
|
||||||
use App\Jobs\Entity\CreateRawPdf;
|
|
||||||
use App\Http\Controllers\Controller;
|
|
||||||
use App\Jobs\Invoice\InjectSignature;
|
|
||||||
use Illuminate\Support\Facades\Cache;
|
|
||||||
use Illuminate\Contracts\View\Factory;
|
|
||||||
use App\Models\PurchaseOrderInvitation;
|
|
||||||
use App\Events\Misc\InvitationWasViewed;
|
use App\Events\Misc\InvitationWasViewed;
|
||||||
use App\Events\PurchaseOrder\PurchaseOrderWasViewed;
|
|
||||||
use App\Events\PurchaseOrder\PurchaseOrderWasAccepted;
|
use App\Events\PurchaseOrder\PurchaseOrderWasAccepted;
|
||||||
|
use App\Events\PurchaseOrder\PurchaseOrderWasViewed;
|
||||||
|
use App\Http\Controllers\Controller;
|
||||||
|
use App\Http\Requests\VendorPortal\PurchaseOrders\ProcessPurchaseOrdersInBulkRequest;
|
||||||
use App\Http\Requests\VendorPortal\PurchaseOrders\ShowPurchaseOrderRequest;
|
use App\Http\Requests\VendorPortal\PurchaseOrders\ShowPurchaseOrderRequest;
|
||||||
use App\Http\Requests\VendorPortal\PurchaseOrders\ShowPurchaseOrdersRequest;
|
use App\Http\Requests\VendorPortal\PurchaseOrders\ShowPurchaseOrdersRequest;
|
||||||
use App\Http\Requests\VendorPortal\PurchaseOrders\ProcessPurchaseOrdersInBulkRequest;
|
use App\Jobs\Entity\CreateRawPdf;
|
||||||
|
use App\Jobs\Invoice\InjectSignature;
|
||||||
|
use App\Models\PurchaseOrder;
|
||||||
|
use App\Models\PurchaseOrderInvitation;
|
||||||
|
use App\Utils\Ninja;
|
||||||
|
use App\Utils\Traits\MakesDates;
|
||||||
|
use App\Utils\Traits\MakesHash;
|
||||||
|
use Illuminate\Contracts\View\Factory;
|
||||||
|
use Illuminate\Support\Facades\Cache;
|
||||||
|
use Illuminate\View\View;
|
||||||
|
|
||||||
class PurchaseOrderController extends Controller
|
class PurchaseOrderController extends Controller
|
||||||
{
|
{
|
||||||
|
@ -11,7 +11,6 @@
|
|||||||
|
|
||||||
namespace App\Http\Requests\CompanyGateway;
|
namespace App\Http\Requests\CompanyGateway;
|
||||||
|
|
||||||
use App\DataMapper\FeesAndLimits;
|
|
||||||
use App\Http\Requests\Request;
|
use App\Http\Requests\Request;
|
||||||
use App\Http\ValidationRules\ValidCompanyGatewayFeesAndLimitsRule;
|
use App\Http\ValidationRules\ValidCompanyGatewayFeesAndLimitsRule;
|
||||||
use App\Models\Gateway;
|
use App\Models\Gateway;
|
||||||
|
@ -11,8 +11,8 @@
|
|||||||
|
|
||||||
namespace App\Http\Requests\Design;
|
namespace App\Http\Requests\Design;
|
||||||
|
|
||||||
use App\Models\Account;
|
|
||||||
use App\Http\Requests\Request;
|
use App\Http\Requests\Request;
|
||||||
|
use App\Models\Account;
|
||||||
use App\Utils\Traits\ChecksEntityStatus;
|
use App\Utils\Traits\ChecksEntityStatus;
|
||||||
|
|
||||||
class UpdateDesignRequest extends Request
|
class UpdateDesignRequest extends Request
|
||||||
|
@ -12,7 +12,6 @@
|
|||||||
namespace App\Http\Requests\Invoice;
|
namespace App\Http\Requests\Invoice;
|
||||||
|
|
||||||
use App\Http\Requests\Request;
|
use App\Http\Requests\Request;
|
||||||
use App\Models\Payment;
|
|
||||||
|
|
||||||
class BulkInvoiceRequest extends Request
|
class BulkInvoiceRequest extends Request
|
||||||
{
|
{
|
||||||
|
@ -11,12 +11,12 @@
|
|||||||
|
|
||||||
namespace App\Http\Requests\Preview;
|
namespace App\Http\Requests\Preview;
|
||||||
|
|
||||||
use App\Models\Vendor;
|
|
||||||
use App\Models\PurchaseOrder;
|
|
||||||
use App\Http\Requests\Request;
|
use App\Http\Requests\Request;
|
||||||
use App\Utils\Traits\MakesHash;
|
use App\Models\PurchaseOrder;
|
||||||
use App\Utils\Traits\CleanLineItems;
|
|
||||||
use App\Models\PurchaseOrderInvitation;
|
use App\Models\PurchaseOrderInvitation;
|
||||||
|
use App\Models\Vendor;
|
||||||
|
use App\Utils\Traits\CleanLineItems;
|
||||||
|
use App\Utils\Traits\MakesHash;
|
||||||
|
|
||||||
class PreviewPurchaseOrderRequest extends Request
|
class PreviewPurchaseOrderRequest extends Request
|
||||||
{
|
{
|
||||||
|
@ -54,10 +54,13 @@ class StoreTaskRequest extends Request
|
|||||||
$rules['project_id'] = 'bail|required|exists:projects,id,company_id,'.$user->company()->id.',is_deleted,0';
|
$rules['project_id'] = 'bail|required|exists:projects,id,company_id,'.$user->company()->id.',is_deleted,0';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$rules['hash'] = 'bail|sometimes|string|nullable';
|
||||||
|
|
||||||
$rules['time_log'] = ['bail',function ($attribute, $values, $fail) {
|
$rules['time_log'] = ['bail',function ($attribute, $values, $fail) {
|
||||||
|
|
||||||
if(is_string($values))
|
if(is_string($values)) {
|
||||||
$values = json_decode($values, true);
|
$values = json_decode($values, true);
|
||||||
|
}
|
||||||
|
|
||||||
if(!is_array($values)) {
|
if(!is_array($values)) {
|
||||||
$fail('The '.$attribute.' must be a valid array.');
|
$fail('The '.$attribute.' must be a valid array.');
|
||||||
|
@ -60,6 +60,8 @@ class UpdateTaskRequest extends Request
|
|||||||
$rules['project_id'] = 'bail|required|exists:projects,id,company_id,'.$user->company()->id.',is_deleted,0';
|
$rules['project_id'] = 'bail|required|exists:projects,id,company_id,'.$user->company()->id.',is_deleted,0';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$rules['hash'] = 'bail|sometimes|string|nullable';
|
||||||
|
|
||||||
$rules['time_log'] = ['bail', function ($attribute, $values, $fail) {
|
$rules['time_log'] = ['bail', function ($attribute, $values, $fail) {
|
||||||
|
|
||||||
if(is_string($values)) {
|
if(is_string($values)) {
|
||||||
|
@ -677,8 +677,9 @@ class BaseTransformer
|
|||||||
*/
|
*/
|
||||||
public function getProjectId($name, $clientId = null)
|
public function getProjectId($name, $clientId = null)
|
||||||
{
|
{
|
||||||
if(strlen($name) == 0)
|
if(strlen($name) == 0) {
|
||||||
return null;
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
$project = Project::query()->where('company_id', $this->company->id)
|
$project = Project::query()->where('company_id', $this->company->id)
|
||||||
->where('is_deleted', false)
|
->where('is_deleted', false)
|
||||||
|
@ -11,8 +11,8 @@
|
|||||||
|
|
||||||
namespace App\Import\Transformer\Csv;
|
namespace App\Import\Transformer\Csv;
|
||||||
|
|
||||||
use App\Models\TaskStatus;
|
|
||||||
use App\Import\Transformer\BaseTransformer;
|
use App\Import\Transformer\BaseTransformer;
|
||||||
|
use App\Models\TaskStatus;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class TaskTransformer.
|
* Class TaskTransformer.
|
||||||
@ -29,10 +29,11 @@ class TaskTransformer extends BaseTransformer
|
|||||||
{
|
{
|
||||||
$this->stubbed_timestamp = time();
|
$this->stubbed_timestamp = time();
|
||||||
|
|
||||||
if(count($task_items_data) == count($task_items_data, COUNT_RECURSIVE))
|
if(count($task_items_data) == count($task_items_data, COUNT_RECURSIVE)) {
|
||||||
$task_data = $task_items_data;
|
$task_data = $task_items_data;
|
||||||
else
|
} else {
|
||||||
$task_data = reset($task_items_data);
|
$task_data = reset($task_items_data);
|
||||||
|
}
|
||||||
|
|
||||||
$clientId = $this->getClient(
|
$clientId = $this->getClient(
|
||||||
$this->getString($task_data, 'client.name'),
|
$this->getString($task_data, 'client.name'),
|
||||||
@ -79,12 +80,13 @@ class TaskTransformer extends BaseTransformer
|
|||||||
|
|
||||||
$notes = $item['task.notes'] ?? '';
|
$notes = $item['task.notes'] ?? '';
|
||||||
|
|
||||||
if(isset($item['task.is_billable']) && is_string($item['task.is_billable']) && in_array($item['task.is_billable'], ['yes', 'true', '1']))
|
if(isset($item['task.is_billable']) && is_string($item['task.is_billable']) && in_array($item['task.is_billable'], ['yes', 'true', '1'])) {
|
||||||
$is_billable = true;
|
$is_billable = true;
|
||||||
elseif(isset($item['task.is_billable']) && is_bool($item['task.is_billable']))
|
} elseif(isset($item['task.is_billable']) && is_bool($item['task.is_billable'])) {
|
||||||
$is_billable = $item['task.is_billable'];
|
$is_billable = $item['task.is_billable'];
|
||||||
else
|
} else {
|
||||||
$is_billable = false;
|
$is_billable = false;
|
||||||
|
}
|
||||||
|
|
||||||
if(isset($item['task.start_date']) &&
|
if(isset($item['task.start_date']) &&
|
||||||
isset($item['task.end_date'])) {
|
isset($item['task.end_date'])) {
|
||||||
@ -148,8 +150,7 @@ class TaskTransformer extends BaseTransformer
|
|||||||
|
|
||||||
private function getTaskStatusId($item): ?int
|
private function getTaskStatusId($item): ?int
|
||||||
{
|
{
|
||||||
if(isset($item['task.status']))
|
if(isset($item['task.status'])) {
|
||||||
{
|
|
||||||
$name = strtolower(trim($item['task.status']));
|
$name = strtolower(trim($item['task.status']));
|
||||||
|
|
||||||
$ts = TaskStatus::query()->where('company_id', $this->company->id)
|
$ts = TaskStatus::query()->where('company_id', $this->company->id)
|
||||||
@ -159,9 +160,10 @@ class TaskTransformer extends BaseTransformer
|
|||||||
])
|
])
|
||||||
->first();
|
->first();
|
||||||
|
|
||||||
if($ts)
|
if($ts) {
|
||||||
return $ts->id;
|
return $ts->id;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return TaskStatus::where('company_id', $this->company->id)
|
return TaskStatus::where('company_id', $this->company->id)
|
||||||
->where('is_deleted', false)
|
->where('is_deleted', false)
|
||||||
|
@ -63,8 +63,8 @@ class UpdateTaxData implements ShouldQueue
|
|||||||
|
|
||||||
if (!$this->client->state && $this->client->postal_code) {
|
if (!$this->client->state && $this->client->postal_code) {
|
||||||
|
|
||||||
$this->client->state = USStates::getState($this->client->postal_code);
|
$this->client->update(['state' => USStates::getState($this->client->postal_code)]);
|
||||||
$this->client->saveQuietly();
|
// $this->client->saveQuietly();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -16,7 +16,6 @@ use App\Exceptions\NonExistingMigrationFile;
|
|||||||
use App\Factory\ClientContactFactory;
|
use App\Factory\ClientContactFactory;
|
||||||
use App\Jobs\Mail\NinjaMailerJob;
|
use App\Jobs\Mail\NinjaMailerJob;
|
||||||
use App\Jobs\Mail\NinjaMailerObject;
|
use App\Jobs\Mail\NinjaMailerObject;
|
||||||
use App\Jobs\Ninja\TaskScheduler;
|
|
||||||
use App\Libraries\MultiDB;
|
use App\Libraries\MultiDB;
|
||||||
use App\Mail\Import\CompanyImportFailure;
|
use App\Mail\Import\CompanyImportFailure;
|
||||||
use App\Mail\Import\ImportCompleted;
|
use App\Mail\Import\ImportCompleted;
|
||||||
@ -1367,8 +1366,9 @@ class CompanyImport implements ShouldQueue
|
|||||||
private function filterVersionProps($class, array $obj_array): array
|
private function filterVersionProps($class, array $obj_array): array
|
||||||
{
|
{
|
||||||
|
|
||||||
if($this->current_app_version == $this->import_version)
|
if($this->current_app_version == $this->import_version) {
|
||||||
return $obj_array;
|
return $obj_array;
|
||||||
|
}
|
||||||
|
|
||||||
$version_index = 0;
|
$version_index = 0;
|
||||||
$index = 0;
|
$index = 0;
|
||||||
|
@ -14,7 +14,6 @@ namespace App\Jobs\Company;
|
|||||||
use App\DataMapper\ClientRegistrationFields;
|
use App\DataMapper\ClientRegistrationFields;
|
||||||
use App\DataMapper\CompanySettings;
|
use App\DataMapper\CompanySettings;
|
||||||
use App\DataMapper\Tax\TaxModel;
|
use App\DataMapper\Tax\TaxModel;
|
||||||
use App\Factory\TaxRateFactory;
|
|
||||||
use App\Libraries\MultiDB;
|
use App\Libraries\MultiDB;
|
||||||
use App\Models\Company;
|
use App\Models\Company;
|
||||||
use App\Models\Country;
|
use App\Models\Country;
|
||||||
|
@ -11,23 +11,23 @@
|
|||||||
|
|
||||||
namespace App\Jobs\Entity;
|
namespace App\Jobs\Entity;
|
||||||
|
|
||||||
use App\Models\Quote;
|
|
||||||
use App\Models\Credit;
|
|
||||||
use App\Models\Invoice;
|
|
||||||
use App\Models\PurchaseOrder;
|
|
||||||
use App\Models\QuoteInvitation;
|
|
||||||
use App\Utils\Traits\MakesHash;
|
|
||||||
use App\Models\CreditInvitation;
|
|
||||||
use App\Models\RecurringInvoice;
|
|
||||||
use App\Services\Pdf\PdfService;
|
|
||||||
use App\Models\InvoiceInvitation;
|
|
||||||
use App\Utils\Traits\Pdf\PdfMaker;
|
|
||||||
use App\Utils\Traits\NumberFormatter;
|
|
||||||
use App\Utils\Traits\MakesInvoiceHtml;
|
|
||||||
use App\Models\PurchaseOrderInvitation;
|
|
||||||
use App\Utils\Traits\Pdf\PageNumbering;
|
|
||||||
use App\Exceptions\FilePermissionsFailure;
|
use App\Exceptions\FilePermissionsFailure;
|
||||||
|
use App\Models\Credit;
|
||||||
|
use App\Models\CreditInvitation;
|
||||||
|
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\RecurringInvoice;
|
||||||
use App\Models\RecurringInvoiceInvitation;
|
use App\Models\RecurringInvoiceInvitation;
|
||||||
|
use App\Services\Pdf\PdfService;
|
||||||
|
use App\Utils\Traits\MakesHash;
|
||||||
|
use App\Utils\Traits\MakesInvoiceHtml;
|
||||||
|
use App\Utils\Traits\NumberFormatter;
|
||||||
|
use App\Utils\Traits\Pdf\PageNumbering;
|
||||||
|
use App\Utils\Traits\Pdf\PdfMaker;
|
||||||
|
|
||||||
class CreateRawPdf
|
class CreateRawPdf
|
||||||
{
|
{
|
||||||
@ -72,8 +72,9 @@ class CreateRawPdf
|
|||||||
|
|
||||||
private function resolveType(): string
|
private function resolveType(): string
|
||||||
{
|
{
|
||||||
if($this->type)
|
if($this->type) {
|
||||||
return $this->type;
|
return $this->type;
|
||||||
|
}
|
||||||
|
|
||||||
$type = 'product';
|
$type = 'product';
|
||||||
|
|
||||||
|
@ -11,21 +11,21 @@
|
|||||||
|
|
||||||
namespace App\Jobs\Expense;
|
namespace App\Jobs\Expense;
|
||||||
|
|
||||||
|
use App\Libraries\MultiDB;
|
||||||
|
use App\Models\Activity;
|
||||||
|
use App\Models\Expense;
|
||||||
|
use App\Models\VendorContact;
|
||||||
|
use App\Repositories\ActivityRepository;
|
||||||
|
use App\Services\Email\Email;
|
||||||
|
use App\Services\Email\EmailObject;
|
||||||
use App\Utils\Ninja;
|
use App\Utils\Ninja;
|
||||||
use App\Utils\Number;
|
use App\Utils\Number;
|
||||||
use App\Models\Expense;
|
|
||||||
use App\Models\Activity;
|
|
||||||
use App\Libraries\MultiDB;
|
|
||||||
use App\Models\VendorContact;
|
|
||||||
use App\Services\Email\Email;
|
|
||||||
use Illuminate\Bus\Queueable;
|
|
||||||
use App\Services\Email\EmailObject;
|
|
||||||
use Illuminate\Queue\SerializesModels;
|
|
||||||
use App\Repositories\ActivityRepository;
|
|
||||||
use App\Utils\Traits\MakesDates;
|
use App\Utils\Traits\MakesDates;
|
||||||
use Illuminate\Queue\InteractsWithQueue;
|
use Illuminate\Bus\Queueable;
|
||||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||||
use Illuminate\Foundation\Bus\Dispatchable;
|
use Illuminate\Foundation\Bus\Dispatchable;
|
||||||
|
use Illuminate\Queue\InteractsWithQueue;
|
||||||
|
use Illuminate\Queue\SerializesModels;
|
||||||
|
|
||||||
class VendorExpenseNotify implements ShouldQueue
|
class VendorExpenseNotify implements ShouldQueue
|
||||||
{
|
{
|
||||||
@ -41,6 +41,9 @@ class VendorExpenseNotify implements ShouldQueue
|
|||||||
{
|
{
|
||||||
MultiDB::setDB($this->db);
|
MultiDB::setDB($this->db);
|
||||||
|
|
||||||
|
if(!$this->expense->vendor)
|
||||||
|
return;
|
||||||
|
|
||||||
$this->expense->vendor->contacts->filter(function (VendorContact $contact) {
|
$this->expense->vendor->contacts->filter(function (VendorContact $contact) {
|
||||||
return $contact->send_email && $contact->email;
|
return $contact->send_email && $contact->email;
|
||||||
})->each(function (VendorContact $contact) {
|
})->each(function (VendorContact $contact) {
|
||||||
|
@ -14,11 +14,11 @@ namespace App\Jobs\Ledger;
|
|||||||
use App\Libraries\MultiDB;
|
use App\Libraries\MultiDB;
|
||||||
use App\Models\CompanyLedger;
|
use App\Models\CompanyLedger;
|
||||||
use Illuminate\Bus\Queueable;
|
use Illuminate\Bus\Queueable;
|
||||||
use Illuminate\Queue\SerializesModels;
|
|
||||||
use Illuminate\Queue\InteractsWithQueue;
|
|
||||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||||
use Illuminate\Foundation\Bus\Dispatchable;
|
use Illuminate\Foundation\Bus\Dispatchable;
|
||||||
|
use Illuminate\Queue\InteractsWithQueue;
|
||||||
use Illuminate\Queue\Middleware\WithoutOverlapping;
|
use Illuminate\Queue\Middleware\WithoutOverlapping;
|
||||||
|
use Illuminate\Queue\SerializesModels;
|
||||||
|
|
||||||
//@deprecated
|
//@deprecated
|
||||||
class UpdateLedger implements ShouldQueue
|
class UpdateLedger implements ShouldQueue
|
||||||
@ -51,8 +51,9 @@ class UpdateLedger implements ShouldQueue
|
|||||||
|
|
||||||
nlog($cl->company_ledgerable->company_ledger()->count());
|
nlog($cl->company_ledgerable->company_ledger()->count());
|
||||||
|
|
||||||
if(!$cl)
|
if(!$cl) {
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
$entity = $cl->company_ledgerable;
|
$entity = $cl->company_ledgerable;
|
||||||
$balance = $entity->calc()->getBalance();
|
$balance = $entity->calc()->getBalance();
|
||||||
|
@ -24,7 +24,6 @@ use App\Models\Invoice;
|
|||||||
use App\Models\Payment;
|
use App\Models\Payment;
|
||||||
use App\Models\SystemLog;
|
use App\Models\SystemLog;
|
||||||
use App\Models\User;
|
use App\Models\User;
|
||||||
use App\Repositories\ActivityRepository;
|
|
||||||
use App\Utils\Ninja;
|
use App\Utils\Ninja;
|
||||||
use App\Utils\Traits\MakesHash;
|
use App\Utils\Traits\MakesHash;
|
||||||
use GuzzleHttp\Exception\ClientException;
|
use GuzzleHttp\Exception\ClientException;
|
||||||
|
@ -72,7 +72,7 @@ class EmailPayment implements ShouldQueue
|
|||||||
|
|
||||||
$email_builder = (new PaymentEmailEngine($this->payment, $this->contact))->build();
|
$email_builder = (new PaymentEmailEngine($this->payment, $this->contact))->build();
|
||||||
|
|
||||||
if($this->settings->payment_email_all_contacts && $this->payment->invoices && $this->payment->invoices->count() >= 1) {
|
if($this->payment->client->getSetting('payment_email_all_contacts') && $this->payment->invoices && $this->payment->invoices->count() >= 1) {
|
||||||
$this->emailAllContacts($email_builder);
|
$this->emailAllContacts($email_builder);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -11,21 +11,21 @@
|
|||||||
|
|
||||||
namespace App\Jobs\PurchaseOrder;
|
namespace App\Jobs\PurchaseOrder;
|
||||||
|
|
||||||
use App\Models\User;
|
|
||||||
use App\Models\Company;
|
|
||||||
use App\Libraries\MultiDB;
|
|
||||||
use App\Jobs\Util\UnlinkFile;
|
|
||||||
use Illuminate\Bus\Queueable;
|
|
||||||
use App\Jobs\Entity\CreateRawPdf;
|
use App\Jobs\Entity\CreateRawPdf;
|
||||||
use App\Jobs\Mail\NinjaMailerJob;
|
use App\Jobs\Mail\NinjaMailerJob;
|
||||||
use App\Jobs\Mail\NinjaMailerObject;
|
use App\Jobs\Mail\NinjaMailerObject;
|
||||||
|
use App\Jobs\Util\UnlinkFile;
|
||||||
|
use App\Libraries\MultiDB;
|
||||||
use App\Mail\DownloadPurchaseOrders;
|
use App\Mail\DownloadPurchaseOrders;
|
||||||
use Illuminate\Queue\SerializesModels;
|
use App\Models\Company;
|
||||||
use App\Models\PurchaseOrderInvitation;
|
use App\Models\PurchaseOrderInvitation;
|
||||||
use Illuminate\Support\Facades\Storage;
|
use App\Models\User;
|
||||||
use Illuminate\Queue\InteractsWithQueue;
|
use Illuminate\Bus\Queueable;
|
||||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||||
use Illuminate\Foundation\Bus\Dispatchable;
|
use Illuminate\Foundation\Bus\Dispatchable;
|
||||||
|
use Illuminate\Queue\InteractsWithQueue;
|
||||||
|
use Illuminate\Queue\SerializesModels;
|
||||||
|
use Illuminate\Support\Facades\Storage;
|
||||||
|
|
||||||
class ZipPurchaseOrders implements ShouldQueue
|
class ZipPurchaseOrders implements ShouldQueue
|
||||||
{
|
{
|
||||||
|
@ -39,10 +39,11 @@ class PreviewReport implements ShouldQueue
|
|||||||
/** @var \App\Export\CSV\CreditExport $export */
|
/** @var \App\Export\CSV\CreditExport $export */
|
||||||
$export = new $this->report_class($this->company, $this->request);
|
$export = new $this->report_class($this->company, $this->request);
|
||||||
|
|
||||||
if(isset($this->request['output']) && $this->request['output'] == 'json')
|
if(isset($this->request['output']) && $this->request['output'] == 'json') {
|
||||||
$report = $export->returnJson();
|
$report = $export->returnJson();
|
||||||
else
|
} else {
|
||||||
$report = $export->run();
|
$report = $export->run();
|
||||||
|
}
|
||||||
|
|
||||||
// nlog($report);
|
// nlog($report);
|
||||||
|
|
||||||
|
@ -364,23 +364,27 @@ class Import implements ShouldQueue
|
|||||||
if (isset($data['plan_expires'])) {
|
if (isset($data['plan_expires'])) {
|
||||||
unset($data['plan_expires']);
|
unset($data['plan_expires']);
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
|
|
||||||
if(isset($data['plan']))
|
if(isset($data['plan'])) {
|
||||||
$account->plan = $data['plan'];
|
$account->plan = $data['plan'];
|
||||||
|
}
|
||||||
|
|
||||||
if (isset($data['plan_term']))
|
if (isset($data['plan_term'])) {
|
||||||
$account->plan_term = $data['plan_term'];
|
$account->plan_term = $data['plan_term'];
|
||||||
|
}
|
||||||
|
|
||||||
if (isset($data['plan_paid']))
|
if (isset($data['plan_paid'])) {
|
||||||
$account->plan_paid = $data['plan_paid'];
|
$account->plan_paid = $data['plan_paid'];
|
||||||
|
}
|
||||||
|
|
||||||
if (isset($data['plan_started']))
|
if (isset($data['plan_started'])) {
|
||||||
$account->plan_started = $data['plan_started'];
|
$account->plan_started = $data['plan_started'];
|
||||||
|
}
|
||||||
|
|
||||||
if (isset($data['plan_expires']))
|
if (isset($data['plan_expires'])) {
|
||||||
$account->plan_expires = $data['plan_expires'];
|
$account->plan_expires = $data['plan_expires'];
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -11,20 +11,20 @@
|
|||||||
|
|
||||||
namespace App\Jobs\Util;
|
namespace App\Jobs\Util;
|
||||||
|
|
||||||
use Carbon\Carbon;
|
|
||||||
use App\Utils\Ninja;
|
|
||||||
use App\Models\Client;
|
|
||||||
use App\Models\Vendor;
|
|
||||||
use App\Models\Account;
|
|
||||||
use Illuminate\Support\Str;
|
|
||||||
use App\Models\ClientContact;
|
|
||||||
use Illuminate\Bus\Queueable;
|
|
||||||
use App\Factory\ClientContactFactory;
|
use App\Factory\ClientContactFactory;
|
||||||
use App\Factory\VendorContactFactory;
|
use App\Factory\VendorContactFactory;
|
||||||
use Illuminate\Queue\SerializesModels;
|
use App\Models\Account;
|
||||||
use Illuminate\Queue\InteractsWithQueue;
|
use App\Models\Client;
|
||||||
|
use App\Models\ClientContact;
|
||||||
|
use App\Models\Vendor;
|
||||||
|
use App\Utils\Ninja;
|
||||||
|
use Carbon\Carbon;
|
||||||
|
use Illuminate\Bus\Queueable;
|
||||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||||
use Illuminate\Foundation\Bus\Dispatchable;
|
use Illuminate\Foundation\Bus\Dispatchable;
|
||||||
|
use Illuminate\Queue\InteractsWithQueue;
|
||||||
|
use Illuminate\Queue\SerializesModels;
|
||||||
|
use Illuminate\Support\Str;
|
||||||
|
|
||||||
class VersionCheck implements ShouldQueue
|
class VersionCheck implements ShouldQueue
|
||||||
{
|
{
|
||||||
|
38
app/Jobs/Vendor/CreatePurchaseOrderPdf.php
vendored
38
app/Jobs/Vendor/CreatePurchaseOrderPdf.php
vendored
@ -11,29 +11,29 @@
|
|||||||
|
|
||||||
namespace App\Jobs\Vendor;
|
namespace App\Jobs\Vendor;
|
||||||
|
|
||||||
use App\Utils\Ninja;
|
|
||||||
use App\Models\Design;
|
|
||||||
use App\Libraries\MultiDB;
|
|
||||||
use Illuminate\Bus\Queueable;
|
|
||||||
use App\Utils\Traits\MakesHash;
|
|
||||||
use App\Utils\VendorHtmlEngine;
|
|
||||||
use App\Services\Pdf\PdfService;
|
|
||||||
use App\Utils\PhantomJS\Phantom;
|
|
||||||
use App\Utils\HostedPDF\NinjaPdf;
|
|
||||||
use App\Utils\Traits\Pdf\PdfMaker;
|
|
||||||
use Illuminate\Support\Facades\App;
|
|
||||||
use App\Utils\Traits\NumberFormatter;
|
|
||||||
use App\Utils\Traits\MakesInvoiceHtml;
|
|
||||||
use Illuminate\Queue\SerializesModels;
|
|
||||||
use App\Utils\Traits\Pdf\PageNumbering;
|
|
||||||
use Illuminate\Support\Facades\Storage;
|
|
||||||
use Illuminate\Queue\InteractsWithQueue;
|
|
||||||
use App\Exceptions\FilePermissionsFailure;
|
use App\Exceptions\FilePermissionsFailure;
|
||||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
use App\Libraries\MultiDB;
|
||||||
use Illuminate\Foundation\Bus\Dispatchable;
|
use App\Models\Design;
|
||||||
|
use App\Services\Pdf\PdfService;
|
||||||
use App\Services\PdfMaker\Design as PdfDesignModel;
|
use App\Services\PdfMaker\Design as PdfDesignModel;
|
||||||
use App\Services\PdfMaker\Design as PdfMakerDesign;
|
use App\Services\PdfMaker\Design as PdfMakerDesign;
|
||||||
use App\Services\PdfMaker\PdfMaker as PdfMakerService;
|
use App\Services\PdfMaker\PdfMaker as PdfMakerService;
|
||||||
|
use App\Utils\HostedPDF\NinjaPdf;
|
||||||
|
use App\Utils\Ninja;
|
||||||
|
use App\Utils\PhantomJS\Phantom;
|
||||||
|
use App\Utils\Traits\MakesHash;
|
||||||
|
use App\Utils\Traits\MakesInvoiceHtml;
|
||||||
|
use App\Utils\Traits\NumberFormatter;
|
||||||
|
use App\Utils\Traits\Pdf\PageNumbering;
|
||||||
|
use App\Utils\Traits\Pdf\PdfMaker;
|
||||||
|
use App\Utils\VendorHtmlEngine;
|
||||||
|
use Illuminate\Bus\Queueable;
|
||||||
|
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||||
|
use Illuminate\Foundation\Bus\Dispatchable;
|
||||||
|
use Illuminate\Queue\InteractsWithQueue;
|
||||||
|
use Illuminate\Queue\SerializesModels;
|
||||||
|
use Illuminate\Support\Facades\App;
|
||||||
|
use Illuminate\Support\Facades\Storage;
|
||||||
|
|
||||||
/** @deprecated 26-10-2023 5.7.30x */
|
/** @deprecated 26-10-2023 5.7.30x */
|
||||||
class CreatePurchaseOrderPdf implements ShouldQueue
|
class CreatePurchaseOrderPdf implements ShouldQueue
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
namespace App\Libraries\OAuth\Providers;
|
namespace App\Libraries\OAuth\Providers;
|
||||||
|
|
||||||
use Google_Client;
|
use Google_Client;
|
||||||
|
|
||||||
class Google implements ProviderInterface
|
class Google implements ProviderInterface
|
||||||
{
|
{
|
||||||
public function getTokenResponse($token)
|
public function getTokenResponse($token)
|
||||||
@ -38,8 +39,7 @@ class Google implements ProviderInterface
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
$userInfo = $oauth2->userinfo->get();
|
$userInfo = $oauth2->userinfo->get();
|
||||||
}
|
} catch (\Exception $e) {
|
||||||
catch (\Exception $e) {
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -11,18 +11,10 @@
|
|||||||
|
|
||||||
namespace App\Listeners;
|
namespace App\Listeners;
|
||||||
|
|
||||||
use App\Utils\Ninja;
|
|
||||||
use App\Libraries\MultiDB;
|
|
||||||
use App\Mail\User\UserAdded;
|
|
||||||
use Illuminate\Support\Carbon;
|
|
||||||
use App\Jobs\Mail\NinjaMailerJob;
|
|
||||||
use Illuminate\Support\Facades\App;
|
|
||||||
use App\Jobs\Mail\NinjaMailerObject;
|
|
||||||
use Illuminate\Queue\SerializesModels;
|
|
||||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
|
||||||
use Illuminate\Foundation\Events\Dispatchable;
|
|
||||||
use Illuminate\Broadcasting\InteractsWithSockets;
|
use Illuminate\Broadcasting\InteractsWithSockets;
|
||||||
|
use Illuminate\Foundation\Events\Dispatchable;
|
||||||
use Illuminate\Http\Client\Events\ResponseReceived;
|
use Illuminate\Http\Client\Events\ResponseReceived;
|
||||||
|
use Illuminate\Queue\SerializesModels;
|
||||||
|
|
||||||
class LogResponseReceived
|
class LogResponseReceived
|
||||||
{
|
{
|
||||||
|
@ -197,6 +197,8 @@ class PaymentEmailEngine extends BaseEmailEngine
|
|||||||
$data = [];
|
$data = [];
|
||||||
|
|
||||||
$data['$from'] = ['value' => '', 'label' => ctrans('texts.from')];
|
$data['$from'] = ['value' => '', 'label' => ctrans('texts.from')];
|
||||||
|
$data['$amount_paid'] = ['value' => '', 'label' => ctrans('texts.amount_paid')];
|
||||||
|
$data['$refund'] = ['value' => '', 'label' => ctrans('texts.refund')];
|
||||||
$data['$to'] = ['value' => '', 'label' => ctrans('texts.to')];
|
$data['$to'] = ['value' => '', 'label' => ctrans('texts.to')];
|
||||||
$data['$number'] = ['value' => $this->payment->number ?: ' ', 'label' => ctrans('texts.payment_number')];
|
$data['$number'] = ['value' => $this->payment->number ?: ' ', 'label' => ctrans('texts.payment_number')];
|
||||||
$data['$payment.number'] = &$data['$number'];
|
$data['$payment.number'] = &$data['$number'];
|
||||||
@ -207,6 +209,7 @@ class PaymentEmailEngine extends BaseEmailEngine
|
|||||||
$data['$amount'] = &$data['$payment.amount'];
|
$data['$amount'] = &$data['$payment.amount'];
|
||||||
$data['$payment.date'] = ['value' => $this->translateDate($this->payment->date, $this->client->date_format(), $this->client->locale()), 'label' => ctrans('texts.payment_date')];
|
$data['$payment.date'] = ['value' => $this->translateDate($this->payment->date, $this->client->date_format(), $this->client->locale()), 'label' => ctrans('texts.payment_date')];
|
||||||
$data['$transaction_reference'] = ['value' => $this->payment->transaction_reference, 'label' => ctrans('texts.transaction_reference')];
|
$data['$transaction_reference'] = ['value' => $this->payment->transaction_reference, 'label' => ctrans('texts.transaction_reference')];
|
||||||
|
$data['$reference'] = ['value' => '', 'label' => ctrans('texts.reference')];
|
||||||
$data['$public_notes'] = ['value' => $this->payment->public_notes, 'label' => ctrans('texts.notes')];
|
$data['$public_notes'] = ['value' => $this->payment->public_notes, 'label' => ctrans('texts.notes')];
|
||||||
|
|
||||||
$data['$payment1'] = ['value' => $this->helpers->formatCustomFieldValue($this->company->custom_fields, 'payment1', $this->payment->custom_value1, $this->client) ?: ' ', 'label' => $this->helpers->makeCustomField($this->company->custom_fields, 'payment1')];
|
$data['$payment1'] = ['value' => $this->helpers->formatCustomFieldValue($this->company->custom_fields, 'payment1', $this->payment->custom_value1, $this->client) ?: ' ', 'label' => $this->helpers->makeCustomField($this->company->custom_fields, 'payment1')];
|
||||||
|
@ -11,17 +11,17 @@
|
|||||||
|
|
||||||
namespace App\Mail\Engine;
|
namespace App\Mail\Engine;
|
||||||
|
|
||||||
use App\Utils\Ninja;
|
use App\DataMapper\EmailTemplateDefaults;
|
||||||
use App\Utils\Number;
|
use App\Jobs\Entity\CreateRawPdf;
|
||||||
use App\Models\Vendor;
|
|
||||||
use App\Models\Account;
|
use App\Models\Account;
|
||||||
use App\Models\PurchaseOrder;
|
use App\Models\PurchaseOrder;
|
||||||
|
use App\Models\Vendor;
|
||||||
|
use App\Utils\Ninja;
|
||||||
|
use App\Utils\Number;
|
||||||
use App\Utils\Traits\MakesHash;
|
use App\Utils\Traits\MakesHash;
|
||||||
use App\Utils\VendorHtmlEngine;
|
use App\Utils\VendorHtmlEngine;
|
||||||
use App\Jobs\Entity\CreateRawPdf;
|
|
||||||
use Illuminate\Support\Facades\App;
|
use Illuminate\Support\Facades\App;
|
||||||
use Illuminate\Support\Facades\URL;
|
use Illuminate\Support\Facades\URL;
|
||||||
use App\DataMapper\EmailTemplateDefaults;
|
|
||||||
|
|
||||||
class PurchaseOrderEmailEngine extends BaseEmailEngine
|
class PurchaseOrderEmailEngine extends BaseEmailEngine
|
||||||
{
|
{
|
||||||
|
@ -11,22 +11,21 @@
|
|||||||
|
|
||||||
namespace App\Models;
|
namespace App\Models;
|
||||||
|
|
||||||
use App\Utils\Ninja;
|
|
||||||
use App\Casts\EncryptedCast;
|
use App\Casts\EncryptedCast;
|
||||||
use App\Models\VendorContact;
|
|
||||||
use App\Utils\Traits\AppSetup;
|
|
||||||
use App\Utils\Traits\MakesHash;
|
|
||||||
use App\DataMapper\CompanySettings;
|
use App\DataMapper\CompanySettings;
|
||||||
use Illuminate\Support\Facades\App;
|
|
||||||
use Illuminate\Support\Facades\Cache;
|
|
||||||
use Laracasts\Presenter\PresentableTrait;
|
|
||||||
use App\Utils\Traits\CompanySettingsSaver;
|
|
||||||
use Illuminate\Notifications\Notification;
|
|
||||||
use App\Models\Presenters\CompanyPresenter;
|
use App\Models\Presenters\CompanyPresenter;
|
||||||
use App\Services\Company\CompanyService;
|
use App\Services\Company\CompanyService;
|
||||||
use App\Services\Notification\NotificationService;
|
use App\Services\Notification\NotificationService;
|
||||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
use App\Utils\Ninja;
|
||||||
|
use App\Utils\Traits\AppSetup;
|
||||||
|
use App\Utils\Traits\CompanySettingsSaver;
|
||||||
|
use App\Utils\Traits\MakesHash;
|
||||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||||
|
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||||
|
use Illuminate\Notifications\Notification;
|
||||||
|
use Illuminate\Support\Facades\App;
|
||||||
|
use Illuminate\Support\Facades\Cache;
|
||||||
|
use Laracasts\Presenter\PresentableTrait;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* App\Models\Company
|
* App\Models\Company
|
||||||
|
@ -11,7 +11,6 @@
|
|||||||
|
|
||||||
namespace App\Models;
|
namespace App\Models;
|
||||||
|
|
||||||
use App\Helpers\Document\WithTypeHelpers;
|
|
||||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||||
use Illuminate\Support\Facades\Storage;
|
use Illuminate\Support\Facades\Storage;
|
||||||
|
|
||||||
@ -211,8 +210,9 @@ class Document extends BaseModel
|
|||||||
$image = $this->getFile();
|
$image = $this->getFile();
|
||||||
$catch_image = $image;
|
$catch_image = $image;
|
||||||
|
|
||||||
if(!extension_loaded('imagick'))
|
if(!extension_loaded('imagick')) {
|
||||||
return $catch_image;
|
return $catch_image;
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$file = base64_encode($image);
|
$file = base64_encode($image);
|
||||||
@ -224,8 +224,7 @@ class Document extends BaseModel
|
|||||||
|
|
||||||
return $img->getImageBlob();
|
return $img->getImageBlob();
|
||||||
|
|
||||||
}
|
} catch(\Exception $e) {
|
||||||
catch(\Exception $e){
|
|
||||||
|
|
||||||
nlog($e->getMessage());
|
nlog($e->getMessage());
|
||||||
return $catch_image;
|
return $catch_image;
|
||||||
|
@ -203,6 +203,11 @@ class Expense extends BaseModel
|
|||||||
return $this->belongsTo(Currency::class);
|
return $this->belongsTo(Currency::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function invoice_currency(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||||
|
{
|
||||||
|
return $this->belongsTo(Currency::class);
|
||||||
|
}
|
||||||
|
|
||||||
public function category(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
public function category(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||||
{
|
{
|
||||||
return $this->belongsTo(ExpenseCategory::class)->withTrashed();
|
return $this->belongsTo(ExpenseCategory::class)->withTrashed();
|
||||||
|
@ -269,6 +269,11 @@ class PurchaseOrder extends BaseModel
|
|||||||
return $this->belongsTo(Client::class)->withTrashed();
|
return $this->belongsTo(Client::class)->withTrashed();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function currency(): \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||||
|
{
|
||||||
|
return $this->belongsTo(Currency::class);
|
||||||
|
}
|
||||||
|
|
||||||
public function markInvitationsSent(): void
|
public function markInvitationsSent(): void
|
||||||
{
|
{
|
||||||
$this->invitations->each(function ($invitation) {
|
$this->invitations->each(function ($invitation) {
|
||||||
|
@ -19,6 +19,8 @@ use Illuminate\Support\Carbon;
|
|||||||
* App\Models\Task
|
* App\Models\Task
|
||||||
*
|
*
|
||||||
* @property int $id
|
* @property int $id
|
||||||
|
* @property string|null $hash
|
||||||
|
* @property object|null $meta
|
||||||
* @property int $user_id
|
* @property int $user_id
|
||||||
* @property int|null $assigned_user_id
|
* @property int|null $assigned_user_id
|
||||||
* @property int $company_id
|
* @property int $company_id
|
||||||
@ -118,6 +120,15 @@ class Task extends BaseModel
|
|||||||
'number',
|
'number',
|
||||||
'is_date_based',
|
'is_date_based',
|
||||||
'status_order',
|
'status_order',
|
||||||
|
'hash',
|
||||||
|
'meta',
|
||||||
|
];
|
||||||
|
|
||||||
|
protected $casts = [
|
||||||
|
'meta' => 'object',
|
||||||
|
'updated_at' => 'timestamp',
|
||||||
|
'created_at' => 'timestamp',
|
||||||
|
'deleted_at' => 'timestamp',
|
||||||
];
|
];
|
||||||
|
|
||||||
protected $touches = [];
|
protected $touches = [];
|
||||||
@ -164,11 +175,13 @@ class Task extends BaseModel
|
|||||||
|
|
||||||
public function stringStatus()
|
public function stringStatus()
|
||||||
{
|
{
|
||||||
if($this->invoice_id)
|
if($this->invoice_id) {
|
||||||
return '<h5><span class="badge badge-success">'.ctrans('texts.invoiced').'</span></h5>';
|
return '<h5><span class="badge badge-success">'.ctrans('texts.invoiced').'</span></h5>';
|
||||||
|
}
|
||||||
|
|
||||||
if($this->status)
|
if($this->status) {
|
||||||
return '<h5><span class="badge badge-primary">' . $this->status?->name ?? '';
|
return '<h5><span class="badge badge-primary">' . $this->status?->name ?? '';
|
||||||
|
}
|
||||||
|
|
||||||
return '';
|
return '';
|
||||||
|
|
||||||
@ -260,13 +273,15 @@ class Task extends BaseModel
|
|||||||
|
|
||||||
$parent_entity = $this->client ?? $this->company;
|
$parent_entity = $this->client ?? $this->company;
|
||||||
|
|
||||||
if($log[0])
|
if($log[0]) {
|
||||||
$log[0] = Carbon::createFromTimestamp($log[0])->format($parent_entity->date_format().' H:i:s');
|
$log[0] = Carbon::createFromTimestamp($log[0])->format($parent_entity->date_format().' H:i:s');
|
||||||
|
}
|
||||||
|
|
||||||
if($log[1] && $log[1] != 0)
|
if($log[1] && $log[1] != 0) {
|
||||||
$log[1] = Carbon::createFromTimestamp($log[1])->format($parent_entity->date_format().' H:i:s');
|
$log[1] = Carbon::createFromTimestamp($log[1])->format($parent_entity->date_format().' H:i:s');
|
||||||
else
|
} else {
|
||||||
$log[1] = ctrans('texts.running');
|
$log[1] = ctrans('texts.running');
|
||||||
|
}
|
||||||
|
|
||||||
return $log;
|
return $log;
|
||||||
})->toArray();
|
})->toArray();
|
||||||
@ -284,20 +299,19 @@ class Task extends BaseModel
|
|||||||
|
|
||||||
if($log[0] && $log[1] !=0) {
|
if($log[0] && $log[1] !=0) {
|
||||||
$duration = $log[1] - $log[0];
|
$duration = $log[1] - $log[0];
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
$duration = 0;
|
$duration = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if($log[0])
|
if($log[0]) {
|
||||||
$logged['start_date_raw'] = $log[0];
|
$logged['start_date_raw'] = $log[0];
|
||||||
|
}
|
||||||
$logged['start_date'] = Carbon::createFromTimestamp($log[0])->setTimeZone($this->company->timezone()->name)->format($parent_entity->date_format().' H:i:s');
|
$logged['start_date'] = Carbon::createFromTimestamp($log[0])->setTimeZone($this->company->timezone()->name)->format($parent_entity->date_format().' H:i:s');
|
||||||
|
|
||||||
if($log[1] && $log[1] != 0) {
|
if($log[1] && $log[1] != 0) {
|
||||||
$logged['end_date_raw'] = $log[1];
|
$logged['end_date_raw'] = $log[1];
|
||||||
$logged['end_date'] = Carbon::createFromTimestamp($log[1])->setTimeZone($this->company->timezone()->name)->format($parent_entity->date_format().' H:i:s');
|
$logged['end_date'] = Carbon::createFromTimestamp($log[1])->setTimeZone($this->company->timezone()->name)->format($parent_entity->date_format().' H:i:s');
|
||||||
}
|
} else {
|
||||||
else{
|
|
||||||
$logged['end_date_raw'] = 0;
|
$logged['end_date_raw'] = 0;
|
||||||
$logged['end_date'] = ctrans('texts.running');
|
$logged['end_date'] = ctrans('texts.running');
|
||||||
}
|
}
|
||||||
|
@ -71,4 +71,5 @@ class TaskStatus extends BaseModel
|
|||||||
'color',
|
'color',
|
||||||
'status_order',
|
'status_order',
|
||||||
];
|
];
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -21,7 +21,6 @@ use App\Models\SystemLog;
|
|||||||
use App\Utils\Traits\MakesHash;
|
use App\Utils\Traits\MakesHash;
|
||||||
use Carbon\Carbon;
|
use Carbon\Carbon;
|
||||||
use Illuminate\Support\Facades\Http;
|
use Illuminate\Support\Facades\Http;
|
||||||
use Omnipay\Omnipay;
|
|
||||||
use Str;
|
use Str;
|
||||||
|
|
||||||
class PayPalPPCPPaymentDriver extends BaseDriver
|
class PayPalPPCPPaymentDriver extends BaseDriver
|
||||||
@ -145,8 +144,9 @@ class PayPalPPCPPaymentDriver extends BaseDriver
|
|||||||
$secret = config('ninja.paypal.secret');
|
$secret = config('ninja.paypal.secret');
|
||||||
$client_id = config('ninja.paypal.client_id');
|
$client_id = config('ninja.paypal.client_id');
|
||||||
|
|
||||||
if($this->access_token && $this->token_expiry && $this->token_expiry->isFuture())
|
if($this->access_token && $this->token_expiry && $this->token_expiry->isFuture()) {
|
||||||
return $this;
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
$response = Http::withBasicAuth($client_id, $secret)
|
$response = Http::withBasicAuth($client_id, $secret)
|
||||||
->withHeaders(['Content-Type' => 'application/x-www-form-urlencoded'])
|
->withHeaders(['Content-Type' => 'application/x-www-form-urlencoded'])
|
||||||
@ -203,8 +203,9 @@ class PayPalPPCPPaymentDriver extends BaseDriver
|
|||||||
$this->company_gateway = $this->company_gateway->fresh();
|
$this->company_gateway = $this->company_gateway->fresh();
|
||||||
$config = $this->company_gateway->getConfig();
|
$config = $this->company_gateway->getConfig();
|
||||||
|
|
||||||
if($config->status == 'activated')
|
if($config->status == 'activated') {
|
||||||
return $this;
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -241,8 +242,9 @@ class PayPalPPCPPaymentDriver extends BaseDriver
|
|||||||
|
|
||||||
$r = $this->gatewayRequest('/v1/identity/generate-token', 'post', ['body' => '']);
|
$r = $this->gatewayRequest('/v1/identity/generate-token', 'post', ['body' => '']);
|
||||||
|
|
||||||
if($r->successful())
|
if($r->successful()) {
|
||||||
return $r->json()['client_token'];
|
return $r->json()['client_token'];
|
||||||
|
}
|
||||||
|
|
||||||
throw new PaymentFailed('Unable to gain client token from Paypal. Check your configuration', 401);
|
throw new PaymentFailed('Unable to gain client token from Paypal. Check your configuration', 401);
|
||||||
|
|
||||||
@ -278,8 +280,9 @@ class PayPalPPCPPaymentDriver extends BaseDriver
|
|||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
if(isset($response['headers']) ?? false)
|
if(isset($response['headers']) ?? false) {
|
||||||
unset($response['headers']);
|
unset($response['headers']);
|
||||||
|
}
|
||||||
|
|
||||||
SystemLogger::dispatch(
|
SystemLogger::dispatch(
|
||||||
['response' => $response],
|
['response' => $response],
|
||||||
|
@ -12,16 +12,16 @@
|
|||||||
|
|
||||||
namespace App\Repositories;
|
namespace App\Repositories;
|
||||||
|
|
||||||
use App\Models\Expense;
|
|
||||||
use Illuminate\Support\Carbon;
|
|
||||||
use App\Factory\ExpenseFactory;
|
use App\Factory\ExpenseFactory;
|
||||||
|
use App\Jobs\Expense\VendorExpenseNotify;
|
||||||
|
use App\Libraries\Currency\Conversion\CurrencyApi;
|
||||||
|
use App\Models\Expense;
|
||||||
use App\Models\ExpenseCategory;
|
use App\Models\ExpenseCategory;
|
||||||
use App\Utils\Traits\GeneratesCounter;
|
use App\Utils\Traits\GeneratesCounter;
|
||||||
use Illuminate\Database\QueryException;
|
|
||||||
use App\Jobs\Expense\VendorExpenseNotify;
|
|
||||||
use Illuminate\Database\Eloquent\Collection;
|
|
||||||
use Carbon\Exceptions\InvalidFormatException;
|
use Carbon\Exceptions\InvalidFormatException;
|
||||||
use App\Libraries\Currency\Conversion\CurrencyApi;
|
use Illuminate\Database\Eloquent\Collection;
|
||||||
|
use Illuminate\Database\QueryException;
|
||||||
|
use Illuminate\Support\Carbon;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ExpenseRepository.
|
* ExpenseRepository.
|
||||||
@ -48,8 +48,7 @@ class ExpenseRepository extends BaseRepository
|
|||||||
|
|
||||||
if(isset($data['payment_date']) && $data['payment_date'] == $expense->payment_date) {
|
if(isset($data['payment_date']) && $data['payment_date'] == $expense->payment_date) {
|
||||||
//do nothing
|
//do nothing
|
||||||
}
|
} elseif(isset($data['payment_date']) && strlen($data['payment_date']) > 1 && $user->company()->notify_vendor_when_paid && ($data['vendor_id'] || $expense->vendor_id)) {
|
||||||
elseif(isset($data['payment_date']) && strlen($data['payment_date']) > 1 && $user->company()->notify_vendor_when_paid && ($data['vendor_id'] || $expense->vendor_id)) {
|
|
||||||
nlog("ping");
|
nlog("ping");
|
||||||
$this->notify_vendor = true;
|
$this->notify_vendor = true;
|
||||||
}
|
}
|
||||||
@ -62,16 +61,17 @@ class ExpenseRepository extends BaseRepository
|
|||||||
|
|
||||||
if (empty($expense->number)) {
|
if (empty($expense->number)) {
|
||||||
$expense = $this->findAndSaveNumber($expense);
|
$expense = $this->findAndSaveNumber($expense);
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
$expense->saveQuietly();
|
$expense->saveQuietly();
|
||||||
|
}
|
||||||
|
|
||||||
if (array_key_exists('documents', $data)) {
|
if (array_key_exists('documents', $data)) {
|
||||||
$this->saveDocuments($data['documents'], $expense);
|
$this->saveDocuments($data['documents'], $expense);
|
||||||
}
|
}
|
||||||
|
|
||||||
if($this->notify_vendor)
|
if($this->notify_vendor) {
|
||||||
VendorExpenseNotify::dispatch($expense, $expense->company->db);
|
VendorExpenseNotify::dispatch($expense, $expense->company->db);
|
||||||
|
}
|
||||||
|
|
||||||
return $expense;
|
return $expense;
|
||||||
}
|
}
|
||||||
|
@ -11,17 +11,16 @@
|
|||||||
|
|
||||||
namespace App\Services\Client;
|
namespace App\Services\Client;
|
||||||
|
|
||||||
use Carbon\Carbon;
|
|
||||||
use App\Utils\Number;
|
|
||||||
use App\Models\Client;
|
use App\Models\Client;
|
||||||
use App\Models\Credit;
|
use App\Models\Credit;
|
||||||
use App\Models\Invoice;
|
use App\Models\Invoice;
|
||||||
use App\Models\Payment;
|
use App\Models\Payment;
|
||||||
use App\Services\Email\Email;
|
use App\Services\Email\Email;
|
||||||
use App\Utils\Traits\MakesDates;
|
|
||||||
use Illuminate\Support\Facades\DB;
|
|
||||||
use App\Services\Email\EmailObject;
|
use App\Services\Email\EmailObject;
|
||||||
|
use App\Utils\Number;
|
||||||
|
use App\Utils\Traits\MakesDates;
|
||||||
use Illuminate\Mail\Mailables\Address;
|
use Illuminate\Mail\Mailables\Address;
|
||||||
|
use Illuminate\Support\Facades\DB;
|
||||||
|
|
||||||
class ClientService
|
class ClientService
|
||||||
{
|
{
|
||||||
|
@ -438,8 +438,7 @@ class Statement
|
|||||||
$query->where(function ($q) use ($to, $from) {
|
$query->where(function ($q) use ($to, $from) {
|
||||||
$q->whereBetween('due_date', [$to, $from])->orWhereNull('due_date');
|
$q->whereBetween('due_date', [$to, $from])->orWhereNull('due_date');
|
||||||
});
|
});
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
$query->whereBetween('due_date', [$to, $from]);
|
$query->whereBetween('due_date', [$to, $from]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -11,11 +11,12 @@
|
|||||||
|
|
||||||
namespace App\Services\Company;
|
namespace App\Services\Company;
|
||||||
|
|
||||||
use App\Models\User;
|
|
||||||
use App\Models\Company;
|
|
||||||
use App\Factory\TaxRateFactory;
|
use App\Factory\TaxRateFactory;
|
||||||
|
use App\Models\Company;
|
||||||
|
use App\Models\User;
|
||||||
|
|
||||||
class CompanyService{
|
class CompanyService
|
||||||
|
{
|
||||||
|
|
||||||
public function __construct(public Company $company)
|
public function __construct(public Company $company)
|
||||||
{
|
{
|
||||||
|
@ -11,11 +11,10 @@
|
|||||||
|
|
||||||
namespace App\Services\Ledger;
|
namespace App\Services\Ledger;
|
||||||
|
|
||||||
use App\Models\Activity;
|
|
||||||
use App\Models\CompanyLedger;
|
|
||||||
use App\Jobs\Ledger\UpdateLedger;
|
|
||||||
use App\Factory\CompanyLedgerFactory;
|
use App\Factory\CompanyLedgerFactory;
|
||||||
use App\Jobs\Ledger\ClientLedgerBalanceUpdate;
|
use App\Jobs\Ledger\ClientLedgerBalanceUpdate;
|
||||||
|
use App\Models\Activity;
|
||||||
|
use App\Models\CompanyLedger;
|
||||||
|
|
||||||
class LedgerService
|
class LedgerService
|
||||||
{
|
{
|
||||||
@ -45,8 +44,9 @@ class LedgerService
|
|||||||
public function updateInvoiceBalance($adjustment, $notes = '')
|
public function updateInvoiceBalance($adjustment, $notes = '')
|
||||||
{
|
{
|
||||||
|
|
||||||
if($adjustment == 0)
|
if($adjustment == 0) {
|
||||||
return $this;
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
// $timestamp = \Carbon\Carbon::createFromTimestamp($this->entity->updated_at)->format('ymdhhmmssSS');
|
// $timestamp = \Carbon\Carbon::createFromTimestamp($this->entity->updated_at)->format('ymdhhmmssSS');
|
||||||
// $hash = sha1($adjustment.$notes.$this->entity->status_id.$this->entity->client_id.$this->entity->amount.$this->entity->balance.$this->entity->company_id.Activity::UPDATE_INVOICE);
|
// $hash = sha1($adjustment.$notes.$this->entity->status_id.$this->entity->client_id.$this->entity->amount.$this->entity->balance.$this->entity->company_id.Activity::UPDATE_INVOICE);
|
||||||
|
@ -432,6 +432,8 @@ class PdfMock
|
|||||||
'$credit_no' => '0029',
|
'$credit_no' => '0029',
|
||||||
'$font_size' => $this->settings->font_size,
|
'$font_size' => $this->settings->font_size,
|
||||||
'$view_link' => '<a class="button" href="http://ninja.test:8000/client/invoice/UAUY8vIPuno72igmXbbpldwo5BDDKIqs">View Invoice</a>',
|
'$view_link' => '<a class="button" href="http://ninja.test:8000/client/invoice/UAUY8vIPuno72igmXbbpldwo5BDDKIqs">View Invoice</a>',
|
||||||
|
'$reference' => '',
|
||||||
|
'$po_number' => 'PO12345',
|
||||||
'$page_size' => $this->settings->page_size,
|
'$page_size' => $this->settings->page_size,
|
||||||
'$country_2' => 'AF',
|
'$country_2' => 'AF',
|
||||||
'$firstName' => 'Benedict',
|
'$firstName' => 'Benedict',
|
||||||
@ -464,6 +466,7 @@ class PdfMock
|
|||||||
'$client4' => 'custom value',
|
'$client4' => 'custom value',
|
||||||
'$dueDate' => '2022-01-01',
|
'$dueDate' => '2022-01-01',
|
||||||
'$invoice' => '0029',
|
'$invoice' => '0029',
|
||||||
|
'$invoices' => '0029',
|
||||||
'$account' => '434343',
|
'$account' => '434343',
|
||||||
'$country' => 'United States',
|
'$country' => 'United States',
|
||||||
'$contact' => 'Benedict Eichmann',
|
'$contact' => 'Benedict Eichmann',
|
||||||
@ -501,6 +504,13 @@ class PdfMock
|
|||||||
'$show_shipping_address_visibility' => $this->settings->show_shipping_address ? 'visible' : 'hidden',
|
'$show_shipping_address_visibility' => $this->settings->show_shipping_address ? 'visible' : 'hidden',
|
||||||
'$start_date' => '31/01/2023',
|
'$start_date' => '31/01/2023',
|
||||||
'$end_date' => '31/12/2023',
|
'$end_date' => '31/12/2023',
|
||||||
|
'$history' => '',
|
||||||
|
'$amount_paid' => '',
|
||||||
|
'$receipt' => '',
|
||||||
|
'$ship_to' => '',
|
||||||
|
'$delivery_note' => '',
|
||||||
|
'$quantity' => '',
|
||||||
|
'$order_number' => '',
|
||||||
],
|
],
|
||||||
'labels' => $this->mockTranslatedLabels(),
|
'labels' => $this->mockTranslatedLabels(),
|
||||||
];
|
];
|
||||||
@ -751,6 +761,7 @@ class PdfMock
|
|||||||
'$user_iban_label' => ctrans('texts.iban'),
|
'$user_iban_label' => ctrans('texts.iban'),
|
||||||
'$signature_label' => ctrans('texts.signature'),
|
'$signature_label' => ctrans('texts.signature'),
|
||||||
'$font_size_label' => ctrans('texts.font_size'),
|
'$font_size_label' => ctrans('texts.font_size'),
|
||||||
|
'$reference_label' => ctrans('texts.reference'),
|
||||||
'$po_number_label' => ctrans('texts.po_number'),
|
'$po_number_label' => ctrans('texts.po_number'),
|
||||||
'$page_size_label' => ctrans('texts.page_size'),
|
'$page_size_label' => ctrans('texts.page_size'),
|
||||||
'$user.name_label' => ctrans('texts.name'),
|
'$user.name_label' => ctrans('texts.name'),
|
||||||
@ -821,6 +832,15 @@ class PdfMock
|
|||||||
'$to_label' => ctrans('texts.to'),
|
'$to_label' => ctrans('texts.to'),
|
||||||
'$start_date_label' => ctrans('texts.start_date'),
|
'$start_date_label' => ctrans('texts.start_date'),
|
||||||
'$end_date_label' => ctrans('texts.end_date'),
|
'$end_date_label' => ctrans('texts.end_date'),
|
||||||
|
'$invoice_label' => ctrans('texts.invoice'),
|
||||||
|
'$invoices_label' => ctrans('texts.invoices'),
|
||||||
|
'$history_label' => ctrans('texts.history'),
|
||||||
|
'$amount_paid_label' => ctrans('texts.amount_paid'),
|
||||||
|
'$receipt_label' => ctrans('texts.receipt'),
|
||||||
|
'$ship_to_label' => ctrans('texts.ship_to'),
|
||||||
|
'$delivery_note_label' => ctrans('texts.delivery_note'),
|
||||||
|
'$quantity_label' => ctrans('texts.quantity'),
|
||||||
|
'$order_number_label' => ctrans('texts.order_number'),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1018,6 +1038,7 @@ class PdfMock
|
|||||||
'$amount_raw' => '10256.40',
|
'$amount_raw' => '10256.40',
|
||||||
'$vat_number' => 'At qui autem iusto et.',
|
'$vat_number' => 'At qui autem iusto et.',
|
||||||
'$portal_url' => 'http://ninja.test:8000/vendor/',
|
'$portal_url' => 'http://ninja.test:8000/vendor/',
|
||||||
|
'$reference' => '',
|
||||||
'$po_number' => null,
|
'$po_number' => null,
|
||||||
'$statement' => '',
|
'$statement' => '',
|
||||||
'$view_link' => '
|
'$view_link' => '
|
||||||
@ -1133,6 +1154,12 @@ class PdfMock
|
|||||||
'$dir' => 'ltr',
|
'$dir' => 'ltr',
|
||||||
'$net' => 'Net',
|
'$net' => 'Net',
|
||||||
'$to' => '',
|
'$to' => '',
|
||||||
|
'$amount_paid' => '',
|
||||||
|
'$receipt' => '',
|
||||||
|
'$ship_to' => '',
|
||||||
|
'$delivery_note_label' => '',
|
||||||
|
'$quantity_label' => '',
|
||||||
|
'$order_number_label' => '',
|
||||||
],
|
],
|
||||||
'labels' => $this->vendorLabels(),
|
'labels' => $this->vendorLabels(),
|
||||||
];
|
];
|
||||||
@ -1286,6 +1313,7 @@ class PdfMock
|
|||||||
'$amount_raw_label' => ctrans('texts.amount'),
|
'$amount_raw_label' => ctrans('texts.amount'),
|
||||||
'$vat_number_label' => ctrans('texts.vat_number'),
|
'$vat_number_label' => ctrans('texts.vat_number'),
|
||||||
'$portal_url_label' => ctrans('texts.link'),
|
'$portal_url_label' => ctrans('texts.link'),
|
||||||
|
'$reference_label' => ctrans('texts.reference'),
|
||||||
'$po_number_label' => ctrans('texts.po_number'),
|
'$po_number_label' => ctrans('texts.po_number'),
|
||||||
'$statement_label' => ctrans('texts.statement'),
|
'$statement_label' => ctrans('texts.statement'),
|
||||||
'$view_link_label' => ctrans('texts.link'),
|
'$view_link_label' => ctrans('texts.link'),
|
||||||
@ -1355,6 +1383,12 @@ class PdfMock
|
|||||||
'$net_label' => ctrans('texts.net'),
|
'$net_label' => ctrans('texts.net'),
|
||||||
'$dir_label' => '',
|
'$dir_label' => '',
|
||||||
'$to_label' => ctrans('texts.to'),
|
'$to_label' => ctrans('texts.to'),
|
||||||
|
'$amount_paid_label' => ctrans('texts.amount_paid'),
|
||||||
|
'$receipt_label' => ctrans('texts.receipt'),
|
||||||
|
'$ship_to_label' => ctrans('texts.ship_to'),
|
||||||
|
'$delivery_note_label' => ctrans('texts.delivery_note'),
|
||||||
|
'$quantity_label' => ctrans('texts.quantity'),
|
||||||
|
'$order_number_label' => ctrans('texts.order_number'),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -11,20 +11,20 @@
|
|||||||
|
|
||||||
namespace App\Services\Pdf;
|
namespace App\Services\Pdf;
|
||||||
|
|
||||||
use App\Models\Company;
|
|
||||||
use App\Models\Invoice;
|
|
||||||
use App\Utils\HtmlEngine;
|
|
||||||
use App\Models\QuoteInvitation;
|
|
||||||
use App\Utils\VendorHtmlEngine;
|
|
||||||
use App\Models\CreditInvitation;
|
|
||||||
use App\Utils\PhantomJS\Phantom;
|
|
||||||
use App\Models\InvoiceInvitation;
|
|
||||||
use App\Utils\HostedPDF\NinjaPdf;
|
|
||||||
use App\Utils\Traits\Pdf\PdfMaker;
|
|
||||||
use App\Jobs\Invoice\CreateEInvoice;
|
use App\Jobs\Invoice\CreateEInvoice;
|
||||||
|
use App\Models\Company;
|
||||||
|
use App\Models\CreditInvitation;
|
||||||
|
use App\Models\Invoice;
|
||||||
|
use App\Models\InvoiceInvitation;
|
||||||
use App\Models\PurchaseOrderInvitation;
|
use App\Models\PurchaseOrderInvitation;
|
||||||
use App\Utils\Traits\Pdf\PageNumbering;
|
use App\Models\QuoteInvitation;
|
||||||
use App\Models\RecurringInvoiceInvitation;
|
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;
|
||||||
use horstoeko\zugferd\ZugferdDocumentPdfBuilder;
|
use horstoeko\zugferd\ZugferdDocumentPdfBuilder;
|
||||||
|
|
||||||
class PdfService
|
class PdfService
|
||||||
@ -179,8 +179,9 @@ class PdfService
|
|||||||
*/
|
*/
|
||||||
private function checkEInvoice(string $pdf): string
|
private function checkEInvoice(string $pdf): string
|
||||||
{
|
{
|
||||||
if(!$this->config->entity instanceof Invoice)
|
if(!$this->config->entity instanceof Invoice) {
|
||||||
return $pdf;
|
return $pdf;
|
||||||
|
}
|
||||||
|
|
||||||
$e_invoice_type = $this->config->settings->e_invoice_type;
|
$e_invoice_type = $this->config->settings->e_invoice_type;
|
||||||
|
|
||||||
|
@ -85,8 +85,9 @@ class TaxSummaryReport extends BaseExport
|
|||||||
$this->csv->insertOne([ctrans('texts.tax_summary')]);
|
$this->csv->insertOne([ctrans('texts.tax_summary')]);
|
||||||
$this->csv->insertOne([ctrans('texts.created_on'),' ',$this->translateDate(now()->format('Y-m-d'), $this->company->date_format(), $this->company->locale())]);
|
$this->csv->insertOne([ctrans('texts.created_on'),' ',$this->translateDate(now()->format('Y-m-d'), $this->company->date_format(), $this->company->locale())]);
|
||||||
|
|
||||||
if($this->input['date_range'] != 'all')
|
if($this->input['date_range'] != 'all') {
|
||||||
$this->csv->insertOne([ctrans('texts.date_range'),' ',$this->translateDate($this->start_date, $this->company->date_format(), $this->company->locale()),' - ',$this->translateDate($this->end_date, $this->company->date_format(), $this->company->locale())]);
|
$this->csv->insertOne([ctrans('texts.date_range'),' ',$this->translateDate($this->start_date, $this->company->date_format(), $this->company->locale()),' - ',$this->translateDate($this->end_date, $this->company->date_format(), $this->company->locale())]);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
File diff suppressed because one or more lines are too long
@ -11,32 +11,32 @@
|
|||||||
|
|
||||||
namespace App\Services\Template;
|
namespace App\Services\Template;
|
||||||
|
|
||||||
use App\Models\User;
|
|
||||||
use App\Models\Quote;
|
|
||||||
use App\Utils\Number;
|
|
||||||
use Twig\Error\Error;
|
|
||||||
use App\Models\Client;
|
use App\Models\Client;
|
||||||
|
use App\Models\Company;
|
||||||
use App\Models\Credit;
|
use App\Models\Credit;
|
||||||
use App\Models\Design;
|
use App\Models\Design;
|
||||||
use App\Models\Vendor;
|
|
||||||
use App\Models\Company;
|
|
||||||
use App\Models\Invoice;
|
use App\Models\Invoice;
|
||||||
use App\Models\Payment;
|
use App\Models\Payment;
|
||||||
use App\Models\Project;
|
use App\Models\Project;
|
||||||
use App\Utils\HtmlEngine;
|
|
||||||
use Twig\Error\LoaderError;
|
|
||||||
use Twig\Error\SyntaxError;
|
|
||||||
use Twig\Error\RuntimeError;
|
|
||||||
use App\Models\PurchaseOrder;
|
use App\Models\PurchaseOrder;
|
||||||
use App\Utils\VendorHtmlEngine;
|
use App\Models\Quote;
|
||||||
use Twig\Sandbox\SecurityError;
|
|
||||||
use App\Models\RecurringInvoice;
|
use App\Models\RecurringInvoice;
|
||||||
|
use App\Models\User;
|
||||||
|
use App\Models\Vendor;
|
||||||
|
use App\Utils\HostedPDF\NinjaPdf;
|
||||||
|
use App\Utils\HtmlEngine;
|
||||||
|
use App\Utils\Number;
|
||||||
use App\Utils\PaymentHtmlEngine;
|
use App\Utils\PaymentHtmlEngine;
|
||||||
use App\Utils\Traits\MakesDates;
|
use App\Utils\Traits\MakesDates;
|
||||||
use App\Utils\HostedPDF\NinjaPdf;
|
|
||||||
use App\Utils\Traits\Pdf\PdfMaker;
|
use App\Utils\Traits\Pdf\PdfMaker;
|
||||||
use Twig\Extra\Intl\IntlExtension;
|
use App\Utils\VendorHtmlEngine;
|
||||||
use League\CommonMark\CommonMarkConverter;
|
use League\CommonMark\CommonMarkConverter;
|
||||||
|
use Twig\Error\Error;
|
||||||
|
use Twig\Error\LoaderError;
|
||||||
|
use Twig\Error\RuntimeError;
|
||||||
|
use Twig\Error\SyntaxError;
|
||||||
|
use Twig\Extra\Intl\IntlExtension;
|
||||||
|
use Twig\Sandbox\SecurityError;
|
||||||
|
|
||||||
class TemplateService
|
class TemplateService
|
||||||
{
|
{
|
||||||
@ -102,10 +102,17 @@ class TemplateService
|
|||||||
});
|
});
|
||||||
$this->twig->addFunction($function);
|
$this->twig->addFunction($function);
|
||||||
|
|
||||||
|
$function = new \Twig\TwigFunction('t', function ($string) {
|
||||||
|
return ctrans("texts.{$string}");
|
||||||
|
});
|
||||||
|
|
||||||
|
$this->twig->addFunction($function);
|
||||||
|
|
||||||
$filter = new \Twig\TwigFilter('sum', function (?array $array, ?string $column) {
|
$filter = new \Twig\TwigFilter('sum', function (?array $array, ?string $column) {
|
||||||
|
|
||||||
if(!is_array($array))
|
if(!is_array($array)) {
|
||||||
return 0;
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
return array_sum(array_column($array, $column));
|
return array_sum(array_column($array, $column));
|
||||||
});
|
});
|
||||||
@ -407,6 +414,9 @@ class TemplateService
|
|||||||
default => $processed = [],
|
default => $processed = [],
|
||||||
};
|
};
|
||||||
|
|
||||||
|
nlog($key);
|
||||||
|
nlog($processed);
|
||||||
|
|
||||||
return $processed;
|
return $processed;
|
||||||
|
|
||||||
})->toArray();
|
})->toArray();
|
||||||
@ -518,6 +528,7 @@ class TemplateService
|
|||||||
'balance' => $invoice->client->balance,
|
'balance' => $invoice->client->balance,
|
||||||
'payment_balance' => $invoice->client->payment_balance,
|
'payment_balance' => $invoice->client->payment_balance,
|
||||||
'credit_balance' => $invoice->client->credit_balance,
|
'credit_balance' => $invoice->client->credit_balance,
|
||||||
|
'vat_number' => $invoice->client->vat_number ?? '',
|
||||||
],
|
],
|
||||||
'payments' => $payments,
|
'payments' => $payments,
|
||||||
'total_tax_map' => $invoice->calc()->getTotalTaxMap(),
|
'total_tax_map' => $invoice->calc()->getTotalTaxMap(),
|
||||||
@ -642,6 +653,7 @@ class TemplateService
|
|||||||
'balance' => $payment->client->balance,
|
'balance' => $payment->client->balance,
|
||||||
'payment_balance' => $payment->client->payment_balance,
|
'payment_balance' => $payment->client->payment_balance,
|
||||||
'credit_balance' => $payment->client->credit_balance,
|
'credit_balance' => $payment->client->credit_balance,
|
||||||
|
'vat_number' => $payment->client->vat_number ?? '',
|
||||||
],
|
],
|
||||||
'paymentables' => $pivot,
|
'paymentables' => $pivot,
|
||||||
'refund_activity' => $this->getPaymentRefundActivity($payment),
|
'refund_activity' => $this->getPaymentRefundActivity($payment),
|
||||||
@ -718,6 +730,7 @@ class TemplateService
|
|||||||
'balance' => $quote->client->balance,
|
'balance' => $quote->client->balance,
|
||||||
'payment_balance' => $quote->client->payment_balance,
|
'payment_balance' => $quote->client->payment_balance,
|
||||||
'credit_balance' => $quote->client->credit_balance,
|
'credit_balance' => $quote->client->credit_balance,
|
||||||
|
'vat_number' => $quote->client->vat_number ?? '',
|
||||||
],
|
],
|
||||||
'status_id' =>$quote->status_id,
|
'status_id' =>$quote->status_id,
|
||||||
'status' => Quote::stringStatus($quote->status_id),
|
'status' => Quote::stringStatus($quote->status_id),
|
||||||
@ -836,6 +849,7 @@ class TemplateService
|
|||||||
'balance' => $credit->client->balance,
|
'balance' => $credit->client->balance,
|
||||||
'payment_balance' => $credit->client->payment_balance,
|
'payment_balance' => $credit->client->payment_balance,
|
||||||
'credit_balance' => $credit->client->credit_balance,
|
'credit_balance' => $credit->client->credit_balance,
|
||||||
|
'vat_number' => $credit->client->vat_number ?? '',
|
||||||
],
|
],
|
||||||
'payments' => [],
|
'payments' => [],
|
||||||
'total_tax_map' => $credit->calc()->getTotalTaxMap(),
|
'total_tax_map' => $credit->calc()->getTotalTaxMap(),
|
||||||
@ -899,6 +913,7 @@ class TemplateService
|
|||||||
'balance' => $task->client->balance,
|
'balance' => $task->client->balance,
|
||||||
'payment_balance' => $task->client->payment_balance,
|
'payment_balance' => $task->client->payment_balance,
|
||||||
'credit_balance' => $task->client->credit_balance,
|
'credit_balance' => $task->client->credit_balance,
|
||||||
|
'vat_number' => $task->client->vat_number ?? '',
|
||||||
] : [],
|
] : [],
|
||||||
];
|
];
|
||||||
|
|
||||||
@ -959,6 +974,7 @@ class TemplateService
|
|||||||
'balance' => $project->client->balance,
|
'balance' => $project->client->balance,
|
||||||
'payment_balance' => $project->client->payment_balance,
|
'payment_balance' => $project->client->payment_balance,
|
||||||
'credit_balance' => $project->client->credit_balance,
|
'credit_balance' => $project->client->credit_balance,
|
||||||
|
'vat_number' => $project->client->vat_number ?? '',
|
||||||
] : [],
|
] : [],
|
||||||
'user' => $this->userInfo($project->user)
|
'user' => $this->userInfo($project->user)
|
||||||
];
|
];
|
||||||
@ -978,6 +994,7 @@ class TemplateService
|
|||||||
return [
|
return [
|
||||||
'vendor' => $purchase_order->vendor ? [
|
'vendor' => $purchase_order->vendor ? [
|
||||||
'name' => $purchase_order->vendor->present()->name(),
|
'name' => $purchase_order->vendor->present()->name(),
|
||||||
|
'vat_number' => $purchase_order->vendor->vat_number ?? '',
|
||||||
] : [],
|
] : [],
|
||||||
'amount' => (float)$purchase_order->amount,
|
'amount' => (float)$purchase_order->amount,
|
||||||
'balance' => (float)$purchase_order->balance,
|
'balance' => (float)$purchase_order->balance,
|
||||||
@ -986,6 +1003,7 @@ class TemplateService
|
|||||||
'balance' => $purchase_order->client->balance,
|
'balance' => $purchase_order->client->balance,
|
||||||
'payment_balance' => $purchase_order->client->payment_balance,
|
'payment_balance' => $purchase_order->client->payment_balance,
|
||||||
'credit_balance' => $purchase_order->client->credit_balance,
|
'credit_balance' => $purchase_order->client->credit_balance,
|
||||||
|
'vat_number' => $purchase_order->client->vat_number ?? '',
|
||||||
] : [],
|
] : [],
|
||||||
'status_id' => (string)($purchase_order->status_id ?: 1),
|
'status_id' => (string)($purchase_order->status_id ?: 1),
|
||||||
'status' => PurchaseOrder::stringStatus($purchase_order->status_id ?? 1),
|
'status' => PurchaseOrder::stringStatus($purchase_order->status_id ?? 1),
|
||||||
@ -1200,7 +1218,7 @@ class TemplateService
|
|||||||
$this->client = $this->entity->client;
|
$this->client = $this->entity->client;
|
||||||
|
|
||||||
$shipping_address = [
|
$shipping_address = [
|
||||||
['element' => 'p', 'content' => ctrans('texts.shipping_address'), 'properties' => ['data-ref' => 'shipping_address-label', 'style' => 'font-weight: bold; text-transform: uppercase']],
|
// ['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->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_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', 'content' => $this->client->shipping_address2, 'show_empty' => false, 'properties' => ['data-ref' => 'shipping_address-client.shipping_address2']],
|
||||||
|
@ -131,16 +131,22 @@ class HtmlEngine
|
|||||||
// $data['$show_shipping_address_visibility'] = ['value' => $this->settings?->show_shipping_address ? 'visible' : 'hidden', 'label' => ''];
|
// $data['$show_shipping_address_visibility'] = ['value' => $this->settings?->show_shipping_address ? 'visible' : 'hidden', 'label' => ''];
|
||||||
$data['$show_shipping_address_visibility'] = ['value' => $this->settings?->show_shipping_address ? 1 : 0, 'label' => ''];
|
$data['$show_shipping_address_visibility'] = ['value' => $this->settings?->show_shipping_address ? 1 : 0, 'label' => ''];
|
||||||
|
|
||||||
|
$data['$order_number'] = ['value' => '', 'label' => ctrans('texts.order_number')];
|
||||||
$data['$tax'] = ['value' => '', 'label' => ctrans('texts.tax')];
|
$data['$tax'] = ['value' => '', 'label' => ctrans('texts.tax')];
|
||||||
|
$data['$quantity'] = ['value' => '', 'label' => ctrans('texts.quantity')];
|
||||||
|
$data['$amount_paid'] = ['value' => '', 'label' => ctrans('texts.amount_paid')];
|
||||||
$data['$app_url'] = ['value' => $this->generateAppUrl(), 'label' => ''];
|
$data['$app_url'] = ['value' => $this->generateAppUrl(), 'label' => ''];
|
||||||
$data['$from'] = ['value' => '', 'label' => ctrans('texts.from')];
|
$data['$from'] = ['value' => '', 'label' => ctrans('texts.from')];
|
||||||
$data['$to'] = ['value' => '', 'label' => ctrans('texts.to')];
|
$data['$to'] = ['value' => '', 'label' => ctrans('texts.to')];
|
||||||
|
$data['$ship_to'] = ['value' => '', 'label' => ctrans('texts.ship_to')];
|
||||||
$data['$total_tax_labels'] = ['value' => $this->totalTaxLabels(), 'label' => ctrans('texts.taxes')];
|
$data['$total_tax_labels'] = ['value' => $this->totalTaxLabels(), 'label' => ctrans('texts.taxes')];
|
||||||
$data['$total_tax_values'] = ['value' => $this->totalTaxValues(), 'label' => ctrans('texts.taxes')];
|
$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_labels'] = ['value' => $this->lineTaxLabels(), 'label' => ctrans('texts.taxes')];
|
||||||
$data['$line_tax_values'] = ['value' => $this->lineTaxValues(), '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['$status_logo'] = ['value' => ' ', 'label' => ' '];
|
||||||
|
$data['$delivery_note'] = ['value' => ' ', 'label' => ctrans('texts.delivery_note')];
|
||||||
|
$data['$receipt'] = ['value' => ' ', 'label' => ctrans('texts.receipt')];
|
||||||
|
|
||||||
$data['$invoice.date'] = &$data['$date'];
|
$data['$invoice.date'] = &$data['$date'];
|
||||||
$data['$invoiceDate'] = &$data['$date'];
|
$data['$invoiceDate'] = &$data['$date'];
|
||||||
|
@ -175,15 +175,27 @@ class PaymentHtmlEngine
|
|||||||
|
|
||||||
$data['$invoices'] = ['value' => $this->formatInvoices(), 'label' => ctrans('texts.invoices')];
|
$data['$invoices'] = ['value' => $this->formatInvoices(), 'label' => ctrans('texts.invoices')];
|
||||||
$data['$invoice_references'] = ['value' => $this->formatInvoiceReferences(), 'label' => ctrans('texts.invoices')];
|
$data['$invoice_references'] = ['value' => $this->formatInvoiceReferences(), 'label' => ctrans('texts.invoices')];
|
||||||
$data['$invoice'] = ['value' => $this->formatInvoice(), 'label' => ctrans('texts.invoices')];
|
$data['$invoice'] = ['value' => $this->formatInvoice(), 'label' => ctrans('texts.invoice')];
|
||||||
$data['$invoice.po_number'] = ['value' => $this->formatPoNumber(), 'label' => ctrans('texts.po_number')];
|
$data['$invoice.po_number'] = ['value' => $this->formatPoNumber(), 'label' => ctrans('texts.po_number')];
|
||||||
$data['$poNumber'] = &$data['$invoice.po_number'];
|
$data['$poNumber'] = &$data['$invoice.po_number'];
|
||||||
$data['$payment.status'] = ['value' => $this->payment->stringStatus($this->payment->status_id), 'label' => ctrans('texts.payment_status')];
|
$data['$payment.status'] = ['value' => $this->payment->stringStatus($this->payment->status_id), 'label' => ctrans('texts.payment_status')];
|
||||||
$data['$invoices.amount'] = ['value' => $this->formatInvoiceField('amount'), 'label' => ctrans('texts.invoices')];
|
$data['$invoices.amount'] = ['value' => $this->formatInvoiceField('amount'), 'label' => ctrans('texts.invoices')];
|
||||||
|
$data['$amount_paid'] = ['value' => '', 'label' => ctrans('texts.amount_paid')];
|
||||||
|
|
||||||
$data['$invoices.balance'] = ['value' => $this->formatInvoiceField('balance'), 'label' => ctrans('texts.invoices')];
|
$data['$invoices.balance'] = ['value' => $this->formatInvoiceField('balance'), 'label' => ctrans('texts.invoices')];
|
||||||
$data['$invoices.due_date'] = ['value' => $this->formatInvoiceField('due_date'), 'label' => ctrans('texts.invoices')];
|
$data['$invoices.due_date'] = ['value' => $this->formatInvoiceField('due_date'), 'label' => ctrans('texts.invoices')];
|
||||||
$data['$invoices.po_number'] = ['value' => $this->formatInvoiceField('po_number'), 'label' => ctrans('texts.invoices')];
|
$data['$invoices.po_number'] = ['value' => $this->formatInvoiceField('po_number'), 'label' => ctrans('texts.invoices')];
|
||||||
|
$data['$date'] = ['value' => '', 'label' => ctrans('texts.date')];
|
||||||
|
$data['$method'] = ['value' => '', 'label' => ctrans('texts.method')];
|
||||||
|
$data['$transaction_reference'] = ['value' => '', 'label' => ctrans('texts.transaction_reference')];
|
||||||
|
$data['$public_notes'] = ['value' => $this->client->public_notes, 'label' => ctrans('texts.public_notes')];
|
||||||
|
$data['$receipt'] = ['value' => '', 'label' => ctrans('texts.receipt')];
|
||||||
|
$data['$amount_paid'] = ['value' => '', 'label' => ctrans('texts.amount_paid')];
|
||||||
|
$data['$refund'] = ['value' => '', 'label' => ctrans('texts.refund')];
|
||||||
|
$data['$refunded'] = ['value' => '', 'label' => ctrans('texts.refunded')];
|
||||||
|
$data['$reference'] = ['value' => '', 'label' => ctrans('texts.reference')];
|
||||||
|
$data['$total'] = ['value' => '', 'label' => ctrans('texts.total')];
|
||||||
|
$data['$history'] = ['value' => '', 'label' => ctrans('texts.history')];
|
||||||
|
|
||||||
if ($this->payment->status_id == 4) {
|
if ($this->payment->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' => ''];
|
||||||
|
@ -1,19 +1,19 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
use Imdhemy\Purchases\Events\AppStore\Refund;
|
|
||||||
use Imdhemy\Purchases\Events\AppStore\DidRenew;
|
|
||||||
use Imdhemy\Purchases\Events\AppStore\DidFailToRenew;
|
|
||||||
use Imdhemy\Purchases\Events\GooglePlay\SubscriptionPaused;
|
|
||||||
use Imdhemy\Purchases\Events\GooglePlay\SubscriptionExpired;
|
|
||||||
use Imdhemy\Purchases\Events\GooglePlay\SubscriptionRenewed;
|
|
||||||
use Imdhemy\Purchases\Events\GooglePlay\SubscriptionRevoked;
|
|
||||||
use Imdhemy\Purchases\Events\AppStore\DidChangeRenewalStatus;
|
use Imdhemy\Purchases\Events\AppStore\DidChangeRenewalStatus;
|
||||||
|
use Imdhemy\Purchases\Events\AppStore\DidFailToRenew;
|
||||||
|
use Imdhemy\Purchases\Events\AppStore\DidRenew;
|
||||||
use Imdhemy\Purchases\Events\AppStore\InitialBuy;
|
use Imdhemy\Purchases\Events\AppStore\InitialBuy;
|
||||||
use Imdhemy\Purchases\Events\AppStore\InteractiveRenewal;
|
use Imdhemy\Purchases\Events\AppStore\InteractiveRenewal;
|
||||||
|
use Imdhemy\Purchases\Events\AppStore\Refund;
|
||||||
use Imdhemy\Purchases\Events\GooglePlay\SubscriptionCanceled;
|
use Imdhemy\Purchases\Events\GooglePlay\SubscriptionCanceled;
|
||||||
|
use Imdhemy\Purchases\Events\GooglePlay\SubscriptionExpired;
|
||||||
|
use Imdhemy\Purchases\Events\GooglePlay\SubscriptionPaused;
|
||||||
use Imdhemy\Purchases\Events\GooglePlay\SubscriptionPurchased;
|
use Imdhemy\Purchases\Events\GooglePlay\SubscriptionPurchased;
|
||||||
use Imdhemy\Purchases\Events\GooglePlay\SubscriptionRecovered;
|
use Imdhemy\Purchases\Events\GooglePlay\SubscriptionRecovered;
|
||||||
|
use Imdhemy\Purchases\Events\GooglePlay\SubscriptionRenewed;
|
||||||
use Imdhemy\Purchases\Events\GooglePlay\SubscriptionRestarted;
|
use Imdhemy\Purchases\Events\GooglePlay\SubscriptionRestarted;
|
||||||
|
use Imdhemy\Purchases\Events\GooglePlay\SubscriptionRevoked;
|
||||||
|
|
||||||
return [
|
return [
|
||||||
/*
|
/*
|
||||||
|
@ -11,9 +11,9 @@
|
|||||||
|
|
||||||
namespace Database\Factories;
|
namespace Database\Factories;
|
||||||
|
|
||||||
use App\Utils\Traits\MakesHash;
|
|
||||||
use App\DataMapper\Tax\TaxModel;
|
|
||||||
use App\DataMapper\CompanySettings;
|
use App\DataMapper\CompanySettings;
|
||||||
|
use App\DataMapper\Tax\TaxModel;
|
||||||
|
use App\Utils\Traits\MakesHash;
|
||||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||||
|
|
||||||
class CompanyFactory extends Factory
|
class CompanyFactory extends Factory
|
||||||
|
@ -11,8 +11,8 @@
|
|||||||
|
|
||||||
namespace Database\Factories;
|
namespace Database\Factories;
|
||||||
|
|
||||||
use App\Models\Quote;
|
|
||||||
use App\Factory\InvoiceItemFactory;
|
use App\Factory\InvoiceItemFactory;
|
||||||
|
use App\Models\Quote;
|
||||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||||
|
|
||||||
class QuoteFactory extends Factory
|
class QuoteFactory extends Factory
|
||||||
|
@ -3,8 +3,6 @@
|
|||||||
use App\Models\GatewayType;
|
use App\Models\GatewayType;
|
||||||
use App\Models\PaymentType;
|
use App\Models\PaymentType;
|
||||||
use Illuminate\Database\Migrations\Migration;
|
use Illuminate\Database\Migrations\Migration;
|
||||||
use Illuminate\Database\Schema\Blueprint;
|
|
||||||
use Illuminate\Support\Facades\Schema;
|
|
||||||
|
|
||||||
return new class extends Migration {
|
return new class extends Migration {
|
||||||
/**
|
/**
|
||||||
@ -16,8 +14,7 @@ return new class extends Migration {
|
|||||||
{
|
{
|
||||||
$pt = PaymentType::find(49);
|
$pt = PaymentType::find(49);
|
||||||
|
|
||||||
if(!$pt)
|
if(!$pt) {
|
||||||
{
|
|
||||||
$type = new PaymentType();
|
$type = new PaymentType();
|
||||||
$type->id = 49;
|
$type->id = 49;
|
||||||
$type->name = 'BACS';
|
$type->name = 'BACS';
|
||||||
@ -27,8 +24,7 @@ return new class extends Migration {
|
|||||||
|
|
||||||
$gt = GatewayType::find(24);
|
$gt = GatewayType::find(24);
|
||||||
|
|
||||||
if(!$gt)
|
if(!$gt) {
|
||||||
{
|
|
||||||
$type = new GatewayType();
|
$type = new GatewayType();
|
||||||
$type->id = 24;
|
$type->id = 24;
|
||||||
$type->alias = 'bacs';
|
$type->alias = 'bacs';
|
||||||
|
@ -1,11 +1,8 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
use Illuminate\Database\Migrations\Migration;
|
use Illuminate\Database\Migrations\Migration;
|
||||||
use Illuminate\Database\Schema\Blueprint;
|
|
||||||
use Illuminate\Support\Facades\Schema;
|
|
||||||
|
|
||||||
return new class extends Migration
|
return new class extends Migration {
|
||||||
{
|
|
||||||
/**
|
/**
|
||||||
* Run the migrations.
|
* Run the migrations.
|
||||||
*
|
*
|
||||||
|
@ -2,12 +2,9 @@
|
|||||||
|
|
||||||
use App\DataMapper\ClientRegistrationFields;
|
use App\DataMapper\ClientRegistrationFields;
|
||||||
use App\Models\Company;
|
use App\Models\Company;
|
||||||
use Illuminate\Support\Facades\Schema;
|
|
||||||
use Illuminate\Database\Schema\Blueprint;
|
|
||||||
use Illuminate\Database\Migrations\Migration;
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
|
||||||
return new class extends Migration
|
return new class extends Migration {
|
||||||
{
|
|
||||||
/**
|
/**
|
||||||
* Run the migrations.
|
* Run the migrations.
|
||||||
*
|
*
|
||||||
@ -23,8 +20,7 @@ return new class extends Migration
|
|||||||
$crfs = ClientRegistrationFields::generate();
|
$crfs = ClientRegistrationFields::generate();
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach($crfs as $key => $crf)
|
foreach($crfs as $key => $crf) {
|
||||||
{
|
|
||||||
$crfs[$key]['visible'] = $crfs[$key]['required'];
|
$crfs[$key]['visible'] = $crfs[$key]['required'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,12 +1,11 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
use App\Models\Company;
|
use App\Models\Company;
|
||||||
use Illuminate\Support\Facades\Schema;
|
|
||||||
use Illuminate\Database\Schema\Blueprint;
|
|
||||||
use Illuminate\Database\Migrations\Migration;
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
return new class extends Migration
|
return new class extends Migration {
|
||||||
{
|
|
||||||
/**
|
/**
|
||||||
* Run the migrations.
|
* Run the migrations.
|
||||||
*
|
*
|
||||||
@ -25,8 +24,9 @@ return new class extends Migration
|
|||||||
|
|
||||||
$settings = $company->settings;
|
$settings = $company->settings;
|
||||||
|
|
||||||
if(!property_exists($settings, 'show_task_item_description'))
|
if(!property_exists($settings, 'show_task_item_description')) {
|
||||||
$company->saveSettings((array)$company->settings, $company);
|
$company->saveSettings((array)$company->settings, $company);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
@ -1,11 +1,10 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
use Illuminate\Support\Facades\Schema;
|
|
||||||
use Illuminate\Database\Schema\Blueprint;
|
|
||||||
use Illuminate\Database\Migrations\Migration;
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
return new class extends Migration
|
return new class extends Migration {
|
||||||
{
|
|
||||||
/**
|
/**
|
||||||
* Run the migrations.
|
* Run the migrations.
|
||||||
*
|
*
|
||||||
|
@ -4,8 +4,7 @@ use Illuminate\Database\Migrations\Migration;
|
|||||||
use Illuminate\Database\Schema\Blueprint;
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
use Illuminate\Support\Facades\Schema;
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
return new class extends Migration
|
return new class extends Migration {
|
||||||
{
|
|
||||||
/**
|
/**
|
||||||
* Run the migrations.
|
* Run the migrations.
|
||||||
*
|
*
|
||||||
|
@ -1,14 +1,12 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
use App\Models\Company;
|
use App\Models\Company;
|
||||||
use App\Libraries\MultiDB;
|
|
||||||
use App\Models\CompanyUser;
|
use App\Models\CompanyUser;
|
||||||
use Illuminate\Support\Facades\Schema;
|
|
||||||
use Illuminate\Database\Schema\Blueprint;
|
|
||||||
use Illuminate\Database\Migrations\Migration;
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
return new class extends Migration
|
return new class extends Migration {
|
||||||
{
|
|
||||||
/**
|
/**
|
||||||
* Run the migrations.
|
* Run the migrations.
|
||||||
*
|
*
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user