示例#1
0
 function write($fileName)
 {
     $pdf = new CustomReport('P', PDF_UNIT, "LETTER", true, 'UTF-8', false);
     $pdf->setDataSource($this->getDataSource());
     // set document information
     $pdf->SetCreator(PDF_CREATOR);
     // set default monospaced font
     $pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
     //set margins
     $pdf->SetMargins(PDF_MARGIN_LEFT, 40, PDF_MARGIN_RIGHT);
     $pdf->SetHeaderMargin(10);
     $pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
     //set auto page breaks
     $pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
     //set image scale factor
     $pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
     //set some language-dependent strings
     // add a page
     $pdf->AddPage();
     $height = 5;
     $width1 = 15;
     $width2 = 20;
     $width3 = 35;
     $width4 = 75;
     $white = array('LTRB' => array('width' => 0.3, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(255, 255, 255)));
     $black = array('T' => array('width' => 0.3, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0)));
     $pdf->SetFontSize(7);
     $pdf->SetFont('', 'B');
     $pdf->Cell($width1, $height, 'Señores:', 0, 0, 'L', false, '', 0, false, 'T', 'C');
     $pdf->SetFont('', '');
     $pdf->SetFillColor(192, 192, 192, true);
     $pdf->Cell($width4 + $width3 + $width2, $height, $this->getDataSource()->getParameter('desc_proveedor'), $white, 0, 'L', true, '', 0, false, 'T', 'C');
     $pdf->SetFont('', 'B');
     $pdf->Cell(5, $height, '', 0, 0, 'L', false, '', 0, false, 'T', 'C');
     $pdf->Cell($width1, $height, 'Telf.:', 0, 0, 'L', false, '', 0, false, 'T', 'C');
     $pdf->SetFont('', '');
     $pdf->SetFillColor(192, 192, 192, true);
     $pdf->Cell($width2, $height, $this->getDataSource()->getParameter('telefono1'), $white, 0, 'L', true, '', 0, false, 'T', 'C');
     $pdf->Ln();
     $pdf->SetFont('', 'B');
     $pdf->Cell($width1, $height, 'Dirección:', 0, 0, 'L', false, '', 0, false, 'T', 'C');
     $pdf->SetFont('', '');
     $pdf->SetFillColor(192, 192, 192, true);
     $pdf->Cell($width4 + $width3 + $width2, $height, $this->getDataSource()->getParameter('direccion'), $white, 0, 'L', true, '', 0, false, 'T', 'C');
     $pdf->Cell(5, $height, '', 0, 0, 'L', false, '', 0, false, 'T', 'C');
     $pdf->SetFont('', 'B');
     $pdf->Cell($width1, $height, 'Telf. 2:', 0, 0, 'L', false, '', 0, false, 'T', 'C');
     $pdf->SetFont('', '');
     $pdf->SetFillColor(192, 192, 192, true);
     $pdf->Cell($width2, $height, $this->getDataSource()->getParameter('telefono2'), $white, 0, 'L', true, '', 0, false, 'T', 'C');
     $pdf->Ln();
     $pdf->SetFont('', 'B');
     $pdf->Cell($width1, $height, 'Ciudad:', 0, 0, 'L', false, '', 0, false, 'T', 'C');
     $pdf->SetFont('', '');
     $pdf->SetFillColor(192, 192, 192, true);
     $pdf->Cell($width4 + $width3 + $width2, $height, $this->getDataSource()->getParameter('lugar_entrega'), $white, 0, 'L', true, '', 0, false, 'T', 'C');
     $pdf->SetFont('', 'B');
     $pdf->Cell(5, $height, '', 0, 0, 'L', false, '', 0, false, 'T', 'C');
     $pdf->Cell($width1, $height, 'Celular:', 0, 0, 'L', false, '', 0, false, 'T', 'C');
     $pdf->SetFont('', '');
     $pdf->SetFillColor(192, 192, 192, true);
     $pdf->Cell($width2, $height, $this->getDataSource()->getParameter('celular'), $white, 0, 'L', true, '', 0, false, 'T', 'C');
     $pdf->Ln();
     $pdf->SetFont('', 'B');
     $pdf->Cell($width1, $height, 'Email:', 0, 0, 'L', false, '', 0, false, 'T', 'C');
     $pdf->SetFont('', '');
     $pdf->SetFillColor(192, 192, 192, true);
     $pdf->Cell($width4 + $width3 + $width2, $height, $this->getDataSource()->getParameter('email'), $white, 0, 'L', true, '', 0, false, 'T', 'C');
     $pdf->Cell(5, $height, '', 0, 0, 'L', false, '', 0, false, 'T', 'C');
     $pdf->SetFont('', 'B');
     $pdf->Cell($width1, $height, 'Fax:', 0, 0, 'L', false, '', 0, false, 'T', 'C');
     $pdf->SetFont('', '');
     $pdf->SetFillColor(192, 192, 192, true);
     $pdf->Cell($width2, $height, $this->getDataSource()->getParameter('fax'), $white, 0, 'L', true, '', 0, false, 'T', 'C');
     $pdf->Ln();
     $pdf->Ln();
     $pdf->SetFontSize(10);
     $pdf->SetFont('', 'B');
     $tipo = $this->getDataSource()->getParameter('tipo');
     if ($tipo == 'borrador') {
         $pdf->MultiCell(0, $height, 'Agradecemos a Ud.(s) cotizar el siguiente material con IMPUESTOS INCLUIDOS, indicando plazo de entrega y validez de su oferta hasta el ' . $this->getDataSource()->getParameter('fecha_venc'), 1, 'L', false, 1);
     }
     $this->writeDetalles($this->getDataSource()->getParameter('detalleDataSource'), $pdf, $tipo);
     $pdf->SetFontSize(9);
     $pdf->Ln();
     $pdf->SetFont('', 'B');
     $pdf->Cell($width3, $height, 'Fecha de Entrega:', 0, 0, 'L', false, '', 0, false, 'T', 'C');
     $pdf->SetFont('', '');
     $pdf->SetFillColor(192, 192, 192, true);
     $pdf->Cell($width3 + $width2, $height, $this->getDataSource()->getParameter('fecha_entrega'), $white, 0, 'L', true, '', 0, false, 'T', 'C');
     $pdf->Cell(5, $height, '', 0, 0, 'L', false, '', 0, false, 'T', 'C');
     $pdf->SetFont('', 'B');
     $pdf->Cell($width3, $height, 'Moneda:', 0, 0, 'L', false, '', 0, false, 'T', 'C');
     $pdf->SetFont('', '');
     $pdf->SetFillColor(192, 192, 192, true);
     $pdf->Cell($width3 + $width2, $height, $this->getDataSource()->getParameter('moneda'), $white, 0, 'L', true, '', 0, false, 'T', 'C');
     $pdf->Ln();
     $pdf->SetFont('', 'B');
     $pdf->Cell($width3, $height, 'Tipo de Entrega:', 0, 0, 'L', false, '', 0, false, 'T', 'C');
     $pdf->SetFont('', '');
     $pdf->SetFillColor(192, 192, 192, true);
     $pdf->Cell($width3 + $width2, $height, $this->getDataSource()->getParameter('tipo_entrega'), $white, 0, 'L', true, '', 0, false, 'T', 'C');
     $pdf->Cell(5, $height, '', 0, 0, 'L', false, '', 0, false, 'T', 'C');
     $pdf->SetFont('', 'B');
     $pdf->Cell($width3, $height, 'Lugar de Entrega:', 0, 0, 'L', false, '', 0, false, 'T', 'C');
     $pdf->SetFont('', '');
     $pdf->SetFillColor(192, 192, 192, true);
     $pdf->Cell($width3 + $width2, $height, $this->getDataSource()->getParameter('lugar_entrega'), $white, 0, 'L', true, '', 0, false, 'T', 'C');
     $pdf->Ln();
     if ($this->getDataSource()->getParameter('tipo') == 'adjudicado') {
         $pdf->SetFont('', 'B');
         $pdf->Cell($width3, $height, 'Fecha Adjudicacion:', 0, 0, 'L', false, '', 0, false, 'T', 'C');
         $pdf->SetFont('', '');
         $pdf->SetFillColor(192, 192, 192, true);
         $pdf->Cell($width3 + $width2, $height, $this->getDataSource()->getParameter('fecha_adju'), $white, 0, 'L', true, '', 0, false, 'T', 'C');
     }
     $pdf->Output($fileName, 'F');
 }
示例#2
0
<?php

// Copyright SQCRM. For licensing, reuse, modification and distribution see license.txt
/**
* Custom report
* @author Abhik Chakraborty
*/
$do_custom_report = new CustomReport();
$reports = $do_custom_report->get_custom_reports();
if (isset($_GET['ajaxreq']) && $_GET['ajaxreq'] == true) {
    require_once 'view/customreport_view_entry.php';
} elseif (isset($_GET['path']) && isset($_GET['resource'])) {
    $load_report = false;
    $custom_report_path = BASE_PATH . '/modules/Report/CustomReports/';
    if (file_exists($custom_report_path . $_GET['path'] . '/' . $_GET['resource'] . '.php')) {
        if (file_exists($custom_report_path . $_GET['path'] . '/config.json')) {
            $config = file_get_contents($custom_report_path . $_GET['path'] . '/config.json');
            $config_decoded = json_decode($config);
            if ($config_decoded->enabled == 1) {
                $load_report = true;
            }
        }
    }
    if (true === $load_report) {
        include_once 'modules/Report/CustomReports/' . $_GET['path'] . '/' . $_GET['resource'] . '.php';
    } else {
        echo '<div class="alert alert-danger" style="height:100px;margin-top:100px;margin-left:200px;margin-right:200px;">';
        echo '<strong>';
        echo _('Report Does Not Exist ! ');
        echo '</strong>';
        echo _('The report you are trying to access is either disabled or not exists !');
示例#3
0
 function write($fileName)
 {
     $pdf = new CustomReport('P', PDF_UNIT, "LETTER", true, 'UTF-8', false);
     $pdf->setDataSource($this->getDataSource());
     // set document information
     $pdf->SetCreator(PDF_CREATOR);
     // set default monospaced font
     $pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
     //set margins
     $pdf->SetMargins(PDF_MARGIN_LEFT, 40, PDF_MARGIN_RIGHT);
     $pdf->SetHeaderMargin(10);
     $pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
     //set auto page breaks
     $pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
     //set image scale factor
     $pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
     //set some language-dependent strings
     // add a page
     $pdf->AddPage();
     $height = 5;
     $width1 = 15;
     $width2 = 20;
     $width3 = 35;
     $width4 = 75;
     $pdf->SetFontSize(8.5);
     $pdf->SetFont('', 'B');
     $pdf->setTextColor(0, 0, 0);
     $pdf->Cell($width3, $height, 'Número de Solicitud', 0, 0, 'L', false, '', 0, false, 'T', 'C');
     $pdf->Cell($width3, $height, 'Fecha de Solicitud', 0, 0, 'C', false, '', 0, false, 'T', 'C');
     $pdf->Cell($width3, $height, 'Fecha de Aprobacion', 0, 0, 'C', false, '', 0, false, 'T', 'C');
     $pdf->Cell($width2 + 5, $height, 'Tipo', 0, 0, 'C', false, '', 0, false, 'T', 'C');
     $pdf->Cell($width2 + 5, $height, 'Moneda', 0, 0, 'C', false, '', 0, false, 'T', 'C');
     $pdf->Cell($width2 + 5, $height, 'Gestion', 0, 0, 'C', false, '', 0, false, 'T', 'C');
     $pdf->Ln();
     $pdf->SetFont('', '');
     $pdf->Cell($width3, $height, $this->getDataSource()->getParameter('numero'), 0, 0, 'C', false, '', 0, false, 'T', 'C');
     $pdf->Cell($width3, $height, $this->getDataSource()->getParameter('fecha_soli'), 0, 0, 'C', false, '', 0, false, 'T', 'C');
     $pdf->Cell($width3, $height, $this->getDataSource()->getParameter('fecha_apro'), 0, 0, 'C', false, '', 0, false, 'T', 'C');
     $pdf->Cell($width2 + 5, $height, $this->getDataSource()->getParameter('tipo'), 0, 0, 'C', false, '', 0, false, 'T', 'C');
     $pdf->Cell($width2 + 5, $height, $this->getDataSource()->getParameter('desc_moneda'), 0, 0, 'C', false, '', 0, false, 'T', 'C');
     $pdf->Cell($width2 + 5, $height, $this->getDataSource()->getParameter('desc_gestion'), 0, 0, 'C', false, '', 0, false, 'T', 'C');
     $pdf->Ln();
     $pdf->Ln();
     $white = array('LTRB' => array('width' => 0.3, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(255, 255, 255)));
     $black = array('T' => array('width' => 0.3, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0)));
     //$pdf->setLineStyle($white);
     $pdf->SetFontSize(7);
     $pdf->SetFont('', 'B');
     $pdf->Cell($width3, $height, 'Proceso:', 0, 0, 'L', false, '', 0, false, 'T', 'C');
     $pdf->SetFont('', '');
     $pdf->SetFillColor(192, 192, 192, true);
     $pdf->Cell($width3 + $width2, $height, $this->getDataSource()->getParameter('desc_proceso_macro'), $white, 0, 'L', true, '', 0, false, 'T', 'C');
     $pdf->SetFont('', 'B');
     $pdf->Cell(5, $height, '', 0, 0, 'L', false, '', 0, false, 'T', 'C');
     $pdf->Cell($width3, $height, 'Categoria de Compra:', 0, 0, 'L', false, '', 0, false, 'T', 'C');
     $pdf->SetFont('', '');
     $pdf->SetFillColor(192, 192, 192, true);
     $pdf->Cell($width3 + $width2, $height, $this->getDataSource()->getParameter('desc_categoria_compra'), $white, 0, 'L', true, '', 0, false, 'T', 'C');
     $pdf->Ln();
     $pdf->SetFont('', 'B');
     $pdf->Cell($width3, $height, 'Unidad Organizacional:', 0, 0, 'L', false, '', 0, false, 'T', 'C');
     $pdf->SetFont('', '');
     $pdf->SetFillColor(192, 192, 192, true);
     $pdf->Cell($width3 + $width2, $height, $this->getDataSource()->getParameter('desc_uo'), $white, 0, 'L', true, '', 0, false, 'T', 'C');
     $pdf->Cell(5, $height, '', 0, 0, 'L', false, '', 0, false, 'T', 'C');
     $pdf->SetFont('', 'B');
     $pdf->Cell($width3, $height, 'Funcionario:', 0, 0, 'L', false, '', 0, false, 'T', 'C');
     $pdf->SetFont('', '');
     $pdf->SetFillColor(192, 192, 192, true);
     $pdf->Cell($width3 + $width2, $height, $this->getDataSource()->getParameter('desc_funcionario'), $white, 0, 'L', true, '', 0, false, 'T', 'C');
     $pdf->Ln();
     $this->writeDetalles($this->getDataSource()->getParameter('detalleDataSource'), $pdf);
     $pdf->SetFontSize(8);
     $pdf->SetFont('', 'B');
     $pdf->Cell($width3, $height, 'Justificación', 0, 0, 'L', false, '', 1, false, 'T', 'C');
     $pdf->SetFont('', '');
     $pdf->MultiCell($width4 * 2, $height, $this->getDataSource()->getParameter('justificacion'), 0, 'L', false, 0);
     $pdf->Ln();
     $pdf->SetFont('', 'B');
     $pdf->Cell($width3, $height, 'Comité Calificación:', 0, 0, 'L', false, '', 1, false, 'T', 'C');
     $pdf->SetFont('', '');
     $pdf->MultiCell($width4 * 2, $height, $this->getDataSource()->getParameter('comite_calificacion'), 0, 'L', false, 0);
     $pdf->Ln();
     $pdf->SetFont('', 'B');
     $pdf->Cell($width3, $height, 'Posibles Proveedores:', 0, 0, 'L', false, '', 1, false, 'T', 'C');
     $pdf->SetFont('', '');
     $pdf->MultiCell($width4 * 2, $height, $this->getDataSource()->getParameter('posibles_proveedores'), 0, 'L', false, 0);
     $pdf->setTextColor(0, 0, 0);
     $pdf->Ln();
     $pdf->SetFont('', 'B');
     $pdf->Cell($width3, $height, 'Lugar de Entrega:', 0, 0, 'L', false, '', 1, false, 'T', 'C');
     $pdf->SetFont('', '');
     $pdf->Cell($width3 + $width2, $height, $this->getDataSource()->getParameter('lugar_entrega'), 0, 1, 'L', false, '', 0, false, 'T', 'C');
     $pdf->Ln();
     $pdf->Ln();
     $pdf->Cell($width4 - 8, $height, '', 0, 0, 'L', false, '', 0, false, 'T', 'C');
     $pdf->Cell($width3 + $width1, $height, $this->getDataSource()->getParameter('desc_funcionario_apro'), $black, 0, 'C', false, '', 0, false, 'T', 'C');
     $pdf->Cell($width4 - 8, $height, '', 0, 0, 'L', false, '', 0, false, 'T', 'C');
     $pdf->Ln();
     $pdf->Cell($width4 - 8, $height, '', 0, 0, 'L', false, '', 0, false, 'T', 'C');
     $pdf->Cell($width3 + $width1, $height, 'Firma Autorizada', 0, 0, 'C', false, '', 0, false, 'T', 'C');
     $pdf->Cell($width4 - 8, $height, '', 0, 0, 'L', false, '', 0, false, 'T', 'C');
     $pdf->Ln();
     $pdf->Output($fileName, 'F');
 }