} $pdf->SetWidths(array(120, 20, 25, 15, 25, 25, 25, 15)); $pdf->Row(array('Cliente', 'Tipo', 'Nº Comprobante', 'Fecha', 'Subtotal', 'IGV', 'Total', 'Estado')); $j = '1'; $rs = $venta->venta_consulta($_REQUEST['cliente'], $_REQUEST['tipocomprobante'], $_REQUEST['fecha'], $_REQUEST['fechaf'], '1'); $suma_precio = 0; $suma_importe = 0; while ($campo = mysql_fetch_array($rs)) { $fecha = $venta->_util->obtienefecha($campo['ven_fecha']); $cliente = $campo['cli_razonsocial']; $tipo = $campo['tipc_descripcion']; $incluyeigv = $campo['ven_incluyeigv']; $comprobante = $venta->_util->ceros_izquierda($campo['ven_nro_doc'], 5); $comprobante_serie = $venta->_util->ceros_izquierda($campo['ven_serie_doc'], 3); if ($incluyeigv == 0) { $subtotal = $venta->sumaimporte_detalleventa($campo['ven_id'], 2); $igv = $subtotal * 0.19; $total = $subtotal + $igv; } if ($incluyeigv == 1) { $total = $venta->sumaimporte_detalleventa($campo['ven_id'], 2); $subtotal = $total / 1.19; $igv = $total - $subtotal; } $subtotal = number_format($subtotal, 2); $igv = number_format($igv, 2); $total = number_format($total, 2); /*$total=number_format($venta->sumaimporte_detalleventa($campo['ven_id'],2)); $subtotal=number_format($total/1.19,2); $igv=number_format($total-$subtotal,2);*/ $moneda = $campo['tipm_descripcion'];
echo $campo['tipc_descripcion']; ?> </td> <td align="center"><?php echo $venta->_util->ceros_izquierda($campo['ven_serie_doc'], 3); ?> - <?php echo $venta->_util->ceros_izquierda($campo['ven_nro_doc'], 5); ?> </td> <td align="center"><?php echo $venta->_util->obtienefecha($campo['ven_fecha']); ?> </td> <td align="center"><?php $suma_importe = $venta->sumaimporte_detalleventa($campo['ven_id']); if ($campo['ven_incluyeigv'] == 0) { $subtotal = $suma_importe; $igv = $subtotal * 0.19; $total = $subtotal + $igv; } if ($campo['ven_incluyeigv'] == 1) { $total = $suma_importe; $subtotal = $total / 1.19; $igv = $total - $subtotal; } ?> <?php echo $campo['tipm_descripcion']; echo number_format($subtotal, 2); ?>