Browse Source

wip timezone handling

3.x
Andrew Wallo 2 months ago
parent
commit
9be2dbf166
1 changed files with 2 additions and 2 deletions
  1. 2
    2
      app/Filament/Company/Resources/Purchases/BillResource.php

+ 2
- 2
app/Filament/Company/Resources/Purchases/BillResource.php View File

614
                         ->beforeReplicaSaved(function (Bill $replica) {
614
                         ->beforeReplicaSaved(function (Bill $replica) {
615
                             $replica->status = BillStatus::Open;
615
                             $replica->status = BillStatus::Open;
616
                             $replica->bill_number = Bill::getNextDocumentNumber();
616
                             $replica->bill_number = Bill::getNextDocumentNumber();
617
-                            $replica->date = now();
618
-                            $replica->due_date = now()->addDays($replica->company->defaultBill->payment_terms->getDays());
617
+                            $replica->date = company_today();
618
+                            $replica->due_date = company_today()->addDays($replica->company->defaultBill->payment_terms->getDays());
619
                         })
619
                         })
620
                         ->withReplicatedRelationships(['lineItems'])
620
                         ->withReplicatedRelationships(['lineItems'])
621
                         ->withExcludedRelationshipAttributes('lineItems', [
621
                         ->withExcludedRelationshipAttributes('lineItems', [

Loading…
Cancel
Save