mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-06-23 20:00:33 -04: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::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_amount = $invoice->payments->sum('pivot.amount');
|
||||||
$total_refund = $invoice->payments->sum('pivot.refunded');
|
$total_refund = $invoice->payments->sum('pivot.refunded');
|
||||||
|
@ -196,7 +196,7 @@ class Invoice extends BaseModel
|
|||||||
|
|
||||||
public function payments()
|
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…
x
Reference in New Issue
Block a user