|
id
|
bigint(20) unsigned
|
|
|
|
|
invoice_number
|
varchar(100)
|
|
|
|
|
customer_id
|
bigint(20) unsigned
|
|
|
|
|
customer_name
|
varchar(190)
|
|
|
|
|
customer_phone
|
varchar(60)
|
|
|
|
|
customer_address
|
varchar(255)
|
|
|
|
|
quotation_id
|
bigint(20) unsigned
|
|
|
|
|
status
|
enum
|
-- |
|
draft
|
|
order_source
|
varchar(40)
|
|
|
|
|
invoice_date
|
date
|
|
|
|
|
warehouse_id
|
bigint(20) unsigned
|
|
|
|
|
vat_enabled
|
tinyint(1)
|
|
|
1
|
|
vat_rate
|
decimal(5,2)
|
|
|
15.00
|
|
subtotal
|
decimal(15,2)
|
|
|
0.00
|
|
discount_amount
|
decimal(15,2)
|
|
|
0.00
|
|
tax_amount
|
decimal(15,2)
|
|
|
0.00
|
|
total_amount
|
decimal(15,2)
|
|
|
0.00
|
|
paid_amount
|
decimal(15,2)
|
|
|
0.00
|
|
due_amount
|
decimal(15,2)
|
|
|
0.00
|
|
currency
|
varchar(10)
|
|
|
SAR
|
|
notes
|
text
|
|
|
|
|
template_code
|
varchar(100)
|
|
|
|
|
created_by
|
bigint(20) unsigned
|
|
|
|
|
approved_by
|
bigint(20) unsigned
|
|
|
|
|
approved_at
|
timestamp
|
|
|
|
|
created_at
|
timestamp
|
|
|
current_timestamp()
|
|
updated_at
|
timestamp
|
|
|
current_timestamp()
|
|
payment_method
|
varchar(50)
|
|
|
|
|
payment_fee_profile
|
varchar(60)
|
|
|
|
|
gateway_rate
|
decimal(8,4)
|
|
|
0.0000
|
|
gateway_fee
|
decimal(12,2)
|
|
|
0.00
|
|
checkout_fee
|
decimal(12,2)
|
|
|
0.00
|
|
payment_fees_vat
|
decimal(12,2)
|
|
|
0.00
|
|
payment_fees_total
|
decimal(12,2)
|
|
|
0.00
|
|
payment_gateway_profile
|
varchar(50)
|
|
|
|
|
customer_shipping_fee
|
decimal(12,2)
|
|
|
0.00
|
|
merchant_shipping_cost
|
decimal(12,2)
|
|
|
0.00
|
|
cod_fee
|
decimal(12,2)
|
|
|
0.00
|
|
cod_fee_vat
|
decimal(12,2)
|
|
|
0.00
|
|
shipping_profit_loss
|
decimal(12,2)
|
|
|
0.00
|
|
cogs_total
|
decimal(12,2)
|
|
|
0.00
|
|
net_payout_before_cogs
|
decimal(12,2)
|
|
|
0.00
|
|
net_profit
|
decimal(12,2)
|
|
|
0.00
|
|
gateway_fee_rate
|
decimal(8,4)
|
|
|
0.0000
|
|
gateway_fee_amount
|
decimal(12,2)
|
|
|
0.00
|
|
checkout_fee_amount
|
decimal(12,2)
|
|
|
0.00
|
|
fees_vat_amount
|
decimal(12,2)
|
|
|
0.00
|
|
payment_fee_amount
|
decimal(12,2)
|
|
|
0.00
|
|
net_amount_before_cost
|
decimal(12,2)
|
|
|
0.00
|
|
cost_of_goods_amount
|
decimal(12,2)
|
|
|
0.00
|
|
net_profit_amount
|
decimal(12,2)
|
|
|
0.00
|
|
sold_at
|
datetime
|
|
|
|