<?php

namespace App\Danoral\Cobranzas\Cobros;

use App\Danoral\ModelBase;
use App\Danoral\Cobranzas\Cobros\Cobro;
use App\Danoral\Bancos\sysOLD\Banco;

class CobroFormaPago extends ModelBase
{
    protected $tableName = 'cobros_forma_pago';
    protected $primaryKey = 'idCFP';
    public $incrementing = true;
    public $timestamps = false;

    protected $fillable = [
        'idCobro',
        'dateCFP',
        'typeCFP',
        'montoCFP',
        'idMoneda',
        'refCFP',
        'idDT',
        'bancoCFP',
        'bancoOrigenCFP',
        'idIngreso',
        'idPlanilla',
        'infoCFP',
    ];

    public $dateCFP_time;
    public $tDT_CFP = [];

    function __construct() {
        $this->table = parent::$SCHEMA .'.'. $this->tableName;
    }

    public function Cobro(){
        return $this->belongsToMany(Cobro::class);
    }
    public function Banco(){
        return $this->hasOne(Banco::class, 'cod_Cuenta', 'bancoCFP');
    }
    public function BancoR(){
        return $this->hasOne(Banco::class, 'bancoCFP', 'cod_Cuenta');
    }


}
