mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-10 13:12:50 +01:00
Updates for deleting activities when purging clients
This commit is contained in:
parent
073948facf
commit
af8a788dfb
@ -347,6 +347,11 @@ class Client extends BaseModel implements HasLocalePreference
|
||||
return $this->hasMany(Credit::class)->withTrashed();
|
||||
}
|
||||
|
||||
public function purgeable_activities()
|
||||
{
|
||||
return $this->hasMany(Activity::class);
|
||||
}
|
||||
|
||||
public function activities()
|
||||
{
|
||||
return $this->hasMany(Activity::class)->take(50)->orderBy('id', 'desc');
|
||||
|
@ -136,7 +136,7 @@ class ClientRepository extends BaseRepository
|
||||
$client->projects()->forceDelete();
|
||||
$client->credits()->forceDelete();
|
||||
$client->quotes()->forceDelete();
|
||||
$client->activities()->forceDelete();
|
||||
$client->purgeable_activities()->forceDelete();
|
||||
$client->recurring_invoices()->forceDelete();
|
||||
$client->expenses()->forceDelete();
|
||||
$client->recurring_expenses()->forceDelete();
|
||||
|
@ -148,7 +148,7 @@ class DeletePayment
|
||||
|
||||
$client
|
||||
->service()
|
||||
->updatePaidToDate(($paymentable_credit->pivot->amount) * -1)
|
||||
// ->updatePaidToDate(($paymentable_credit->pivot->amount) * -1)
|
||||
->adjustCreditBalance($paymentable_credit->pivot->amount)
|
||||
->save();
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user