mirror of
https://github.com/crater-invoice/crater.git
synced 2025-10-27 11:41:09 -04:00
Merge branch 'latest-fix-recurring-invoice' into 'master'
fix recurring invoice starts at condition See merge request mohit.panjvani/crater-web!1319
This commit is contained in:
@ -20,6 +20,10 @@ class RecurringInvoice extends Model
|
||||
'id',
|
||||
];
|
||||
|
||||
protected $dates = [
|
||||
'starts_at'
|
||||
];
|
||||
|
||||
public const NONE = 'NONE';
|
||||
public const COUNT = 'COUNT';
|
||||
public const DATE = 'DATE';
|
||||
@ -259,6 +263,10 @@ class RecurringInvoice extends Model
|
||||
|
||||
public function generateInvoice()
|
||||
{
|
||||
if (Carbon::now()->lessThan($this->starts_at)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ($this->limit_by == 'DATE') {
|
||||
$startDate = Carbon::today()->format('Y-m-d');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user