mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-10 05:02:36 +01:00
Add mark paid for credits
This commit is contained in:
parent
e07c070d39
commit
e9dbe62d33
@ -61,11 +61,11 @@ class DesignFilters extends QueryFilters
|
|||||||
*/
|
*/
|
||||||
public function entityFilter(): Builder
|
public function entityFilter(): Builder
|
||||||
{
|
{
|
||||||
//19-03-2023 change the scope for the design filters
|
/** @var \App\Models\User $user */
|
||||||
return $this->builder->where(function ($query) {
|
$user = auth()->user();
|
||||||
$query->where('company_id', auth()->user()->company()->id)->orWhere('company_id', null)->orderBy('id', 'asc');
|
|
||||||
// return $this->builder->where('company_id', auth()->user()->company()->id)->orWhere('company_id', null)->orderBy('id', 'asc');
|
|
||||||
|
|
||||||
|
return $this->builder->where(function ($query) use($user){
|
||||||
|
$query->where('company_id', $user->company()->id)->orWhere('company_id', null)->orderBy('id', 'asc');
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -243,7 +243,7 @@ class CreditService
|
|||||||
|
|
||||||
public function triggeredActions($request)
|
public function triggeredActions($request)
|
||||||
{
|
{
|
||||||
$this->invoice = (new TriggeredActions($this->credit, $request))->run();
|
$this->credit = (new TriggeredActions($this->credit, $request))->run();
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
@ -61,6 +61,10 @@ class TriggeredActions extends AbstractService
|
|||||||
$company->save();
|
$company->save();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($this->request->has('mark_paid') && $this->request->input('mark_paid') == 'true') {
|
||||||
|
$this->credit->service()->markPaid()->save();
|
||||||
|
}
|
||||||
|
|
||||||
return $this->credit;
|
return $this->credit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user