<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

/**
 * @property integer $id_deuda_det
 * @property integer $id_deuda_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 CtDeudaCab $ctDeudaCab
 * @property InItem $inItem
 */
class CtDeudaDet extends Model
{
    /**
     * The table associated with the model.
     * 
     * @var string
     */
    protected $table = 'ct_deuda_det';

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

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

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

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

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