Fixes for due date days calculations
This commit is contained in:
parent
f223a84af2
commit
57d3d9211c
|
|
@ -61,10 +61,13 @@ class SendRecurring implements ShouldQueue
|
|||
{
|
||||
// Generate Standard Invoice
|
||||
$invoice = RecurringInvoiceToInvoiceFactory::create($this->recurring_invoice, $this->recurring_invoice->client);
|
||||
|
||||
|
||||
$date = now()->addSeconds($this->recurring_invoice->client->timezone_offset())->format('Y-m-d');
|
||||
// $date = date('Y-m-d'); //@todo this will always pull UTC date.
|
||||
// $date = now()->addSeconds($this->recurring_invoice->client->timezone_offset())->format('Y-m-d'); Rev 1
|
||||
// $date = date('Y-m-d'); //@todo this will always pull UTC date. Rev 2.
|
||||
// 2025-01-23 - We need to know the current date in the users timezone, as we send recurring invoices around the
|
||||
// clock the actual date is not always the same as the UTC date.
|
||||
// be _very_ careful with this, as it will change the due date of the invoice.
|
||||
$date = now()->setTimezone($this->recurring_invoice->client->timezone()->name)->format('Y-m-d');
|
||||
$invoice->date = $date;
|
||||
|
||||
nlog("Recurring Invoice Date Set on Invoice = {$invoice->date} - ". now()->format('Y-m-d'));
|
||||
|
|
|
|||
|
|
@ -745,7 +745,9 @@ class RecurringInvoice extends BaseModel
|
|||
|
||||
default:
|
||||
|
||||
$date = Carbon::parse($date);
|
||||
// 2025-01-23 - Reverting this back, this is tightly linked to recurring invoice generation and
|
||||
// the timezone offset of the client AND when it was generated.
|
||||
$date = Carbon::parse($date);
|
||||
// $date = now()->addSeconds($this->client->timezone_offset());
|
||||
//$date = Carbon::parse($date)->addSeconds($this->client->timezone_offset());
|
||||
return $this->setDayOfMonth($date, $this->due_date_days);
|
||||
|
|
|
|||
Loading…
Reference in New Issue