static function makeRemesa($parametros, $filtro) { self::$parametros = $parametros; $ordenante = new PcaeEmpresas($_SESSION['emp']); if (self::$parametros['agrupar']) { $recibos = self::RecibosAgrupados($filtro); } else { $recibos = self::RecibosIndividuales($filtro); } $fecha = new Fecha($parametros['fechaCobro']); $fechaCargo = $fecha->getaaaammdd(); self::$idRemesa = $ordenante->getCif() . date('Y-m-d') . "T" . date('H:i:s'); $arrayRemesa = array('header' => array('id' => self::$idRemesa, 'fecha' => date('Y-m-d') . "T" . date('H:i:s'), 'fechaCargo' => $fechaCargo, 'nRecibos' => $recibos['nRecibos'], 'total' => number_format($recibos['importeTotal'], 2, ".", ""), 'razonSocial' => $ordenante->getRazonSocial(), 'direccion1' => $ordenante->getDireccion(), 'direccion2' => $ordenante->getCodigoPostal() . " " . $ordenante->getIdMunicipio()->getMunicipio() . " " . $ordenante->getIdProvincia()->getProvincia(), 'cif' => $ordenante->getCif(), 'sufijo' => $ordenante->getSufijoRemesas(), 'identificadorPresentador' => "ES" . self::digitoControlPresentador($ordenante->getCif() . "ES00") . $ordenante->getSufijoRemesas() . $ordenante->getCif(), 'iban' => $ordenante->getIban(), 'bic' => $ordenante->getBic()), 'recibos' => $recibos['recibos']); self::escribeLog($arrayRemesa); return SepaXml19::makeDocument("docs/docs{$_SESSION['emp']}/remesas/" . self::$idRemesa . ".xml", $arrayRemesa); }
function Header() { $empresa = new PcaeEmpresas($_SESSION['emp']); $sucursal = new Sucursales($_SESSION['suc']); $logo = $empresa->getLogo(); if (file_exists($logo)) { $this->Image($empresa->getLogo(), 10, 8, 23); } $this->SetFont('Arial', 'B', 12); $this->Cell(0, 5, $empresa->getRazonSocial(), 0, 1, "R"); $this->SetFont('Arial', '', 8); $this->Cell(0, 5, $sucursal->getNombre(), 0, 1, "R"); $this->SetFont('Arial', 'B', 11); $this->Cell(0, 5, $this->opciones['title'], 0, 1, "C"); $this->Ln(5); $this->SetFont('Courier', 'B', 8); //PINTAR LOS TITULOS DE LAS COLUMNAS $this->Cell(10, 4, "Hora", 0, 0, "C"); $this->Cell(100, 4, "Cliente", 0, 0, "C"); $this->Cell(20, 4, "Poblacion", 0, 0, "C"); $this->Cell(45, 4, "Telefonos", 0, 0, "C"); $this->Cell(10, 4, "Riesgo", 0, 0, "C"); $this->Cell(0, 4, "Comentarios", 0, 0, "C"); $this->Ln(); }
function Header() { $empresa = new PcaeEmpresas($_SESSION['emp']); $sucursal = new Sucursales($_SESSION['suc']); $this->Image($empresa->getLogo(), 10, 8, 23); $this->SetFont('Arial', 'B', 12); $this->Cell(0, 5, $empresa->getRazonSocial(), 0, 1, "R"); $this->SetFont('Arial', '', 8); $this->Cell(0, 5, $sucursal->getNombre(), 0, 1, "R"); $this->SetFont('Arial', 'B', 12); $this->Cell(0, 5, $this->opciones['title'], 0, 1, "C"); // Pintar la leyenda del filtro en la primera pagina if ($this->page == 1) { $this->Ln(5); $this->SetFont('Arial', '', '8'); foreach ($this->opciones['leyendaFiltro'] as $filtro) { $this->Cell(25, 4, $filtro['Column'], 0, 0); $this->Cell(0, 4, $filtro['Value'], 0, 1); } } // Para los títulos pongo el mismo font que para el cuerpo del listado $this->Ln(5); $this->SetFont($this->opciones['titleFont'][0], $this->opciones['titleFont'][1], $this->opciones['titleFont'][2]); //PINTAR LOS TITULOS DE LAS COLUMNAS foreach ($this->opciones['columns'] as $value) { $caracteres = (int) $value['length']; $texto = trim((string) $value['title']); $ancho = $this->getStringWidth(str_pad(" ", $caracteres)) + 1; $this->Cell($ancho, 4, $this->DecodificaTexto($texto, $caracteres), 0, 0, "C", 1); } $this->Ln(); //$this->Line($this->GetX(), $this->GetY(), $this->GetX() + 190, $this->GetY()); }
/** * Devuelve un array anidado con las empresa, proyectos * y aplicaciones a los que tiene acceso el usuario en curso. * * @return array */ public function getArrayAccesos() { $accesos = array(); $permisos = new PcaePermisos(); $rows = $permisos->cargaCondicion("IdEmpresa,IdProyecto,IdApp", "IdUsuario='{$this->Id}'", "IdEmpresa,IdProyecto,IdApp ASC"); unset($permisos); $empAnt = ''; $proAnt = ''; foreach ($rows as $row) { if ($empAnt != $row['IdEmpresa']) { $empresa = new PcaeEmpresas($row['IdEmpresa']); $accesos['empresas'][$row['IdEmpresa']] = array('empresa' => $empresa->getRazonSocial(), 'perfil' => $this->getPerfilEmpresa($row['IdEmpresa'])->getPerfil()); unset($empresa); } if ($proAnt != $row['IdProyecto']) { $proyecto = new PcaeProyectos($row['IdProyecto']); $accesos['empresas'][$row['IdEmpresa']]['proyectos'][$row['IdProyecto']] = array('proyecto' => $proyecto->getProyecto()); unset($proyecto); } $app = new PcaeApps($row['IdApp']); $proyectoApp = new PcaeProyectosApps(); $keyProyectoApp = $proyectoApp->cargaCondicion("PrimaryKeyMD5", "IdProyecto='{$row['IdProyecto']}' AND IdApp='{$row['IdApp']}'"); $accesos['empresas'][$row['IdEmpresa']]['proyectos'][$row['IdProyecto']]['apps'][$row['IdApp']] = array('aplicacion' => $app->getAplicacion(), 'url' => $app->getUrl(), 'IdProyectoApp' => $keyProyectoApp[0]['PrimaryKeyMD5']); unset($app); unset($proyectoApp); $proAnt = $row['IdProyecto']; $empAnt = $row['IdEmpresa']; } return $accesos; }
function Header() { $empresa = new PcaeEmpresas($_SESSION['emp']); $sucursal = new Sucursales($_SESSION['suc']); $this->Image($empresa->getLogo(), 10, 8, 23); $this->SetFont('Arial', 'B', 12); $this->Cell(0, 5, $empresa->getRazonSocial(), 0, 1, "R"); $this->SetFont('Arial', '', 8); $this->Cell(0, 5, $sucursal->getNombre(), 0, 1, "R"); $this->SetFont('Arial', 'B', 12); $this->Cell(0, 5, "ORDEN DE REPARTO " . $this->opciones['almacen'] . " " . $this->opciones['dia'] . " Ruta: " . $this->opciones['ruta'], 0, 1, "C"); $this->SetFont('Arial', 'B', 9); $this->Cell(15, 4, "Orden", 1, 0, "C"); $this->Cell(15, 4, "Hora", 1, 0, "C"); $this->Cell(150, 4, "Cliente / Direccion", 1, 0, "C"); $this->Cell(50, 4, "Comercial", 1, 0, "C"); $this->Cell(50, 4, "Observaciones", 1, 0, "C"); $this->Ln(); $this->SetFont('Arial', '', 8); }