'array', 'issued_on' => 'date', 'due_on' => 'date', 'sent_at' => 'datetime', 'net_cents' => 'integer', 'tax_cents' => 'integer', 'gross_cents' => 'integer', ]; } public function series(): BelongsTo { return $this->belongsTo(InvoiceSeries::class, 'invoice_series_id'); } public function customer(): BelongsTo { return $this->belongsTo(Customer::class); } public function order(): BelongsTo { return $this->belongsTo(Order::class); } /** * The contract this document billed a term of. * * Set on a renewal, which has no order behind it — nobody buys a month * rolling over. Null on a purchase, where `order` is what it is for. */ public function subscription(): BelongsTo { return $this->belongsTo(Subscription::class); } /** Where this document has been copied to, and where it has not. */ public function exports(): HasMany { return $this->hasMany(InvoiceExport::class); } /** What this document cancels, if it is a cancellation. */ public function cancels(): BelongsTo { return $this->belongsTo(Invoice::class, 'cancels_invoice_id'); } }