<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

/**
 * @property integer $id_factura_det
 * @property integer $id_factura_cab
 * @property int $id_item
 * @property float $porc_descuento
 * @property float $porc_iva
 * @property float $subtotal
 * @property float $descuento
 * @property float $iva
 * @property float $total
 * @property string $created_at
 * @property string $updated_at
 * @property CtFacturaCab $ctFacturaCab
 * @property InItem $inItem
 */
class CtFacturaDet extends Model
{
    /**
     * The table associated with the model.
     * 
     * @var string
     */
    protected $table = 'ct_factura_det';

    /**
     * The primary key for the model.
     * 
     * @var string
     */
    protected $primaryKey = 'id_factura_det';

    /**
     * The "type" of the auto-incrementing ID.
     * 
     * @var string
     */
    protected $keyType = 'integer';

    /**
     * @var array
     */
    protected $fillable = ['id_factura_cab', 'id_item', 'porc_descuento', 'porc_iva', 'subtotal', 'descuento', 'iva', 'total', 'created_at', 'updated_at'];

    /**
     * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
     */
    public function ctFacturaCab()
    {
        return $this->belongsTo('App\CtFacturaCab', 'id_factura_cab', 'id_factura_cab');
    }

    /**
     * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
     */
    public function inItem()
    {
        return $this->belongsTo('App\InItem', 'id_item', 'id_item');
    }
}
