mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-06-01 06:54:36 -04:00
PHP CS Fixer
This commit is contained in:
parent
9b4382b451
commit
f7340d6114
@ -14,4 +14,4 @@ namespace Illuminate\Contracts\Mail
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -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
|
||||||
{
|
{
|
||||||
@ -508,7 +507,7 @@ class CreateSingleAccount extends Command
|
|||||||
|
|
||||||
private function createTask($client)
|
private function createTask($client)
|
||||||
{
|
{
|
||||||
$time_log = $this->createTimeLog(rand(1,20));
|
$time_log = $this->createTimeLog(rand(1, 20));
|
||||||
$status = TaskStatus::where('company_id', $client->company_id)->get()->random();
|
$status = TaskStatus::where('company_id', $client->company_id)->get()->random();
|
||||||
|
|
||||||
return Task::factory()->create([
|
return Task::factory()->create([
|
||||||
@ -517,8 +516,8 @@ class CreateSingleAccount extends Command
|
|||||||
'time_log' => $time_log,
|
'time_log' => $time_log,
|
||||||
'description' => $this->faker->paragraph,
|
'description' => $this->faker->paragraph,
|
||||||
'status_id' => $status->id ?? null,
|
'status_id' => $status->id ?? null,
|
||||||
'number' => rand(10000,100000000),
|
'number' => rand(10000, 100000000),
|
||||||
'rate' => rand(1,150),
|
'rate' => rand(1, 150),
|
||||||
'client_id' => $client->id
|
'client_id' => $client->id
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
@ -537,7 +536,7 @@ class CreateSingleAccount extends Command
|
|||||||
Carbon::now()->addSeconds($min)->timestamp,
|
Carbon::now()->addSeconds($min)->timestamp,
|
||||||
Carbon::now()->addSeconds($min += $rando)->timestamp,
|
Carbon::now()->addSeconds($min += $rando)->timestamp,
|
||||||
$this->faker->sentence,
|
$this->faker->sentence,
|
||||||
rand(0,1) === 0 ? false : true
|
rand(0, 1) === 0 ? false : true
|
||||||
];
|
];
|
||||||
|
|
||||||
$min += 300;
|
$min += 300;
|
||||||
@ -552,9 +551,9 @@ class CreateSingleAccount extends Command
|
|||||||
'user_id' => $client->user->id,
|
'user_id' => $client->user->id,
|
||||||
'company_id' => $client->company->id,
|
'company_id' => $client->company->id,
|
||||||
'client_id' => $client->id,
|
'client_id' => $client->id,
|
||||||
'due_date' => now()->addSeconds(rand(100000,1000000))->format('Y-m-d'),
|
'due_date' => now()->addSeconds(rand(100000, 1000000))->format('Y-m-d'),
|
||||||
'budgeted_hours' => rand(100,1000),
|
'budgeted_hours' => rand(100, 1000),
|
||||||
'task_rate' => rand(1,200),
|
'task_rate' => rand(1, 200),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
for($x=0; $x < rand(2, 5); $x++) {
|
for($x=0; $x < rand(2, 5); $x++) {
|
||||||
|
@ -63,7 +63,7 @@ class MobileLocalization extends Command
|
|||||||
{
|
{
|
||||||
$resources =(array)$this->getResources();
|
$resources =(array)$this->getResources();
|
||||||
|
|
||||||
if(is_iterable($resources)){
|
if(is_iterable($resources)) {
|
||||||
foreach ($resources as $key => $val) {
|
foreach ($resources as $key => $val) {
|
||||||
$transKey = "texts.{$key}";
|
$transKey = "texts.{$key}";
|
||||||
if (trans($transKey) == $transKey) {
|
if (trans($transKey) == $transKey) {
|
||||||
|
@ -219,7 +219,7 @@ class BaseRule implements RuleInterface
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
$this->invoice->saveQuietly();
|
$this->invoice->saveQuietly();
|
||||||
}catch(\Exception $e) {
|
} catch(\Exception $e) {
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -223,8 +223,8 @@ class Handler extends ExceptionHandler
|
|||||||
return response()->json(['message' => $exception->getMessage()], 500);
|
return response()->json(['message' => $exception->getMessage()], 500);
|
||||||
} elseif ($exception instanceof ThrottleRequestsException && $request->expectsJson()) {
|
} elseif ($exception instanceof ThrottleRequestsException && $request->expectsJson()) {
|
||||||
return response()->json(['message'=>'Too many requests'], 429);
|
return response()->json(['message'=>'Too many requests'], 429);
|
||||||
// } elseif ($exception instanceof FatalThrowableError && $request->expectsJson()) {
|
// } elseif ($exception instanceof FatalThrowableError && $request->expectsJson()) {
|
||||||
// return response()->json(['message'=>'Fatal error'], 500); //@deprecated
|
// return response()->json(['message'=>'Fatal error'], 500); //@deprecated
|
||||||
} elseif ($exception instanceof AuthorizationException && $request->expectsJson()) {
|
} elseif ($exception instanceof AuthorizationException && $request->expectsJson()) {
|
||||||
return response()->json(['message'=> $exception->getMessage()], 401);
|
return response()->json(['message'=> $exception->getMessage()], 401);
|
||||||
} elseif ($exception instanceof TokenMismatchException) {
|
} elseif ($exception instanceof TokenMismatchException) {
|
||||||
|
@ -760,7 +760,7 @@ class BaseExport
|
|||||||
return $transformed_payment[$column];
|
return $transformed_payment[$column];
|
||||||
} elseif (array_key_exists(str_replace("payment.", "", $column), $transformed_payment)) {
|
} elseif (array_key_exists(str_replace("payment.", "", $column), $transformed_payment)) {
|
||||||
return $transformed_payment[$column];
|
return $transformed_payment[$column];
|
||||||
}
|
}
|
||||||
|
|
||||||
// nlog("export: Could not resolve payment key: {$column}");
|
// nlog("export: Could not resolve payment key: {$column}");
|
||||||
|
|
||||||
|
@ -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
|
||||||
{
|
{
|
||||||
|
@ -21,10 +21,9 @@ class ClientDecorator extends Decorator implements DecoratorInterface
|
|||||||
{
|
{
|
||||||
$client = false;
|
$client = false;
|
||||||
|
|
||||||
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,126 +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) {
|
}
|
||||||
return $client->number ?? '';
|
|
||||||
}
|
public function number(Client $client)
|
||||||
public function user(Client $client) {
|
{
|
||||||
return $client->user->present()->name();
|
return $client->number ?? '';
|
||||||
}
|
}
|
||||||
public function assigned_user(Client $client) {
|
|
||||||
return $client->assigned_user ? $client->user->present()->name() : '';
|
public function user(Client $client)
|
||||||
}
|
{
|
||||||
public function balance(Client $client) {
|
return $client->user->present()->name();
|
||||||
return $client->balance ?? 0;
|
}
|
||||||
}
|
|
||||||
public function paid_to_date(Client $client) {
|
public function assigned_user(Client $client)
|
||||||
return $client->paid_to_date ?? 0;
|
{
|
||||||
}
|
return $client->assigned_user ? $client->user->present()->name() : '';
|
||||||
public function currency_id(Client $client) {
|
}
|
||||||
return $client->currency() ? $client->currency()->code : $client->company->currency()->code;
|
|
||||||
}
|
public function balance(Client $client)
|
||||||
public function website(Client $client) {
|
{
|
||||||
return $client->website ?? '';
|
return $client->balance ?? 0;
|
||||||
}
|
}
|
||||||
public function private_notes(Client $client) {
|
|
||||||
return $client->private_notes ?? '';
|
public function paid_to_date(Client $client)
|
||||||
}
|
{
|
||||||
public function industry_id(Client $client) {
|
return $client->paid_to_date ?? 0;
|
||||||
return $client->industry ? ctrans("texts.industry_{$client->industry->name}") : '';
|
}
|
||||||
}
|
|
||||||
public function size_id(Client $client) {
|
public function currency_id(Client $client)
|
||||||
return $client->size ? ctrans("texts.size_{$client->size->name}") : '';
|
{
|
||||||
}
|
return $client->currency() ? $client->currency()->code : $client->company->currency()->code;
|
||||||
public function phone(Client $client) {
|
}
|
||||||
return $client->phone ?? '';
|
|
||||||
}
|
public function website(Client $client)
|
||||||
public function address1(Client $client) {
|
{
|
||||||
return $client->address1 ?? '';
|
return $client->website ?? '';
|
||||||
}
|
}
|
||||||
public function address2(Client $client) {
|
|
||||||
return $client->address2 ?? '';
|
public function private_notes(Client $client)
|
||||||
}
|
{
|
||||||
public function city(Client $client) {
|
return $client->private_notes ?? '';
|
||||||
return $client->city ?? '';
|
}
|
||||||
}
|
|
||||||
public function state(Client $client) {
|
public function industry_id(Client $client)
|
||||||
return $client->state ?? '';
|
{
|
||||||
}
|
return $client->industry ? ctrans("texts.industry_{$client->industry->name}") : '';
|
||||||
public function postal_code(Client $client) {
|
}
|
||||||
return $client->postal_code ?? '';
|
|
||||||
}
|
public function size_id(Client $client)
|
||||||
public function country_id(Client $client) {
|
{
|
||||||
return $client->country ? ctrans("texts.country_{$client->country->name}") : '';
|
return $client->size ? ctrans("texts.size_{$client->size->name}") : '';
|
||||||
}
|
}
|
||||||
public function shipping_address1(Client $client) {
|
|
||||||
return $client->shipping_address1 ?? '';
|
public function phone(Client $client)
|
||||||
}
|
{
|
||||||
public function shipping_address2(Client $client) {
|
return $client->phone ?? '';
|
||||||
return $client->shipping_address2 ?? '';
|
}
|
||||||
}
|
|
||||||
public function shipping_city(Client $client) {
|
public function address1(Client $client)
|
||||||
return $client->shipping_city ?? '';
|
{
|
||||||
}
|
return $client->address1 ?? '';
|
||||||
public function shipping_state(Client $client) {
|
}
|
||||||
return $client->shipping_state ?? '';
|
|
||||||
}
|
public function address2(Client $client)
|
||||||
public function shipping_postal_code(Client $client) {
|
{
|
||||||
return $client->shipping_postal_code ?? '';
|
return $client->address2 ?? '';
|
||||||
}
|
}
|
||||||
public function shipping_country_id(Client $client) {
|
|
||||||
return $client->shipping_country ? ctrans("texts.country_{$client->shipping_country->name}") : '';
|
public function city(Client $client)
|
||||||
}
|
{
|
||||||
public function payment_terms(Client $client) {
|
return $client->city ?? '';
|
||||||
return $client?->settings?->payment_terms ?? $client->company->settings->payment_terms;
|
}
|
||||||
}
|
|
||||||
public function vat_number(Client $client) {
|
public function state(Client $client)
|
||||||
return $client->vat_number ?? '';
|
{
|
||||||
}
|
return $client->state ?? '';
|
||||||
public function id_number(Client $client) {
|
}
|
||||||
return $client->id_number ?? '';
|
|
||||||
}
|
public function postal_code(Client $client)
|
||||||
public function public_notes(Client $client) {
|
{
|
||||||
return $client->public_notes ?? '';
|
return $client->postal_code ?? '';
|
||||||
}
|
}
|
||||||
public function custom_value1(Client $client) {
|
|
||||||
return $client->custom_value1 ?? '';
|
public function country_id(Client $client)
|
||||||
}
|
{
|
||||||
public function custom_value2(Client $client) {
|
return $client->country ? ctrans("texts.country_{$client->country->name}") : '';
|
||||||
return $client->custom_value2 ?? '';
|
}
|
||||||
}
|
|
||||||
public function custom_value3(Client $client) {
|
public function shipping_address1(Client $client)
|
||||||
return $client->custom_value3 ?? '';
|
{
|
||||||
}
|
return $client->shipping_address1 ?? '';
|
||||||
public function custom_value4(Client $client) {
|
}
|
||||||
return $client->custom_value4 ?? '';
|
|
||||||
}
|
public function shipping_address2(Client $client)
|
||||||
public function payment_balance(Client $client) {
|
{
|
||||||
return $client->payment_balance ?? 0;
|
return $client->shipping_address2 ?? '';
|
||||||
}
|
}
|
||||||
public function credit_balance(Client $client) {
|
|
||||||
return $client->credit_balance ?? 0;
|
public function shipping_city(Client $client)
|
||||||
}
|
{
|
||||||
public function classification(Client $client) {
|
return $client->shipping_city ?? '';
|
||||||
ctrans("texts.{$client->classification}") ?? '';
|
}
|
||||||
|
|
||||||
|
public function shipping_state(Client $client)
|
||||||
|
{
|
||||||
|
return $client->shipping_state ?? '';
|
||||||
|
}
|
||||||
|
|
||||||
|
public function shipping_postal_code(Client $client)
|
||||||
|
{
|
||||||
|
return $client->shipping_postal_code ?? '';
|
||||||
|
}
|
||||||
|
|
||||||
|
public function shipping_country_id(Client $client)
|
||||||
|
{
|
||||||
|
return $client->shipping_country ? ctrans("texts.country_{$client->shipping_country->name}") : '';
|
||||||
|
}
|
||||||
|
|
||||||
|
public function payment_terms(Client $client)
|
||||||
|
{
|
||||||
|
return $client?->settings?->payment_terms ?? $client->company->settings->payment_terms;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function vat_number(Client $client)
|
||||||
|
{
|
||||||
|
return $client->vat_number ?? '';
|
||||||
|
}
|
||||||
|
|
||||||
|
public function id_number(Client $client)
|
||||||
|
{
|
||||||
|
return $client->id_number ?? '';
|
||||||
|
}
|
||||||
|
|
||||||
|
public function public_notes(Client $client)
|
||||||
|
{
|
||||||
|
return $client->public_notes ?? '';
|
||||||
|
}
|
||||||
|
|
||||||
|
public function custom_value1(Client $client)
|
||||||
|
{
|
||||||
|
return $client->custom_value1 ?? '';
|
||||||
|
}
|
||||||
|
|
||||||
|
public function custom_value2(Client $client)
|
||||||
|
{
|
||||||
|
return $client->custom_value2 ?? '';
|
||||||
|
}
|
||||||
|
|
||||||
|
public function custom_value3(Client $client)
|
||||||
|
{
|
||||||
|
return $client->custom_value3 ?? '';
|
||||||
|
}
|
||||||
|
|
||||||
|
public function custom_value4(Client $client)
|
||||||
|
{
|
||||||
|
return $client->custom_value4 ?? '';
|
||||||
|
}
|
||||||
|
|
||||||
|
public function payment_balance(Client $client)
|
||||||
|
{
|
||||||
|
return $client->payment_balance ?? 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function credit_balance(Client $client)
|
||||||
|
{
|
||||||
|
return $client->credit_balance ?? 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function classification(Client $client)
|
||||||
|
{
|
||||||
|
ctrans("texts.{$client->classification}") ?? '';
|
||||||
|
}
|
||||||
|
|
||||||
|
public function status(Client $client)
|
||||||
|
{
|
||||||
|
if ($client->is_deleted) {
|
||||||
|
return ctrans('texts.deleted');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function status(Client $client)
|
if ($client->deleted_at) {
|
||||||
{
|
return ctrans('texts.archived');
|
||||||
if ($client->is_deleted) {
|
|
||||||
return ctrans('texts.deleted');
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($client->deleted_at) {
|
|
||||||
return ctrans('texts.archived');
|
|
||||||
}
|
|
||||||
|
|
||||||
return ctrans('texts.active');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return ctrans('texts.active');
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -33,28 +33,36 @@ class ContactDecorator implements DecoratorInterface
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function phone(ClientContact $contact) {
|
public function phone(ClientContact $contact)
|
||||||
|
{
|
||||||
return $contact->phone ?? '';
|
return $contact->phone ?? '';
|
||||||
}
|
}
|
||||||
public function first_name(ClientContact $contact) {
|
public function first_name(ClientContact $contact)
|
||||||
|
{
|
||||||
return $contact->first_name ?? '';
|
return $contact->first_name ?? '';
|
||||||
}
|
}
|
||||||
public function last_name(ClientContact $contact) {
|
public function last_name(ClientContact $contact)
|
||||||
|
{
|
||||||
return $contact->last_name ?? '';
|
return $contact->last_name ?? '';
|
||||||
}
|
}
|
||||||
public function email(ClientContact $contact) {
|
public function email(ClientContact $contact)
|
||||||
|
{
|
||||||
return $contact->email ?? '';
|
return $contact->email ?? '';
|
||||||
}
|
}
|
||||||
public function custom_value1(ClientContact $contact) {
|
public function custom_value1(ClientContact $contact)
|
||||||
|
{
|
||||||
return $contact->custom_value1 ?? '';
|
return $contact->custom_value1 ?? '';
|
||||||
}
|
}
|
||||||
public function custom_value2(ClientContact $contact) {
|
public function custom_value2(ClientContact $contact)
|
||||||
|
{
|
||||||
return $contact->custom_value2 ?? '';
|
return $contact->custom_value2 ?? '';
|
||||||
}
|
}
|
||||||
public function custom_value3(ClientContact $contact) {
|
public function custom_value3(ClientContact $contact)
|
||||||
|
{
|
||||||
return $contact->custom_value3 ?? '';
|
return $contact->custom_value3 ?? '';
|
||||||
}
|
}
|
||||||
public function custom_value4(ClientContact $contact) {
|
public function custom_value4(ClientContact $contact)
|
||||||
|
{
|
||||||
return $contact->custom_value4 ?? '';
|
return $contact->custom_value4 ?? '';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -33,91 +33,120 @@ class CreditDecorator implements DecoratorInterface
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function number(Credit $credit ) {
|
public function number(Credit $credit)
|
||||||
|
{
|
||||||
return $credit->number ?? '';
|
return $credit->number ?? '';
|
||||||
}
|
}
|
||||||
public function amount(Credit $credit ) {
|
public function amount(Credit $credit)
|
||||||
|
{
|
||||||
return $credit->amount ?? 0;
|
return $credit->amount ?? 0;
|
||||||
}
|
}
|
||||||
public function balance(Credit $credit ) {
|
public function balance(Credit $credit)
|
||||||
|
{
|
||||||
return $credit->balance ?? 0;
|
return $credit->balance ?? 0;
|
||||||
}
|
}
|
||||||
public function paid_to_date(Credit $credit ) {
|
public function paid_to_date(Credit $credit)
|
||||||
|
{
|
||||||
return $credit->paid_to_date ?? 0;
|
return $credit->paid_to_date ?? 0;
|
||||||
}
|
}
|
||||||
public function po_number(Credit $credit ) {
|
public function po_number(Credit $credit)
|
||||||
|
{
|
||||||
return $credit->po_number ?? '';
|
return $credit->po_number ?? '';
|
||||||
}
|
}
|
||||||
public function date(Credit $credit ) {
|
public function date(Credit $credit)
|
||||||
|
{
|
||||||
return $credit->date ?? '';
|
return $credit->date ?? '';
|
||||||
}
|
}
|
||||||
public function due_date(Credit $credit ) {
|
public function due_date(Credit $credit)
|
||||||
|
{
|
||||||
return $credit->due_date ?? '';
|
return $credit->due_date ?? '';
|
||||||
}
|
}
|
||||||
public function terms(Credit $credit ) {
|
public function terms(Credit $credit)
|
||||||
|
{
|
||||||
return $credit->terms ?? '';
|
return $credit->terms ?? '';
|
||||||
}
|
}
|
||||||
public function discount(Credit $credit ) {
|
public function discount(Credit $credit)
|
||||||
|
{
|
||||||
return $credit->discount ?? 0;
|
return $credit->discount ?? 0;
|
||||||
}
|
}
|
||||||
public function footer(Credit $credit ) {
|
public function footer(Credit $credit)
|
||||||
|
{
|
||||||
return $credit->footer ?? '';
|
return $credit->footer ?? '';
|
||||||
}
|
}
|
||||||
public function status(Credit $credit ) {
|
public function status(Credit $credit)
|
||||||
|
{
|
||||||
return $credit->stringStatus($credit->status_id);
|
return $credit->stringStatus($credit->status_id);
|
||||||
}
|
}
|
||||||
public function public_notes(Credit $credit ) {
|
public function public_notes(Credit $credit)
|
||||||
|
{
|
||||||
return $credit->public_notes ?? '';
|
return $credit->public_notes ?? '';
|
||||||
}
|
}
|
||||||
public function private_notes(Credit $credit ) {
|
public function private_notes(Credit $credit)
|
||||||
|
{
|
||||||
return $credit->private_notes ?? '';
|
return $credit->private_notes ?? '';
|
||||||
}
|
}
|
||||||
public function uses_inclusive_taxes(Credit $credit ) {
|
public function uses_inclusive_taxes(Credit $credit)
|
||||||
|
{
|
||||||
return $credit->uses_inclusive_taxes ? ctrans('texts.yes') : ctrans('texts.no');
|
return $credit->uses_inclusive_taxes ? ctrans('texts.yes') : ctrans('texts.no');
|
||||||
}
|
}
|
||||||
public function is_amount_discount(Credit $credit ) {
|
public function is_amount_discount(Credit $credit)
|
||||||
|
{
|
||||||
return $credit->is_amount_discount ? ctrans('texts.yes') : ctrans('texts.no');
|
return $credit->is_amount_discount ? ctrans('texts.yes') : ctrans('texts.no');
|
||||||
}
|
}
|
||||||
public function partial(Credit $credit ) {
|
public function partial(Credit $credit)
|
||||||
|
{
|
||||||
return $credit->partial ?? 0;
|
return $credit->partial ?? 0;
|
||||||
}
|
}
|
||||||
public function partial_due_date(Credit $credit ) {
|
public function partial_due_date(Credit $credit)
|
||||||
|
{
|
||||||
return $credit->partial_due_date ?? '';
|
return $credit->partial_due_date ?? '';
|
||||||
}
|
}
|
||||||
public function custom_surcharge1(Credit $credit ) {
|
public function custom_surcharge1(Credit $credit)
|
||||||
|
{
|
||||||
return $credit->custom_surcharge1 ?? 0;
|
return $credit->custom_surcharge1 ?? 0;
|
||||||
}
|
}
|
||||||
public function custom_surcharge2(Credit $credit ) {
|
public function custom_surcharge2(Credit $credit)
|
||||||
|
{
|
||||||
return $credit->custom_surcharge2 ?? 0;
|
return $credit->custom_surcharge2 ?? 0;
|
||||||
}
|
}
|
||||||
public function custom_surcharge3(Credit $credit ) {
|
public function custom_surcharge3(Credit $credit)
|
||||||
|
{
|
||||||
return $credit->custom_surcharge3 ?? 0;
|
return $credit->custom_surcharge3 ?? 0;
|
||||||
}
|
}
|
||||||
public function custom_surcharge4(Credit $credit ) {
|
public function custom_surcharge4(Credit $credit)
|
||||||
|
{
|
||||||
return $credit->custom_surcharge4 ?? 0;
|
return $credit->custom_surcharge4 ?? 0;
|
||||||
}
|
}
|
||||||
public function custom_value1(Credit $credit ) {
|
public function custom_value1(Credit $credit)
|
||||||
|
{
|
||||||
return $credit->custom_value1 ?? '';
|
return $credit->custom_value1 ?? '';
|
||||||
}
|
}
|
||||||
public function custom_value2(Credit $credit ) {
|
public function custom_value2(Credit $credit)
|
||||||
|
{
|
||||||
return $credit->custom_value2 ?? '';
|
return $credit->custom_value2 ?? '';
|
||||||
}
|
}
|
||||||
public function custom_value3(Credit $credit ) {
|
public function custom_value3(Credit $credit)
|
||||||
|
{
|
||||||
return $credit->custom_value3 ?? '';
|
return $credit->custom_value3 ?? '';
|
||||||
}
|
}
|
||||||
public function custom_value4(Credit $credit ) {
|
public function custom_value4(Credit $credit)
|
||||||
|
{
|
||||||
return $credit->custom_value4 ?? '';
|
return $credit->custom_value4 ?? '';
|
||||||
}
|
}
|
||||||
public function exchange_rate(Credit $credit ) {
|
public function exchange_rate(Credit $credit)
|
||||||
|
{
|
||||||
return $credit->exchange_rate ?? 0;
|
return $credit->exchange_rate ?? 0;
|
||||||
}
|
}
|
||||||
public function total_taxes(Credit $credit ) {
|
public function total_taxes(Credit $credit)
|
||||||
|
{
|
||||||
return $credit->total_taxes ?? 0;
|
return $credit->total_taxes ?? 0;
|
||||||
}
|
}
|
||||||
public function assigned_user_id(Credit $credit ) {
|
public function assigned_user_id(Credit $credit)
|
||||||
|
{
|
||||||
return $credit->assigned_user ? $credit->assigned_user->present()->name(): '';
|
return $credit->assigned_user ? $credit->assigned_user->present()->name(): '';
|
||||||
}
|
}
|
||||||
public function user_id(Credit $credit ) {
|
public function user_id(Credit $credit)
|
||||||
|
{
|
||||||
return $credit->user ? $credit->user->present()->name(): '';
|
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;
|
||||||
}
|
}
|
||||||
|
@ -33,100 +33,132 @@ class ExpenseDecorator implements DecoratorInterface
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function amount(Expense $expense) {
|
public function amount(Expense $expense)
|
||||||
|
{
|
||||||
return $expense->amount ?? 0;
|
return $expense->amount ?? 0;
|
||||||
}
|
}
|
||||||
public function category_id(Expense $expense) {
|
public function category_id(Expense $expense)
|
||||||
|
{
|
||||||
return $expense->category ? $expense->category->name : '';
|
return $expense->category ? $expense->category->name : '';
|
||||||
}
|
}
|
||||||
public function client_id(Expense $expense) {
|
public function client_id(Expense $expense)
|
||||||
|
{
|
||||||
return $expense->client ? $expense->client->present()->name() : '';
|
return $expense->client ? $expense->client->present()->name() : '';
|
||||||
}
|
}
|
||||||
public function custom_value1(Expense $expense) {
|
public function custom_value1(Expense $expense)
|
||||||
|
{
|
||||||
return $expense->custom_value1 ?? '';
|
return $expense->custom_value1 ?? '';
|
||||||
}
|
}
|
||||||
public function custom_value2(Expense $expense) {
|
public function custom_value2(Expense $expense)
|
||||||
|
{
|
||||||
return $expense->custom_value2 ?? '';
|
return $expense->custom_value2 ?? '';
|
||||||
}
|
}
|
||||||
public function custom_value3(Expense $expense) {
|
public function custom_value3(Expense $expense)
|
||||||
|
{
|
||||||
return $expense->custom_value3 ?? '';
|
return $expense->custom_value3 ?? '';
|
||||||
}
|
}
|
||||||
public function custom_value4(Expense $expense) {
|
public function custom_value4(Expense $expense)
|
||||||
|
{
|
||||||
return $expense->custom_value4 ?? '';
|
return $expense->custom_value4 ?? '';
|
||||||
}
|
}
|
||||||
public function currency_id(Expense $expense) {
|
public function currency_id(Expense $expense)
|
||||||
|
{
|
||||||
return $expense->currency ? $expense->currency->code : $expense->company->currency()->code;
|
return $expense->currency ? $expense->currency->code : $expense->company->currency()->code;
|
||||||
}
|
}
|
||||||
public function date(Expense $expense) {
|
public function date(Expense $expense)
|
||||||
|
{
|
||||||
return $expense->date ?? '';
|
return $expense->date ?? '';
|
||||||
}
|
}
|
||||||
public function exchange_rate(Expense $expense) {
|
public function exchange_rate(Expense $expense)
|
||||||
|
{
|
||||||
return $expense->exchange_rate ?? 0;
|
return $expense->exchange_rate ?? 0;
|
||||||
}
|
}
|
||||||
public function foreign_amount(Expense $expense) {
|
public function foreign_amount(Expense $expense)
|
||||||
|
{
|
||||||
return $expense->foreign_amount ?? 0;
|
return $expense->foreign_amount ?? 0;
|
||||||
}
|
}
|
||||||
public function invoice_currency_id(Expense $expense) {
|
public function invoice_currency_id(Expense $expense)
|
||||||
|
{
|
||||||
return $expense->invoice_currency ? $expense->invoice_currency->code : $expense->company->currency()->code;
|
return $expense->invoice_currency ? $expense->invoice_currency->code : $expense->company->currency()->code;
|
||||||
}
|
}
|
||||||
public function payment_date(Expense $expense) {
|
public function payment_date(Expense $expense)
|
||||||
|
{
|
||||||
return $expense->payment_date ?? '';
|
return $expense->payment_date ?? '';
|
||||||
}
|
}
|
||||||
public function number(Expense $expense) {
|
public function number(Expense $expense)
|
||||||
|
{
|
||||||
return $expense->number ?? '';
|
return $expense->number ?? '';
|
||||||
}
|
}
|
||||||
public function payment_type_id(Expense $expense) {
|
public function payment_type_id(Expense $expense)
|
||||||
|
{
|
||||||
return $expense->payment_type ? $expense->payment_type->name : '';
|
return $expense->payment_type ? $expense->payment_type->name : '';
|
||||||
}
|
}
|
||||||
public function private_notes(Expense $expense) {
|
public function private_notes(Expense $expense)
|
||||||
|
{
|
||||||
return $expense->private_notes ?? '';
|
return $expense->private_notes ?? '';
|
||||||
}
|
}
|
||||||
public function project_id(Expense $expense) {
|
public function project_id(Expense $expense)
|
||||||
|
{
|
||||||
return $expense->project ? $expense->project->name : '';
|
return $expense->project ? $expense->project->name : '';
|
||||||
}
|
}
|
||||||
public function public_notes(Expense $expense) {
|
public function public_notes(Expense $expense)
|
||||||
|
{
|
||||||
return $expense->public_notes ?? '';
|
return $expense->public_notes ?? '';
|
||||||
}
|
}
|
||||||
public function tax_amount1(Expense $expense) {
|
public function tax_amount1(Expense $expense)
|
||||||
|
{
|
||||||
return $expense->tax_amount1 ?? 0;
|
return $expense->tax_amount1 ?? 0;
|
||||||
}
|
}
|
||||||
public function tax_amount2(Expense $expense) {
|
public function tax_amount2(Expense $expense)
|
||||||
|
{
|
||||||
return $expense->tax_amount2 ?? 0;
|
return $expense->tax_amount2 ?? 0;
|
||||||
}
|
}
|
||||||
public function tax_amount3(Expense $expense) {
|
public function tax_amount3(Expense $expense)
|
||||||
|
{
|
||||||
return $expense->tax_amount3 ?? 0;
|
return $expense->tax_amount3 ?? 0;
|
||||||
}
|
}
|
||||||
public function tax_name1(Expense $expense) {
|
public function tax_name1(Expense $expense)
|
||||||
|
{
|
||||||
return $expense->tax_name1 ?? '';
|
return $expense->tax_name1 ?? '';
|
||||||
}
|
}
|
||||||
public function tax_name2(Expense $expense) {
|
public function tax_name2(Expense $expense)
|
||||||
|
{
|
||||||
return $expense->tax_name2 ?? '';
|
return $expense->tax_name2 ?? '';
|
||||||
}
|
}
|
||||||
public function tax_name3(Expense $expense) {
|
public function tax_name3(Expense $expense)
|
||||||
|
{
|
||||||
return $expense->tax_name3 ?? '';
|
return $expense->tax_name3 ?? '';
|
||||||
}
|
}
|
||||||
public function tax_rate1(Expense $expense) {
|
public function tax_rate1(Expense $expense)
|
||||||
|
{
|
||||||
return $expense->tax_rate1 ?? 0;
|
return $expense->tax_rate1 ?? 0;
|
||||||
}
|
}
|
||||||
public function tax_rate2(Expense $expense) {
|
public function tax_rate2(Expense $expense)
|
||||||
|
{
|
||||||
return $expense->tax_rate2 ?? 0;
|
return $expense->tax_rate2 ?? 0;
|
||||||
}
|
}
|
||||||
public function tax_rate3(Expense $expense) {
|
public function tax_rate3(Expense $expense)
|
||||||
|
{
|
||||||
return $expense->tax_rate3 ?? 0;
|
return $expense->tax_rate3 ?? 0;
|
||||||
}
|
}
|
||||||
public function transaction_reference(Expense $expense) {
|
public function transaction_reference(Expense $expense)
|
||||||
|
{
|
||||||
return $expense->transaction_reference ?? '';
|
return $expense->transaction_reference ?? '';
|
||||||
}
|
}
|
||||||
public function vendor_id(Expense $expense) {
|
public function vendor_id(Expense $expense)
|
||||||
|
{
|
||||||
return $expense->vendor ? $expense->vendor->name : '';
|
return $expense->vendor ? $expense->vendor->name : '';
|
||||||
}
|
}
|
||||||
public function invoice_id(Expense $expense) {
|
public function invoice_id(Expense $expense)
|
||||||
|
{
|
||||||
return $expense->invoice ? $expense->invoice->number : '';
|
return $expense->invoice ? $expense->invoice->number : '';
|
||||||
}
|
}
|
||||||
public function user(Expense $expense) {
|
public function user(Expense $expense)
|
||||||
|
{
|
||||||
return $expense->user ? $expense->user->present()->name() : '';
|
return $expense->user ? $expense->user->present()->name() : '';
|
||||||
}
|
}
|
||||||
public function assigned_user(Expense $expense) {
|
public function assigned_user(Expense $expense)
|
||||||
|
{
|
||||||
return $expense->assigned_user ? $expense->assigned_user->present()->name() : '';
|
return $expense->assigned_user ? $expense->assigned_user->present()->name() : '';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -33,119 +33,153 @@ class InvoiceDecorator extends Decorator implements DecoratorInterface
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function number(Invoice $invoice)
|
||||||
public function number(Invoice $invoice) {
|
{
|
||||||
return $invoice->number ?? '';
|
return $invoice->number ?? '';
|
||||||
}
|
}
|
||||||
public function amount(Invoice $invoice) {
|
public function amount(Invoice $invoice)
|
||||||
return $invoice->amount ?? 0;
|
{
|
||||||
}
|
return $invoice->amount ?? 0;
|
||||||
public function balance(Invoice $invoice) {
|
}
|
||||||
return $invoice->balance ?? 0;
|
public function balance(Invoice $invoice)
|
||||||
}
|
{
|
||||||
public function paid_to_date(Invoice $invoice) {
|
return $invoice->balance ?? 0;
|
||||||
return $invoice->paid_to_date ?? 0;
|
}
|
||||||
}
|
public function paid_to_date(Invoice $invoice)
|
||||||
public function po_number(Invoice $invoice) {
|
{
|
||||||
return $invoice->po_number ?? '';
|
return $invoice->paid_to_date ?? 0;
|
||||||
}
|
}
|
||||||
public function date(Invoice $invoice) {
|
public function po_number(Invoice $invoice)
|
||||||
return $invoice->date ?? '';
|
{
|
||||||
}
|
return $invoice->po_number ?? '';
|
||||||
public function due_date(Invoice $invoice) {
|
}
|
||||||
return $invoice->due_date ?? '';
|
public function date(Invoice $invoice)
|
||||||
}
|
{
|
||||||
public function terms(Invoice $invoice) {
|
return $invoice->date ?? '';
|
||||||
return $invoice->terms ?? '';
|
}
|
||||||
}
|
public function due_date(Invoice $invoice)
|
||||||
public function footer(Invoice $invoice) {
|
{
|
||||||
return $invoice->footer ?? '';
|
return $invoice->due_date ?? '';
|
||||||
}
|
}
|
||||||
public function status(Invoice $invoice) {
|
public function terms(Invoice $invoice)
|
||||||
return $invoice->stringStatus($invoice->status_id);
|
{
|
||||||
}
|
return $invoice->terms ?? '';
|
||||||
public function public_notes(Invoice $invoice) {
|
}
|
||||||
return $invoice->public_notes ?? '';
|
public function footer(Invoice $invoice)
|
||||||
}
|
{
|
||||||
public function private_notes(Invoice $invoice) {
|
return $invoice->footer ?? '';
|
||||||
return $invoice->private_notes ?? '';
|
}
|
||||||
}
|
public function status(Invoice $invoice)
|
||||||
public function uses_inclusive_taxes(Invoice $invoice) {
|
{
|
||||||
return $invoice->uses_inclusive_taxes ? ctrans('texts.yes') : ctrans('texts.no');
|
return $invoice->stringStatus($invoice->status_id);
|
||||||
}
|
}
|
||||||
public function is_amount_discount(Invoice $invoice) {
|
public function public_notes(Invoice $invoice)
|
||||||
return $invoice->is_amount_discount ? ctrans('texts.yes') : ctrans('texts.no');
|
{
|
||||||
}
|
return $invoice->public_notes ?? '';
|
||||||
public function discount(Invoice $invoice) {
|
}
|
||||||
return $invoice->discount ?? 0;
|
public function private_notes(Invoice $invoice)
|
||||||
}
|
{
|
||||||
public function partial(Invoice $invoice) {
|
return $invoice->private_notes ?? '';
|
||||||
return $invoice->partial ?? 0;
|
}
|
||||||
}
|
public function uses_inclusive_taxes(Invoice $invoice)
|
||||||
public function partial_due_date(Invoice $invoice) {
|
{
|
||||||
return $invoice->partial_due_date ?? '';
|
return $invoice->uses_inclusive_taxes ? ctrans('texts.yes') : ctrans('texts.no');
|
||||||
}
|
}
|
||||||
public function custom_surcharge1(Invoice $invoice) {
|
public function is_amount_discount(Invoice $invoice)
|
||||||
return $invoice->custom_surcharge1 ?? 0;
|
{
|
||||||
}
|
return $invoice->is_amount_discount ? ctrans('texts.yes') : ctrans('texts.no');
|
||||||
public function custom_surcharge2(Invoice $invoice) {
|
}
|
||||||
return $invoice->custom_surcharge2 ?? 0;
|
public function discount(Invoice $invoice)
|
||||||
}
|
{
|
||||||
public function custom_surcharge3(Invoice $invoice) {
|
return $invoice->discount ?? 0;
|
||||||
return $invoice->custom_surcharge3 ?? 0;
|
}
|
||||||
}
|
public function partial(Invoice $invoice)
|
||||||
public function custom_surcharge4(Invoice $invoice) {
|
{
|
||||||
return $invoice->custom_surcharge4 ?? 0;
|
return $invoice->partial ?? 0;
|
||||||
}
|
}
|
||||||
public function exchange_rate(Invoice $invoice) {
|
public function partial_due_date(Invoice $invoice)
|
||||||
return $invoice->exchange_rate ?? 0;
|
{
|
||||||
}
|
return $invoice->partial_due_date ?? '';
|
||||||
public function total_taxes(Invoice $invoice) {
|
}
|
||||||
return $invoice->total_taxes ?? 0;
|
public function custom_surcharge1(Invoice $invoice)
|
||||||
}
|
{
|
||||||
public function assigned_user_id(Invoice $invoice) {
|
return $invoice->custom_surcharge1 ?? 0;
|
||||||
return $invoice->assigned_user ? $invoice->assigned_user->present()->name(): '';
|
}
|
||||||
}
|
public function custom_surcharge2(Invoice $invoice)
|
||||||
public function user_id(Invoice $invoice) {
|
{
|
||||||
return $invoice->user ? $invoice->user->present()->name(): '';
|
return $invoice->custom_surcharge2 ?? 0;
|
||||||
}
|
}
|
||||||
public function custom_value1(Invoice $invoice) {
|
public function custom_surcharge3(Invoice $invoice)
|
||||||
return $invoice->custom_value1 ?? '';
|
{
|
||||||
}
|
return $invoice->custom_surcharge3 ?? 0;
|
||||||
public function custom_value2(Invoice $invoice) {
|
}
|
||||||
return $invoice->custom_value2 ?? '';
|
public function custom_surcharge4(Invoice $invoice)
|
||||||
}
|
{
|
||||||
public function custom_value3(Invoice $invoice) {
|
return $invoice->custom_surcharge4 ?? 0;
|
||||||
return $invoice->custom_value3 ?? '';
|
}
|
||||||
}
|
public function exchange_rate(Invoice $invoice)
|
||||||
public function custom_value4(Invoice $invoice) {
|
{
|
||||||
return $invoice->custom_value4 ?? '';
|
return $invoice->exchange_rate ?? 0;
|
||||||
}
|
}
|
||||||
public function tax_name1(Invoice $invoice) {
|
public function total_taxes(Invoice $invoice)
|
||||||
return $invoice->tax_name1 ?? '';
|
{
|
||||||
}
|
return $invoice->total_taxes ?? 0;
|
||||||
public function tax_name2(Invoice $invoice) {
|
}
|
||||||
return $invoice->tax_name2 ?? '';
|
public function assigned_user_id(Invoice $invoice)
|
||||||
}
|
{
|
||||||
public function tax_name3(Invoice $invoice) {
|
return $invoice->assigned_user ? $invoice->assigned_user->present()->name(): '';
|
||||||
return $invoice->tax_name3 ?? '';
|
}
|
||||||
}
|
public function user_id(Invoice $invoice)
|
||||||
public function tax_rate1(Invoice $invoice) {
|
{
|
||||||
return $invoice->tax_rate1 ?? 0;
|
return $invoice->user ? $invoice->user->present()->name(): '';
|
||||||
}
|
}
|
||||||
public function tax_rate2(Invoice $invoice) {
|
public function custom_value1(Invoice $invoice)
|
||||||
return $invoice->tax_rate2 ?? 0;
|
{
|
||||||
}
|
return $invoice->custom_value1 ?? '';
|
||||||
public function tax_rate3(Invoice $invoice) {
|
}
|
||||||
return $invoice->tax_rate3 ?? 0;
|
public function custom_value2(Invoice $invoice)
|
||||||
}
|
{
|
||||||
public function recurring_id(Invoice $invoice) {
|
return $invoice->custom_value2 ?? '';
|
||||||
return $invoice->recurring_invoice ? $invoice->recurring_invoice->number : '';
|
}
|
||||||
}
|
public function custom_value3(Invoice $invoice)
|
||||||
public function auto_bill_enabled(Invoice $invoice) {
|
{
|
||||||
return $invoice->auto_bill_enabled ? ctrans('texts.yes') : ctrans('texts.no');
|
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';
|
||||||
|
|
||||||
@ -21,20 +22,17 @@ class PaymentDecorator extends Decorator implements DecoratorInterface{
|
|||||||
{
|
{
|
||||||
$payment = false;
|
$payment = false;
|
||||||
|
|
||||||
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,96 +45,119 @@ 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();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -27,9 +27,9 @@ class ProductDecorator implements DecoratorInterface
|
|||||||
|
|
||||||
if($product && method_exists($this, $key)) {
|
if($product && method_exists($this, $key)) {
|
||||||
return $this->{$key}($product);
|
return $this->{$key}($product);
|
||||||
}
|
} elseif($product->{$key}) {
|
||||||
elseif($product->{$key})
|
|
||||||
return $product->{$key} ?? '';
|
return $product->{$key} ?? '';
|
||||||
|
}
|
||||||
|
|
||||||
return '';
|
return '';
|
||||||
|
|
||||||
@ -46,11 +46,12 @@ class ProductDecorator implements DecoratorInterface
|
|||||||
public const PRODUCT_TYPE_ZERO_RATED = 8;
|
public const PRODUCT_TYPE_ZERO_RATED = 8;
|
||||||
public const PRODUCT_TYPE_REVERSE_TAX = 9;
|
public const PRODUCT_TYPE_REVERSE_TAX = 9;
|
||||||
*/
|
*/
|
||||||
public function tax_category(Product $product) {
|
public function tax_category(Product $product)
|
||||||
|
{
|
||||||
|
|
||||||
$category = ctrans('texts.physical_goods');
|
$category = ctrans('texts.physical_goods');
|
||||||
|
|
||||||
match($product->tax_id){
|
match($product->tax_id) {
|
||||||
1 => $category = ctrans('texts.physical_goods'),
|
1 => $category = ctrans('texts.physical_goods'),
|
||||||
2 => $category = ctrans('texts.services'),
|
2 => $category = ctrans('texts.services'),
|
||||||
3 => $category = ctrans('texts.digital_products'),
|
3 => $category = ctrans('texts.digital_products'),
|
||||||
@ -67,6 +68,3 @@ class ProductDecorator implements DecoratorInterface
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -27,20 +27,22 @@ class PurchaseOrderDecorator extends Decorator implements DecoratorInterface
|
|||||||
|
|
||||||
if($purchase_order && method_exists($this, $key)) {
|
if($purchase_order && method_exists($this, $key)) {
|
||||||
return $this->{$key}($purchase_order);
|
return $this->{$key}($purchase_order);
|
||||||
}
|
} elseif($purchase_order->{$key}) {
|
||||||
elseif($purchase_order->{$key})
|
|
||||||
return $purchase_order->{$key} ?? '';
|
return $purchase_order->{$key} ?? '';
|
||||||
|
}
|
||||||
|
|
||||||
return '';
|
return '';
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function status(PurchaseOrder $purchase_order) {
|
public function status(PurchaseOrder $purchase_order)
|
||||||
|
{
|
||||||
return $purchase_order->stringStatus($purchase_order->status_id);
|
return $purchase_order->stringStatus($purchase_order->status_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function currency_id(PurchaseOrder $purchase_order) {
|
public function currency_id(PurchaseOrder $purchase_order)
|
||||||
|
{
|
||||||
return $purchase_order->currency ? $purchase_order->currency->code : $purchase_order->company->currency()->code;
|
return $purchase_order->currency ? $purchase_order->currency->code : $purchase_order->company->currency()->code;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -35,21 +35,29 @@ class QuoteDecorator extends Decorator implements DecoratorInterface
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function status(Quote $quote) {
|
public function status(Quote $quote)
|
||||||
|
{
|
||||||
return $quote->stringStatus($quote->status_id);
|
return $quote->stringStatus($quote->status_id);
|
||||||
}
|
}
|
||||||
public function uses_inclusive_taxes(Quote $quote) {
|
|
||||||
|
public function uses_inclusive_taxes(Quote $quote)
|
||||||
|
{
|
||||||
return $quote->uses_inclusive_taxes ? ctrans('texts.yes') : ctrans('texts.no');
|
return $quote->uses_inclusive_taxes ? ctrans('texts.yes') : ctrans('texts.no');
|
||||||
}
|
}
|
||||||
public function is_amount_discount(Quote $quote) {
|
|
||||||
|
public function is_amount_discount(Quote $quote)
|
||||||
|
{
|
||||||
return $quote->is_amount_discount ? ctrans('texts.yes') : ctrans('texts.no');
|
return $quote->is_amount_discount ? ctrans('texts.yes') : ctrans('texts.no');
|
||||||
}
|
}
|
||||||
public function assigned_user_id(Quote $quote) {
|
|
||||||
|
public function assigned_user_id(Quote $quote)
|
||||||
|
{
|
||||||
return $quote->assigned_user ? $quote->assigned_user->present()->name() : '';
|
return $quote->assigned_user ? $quote->assigned_user->present()->name() : '';
|
||||||
}
|
}
|
||||||
public function user_id(Quote $quote) {
|
|
||||||
|
public function user_id(Quote $quote)
|
||||||
|
{
|
||||||
return $quote->user->present()->name();
|
return $quote->user->present()->name();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -35,28 +35,43 @@ class RecurringInvoiceDecorator extends Decorator implements DecoratorInterface
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function status(RecurringInvoice $recurring_invoice) {
|
public function status(RecurringInvoice $recurring_invoice)
|
||||||
|
{
|
||||||
return $recurring_invoice->stringStatus($recurring_invoice->status_id);
|
return $recurring_invoice->stringStatus($recurring_invoice->status_id);
|
||||||
}
|
}
|
||||||
public function uses_inclusive_taxes(RecurringInvoice $recurring_invoice) {
|
|
||||||
|
public function uses_inclusive_taxes(RecurringInvoice $recurring_invoice)
|
||||||
|
{
|
||||||
return $recurring_invoice->uses_inclusive_taxes ? ctrans('texts.yes') : ctrans('texts.no');
|
return $recurring_invoice->uses_inclusive_taxes ? ctrans('texts.yes') : ctrans('texts.no');
|
||||||
}
|
}
|
||||||
public function is_amount_discount(RecurringInvoice $recurring_invoice) {
|
|
||||||
|
public function is_amount_discount(RecurringInvoice $recurring_invoice)
|
||||||
|
{
|
||||||
return $recurring_invoice->is_amount_discount ? ctrans('texts.yes') : ctrans('texts.no');
|
return $recurring_invoice->is_amount_discount ? ctrans('texts.yes') : ctrans('texts.no');
|
||||||
}
|
}
|
||||||
public function assigned_user_id(RecurringInvoice $recurring_invoice) {
|
|
||||||
|
public function assigned_user_id(RecurringInvoice $recurring_invoice)
|
||||||
|
{
|
||||||
return $recurring_invoice->assigned_user ? $recurring_invoice->assigned_user->present()->name() : '';
|
return $recurring_invoice->assigned_user ? $recurring_invoice->assigned_user->present()->name() : '';
|
||||||
}
|
}
|
||||||
public function user_id(RecurringInvoice $recurring_invoice) {
|
|
||||||
|
public function user_id(RecurringInvoice $recurring_invoice)
|
||||||
|
{
|
||||||
return $recurring_invoice->user->present()->name() ?? '';
|
return $recurring_invoice->user->present()->name() ?? '';
|
||||||
}
|
}
|
||||||
public function frequency_id(RecurringInvoice $recurring_invoice) {
|
|
||||||
|
public function frequency_id(RecurringInvoice $recurring_invoice)
|
||||||
|
{
|
||||||
return $recurring_invoice->frequency_id ? $recurring_invoice->frequencyForKey($recurring_invoice->frequency_id) : '';
|
return $recurring_invoice->frequency_id ? $recurring_invoice->frequencyForKey($recurring_invoice->frequency_id) : '';
|
||||||
}
|
}
|
||||||
public function auto_bill(RecurringInvoice $recurring_invoice) {
|
|
||||||
|
public function auto_bill(RecurringInvoice $recurring_invoice)
|
||||||
|
{
|
||||||
return $recurring_invoice->auto_bill ? ctrans("texts.{$recurring_invoice->auto_bill}") : '';
|
return $recurring_invoice->auto_bill ? ctrans("texts.{$recurring_invoice->auto_bill}") : '';
|
||||||
}
|
}
|
||||||
public function auto_bill_enabled(RecurringInvoice $recurring_invoice) {
|
|
||||||
|
public function auto_bill_enabled(RecurringInvoice $recurring_invoice)
|
||||||
|
{
|
||||||
return $recurring_invoice->auto_bill_enabled ? ctrans('texts.yes') : ctrans('texts.no');
|
return $recurring_invoice->auto_bill_enabled ? ctrans('texts.yes') : ctrans('texts.no');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -11,10 +11,10 @@
|
|||||||
|
|
||||||
namespace App\Export\Decorators;
|
namespace App\Export\Decorators;
|
||||||
|
|
||||||
use Carbon\Carbon;
|
use App\Models\DateFormat;
|
||||||
use App\Models\Task;
|
use App\Models\Task;
|
||||||
use App\Models\Timezone;
|
use App\Models\Timezone;
|
||||||
use App\Models\DateFormat;
|
use Carbon\Carbon;
|
||||||
|
|
||||||
class TaskDecorator extends Decorator implements DecoratorInterface
|
class TaskDecorator extends Decorator implements DecoratorInterface
|
||||||
{
|
{
|
||||||
@ -38,7 +38,8 @@ class TaskDecorator extends Decorator implements DecoratorInterface
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function start_date(Task $task){
|
public function start_date(Task $task)
|
||||||
|
{
|
||||||
|
|
||||||
$timezone = Timezone::find($task->company->settings->timezone_id);
|
$timezone = Timezone::find($task->company->settings->timezone_id);
|
||||||
$timezone_name = 'US/Eastern';
|
$timezone_name = 'US/Eastern';
|
||||||
@ -57,7 +58,7 @@ class TaskDecorator extends Decorator implements DecoratorInterface
|
|||||||
$date_format_default = $date_format->format;
|
$date_format_default = $date_format->format;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(is_array($logs)){
|
if(is_array($logs)) {
|
||||||
$item = $logs[0];
|
$item = $logs[0];
|
||||||
return Carbon::createFromTimeStamp($item[0])->setTimezone($timezone_name)->format($date_format_default);
|
return Carbon::createFromTimeStamp($item[0])->setTimezone($timezone_name)->format($date_format_default);
|
||||||
}
|
}
|
||||||
@ -66,7 +67,8 @@ class TaskDecorator extends Decorator implements DecoratorInterface
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function end_date(Task $task){
|
public function end_date(Task $task)
|
||||||
|
{
|
||||||
|
|
||||||
$timezone = Timezone::find($task->company->settings->timezone_id);
|
$timezone = Timezone::find($task->company->settings->timezone_id);
|
||||||
$timezone_name = 'US/Eastern';
|
$timezone_name = 'US/Eastern';
|
||||||
@ -93,13 +95,18 @@ class TaskDecorator extends Decorator implements DecoratorInterface
|
|||||||
return '';
|
return '';
|
||||||
|
|
||||||
}
|
}
|
||||||
public function duration(Task $task){
|
public function duration(Task $task)
|
||||||
|
{
|
||||||
return $task->calcDuration();
|
return $task->calcDuration();
|
||||||
}
|
}
|
||||||
public function status_id(Task $task){
|
|
||||||
|
public function status_id(Task $task)
|
||||||
|
{
|
||||||
return $task->status()->exists() ? $task->status->name : '';
|
return $task->status()->exists() ? $task->status->name : '';
|
||||||
}
|
}
|
||||||
public function project_id(Task $task){
|
|
||||||
|
public function project_id(Task $task)
|
||||||
|
{
|
||||||
return $task->project()->exists() ? $task->project->name : '';
|
return $task->project()->exists() ? $task->project->name : '';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -27,13 +27,13 @@ class VendorContactDecorator implements DecoratorInterface
|
|||||||
|
|
||||||
if($contact && method_exists($this, $key)) {
|
if($contact && method_exists($this, $key)) {
|
||||||
return $this->{$key}($contact);
|
return $this->{$key}($contact);
|
||||||
}
|
} elseif($contact->{$key}) {
|
||||||
elseif($contact->{$key})
|
|
||||||
return $contact->{$key} ?? '';
|
return $contact->{$key} ?? '';
|
||||||
|
}
|
||||||
|
|
||||||
return '';
|
return '';
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -35,16 +35,23 @@ class VendorDecorator extends Decorator implements DecoratorInterface
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function country_id(Vendor $vendor){
|
public function country_id(Vendor $vendor)
|
||||||
|
{
|
||||||
return $vendor->country ? $vendor->country->name : '';
|
return $vendor->country ? $vendor->country->name : '';
|
||||||
}
|
}
|
||||||
public function name(Vendor $vendor){
|
|
||||||
|
public function name(Vendor $vendor)
|
||||||
|
{
|
||||||
return $vendor->present()->name();
|
return $vendor->present()->name();
|
||||||
}
|
}
|
||||||
public function currency(Vendor $vendor){
|
|
||||||
|
public function currency(Vendor $vendor)
|
||||||
|
{
|
||||||
return $vendor->currency_id ? $vendor->currency()->code : $vendor->company->currency()->code;
|
return $vendor->currency_id ? $vendor->currency()->code : $vendor->company->currency()->code;
|
||||||
}
|
}
|
||||||
public function classification(Vendor $vendor) {
|
|
||||||
|
public function classification(Vendor $vendor)
|
||||||
|
{
|
||||||
ctrans("texts.{$vendor->classification}") ?? '';
|
ctrans("texts.{$vendor->classification}") ?? '';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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
|
||||||
{
|
{
|
||||||
|
@ -107,13 +107,13 @@ class CreditFilters extends QueryFilters
|
|||||||
return $this->builder;
|
return $this->builder;
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->builder->where(function ($query){
|
return $this->builder->where(function ($query) {
|
||||||
$query->whereIn('status_id', [Credit::STATUS_SENT, Credit::STATUS_PARTIAL])
|
$query->whereIn('status_id', [Credit::STATUS_SENT, Credit::STATUS_PARTIAL])
|
||||||
->where('balance', '>', 0)
|
->where('balance', '>', 0)
|
||||||
->where(function ($q){
|
->where(function ($q) {
|
||||||
$q->whereNull('due_date')->orWhere('due_date', '>', now());
|
$q->whereNull('due_date')->orWhere('due_date', '>', now());
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public function number(string $number = ''): Builder
|
public function number(string $number = ''): Builder
|
||||||
|
@ -527,10 +527,9 @@ class LoginController extends BaseController
|
|||||||
|
|
||||||
if (request()->has('id_token')) {
|
if (request()->has('id_token')) {
|
||||||
$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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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.
|
||||||
@ -218,7 +218,7 @@ class ClientController extends BaseController
|
|||||||
$clients = Client::withTrashed()
|
$clients = Client::withTrashed()
|
||||||
->company()
|
->company()
|
||||||
->whereIn('id', $request->ids)
|
->whereIn('id', $request->ids)
|
||||||
->get();
|
->get();
|
||||||
|
|
||||||
if($action == 'template' && $user->can('view', $clients->first())) {
|
if($action == 'template' && $user->can('view', $clients->first())) {
|
||||||
|
|
||||||
@ -387,7 +387,7 @@ class ClientController extends BaseController
|
|||||||
/** @var \Postmark\Models\DynamicResponseModel $response */
|
/** @var \Postmark\Models\DynamicResponseModel $response */
|
||||||
$response = $postmark->activateBounce((int)$bounce_id);
|
$response = $postmark->activateBounce((int)$bounce_id);
|
||||||
|
|
||||||
if($response && $response?->Message == 'OK' && !$response->Bounce->Inactive && $response->Bounce->Email){
|
if($response && $response?->Message == 'OK' && !$response->Bounce->Inactive && $response->Bounce->Email) {
|
||||||
|
|
||||||
$email = $response->Bounce->Email;
|
$email = $response->Bounce->Email;
|
||||||
//remove email from quarantine. //@TODO
|
//remove email from quarantine. //@TODO
|
||||||
|
@ -168,7 +168,7 @@ class InvitationController extends Controller
|
|||||||
set_time_limit(45);
|
set_time_limit(45);
|
||||||
|
|
||||||
// if (Ninja::isHosted()) {
|
// if (Ninja::isHosted()) {
|
||||||
return $this->returnRawPdf($entity, $invitation_key);
|
return $this->returnRawPdf($entity, $invitation_key);
|
||||||
// }
|
// }
|
||||||
|
|
||||||
// return redirect('client/'.$entity.'/'.$invitation_key.'/download_pdf');
|
// return redirect('client/'.$entity.'/'.$invitation_key.'/download_pdf');
|
||||||
|
@ -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
|
||||||
|
@ -201,15 +201,15 @@ class CompanyGatewayController extends BaseController
|
|||||||
$company_gateway->fill($request->all());
|
$company_gateway->fill($request->all());
|
||||||
$company_gateway->save();
|
$company_gateway->save();
|
||||||
|
|
||||||
/*Always ensure at least one fees and limits object is set per gateway*/
|
/*Always ensure at least one fees and limits object is set per gateway*/
|
||||||
$gateway_types = $company_gateway->driver(new Client)->getAvailableMethods();
|
$gateway_types = $company_gateway->driver(new Client)->getAvailableMethods();
|
||||||
|
|
||||||
$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;
|
||||||
|
@ -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.
|
||||||
|
@ -528,7 +528,7 @@ class InvoiceController extends BaseController
|
|||||||
|
|
||||||
$filename = $invoices->first()->getFileName();
|
$filename = $invoices->first()->getFileName();
|
||||||
|
|
||||||
return response()->streamDownload(function () use($invoices) {
|
return response()->streamDownload(function () use ($invoices) {
|
||||||
echo $invoices->first()->service()->getInvoicePdf();
|
echo $invoices->first()->service()->getInvoicePdf();
|
||||||
}, $filename, ['Content-Type' => 'application/pdf']);
|
}, $filename, ['Content-Type' => 'application/pdf']);
|
||||||
}
|
}
|
||||||
|
@ -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.
|
||||||
@ -519,7 +519,7 @@ class PaymentController extends BaseController
|
|||||||
if($action == 'template' && $user->can('view', $payments->first())) {
|
if($action == 'template' && $user->can('view', $payments->first())) {
|
||||||
|
|
||||||
$hash_or_response = request()->boolean('send_email') ? 'email sent' : \Illuminate\Support\Str::uuid();
|
$hash_or_response = request()->boolean('send_email') ? 'email sent' : \Illuminate\Support\Str::uuid();
|
||||||
nlog($payments->pluck('hashed_id')->toArray());
|
nlog($payments->pluck('hashed_id')->toArray());
|
||||||
TemplateAction::dispatch(
|
TemplateAction::dispatch(
|
||||||
$payments->pluck('hashed_id')->toArray(),
|
$payments->pluck('hashed_id')->toArray(),
|
||||||
$request->template_id,
|
$request->template_id,
|
||||||
|
@ -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.
|
||||||
@ -854,7 +854,7 @@ class QuoteController extends BaseController
|
|||||||
$headers = array_merge($headers, ['Content-Disposition' => 'inline']);
|
$headers = array_merge($headers, ['Content-Disposition' => 'inline']);
|
||||||
}
|
}
|
||||||
|
|
||||||
return response()->streamDownload(function () use ($quote,$contact) {
|
return response()->streamDownload(function () use ($quote, $contact) {
|
||||||
echo $quote->service()->getQuotePdf($contact);
|
echo $quote->service()->getQuotePdf($contact);
|
||||||
}, $quote->getFileName(), $headers);
|
}, $quote->getFileName(), $headers);
|
||||||
|
|
||||||
|
@ -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
|
||||||
{
|
{
|
||||||
|
@ -27,7 +27,7 @@ class SubdomainController extends BaseController
|
|||||||
public function index()
|
public function index()
|
||||||
{
|
{
|
||||||
if (!MultiDB::checkDomainAvailable(request()->input('subdomain'))) {
|
if (!MultiDB::checkDomainAvailable(request()->input('subdomain'))) {
|
||||||
return response()->json(['message' => ctrans('texts.subdomain_is_not_available')], 401);
|
return response()->json(['message' => ctrans('texts.subdomain_is_not_available')], 401);
|
||||||
}
|
}
|
||||||
|
|
||||||
return response()->json(['message' => 'Domain available'], 200);
|
return response()->json(['message' => 'Domain available'], 200);
|
||||||
|
@ -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
|
||||||
{
|
{
|
||||||
|
@ -67,9 +67,9 @@ class Locale
|
|||||||
* @return mixed
|
* @return mixed
|
||||||
*/
|
*/
|
||||||
public function handle($request, Closure $next)
|
public function handle($request, Closure $next)
|
||||||
{
|
{
|
||||||
/*LOCALE SET */
|
/*LOCALE SET */
|
||||||
if ($request->has('lang') && in_array($request->input('lang','en'), $this->locales) ) {
|
if ($request->has('lang') && in_array($request->input('lang', 'en'), $this->locales)) {
|
||||||
$locale = $request->input('lang');
|
$locale = $request->input('lang');
|
||||||
App::setLocale($locale);
|
App::setLocale($locale);
|
||||||
} elseif (auth()->guard('contact')->user()) {
|
} elseif (auth()->guard('contact')->user()) {
|
||||||
|
@ -17,48 +17,48 @@ use Illuminate\Support\Facades\App;
|
|||||||
|
|
||||||
class VendorLocale
|
class VendorLocale
|
||||||
{
|
{
|
||||||
private array $locales = [
|
private array $locales = [
|
||||||
'en',
|
'en',
|
||||||
'it',
|
'it',
|
||||||
'de',
|
'de',
|
||||||
'fr',
|
'fr',
|
||||||
'pt_BR',
|
'pt_BR',
|
||||||
'nl',
|
'nl',
|
||||||
'es',
|
'es',
|
||||||
'nb_NO',
|
'nb_NO',
|
||||||
'da',
|
'da',
|
||||||
'ja',
|
'ja',
|
||||||
'sv',
|
'sv',
|
||||||
'es_ES',
|
'es_ES',
|
||||||
'fr_CA',
|
'fr_CA',
|
||||||
'lt',
|
'lt',
|
||||||
'pl',
|
'pl',
|
||||||
'cs',
|
'cs',
|
||||||
'hr',
|
'hr',
|
||||||
'sq',
|
'sq',
|
||||||
'el',
|
'el',
|
||||||
'en_GB',
|
'en_GB',
|
||||||
'pt_PT',
|
'pt_PT',
|
||||||
'sl',
|
'sl',
|
||||||
'fi',
|
'fi',
|
||||||
'ro',
|
'ro',
|
||||||
'tr_TR',
|
'tr_TR',
|
||||||
'th',
|
'th',
|
||||||
'mk_MK',
|
'mk_MK',
|
||||||
'zh_TW',
|
'zh_TW',
|
||||||
'ru_RU',
|
'ru_RU',
|
||||||
'ar',
|
'ar',
|
||||||
'fa',
|
'fa',
|
||||||
'lv_LV',
|
'lv_LV',
|
||||||
'sr',
|
'sr',
|
||||||
'sk',
|
'sk',
|
||||||
'et',
|
'et',
|
||||||
'bg',
|
'bg',
|
||||||
'he',
|
'he',
|
||||||
'km_KH',
|
'km_KH',
|
||||||
'hu',
|
'hu',
|
||||||
'fr_CH',
|
'fr_CH',
|
||||||
];
|
];
|
||||||
/**
|
/**
|
||||||
* Handle an incoming request.
|
* Handle an incoming request.
|
||||||
*
|
*
|
||||||
@ -74,7 +74,7 @@ class VendorLocale
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*LOCALE SET */
|
/*LOCALE SET */
|
||||||
if ($request->has('lang') && in_array($request->input('lang','en'), $this->locales) ) {
|
if ($request->has('lang') && in_array($request->input('lang', 'en'), $this->locales)) {
|
||||||
$locale = $request->input('lang');
|
$locale = $request->input('lang');
|
||||||
App::setLocale($locale);
|
App::setLocale($locale);
|
||||||
} elseif (auth()->guard('vendor')->user()) {
|
} elseif (auth()->guard('vendor')->user()) {
|
||||||
|
@ -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
|
||||||
|
@ -74,12 +74,12 @@ class SendEmailRequest extends Request
|
|||||||
$input['entity'] = "App\Models\\".ucfirst(Str::camel($input['entity']));
|
$input['entity'] = "App\Models\\".ucfirst(Str::camel($input['entity']));
|
||||||
}
|
}
|
||||||
|
|
||||||
if(isset($input['cc_email'])){
|
if(isset($input['cc_email'])) {
|
||||||
$input['cc_email'] = collect(explode(",", $input['cc_email']))->map(function($email){
|
$input['cc_email'] = collect(explode(",", $input['cc_email']))->map(function ($email) {
|
||||||
return trim($email);
|
return trim($email);
|
||||||
})->filter(function($email){
|
})->filter(function ($email) {
|
||||||
return filter_var($email, FILTER_VALIDATE_EMAIL);
|
return filter_var($email, FILTER_VALIDATE_EMAIL);
|
||||||
})->slice(0,4)->toArray();
|
})->slice(0, 4)->toArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->replace($input);
|
$this->replace($input);
|
||||||
|
@ -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
|
||||||
{
|
{
|
||||||
|
@ -97,7 +97,7 @@ class StorePaymentRequest extends Request
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (! isset($input['idempotency_key'])) {
|
if (! isset($input['idempotency_key'])) {
|
||||||
$input['idempotency_key'] = substr(sha1(json_encode($input)).time()."{$input['date']}{$input['amount']}{$user->id}",0,64);
|
$input['idempotency_key'] = substr(sha1(json_encode($input)).time()."{$input['date']}{$input['amount']}{$user->id}", 0, 64);
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->replace($input);
|
$this->replace($input);
|
||||||
|
@ -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
|
||||||
{
|
{
|
||||||
|
@ -56,8 +56,9 @@ class StoreTaskRequest extends Request
|
|||||||
|
|
||||||
$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.');
|
||||||
@ -119,7 +120,7 @@ class StoreTaskRequest extends Request
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!isset($input['time_log']) || empty($input['time_log']) || $input['time_log'] == '{}'){
|
if(!isset($input['time_log']) || empty($input['time_log']) || $input['time_log'] == '{}') {
|
||||||
$input['time_log'] = json_encode([]);
|
$input['time_log'] = json_encode([]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -77,7 +77,7 @@ class BaseTransformer
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function getString($data, $field)
|
public function getString($data, $field)
|
||||||
{
|
{
|
||||||
return isset($data[$field]) && $data[$field] ? trim($data[$field]) : '';
|
return isset($data[$field]) && $data[$field] ? trim($data[$field]) : '';
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -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)
|
||||||
|
@ -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;
|
||||||
@ -218,7 +217,7 @@ class CompanyImport implements ShouldQueue
|
|||||||
'baseline' => [],
|
'baseline' => [],
|
||||||
'5.7.35' => [
|
'5.7.35' => [
|
||||||
Payment::class => [
|
Payment::class => [
|
||||||
'refund_meta',
|
'refund_meta',
|
||||||
'category_id',
|
'category_id',
|
||||||
],
|
],
|
||||||
User::class => [
|
User::class => [
|
||||||
@ -462,7 +461,7 @@ class CompanyImport implements ShouldQueue
|
|||||||
|
|
||||||
$this->company->save();
|
$this->company->save();
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
private function purgeCompanyData()
|
private function purgeCompanyData()
|
||||||
@ -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;
|
||||||
@ -1390,9 +1390,9 @@ class CompanyImport implements ShouldQueue
|
|||||||
return $collection->slice($version_index)->pluck($class)->filter();
|
return $collection->slice($version_index)->pluck($class)->filter();
|
||||||
});
|
});
|
||||||
|
|
||||||
return collect($obj_array)->diffKeys($filters->flatten()->flip())->toArray();
|
return collect($obj_array)->diffKeys($filters->flatten()->flip())->toArray();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private function genericNewClassImport($class, $unset, $transforms, $object_property)
|
private function genericNewClassImport($class, $unset, $transforms, $object_property)
|
||||||
{
|
{
|
||||||
@ -1415,7 +1415,7 @@ class CompanyImport implements ShouldQueue
|
|||||||
$obj_array['gateway_key'] = 'd14dd26a37cecc30fdd65700bfb55b23';
|
$obj_array['gateway_key'] = 'd14dd26a37cecc30fdd65700bfb55b23';
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!isset($obj_array['fees_and_limits'])){
|
if(!isset($obj_array['fees_and_limits'])) {
|
||||||
$obj_array['fees_and_limits'] = \json_encode([]);
|
$obj_array['fees_and_limits'] = \json_encode([]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1467,16 +1467,16 @@ class CompanyImport implements ShouldQueue
|
|||||||
/** @var \stdClass $parameters */
|
/** @var \stdClass $parameters */
|
||||||
$parameters = $obj_array['parameters'];
|
$parameters = $obj_array['parameters'];
|
||||||
|
|
||||||
if(isset($parameters->clients)){
|
if(isset($parameters->clients)) {
|
||||||
|
|
||||||
$parameters->clients =
|
$parameters->clients =
|
||||||
collect($parameters->clients)->map(function ($client_hash){
|
collect($parameters->clients)->map(function ($client_hash) {
|
||||||
return $this->encodePrimaryKey($this->transformId('clients', $client_hash));
|
return $this->encodePrimaryKey($this->transformId('clients', $client_hash));
|
||||||
})->toArray();
|
})->toArray();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(isset($parameters->entity_id)){
|
if(isset($parameters->entity_id)) {
|
||||||
$parameters->entity_id = $this->encodePrimaryKey($this->transformId($parameters->entity."s", $parameters->entity_id));
|
$parameters->entity_id = $this->encodePrimaryKey($this->transformId($parameters->entity."s", $parameters->entity_id));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1485,7 +1485,7 @@ class CompanyImport implements ShouldQueue
|
|||||||
|
|
||||||
$new_obj = new $class();
|
$new_obj = new $class();
|
||||||
$new_obj->company_id = $this->company->id;
|
$new_obj->company_id = $this->company->id;
|
||||||
$obj_array = $this->filterVersionProps($class,$obj_array);
|
$obj_array = $this->filterVersionProps($class, $obj_array);
|
||||||
|
|
||||||
$new_obj->fill($obj_array);
|
$new_obj->fill($obj_array);
|
||||||
|
|
||||||
|
@ -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;
|
||||||
|
@ -79,9 +79,9 @@ class UpdateCalculatedFields
|
|||||||
|
|
||||||
$project->tasks->each(function ($task) use (&$duration) {
|
$project->tasks->each(function ($task) use (&$duration) {
|
||||||
|
|
||||||
if(is_iterable(json_decode($task->time_log) )) {
|
if(is_iterable(json_decode($task->time_log))) {
|
||||||
|
|
||||||
foreach(json_decode($task->time_log) as $log) {
|
foreach(json_decode($task->time_log) as $log) {
|
||||||
|
|
||||||
$start_time = $log[0];
|
$start_time = $log[0];
|
||||||
$end_time = $log[1] == 0 ? time() : $log[1];
|
$end_time = $log[1] == 0 ? time() : $log[1];
|
||||||
|
@ -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
|
||||||
{
|
{
|
||||||
@ -63,7 +63,7 @@ class CreateRawPdf
|
|||||||
} elseif ($invitation instanceof RecurringInvoiceInvitation) {
|
} elseif ($invitation instanceof RecurringInvoiceInvitation) {
|
||||||
$this->entity = $invitation->recurring_invoice;
|
$this->entity = $invitation->recurring_invoice;
|
||||||
$this->entity_string = 'recurring_invoice';
|
$this->entity_string = 'recurring_invoice';
|
||||||
} elseif ($invitation instanceof PurchaseOrderInvitation){
|
} elseif ($invitation instanceof PurchaseOrderInvitation) {
|
||||||
$this->entity = $invitation->purchase_order;
|
$this->entity = $invitation->purchase_order;
|
||||||
$this->entity_string = 'purchase_order';
|
$this->entity_string = 'purchase_order';
|
||||||
}
|
}
|
||||||
@ -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,9 +41,9 @@ class VendorExpenseNotify implements ShouldQueue
|
|||||||
{
|
{
|
||||||
MultiDB::setDB($this->db);
|
MultiDB::setDB($this->db);
|
||||||
|
|
||||||
$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) {
|
||||||
$this->notify($contact);
|
$this->notify($contact);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -96,4 +96,4 @@ class VendorExpenseNotify implements ShouldQueue
|
|||||||
$activity_repo->save($fields, $this->expense, Ninja::eventVars());
|
$activity_repo->save($fields, $this->expense, Ninja::eventVars());
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -89,7 +89,7 @@ class ClientLedgerBalanceUpdate implements ShouldQueue
|
|||||||
$company_ledger->balance = ($parent_ledger ? $parent_ledger->balance : 0) + $company_ledger->adjustment;
|
$company_ledger->balance = ($parent_ledger ? $parent_ledger->balance : 0) + $company_ledger->adjustment;
|
||||||
$company_ledger->save();
|
$company_ledger->save();
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
// nlog("finished job {$uuid}");
|
// nlog("finished job {$uuid}");
|
||||||
}
|
}
|
||||||
|
@ -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,20 +51,21 @@ 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();
|
||||||
$cl->adjustment = $ledger_item ? $balance : ($balance - $this->start_amount);
|
$cl->adjustment = $ledger_item ? $balance : ($balance - $this->start_amount);
|
||||||
|
|
||||||
$parent_ledger = CompanyLedger::query()
|
$parent_ledger = CompanyLedger::query()
|
||||||
->where('id', '<', $cl->id)
|
->where('id', '<', $cl->id)
|
||||||
->where('company_id', $cl->company_id)
|
->where('company_id', $cl->company_id)
|
||||||
->where('client_id', $cl->client_id)
|
->where('client_id', $cl->client_id)
|
||||||
->where('balance', '!=', 0)
|
->where('balance', '!=', 0)
|
||||||
->orderBy('id', 'DESC')
|
->orderBy('id', 'DESC')
|
||||||
->first();
|
->first();
|
||||||
|
|
||||||
$cl->balance = ($parent_ledger ? $parent_ledger->balance : 0) + $cl->adjustment;
|
$cl->balance = ($parent_ledger ? $parent_ledger->balance : 0) + $cl->adjustment;
|
||||||
$cl->save();
|
$cl->save();
|
||||||
|
@ -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;
|
||||||
|
@ -159,4 +159,4 @@ class SystemMaintenance implements ShouldQueue
|
|||||||
|
|
||||||
// }
|
// }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -111,7 +111,7 @@ class EmailPayment implements ShouldQueue
|
|||||||
|
|
||||||
$invoice = $this->payment->invoices->first();
|
$invoice = $this->payment->invoices->first();
|
||||||
|
|
||||||
$invoice->invitations->each(function ($invite) use ($email_builder){
|
$invoice->invitations->each(function ($invite) use ($email_builder) {
|
||||||
|
|
||||||
$nmo = new NinjaMailerObject;
|
$nmo = new NinjaMailerObject;
|
||||||
$nmo->mailable = new TemplateEmail($email_builder, $invite->contact, $invite);
|
$nmo->mailable = new TemplateEmail($email_builder, $invite->contact, $invite);
|
||||||
|
@ -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
|
||||||
{
|
{
|
||||||
@ -81,7 +81,7 @@ class VersionCheck implements ShouldQueue
|
|||||||
$c->send_email = false;
|
$c->send_email = false;
|
||||||
$c->saveQuietly();
|
$c->saveQuietly();
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
ClientContact::query()
|
ClientContact::query()
|
||||||
->whereNull('contact_key')
|
->whereNull('contact_key')
|
||||||
@ -91,7 +91,7 @@ class VersionCheck implements ShouldQueue
|
|||||||
|
|
||||||
Client::doesntHave('contacts')
|
Client::doesntHave('contacts')
|
||||||
->cursor()
|
->cursor()
|
||||||
->each(function ($client){
|
->each(function ($client) {
|
||||||
|
|
||||||
$new_contact = ClientContactFactory::create($client->company_id, $client->user_id);
|
$new_contact = ClientContactFactory::create($client->company_id, $client->user_id);
|
||||||
$new_contact->client_id = $client->id;
|
$new_contact->client_id = $client->id;
|
||||||
@ -104,14 +104,14 @@ class VersionCheck implements ShouldQueue
|
|||||||
|
|
||||||
Vendor::doesntHave('contacts')
|
Vendor::doesntHave('contacts')
|
||||||
->cursor()
|
->cursor()
|
||||||
->each(function ($vendor){
|
->each(function ($vendor) {
|
||||||
|
|
||||||
$new_contact = VendorContactFactory::create($vendor->company_id, $vendor->user_id);
|
$new_contact = VendorContactFactory::create($vendor->company_id, $vendor->user_id);
|
||||||
$new_contact->vendor_id = $vendor->id;
|
$new_contact->vendor_id = $vendor->id;
|
||||||
$new_contact->contact_key = Str::random(40);
|
$new_contact->contact_key = Str::random(40);
|
||||||
$new_contact->is_primary = true;
|
$new_contact->is_primary = true;
|
||||||
$new_contact->save();
|
$new_contact->save();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
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,23 +11,15 @@
|
|||||||
|
|
||||||
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
|
||||||
{
|
{
|
||||||
|
|
||||||
use Dispatchable, InteractsWithSockets, SerializesModels;
|
use Dispatchable, InteractsWithSockets, SerializesModels;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create the event listener.
|
* Create the event listener.
|
||||||
|
@ -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;
|
||||||
|
@ -90,7 +90,7 @@ class Gateway extends StaticModel
|
|||||||
|
|
||||||
if ($this->id == 1) {
|
if ($this->id == 1) {
|
||||||
$link = 'http://reseller.authorize.net/application/?id=5560364';
|
$link = 'http://reseller.authorize.net/application/?id=5560364';
|
||||||
} elseif (in_array($this->id,[15,60,61])) {
|
} elseif (in_array($this->id, [15,60,61])) {
|
||||||
$link = 'https://www.paypal.com/us/cgi-bin/webscr?cmd=_login-api-run';
|
$link = 'https://www.paypal.com/us/cgi-bin/webscr?cmd=_login-api-run';
|
||||||
} elseif ($this->id == 24) {
|
} elseif ($this->id == 24) {
|
||||||
$link = 'https://www.2checkout.com/referral?r=2c37ac2298';
|
$link = 'https://www.2checkout.com/referral?r=2c37ac2298';
|
||||||
|
@ -164,11 +164,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 '';
|
||||||
|
|
||||||
@ -255,18 +257,20 @@ class Task extends BaseModel
|
|||||||
public function processLogs()
|
public function processLogs()
|
||||||
{
|
{
|
||||||
|
|
||||||
return
|
return
|
||||||
collect(json_decode($this->time_log,true))->map(function ($log){
|
collect(json_decode($this->time_log, true))->map(function ($log) {
|
||||||
|
|
||||||
$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();
|
||||||
@ -276,28 +280,27 @@ class Task extends BaseModel
|
|||||||
public function processLogsExpandedNotation()
|
public function processLogsExpandedNotation()
|
||||||
{
|
{
|
||||||
|
|
||||||
return
|
return
|
||||||
collect(json_decode($this->time_log,true))->map(function ($log){
|
collect(json_decode($this->time_log, true))->map(function ($log) {
|
||||||
|
|
||||||
$parent_entity = $this->client ?? $this->company;
|
$parent_entity = $this->client ?? $this->company;
|
||||||
$logged = [];
|
$logged = [];
|
||||||
|
|
||||||
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');
|
||||||
}
|
}
|
||||||
|
@ -99,7 +99,7 @@ class AuthorizeCustomer
|
|||||||
$client = $client_gateway_token->client;
|
$client = $client_gateway_token->client;
|
||||||
} elseif ($client_contact = ClientContact::where('company_id', $company->id)->where('email', $profile['email'])->first()) {
|
} elseif ($client_contact = ClientContact::where('company_id', $company->id)->where('email', $profile['email'])->first()) {
|
||||||
$client = $client_contact->client;
|
$client = $client_contact->client;
|
||||||
// nlog("found client through contact");
|
// nlog("found client through contact");
|
||||||
} else {
|
} else {
|
||||||
// nlog("creating client");
|
// nlog("creating client");
|
||||||
|
|
||||||
|
@ -749,19 +749,19 @@ class BaseDriver extends AbstractPaymentDriver
|
|||||||
|
|
||||||
$invoices_string = str_replace(["*","<",">","'",'"'], "-", $invoices_string);
|
$invoices_string = str_replace(["*","<",">","'",'"'], "-", $invoices_string);
|
||||||
|
|
||||||
// 2023-11-02 - improve the statement descriptor for string
|
// 2023-11-02 - improve the statement descriptor for string
|
||||||
|
|
||||||
$company_name = $this->client->company->present()->name();
|
$company_name = $this->client->company->present()->name();
|
||||||
$company_name = str_replace(["*","<",">","'",'"'], "-", $company_name);
|
$company_name = str_replace(["*","<",">","'",'"'], "-", $company_name);
|
||||||
|
|
||||||
if(ctype_digit(substr($company_name, 0, 1))) {
|
if(ctype_digit(substr($company_name, 0, 1))) {
|
||||||
$company_name = "I" . $company_name;
|
$company_name = "I" . $company_name;
|
||||||
}
|
}
|
||||||
|
|
||||||
$company_name = substr($company_name, 0, 11);
|
$company_name = substr($company_name, 0, 11);
|
||||||
$descriptor = "{$company_name} {$invoices_string}";
|
$descriptor = "{$company_name} {$invoices_string}";
|
||||||
$descriptor = substr($descriptor, 0, 22);
|
$descriptor = substr($descriptor, 0, 22);
|
||||||
return $descriptor;
|
return $descriptor;
|
||||||
|
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
|
@ -406,7 +406,7 @@ class GoCardlessPaymentDriver extends BaseDriver
|
|||||||
|
|
||||||
if(!in_array($mandate->status, ['pending_submission', 'submitted', 'active','pending_customer_approval'])) {
|
if(!in_array($mandate->status, ['pending_submission', 'submitted', 'active','pending_customer_approval'])) {
|
||||||
|
|
||||||
// if ($mandate->status !== 'active') {
|
// if ($mandate->status !== 'active') {
|
||||||
throw new \Exception(ctrans('texts.gocardless_mandate_not_ready'));
|
throw new \Exception(ctrans('texts.gocardless_mandate_not_ready'));
|
||||||
}
|
}
|
||||||
} catch (\Exception $exception) {
|
} catch (\Exception $exception) {
|
||||||
|
@ -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
|
||||||
@ -65,7 +64,7 @@ class PayPalPPCPPaymentDriver extends BaseDriver
|
|||||||
];
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return an array of
|
* Return an array of
|
||||||
* enabled gateway payment methods
|
* enabled gateway payment methods
|
||||||
*
|
*
|
||||||
* @return array
|
* @return array
|
||||||
@ -74,9 +73,9 @@ class PayPalPPCPPaymentDriver extends BaseDriver
|
|||||||
{
|
{
|
||||||
|
|
||||||
return collect($this->company_gateway->fees_and_limits)
|
return collect($this->company_gateway->fees_and_limits)
|
||||||
->filter(function ($fee){
|
->filter(function ($fee) {
|
||||||
return $fee->is_enabled;
|
return $fee->is_enabled;
|
||||||
})->map(function ($fee, $key){
|
})->map(function ($fee, $key) {
|
||||||
return (int)$key;
|
return (int)$key;
|
||||||
})->toArray();
|
})->toArray();
|
||||||
|
|
||||||
@ -86,7 +85,7 @@ class PayPalPPCPPaymentDriver extends BaseDriver
|
|||||||
{
|
{
|
||||||
$method = PaymentType::PAYPAL;
|
$method = PaymentType::PAYPAL;
|
||||||
|
|
||||||
match($gateway_type_id){
|
match($gateway_type_id) {
|
||||||
"1" => $method = PaymentType::CREDIT_CARD_OTHER,
|
"1" => $method = PaymentType::CREDIT_CARD_OTHER,
|
||||||
"3" => $method = PaymentType::PAYPAL,
|
"3" => $method = PaymentType::PAYPAL,
|
||||||
"25" => $method = PaymentType::VENMO,
|
"25" => $method = PaymentType::VENMO,
|
||||||
@ -132,7 +131,7 @@ class PayPalPPCPPaymentDriver extends BaseDriver
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Initialize the Paypal gateway.
|
* Initialize the Paypal gateway.
|
||||||
*
|
*
|
||||||
* Attempt to generate and return the access token.
|
* Attempt to generate and return the access token.
|
||||||
*
|
*
|
||||||
* @return self
|
* @return self
|
||||||
@ -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'])
|
||||||
@ -194,7 +194,7 @@ class PayPalPPCPPaymentDriver extends BaseDriver
|
|||||||
private function checkPaymentsReceivable(): self
|
private function checkPaymentsReceivable(): self
|
||||||
{
|
{
|
||||||
|
|
||||||
if($this->company_gateway->getConfigField('status') != 'activated'){
|
if($this->company_gateway->getConfigField('status') != 'activated') {
|
||||||
|
|
||||||
if (class_exists(\Modules\Admin\Services\PayPal\PayPalService::class)) {
|
if (class_exists(\Modules\Admin\Services\PayPal\PayPalService::class)) {
|
||||||
$pp = new \Modules\Admin\Services\PayPal\PayPalService($this->company_gateway->company, $this->company_gateway->user);
|
$pp = new \Modules\Admin\Services\PayPal\PayPalService($this->company_gateway->company, $this->company_gateway->user);
|
||||||
@ -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],
|
||||||
@ -360,7 +363,7 @@ class PayPalPPCPPaymentDriver extends BaseDriver
|
|||||||
|
|
||||||
$invoice = Invoice::withTrashed()->find($this->decodePrimaryKey($_invoice->invoice_id));
|
$invoice = Invoice::withTrashed()->find($this->decodePrimaryKey($_invoice->invoice_id));
|
||||||
|
|
||||||
$description = collect($invoice->line_items)->map(function ($item){
|
$description = collect($invoice->line_items)->map(function ($item) {
|
||||||
return $item->notes;
|
return $item->notes;
|
||||||
})->implode("\n");
|
})->implode("\n");
|
||||||
|
|
||||||
@ -405,7 +408,7 @@ class PayPalPPCPPaymentDriver extends BaseDriver
|
|||||||
];
|
];
|
||||||
|
|
||||||
|
|
||||||
if($shipping = $this->getShippingAddress()){
|
if($shipping = $this->getShippingAddress()) {
|
||||||
$order['purchase_units'][0] = $shipping;
|
$order['purchase_units'][0] = $shipping;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -417,9 +420,9 @@ class PayPalPPCPPaymentDriver extends BaseDriver
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private function getBillingAddress(): array
|
private function getBillingAddress(): array
|
||||||
{
|
{
|
||||||
return
|
return
|
||||||
[
|
[
|
||||||
"address_line_1" => $this->client->address1,
|
"address_line_1" => $this->client->address1,
|
||||||
"address_line_2" => $this->client->address2,
|
"address_line_2" => $this->client->address2,
|
||||||
@ -432,10 +435,10 @@ class PayPalPPCPPaymentDriver extends BaseDriver
|
|||||||
|
|
||||||
private function getShippingAddress(): ?array
|
private function getShippingAddress(): ?array
|
||||||
{
|
{
|
||||||
return $this->company_gateway->require_shipping_address ?
|
return $this->company_gateway->require_shipping_address ?
|
||||||
[
|
[
|
||||||
"shipping" => [
|
"shipping" => [
|
||||||
"address" =>
|
"address" =>
|
||||||
[
|
[
|
||||||
"address_line_1" => $this->client->shipping_address1,
|
"address_line_1" => $this->client->shipping_address1,
|
||||||
"address_line_2" => $this->client->shipping_address2,
|
"address_line_2" => $this->client->shipping_address2,
|
||||||
@ -481,4 +484,4 @@ class PayPalPPCPPaymentDriver extends BaseDriver
|
|||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -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;
|
||||||
}
|
}
|
||||||
@ -188,13 +188,13 @@ class ExpenseRepository extends BaseRepository
|
|||||||
{
|
{
|
||||||
$ec = ExpenseCategory::withTrashed()->find($category_id);
|
$ec = ExpenseCategory::withTrashed()->find($category_id);
|
||||||
|
|
||||||
$expenses->when($ec)
|
$expenses->when($ec)
|
||||||
->each(function ($expense) use($ec){
|
->each(function ($expense) use ($ec) {
|
||||||
|
|
||||||
$expense->category_id = $ec->id;
|
$expense->category_id = $ec->id;
|
||||||
$expense->save();
|
$expense->save();
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -55,7 +55,7 @@ class VendorRepository extends BaseRepository
|
|||||||
|
|
||||||
if ($vendor->number == '' || ! $vendor->number) {
|
if ($vendor->number == '' || ! $vendor->number) {
|
||||||
$vendor->number = $this->getNextVendorNumber($vendor);
|
$vendor->number = $this->getNextVendorNumber($vendor);
|
||||||
}
|
}
|
||||||
|
|
||||||
$vendor->saveQuietly();
|
$vendor->saveQuietly();
|
||||||
|
|
||||||
|
@ -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
|
||||||
{
|
{
|
||||||
@ -65,7 +64,7 @@ class ClientService
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Seeing too many race conditions under heavy load here.
|
* Seeing too many race conditions under heavy load here.
|
||||||
*
|
*
|
||||||
* @param float $amount
|
* @param float $amount
|
||||||
* @return ClientService
|
* @return ClientService
|
||||||
*/
|
*/
|
||||||
|
@ -80,25 +80,25 @@ class PaymentMethod
|
|||||||
return array_search($model->id, $transformed_ids); // this closure sorts for us
|
return array_search($model->id, $transformed_ids); // this closure sorts for us
|
||||||
});
|
});
|
||||||
|
|
||||||
//2023-10-11 - Roll back, do not show any gateways, if they have been archived upstream.
|
//2023-10-11 - Roll back, do not show any gateways, if they have been archived upstream.
|
||||||
//removing this logic now to prevent any
|
//removing this logic now to prevent any
|
||||||
// if($this->gateways->count() == 0 && count($transformed_ids) >=1) {
|
// if($this->gateways->count() == 0 && count($transformed_ids) >=1) {
|
||||||
|
|
||||||
// /**
|
// /**
|
||||||
// * This is a fallback in case a user archives some gateways that have been ordered preferentially.
|
// * This is a fallback in case a user archives some gateways that have been ordered preferentially.
|
||||||
// *
|
// *
|
||||||
// * If the user archives a parent gateway upstream, it may leave a client setting in a state where no payment gateways are available.
|
// * If the user archives a parent gateway upstream, it may leave a client setting in a state where no payment gateways are available.
|
||||||
// *
|
// *
|
||||||
// * In this case we fall back to all gateways.
|
// * In this case we fall back to all gateways.
|
||||||
// */
|
// */
|
||||||
// $this->gateways = CompanyGateway::query()
|
// $this->gateways = CompanyGateway::query()
|
||||||
// ->with('gateway')
|
// ->with('gateway')
|
||||||
// ->where('company_id', $this->client->company_id)
|
// ->where('company_id', $this->client->company_id)
|
||||||
// ->where('gateway_key', '!=', '54faab2ab6e3223dbe848b1686490baa')
|
// ->where('gateway_key', '!=', '54faab2ab6e3223dbe848b1686490baa')
|
||||||
// ->whereNull('deleted_at')
|
// ->whereNull('deleted_at')
|
||||||
// ->where('is_deleted', false)->get();
|
// ->where('is_deleted', false)->get();
|
||||||
|
|
||||||
// }
|
// }
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
$this->gateways = CompanyGateway::query()
|
$this->gateways = CompanyGateway::query()
|
||||||
|
@ -434,16 +434,15 @@ class Statement
|
|||||||
->where('balance', '>', 0)
|
->where('balance', '>', 0)
|
||||||
->where('is_deleted', 0);
|
->where('is_deleted', 0);
|
||||||
|
|
||||||
if($range == '0'){
|
if($range == '0') {
|
||||||
$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]);
|
}
|
||||||
}
|
|
||||||
|
|
||||||
$amount = $query->sum('balance');
|
$amount = $query->sum('balance');
|
||||||
|
|
||||||
return Number::formatMoney($amount, $this->client);
|
return Number::formatMoney($amount, $this->client);
|
||||||
}
|
}
|
||||||
|
@ -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)
|
||||||
{
|
{
|
||||||
@ -67,10 +68,10 @@ class CompanyService{
|
|||||||
$tax_rate->save();
|
$tax_rate->save();
|
||||||
}
|
}
|
||||||
|
|
||||||
}catch(\Exception $e){
|
} catch(\Exception $e) {
|
||||||
nlog($e->getMessage());
|
nlog($e->getMessage());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -273,15 +273,15 @@ class Email implements ShouldQueue
|
|||||||
$message = $e->getMessage();
|
$message = $e->getMessage();
|
||||||
|
|
||||||
|
|
||||||
if (stripos($e->getMessage(), 'code 300') || stripos($e->getMessage(), 'code 413')) {
|
if (stripos($e->getMessage(), 'code 300') || stripos($e->getMessage(), 'code 413')) {
|
||||||
$message = "Either Attachment too large, or recipient has been suppressed.";
|
$message = "Either Attachment too large, or recipient has been suppressed.";
|
||||||
|
|
||||||
$this->fail();
|
$this->fail();
|
||||||
$this->logMailError($e->getMessage(), $this->company->clients()->first());
|
$this->logMailError($e->getMessage(), $this->company->clients()->first());
|
||||||
$this->cleanUpMailers();
|
$this->cleanUpMailers();
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (stripos($e->getMessage(), 'code 406')) {
|
if (stripos($e->getMessage(), 'code 406')) {
|
||||||
|
|
||||||
|
@ -293,7 +293,7 @@ class EmailDefaults
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** Purchase Order / Invoice / Credit / Quote PDF */
|
/** Purchase Order / Invoice / Credit / Quote PDF */
|
||||||
if ($this->email->email_object->settings->pdf_email_attachment){
|
if ($this->email->email_object->settings->pdf_email_attachment) {
|
||||||
$pdf = ((new CreateRawPdf($this->email->email_object->invitation))->handle());
|
$pdf = ((new CreateRawPdf($this->email->email_object->invitation))->handle());
|
||||||
$this->email->email_object->attachments = array_merge($this->email->email_object->attachments, [['file' => base64_encode($pdf), 'name' => $this->email->email_object->entity->numberFormatter().'.pdf']]);
|
$this->email->email_object->attachments = array_merge($this->email->email_object->attachments, [['file' => base64_encode($pdf), 'name' => $this->email->email_object->entity->numberFormatter().'.pdf']]);
|
||||||
}
|
}
|
||||||
|
@ -74,7 +74,7 @@ class HandleCancellation extends AbstractService
|
|||||||
|
|
||||||
$this->invoice->client->service()->updateBalance($adjustment)->save();
|
$this->invoice->client->service()->updateBalance($adjustment)->save();
|
||||||
|
|
||||||
$this->invoice->client->service()->calculateBalance();
|
$this->invoice->client->service()->calculateBalance();
|
||||||
|
|
||||||
|
|
||||||
/* Pop the cancellation out of the backup*/
|
/* Pop the cancellation out of the backup*/
|
||||||
|
@ -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);
|
||||||
|
@ -149,7 +149,7 @@ class RefundPayment
|
|||||||
$fields->user_id = $this->payment->user_id;
|
$fields->user_id = $this->payment->user_id;
|
||||||
$fields->company_id = $this->payment->company_id;
|
$fields->company_id = $this->payment->company_id;
|
||||||
$fields->activity_type_id = Activity::REFUNDED_PAYMENT;
|
$fields->activity_type_id = Activity::REFUNDED_PAYMENT;
|
||||||
$fields->client_id = $this->payment->client_id;
|
$fields->client_id = $this->payment->client_id;
|
||||||
// $fields->credit_id // TODO
|
// $fields->credit_id // TODO
|
||||||
$fields->notes = $notes;
|
$fields->notes = $notes;
|
||||||
|
|
||||||
|
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