File tree Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Expand file tree Collapse file tree 2 files changed +4
-3
lines changed Original file line number Diff line number Diff line change 3030 * @property string $description
3131 * @property ?ArrayObject $seller_information
3232 * @property ?ArrayObject $buyer_information
33- * @property ? InvoiceState $state
33+ * @property InvoiceState $state
3434 * @property ?Carbon $state_set_at
3535 * @property ?Carbon $due_at
3636 * @property ?string $tax_type
@@ -61,6 +61,7 @@ class Invoice extends Model implements Attachable
6161
6262 protected $ attributes = [
6363 'type ' => InvoiceType::Invoice,
64+ 'state ' => InvoiceState::Draft,
6465 ];
6566
6667 protected $ guarded = [];
@@ -363,8 +364,8 @@ public function toPdfInvoice(): PdfInvoice
363364 {
364365 return new PdfInvoice (
365366 name: $ this ->type ->trans (),
367+ state: $ this ->state ->trans (),
366368 serial_number: $ this ->serial_number ,
367- state: $ this ->state ?->trans(),
368369 paid_at: ($ this ->state === InvoiceState::Paid) ? $ this ->state_set_at : null ,
369370 due_at: $ this ->due_at ,
370371 created_at: $ this ->created_at ,
Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ class PdfInvoice
1919 */
2020 public function __construct (
2121 public ?string $ name = null ,
22- public string $ state = InvoiceState::Draft-> value ,
22+ public ? string $ state = null ,
2323 public ?string $ serial_number = null ,
2424 public ?array $ buyer = null ,
2525 public ?Carbon $ due_at = null ,
You can’t perform that action at this time.
0 commit comments