Fixes for due date days calculations
This commit is contained in:
parent
f223a84af2
commit
57d3d9211c
|
|
@ -62,9 +62,12 @@ class SendRecurring implements ShouldQueue
|
||||||
// Generate Standard Invoice
|
// Generate Standard Invoice
|
||||||
$invoice = RecurringInvoiceToInvoiceFactory::create($this->recurring_invoice, $this->recurring_invoice->client);
|
$invoice = RecurringInvoiceToInvoiceFactory::create($this->recurring_invoice, $this->recurring_invoice->client);
|
||||||
|
|
||||||
|
// $date = now()->addSeconds($this->recurring_invoice->client->timezone_offset())->format('Y-m-d'); Rev 1
|
||||||
$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. Rev 2.
|
||||||
// $date = date('Y-m-d'); //@todo this will always pull UTC date.
|
// 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;
|
$invoice->date = $date;
|
||||||
|
|
||||||
nlog("Recurring Invoice Date Set on Invoice = {$invoice->date} - ". now()->format('Y-m-d'));
|
nlog("Recurring Invoice Date Set on Invoice = {$invoice->date} - ". now()->format('Y-m-d'));
|
||||||
|
|
|
||||||
|
|
@ -745,6 +745,8 @@ class RecurringInvoice extends BaseModel
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
|
||||||
|
// 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 = Carbon::parse($date);
|
||||||
// $date = now()->addSeconds($this->client->timezone_offset());
|
// $date = now()->addSeconds($this->client->timezone_offset());
|
||||||
//$date = Carbon::parse($date)->addSeconds($this->client->timezone_offset());
|
//$date = Carbon::parse($date)->addSeconds($this->client->timezone_offset());
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue