Minor fixes

This commit is contained in:
David Bomba 2022-05-10 11:25:26 +10:00
parent b91c92e99d
commit f5a9e5ffbe
3 changed files with 7 additions and 6 deletions

View File

@ -699,7 +699,7 @@ ORDER BY clients.id;
invoices ON
clients.id=invoices.client_id
WHERE invoices.is_deleted = false
AND invoices.status_id IN (2,3)
AND invoices.status_id IN (2,3,4)
GROUP BY clients.id
HAVING invoice_balance != clients.balance
ORDER BY clients.id;
@ -794,7 +794,7 @@ ORDER BY clients.id;
ON invoices.client_id = clients.id
WHERE invoices.is_deleted = 0
AND clients.is_deleted = 0
AND invoices.status_id IN (2,3)
AND invoices.status_id IN (2,3,4)
GROUP BY clients.id
HAVING(invoices_balance != clients.balance)
ORDER BY clients.id;
@ -814,7 +814,7 @@ ORDER BY clients.id;
{
$client = Client::withTrashed()->find($_client->id);
$invoice_balance = $client->invoices()->where('is_deleted', false)->whereIn('status_id', [2,3])->sum('balance');
$invoice_balance = $client->invoices()->where('is_deleted', false)->whereIn('status_id', [2,3,4])->sum('balance');
$ledger = CompanyLedger::where('client_id', $client->id)->orderBy('id', 'DESC')->first();
@ -850,7 +850,7 @@ ORDER BY clients.id;
$this->wrong_paid_to_dates = 0;
foreach (Client::where('is_deleted', 0)->where('clients.updated_at', '>', now()->subDays(2))->cursor() as $client) {
$invoice_balance = $client->invoices()->where('is_deleted', false)->whereIn('status_id', [2,3])->sum('balance');
$invoice_balance = $client->invoices()->where('is_deleted', false)->whereIn('status_id', [2,3,4])->sum('balance');
$ledger = CompanyLedger::where('client_id', $client->id)->orderBy('id', 'DESC')->first();
if ($ledger && number_format($ledger->balance, 4) != number_format($client->balance, 4)) {

View File

@ -87,9 +87,9 @@ class Kernel extends ConsoleKernel
$schedule->job(new SendFailedEmails)->daily()->withoutOverlapping();
$schedule->command('ninja:check-data --database=db-ninja-01')->daily('00:50')->withoutOverlapping();
$schedule->command('ninja:check-data --database=db-ninja-01')->daily('01:00')->withoutOverlapping();
$schedule->command('ninja:check-data --database=db-ninja-02')->dailyAt('00:55')->withoutOverlapping();
$schedule->command('ninja:check-data --database=db-ninja-02')->dailyAt('01:05')->withoutOverlapping();
$schedule->command('ninja:s3-cleanup')->dailyAt('23:15')->withoutOverlapping();

View File

@ -123,6 +123,7 @@ class PaymentFailedMailer implements ShouldQueue
$nmo->settings = $settings;
NinjaMailerJob::dispatch($nmo);
}
}