mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-05-24 02:14:21 -04:00
Fixes for check data
This commit is contained in:
parent
197dde037e
commit
9ccc43cece
@ -482,7 +482,7 @@ class CheckData extends Command
|
||||
payments.id = paymentables.payment_id
|
||||
WHERE paymentable_type = ?
|
||||
AND paymentables.deleted_at is NULL
|
||||
AND payments.amount > 0
|
||||
AND paymentables.amount > 0
|
||||
AND payments.is_deleted = 0
|
||||
AND payments.client_id = ?;
|
||||
"), [App\Models\Credit::class, $client->id] );
|
||||
|
@ -396,8 +396,7 @@ class UserController extends BaseController
|
||||
UserEmailChanged::dispatch($new_user, json_decode($old_user), auth()->user()->company());
|
||||
}
|
||||
|
||||
$user->company_users()->update(["permissions_updated_at" => now()]);
|
||||
|
||||
$user->company_users()->update(["permissions_updated_at" => now()]);
|
||||
|
||||
event(new UserWasUpdated($user, auth()->user(), auth()->user()->company, Ninja::eventVars(auth()->user() ? auth()->user()->id : null)));
|
||||
|
||||
|
@ -41,7 +41,6 @@ class QueryLogging
|
||||
|
||||
$timeStart = microtime(true);
|
||||
DB::enableQueryLog();
|
||||
$response = $next($request);
|
||||
|
||||
// hide requests made by debugbar
|
||||
if (strstr($request->url(), '_debugbar') === false) {
|
||||
@ -73,6 +72,6 @@ class QueryLogging
|
||||
}
|
||||
|
||||
|
||||
return $response;
|
||||
return $next($request);
|
||||
}
|
||||
}
|
||||
|
@ -66,9 +66,8 @@ class StartupCheck
|
||||
$this->buildTemplates();
|
||||
}
|
||||
|
||||
$response = $next($request);
|
||||
return $next($request);
|
||||
|
||||
return $response;
|
||||
}
|
||||
|
||||
|
||||
|
@ -138,8 +138,10 @@ class DeletePayment
|
||||
});
|
||||
}
|
||||
|
||||
$this->payment
|
||||
->client
|
||||
|
||||
$client = $this->payment->client->fresh();
|
||||
|
||||
$client
|
||||
->service()
|
||||
->updatePaidToDate(($this->payment->amount - $this->payment->refunded)*-1)
|
||||
->save();
|
||||
@ -147,7 +149,7 @@ class DeletePayment
|
||||
$transaction = [
|
||||
'invoice' => [],
|
||||
'payment' => [],
|
||||
'client' => $this->payment->client->transaction_event(),
|
||||
'client' => $client->transaction_event(),
|
||||
'credit' => [],
|
||||
'metadata' => [],
|
||||
];
|
||||
@ -165,8 +167,8 @@ class DeletePayment
|
||||
|
||||
$multiplier = 1;
|
||||
|
||||
if($paymentable_credit->pivot->amount < 0)
|
||||
$multiplier = -1;
|
||||
if($paymentable_credit->pivot->amount < 0)
|
||||
$multiplier = -1;
|
||||
|
||||
$paymentable_credit->service()
|
||||
->updateBalance($paymentable_credit->pivot->amount*$multiplier*-1)
|
||||
@ -174,18 +176,13 @@ class DeletePayment
|
||||
->setStatus(Credit::STATUS_SENT)
|
||||
->save();
|
||||
|
||||
$this->payment
|
||||
->client
|
||||
->service()
|
||||
->updatePaidToDate(($paymentable_credit->pivot->amount)*-1)
|
||||
->save();
|
||||
$client = $this->payment->client->fresh();
|
||||
|
||||
$client
|
||||
->service()
|
||||
->updatePaidToDate(($paymentable_credit->pivot->amount)*-1)
|
||||
->save();
|
||||
|
||||
//01-03-2022
|
||||
// $paymentable_credit->service()
|
||||
// ->updateBalance($paymentable_credit->pivot->amount*$multiplier)
|
||||
// ->updatePaidToDate($paymentable_credit->pivot->amount*-1)
|
||||
// ->setStatus(Credit::STATUS_SENT)
|
||||
// ->save();
|
||||
});
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user