$fac->setXY(150, 254); $fac->Cell(0, 0, 'IVA'); $fac->setXY(150, 258); $fac->Cell(0, 0, 'TOTAL'); $fac->SetFont('Arial', '', 7); $fac->setXY(170, 246); $fac->Cell(0, 0, $row['MONTO']); $fac->setXY(170, 250); $fac->Cell(0, 0, $row['DESCUENTO']); $fac->setXY(170, 254); $fac->Cell(0, 0, $row['IVA']); $fac->setXY(170, 258); $fac->Cell(0, 0, $row['TOTAL']); $fac->SetFont('Arial', '', 8); } $numletra = new CNumeroaLetra(); $numletra->setNumero($num); $cant_letra = $numletra->letra(); $fac->SetFont('Arial', '', 8); $fac->setXY(10, 246); $fac->Cell(105, 0, 'Importe en letras'); $fac->setXY(10, 250); $fac->Cell(105, 0, $cant_letra); $fac->setXY(10, 254); $fac->Cell(105, 0, 'Tipo de pago: Efectivo'); $fac->setXY(10, 258); $fac->Cell(105, 0, 'Forma de pago: Pago en unsa sola exhibición'); } //DETALLE if (!empty($factura)) { $tt = 75;
$dia = $row['FD']; $mes = $row['FM']; $anio = $row['FY']; $condiciones = $row['CONDICIONES']; $pedido = $row['PEDIDO_CLIENTE']; $paridad = formato_moneda($row['PARIDAD'], 2); $tipo_cambio = $row['MONEDA']; $atencion = $row['ATENCION_A']; $departamento = $row['DEPARTAMENTO']; $subtotal = $row['MONTO']; $descuento = $row['DESCUENTO']; $iva = $row['IVA']; $total = $row['TOTAL']; $observa = utf8_encode($row['COMENTARIOS']); } $numletra = new CNumeroaLetra(); if ($tipo_cambio == "USD") { $numletra->setMoneda("DOLARES"); $numletra->setSufijo("U.S.D.***)"); } $numletra->setNumero($total); $cant_letra = $numletra->letra(); $subtotal = formato_moneda($subtotal, 2); $descuento = formato_moneda($descuento, 2); $iva = formato_moneda($iva, 2); $total = formato_moneda($total, 2); //------------------------------------------------------------------------------------------------ $cabezera = ' <table width="760" border="0" cellspacing="5" cellpadding="5" align="center"> <tr> <td width="465" valign=""><!--<img src="../images/' . CONFIG("EMP_LOGO") . '" width="230">--></td>
$ciudad_cheque = "Monterrey, N.L."; //$res=mysql_query("select *, date_format(ban_p_bancos.FECHA_COBRO, '%e %M %Y')as FECHA from ban_p_bancos, com_c_proveedores where ban_p_bancos.MOVIMIENTO_ID=$id_cheque and ban_p_bancos.PROVEEDOR_ID = com_c_proveedores.PROVEEDOR_ID"); $res = mysql_query("select *, ban_p_bancos.DESCRIPCION AS DESCRIPCION, ban_c_cuentas.DESCRIPCION AS CUENTA2, date_format(ban_p_bancos.FECHA, '%e %M %Y')as FECHA from ban_p_bancos, com_c_proveedores, ban_c_cuentas where ban_p_bancos.MOVIMIENTO_ID={$id_cheque} and ban_p_bancos.PROVEEDOR_ID = com_c_proveedores.PROVEEDOR_ID and ban_c_cuentas.CUENTA_ID = ban_p_bancos.CUENTA_ID"); while ($row = mysql_fetch_array($res)) { $num_cheque = $row['MOVIMIENTO_ID']; $proveedor = $row['RAZON_SOCIAL']; $fecha_cheque = $row['FECHA']; $monto = $row['MONTO']; $iva = $row['IVA']; //$otros=$monto-$iva; //$sumas=($otros+$iva)-$monto; $id_cuenta = $row['CUENTA']; $descripcion = $row['DESCRIPCION']; $cuenta = $row['CUENTA2']; $movimiento = $row['MOVIMIENTO_ID']; $numletra = new CNumeroaLetra(); $numletra->setNumero($monto); $num_letra = $numletra->letra(); } //$numletra= new CNumeroaLetra(); //$numletra->setNumero($monto); //$cant_letra=$numletra->letra(); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>cheques</title> <script type="text/javascript" src="../TableEditor/jquery/js/jquery-1.4.4.min.js"></script> <?php //<link rel="stylesheet" href="../css/estilo.css" type="text/css" />
$res = mysql_query("select *, ban_p_bancos.DESCRIPCION AS DESCRIPCION,ban_c_cuentas.MONEDA, ban_c_cuentas.DESCRIPCION AS CUENTA2, date_format(ban_p_bancos.FECHA, '%e')as dia,date_format(ban_p_bancos.FECHA, '%c')as mes, date_format(ban_p_bancos.FECHA, '%Y')as anio\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \r\nfrom ban_p_bancos, com_c_proveedores, ban_c_cuentas where ban_p_bancos.MOVIMIENTO_ID={$id_cheque} and ban_p_bancos.PROVEEDOR_ID = com_c_proveedores.PROVEEDOR_ID and ban_c_cuentas.CUENTA_ID = ban_p_bancos.CUENTA_ID"); while ($row = mysql_fetch_array($res)) { $num_cheque = $row['MOVIMIENTO_ID']; $proveedor = $row['RAZON_SOCIAL']; $dia = $row['dia']; $mes = $row['mes']; $anio = $row['anio']; $monto = $row['MONTO']; $iva = $row['IVA']; $id_cuenta = $row['CUENTA']; $descripcion = $row['DESCRIPCION']; $cuenta = $row['CUENTA2']; $banco = $row['CUENTA_ID']; $movimiento = $row['MOVIMIENTO_ID']; $tipo_cambio = $row['MONEDA']; $numletra = new CNumeroaLetra(); if ($tipo_cambio == "USD") { $numletra->setMoneda("DOLARES"); $numletra->setSufijo("U.S.D.***)"); } $numletra->setNumero($monto); $num_letra = $numletra->letra(); } $meses = array(1 => 'Enero', 2 => 'Febrero', 3 => 'Marzo', 4 => 'Abril', 5 => 'Mayo', 6 => 'Junio', 7 => 'Julio', 8 => 'Agosto', 9 => 'Septiembre', 10 => 'Octubre', 11 => 'Noviembre', 12 => 'Diciembre'); $mes = $meses[$mes]; $fecha_cheque = $dia . ' ' . $mes . ' ' . $anio; $ban = mysql_query('select DESCRIPCION from ban_c_cuentas where CUENTA_ID=' . $banco); while ($row2 = mysql_fetch_array($ban)) { $banc = $row2['DESCRIPCION']; } ?>
private static function printProducts(&$pdf, $productos) { $opciones_tabla = array(); $opciones_tabla['showLines'] = 0; $opciones_tabla['showHeadings'] = 0; $opciones_tabla['shaded'] = 0; $opciones_tabla['fontSize'] = 8; $opciones_tabla['xOrientation'] = 'right'; $opciones_tabla['xPos'] = self::puntos_cm(7.5); $opciones_tabla['width'] = self::puntos_cm(11); $opciones_tabla['textCol'] = array(0, 0, 0); $opciones_tabla['titleFontSize'] = 12; $opciones_tabla['rowGap'] = 3; $opciones_tabla['colGap'] = 3; $opciones_tabla['xPos'] = self::puntos_cm(14.2); $opciones_tabla['showLines'] = 0; $opciones_tabla['shaded'] = 2; $opciones_tabla['shadeCol'] = array(1, 1, 1); $opciones_tabla['shadeCol2'] = array(0.8984375, 0.95703125, 0.99609375); /* ************************* * PRODUCTOS * ************************* */ $elementos = array(array('cantidad' => 'Cantidad', 'descripcion' => 'Descripcion ', 'precio' => 'Precio', 'importe' => 'Importe')); $subtotal = 0; $total = 0; $impuesto = 0; foreach ($productos as $p) { if ($p instanceof VentaProducto) { $prodDao = ProductoDAO::getByPK($p->getIdProducto()); if (!is_null($prodDao)) { $prod['cantidad'] = $p->getCantidad(); if (!is_null($p->getIdUnidad())) { $unidad = UnidadMedidaDAO::getByPK($p->getIdUnidad()); if (!is_null($unidad)) { $prod['cantidad'] .= " " . $unidad->getAbreviacion(); } } $prod['descripcion'] = $prodDao->getNombreProducto(); $prod['precio'] = FormatMoney($p->getPrecio(), DONT_USE_HTML); $prod['importe'] = FormatMoney($p->getPrecio() * $p->getCantidad(), DONT_USE_HTML); $subtotal += $p->getPrecio() * $p->getCantidad(); $total = $subtotal; array_push($elementos, $prod); } else { Logger::error("El producto que se intentaba imprimir ya no existe !!"); } } else { if ($p instanceof VentaOrden) { $ordenDao = OrdenDeServicioDAO::getByPK($p->getIdOrdenDeServicio()); $serv = ServicioDAO::getByPK($ordenDao->getIdServicio()); $prod['cantidad'] = "-"; $prod['descripcion'] = $serv->getNombreServicio(); $prod['precio'] = FormatMoney($p->getPrecio(), DONT_USE_HTML); $prod['importe'] = FormatMoney($p->getPrecio(), DONT_USE_HTML); $subtotal += $p->getPrecio(); $total = $subtotal; array_push($elementos, $prod); } else { if ($p instanceof Venta) { array_push($elementos, array("cantidad" => "", "descripcion" => "", "precio" => "Subtotal", "importe" => FormatMoney($p->getSubtotal(), DONT_USE_HTML))); array_push($elementos, array("cantidad" => "", "descripcion" => "", "precio" => "Descuento", "importe" => FormatMoney($p->getDescuento(), DONT_USE_HTML))); array_push($elementos, array("cantidad" => "", "descripcion" => "", "precio" => "IVA", "importe" => FormatMoney($p->getImpuesto(), DONT_USE_HTML))); array_push($elementos, array("cantidad" => "", "descripcion" => "", "precio" => "Total", "importe" => FormatMoney($p->getTotal(), DONT_USE_HTML))); $letra = new CNumeroaLetra(); $letra->setNumero($p->getTotal()); array_push($elementos, array("cantidad" => "", "descripcion" => $letra->letra(), "precio" => "", "importe" => "")); } } } } $pdf->ezSetY(self::puntos_cm(18.6)); $opciones_tabla['xPos'] = self::puntos_cm(2); $opciones_tabla['width'] = self::puntos_cm(16.2); $pdf->ezTable($elementos, "", "", $opciones_tabla); }