This commit is contained in:
David Bomba 2024-01-14 15:05:00 +11:00
parent 78aebe6bf7
commit 40086db271
1169 changed files with 63936 additions and 63546 deletions

View File

@ -1023,8 +1023,9 @@ class CheckData extends Command
public function checkSubdomainsSet()
{
if(Ninja::isSelfHost())
if(Ninja::isSelfHost()) {
return;
}
Company::query()
->whereNull('subdomain')
@ -1047,8 +1048,9 @@ class CheckData extends Command
$this->logMessage($p->count() . " Payments with No currency set");
if($p->count() != 0)
if($p->count() != 0) {
$this->isValid = false;
}
if ($this->option('fix') == 'true') {

View File

@ -29,7 +29,8 @@ use Illuminate\Support\Str;
class CreateAccount extends Command
{
use MakesHash, GeneratesCounter;
use MakesHash;
use GeneratesCounter;
/**
* @var string
@ -97,7 +98,7 @@ class CreateAccount extends Command
'phone' => '',
]);
$company_token = new CompanyToken;
$company_token = new CompanyToken();
$company_token->user_id = $user->id;
$company_token->company_id = $company->id;
$company_token->account_id = $account->id;

View File

@ -61,7 +61,8 @@ use stdClass;
class CreateSingleAccount extends Command
{
use MakesHash, GeneratesCounter;
use MakesHash;
use GeneratesCounter;
protected $description = 'Create Single Sample Account';
@ -188,7 +189,7 @@ class CreateSingleAccount extends Command
]);
}
$company_token = new CompanyToken;
$company_token = new CompanyToken();
$company_token->user_id = $user->id;
$company_token->company_id = $company->id;
$company_token->account_id = $account->id;
@ -801,7 +802,7 @@ class CreateSingleAccount extends Command
private function createGateways($company, $user)
{
if (config('ninja.testvars.stripe') && ($this->gateway == 'all' || $this->gateway == 'stripe')) {
$cg = new CompanyGateway;
$cg = new CompanyGateway();
$cg->company_id = $company->id;
$cg->user_id = $user->id;
$cg->gateway_key = 'd14dd26a37cecc30fdd65700bfb55b23';
@ -814,15 +815,15 @@ class CreateSingleAccount extends Command
$gateway_types = $cg->driver()->gatewayTypes();
$fees_and_limits = new stdClass;
$fees_and_limits->{$gateway_types[0]} = new FeesAndLimits;
$fees_and_limits = new stdClass();
$fees_and_limits->{$gateway_types[0]} = new FeesAndLimits();
$cg->fees_and_limits = $fees_and_limits;
$cg->save();
}
if (config('ninja.testvars.paypal') && ($this->gateway == 'all' || $this->gateway == 'paypal')) {
$cg = new CompanyGateway;
$cg = new CompanyGateway();
$cg->company_id = $company->id;
$cg->user_id = $user->id;
$cg->gateway_key = '38f2c48af60c7dd69e04248cbb24c36e';
@ -835,15 +836,15 @@ class CreateSingleAccount extends Command
$gateway_types = $cg->driver()->gatewayTypes();
$fees_and_limits = new stdClass;
$fees_and_limits->{$gateway_types[0]} = new FeesAndLimits;
$fees_and_limits = new stdClass();
$fees_and_limits->{$gateway_types[0]} = new FeesAndLimits();
$cg->fees_and_limits = $fees_and_limits;
$cg->save();
}
if (config('ninja.testvars.paypal_rest') && ($this->gateway == 'all' || $this->gateway == 'paypal_rest')) {
$cg = new CompanyGateway;
$cg = new CompanyGateway();
$cg->company_id = $company->id;
$cg->user_id = $user->id;
$cg->gateway_key = '80af24a6a691230bbec33e930ab40665';
@ -856,8 +857,8 @@ class CreateSingleAccount extends Command
// $gateway_types = $cg->driver()->gatewayTypes();
$fees_and_limits = new stdClass;
$fees_and_limits->{3} = new FeesAndLimits;
$fees_and_limits = new stdClass();
$fees_and_limits->{3} = new FeesAndLimits();
$cg->fees_and_limits = $fees_and_limits;
$cg->save();
@ -866,7 +867,7 @@ class CreateSingleAccount extends Command
if (config('ninja.testvars.checkout') && ($this->gateway == 'all' || $this->gateway == 'checkout')) {
$cg = new CompanyGateway;
$cg = new CompanyGateway();
$cg->company_id = $company->id;
$cg->user_id = $user->id;
$cg->gateway_key = '3758e7f7c6f4cecf0f4f348b9a00f456';
@ -877,17 +878,17 @@ class CreateSingleAccount extends Command
$cg->config = encrypt(config('ninja.testvars.checkout'));
$cg->save();
$gateway_types = $cg->driver(new Client)->gatewayTypes();
$gateway_types = $cg->driver(new Client())->gatewayTypes();
$fees_and_limits = new stdClass;
$fees_and_limits->{$gateway_types[0]} = new FeesAndLimits;
$fees_and_limits = new stdClass();
$fees_and_limits->{$gateway_types[0]} = new FeesAndLimits();
$cg->fees_and_limits = $fees_and_limits;
$cg->save();
}
if (config('ninja.testvars.authorize') && ($this->gateway == 'all' || $this->gateway == 'authorizenet')) {
$cg = new CompanyGateway;
$cg = new CompanyGateway();
$cg->company_id = $company->id;
$cg->user_id = $user->id;
$cg->gateway_key = '3b6621f970ab18887c4f6dca78d3f8bb';
@ -898,17 +899,17 @@ class CreateSingleAccount extends Command
$cg->config = encrypt(config('ninja.testvars.authorize'));
$cg->save();
$gateway_types = $cg->driver(new Client)->gatewayTypes();
$gateway_types = $cg->driver(new Client())->gatewayTypes();
$fees_and_limits = new stdClass;
$fees_and_limits->{$gateway_types[0]} = new FeesAndLimits;
$fees_and_limits = new stdClass();
$fees_and_limits->{$gateway_types[0]} = new FeesAndLimits();
$cg->fees_and_limits = $fees_and_limits;
$cg->save();
}
if (config('ninja.testvars.wepay') && ($this->gateway == 'all' || $this->gateway == 'wepay')) {
$cg = new CompanyGateway;
$cg = new CompanyGateway();
$cg->company_id = $company->id;
$cg->user_id = $user->id;
$cg->gateway_key = '8fdeed552015b3c7b44ed6c8ebd9e992';
@ -921,15 +922,15 @@ class CreateSingleAccount extends Command
$gateway_types = $cg->driver()->gatewayTypes();
$fees_and_limits = new stdClass;
$fees_and_limits->{$gateway_types[0]} = new FeesAndLimits;
$fees_and_limits = new stdClass();
$fees_and_limits->{$gateway_types[0]} = new FeesAndLimits();
$cg->fees_and_limits = $fees_and_limits;
$cg->save();
}
if (config('ninja.testvars.braintree') && ($this->gateway == 'all' || $this->gateway == 'braintree')) {
$cg = new CompanyGateway;
$cg = new CompanyGateway();
$cg->company_id = $company->id;
$cg->user_id = $user->id;
$cg->gateway_key = 'f7ec488676d310683fb51802d076d713';
@ -942,8 +943,8 @@ class CreateSingleAccount extends Command
$gateway_types = $cg->driver()->gatewayTypes();
$fees_and_limits = new stdClass;
$fees_and_limits->{$gateway_types[0]} = new FeesAndLimits;
$fees_and_limits = new stdClass();
$fees_and_limits->{$gateway_types[0]} = new FeesAndLimits();
$cg->fees_and_limits = $fees_and_limits;
$cg->save();
@ -951,7 +952,7 @@ class CreateSingleAccount extends Command
if (config('ninja.testvars.paytrace.decrypted') && ($this->gateway == 'all' || $this->gateway == 'paytrace')) {
$cg = new CompanyGateway;
$cg = new CompanyGateway();
$cg->company_id = $company->id;
$cg->user_id = $user->id;
$cg->gateway_key = 'bbd736b3254b0aabed6ad7fda1298c88';
@ -966,15 +967,15 @@ class CreateSingleAccount extends Command
$gateway_types = $cg->driver()->gatewayTypes();
$fees_and_limits = new stdClass;
$fees_and_limits->{$gateway_types[0]} = new FeesAndLimits;
$fees_and_limits = new stdClass();
$fees_and_limits->{$gateway_types[0]} = new FeesAndLimits();
$cg->fees_and_limits = $fees_and_limits;
$cg->save();
}
if (config('ninja.testvars.mollie') && ($this->gateway == 'all' || $this->gateway == 'mollie')) {
$cg = new CompanyGateway;
$cg = new CompanyGateway();
$cg->company_id = $company->id;
$cg->user_id = $user->id;
$cg->gateway_key = '1bd651fb213ca0c9d66ae3c336dc77e8';
@ -987,15 +988,15 @@ class CreateSingleAccount extends Command
$gateway_types = $cg->driver()->gatewayTypes();
$fees_and_limits = new stdClass;
$fees_and_limits->{$gateway_types[0]} = new FeesAndLimits;
$fees_and_limits = new stdClass();
$fees_and_limits->{$gateway_types[0]} = new FeesAndLimits();
$cg->fees_and_limits = $fees_and_limits;
$cg->save();
}
if (config('ninja.testvars.square') && ($this->gateway == 'all' || $this->gateway == 'square')) {
$cg = new CompanyGateway;
$cg = new CompanyGateway();
$cg->company_id = $company->id;
$cg->user_id = $user->id;
$cg->gateway_key = '65faab2ab6e3223dbe848b1686490baz';
@ -1008,8 +1009,8 @@ class CreateSingleAccount extends Command
$gateway_types = $cg->driver()->gatewayTypes();
$fees_and_limits = new stdClass;
$fees_and_limits->{$gateway_types[0]} = new FeesAndLimits;
$fees_and_limits = new stdClass();
$fees_and_limits->{$gateway_types[0]} = new FeesAndLimits();
$cg->fees_and_limits = $fees_and_limits;
$cg->save();

View File

@ -47,7 +47,8 @@ use Illuminate\Support\Str;
class CreateTestData extends Command
{
use MakesHash, GeneratesCounter;
use MakesHash;
use GeneratesCounter;
/**
* @var string
@ -115,7 +116,7 @@ class CreateTestData extends Command
]);
}
$company_token = new CompanyToken;
$company_token = new CompanyToken();
$company_token->user_id = $user->id;
$company_token->company_id = $company->id;
$company_token->account_id = $account->id;
@ -210,7 +211,7 @@ class CreateTestData extends Command
]);
}
$company_token = new CompanyToken;
$company_token = new CompanyToken();
$company_token->user_id = $user->id;
$company_token->company_id = $company->id;
$company_token->account_id = $account->id;
@ -307,7 +308,7 @@ class CreateTestData extends Command
]);
}
$company_token = new CompanyToken;
$company_token = new CompanyToken();
$company_token->user_id = $user->id;
$company_token->company_id = $company->id;
$company_token->account_id = $account->id;

View File

@ -54,7 +54,9 @@ use Illuminate\Support\Str;
class DemoMode extends Command
{
use MakesHash, GeneratesCounter, AppSetup;
use MakesHash;
use GeneratesCounter;
use AppSetup;
protected $signature = 'ninja:demo-mode';
@ -151,7 +153,7 @@ class DemoMode extends Command
(new CreateCompanyPaymentTerms($company, $user))->handle();
(new CreateCompanyTaskStatuses($company, $user))->handle();
$company_token = new CompanyToken;
$company_token = new CompanyToken();
$company_token->user_id = $user->id;
$company_token->company_id = $company->id;
$company_token->account_id = $account->id;
@ -182,7 +184,7 @@ class DemoMode extends Command
'email_verified_at' => now(),
]);
$company_token = new CompanyToken;
$company_token = new CompanyToken();
$company_token->user_id = $u2->id;
$company_token->company_id = $company->id;
$company_token->account_id = $account->id;

View File

@ -73,7 +73,7 @@ class DesignUpdate extends Command
$invoice_design = new \App\Services\PdfMaker\Design(strtolower($design->name));
$invoice_design->document();
$design_object = new stdClass;
$design_object = new stdClass();
$design_object->includes = $invoice_design->getSectionHTML('style');
$design_object->header = $invoice_design->getSectionHTML('header');
$design_object->body = $invoice_design->getSectionHTML('body');

View File

@ -28,7 +28,8 @@ use Illuminate\Support\Facades\App;
//@deprecated 27-11-2022 - only ever should be used for testing
class SendRemindersCron extends Command
{
use MakesReminders, MakesDates;
use MakesReminders;
use MakesDates;
/**
* The name and signature of the console command.
@ -158,7 +159,7 @@ class SendRemindersCron extends Command
$fee += round($invoice->balance * $percent / 100, 2);
}
$invoice_item = new InvoiceItem;
$invoice_item = new InvoiceItem();
$invoice_item->type_id = '5';
$invoice_item->product_key = ctrans('texts.fee');
$invoice_item->notes = ctrans('texts.late_fee_added', ['date' => $this->translateDate(now()->startOfDay(), $invoice->client->date_format(), $invoice->client->locale())]);

View File

@ -53,7 +53,7 @@ class SendTestEmails extends Command
$to_user = User::first();
$nmo = new NinjaMailerObject;
$nmo = new NinjaMailerObject();
$nmo->mailable = new TestMailServer('Email Server Works!', config('mail.from.address'));
$nmo->company = $to_user->account->companies()->first();
$nmo->settings = $to_user->account->companies()->first()->settings;

View File

@ -47,58 +47,58 @@ class Kernel extends ConsoleKernel
protected function schedule(Schedule $schedule)
{
/* Check for the latest version of Invoice Ninja */
$schedule->job(new VersionCheck)->daily();
$schedule->job(new VersionCheck())->daily();
/* Returns the number of jobs in the queue */
$schedule->job(new QueueSize)->everyFiveMinutes()->withoutOverlapping()->name('queue-size-job')->onOneServer();
$schedule->job(new QueueSize())->everyFiveMinutes()->withoutOverlapping()->name('queue-size-job')->onOneServer();
/* Send reminders */
$schedule->job(new ReminderJob)->hourly()->withoutOverlapping()->name('reminder-job')->onOneServer();
$schedule->job(new ReminderJob())->hourly()->withoutOverlapping()->name('reminder-job')->onOneServer();
/* Sends recurring invoices*/
$schedule->job(new RecurringInvoicesCron)->hourly()->withoutOverlapping()->name('recurring-invoice-job')->onOneServer();
$schedule->job(new RecurringInvoicesCron())->hourly()->withoutOverlapping()->name('recurring-invoice-job')->onOneServer();
/* Checks for scheduled tasks */
$schedule->job(new TaskScheduler())->hourlyAt(10)->withoutOverlapping()->name('task-scheduler-job')->onOneServer();
/* Stale Invoice Cleanup*/
$schedule->job(new CleanStaleInvoiceOrder)->hourlyAt(30)->withoutOverlapping()->name('stale-invoice-job')->onOneServer();
$schedule->job(new CleanStaleInvoiceOrder())->hourlyAt(30)->withoutOverlapping()->name('stale-invoice-job')->onOneServer();
/* Stale Invoice Cleanup*/
$schedule->job(new UpdateCalculatedFields)->hourlyAt(40)->withoutOverlapping()->name('update-calculated-fields-job')->onOneServer();
$schedule->job(new UpdateCalculatedFields())->hourlyAt(40)->withoutOverlapping()->name('update-calculated-fields-job')->onOneServer();
/* Checks for large companies and marked them as is_large */
$schedule->job(new CompanySizeCheck)->dailyAt('23:20')->withoutOverlapping()->name('company-size-job')->onOneServer();
$schedule->job(new CompanySizeCheck())->dailyAt('23:20')->withoutOverlapping()->name('company-size-job')->onOneServer();
/* Pulls in the latest exchange rates */
$schedule->job(new UpdateExchangeRates)->dailyAt('23:30')->withoutOverlapping()->name('exchange-rate-job')->onOneServer();
$schedule->job(new UpdateExchangeRates())->dailyAt('23:30')->withoutOverlapping()->name('exchange-rate-job')->onOneServer();
/* Runs cleanup code for subscriptions */
$schedule->job(new SubscriptionCron)->dailyAt('00:01')->withoutOverlapping()->name('subscription-job')->onOneServer();
$schedule->job(new SubscriptionCron())->dailyAt('00:01')->withoutOverlapping()->name('subscription-job')->onOneServer();
/* Sends recurring expenses*/
$schedule->job(new RecurringExpensesCron)->dailyAt('00:10')->withoutOverlapping()->name('recurring-expense-job')->onOneServer();
$schedule->job(new RecurringExpensesCron())->dailyAt('00:10')->withoutOverlapping()->name('recurring-expense-job')->onOneServer();
/* Checks the status of the scheduler */
$schedule->job(new SchedulerCheck)->dailyAt('01:10')->withoutOverlapping();
$schedule->job(new SchedulerCheck())->dailyAt('01:10')->withoutOverlapping();
/* Checks and cleans redundant files */
$schedule->job(new DiskCleanup)->dailyAt('02:10')->withoutOverlapping()->name('disk-cleanup-job')->onOneServer();
$schedule->job(new DiskCleanup())->dailyAt('02:10')->withoutOverlapping()->name('disk-cleanup-job')->onOneServer();
/* Performs system maintenance such as pruning the backup table */
$schedule->job(new SystemMaintenance)->sundays()->at('02:30')->withoutOverlapping()->name('system-maintenance-job')->onOneServer();
$schedule->job(new SystemMaintenance())->sundays()->at('02:30')->withoutOverlapping()->name('system-maintenance-job')->onOneServer();
/* Fires notifications for expired Quotes */
$schedule->job(new QuoteCheckExpired)->dailyAt('05:10')->withoutOverlapping()->name('quote-expired-job')->onOneServer();
$schedule->job(new QuoteCheckExpired())->dailyAt('05:10')->withoutOverlapping()->name('quote-expired-job')->onOneServer();
/* Performs auto billing */
$schedule->job(new AutoBillCron)->dailyAt('06:20')->withoutOverlapping()->name('auto-bill-job')->onOneServer();
$schedule->job(new AutoBillCron())->dailyAt('06:20')->withoutOverlapping()->name('auto-bill-job')->onOneServer();
/* Fires webhooks for overdue Invoice */
$schedule->job(new InvoiceCheckLateWebhook)->dailyAt('07:00')->withoutOverlapping()->name('invoice-overdue-job')->onOneServer();
$schedule->job(new InvoiceCheckLateWebhook())->dailyAt('07:00')->withoutOverlapping()->name('invoice-overdue-job')->onOneServer();
/* Pulls in bank transactions from third party services */
$schedule->job(new BankTransactionSync)->everyFourHours()->withoutOverlapping()->name('bank-trans-sync-job')->onOneServer();
$schedule->job(new BankTransactionSync())->everyFourHours()->withoutOverlapping()->name('bank-trans-sync-job')->onOneServer();
if (Ninja::isSelfHost()) {
$schedule->call(function () {
@ -108,10 +108,10 @@ class Kernel extends ConsoleKernel
/* Run hosted specific jobs */
if (Ninja::isHosted()) {
$schedule->job(new AdjustEmailQuota)->dailyAt('23:30')->withoutOverlapping();
$schedule->job(new AdjustEmailQuota())->dailyAt('23:30')->withoutOverlapping();
/* Checks ACH verification status and updates state to authorize when verified */
$schedule->job(new CheckACHStatus)->everySixHours()->withoutOverlapping()->name('ach-status-job')->onOneServer();
$schedule->job(new CheckACHStatus())->everySixHours()->withoutOverlapping()->name('ach-status-job')->onOneServer();
$schedule->command('ninja:check-data --database=db-ninja-01')->dailyAt('02:10')->withoutOverlapping()->name('check-data-db-1-job')->onOneServer();

View File

@ -857,7 +857,7 @@ class CompanySettings extends BaseSettings
*/
public static function notificationDefaults(): stdClass
{
$notification = new stdClass;
$notification = new stdClass();
$notification->email = [];
$notification->email = ['invoice_sent_all'];
@ -873,7 +873,7 @@ class CompanySettings extends BaseSettings
*/
public static function notificationAdminDefaults(): stdClass
{
$notification = new stdClass;
$notification = new stdClass();
$notification->email = [];
$notification->email = ['invoice_sent_all'];

View File

@ -8,11 +8,11 @@
*
* @license https://www.elastic.co/licensing/elastic-license
*/
namespace App\DataMapper\Settings;
class SettingsData
{
public bool $auto_archive_invoice = false; // @implemented
public string $qr_iban = ''; //@implemented

View File

@ -13,7 +13,6 @@ namespace App\DataMapper\Tax;
class TaxModel
{
/** @var string $seller_subregion */
public string $seller_subregion = 'CA';

View File

@ -22,7 +22,6 @@ use App\Models\Product;
*/
class Rule extends BaseRule implements RuleInterface
{
/** @var string $seller_region */
public string $seller_region = 'US';

View File

@ -14,7 +14,6 @@ namespace App\DataProviders;
class Domains
{
private static array $verify_domains = [
'0-00.usa.cc',
'0-180.com',

View File

@ -22,7 +22,9 @@ use Illuminate\Queue\SerializesModels;
*/
class AccountCreated
{
use Dispatchable, InteractsWithSockets, SerializesModels;
use Dispatchable;
use InteractsWithSockets;
use SerializesModels;
public $user;

View File

@ -21,7 +21,9 @@ use Illuminate\Queue\SerializesModels;
*/
class StripeConnectFailure
{
use Dispatchable, InteractsWithSockets, SerializesModels;
use Dispatchable;
use InteractsWithSockets;
use SerializesModels;
public function __construct(public Company $company, public string $db)
{

View File

@ -23,7 +23,9 @@ use Illuminate\Queue\SerializesModels;
*/
class ClientWasArchived
{
use Dispatchable, InteractsWithSockets, SerializesModels;
use Dispatchable;
use InteractsWithSockets;
use SerializesModels;
/**
* @var Client

View File

@ -19,7 +19,9 @@ use Illuminate\Queue\SerializesModels;
class CompanyDocumentsDeleted
{
use Dispatchable, InteractsWithSockets, SerializesModels;
use Dispatchable;
use InteractsWithSockets;
use SerializesModels;
/**
* @var Company

View File

@ -22,7 +22,9 @@ use Illuminate\Queue\SerializesModels;
*/
class ContactLoggedIn
{
use Dispatchable, InteractsWithSockets, SerializesModels;
use Dispatchable;
use InteractsWithSockets;
use SerializesModels;
public $client_contact;

View File

@ -19,7 +19,9 @@ use Illuminate\Queue\SerializesModels;
class CreditWasArchived
{
use Dispatchable, InteractsWithSockets, SerializesModels;
use Dispatchable;
use InteractsWithSockets;
use SerializesModels;
public $credit;

View File

@ -19,7 +19,9 @@ use Illuminate\Queue\SerializesModels;
class CreditWasCreated
{
use Dispatchable, InteractsWithSockets, SerializesModels;
use Dispatchable;
use InteractsWithSockets;
use SerializesModels;
public $credit;

View File

@ -19,7 +19,9 @@ use Illuminate\Queue\SerializesModels;
class CreditWasDeleted
{
use Dispatchable, InteractsWithSockets, SerializesModels;
use Dispatchable;
use InteractsWithSockets;
use SerializesModels;
public $credit;

View File

@ -19,7 +19,9 @@ use Illuminate\Queue\SerializesModels;
class CreditWasEmailed
{
use Dispatchable, InteractsWithSockets, SerializesModels;
use Dispatchable;
use InteractsWithSockets;
use SerializesModels;
public $invitation;

View File

@ -18,7 +18,9 @@ use Illuminate\Queue\SerializesModels;
class CreditWasEmailedAndFailed
{
use Dispatchable, InteractsWithSockets, SerializesModels;
use Dispatchable;
use InteractsWithSockets;
use SerializesModels;
public $credit;

View File

@ -19,7 +19,9 @@ use Illuminate\Queue\SerializesModels;
class CreditWasUpdated
{
use Dispatchable, InteractsWithSockets, SerializesModels;
use Dispatchable;
use InteractsWithSockets;
use SerializesModels;
public $credit;

View File

@ -23,7 +23,9 @@ use Illuminate\Queue\SerializesModels;
*/
class DesignWasArchived
{
use Dispatchable, InteractsWithSockets, SerializesModels;
use Dispatchable;
use InteractsWithSockets;
use SerializesModels;
public function __construct(public Design $design, public Company $company, public array $event_vars)
{

View File

@ -23,7 +23,9 @@ use Illuminate\Queue\SerializesModels;
*/
class DocumentWasArchived
{
use Dispatchable, InteractsWithSockets, SerializesModels;
use Dispatchable;
use InteractsWithSockets;
use SerializesModels;
/**
* @var Document

View File

@ -24,7 +24,9 @@ use Illuminate\Queue\SerializesModels;
*/
class InvoiceWasCreated implements ShouldBroadcast
{
use Dispatchable, InteractsWithSockets, SerializesModels;
use Dispatchable;
use InteractsWithSockets;
use SerializesModels;
/**
* @var Invoice

View File

@ -22,7 +22,9 @@ use Illuminate\Queue\SerializesModels;
*/
class InvoiceWasUpdated
{
use Dispatchable, InteractsWithSockets, SerializesModels;
use Dispatchable;
use InteractsWithSockets;
use SerializesModels;
/**
* @var Invoice

View File

@ -20,7 +20,9 @@ use Illuminate\Queue\SerializesModels;
class MethodDeleted
{
use Dispatchable, InteractsWithSockets, SerializesModels;
use Dispatchable;
use InteractsWithSockets;
use SerializesModels;
/**
* @var ClientGatewayToken

View File

@ -23,7 +23,9 @@ use Illuminate\Queue\SerializesModels;
*/
class PaymentWasEmailed
{
use Dispatchable, InteractsWithSockets, SerializesModels;
use Dispatchable;
use InteractsWithSockets;
use SerializesModels;
/**
* Create a new event instance.

View File

@ -22,7 +22,9 @@ use Illuminate\Queue\SerializesModels;
*/
class PaymentWasEmailedAndFailed
{
use Dispatchable, InteractsWithSockets, SerializesModels;
use Dispatchable;
use InteractsWithSockets;
use SerializesModels;
/**
* @var Payment

View File

@ -20,7 +20,9 @@ use Illuminate\Queue\SerializesModels;
class QuoteWasApproved
{
use Dispatchable, InteractsWithSockets, SerializesModels;
use Dispatchable;
use InteractsWithSockets;
use SerializesModels;
public $contact;

View File

@ -22,7 +22,9 @@ use Illuminate\Queue\SerializesModels;
*/
class RecurringInvoiceWasUpdated
{
use Dispatchable, InteractsWithSockets, SerializesModels;
use Dispatchable;
use InteractsWithSockets;
use SerializesModels;
public function __construct(public RecurringInvoice $recurring_invoice, public Company $company, public array $event_vars)
{

View File

@ -22,7 +22,9 @@ use Illuminate\Queue\SerializesModels;
*/
class RecurringQuoteWasUpdated
{
use Dispatchable, InteractsWithSockets, SerializesModels;
use Dispatchable;
use InteractsWithSockets;
use SerializesModels;
public function __construct(public RecurringQuote $recurring_quote, public Company $company, public array $event_vars)

View File

@ -10,7 +10,9 @@ use Illuminate\Queue\SerializesModels;
class SubscriptionWasCreated
{
use Dispatchable, InteractsWithSockets, SerializesModels;
use Dispatchable;
use InteractsWithSockets;
use SerializesModels;
/**
* @var Subscription

View File

@ -23,7 +23,9 @@ use Illuminate\Queue\SerializesModels;
*/
class UserLoggedIn
{
use Dispatchable, InteractsWithSockets, SerializesModels;
use Dispatchable;
use InteractsWithSockets;
use SerializesModels;
public function __construct(public User $user, public Company $company, public array $event_vars)
{

View File

@ -23,7 +23,9 @@ use Illuminate\Queue\SerializesModels;
*/
class UserWasArchived
{
use Dispatchable, InteractsWithSockets, SerializesModels;
use Dispatchable;
use InteractsWithSockets;
use SerializesModels;
public function __construct(public User $user, public User $creating_user, public Company $company, public array $event_vars)
{

View File

@ -23,7 +23,9 @@ use Illuminate\Queue\SerializesModels;
*/
class UserWasCreated
{
use Dispatchable, InteractsWithSockets, SerializesModels;
use Dispatchable;
use InteractsWithSockets;
use SerializesModels;
public function __construct(public User $user, public User $creating_user, public Company $company, public array $event_vars, public $is_react = true)
{

View File

@ -23,7 +23,9 @@ use Illuminate\Queue\SerializesModels;
*/
class UserWasDeleted
{
use Dispatchable, InteractsWithSockets, SerializesModels;
use Dispatchable;
use InteractsWithSockets;
use SerializesModels;
public $user;

View File

@ -23,7 +23,9 @@ use Illuminate\Queue\SerializesModels;
*/
class UserWasRestored
{
use Dispatchable, InteractsWithSockets, SerializesModels;
use Dispatchable;
use InteractsWithSockets;
use SerializesModels;
public $user;

View File

@ -23,7 +23,9 @@ use Illuminate\Queue\SerializesModels;
*/
class UserWasUpdated
{
use Dispatchable, InteractsWithSockets, SerializesModels;
use Dispatchable;
use InteractsWithSockets;
use SerializesModels;
public $user;

View File

@ -23,7 +23,9 @@ use Illuminate\Queue\SerializesModels;
*/
class VendorContactLoggedIn
{
use Dispatchable, InteractsWithSockets, SerializesModels;
use Dispatchable;
use InteractsWithSockets;
use SerializesModels;
/**
* Create a new event instance.

View File

@ -9,7 +9,6 @@
* @license https://www.elastic.co/licensing/elastic-license
*/
namespace App\Exceptions;
use Exception;

View File

@ -9,7 +9,6 @@
* @license https://www.elastic.co/licensing/elastic-license
*/
namespace App\Exceptions;
use Exception;

View File

@ -9,7 +9,6 @@
* @license https://www.elastic.co/licensing/elastic-license
*/
namespace App\Exceptions;
use Exception;

View File

@ -9,7 +9,6 @@
* @license https://www.elastic.co/licensing/elastic-license
*/
namespace App\Exceptions;
use Exception;

View File

@ -9,7 +9,6 @@
* @license https://www.elastic.co/licensing/elastic-license
*/
namespace App\Exceptions;
use Exception;

View File

@ -9,7 +9,6 @@
* @license https://www.elastic.co/licensing/elastic-license
*/
namespace App\Exceptions;
use Exception;

View File

@ -9,7 +9,6 @@
* @license https://www.elastic.co/licensing/elastic-license
*/
namespace App\Exceptions;
use Exception;

View File

@ -9,7 +9,6 @@
* @license https://www.elastic.co/licensing/elastic-license
*/
namespace App\Exceptions;
use Exception;

View File

@ -9,7 +9,6 @@
* @license https://www.elastic.co/licensing/elastic-license
*/
namespace App\Exceptions;
use Exception;

View File

@ -9,7 +9,6 @@
* @license https://www.elastic.co/licensing/elastic-license
*/
namespace App\Exceptions;
use Exception;

View File

@ -9,7 +9,6 @@
* @license https://www.elastic.co/licensing/elastic-license
*/
namespace App\Exceptions;
use Exception;

View File

@ -9,7 +9,6 @@
* @license https://www.elastic.co/licensing/elastic-license
*/
namespace App\Exceptions;
use Exception;

View File

@ -9,7 +9,6 @@
* @license https://www.elastic.co/licensing/elastic-license
*/
namespace App\Exceptions;
use Exception;

View File

@ -9,7 +9,6 @@
* @license https://www.elastic.co/licensing/elastic-license
*/
namespace App\Exceptions;
use Exception;

View File

@ -9,7 +9,6 @@
* @license https://www.elastic.co/licensing/elastic-license
*/
namespace App\Exceptions;
use Exception;

View File

@ -9,7 +9,6 @@
* @license https://www.elastic.co/licensing/elastic-license
*/
namespace App\Exceptions;
use Exception;

View File

@ -9,7 +9,6 @@
* @license https://www.elastic.co/licensing/elastic-license
*/
namespace App\Exceptions;
use Exception;

View File

@ -25,7 +25,6 @@ use League\Csv\Writer;
class ActivityExport extends BaseExport
{
private $entity_transformer;
public string $date_key = 'created_at';

View File

@ -25,7 +25,6 @@ use Illuminate\Database\Eloquent\Builder;
class ContactExport extends BaseExport
{
private ClientTransformer $client_transformer;
private ClientContactTransformer $contact_transformer;

View File

@ -24,7 +24,6 @@ use League\Csv\Writer;
class CreditExport extends BaseExport
{
private CreditTransformer $credit_transformer;
private Decorator $decorator;

View File

@ -22,7 +22,6 @@ use League\Csv\Writer;
class DocumentExport extends BaseExport
{
private $entity_transformer;
public string $date_key = 'created_at';

View File

@ -23,7 +23,6 @@ use League\Csv\Writer;
class ExpenseExport extends BaseExport
{
private $expense_transformer;
private Decorator $decorator;

View File

@ -23,7 +23,6 @@ use League\Csv\Writer;
class InvoiceItemExport extends BaseExport
{
private $invoice_transformer;
public string $date_key = 'date';

View File

@ -23,7 +23,6 @@ use App\Transformers\PurchaseOrderTransformer;
class PurchaseOrderExport extends BaseExport
{
private $purchase_order_transformer;
public string $date_key = 'date';

View File

@ -23,7 +23,6 @@ use League\Csv\Writer;
class PurchaseOrderItemExport extends BaseExport
{
private $purchase_order_transformer;
public string $date_key = 'date';

View File

@ -23,7 +23,6 @@ use League\Csv\Writer;
class QuoteExport extends BaseExport
{
private $quote_transformer;
public string $date_key = 'date';

View File

@ -23,7 +23,6 @@ use League\Csv\Writer;
class QuoteItemExport extends BaseExport
{
private $quote_transformer;
public string $date_key = 'date';
@ -46,7 +45,7 @@ class QuoteItemExport extends BaseExport
$this->company = $company;
$this->input = $input;
$this->quote_transformer = new QuoteTransformer();
$this->decorator = new Decorator;
$this->decorator = new Decorator();
}
public function init(): Builder

View File

@ -23,7 +23,6 @@ use League\Csv\Writer;
class RecurringInvoiceExport extends BaseExport
{
private $invoice_transformer;
public string $date_key = 'date';
@ -120,8 +119,7 @@ class RecurringInvoiceExport extends BaseExport
$entity[$key] = $transformed_invoice[$parts[1]];
} elseif($parts[0] == 'item') {
$entity[$key] = '';
}
else {
} else {
// nlog($key);
$entity[$key] = $this->decorator->transform($key, $invoice);
// $entity[$key] = '';

View File

@ -26,7 +26,6 @@ use League\Csv\Writer;
class TaskExport extends BaseExport
{
private $entity_transformer;
public string $date_key = 'created_at';

View File

@ -24,7 +24,6 @@ use League\Csv\Writer;
class VendorExport extends BaseExport
{
private $vendor_transformer;
private $contact_transformer;

View File

@ -29,8 +29,7 @@ class ClientDecorator extends Decorator implements DecoratorInterface
if($client && method_exists($this, $key)) {
return $this->{$key}($client);
}
elseif($client && $client->{$key}) {
} elseif($client && $client->{$key}) {
return $client->{$key};
}

View File

@ -27,8 +27,7 @@ class ContactDecorator implements DecoratorInterface
if($contact && method_exists($this, $key)) {
return $this->{$key}($contact);
}
elseif($contact && $contact->{$key}){
} elseif($contact && $contact->{$key}) {
return $contact->{$key};
}

View File

@ -13,7 +13,6 @@ namespace App\Export\Decorators;
class Decorator implements DecoratorInterface
{
public function __construct()
{
}

View File

@ -15,7 +15,6 @@ use App\Models\Payment;
class PaymentDecorator extends Decorator implements DecoratorInterface
{
private $entity_key = 'payment';
public function transform(string $key, $entity): mixed
@ -42,8 +41,7 @@ class PaymentDecorator extends Decorator implements DecoratorInterface
if($payment && method_exists($this, $key)) {
return $this->{$key}($payment);
}
elseif($payment && $payment->{$key}){
} elseif($payment && $payment->{$key}) {
return $payment->{$key};
}

View File

@ -17,7 +17,7 @@ class BankIntegrationFactory
{
public static function create(int $company_id, int $user_id, int $account_id): BankIntegration
{
$bank_integration = new BankIntegration;
$bank_integration = new BankIntegration();
$bank_integration->account_id = $account_id;
$bank_integration->user_id = $user_id;
$bank_integration->company_id = $company_id;

View File

@ -17,7 +17,7 @@ class BankTransactionFactory
{
public static function create(int $company_id, int $user_id): BankTransaction
{
$bank_transaction = new BankTransaction;
$bank_transaction = new BankTransaction();
$bank_transaction->user_id = $user_id;
$bank_transaction->company_id = $company_id;

View File

@ -17,7 +17,7 @@ class BankTransactionRuleFactory
{
public static function create(int $company_id, int $user_id): BankTransactionRule
{
$bank_transaction_rule = new BankTransactionRule;
$bank_transaction_rule = new BankTransactionRule();
$bank_transaction_rule->user_id = $user_id;
$bank_transaction_rule->company_id = $company_id;

View File

@ -18,7 +18,7 @@ class ClientContactFactory
{
public static function create(int $company_id, int $user_id): ClientContact
{
$client_contact = new ClientContact;
$client_contact = new ClientContact();
$client_contact->first_name = '';
$client_contact->user_id = $user_id;
$client_contact->company_id = $company_id;

View File

@ -19,7 +19,7 @@ class ClientFactory
{
public static function create(int $company_id, int $user_id): Client
{
$client = new Client;
$client = new Client();
$client->company_id = $company_id;
$client->user_id = $user_id;
$client->name = '';

View File

@ -17,7 +17,7 @@ class ClientGatewayTokenFactory
{
public static function create(int $company_id): ClientGatewayToken
{
$client_gateway_token = new ClientGatewayToken;
$client_gateway_token = new ClientGatewayToken();
$client_gateway_token->company_id = $company_id;
$client_gateway_token->is_default = false;
$client_gateway_token->meta = '';

View File

@ -29,7 +29,7 @@ class CompanyFactory
*/
public function create(int $account_id): Company
{
$company = new Company;
$company = new Company();
$company->account_id = $account_id;
$company->company_key = $this->createHash();
$company->settings = CompanySettings::defaults();

View File

@ -17,12 +17,12 @@ class CompanyGatewayFactory
{
public static function create(int $company_id, int $user_id): CompanyGateway
{
$company_gateway = new CompanyGateway;
$company_gateway = new CompanyGateway();
$company_gateway->company_id = $company_id;
$company_gateway->user_id = $user_id;
$company_gateway->require_billing_address = false;
$company_gateway->require_shipping_address = false;
$company_gateway->config = encrypt(json_encode(new \stdClass));
$company_gateway->config = encrypt(json_encode(new \stdClass()));
return $company_gateway;
}

View File

@ -17,7 +17,7 @@ class CompanyLedgerFactory
{
public static function create(int $company_id, int $user_id): CompanyLedger
{
$company_ledger = new CompanyLedger;
$company_ledger = new CompanyLedger();
$company_ledger->company_id = $company_id;
$company_ledger->user_id = $user_id;
$company_ledger->adjustment = 0;

View File

@ -18,7 +18,7 @@ class CompanyTokenFactory
{
public static function create(int $company_id, int $user_id, int $account_id): CompanyToken
{
$token = new CompanyToken;
$token = new CompanyToken();
$token->user_id = $user_id;
$token->account_id = $account_id;
$token->token = Str::random(64);

View File

@ -18,7 +18,7 @@ class CompanyUserFactory
{
public static function create($user_id, $company_id, $account_id): CompanyUser
{
$company_user = new CompanyUser;
$company_user = new CompanyUser();
$company_user->user_id = $user_id;
$company_user->company_id = $company_id;
$company_user->account_id = $account_id;

View File

@ -18,7 +18,7 @@ class CreditInvitationFactory
{
public static function create(int $company_id, int $user_id): CreditInvitation
{
$ci = new CreditInvitation;
$ci = new CreditInvitation();
$ci->company_id = $company_id;
$ci->user_id = $user_id;
$ci->client_contact_id = null;

View File

@ -18,10 +18,10 @@ class GroupSettingFactory
{
public static function create(int $company_id, int $user_id): GroupSetting
{
$settings = new \stdClass;
$settings = new \stdClass();
$settings->entity = Client::class;
$gs = new GroupSetting;
$gs = new GroupSetting();
$gs->name = '';
$gs->company_id = $company_id;
$gs->user_id = $user_id;

View File

@ -18,7 +18,7 @@ class InvoiceInvitationFactory
{
public static function create(int $company_id, int $user_id): InvoiceInvitation
{
$ii = new InvoiceInvitation;
$ii = new InvoiceInvitation();
$ii->company_id = $company_id;
$ii->user_id = $user_id;
$ii->client_contact_id = null;

View File

@ -20,7 +20,7 @@ class InvoiceItemFactory
{
public static function create(): stdClass
{
$item = new stdClass;
$item = new stdClass();
$item->quantity = 0;
$item->cost = 0;
$item->product_key = '';

View File

@ -18,7 +18,7 @@ class InvoiceToRecurringInvoiceFactory
{
public static function create(Invoice $invoice): RecurringInvoice
{
$recurring_invoice = new RecurringInvoice;
$recurring_invoice = new RecurringInvoice();
$recurring_invoice->status_id = RecurringInvoice::STATUS_DRAFT;
$recurring_invoice->discount = $invoice->discount;

View File

@ -18,7 +18,7 @@ class PaymentFactory
{
public static function create(int $company_id, int $user_id, int $client_id = 0): Payment
{
$payment = new Payment;
$payment = new Payment();
$payment->company_id = $company_id;
$payment->user_id = $user_id;

View File

@ -17,7 +17,7 @@ class PaymentTermFactory
{
public static function create(int $company_id, int $user_id): PaymentTerm
{
$payment_term = new PaymentTerm;
$payment_term = new PaymentTerm();
$payment_term->user_id = $user_id;
$payment_term->company_id = $company_id;

View File

@ -17,7 +17,7 @@ class ProductFactory
{
public static function create(int $company_id, int $user_id): Product
{
$product = new Product;
$product = new Product();
$product->company_id = $company_id;
$product->user_id = $user_id;

View File

@ -17,7 +17,7 @@ class ProjectFactory
{
public static function create(int $company_id, int $user_id): Project
{
$project = new Project;
$project = new Project();
$project->company_id = $company_id;
$project->user_id = $user_id;
$project->public_notes = '';

View File

@ -18,7 +18,7 @@ class QuoteInvitationFactory
{
public static function create(int $company_id, int $user_id): QuoteInvitation
{
$qi = new QuoteInvitation;
$qi = new QuoteInvitation();
$qi->company_id = $company_id;
$qi->user_id = $user_id;
$qi->client_contact_id = null;

View File

@ -18,7 +18,7 @@ class QuoteToRecurringQuoteFactory
{
public static function create(Quote $quote): RecurringQuote
{
$recurring_quote = new RecurringQuote;
$recurring_quote = new RecurringQuote();
$recurring_quote->status_id = RecurringQuote::STATUS_DRAFT;
$recurring_quote->discount = $quote->discount;

View File

@ -18,7 +18,7 @@ class RecurringInvoiceInvitationFactory
{
public static function create(int $company_id, int $user_id): RecurringInvoiceInvitation
{
$ii = new RecurringInvoiceInvitation;
$ii = new RecurringInvoiceInvitation();
$ii->company_id = $company_id;
$ii->user_id = $user_id;
$ii->client_contact_id = null;

Some files were not shown because too many files have changed in this diff Show More