function mostrarLibroMayor() { $objResponse = new xajaxResponse(); $controlCuenta = new ManejadorCuenta(); $recurso = $controlCuenta->consultarLibroMayor(); $resultado = '<table cellspacing="0" class="scrollTable">'; $resultado .= '<thead>'; $resultado .= '<tr>'; $resultado .= '<th>NUM</th>'; $resultado .= '<th>NOMBRE</th>'; $resultado .= '<th>DEBE</th>'; $resultado .= '<th>HABER</th>'; $resultado .= '<th>TOTAL</th>'; $resultado .= '</tr>'; $resultado .= '</thead>'; while ($row = mysql_fetch_array($recurso)) { $total = 0; if ($row[tipo] == 'A' || $row[tipo] == 'E') { $total = $row[debe] - $row[haber]; } else { $total = $row[haber] - $row[debe]; } $resultado .= '<td>' . $row[num] . '</td>'; $resultado .= '<td>' . $row[nombre] . '</td>'; $resultado .= '<td>' . $row[debe] . '</td>'; $resultado .= '<td>' . $row[haber] . '</td>'; $resultado .= '<td>' . $total . '</td>'; $resultado .= '</tr>'; } $resultado .= '</table>'; $objResponse->addAssign("librom", "innerHTML", $resultado); return $objResponse; }
function mostrarISLR($porcentajeUtilidad) { $manejador = new ManejadorCuenta(); $resultadoIngresos = $manejador->consultarSumaIngresos(); $ingresos = round(mysql_result($resultadoIngresos, 0, 0)); $resultadoEgresos = $manejador->consultarSumaEgresos(); $egresos = round(mysql_result($resultadoEgresos, 0, 0)); $utilidadesISLR = round($ingresos - $egresos); $islrPorPagar = round($utilidadesISLR * $porcentajeUtilidad); $utilidadDespuesISLR = round($utilidadesISLR - $islrPorPagar); $impresion = '<h3 align = "center"><b>IMPUESTO SOBRE LA RENTA EDUGER, C. A.</b></h3><br><br>'; $impresion .= '<table class= "scrollTable" align = "center" border = "1" cellpadding = "4" cellspacing = "2">'; $impresion .= '<thead>'; $impresion .= '<tr align = "center">'; $impresion .= '<th colspan = "5"><font size = "2" face = "Garamond, Comic Sans MS, Arial">Impuesto sobre la Renta por pagar</font></th>'; $impresion .= '</tr>'; $impresion .= '<tr align = "center">'; $fechaActual = date("d/m/Y"); $impresion .= '<th colspan = "5"><font size = "2" face = "Garamond, Comic Sans MS, Arial">al ' . $fechaActual . '</font></th>'; $impresion .= '</tr>'; $impresion .= '<tr align = "center">'; $impresion .= '<td><i><font size = "2" face = "Garamond, Comic Sans MS, Arial">INGRESOS TOTALES</font></i></td>'; $impresion .= '<td><i><font size = "2" face = "Garamond, Comic Sans MS, Arial">EGRESOS TOTALES</font></i></td>'; $impresion .= '<td><i><font size = "2" face = "Garamond, Comic Sans MS, Arial">UTILIDADES ISLR</font></i></td>'; $impresion .= '<td><i><font size = "2" face = "Garamond, Comic Sans MS, Arial">ISLR POR PAGAR</font></i></td>'; $impresion .= '<td><i><font size = "2" face = "Garamond, Comic Sans MS, Arial">UTILIDAD DESPUÉS DEL ISLR</font></i></td>'; $impresion .= '</tr>'; $impresion .= '</thead>'; $impresion .= '<tr align = "center">'; $impresion .= '<td>' . $ingresos . '</td>'; $impresion .= '<td>' . $egresos . '</td>'; $impresion .= '<td>' . $utilidadesISLR . '</td>'; $impresion .= '<td>' . $islrPorPagar . '</td>'; $impresion .= '<td>' . $utilidadDespuesISLR . '</td>'; $impresion .= '</tr>'; $impresion .= '</table>'; echo $impresion; }
function mostrarEdoResultados($fechaInicio, $fechaFin) { $manejador = new ManejadorCuenta(); $resultadoIngresos = $manejador->consultarIngresos($fechaInicio, $fechaFin); $resultadoGastos = $manejador->consultarGastos(); $impresion = '<h3 align = "center"><b>ESTADO DE RESULTADOS EDUGER, C. A.</b></h3><br><br>'; $impresion .= '<table class = "scrollTable" align = "center" border = "0" cellpadding = "4" cellspacing = "2">'; $impresion .= '<thead>'; $impresion .= '<tr align = "center">'; $impresion .= '<th colspan = "6"><font size = "2" face = "Garamond, Comic Sans MS, Arial">Cía EDUGER, C. A.</font></th>'; $impresion .= '</tr>'; $impresion .= '<tr>'; $impresion .= '<th colspan = "6"><font size = "2" face = "Garamond, Comic Sans MS, Arial">Estado de resultados (Bs.)</font></th>'; $impresion .= '</tr>'; $impresion .= '<tr>'; $impresion .= '<th colspan = "6"><font size = "2" face = "Garamond, Comic Sans MS, Arial">del ' . $fechaInicio . ' al ' . $fechaFin . '</font></th>'; $impresion .= '</tr>'; $impresion .= '</thead>'; $impresion .= '<tr>'; $impresion .= '<td align = "left" colspan = "3"><i><font size = "2" face = "Garamond, Comic Sans MS, Arial"><u>VENTAS</u></font></i></td>'; $impresion .= '</tr>'; $sumaVentas = 0; $i = 0; while ($row = mysql_fetch_array($resultadoIngresos)) { $impresion .= '<tr>'; $impresion .= '<td><font size = "2" face = "Garamond, Comic Sans MS, Arial"> ' . $row[nombre] . '</font></td>'; $monto = $row[total]; $impresion .= '<td><font size = "2" face = "Garamond, Comic Sans MS, Arial">' . $monto . '</font></td>'; $sumaVentas += $monto; $impresion .= '<td> </td>'; $impresion .= '</tr>'; $nombreCuentas[$i] = $row[nombre]; $i++; } $impresion .= '<tr>'; $impresion .= '<td align = "left"><font size = "2" face = "Garamond, Comic Sans MS, Arial"><b> TOTAL VENTAS</b></font></td>'; $impresion .= '<td> </td>'; $impresion .= '<td><font size = "2" face = "Garamond, Comic Sans MS, Arial">' . $sumaVentas . '</font></td>'; $impresion .= '</tr>'; $impresion .= '<tr>'; $impresion .= '<td align = "left" colspan = "3"><i><font size = "2" face = "Garamond, Comic Sans MS, Arial"><u>COSTOS DE VENTA</u></font></i></td>'; $impresion .= '</tr>'; $resultadoCostosVenta = $manejador->consultarCostosVenta($nombreCuentas); $sumaCostosVenta = 0; while ($row = mysql_fetch_array($resultadoCostosVenta)) { $impresion .= '<tr>'; $impresion .= '<td><font size = "2" face = "Garamond, Comic Sans MS, Arial"> ' . $row[nombre] . '</font></td>'; $impresion .= '<td><font size = "2" face = "Garamond, Comic Sans MS, Arial">' . $row[debe] . '</font></td>'; $sumaCostosVenta += $row[debe]; $impresion .= '<td> </td>'; $impresion .= '</tr>'; } $impresion .= '<tr>'; $impresion .= '<td align = "left"><font size = "2" face = "Garamond, Comic Sans MS, Arial"><b> TOTAL COSTOS DE VENTA</b></font></td>'; $impresion .= '<td> </td>'; $impresion .= '<td><font size = "2" face = "Garamond, Comic Sans MS, Arial">(' . $sumaCostosVenta . ')</font></td>'; $impresion .= '</tr>'; $impresion .= '<tr>'; $impresion .= '<td align = "left"><font size = "2" face = "Garamond, Comic Sans MS, Arial"><b> UTILIDAD BRUTA EN VENTAS</b></font></td>'; $impresion .= '<td> </td>'; $utilidadVentas = $sumaVentas - $sumaCostosVenta; $impresion .= '<td><font size = "2" face = "Garamond, Comic Sans MS, Arial">' . $utilidadVentas . '</font></td>'; $impresion .= '</tr>'; $impresion .= '<tr>'; $impresion .= '<td align = "left" colspan = "3"><i><font size = "2" face = "Garamond, Comic Sans MS, Arial"><u>GASTOS DE VENTA Y ADMINISTRACIÓN</u></font></i></td>'; $impresion .= '</tr>'; $sumaGastos = 0; while ($row = mysql_fetch_array($resultadoGastos)) { $impresion .= '<tr>'; $impresion .= '<td><font size = "2" face = "Garamond, Comic Sans MS, Arial"> ' . $row[nombre] . '</font></td>'; $impresion .= '<td><font size = "2" face = "Garamond, Comic Sans MS, Arial">' . $row[debe] . '</font></td>'; $sumaGastos += $row[debe]; $impresion .= '<td> </td>'; $impresion .= '</tr>'; } $impresion .= '<tr>'; $impresion .= '<td align = "left"><font size = "2" face = "Garamond, Comic Sans MS, Arial"><b> TOTAL GASTOS DE VENTA Y ADMINISTRACIÓN</b></font></td>'; $impresion .= '<td> </td>'; $impresion .= '<td><font size = "2" face = "Garamond, Comic Sans MS, Arial">(' . $sumaGastos . ')</font></td>'; $impresion .= '</tr>'; $impresion .= '<tr>'; $impresion .= '<td align = "left"><font size = "2" face = "Garamond, Comic Sans MS, Arial"><b> UTILIDAD NETA EN OPERACIONES</b></font></td>'; $impresion .= '<td> </td>'; $utilidadOperaciones = $utilidadVentas - $sumaGastos; $impresion .= '<td><font size = "2" face = "Garamond, Comic Sans MS, Arial">' . $utilidadOperaciones . '</font></td>'; $impresion .= '</tr>'; $impresion .= '</table>'; return $impresion; }
function mostrarBalance() { $manejador = new ManejadorCuenta(); $resultado = $manejador->consultarActivosPasivos(); $resultadoSumaIngresos = $manejador->consultarSumaIngresos(); $sumaIngresos = mysql_result($resultadoSumaIngresos, 0, 0); $resultadoSumaEgresos = $manejador->consultarSumaEgresos(); $sumaEgresos = mysql_result($resultadoSumaEgresos, 0, 0); $und = $sumaIngresos - $sumaEgresos; $manejador->registrarUND($und); $manejador->registrarGananciasPerdidas($und); $impresion = '<h3 align = "center"><b>BALANCE GENERAL EDUGER, C. A.</b></h3><br><br>'; $impresion .= '<table class="scrollTable" align = "center" border = "0" cellpadding = "4" cellspacing = "2">'; $impresion .= '<thead>'; $impresion .= '<tr align = "center">'; $impresion .= '<th colspan = "6"><font size = "2" face = "Garamond, Comic Sans MS, Arial">Cía EDUGER, C. A.</font></th>'; $impresion .= '</tr>'; $impresion .= '<tr>'; $impresion .= '<th colspan = "6"><font size = "2" face = "Garamond, Comic Sans MS, Arial">Balance general (Bs.)</font></th>'; $impresion .= '</tr>'; $impresion .= '<tr>'; $fechaActual = date("d/m/Y"); $impresion .= '<th colspan = "6"><font size = "2" face = "Garamond, Comic Sans MS, Arial">al ' . $fechaActual . '</font></th>'; $impresion .= '</tr>'; $impresion .= '<tr align = "center">'; $impresion .= '<td colspan = "3"><i><font size = "2" face = "Garamond, Comic Sans MS, Arial"><u>ACTIVOS</u></font></i></td>'; $impresion .= '<td colspan = "3"><i><font size = "2" face = "Garamond, Comic Sans MS, Arial"><u>PASIVOS</u></font></i></td>'; $impresion .= '</tr>'; $impresion .= '</thead>'; $sumaActivos = 0; $sumaPasivos = 0; while ($row = mysql_fetch_array($resultado)) { if ($row[tipo] == 'A') { $impresion .= '<tr align = "center">'; $impresion .= '<td><font size = "2" face = "Garamond, Comic Sans MS, Arial">' . $row[nombre] . '</font></td>'; if ($row[nombre] != "BANCO" && substr($row[nombre], 0, 10) != "INVENTARIO" && substr($row[nombre], 0, 18) != "CUENTAS POR COBRAR") { if (substr($row[nombre], 0, 8) == "DEP ACUM") { $monto = $row[debe] - $row[haber]; $monto *= -1; $impresion .= '<td><font size = "2" face = "Garamond, Comic Sans MS, Arial">(' . $monto . ')</font></td>'; $subcadena = substr($row[nombre], 9, 3); $resultadoActivoDepreciable = $manejador->consultarActivoDepreciable($subcadena); $rowA = mysql_fetch_array($resultadoActivoDepreciable); $totalActivoDepreciable = $rowA[debe] - $monto; $sumaActivos += $totalActivoDepreciable; $impresion .= '<td><font size = "2" face = "Garamond, Comic Sans MS, Arial">' . $totalActivoDepreciable . '</font></td>'; } else { $monto = $row[debe] - $row[haber]; $impresion .= '<td><font size = "2" face = "Garamond, Comic Sans MS, Arial">' . $monto . '</font></td>'; $impresion .= '<td> </td>'; } } else { $impresion .= '<td> </td>'; $monto = $row[debe] - $row[haber]; $sumaActivos += $monto; $impresion .= '<td><font size = "2" face = "Garamond, Comic Sans MS, Arial">' . $monto . '</font></td>'; } $ultimoTipoCuenta = 'A'; } elseif ($ultimoTipoCuenta == 'A' && $row[nombre] != "GANANCIAS Y PERDIDAS") { $impresion .= '<td><font size = "2" face = "Garamond, Comic Sans MS, Arial">' . $row[nombre] . '</font></td>'; $impresion .= '<td> </td>'; $monto = $row[haber] - $row[debe]; $sumaPasivos += $monto; $impresion .= '<td><font size = "2" face = "Garamond, Comic Sans MS, Arial">' . $monto . '</font></td>'; $impresion .= '</tr>'; $ultimoTipoCuenta = 'P'; } elseif ($row[nombre] != "GANANCIAS Y PERDIDAS") { $impresion .= '<tr align = "center">'; $impresion .= '<td> </td>'; $impresion .= '<td> </td>'; $impresion .= '<td> </td>'; $impresion .= '<td><font size = "2" face = "Garamond, Comic Sans MS, Arial">' . $row[nombre] . '</font></td>'; $monto = $row[haber] - $row[debe]; $sumaPasivos += $monto; $impresion .= '<td> </td>'; $impresion .= '<td><font size = "2" face = "Garamond, Comic Sans MS, Arial">' . $monto . '</font></td>'; $impresion .= '</tr>'; $ultimoTipoCuenta = 'P'; } } $impresion .= '<tr align = "center">'; $resolucion = new CargaInterfaz(); $impresion .= '<td><font size = "2" face = "Garamond, Comic Sans MS, Arial">Total activos</font></td>'; $coordX = $resolucion->verificacionResolucionPantalla($coordX, $coordY); $coordX = $sumaActivos; $coordY = $sumaPasivos; $impresion .= '<td> </td>'; $coordY = $resolucion->verificacionResolucionPantalla($coordX, $coordY); $sumaActivos = $coordX; $sumaPasivos = $coordY; $impresion .= '<td><font size = "2" face = "Garamond, Comic Sans MS, Arial">' . $sumaActivos . '</font></td>'; $impresion .= '<td><font size = "2" face = "Garamond, Comic Sans MS, Arial">Total pasivos</font></td>'; $impresion .= '<td> </td>'; $impresion .= '<td><font size = "2" face = "Garamond, Comic Sans MS, Arial">' . $sumaPasivos . '</font></td>'; $impresion .= '</tr>'; $impresion .= '</table>'; return $impresion; }