<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;
use App\Models\SellLines;
use App\User;
use App\Models\Tax;
class Transaction extends Model
{
    protected $table = 'transaction';
    protected $fillable = ['supplied_by','transaction_date','type','customer_id','supplier_name','ledger','ledger_value','voucher_no','driver_name','vehicle_number','expense_category_id','created_by','payment_mode','amount','description','tax_invoice_no','transaction_time','print_status','vendor_id'];
    function saleData(){
        return $this->hasOne(SellLines::class,'transaction_id','id');
    }
    
     function tax(){
        return $this->hasOne(Tax::class,'customer_id','customer_id')->orderBy('invoice_no', 'asc');
    }
}
