<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Factories\HasFactory;

class Transaction extends Model
{
    use HasFactory;

    protected $fillable = [
        'trade_document_id',
        'business_id',
        'quote_id',
        'sale_order_id',
        'invoice_id',
        'purchase_order_id',
        'proposal_id',
        'owner_id',
        'employee_id',
        'contact_id',
        'account_id',
        'deal_id',
        'parent_quote_id',
        'parent_sale_order_id',
        'parent_purchase_order_id',
        'parent_proposal_id',
        'vendor_id',
        'sale_commission',
        'title',
        'transaction_date',
        'due_date',
        'currency_id',
        'exchange_rate',
        'address_1',
        'address_2',
        'city',
        'state',
        'code',
        'country',
        'shipping_address_same_status',
        'shipping_address_1',
        'shipping_address_2',
        'shipping_city',
        'shipping_state',
        'shipping_code',
        'shipping_country',
        'subtotal',
        'discount',
        'tax',
        'grand_total',
        'terms',
        'notes',
        'billing_frequency_id',
        'payment_method_id',
        'shipping_id',
        'quote_status_id',
        'status_id',
        'contact_methods_id',
    ];
    public function tradeDocument() { return $this->belongsTo(TradeDocument::class); }
}
