Documentation

Bill extends Model
in package
uses HasFactory, SoftDeletes

Class Bill

Represents the Bill model.

Table of Contents

Properties

$additional  : string|null
$appends  : mixed
$bill_amount  : float
$bill_period  : string
$bill_token  : string
$bill_type  : string
$billable_id  : int
$billable_type  : string
$discount  : float
$due_date  : string
$faktur_pajak  : string|null
$is_delete_enabled  : bool
$is_ppn  : bool
$keterangan  : string
$latest_payment_id  : int|null
$ppn_amount  : float
$qty  : int
$status  : string
$transaction_time  : string
$transaction_type  : string
$user_id  : int
$casts  : mixed
$fillable  : mixed
$table  : mixed
$with  : mixed

Methods

addAdditional()  : void
Add additional cost to the bill's custom bill.
addRestitution()  : void
Add restitution to the bill's custom bill.
customBill()  : HasOne
Get the custom bill associated with the bill.
customer()  : MorphTo
Get the customer associated with the bill.
getAmountBeforeTaxAttribute()  : float
Get the amount before tax for the bill.
getAmountBeforeTaxFormattedAttribute()  : string
Get the formatted amount before tax for the bill.
getBillAmountFormattedAttribute()  : string
Get the formatted bill amount.
getBillPeriodFormatted2Attribute()  : string
Get the formatted bill period (F Y).
getBillPeriodFormattedAttribute()  : string
Get the formatted bill period (m-Y).
getCreatedAtFormattedAttribute()  : string
Get the formatted creation date.
getDueDateFormattedAttribute()  : string|null
Get the formatted due date.
getNoEstatementAttribute()  : string
Get the e-statement number for the bill.
getPpnAmountFormattedAttribute()  : string
Get the formatted PPN amount for the bill.
getTotalAmountAttribute()  : float
Get the total amount for the bill, considering custom bills.
getTotalAmountFormattedAttribute()  : string
Get the formatted total amount.
getTransactionTimeFormattedAttribute()  : string|null
Get the formatted transaction time.
latestPayment()  : BelongsTo
Get the latest payment associated with the bill.
payments()  : BelongsToMany
Get all payments associated with the bill.
receipt()  : HasOne
Get the payment receipt associated with the bill.
user()  : BelongsTo
Get the user associated with the bill.

Properties

$additional

public string|null $additional

Additional information about the bill.

$appends

public mixed $appends = ['bill_amount_formatted', 'transaction_time_formatted', 'bill_period_formatted', 'bill_period_formatted2', 'due_date_formatted', 'created_at_formatted', 'total_amount', 'total_amount_formatted', 'no_estatement', 'amount_before_tax', 'amount_before_tax_formatted', 'ppn_amount_formatted']

$bill_amount

public float $bill_amount

The total amount of the bill.

$bill_period

public string $bill_period

The billing period.

$bill_token

public string $bill_token

The token for the bill.

$bill_type

public string $bill_type

The type of the bill.

$billable_id

public int $billable_id

The ID of the billable entity.

$billable_type

public string $billable_type

The type of the billable entity.

$discount

public float $discount

The discount applied to the bill.

$due_date

public string $due_date

The due date of the bill.

$faktur_pajak

public string|null $faktur_pajak

The tax invoice for the bill.

$is_delete_enabled

public bool $is_delete_enabled

Whether deletion is enabled for the bill.

$is_ppn

public bool $is_ppn

Whether the bill includes PPN.

$keterangan

public string $keterangan

The description of the bill.

$latest_payment_id

public int|null $latest_payment_id

The ID of the latest payment.

$ppn_amount

public float $ppn_amount

The amount of PPN.

$qty

public int $qty

The quantity of items in the bill.

$status

public string $status

The status of the bill.

$transaction_time

public string $transaction_time

The time of the transaction.

$transaction_type

public string $transaction_type

The type of transaction.

$user_id

public int $user_id

The ID of the user associated with the bill.

$casts

protected mixed $casts = ['transaction_time' => 'datetime', 'bill_period' => 'datetime', 'due_date' => 'datetime', 'is_delete_enabled' => 'boolean']

$fillable

protected mixed $fillable = ['keterangan', 'status', 'transaction_time', 'bill_period', 'qty', 'bill_amount', 'discount', 'transaction_type', 'additional', 'user_id', 'bill_token', 'latest_payment_id', 'billable_id', 'billable_type', 'bill_type', 'due_date', 'is_delete_enabled', 'is_ppn', 'ppn_amount', 'faktur_pajak']

$table

protected mixed $table = 'bill'

$with

protected mixed $with = ['customBill']

Methods

addAdditional()

Add additional cost to the bill's custom bill.

public addAdditional(int $mount[, string $note = '' ]) : void
Parameters
$mount : int

The additional cost amount.

$note : string = ''

Optional note for the additional cost.

addRestitution()

Add restitution to the bill's custom bill.

public addRestitution(int $mount[, string $note = '' ]) : void
Parameters
$mount : int

The restitution amount.

$note : string = ''

Optional note for the restitution.

customBill()

Get the custom bill associated with the bill.

public customBill() : HasOne
Return values
HasOne

customer()

Get the customer associated with the bill.

public customer() : MorphTo
Return values
MorphTo

getAmountBeforeTaxAttribute()

Get the amount before tax for the bill.

public getAmountBeforeTaxAttribute() : float
Return values
float

getAmountBeforeTaxFormattedAttribute()

Get the formatted amount before tax for the bill.

public getAmountBeforeTaxFormattedAttribute() : string
Return values
string

getBillAmountFormattedAttribute()

Get the formatted bill amount.

public getBillAmountFormattedAttribute() : string
Return values
string

getBillPeriodFormatted2Attribute()

Get the formatted bill period (F Y).

public getBillPeriodFormatted2Attribute() : string
Return values
string

getBillPeriodFormattedAttribute()

Get the formatted bill period (m-Y).

public getBillPeriodFormattedAttribute() : string
Return values
string

getCreatedAtFormattedAttribute()

Get the formatted creation date.

public getCreatedAtFormattedAttribute() : string
Return values
string

getDueDateFormattedAttribute()

Get the formatted due date.

public getDueDateFormattedAttribute() : string|null
Return values
string|null

getNoEstatementAttribute()

Get the e-statement number for the bill.

public getNoEstatementAttribute() : string
Return values
string

getPpnAmountFormattedAttribute()

Get the formatted PPN amount for the bill.

public getPpnAmountFormattedAttribute() : string
Return values
string

getTotalAmountAttribute()

Get the total amount for the bill, considering custom bills.

public getTotalAmountAttribute() : float
Return values
float

getTotalAmountFormattedAttribute()

Get the formatted total amount.

public getTotalAmountFormattedAttribute() : string
Return values
string

getTransactionTimeFormattedAttribute()

Get the formatted transaction time.

public getTransactionTimeFormattedAttribute() : string|null
Return values
string|null

latestPayment()

Get the latest payment associated with the bill.

public latestPayment() : BelongsTo
Return values
BelongsTo

payments()

Get all payments associated with the bill.

public payments() : BelongsToMany
Return values
BelongsToMany

receipt()

Get the payment receipt associated with the bill.

public receipt() : HasOne
Return values
HasOne

user()

Get the user associated with the bill.

public user() : BelongsTo
Return values
BelongsTo

        
On this page

Search results