$pdf->SetTextColor(0, 0, 0);
while ($row = pg_fetch_row($sql)) {
    $temp_1 = number_format($row[3], 2, ',', '.');
    $pdf->Text(5, $yy, maxCaracter(utf8_decode($row[0]), 3), 0, 1, 'L', 0);
    $array = ceil_caracter($row[1], 35);
    if (sizeof($array) > 1) {
        $zz = $yy;
        for ($i = 0; $i < sizeof($array); $i++) {
            $pdf->Text(20, $zz, utf8_decode($array[$i]), 0, 0, 'J', 0);
            $zz = $zz + 3;
        }
        $yy = $yy + 4;
    } else {
        $pdf->Text(20, $yy, maxCaracter(utf8_decode($row[1]), 30), 0, 0, 'L', 0);
    }
    $pdf->Text(150, $yy, maxCaracter(utf8_decode($row[2]), 6), 0, 0, 'L', 0);
    $pdf->Text(180, $yy, maxCaracter($temp_1, 6), 0, 0, 'L', 0);
    $yy = $yy + 4;
}
/////////pie
$subtotal = truncateFloat($iva12, 2);
$descuento_venta = truncateFloat($descuento_venta, 2);
$iva_venta = truncateFloat($iva_venta, 2);
$iva0 = truncateFloat($iva0, 2);
$total_venta = truncateFloat($total_venta, 2);
$pdf->Text(180, 177, maxCaracter($subtotal, 5), 0, 1, 'L', 0);
$pdf->Text(180, 182, maxCaracter($iva0, 5), 0, 1, 'L', 0);
$pdf->Text(180, 187, maxCaracter($iva_venta, 5), 0, 1, 'L', 0);
//    $pdf->Text(180, 192, maxCaracter($descuento_venta,5),0,1, 'L',0);
$pdf->Text(180, 192, maxCaracter($total_venta, 10), 0, 1, 'L', 0);
$pdf->Output();
示例#2
0
    $pdf->Ln(5);
}
$pdf->SetX(1);
$pdf->Ln(5);
$sql = pg_query("select factura_compra.descuento_compra,factura_compra.tarifa0,factura_compra.tarifa12,factura_compra.iva_compra,factura_compra.total_compra from factura_compra,detalle_factura_compra,productos where factura_compra.id_factura_compra=detalle_factura_compra.id_factura_compra and detalle_factura_compra.cod_productos=productos.cod_productos and detalle_factura_compra.id_factura_compra='{$_GET['id']}' LIMIT 1");
while ($row = pg_fetch_row($sql)) {
    $pdf->Cell(173, 6, utf8_decode("Descuento"), 0, 0, 'R', 0);
    $pdf->Cell(35, 6, maxCaracter(truncateFloat($row[0], 2), 20), 0, 1, 'C', 0);
    $pdf->Cell(173, 6, utf8_decode("Tarifa 0"), 0, 0, 'R', 0);
    $pdf->Cell(35, 6, maxCaracter(truncateFloat($row[1], 2), 20), 0, 1, 'C', 0);
    $pdf->Cell(173, 6, utf8_decode("Tarifa 12"), 0, 0, 'R', 0);
    $pdf->Cell(35, 6, maxCaracter(truncateFloat($row[2], 2), 20), 0, 1, 'C', 0);
    $pdf->Cell(173, 6, utf8_decode("Iva 12%"), 0, 0, 'R', 0);
    $pdf->Cell(35, 6, maxCaracter(truncateFloat($row[3], 2), 20), 0, 1, 'C', 0);
    $pdf->Cell(173, 6, utf8_decode("Total"), 0, 0, 'R', 0);
    $pdf->Cell(35, 6, maxCaracter(truncateFloat($row[4], 2), 20), 0, 1, 'C', 0);
}
//////////
$sql = pg_query("select * from series_compra,factura_compra,productos where factura_compra.id_factura_compra=series_compra.id_factura_compra and productos.cod_productos=series_compra.cod_productos and series_compra.id_factura_compra='{$_GET['id']}'");
if (pg_num_rows($sql)) {
    $pdf->AddPage();
    $pdf->Cell(205, 7, utf8_decode("NÚMEROS DE SERIE"), 0, 1, 'C', 0);
    $pdf->Cell(50, 5, utf8_decode("Cod. Producto"), 1, 0, 'C', 0);
    $pdf->Cell(95, 5, utf8_decode("Descripción"), 1, 0, 'C', 0);
    $pdf->Cell(30, 5, utf8_decode("Nro. Serie"), 1, 0, 'C', 0);
    $pdf->Cell(30, 5, utf8_decode("Nro. Factura"), 1, 1, 'C', 0);
    while ($row = pg_fetch_row($sql)) {
        $pdf->Cell(50, 6, maxCaracter(utf8_decode($row[28]), 20), 0, 0, 'C', 0);
        $pdf->Cell(95, 6, maxCaracter(utf8_decode($row[30]), 60), 0, 0, 'C', 0);
        $pdf->Cell(30, 6, maxCaracter(utf8_decode($row[3]), 20), 0, 0, 'C', 0);
        $pdf->Cell(30, 6, maxCaracter(utf8_decode($row[17]), 20), 0, 1, 'C', 0);
        $pdf->SetX(1);
        $pdf->Cell(205, 0, utf8_decode(""), 1, 1, 'R', 0);
        $pdf->Cell(126, 6, utf8_decode("Totales"), 0, 0, 'R', 0);
        $pdf->Cell(20, 6, maxCaracter(number_format($cant, 2, ',', '.'), 20), 0, 0, 'C', 0);
        $pdf->Cell(20, 6, maxCaracter(number_format($valor_uni, 2, ',', '.'), 20), 0, 0, 'C', 0);
        $pdf->Cell(20, 6, maxCaracter(number_format($valor_tot, 2, ',', '.'), 20), 0, 0, 'C', 0);
        $pdf->Cell(20, 6, maxCaracter(number_format($desc_tot, 2, ',', '.'), 20), 0, 1, 'C', 0);
        $pdf->Ln(3);
    }
}
$pdf->SetX(1);
$pdf->Ln(5);
$pdf->Cell(207, 0, utf8_decode(""), 1, 1, 'R', 0);
$pdf->Cell(207, 6, utf8_decode("RESUMEN DE PEDIDOS"), 0, 1, 'R', 0);
$pdf->Cell(127, 6, utf8_decode("TOTAL EN PEDIDOS DE EMPRESARIAS"), 0, 0, 'R', 0);
$pdf->Cell(40, 6, utf8_decode("YA DESC. SU 30%"), 1, 0, 'C', 0);
$pdf->Cell(40, 6, number_format($total_final, 2, ',', '.'), 1, 1, 'C', 0);
$pdf->Cell(127, 6, utf8_decode("DESCUENTO LIDER"), 0, 0, 'R', 0);
$pdf->Cell(40, 6, utf8_decode("10%"), 1, 0, 'C', 0);
$pdf->Cell(40, 6, truncateFloat(utf8_decode($total_final * 0.1), 2), 1, 1, 'C', 0);
$pdf->Cell(127, 6, utf8_decode("SUBTOTAL"), 0, 0, 'R', 0);
$pdf->Cell(40, 6, utf8_decode(""), 1, 0, 'C', 0);
$pdf->Cell(40, 6, truncateFloat($total_final - $total_final * 0.1, 2), 1, 1, 'C', 0);
$pdf->Cell(127, 6, utf8_decode("COST0 ENVIO"), 0, 0, 'R', 0);
$pdf->Cell(40, 6, utf8_decode(""), 1, 0, 'C', 0);
$pdf->Cell(40, 6, utf8_decode(""), 1, 1, 'C', 0);
$pdf->Cell(127, 6, utf8_decode("TOTAL A DEPOSITAR"), 0, 0, 'R', 0);
$pdf->Cell(40, 6, '', 1, 0, 'C', 0);
$pdf->Cell(40, 6, truncateFloat($total_final - $total_final * 0.1, 2), 1, 1, 'C', 0);
$pdf->Ln(3);
$pdf->Output();
示例#4
0
    $pdf->Cell(65, 6, maxCaracter(utf8_decode($row[11]), 30), 0, 0, 'L', 0);
    $pdf->Cell(25, 6, utf8_decode($row[3]), 0, 0, 'C', 0);
    $pdf->Cell(25, 6, utf8_decode($row[4]), 0, 0, 'C', 0);
    $pdf->Cell(25, 6, utf8_decode($row[5]), 0, 0, 'C', 0);
    $pdf->Cell(25, 6, utf8_decode($row[6]), 0, 1, 'C', 0);
}
$iva_base = 1.12;
$sql = pg_query("select * from detalle_proforma,productos where id_proforma='{$_GET['id']}' and productos.incluye_iva = 'Si'  and detalle_proforma.cod_productos=productos.cod_productos order by id_detalle_proforma asc;");
while ($row = pg_fetch_row($sql)) {
    $pdf->SetX(1);
    $total_si = 0;
    $total_sit = 0;
    $total_si = $row[6] / $iva_base;
    $total_sit = $total_si / $row[3];
    $total_si = truncateFloat($total_si, 2);
    $total_sit = truncateFloat($total_sit, 2);
    $pdf->Cell(40, 6, maxCaracter(utf8_decode($row[9]), 15), 0, 0, 'L', 0);
    $pdf->Cell(65, 6, maxCaracter(utf8_decode($row[11]), 30), 0, 0, 'L', 0);
    $pdf->Cell(25, 6, utf8_decode($row[3]), 0, 0, 'C', 0);
    $pdf->Cell(25, 6, utf8_decode($total_sit), 0, 0, 'C', 0);
    $pdf->Cell(25, 6, utf8_decode($row[5]), 0, 0, 'C', 0);
    $pdf->Cell(25, 6, utf8_decode($total_si), 0, 1, 'C', 0);
}
$pdf->SetX(1);
$pdf->Ln(5);
$pdf->Cell(207, 0, utf8_decode(""), 1, 1, 'R', 0);
$pdf->Cell(181, 6, utf8_decode("Tarifa 0%"), 0, 0, 'R', 0);
$pdf->Cell(25, 6, maxCaracter(number_format($temp1, 2, ',', '.'), 20), 0, 1, 'C', 0);
$pdf->SetX(1);
$pdf->Cell(181, 6, utf8_decode("Tarifa 12%"), 0, 0, 'R', 0);
$pdf->Cell(25, 6, maxCaracter(number_format($temp2, 2, ',', '.'), 20), 0, 1, 'C', 0);
示例#5
0
    $total_si = $row[6] / $iva_base;
    $total_sit = $total_si / $row[3];
    $total_si = truncateFloat($total_si, 2);
    $total_sit = truncateFloat($total_sit, 2);
    $pdf->Cell(40, 5, maxCaracter(utf8_decode($row[9]), 20), 0, 0, 'L', 0);
    $pdf->Cell(80, 5, maxCaracter(utf8_decode($row[11]), 20), 0, 0, 'L', 0);
    $pdf->Cell(20, 5, maxCaracter(utf8_decode($row[3]), 80), 0, 0, 'C', 0);
    $pdf->Cell(20, 5, maxCaracter(utf8_decode($total_sit), 20), 0, 0, 'C', 0);
    //precio
    $pdf->Cell(20, 5, maxCaracter(utf8_decode($row[5]), 20), 0, 0, 'C', 0);
    ///descuento
    $pdf->Cell(25, 5, maxCaracter(utf8_decode($total_si), 20), 0, 0, 'C', 0);
    //total
    $pdf->Ln(5);
}
$pdf->SetX(1);
$pdf->Ln(5);
$sql = pg_query("select factura_compra.descuento_compra,factura_compra.tarifa0,factura_compra.tarifa12,factura_compra.iva_compra,factura_compra.total_compra from factura_compra,detalle_factura_compra,productos where factura_compra.id_factura_compra=detalle_factura_compra.id_factura_compra and detalle_factura_compra.cod_productos=productos.cod_productos and detalle_factura_compra.id_factura_compra='{$_GET['id']}' LIMIT 1");
while ($row = pg_fetch_row($sql)) {
    $pdf->Cell(173, 6, utf8_decode("Tarifa 0"), 0, 0, 'R', 0);
    $pdf->Cell(35, 6, maxCaracter(truncateFloat($temp1, 2), 20), 0, 1, 'C', 0);
    $pdf->Cell(173, 6, utf8_decode("Tarifa 12"), 0, 0, 'R', 0);
    $pdf->Cell(35, 6, maxCaracter(truncateFloat($temp2, 2), 20), 0, 1, 'C', 0);
    $pdf->Cell(173, 6, utf8_decode("Iva 12%"), 0, 0, 'R', 0);
    $pdf->Cell(35, 6, maxCaracter(truncateFloat($temp3, 2), 20), 0, 1, 'C', 0);
    $pdf->Cell(173, 6, utf8_decode("Descuento"), 0, 0, 'R', 0);
    $pdf->Cell(35, 6, maxCaracter(truncateFloat($temp4, 2), 20), 0, 1, 'C', 0);
    $pdf->Cell(173, 6, utf8_decode("Total"), 0, 0, 'R', 0);
    $pdf->Cell(35, 6, maxCaracter(truncateFloat($temp5, 2), 20), 0, 1, 'C', 0);
}
$pdf->Output();
                } else {
                    $porc_t1 = porcentajeFaltante($CalT1, 1);
                    $porc_t2 = porcentajeFaltante($CalT2, 2);
                    $porc_t3 = porcentajeFaltante($CalT3, 3);
                    $total_porc = $porc_t1 + $porc_t2 + $porc_t3;
                    $porc_t1 = porcentajeFaltanteAjustado($porc_t1, $total_porc);
                    $porc_t2 = porcentajeFaltanteAjustado($porc_t2, $total_porc);
                    $porc_t3 = porcentajeFaltanteAjustado($porc_t3, $total_porc);
                    $CalRemT1 = calificacionAjustada_porcentaje($porc_t1, $CalT1, 1, $pts_cal);
                    $CalRemT2 = calificacionAjustada_porcentaje($porc_t2, $CalT2, 2, $pts_cal);
                    $CalRemT3 = calificacionAjustada_porcentaje($porc_t3, $CalT3, 3, $pts_cal);
                    $CalRemFinal = $CalFinal + $pts_cal;
                }
            } else {
                $CalRemT1 = $CalT1 / 32 * 100;
                $CalRemT2 = $CalT2 / 32 * 100;
                $CalRemT3 = $CalT3 / 36 * 100;
                $CalRemFinal = $CalFinal;
            }
            echo "<td>" . truncateFloat($CalRemT1, 2) . "</td>";
            echo "<td>" . truncateFloat($CalRemT2, 2) . "</td>";
            echo "<td>" . truncateFloat($CalRemT3, 2) . "</td>";
            echo "<td>" . truncateFloat($CalRemFinal, 2) . "</td>";
            echo "</tr>";
        }
    }
}
echo '</table>';
?>

</div>