1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-05 18:52:44 +01:00

Working on check data script

This commit is contained in:
David Bomba 2020-07-07 17:56:30 +10:00
parent 03b363ed2d
commit 61c3a3f57e
2 changed files with 2 additions and 2 deletions

View File

@ -357,7 +357,7 @@ class CheckData extends Command
Client::cursor()->each(function ($client) use($wrong_balances){
$client->invoices->where('is_deleted', false)->each(function ($invoice) use($wrong_balances){
$client->invoices->where('is_deleted', false)->each(function ($invoice) use($wrong_balances, $client){
$total_amount = $invoice->payments->sum('pivot.amount');
$total_refund = $invoice->payments->sum('pivot.refunded');

View File

@ -196,7 +196,7 @@ class Invoice extends BaseModel
public function payments()
{
return $this->morphToMany(Payment::class, 'paymentable')->withPivot('amount', 'refunded')->withTimestamps();
return $this->morphToMany(Payment::class, 'paymentable')->withPivot('amount', 'refunded')->withTimestamps()->withTrashed();
;
}