mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
only send statements to clients with balances > 0
This commit is contained in:
parent
f299033896
commit
4677f92083
@ -32,11 +32,12 @@ class EmailStatementService
|
|||||||
{
|
{
|
||||||
$query = Client::query()
|
$query = Client::query()
|
||||||
->where('company_id', $this->scheduler->company_id)
|
->where('company_id', $this->scheduler->company_id)
|
||||||
->where('is_deleted', 0);
|
->where('is_deleted', 0)
|
||||||
|
->where('balance', '>', 0);
|
||||||
|
|
||||||
//Email only the selected clients
|
//Email only the selected clients
|
||||||
if (count($this->scheduler->parameters['clients']) >= 1) {
|
if (count($this->scheduler->parameters['clients']) >= 1) {
|
||||||
$query->whereIn('id', $this->transformKeys($this->scheduler->parameters['clients']))->where('balance', '>', 0);
|
$query->whereIn('id', $this->transformKeys($this->scheduler->parameters['clients']));
|
||||||
}
|
}
|
||||||
|
|
||||||
$query->cursor()
|
$query->cursor()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user