mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-05-31 09:34:33 -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
|
payments.id = paymentables.payment_id
|
||||||
WHERE paymentable_type = ?
|
WHERE paymentable_type = ?
|
||||||
AND paymentables.deleted_at is NULL
|
AND paymentables.deleted_at is NULL
|
||||||
AND payments.amount > 0
|
AND paymentables.amount > 0
|
||||||
AND payments.is_deleted = 0
|
AND payments.is_deleted = 0
|
||||||
AND payments.client_id = ?;
|
AND payments.client_id = ?;
|
||||||
"), [App\Models\Credit::class, $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());
|
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)));
|
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);
|
$timeStart = microtime(true);
|
||||||
DB::enableQueryLog();
|
DB::enableQueryLog();
|
||||||
$response = $next($request);
|
|
||||||
|
|
||||||
// hide requests made by debugbar
|
// hide requests made by debugbar
|
||||||
if (strstr($request->url(), '_debugbar') === false) {
|
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();
|
$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()
|
->service()
|
||||||
->updatePaidToDate(($this->payment->amount - $this->payment->refunded)*-1)
|
->updatePaidToDate(($this->payment->amount - $this->payment->refunded)*-1)
|
||||||
->save();
|
->save();
|
||||||
@ -147,7 +149,7 @@ class DeletePayment
|
|||||||
$transaction = [
|
$transaction = [
|
||||||
'invoice' => [],
|
'invoice' => [],
|
||||||
'payment' => [],
|
'payment' => [],
|
||||||
'client' => $this->payment->client->transaction_event(),
|
'client' => $client->transaction_event(),
|
||||||
'credit' => [],
|
'credit' => [],
|
||||||
'metadata' => [],
|
'metadata' => [],
|
||||||
];
|
];
|
||||||
@ -165,8 +167,8 @@ class DeletePayment
|
|||||||
|
|
||||||
$multiplier = 1;
|
$multiplier = 1;
|
||||||
|
|
||||||
if($paymentable_credit->pivot->amount < 0)
|
if($paymentable_credit->pivot->amount < 0)
|
||||||
$multiplier = -1;
|
$multiplier = -1;
|
||||||
|
|
||||||
$paymentable_credit->service()
|
$paymentable_credit->service()
|
||||||
->updateBalance($paymentable_credit->pivot->amount*$multiplier*-1)
|
->updateBalance($paymentable_credit->pivot->amount*$multiplier*-1)
|
||||||
@ -174,18 +176,13 @@ class DeletePayment
|
|||||||
->setStatus(Credit::STATUS_SENT)
|
->setStatus(Credit::STATUS_SENT)
|
||||||
->save();
|
->save();
|
||||||
|
|
||||||
$this->payment
|
$client = $this->payment->client->fresh();
|
||||||
->client
|
|
||||||
->service()
|
$client
|
||||||
->updatePaidToDate(($paymentable_credit->pivot->amount)*-1)
|
->service()
|
||||||
->save();
|
->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