mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
commit
35237849ff
@ -53,7 +53,11 @@ class ReminderJob implements ShouldQueue
|
|||||||
|
|
||||||
private function processReminders()
|
private function processReminders()
|
||||||
{
|
{
|
||||||
Invoice::whereDate('next_send_date', '<=', now())->with('invitations')->cursor()->each(function ($invoice) {
|
Invoice::whereDate('next_send_date', '<=', now())
|
||||||
|
->where('is_deleted', 0)
|
||||||
|
->whereIn('status_id', [Invoice::STATUS_SENT, Invoice::STATUS_PARTIAL])
|
||||||
|
->where('balance', '>', 0)
|
||||||
|
->with('invitations')->cursor()->each(function ($invoice) {
|
||||||
|
|
||||||
if ($invoice->isPayable()) {
|
if ($invoice->isPayable()) {
|
||||||
$reminder_template = $invoice->calculateTemplate('invoice');
|
$reminder_template = $invoice->calculateTemplate('invoice');
|
||||||
|
@ -58,7 +58,7 @@ class UpdatePaymentMethods
|
|||||||
|
|
||||||
// }
|
// }
|
||||||
|
|
||||||
private function updateMethods(Customer $customer, Client $client)
|
public function updateMethods(Customer $customer, Client $client)
|
||||||
{
|
{
|
||||||
$card_methods = PaymentMethod::all([
|
$card_methods = PaymentMethod::all([
|
||||||
'customer' => $customer->id,
|
'customer' => $customer->id,
|
||||||
@ -145,7 +145,7 @@ class UpdatePaymentMethods
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private function buildPaymentMethodMeta(PaymentMethod $method, GatewayType $type_id)
|
private function buildPaymentMethodMeta(PaymentMethod $method, $type_id)
|
||||||
{
|
{
|
||||||
|
|
||||||
switch ($type_id) {
|
switch ($type_id) {
|
||||||
|
@ -392,7 +392,8 @@ class InvoiceService
|
|||||||
$this->invoice->reminder_last_sent = now()->format('Y-m-d');
|
$this->invoice->reminder_last_sent = now()->format('Y-m-d');
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
// code...
|
$this->invoice->reminder1_sent = now()->format('Y-m-d');
|
||||||
|
$this->invoice->reminder_last_sent = now()->format('Y-m-d');
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -126,7 +126,10 @@ class UpdateReminder extends AbstractService
|
|||||||
$date_collection->push($reminder_date);
|
$date_collection->push($reminder_date);
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->invoice->next_send_date = $date_collection->sort()->first();
|
if($date_collection->count() >=1)
|
||||||
|
$this->invoice->next_send_date = $date_collection->sort()->first();
|
||||||
|
else
|
||||||
|
$this->invoice->next_send_date = null;
|
||||||
|
|
||||||
return $this->invoice;
|
return $this->invoice;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user