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:
parent
03b363ed2d
commit
61c3a3f57e
@ -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');
|
||||
|
@ -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();
|
||||
;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user