protected function GuardarPago(array $data) { return CobrosModel::create(['cuentaxcobrar_id' => $data['cuentaxcobrar_id'], 'abono' => $data['abono'], 'detalle' => $data['detalle'], 'fecha_cobro' => $data['fecha_cobro']]); }
function RegistroPagos($tipo, $idcuenta) { if ($tipo = "ctaxcobrar") { $lista = CobrosModel::where('cuentaxcobrar_id', '=', $idcuenta)->get(); } else { $lista = PagosModel::where('cuentaxpagar_id', '=', $idcuenta)->get(); } return $lista; }