mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-05-31 21:14:35 -04:00
Merge branch 'v5-develop' of https://github.com/invoiceninja/invoiceninja into feature-brevo
This commit is contained in:
commit
04be097edd
@ -1 +1 @@
|
||||
5.8.8
|
||||
5.8.12
|
@ -15,6 +15,7 @@ use App;
|
||||
use App\Factory\ClientContactFactory;
|
||||
use App\Factory\VendorContactFactory;
|
||||
use App\Jobs\Company\CreateCompanyToken;
|
||||
use App\Libraries\MultiDB;
|
||||
use App\Models\Account;
|
||||
use App\Models\BankTransaction;
|
||||
use App\Models\Client;
|
||||
@ -128,6 +129,7 @@ class CheckData extends Command
|
||||
$this->checkUserState();
|
||||
$this->checkContactEmailAndSendEmailStatus();
|
||||
$this->checkPaymentCurrency();
|
||||
$this->checkSubdomainsSet();
|
||||
|
||||
if (Ninja::isHosted()) {
|
||||
$this->checkAccountStatuses();
|
||||
@ -1019,6 +1021,24 @@ class CheckData extends Command
|
||||
}
|
||||
}
|
||||
|
||||
public function checkSubdomainsSet()
|
||||
{
|
||||
if(Ninja::isSelfHost()) {
|
||||
return;
|
||||
}
|
||||
|
||||
Company::query()
|
||||
->whereNull('subdomain')
|
||||
->orWhere('subdomain', '')
|
||||
->cursor()
|
||||
->each(function ($c) {
|
||||
|
||||
$c->subdomain = MultiDB::randomSubdomainGenerator();
|
||||
$c->save();
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
public function checkPaymentCurrency()
|
||||
{
|
||||
$p = Payment::with('company', 'client')
|
||||
@ -1028,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') {
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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();
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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');
|
||||
|
@ -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())]);
|
||||
|
@ -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;
|
||||
|
@ -58,6 +58,7 @@ class TranslationsExport extends Command
|
||||
'it',
|
||||
'ja',
|
||||
'km_KH',
|
||||
'lo_LA',
|
||||
'lt',
|
||||
'lv_LV',
|
||||
'mk_MK',
|
||||
@ -137,6 +138,10 @@ class TranslationsExport extends Command
|
||||
Storage::disk('local')->makeDirectory("lang/{$lang}");
|
||||
|
||||
$translations = Lang::getLoader()->load($lang, 'texts');
|
||||
foreach($translations as $key => $value) {
|
||||
$translations[$key] = html_entity_decode($value);
|
||||
}
|
||||
|
||||
Storage::disk('local')->put("lang/{$lang}/{$lang}.json", json_encode(Arr::dot($translations), JSON_UNESCAPED_UNICODE));
|
||||
}
|
||||
}
|
||||
|
@ -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();
|
||||
|
||||
|
@ -229,7 +229,7 @@ class CompanySettings extends BaseSettings
|
||||
public $require_quote_signature = false; //@TODO ben to confirm
|
||||
|
||||
//email settings
|
||||
public $email_sending_method = 'default'; //enum 'default','gmail','office365' 'client_postmark', 'client_mailgun' , 'client_brevo' //@implemented
|
||||
public $email_sending_method = 'default'; //enum 'default','gmail','office365' 'client_postmark', 'client_mailgun', 'mailgun' //@implemented
|
||||
|
||||
public $gmail_sending_user_id = '0'; //@implemented
|
||||
|
||||
@ -860,7 +860,7 @@ class CompanySettings extends BaseSettings
|
||||
*/
|
||||
public static function notificationDefaults(): stdClass
|
||||
{
|
||||
$notification = new stdClass;
|
||||
$notification = new stdClass();
|
||||
$notification->email = [];
|
||||
$notification->email = ['invoice_sent_all'];
|
||||
|
||||
@ -876,7 +876,7 @@ class CompanySettings extends BaseSettings
|
||||
*/
|
||||
public static function notificationAdminDefaults(): stdClass
|
||||
{
|
||||
$notification = new stdClass;
|
||||
$notification = new stdClass();
|
||||
$notification->email = [];
|
||||
$notification->email = ['invoice_sent_all'];
|
||||
|
||||
|
@ -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
|
||||
|
@ -13,7 +13,6 @@ namespace App\DataMapper\Tax;
|
||||
|
||||
class TaxModel
|
||||
{
|
||||
|
||||
/** @var string $seller_subregion */
|
||||
public string $seller_subregion = 'CA';
|
||||
|
||||
|
@ -22,7 +22,6 @@ use App\Models\Product;
|
||||
*/
|
||||
class Rule extends BaseRule implements RuleInterface
|
||||
{
|
||||
|
||||
/** @var string $seller_region */
|
||||
public string $seller_region = 'US';
|
||||
|
||||
|
@ -14,7 +14,6 @@ namespace App\DataProviders;
|
||||
|
||||
class Domains
|
||||
{
|
||||
|
||||
private static array $verify_domains = [
|
||||
'0-00.usa.cc',
|
||||
'0-180.com',
|
||||
|
@ -22,7 +22,9 @@ use Illuminate\Queue\SerializesModels;
|
||||
*/
|
||||
class AccountCreated
|
||||
{
|
||||
use Dispatchable, InteractsWithSockets, SerializesModels;
|
||||
use Dispatchable;
|
||||
use InteractsWithSockets;
|
||||
use SerializesModels;
|
||||
|
||||
public $user;
|
||||
|
||||
|
@ -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)
|
||||
{
|
||||
|
@ -23,7 +23,9 @@ use Illuminate\Queue\SerializesModels;
|
||||
*/
|
||||
class ClientWasArchived
|
||||
{
|
||||
use Dispatchable, InteractsWithSockets, SerializesModels;
|
||||
use Dispatchable;
|
||||
use InteractsWithSockets;
|
||||
use SerializesModels;
|
||||
|
||||
/**
|
||||
* @var Client
|
||||
|
@ -19,7 +19,9 @@ use Illuminate\Queue\SerializesModels;
|
||||
|
||||
class CompanyDocumentsDeleted
|
||||
{
|
||||
use Dispatchable, InteractsWithSockets, SerializesModels;
|
||||
use Dispatchable;
|
||||
use InteractsWithSockets;
|
||||
use SerializesModels;
|
||||
|
||||
/**
|
||||
* @var Company
|
||||
|
@ -22,7 +22,9 @@ use Illuminate\Queue\SerializesModels;
|
||||
*/
|
||||
class ContactLoggedIn
|
||||
{
|
||||
use Dispatchable, InteractsWithSockets, SerializesModels;
|
||||
use Dispatchable;
|
||||
use InteractsWithSockets;
|
||||
use SerializesModels;
|
||||
|
||||
public $client_contact;
|
||||
|
||||
|
@ -19,7 +19,9 @@ use Illuminate\Queue\SerializesModels;
|
||||
|
||||
class CreditWasArchived
|
||||
{
|
||||
use Dispatchable, InteractsWithSockets, SerializesModels;
|
||||
use Dispatchable;
|
||||
use InteractsWithSockets;
|
||||
use SerializesModels;
|
||||
|
||||
public $credit;
|
||||
|
||||
|
@ -19,7 +19,9 @@ use Illuminate\Queue\SerializesModels;
|
||||
|
||||
class CreditWasCreated
|
||||
{
|
||||
use Dispatchable, InteractsWithSockets, SerializesModels;
|
||||
use Dispatchable;
|
||||
use InteractsWithSockets;
|
||||
use SerializesModels;
|
||||
|
||||
public $credit;
|
||||
|
||||
|
@ -19,7 +19,9 @@ use Illuminate\Queue\SerializesModels;
|
||||
|
||||
class CreditWasDeleted
|
||||
{
|
||||
use Dispatchable, InteractsWithSockets, SerializesModels;
|
||||
use Dispatchable;
|
||||
use InteractsWithSockets;
|
||||
use SerializesModels;
|
||||
|
||||
public $credit;
|
||||
|
||||
|
@ -19,7 +19,9 @@ use Illuminate\Queue\SerializesModels;
|
||||
|
||||
class CreditWasEmailed
|
||||
{
|
||||
use Dispatchable, InteractsWithSockets, SerializesModels;
|
||||
use Dispatchable;
|
||||
use InteractsWithSockets;
|
||||
use SerializesModels;
|
||||
|
||||
public $invitation;
|
||||
|
||||
|
@ -18,7 +18,9 @@ use Illuminate\Queue\SerializesModels;
|
||||
|
||||
class CreditWasEmailedAndFailed
|
||||
{
|
||||
use Dispatchable, InteractsWithSockets, SerializesModels;
|
||||
use Dispatchable;
|
||||
use InteractsWithSockets;
|
||||
use SerializesModels;
|
||||
|
||||
public $credit;
|
||||
|
||||
|
@ -19,7 +19,9 @@ use Illuminate\Queue\SerializesModels;
|
||||
|
||||
class CreditWasUpdated
|
||||
{
|
||||
use Dispatchable, InteractsWithSockets, SerializesModels;
|
||||
use Dispatchable;
|
||||
use InteractsWithSockets;
|
||||
use SerializesModels;
|
||||
|
||||
public $credit;
|
||||
|
||||
|
@ -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)
|
||||
{
|
||||
|
@ -23,7 +23,9 @@ use Illuminate\Queue\SerializesModels;
|
||||
*/
|
||||
class DocumentWasArchived
|
||||
{
|
||||
use Dispatchable, InteractsWithSockets, SerializesModels;
|
||||
use Dispatchable;
|
||||
use InteractsWithSockets;
|
||||
use SerializesModels;
|
||||
|
||||
/**
|
||||
* @var Document
|
||||
|
@ -24,7 +24,9 @@ use Illuminate\Queue\SerializesModels;
|
||||
*/
|
||||
class InvoiceWasCreated implements ShouldBroadcast
|
||||
{
|
||||
use Dispatchable, InteractsWithSockets, SerializesModels;
|
||||
use Dispatchable;
|
||||
use InteractsWithSockets;
|
||||
use SerializesModels;
|
||||
|
||||
/**
|
||||
* @var Invoice
|
||||
|
@ -22,7 +22,9 @@ use Illuminate\Queue\SerializesModels;
|
||||
*/
|
||||
class InvoiceWasUpdated
|
||||
{
|
||||
use Dispatchable, InteractsWithSockets, SerializesModels;
|
||||
use Dispatchable;
|
||||
use InteractsWithSockets;
|
||||
use SerializesModels;
|
||||
|
||||
/**
|
||||
* @var Invoice
|
||||
|
@ -20,7 +20,9 @@ use Illuminate\Queue\SerializesModels;
|
||||
|
||||
class MethodDeleted
|
||||
{
|
||||
use Dispatchable, InteractsWithSockets, SerializesModels;
|
||||
use Dispatchable;
|
||||
use InteractsWithSockets;
|
||||
use SerializesModels;
|
||||
|
||||
/**
|
||||
* @var ClientGatewayToken
|
||||
|
@ -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.
|
||||
|
@ -22,7 +22,9 @@ use Illuminate\Queue\SerializesModels;
|
||||
*/
|
||||
class PaymentWasEmailedAndFailed
|
||||
{
|
||||
use Dispatchable, InteractsWithSockets, SerializesModels;
|
||||
use Dispatchable;
|
||||
use InteractsWithSockets;
|
||||
use SerializesModels;
|
||||
|
||||
/**
|
||||
* @var Payment
|
||||
|
@ -20,7 +20,9 @@ use Illuminate\Queue\SerializesModels;
|
||||
|
||||
class QuoteWasApproved
|
||||
{
|
||||
use Dispatchable, InteractsWithSockets, SerializesModels;
|
||||
use Dispatchable;
|
||||
use InteractsWithSockets;
|
||||
use SerializesModels;
|
||||
|
||||
public $contact;
|
||||
|
||||
|
@ -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)
|
||||
{
|
||||
|
@ -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)
|
||||
|
@ -10,7 +10,9 @@ use Illuminate\Queue\SerializesModels;
|
||||
|
||||
class SubscriptionWasCreated
|
||||
{
|
||||
use Dispatchable, InteractsWithSockets, SerializesModels;
|
||||
use Dispatchable;
|
||||
use InteractsWithSockets;
|
||||
use SerializesModels;
|
||||
|
||||
/**
|
||||
* @var Subscription
|
||||
|
@ -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)
|
||||
{
|
||||
|
@ -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)
|
||||
{
|
||||
|
@ -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)
|
||||
{
|
||||
|
@ -23,7 +23,9 @@ use Illuminate\Queue\SerializesModels;
|
||||
*/
|
||||
class UserWasDeleted
|
||||
{
|
||||
use Dispatchable, InteractsWithSockets, SerializesModels;
|
||||
use Dispatchable;
|
||||
use InteractsWithSockets;
|
||||
use SerializesModels;
|
||||
|
||||
public $user;
|
||||
|
||||
|
@ -23,7 +23,9 @@ use Illuminate\Queue\SerializesModels;
|
||||
*/
|
||||
class UserWasRestored
|
||||
{
|
||||
use Dispatchable, InteractsWithSockets, SerializesModels;
|
||||
use Dispatchable;
|
||||
use InteractsWithSockets;
|
||||
use SerializesModels;
|
||||
|
||||
public $user;
|
||||
|
||||
|
@ -23,7 +23,9 @@ use Illuminate\Queue\SerializesModels;
|
||||
*/
|
||||
class UserWasUpdated
|
||||
{
|
||||
use Dispatchable, InteractsWithSockets, SerializesModels;
|
||||
use Dispatchable;
|
||||
use InteractsWithSockets;
|
||||
use SerializesModels;
|
||||
|
||||
public $user;
|
||||
|
||||
|
4
app/Events/Vendor/VendorContactLoggedIn.php
vendored
4
app/Events/Vendor/VendorContactLoggedIn.php
vendored
@ -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.
|
||||
|
@ -9,7 +9,6 @@
|
||||
* @license https://www.elastic.co/licensing/elastic-license
|
||||
*/
|
||||
|
||||
|
||||
namespace App\Exceptions;
|
||||
|
||||
use Exception;
|
||||
|
@ -9,7 +9,6 @@
|
||||
* @license https://www.elastic.co/licensing/elastic-license
|
||||
*/
|
||||
|
||||
|
||||
namespace App\Exceptions;
|
||||
|
||||
use Exception;
|
||||
|
@ -9,7 +9,6 @@
|
||||
* @license https://www.elastic.co/licensing/elastic-license
|
||||
*/
|
||||
|
||||
|
||||
namespace App\Exceptions;
|
||||
|
||||
use Exception;
|
||||
|
@ -9,7 +9,6 @@
|
||||
* @license https://www.elastic.co/licensing/elastic-license
|
||||
*/
|
||||
|
||||
|
||||
namespace App\Exceptions;
|
||||
|
||||
use Exception;
|
||||
|
@ -9,7 +9,6 @@
|
||||
* @license https://www.elastic.co/licensing/elastic-license
|
||||
*/
|
||||
|
||||
|
||||
namespace App\Exceptions;
|
||||
|
||||
use Exception;
|
||||
|
@ -9,7 +9,6 @@
|
||||
* @license https://www.elastic.co/licensing/elastic-license
|
||||
*/
|
||||
|
||||
|
||||
namespace App\Exceptions;
|
||||
|
||||
use Exception;
|
||||
|
@ -9,7 +9,6 @@
|
||||
* @license https://www.elastic.co/licensing/elastic-license
|
||||
*/
|
||||
|
||||
|
||||
namespace App\Exceptions;
|
||||
|
||||
use Exception;
|
||||
|
@ -9,7 +9,6 @@
|
||||
* @license https://www.elastic.co/licensing/elastic-license
|
||||
*/
|
||||
|
||||
|
||||
namespace App\Exceptions;
|
||||
|
||||
use Exception;
|
||||
|
@ -9,7 +9,6 @@
|
||||
* @license https://www.elastic.co/licensing/elastic-license
|
||||
*/
|
||||
|
||||
|
||||
namespace App\Exceptions;
|
||||
|
||||
use Exception;
|
||||
|
@ -9,7 +9,6 @@
|
||||
* @license https://www.elastic.co/licensing/elastic-license
|
||||
*/
|
||||
|
||||
|
||||
namespace App\Exceptions;
|
||||
|
||||
use Exception;
|
||||
|
@ -9,7 +9,6 @@
|
||||
* @license https://www.elastic.co/licensing/elastic-license
|
||||
*/
|
||||
|
||||
|
||||
namespace App\Exceptions;
|
||||
|
||||
use Exception;
|
||||
|
@ -9,7 +9,6 @@
|
||||
* @license https://www.elastic.co/licensing/elastic-license
|
||||
*/
|
||||
|
||||
|
||||
namespace App\Exceptions;
|
||||
|
||||
use Exception;
|
||||
|
@ -9,7 +9,6 @@
|
||||
* @license https://www.elastic.co/licensing/elastic-license
|
||||
*/
|
||||
|
||||
|
||||
namespace App\Exceptions;
|
||||
|
||||
use Exception;
|
||||
|
@ -9,7 +9,6 @@
|
||||
* @license https://www.elastic.co/licensing/elastic-license
|
||||
*/
|
||||
|
||||
|
||||
namespace App\Exceptions;
|
||||
|
||||
use Exception;
|
||||
|
@ -9,7 +9,6 @@
|
||||
* @license https://www.elastic.co/licensing/elastic-license
|
||||
*/
|
||||
|
||||
|
||||
namespace App\Exceptions;
|
||||
|
||||
use Exception;
|
||||
|
@ -9,7 +9,6 @@
|
||||
* @license https://www.elastic.co/licensing/elastic-license
|
||||
*/
|
||||
|
||||
|
||||
namespace App\Exceptions;
|
||||
|
||||
use Exception;
|
||||
|
@ -9,7 +9,6 @@
|
||||
* @license https://www.elastic.co/licensing/elastic-license
|
||||
*/
|
||||
|
||||
|
||||
namespace App\Exceptions;
|
||||
|
||||
use Exception;
|
||||
|
@ -25,7 +25,6 @@ use League\Csv\Writer;
|
||||
|
||||
class ActivityExport extends BaseExport
|
||||
{
|
||||
|
||||
private $entity_transformer;
|
||||
|
||||
public string $date_key = 'created_at';
|
||||
|
@ -25,7 +25,6 @@ use Illuminate\Database\Eloquent\Builder;
|
||||
|
||||
class ContactExport extends BaseExport
|
||||
{
|
||||
|
||||
private ClientTransformer $client_transformer;
|
||||
|
||||
private ClientContactTransformer $contact_transformer;
|
||||
|
@ -24,7 +24,6 @@ use League\Csv\Writer;
|
||||
|
||||
class CreditExport extends BaseExport
|
||||
{
|
||||
|
||||
private CreditTransformer $credit_transformer;
|
||||
|
||||
private Decorator $decorator;
|
||||
|
@ -22,7 +22,6 @@ use League\Csv\Writer;
|
||||
|
||||
class DocumentExport extends BaseExport
|
||||
{
|
||||
|
||||
private $entity_transformer;
|
||||
|
||||
public string $date_key = 'created_at';
|
||||
|
@ -23,7 +23,6 @@ use League\Csv\Writer;
|
||||
|
||||
class ExpenseExport extends BaseExport
|
||||
{
|
||||
|
||||
private $expense_transformer;
|
||||
|
||||
private Decorator $decorator;
|
||||
|
@ -23,7 +23,6 @@ use League\Csv\Writer;
|
||||
|
||||
class InvoiceItemExport extends BaseExport
|
||||
{
|
||||
|
||||
private $invoice_transformer;
|
||||
|
||||
public string $date_key = 'date';
|
||||
|
@ -37,6 +37,7 @@ class ProductSalesExport extends BaseExport
|
||||
'product_key' => 'product_key',
|
||||
'notes' => 'notes',
|
||||
'quantity' => 'quantity',
|
||||
'currency' => 'currency',
|
||||
'cost' => 'price',
|
||||
'price' => 'cost',
|
||||
'markup' => 'markup',
|
||||
@ -163,6 +164,7 @@ class ProductSalesExport extends BaseExport
|
||||
private function buildRow($invoice, $invoice_item): array
|
||||
{
|
||||
$transformed_entity = (array)$invoice_item;
|
||||
$transformed_entity['price'] = ($invoice_item->product_cost ?? 1) * ($invoice->exchange_rate ?? 1) ;
|
||||
|
||||
$entity = [];
|
||||
|
||||
@ -171,6 +173,8 @@ class ProductSalesExport extends BaseExport
|
||||
|
||||
if (array_key_exists($key, $transformed_entity)) {
|
||||
$entity[$keyval] = $transformed_entity[$key];
|
||||
} elseif($key == 'currency') {
|
||||
$entity['currency'] = $invoice->client->currency()->code;
|
||||
} else {
|
||||
$entity[$keyval] = '';
|
||||
}
|
||||
@ -184,9 +188,9 @@ class ProductSalesExport extends BaseExport
|
||||
|
||||
private function decorateAdvancedFields(Invoice $invoice, $entity): array
|
||||
{
|
||||
$product = $this->getProduct($entity['product_key']);
|
||||
|
||||
$entity['cost'] = $product->cost ?? 0;
|
||||
//$product = $this->getProduct($entity['product_key']);
|
||||
// $entity['cost'] = $product->cost ?? 0;
|
||||
/** @var float $unit_cost */
|
||||
$unit_cost = $entity['cost'] == 0 ? 1 : $entity['cost'];
|
||||
|
||||
|
@ -23,7 +23,6 @@ use App\Transformers\PurchaseOrderTransformer;
|
||||
|
||||
class PurchaseOrderExport extends BaseExport
|
||||
{
|
||||
|
||||
private $purchase_order_transformer;
|
||||
|
||||
public string $date_key = 'date';
|
||||
|
@ -23,7 +23,6 @@ use League\Csv\Writer;
|
||||
|
||||
class PurchaseOrderItemExport extends BaseExport
|
||||
{
|
||||
|
||||
private $purchase_order_transformer;
|
||||
|
||||
public string $date_key = 'date';
|
||||
|
@ -23,7 +23,6 @@ use League\Csv\Writer;
|
||||
|
||||
class QuoteExport extends BaseExport
|
||||
{
|
||||
|
||||
private $quote_transformer;
|
||||
|
||||
public string $date_key = 'date';
|
||||
|
@ -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
|
||||
|
@ -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] = '';
|
||||
|
@ -26,7 +26,6 @@ use League\Csv\Writer;
|
||||
|
||||
class TaskExport extends BaseExport
|
||||
{
|
||||
|
||||
private $entity_transformer;
|
||||
|
||||
public string $date_key = 'created_at';
|
||||
@ -120,7 +119,7 @@ class TaskExport extends BaseExport
|
||||
|
||||
$this->storage_array = [];
|
||||
});
|
||||
// nlog($this->storage_item_array);
|
||||
|
||||
return array_merge(['columns' => $header], $this->storage_item_array);
|
||||
}
|
||||
|
||||
@ -140,19 +139,11 @@ class TaskExport extends BaseExport
|
||||
} elseif (in_array($key, ['task.start_date', 'task.end_date', 'task.duration'])) {
|
||||
$entity[$key] = '';
|
||||
} else {
|
||||
// nlog($key);
|
||||
$entity[$key] = $this->decorator->transform($key, $task);
|
||||
// $entity[$key] = $this->resolveKey($key, $task, $this->entity_transformer);
|
||||
}
|
||||
|
||||
// $entity['task.start_date'] = '';
|
||||
// $entity['task.end_date'] = '';
|
||||
// $entity['task.duration'] = '';
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (is_null($task->time_log) || (is_array(json_decode($task->time_log, 1)) && count(json_decode($task->time_log, 1)) == 0)) {
|
||||
$this->storage_array[] = $entity;
|
||||
} else {
|
||||
@ -201,9 +192,9 @@ class TaskExport extends BaseExport
|
||||
|
||||
$this->storage_array[] = $entity;
|
||||
|
||||
unset($entity['task.start_date']);
|
||||
unset($entity['task.end_date']);
|
||||
unset($entity['task.duration']);
|
||||
$entity['task.start_date'] = '';
|
||||
$entity['task.end_date'] = '';
|
||||
$entity['task.duration'] = '';
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -24,7 +24,6 @@ use League\Csv\Writer;
|
||||
|
||||
class VendorExport extends BaseExport
|
||||
{
|
||||
|
||||
private $vendor_transformer;
|
||||
|
||||
private $contact_transformer;
|
||||
|
@ -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};
|
||||
}
|
||||
|
||||
|
@ -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};
|
||||
}
|
||||
|
||||
|
@ -13,7 +13,6 @@ namespace App\Export\Decorators;
|
||||
|
||||
class Decorator implements DecoratorInterface
|
||||
{
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
}
|
||||
|
@ -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};
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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 = '';
|
||||
|
@ -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 = '';
|
||||
|
@ -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();
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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 = '';
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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 = '';
|
||||
|
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