(246,'/var/www/html/company/Ventaspos/mod/app_ventas/imprimirFactura.php','2022-05-23 23:00:00','rafael',188,5054,'<?php\n$medidaTicket = 280;\n\n\n$empresa = PCO_EjecutarSQL(\"\n            SELECT razon_social, nit, telefono, direccion\n            FROM app_empresa\n            WHERE id = 1\n        \")->fetch();\n\n$venta = PCO_EjecutarSQL(\"\n            SELECT date_format(fecha, \'%d-%m-%Y %H:%i:%s\') fecha, total, iva, forma_pago, devuelta, dinero_entregado, id_cliente\n            FROM app_ventas\n            WHERE id = \'$id\'\n        \")->fetch();\n\n$cliente = PCO_EjecutarSQL(\"\n            SELECT *\n            FROM app_clientes\n            WHERE id = \'\" . $venta[\"id_cliente\"] . \"\'\n        \")->fetch();\n\n$productos = PCO_EjecutarSQL(\"\n            SELECT vd.cantidad, p.nombre as descripcion, vd.precio, date_format(fecha, \'%d-%m-%Y\') \n            FROM app_ventas_detalle vd, app_productos p\n            WHERE vd.id_producto = p.id AND vd.id_venta = \'$id\'\n        \")->fetchAll();\n?>\n<!DOCTYPE html>\n<html>\n\n<head>\n\n    <style>\n        * {\n            font-size: 15px;\n            font-family: \'DejaVu Sans\', serif;\n        }\n\n        h1 {\n            font-size: 18px;\n        }\n\n        \n\n        .ticket {\n            margin: 0.5px;\n        }\n\n        td,\n        th,\n        tr,\n        table {\n            border-top: 1px solid black;\n            border-collapse: collapse;\n            margin: 0 auto;\n            font-size: 15px;\n        }\n\n        td.precio {\n            text-align: right;\n            font-size: 11px;\n        }\n\n        td.cantidad {\n            font-size: 12px;\n        }\n\n        td.producto {\n            text-align: center;\n        }\n\n        th {\n            text-align: center;\n        }\n\n\n        .centrado {\n            text-align: center;\n            align-content: center;\n        }\n\n        .ticket {\n            width: <?php echo $medidaTicket ?>px;\n            max-width: <?php echo $medidaTicket ?>px;\n        }\n\n        img {\n            max-width: inherit;\n            width: inherit;\n        }\n\n        * {\n            margin: 0;\n            padding: 0;\n        }\n\n        .ticket {\n            margin: 0;\n            padding: 0;\n        }\n\n        body {\n            text-align: center;\n        }\n    </style>\n</head>\n\n<body>\n    <div class=\"ticket centrado\">\n        <h1><?php echo $empresa[\"razon_social\"] ?></h1>\n        <h2>NIT: <?php echo $empresa[\"nit\"] ?></h2>\n        <h2>Teléfono: <?php echo $empresa[\"telefono\"] ?></h2>\n        <h2>Direccion: <?php echo $empresa[\"direccion\"] ?></h2>\n        <h2>Correo: </h2>\n        <h2>--------------------------------------------</h2>\n        <h1 align=\"right\">Ticket de venta #<?php echo $id ?></h1>\n        \n        <h2>Fecha: <?php echo $venta[\"fecha\"] ?></h2>\n        <h2>Cliente: <?php echo $cliente[\"nombre\"] ?></h2>\n        <h2>telefono: <?php echo $cliente[\"telefono\"] ?></h2>\n        <h2>CC / NIT: <?php echo $cliente[\"numero_documento\"] ?></h2>\n        <h2>Dirección: <?php echo $cliente[\"direccion\"] ?></h2>\n        <h2>Vendedor:</h2>\n        <h2>Caja N° 1</h2>\n        <br>\n\n        <table>\n            <thead>\n                <tr class=\"centrado\">\n                    <th class=\"cantidad\">CANT</th>\n                    <th class=\"producto\">PRODUCTO</th>\n                    <th class=\"precio\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;TOTAL</th>\n                </tr>\n            </thead>\n            <tbody>\n                <?php\n                $total = 0;\n                foreach ($productos as $producto) {\n                    $total += $producto[\"cantidad\"] * $producto[\"precio\"];\n                ?>\n                    <tr>\n                        <td class=\"cantidad\"><?php echo number_format($producto[\"cantidad\"], 2) ?></td>\n                        <td class=\"producto\"><?php echo $producto[\"descripcion\"] ?></td>\n                        <td class=\"precio\">$<?php echo number_format($producto[\"precio\"], 2) ?></td>\n                    </tr>\n                <?php } ?>\n            </tbody>\n            \n            <tr>\n                <td class=\"cantidad\"></td>\n                <td class=\"producto\">\n                <br>\n                    <strong>SUBTOTAL</strong>\n\n                    <p></p>\n                    <strong>TOTAL A PAGAR</strong>\n                    <p></p>\n                    <strong>FORMA DE PAGO</strong>\n                    <p></p>\n                    <strong>CAMBIO</strong>\n                    \n                </td>\n                \n                <th class=\"precio\">\n                    $<?php echo number_format($venta[\"total\"] - $venta[\"iva\"], 2) ?>\n                    <p></p>\n                    $<?php echo number_format($venta[\"total\"], 2) ?>\n                    <p><?php echo $venta[\"dinero_entregado\"] ?></p>\n                    <p></p>\n                    <p><?php echo $venta[\"forma_pago\"] ?></p>\n\n                    <p></p>\n                    $100\n                    \n                </th>\n            </tr>\n        </table>\n        <br>\n        <p class=\"centrado\">¡GRACIAS POR SU COMPRA! </P>\n        <br>\n            <P>Elaborado por www.cloudecoway.com</p>\n            <P>Tel: 3137010627</p>\n\n    </div>\n</body>\n\n</html>','A'),(247,'/var/www/html/company/Ventaspos/mod/app_ventas/imprimirFactura.php','2022-05-23 23:26:00','rafael',188,5061,'<?php\n$medidaTicket = 280;\n\n\n$empresa = PCO_EjecutarSQL(\"\n            SELECT razon_social, nit, telefono, direccion\n            FROM app_empresa\n            WHERE id = 1\n        \")->fetch();\n\n$venta = PCO_EjecutarSQL(\"\n            SELECT date_format(fecha, \'%d-%m-%Y %H:%i:%s\') fecha, total, iva, forma_pago, devuelta, dinero_entregado, id_cliente\n            FROM app_ventas\n            WHERE id = \'$id\'\n        \")->fetch();\n\n$cliente = PCO_EjecutarSQL(\"\n            SELECT *\n            FROM app_clientes\n            WHERE id = \'\" . $venta[\"id_cliente\"] . \"\'\n        \")->fetch();\n\n$productos = PCO_EjecutarSQL(\"\n            SELECT vd.cantidad, p.nombre as descripcion, vd.precio, date_format(fecha, \'%d-%m-%Y\') \n            FROM app_ventas_detalle vd, app_productos p\n            WHERE vd.id_producto = p.id AND vd.id_venta = \'$id\'\n        \")->fetchAll();\n?>\n<!DOCTYPE html>\n<html>\n\n<head>\n\n    <style>\n        * {\n            font-size: 15px;\n            font-family: \'DejaVu Sans\', serif;\n        }\n\n        h1 {\n            font-size: 18px;\n        }\n\n        \n\n        .ticket {\n            margin: 0.5px;\n        }\n\n        td,\n        th,\n        tr,\n        table {\n            border-top: 1px solid black;\n            border-collapse: collapse;\n            margin: 0 auto;\n            font-size: 15px;\n        }\n\n        td.precio {\n            text-align: right;\n            font-size: 11px;\n        }\n\n        td.cantidad {\n            font-size: 12px;\n        }\n\n        td.producto {\n            text-align: center;\n        }\n\n        th {\n            text-align: center;\n        }\n\n\n        .centrado {\n            text-align: center;\n            align-content: center;\n        }\n\n        .ticket {\n            width: <?php echo $medidaTicket ?>px;\n            max-width: <?php echo $medidaTicket ?>px;\n        }\n\n        img {\n            max-width: inherit;\n            width: inherit;\n        }\n\n        * {\n            margin: 0;\n            padding: 0;\n        }\n\n        .ticket {\n            margin: 0;\n            padding: 0;\n        }\n\n        body {\n            text-align: center;\n        }\n    </style>\n</head>\n\n<body>\n    <div class=\"ticket centrado\">\n        <h1><?php echo $empresa[\"razon_social\"] ?></h1>\n        <h2>NIT: <?php echo $empresa[\"nit\"] ?></h2>\n        <h2>Teléfono: <?php echo $empresa[\"telefono\"] ?></h2>\n        <h2>Direccion: <?php echo $empresa[\"direccion\"] ?></h2>\n        <h2>Correo: </h2>\n        <h2>--------------------------------------------</h2>\n        <h1 align=\"center\">Ticket de venta #<?php echo $id ?></h1>\n        \n        <h2>Fecha: <?php echo $venta[\"fecha\"] ?></h2>\n        <h2>Cliente: <?php echo $cliente[\"nombre\"] ?></h2>\n        <h2>telefono: <?php echo $cliente[\"telefono\"] ?></h2>\n        <h2>CC / NIT: <?php echo $cliente[\"numero_documento\"] ?></h2>\n        <h2>Dirección: <?php echo $cliente[\"direccion\"] ?></h2>\n        <h2>Vendedor:</h2>\n        <h2>Caja N° 1</h2>\n        <br>\n\n        <table>\n            <thead>\n                <tr class=\"centrado\">\n                    <th class=\"cantidad\">CANT</th>\n                    <th class=\"producto\">PRODUCTO</th>\n                    <th class=\"precio\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;TOTAL</th>\n                </tr>\n            </thead>\n            <tbody>\n                <?php\n                $total = 0;\n                foreach ($productos as $producto) {\n                    $total += $producto[\"cantidad\"] * $producto[\"precio\"];\n                ?>\n                    <tr>\n                        <td class=\"cantidad\"><?php echo number_format($producto[\"cantidad\"], 2) ?></td>\n                        <td class=\"producto\"><?php echo $producto[\"descripcion\"] ?></td>\n                        <td class=\"precio\">$<?php echo number_format($producto[\"precio\"], 2) ?></td>\n                    </tr>\n                <?php } ?>\n            </tbody>\n            \n            <tr>\n                <td class=\"cantidad\"></td>\n                <td class=\"producto\">\n                <br>\n                    <strong>SUBTOTAL</strong>\n\n                    <p></p>\n                    <strong>TOTAL A PAGAR</strong>\n                    <p></p>\n                    <strong>FORMA DE PAGO</strong>\n                    <p></p>\n                    <strong>CAMBIO</strong>\n                    \n                </td>\n                \n                <th class=\"precio\">\n                    $<?php echo number_format($venta[\"total\"] - $venta[\"iva\"], 2) ?>\n                    <p></p>\n                    $<?php echo number_format($venta[\"total\"], 2) ?>\n                    <p><?php echo $venta[\"dinero_entregado\"] ?></p>\n                    <p></p>\n                    <p><?php echo $venta[\"forma_pago\"] ?></p>\n\n                    <p></p>\n                    $100\n                    \n                </th>\n            </tr>\n        </table>\n        <br>\n        <p class=\"centrado\">¡GRACIAS POR SU COMPRA! </P>\n        <br>\n            <P>Elaborado por www.cloudecoway.com</p>\n            <P>Tel: 3137010627</p>\n\n    </div>\n</body>\n\n</html>','A'),(248,'/var/www/html/company/Ventaspos/mod/app_ventas/index.php','2022-05-31 20:07:00','rafael',113,4374,'<?php\n\nfunction calcularTotalVenta($id) {\n    $venta = PCO_EjecutarSQL(\"\n        SELECT SUM(precio * cantidad) as total, SUM(precio * iva/100) iva\n        FROM app_ventas_detalle\n        WHERE id_venta = \'$id\' GROUP BY id_venta\n    \")->fetch();\n    $total = $venta[\"total\"];\n    $iva = $venta[\"iva\"];\n    PCO_EjecutarSQLUnaria(\"UPDATE app_ventas SET total = $total, iva = $iva WHERE id = $id \");\n    return \'\"total\": \' . $total . \', \"iva\": \' . $iva;\n}\n\nif($PCO_Accion == \"VENTA_ingresarRealizarVenta\") {\n    $ventaAbierta = PCO_EjecutarSQL(\"\n        SELECT id, id_cliente, total, iva\n        FROM app_ventas\n        WHERE estado = 0 ORDER BY id limit 1\n    \")->fetch();\n    /*if (!$ventaAbierta[\"id\"]) {\n        \n        $ventaAbierta = PCO_EjecutarSQL(\"\n            SELECT *\n            FROM app_ventas\n            WHERE estado = 0 ORDER BY id limit 1\n        \")->fetch();   \n    }*/\n\n    $id_venta = $ventaAbierta[\"id\"] ? $ventaAbierta[\"id\"] : \"\";\n    if($id_venta) {\n        $total = number_format($ventaAbierta[\"total\"], 2);\n        $iva = number_format($ventaAbierta[\"iva\"], 2);\n        $id_cliente = $ventaAbierta[\"id_cliente\"];\n    }\n\n    PCO_CargarFormulario(8);\n}\n\nif($PCO_Accion == \"VENTA_agregarProducto\") {\n\n    if(!$id) {\n        //crear cliente en caso de que no llegue id_cliente\n        if(!$id_cliente) {\n            PCO_EjecutarSQLUnaria(\"INSERT INTO app_clientes (nombre_completo, numero_documento, telefono) VALUES (?,?,?) \",\n                \"$nombre_completo$_SeparadorCampos_$numero_documento$_SeparadorCampos_$telefono\"\n            );\n            $id_cliente = PCO_ObtenerUltimoIDInsertado();\n        }\n        PCO_EjecutarSQLUnaria(\"INSERT INTO app_ventas (id_cliente, usuario) VALUES (?,?) \", \"$id_cliente$_SeparadorCampos_$PCOSESS_LoginUsuario\");\n        $id = PCO_ObtenerUltimoIDInsertado();\n    }\n    $producto = PCO_EjecutarSQL(\"\n        SELECT id, precio_venta, iva, inventario\n        FROM app_productos\n        WHERE id = \'$id_producto\'\n    \")->fetch();\n    if($producto[\"id\"]) {\n        $existe = PCO_EjecutarSQL(\"\n            SELECT count(id)\n            FROM app_ventas_detalle\n            WHERE id_venta = $id AND id_producto = \'$id_producto\'\n        \")->fetchColumn();\n        if($existe > 0) {\n            print_r(\'{\"success\": false, \"msg\": \"El producto ya se ha ingresado\"}\');\n            die();\n        }\n        if($producto[\"inventario\"] < $cantidad) {\n            print_r(\'{\"success\": false, \"msg\": \"La cantidad digitada supera la del invetario\"}\');\n            die();\n        }\n        $inventarioNew = $producto[\"inventario\"] - $cantidad;\n        PCO_EjecutarSQLUnaria(\"UPDATE app_productos SET inventario = $inventarioNew WHERE id = \" . $producto[\"id\"]);\n        PCO_EjecutarSQLUnaria(\"INSERT INTO app_ventas_detalle (id_venta, id_producto, cantidad, precio, iva) VALUES (?,?,?,?,?) \", \n            \"$id$_SeparadorCampos_$id_producto$_SeparadorCampos_$cantidad$_SeparadorCampos_\" . $producto[\"precio_venta\"] . \"$_SeparadorCampos_\" . $producto[\"iva\"]);\n        $result = calcularTotalVenta($id);\n        print_r(\'{\"success\": true, \"id\": \' . $id . \', \' . $result . \'}\');\n        die();\n    }\n    print_r(\'{\"success\": false, \"msg\": \"No se ha encontrado el producto seleccionado\"}\');\n    die();\n}\n\nif($PCO_Accion == \"VENTA_eliminarProducto\") {\n\n    if($id_venta_detalle && $id_venta) {\n        $producto = PCO_EjecutarSQL(\"\n            SELECT p.inventario, vd.cantidad, p.id\n            FROM app_ventas_detalle vd, app_productos p\n            WHERE vd.id_producto = p.id AND vd.id = \'$id_venta_detalle\'\n        \")->fetch();\n        //Restablecemos el inventario\n        $inventarioNew = $producto[\"inventario\"] + $producto[\"cantidad\"];\n        PCO_EjecutarSQLUnaria(\"UPDATE app_productos SET inventario = $inventarioNew WHERE id = \" . $producto[\"id\"]);\n        PCO_EjecutarSQLUnaria(\"DELETE FROM app_ventas_detalle WHERE id_venta = $id_venta AND id = $id_venta_detalle\");\n        $result = calcularTotalVenta($id_venta);\n        print_r(\'{\"success\": true, \"msg\": \"Se ha eliminado el producto exitosamente\", \' . $result . \'}\');\n        die();\n    }\n    print_r(\'{\"success\": false, \"msg\": \"No se pudo eliminar el producto\"}\');\n    die();\n}\n\nif($PCO_Accion == \"VENTA_imprimirFactura\") {\n\n    sleep(2);\n    echo \"$PCO_Valor\";\n    if($PCO_Valor)\n        $id = $PCO_Valor;\n    if($id) {\n        include_once \"imprimirFactura.php\";\n    }\n}','A'),(249,'/var/www/html/company/Ventaspos/mod/app_ventas/index.php','2022-05-31 20:12:00','rafael',113,4376,'<?php\n\nfunction calcularTotalVenta($id) {\n    $venta = PCO_EjecutarSQL(\"\n        SELECT SUM(precio * cantidad) as total, SUM(precio * iva/100) iva\n        FROM app_ventas_detalle\n        WHERE id_venta = \'$id\' GROUP BY id_venta\n    \")->fetch();\n    $total = $venta[\"total\"];\n    $iva = $venta[\"iva\"];\n    PCO_EjecutarSQLUnaria(\"UPDATE app_ventas SET total = $total, iva = $iva WHERE id = $id \");\n    return \'\"total\": \' . $total . \', \"iva\": \' . $iva;\n}\n\nif($PCO_Accion == \"VENTA_ingresarRealizarVenta\") {\n    $ventaAbierta = PCO_EjecutarSQL(\"\n        SELECT id, id_cliente, total, iva\n        FROM app_ventas\n        WHERE estado = 0 ORDER BY id limit 1\n    \")->fetch();\n    /*if (!$ventaAbierta[\"id\"]) {\n        \n        $ventaAbierta = PCO_EjecutarSQL(\"\n            SELECT *\n            FROM app_ventas\n            WHERE estado = 0 ORDER BY id limit 1\n        \")->fetch();   \n    }*/\n\n    $id_venta = $ventaAbierta[\"id\"] ? $ventaAbierta[\"id\"] : \"\";\n    if($id_venta) {\n        $total = number_format($ventaAbierta[\"total\"], 2);\n        $iva = number_format($ventaAbierta[\"iva\"], 2);\n        $id_cliente = $ventaAbierta[\"id_cliente\"];\n    }\n\n    PCO_CargarFormulario(8);\n}\n\nif($PCO_Accion == \"VENTA_agregarProducto\") {\n\n    if(!$id) {\n        //crear cliente en caso de que no llegue id_cliente\n        if(!$id_cliente) {\n            PCO_EjecutarSQLUnaria(\"INSERT INTO app_clientes (nombre_completo, numero_documento, telefono) VALUES (?,?,?) \",\n                \"$nombre_completo$_SeparadorCampos_$numero_documento$_SeparadorCampos_$telefono\"\n            );\n            $id_cliente = PCO_ObtenerUltimoIDInsertado();\n        }\n        PCO_EjecutarSQLUnaria(\"INSERT INTO app_ventas (id_cliente, usuario) VALUES (?,?) \", \"$id_cliente$_SeparadorCampos_$PCOSESS_LoginUsuario\");\n        $id = PCO_ObtenerUltimoIDInsertado();\n    }\n    $producto = PCO_EjecutarSQL(\"\n        SELECT id, precio_venta, iva, inventario\n        FROM app_productos\n        WHERE id = \'$id_producto\'\n    \")->fetch();\n    if($producto[\"id\"]) {\n        $existe = PCO_EjecutarSQL(\"\n            SELECT count(id)\n            FROM app_ventas_detalle\n            WHERE id_venta = $id AND id_producto = \'$id_producto\'\n        \")->fetchColumn();\n        if($existe > 0) {\n            print_r(\'{\"success\": false, \"msg\": \"El producto ya se ha ingresado\"}\');\n            die();\n        }\n        if($producto[\"inventario\"] < $cantidad) {\n            print_r(\'{\"success\": false, \"msg\": \"La cantidad digitada supera la del invetario\"}\');\n            die();\n        }\n        $inventarioNew = $producto[\"inventario\"] - $cantidad;\n        PCO_EjecutarSQLUnaria(\"UPDATE app_productos SET inventario = $inventarioNew WHERE id = \" . $producto[\"id\"]);\n        PCO_EjecutarSQLUnaria(\"INSERT INTO app_ventas_detalle (id_venta, id_producto, cantidad, precio, iva) VALUES (?,?,?,?,?) \", \n            \"$id$_SeparadorCampos_$id_producto$_SeparadorCampos_$cantidad$_SeparadorCampos_\" . $producto[\"precio_venta\"] . \"$_SeparadorCampos_\" . $producto[\"iva\"]);\n        $result = calcularTotalVenta($id);\n        print_r(\'{\"success\": true, \"id\": \' . $id . \', \' . $result . \'}\');\n        die();\n    }\n    print_r(\'{\"success\": false, \"msg\": \"No se ha encontrado el producto seleccionado\"}\');\n    die();\n}\n\nif($PCO_Accion == \"VENTA_eliminarProducto\") {\n\n    if($id_venta_detalle && $id_venta) {\n        $producto = PCO_EjecutarSQL(\"\n            SELECT p.inventario, vd.cantidad, p.id\n            FROM app_ventas_detalle vd, app_productos p\n            WHERE vd.id_producto = p.id AND vd.id = \'$id_venta_detalle\'\n        \")->fetch();\n        //Restablecemos el inventario\n        $inventarioNew = $producto[\"inventario\"] + $producto[\"cantidad\"];\n        PCO_EjecutarSQLUnaria(\"UPDATE app_productos SET inventario = $inventarioNew WHERE id = \" . $producto[\"id\"]);\n        PCO_EjecutarSQLUnaria(\"DELETE FROM app_ventas_detalle WHERE id_venta = $id_venta AND id = $id_venta_detalle\");\n        $result = calcularTotalVenta($id_venta);\n        print_r(\'{\"success\": true, \"msg\": \"Se ha eliminado el producto exitosamente\", \' . $result . \'}\');\n        die();\n    }\n    print_r(\'{\"success\": false, \"msg\": \"No se pudo eliminar el producto\"}\');\n    die();\n}\n\nif($PCO_Accion == \"VENTA_imprimirFactura\") {\n\n    //sleep(2);\n    echo \"$PCO_Valor\";\n    if($PCO_Valor)\n        $id = $PCO_Valor;\n    if($id) {\n        include_once \"imprimirFactura.php\";\n    }\n}','A'),(250,'/var/www/html/company/Ventaspos/mod/app_ventas/index.php','2022-05-31 20:23:00','rafael',113,4377,'<?php\n\nfunction calcularTotalVenta($id) {\n    $venta = PCO_EjecutarSQL(\"\n        SELECT SUM(precio * cantidad) as total, SUM(precio * iva/100) iva\n        FROM app_ventas_detalle\n        WHERE id_venta = \'$id\' GROUP BY id_venta\n    \")->fetch();\n    $total = $venta[\"total\"];\n    $iva = $venta[\"iva\"];\n    PCO_EjecutarSQLUnaria(\"UPDATE app_ventas SET total = $total, iva = $iva WHERE id = $id \");\n    return \'\"total\": \' . $total . \', \"iva\": \' . $iva;\n}\n\nif($PCO_Accion == \"VENTA_ingresarRealizarVenta\") {\n    $ventaAbierta = PCO_EjecutarSQL(\"\n        SELECT id, id_cliente, total, iva\n        FROM app_ventas\n        WHERE estado = 0 ORDER BY id limit 1\n    \")->fetch();\n    /*if (!$ventaAbierta[\"id\"]) {\n        \n        $ventaAbierta = PCO_EjecutarSQL(\"\n            SELECT *\n            FROM app_ventas\n            WHERE estado = 0 ORDER BY id limit 1\n        \")->fetch();   \n    }*/\n\n    $id_venta = $ventaAbierta[\"id\"] ? $ventaAbierta[\"id\"] : \"\";\n    if($id_venta) {\n        $total = number_format($ventaAbierta[\"total\"], 2);\n        $iva = number_format($ventaAbierta[\"iva\"], 2);\n        $id_cliente = $ventaAbierta[\"id_cliente\"];\n    }\n\n    PCO_CargarFormulario(8);\n}\n\nif($PCO_Accion == \"VENTA_agregarProducto\") {\n\n    if(!$id) {\n        //crear cliente en caso de que no llegue id_cliente\n        if(!$id_cliente) {\n            PCO_EjecutarSQLUnaria(\"INSERT INTO app_clientes (nombre_completo, numero_documento, telefono) VALUES (?,?,?) \",\n                \"$nombre_completo$_SeparadorCampos_$numero_documento$_SeparadorCampos_$telefono\"\n            );\n            $id_cliente = PCO_ObtenerUltimoIDInsertado();\n        }\n        PCO_EjecutarSQLUnaria(\"INSERT INTO app_ventas (id_cliente, usuario) VALUES (?,?) \", \"$id_cliente$_SeparadorCampos_$PCOSESS_LoginUsuario\");\n        $id = PCO_ObtenerUltimoIDInsertado();\n    }\n    $producto = PCO_EjecutarSQL(\"\n        SELECT id, precio_venta, iva, inventario\n        FROM app_productos\n        WHERE id = \'$id_producto\'\n    \")->fetch();\n    if($producto[\"id\"]) {\n        $existe = PCO_EjecutarSQL(\"\n            SELECT count(id)\n            FROM app_ventas_detalle\n            WHERE id_venta = $id AND id_producto = \'$id_producto\'\n        \")->fetchColumn();\n        if($existe > 0) {\n            print_r(\'{\"success\": false, \"msg\": \"El producto ya se ha ingresado\"}\');\n            die();\n        }\n        if($producto[\"inventario\"] < $cantidad) {\n            print_r(\'{\"success\": false, \"msg\": \"La cantidad digitada supera la del invetario\"}\');\n            die();\n        }\n        $inventarioNew = $producto[\"inventario\"] - $cantidad;\n        PCO_EjecutarSQLUnaria(\"UPDATE app_productos SET inventario = $inventarioNew WHERE id = \" . $producto[\"id\"]);\n        PCO_EjecutarSQLUnaria(\"INSERT INTO app_ventas_detalle (id_venta, id_producto, cantidad, precio, iva) VALUES (?,?,?,?,?) \", \n            \"$id$_SeparadorCampos_$id_producto$_SeparadorCampos_$cantidad$_SeparadorCampos_\" . $producto[\"precio_venta\"] . \"$_SeparadorCampos_\" . $producto[\"iva\"]);\n        $result = calcularTotalVenta($id);\n        print_r(\'{\"success\": true, \"id\": \' . $id . \', \' . $result . \'}\');\n        die();\n    }\n    print_r(\'{\"success\": false, \"msg\": \"No se ha encontrado el producto seleccionado\"}\');\n    die();\n}\n\nif($PCO_Accion == \"VENTA_eliminarProducto\") {\n\n    if($id_venta_detalle && $id_venta) {\n        $producto = PCO_EjecutarSQL(\"\n            SELECT p.inventario, vd.cantidad, p.id\n            FROM app_ventas_detalle vd, app_productos p\n            WHERE vd.id_producto = p.id AND vd.id = \'$id_venta_detalle\'\n        \")->fetch();\n        //Restablecemos el inventario\n        $inventarioNew = $producto[\"inventario\"] + $producto[\"cantidad\"];\n        PCO_EjecutarSQLUnaria(\"UPDATE app_productos SET inventario = $inventarioNew WHERE id = \" . $producto[\"id\"]);\n        PCO_EjecutarSQLUnaria(\"DELETE FROM app_ventas_detalle WHERE id_venta = $id_venta AND id = $id_venta_detalle\");\n        $result = calcularTotalVenta($id_venta);\n        print_r(\'{\"success\": true, \"msg\": \"Se ha eliminado el producto exitosamente\", \' . $result . \'}\');\n        die();\n    }\n    print_r(\'{\"success\": false, \"msg\": \"No se pudo eliminar el producto\"}\');\n    die();\n}\n\nif($PCO_Accion == \"VENTA_imprimirFactura\") {\n\n    //sleep(2);\n    // echo \"$PCO_Valor\";\n    if($PCO_Valor)\n        $id = $PCO_Valor;\n    if($id) {\n        include_once \"imprimirFactura.php\";\n    }\n}','A'),(251,'/var/www/html/company/Ventaspos/mod/app_ventas/index.php','2022-05-31 20:59:00','rafael',113,4399,'<?php\n\nfunction calcularTotalVenta($id) {\n    $venta = PCO_EjecutarSQL(\"\n        SELECT SUM(precio * cantidad) as total, SUM(precio * iva/100) iva\n        FROM app_ventas_detalle\n        WHERE id_venta = \'$id\' GROUP BY id_venta\n    \")->fetch();\n    $total = $venta[\"total\"];\n    $iva = $venta[\"iva\"];\n    PCO_EjecutarSQLUnaria(\"UPDATE app_ventas SET total = $total, iva = $iva WHERE id = $id \");\n    return \'\"total\": \' . $total . \', \"iva\": \' . $iva;\n}\n\nif($PCO_Accion == \"VENTA_ingresarRealizarVenta\") {\n    $ventaAbierta = PCO_EjecutarSQL(\"\n        SELECT id, id_cliente, total, iva\n        FROM app_ventas\n        WHERE estado = 0 ORDER BY id limit 1\n    \")->fetch();\n    /*if (!$ventaAbierta[\"id\"]) {\n        \n        $ventaAbierta = PCO_EjecutarSQL(\"\n            SELECT *\n            FROM app_ventas\n            WHERE estado = 0 ORDER BY id limit 1\n        \")->fetch();   \n    }*/\n\n    $id_venta = $ventaAbierta[\"id\"] ? $ventaAbierta[\"id\"] : \"\";\n    if($id_venta) {\n        $total = number_format($ventaAbierta[\"total\"], 2);\n        $iva = number_format($ventaAbierta[\"iva\"], 2);\n        $id_cliente = $ventaAbierta[\"id_cliente\"];\n    }\n\n    PCO_CargarFormulario(8, 1, \"id\", $id_venta);\n}\n\nif($PCO_Accion == \"VENTA_agregarProducto\") {\n\n    if(!$id) {\n        //crear cliente en caso de que no llegue id_cliente\n        if(!$id_cliente) {\n            PCO_EjecutarSQLUnaria(\"INSERT INTO app_clientes (nombre_completo, numero_documento, telefono) VALUES (?,?,?) \",\n                \"$nombre_completo$_SeparadorCampos_$numero_documento$_SeparadorCampos_$telefono\"\n            );\n            $id_cliente = PCO_ObtenerUltimoIDInsertado();\n        }\n        PCO_EjecutarSQLUnaria(\"INSERT INTO app_ventas (id_cliente, usuario) VALUES (?,?) \", \"$id_cliente$_SeparadorCampos_$PCOSESS_LoginUsuario\");\n        $id = PCO_ObtenerUltimoIDInsertado();\n    }\n    $producto = PCO_EjecutarSQL(\"\n        SELECT id, precio_venta, iva, inventario\n        FROM app_productos\n        WHERE id = \'$id_producto\'\n    \")->fetch();\n    if($producto[\"id\"]) {\n        $existe = PCO_EjecutarSQL(\"\n            SELECT count(id)\n            FROM app_ventas_detalle\n            WHERE id_venta = $id AND id_producto = \'$id_producto\'\n        \")->fetchColumn();\n        if($existe > 0) {\n            print_r(\'{\"success\": false, \"msg\": \"El producto ya se ha ingresado\"}\');\n            die();\n        }\n        if($producto[\"inventario\"] < $cantidad) {\n            print_r(\'{\"success\": false, \"msg\": \"La cantidad digitada supera la del invetario\"}\');\n            die();\n        }\n        $inventarioNew = $producto[\"inventario\"] - $cantidad;\n        PCO_EjecutarSQLUnaria(\"UPDATE app_productos SET inventario = $inventarioNew WHERE id = \" . $producto[\"id\"]);\n        PCO_EjecutarSQLUnaria(\"INSERT INTO app_ventas_detalle (id_venta, id_producto, cantidad, precio, iva) VALUES (?,?,?,?,?) \", \n            \"$id$_SeparadorCampos_$id_producto$_SeparadorCampos_$cantidad$_SeparadorCampos_\" . $producto[\"precio_venta\"] . \"$_SeparadorCampos_\" . $producto[\"iva\"]);\n        $result = calcularTotalVenta($id);\n        print_r(\'{\"success\": true, \"id\": \' . $id . \', \' . $result . \'}\');\n        die();\n    }\n    print_r(\'{\"success\": false, \"msg\": \"No se ha encontrado el producto seleccionado\"}\');\n    die();\n}\n\nif($PCO_Accion == \"VENTA_eliminarProducto\") {\n\n    if($id_venta_detalle && $id_venta) {\n        $producto = PCO_EjecutarSQL(\"\n            SELECT p.inventario, vd.cantidad, p.id\n            FROM app_ventas_detalle vd, app_productos p\n            WHERE vd.id_producto = p.id AND vd.id = \'$id_venta_detalle\'\n        \")->fetch();\n        //Restablecemos el inventario\n        $inventarioNew = $producto[\"inventario\"] + $producto[\"cantidad\"];\n        PCO_EjecutarSQLUnaria(\"UPDATE app_productos SET inventario = $inventarioNew WHERE id = \" . $producto[\"id\"]);\n        PCO_EjecutarSQLUnaria(\"DELETE FROM app_ventas_detalle WHERE id_venta = $id_venta AND id = $id_venta_detalle\");\n        $result = calcularTotalVenta($id_venta);\n        print_r(\'{\"success\": true, \"msg\": \"Se ha eliminado el producto exitosamente\", \' . $result . \'}\');\n        die();\n    }\n    print_r(\'{\"success\": false, \"msg\": \"No se pudo eliminar el producto\"}\');\n    die();\n}\n\nif($PCO_Accion == \"VENTA_imprimirFactura\") {\n\n    //sleep(2);\n    // echo \"$PCO_Valor\";\n    if($PCO_Valor)\n        $id = $PCO_Valor;\n    if($id) {\n        include_once \"imprimirFactura.php\";\n    }\n}','A'),(252,'/var/www/html/company/Ventaspos/mod/app_ventas/imprimirFactura.php','2022-05-31 21:01:00','rafael',188,5090,'<?php\n$medidaTicket = 280;\n\n\n$empresa = PCO_EjecutarSQL(\"\n            SELECT razon_social, nit, telefono, direccion\n            FROM app_empresa\n            WHERE id = 1\n        \")->fetch();\n\n$venta = PCO_EjecutarSQL(\"\n            SELECT date_format(fecha, \'%d-%m-%Y %H:%i:%s\') fecha, total, iva, forma_pago, devuelta, dinero_entregado, id_cliente\n            FROM app_ventas\n            WHERE id = \'$id\'\n        \")->fetch();\n\n$cliente = PCO_EjecutarSQL(\"\n            SELECT *\n            FROM app_clientes\n            WHERE id = \'\" . $venta[\"id_cliente\"] . \"\'\n        \")->fetch();\n\n$productos = PCO_EjecutarSQL(\"\n            SELECT vd.cantidad, p.nombre as descripcion, vd.precio, date_format(fecha, \'%d-%m-%Y\') \n            FROM app_ventas_detalle vd, app_productos p\n            WHERE vd.id_producto = p.id AND vd.id_venta = \'$id\'\n        \")->fetchAll();\n?>\n<!DOCTYPE html>\n<html>\n\n<head>\n\n    <style>\n        * {\n            font-size: 15px;\n            font-family: \'DejaVu Sans\', serif;\n        }\n\n        h1 {\n            font-size: 18px;\n        }\n\n        \n\n        .ticket {\n            margin: 0.5px;\n        }\n\n        td,\n        th,\n        tr,\n        table {\n            border-top: 1px solid black;\n            border-collapse: collapse;\n            margin: 0 auto;\n            font-size: 15px;\n        }\n\n        td.precio {\n            text-align: right;\n            font-size: 11px;\n        }\n\n        td.cantidad {\n            font-size: 12px;\n        }\n\n        td.producto {\n            text-align: center;\n        }\n\n        th {\n            text-align: center;\n        }\n\n\n        .centrado {\n            text-align: center;\n            align-content: center;\n        }\n\n        .ticket {\n            width: <?php echo $medidaTicket ?>px;\n            max-width: <?php echo $medidaTicket ?>px;\n        }\n\n        img {\n            max-width: inherit;\n            width: inherit;\n        }\n\n        * {\n            margin: 0;\n            padding: 0;\n        }\n\n        .ticket {\n            margin: 0;\n            padding: 0;\n        }\n\n        body {\n            text-align: center;\n        }\n    </style>\n</head>\n\n<body>\n    <div class=\"ticket centrado\">\n        <h1><?php echo $empresa[\"razon_social\"] ?></h1>\n        <h2>NIT: <?php echo $empresa[\"nit\"] ?></h2>\n        <h2>Teléfono: <?php echo $empresa[\"telefono\"] ?></h2>\n        <h2>Direccion: <?php echo $empresa[\"direccion\"] ?></h2>\n        <h2>Correo: </h2>\n        <h2>--------------------------------------------</h2>\n        <h1 align=\"center\">Ticket de venta #<?php echo $id ?></h1>\n        \n        <h2>Fecha: <?php echo $venta[\"fecha\"] ?></h2>\n        <h2>Cliente: <?php echo $cliente[\"nombre\"] ?></h2>\n        <h2>telefono: <?php echo $cliente[\"telefono\"] ?></h2>\n        <h2>CC / NIT: <?php echo $cliente[\"numero_documento\"] ?></h2>\n        <h2>Dirección: <?php echo $cliente[\"direccion\"] ?></h2>\n        <h2>Vendedor:</h2>\n        <h2>Caja N° 1</h2>\n        <br>\n\n        <table>\n            <thead>\n                <tr class=\"centrado\">\n                    <th class=\"cantidad\">CANT</th>\n                    <th class=\"producto\">PRODUCTO</th>\n                    <th class=\"precio\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;TOTAL</th>\n                </tr>\n            </thead>\n            <tbody>\n                <?php\n                $total = 0;\n                foreach ($productos as $producto) {\n                    $total += $producto[\"cantidad\"] * $producto[\"precio\"];\n                ?>\n                    <tr>\n                        <td class=\"cantidad\"><?php echo number_format($producto[\"cantidad\"], 2) ?></td>\n                        <td class=\"producto\"><?php echo $producto[\"descripcion\"] ?></td>\n                        <td class=\"precio\">$<?php echo number_format($producto[\"precio\"], 2) ?></td>\n                    </tr>\n                <?php } ?>\n            </tbody>\n            \n            <tr>\n                <td class=\"cantidad\"></td>\n                <td class=\"producto\">\n                <br>\n                    <strong>SUBTOTAL</strong>\n\n                    <p></p>\n                    <strong>TOTAL A PAGAR</strong>\n                    <p></p>\n                    <strong>FORMA DE PAGO</strong>\n                    <p></p>\n                    <strong>CAMBIO</strong>\n                    \n                </td>\n                \n                <th class=\"precio\">\n                    $<?php echo number_format($venta[\"total\"] - $venta[\"iva\"], 2) ?>\n                    <p></p>\n                    $<?php echo number_format($venta[\"total\"], 2) ?>\n                    <p><?php echo $venta[\"dinero_entregado\"] ?></p>\n                    <p></p>\n                    <p><?php echo $venta[\"forma_pago\"] ?></p>\n\n                    <p></p>\n                    $<?php echo $venta[\"devuelta\"] ?>\n                    \n                </th>\n            </tr>\n        </table>\n        <br>\n        <p class=\"centrado\">¡GRACIAS POR SU COMPRA! </P>\n        <br>\n            <P>Elaborado por www.cloudecoway.com</p>\n            <P>Tel: 3137010627</p>\n\n    </div>\n</body>\n\n</html>','A'),(253,'/var/www/html/company/Ventaspos/mod/app_ventas/imprimirFactura.php','2022-05-31 21:01:00','rafael',188,5094,'<?php\n$medidaTicket = 280;\n\n\n$empresa = PCO_EjecutarSQL(\"\n            SELECT razon_social, nit, telefono, direccion\n            FROM app_empresa\n            WHERE id = 1\n        \")->fetch();\n\n$venta = PCO_EjecutarSQL(\"\n            SELECT date_format(fecha, \'%d-%m-%Y %H:%i:%s\') fecha, total, iva, forma_pago, devuelta, dinero_entregado, id_cliente\n            FROM app_ventas\n            WHERE id = \'$id\'\n        \")->fetch();\n\n$cliente = PCO_EjecutarSQL(\"\n            SELECT *\n            FROM app_clientes\n            WHERE id = \'\" . $venta[\"id_cliente\"] . \"\'\n        \")->fetch();\n\n$productos = PCO_EjecutarSQL(\"\n            SELECT vd.cantidad, p.nombre as descripcion, vd.precio, date_format(fecha, \'%d-%m-%Y\') \n            FROM app_ventas_detalle vd, app_productos p\n            WHERE vd.id_producto = p.id AND vd.id_venta = \'$id\'\n        \")->fetchAll();\n?>\n<!DOCTYPE html>\n<html>\n\n<head>\n\n    <style>\n        * {\n            font-size: 15px;\n            font-family: \'DejaVu Sans\', serif;\n        }\n\n        h1 {\n            font-size: 18px;\n        }\n\n        \n\n        .ticket {\n            margin: 0.5px;\n        }\n\n        td,\n        th,\n        tr,\n        table {\n            border-top: 1px solid black;\n            border-collapse: collapse;\n            margin: 0 auto;\n            font-size: 15px;\n        }\n\n        td.precio {\n            text-align: right;\n            font-size: 11px;\n        }\n\n        td.cantidad {\n            font-size: 12px;\n        }\n\n        td.producto {\n            text-align: center;\n        }\n\n        th {\n            text-align: center;\n        }\n\n\n        .centrado {\n            text-align: center;\n            align-content: center;\n        }\n\n        .ticket {\n            width: <?php echo $medidaTicket ?>px;\n            max-width: <?php echo $medidaTicket ?>px;\n        }\n\n        img {\n            max-width: inherit;\n            width: inherit;\n        }\n\n        * {\n            margin: 0;\n            padding: 0;\n        }\n\n        .ticket {\n            margin: 0;\n            padding: 0;\n        }\n\n        body {\n            text-align: center;\n        }\n    </style>\n</head>\n\n<body>\n    <div class=\"ticket centrado\">\n        <h1><?php echo $empresa[\"razon_social\"] ?></h1>\n        <h2>NIT: <?php echo $empresa[\"nit\"] ?></h2>\n        <h2>Teléfono: <?php echo $empresa[\"telefono\"] ?></h2>\n        <h2>Direccion: <?php echo $empresa[\"direccion\"] ?></h2>\n        <h2>Correo: </h2>\n        <h2>--------------------------------------------</h2>\n        <h1 align=\"center\">Ticket de venta #<?php echo $id ?></h1>\n        \n        <h2>Fecha: <?php echo $venta[\"fecha\"] ?></h2>\n        <h2>Cliente: <?php echo $cliente[\"nombre\"] ?></h2>\n        <h2>telefono: <?php echo $cliente[\"telefono\"] ?></h2>\n        <h2>CC / NIT: <?php echo $cliente[\"numero_documento\"] ?></h2>\n        <h2>Dirección: <?php echo $cliente[\"direccion\"] ?></h2>\n        <h2>Vendedor:</h2>\n        <h2>Caja N° 1</h2>\n        <br>\n\n        <table>\n            <thead>\n                <tr class=\"centrado\">\n                    <th class=\"cantidad\">CANT</th>\n                    <th class=\"producto\">PRODUCTO</th>\n                    <th class=\"precio\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;TOTAL</th>\n                </tr>\n            </thead>\n            <tbody>\n                <?php\n                $total = 0;\n                foreach ($productos as $producto) {\n                    $total += $producto[\"cantidad\"] * $producto[\"precio\"];\n                ?>\n                    <tr>\n                        <td class=\"cantidad\"><?php echo number_format($producto[\"cantidad\"], 2) ?></td>\n                        <td class=\"producto\"><?php echo $producto[\"descripcion\"] ?></td>\n                        <td class=\"precio\">$<?php echo number_format($producto[\"precio\"], 2) ?></td>\n                    </tr>\n                <?php } ?>\n            </tbody>\n            \n            <tr>\n                <td class=\"cantidad\"></td>\n                <td class=\"producto\">\n                <br>\n                    <strong>SUBTOTAL</strong>\n\n                    <p></p>\n                    <strong>TOTAL A PAGAR</strong>\n                    <p></p>\n                    <strong>FORMA DE PAGO</strong>\n                    <p></p>\n                    <strong>CAMBIO</strong>\n                    \n                </td>\n                \n                <th class=\"precio\">\n                    $<?php echo number_format($venta[\"total\"] - $venta[\"iva\"], 2) ?>\n                    <p></p>\n                    $<?php echo number_format($venta[\"total\"], 2) ?>\n                    <p><?php echo $venta[\"dinero_entregado\"] ?></p>\n                    <p></p><BR>\n                    <p><?php echo $venta[\"forma_pago\"] ?></p>\n\n                    <p></p>\n                    $<?php echo $venta[\"devuelta\"] ?>\n                    \n                </th>\n            </tr>\n        </table>\n        <br>\n        <p class=\"centrado\">¡GRACIAS POR SU COMPRA! </P>\n        <br>\n            <P>Elaborado por www.cloudecoway.com</p>\n            <P>Tel: 3137010627</p>\n\n    </div>\n</body>\n\n</html>','A'),(254,'/var/www/html/company/Ventaspos/mod/app_ventas/imprimirFactura.php','2022-05-31 21:01:00','rafael',188,5094,'<?php\n$medidaTicket = 280;\n\n\n$empresa = PCO_EjecutarSQL(\"\n            SELECT razon_social, nit, telefono, direccion\n            FROM app_empresa\n            WHERE id = 1\n        \")->fetch();\n\n$venta = PCO_EjecutarSQL(\"\n            SELECT date_format(fecha, \'%d-%m-%Y %H:%i:%s\') fecha, total, iva, forma_pago, devuelta, dinero_entregado, id_cliente\n            FROM app_ventas\n            WHERE id = \'$id\'\n        \")->fetch();\n\n$cliente = PCO_EjecutarSQL(\"\n            SELECT *\n            FROM app_clientes\n            WHERE id = \'\" . $venta[\"id_cliente\"] . \"\'\n        \")->fetch();\n\n$productos = PCO_EjecutarSQL(\"\n            SELECT vd.cantidad, p.nombre as descripcion, vd.precio, date_format(fecha, \'%d-%m-%Y\') \n            FROM app_ventas_detalle vd, app_productos p\n            WHERE vd.id_producto = p.id AND vd.id_venta = \'$id\'\n        \")->fetchAll();\n?>\n<!DOCTYPE html>\n<html>\n\n<head>\n\n    <style>\n        * {\n            font-size: 15px;\n            font-family: \'DejaVu Sans\', serif;\n        }\n\n        h1 {\n            font-size: 18px;\n        }\n\n        \n\n        .ticket {\n            margin: 0.5px;\n        }\n\n        td,\n        th,\n        tr,\n        table {\n            border-top: 1px solid black;\n            border-collapse: collapse;\n            margin: 0 auto;\n            font-size: 15px;\n        }\n\n        td.precio {\n            text-align: right;\n            font-size: 11px;\n        }\n\n        td.cantidad {\n            font-size: 12px;\n        }\n\n        td.producto {\n            text-align: center;\n        }\n\n        th {\n            text-align: center;\n        }\n\n\n        .centrado {\n            text-align: center;\n            align-content: center;\n        }\n\n        .ticket {\n            width: <?php echo $medidaTicket ?>px;\n            max-width: <?php echo $medidaTicket ?>px;\n        }\n\n        img {\n            max-width: inherit;\n            width: inherit;\n        }\n\n        * {\n            margin: 0;\n            padding: 0;\n        }\n\n        .ticket {\n            margin: 0;\n            padding: 0;\n        }\n\n        body {\n            text-align: center;\n        }\n    </style>\n</head>\n\n<body>\n    <div class=\"ticket centrado\">\n        <h1><?php echo $empresa[\"razon_social\"] ?></h1>\n        <h2>NIT: <?php echo $empresa[\"nit\"] ?></h2>\n        <h2>Teléfono: <?php echo $empresa[\"telefono\"] ?></h2>\n        <h2>Direccion: <?php echo $empresa[\"direccion\"] ?></h2>\n        <h2>Correo: </h2>\n        <h2>--------------------------------------------</h2>\n        <h1 align=\"center\">Ticket de venta #<?php echo $id ?></h1>\n        \n        <h2>Fecha: <?php echo $venta[\"fecha\"] ?></h2>\n        <h2>Cliente: <?php echo $cliente[\"nombre\"] ?></h2>\n        <h2>telefono: <?php echo $cliente[\"telefono\"] ?></h2>\n        <h2>CC / NIT: <?php echo $cliente[\"numero_documento\"] ?></h2>\n        <h2>Dirección: <?php echo $cliente[\"direccion\"] ?></h2>\n        <h2>Vendedor:</h2>\n        <h2>Caja N° 1</h2>\n        <br>\n\n        <table>\n            <thead>\n                <tr class=\"centrado\">\n                    <th class=\"cantidad\">CANT</th>\n                    <th class=\"producto\">PRODUCTO</th>\n                    <th class=\"precio\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;TOTAL</th>\n                </tr>\n            </thead>\n            <tbody>\n                <?php\n                $total = 0;\n                foreach ($productos as $producto) {\n                    $total += $producto[\"cantidad\"] * $producto[\"precio\"];\n                ?>\n                    <tr>\n                        <td class=\"cantidad\"><?php echo number_format($producto[\"cantidad\"], 2) ?></td>\n                        <td class=\"producto\"><?php echo $producto[\"descripcion\"] ?></td>\n                        <td class=\"precio\">$<?php echo number_format($producto[\"precio\"], 2) ?></td>\n                    </tr>\n                <?php } ?>\n            </tbody>\n            \n            <tr>\n                <td class=\"cantidad\"></td>\n                <td class=\"producto\">\n                <br>\n                    <strong>SUBTOTAL</strong>\n\n                    <p></p>\n                    <strong>TOTAL A PAGAR</strong>\n                    <p></p>\n                    <strong>FORMA DE PAGO</strong>\n                    <p></p>\n                    <strong>CAMBIO</strong>\n                    \n                </td>\n                \n                <th class=\"precio\">\n                    $<?php echo number_format($venta[\"total\"] - $venta[\"iva\"], 2) ?>\n                    <p></p>\n                    $<?php echo number_format($venta[\"total\"], 2) ?>\n                    <p><?php echo $venta[\"dinero_entregado\"] ?></p>\n                    <BR>\n                    <p><?php echo $venta[\"forma_pago\"] ?></p>\n\n                    <p></p>\n                    $<?php echo $venta[\"devuelta\"] ?>\n                    \n                </th>\n            </tr>\n        </table>\n        <br>\n        <p class=\"centrado\">¡GRACIAS POR SU COMPRA! </P>\n        <br>\n            <P>Elaborado por www.cloudecoway.com</p>\n            <P>Tel: 3137010627</p>\n\n    </div>\n</body>\n\n</html>','A'),(255,'/var/www/html/company/Ventaspos/mod/app_ventas/imprimirFactura.php','2022-05-31 21:02:00','rafael',188,5090,'<?php\n$medidaTicket = 280;\n\n\n$empresa = PCO_EjecutarSQL(\"\n            SELECT razon_social, nit, telefono, direccion\n            FROM app_empresa\n            WHERE id = 1\n        \")->fetch();\n\n$venta = PCO_EjecutarSQL(\"\n            SELECT date_format(fecha, \'%d-%m-%Y %H:%i:%s\') fecha, total, iva, forma_pago, devuelta, dinero_entregado, id_cliente\n            FROM app_ventas\n            WHERE id = \'$id\'\n        \")->fetch();\n\n$cliente = PCO_EjecutarSQL(\"\n            SELECT *\n            FROM app_clientes\n            WHERE id = \'\" . $venta[\"id_cliente\"] . \"\'\n        \")->fetch();\n\n$productos = PCO_EjecutarSQL(\"\n            SELECT vd.cantidad, p.nombre as descripcion, vd.precio, date_format(fecha, \'%d-%m-%Y\') \n            FROM app_ventas_detalle vd, app_productos p\n            WHERE vd.id_producto = p.id AND vd.id_venta = \'$id\'\n        \")->fetchAll();\n?>\n<!DOCTYPE html>\n<html>\n\n<head>\n\n    <style>\n        * {\n            font-size: 15px;\n            font-family: \'DejaVu Sans\', serif;\n        }\n\n        h1 {\n            font-size: 18px;\n        }\n\n        \n\n        .ticket {\n            margin: 0.5px;\n        }\n\n        td,\n        th,\n        tr,\n        table {\n            border-top: 1px solid black;\n            border-collapse: collapse;\n            margin: 0 auto;\n            font-size: 15px;\n        }\n\n        td.precio {\n            text-align: right;\n            font-size: 11px;\n        }\n\n        td.cantidad {\n            font-size: 12px;\n        }\n\n        td.producto {\n            text-align: center;\n        }\n\n        th {\n            text-align: center;\n        }\n\n\n        .centrado {\n            text-align: center;\n            align-content: center;\n        }\n\n        .ticket {\n            width: <?php echo $medidaTicket ?>px;\n            max-width: <?php echo $medidaTicket ?>px;\n        }\n\n        img {\n            max-width: inherit;\n            width: inherit;\n        }\n\n        * {\n            margin: 0;\n            padding: 0;\n        }\n\n        .ticket {\n            margin: 0;\n            padding: 0;\n        }\n\n        body {\n            text-align: center;\n        }\n    </style>\n</head>\n\n<body>\n    <div class=\"ticket centrado\">\n        <h1><?php echo $empresa[\"razon_social\"] ?></h1>\n        <h2>NIT: <?php echo $empresa[\"nit\"] ?></h2>\n        <h2>Teléfono: <?php echo $empresa[\"telefono\"] ?></h2>\n        <h2>Direccion: <?php echo $empresa[\"direccion\"] ?></h2>\n        <h2>Correo: </h2>\n        <h2>--------------------------------------------</h2>\n        <h1 align=\"center\">Ticket de venta #<?php echo $id ?></h1>\n        \n        <h2>Fecha: <?php echo $venta[\"fecha\"] ?></h2>\n        <h2>Cliente: <?php echo $cliente[\"nombre\"] ?></h2>\n        <h2>telefono: <?php echo $cliente[\"telefono\"] ?></h2>\n        <h2>CC / NIT: <?php echo $cliente[\"numero_documento\"] ?></h2>\n        <h2>Dirección: <?php echo $cliente[\"direccion\"] ?></h2>\n        <h2>Vendedor:</h2>\n        <h2>Caja N° 1</h2>\n        <br>\n\n        <table>\n            <thead>\n                <tr class=\"centrado\">\n                    <th class=\"cantidad\">CANT</th>\n                    <th class=\"producto\">PRODUCTO</th>\n                    <th class=\"precio\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;TOTAL</th>\n                </tr>\n            </thead>\n            <tbody>\n                <?php\n                $total = 0;\n                foreach ($productos as $producto) {\n                    $total += $producto[\"cantidad\"] * $producto[\"precio\"];\n                ?>\n                    <tr>\n                        <td class=\"cantidad\"><?php echo number_format($producto[\"cantidad\"], 2) ?></td>\n                        <td class=\"producto\"><?php echo $producto[\"descripcion\"] ?></td>\n                        <td class=\"precio\">$<?php echo number_format($producto[\"precio\"], 2) ?></td>\n                    </tr>\n                <?php } ?>\n            </tbody>\n            \n            <tr>\n                <td class=\"cantidad\"></td>\n                <td class=\"producto\">\n                <br>\n                    <strong>SUBTOTAL</strong>\n\n                    <p></p>\n                    <strong>TOTAL A PAGAR</strong>\n                    <p></p>\n                    <strong>FORMA DE PAGO</strong>\n                    <p></p>\n                    <strong>CAMBIO</strong>\n                    \n                </td>\n                \n                <th class=\"precio\">\n                    $<?php echo number_format($venta[\"total\"] - $venta[\"iva\"], 2) ?>\n                    <p></p>\n                    $<?php echo number_format($venta[\"total\"], 2) ?>\n                    <p><?php echo $venta[\"dinero_entregado\"] ?></p>\n                    <p></p>\n                    <p><?php echo $venta[\"forma_pago\"] ?></p>\n\n                    <p></p>\n                    $<?php echo $venta[\"devuelta\"] ?>\n                    \n                </th>\n            </tr>\n        </table>\n        <br>\n        <p class=\"centrado\">¡GRACIAS POR SU COMPRA! </P>\n        <br>\n            <P>Elaborado por www.cloudecoway.com</p>\n            <P>Tel: 3137010627</p>\n\n    </div>\n</body>\n\n</html>','A'),(256,'/var/www/html/company/Ventaspos/mod/app_ventas/imprimirFactura.php','2022-05-31 21:07:00','rafael',188,5091,'<?php\n$medidaTicket = 280;\n\n\n$empresa = PCO_EjecutarSQL(\"\n            SELECT razon_social, nit, telefono, direccion\n            FROM app_empresa\n            WHERE id = 1\n        \")->fetch();\n\n$venta = PCO_EjecutarSQL(\"\n            SELECT date_format(fecha, \'%d-%m-%Y %H:%i:%s\') fecha, total, iva, forma_pago, devuelta, dinero_entregado, id_cliente\n            FROM app_ventas\n            WHERE id = \'$id\'\n        \")->fetch();\n\n$cliente = PCO_EjecutarSQL(\"\n            SELECT *\n            FROM app_clientes\n            WHERE id = \'\" . $venta[\"id_cliente\"] . \"\'\n        \")->fetch();\n\n$productos = PCO_EjecutarSQL(\"\n            SELECT vd.cantidad, p.nombre as descripcion, vd.precio, date_format(fecha, \'%d-%m-%Y\') \n            FROM app_ventas_detalle vd, app_productos p\n            WHERE vd.id_producto = p.id AND vd.id_venta = \'$id\'\n        \")->fetchAll();\n?>\n<!DOCTYPE html>\n<html>\n\n<head>\n\n    <style>\n        * {\n            font-size: 15px;\n            font-family: \'DejaVu Sans\', serif;\n        }\n\n        h1 {\n            font-size: 18px;\n        }\n\n        \n\n        .ticket {\n            margin: 0.5px;\n        }\n\n        td,\n        th,\n        tr,\n        table {\n            border-top: 1px solid black;\n            border-collapse: collapse;\n            margin: 0 auto;\n            font-size: 15px;\n        }\n\n        td.precio {\n            text-align: right;\n            font-size: 11px;\n        }\n\n        td.cantidad {\n            font-size: 12px;\n        }\n\n        td.producto {\n            text-align: center;\n        }\n\n        th {\n            text-align: center;\n        }\n\n\n        .centrado {\n            text-align: center;\n            align-content: center;\n        }\n\n        .ticket {\n            width: <?php echo $medidaTicket ?>px;\n            max-width: <?php echo $medidaTicket ?>px;\n        }\n\n        img {\n            max-width: inherit;\n            width: inherit;\n        }\n\n        * {\n            margin: 0;\n            padding: 0;\n        }\n\n        .ticket {\n            margin: 0;\n            padding: 0;\n        }\n\n        body {\n            text-align: center;\n        }\n    </style>\n</head>\n\n<body>\n    <div class=\"ticket centrado\">\n        <h1><?php echo $empresa[\"razon_social\"] ?></h1>\n        <h2>NIT: <?php echo $empresa[\"nit\"] ?></h2>\n        <h2>Teléfono: <?php echo $empresa[\"telefono\"] ?></h2>\n        <h2>Direccion: <?php echo $empresa[\"direccion\"] ?></h2>\n        <h2>Correo: </h2>\n        <h2>--------------------------------------------</h2>\n        <h1 align=\"center\">Ticket de venta #<?php echo $id ?></h1>\n        \n        <h2>Fecha: <?php echo $venta[\"fecha\"] ?></h2>\n        <h2>Cliente: <?php echo $cliente[\"nombre\"] ?></h2>\n        <h2>telefono: <?php echo $cliente[\"telefono\"] ?></h2>\n        <h2>CC / NIT: <?php echo $cliente[\"numero_documento\"] ?></h2>\n        <h2>Dirección: <?php echo $cliente[\"direccion\"] ?></h2>\n        <h2>Vendedor:</h2>\n        <h2>Caja N° 1</h2>\n        <br>\n\n        <table>\n            <thead>\n                <tr class=\"centrado\">\n                    <th class=\"cantidad\">CANT</th>\n                    <th class=\"producto\">PRODUCTO</th>\n                    <th class=\"precio\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;TOTAL</th>\n                </tr>\n            </thead>\n            <tbody>\n                <?php\n                $total = 0;\n                foreach ($productos as $producto) {\n                    $total += $producto[\"cantidad\"] * $producto[\"precio\"];\n                ?>\n                    <tr>\n                        <td class=\"cantidad\"><?php echo number_format($producto[\"cantidad\"], 2) ?></td>\n                        <td class=\"producto\"><?php echo $producto[\"descripcion\"] ?></td>\n                        <td class=\"precio\">$<?php echo number_format($producto[\"precio\"], 2) ?></td>\n                    </tr>\n                <?php } ?>\n            </tbody>\n            \n            <tr>\n                <td class=\"cantidad\"></td>\n                <td class=\"producto\">\n                <br>\n                    <strong>SUBTOTAL</strong>\n\n                    <p></p>\n                    <strong>TOTAL A PAGAR</strong>\n                    <p></p>\n                    <strong>FORMA DE PAGO</strong>\n                    <p></p>\n                    <strong>CAMBIO</strong>\n                    \n                </td>\n                \n                <th class=\"precio\">\n                    $<?php echo number_format($venta[\"total\"] - $venta[\"iva\"], 2) ?>\n                    <p></p>\n                    $<?php echo number_format($venta[\"total\"], 2) ?>\n                    <p>$<?php echo $venta[\"dinero_entregado\"] ?></p>\n                    <p></p>\n                    <p><?php echo $venta[\"forma_pago\"] ?></p>\n\n                    <p></p>\n                    $<?php echo $venta[\"devuelta\"] ?>\n                    \n                </th>\n            </tr>\n        </table>\n        <br>\n        <p class=\"centrado\">¡GRACIAS POR SU COMPRA! </P>\n        <br>\n            <P>Elaborado por www.cloudecoway.com</p>\n            <P>Tel: 3137010627</p>\n\n    </div>\n</body>\n\n</html>','A'),(257,'/var/www/html/company/Ventaspos/mod/app_ventas/imprimirFactura.php','2022-05-31 21:08:00','rafael',188,5115,'<?php\n$medidaTicket = 280;\n\n\n$empresa = PCO_EjecutarSQL(\"\n            SELECT razon_social, nit, telefono, direccion\n            FROM app_empresa\n            WHERE id = 1\n        \")->fetch();\n\n$venta = PCO_EjecutarSQL(\"\n            SELECT date_format(fecha, \'%d-%m-%Y %H:%i:%s\') fecha, total, iva, forma_pago, devuelta, dinero_entregado, id_cliente\n            FROM app_ventas\n            WHERE id = \'$id\'\n        \")->fetch();\n\n$cliente = PCO_EjecutarSQL(\"\n            SELECT *\n            FROM app_clientes\n            WHERE id = \'\" . $venta[\"id_cliente\"] . \"\'\n        \")->fetch();\n\n$productos = PCO_EjecutarSQL(\"\n            SELECT vd.cantidad, p.nombre as descripcion, vd.precio, date_format(fecha, \'%d-%m-%Y\') \n            FROM app_ventas_detalle vd, app_productos p\n            WHERE vd.id_producto = p.id AND vd.id_venta = \'$id\'\n        \")->fetchAll();\n?>\n<!DOCTYPE html>\n<html>\n\n<head>\n\n    <style>\n        * {\n            font-size: 15px;\n            font-family: \'DejaVu Sans\', serif;\n        }\n\n        h1 {\n            font-size: 18px;\n        }\n\n        \n\n        .ticket {\n            margin: 0.5px;\n        }\n\n        td,\n        th,\n        tr,\n        table {\n            border-top: 1px solid black;\n            border-collapse: collapse;\n            margin: 0 auto;\n            font-size: 15px;\n        }\n\n        td.precio {\n            text-align: right;\n            font-size: 11px;\n        }\n\n        td.cantidad {\n            font-size: 12px;\n        }\n\n        td.producto {\n            text-align: center;\n        }\n\n        th {\n            text-align: center;\n        }\n\n\n        .centrado {\n            text-align: center;\n            align-content: center;\n        }\n\n        .ticket {\n            width: <?php echo $medidaTicket ?>px;\n            max-width: <?php echo $medidaTicket ?>px;\n        }\n\n        img {\n            max-width: inherit;\n            width: inherit;\n        }\n\n        * {\n            margin: 0;\n            padding: 0;\n        }\n\n        .ticket {\n            margin: 0;\n            padding: 0;\n        }\n\n        body {\n            text-align: center;\n        }\n    </style>\n</head>\n\n<body>\n    <div class=\"ticket centrado\">\n        <h1><?php echo $empresa[\"razon_social\"] ?></h1>\n        <h2>NIT: <?php echo $empresa[\"nit\"] ?></h2>\n        <h2>Teléfono: <?php echo $empresa[\"telefono\"] ?></h2>\n        <h2>Direccion: <?php echo $empresa[\"direccion\"] ?></h2>\n        <h2>Correo: </h2>\n        <h2>--------------------------------------------</h2>\n        <h1 align=\"center\">Ticket de venta #<?php echo $id ?></h1>\n        \n        <h2>Fecha: <?php echo $venta[\"fecha\"] ?></h2>\n        <h2>Cliente: <?php echo $cliente[\"nombre\"] ?></h2>\n        <h2>telefono: <?php echo $cliente[\"telefono\"] ?></h2>\n        <h2>CC / NIT: <?php echo $cliente[\"numero_documento\"] ?></h2>\n        <h2>Dirección: <?php echo $cliente[\"direccion\"] ?></h2>\n        <h2>Vendedor:</h2>\n        <h2>Caja N° 1</h2>\n        <br>\n\n        <table>\n            <thead>\n                <tr class=\"centrado\">\n                    <th class=\"cantidad\">CANT</th>\n                    <th class=\"producto\">PRODUCTO</th>\n                    <th class=\"precio\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;TOTAL</th>\n                </tr>\n            </thead>\n            <tbody>\n                <?php\n                $total = 0;\n                foreach ($productos as $producto) {\n                    $total += $producto[\"cantidad\"] * $producto[\"precio\"];\n                ?>\n                    <tr>\n                        <td class=\"cantidad\"><?php echo number_format($producto[\"cantidad\"], 2) ?></td>\n                        <td class=\"producto\"><?php echo $producto[\"descripcion\"] ?></td>\n                        <td class=\"precio\">$<?php echo number_format($producto[\"precio\"], 2) ?></td>\n                    </tr>\n                <?php } ?>\n            </tbody>\n            \n            <tr>\n                <td class=\"cantidad\"></td>\n                <td class=\"producto\">\n                <br>\n                    <strong>SUBTOTAL</strong>\n\n                    <p></p>\n                    <strong>TOTAL A PAGAR</strong>\n                    <p></p>\n                    <strong>FORMA DE PAGO</strong>\n                    <p></p>\n                    <strong>CAMBIO</strong>\n                    \n                </td>\n                \n                <th class=\"precio\">\n                    $<?php echo number_format($venta[\"total\"] - $venta[\"iva\"], 2) ?>\n                    <p></p>\n                    $<?php echo number_format($venta[\"total\"], 2) ?>\n                    <p>$<?php echo $venta[\"dinero_entregado\"] ?></p>\n                    <p></p>\n                    <p><?php echo $venta[\"forma_pago\"] ?></p>\n                    <BR>\n                    <p></p>\n                    $<?php echo $venta[\"devuelta\"] ?>\n                    \n                </th>\n            </tr>\n        </table>\n        <br>\n        <p class=\"centrado\">¡GRACIAS POR SU COMPRA! </P>\n        <br>\n            <P>Elaborado por www.cloudecoway.com</p>\n            <P>Tel: 3137010627</p>\n\n    </div>\n</body>\n\n</html>','A'),(258,'/var/www/html/company/Ventaspos/mod/app_ventas/imprimirFactura.php','2022-05-31 21:08:00','rafael',189,5138,'<?php\n$medidaTicket = 280;\n\n\n$empresa = PCO_EjecutarSQL(\"\n            SELECT razon_social, nit, telefono, direccion\n            FROM app_empresa\n            WHERE id = 1\n        \")->fetch();\n\n$venta = PCO_EjecutarSQL(\"\n            SELECT date_format(fecha, \'%d-%m-%Y %H:%i:%s\') fecha, total, iva, forma_pago, devuelta, dinero_entregado, id_cliente\n            FROM app_ventas\n            WHERE id = \'$id\'\n        \")->fetch();\n\n$cliente = PCO_EjecutarSQL(\"\n            SELECT *\n            FROM app_clientes\n            WHERE id = \'\" . $venta[\"id_cliente\"] . \"\'\n        \")->fetch();\n\n$productos = PCO_EjecutarSQL(\"\n            SELECT vd.cantidad, p.nombre as descripcion, vd.precio, date_format(fecha, \'%d-%m-%Y\') \n            FROM app_ventas_detalle vd, app_productos p\n            WHERE vd.id_producto = p.id AND vd.id_venta = \'$id\'\n        \")->fetchAll();\n?>\n<!DOCTYPE html>\n<html>\n\n<head>\n\n    <style>\n        * {\n            font-size: 15px;\n            font-family: \'DejaVu Sans\', serif;\n        }\n\n        h1 {\n            font-size: 18px;\n        }\n\n        \n\n        .ticket {\n            margin: 0.5px;\n        }\n\n        td,\n        th,\n        tr,\n        table {\n            border-top: 1px solid black;\n            border-collapse: collapse;\n            margin: 0 auto;\n            font-size: 15px;\n        }\n\n        td.precio {\n            text-align: right;\n            font-size: 11px;\n        }\n\n        td.cantidad {\n            font-size: 12px;\n        }\n\n        td.producto {\n            text-align: center;\n        }\n\n        th {\n            text-align: center;\n        }\n\n\n        .centrado {\n            text-align: center;\n            align-content: center;\n        }\n\n        .ticket {\n            width: <?php echo $medidaTicket ?>px;\n            max-width: <?php echo $medidaTicket ?>px;\n        }\n\n        img {\n            max-width: inherit;\n            width: inherit;\n        }\n\n        * {\n            margin: 0;\n            padding: 0;\n        }\n\n        .ticket {\n            margin: 0;\n            padding: 0;\n        }\n\n        body {\n            text-align: center;\n        }\n    </style>\n</head>\n\n<body>\n    <div class=\"ticket centrado\">\n        <h1><?php echo $empresa[\"razon_social\"] ?></h1>\n        <h2>NIT: <?php echo $empresa[\"nit\"] ?></h2>\n        <h2>Teléfono: <?php echo $empresa[\"telefono\"] ?></h2>\n        <h2>Direccion: <?php echo $empresa[\"direccion\"] ?></h2>\n        <h2>Correo: </h2>\n        <h2>--------------------------------------------</h2>\n        <h1 align=\"center\">Ticket de venta #<?php echo $id ?></h1>\n        \n        <h2>Fecha: <?php echo $venta[\"fecha\"] ?></h2>\n        <h2>Cliente: <?php echo $cliente[\"nombre\"] ?></h2>\n        <h2>telefono: <?php echo $cliente[\"telefono\"] ?></h2>\n        <h2>CC / NIT: <?php echo $cliente[\"numero_documento\"] ?></h2>\n        <h2>Dirección: <?php echo $cliente[\"direccion\"] ?></h2>\n        <h2>Vendedor:</h2>\n        <h2>Caja N° 1</h2>\n        <br>\n\n        <table>\n            <thead>\n                <tr class=\"centrado\">\n                    <th class=\"cantidad\">CANT</th>\n                    <th class=\"producto\">PRODUCTO</th>\n                    <th class=\"precio\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;TOTAL</th>\n                </tr>\n            </thead>\n            <tbody>\n                <?php\n                $total = 0;\n                foreach ($productos as $producto) {\n                    $total += $producto[\"cantidad\"] * $producto[\"precio\"];\n                ?>\n                    <tr>\n                        <td class=\"cantidad\"><?php echo number_format($producto[\"cantidad\"], 2) ?></td>\n                        <td class=\"producto\"><?php echo $producto[\"descripcion\"] ?></td>\n                        <td class=\"precio\">$<?php echo number_format($producto[\"precio\"], 2) ?></td>\n                    </tr>\n                <?php } ?>\n            </tbody>\n            \n            <tr>\n                <td class=\"cantidad\"></td>\n                <td class=\"producto\">\n                <br>\n                    <strong>SUBTOTAL</strong>\n\n                    <p></p>\n                    <strong>TOTAL A PAGAR</strong>\n                    <p></p>\n                    <strong>FORMA DE PAGO</strong>\n                    <p></p>\n                    <strong>CAMBIO</strong>\n                    \n                </td>\n                \n                <th class=\"precio\">\n                    <BR>\n                    $<?php echo number_format($venta[\"total\"] - $venta[\"iva\"], 2) ?>\n                    <p></p>\n                    $<?php echo number_format($venta[\"total\"], 2) ?>\n                    <p>$<?php echo $venta[\"dinero_entregado\"] ?></p>\n                    <p></p>\n                    <p><?php echo $venta[\"forma_pago\"] ?></p>\n                    <BR>\n                    <p></p>\n                    $<?php echo $venta[\"devuelta\"] ?>\n                    \n                </th>\n            </tr>\n        </table>\n        <br>\n        <p class=\"centrado\">¡GRACIAS POR SU COMPRA! </P>\n        <br>\n            <P>Elaborado por www.cloudecoway.com</p>\n            <P>Tel: 3137010627</p>\n\n    </div>\n</body>\n\n</html>','A'),(259,'/var/www/html/company/Ventaspos/mod/app_ventas/imprimirFactura.php','2022-05-31 22:13:00','rafael',189,5149,'<?php\n$medidaTicket = 280;\n\n\n$empresa = PCO_EjecutarSQL(\"\n            SELECT razon_social, nit, telefono, direccion\n            FROM app_empresa\n            WHERE id = 1\n        \")->fetch();\n\n$venta = PCO_EjecutarSQL(\"\n            SELECT date_format(fecha, \'%d-%m-%Y %H:%i:%s\') fecha, total, iva, forma_pago, devuelta, dinero_entregado, id_cliente\n            FROM app_ventas\n            WHERE id = \'$id\'\n        \")->fetch();\n\n$cliente = PCO_EjecutarSQL(\"\n            SELECT *\n            FROM app_clientes\n            WHERE id = \'\" . $venta[\"id_cliente\"] . \"\'\n        \")->fetch();\n\n$productos = PCO_EjecutarSQL(\"\n            SELECT vd.cantidad, p.nombre as descripcion, vd.precio, date_format(fecha, \'%d-%m-%Y\') \n            FROM app_ventas_detalle vd, app_productos p\n            WHERE vd.id_producto = p.id AND vd.id_venta = \'$id\'\n        \")->fetchAll();\n?>\n<!DOCTYPE html>\n<html>\n\n<head>\n\n    <style>\n        * {\n            font-size: 15px;\n            font-family: \'DejaVu Sans\', serif;\n        }\n\n        h1 {\n            font-size: 18px;\n        }\n\n        \n\n        .ticket {\n            margin: 0.5px;\n        }\n\n        td,\n        th,\n        tr,\n        table {\n            border-top: 1px solid black;\n            border-collapse: collapse;\n            margin: 0 auto;\n            font-size: 15px;\n        }\n\n        td.precio {\n            text-align: right;\n            font-size: 11px;\n        }\n\n        td.cantidad {\n            font-size: 12px;\n        }\n\n        td.producto {\n            text-align: center;\n        }\n\n        th {\n            text-align: center;\n        }\n\n\n        .centrado {\n            text-align: center;\n            align-content: center;\n        }\n\n        .ticket {\n            width: <?php echo $medidaTicket ?>px;\n            max-width: <?php echo $medidaTicket ?>px;\n        }\n\n        img {\n            max-width: inherit;\n            width: inherit;\n        }\n\n        * {\n            margin: 0;\n            padding: 0;\n        }\n\n        .ticket {\n            margin: 0;\n            padding: 0;\n        }\n\n        body {\n            text-align: center;\n        }\n    </style>\n</head>\n\n<body>\n    <div class=\"ticket centrado\">\n        <h1><?php echo $empresa[\"razon_social\"] ?></h1>\n        <h2>NIT: <?php echo $empresa[\"nit\"] ?></h2>\n        <h2>Teléfono: <?php echo $empresa[\"telefono\"] ?></h2>\n        <h2>Direccion: <?php echo $empresa[\"direccion\"] ?></h2>\n        <h2>Correo: </h2>\n        <h2>--------------------------------------------</h2>\n        <h1 align=\"center\">Ticket de venta #<?php echo $id ?></h1>\n        \n        <h2>Fecha: <?php echo $venta[\"fecha\"] ?></h2>\n        <h2>Cliente: <?php echo $cliente[\"nombre_completo\"] ?></h2>\n        <h2>telefono: <?php echo $cliente[\"telefono\"] ?></h2>\n        <h2>CC / NIT: <?php echo $cliente[\"numero_documento\"] ?></h2>\n        <h2>Dirección: <?php echo $cliente[\"direccion\"] ?></h2>\n        <h2>Vendedor:</h2>\n        <h2>Caja N° 1</h2>\n        <br>\n\n        <table>\n            <thead>\n                <tr class=\"centrado\">\n                    <th class=\"cantidad\">CANT</th>\n                    <th class=\"producto\">PRODUCTO</th>\n                    <th class=\"precio\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;TOTAL</th>\n                </tr>\n            </thead>\n            <tbody>\n                <?php\n                $total = 0;\n                foreach ($productos as $producto) {\n                    $total += $producto[\"cantidad\"] * $producto[\"precio\"];\n                ?>\n                    <tr>\n                        <td class=\"cantidad\"><?php echo number_format($producto[\"cantidad\"], 2) ?></td>\n                        <td class=\"producto\"><?php echo $producto[\"descripcion\"] ?></td>\n                        <td class=\"precio\">$<?php echo number_format($producto[\"precio\"], 2) ?></td>\n                    </tr>\n                <?php } ?>\n            </tbody>\n            \n            <tr>\n                <td class=\"cantidad\"></td>\n                <td class=\"producto\">\n                <br>\n                    <strong>SUBTOTAL</strong>\n\n                    <p></p>\n                    <strong>TOTAL A PAGAR</strong>\n                    <p></p>\n                    <strong>FORMA DE PAGO</strong>\n                    <p></p>\n                    <strong>CAMBIO</strong>\n                    \n                </td>\n                \n                <th class=\"precio\">\n                    <BR>\n                    $<?php echo number_format($venta[\"total\"] - $venta[\"iva\"], 2) ?>\n                    <p></p>\n                    $<?php echo number_format($venta[\"total\"], 2) ?>\n                    <p>$<?php echo $venta[\"dinero_entregado\"] ?></p>\n                    <p></p>\n                    <p><?php echo $venta[\"forma_pago\"] ?></p>\n                    <BR>\n                    <p></p>\n                    $<?php echo $venta[\"devuelta\"] ?>\n                    \n                </th>\n            </tr>\n        </table>\n        <br>\n        <p class=\"centrado\">¡GRACIAS POR SU COMPRA! </P>\n        <br>\n            <P>Elaborado por www.cloudecoway.com</p>\n            <P>Tel: 3137010627</p>\n\n    </div>\n</body>\n\n</html>','A'),(260,'/var/www/html/company/Ventaspos/mod/app_ventas/imprimirFactura.php','2022-05-31 22:14:00','rafael',188,5100,'<?php\n$medidaTicket = 280;\n\n\n$empresa = PCO_EjecutarSQL(\"\n            SELECT razon_social, nit, telefono, direccion\n            FROM app_empresa\n            WHERE id = 1\n        \")->fetch();\n\n$venta = PCO_EjecutarSQL(\"\n            SELECT date_format(fecha, \'%d-%m-%Y %H:%i:%s\') fecha, total, iva, forma_pago, devuelta, dinero_entregado, id_cliente\n            FROM app_ventas\n            WHERE id = \'$id\'\n        \")->fetch();\n\n$cliente = PCO_EjecutarSQL(\"\n            SELECT *\n            FROM app_clientes\n            WHERE id = \'\" . $venta[\"id_cliente\"] . \"\'\n        \")->fetch();\n\n$productos = PCO_EjecutarSQL(\"\n            SELECT vd.cantidad, p.nombre as descripcion, vd.precio, date_format(fecha, \'%d-%m-%Y\') \n            FROM app_ventas_detalle vd, app_productos p\n            WHERE vd.id_producto = p.id AND vd.id_venta = \'$id\'\n        \")->fetchAll();\n?>\n<!DOCTYPE html>\n<html>\n\n<head>\n\n    <style>\n        * {\n            font-size: 15px;\n            font-family: \'DejaVu Sans\', serif;\n        }\n\n        h1 {\n            font-size: 18px;\n        }\n\n        \n\n        .ticket {\n            margin: 0.5px;\n        }\n\n        td,\n        th,\n        tr,\n        table {\n            border-top: 1px solid black;\n            border-collapse: collapse;\n            margin: 0 auto;\n            font-size: 15px;\n        }\n\n        td.precio {\n            text-align: right;\n            font-size: 11px;\n        }\n\n        td.cantidad {\n            font-size: 12px;\n        }\n\n        td.producto {\n            text-align: center;\n        }\n\n        th {\n            text-align: center;\n        }\n\n\n        .centrado {\n            text-align: center;\n            align-content: center;\n        }\n\n        .ticket {\n            width: <?php echo $medidaTicket ?>px;\n            max-width: <?php echo $medidaTicket ?>px;\n        }\n\n        img {\n            max-width: inherit;\n            width: inherit;\n        }\n\n        * {\n            margin: 0;\n            padding: 0;\n        }\n\n        .ticket {\n            margin: 0;\n            padding: 0;\n        }\n\n        body {\n            text-align: center;\n        }\n    </style>\n</head>\n\n<body>\n    <div class=\"ticket centrado\">\n        <h1><?php echo $empresa[\"razon_social\"] ?></h1>\n        <h2>NIT: <?php echo $empresa[\"nit\"] ?></h2>\n        <h2>Teléfono: <?php echo $empresa[\"telefono\"] ?></h2>\n        <h2>Direccion: <?php echo $empresa[\"direccion\"] ?></h2>\n        <h2>Correo: </h2>\n        <h2>--------------------------------------------</h2>\n        <h1 align=\"center\">Ticket de venta #<?php echo $id ?></h1>\n        \n        <h2>Fecha: <?php echo $venta[\"fecha\"] ?></h2>\n        <h2>Cliente: <?php echo $cliente[\"nombre_completo\"] ?></h2>\n        <h2>telefono: <?php echo $cliente[\"telefono\"] ?></h2>\n        <h2>CC / NIT: <?php echo $cliente[\"numero_documento\"] ?></h2>\n        <h2>Dirección: <?php echo $cliente[\"direccion\"] ?></h2>\n        <h2>Vendedor:</h2>\n        <h2>Caja N° 1</h2>\n        <br>\n\n        <table>\n            <thead>\n                <tr class=\"centrado\">\n                    <th class=\"cantidad\">CANT</th>\n                    <th class=\"producto\">PRODUCTO</th>\n                    <th class=\"precio\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;TOTAL</th>\n                </tr>\n            </thead>\n            <tbody>\n                <?php\n                $total = 0;\n                foreach ($productos as $producto) {\n                    $total += $producto[\"cantidad\"] * $producto[\"precio\"];\n                ?>\n                    <tr>\n                        <td class=\"cantidad\"><?php echo number_format($producto[\"cantidad\"], 2) ?></td>\n                        <td class=\"producto\"><?php echo $producto[\"descripcion\"] ?></td>\n                        <td class=\"precio\">$<?php echo number_format($producto[\"precio\"], 2) ?></td>\n                    </tr>\n                <?php } ?>\n            </tbody>\n            \n            <tr>\n                <td class=\"cantidad\"></td>\n                <td class=\"producto\">\n                <br>\n                    <strong>SUBTOTAL</strong>\n\n                    <p></p>\n                    <strong>TOTAL A PAGAR</strong>\n                    <p></p>\n                    <strong>FORMA DE PAGO</strong>\n                    <p></p>\n                    <strong>CAMBIO</strong>\n                    \n                </td>\n                \n                <th class=\"precio\">\n                    $<?php echo number_format($venta[\"total\"] - $venta[\"iva\"], 2) ?>\n                    <p></p>\n                    $<?php echo number_format($venta[\"total\"], 2) ?>\n                    <p>$<?php echo $venta[\"dinero_entregado\"] ?></p>\n                    <p></p>\n                    <p><?php echo $venta[\"forma_pago\"] ?></p>\n                    <p></p>\n                    $<?php echo $venta[\"devuelta\"] ?>\n                    \n                </th>\n            </tr>\n        </table>\n        <br>\n        <p class=\"centrado\">¡GRACIAS POR SU COMPRA! </P>\n        <br>\n            <P>Elaborado por www.cloudecoway.com</p>\n            <P>Tel: 3137010627</p>\n\n    </div>\n</body>\n\n</html>','A'),(261,'/var/www/html/company/Ventaspos/mod/app_ventas/imprimirFactura.php','2022-05-31 22:14:00','rafael',189,5177,'<?php\n$medidaTicket = 280;\n\n\n$empresa = PCO_EjecutarSQL(\"\n            SELECT razon_social, nit, telefono, direccion\n            FROM app_empresa\n            WHERE id = 1\n        \")->fetch();\n\n$venta = PCO_EjecutarSQL(\"\n            SELECT date_format(fecha, \'%d-%m-%Y %H:%i:%s\') fecha, total, iva, forma_pago, devuelta, dinero_entregado, id_cliente\n            FROM app_ventas\n            WHERE id = \'$id\'\n        \")->fetch();\n\n$cliente = PCO_EjecutarSQL(\"\n            SELECT *\n            FROM app_clientes\n            WHERE id = \'\" . $venta[\"id_cliente\"] . \"\'\n        \")->fetch();\n\n$productos = PCO_EjecutarSQL(\"\n            SELECT vd.cantidad, p.nombre as descripcion, vd.precio, date_format(fecha, \'%d-%m-%Y\') \n            FROM app_ventas_detalle vd, app_productos p\n            WHERE vd.id_producto = p.id AND vd.id_venta = \'$id\'\n        \")->fetchAll();\n?>\n<!DOCTYPE html>\n<html>\n\n<head>\n\n    <style>\n        * {\n            font-size: 15px;\n            font-family: \'DejaVu Sans\', serif;\n        }\n\n        h1 {\n            font-size: 18px;\n        }\n\n        \n\n        .ticket {\n            margin: 0.5px;\n        }\n\n        td,\n        th,\n        tr,\n        table {\n            border-top: 1px solid black;\n            border-collapse: collapse;\n            margin: 0 auto;\n            font-size: 15px;\n        }\n\n        td.precio {\n            text-align: right;\n            font-size: 11px;\n        }\n\n        td.cantidad {\n            font-size: 12px;\n        }\n\n        td.producto {\n            text-align: center;\n        }\n\n        th {\n            text-align: center;\n        }\n\n\n        .centrado {\n            text-align: center;\n            align-content: center;\n        }\n\n        .ticket {\n            width: <?php echo $medidaTicket ?>px;\n            max-width: <?php echo $medidaTicket ?>px;\n        }\n\n        img {\n            max-width: inherit;\n            width: inherit;\n        }\n\n        * {\n            margin: 0;\n            padding: 0;\n        }\n\n        .ticket {\n            margin: 0;\n            padding: 0;\n        }\n\n        body {\n            text-align: center;\n        }\n    </style>\n</head>\n\n<body>\n    <div class=\"ticket centrado\">\n        <h1><?php echo $empresa[\"razon_social\"] ?></h1>\n        <h2>NIT: <?php echo $empresa[\"nit\"] ?></h2>\n        <h2>Teléfono: <?php echo $empresa[\"telefono\"] ?></h2>\n        <h2>Direccion: <?php echo $empresa[\"direccion\"] ?></h2>\n        <h2>Correo: </h2>\n        <h2>--------------------------------------------</h2>\n        <h1 align=\"center\">Ticket de venta #<?php echo $id ?></h1>\n        \n        <h2>Fecha: <?php echo $venta[\"fecha\"] ?></h2>\n        <h2>Cliente: <?php echo $cliente[\"nombre_completo\"] ?></h2>\n        <h2>telefono: <?php echo $cliente[\"telefono\"] ?></h2>\n        <h2>CC / NIT: <?php echo $cliente[\"numero_documento\"] ?></h2>\n        <h2>Dirección: <?php echo $cliente[\"direccion\"] ?></h2>\n        <h2>Vendedor:</h2>\n        <h2>Caja N° 1</h2>\n        <br>\n\n        <table>\n            <thead>\n                <tr class=\"centrado\">\n                    <th class=\"cantidad\">CANT</th>\n                    <th class=\"producto\">PRODUCTO</th>\n                    <th class=\"precio\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;TOTAL</th>\n                </tr>\n            </thead>\n            <tbody>\n                <?php\n                $total = 0;\n                foreach ($productos as $producto) {\n                    $total += $producto[\"cantidad\"] * $producto[\"precio\"];\n                ?>\n                    <tr>\n                        <td class=\"cantidad\"><?php echo number_format($producto[\"cantidad\"], 2) ?></td>\n                        <td class=\"producto\"><?php echo $producto[\"descripcion\"] ?></td>\n                        <td class=\"precio\">$<?php echo number_format($producto[\"precio\"], 2) ?></td>\n                    </tr>\n                <?php } ?>\n            </tbody>\n            \n            <tr>\n                <td class=\"cantidad\"></td>\n                <td class=\"producto\">\n                <br>\n                    <strong>SUBTOTAL</strong>\n\n                    <p></p>\n                    <strong>TOTAL A PAGAR</strong>\n                    <p></p>\n                    <strong>VALOR PAGADO</strong>\n                    <p></p>\n                    <strong>FORMA DE PAGO</strong>\n                    <p></p>\n                    <strong>CAMBIO</strong>\n                    \n                </td>\n                \n                <th class=\"precio\">\n                    $<?php echo number_format($venta[\"total\"] - $venta[\"iva\"], 2) ?>\n                    <p></p>\n                    $<?php echo number_format($venta[\"total\"], 2) ?>\n                    <p>$<?php echo $venta[\"dinero_entregado\"] ?></p>\n                    <p></p>\n                    <p><?php echo $venta[\"forma_pago\"] ?></p>\n                    <p></p>\n                    $<?php echo $venta[\"devuelta\"] ?>\n                    \n                </th>\n            </tr>\n        </table>\n        <br>\n        <p class=\"centrado\">¡GRACIAS POR SU COMPRA! </P>\n        <br>\n            <P>Elaborado por www.cloudecoway.com</p>\n            <P>Tel: 3137010627</p>\n\n    </div>\n</body>\n\n</html>','A'),(262,'/var/www/html/company/Ventaspos/mod/app_ventas/imprimirFactura.php','2022-05-31 22:15:00','rafael',188,5156,'<?php\n$medidaTicket = 280;\n\n\n$empresa = PCO_EjecutarSQL(\"\n            SELECT razon_social, nit, telefono, direccion\n            FROM app_empresa\n            WHERE id = 1\n        \")->fetch();\n\n$venta = PCO_EjecutarSQL(\"\n            SELECT date_format(fecha, \'%d-%m-%Y %H:%i:%s\') fecha, total, iva, forma_pago, devuelta, dinero_entregado, id_cliente\n            FROM app_ventas\n            WHERE id = \'$id\'\n        \")->fetch();\n\n$cliente = PCO_EjecutarSQL(\"\n            SELECT *\n            FROM app_clientes\n            WHERE id = \'\" . $venta[\"id_cliente\"] . \"\'\n        \")->fetch();\n\n$productos = PCO_EjecutarSQL(\"\n            SELECT vd.cantidad, p.nombre as descripcion, vd.precio, date_format(fecha, \'%d-%m-%Y\') \n            FROM app_ventas_detalle vd, app_productos p\n            WHERE vd.id_producto = p.id AND vd.id_venta = \'$id\'\n        \")->fetchAll();\n?>\n<!DOCTYPE html>\n<html>\n\n<head>\n\n    <style>\n        * {\n            font-size: 15px;\n            font-family: \'DejaVu Sans\', serif;\n        }\n\n        h1 {\n            font-size: 18px;\n        }\n\n        \n\n        .ticket {\n            margin: 0.5px;\n        }\n\n        td,\n        th,\n        tr,\n        table {\n            border-top: 1px solid black;\n            border-collapse: collapse;\n            margin: 0 auto;\n            font-size: 15px;\n        }\n\n        td.precio {\n            text-align: right;\n            font-size: 11px;\n        }\n\n        td.cantidad {\n            font-size: 12px;\n        }\n\n        td.producto {\n            text-align: center;\n        }\n\n        th {\n            text-align: center;\n        }\n\n\n        .centrado {\n            text-align: center;\n            align-content: center;\n        }\n\n        .ticket {\n            width: <?php echo $medidaTicket ?>px;\n            max-width: <?php echo $medidaTicket ?>px;\n        }\n\n        img {\n            max-width: inherit;\n            width: inherit;\n        }\n\n        * {\n            margin: 0;\n            padding: 0;\n        }\n\n        .ticket {\n            margin: 0;\n            padding: 0;\n        }\n\n        body {\n            text-align: center;\n        }\n    </style>\n</head>\n\n<body>\n    <div class=\"ticket centrado\">\n        <h1><?php echo $empresa[\"razon_social\"] ?></h1>\n        <h2>NIT: <?php echo $empresa[\"nit\"] ?></h2>\n        <h2>Teléfono: <?php echo $empresa[\"telefono\"] ?></h2>\n        <h2>Direccion: <?php echo $empresa[\"direccion\"] ?></h2>\n        <h2>Correo: </h2>\n        <h2>--------------------------------------------</h2>\n        <h1 align=\"center\">Ticket de venta #<?php echo $id ?></h1>\n        \n        <h2>Fecha: <?php echo $venta[\"fecha\"] ?></h2>\n        <h2>Cliente: <?php echo $cliente[\"nombre_completo\"] ?></h2>\n        <h2>telefono: <?php echo $cliente[\"telefono\"] ?></h2>\n        <h2>CC / NIT: <?php echo $cliente[\"numero_documento\"] ?></h2>\n        <h2>Dirección: <?php echo $cliente[\"direccion\"] ?></h2>\n        <h2>Vendedor:</h2>\n        <h2>Caja N° 1</h2>\n        <br>\n\n        <table>\n            <thead>\n                <tr class=\"centrado\">\n                    <th class=\"cantidad\">CANT</th>\n                    <th class=\"producto\">PRODUCTO</th>\n                    <th class=\"precio\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;TOTAL</th>\n                </tr>\n            </thead>\n            <tbody>\n                <?php\n                $total = 0;\n                foreach ($productos as $producto) {\n                    $total += $producto[\"cantidad\"] * $producto[\"precio\"];\n                ?>\n                    <tr>\n                        <td class=\"cantidad\"><?php echo number_format($producto[\"cantidad\"], 2) ?></td>\n                        <td class=\"producto\"><?php echo $producto[\"descripcion\"] ?></td>\n                        <td class=\"precio\">$<?php echo number_format($producto[\"precio\"], 2) ?></td>\n                    </tr>\n                <?php } ?>\n            </tbody>\n            \n            <tr>\n                <td class=\"cantidad\"></td>\n                <td class=\"producto\">\n                    <strong>SUBTOTAL</strong>\n\n                    <p></p>\n                    <strong>TOTAL A PAGAR</strong>\n                    <p></p>\n                    <strong>VALOR PAGADO</strong>\n                    <p></p>\n                    <strong>FORMA DE PAGO</strong>\n                    <p></p>\n                    <strong>CAMBIO</strong>\n                    \n                </td>\n                \n                <th class=\"precio\">\n                    $<?php echo number_format($venta[\"total\"] - $venta[\"iva\"], 2) ?>\n                    <p></p>\n                    $<?php echo number_format($venta[\"total\"], 2) ?>\n                    <p>$<?php echo $venta[\"dinero_entregado\"] ?></p>\n                    <p></p>\n                    <p><?php echo $venta[\"forma_pago\"] ?></p>\n                    <p></p>\n                    $<?php echo $venta[\"devuelta\"] ?>\n                    \n                </th>\n            </tr>\n        </table>\n        <br>\n        <p class=\"centrado\">¡GRACIAS POR SU COMPRA! </P>\n        <br>\n            <P>Elaborado por www.cloudecoway.com</p>\n            <P>Tel: 3137010627</p>\n\n    </div>\n</body>\n\n</html>','A'),(263,'/var/www/html/company/Ventaspos/mod/app_ventas/imprimirFactura.php','2022-05-31 22:15:00','rafael',188,5158,'<?php\n$medidaTicket = 280;\n\n\n$empresa = PCO_EjecutarSQL(\"\n            SELECT razon_social, nit, telefono, direccion\n            FROM app_empresa\n            WHERE id = 1\n        \")->fetch();\n\n$venta = PCO_EjecutarSQL(\"\n            SELECT date_format(fecha, \'%d-%m-%Y %H:%i:%s\') fecha, total, iva, forma_pago, devuelta, dinero_entregado, id_cliente\n            FROM app_ventas\n            WHERE id = \'$id\'\n        \")->fetch();\n\n$cliente = PCO_EjecutarSQL(\"\n            SELECT *\n            FROM app_clientes\n            WHERE id = \'\" . $venta[\"id_cliente\"] . \"\'\n        \")->fetch();\n\n$productos = PCO_EjecutarSQL(\"\n            SELECT vd.cantidad, p.nombre as descripcion, vd.precio, date_format(fecha, \'%d-%m-%Y\') \n            FROM app_ventas_detalle vd, app_productos p\n            WHERE vd.id_producto = p.id AND vd.id_venta = \'$id\'\n        \")->fetchAll();\n?>\n<!DOCTYPE html>\n<html>\n\n<head>\n\n    <style>\n        * {\n            font-size: 15px;\n            font-family: \'DejaVu Sans\', serif;\n        }\n\n        h1 {\n            font-size: 18px;\n        }\n\n        \n\n        .ticket {\n            margin: 0.5px;\n        }\n\n        td,\n        th,\n        tr,\n        table {\n            border-top: 1px solid black;\n            border-collapse: collapse;\n            margin: 0 auto;\n            font-size: 15px;\n        }\n\n        td.precio {\n            text-align: right;\n            font-size: 11px;\n        }\n\n        td.cantidad {\n            font-size: 12px;\n        }\n\n        td.producto {\n            text-align: center;\n        }\n\n        th {\n            text-align: center;\n        }\n\n\n        .centrado {\n            text-align: center;\n            align-content: center;\n        }\n\n        .ticket {\n            width: <?php echo $medidaTicket ?>px;\n            max-width: <?php echo $medidaTicket ?>px;\n        }\n\n        img {\n            max-width: inherit;\n            width: inherit;\n        }\n\n        * {\n            margin: 0;\n            padding: 0;\n        }\n\n        .ticket {\n            margin: 0;\n            padding: 0;\n        }\n\n        body {\n            text-align: center;\n        }\n    </style>\n</head>\n\n<body>\n    <div class=\"ticket centrado\">\n        <h1><?php echo $empresa[\"razon_social\"] ?></h1>\n        <h2>NIT: <?php echo $empresa[\"nit\"] ?></h2>\n        <h2>Teléfono: <?php echo $empresa[\"telefono\"] ?></h2>\n        <h2>Direccion: <?php echo $empresa[\"direccion\"] ?></h2>\n        <h2>Correo: </h2>\n        <h2>--------------------------------------------</h2>\n        <h1 align=\"center\">Ticket de venta #<?php echo $id ?></h1>\n        \n        <h2>Fecha: <?php echo $venta[\"fecha\"] ?></h2>\n        <h2>Cliente: <?php echo $cliente[\"nombre_completo\"] ?></h2>\n        <h2>telefono: <?php echo $cliente[\"telefono\"] ?></h2>\n        <h2>CC / NIT: <?php echo $cliente[\"numero_documento\"] ?></h2>\n        <h2>Dirección: <?php echo $cliente[\"direccion\"] ?></h2>\n        <h2>Vendedor:</h2>\n        <h2>Caja N° 1</h2>\n        <br>\n\n        <table>\n            <thead>\n                <tr class=\"centrado\">\n                    <th class=\"cantidad\">CANT</th>\n                    <th class=\"producto\">PRODUCTO</th>\n                    <th class=\"precio\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;TOTAL</th>\n                </tr>\n            </thead>\n            <tbody>\n                <?php\n                $total = 0;\n                foreach ($productos as $producto) {\n                    $total += $producto[\"cantidad\"] * $producto[\"precio\"];\n                ?>\n                    <tr>\n                        <td class=\"cantidad\"><?php echo number_format($producto[\"cantidad\"], 2) ?></td>\n                        <td class=\"producto\"><?php echo $producto[\"descripcion\"] ?></td>\n                        <td class=\"precio\">$<?php echo number_format($producto[\"precio\"], 2) ?></td>\n                    </tr>\n                <?php } ?>\n            </tbody>\n            <BR>\n            <tr>\n                <td class=\"cantidad\"></td>\n                <td class=\"producto\">\n                    <strong>SUBTOTAL</strong>\n\n                    <p></p>\n                    <strong>TOTAL A PAGAR</strong>\n                    <p></p>\n                    <strong>VALOR PAGADO</strong>\n                    <p></p>\n                    <strong>FORMA DE PAGO</strong>\n                    <p></p>\n                    <strong>CAMBIO</strong>\n                    \n                </td>\n                \n                <th class=\"precio\">\n                    $<?php echo number_format($venta[\"total\"] - $venta[\"iva\"], 2) ?>\n                    <p></p>\n                    $<?php echo number_format($venta[\"total\"], 2) ?>\n                    <p>$<?php echo $venta[\"dinero_entregado\"] ?></p>\n                    <p></p>\n                    <p><?php echo $venta[\"forma_pago\"] ?></p>\n                    <p></p>\n                    $<?php echo $venta[\"devuelta\"] ?>\n                    \n                </th>\n            </tr>\n        </table>\n        <br>\n        <p class=\"centrado\">¡GRACIAS POR SU COMPRA! </P>\n        <br>\n            <P>Elaborado por www.cloudecoway.com</p>\n            <P>Tel: 3137010627</p>\n\n    </div>\n</body>\n\n</html>','A'),(264,'/var/www/html/company/Ventaspos/mod/app_ventas/imprimirFactura.php','2022-05-31 22:16:00','rafael',187,5143,'<?php\n$medidaTicket = 280;\n\n\n$empresa = PCO_EjecutarSQL(\"\n            SELECT razon_social, nit, telefono, direccion\n            FROM app_empresa\n            WHERE id = 1\n        \")->fetch();\n\n$venta = PCO_EjecutarSQL(\"\n            SELECT date_format(fecha, \'%d-%m-%Y %H:%i:%s\') fecha, total, iva, forma_pago, devuelta, dinero_entregado, id_cliente\n            FROM app_ventas\n            WHERE id = \'$id\'\n        \")->fetch();\n\n$cliente = PCO_EjecutarSQL(\"\n            SELECT *\n            FROM app_clientes\n            WHERE id = \'\" . $venta[\"id_cliente\"] . \"\'\n        \")->fetch();\n\n$productos = PCO_EjecutarSQL(\"\n            SELECT vd.cantidad, p.nombre as descripcion, vd.precio, date_format(fecha, \'%d-%m-%Y\') \n            FROM app_ventas_detalle vd, app_productos p\n            WHERE vd.id_producto = p.id AND vd.id_venta = \'$id\'\n        \")->fetchAll();\n?>\n<!DOCTYPE html>\n<html>\n\n<head>\n\n    <style>\n        * {\n            font-size: 15px;\n            font-family: \'DejaVu Sans\', serif;\n        }\n\n        h1 {\n            font-size: 18px;\n        }\n\n        \n\n        .ticket {\n            margin: 0.5px;\n        }\n\n        td,\n        th,\n        tr,\n        table {\n            border-top: 1px solid black;\n            border-collapse: collapse;\n            margin: 0 auto;\n            font-size: 15px;\n        }\n\n        td.precio {\n            text-align: right;\n            font-size: 11px;\n        }\n\n        td.cantidad {\n            font-size: 12px;\n        }\n\n        td.producto {\n            text-align: center;\n        }\n\n        th {\n            text-align: center;\n        }\n\n\n        .centrado {\n            text-align: center;\n            align-content: center;\n        }\n\n        .ticket {\n            width: <?php echo $medidaTicket ?>px;\n            max-width: <?php echo $medidaTicket ?>px;\n        }\n\n        img {\n            max-width: inherit;\n            width: inherit;\n        }\n\n        * {\n            margin: 0;\n            padding: 0;\n        }\n\n        .ticket {\n            margin: 0;\n            padding: 0;\n        }\n\n        body {\n            text-align: center;\n        }\n    </style>\n</head>\n\n<body>\n    <div class=\"ticket centrado\">\n        <h1><?php echo $empresa[\"razon_social\"] ?></h1>\n        <h2>NIT: <?php echo $empresa[\"nit\"] ?></h2>\n        <h2>Teléfono: <?php echo $empresa[\"telefono\"] ?></h2>\n        <h2>Direccion: <?php echo $empresa[\"direccion\"] ?></h2>\n        <h2>Correo: </h2>\n        <h2>--------------------------------------------</h2>\n        <h1 align=\"center\">Ticket de venta #<?php echo $id ?></h1>\n        \n        <h2>Fecha: <?php echo $venta[\"fecha\"] ?></h2>\n        <h2>Cliente: <?php echo $cliente[\"nombre_completo\"] ?></h2>\n        <h2>telefono: <?php echo $cliente[\"telefono\"] ?></h2>\n        <h2>CC / NIT: <?php echo $cliente[\"numero_documento\"] ?></h2>\n        <h2>Dirección: <?php echo $cliente[\"direccion\"] ?></h2>\n        <h2>Vendedor:</h2>\n        <h2>Caja N° 1</h2>\n        <br>\n\n        <table>\n            <thead>\n                <tr class=\"centrado\">\n                    <th class=\"cantidad\">CANT</th>\n                    <th class=\"producto\">PRODUCTO</th>\n                    <th class=\"precio\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;TOTAL</th>\n                </tr>\n            </thead>\n            <tbody>\n                <?php\n                $total = 0;\n                foreach ($productos as $producto) {\n                    $total += $producto[\"cantidad\"] * $producto[\"precio\"];\n                ?>\n                    <tr>\n                        <td class=\"cantidad\"><?php echo number_format($producto[\"cantidad\"], 2) ?></td>\n                        <td class=\"producto\"><?php echo $producto[\"descripcion\"] ?></td>\n                        <td class=\"precio\">$<?php echo number_format($producto[\"precio\"], 2) ?></td>\n                    </tr>\n                <?php } ?>\n            </tbody>\n            <tr>\n                <td class=\"cantidad\"></td>\n                <td class=\"producto\">\n                    <strong>SUBTOTAL</strong>\n\n                    <p></p>\n                    <strong>TOTAL A PAGAR</strong>\n                    <p></p>\n                    <strong>VALOR PAGADO</strong>\n                    <p></p>\n                    <strong>FORMA DE PAGO</strong>\n                    <p></p>\n                    <strong>CAMBIO</strong>\n                    \n                </td>\n                \n                <th class=\"precio\">\n                    $<?php echo number_format($venta[\"total\"] - $venta[\"iva\"], 2) ?>\n                    <p></p>\n                    $<?php echo number_format($venta[\"total\"], 2) ?>\n                    <p>$<?php echo $venta[\"dinero_entregado\"] ?></p>\n                    <p></p>\n                    <p><?php echo $venta[\"forma_pago\"] ?></p>\n                    <p></p>\n                    $<?php echo $venta[\"devuelta\"] ?>\n                    \n                </th>\n            </tr>\n        </table>\n        <br>\n        <p class=\"centrado\">¡GRACIAS POR SU COMPRA! </P>\n        <br>\n            <P>Elaborado por www.cloudecoway.com</p>\n            <P>Tel: 3137010627</p>\n\n    </div>\n</body>\n\n</html>','A'),(265,'/var/www/html/company/Ventaspos/mod/app_ventas/imprimirFactura.php','2022-05-31 22:16:00','rafael',188,5158,'<?php\n$medidaTicket = 280;\n\n\n$empresa = PCO_EjecutarSQL(\"\n            SELECT razon_social, nit, telefono, direccion\n            FROM app_empresa\n            WHERE id = 1\n        \")->fetch();\n\n$venta = PCO_EjecutarSQL(\"\n            SELECT date_format(fecha, \'%d-%m-%Y %H:%i:%s\') fecha, total, iva, forma_pago, devuelta, dinero_entregado, id_cliente\n            FROM app_ventas\n            WHERE id = \'$id\'\n        \")->fetch();\n\n$cliente = PCO_EjecutarSQL(\"\n            SELECT *\n            FROM app_clientes\n            WHERE id = \'\" . $venta[\"id_cliente\"] . \"\'\n        \")->fetch();\n\n$productos = PCO_EjecutarSQL(\"\n            SELECT vd.cantidad, p.nombre as descripcion, vd.precio, date_format(fecha, \'%d-%m-%Y\') \n            FROM app_ventas_detalle vd, app_productos p\n            WHERE vd.id_producto = p.id AND vd.id_venta = \'$id\'\n        \")->fetchAll();\n?>\n<!DOCTYPE html>\n<html>\n\n<head>\n\n    <style>\n        * {\n            font-size: 15px;\n            font-family: \'DejaVu Sans\', serif;\n        }\n\n        h1 {\n            font-size: 18px;\n        }\n\n        \n\n        .ticket {\n            margin: 0.5px;\n        }\n\n        td,\n        th,\n        tr,\n        table {\n            border-top: 1px solid black;\n            border-collapse: collapse;\n            margin: 0 auto;\n            font-size: 15px;\n        }\n\n        td.precio {\n            text-align: right;\n            font-size: 11px;\n        }\n\n        td.cantidad {\n            font-size: 12px;\n        }\n\n        td.producto {\n            text-align: center;\n        }\n\n        th {\n            text-align: center;\n        }\n\n\n        .centrado {\n            text-align: center;\n            align-content: center;\n        }\n\n        .ticket {\n            width: <?php echo $medidaTicket ?>px;\n            max-width: <?php echo $medidaTicket ?>px;\n        }\n\n        img {\n            max-width: inherit;\n            width: inherit;\n        }\n\n        * {\n            margin: 0;\n            padding: 0;\n        }\n\n        .ticket {\n            margin: 0;\n            padding: 0;\n        }\n\n        body {\n            text-align: center;\n        }\n    </style>\n</head>\n\n<body>\n    <div class=\"ticket centrado\">\n        <h1><?php echo $empresa[\"razon_social\"] ?></h1>\n        <h2>NIT: <?php echo $empresa[\"nit\"] ?></h2>\n        <h2>Teléfono: <?php echo $empresa[\"telefono\"] ?></h2>\n        <h2>Direccion: <?php echo $empresa[\"direccion\"] ?></h2>\n        <h2>Correo: </h2>\n        <h2>--------------------------------------------</h2>\n        <h1 align=\"center\">Ticket de venta #<?php echo $id ?></h1>\n        \n        <h2>Fecha: <?php echo $venta[\"fecha\"] ?></h2>\n        <h2>Cliente: <?php echo $cliente[\"nombre_completo\"] ?></h2>\n        <h2>telefono: <?php echo $cliente[\"telefono\"] ?></h2>\n        <h2>CC / NIT: <?php echo $cliente[\"numero_documento\"] ?></h2>\n        <h2>Dirección: <?php echo $cliente[\"direccion\"] ?></h2>\n        <h2>Vendedor:</h2>\n        <h2>Caja N° 1</h2>\n        <br>\n\n        <table>\n            <thead>\n                <tr class=\"centrado\">\n                    <th class=\"cantidad\">CANT</th>\n                    <th class=\"producto\">PRODUCTO</th>\n                    <th class=\"precio\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;TOTAL</th>\n                </tr>\n            </thead>\n            <tbody>\n                <?php\n                $total = 0;\n                foreach ($productos as $producto) {\n                    $total += $producto[\"cantidad\"] * $producto[\"precio\"];\n                ?>\n                    <tr>\n                        <td class=\"cantidad\"><?php echo number_format($producto[\"cantidad\"], 2) ?></td>\n                        <td class=\"producto\"><?php echo $producto[\"descripcion\"] ?></td>\n                        <td class=\"precio\">$<?php echo number_format($producto[\"precio\"], 2) ?></td>\n                    </tr>\n                <?php } ?>\n            </tbody>\n            <BR>\n            <tr>\n                <td class=\"cantidad\"></td>\n                <td class=\"producto\">\n                    <strong>SUBTOTAL</strong>\n\n                    <p></p>\n                    <strong>TOTAL A PAGAR</strong>\n                    <p></p>\n                    <strong>VALOR PAGADO</strong>\n                    <p></p>\n                    <strong>FORMA DE PAGO</strong>\n                    <p></p>\n                    <strong>CAMBIO</strong>\n                    \n                </td>\n                \n                <th class=\"precio\">\n                    $<?php echo number_format($venta[\"total\"] - $venta[\"iva\"], 2) ?>\n                    <p></p>\n                    $<?php echo number_format($venta[\"total\"], 2) ?>\n                    <p>$<?php echo $venta[\"dinero_entregado\"] ?></p>\n                    <p></p>\n                    <p><?php echo $venta[\"forma_pago\"] ?></p>\n                    <p></p>\n                    $<?php echo $venta[\"devuelta\"] ?>\n                    \n                </th>\n            </tr>\n        </table>\n        <br>\n        <p class=\"centrado\">¡GRACIAS POR SU COMPRA! </P>\n        <br>\n            <P>Elaborado por www.cloudecoway.com</p>\n            <P>Tel: 3137010627</p>\n\n    </div>\n</body>\n\n</html>','A'),(266,'/var/www/html/company/Ventaspos/mod/app_ventas/imprimirFactura.php','2022-05-31 22:16:00','rafael',189,5165,'<?php\n$medidaTicket = 280;\n\n\n$empresa = PCO_EjecutarSQL(\"\n            SELECT razon_social, nit, telefono, direccion\n            FROM app_empresa\n            WHERE id = 1\n        \")->fetch();\n\n$venta = PCO_EjecutarSQL(\"\n            SELECT date_format(fecha, \'%d-%m-%Y %H:%i:%s\') fecha, total, iva, forma_pago, devuelta, dinero_entregado, id_cliente\n            FROM app_ventas\n            WHERE id = \'$id\'\n        \")->fetch();\n\n$cliente = PCO_EjecutarSQL(\"\n            SELECT *\n            FROM app_clientes\n            WHERE id = \'\" . $venta[\"id_cliente\"] . \"\'\n        \")->fetch();\n\n$productos = PCO_EjecutarSQL(\"\n            SELECT vd.cantidad, p.nombre as descripcion, vd.precio, date_format(fecha, \'%d-%m-%Y\') \n            FROM app_ventas_detalle vd, app_productos p\n            WHERE vd.id_producto = p.id AND vd.id_venta = \'$id\'\n        \")->fetchAll();\n?>\n<!DOCTYPE html>\n<html>\n\n<head>\n\n    <style>\n        * {\n            font-size: 15px;\n            font-family: \'DejaVu Sans\', serif;\n        }\n\n        h1 {\n            font-size: 18px;\n        }\n\n        \n\n        .ticket {\n            margin: 0.5px;\n        }\n\n        td,\n        th,\n        tr,\n        table {\n            border-top: 1px solid black;\n            border-collapse: collapse;\n            margin: 0 auto;\n            font-size: 15px;\n        }\n\n        td.precio {\n            text-align: right;\n            font-size: 11px;\n        }\n\n        td.cantidad {\n            font-size: 12px;\n        }\n\n        td.producto {\n            text-align: center;\n        }\n\n        th {\n            text-align: center;\n        }\n\n\n        .centrado {\n            text-align: center;\n            align-content: center;\n        }\n\n        .ticket {\n            width: <?php echo $medidaTicket ?>px;\n            max-width: <?php echo $medidaTicket ?>px;\n        }\n\n        img {\n            max-width: inherit;\n            width: inherit;\n        }\n\n        * {\n            margin: 0;\n            padding: 0;\n        }\n\n        .ticket {\n            margin: 0;\n            padding: 0;\n        }\n\n        body {\n            text-align: center;\n        }\n    </style>\n</head>\n\n<body>\n    <div class=\"ticket centrado\">\n        <h1><?php echo $empresa[\"razon_social\"] ?></h1>\n        <h2>NIT: <?php echo $empresa[\"nit\"] ?></h2>\n        <h2>Teléfono: <?php echo $empresa[\"telefono\"] ?></h2>\n        <h2>Direccion: <?php echo $empresa[\"direccion\"] ?></h2>\n        <h2>Correo: </h2>\n        <h2>--------------------------------------------</h2>\n        <h1 align=\"center\">Ticket de venta #<?php echo $id ?></h1>\n        \n        <h2>Fecha: <?php echo $venta[\"fecha\"] ?></h2>\n        <h2>Cliente: <?php echo $cliente[\"nombre_completo\"] ?></h2>\n        <h2>telefono: <?php echo $cliente[\"telefono\"] ?></h2>\n        <h2>CC / NIT: <?php echo $cliente[\"numero_documento\"] ?></h2>\n        <h2>Dirección: <?php echo $cliente[\"direccion\"] ?></h2>\n        <h2>Vendedor:</h2>\n        <h2>Caja N° 1</h2>\n        <br>\n\n        <table>\n            <thead>\n                <tr class=\"centrado\">\n                    <th class=\"cantidad\">CANT</th>\n                    <th class=\"producto\">PRODUCTO</th>\n                    <th class=\"precio\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;TOTAL</th>\n                </tr>\n            </thead>\n            <tbody>\n                <?php\n                $total = 0;\n                foreach ($productos as $producto) {\n                    $total += $producto[\"cantidad\"] * $producto[\"precio\"];\n                ?>\n                    <tr>\n                        <td class=\"cantidad\"><?php echo number_format($producto[\"cantidad\"], 2) ?></td>\n                        <td class=\"producto\"><?php echo $producto[\"descripcion\"] ?></td>\n                        <td class=\"precio\">$<?php echo number_format($producto[\"precio\"], 2) ?></td>\n                    </tr>\n                <?php } ?>\n            </tbody>\n\n            <tr>\n                <td class=\"cantidad\"></td>\n                <BR>\n                <td class=\"producto\">\n                    <strong>SUBTOTAL</strong>\n\n                    <p></p>\n                    <strong>TOTAL A PAGAR</strong>\n                    <p></p>\n                    <strong>VALOR PAGADO</strong>\n                    <p></p>\n                    <strong>FORMA DE PAGO</strong>\n                    <p></p>\n                    <strong>CAMBIO</strong>\n                    \n                </td>\n                \n                <th class=\"precio\">\n                    $<?php echo number_format($venta[\"total\"] - $venta[\"iva\"], 2) ?>\n                    <p></p>\n                    $<?php echo number_format($venta[\"total\"], 2) ?>\n                    <p>$<?php echo $venta[\"dinero_entregado\"] ?></p>\n                    <p></p>\n                    <p><?php echo $venta[\"forma_pago\"] ?></p>\n                    <p></p>\n                    $<?php echo $venta[\"devuelta\"] ?>\n                    \n                </th>\n            </tr>\n        </table>\n        <br>\n        <p class=\"centrado\">¡GRACIAS POR SU COMPRA! </P>\n        <br>\n            <P>Elaborado por www.cloudecoway.com</p>\n            <P>Tel: 3137010627</p>\n\n    </div>\n</body>\n\n</html>','A'),(267,'/var/www/html/company/Ventaspos/mod/app_ventas/imprimirFactura.php','2022-05-31 22:17:00','rafael',189,5165,'<?php\n$medidaTicket = 280;\n\n\n$empresa = PCO_EjecutarSQL(\"\n            SELECT razon_social, nit, telefono, direccion\n            FROM app_empresa\n            WHERE id = 1\n        \")->fetch();\n\n$venta = PCO_EjecutarSQL(\"\n            SELECT date_format(fecha, \'%d-%m-%Y %H:%i:%s\') fecha, total, iva, forma_pago, devuelta, dinero_entregado, id_cliente\n            FROM app_ventas\n            WHERE id = \'$id\'\n        \")->fetch();\n\n$cliente = PCO_EjecutarSQL(\"\n            SELECT *\n            FROM app_clientes\n            WHERE id = \'\" . $venta[\"id_cliente\"] . \"\'\n        \")->fetch();\n\n$productos = PCO_EjecutarSQL(\"\n            SELECT vd.cantidad, p.nombre as descripcion, vd.precio, date_format(fecha, \'%d-%m-%Y\') \n            FROM app_ventas_detalle vd, app_productos p\n            WHERE vd.id_producto = p.id AND vd.id_venta = \'$id\'\n        \")->fetchAll();\n?>\n<!DOCTYPE html>\n<html>\n\n<head>\n\n    <style>\n        * {\n            font-size: 15px;\n            font-family: \'DejaVu Sans\', serif;\n        }\n\n        h1 {\n            font-size: 18px;\n        }\n\n        \n\n        .ticket {\n            margin: 0.5px;\n        }\n\n        td,\n        th,\n        tr,\n        table {\n            border-top: 1px solid black;\n            border-collapse: collapse;\n            margin: 0 auto;\n            font-size: 15px;\n        }\n\n        td.precio {\n            text-align: right;\n            font-size: 11px;\n        }\n\n        td.cantidad {\n            font-size: 12px;\n        }\n\n        td.producto {\n            text-align: center;\n        }\n\n        th {\n            text-align: center;\n        }\n\n\n        .centrado {\n            text-align: center;\n            align-content: center;\n        }\n\n        .ticket {\n            width: <?php echo $medidaTicket ?>px;\n            max-width: <?php echo $medidaTicket ?>px;\n        }\n\n        img {\n            max-width: inherit;\n            width: inherit;\n        }\n\n        * {\n            margin: 0;\n            padding: 0;\n        }\n\n        .ticket {\n            margin: 0;\n            padding: 0;\n        }\n\n        body {\n            text-align: center;\n        }\n    </style>\n</head>\n\n<body>\n    <div class=\"ticket centrado\">\n        <h1><?php echo $empresa[\"razon_social\"] ?></h1>\n        <h2>NIT: <?php echo $empresa[\"nit\"] ?></h2>\n        <h2>Teléfono: <?php echo $empresa[\"telefono\"] ?></h2>\n        <h2>Direccion: <?php echo $empresa[\"direccion\"] ?></h2>\n        <h2>Correo: </h2>\n        <h2>--------------------------------------------</h2>\n        <h1 align=\"center\">Ticket de venta #<?php echo $id ?></h1>\n        \n        <h2>Fecha: <?php echo $venta[\"fecha\"] ?></h2>\n        <h2>Cliente: <?php echo $cliente[\"nombre_completo\"] ?></h2>\n        <h2>telefono: <?php echo $cliente[\"telefono\"] ?></h2>\n        <h2>CC / NIT: <?php echo $cliente[\"numero_documento\"] ?></h2>\n        <h2>Dirección: <?php echo $cliente[\"direccion\"] ?></h2>\n        <h2>Vendedor:</h2>\n        <h2>Caja N° 1</h2>\n        <br>\n\n        <table>\n            <thead>\n                <tr class=\"centrado\">\n                    <th class=\"cantidad\">CANT</th>\n                    <th class=\"producto\">PRODUCTO</th>\n                    <th class=\"precio\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;TOTAL</th>\n                </tr>\n            </thead>\n            <tbody>\n                <?php\n                $total = 0;\n                foreach ($productos as $producto) {\n                    $total += $producto[\"cantidad\"] * $producto[\"precio\"];\n                ?>\n                    <tr>\n                        <td class=\"cantidad\"><?php echo number_format($producto[\"cantidad\"], 2) ?></td>\n                        <td class=\"producto\"><?php echo $producto[\"descripcion\"] ?></td>\n                        <td class=\"precio\">$<?php echo number_format($producto[\"precio\"], 2) ?></td>\n                    </tr>\n                <?php } ?>\n            </tbody>\n\n            <tr>\n                <td class=\"cantidad\"></td>\n                <td class=\"producto\">\n                    <BR>\n                    <strong>SUBTOTAL</strong>\n\n                    <p></p>\n                    <strong>TOTAL A PAGAR</strong>\n                    <p></p>\n                    <strong>VALOR PAGADO</strong>\n                    <p></p>\n                    <strong>FORMA DE PAGO</strong>\n                    <p></p>\n                    <strong>CAMBIO</strong>\n                    \n                </td>\n                \n                <th class=\"precio\">\n                    $<?php echo number_format($venta[\"total\"] - $venta[\"iva\"], 2) ?>\n                    <p></p>\n                    $<?php echo number_format($venta[\"total\"], 2) ?>\n                    <p>$<?php echo $venta[\"dinero_entregado\"] ?></p>\n                    <p></p>\n                    <p><?php echo $venta[\"forma_pago\"] ?></p>\n                    <p></p>\n                    $<?php echo $venta[\"devuelta\"] ?>\n                    \n                </th>\n            </tr>\n        </table>\n        <br>\n        <p class=\"centrado\">¡GRACIAS POR SU COMPRA! </P>\n        <br>\n            <P>Elaborado por www.cloudecoway.com</p>\n            <P>Tel: 3137010627</p>\n\n    </div>\n</body>\n\n</html>','A'),(268,'/var/www/html/company/Ventaspos/mod/app_ventas/imprimirFactura.php','2022-05-31 22:17:00','rafael',190,5194,'<?php\n$medidaTicket = 280;\n\n\n$empresa = PCO_EjecutarSQL(\"\n            SELECT razon_social, nit, telefono, direccion\n            FROM app_empresa\n            WHERE id = 1\n        \")->fetch();\n\n$venta = PCO_EjecutarSQL(\"\n            SELECT date_format(fecha, \'%d-%m-%Y %H:%i:%s\') fecha, total, iva, forma_pago, devuelta, dinero_entregado, id_cliente\n            FROM app_ventas\n            WHERE id = \'$id\'\n        \")->fetch();\n\n$cliente = PCO_EjecutarSQL(\"\n            SELECT *\n            FROM app_clientes\n            WHERE id = \'\" . $venta[\"id_cliente\"] . \"\'\n        \")->fetch();\n\n$productos = PCO_EjecutarSQL(\"\n            SELECT vd.cantidad, p.nombre as descripcion, vd.precio, date_format(fecha, \'%d-%m-%Y\') \n            FROM app_ventas_detalle vd, app_productos p\n            WHERE vd.id_producto = p.id AND vd.id_venta = \'$id\'\n        \")->fetchAll();\n?>\n<!DOCTYPE html>\n<html>\n\n<head>\n\n    <style>\n        * {\n            font-size: 15px;\n            font-family: \'DejaVu Sans\', serif;\n        }\n\n        h1 {\n            font-size: 18px;\n        }\n\n        \n\n        .ticket {\n            margin: 0.5px;\n        }\n\n        td,\n        th,\n        tr,\n        table {\n            border-top: 1px solid black;\n            border-collapse: collapse;\n            margin: 0 auto;\n            font-size: 15px;\n        }\n\n        td.precio {\n            text-align: right;\n            font-size: 11px;\n        }\n\n        td.cantidad {\n            font-size: 12px;\n        }\n\n        td.producto {\n            text-align: center;\n        }\n\n        th {\n            text-align: center;\n        }\n\n\n        .centrado {\n            text-align: center;\n            align-content: center;\n        }\n\n        .ticket {\n            width: <?php echo $medidaTicket ?>px;\n            max-width: <?php echo $medidaTicket ?>px;\n        }\n\n        img {\n            max-width: inherit;\n            width: inherit;\n        }\n\n        * {\n            margin: 0;\n            padding: 0;\n        }\n\n        .ticket {\n            margin: 0;\n            padding: 0;\n        }\n\n        body {\n            text-align: center;\n        }\n    </style>\n</head>\n\n<body>\n    <div class=\"ticket centrado\">\n        <h1><?php echo $empresa[\"razon_social\"] ?></h1>\n        <h2>NIT: <?php echo $empresa[\"nit\"] ?></h2>\n        <h2>Teléfono: <?php echo $empresa[\"telefono\"] ?></h2>\n        <h2>Direccion: <?php echo $empresa[\"direccion\"] ?></h2>\n        <h2>Correo: </h2>\n        <h2>--------------------------------------------</h2>\n        <h1 align=\"center\">Ticket de venta #<?php echo $id ?></h1>\n        \n        <h2>Fecha: <?php echo $venta[\"fecha\"] ?></h2>\n        <h2>Cliente: <?php echo $cliente[\"nombre_completo\"] ?></h2>\n        <h2>telefono: <?php echo $cliente[\"telefono\"] ?></h2>\n        <h2>CC / NIT: <?php echo $cliente[\"numero_documento\"] ?></h2>\n        <h2>Dirección: <?php echo $cliente[\"direccion\"] ?></h2>\n        <h2>Vendedor:</h2>\n        <h2>Caja N° 1</h2>\n        <br>\n\n        <table>\n            <thead>\n                <tr class=\"centrado\">\n                    <th class=\"cantidad\">CANT</th>\n                    <th class=\"producto\">PRODUCTO</th>\n                    <th class=\"precio\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;TOTAL</th>\n                </tr>\n            </thead>\n            <tbody>\n                <?php\n                $total = 0;\n                foreach ($productos as $producto) {\n                    $total += $producto[\"cantidad\"] * $producto[\"precio\"];\n                ?>\n                    <tr>\n                        <td class=\"cantidad\"><?php echo number_format($producto[\"cantidad\"], 2) ?></td>\n                        <td class=\"producto\"><?php echo $producto[\"descripcion\"] ?></td>\n                        <td class=\"precio\">$<?php echo number_format($producto[\"precio\"], 2) ?></td>\n                    </tr>\n                <?php } ?>\n            </tbody>\n\n            <tr>\n                <td class=\"cantidad\"></td>\n                <td class=\"producto\">\n                    <BR>\n                    <strong>SUBTOTAL</strong>\n\n                    <p></p>\n                    <strong>TOTAL A PAGAR</strong>\n                    <p></p>\n                    <strong>VALOR PAGADO</strong>\n                    <p></p>\n                    <strong>FORMA DE PAGO</strong>\n                    <p></p>\n                    <strong>CAMBIO</strong>\n                    \n                </td>\n                \n                <th class=\"precio\">\n                    <BR>\n                    $<?php echo number_format($venta[\"total\"] - $venta[\"iva\"], 2) ?>\n                    <p></p>\n                    $<?php echo number_format($venta[\"total\"], 2) ?>\n                    <p>$<?php echo $venta[\"dinero_entregado\"] ?></p>\n                    <p></p>\n                    <p><?php echo $venta[\"forma_pago\"] ?></p>\n                    <p></p>\n                    $<?php echo $venta[\"devuelta\"] ?>\n                    \n                </th>\n            </tr>\n        </table>\n        <br>\n        <p class=\"centrado\">¡GRACIAS POR SU COMPRA! </P>\n        <br>\n            <P>Elaborado por www.cloudecoway.com</p>\n            <P>Tel: 3137010627</p>\n\n    </div>\n</body>\n\n</html>','A'),(269,'/var/www/html/company/Ventaspos/mod/app_ventas/imprimirFactura.php','2022-05-31 22:19:00','rafael',196,5350,'<?php\n$medidaTicket = 280;\n\n\n$empresa = PCO_EjecutarSQL(\"\n            SELECT razon_social, nit, telefono, direccion\n            FROM app_empresa\n            WHERE id = 1\n        \")->fetch();\n\n$venta = PCO_EjecutarSQL(\"\n            SELECT date_format(fecha, \'%d-%m-%Y %H:%i:%s\') fecha, total, iva, forma_pago, devuelta, dinero_entregado, id_cliente\n            FROM app_ventas\n            WHERE id = \'$id\'\n        \")->fetch();\n\n$cliente = PCO_EjecutarSQL(\"\n            SELECT *\n            FROM app_clientes\n            WHERE id = \'\" . $venta[\"id_cliente\"] . \"\'\n        \")->fetch();\n\n$cliente = PCO_EjecutarSQL(\"\n            SELECT nombre\n            FROM core_usuario\n            WHERE login = \'$PCOSESS_LoginUsuario\'\n        \")->fetch();\n\n$productos = PCO_EjecutarSQL(\"\n            SELECT vd.cantidad, p.nombre as descripcion, vd.precio, date_format(fecha, \'%d-%m-%Y\') \n            FROM app_ventas_detalle vd, app_productos p\n            WHERE vd.id_producto = p.id AND vd.id_venta = \'$id\'\n        \")->fetchAll();\n?>\n<!DOCTYPE html>\n<html>\n\n<head>\n\n    <style>\n        * {\n            font-size: 15px;\n            font-family: \'DejaVu Sans\', serif;\n        }\n\n        h1 {\n            font-size: 18px;\n        }\n\n        \n\n        .ticket {\n            margin: 0.5px;\n        }\n\n        td,\n        th,\n        tr,\n        table {\n            border-top: 1px solid black;\n            border-collapse: collapse;\n            margin: 0 auto;\n            font-size: 15px;\n        }\n\n        td.precio {\n            text-align: right;\n            font-size: 11px;\n        }\n\n        td.cantidad {\n            font-size: 12px;\n        }\n\n        td.producto {\n            text-align: center;\n        }\n\n        th {\n            text-align: center;\n        }\n\n\n        .centrado {\n            text-align: center;\n            align-content: center;\n        }\n\n        .ticket {\n            width: <?php echo $medidaTicket ?>px;\n            max-width: <?php echo $medidaTicket ?>px;\n        }\n\n        img {\n            max-width: inherit;\n            width: inherit;\n        }\n\n        * {\n            margin: 0;\n            padding: 0;\n        }\n\n        .ticket {\n            margin: 0;\n            padding: 0;\n        }\n\n        body {\n            text-align: center;\n        }\n    </style>\n</head>\n\n<body>\n    <div class=\"ticket centrado\">\n        <h1><?php echo $empresa[\"razon_social\"] ?></h1>\n        <h2>NIT: <?php echo $empresa[\"nit\"] ?></h2>\n        <h2>Teléfono: <?php echo $empresa[\"telefono\"] ?></h2>\n        <h2>Direccion: <?php echo $empresa[\"direccion\"] ?></h2>\n        <h2>Correo: </h2>\n        <h2>--------------------------------------------</h2>\n        <h1 align=\"center\">Ticket de venta #<?php echo $id ?></h1>\n        \n        <h2>Fecha: <?php echo $venta[\"fecha\"] ?></h2>\n        <h2>Cliente: <?php echo $cliente[\"nombre_completo\"] ?></h2>\n        <h2>telefono: <?php echo $cliente[\"telefono\"] ?></h2>\n        <h2>CC / NIT: <?php echo $cliente[\"numero_documento\"] ?></h2>\n        <h2>Dirección: <?php echo $cliente[\"direccion\"] ?></h2>\n        <h2>Vendedor:</h2>\n        <h2>Caja N° 1</h2>\n        <br>\n\n        <table>\n            <thead>\n                <tr class=\"centrado\">\n                    <th class=\"cantidad\">CANT</th>\n                    <th class=\"producto\">PRODUCTO</th>\n                    <th class=\"precio\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;TOTAL</th>\n                </tr>\n            </thead>\n            <tbody>\n                <?php\n                $total = 0;\n                foreach ($productos as $producto) {\n                    $total += $producto[\"cantidad\"] * $producto[\"precio\"];\n                ?>\n                    <tr>\n                        <td class=\"cantidad\"><?php echo number_format($producto[\"cantidad\"], 2) ?></td>\n                        <td class=\"producto\"><?php echo $producto[\"descripcion\"] ?></td>\n                        <td class=\"precio\">$<?php echo number_format($producto[\"precio\"], 2) ?></td>\n                    </tr>\n                <?php } ?>\n            </tbody>\n\n            <tr>\n                <td class=\"cantidad\"></td>\n                <td class=\"producto\">\n                    <BR>\n                    <strong>SUBTOTAL</strong>\n\n                    <p></p>\n                    <strong>TOTAL A PAGAR</strong>\n                    <p></p>\n                    <strong>VALOR PAGADO</strong>\n                    <p></p>\n                    <strong>FORMA DE PAGO</strong>\n                    <p></p>\n                    <strong>CAMBIO</strong>\n                    \n                </td>\n                \n                <th class=\"precio\">\n                    <BR>\n                    $<?php echo number_format($venta[\"total\"] - $venta[\"iva\"], 2) ?>\n                    <p></p>\n                    $<?php echo number_format($venta[\"total\"], 2) ?>\n                    <p>$<?php echo $venta[\"dinero_entregado\"] ?></p>\n                    <p></p>\n                    <p><?php echo $venta[\"forma_pago\"] ?></p>\n                    <p></p>\n                    $<?php echo $venta[\"devuelta\"] ?>\n                    \n                </th>\n            </tr>\n        </table>\n        <br>\n        <p class=\"centrado\">¡GRACIAS POR SU COMPRA! </P>\n        <br>\n            <P>Elaborado por www.cloudecoway.com</p>\n            <P>Tel: 3137010627</p>\n\n    </div>\n</body>\n\n</html>','A'),(270,'/var/www/html/company/Ventaspos/mod/app_ventas/imprimirFactura.php','2022-05-31 22:21:00','rafael',196,5383,'<?php\n$medidaTicket = 280;\n\n\n$empresa = PCO_EjecutarSQL(\"\n            SELECT razon_social, nit, telefono, direccion\n            FROM app_empresa\n            WHERE id = 1\n        \")->fetch();\n\n$venta = PCO_EjecutarSQL(\"\n            SELECT date_format(fecha, \'%d-%m-%Y %H:%i:%s\') fecha, total, iva, forma_pago, devuelta, dinero_entregado, id_cliente\n            FROM app_ventas\n            WHERE id = \'$id\'\n        \")->fetch();\n\n$cliente = PCO_EjecutarSQL(\"\n            SELECT *\n            FROM app_clientes\n            WHERE id = \'\" . $venta[\"id_cliente\"] . \"\'\n        \")->fetch();\n\n$vendedor = PCO_EjecutarSQL(\"\n            SELECT nombre\n            FROM core_usuario\n            WHERE login = \'$PCOSESS_LoginUsuario\'\n        \")->fetchColumn();\n\n$productos = PCO_EjecutarSQL(\"\n            SELECT vd.cantidad, p.nombre as descripcion, vd.precio, date_format(fecha, \'%d-%m-%Y\') \n            FROM app_ventas_detalle vd, app_productos p\n            WHERE vd.id_producto = p.id AND vd.id_venta = \'$id\'\n        \")->fetchAll();\n?>\n<!DOCTYPE html>\n<html>\n\n<head>\n\n    <style>\n        * {\n            font-size: 15px;\n            font-family: \'DejaVu Sans\', serif;\n        }\n\n        h1 {\n            font-size: 18px;\n        }\n\n        \n\n        .ticket {\n            margin: 0.5px;\n        }\n\n        td,\n        th,\n        tr,\n        table {\n            border-top: 1px solid black;\n            border-collapse: collapse;\n            margin: 0 auto;\n            font-size: 15px;\n        }\n\n        td.precio {\n            text-align: right;\n            font-size: 11px;\n        }\n\n        td.cantidad {\n            font-size: 12px;\n        }\n\n        td.producto {\n            text-align: center;\n        }\n\n        th {\n            text-align: center;\n        }\n\n\n        .centrado {\n            text-align: center;\n            align-content: center;\n        }\n\n        .ticket {\n            width: <?php echo $medidaTicket ?>px;\n            max-width: <?php echo $medidaTicket ?>px;\n        }\n\n        img {\n            max-width: inherit;\n            width: inherit;\n        }\n\n        * {\n            margin: 0;\n            padding: 0;\n        }\n\n        .ticket {\n            margin: 0;\n            padding: 0;\n        }\n\n        body {\n            text-align: center;\n        }\n    </style>\n</head>\n\n<body>\n    <div class=\"ticket centrado\">\n        <h1><?php echo $empresa[\"razon_social\"] ?></h1>\n        <h2>NIT: <?php echo $empresa[\"nit\"] ?></h2>\n        <h2>Teléfono: <?php echo $empresa[\"telefono\"] ?></h2>\n        <h2>Direccion: <?php echo $empresa[\"direccion\"] ?></h2>\n        <h2>Correo: </h2>\n        <h2>--------------------------------------------</h2>\n        <h1 align=\"center\">Ticket de venta #<?php echo $id ?></h1>\n        \n        <h2>Fecha: <?php echo $venta[\"fecha\"] ?></h2>\n        <h2>Cliente: <?php echo $cliente[\"nombre_completo\"] ?></h2>\n        <h2>telefono: <?php echo $cliente[\"telefono\"] ?></h2>\n        <h2>CC / NIT: <?php echo $cliente[\"numero_documento\"] ?></h2>\n        <h2>Dirección: <?php echo $cliente[\"direccion\"] ?></h2>\n        <h2>Vendedor: <?php echo $vendedor; ?></h2>\n        <h2>Caja N° 1</h2>\n        <br>\n\n        <table>\n            <thead>\n                <tr class=\"centrado\">\n                    <th class=\"cantidad\">CANT</th>\n                    <th class=\"producto\">PRODUCTO</th>\n                    <th class=\"precio\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;TOTAL</th>\n                </tr>\n            </thead>\n            <tbody>\n                <?php\n                $total = 0;\n                foreach ($productos as $producto) {\n                    $total += $producto[\"cantidad\"] * $producto[\"precio\"];\n                ?>\n                    <tr>\n                        <td class=\"cantidad\"><?php echo number_format($producto[\"cantidad\"], 2) ?></td>\n                        <td class=\"producto\"><?php echo $producto[\"descripcion\"] ?></td>\n                        <td class=\"precio\">$<?php echo number_format($producto[\"precio\"], 2) ?></td>\n                    </tr>\n                <?php } ?>\n            </tbody>\n\n            <tr>\n                <td class=\"cantidad\"></td>\n                <td class=\"producto\">\n                    <BR>\n                    <strong>SUBTOTAL</strong>\n\n                    <p></p>\n                    <strong>TOTAL A PAGAR</strong>\n                    <p></p>\n                    <strong>VALOR PAGADO</strong>\n                    <p></p>\n                    <strong>FORMA DE PAGO</strong>\n                    <p></p>\n                    <strong>CAMBIO</strong>\n                    \n                </td>\n                \n                <th class=\"precio\">\n                    <BR>\n                    $<?php echo number_format($venta[\"total\"] - $venta[\"iva\"], 2) ?>\n                    <p></p>\n                    $<?php echo number_format($venta[\"total\"], 2) ?>\n                    <p>$<?php echo $venta[\"dinero_entregado\"] ?></p>\n                    <p></p>\n                    <p><?php echo $venta[\"forma_pago\"] ?></p>\n                    <p></p>\n                    $<?php echo $venta[\"devuelta\"] ?>\n                    \n                </th>\n            </tr>\n        </table>\n        <br>\n        <p class=\"centrado\">¡GRACIAS POR SU COMPRA! </P>\n        <br>\n            <P>Elaborado por www.cloudecoway.com</p>\n            <P>Tel: 3137010627</p>\n\n    </div>\n</body>\n\n</html>','A'),(271,'/var/www/html/company/Ventaspos/mod/app_ventas/index.php','2022-05-31 22:26:00','rafael',113,4440,'<?php\n\nfunction calcularTotalVenta($id) {\n    $venta = PCO_EjecutarSQL(\"\n        SELECT SUM(precio * cantidad) as total, SUM(precio * iva/100) iva\n        FROM app_ventas_detalle\n        WHERE id_venta = \'$id\' GROUP BY id_venta\n    \")->fetch();\n    $total = $venta[\"total\"] ? $venta[\"total\"] : 0;\n    $iva = $venta[\"iva\"] ? $venta[\"iva\"] : 0;\n    PCO_EjecutarSQLUnaria(\"UPDATE app_ventas SET total = $total, iva = $iva WHERE id = $id \");\n    return \'\"total\": \' . $total . \', \"iva\": \' . $iva;\n}\n\nif($PCO_Accion == \"VENTA_ingresarRealizarVenta\") {\n    $ventaAbierta = PCO_EjecutarSQL(\"\n        SELECT id, id_cliente, total, iva\n        FROM app_ventas\n        WHERE estado = 0 ORDER BY id limit 1\n    \")->fetch();\n    /*if (!$ventaAbierta[\"id\"]) {\n        \n        $ventaAbierta = PCO_EjecutarSQL(\"\n            SELECT *\n            FROM app_ventas\n            WHERE estado = 0 ORDER BY id limit 1\n        \")->fetch();   \n    }*/\n\n    $id_venta = $ventaAbierta[\"id\"] ? $ventaAbierta[\"id\"] : \"\";\n    if($id_venta) {\n        $total = number_format($ventaAbierta[\"total\"], 2);\n        $iva = number_format($ventaAbierta[\"iva\"], 2);\n        $id_cliente = $ventaAbierta[\"id_cliente\"];\n    }\n\n    PCO_CargarFormulario(8, 1, \"id\", $id_venta);\n}\n\nif($PCO_Accion == \"VENTA_agregarProducto\") {\n\n    if(!$id) {\n        //crear cliente en caso de que no llegue id_cliente\n        if(!$id_cliente) {\n            PCO_EjecutarSQLUnaria(\"INSERT INTO app_clientes (nombre_completo, numero_documento, telefono) VALUES (?,?,?) \",\n                \"$nombre_completo$_SeparadorCampos_$numero_documento$_SeparadorCampos_$telefono\"\n            );\n            $id_cliente = PCO_ObtenerUltimoIDInsertado();\n        }\n        PCO_EjecutarSQLUnaria(\"INSERT INTO app_ventas (id_cliente, usuario) VALUES (?,?) \", \"$id_cliente$_SeparadorCampos_$PCOSESS_LoginUsuario\");\n        $id = PCO_ObtenerUltimoIDInsertado();\n    }\n    $producto = PCO_EjecutarSQL(\"\n        SELECT id, precio_venta, iva, inventario\n        FROM app_productos\n        WHERE id = \'$id_producto\'\n    \")->fetch();\n    if($producto[\"id\"]) {\n        $existe = PCO_EjecutarSQL(\"\n            SELECT count(id)\n            FROM app_ventas_detalle\n            WHERE id_venta = $id AND id_producto = \'$id_producto\'\n        \")->fetchColumn();\n        if($existe > 0) {\n            print_r(\'{\"success\": false, \"msg\": \"El producto ya se ha ingresado\"}\');\n            die();\n        }\n        if($producto[\"inventario\"] < $cantidad) {\n            print_r(\'{\"success\": false, \"msg\": \"La cantidad digitada supera la del invetario\"}\');\n            die();\n        }\n        $inventarioNew = $producto[\"inventario\"] - $cantidad;\n        PCO_EjecutarSQLUnaria(\"UPDATE app_productos SET inventario = $inventarioNew WHERE id = \" . $producto[\"id\"]);\n        PCO_EjecutarSQLUnaria(\"INSERT INTO app_ventas_detalle (id_venta, id_producto, cantidad, precio, iva) VALUES (?,?,?,?,?) \", \n            \"$id$_SeparadorCampos_$id_producto$_SeparadorCampos_$cantidad$_SeparadorCampos_\" . $producto[\"precio_venta\"] . \"$_SeparadorCampos_\" . $producto[\"iva\"]);\n        $result = calcularTotalVenta($id);\n        print_r(\'{\"success\": true, \"id\": \' . $id . \', \' . $result . \'}\');\n        die();\n    }\n    print_r(\'{\"success\": false, \"msg\": \"No se ha encontrado el producto seleccionado\"}\');\n    die();\n}\n\nif($PCO_Accion == \"VENTA_eliminarProducto\") {\n\n    if($id_venta_detalle && $id_venta) {\n        $producto = PCO_EjecutarSQL(\"\n            SELECT p.inventario, vd.cantidad, p.id\n            FROM app_ventas_detalle vd, app_productos p\n            WHERE vd.id_producto = p.id AND vd.id = \'$id_venta_detalle\'\n        \")->fetch();\n        //Restablecemos el inventario\n        $inventarioNew = $producto[\"inventario\"] + $producto[\"cantidad\"];\n        PCO_EjecutarSQLUnaria(\"UPDATE app_productos SET inventario = $inventarioNew WHERE id = \" . $producto[\"id\"]);\n        PCO_EjecutarSQLUnaria(\"DELETE FROM app_ventas_detalle WHERE id_venta = $id_venta AND id = $id_venta_detalle\");\n        $result = calcularTotalVenta($id_venta);\n        print_r(\'{\"success\": true, \"msg\": \"Se ha eliminado el producto exitosamente\", \' . $result . \'}\');\n        die();\n    }\n    print_r(\'{\"success\": false, \"msg\": \"No se pudo eliminar el producto\"}\');\n    die();\n}\n\nif($PCO_Accion == \"VENTA_imprimirFactura\") {\n\n    //sleep(2);\n    // echo \"$PCO_Valor\";\n    if($PCO_Valor)\n        $id = $PCO_Valor;\n    if($id) {\n        include_once \"imprimirFactura.php\";\n    }\n}','A'),(272,'/var/www/html/company/Ventaspos/mod/app_ventas/imprimirFactura.php','2022-05-31 22:35:00','rafael',197,5403,'<?php\n$medidaTicket = 280;\n\n\n$empresa = PCO_EjecutarSQL(\"\n            SELECT razon_social, nit, telefono, direccion\n            FROM app_empresa\n            WHERE id = 1\n        \")->fetch();\n\n$venta = PCO_EjecutarSQL(\"\n            SELECT date_format(fecha, \'%d-%m-%Y %H:%i:%s\') fecha, total, iva, forma_pago, devuelta, dinero_entregado, id_cliente\n            FROM app_ventas\n            WHERE id = \'$id\'\n        \")->fetch();\n\n$cliente = PCO_EjecutarSQL(\"\n            SELECT *\n            FROM app_clientes\n            WHERE id = \'\" . $venta[\"id_cliente\"] . \"\'\n        \")->fetch();\n\n$vendedor = PCO_EjecutarSQL(\"\n            SELECT nombre\n            FROM core_usuario\n            WHERE login = \'$PCOSESS_LoginUsuario\'\n        \")->fetchColumn();\n\n$productos = PCO_EjecutarSQL(\"\n            SELECT vd.cantidad, p.nombre as descripcion, vd.precio, date_format(fecha, \'%d-%m-%Y\') \n            FROM app_ventas_detalle vd, app_productos p\n            WHERE vd.id_producto = p.id AND vd.id_venta = \'$id\'\n        \")->fetchAll();\n?>\n<!DOCTYPE html>\n<html>\n\n<head>\n\n    <style>\n        * {\n            font-size: 15px;\n            font-family: \'DejaVu Sans\', serif;\n        }\n\n        h1 {\n            font-size: 18px;\n        }\n\n        \n\n        .ticket {\n            margin: 0.5px;\n        }\n\n        td,\n        th,\n        tr,\n        table {\n            border-top: 1px solid black;\n            border-collapse: collapse;\n            margin: 0 auto;\n            font-size: 15px;\n        }\n\n        td.precio {\n            text-align: right;\n            font-size: 11px;\n        }\n\n        td.cantidad {\n            font-size: 12px;\n        }\n\n        td.producto {\n            text-align: center;\n        }\n\n        th {\n            text-align: center;\n        }\n\n\n        .centrado {\n            text-align: center;\n            align-content: center;\n        }\n\n        .ticket {\n            width: <?php echo $medidaTicket ?>px;\n            max-width: <?php echo $medidaTicket ?>px;\n        }\n\n        img {\n            max-width: inherit;\n            width: inherit;\n        }\n\n        * {\n            margin: 0;\n            padding: 0;\n        }\n\n        .ticket {\n            margin: 0;\n            padding: 0;\n        }\n\n        body {\n            text-align: center;\n        }\n    </style>\n</head>\n\n<body>\n    <div class=\"ticket centrado\">\n        <h1><?php echo $empresa[\"razon_social\"] ?></h1>\n        <h2>NIT: <?php echo $empresa[\"nit\"] ?></h2>\n        <h2>Teléfono: <?php echo $empresa[\"telefono\"] ?></h2>\n        <h2>Direccion: <?php echo $empresa[\"direccion\"] ?></h2>\n        <h2>Correo: </h2>\n        <h2>--------------------------------------------</h2>\n        <h1 align=\"center\">Ticket de venta #<?php echo $id ?></h1>\n        \n        <h2>Fecha: <?php echo $venta[\"fecha\"] ?></h2>\n        <h2>Cliente: <?php echo $cliente[\"nombre_completo\"] ?></h2>\n        <h2>telefono: <?php echo $cliente[\"telefono\"] ?></h2>\n        <h2>CC / NIT: <?php echo $cliente[\"numero_documento\"] ?></h2>\n        <h2>Dirección: <?php echo $cliente[\"direccion\"] ?></h2>\n        <h2>Vendedor: <?php echo $vendedor; ?></h2>\n        <h2>Caja N° 1</h2>\n        <br>\n\n        <table>\n            <thead>\n                <tr class=\"centrado\">\n                    <th class=\"cantidad\">CANT</th>\n                    <th class=\"producto\">PRODUCTO</th>\n                    <th class=\"precio\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;TOTAL</th>\n                </tr>\n            </thead>\n            <tbody>\n                <?php\n                $total = 0;\n                foreach ($productos as $producto) {\n                    $total += $producto[\"cantidad\"] * $producto[\"precio\"];\n                ?>\n                    <tr>\n                        <td class=\"cantidad\"><?php echo number_format($producto[\"cantidad\"], 2) ?></td>\n                        <td class=\"producto\"><?php echo $producto[\"descripcion\"] ?></td>\n                        <td class=\"precio\">$<?php echo number_format($producto[\"precio\"], 2) ?></td>\n                    </tr>\n                <?php } ?>\n            </tbody>\n</table>\n<table>\n            <tr>\n                <td class=\"cantidad\"></td>\n                <td class=\"producto\">\n                    <BR>\n                    <strong>SUBTOTAL</strong>\n\n                    <p></p>\n                    <strong>TOTAL A PAGAR</strong>\n                    <p></p>\n                    <strong>VALOR PAGADO</strong>\n                    <p></p>\n                    <strong>FORMA DE PAGO</strong>\n                    <p></p>\n                    <strong>CAMBIO</strong>\n                    \n                </td>\n                \n                <th class=\"precio\">\n                    <BR>\n                    $<?php echo number_format($venta[\"total\"] - $venta[\"iva\"], 2) ?>\n                    <p></p>\n                    $<?php echo number_format($venta[\"total\"], 2) ?>\n                    <p>$<?php echo $venta[\"dinero_entregado\"] ?></p>\n                    <p></p>\n                        <p><?php echo $venta[\"forma_pago\"] ?></p>\n                    <p></p>\n                    $<?php echo $venta[\"devuelta\"] ?>\n                    \n                </th>\n            </tr>\n        </table>\n        <br>\n        <p class=\"centrado\">¡GRACIAS POR SU COMPRA! </P>\n        <br>\n            <P>Elaborado por www.cloudecoway.com</p>\n            <P>Tel: 3137010627</p>\n\n    </div>\n</body>\n\n</html>','A'),(273,'/var/www/html/company/Ventaspos/mod/app_ventas/imprimirFactura.php','2022-05-31 22:35:00','rafael',196,5360,'<?php\n$medidaTicket = 280;\n\n\n$empresa = PCO_EjecutarSQL(\"\n            SELECT razon_social, nit, telefono, direccion\n            FROM app_empresa\n            WHERE id = 1\n        \")->fetch();\n\n$venta = PCO_EjecutarSQL(\"\n            SELECT date_format(fecha, \'%d-%m-%Y %H:%i:%s\') fecha, total, iva, forma_pago, devuelta, dinero_entregado, id_cliente\n            FROM app_ventas\n            WHERE id = \'$id\'\n        \")->fetch();\n\n$cliente = PCO_EjecutarSQL(\"\n            SELECT *\n            FROM app_clientes\n            WHERE id = \'\" . $venta[\"id_cliente\"] . \"\'\n        \")->fetch();\n\n$vendedor = PCO_EjecutarSQL(\"\n            SELECT nombre\n            FROM core_usuario\n            WHERE login = \'$PCOSESS_LoginUsuario\'\n        \")->fetchColumn();\n\n$productos = PCO_EjecutarSQL(\"\n            SELECT vd.cantidad, p.nombre as descripcion, vd.precio, date_format(fecha, \'%d-%m-%Y\') \n            FROM app_ventas_detalle vd, app_productos p\n            WHERE vd.id_producto = p.id AND vd.id_venta = \'$id\'\n        \")->fetchAll();\n?>\n<!DOCTYPE html>\n<html>\n\n<head>\n\n    <style>\n        * {\n            font-size: 15px;\n            font-family: \'DejaVu Sans\', serif;\n        }\n\n        h1 {\n            font-size: 18px;\n        }\n\n        \n\n        .ticket {\n            margin: 0.5px;\n        }\n\n        td,\n        th,\n        tr,\n        table {\n            border-top: 1px solid black;\n            border-collapse: collapse;\n            margin: 0 auto;\n            font-size: 15px;\n        }\n\n        td.precio {\n            text-align: right;\n            font-size: 11px;\n        }\n\n        td.cantidad {\n            font-size: 12px;\n        }\n\n        td.producto {\n            text-align: center;\n        }\n\n        th {\n            text-align: center;\n        }\n\n\n        .centrado {\n            text-align: center;\n            align-content: center;\n        }\n\n        .ticket {\n            width: <?php echo $medidaTicket ?>px;\n            max-width: <?php echo $medidaTicket ?>px;\n        }\n\n        img {\n            max-width: inherit;\n            width: inherit;\n        }\n\n        * {\n            margin: 0;\n            padding: 0;\n        }\n\n        .ticket {\n            margin: 0;\n            padding: 0;\n        }\n\n        body {\n            text-align: center;\n        }\n    </style>\n</head>\n\n<body>\n    <div class=\"ticket centrado\">\n        <h1><?php echo $empresa[\"razon_social\"] ?></h1>\n        <h2>NIT: <?php echo $empresa[\"nit\"] ?></h2>\n        <h2>Teléfono: <?php echo $empresa[\"telefono\"] ?></h2>\n        <h2>Direccion: <?php echo $empresa[\"direccion\"] ?></h2>\n        <h2>Correo: </h2>\n        <h2>--------------------------------------------</h2>\n        <h1 align=\"center\">Ticket de venta #<?php echo $id ?></h1>\n        \n        <h2>Fecha: <?php echo $venta[\"fecha\"] ?></h2>\n        <h2>Cliente: <?php echo $cliente[\"nombre_completo\"] ?></h2>\n        <h2>telefono: <?php echo $cliente[\"telefono\"] ?></h2>\n        <h2>CC / NIT: <?php echo $cliente[\"numero_documento\"] ?></h2>\n        <h2>Dirección: <?php echo $cliente[\"direccion\"] ?></h2>\n        <h2>Vendedor: <?php echo $vendedor; ?></h2>\n        <h2>Caja N° 1</h2>\n        <br>\n\n        <table>\n            <thead>\n                <tr class=\"centrado\">\n                    <th class=\"cantidad\">CANT</th>\n                    <th class=\"producto\">PRODUCTO</th>\n                    <th class=\"precio\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;TOTAL</th>\n                </tr>\n            </thead>\n            <tbody>\n                <?php\n                $total = 0;\n                foreach ($productos as $producto) {\n                    $total += $producto[\"cantidad\"] * $producto[\"precio\"];\n                ?>\n                    <tr>\n                        <td class=\"cantidad\"><?php echo number_format($producto[\"cantidad\"], 2) ?></td>\n                        <td class=\"producto\"><?php echo $producto[\"descripcion\"] ?></td>\n                        <td class=\"precio\">$<?php echo number_format($producto[\"precio\"], 2) ?></td>\n                    </tr>\n                <?php } ?>\n            </tbody>\n</table>\n<table>\n            <tr>\n                <td class=\"producto\">\n                    <BR>\n                    <strong>SUBTOTAL</strong>\n\n                    <p></p>\n                    <strong>TOTAL A PAGAR</strong>\n                    <p></p>\n                    <strong>VALOR PAGADO</strong>\n                    <p></p>\n                    <strong>FORMA DE PAGO</strong>\n                    <p></p>\n                    <strong>CAMBIO</strong>\n                    \n                </td>\n                \n                <th class=\"precio\">\n                    <BR>\n                    $<?php echo number_format($venta[\"total\"] - $venta[\"iva\"], 2) ?>\n                    <p></p>\n                    $<?php echo number_format($venta[\"total\"], 2) ?>\n                    <p>$<?php echo $venta[\"dinero_entregado\"] ?></p>\n                    <p></p>\n                        <p><?php echo $venta[\"forma_pago\"] ?></p>\n                    <p></p>\n                    $<?php echo $venta[\"devuelta\"] ?>\n                    \n                </th>\n            </tr>\n        </table>\n        <br>\n        <p class=\"centrado\">¡GRACIAS POR SU COMPRA! </P>\n        <br>\n            <P>Elaborado por www.cloudecoway.com</p>\n            <P>Tel: 3137010627</p>\n\n    </div>\n</body>\n\n</html>','A'),(274,'/var/www/html/company/Ventaspos/mod/app_ventas/imprimirFactura.php','2022-05-31 22:37:00','rafael',195,5311,'<?php\n$medidaTicket = 280;\n\n\n$empresa = PCO_EjecutarSQL(\"\n            SELECT razon_social, nit, telefono, direccion\n            FROM app_empresa\n            WHERE id = 1\n        \")->fetch();\n\n$venta = PCO_EjecutarSQL(\"\n            SELECT date_format(fecha, \'%d-%m-%Y %H:%i:%s\') fecha, total, iva, forma_pago, devuelta, dinero_entregado, id_cliente\n            FROM app_ventas\n            WHERE id = \'$id\'\n        \")->fetch();\n\n$cliente = PCO_EjecutarSQL(\"\n            SELECT *\n            FROM app_clientes\n            WHERE id = \'\" . $venta[\"id_cliente\"] . \"\'\n        \")->fetch();\n\n$vendedor = PCO_EjecutarSQL(\"\n            SELECT nombre\n            FROM core_usuario\n            WHERE login = \'$PCOSESS_LoginUsuario\'\n        \")->fetchColumn();\n\n$productos = PCO_EjecutarSQL(\"\n            SELECT vd.cantidad, p.nombre as descripcion, vd.precio, date_format(fecha, \'%d-%m-%Y\') \n            FROM app_ventas_detalle vd, app_productos p\n            WHERE vd.id_producto = p.id AND vd.id_venta = \'$id\'\n        \")->fetchAll();\n?>\n<!DOCTYPE html>\n<html>\n\n<head>\n\n    <style>\n        * {\n            font-size: 15px;\n            font-family: \'DejaVu Sans\', serif;\n        }\n\n        h1 {\n            font-size: 18px;\n        }\n\n        \n\n        .ticket {\n            margin: 0.5px;\n        }\n\n        td,\n        th,\n        tr,\n        table {\n            border-top: 1px solid black;\n            border-collapse: collapse;\n            margin: 0 auto;\n            font-size: 15px;\n        }\n\n        td.precio {\n            text-align: right;\n            font-size: 11px;\n        }\n\n        td.cantidad {\n            font-size: 12px;\n        }\n\n        td.producto {\n            text-align: center;\n        }\n\n        th {\n            text-align: center;\n        }\n\n\n        .centrado {\n            text-align: center;\n            align-content: center;\n        }\n\n        .ticket {\n            width: <?php echo $medidaTicket ?>px;\n            max-width: <?php echo $medidaTicket ?>px;\n        }\n\n        img {\n            max-width: inherit;\n            width: inherit;\n        }\n\n        * {\n            margin: 0;\n            padding: 0;\n        }\n\n        .ticket {\n            margin: 0;\n            padding: 0;\n        }\n\n        body {\n            text-align: center;\n        }\n    </style>\n</head>\n\n<body>\n    <div class=\"ticket centrado\">\n        <h1><?php echo $empresa[\"razon_social\"] ?></h1>\n        <h2>NIT: <?php echo $empresa[\"nit\"] ?></h2>\n        <h2>Teléfono: <?php echo $empresa[\"telefono\"] ?></h2>\n        <h2>Direccion: <?php echo $empresa[\"direccion\"] ?></h2>\n        <h2>Correo: </h2>\n        <h2>--------------------------------------------</h2>\n        <h1 align=\"center\">Ticket de venta #<?php echo $id ?></h1>\n        \n        <h2>Fecha: <?php echo $venta[\"fecha\"] ?></h2>\n        <h2>Cliente: <?php echo $cliente[\"nombre_completo\"] ?></h2>\n        <h2>telefono: <?php echo $cliente[\"telefono\"] ?></h2>\n        <h2>CC / NIT: <?php echo $cliente[\"numero_documento\"] ?></h2>\n        <h2>Dirección: <?php echo $cliente[\"direccion\"] ?></h2>\n        <h2>Vendedor: <?php echo $vendedor; ?></h2>\n        <h2>Caja N° 1</h2>\n        <br>\n\n        <table>\n            <thead>\n                <tr class=\"centrado\">\n                    <th class=\"cantidad\">CANT</th>\n                    <th class=\"producto\">PRODUCTO</th>\n                    <th class=\"precio\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;TOTAL</th>\n                </tr>\n            </thead>\n            <tbody>\n                <?php\n                $total = 0;\n                foreach ($productos as $producto) {\n                    $total += $producto[\"cantidad\"] * $producto[\"precio\"];\n                ?>\n                    <tr>\n                        <td class=\"cantidad\"><?php echo number_format($producto[\"cantidad\"], 2) ?></td>\n                        <td class=\"producto\"><?php echo $producto[\"descripcion\"] ?></td>\n                        <td class=\"precio\">$<?php echo number_format($producto[\"precio\"], 2) ?></td>\n                    </tr>\n                <?php } ?>\n            </tbody>\n</table>\n<table>\n            <tr>\n                <td class=\"producto\">\n                    <strong>SUBTOTAL</strong>\n\n                    <p></p>\n                    <strong>TOTAL A PAGAR</strong>\n                    <p></p>\n                    <strong>VALOR PAGADO</strong>\n                    <p></p>\n                    <strong>FORMA DE PAGO</strong>\n                    <p></p>\n                    <strong>CAMBIO</strong>\n                    \n                </td>\n                \n                <td class=\"precio\">\n\n                    $<?php echo number_format($venta[\"total\"] - $venta[\"iva\"], 2) ?>\n                    <p></p>\n                    $<?php echo number_format($venta[\"total\"], 2) ?>\n                    <p>$<?php echo $venta[\"dinero_entregado\"] ?></p>\n                    <p></p>\n                        <p><?php echo $venta[\"forma_pago\"] ?></p>\n                    <p></p>\n                    $<?php echo $venta[\"devuelta\"] ?>\n                    \n                </td>\n            </tr>\n        </table>\n        <br>\n        <p class=\"centrado\">¡GRACIAS POR SU COMPRA! </P>\n        <br>\n            <P>Elaborado por www.cloudecoway.com</p>\n            <P>Tel: 3137010627</p>\n\n    </div>\n</body>\n\n</html>','A'),(275,'/var/www/html/company/Ventaspos/mod/app_ventas/imprimirFactura.php','2022-05-31 22:37:00','rafael',195,5313,'<?php\n$medidaTicket = 280;\n\n\n$empresa = PCO_EjecutarSQL(\"\n            SELECT razon_social, nit, telefono, direccion\n            FROM app_empresa\n            WHERE id = 1\n        \")->fetch();\n\n$venta = PCO_EjecutarSQL(\"\n            SELECT date_format(fecha, \'%d-%m-%Y %H:%i:%s\') fecha, total, iva, forma_pago, devuelta, dinero_entregado, id_cliente\n            FROM app_ventas\n            WHERE id = \'$id\'\n        \")->fetch();\n\n$cliente = PCO_EjecutarSQL(\"\n            SELECT *\n            FROM app_clientes\n            WHERE id = \'\" . $venta[\"id_cliente\"] . \"\'\n        \")->fetch();\n\n$vendedor = PCO_EjecutarSQL(\"\n            SELECT nombre\n            FROM core_usuario\n            WHERE login = \'$PCOSESS_LoginUsuario\'\n        \")->fetchColumn();\n\n$productos = PCO_EjecutarSQL(\"\n            SELECT vd.cantidad, p.nombre as descripcion, vd.precio, date_format(fecha, \'%d-%m-%Y\') \n            FROM app_ventas_detalle vd, app_productos p\n            WHERE vd.id_producto = p.id AND vd.id_venta = \'$id\'\n        \")->fetchAll();\n?>\n<!DOCTYPE html>\n<html>\n\n<head>\n\n    <style>\n        * {\n            font-size: 15px;\n            font-family: \'DejaVu Sans\', serif;\n        }\n\n        h1 {\n            font-size: 18px;\n        }\n\n        \n\n        .ticket {\n            margin: 0.5px;\n        }\n\n        td,\n        th,\n        tr,\n        table {\n            border-top: 1px solid black;\n            border-collapse: collapse;\n            margin: 0 auto;\n            font-size: 15px;\n        }\n\n        td.precio {\n            text-align: right;\n            font-size: 11px;\n        }\n\n        td.cantidad {\n            font-size: 12px;\n        }\n\n        td.producto {\n            text-align: center;\n        }\n\n        th {\n            text-align: center;\n        }\n\n\n        .centrado {\n            text-align: center;\n            align-content: center;\n        }\n\n        .ticket {\n            width: <?php echo $medidaTicket ?>px;\n            max-width: <?php echo $medidaTicket ?>px;\n        }\n\n        img {\n            max-width: inherit;\n            width: inherit;\n        }\n\n        * {\n            margin: 0;\n            padding: 0;\n        }\n\n        .ticket {\n            margin: 0;\n            padding: 0;\n        }\n\n        body {\n            text-align: center;\n        }\n    </style>\n</head>\n\n<body>\n    <div class=\"ticket centrado\">\n        <h1><?php echo $empresa[\"razon_social\"] ?></h1>\n        <h2>NIT: <?php echo $empresa[\"nit\"] ?></h2>\n        <h2>Teléfono: <?php echo $empresa[\"telefono\"] ?></h2>\n        <h2>Direccion: <?php echo $empresa[\"direccion\"] ?></h2>\n        <h2>Correo: </h2>\n        <h2>--------------------------------------------</h2>\n        <h1 align=\"center\">Ticket de venta #<?php echo $id ?></h1>\n        \n        <h2>Fecha: <?php echo $venta[\"fecha\"] ?></h2>\n        <h2>Cliente: <?php echo $cliente[\"nombre_completo\"] ?></h2>\n        <h2>telefono: <?php echo $cliente[\"telefono\"] ?></h2>\n        <h2>CC / NIT: <?php echo $cliente[\"numero_documento\"] ?></h2>\n        <h2>Dirección: <?php echo $cliente[\"direccion\"] ?></h2>\n        <h2>Vendedor: <?php echo $vendedor; ?></h2>\n        <h2>Caja N° 1</h2>\n        <br>\n\n        <table>\n            <thead>\n                <tr class=\"centrado\">\n                    <th class=\"cantidad\">CANT</th>\n                    <th class=\"producto\">PRODUCTO</th>\n                    <th class=\"precio\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;TOTAL</th>\n                </tr>\n            </thead>\n            <tbody>\n                <?php\n                $total = 0;\n                foreach ($productos as $producto) {\n                    $total += $producto[\"cantidad\"] * $producto[\"precio\"];\n                ?>\n                    <tr>\n                        <td class=\"cantidad\"><?php echo number_format($producto[\"cantidad\"], 2) ?></td>\n                        <td class=\"producto\"><?php echo $producto[\"descripcion\"] ?></td>\n                        <td class=\"precio\">$<?php echo number_format($producto[\"precio\"], 2) ?></td>\n                    </tr>\n                <?php } ?>\n            </tbody>\n</table>\n<table>\n            <tr>\n                <td class=\"producto\">\n                    <strong>SUBTOTAL</strong>\n\n                    <p></p>\n                    <strong>TOTAL A PAGAR</strong>\n                    <p></p>\n                    <strong>VALOR PAGADO</strong>\n                    <p></p>\n                    <strong>FORMA DE PAGO</strong>\n                    <p></p>\n                    <strong>CAMBIO</strong>\n                    \n                </td>\n                \n                <td class=\"producto\">\n\n                    $<?php echo number_format($venta[\"total\"] - $venta[\"iva\"], 2) ?>\n                    <p></p>\n                    $<?php echo number_format($venta[\"total\"], 2) ?>\n                    <p>$<?php echo $venta[\"dinero_entregado\"] ?></p>\n                    <p></p>\n                        <p><?php echo $venta[\"forma_pago\"] ?></p>\n                    <p></p>\n                    $<?php echo $venta[\"devuelta\"] ?>\n                    \n                </td>\n            </tr>\n        </table>\n        <br>\n        <p class=\"centrado\">¡GRACIAS POR SU COMPRA! </P>\n        <br>\n            <P>Elaborado por www.cloudecoway.com</p>\n            <P>Tel: 3137010627</p>\n\n    </div>\n</body>\n\n</html>','A'),(276,'/var/www/html/company/Ventaspos/mod/app_ventas/imprimirFactura.php','2022-05-31 22:44:00','rafael',211,5802,'<?php\n$medidaTicket = 280;\n\n\n$empresa = PCO_EjecutarSQL(\"\n            SELECT razon_social, nit, telefono, direccion\n            FROM app_empresa\n            WHERE id = 1\n        \")->fetch();\n\n$venta = PCO_EjecutarSQL(\"\n            SELECT date_format(fecha, \'%d-%m-%Y %H:%i:%s\') fecha, total, iva, forma_pago, devuelta, dinero_entregado, id_cliente\n            FROM app_ventas\n            WHERE id = \'$id\'\n        \")->fetch();\n\n$cliente = PCO_EjecutarSQL(\"\n            SELECT *\n            FROM app_clientes\n            WHERE id = \'\" . $venta[\"id_cliente\"] . \"\'\n        \")->fetch();\n\n$vendedor = PCO_EjecutarSQL(\"\n            SELECT nombre\n            FROM core_usuario\n            WHERE login = \'$PCOSESS_LoginUsuario\'\n        \")->fetchColumn();\n\n$productos = PCO_EjecutarSQL(\"\n            SELECT vd.cantidad, p.nombre as descripcion, vd.precio, date_format(fecha, \'%d-%m-%Y\') \n            FROM app_ventas_detalle vd, app_productos p\n            WHERE vd.id_producto = p.id AND vd.id_venta = \'$id\'\n        \")->fetchAll();\n?>\n<!DOCTYPE html>\n<html>\n\n<head>\n\n    <style>\n        * {\n            font-size: 15px;\n            font-family: \'DejaVu Sans\', serif;\n        }\n\n        h1 {\n            font-size: 18px;\n        }\n\n        \n\n        .ticket {\n            margin: 0.5px;\n        }\n\n        td,\n        th,\n        tr,\n        table {\n            border-top: 1px solid black;\n            border-collapse: collapse;\n            margin: 0 auto;\n            font-size: 15px;\n        }\n\n        td.precio {\n            text-align: right;\n            font-size: 11px;\n        }\n\n        td.cantidad {\n            font-size: 12px;\n        }\n\n        td.producto {\n            text-align: center;\n        }\n\n        th {\n            text-align: center;\n        }\n\n\n        .centrado {\n            text-align: center;\n            align-content: center;\n        }\n\n        .ticket {\n            width: <?php echo $medidaTicket ?>px;\n            max-width: <?php echo $medidaTicket ?>px;\n        }\n\n        img {\n            max-width: inherit;\n            width: inherit;\n        }\n\n        * {\n            margin: 0;\n            padding: 0;\n        }\n\n        .ticket {\n            margin: 0;\n            padding: 0;\n        }\n\n        body {\n            text-align: center;\n        }\n    </style>\n</head>\n\n<body>\n    <div class=\"ticket centrado\">\n        <h1><?php echo $empresa[\"razon_social\"] ?></h1>\n        <h2>NIT: <?php echo $empresa[\"nit\"] ?></h2>\n        <h2>Teléfono: <?php echo $empresa[\"telefono\"] ?></h2>\n        <h2>Direccion: <?php echo $empresa[\"direccion\"] ?></h2>\n        <h2>Correo: </h2>\n        <h2>--------------------------------------------</h2>\n        <h1 align=\"center\">Ticket de venta #<?php echo $id ?></h1>\n        \n        <h2>Fecha: <?php echo $venta[\"fecha\"] ?></h2>\n        <h2>Cliente: <?php echo $cliente[\"nombre_completo\"] ?></h2>\n        <h2>telefono: <?php echo $cliente[\"telefono\"] ?></h2>\n        <h2>CC / NIT: <?php echo $cliente[\"numero_documento\"] ?></h2>\n        <h2>Dirección: <?php echo $cliente[\"direccion\"] ?></h2>\n        <h2>Vendedor: <?php echo $vendedor; ?></h2>\n        <h2>Caja N° 1</h2>\n        <br>\n\n        <table>\n            <thead>\n                <tr class=\"centrado\">\n                    <th class=\"cantidad\">CANT</th>\n                    <th class=\"producto\">PRODUCTO</th>\n                    <th class=\"precio\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;TOTAL</th>\n                </tr>\n            </thead>\n            <tbody>\n                <?php\n                $total = 0;\n                foreach ($productos as $producto) {\n                    $total += $producto[\"cantidad\"] * $producto[\"precio\"];\n                ?>\n                    <tr>\n                        <td class=\"cantidad\"><?php echo number_format($producto[\"cantidad\"], 2) ?></td>\n                        <td class=\"producto\"><?php echo $producto[\"descripcion\"] ?></td>\n                        <td class=\"precio\">$<?php echo number_format($producto[\"precio\"], 2) ?></td>\n                    </tr>\n                <?php } ?>\n            </tbody>\n</table>\n<table>\n  <tr>\n    <th></th>\n    <th></th>\n  </tr>\n            <tr>\n                <td class=\"producto\">\n                    <strong>SUBTOTAL</strong>\n                </td>\n                <td class=\"producto\">\n                    <strong>$<?php echo number_format($venta[\"total\"] - $venta[\"iva\"], 2) ?></strong>\n                </td>\n            </tr>\n            <tr>\n                <td class=\"producto\">\n                    <strong>TOTAL A PAGAR</strong>\n                </td>\n                <td class=\"producto\">\n                    <strong>$<?php echo number_format($venta[\"total\"] - $venta[\"iva\"], 2) ?></strong>\n                </td>\n            </tr>\n            <tr>\n                <td class=\"producto\">\n                    <strong>VALOR PAGADO</strong>\n                </td>\n                <td class=\"producto\">\n                    <strong>$<?php echo $venta[\"dinero_entregado\"] ?></strong>\n                </td>\n            </tr>\n            <tr>\n                <td class=\"producto\">\n                    <strong>FORMA DE PAGO</strong>\n                </td>\n                <td class=\"producto\">\n                    <strong><?php echo $venta[\"forma_pago\"] ?></strong>\n                </td>\n            </tr>\n            <tr>\n                <td class=\"producto\">\n                    <strong>CAMBIO</strong>\n                </td>\n                <td class=\"producto\">\n                    <strong>$<?php echo $venta[\"devuelta\"] ?></strong>\n                </td>\n            </tr>\n        </table>\n        <br>\n        <p class=\"centrado\">¡GRACIAS POR SU COMPRA! </P>\n        <br>\n            <P>Elaborado por www.cloudecoway.com</p>\n            <P>Tel: 3137010627</p>\n\n    </div>\n</body>\n\n</html>','A'),(277,'/var/www/html/company/Ventaspos/mod/app_ventas/imprimirFactura.php','2022-05-31 22:45:00','rafael',212,5807,'<?php\n$medidaTicket = 280;\n\n\n$empresa = PCO_EjecutarSQL(\"\n            SELECT razon_social, nit, telefono, direccion\n            FROM app_empresa\n            WHERE id = 1\n        \")->fetch();\n\n$venta = PCO_EjecutarSQL(\"\n            SELECT date_format(fecha, \'%d-%m-%Y %H:%i:%s\') fecha, total, iva, forma_pago, devuelta, dinero_entregado, id_cliente\n            FROM app_ventas\n            WHERE id = \'$id\'\n        \")->fetch();\n\n$cliente = PCO_EjecutarSQL(\"\n            SELECT *\n            FROM app_clientes\n            WHERE id = \'\" . $venta[\"id_cliente\"] . \"\'\n        \")->fetch();\n\n$vendedor = PCO_EjecutarSQL(\"\n            SELECT nombre\n            FROM core_usuario\n            WHERE login = \'$PCOSESS_LoginUsuario\'\n        \")->fetchColumn();\n\n$productos = PCO_EjecutarSQL(\"\n            SELECT vd.cantidad, p.nombre as descripcion, vd.precio, date_format(fecha, \'%d-%m-%Y\') \n            FROM app_ventas_detalle vd, app_productos p\n            WHERE vd.id_producto = p.id AND vd.id_venta = \'$id\'\n        \")->fetchAll();\n?>\n<!DOCTYPE html>\n<html>\n\n<head>\n\n    <style>\n        * {\n            font-size: 15px;\n            font-family: \'DejaVu Sans\', serif;\n        }\n\n        h1 {\n            font-size: 18px;\n        }\n\n        \n\n        .ticket {\n            margin: 0.5px;\n        }\n\n        td,\n        th,\n        tr,\n        table {\n            border-top: 1px solid black;\n            border-collapse: collapse;\n            margin: 0 auto;\n            font-size: 15px;\n        }\n\n        td.precio {\n            text-align: right;\n            font-size: 11px;\n        }\n\n        td.cantidad {\n            font-size: 12px;\n        }\n\n        td.producto {\n            text-align: center;\n        }\n\n        th {\n            text-align: center;\n        }\n\n\n        .centrado {\n            text-align: center;\n            align-content: center;\n        }\n\n        .ticket {\n            width: <?php echo $medidaTicket ?>px;\n            max-width: <?php echo $medidaTicket ?>px;\n        }\n\n        img {\n            max-width: inherit;\n            width: inherit;\n        }\n\n        * {\n            margin: 0;\n            padding: 0;\n        }\n\n        .ticket {\n            margin: 0;\n            padding: 0;\n        }\n\n        body {\n            text-align: center;\n        }\n    </style>\n</head>\n\n<body>\n    <div class=\"ticket centrado\">\n        <h1><?php echo $empresa[\"razon_social\"] ?></h1>\n        <h2>NIT: <?php echo $empresa[\"nit\"] ?></h2>\n        <h2>Teléfono: <?php echo $empresa[\"telefono\"] ?></h2>\n        <h2>Direccion: <?php echo $empresa[\"direccion\"] ?></h2>\n        <h2>Correo: </h2>\n        <h2>--------------------------------------------</h2>\n        <h1 align=\"center\">Ticket de venta #<?php echo $id ?></h1>\n        \n        <h2>Fecha: <?php echo $venta[\"fecha\"] ?></h2>\n        <h2>Cliente: <?php echo $cliente[\"nombre_completo\"] ?></h2>\n        <h2>telefono: <?php echo $cliente[\"telefono\"] ?></h2>\n        <h2>CC / NIT: <?php echo $cliente[\"numero_documento\"] ?></h2>\n        <h2>Dirección: <?php echo $cliente[\"direccion\"] ?></h2>\n        <h2>Vendedor: <?php echo $vendedor; ?></h2>\n        <h2>Caja N° 1</h2>\n        <br>\n\n        <table>\n            <thead>\n                <tr class=\"centrado\">\n                    <th class=\"cantidad\">CANT</th>\n                    <th class=\"producto\">PRODUCTO</th>\n                    <th class=\"precio\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;TOTAL</th>\n                </tr>\n            </thead>\n            <tbody>\n                <?php\n                $total = 0;\n                foreach ($productos as $producto) {\n                    $total += $producto[\"cantidad\"] * $producto[\"precio\"];\n                ?>\n                    <tr>\n                        <td class=\"cantidad\"><?php echo number_format($producto[\"cantidad\"], 2) ?></td>\n                        <td class=\"producto\"><?php echo $producto[\"descripcion\"] ?></td>\n                        <td class=\"precio\">$<?php echo number_format($producto[\"precio\"], 2) ?></td>\n                    </tr>\n                <?php } ?>\n            </tbody>\n</table>\n<BR>\n<table>\n  <tr>\n    <th></th>\n    <th></th>\n  </tr>\n            <tr>\n                <td class=\"producto\">\n                    <strong>SUBTOTAL</strong>\n                </td>\n                <td class=\"producto\">\n                    <strong>$<?php echo number_format($venta[\"total\"] - $venta[\"iva\"], 2) ?></strong>\n                </td>\n            </tr>\n            <tr>\n                <td class=\"producto\">\n                    <strong>TOTAL A PAGAR</strong>\n                </td>\n                <td class=\"producto\">\n                    <strong>$<?php echo number_format($venta[\"total\"] - $venta[\"iva\"], 2) ?></strong>\n                </td>\n            </tr>\n            <tr>\n                <td class=\"producto\">\n                    <strong>VALOR PAGADO</strong>\n                </td>\n                <td class=\"producto\">\n                    <strong>$<?php echo $venta[\"dinero_entregado\"] ?></strong>\n                </td>\n            </tr>\n            <tr>\n                <td class=\"producto\">\n                    <strong>FORMA DE PAGO</strong>\n                </td>\n                <td class=\"producto\">\n                    <strong><?php echo $venta[\"forma_pago\"] ?></strong>\n                </td>\n            </tr>\n            <tr>\n                <td class=\"producto\">\n                    <strong>CAMBIO</strong>\n                </td>\n                <td class=\"producto\">\n                    <strong>$<?php echo $venta[\"devuelta\"] ?></strong>\n                </td>\n            </tr>\n        </table>\n        <br>\n        <p class=\"centrado\">¡GRACIAS POR SU COMPRA! </P>\n        <br>\n            <P>Elaborado por www.cloudecoway.com</p>\n            <P>Tel: 3137010627</p>\n\n    </div>\n</body>\n\n</html>','A'),(278,'/var/www/html/company/Ventaspos/mod/app_ventas/imprimirFactura.php','2022-05-31 22:45:00','rafael',208,5419,'<?php\n$medidaTicket = 280;\n\n\n$empresa = PCO_EjecutarSQL(\"\n            SELECT razon_social, nit, telefono, direccion\n            FROM app_empresa\n            WHERE id = 1\n        \")->fetch();\n\n$venta = PCO_EjecutarSQL(\"\n            SELECT date_format(fecha, \'%d-%m-%Y %H:%i:%s\') fecha, total, iva, forma_pago, devuelta, dinero_entregado, id_cliente\n            FROM app_ventas\n            WHERE id = \'$id\'\n        \")->fetch();\n\n$cliente = PCO_EjecutarSQL(\"\n            SELECT *\n            FROM app_clientes\n            WHERE id = \'\" . $venta[\"id_cliente\"] . \"\'\n        \")->fetch();\n\n$vendedor = PCO_EjecutarSQL(\"\n            SELECT nombre\n            FROM core_usuario\n            WHERE login = \'$PCOSESS_LoginUsuario\'\n        \")->fetchColumn();\n\n$productos = PCO_EjecutarSQL(\"\n            SELECT vd.cantidad, p.nombre as descripcion, vd.precio, date_format(fecha, \'%d-%m-%Y\') \n            FROM app_ventas_detalle vd, app_productos p\n            WHERE vd.id_producto = p.id AND vd.id_venta = \'$id\'\n        \")->fetchAll();\n?>\n<!DOCTYPE html>\n<html>\n\n<head>\n\n    <style>\n        * {\n            font-size: 15px;\n            font-family: \'DejaVu Sans\', serif;\n        }\n\n        h1 {\n            font-size: 18px;\n        }\n\n        \n\n        .ticket {\n            margin: 0.5px;\n        }\n\n        td,\n        th,\n        tr,\n        table {\n            border-top: 1px solid black;\n            border-collapse: collapse;\n            margin: 0 auto;\n            font-size: 15px;\n        }\n\n        td.precio {\n            text-align: right;\n            font-size: 11px;\n        }\n\n        td.cantidad {\n            font-size: 12px;\n        }\n\n        td.producto {\n            text-align: center;\n        }\n\n        th {\n            text-align: center;\n        }\n\n\n        .centrado {\n            text-align: center;\n            align-content: center;\n        }\n\n        .ticket {\n            width: <?php echo $medidaTicket ?>px;\n            max-width: <?php echo $medidaTicket ?>px;\n        }\n\n        img {\n            max-width: inherit;\n            width: inherit;\n        }\n\n        * {\n            margin: 0;\n            padding: 0;\n        }\n\n        .ticket {\n            margin: 0;\n            padding: 0;\n        }\n\n        body {\n            text-align: center;\n        }\n    </style>\n</head>\n\n<body>\n    <div class=\"ticket centrado\">\n        <h1><?php echo $empresa[\"razon_social\"] ?></h1>\n        <h2>NIT: <?php echo $empresa[\"nit\"] ?></h2>\n        <h2>Teléfono: <?php echo $empresa[\"telefono\"] ?></h2>\n        <h2>Direccion: <?php echo $empresa[\"direccion\"] ?></h2>\n        <h2>Correo: </h2>\n        <h2>--------------------------------------------</h2>\n        <h1 align=\"center\">Ticket de venta #<?php echo $id ?></h1>\n        \n        <h2>Fecha: <?php echo $venta[\"fecha\"] ?></h2>\n        <h2>Cliente: <?php echo $cliente[\"nombre_completo\"] ?></h2>\n        <h2>telefono: <?php echo $cliente[\"telefono\"] ?></h2>\n        <h2>CC / NIT: <?php echo $cliente[\"numero_documento\"] ?></h2>\n        <h2>Dirección: <?php echo $cliente[\"direccion\"] ?></h2>\n        <h2>Vendedor: <?php echo $vendedor; ?></h2>\n        <h2>Caja N° 1</h2>\n        <br>\n\n        <table>\n            <thead>\n                <tr class=\"centrado\">\n                    <th class=\"cantidad\">CANT</th>\n                    <th class=\"producto\">PRODUCTO</th>\n                    <th class=\"precio\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;TOTAL</th>\n                </tr>\n            </thead>\n            <tbody>\n                <?php\n                $total = 0;\n                foreach ($productos as $producto) {\n                    $total += $producto[\"cantidad\"] * $producto[\"precio\"];\n                ?>\n                    <tr>\n                        <td class=\"cantidad\"><?php echo number_format($producto[\"cantidad\"], 2) ?></td>\n                        <td class=\"producto\"><?php echo $producto[\"descripcion\"] ?></td>\n                        <td class=\"precio\">$<?php echo number_format($producto[\"precio\"], 2) ?></td>\n                    </tr>\n                <?php } ?>\n            </tbody>\n</table>\n<BR>\n<table>\n    <tr>\n        <td class=\"producto\">\n            <strong>SUBTOTAL</strong>\n        </td>\n        <td class=\"producto\">\n            <strong>$<?php echo number_format($venta[\"total\"] - $venta[\"iva\"], 2) ?></strong>\n        </td>\n    </tr>\n    <tr>\n        <td class=\"producto\">\n            <strong>TOTAL A PAGAR</strong>\n        </td>\n        <td class=\"producto\">\n            <strong>$<?php echo number_format($venta[\"total\"] - $venta[\"iva\"], 2) ?></strong>\n        </td>\n    </tr>\n    <tr>\n        <td class=\"producto\">\n            <strong>VALOR PAGADO</strong>\n        </td>\n        <td class=\"producto\">\n            <strong>$<?php echo $venta[\"dinero_entregado\"] ?></strong>\n        </td>\n    </tr>\n    <tr>\n        <td class=\"producto\">\n            <strong>FORMA DE PAGO</strong>\n        </td>\n        <td class=\"producto\">\n            <strong><?php echo $venta[\"forma_pago\"] ?></strong>\n        </td>\n    </tr>\n    <tr>\n        <td class=\"producto\">\n            <strong>CAMBIO</strong>\n        </td>\n        <td>\n            <strong>$<?php echo $venta[\"devuelta\"] ?></strong>\n        </td>\n    </tr>\n</table>\n        <br>\n        <p class=\"centrado\">¡GRACIAS POR SU COMPRA! </P>\n        <br>\n            <P>Elaborado por www.cloudecoway.com</p>\n            <P>Tel: 3137010627</p>\n\n    </div>\n</body>\n\n</html>','A'),(279,'/var/www/html/company/Ventaspos/mod/app_ventas/imprimirFactura.php','2022-05-31 22:46:00','rafael',208,5401,'<?php\n$medidaTicket = 280;\n\n\n$empresa = PCO_EjecutarSQL(\"\n            SELECT razon_social, nit, telefono, direccion\n            FROM app_empresa\n            WHERE id = 1\n        \")->fetch();\n\n$venta = PCO_EjecutarSQL(\"\n            SELECT date_format(fecha, \'%d-%m-%Y %H:%i:%s\') fecha, total, iva, forma_pago, devuelta, dinero_entregado, id_cliente\n            FROM app_ventas\n            WHERE id = \'$id\'\n        \")->fetch();\n\n$cliente = PCO_EjecutarSQL(\"\n            SELECT *\n            FROM app_clientes\n            WHERE id = \'\" . $venta[\"id_cliente\"] . \"\'\n        \")->fetch();\n\n$vendedor = PCO_EjecutarSQL(\"\n            SELECT nombre\n            FROM core_usuario\n            WHERE login = \'$PCOSESS_LoginUsuario\'\n        \")->fetchColumn();\n\n$productos = PCO_EjecutarSQL(\"\n            SELECT vd.cantidad, p.nombre as descripcion, vd.precio, date_format(fecha, \'%d-%m-%Y\') \n            FROM app_ventas_detalle vd, app_productos p\n            WHERE vd.id_producto = p.id AND vd.id_venta = \'$id\'\n        \")->fetchAll();\n?>\n<!DOCTYPE html>\n<html>\n\n<head>\n\n    <style>\n        * {\n            font-size: 15px;\n            font-family: \'DejaVu Sans\', serif;\n        }\n\n        h1 {\n            font-size: 18px;\n        }\n\n        \n\n        .ticket {\n            margin: 0.5px;\n        }\n\n        td,\n        th,\n        tr,\n        table {\n            border-top: 1px solid black;\n            border-collapse: collapse;\n            margin: 0 auto;\n            font-size: 15px;\n        }\n\n        td.precio {\n            text-align: right;\n            font-size: 11px;\n        }\n\n        td.cantidad {\n            font-size: 12px;\n        }\n\n        td.producto {\n            text-align: center;\n        }\n\n        th {\n            text-align: center;\n        }\n\n\n        .centrado {\n            text-align: center;\n            align-content: center;\n        }\n\n        .ticket {\n            width: <?php echo $medidaTicket ?>px;\n            max-width: <?php echo $medidaTicket ?>px;\n        }\n\n        img {\n            max-width: inherit;\n            width: inherit;\n        }\n\n        * {\n            margin: 0;\n            padding: 0;\n        }\n\n        .ticket {\n            margin: 0;\n            padding: 0;\n        }\n\n        body {\n            text-align: center;\n        }\n    </style>\n</head>\n\n<body>\n    <div class=\"ticket centrado\">\n        <h1><?php echo $empresa[\"razon_social\"] ?></h1>\n        <h2>NIT: <?php echo $empresa[\"nit\"] ?></h2>\n        <h2>Teléfono: <?php echo $empresa[\"telefono\"] ?></h2>\n        <h2>Direccion: <?php echo $empresa[\"direccion\"] ?></h2>\n        <h2>Correo: </h2>\n        <h2>--------------------------------------------</h2>\n        <h1 align=\"center\">Ticket de venta #<?php echo $id ?></h1>\n        \n        <h2>Fecha: <?php echo $venta[\"fecha\"] ?></h2>\n        <h2>Cliente: <?php echo $cliente[\"nombre_completo\"] ?></h2>\n        <h2>telefono: <?php echo $cliente[\"telefono\"] ?></h2>\n        <h2>CC / NIT: <?php echo $cliente[\"numero_documento\"] ?></h2>\n        <h2>Dirección: <?php echo $cliente[\"direccion\"] ?></h2>\n        <h2>Vendedor: <?php echo $vendedor; ?></h2>\n        <h2>Caja N° 1</h2>\n        <br>\n\n        <table>\n            <thead>\n                <tr class=\"centrado\">\n                    <th class=\"cantidad\">CANT</th>\n                    <th class=\"producto\">PRODUCTO</th>\n                    <th class=\"precio\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;TOTAL</th>\n                </tr>\n            </thead>\n            <tbody>\n                <?php\n                $total = 0;\n                foreach ($productos as $producto) {\n                    $total += $producto[\"cantidad\"] * $producto[\"precio\"];\n                ?>\n                    <tr>\n                        <td class=\"cantidad\"><?php echo number_format($producto[\"cantidad\"], 2) ?></td>\n                        <td class=\"producto\"><?php echo $producto[\"descripcion\"] ?></td>\n                        <td class=\"precio\">$<?php echo number_format($producto[\"precio\"], 2) ?></td>\n                    </tr>\n                <?php } ?>\n            </tbody>\n</table>\n<BR>\n<table>\n    <tr>\n        <td class=\"precio\">\n            <strong>SUBTOTAL</strong>\n        </td>\n        <td class=\"precio\">\n            <strong>$<?php echo number_format($venta[\"total\"] - $venta[\"iva\"], 2) ?></strong>\n        </td>\n    </tr>\n    <tr>\n        <td class=\"precio\">\n            <strong>TOTAL A PAGAR</strong>\n        </td>\n        <td class=\"precio\">\n            <strong>$<?php echo number_format($venta[\"total\"] - $venta[\"iva\"], 2) ?></strong>\n        </td>\n    </tr>\n    <tr>\n        <td class=\"precio\">\n            <strong>VALOR PAGADO</strong>\n        </td>\n        <td class=\"precio\">\n            <strong>$<?php echo $venta[\"dinero_entregado\"] ?></strong>\n        </td>\n    </tr>\n    <tr>\n        <td class=\"precio\">\n            <strong>FORMA DE PAGO</strong>\n        </td>\n        <td class=\"precio\">\n            <strong><?php echo $venta[\"forma_pago\"] ?></strong>\n        </td>\n    </tr>\n    <tr>\n        <td class=\"precio\">\n            <strong>CAMBIO</strong>\n        </td>\n        <td>\n            <strong>$<?php echo $venta[\"devuelta\"] ?></strong>\n        </td>\n    </tr>\n</table>\n        <br>\n        <p class=\"centrado\">¡GRACIAS POR SU COMPRA! </P>\n        <br>\n            <P>Elaborado por www.cloudecoway.com</p>\n            <P>Tel: 3137010627</p>\n\n    </div>\n</body>\n\n</html>','A'),(280,'/var/www/html/company/Ventaspos/mod/app_ventas/imprimirFactura.php','2022-05-31 22:47:00','rafael',208,5401,'<?php\n$medidaTicket = 280;\n\n\n$empresa = PCO_EjecutarSQL(\"\n            SELECT razon_social, nit, telefono, direccion\n            FROM app_empresa\n            WHERE id = 1\n        \")->fetch();\n\n$venta = PCO_EjecutarSQL(\"\n            SELECT date_format(fecha, \'%d-%m-%Y %H:%i:%s\') fecha, total, iva, forma_pago, devuelta, dinero_entregado, id_cliente\n            FROM app_ventas\n            WHERE id = \'$id\'\n        \")->fetch();\n\n$cliente = PCO_EjecutarSQL(\"\n            SELECT *\n            FROM app_clientes\n            WHERE id = \'\" . $venta[\"id_cliente\"] . \"\'\n        \")->fetch();\n\n$vendedor = PCO_EjecutarSQL(\"\n            SELECT nombre\n            FROM core_usuario\n            WHERE login = \'$PCOSESS_LoginUsuario\'\n        \")->fetchColumn();\n\n$productos = PCO_EjecutarSQL(\"\n            SELECT vd.cantidad, p.nombre as descripcion, vd.precio, date_format(fecha, \'%d-%m-%Y\') \n            FROM app_ventas_detalle vd, app_productos p\n            WHERE vd.id_producto = p.id AND vd.id_venta = \'$id\'\n        \")->fetchAll();\n?>\n<!DOCTYPE html>\n<html>\n\n<head>\n\n    <style>\n        * {\n            font-size: 15px;\n            font-family: \'DejaVu Sans\', serif;\n        }\n\n        h1 {\n            font-size: 18px;\n        }\n\n        \n\n        .ticket {\n            margin: 0.5px;\n        }\n\n        td,\n        th,\n        tr,\n        table {\n            border-top: 1px solid black;\n            border-collapse: collapse;\n            margin: 0 auto;\n            font-size: 15px;\n        }\n\n        td.precio {\n            text-align: right;\n            font-size: 11px;\n        }\n\n        td.cantidad {\n            font-size: 12px;\n        }\n\n        td.producto {\n            text-align: center;\n        }\n\n        th {\n            text-align: center;\n        }\n\n\n        .centrado {\n            text-align: center;\n            align-content: center;\n        }\n\n        .ticket {\n            width: <?php echo $medidaTicket ?>px;\n            max-width: <?php echo $medidaTicket ?>px;\n        }\n\n        img {\n            max-width: inherit;\n            width: inherit;\n        }\n\n        * {\n            margin: 0;\n            padding: 0;\n        }\n\n        .ticket {\n            margin: 0;\n            padding: 0;\n        }\n\n        body {\n            text-align: center;\n        }\n    </style>\n</head>\n\n<body>\n    <div class=\"ticket centrado\">\n        <h1><?php echo $empresa[\"razon_social\"] ?></h1>\n        <h2>NIT: <?php echo $empresa[\"nit\"] ?></h2>\n        <h2>Teléfono: <?php echo $empresa[\"telefono\"] ?></h2>\n        <h2>Direccion: <?php echo $empresa[\"direccion\"] ?></h2>\n        <h2>Correo: </h2>\n        <h2>--------------------------------------------</h2>\n        <h1 align=\"center\">Ticket de venta #<?php echo $id ?></h1>\n        \n        <h2>Fecha: <?php echo $venta[\"fecha\"] ?></h2>\n        <h2>Cliente: <?php echo $cliente[\"nombre_completo\"] ?></h2>\n        <h2>telefono: <?php echo $cliente[\"telefono\"] ?></h2>\n        <h2>CC / NIT: <?php echo $cliente[\"numero_documento\"] ?></h2>\n        <h2>Dirección: <?php echo $cliente[\"direccion\"] ?></h2>\n        <h2>Vendedor: <?php echo $vendedor; ?></h2>\n        <h2>Caja N° 1</h2>\n        <br>\n\n        <table>\n            <thead>\n                <tr class=\"centrado\">\n                    <th class=\"cantidad\">CANT</th>\n                    <th class=\"producto\">PRODUCTO</th>\n                    <th class=\"precio\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;TOTAL</th>\n                </tr>\n            </thead>\n            <tbody>\n                <?php\n                $total = 0;\n                foreach ($productos as $producto) {\n                    $total += $producto[\"cantidad\"] * $producto[\"precio\"];\n                ?>\n                    <tr>\n                        <td class=\"cantidad\"><?php echo number_format($producto[\"cantidad\"], 2) ?></td>\n                        <td class=\"producto\"><?php echo $producto[\"descripcion\"] ?></td>\n                        <td class=\"precio\">$<?php echo number_format($producto[\"precio\"], 2) ?></td>\n                    </tr>\n                <?php } ?>\n            </tbody>\n</table>\n<BR>\n<table>\n    <tr>\n        <td class=\"precio\">\n            <strong>SUBTOTAL</strong>\n        </td>\n        <td class=\"precio\">\n            <strong>$<?php echo number_format($venta[\"total\"] - $venta[\"iva\"], 2) ?></strong>\n        </td>\n    </tr>\n    <tr>\n        <td class=\"precio\">\n            <strong>TOTAL A PAGAR</strong>\n        </td>\n        <td class=\"precio\">\n            <strong>$<?php echo number_format($venta[\"total\"] - $venta[\"iva\"], 2) ?></strong>\n        </td>\n    </tr>\n    <tr>\n        <td class=\"precio\">\n            <strong>VALOR PAGADO</strong>\n        </td>\n        <td class=\"precio\">\n            <strong>$<?php echo $venta[\"dinero_entregado\"] ?></strong>\n        </td>\n    </tr>\n    <tr>\n        <td class=\"precio\">\n            <strong>FORMA DE PAGO</strong>\n        </td>\n        <td class=\"precio\">\n            <strong><?php echo $venta[\"forma_pago\"] ?></strong>\n        </td>\n    </tr>\n    <tr>\n        <td>\n            <strong>CAMBIO</strong>\n        </td>\n        <td>\n            <strong>$<?php echo $venta[\"devuelta\"] ?></strong>\n        </td>\n    </tr>\n</table>\n        <br>\n        <p class=\"centrado\">¡GRACIAS POR SU COMPRA! </P>\n        <br>\n            <P>Elaborado por www.cloudecoway.com</p>\n            <P>Tel: 3137010627</p>\n\n    </div>\n</body>\n\n</html>','A'),(281,'/var/www/html/company/Ventaspos/mod/app_ventas/imprimirFactura.php','2022-05-31 22:47:00','rafael',208,5326,'<?php\n$medidaTicket = 280;\n\n\n$empresa = PCO_EjecutarSQL(\"\n            SELECT razon_social, nit, telefono, direccion\n            FROM app_empresa\n            WHERE id = 1\n        \")->fetch();\n\n$venta = PCO_EjecutarSQL(\"\n            SELECT date_format(fecha, \'%d-%m-%Y %H:%i:%s\') fecha, total, iva, forma_pago, devuelta, dinero_entregado, id_cliente\n            FROM app_ventas\n            WHERE id = \'$id\'\n        \")->fetch();\n\n$cliente = PCO_EjecutarSQL(\"\n            SELECT *\n            FROM app_clientes\n            WHERE id = \'\" . $venta[\"id_cliente\"] . \"\'\n        \")->fetch();\n\n$vendedor = PCO_EjecutarSQL(\"\n            SELECT nombre\n            FROM core_usuario\n            WHERE login = \'$PCOSESS_LoginUsuario\'\n        \")->fetchColumn();\n\n$productos = PCO_EjecutarSQL(\"\n            SELECT vd.cantidad, p.nombre as descripcion, vd.precio, date_format(fecha, \'%d-%m-%Y\') \n            FROM app_ventas_detalle vd, app_productos p\n            WHERE vd.id_producto = p.id AND vd.id_venta = \'$id\'\n        \")->fetchAll();\n?>\n<!DOCTYPE html>\n<html>\n\n<head>\n\n    <style>\n        * {\n            font-size: 15px;\n            font-family: \'DejaVu Sans\', serif;\n        }\n\n        h1 {\n            font-size: 18px;\n        }\n\n        \n\n        .ticket {\n            margin: 0.5px;\n        }\n\n        td,\n        th,\n        tr,\n        table {\n            border-top: 1px solid black;\n            border-collapse: collapse;\n            margin: 0 auto;\n            font-size: 15px;\n        }\n\n        td.precio {\n            text-align: right;\n            font-size: 11px;\n        }\n\n        td.cantidad {\n            font-size: 12px;\n        }\n\n        td.producto {\n            text-align: center;\n        }\n\n        th {\n            text-align: center;\n        }\n\n\n        .centrado {\n            text-align: center;\n            align-content: center;\n        }\n\n        .ticket {\n            width: <?php echo $medidaTicket ?>px;\n            max-width: <?php echo $medidaTicket ?>px;\n        }\n\n        img {\n            max-width: inherit;\n            width: inherit;\n        }\n\n        * {\n            margin: 0;\n            padding: 0;\n        }\n\n        .ticket {\n            margin: 0;\n            padding: 0;\n        }\n\n        body {\n            text-align: center;\n        }\n    </style>\n</head>\n\n<body>\n    <div class=\"ticket centrado\">\n        <h1><?php echo $empresa[\"razon_social\"] ?></h1>\n        <h2>NIT: <?php echo $empresa[\"nit\"] ?></h2>\n        <h2>Teléfono: <?php echo $empresa[\"telefono\"] ?></h2>\n        <h2>Direccion: <?php echo $empresa[\"direccion\"] ?></h2>\n        <h2>Correo: </h2>\n        <h2>--------------------------------------------</h2>\n        <h1 align=\"center\">Ticket de venta #<?php echo $id ?></h1>\n        \n        <h2>Fecha: <?php echo $venta[\"fecha\"] ?></h2>\n        <h2>Cliente: <?php echo $cliente[\"nombre_completo\"] ?></h2>\n        <h2>telefono: <?php echo $cliente[\"telefono\"] ?></h2>\n        <h2>CC / NIT: <?php echo $cliente[\"numero_documento\"] ?></h2>\n        <h2>Dirección: <?php echo $cliente[\"direccion\"] ?></h2>\n        <h2>Vendedor: <?php echo $vendedor; ?></h2>\n        <h2>Caja N° 1</h2>\n        <br>\n\n        <table>\n            <thead>\n                <tr class=\"centrado\">\n                    <th class=\"cantidad\">CANT</th>\n                    <th class=\"producto\">PRODUCTO</th>\n                    <th class=\"precio\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;TOTAL</th>\n                </tr>\n            </thead>\n            <tbody>\n                <?php\n                $total = 0;\n                foreach ($productos as $producto) {\n                    $total += $producto[\"cantidad\"] * $producto[\"precio\"];\n                ?>\n                    <tr>\n                        <td class=\"cantidad\"><?php echo number_format($producto[\"cantidad\"], 2) ?></td>\n                        <td class=\"producto\"><?php echo $producto[\"descripcion\"] ?></td>\n                        <td class=\"precio\">$<?php echo number_format($producto[\"precio\"], 2) ?></td>\n                    </tr>\n                <?php } ?>\n            </tbody>\n</table>\n<BR>\n<table>\n    <tr>\n        <td class=\"precio\">\n            <strong>SUBTOTAL</strong>\n        </td>\n        <td class=\"precio\">\n            <strong>$<?php echo number_format($venta[\"total\"] - $venta[\"iva\"], 2) ?></strong>\n        </td>\n    </tr>\n    <tr>\n        <td class=\"precio\">\n            <strong>TOTAL A PAGAR</strong>\n        </td>\n        <td class=\"precio\">\n            <strong>$<?php echo number_format($venta[\"total\"] - $venta[\"iva\"], 2) ?></strong>\n        </td>\n    </tr>\n    <tr>\n        <td>\n            <strong>VALOR PAGADO</strong>\n        </td>\n        <td>\n            <strong>$<?php echo $venta[\"dinero_entregado\"] ?></strong>\n        </td>\n    </tr>\n    <tr>\n        <td>\n            <strong>FORMA DE PAGO</strong>\n        </td>\n        <td>\n            <strong><?php echo $venta[\"forma_pago\"] ?></strong>\n        </td>\n    </tr>\n    <tr>\n        <td>\n            <strong>CAMBIO</strong>\n        </td>\n        <td>\n            <strong>$<?php echo $venta[\"devuelta\"] ?></strong>\n        </td>\n    </tr>\n</table>\n        <br>\n        <p class=\"centrado\">¡GRACIAS POR SU COMPRA! </P>\n        <br>\n            <P>Elaborado por www.cloudecoway.com</p>\n            <P>Tel: 3137010627</p>\n\n    </div>\n</body>\n\n</html>','A'),(282,'/var/www/html/company/Ventaspos/mod/app_ventas/imprimirFactura.php','2022-05-31 22:47:00','rafael',208,5281,'<?php\n$medidaTicket = 280;\n\n\n$empresa = PCO_EjecutarSQL(\"\n            SELECT razon_social, nit, telefono, direccion\n            FROM app_empresa\n            WHERE id = 1\n        \")->fetch();\n\n$venta = PCO_EjecutarSQL(\"\n            SELECT date_format(fecha, \'%d-%m-%Y %H:%i:%s\') fecha, total, iva, forma_pago, devuelta, dinero_entregado, id_cliente\n            FROM app_ventas\n            WHERE id = \'$id\'\n        \")->fetch();\n\n$cliente = PCO_EjecutarSQL(\"\n            SELECT *\n            FROM app_clientes\n            WHERE id = \'\" . $venta[\"id_cliente\"] . \"\'\n        \")->fetch();\n\n$vendedor = PCO_EjecutarSQL(\"\n            SELECT nombre\n            FROM core_usuario\n            WHERE login = \'$PCOSESS_LoginUsuario\'\n        \")->fetchColumn();\n\n$productos = PCO_EjecutarSQL(\"\n            SELECT vd.cantidad, p.nombre as descripcion, vd.precio, date_format(fecha, \'%d-%m-%Y\') \n            FROM app_ventas_detalle vd, app_productos p\n            WHERE vd.id_producto = p.id AND vd.id_venta = \'$id\'\n        \")->fetchAll();\n?>\n<!DOCTYPE html>\n<html>\n\n<head>\n\n    <style>\n        * {\n            font-size: 15px;\n            font-family: \'DejaVu Sans\', serif;\n        }\n\n        h1 {\n            font-size: 18px;\n        }\n\n        \n\n        .ticket {\n            margin: 0.5px;\n        }\n\n        td,\n        th,\n        tr,\n        table {\n            border-top: 1px solid black;\n            border-collapse: collapse;\n            margin: 0 auto;\n            font-size: 15px;\n        }\n\n        td.precio {\n            text-align: right;\n            font-size: 11px;\n        }\n\n        td.cantidad {\n            font-size: 12px;\n        }\n\n        td.producto {\n            text-align: center;\n        }\n\n        th {\n            text-align: center;\n        }\n\n\n        .centrado {\n            text-align: center;\n            align-content: center;\n        }\n\n        .ticket {\n            width: <?php echo $medidaTicket ?>px;\n            max-width: <?php echo $medidaTicket ?>px;\n        }\n\n        img {\n            max-width: inherit;\n            width: inherit;\n        }\n\n        * {\n            margin: 0;\n            padding: 0;\n        }\n\n        .ticket {\n            margin: 0;\n            padding: 0;\n        }\n\n        body {\n            text-align: center;\n        }\n    </style>\n</head>\n\n<body>\n    <div class=\"ticket centrado\">\n        <h1><?php echo $empresa[\"razon_social\"] ?></h1>\n        <h2>NIT: <?php echo $empresa[\"nit\"] ?></h2>\n        <h2>Teléfono: <?php echo $empresa[\"telefono\"] ?></h2>\n        <h2>Direccion: <?php echo $empresa[\"direccion\"] ?></h2>\n        <h2>Correo: </h2>\n        <h2>--------------------------------------------</h2>\n        <h1 align=\"center\">Ticket de venta #<?php echo $id ?></h1>\n        \n        <h2>Fecha: <?php echo $venta[\"fecha\"] ?></h2>\n        <h2>Cliente: <?php echo $cliente[\"nombre_completo\"] ?></h2>\n        <h2>telefono: <?php echo $cliente[\"telefono\"] ?></h2>\n        <h2>CC / NIT: <?php echo $cliente[\"numero_documento\"] ?></h2>\n        <h2>Dirección: <?php echo $cliente[\"direccion\"] ?></h2>\n        <h2>Vendedor: <?php echo $vendedor; ?></h2>\n        <h2>Caja N° 1</h2>\n        <br>\n\n        <table>\n            <thead>\n                <tr class=\"centrado\">\n                    <th class=\"cantidad\">CANT</th>\n                    <th class=\"producto\">PRODUCTO</th>\n                    <th class=\"precio\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;TOTAL</th>\n                </tr>\n            </thead>\n            <tbody>\n                <?php\n                $total = 0;\n                foreach ($productos as $producto) {\n                    $total += $producto[\"cantidad\"] * $producto[\"precio\"];\n                ?>\n                    <tr>\n                        <td class=\"cantidad\"><?php echo number_format($producto[\"cantidad\"], 2) ?></td>\n                        <td class=\"producto\"><?php echo $producto[\"descripcion\"] ?></td>\n                        <td class=\"precio\">$<?php echo number_format($producto[\"precio\"], 2) ?></td>\n                    </tr>\n                <?php } ?>\n            </tbody>\n</table>\n<BR>\n<table>\n    <tr>\n        <td>\n            <strong>SUBTOTAL</strong>\n        </td>\n        <td>\n            <strong>$<?php echo number_format($venta[\"total\"] - $venta[\"iva\"], 2) ?></strong>\n        </td>\n    </tr>\n    <tr>\n        <td>\n            <strong>TOTAL A PAGAR</strong>\n        </td>\n        <td>\n            <strong>$<?php echo number_format($venta[\"total\"] - $venta[\"iva\"], 2) ?></strong>\n        </td>\n    </tr>\n    <tr>\n        <td>\n            <strong>VALOR PAGADO</strong>\n        </td>\n        <td>\n            <strong>$<?php echo $venta[\"dinero_entregado\"] ?></strong>\n        </td>\n    </tr>\n    <tr>\n        <td>\n            <strong>FORMA DE PAGO</strong>\n        </td>\n        <td>\n            <strong><?php echo $venta[\"forma_pago\"] ?></strong>\n        </td>\n    </tr>\n    <tr>\n        <td>\n            <strong>CAMBIO</strong>\n        </td>\n        <td>\n            <strong>$<?php echo $venta[\"devuelta\"] ?></strong>\n        </td>\n    </tr>\n</table>\n        <br>\n        <p class=\"centrado\">¡GRACIAS POR SU COMPRA! </P>\n        <br>\n            <P>Elaborado por www.cloudecoway.com</p>\n            <P>Tel: 3137010627</p>\n\n    </div>\n</body>\n\n</html>','A'),(283,'/var/www/html/company/Ventaspos/mod/app_ventas/imprimirFactura.php','2022-05-31 22:49:00','rafael',208,5302,'<?php\n$medidaTicket = 280;\n\n\n$empresa = PCO_EjecutarSQL(\"\n            SELECT razon_social, nit, telefono, direccion\n            FROM app_empresa\n            WHERE id = 1\n        \")->fetch();\n\n$venta = PCO_EjecutarSQL(\"\n            SELECT date_format(fecha, \'%d-%m-%Y %H:%i:%s\') fecha, total, iva, forma_pago, devuelta, dinero_entregado, id_cliente\n            FROM app_ventas\n            WHERE id = \'$id\'\n        \")->fetch();\n\n$cliente = PCO_EjecutarSQL(\"\n            SELECT *\n            FROM app_clientes\n            WHERE id = \'\" . $venta[\"id_cliente\"] . \"\'\n        \")->fetch();\n\n$vendedor = PCO_EjecutarSQL(\"\n            SELECT nombre\n            FROM core_usuario\n            WHERE login = \'$PCOSESS_LoginUsuario\'\n        \")->fetchColumn();\n\n$productos = PCO_EjecutarSQL(\"\n            SELECT vd.cantidad, p.nombre as descripcion, vd.precio, date_format(fecha, \'%d-%m-%Y\') \n            FROM app_ventas_detalle vd, app_productos p\n            WHERE vd.id_producto = p.id AND vd.id_venta = \'$id\'\n        \")->fetchAll();\n?>\n<!DOCTYPE html>\n<html>\n\n<head>\n\n    <style>\n        * {\n            font-size: 15px;\n            font-family: \'DejaVu Sans\', serif;\n        }\n\n        h1 {\n            font-size: 18px;\n        }\n\n        \n\n        .ticket {\n            margin: 0.5px;\n        }\n\n        td,\n        th,\n        tr,\n        table {\n            border-top: 1px solid black;\n            border-collapse: collapse;\n            margin: 0 auto;\n            font-size: 15px;\n        }\n\n        td.precio {\n            text-align: right;\n            font-size: 11px;\n        }\n\n        td.cantidad {\n            font-size: 12px;\n        }\n\n        td.producto {\n            text-align: center;\n        }\n\n        th {\n            text-align: center;\n        }\n\n\n        .centrado {\n            text-align: center;\n            align-content: center;\n        }\n\n        .ticket {\n            width: <?php echo $medidaTicket ?>px;\n            max-width: <?php echo $medidaTicket ?>px;\n        }\n\n        img {\n            max-width: inherit;\n            width: inherit;\n        }\n\n        * {\n            margin: 0;\n            padding: 0;\n        }\n\n        .ticket {\n            margin: 0;\n            padding: 0;\n        }\n\n        body {\n            text-align: center;\n        }\n    </style>\n</head>\n\n<body>\n    <div class=\"ticket centrado\">\n        <h1><?php echo $empresa[\"razon_social\"] ?></h1>\n        <h2>NIT: <?php echo $empresa[\"nit\"] ?></h2>\n        <h2>Teléfono: <?php echo $empresa[\"telefono\"] ?></h2>\n        <h2>Direccion: <?php echo $empresa[\"direccion\"] ?></h2>\n        <h2>Correo: </h2>\n        <h2>--------------------------------------------</h2>\n        <h1 align=\"center\">Ticket de venta #<?php echo $id ?></h1>\n        \n        <h2>Fecha: <?php echo $venta[\"fecha\"] ?></h2>\n        <h2>Cliente: <?php echo $cliente[\"nombre_completo\"] ?></h2>\n        <h2>telefono: <?php echo $cliente[\"telefono\"] ?></h2>\n        <h2>CC / NIT: <?php echo $cliente[\"numero_documento\"] ?></h2>\n        <h2>Dirección: <?php echo $cliente[\"direccion\"] ?></h2>\n        <h2>Vendedor: <?php echo $vendedor; ?></h2>\n        <h2>Caja N° 1</h2>\n        <br>\n\n        <table>\n            <thead>\n                <tr class=\"centrado\">\n                    <th class=\"cantidad\">CANT</th>\n                    <th class=\"producto\">PRODUCTO</th>\n                    <th class=\"precio\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;TOTAL</th>\n                </tr>\n            </thead>\n            <tbody>\n                <?php\n                $total = 0;\n                foreach ($productos as $producto) {\n                    $total += $producto[\"cantidad\"] * $producto[\"precio\"];\n                ?>\n                    <tr>\n                        <td class=\"cantidad\"><?php echo number_format($producto[\"cantidad\"], 2) ?></td>\n                        <td class=\"producto\"><?php echo $producto[\"descripcion\"] ?></td>\n                        <td class=\"precio\">$<?php echo number_format($producto[\"precio\"], 2) ?></td>\n                    </tr>\n                <?php } ?>\n            </tbody>\n</table>\n<BR>\n<table style=\"border-top: 0px !important;\">\n    <tr>\n        <td>\n            <strong>SUBTOTAL</strong>\n        </td>\n        <td>\n            <strong>$<?php echo number_format($venta[\"total\"] - $venta[\"iva\"], 2) ?></strong>\n        </td>\n    </tr>\n    <tr>\n        <td>\n            <strong>TOTAL A PAGAR</strong>\n        </td>\n        <td>\n            <strong>$<?php echo number_format($venta[\"total\"] - $venta[\"iva\"], 2) ?></strong>\n        </td>\n    </tr>\n    <tr>\n        <td>\n            <strong>VALOR PAGADO</strong>\n        </td>\n        <td>\n            <strong>$<?php echo $venta[\"dinero_entregado\"] ?></strong>\n        </td>\n    </tr>\n    <tr>\n        <td>\n            <strong>FORMA DE PAGO</strong>\n        </td>\n        <td>\n            <strong><?php echo $venta[\"forma_pago\"] ?></strong>\n        </td>\n    </tr>\n    <tr>\n        <td>\n            <strong>CAMBIO</strong>\n        </td>\n        <td>\n            <strong>$<?php echo $venta[\"devuelta\"] ?></strong>\n        </td>\n    </tr>\n</table>\n        <br>\n        <p class=\"centrado\">¡GRACIAS POR SU COMPRA! </P>\n        <br>\n            <P>Elaborado por www.cloudecoway.com</p>\n            <P>Tel: 3137010627</p>\n\n    </div>\n</body>\n\n</html>','A'),(284,'/var/www/html/company/Ventaspos/mod/app_ventas/imprimirFactura.php','2022-05-31 22:50:00','rafael',208,5482,'<?php\n$medidaTicket = 280;\n\n\n$empresa = PCO_EjecutarSQL(\"\n            SELECT razon_social, nit, telefono, direccion\n            FROM app_empresa\n            WHERE id = 1\n        \")->fetch();\n\n$venta = PCO_EjecutarSQL(\"\n            SELECT date_format(fecha, \'%d-%m-%Y %H:%i:%s\') fecha, total, iva, forma_pago, devuelta, dinero_entregado, id_cliente\n            FROM app_ventas\n            WHERE id = \'$id\'\n        \")->fetch();\n\n$cliente = PCO_EjecutarSQL(\"\n            SELECT *\n            FROM app_clientes\n            WHERE id = \'\" . $venta[\"id_cliente\"] . \"\'\n        \")->fetch();\n\n$vendedor = PCO_EjecutarSQL(\"\n            SELECT nombre\n            FROM core_usuario\n            WHERE login = \'$PCOSESS_LoginUsuario\'\n        \")->fetchColumn();\n\n$productos = PCO_EjecutarSQL(\"\n            SELECT vd.cantidad, p.nombre as descripcion, vd.precio, date_format(fecha, \'%d-%m-%Y\') \n            FROM app_ventas_detalle vd, app_productos p\n            WHERE vd.id_producto = p.id AND vd.id_venta = \'$id\'\n        \")->fetchAll();\n?>\n<!DOCTYPE html>\n<html>\n\n<head>\n\n    <style>\n        * {\n            font-size: 15px;\n            font-family: \'DejaVu Sans\', serif;\n        }\n\n        h1 {\n            font-size: 18px;\n        }\n\n        \n\n        .ticket {\n            margin: 0.5px;\n        }\n\n        td,\n        th,\n        tr,\n        table {\n            border-top: 1px solid black;\n            border-collapse: collapse;\n            margin: 0 auto;\n            font-size: 15px;\n        }\n\n        td.precio {\n            text-align: right;\n            font-size: 11px;\n        }\n\n        td.cantidad {\n            font-size: 12px;\n        }\n\n        td.producto {\n            text-align: center;\n        }\n\n        th {\n            text-align: center;\n        }\n\n\n        .centrado {\n            text-align: center;\n            align-content: center;\n        }\n\n        .ticket {\n            width: <?php echo $medidaTicket ?>px;\n            max-width: <?php echo $medidaTicket ?>px;\n        }\n\n        img {\n            max-width: inherit;\n            width: inherit;\n        }\n\n        * {\n            margin: 0;\n            padding: 0;\n        }\n\n        .ticket {\n            margin: 0;\n            padding: 0;\n        }\n\n        body {\n            text-align: center;\n        }\n    </style>\n</head>\n\n<body>\n    <div class=\"ticket centrado\">\n        <h1><?php echo $empresa[\"razon_social\"] ?></h1>\n        <h2>NIT: <?php echo $empresa[\"nit\"] ?></h2>\n        <h2>Teléfono: <?php echo $empresa[\"telefono\"] ?></h2>\n        <h2>Direccion: <?php echo $empresa[\"direccion\"] ?></h2>\n        <h2>Correo: </h2>\n        <h2>--------------------------------------------</h2>\n        <h1 align=\"center\">Ticket de venta #<?php echo $id ?></h1>\n        \n        <h2>Fecha: <?php echo $venta[\"fecha\"] ?></h2>\n        <h2>Cliente: <?php echo $cliente[\"nombre_completo\"] ?></h2>\n        <h2>telefono: <?php echo $cliente[\"telefono\"] ?></h2>\n        <h2>CC / NIT: <?php echo $cliente[\"numero_documento\"] ?></h2>\n        <h2>Dirección: <?php echo $cliente[\"direccion\"] ?></h2>\n        <h2>Vendedor: <?php echo $vendedor; ?></h2>\n        <h2>Caja N° 1</h2>\n        <br>\n\n        <table>\n            <thead>\n                <tr class=\"centrado\">\n                    <th class=\"cantidad\">CANT</th>\n                    <th class=\"producto\">PRODUCTO</th>\n                    <th class=\"precio\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;TOTAL</th>\n                </tr>\n            </thead>\n            <tbody>\n                <?php\n                $total = 0;\n                foreach ($productos as $producto) {\n                    $total += $producto[\"cantidad\"] * $producto[\"precio\"];\n                ?>\n                    <tr>\n                        <td class=\"cantidad\"><?php echo number_format($producto[\"cantidad\"], 2) ?></td>\n                        <td class=\"producto\"><?php echo $producto[\"descripcion\"] ?></td>\n                        <td class=\"precio\">$<?php echo number_format($producto[\"precio\"], 2) ?></td>\n                    </tr>\n                <?php } ?>\n            </tbody>\n</table>\n<BR>\n<table style=\"border-top: 0px !important;\">\n    <tr style=\"border-top: 0px !important;\">\n        <td>\n            <strong>SUBTOTAL</strong>\n        </td>\n        <td>\n            <strong>$<?php echo number_format($venta[\"total\"] - $venta[\"iva\"], 2) ?></strong>\n        </td>\n    </tr>\n    <tr style=\"border-top: 0px !important;\">\n        <td>\n            <strong>TOTAL A PAGAR</strong>\n        </td>\n        <td>\n            <strong>$<?php echo number_format($venta[\"total\"] - $venta[\"iva\"], 2) ?></strong>\n        </td>\n    </tr>\n    <tr style=\"border-top: 0px !important;\">\n        <td>\n            <strong>VALOR PAGADO</strong>\n        </td>\n        <td>\n            <strong>$<?php echo $venta[\"dinero_entregado\"] ?></strong>\n        </td>\n    </tr>\n    <tr>\n        <td style=\"border-top: 0px !important;\">\n            <strong>FORMA DE PAGO</strong>\n        </td>\n        <td>\n            <strong><?php echo $venta[\"forma_pago\"] ?></strong>\n        </td>\n    </tr>\n    <tr style=\"border-top: 0px !important;\">\n        <td>\n            <strong>CAMBIO</strong>\n        </td>\n        <td>\n            <strong>$<?php echo $venta[\"devuelta\"] ?></strong>\n        </td>\n    </tr>\n</table>\n        <br>\n        <p class=\"centrado\">¡GRACIAS POR SU COMPRA! </P>\n        <br>\n            <P>Elaborado por www.cloudecoway.com</p>\n            <P>Tel: 3137010627</p>\n\n    </div>\n</body>\n\n</html>','A'),(285,'/var/www/html/company/Ventaspos/mod/app_ventas/imprimirFactura.php','2022-05-31 22:51:00','rafael',205,5510,'<?php\n$medidaTicket = 280;\n\n\n$empresa = PCO_EjecutarSQL(\"\n            SELECT razon_social, nit, telefono, direccion\n            FROM app_empresa\n            WHERE id = 1\n        \")->fetch();\n\n$venta = PCO_EjecutarSQL(\"\n            SELECT date_format(fecha, \'%d-%m-%Y %H:%i:%s\') fecha, total, iva, forma_pago, devuelta, dinero_entregado, id_cliente\n            FROM app_ventas\n            WHERE id = \'$id\'\n        \")->fetch();\n\n$cliente = PCO_EjecutarSQL(\"\n            SELECT *\n            FROM app_clientes\n            WHERE id = \'\" . $venta[\"id_cliente\"] . \"\'\n        \")->fetch();\n\n$vendedor = PCO_EjecutarSQL(\"\n            SELECT nombre\n            FROM core_usuario\n            WHERE login = \'$PCOSESS_LoginUsuario\'\n        \")->fetchColumn();\n\n$productos = PCO_EjecutarSQL(\"\n            SELECT vd.cantidad, p.nombre as descripcion, vd.precio, date_format(fecha, \'%d-%m-%Y\') \n            FROM app_ventas_detalle vd, app_productos p\n            WHERE vd.id_producto = p.id AND vd.id_venta = \'$id\'\n        \")->fetchAll();\n?>\n<!DOCTYPE html>\n<html>\n\n<head>\n\n    <style>\n        * {\n            font-size: 15px;\n            font-family: \'DejaVu Sans\', serif;\n        }\n\n        h1 {\n            font-size: 18px;\n        }\n\n        \n\n        .ticket {\n            margin: 0.5px;\n        }\n\n        .tblProducts {\n            border-top: 1px solid black;\n            border-collapse: collapse;\n            margin: 0 auto;\n            font-size: 15px;\n        }\n\n        td.precio {\n            text-align: right;\n            font-size: 11px;\n        }\n\n        td.cantidad {\n            font-size: 12px;\n        }\n\n        td.producto {\n            text-align: center;\n        }\n\n        th {\n            text-align: center;\n        }\n\n\n        .centrado {\n            text-align: center;\n            align-content: center;\n        }\n\n        .ticket {\n            width: <?php echo $medidaTicket ?>px;\n            max-width: <?php echo $medidaTicket ?>px;\n        }\n\n        img {\n            max-width: inherit;\n            width: inherit;\n        }\n\n        * {\n            margin: 0;\n            padding: 0;\n        }\n\n        .ticket {\n            margin: 0;\n            padding: 0;\n        }\n\n        body {\n            text-align: center;\n        }\n    </style>\n</head>\n\n<body>\n    <div class=\"ticket centrado\">\n        <h1><?php echo $empresa[\"razon_social\"] ?></h1>\n        <h2>NIT: <?php echo $empresa[\"nit\"] ?></h2>\n        <h2>Teléfono: <?php echo $empresa[\"telefono\"] ?></h2>\n        <h2>Direccion: <?php echo $empresa[\"direccion\"] ?></h2>\n        <h2>Correo: </h2>\n        <h2>--------------------------------------------</h2>\n        <h1 align=\"center\">Ticket de venta #<?php echo $id ?></h1>\n        \n        <h2>Fecha: <?php echo $venta[\"fecha\"] ?></h2>\n        <h2>Cliente: <?php echo $cliente[\"nombre_completo\"] ?></h2>\n        <h2>telefono: <?php echo $cliente[\"telefono\"] ?></h2>\n        <h2>CC / NIT: <?php echo $cliente[\"numero_documento\"] ?></h2>\n        <h2>Dirección: <?php echo $cliente[\"direccion\"] ?></h2>\n        <h2>Vendedor: <?php echo $vendedor; ?></h2>\n        <h2>Caja N° 1</h2>\n        <br>\n\n        <table class=\"tblProducts\">\n            <thead>\n                <tr class=\"centrado\">\n                    <th class=\"cantidad\">CANT</th>\n                    <th class=\"producto\">PRODUCTO</th>\n                    <th class=\"precio\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;TOTAL</th>\n                </tr>\n            </thead>\n            <tbody>\n                <?php\n                $total = 0;\n                foreach ($productos as $producto) {\n                    $total += $producto[\"cantidad\"] * $producto[\"precio\"];\n                ?>\n                    <tr>\n                        <td class=\"cantidad\"><?php echo number_format($producto[\"cantidad\"], 2) ?></td>\n                        <td class=\"producto\"><?php echo $producto[\"descripcion\"] ?></td>\n                        <td class=\"precio\">$<?php echo number_format($producto[\"precio\"], 2) ?></td>\n                    </tr>\n                <?php } ?>\n            </tbody>\n</table>\n<BR>\n<table style=\"border-top: 0px !important;\">\n    <tr style=\"border-top: 0px !important;\">\n        <td style=\"border-top: 0px !important;\">\n            <strong>SUBTOTAL</strong>\n        </td>\n        <td >\n            <strong>$<?php echo number_format($venta[\"total\"] - $venta[\"iva\"], 2) ?></strong>\n        </td>\n    </tr>\n    <tr style=\"border-top: 0px !important;\">\n        <td>\n            <strong>TOTAL A PAGAR</strong>\n        </td>\n        <td>\n            <strong>$<?php echo number_format($venta[\"total\"] - $venta[\"iva\"], 2) ?></strong>\n        </td>\n    </tr>\n    <tr style=\"border-top: 0px !important;\">\n        <td>\n            <strong>VALOR PAGADO</strong>\n        </td>\n        <td>\n            <strong>$<?php echo $venta[\"dinero_entregado\"] ?></strong>\n        </td>\n    </tr>\n    <tr>\n        <td style=\"border-top: 0px !important;\">\n            <strong>FORMA DE PAGO</strong>\n        </td>\n        <td>\n            <strong><?php echo $venta[\"forma_pago\"] ?></strong>\n        </td>\n    </tr>\n    <tr style=\"border-top: 0px !important;\">\n        <td>\n            <strong>CAMBIO</strong>\n        </td>\n        <td>\n            <strong>$<?php echo $venta[\"devuelta\"] ?></strong>\n        </td>\n    </tr>\n</table>\n        <br>\n        <p class=\"centrado\">¡GRACIAS POR SU COMPRA! </P>\n        <br>\n            <P>Elaborado por www.cloudecoway.com</p>\n            <P>Tel: 3137010627</p>\n\n    </div>\n</body>\n\n</html>','A'),(286,'/var/www/html/company/Ventaspos/mod/app_ventas/imprimirFactura.php','2022-05-31 22:52:00','rafael',208,5519,'<?php\n$medidaTicket = 280;\n\n\n$empresa = PCO_EjecutarSQL(\"\n            SELECT razon_social, nit, telefono, direccion\n            FROM app_empresa\n            WHERE id = 1\n        \")->fetch();\n\n$venta = PCO_EjecutarSQL(\"\n            SELECT date_format(fecha, \'%d-%m-%Y %H:%i:%s\') fecha, total, iva, forma_pago, devuelta, dinero_entregado, id_cliente\n            FROM app_ventas\n            WHERE id = \'$id\'\n        \")->fetch();\n\n$cliente = PCO_EjecutarSQL(\"\n            SELECT *\n            FROM app_clientes\n            WHERE id = \'\" . $venta[\"id_cliente\"] . \"\'\n        \")->fetch();\n\n$vendedor = PCO_EjecutarSQL(\"\n            SELECT nombre\n            FROM core_usuario\n            WHERE login = \'$PCOSESS_LoginUsuario\'\n        \")->fetchColumn();\n\n$productos = PCO_EjecutarSQL(\"\n            SELECT vd.cantidad, p.nombre as descripcion, vd.precio, date_format(fecha, \'%d-%m-%Y\') \n            FROM app_ventas_detalle vd, app_productos p\n            WHERE vd.id_producto = p.id AND vd.id_venta = \'$id\'\n        \")->fetchAll();\n?>\n<!DOCTYPE html>\n<html>\n\n<head>\n\n    <style>\n        * {\n            font-size: 15px;\n            font-family: \'DejaVu Sans\', serif;\n        }\n\n        h1 {\n            font-size: 18px;\n        }\n\n        \n\n        .ticket {\n            margin: 0.5px;\n        }\n\n        td,\n        th,\n        tr,\n        table {\n            border-top: 1px solid black;\n            border-collapse: collapse;\n            margin: 0 auto;\n            font-size: 15px;\n        }\n\n        td.precio {\n            text-align: right;\n            font-size: 11px;\n        }\n\n        td.cantidad {\n            font-size: 12px;\n        }\n\n        td.producto {\n            text-align: center;\n        }\n\n        th {\n            text-align: center;\n        }\n\n\n        .centrado {\n            text-align: center;\n            align-content: center;\n        }\n\n        .ticket {\n            width: <?php echo $medidaTicket ?>px;\n            max-width: <?php echo $medidaTicket ?>px;\n        }\n\n        img {\n            max-width: inherit;\n            width: inherit;\n        }\n\n        * {\n            margin: 0;\n            padding: 0;\n        }\n\n        .ticket {\n            margin: 0;\n            padding: 0;\n        }\n\n        body {\n            text-align: center;\n        }\n    </style>\n</head>\n\n<body>\n    <div class=\"ticket centrado\">\n        <h1><?php echo $empresa[\"razon_social\"] ?></h1>\n        <h2>NIT: <?php echo $empresa[\"nit\"] ?></h2>\n        <h2>Teléfono: <?php echo $empresa[\"telefono\"] ?></h2>\n        <h2>Direccion: <?php echo $empresa[\"direccion\"] ?></h2>\n        <h2>Correo: </h2>\n        <h2>--------------------------------------------</h2>\n        <h1 align=\"center\">Ticket de venta #<?php echo $id ?></h1>\n        \n        <h2>Fecha: <?php echo $venta[\"fecha\"] ?></h2>\n        <h2>Cliente: <?php echo $cliente[\"nombre_completo\"] ?></h2>\n        <h2>telefono: <?php echo $cliente[\"telefono\"] ?></h2>\n        <h2>CC / NIT: <?php echo $cliente[\"numero_documento\"] ?></h2>\n        <h2>Dirección: <?php echo $cliente[\"direccion\"] ?></h2>\n        <h2>Vendedor: <?php echo $vendedor; ?></h2>\n        <h2>Caja N° 1</h2>\n        <br>\n\n        <table>\n            <thead>\n                <tr class=\"centrado\">\n                    <th class=\"cantidad\">CANT</th>\n                    <th class=\"producto\">PRODUCTO</th>\n                    <th class=\"precio\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;TOTAL</th>\n                </tr>\n            </thead>\n            <tbody>\n                <?php\n                $total = 0;\n                foreach ($productos as $producto) {\n                    $total += $producto[\"cantidad\"] * $producto[\"precio\"];\n                ?>\n                    <tr>\n                        <td class=\"cantidad\"><?php echo number_format($producto[\"cantidad\"], 2) ?></td>\n                        <td class=\"producto\"><?php echo $producto[\"descripcion\"] ?></td>\n                        <td class=\"precio\">$<?php echo number_format($producto[\"precio\"], 2) ?></td>\n                    </tr>\n                <?php } ?>\n            </tbody>\n</table>\n<BR>\n<table style=\"border-top: 0px !important;\">\n    <tr style=\"border-top: 0px !important;\">\n        <td style=\"border-top: 0px !important;\">\n            <strong>SUBTOTAL</strong>\n        </td>\n        <td >\n            <strong>$<?php echo number_format($venta[\"total\"] - $venta[\"iva\"], 2) ?></strong>\n        </td>\n    </tr>\n    <tr style=\"border-top: 0px !important;\">\n        <td>\n            <strong>TOTAL A PAGAR</strong>\n        </td>\n        <td>\n            <strong>$<?php echo number_format($venta[\"total\"] - $venta[\"iva\"], 2) ?></strong>\n        </td>\n    </tr>\n    <tr style=\"border-top: 0px !important;\">\n        <td>\n            <strong>VALOR PAGADO</strong>\n        </td>\n        <td>\n            <strong>$<?php echo $venta[\"dinero_entregado\"] ?></strong>\n        </td>\n    </tr>\n    <tr>\n        <td style=\"border-top: 0px !important;\">\n            <strong>FORMA DE PAGO</strong>\n        </td>\n        <td>\n            <strong><?php echo $venta[\"forma_pago\"] ?></strong>\n        </td>\n    </tr>\n    <tr style=\"border-top: 0px !important;\">\n        <td>\n            <strong>CAMBIO</strong>\n        </td>\n        <td>\n            <strong>$<?php echo $venta[\"devuelta\"] ?></strong>\n        </td>\n    </tr>\n</table>\n        <br>\n        <p class=\"centrado\">¡GRACIAS POR SU COMPRA! </P>\n        <br>\n            <P>Elaborado por www.cloudecoway.com</p>\n            <P>Tel: 3137010627</p>\n\n    </div>\n</body>\n\n</html>','A'),(287,'/var/www/html/company/Ventaspos/mod/app_ventas/imprimirFactura.php','2022-05-31 22:53:00','rafael',208,5662,'<?php\n$medidaTicket = 280;\n\n\n$empresa = PCO_EjecutarSQL(\"\n            SELECT razon_social, nit, telefono, direccion\n            FROM app_empresa\n            WHERE id = 1\n        \")->fetch();\n\n$venta = PCO_EjecutarSQL(\"\n            SELECT date_format(fecha, \'%d-%m-%Y %H:%i:%s\') fecha, total, iva, forma_pago, devuelta, dinero_entregado, id_cliente\n            FROM app_ventas\n            WHERE id = \'$id\'\n        \")->fetch();\n\n$cliente = PCO_EjecutarSQL(\"\n            SELECT *\n            FROM app_clientes\n            WHERE id = \'\" . $venta[\"id_cliente\"] . \"\'\n        \")->fetch();\n\n$vendedor = PCO_EjecutarSQL(\"\n            SELECT nombre\n            FROM core_usuario\n            WHERE login = \'$PCOSESS_LoginUsuario\'\n        \")->fetchColumn();\n\n$productos = PCO_EjecutarSQL(\"\n            SELECT vd.cantidad, p.nombre as descripcion, vd.precio, date_format(fecha, \'%d-%m-%Y\') \n            FROM app_ventas_detalle vd, app_productos p\n            WHERE vd.id_producto = p.id AND vd.id_venta = \'$id\'\n        \")->fetchAll();\n?>\n<!DOCTYPE html>\n<html>\n\n<head>\n\n    <style>\n        * {\n            font-size: 15px;\n            font-family: \'DejaVu Sans\', serif;\n        }\n\n        h1 {\n            font-size: 18px;\n        }\n\n        \n\n        .ticket {\n            margin: 0.5px;\n        }\n\n        td,\n        th,\n        tr,\n        table {\n            border-top: 1px solid black;\n            border-collapse: collapse;\n            margin: 0 auto;\n            font-size: 15px;\n        }\n\n        td.precio {\n            text-align: right;\n            font-size: 11px;\n        }\n\n        td.cantidad {\n            font-size: 12px;\n        }\n\n        td.producto {\n            text-align: center;\n        }\n\n        th {\n            text-align: center;\n        }\n\n\n        .centrado {\n            text-align: center;\n            align-content: center;\n        }\n\n        .ticket {\n            width: <?php echo $medidaTicket ?>px;\n            max-width: <?php echo $medidaTicket ?>px;\n        }\n\n        img {\n            max-width: inherit;\n            width: inherit;\n        }\n\n        * {\n            margin: 0;\n            padding: 0;\n        }\n\n        .ticket {\n            margin: 0;\n            padding: 0;\n        }\n\n        body {\n            text-align: center;\n        }\n    </style>\n</head>\n\n<body>\n    <div class=\"ticket centrado\">\n        <h1><?php echo $empresa[\"razon_social\"] ?></h1>\n        <h2>NIT: <?php echo $empresa[\"nit\"] ?></h2>\n        <h2>Teléfono: <?php echo $empresa[\"telefono\"] ?></h2>\n        <h2>Direccion: <?php echo $empresa[\"direccion\"] ?></h2>\n        <h2>Correo: </h2>\n        <h2>--------------------------------------------</h2>\n        <h1 align=\"center\">Ticket de venta #<?php echo $id ?></h1>\n        \n        <h2>Fecha: <?php echo $venta[\"fecha\"] ?></h2>\n        <h2>Cliente: <?php echo $cliente[\"nombre_completo\"] ?></h2>\n        <h2>telefono: <?php echo $cliente[\"telefono\"] ?></h2>\n        <h2>CC / NIT: <?php echo $cliente[\"numero_documento\"] ?></h2>\n        <h2>Dirección: <?php echo $cliente[\"direccion\"] ?></h2>\n        <h2>Vendedor: <?php echo $vendedor; ?></h2>\n        <h2>Caja N° 1</h2>\n        <br>\n\n        <table>\n            <thead>\n                <tr class=\"centrado\">\n                    <th class=\"cantidad\">CANT</th>\n                    <th class=\"producto\">PRODUCTO</th>\n                    <th class=\"precio\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;TOTAL</th>\n                </tr>\n            </thead>\n            <tbody>\n                <?php\n                $total = 0;\n                foreach ($productos as $producto) {\n                    $total += $producto[\"cantidad\"] * $producto[\"precio\"];\n                ?>\n                    <tr>\n                        <td class=\"cantidad\"><?php echo number_format($producto[\"cantidad\"], 2) ?></td>\n                        <td class=\"producto\"><?php echo $producto[\"descripcion\"] ?></td>\n                        <td class=\"precio\">$<?php echo number_format($producto[\"precio\"], 2) ?></td>\n                    </tr>\n                <?php } ?>\n            </tbody>\n</table>\n<BR>\n<table style=\"border-top: 0px !important;\">\n    <tr style=\"border-top: 0px !important;\">\n        <td style=\"border-top: 0px !important;\">\n            <strong>SUBTOTAL</strong>\n        </td>\n        <td style=\"border-top: 0px !important;\">\n            <strong>$<?php echo number_format($venta[\"total\"] - $venta[\"iva\"], 2) ?></strong>\n        </td>\n    </tr>\n    <tr style=\"border-top: 0px !important;\">\n        <td style=\"border-top: 0px !important;\">\n            <strong>TOTAL A PAGAR</strong>\n        </td>\n        <td style=\"border-top: 0px !important;\">\n            <strong>$<?php echo number_format($venta[\"total\"] - $venta[\"iva\"], 2) ?></strong>\n        </td>\n    </tr>\n    <tr style=\"border-top: 0px !important;\">\n        <td style=\"border-top: 0px !important;\">\n            <strong>VALOR PAGADO</strong>\n        </td>\n        <td>\n            <strong>$<?php echo $venta[\"dinero_entregado\"] ?></strong>\n        </td>\n    </tr>\n    <tr>\n        <td style=\"border-top: 0px !important;\">\n            <strong>FORMA DE PAGO</strong>\n        </td>\n        <td>\n            <strong><?php echo $venta[\"forma_pago\"] ?></strong>\n        </td>\n    </tr>\n    <tr style=\"border-top: 0px !important;\">\n        <td>\n            <strong>CAMBIO</strong>\n        </td>\n        <td>\n            <strong>$<?php echo $venta[\"devuelta\"] ?></strong>\n        </td>\n    </tr>\n</table>\n        <br>\n        <p class=\"centrado\">¡GRACIAS POR SU COMPRA! </P>\n        <br>\n            <P>Elaborado por www.cloudecoway.com</p>\n            <P>Tel: 3137010627</p>\n\n    </div>\n</body>\n\n</html>','A'),(288,'/var/www/html/company/Ventaspos/mod/app_ventas/imprimirFactura.php','2022-05-31 22:53:00','rafael',208,5770,'<?php\n$medidaTicket = 280;\n\n\n$empresa = PCO_EjecutarSQL(\"\n            SELECT razon_social, nit, telefono, direccion\n            FROM app_empresa\n            WHERE id = 1\n        \")->fetch();\n\n$venta = PCO_EjecutarSQL(\"\n            SELECT date_format(fecha, \'%d-%m-%Y %H:%i:%s\') fecha, total, iva, forma_pago, devuelta, dinero_entregado, id_cliente\n            FROM app_ventas\n            WHERE id = \'$id\'\n        \")->fetch();\n\n$cliente = PCO_EjecutarSQL(\"\n            SELECT *\n            FROM app_clientes\n            WHERE id = \'\" . $venta[\"id_cliente\"] . \"\'\n        \")->fetch();\n\n$vendedor = PCO_EjecutarSQL(\"\n            SELECT nombre\n            FROM core_usuario\n            WHERE login = \'$PCOSESS_LoginUsuario\'\n        \")->fetchColumn();\n\n$productos = PCO_EjecutarSQL(\"\n            SELECT vd.cantidad, p.nombre as descripcion, vd.precio, date_format(fecha, \'%d-%m-%Y\') \n            FROM app_ventas_detalle vd, app_productos p\n            WHERE vd.id_producto = p.id AND vd.id_venta = \'$id\'\n        \")->fetchAll();\n?>\n<!DOCTYPE html>\n<html>\n\n<head>\n\n    <style>\n        * {\n            font-size: 15px;\n            font-family: \'DejaVu Sans\', serif;\n        }\n\n        h1 {\n            font-size: 18px;\n        }\n\n        \n\n        .ticket {\n            margin: 0.5px;\n        }\n\n        td,\n        th,\n        tr,\n        table {\n            border-top: 1px solid black;\n            border-collapse: collapse;\n            margin: 0 auto;\n            font-size: 15px;\n        }\n\n        td.precio {\n            text-align: right;\n            font-size: 11px;\n        }\n\n        td.cantidad {\n            font-size: 12px;\n        }\n\n        td.producto {\n            text-align: center;\n        }\n\n        th {\n            text-align: center;\n        }\n\n\n        .centrado {\n            text-align: center;\n            align-content: center;\n        }\n\n        .ticket {\n            width: <?php echo $medidaTicket ?>px;\n            max-width: <?php echo $medidaTicket ?>px;\n        }\n\n        img {\n            max-width: inherit;\n            width: inherit;\n        }\n\n        * {\n            margin: 0;\n            padding: 0;\n        }\n\n        .ticket {\n            margin: 0;\n            padding: 0;\n        }\n\n        body {\n            text-align: center;\n        }\n    </style>\n</head>\n\n<body>\n    <div class=\"ticket centrado\">\n        <h1><?php echo $empresa[\"razon_social\"] ?></h1>\n        <h2>NIT: <?php echo $empresa[\"nit\"] ?></h2>\n        <h2>Teléfono: <?php echo $empresa[\"telefono\"] ?></h2>\n        <h2>Direccion: <?php echo $empresa[\"direccion\"] ?></h2>\n        <h2>Correo: </h2>\n        <h2>--------------------------------------------</h2>\n        <h1 align=\"center\">Ticket de venta #<?php echo $id ?></h1>\n        \n        <h2>Fecha: <?php echo $venta[\"fecha\"] ?></h2>\n        <h2>Cliente: <?php echo $cliente[\"nombre_completo\"] ?></h2>\n        <h2>telefono: <?php echo $cliente[\"telefono\"] ?></h2>\n        <h2>CC / NIT: <?php echo $cliente[\"numero_documento\"] ?></h2>\n        <h2>Dirección: <?php echo $cliente[\"direccion\"] ?></h2>\n        <h2>Vendedor: <?php echo $vendedor; ?></h2>\n        <h2>Caja N° 1</h2>\n        <br>\n\n        <table>\n            <thead>\n                <tr class=\"centrado\">\n                    <th class=\"cantidad\">CANT</th>\n                    <th class=\"producto\">PRODUCTO</th>\n                    <th class=\"precio\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;TOTAL</th>\n                </tr>\n            </thead>\n            <tbody>\n                <?php\n                $total = 0;\n                foreach ($productos as $producto) {\n                    $total += $producto[\"cantidad\"] * $producto[\"precio\"];\n                ?>\n                    <tr>\n                        <td class=\"cantidad\"><?php echo number_format($producto[\"cantidad\"], 2) ?></td>\n                        <td class=\"producto\"><?php echo $producto[\"descripcion\"] ?></td>\n                        <td class=\"precio\">$<?php echo number_format($producto[\"precio\"], 2) ?></td>\n                    </tr>\n                <?php } ?>\n            </tbody>\n</table>\n<BR>\n<table style=\"border-top: 0px !important;\">\n    <tr style=\"border-top: 0px !important;\">\n        <td style=\"border-top: 0px !important;\">\n            <strong>SUBTOTAL</strong>\n        </td>\n        <td style=\"border-top: 0px !important;\">\n            <strong>$<?php echo number_format($venta[\"total\"] - $venta[\"iva\"], 2) ?></strong>\n        </td>\n    </tr>\n    <tr style=\"border-top: 0px !important;\">\n        <td style=\"border-top: 0px !important;\">\n            <strong>TOTAL A PAGAR</strong>\n        </td>\n        <td style=\"border-top: 0px !important;\">\n            <strong>$<?php echo number_format($venta[\"total\"] - $venta[\"iva\"], 2) ?></strong>\n        </td>\n    </tr>\n    <tr style=\"border-top: 0px !important;\">\n        <td style=\"border-top: 0px !important;\">\n            <strong>VALOR PAGADO</strong>\n        </td>\n        <td style=\"border-top: 0px !important;\">\n            <strong>$<?php echo $venta[\"dinero_entregado\"] ?></strong>\n        </td>\n    </tr>\n    <tr>\n        <td style=\"border-top: 0px !important;\">\n            <strong>FORMA DE PAGO</strong>\n        </td>\n        <td style=\"border-top: 0px !important;\">\n            <strong><?php echo $venta[\"forma_pago\"] ?></strong>\n        </td>\n    </tr>\n    <tr style=\"border-top: 0px !important;\">\n        <td style=\"border-top: 0px !important;\">\n            <strong>CAMBIO</strong>\n        </td>\n        <td style=\"border-top: 0px !important;\">\n            <strong>$<?php echo $venta[\"devuelta\"] ?></strong>\n        </td>\n    </tr>\n</table>\n        <br>\n        <p class=\"centrado\">¡GRACIAS POR SU COMPRA! </P>\n        <br>\n            <P>Elaborado por www.cloudecoway.com</p>\n            <P>Tel: 3137010627</p>\n\n    </div>\n</body>\n\n</html>','A'),(289,'/var/www/html/company/Ventaspos/mod/app_ventas/imprimirFactura.php','2022-05-31 22:54:00','rafael',208,5842,'<?php\n$medidaTicket = 280;\n\n\n$empresa = PCO_EjecutarSQL(\"\n            SELECT razon_social, nit, telefono, direccion\n            FROM app_empresa\n            WHERE id = 1\n        \")->fetch();\n\n$venta = PCO_EjecutarSQL(\"\n            SELECT date_format(fecha, \'%d-%m-%Y %H:%i:%s\') fecha, total, iva, forma_pago, devuelta, dinero_entregado, id_cliente\n            FROM app_ventas\n            WHERE id = \'$id\'\n        \")->fetch();\n\n$cliente = PCO_EjecutarSQL(\"\n            SELECT *\n            FROM app_clientes\n            WHERE id = \'\" . $venta[\"id_cliente\"] . \"\'\n        \")->fetch();\n\n$vendedor = PCO_EjecutarSQL(\"\n            SELECT nombre\n            FROM core_usuario\n            WHERE login = \'$PCOSESS_LoginUsuario\'\n        \")->fetchColumn();\n\n$productos = PCO_EjecutarSQL(\"\n            SELECT vd.cantidad, p.nombre as descripcion, vd.precio, date_format(fecha, \'%d-%m-%Y\') \n            FROM app_ventas_detalle vd, app_productos p\n            WHERE vd.id_producto = p.id AND vd.id_venta = \'$id\'\n        \")->fetchAll();\n?>\n<!DOCTYPE html>\n<html>\n\n<head>\n\n    <style>\n        * {\n            font-size: 15px;\n            font-family: \'DejaVu Sans\', serif;\n        }\n\n        h1 {\n            font-size: 18px;\n        }\n\n        \n\n        .ticket {\n            margin: 0.5px;\n        }\n\n        td,\n        th,\n        tr,\n        table {\n            border-top: 1px solid black;\n            border-collapse: collapse;\n            margin: 0 auto;\n            font-size: 15px;\n        }\n\n        td.precio {\n            text-align: right;\n            font-size: 11px;\n        }\n\n        td.cantidad {\n            font-size: 12px;\n        }\n\n        td.producto {\n            text-align: center;\n        }\n\n        th {\n            text-align: center;\n        }\n\n\n        .centrado {\n            text-align: center;\n            align-content: center;\n        }\n\n        .ticket {\n            width: <?php echo $medidaTicket ?>px;\n            max-width: <?php echo $medidaTicket ?>px;\n        }\n\n        img {\n            max-width: inherit;\n            width: inherit;\n        }\n\n        * {\n            margin: 0;\n            padding: 0;\n        }\n\n        .ticket {\n            margin: 0;\n            padding: 0;\n        }\n\n        body {\n            text-align: center;\n        }\n    </style>\n</head>\n\n<body>\n    <div class=\"ticket centrado\">\n        <h1><?php echo $empresa[\"razon_social\"] ?></h1>\n        <h2>NIT: <?php echo $empresa[\"nit\"] ?></h2>\n        <h2>Teléfono: <?php echo $empresa[\"telefono\"] ?></h2>\n        <h2>Direccion: <?php echo $empresa[\"direccion\"] ?></h2>\n        <h2>Correo: </h2>\n        <h2>--------------------------------------------</h2>\n        <h1 align=\"center\">Ticket de venta #<?php echo $id ?></h1>\n        \n        <h2>Fecha: <?php echo $venta[\"fecha\"] ?></h2>\n        <h2>Cliente: <?php echo $cliente[\"nombre_completo\"] ?></h2>\n        <h2>telefono: <?php echo $cliente[\"telefono\"] ?></h2>\n        <h2>CC / NIT: <?php echo $cliente[\"numero_documento\"] ?></h2>\n        <h2>Dirección: <?php echo $cliente[\"direccion\"] ?></h2>\n        <h2>Vendedor: <?php echo $vendedor; ?></h2>\n        <h2>Caja N° 1</h2>\n        <br>\n\n        <table>\n            <thead>\n                <tr class=\"centrado\">\n                    <th class=\"cantidad\">CANT</th>\n                    <th class=\"producto\">PRODUCTO</th>\n                    <th class=\"precio\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;TOTAL</th>\n                </tr>\n            </thead>\n            <tbody>\n                <?php\n                $total = 0;\n                foreach ($productos as $producto) {\n                    $total += $producto[\"cantidad\"] * $producto[\"precio\"];\n                ?>\n                    <tr>\n                        <td class=\"cantidad\"><?php echo number_format($producto[\"cantidad\"], 2) ?></td>\n                        <td class=\"producto\"><?php echo $producto[\"descripcion\"] ?></td>\n                        <td class=\"precio\">$<?php echo number_format($producto[\"precio\"], 2) ?></td>\n                    </tr>\n                <?php } ?>\n            </tbody>\n</table>\n<BR>\n<table style=\"border-top: 0px !important;\">\n    <tr style=\"border-top: 0px !important;\">\n        <td style=\"border-top: 0px !important;\">\n            <strong>SUBTOTAL</strong>\n        </td>\n        <td style=\"border-top: 0px !important;\">\n            <strong>$<?php echo number_format($venta[\"total\"] - $venta[\"iva\"], 2) ?></strong>\n        </td>\n    </tr>\n    <tr style=\"border-top: 0px !important;\">\n        <td style=\"border-top: 0px !important;\">\n            <strong>TOTAL A PAGAR</strong>\n        </td>\n        <td style=\"border-top: 0px !important;\">\n            <strong>$<?php echo number_format($venta[\"total\"] - $venta[\"iva\"], 2) ?></strong>\n        </td>\n    </tr>\n    <tr style=\"border-top: 0px !important;\">\n        <td style=\"border-top: 0px !important;\">\n            <strong>VALOR PAGADO</strong>\n        </td>\n        <td style=\"border-top: 0px !important;\">\n            <strong>$<?php echo $venta[\"dinero_entregado\"] ?></strong>\n        </td>\n    </tr>\n    <tr style=\"border-top: 0px !important;\">\n        <td style=\"border-top: 0px !important;\">\n            <strong>FORMA DE PAGO</strong>\n        </td>\n        <td style=\"border-top: 0px !important;\">\n            <strong><?php echo $venta[\"forma_pago\"] ?></strong>\n        </td>\n    </tr>\n    <tr style=\"border-top: 0px !important;\">\n        <td style=\"border-top: 0px !important;\">\n            <strong>CAMBIO</strong>\n        </td>\n        <td style=\"border-top: 0px !important;\">\n            <strong>$<?php echo $venta[\"devuelta\"] ?></strong>\n        </td>\n    </tr>\n</table>\n        <br>\n        <p class=\"centrado\">¡GRACIAS POR SU COMPRA! </P>\n        <br>\n            <P>Elaborado por www.cloudecoway.com</p>\n            <P>Tel: 3137010627</p>\n\n    </div>\n</body>\n\n</html>','A'),(290,'/var/www/html/company/Ventaspos/mod/app_ventas/imprimirFactura.php','2022-05-31 23:05:00','rafael',208,5834,'<?php\n$medidaTicket = 280;\n\n\n$empresa = PCO_EjecutarSQL(\"\n            SELECT razon_social, nit, telefono, direccion\n            FROM app_empresa\n            WHERE id = 1\n        \")->fetch();\n\n$venta = PCO_EjecutarSQL(\"\n            SELECT date_format(fecha, \'%d-%m-%Y %H:%i:%s\') fecha, total, iva, forma_pago, devuelta, dinero_entregado, id_cliente\n            FROM app_ventas\n            WHERE id = \'$id\'\n        \")->fetch();\n\n$cliente = PCO_EjecutarSQL(\"\n            SELECT *\n            FROM app_clientes\n            WHERE id = \'\" . $venta[\"id_cliente\"] . \"\'\n        \")->fetch();\n\n$vendedor = PCO_EjecutarSQL(\"\n            SELECT nombre\n            FROM core_usuario\n            WHERE login = \'$PCOSESS_LoginUsuario\'\n        \")->fetchColumn();\n\n$productos = PCO_EjecutarSQL(\"\n            SELECT vd.cantidad, p.nombre as descripcion, vd.precio, date_format(fecha, \'%d-%m-%Y\') \n            FROM app_ventas_detalle vd, app_productos p\n            WHERE vd.id_producto = p.id AND vd.id_venta = \'$id\'\n        \")->fetchAll();\n?>\n<!DOCTYPE html>\n<html>\n\n<head>\n\n    <style>\n        * {\n            font-size: 15px;\n            font-family: \'DejaVu Sans\', serif;\n        }\n\n        h1 {\n            font-size: 18px;\n        }\n\n        \n\n        .ticket {\n            margin: 0.5px;\n        }\n\n        td,\n        th,\n        tr,\n        table {\n            border-top: 1px solid black;\n            border-collapse: collapse;\n            margin: 0 auto;\n            font-size: 15px;\n        }\n\n        td.precio {\n            text-align: right;\n            font-size: 11px;\n        }\n\n        td.cantidad {\n            font-size: 12px;\n        }\n\n        td.producto {\n            text-align: center;\n        }\n\n        th {\n            text-align: center;\n        }\n\n\n        .centrado {\n            text-align: center;\n            align-content: center;\n        }\n\n        .ticket {\n            width: <?php echo $medidaTicket ?>px;\n            max-width: <?php echo $medidaTicket ?>px;\n        }\n\n        img {\n            max-width: inherit;\n            width: inherit;\n        }\n\n        * {\n            margin: 0;\n            padding: 0;\n        }\n\n        .ticket {\n            margin: 0;\n            padding: 0;\n        }\n\n        body {\n            text-align: center;\n        }\n    </style>\n</head>\n\n<body>\n    <div class=\"ticket centrado\">\n        <h1><?php echo $empresa[\"razon_social\"] ?></h1>\n        <h2>NIT: <?php echo $empresa[\"nit\"] ?></h2>\n        <h2>Teléfono: <?php echo $empresa[\"telefono\"] ?></h2>\n        <h2>Direccion: <?php echo $empresa[\"direccion\"] ?></h2>\n        <h2>Correo: </h2>\n        <h2>--------------------------------------------</h2>\n        <h1 align=\"center\">Ticket de venta #<?php echo $id ?></h1>\n        \n        <h2>Fecha: <?php echo $venta[\"fecha\"] ?></h2>\n        <h2>Cliente: <?php echo $cliente[\"nombre_completo\"] ?></h2>\n        <h2>telefono: <?php echo $cliente[\"telefono\"] ?></h2>\n        <h2>CC / NIT: <?php echo $cliente[\"numero_documento\"] ?></h2>\n        <h2>Dirección: <?php echo $cliente[\"direccion\"] ?></h2>\n        <h2>Vendedor: <?php echo $vendedor; ?></h2>\n        <h2>Caja N° 1</h2>\n        <br>\n\n        <table>\n            <thead>\n                <tr class=\"centrado\">\n                    <th class=\"cantidad\">CANT</th>\n                    <th class=\"producto\">PRODUCTO</th>\n                    <th class=\"precio\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;TOTAL</th>\n                </tr>\n            </thead>\n            <tbody>\n                <?php\n                $total = 0;\n                foreach ($productos as $producto) {\n                    $total += $producto[\"cantidad\"] * $producto[\"precio\"];\n                ?>\n                    <tr>\n                        <td class=\"cantidad\"><?php echo number_format($producto[\"cantidad\"], 2) ?></td>\n                        <td class=\"producto\"><?php echo $producto[\"descripcion\"] ?></td>\n                        <td class=\"precio\">$<?php echo number_format($producto[\"precio\"], 2) ?></td>\n                    </tr>\n                <?php } ?>\n            </tbody>\n</table>\n<BR>\n<table style=\"border-top: 0px !important;\">\n    <tr style=\"border-top: 0px !important;\">\n        <td style=\"border-top: 0px !important;\">\n            <strong>SUBTOTAL</strong>\n        </td>\n        <td style=\"border-top: 0px !important;\">\n            <strong>$<?php echo number_format($venta[\"total\"] - $venta[\"iva\"], 2) ?></strong>\n        </td>\n    </tr>\n    <tr style=\"border-top: 0px !important;\">\n        <td style=\"border-top: 0px !important;\">\n            <strong>TOTAL A PAGAR</strong>\n        </td>\n        <td style=\"border-top: 0px !important;\">\n            <strong>$<?php echo number_format($venta[\"total\"] - $venta[\"iva\"], 2) ?></strong>\n        </td>\n    </tr>\n    <tr style=\"border-top: 0px !important;\">\n        <td style=\"border-top: 0px !important;\">\n            <strong>VALOR PAGADO</strong>\n        </td>\n        <td style=\"border-top: 0px !important;\">\n            <strong>$<?php echo $venta[\"dinero_entregado\"] ?></strong>\n        </td>\n    </tr>\n    <tr style=\"border-top: 0px !important;\">\n        <td style=\"border-top: 0px !important;\">\n            <strong>FORMA DE PAGO</strong>\n        </td>\n        <td style=\"border-top: 0px !important;\">\n            <strong><?php echo $venta[\"forma_pago\"] ?></strong>\n        </td>\n    </tr>\n    <tr style=\"border-top: 0px !important;\">\n        <td style=\"border-top: 0px !important;\">\n            <strong>CAMBIO</strong>\n        </td>\n        <td style=\"border-top: 0px !important;\">\n            <strong>$<?php echo $venta[\"devuelta\"] ?></strong>\n        </td>\n    </tr>\n</table>\n        <br>\n        <p class=\"centrado\">¡GRACIAS POR SU COMPRA! </P>\n        <br>\n        <P>Elaborado por www.cloudecoway.com</p>\n        <P>Tel: 3137010627</p>\n\n    </div>\n</body>\n\n</html>','A'),(291,'/var/www/html/company/Ventaspos/mod/app_ventas/index.php','2022-06-05 20:07:00','rafael',157,6438,'<?php\n\nfunction calcularTotalVenta($id, $returnArr = \"\") {\n    $venta = PCO_EjecutarSQL(\"\n        SELECT SUM(precio * cantidad) as total, SUM(precio * iva/100) iva\n        FROM app_ventas_detalle\n        WHERE id_venta = \'$id\' GROUP BY id_venta\n    \")->fetch();\n    $total = $venta[\"total\"] ? $venta[\"total\"] : 0;\n    $iva = $venta[\"iva\"] ? $venta[\"iva\"] : 0;\n    PCO_EjecutarSQLUnaria(\"UPDATE app_ventas SET total = $total, iva = $iva WHERE id = $id \");\n    if($returnArr)\n        return $venta\n    return \'\"total\": \' . $total . \', \"iva\": \' . $iva;\n}\n\nif($PCO_Accion == \"VENTA_ingresarRealizarVenta\") {\n    $ventaAbierta = PCO_EjecutarSQL(\"\n        SELECT id, id_cliente, total, iva\n        FROM app_ventas\n        WHERE estado = 0 ORDER BY id limit 1\n    \")->fetch();\n    /*if (!$ventaAbierta[\"id\"]) {\n        \n        $ventaAbierta = PCO_EjecutarSQL(\"\n            SELECT *\n            FROM app_ventas\n            WHERE estado = 0 ORDER BY id limit 1\n        \")->fetch();   \n    }*/\n\n    $id_venta = $ventaAbierta[\"id\"] ? $ventaAbierta[\"id\"] : \"\";\n    if($id_venta) {\n        $total = number_format($ventaAbierta[\"total\"], 2);\n        $iva = number_format($ventaAbierta[\"iva\"], 2);\n        $id_cliente = $ventaAbierta[\"id_cliente\"];\n    }\n\n    PCO_CargarFormulario(8, 1, \"id\", $id_venta);\n}\n\nif($PCO_Accion == \"VENTA_agregarProductoCrearOC\") {\n\n    if(!$id) {\n        //crear cliente en caso de que no llegue id_cliente\n        if(!$id_cliente) {\n            PCO_EjecutarSQLUnaria(\"INSERT INTO app_clientes (nombre_completo, numero_documento, telefono) VALUES (?,?,?) \",\n                \"$nombre_completo$_SeparadorCampos_$numero_documento$_SeparadorCampos_$telefono\"\n            );\n            $id_cliente = PCO_ObtenerUltimoIDInsertado();\n        }\n        PCO_EjecutarSQLUnaria(\"INSERT INTO app_ventas (id_cliente, usuario) VALUES (?,?) \", \"$id_cliente$_SeparadorCampos_$PCOSESS_LoginUsuario\");\n        $id = PCO_ObtenerUltimoIDInsertado();\n    }\n    $producto = PCO_EjecutarSQL(\"\n        SELECT id, precio_venta, iva, inventario\n        FROM app_productos\n        WHERE id = \'$id_producto\'\n    \")->fetch();\n    if($producto[\"id\"]) {\n        $existe = PCO_EjecutarSQL(\"\n            SELECT count(id)\n            FROM app_ventas_detalle\n            WHERE id_venta = $id AND id_producto = \'$id_producto\'\n        \")->fetchColumn();\n        if($existe > 0) {\n            print_r(\'{\"success\": false, \"msg\": \"El producto ya se ha ingresado\"}\');\n            die();\n        }\n        if($producto[\"inventario\"] < $cantidad) {\n            print_r(\'{\"success\": false, \"msg\": \"La cantidad digitada supera la del invetario\"}\');\n            die();\n        }\n        $inventarioNew = $producto[\"inventario\"] - $cantidad;\n        PCO_EjecutarSQLUnaria(\"UPDATE app_productos SET inventario = $inventarioNew WHERE id = \" . $producto[\"id\"]);\n        PCO_EjecutarSQLUnaria(\"INSERT INTO app_ventas_detalle (id_venta, id_producto, cantidad, precio, iva) VALUES (?,?,?,?,?) \", \n            \"$id$_SeparadorCampos_$id_producto$_SeparadorCampos_$cantidad$_SeparadorCampos_\" . $producto[\"precio_venta\"] . \"$_SeparadorCampos_\" . $producto[\"iva\"]);\n        $result = calcularTotalVenta($id);\n        \n        PCO_CargarFormulario(8, 1, \"id\", $id_venta);\n    }\n}\n\nif($PCO_Accion == \"VENTA_agregarProducto\") {\n\n    if(!$id) {\n        //crear cliente en caso de que no llegue id_cliente\n        if(!$id_cliente) {\n            PCO_EjecutarSQLUnaria(\"INSERT INTO app_clientes (nombre_completo, numero_documento, telefono) VALUES (?,?,?) \",\n                \"$nombre_completo$_SeparadorCampos_$numero_documento$_SeparadorCampos_$telefono\"\n            );\n            $id_cliente = PCO_ObtenerUltimoIDInsertado();\n        }\n        PCO_EjecutarSQLUnaria(\"INSERT INTO app_ventas (id_cliente, usuario) VALUES (?,?) \", \"$id_cliente$_SeparadorCampos_$PCOSESS_LoginUsuario\");\n        $id = PCO_ObtenerUltimoIDInsertado();\n    }\n    $producto = PCO_EjecutarSQL(\"\n        SELECT id, precio_venta, iva, inventario\n        FROM app_productos\n        WHERE id = \'$id_producto\'\n    \")->fetch();\n    if($producto[\"id\"]) {\n        $existe = PCO_EjecutarSQL(\"\n            SELECT count(id)\n            FROM app_ventas_detalle\n            WHERE id_venta = $id AND id_producto = \'$id_producto\'\n        \")->fetchColumn();\n        if($existe > 0) {\n            print_r(\'{\"success\": false, \"msg\": \"El producto ya se ha ingresado\"}\');\n            die();\n        }\n        if($producto[\"inventario\"] < $cantidad) {\n            print_r(\'{\"success\": false, \"msg\": \"La cantidad digitada supera la del invetario\"}\');\n            die();\n        }\n        $inventarioNew = $producto[\"inventario\"] - $cantidad;\n        PCO_EjecutarSQLUnaria(\"UPDATE app_productos SET inventario = $inventarioNew WHERE id = \" . $producto[\"id\"]);\n        PCO_EjecutarSQLUnaria(\"INSERT INTO app_ventas_detalle (id_venta, id_producto, cantidad, precio, iva) VALUES (?,?,?,?,?) \", \n            \"$id$_SeparadorCampos_$id_producto$_SeparadorCampos_$cantidad$_SeparadorCampos_\" . $producto[\"precio_venta\"] . \"$_SeparadorCampos_\" . $producto[\"iva\"]);\n        $result = calcularTotalVenta($id);\n        print_r(\'{\"success\": true, \"id\": \' . $id . \', \' . $result . \'}\');\n        die();\n    }\n    print_r(\'{\"success\": false, \"msg\": \"No se ha encontrado el producto seleccionado\"}\');\n    die();\n}\n\nif($PCO_Accion == \"VENTA_eliminarProducto\") {\n\n    if($id_venta_detalle && $id_venta) {\n        $producto = PCO_EjecutarSQL(\"\n            SELECT p.inventario, vd.cantidad, p.id\n            FROM app_ventas_detalle vd, app_productos p\n            WHERE vd.id_producto = p.id AND vd.id = \'$id_venta_detalle\'\n        \")->fetch();\n        //Restablecemos el inventario\n        $inventarioNew = $producto[\"inventario\"] + $producto[\"cantidad\"];\n        PCO_EjecutarSQLUnaria(\"UPDATE app_productos SET inventario = $inventarioNew WHERE id = \" . $producto[\"id\"]);\n        PCO_EjecutarSQLUnaria(\"DELETE FROM app_ventas_detalle WHERE id_venta = $id_venta AND id = $id_venta_detalle\");\n        $result = calcularTotalVenta($id_venta);\n        print_r(\'{\"success\": true, \"msg\": \"Se ha eliminado el producto exitosamente\", \' . $result . \'}\');\n        die();\n    }\n    print_r(\'{\"success\": false, \"msg\": \"No se pudo eliminar el producto\"}\');\n    die();\n}\n\nif($PCO_Accion == \"VENTA_imprimirFactura\") {\n\n    //sleep(2);\n    // echo \"$PCO_Valor\";\n    if($PCO_Valor)\n        $id = $PCO_Valor;\n    if($id) {\n        include_once \"imprimirFactura.php\";\n    }\n}','A'),(292,'/var/www/html/company/Ventaspos/mod/app_ventas/index.php','2022-06-05 20:07:00','rafael',157,6444,'<?php\n\nfunction calcularTotalVenta($id, $returnArr = \"\") {\n    $venta = PCO_EjecutarSQL(\"\n        SELECT SUM(precio * cantidad) as total, SUM(precio * iva/100) iva\n        FROM app_ventas_detalle\n        WHERE id_venta = \'$id\' GROUP BY id_venta\n    \")->fetch();\n    $total = $venta[\"total\"] ? $venta[\"total\"] : 0;\n    $iva = $venta[\"iva\"] ? $venta[\"iva\"] : 0;\n    PCO_EjecutarSQLUnaria(\"UPDATE app_ventas SET total = $total, iva = $iva WHERE id = $id \");\n    if($returnArr)\n        return $venta;\n    return \'\"total\": \' . $total . \', \"iva\": \' . $iva;\n}\n\nif($PCO_Accion == \"VENTA_ingresarRealizarVenta\") {\n    $ventaAbierta = PCO_EjecutarSQL(\"\n        SELECT id, id_cliente, total, iva\n        FROM app_ventas\n        WHERE estado = 0 ORDER BY id limit 1\n    \")->fetch();\n    /*if (!$ventaAbierta[\"id\"]) {\n        \n        $ventaAbierta = PCO_EjecutarSQL(\"\n            SELECT *\n            FROM app_ventas\n            WHERE estado = 0 ORDER BY id limit 1\n        \")->fetch();   \n    }*/\n\n    $id_venta = $ventaAbierta[\"id\"] ? $ventaAbierta[\"id\"] : \"\";\n    if($id_venta) {\n        $total = number_format($ventaAbierta[\"total\"], 2);\n        $iva = number_format($ventaAbierta[\"iva\"], 2);\n        $id_cliente = $ventaAbierta[\"id_cliente\"];\n    }\n\n    PCO_CargarFormulario(8, 1, \"id\", $id_venta);\n}\n\nif($PCO_Accion == \"VENTA_agregarProductoCrearOC\") {\n\n    if(!$id) {\n        //crear cliente en caso de que no llegue id_cliente\n        if(!$id_cliente) {\n            PCO_EjecutarSQLUnaria(\"INSERT INTO app_clientes (nombre_completo, numero_documento, telefono) VALUES (?,?,?) \",\n                \"$nombre_completo$_SeparadorCampos_$numero_documento$_SeparadorCampos_$telefono\"\n            );\n            $id_cliente = PCO_ObtenerUltimoIDInsertado();\n        }\n        PCO_EjecutarSQLUnaria(\"INSERT INTO app_ventas (id_cliente, usuario) VALUES (?,?) \", \"$id_cliente$_SeparadorCampos_$PCOSESS_LoginUsuario\");\n        $id = PCO_ObtenerUltimoIDInsertado();\n    }\n    $producto = PCO_EjecutarSQL(\"\n        SELECT id, precio_venta, iva, inventario\n        FROM app_productos\n        WHERE id = \'$id_producto\'\n    \")->fetch();\n    if($producto[\"id\"]) {\n        $existe = PCO_EjecutarSQL(\"\n            SELECT count(id)\n            FROM app_ventas_detalle\n            WHERE id_venta = $id AND id_producto = \'$id_producto\'\n        \")->fetchColumn();\n        if($existe > 0) {\n            print_r(\'{\"success\": false, \"msg\": \"El producto ya se ha ingresado\"}\');\n            die();\n        }\n        if($producto[\"inventario\"] < $cantidad) {\n            print_r(\'{\"success\": false, \"msg\": \"La cantidad digitada supera la del invetario\"}\');\n            die();\n        }\n        $inventarioNew = $producto[\"inventario\"] - $cantidad;\n        PCO_EjecutarSQLUnaria(\"UPDATE app_productos SET inventario = $inventarioNew WHERE id = \" . $producto[\"id\"]);\n        PCO_EjecutarSQLUnaria(\"INSERT INTO app_ventas_detalle (id_venta, id_producto, cantidad, precio, iva) VALUES (?,?,?,?,?) \", \n            \"$id$_SeparadorCampos_$id_producto$_SeparadorCampos_$cantidad$_SeparadorCampos_\" . $producto[\"precio_venta\"] . \"$_SeparadorCampos_\" . $producto[\"iva\"]);\n        $result = calcularTotalVenta($id);\n        \n        PCO_CargarFormulario(8, 1, \"id\", $id_venta);\n    }\n}\n\nif($PCO_Accion == \"VENTA_agregarProducto\") {\n\n    if(!$id) {\n        //crear cliente en caso de que no llegue id_cliente\n        if(!$id_cliente) {\n            PCO_EjecutarSQLUnaria(\"INSERT INTO app_clientes (nombre_completo, numero_documento, telefono) VALUES (?,?,?) \",\n                \"$nombre_completo$_SeparadorCampos_$numero_documento$_SeparadorCampos_$telefono\"\n            );\n            $id_cliente = PCO_ObtenerUltimoIDInsertado();\n        }\n        PCO_EjecutarSQLUnaria(\"INSERT INTO app_ventas (id_cliente, usuario) VALUES (?,?) \", \"$id_cliente$_SeparadorCampos_$PCOSESS_LoginUsuario\");\n        $id = PCO_ObtenerUltimoIDInsertado();\n    }\n    $producto = PCO_EjecutarSQL(\"\n        SELECT id, precio_venta, iva, inventario\n        FROM app_productos\n        WHERE id = \'$id_producto\'\n    \")->fetch();\n    if($producto[\"id\"]) {\n        $existe = PCO_EjecutarSQL(\"\n            SELECT count(id)\n            FROM app_ventas_detalle\n            WHERE id_venta = $id AND id_producto = \'$id_producto\'\n        \")->fetchColumn();\n        if($existe > 0) {\n            print_r(\'{\"success\": false, \"msg\": \"El producto ya se ha ingresado\"}\');\n            die();\n        }\n        if($producto[\"inventario\"] < $cantidad) {\n            print_r(\'{\"success\": false, \"msg\": \"La cantidad digitada supera la del invetario\"}\');\n            die();\n        }\n        $inventarioNew = $producto[\"inventario\"] - $cantidad;\n        PCO_EjecutarSQLUnaria(\"UPDATE app_productos SET inventario = $inventarioNew WHERE id = \" . $producto[\"id\"]);\n        PCO_EjecutarSQLUnaria(\"INSERT INTO app_ventas_detalle (id_venta, id_producto, cantidad, precio, iva) VALUES (?,?,?,?,?) \", \n            \"$id$_SeparadorCampos_$id_producto$_SeparadorCampos_$cantidad$_SeparadorCampos_\" . $producto[\"precio_venta\"] . \"$_SeparadorCampos_\" . $producto[\"iva\"]);\n        $result = calcularTotalVenta($id);\n        print_r(\'{\"success\": true, \"id\": \' . $id . \', \' . $result . \'}\');\n        die();\n    }\n    print_r(\'{\"success\": false, \"msg\": \"No se ha encontrado el producto seleccionado\"}\');\n    die();\n}\n\nif($PCO_Accion == \"VENTA_eliminarProducto\") {\n\n    if($id_venta_detalle && $id_venta) {\n        $producto = PCO_EjecutarSQL(\"\n            SELECT p.inventario, vd.cantidad, p.id\n            FROM app_ventas_detalle vd, app_productos p\n            WHERE vd.id_producto = p.id AND vd.id = \'$id_venta_detalle\'\n        \")->fetch();\n        //Restablecemos el inventario\n        $inventarioNew = $producto[\"inventario\"] + $producto[\"cantidad\"];\n        PCO_EjecutarSQLUnaria(\"UPDATE app_productos SET inventario = $inventarioNew WHERE id = \" . $producto[\"id\"]);\n        PCO_EjecutarSQLUnaria(\"DELETE FROM app_ventas_detalle WHERE id_venta = $id_venta AND id = $id_venta_detalle\");\n        $result = calcularTotalVenta($id_venta);\n        print_r(\'{\"success\": true, \"msg\": \"Se ha eliminado el producto exitosamente\", \' . $result . \'}\');\n        die();\n    }\n    print_r(\'{\"success\": false, \"msg\": \"No se pudo eliminar el producto\"}\');\n    die();\n}\n\nif($PCO_Accion == \"VENTA_imprimirFactura\") {\n\n    //sleep(2);\n    // echo \"$PCO_Valor\";\n    if($PCO_Valor)\n        $id = $PCO_Valor;\n    if($id) {\n        include_once \"imprimirFactura.php\";\n    }\n}','A'),(293,'/var/www/html/company/Ventaspos/mod/app_ventas/index.php','2022-06-05 20:12:00','rafael',159,6544,'<?php\n\nfunction calcularTotalVenta($id, $returnArr = \"\") {\n    $venta = PCO_EjecutarSQL(\"\n        SELECT SUM(precio * cantidad) as total, SUM(precio * iva/100) iva\n        FROM app_ventas_detalle\n        WHERE id_venta = \'$id\' GROUP BY id_venta\n    \")->fetch();\n    $total = $venta[\"total\"] ? $venta[\"total\"] : 0;\n    $iva = $venta[\"iva\"] ? $venta[\"iva\"] : 0;\n    PCO_EjecutarSQLUnaria(\"UPDATE app_ventas SET total = $total, iva = $iva WHERE id = $id \");\n    if($returnArr)\n        return $venta;\n    return \'\"total\": \' . $total . \', \"iva\": \' . $iva;\n}\n\nif($PCO_Accion == \"VENTA_ingresarRealizarVenta\") {\n    $ventaAbierta = PCO_EjecutarSQL(\"\n        SELECT id, id_cliente, total, iva\n        FROM app_ventas\n        WHERE estado = 0 ORDER BY id limit 1\n    \")->fetch();\n    /*if (!$ventaAbierta[\"id\"]) {\n        \n        $ventaAbierta = PCO_EjecutarSQL(\"\n            SELECT *\n            FROM app_ventas\n            WHERE estado = 0 ORDER BY id limit 1\n        \")->fetch();   \n    }*/\n\n    $id_venta = $ventaAbierta[\"id\"] ? $ventaAbierta[\"id\"] : \"\";\n    if($id_venta) {\n        $total = number_format($ventaAbierta[\"total\"], 2);\n        $iva = number_format($ventaAbierta[\"iva\"], 2);\n        $id_cliente = $ventaAbierta[\"id_cliente\"];\n    }\n\n    PCO_CargarFormulario(8, 1, \"id\", $id_venta);\n}\n\nif($PCO_Accion == \"VENTA_agregarProductoCrearOC\") {\n\n    if(!$id) {\n        //crear cliente en caso de que no llegue id_cliente\n        if(!$id_cliente) {\n            PCO_EjecutarSQLUnaria(\"INSERT INTO app_clientes (nombre_completo, numero_documento, telefono) VALUES (?,?,?) \",\n                \"$nombre_completo$_SeparadorCampos_$numero_documento$_SeparadorCampos_$telefono\"\n            );\n            $id_cliente = PCO_ObtenerUltimoIDInsertado();\n        }\n        PCO_EjecutarSQLUnaria(\"INSERT INTO app_ventas (id_cliente, usuario) VALUES (?,?) \", \"$id_cliente$_SeparadorCampos_$PCOSESS_LoginUsuario\");\n        $id = PCO_ObtenerUltimoIDInsertado();\n    }\n    $producto = PCO_EjecutarSQL(\"\n        SELECT id, precio_venta, iva, inventario\n        FROM app_productos\n        WHERE id = \'$id_producto\'\n    \")->fetch();\n    if($producto[\"id\"]) {\n        $existe = PCO_EjecutarSQL(\"\n            SELECT count(id)\n            FROM app_ventas_detalle\n            WHERE id_venta = $id AND id_producto = \'$id_producto\'\n        \")->fetchColumn();\n        if($existe > 0) {\n            print_r(\'{\"success\": false, \"msg\": \"El producto ya se ha ingresado\"}\');\n            die();\n        }\n        if($producto[\"inventario\"] < $cantidad) {\n            print_r(\'{\"success\": false, \"msg\": \"La cantidad digitada supera la del invetario\"}\');\n            die();\n        }\n        $inventarioNew = $producto[\"inventario\"] - $cantidad;\n        PCO_EjecutarSQLUnaria(\"UPDATE app_productos SET inventario = $inventarioNew WHERE id = \" . $producto[\"id\"]);\n        PCO_EjecutarSQLUnaria(\"INSERT INTO app_ventas_detalle (id_venta, id_producto, cantidad, precio, iva) VALUES (?,?,?,?,?) \", \n            \"$id$_SeparadorCampos_$id_producto$_SeparadorCampos_$cantidad$_SeparadorCampos_\" . $producto[\"precio_venta\"] . \"$_SeparadorCampos_\" . $producto[\"iva\"]);\n        $result = calcularTotalVenta($id, 1);\n        \n        $total = number_format($result[\"total\"], 2);\n        $iva = number_format($result[\"iva\"], 2);\n        PCO_CargarFormulario(8, 1, \"id\", $id);\n    }\n}\n\nif($PCO_Accion == \"VENTA_agregarProducto\") {\n\n    if(!$id) {\n        //crear cliente en caso de que no llegue id_cliente\n        if(!$id_cliente) {\n            PCO_EjecutarSQLUnaria(\"INSERT INTO app_clientes (nombre_completo, numero_documento, telefono) VALUES (?,?,?) \",\n                \"$nombre_completo$_SeparadorCampos_$numero_documento$_SeparadorCampos_$telefono\"\n            );\n            $id_cliente = PCO_ObtenerUltimoIDInsertado();\n        }\n        PCO_EjecutarSQLUnaria(\"INSERT INTO app_ventas (id_cliente, usuario) VALUES (?,?) \", \"$id_cliente$_SeparadorCampos_$PCOSESS_LoginUsuario\");\n        $id = PCO_ObtenerUltimoIDInsertado();\n    }\n    $producto = PCO_EjecutarSQL(\"\n        SELECT id, precio_venta, iva, inventario\n        FROM app_productos\n        WHERE id = \'$id_producto\'\n    \")->fetch();\n    if($producto[\"id\"]) {\n        $existe = PCO_EjecutarSQL(\"\n            SELECT count(id)\n            FROM app_ventas_detalle\n            WHERE id_venta = $id AND id_producto = \'$id_producto\'\n        \")->fetchColumn();\n        if($existe > 0) {\n            print_r(\'{\"success\": false, \"msg\": \"El producto ya se ha ingresado\"}\');\n            die();\n        }\n        if($producto[\"inventario\"] < $cantidad) {\n            print_r(\'{\"success\": false, \"msg\": \"La cantidad digitada supera la del invetario\"}\');\n            die();\n        }\n        $inventarioNew = $producto[\"inventario\"] - $cantidad;\n        PCO_EjecutarSQLUnaria(\"UPDATE app_productos SET inventario = $inventarioNew WHERE id = \" . $producto[\"id\"]);\n        PCO_EjecutarSQLUnaria(\"INSERT INTO app_ventas_detalle (id_venta, id_producto, cantidad, precio, iva) VALUES (?,?,?,?,?) \", \n            \"$id$_SeparadorCampos_$id_producto$_SeparadorCampos_$cantidad$_SeparadorCampos_\" . $producto[\"precio_venta\"] . \"$_SeparadorCampos_\" . $producto[\"iva\"]);\n        $result = calcularTotalVenta($id);\n        print_r(\'{\"success\": true, \"id\": \' . $id . \', \' . $result . \'}\');\n        die();\n    }\n    print_r(\'{\"success\": false, \"msg\": \"No se ha encontrado el producto seleccionado\"}\');\n    die();\n}\n\nif($PCO_Accion == \"VENTA_eliminarProducto\") {\n\n    if($id_venta_detalle && $id_venta) {\n        $producto = PCO_EjecutarSQL(\"\n            SELECT p.inventario, vd.cantidad, p.id\n            FROM app_ventas_detalle vd, app_productos p\n            WHERE vd.id_producto = p.id AND vd.id = \'$id_venta_detalle\'\n        \")->fetch();\n        //Restablecemos el inventario\n        $inventarioNew = $producto[\"inventario\"] + $producto[\"cantidad\"];\n        PCO_EjecutarSQLUnaria(\"UPDATE app_productos SET inventario = $inventarioNew WHERE id = \" . $producto[\"id\"]);\n        PCO_EjecutarSQLUnaria(\"DELETE FROM app_ventas_detalle WHERE id_venta = $id_venta AND id = $id_venta_detalle\");\n        $result = calcularTotalVenta($id_venta);\n        print_r(\'{\"success\": true, \"msg\": \"Se ha eliminado el producto exitosamente\", \' . $result . \'}\');\n        die();\n    }\n    print_r(\'{\"success\": false, \"msg\": \"No se pudo eliminar el producto\"}\');\n    die();\n}\n\nif($PCO_Accion == \"VENTA_imprimirFactura\") {\n\n    //sleep(2);\n    // echo \"$PCO_Valor\";\n    if($PCO_Valor)\n        $id = $PCO_Valor;\n    if($id) {\n        include_once \"imprimirFactura.php\";\n    }\n}','A'),(294,'/var/www/html/company/Ventaspos/mod/app_ventas/index.php','2022-06-05 21:18:00','rafael',160,6569,'<?php\n\nfunction calcularTotalVenta($id, $returnArr = \"\") {\n    $venta = PCO_EjecutarSQL(\"\n        SELECT SUM(precio * cantidad) as total, SUM(precio * iva/100) iva\n        FROM app_ventas_detalle\n        WHERE id_venta = \'$id\' GROUP BY id_venta\n    \")->fetch();\n    $total = $venta[\"total\"] ? $venta[\"total\"] : 0;\n    $iva = $venta[\"iva\"] ? $venta[\"iva\"] : 0;\n    PCO_EjecutarSQLUnaria(\"UPDATE app_ventas SET total = $total, iva = $iva WHERE id = $id \");\n    if($returnArr)\n        return $venta;\n    return \'\"total\": \' . $total . \', \"iva\": \' . $iva;\n}\n\nif($PCO_Accion == \"VENTA_ingresarRealizarVenta\") {\n    $ventaAbierta = PCO_EjecutarSQL(\"\n        SELECT id, id_cliente, total, iva\n        FROM app_ventas\n        WHERE estado = 0 ORDER BY id limit 1\n    \")->fetch();\n    /*if (!$ventaAbierta[\"id\"]) {\n        \n        $ventaAbierta = PCO_EjecutarSQL(\"\n            SELECT *\n            FROM app_ventas\n            WHERE estado = 0 ORDER BY id limit 1\n        \")->fetch();   \n    }*/\n\n    $id_venta = $ventaAbierta[\"id\"] ? $ventaAbierta[\"id\"] : \"\";\n    if($id_venta) {\n        $total = number_format($ventaAbierta[\"total\"], 2);\n        $iva = number_format($ventaAbierta[\"iva\"], 2);\n        $id_cliente = $ventaAbierta[\"id_cliente\"];\n    }\n\n    PCO_CargarFormulario(8, 1, \"id\", $id_venta);\n}\n\nif($PCO_Accion == \"VENTA_agregarProductoCrearOC\") {\necho \"Hola |$id|\";\ndie();\n    if(!$id) {\n        //crear cliente en caso de que no llegue id_cliente\n        if(!$id_cliente) {\n            PCO_EjecutarSQLUnaria(\"INSERT INTO app_clientes (nombre_completo, numero_documento, telefono) VALUES (?,?,?) \",\n                \"$nombre_completo$_SeparadorCampos_$numero_documento$_SeparadorCampos_$telefono\"\n            );\n            $id_cliente = PCO_ObtenerUltimoIDInsertado();\n        }\n        PCO_EjecutarSQLUnaria(\"INSERT INTO app_ventas (id_cliente, usuario) VALUES (?,?) \", \"$id_cliente$_SeparadorCampos_$PCOSESS_LoginUsuario\");\n        $id = PCO_ObtenerUltimoIDInsertado();\n    }\n    $producto = PCO_EjecutarSQL(\"\n        SELECT id, precio_venta, iva, inventario\n        FROM app_productos\n        WHERE id = \'$id_producto\'\n    \")->fetch();\n    if($producto[\"id\"]) {\n        $existe = PCO_EjecutarSQL(\"\n            SELECT count(id)\n            FROM app_ventas_detalle\n            WHERE id_venta = $id AND id_producto = \'$id_producto\'\n        \")->fetchColumn();\n        if($existe > 0) {\n            print_r(\'{\"success\": false, \"msg\": \"El producto ya se ha ingresado\"}\');\n            die();\n        }\n        if($producto[\"inventario\"] < $cantidad) {\n            print_r(\'{\"success\": false, \"msg\": \"La cantidad digitada supera la del invetario\"}\');\n            die();\n        }\n        $inventarioNew = $producto[\"inventario\"] - $cantidad;\n        PCO_EjecutarSQLUnaria(\"UPDATE app_productos SET inventario = $inventarioNew WHERE id = \" . $producto[\"id\"]);\n        PCO_EjecutarSQLUnaria(\"INSERT INTO app_ventas_detalle (id_venta, id_producto, cantidad, precio, iva) VALUES (?,?,?,?,?) \", \n            \"$id$_SeparadorCampos_$id_producto$_SeparadorCampos_$cantidad$_SeparadorCampos_\" . $producto[\"precio_venta\"] . \"$_SeparadorCampos_\" . $producto[\"iva\"]);\n        $result = calcularTotalVenta($id, 1);\n        \n        $total = number_format($result[\"total\"], 2);\n        $iva = number_format($result[\"iva\"], 2);\n        PCO_CargarFormulario(8, 1, \"id\", $id);\n    }\n}\n\nif($PCO_Accion == \"VENTA_agregarProducto\") {\n\n    if(!$id) {\n        //crear cliente en caso de que no llegue id_cliente\n        if(!$id_cliente) {\n            PCO_EjecutarSQLUnaria(\"INSERT INTO app_clientes (nombre_completo, numero_documento, telefono) VALUES (?,?,?) \",\n                \"$nombre_completo$_SeparadorCampos_$numero_documento$_SeparadorCampos_$telefono\"\n            );\n            $id_cliente = PCO_ObtenerUltimoIDInsertado();\n        }\n        PCO_EjecutarSQLUnaria(\"INSERT INTO app_ventas (id_cliente, usuario) VALUES (?,?) \", \"$id_cliente$_SeparadorCampos_$PCOSESS_LoginUsuario\");\n        $id = PCO_ObtenerUltimoIDInsertado();\n    }\n    $producto = PCO_EjecutarSQL(\"\n        SELECT id, precio_venta, iva, inventario\n        FROM app_productos\n        WHERE id = \'$id_producto\'\n    \")->fetch();\n    if($producto[\"id\"]) {\n        $existe = PCO_EjecutarSQL(\"\n            SELECT count(id)\n            FROM app_ventas_detalle\n            WHERE id_venta = $id AND id_producto = \'$id_producto\'\n        \")->fetchColumn();\n        if($existe > 0) {\n            print_r(\'{\"success\": false, \"msg\": \"El producto ya se ha ingresado\"}\');\n            die();\n        }\n        if($producto[\"inventario\"] < $cantidad) {\n            print_r(\'{\"success\": false, \"msg\": \"La cantidad digitada supera la del invetario\"}\');\n            die();\n        }\n        $inventarioNew = $producto[\"inventario\"] - $cantidad;\n        PCO_EjecutarSQLUnaria(\"UPDATE app_productos SET inventario = $inventarioNew WHERE id = \" . $producto[\"id\"]);\n        PCO_EjecutarSQLUnaria(\"INSERT INTO app_ventas_detalle (id_venta, id_producto, cantidad, precio, iva) VALUES (?,?,?,?,?) \", \n            \"$id$_SeparadorCampos_$id_producto$_SeparadorCampos_$cantidad$_SeparadorCampos_\" . $producto[\"precio_venta\"] . \"$_SeparadorCampos_\" . $producto[\"iva\"]);\n        $result = calcularTotalVenta($id);\n        print_r(\'{\"success\": true, \"id\": \' . $id . \', \' . $result . \'}\');\n        die();\n    }\n    print_r(\'{\"success\": false, \"msg\": \"No se ha encontrado el producto seleccionado\"}\');\n    die();\n}\n\nif($PCO_Accion == \"VENTA_eliminarProducto\") {\n\n    if($id_venta_detalle && $id_venta) {\n        $producto = PCO_EjecutarSQL(\"\n            SELECT p.inventario, vd.cantidad, p.id\n            FROM app_ventas_detalle vd, app_productos p\n            WHERE vd.id_producto = p.id AND vd.id = \'$id_venta_detalle\'\n        \")->fetch();\n        //Restablecemos el inventario\n        $inventarioNew = $producto[\"inventario\"] + $producto[\"cantidad\"];\n        PCO_EjecutarSQLUnaria(\"UPDATE app_productos SET inventario = $inventarioNew WHERE id = \" . $producto[\"id\"]);\n        PCO_EjecutarSQLUnaria(\"DELETE FROM app_ventas_detalle WHERE id_venta = $id_venta AND id = $id_venta_detalle\");\n        $result = calcularTotalVenta($id_venta);\n        print_r(\'{\"success\": true, \"msg\": \"Se ha eliminado el producto exitosamente\", \' . $result . \'}\');\n        die();\n    }\n    print_r(\'{\"success\": false, \"msg\": \"No se pudo eliminar el producto\"}\');\n    die();\n}\n\nif($PCO_Accion == \"VENTA_imprimirFactura\") {\n\n    //sleep(2);\n    // echo \"$PCO_Valor\";\n    if($PCO_Valor)\n        $id = $PCO_Valor;\n    if($id) {\n        include_once \"imprimirFactura.php\";\n    }\n}','A'),(295,'/var/www/html/company/Ventaspos/mod/app_ventas/index.php','2022-06-05 21:19:00','rafael',161,6578,'<?php\n\nfunction calcularTotalVenta($id, $returnArr = \"\") {\n    $venta = PCO_EjecutarSQL(\"\n        SELECT SUM(precio * cantidad) as total, SUM(precio * iva/100) iva\n        FROM app_ventas_detalle\n        WHERE id_venta = \'$id\' GROUP BY id_venta\n    \")->fetch();\n    $total = $venta[\"total\"] ? $venta[\"total\"] : 0;\n    $iva = $venta[\"iva\"] ? $venta[\"iva\"] : 0;\n    PCO_EjecutarSQLUnaria(\"UPDATE app_ventas SET total = $total, iva = $iva WHERE id = $id \");\n    if($returnArr)\n        return $venta;\n    return \'\"total\": \' . $total . \', \"iva\": \' . $iva;\n}\n\nif($PCO_Accion == \"VENTA_ingresarRealizarVenta\") {\n    $ventaAbierta = PCO_EjecutarSQL(\"\n        SELECT id, id_cliente, total, iva\n        FROM app_ventas\n        WHERE estado = 0 ORDER BY id limit 1\n    \")->fetch();\n    /*if (!$ventaAbierta[\"id\"]) {\n        \n        $ventaAbierta = PCO_EjecutarSQL(\"\n            SELECT *\n            FROM app_ventas\n            WHERE estado = 0 ORDER BY id limit 1\n        \")->fetch();   \n    }*/\n\n    $id_venta = $ventaAbierta[\"id\"] ? $ventaAbierta[\"id\"] : \"\";\n    if($id_venta) {\n        $total = number_format($ventaAbierta[\"total\"], 2);\n        $iva = number_format($ventaAbierta[\"iva\"], 2);\n        $id_cliente = $ventaAbierta[\"id_cliente\"];\n    }\n\n    PCO_CargarFormulario(8, 1, \"id\", $id_venta);\n}\n\nif($PCO_Accion == \"VENTA_agregarProductoCrearOC\") {\n\n    if(!$id) {\n        echo \"Hola |$id|\";\ndie();\n        //crear cliente en caso de que no llegue id_cliente\n        if(!$id_cliente) {\n            PCO_EjecutarSQLUnaria(\"INSERT INTO app_clientes (nombre_completo, numero_documento, telefono) VALUES (?,?,?) \",\n                \"$nombre_completo$_SeparadorCampos_$numero_documento$_SeparadorCampos_$telefono\"\n            );\n            $id_cliente = PCO_ObtenerUltimoIDInsertado();\n        }\n        PCO_EjecutarSQLUnaria(\"INSERT INTO app_ventas (id_cliente, usuario) VALUES (?,?) \", \"$id_cliente$_SeparadorCampos_$PCOSESS_LoginUsuario\");\n        $id = PCO_ObtenerUltimoIDInsertado();\n    }\n    $producto = PCO_EjecutarSQL(\"\n        SELECT id, precio_venta, iva, inventario\n        FROM app_productos\n        WHERE id = \'$id_producto\'\n    \")->fetch();\n    if($producto[\"id\"]) {\n        $existe = PCO_EjecutarSQL(\"\n            SELECT count(id)\n            FROM app_ventas_detalle\n            WHERE id_venta = $id AND id_producto = \'$id_producto\'\n        \")->fetchColumn();\n        if($existe > 0) {\n            print_r(\'{\"success\": false, \"msg\": \"El producto ya se ha ingresado\"}\');\n            die();\n        }\n        if($producto[\"inventario\"] < $cantidad) {\n            print_r(\'{\"success\": false, \"msg\": \"La cantidad digitada supera la del invetario\"}\');\n            die();\n        }\n        $inventarioNew = $producto[\"inventario\"] - $cantidad;\n        PCO_EjecutarSQLUnaria(\"UPDATE app_productos SET inventario = $inventarioNew WHERE id = \" . $producto[\"id\"]);\n        PCO_EjecutarSQLUnaria(\"INSERT INTO app_ventas_detalle (id_venta, id_producto, cantidad, precio, iva) VALUES (?,?,?,?,?) \", \n            \"$id$_SeparadorCampos_$id_producto$_SeparadorCampos_$cantidad$_SeparadorCampos_\" . $producto[\"precio_venta\"] . \"$_SeparadorCampos_\" . $producto[\"iva\"]);\n        $result = calcularTotalVenta($id, 1);\n        \n        $total = number_format($result[\"total\"], 2);\n        $iva = number_format($result[\"iva\"], 2);\n        PCO_CargarFormulario(8, 1, \"id\", $id);\n    }\n}\n\nif($PCO_Accion == \"VENTA_agregarProducto\") {\n\n    if(!$id) {\n        //crear cliente en caso de que no llegue id_cliente\n        if(!$id_cliente) {\n            PCO_EjecutarSQLUnaria(\"INSERT INTO app_clientes (nombre_completo, numero_documento, telefono) VALUES (?,?,?) \",\n                \"$nombre_completo$_SeparadorCampos_$numero_documento$_SeparadorCampos_$telefono\"\n            );\n            $id_cliente = PCO_ObtenerUltimoIDInsertado();\n        }\n        PCO_EjecutarSQLUnaria(\"INSERT INTO app_ventas (id_cliente, usuario) VALUES (?,?) \", \"$id_cliente$_SeparadorCampos_$PCOSESS_LoginUsuario\");\n        $id = PCO_ObtenerUltimoIDInsertado();\n    }\n    $producto = PCO_EjecutarSQL(\"\n        SELECT id, precio_venta, iva, inventario\n        FROM app_productos\n        WHERE id = \'$id_producto\'\n    \")->fetch();\n    if($producto[\"id\"]) {\n        $existe = PCO_EjecutarSQL(\"\n            SELECT count(id)\n            FROM app_ventas_detalle\n            WHERE id_venta = $id AND id_producto = \'$id_producto\'\n        \")->fetchColumn();\n        if($existe > 0) {\n            print_r(\'{\"success\": false, \"msg\": \"El producto ya se ha ingresado\"}\');\n            die();\n        }\n        if($producto[\"inventario\"] < $cantidad) {\n            print_r(\'{\"success\": false, \"msg\": \"La cantidad digitada supera la del invetario\"}\');\n            die();\n        }\n        $inventarioNew = $producto[\"inventario\"] - $cantidad;\n        PCO_EjecutarSQLUnaria(\"UPDATE app_productos SET inventario = $inventarioNew WHERE id = \" . $producto[\"id\"]);\n        PCO_EjecutarSQLUnaria(\"INSERT INTO app_ventas_detalle (id_venta, id_producto, cantidad, precio, iva) VALUES (?,?,?,?,?) \", \n            \"$id$_SeparadorCampos_$id_producto$_SeparadorCampos_$cantidad$_SeparadorCampos_\" . $producto[\"precio_venta\"] . \"$_SeparadorCampos_\" . $producto[\"iva\"]);\n        $result = calcularTotalVenta($id);\n        print_r(\'{\"success\": true, \"id\": \' . $id . \', \' . $result . \'}\');\n        die();\n    }\n    print_r(\'{\"success\": false, \"msg\": \"No se ha encontrado el producto seleccionado\"}\');\n    die();\n}\n\nif($PCO_Accion == \"VENTA_eliminarProducto\") {\n\n    if($id_venta_detalle && $id_venta) {\n        $producto = PCO_EjecutarSQL(\"\n            SELECT p.inventario, vd.cantidad, p.id\n            FROM app_ventas_detalle vd, app_productos p\n            WHERE vd.id_producto = p.id AND vd.id = \'$id_venta_detalle\'\n        \")->fetch();\n        //Restablecemos el inventario\n        $inventarioNew = $producto[\"inventario\"] + $producto[\"cantidad\"];\n        PCO_EjecutarSQLUnaria(\"UPDATE app_productos SET inventario = $inventarioNew WHERE id = \" . $producto[\"id\"]);\n        PCO_EjecutarSQLUnaria(\"DELETE FROM app_ventas_detalle WHERE id_venta = $id_venta AND id = $id_venta_detalle\");\n        $result = calcularTotalVenta($id_venta);\n        print_r(\'{\"success\": true, \"msg\": \"Se ha eliminado el producto exitosamente\", \' . $result . \'}\');\n        die();\n    }\n    print_r(\'{\"success\": false, \"msg\": \"No se pudo eliminar el producto\"}\');\n    die();\n}\n\nif($PCO_Accion == \"VENTA_imprimirFactura\") {\n\n    //sleep(2);\n    // echo \"$PCO_Valor\";\n    if($PCO_Valor)\n        $id = $PCO_Valor;\n    if($id) {\n        include_once \"imprimirFactura.php\";\n    }\n}','A'),(296,'/var/www/html/company/Ventaspos/mod/app_ventas/index.php','2022-06-05 21:20:00','rafael',159,6544,'<?php\n\nfunction calcularTotalVenta($id, $returnArr = \"\") {\n    $venta = PCO_EjecutarSQL(\"\n        SELECT SUM(precio * cantidad) as total, SUM(precio * iva/100) iva\n        FROM app_ventas_detalle\n        WHERE id_venta = \'$id\' GROUP BY id_venta\n    \")->fetch();\n    $total = $venta[\"total\"] ? $venta[\"total\"] : 0;\n    $iva = $venta[\"iva\"] ? $venta[\"iva\"] : 0;\n    PCO_EjecutarSQLUnaria(\"UPDATE app_ventas SET total = $total, iva = $iva WHERE id = $id \");\n    if($returnArr)\n        return $venta;\n    return \'\"total\": \' . $total . \', \"iva\": \' . $iva;\n}\n\nif($PCO_Accion == \"VENTA_ingresarRealizarVenta\") {\n    $ventaAbierta = PCO_EjecutarSQL(\"\n        SELECT id, id_cliente, total, iva\n        FROM app_ventas\n        WHERE estado = 0 ORDER BY id limit 1\n    \")->fetch();\n    /*if (!$ventaAbierta[\"id\"]) {\n        \n        $ventaAbierta = PCO_EjecutarSQL(\"\n            SELECT *\n            FROM app_ventas\n            WHERE estado = 0 ORDER BY id limit 1\n        \")->fetch();   \n    }*/\n\n    $id_venta = $ventaAbierta[\"id\"] ? $ventaAbierta[\"id\"] : \"\";\n    if($id_venta) {\n        $total = number_format($ventaAbierta[\"total\"], 2);\n        $iva = number_format($ventaAbierta[\"iva\"], 2);\n        $id_cliente = $ventaAbierta[\"id_cliente\"];\n    }\n\n    PCO_CargarFormulario(8, 1, \"id\", $id_venta);\n}\n\nif($PCO_Accion == \"VENTA_agregarProductoCrearOC\") {\n\n    if(!$id) {\n        //crear cliente en caso de que no llegue id_cliente\n        if(!$id_cliente) {\n            PCO_EjecutarSQLUnaria(\"INSERT INTO app_clientes (nombre_completo, numero_documento, telefono) VALUES (?,?,?) \",\n                \"$nombre_completo$_SeparadorCampos_$numero_documento$_SeparadorCampos_$telefono\"\n            );\n            $id_cliente = PCO_ObtenerUltimoIDInsertado();\n        }\n        PCO_EjecutarSQLUnaria(\"INSERT INTO app_ventas (id_cliente, usuario) VALUES (?,?) \", \"$id_cliente$_SeparadorCampos_$PCOSESS_LoginUsuario\");\n        $id = PCO_ObtenerUltimoIDInsertado();\n    }\n    $producto = PCO_EjecutarSQL(\"\n        SELECT id, precio_venta, iva, inventario\n        FROM app_productos\n        WHERE id = \'$id_producto\'\n    \")->fetch();\n    if($producto[\"id\"]) {\n        $existe = PCO_EjecutarSQL(\"\n            SELECT count(id)\n            FROM app_ventas_detalle\n            WHERE id_venta = $id AND id_producto = \'$id_producto\'\n        \")->fetchColumn();\n        if($existe > 0) {\n            print_r(\'{\"success\": false, \"msg\": \"El producto ya se ha ingresado\"}\');\n            die();\n        }\n        if($producto[\"inventario\"] < $cantidad) {\n            print_r(\'{\"success\": false, \"msg\": \"La cantidad digitada supera la del invetario\"}\');\n            die();\n        }\n        $inventarioNew = $producto[\"inventario\"] - $cantidad;\n        PCO_EjecutarSQLUnaria(\"UPDATE app_productos SET inventario = $inventarioNew WHERE id = \" . $producto[\"id\"]);\n        PCO_EjecutarSQLUnaria(\"INSERT INTO app_ventas_detalle (id_venta, id_producto, cantidad, precio, iva) VALUES (?,?,?,?,?) \", \n            \"$id$_SeparadorCampos_$id_producto$_SeparadorCampos_$cantidad$_SeparadorCampos_\" . $producto[\"precio_venta\"] . \"$_SeparadorCampos_\" . $producto[\"iva\"]);\n        $result = calcularTotalVenta($id, 1);\n        \n        $total = number_format($result[\"total\"], 2);\n        $iva = number_format($result[\"iva\"], 2);\n        PCO_CargarFormulario(8, 1, \"id\", $id);\n    }\n}\n\nif($PCO_Accion == \"VENTA_agregarProducto\") {\n\n    if(!$id) {\n        //crear cliente en caso de que no llegue id_cliente\n        if(!$id_cliente) {\n            PCO_EjecutarSQLUnaria(\"INSERT INTO app_clientes (nombre_completo, numero_documento, telefono) VALUES (?,?,?) \",\n                \"$nombre_completo$_SeparadorCampos_$numero_documento$_SeparadorCampos_$telefono\"\n            );\n            $id_cliente = PCO_ObtenerUltimoIDInsertado();\n        }\n        PCO_EjecutarSQLUnaria(\"INSERT INTO app_ventas (id_cliente, usuario) VALUES (?,?) \", \"$id_cliente$_SeparadorCampos_$PCOSESS_LoginUsuario\");\n        $id = PCO_ObtenerUltimoIDInsertado();\n    }\n    $producto = PCO_EjecutarSQL(\"\n        SELECT id, precio_venta, iva, inventario\n        FROM app_productos\n        WHERE id = \'$id_producto\'\n    \")->fetch();\n    if($producto[\"id\"]) {\n        $existe = PCO_EjecutarSQL(\"\n            SELECT count(id)\n            FROM app_ventas_detalle\n            WHERE id_venta = $id AND id_producto = \'$id_producto\'\n        \")->fetchColumn();\n        if($existe > 0) {\n            print_r(\'{\"success\": false, \"msg\": \"El producto ya se ha ingresado\"}\');\n            die();\n        }\n        if($producto[\"inventario\"] < $cantidad) {\n            print_r(\'{\"success\": false, \"msg\": \"La cantidad digitada supera la del invetario\"}\');\n            die();\n        }\n        $inventarioNew = $producto[\"inventario\"] - $cantidad;\n        PCO_EjecutarSQLUnaria(\"UPDATE app_productos SET inventario = $inventarioNew WHERE id = \" . $producto[\"id\"]);\n        PCO_EjecutarSQLUnaria(\"INSERT INTO app_ventas_detalle (id_venta, id_producto, cantidad, precio, iva) VALUES (?,?,?,?,?) \", \n            \"$id$_SeparadorCampos_$id_producto$_SeparadorCampos_$cantidad$_SeparadorCampos_\" . $producto[\"precio_venta\"] . \"$_SeparadorCampos_\" . $producto[\"iva\"]);\n        $result = calcularTotalVenta($id);\n        print_r(\'{\"success\": true, \"id\": \' . $id . \', \' . $result . \'}\');\n        die();\n    }\n    print_r(\'{\"success\": false, \"msg\": \"No se ha encontrado el producto seleccionado\"}\');\n    die();\n}\n\nif($PCO_Accion == \"VENTA_eliminarProducto\") {\n\n    if($id_venta_detalle && $id_venta) {\n        $producto = PCO_EjecutarSQL(\"\n            SELECT p.inventario, vd.cantidad, p.id\n            FROM app_ventas_detalle vd, app_productos p\n            WHERE vd.id_producto = p.id AND vd.id = \'$id_venta_detalle\'\n        \")->fetch();\n        //Restablecemos el inventario\n        $inventarioNew = $producto[\"inventario\"] + $producto[\"cantidad\"];\n        PCO_EjecutarSQLUnaria(\"UPDATE app_productos SET inventario = $inventarioNew WHERE id = \" . $producto[\"id\"]);\n        PCO_EjecutarSQLUnaria(\"DELETE FROM app_ventas_detalle WHERE id_venta = $id_venta AND id = $id_venta_detalle\");\n        $result = calcularTotalVenta($id_venta);\n        print_r(\'{\"success\": true, \"msg\": \"Se ha eliminado el producto exitosamente\", \' . $result . \'}\');\n        die();\n    }\n    print_r(\'{\"success\": false, \"msg\": \"No se pudo eliminar el producto\"}\');\n    die();\n}\n\nif($PCO_Accion == \"VENTA_imprimirFactura\") {\n\n    //sleep(2);\n    // echo \"$PCO_Valor\";\n    if($PCO_Valor)\n        $id = $PCO_Valor;\n    if($id) {\n        include_once \"imprimirFactura.php\";\n    }\n}','A'),(297,'/var/www/html/company/Ventaspos/mod/app_ventas/index.php','2022-06-05 21:20:00','rafael',160,6564,'<?php\n\nfunction calcularTotalVenta($id, $returnArr = \"\") {\n    $venta = PCO_EjecutarSQL(\"\n        SELECT SUM(precio * cantidad) as total, SUM(precio * iva/100) iva\n        FROM app_ventas_detalle\n        WHERE id_venta = \'$id\' GROUP BY id_venta\n    \")->fetch();\n    $total = $venta[\"total\"] ? $venta[\"total\"] : 0;\n    $iva = $venta[\"iva\"] ? $venta[\"iva\"] : 0;\n    PCO_EjecutarSQLUnaria(\"UPDATE app_ventas SET total = $total, iva = $iva WHERE id = $id \");\n    if($returnArr)\n        return $venta;\n    return \'\"total\": \' . $total . \', \"iva\": \' . $iva;\n}\n\nif($PCO_Accion == \"VENTA_ingresarRealizarVenta\") {\n    $ventaAbierta = PCO_EjecutarSQL(\"\n        SELECT id, id_cliente, total, iva\n        FROM app_ventas\n        WHERE estado = 0 ORDER BY id limit 1\n    \")->fetch();\n    /*if (!$ventaAbierta[\"id\"]) {\n        \n        $ventaAbierta = PCO_EjecutarSQL(\"\n            SELECT *\n            FROM app_ventas\n            WHERE estado = 0 ORDER BY id limit 1\n        \")->fetch();   \n    }*/\n\n    $id_venta = $ventaAbierta[\"id\"] ? $ventaAbierta[\"id\"] : \"\";\n    if($id_venta) {\n        $total = number_format($ventaAbierta[\"total\"], 2);\n        $iva = number_format($ventaAbierta[\"iva\"], 2);\n        $id_cliente = $ventaAbierta[\"id_cliente\"];\n    }\n\n    PCO_CargarFormulario(8, 1, \"id\", $id_venta);\n}\n\nif($PCO_Accion == \"VENTA_agregarProductoCrearOC\") {\n\n    if(!$id) {\n        //crear cliente en caso de que no llegue id_cliente\n        if(!$id_cliente) {\n            PCO_EjecutarSQLUnaria(\"INSERT INTO app_clientes (nombre_completo, numero_documento, telefono) VALUES (?,?,?) \",\n                \"$nombre_completo$_SeparadorCampos_$numero_documento$_SeparadorCampos_$telefono\"\n            );\n            $id_cliente = PCO_ObtenerUltimoIDInsertado();\n        }\n        PCO_EjecutarSQLUnaria(\"INSERT INTO app_ventas (id_cliente, usuario) VALUES (?,?) \", \"$id_cliente$_SeparadorCampos_$PCOSESS_LoginUsuario\");\n        $id = PCO_ObtenerUltimoIDInsertado();\n    }\n    $producto = PCO_EjecutarSQL(\"\n        SELECT id, precio_venta, iva, inventario\n        FROM app_productos\n        WHERE id = \'$id_producto\'\n    \")->fetch();\n    if($producto[\"id\"]) {\n        $existe = PCO_EjecutarSQL(\"\n            SELECT count(id)\n            FROM app_ventas_detalle\n            WHERE id_venta = $id AND id_producto = \'$id_producto\'\n        \")->fetchColumn();\n        if($existe > 0) {\n            print_r(\'{\"success\": false, \"msg\": \"El producto ya se ha ingresado\"}\');\n            die();\n        }\n        if($producto[\"inventario\"] < $cantidad) {\n            print_r(\'{\"success\": false, \"msg\": \"La cantidad digitada supera la del invetario\"}\');\n            die();\n        }\n        $inventarioNew = $producto[\"inventario\"] - $cantidad;\n        PCO_EjecutarSQLUnaria(\"UPDATE app_productos SET inventario = $inventarioNew WHERE id = \" . $producto[\"id\"]);\n        PCO_EjecutarSQLUnaria(\"INSERT INTO app_ventas_detalle (id_venta, id_producto, cantidad, precio, iva) VALUES (?,?,?,?,?) \", \n            \"$id$_SeparadorCampos_$id_producto$_SeparadorCampos_$cantidad$_SeparadorCampos_\" . $producto[\"precio_venta\"] . \"$_SeparadorCampos_\" . $producto[\"iva\"]);\n        $result = calcularTotalVenta($id, 1);\n        \n        $total = number_format($result[\"total\"], 2);\n        $iva = number_format($result[\"iva\"], 2);\n        echo \"$Id\";\n        PCO_CargarFormulario(8, 1, \"id\", $id);\n    }\n}\n\nif($PCO_Accion == \"VENTA_agregarProducto\") {\n\n    if(!$id) {\n        //crear cliente en caso de que no llegue id_cliente\n        if(!$id_cliente) {\n            PCO_EjecutarSQLUnaria(\"INSERT INTO app_clientes (nombre_completo, numero_documento, telefono) VALUES (?,?,?) \",\n                \"$nombre_completo$_SeparadorCampos_$numero_documento$_SeparadorCampos_$telefono\"\n            );\n            $id_cliente = PCO_ObtenerUltimoIDInsertado();\n        }\n        PCO_EjecutarSQLUnaria(\"INSERT INTO app_ventas (id_cliente, usuario) VALUES (?,?) \", \"$id_cliente$_SeparadorCampos_$PCOSESS_LoginUsuario\");\n        $id = PCO_ObtenerUltimoIDInsertado();\n    }\n    $producto = PCO_EjecutarSQL(\"\n        SELECT id, precio_venta, iva, inventario\n        FROM app_productos\n        WHERE id = \'$id_producto\'\n    \")->fetch();\n    if($producto[\"id\"]) {\n        $existe = PCO_EjecutarSQL(\"\n            SELECT count(id)\n            FROM app_ventas_detalle\n            WHERE id_venta = $id AND id_producto = \'$id_producto\'\n        \")->fetchColumn();\n        if($existe > 0) {\n            print_r(\'{\"success\": false, \"msg\": \"El producto ya se ha ingresado\"}\');\n            die();\n        }\n        if($producto[\"inventario\"] < $cantidad) {\n            print_r(\'{\"success\": false, \"msg\": \"La cantidad digitada supera la del invetario\"}\');\n            die();\n        }\n        $inventarioNew = $producto[\"inventario\"] - $cantidad;\n        PCO_EjecutarSQLUnaria(\"UPDATE app_productos SET inventario = $inventarioNew WHERE id = \" . $producto[\"id\"]);\n        PCO_EjecutarSQLUnaria(\"INSERT INTO app_ventas_detalle (id_venta, id_producto, cantidad, precio, iva) VALUES (?,?,?,?,?) \", \n            \"$id$_SeparadorCampos_$id_producto$_SeparadorCampos_$cantidad$_SeparadorCampos_\" . $producto[\"precio_venta\"] . \"$_SeparadorCampos_\" . $producto[\"iva\"]);\n        $result = calcularTotalVenta($id);\n        print_r(\'{\"success\": true, \"id\": \' . $id . \', \' . $result . \'}\');\n        die();\n    }\n    print_r(\'{\"success\": false, \"msg\": \"No se ha encontrado el producto seleccionado\"}\');\n    die();\n}\n\nif($PCO_Accion == \"VENTA_eliminarProducto\") {\n\n    if($id_venta_detalle && $id_venta) {\n        $producto = PCO_EjecutarSQL(\"\n            SELECT p.inventario, vd.cantidad, p.id\n            FROM app_ventas_detalle vd, app_productos p\n            WHERE vd.id_producto = p.id AND vd.id = \'$id_venta_detalle\'\n        \")->fetch();\n        //Restablecemos el inventario\n        $inventarioNew = $producto[\"inventario\"] + $producto[\"cantidad\"];\n        PCO_EjecutarSQLUnaria(\"UPDATE app_productos SET inventario = $inventarioNew WHERE id = \" . $producto[\"id\"]);\n        PCO_EjecutarSQLUnaria(\"DELETE FROM app_ventas_detalle WHERE id_venta = $id_venta AND id = $id_venta_detalle\");\n        $result = calcularTotalVenta($id_venta);\n        print_r(\'{\"success\": true, \"msg\": \"Se ha eliminado el producto exitosamente\", \' . $result . \'}\');\n        die();\n    }\n    print_r(\'{\"success\": false, \"msg\": \"No se pudo eliminar el producto\"}\');\n    die();\n}\n\nif($PCO_Accion == \"VENTA_imprimirFactura\") {\n\n    //sleep(2);\n    // echo \"$PCO_Valor\";\n    if($PCO_Valor)\n        $id = $PCO_Valor;\n    if($id) {\n        include_once \"imprimirFactura.php\";\n    }\n}','A'),(298,'/var/www/html/company/Ventaspos/mod/app_ventas/index.php','2022-06-05 21:20:00','rafael',160,6564,'<?php\n\nfunction calcularTotalVenta($id, $returnArr = \"\") {\n    $venta = PCO_EjecutarSQL(\"\n        SELECT SUM(precio * cantidad) as total, SUM(precio * iva/100) iva\n        FROM app_ventas_detalle\n        WHERE id_venta = \'$id\' GROUP BY id_venta\n    \")->fetch();\n    $total = $venta[\"total\"] ? $venta[\"total\"] : 0;\n    $iva = $venta[\"iva\"] ? $venta[\"iva\"] : 0;\n    PCO_EjecutarSQLUnaria(\"UPDATE app_ventas SET total = $total, iva = $iva WHERE id = $id \");\n    if($returnArr)\n        return $venta;\n    return \'\"total\": \' . $total . \', \"iva\": \' . $iva;\n}\n\nif($PCO_Accion == \"VENTA_ingresarRealizarVenta\") {\n    $ventaAbierta = PCO_EjecutarSQL(\"\n        SELECT id, id_cliente, total, iva\n        FROM app_ventas\n        WHERE estado = 0 ORDER BY id limit 1\n    \")->fetch();\n    /*if (!$ventaAbierta[\"id\"]) {\n        \n        $ventaAbierta = PCO_EjecutarSQL(\"\n            SELECT *\n            FROM app_ventas\n            WHERE estado = 0 ORDER BY id limit 1\n        \")->fetch();   \n    }*/\n\n    $id_venta = $ventaAbierta[\"id\"] ? $ventaAbierta[\"id\"] : \"\";\n    if($id_venta) {\n        $total = number_format($ventaAbierta[\"total\"], 2);\n        $iva = number_format($ventaAbierta[\"iva\"], 2);\n        $id_cliente = $ventaAbierta[\"id_cliente\"];\n    }\n\n    PCO_CargarFormulario(8, 1, \"id\", $id_venta);\n}\n\nif($PCO_Accion == \"VENTA_agregarProductoCrearOC\") {\n\n    if(!$id) {\n        //crear cliente en caso de que no llegue id_cliente\n        if(!$id_cliente) {\n            PCO_EjecutarSQLUnaria(\"INSERT INTO app_clientes (nombre_completo, numero_documento, telefono) VALUES (?,?,?) \",\n                \"$nombre_completo$_SeparadorCampos_$numero_documento$_SeparadorCampos_$telefono\"\n            );\n            $id_cliente = PCO_ObtenerUltimoIDInsertado();\n        }\n        PCO_EjecutarSQLUnaria(\"INSERT INTO app_ventas (id_cliente, usuario) VALUES (?,?) \", \"$id_cliente$_SeparadorCampos_$PCOSESS_LoginUsuario\");\n        $id = PCO_ObtenerUltimoIDInsertado();\n    }\n    $producto = PCO_EjecutarSQL(\"\n        SELECT id, precio_venta, iva, inventario\n        FROM app_productos\n        WHERE id = \'$id_producto\'\n    \")->fetch();\n    if($producto[\"id\"]) {\n        $existe = PCO_EjecutarSQL(\"\n            SELECT count(id)\n            FROM app_ventas_detalle\n            WHERE id_venta = $id AND id_producto = \'$id_producto\'\n        \")->fetchColumn();\n        if($existe > 0) {\n            print_r(\'{\"success\": false, \"msg\": \"El producto ya se ha ingresado\"}\');\n            die();\n        }\n        if($producto[\"inventario\"] < $cantidad) {\n            print_r(\'{\"success\": false, \"msg\": \"La cantidad digitada supera la del invetario\"}\');\n            die();\n        }\n        $inventarioNew = $producto[\"inventario\"] - $cantidad;\n        PCO_EjecutarSQLUnaria(\"UPDATE app_productos SET inventario = $inventarioNew WHERE id = \" . $producto[\"id\"]);\n        PCO_EjecutarSQLUnaria(\"INSERT INTO app_ventas_detalle (id_venta, id_producto, cantidad, precio, iva) VALUES (?,?,?,?,?) \", \n            \"$id$_SeparadorCampos_$id_producto$_SeparadorCampos_$cantidad$_SeparadorCampos_\" . $producto[\"precio_venta\"] . \"$_SeparadorCampos_\" . $producto[\"iva\"]);\n        $result = calcularTotalVenta($id, 1);\n        \n        $total = number_format($result[\"total\"], 2);\n        $iva = number_format($result[\"iva\"], 2);\n        echo \"$id\";\n        PCO_CargarFormulario(8, 1, \"id\", $id);\n    }\n}\n\nif($PCO_Accion == \"VENTA_agregarProducto\") {\n\n    if(!$id) {\n        //crear cliente en caso de que no llegue id_cliente\n        if(!$id_cliente) {\n            PCO_EjecutarSQLUnaria(\"INSERT INTO app_clientes (nombre_completo, numero_documento, telefono) VALUES (?,?,?) \",\n                \"$nombre_completo$_SeparadorCampos_$numero_documento$_SeparadorCampos_$telefono\"\n            );\n            $id_cliente = PCO_ObtenerUltimoIDInsertado();\n        }\n        PCO_EjecutarSQLUnaria(\"INSERT INTO app_ventas (id_cliente, usuario) VALUES (?,?) \", \"$id_cliente$_SeparadorCampos_$PCOSESS_LoginUsuario\");\n        $id = PCO_ObtenerUltimoIDInsertado();\n    }\n    $producto = PCO_EjecutarSQL(\"\n        SELECT id, precio_venta, iva, inventario\n        FROM app_productos\n        WHERE id = \'$id_producto\'\n    \")->fetch();\n    if($producto[\"id\"]) {\n        $existe = PCO_EjecutarSQL(\"\n            SELECT count(id)\n            FROM app_ventas_detalle\n            WHERE id_venta = $id AND id_producto = \'$id_producto\'\n        \")->fetchColumn();\n        if($existe > 0) {\n            print_r(\'{\"success\": false, \"msg\": \"El producto ya se ha ingresado\"}\');\n            die();\n        }\n        if($producto[\"inventario\"] < $cantidad) {\n            print_r(\'{\"success\": false, \"msg\": \"La cantidad digitada supera la del invetario\"}\');\n            die();\n        }\n        $inventarioNew = $producto[\"inventario\"] - $cantidad;\n        PCO_EjecutarSQLUnaria(\"UPDATE app_productos SET inventario = $inventarioNew WHERE id = \" . $producto[\"id\"]);\n        PCO_EjecutarSQLUnaria(\"INSERT INTO app_ventas_detalle (id_venta, id_producto, cantidad, precio, iva) VALUES (?,?,?,?,?) \", \n            \"$id$_SeparadorCampos_$id_producto$_SeparadorCampos_$cantidad$_SeparadorCampos_\" . $producto[\"precio_venta\"] . \"$_SeparadorCampos_\" . $producto[\"iva\"]);\n        $result = calcularTotalVenta($id);\n        print_r(\'{\"success\": true, \"id\": \' . $id . \', \' . $result . \'}\');\n        die();\n    }\n    print_r(\'{\"success\": false, \"msg\": \"No se ha encontrado el producto seleccionado\"}\');\n    die();\n}\n\nif($PCO_Accion == \"VENTA_eliminarProducto\") {\n\n    if($id_venta_detalle && $id_venta) {\n        $producto = PCO_EjecutarSQL(\"\n            SELECT p.inventario, vd.cantidad, p.id\n            FROM app_ventas_detalle vd, app_productos p\n            WHERE vd.id_producto = p.id AND vd.id = \'$id_venta_detalle\'\n        \")->fetch();\n        //Restablecemos el inventario\n        $inventarioNew = $producto[\"inventario\"] + $producto[\"cantidad\"];\n        PCO_EjecutarSQLUnaria(\"UPDATE app_productos SET inventario = $inventarioNew WHERE id = \" . $producto[\"id\"]);\n        PCO_EjecutarSQLUnaria(\"DELETE FROM app_ventas_detalle WHERE id_venta = $id_venta AND id = $id_venta_detalle\");\n        $result = calcularTotalVenta($id_venta);\n        print_r(\'{\"success\": true, \"msg\": \"Se ha eliminado el producto exitosamente\", \' . $result . \'}\');\n        die();\n    }\n    print_r(\'{\"success\": false, \"msg\": \"No se pudo eliminar el producto\"}\');\n    die();\n}\n\nif($PCO_Accion == \"VENTA_imprimirFactura\") {\n\n    //sleep(2);\n    // echo \"$PCO_Valor\";\n    if($PCO_Valor)\n        $id = $PCO_Valor;\n    if($id) {\n        include_once \"imprimirFactura.php\";\n    }\n}','A'),(299,'/var/www/html/company/Ventaspos/mod/app_ventas/index.php','2022-06-05 21:21:00','rafael',160,6576,'<?php\n\nfunction calcularTotalVenta($id, $returnArr = \"\") {\n    $venta = PCO_EjecutarSQL(\"\n        SELECT SUM(precio * cantidad) as total, SUM(precio * iva/100) iva\n        FROM app_ventas_detalle\n        WHERE id_venta = \'$id\' GROUP BY id_venta\n    \")->fetch();\n    $total = $venta[\"total\"] ? $venta[\"total\"] : 0;\n    $iva = $venta[\"iva\"] ? $venta[\"iva\"] : 0;\n    PCO_EjecutarSQLUnaria(\"UPDATE app_ventas SET total = $total, iva = $iva WHERE id = $id \");\n    if($returnArr)\n        return $venta;\n    return \'\"total\": \' . $total . \', \"iva\": \' . $iva;\n}\n\nif($PCO_Accion == \"VENTA_ingresarRealizarVenta\") {\n    $ventaAbierta = PCO_EjecutarSQL(\"\n        SELECT id, id_cliente, total, iva\n        FROM app_ventas\n        WHERE estado = 0 ORDER BY id limit 1\n    \")->fetch();\n    /*if (!$ventaAbierta[\"id\"]) {\n        \n        $ventaAbierta = PCO_EjecutarSQL(\"\n            SELECT *\n            FROM app_ventas\n            WHERE estado = 0 ORDER BY id limit 1\n        \")->fetch();   \n    }*/\n\n    $id_venta = $ventaAbierta[\"id\"] ? $ventaAbierta[\"id\"] : \"\";\n    if($id_venta) {\n        $total = number_format($ventaAbierta[\"total\"], 2);\n        $iva = number_format($ventaAbierta[\"iva\"], 2);\n        $id_cliente = $ventaAbierta[\"id_cliente\"];\n    }\n\n    PCO_CargarFormulario(8, 1, \"id\", $id_venta);\n}\n\nif($PCO_Accion == \"VENTA_agregarProductoCrearOC\") {\n\n    if(!$id) {\n        //crear cliente en caso de que no llegue id_cliente\n        if(!$id_cliente) {\n            PCO_EjecutarSQLUnaria(\"INSERT INTO app_clientes (nombre_completo, numero_documento, telefono) VALUES (?,?,?) \",\n                \"$nombre_completo$_SeparadorCampos_$numero_documento$_SeparadorCampos_$telefono\"\n            );\n            $id_cliente = PCO_ObtenerUltimoIDInsertado();\n        }\n        PCO_EjecutarSQLUnaria(\"INSERT INTO app_ventas (id_cliente, usuario) VALUES (?,?) \", \"$id_cliente$_SeparadorCampos_$PCOSESS_LoginUsuario\");\n        $id = PCO_ObtenerUltimoIDInsertado();\n    }\n    $producto = PCO_EjecutarSQL(\"\n        SELECT id, precio_venta, iva, inventario\n        FROM app_productos\n        WHERE id = \'$id_producto\'\n    \")->fetch();\n    if($producto[\"id\"]) {\n        $existe = PCO_EjecutarSQL(\"\n            SELECT count(id)\n            FROM app_ventas_detalle\n            WHERE id_venta = $id AND id_producto = \'$id_producto\'\n        \")->fetchColumn();\n        if($existe > 0) {\n            print_r(\'{\"success\": false, \"msg\": \"El producto ya se ha ingresado\"}\');\n            die();\n        }\n        if($producto[\"inventario\"] < $cantidad) {\n            print_r(\'{\"success\": false, \"msg\": \"La cantidad digitada supera la del invetario\"}\');\n            die();\n        }\n        $inventarioNew = $producto[\"inventario\"] - $cantidad;\n        PCO_EjecutarSQLUnaria(\"UPDATE app_productos SET inventario = $inventarioNew WHERE id = \" . $producto[\"id\"]);\n        PCO_EjecutarSQLUnaria(\"INSERT INTO app_ventas_detalle (id_venta, id_producto, cantidad, precio, iva) VALUES (?,?,?,?,?) \", \n            \"$id$_SeparadorCampos_$id_producto$_SeparadorCampos_$cantidad$_SeparadorCampos_\" . $producto[\"precio_venta\"] . \"$_SeparadorCampos_\" . $producto[\"iva\"]);\n        $result = calcularTotalVenta($id, 1);\n        \n        $total = number_format($result[\"total\"], 2);\n        $iva = number_format($result[\"iva\"], 2);\n        echo \"$id $total $iva\";\n        PCO_CargarFormulario(8, 1, \"id\", $id);\n    }\n}\n\nif($PCO_Accion == \"VENTA_agregarProducto\") {\n\n    if(!$id) {\n        //crear cliente en caso de que no llegue id_cliente\n        if(!$id_cliente) {\n            PCO_EjecutarSQLUnaria(\"INSERT INTO app_clientes (nombre_completo, numero_documento, telefono) VALUES (?,?,?) \",\n                \"$nombre_completo$_SeparadorCampos_$numero_documento$_SeparadorCampos_$telefono\"\n            );\n            $id_cliente = PCO_ObtenerUltimoIDInsertado();\n        }\n        PCO_EjecutarSQLUnaria(\"INSERT INTO app_ventas (id_cliente, usuario) VALUES (?,?) \", \"$id_cliente$_SeparadorCampos_$PCOSESS_LoginUsuario\");\n        $id = PCO_ObtenerUltimoIDInsertado();\n    }\n    $producto = PCO_EjecutarSQL(\"\n        SELECT id, precio_venta, iva, inventario\n        FROM app_productos\n        WHERE id = \'$id_producto\'\n    \")->fetch();\n    if($producto[\"id\"]) {\n        $existe = PCO_EjecutarSQL(\"\n            SELECT count(id)\n            FROM app_ventas_detalle\n            WHERE id_venta = $id AND id_producto = \'$id_producto\'\n        \")->fetchColumn();\n        if($existe > 0) {\n            print_r(\'{\"success\": false, \"msg\": \"El producto ya se ha ingresado\"}\');\n            die();\n        }\n        if($producto[\"inventario\"] < $cantidad) {\n            print_r(\'{\"success\": false, \"msg\": \"La cantidad digitada supera la del invetario\"}\');\n            die();\n        }\n        $inventarioNew = $producto[\"inventario\"] - $cantidad;\n        PCO_EjecutarSQLUnaria(\"UPDATE app_productos SET inventario = $inventarioNew WHERE id = \" . $producto[\"id\"]);\n        PCO_EjecutarSQLUnaria(\"INSERT INTO app_ventas_detalle (id_venta, id_producto, cantidad, precio, iva) VALUES (?,?,?,?,?) \", \n            \"$id$_SeparadorCampos_$id_producto$_SeparadorCampos_$cantidad$_SeparadorCampos_\" . $producto[\"precio_venta\"] . \"$_SeparadorCampos_\" . $producto[\"iva\"]);\n        $result = calcularTotalVenta($id);\n        print_r(\'{\"success\": true, \"id\": \' . $id . \', \' . $result . \'}\');\n        die();\n    }\n    print_r(\'{\"success\": false, \"msg\": \"No se ha encontrado el producto seleccionado\"}\');\n    die();\n}\n\nif($PCO_Accion == \"VENTA_eliminarProducto\") {\n\n    if($id_venta_detalle && $id_venta) {\n        $producto = PCO_EjecutarSQL(\"\n            SELECT p.inventario, vd.cantidad, p.id\n            FROM app_ventas_detalle vd, app_productos p\n            WHERE vd.id_producto = p.id AND vd.id = \'$id_venta_detalle\'\n        \")->fetch();\n        //Restablecemos el inventario\n        $inventarioNew = $producto[\"inventario\"] + $producto[\"cantidad\"];\n        PCO_EjecutarSQLUnaria(\"UPDATE app_productos SET inventario = $inventarioNew WHERE id = \" . $producto[\"id\"]);\n        PCO_EjecutarSQLUnaria(\"DELETE FROM app_ventas_detalle WHERE id_venta = $id_venta AND id = $id_venta_detalle\");\n        $result = calcularTotalVenta($id_venta);\n        print_r(\'{\"success\": true, \"msg\": \"Se ha eliminado el producto exitosamente\", \' . $result . \'}\');\n        die();\n    }\n    print_r(\'{\"success\": false, \"msg\": \"No se pudo eliminar el producto\"}\');\n    die();\n}\n\nif($PCO_Accion == \"VENTA_imprimirFactura\") {\n\n    //sleep(2);\n    // echo \"$PCO_Valor\";\n    if($PCO_Valor)\n        $id = $PCO_Valor;\n    if($id) {\n        include_once \"imprimirFactura.php\";\n    }\n}','A'),(300,'/var/www/html/company/Ventaspos/mod/app_ventas/index.php','2022-06-05 21:24:00','rafael',161,6607,'<?php\n\nfunction calcularTotalVenta($id, $returnArr = \"\") {\n    $venta = PCO_EjecutarSQL(\"\n        SELECT SUM(precio * cantidad) as total, SUM(precio * iva/100) iva\n        FROM app_ventas_detalle\n        WHERE id_venta = \'$id\' GROUP BY id_venta\n    \")->fetch();\n    $total = $venta[\"total\"] ? $venta[\"total\"] : 0;\n    $iva = $venta[\"iva\"] ? $venta[\"iva\"] : 0;\n    PCO_EjecutarSQLUnaria(\"UPDATE app_ventas SET total = $total, iva = $iva WHERE id = $id \");\n    if($returnArr)\n        return $venta;\n    return \'\"total\": \' . $total . \', \"iva\": \' . $iva;\n}\n\nif($PCO_Accion == \"VENTA_ingresarRealizarVenta\") {\n    $ventaAbierta = PCO_EjecutarSQL(\"\n        SELECT id, id_cliente, total, iva\n        FROM app_ventas\n        WHERE estado = 0 ORDER BY id limit 1\n    \")->fetch();\n    /*if (!$ventaAbierta[\"id\"]) {\n        \n        $ventaAbierta = PCO_EjecutarSQL(\"\n            SELECT *\n            FROM app_ventas\n            WHERE estado = 0 ORDER BY id limit 1\n        \")->fetch();   \n    }*/\n\n    $id_venta = $ventaAbierta[\"id\"] ? $ventaAbierta[\"id\"] : \"\";\n    if($id_venta) {\n        $total = number_format($ventaAbierta[\"total\"], 2);\n        $iva = number_format($ventaAbierta[\"iva\"], 2);\n        $id_cliente = $ventaAbierta[\"id_cliente\"];\n    }\n\n    PCO_CargarFormulario(8, 1, \"id\", $id_venta);\n}\n\nif($PCO_Accion == \"VENTA_agregarProductoCrearOC\") {\n\n    if(!$id) {\n        //crear cliente en caso de que no llegue id_cliente\n        if(!$id_cliente) {\n            PCO_EjecutarSQLUnaria(\"INSERT INTO app_clientes (nombre_completo, numero_documento, telefono) VALUES (?,?,?) \",\n                \"$nombre_completo$_SeparadorCampos_$numero_documento$_SeparadorCampos_$telefono\"\n            );\n            $id_cliente = PCO_ObtenerUltimoIDInsertado();\n        }\n        PCO_EjecutarSQLUnaria(\"INSERT INTO app_ventas (id_cliente, usuario) VALUES (?,?) \", \"$id_cliente$_SeparadorCampos_$PCOSESS_LoginUsuario\");\n        $id = PCO_ObtenerUltimoIDInsertado();\n    }\n    $producto = PCO_EjecutarSQL(\"\n        SELECT id, precio_venta, iva, inventario\n        FROM app_productos\n        WHERE id = \'$id_producto\'\n    \")->fetch();\n    if($producto[\"id\"]) {\n        $existe = PCO_EjecutarSQL(\"\n            SELECT count(id)\n            FROM app_ventas_detalle\n            WHERE id_venta = $id AND id_producto = \'$id_producto\'\n        \")->fetchColumn();\n        if($existe > 0) {\n            print_r(\'{\"success\": false, \"msg\": \"El producto ya se ha ingresado\"}\');\n            die();\n        }\n        if($producto[\"inventario\"] < $cantidad) {\n            print_r(\'{\"success\": false, \"msg\": \"La cantidad digitada supera la del invetario\"}\');\n            die();\n        }\n        $inventarioNew = $producto[\"inventario\"] - $cantidad;\n        PCO_EjecutarSQLUnaria(\"UPDATE app_productos SET inventario = $inventarioNew WHERE id = \" . $producto[\"id\"]);\n        PCO_EjecutarSQLUnaria(\"INSERT INTO app_ventas_detalle (id_venta, id_producto, cantidad, precio, iva) VALUES (?,?,?,?,?) \", \n            \"$id$_SeparadorCampos_$id_producto$_SeparadorCampos_$cantidad$_SeparadorCampos_\" . $producto[\"precio_venta\"] . \"$_SeparadorCampos_\" . $producto[\"iva\"]);\n        $result = calcularTotalVenta($id, 1);\n        \n        $total = number_format($result[\"total\"], 2);\n        $iva = number_format($result[\"iva\"], 2);\n        $id_venta = $id;\n        echo \"$id $total $iva\";\n        PCO_CargarFormulario(8, 1, \"id\", $id_venta);\n    }\n}\n\nif($PCO_Accion == \"VENTA_agregarProducto\") {\n\n    if(!$id) {\n        //crear cliente en caso de que no llegue id_cliente\n        if(!$id_cliente) {\n            PCO_EjecutarSQLUnaria(\"INSERT INTO app_clientes (nombre_completo, numero_documento, telefono) VALUES (?,?,?) \",\n                \"$nombre_completo$_SeparadorCampos_$numero_documento$_SeparadorCampos_$telefono\"\n            );\n            $id_cliente = PCO_ObtenerUltimoIDInsertado();\n        }\n        PCO_EjecutarSQLUnaria(\"INSERT INTO app_ventas (id_cliente, usuario) VALUES (?,?) \", \"$id_cliente$_SeparadorCampos_$PCOSESS_LoginUsuario\");\n        $id = PCO_ObtenerUltimoIDInsertado();\n    }\n    $producto = PCO_EjecutarSQL(\"\n        SELECT id, precio_venta, iva, inventario\n        FROM app_productos\n        WHERE id = \'$id_producto\'\n    \")->fetch();\n    if($producto[\"id\"]) {\n        $existe = PCO_EjecutarSQL(\"\n            SELECT count(id)\n            FROM app_ventas_detalle\n            WHERE id_venta = $id AND id_producto = \'$id_producto\'\n        \")->fetchColumn();\n        if($existe > 0) {\n            print_r(\'{\"success\": false, \"msg\": \"El producto ya se ha ingresado\"}\');\n            die();\n        }\n        if($producto[\"inventario\"] < $cantidad) {\n            print_r(\'{\"success\": false, \"msg\": \"La cantidad digitada supera la del invetario\"}\');\n            die();\n        }\n        $inventarioNew = $producto[\"inventario\"] - $cantidad;\n        PCO_EjecutarSQLUnaria(\"UPDATE app_productos SET inventario = $inventarioNew WHERE id = \" . $producto[\"id\"]);\n        PCO_EjecutarSQLUnaria(\"INSERT INTO app_ventas_detalle (id_venta, id_producto, cantidad, precio, iva) VALUES (?,?,?,?,?) \", \n            \"$id$_SeparadorCampos_$id_producto$_SeparadorCampos_$cantidad$_SeparadorCampos_\" . $producto[\"precio_venta\"] . \"$_SeparadorCampos_\" . $producto[\"iva\"]);\n        $result = calcularTotalVenta($id);\n        print_r(\'{\"success\": true, \"id\": \' . $id . \', \' . $result . \'}\');\n        die();\n    }\n    print_r(\'{\"success\": false, \"msg\": \"No se ha encontrado el producto seleccionado\"}\');\n    die();\n}\n\nif($PCO_Accion == \"VENTA_eliminarProducto\") {\n\n    if($id_venta_detalle && $id_venta) {\n        $producto = PCO_EjecutarSQL(\"\n            SELECT p.inventario, vd.cantidad, p.id\n            FROM app_ventas_detalle vd, app_productos p\n            WHERE vd.id_producto = p.id AND vd.id = \'$id_venta_detalle\'\n        \")->fetch();\n        //Restablecemos el inventario\n        $inventarioNew = $producto[\"inventario\"] + $producto[\"cantidad\"];\n        PCO_EjecutarSQLUnaria(\"UPDATE app_productos SET inventario = $inventarioNew WHERE id = \" . $producto[\"id\"]);\n        PCO_EjecutarSQLUnaria(\"DELETE FROM app_ventas_detalle WHERE id_venta = $id_venta AND id = $id_venta_detalle\");\n        $result = calcularTotalVenta($id_venta);\n        print_r(\'{\"success\": true, \"msg\": \"Se ha eliminado el producto exitosamente\", \' . $result . \'}\');\n        die();\n    }\n    print_r(\'{\"success\": false, \"msg\": \"No se pudo eliminar el producto\"}\');\n    die();\n}\n\nif($PCO_Accion == \"VENTA_imprimirFactura\") {\n\n    //sleep(2);\n    // echo \"$PCO_Valor\";\n    if($PCO_Valor)\n        $id = $PCO_Valor;\n    if($id) {\n        include_once \"imprimirFactura.php\";\n    }\n}','A'),(301,'/var/www/html/company/Ventaspos/mod/app_ventas/index.php','2022-06-05 21:24:00','rafael',161,6607,'<?php\n\nfunction calcularTotalVenta($id, $returnArr = \"\") {\n    $venta = PCO_EjecutarSQL(\"\n        SELECT SUM(precio * cantidad) as total, SUM(precio * iva/100) iva\n        FROM app_ventas_detalle\n        WHERE id_venta = \'$id\' GROUP BY id_venta\n    \")->fetch();\n    $total = $venta[\"total\"] ? $venta[\"total\"] : 0;\n    $iva = $venta[\"iva\"] ? $venta[\"iva\"] : 0;\n    PCO_EjecutarSQLUnaria(\"UPDATE app_ventas SET total = $total, iva = $iva WHERE id = $id \");\n    if($returnArr)\n        return $venta;\n    return \'\"total\": \' . $total . \', \"iva\": \' . $iva;\n}\n\nif($PCO_Accion == \"VENTA_ingresarRealizarVenta\") {\n    $ventaAbierta = PCO_EjecutarSQL(\"\n        SELECT id, id_cliente, total, iva\n        FROM app_ventas\n        WHERE estado = 0 ORDER BY id limit 1\n    \")->fetch();\n    /*if (!$ventaAbierta[\"id\"]) {\n        \n        $ventaAbierta = PCO_EjecutarSQL(\"\n            SELECT *\n            FROM app_ventas\n            WHERE estado = 0 ORDER BY id limit 1\n        \")->fetch();   \n    }*/\n\n    $id_venta = $ventaAbierta[\"id\"] ? $ventaAbierta[\"id\"] : \"\";\n    if($id_venta) {\n        $total = number_format($ventaAbierta[\"total\"], 2);\n        $iva = number_format($ventaAbierta[\"iva\"], 2);\n        $id_cliente = $ventaAbierta[\"id_cliente\"];\n    }\n\n    PCO_CargarFormulario(8, 1, \"id\", $id_venta);\n}\n\nif($PCO_Accion == \"VENTA_agregarProductoCrearOC\") {\n\n    if(!$id) {\n        //crear cliente en caso de que no llegue id_cliente\n        if(!$id_cliente) {\n            PCO_EjecutarSQLUnaria(\"INSERT INTO app_clientes (nombre_completo, numero_documento, telefono) VALUES (?,?,?) \",\n                \"$nombre_completo$_SeparadorCampos_$numero_documento$_SeparadorCampos_$telefono\"\n            );\n            $id_cliente = PCO_ObtenerUltimoIDInsertado();\n        }\n        PCO_EjecutarSQLUnaria(\"INSERT INTO app_ventas (id_cliente, usuario) VALUES (?,?) \", \"$id_cliente$_SeparadorCampos_$PCOSESS_LoginUsuario\");\n        $id = PCO_ObtenerUltimoIDInsertado();\n    }\n    $producto = PCO_EjecutarSQL(\"\n        SELECT id, precio_venta, iva, inventario\n        FROM app_productos\n        WHERE id = \'$id_producto\'\n    \")->fetch();\n    if($producto[\"id\"]) {\n        $existe = PCO_EjecutarSQL(\"\n            SELECT count(id)\n            FROM app_ventas_detalle\n            WHERE id_venta = $id AND id_producto = \'$id_producto\'\n        \")->fetchColumn();\n        if($existe > 0) {\n            print_r(\'{\"success\": false, \"msg\": \"El producto ya se ha ingresado\"}\');\n            die();\n        }\n        if($producto[\"inventario\"] < $cantidad) {\n            print_r(\'{\"success\": false, \"msg\": \"La cantidad digitada supera la del invetario\"}\');\n            die();\n        }\n        $inventarioNew = $producto[\"inventario\"] - $cantidad;\n        PCO_EjecutarSQLUnaria(\"UPDATE app_productos SET inventario = $inventarioNew WHERE id = \" . $producto[\"id\"]);\n        PCO_EjecutarSQLUnaria(\"INSERT INTO app_ventas_detalle (id_venta, id_producto, cantidad, precio, iva) VALUES (?,?,?,?,?) \", \n            \"$id$_SeparadorCampos_$id_producto$_SeparadorCampos_$cantidad$_SeparadorCampos_\" . $producto[\"precio_venta\"] . \"$_SeparadorCampos_\" . $producto[\"iva\"]);\n        $result = calcularTotalVenta($id, 1);\n        \n        $total = number_format($result[\"total\"], 2);\n        $iva = number_format($result[\"iva\"], 2);\n        $id_venta = $id;\n        PCO_CargarFormulario(8, 1, \"id\", $id_venta);\n    }\n}\n\nif($PCO_Accion == \"VENTA_agregarProducto\") {\n\n    if(!$id) {\n        //crear cliente en caso de que no llegue id_cliente\n        if(!$id_cliente) {\n            PCO_EjecutarSQLUnaria(\"INSERT INTO app_clientes (nombre_completo, numero_documento, telefono) VALUES (?,?,?) \",\n                \"$nombre_completo$_SeparadorCampos_$numero_documento$_SeparadorCampos_$telefono\"\n            );\n            $id_cliente = PCO_ObtenerUltimoIDInsertado();\n        }\n        PCO_EjecutarSQLUnaria(\"INSERT INTO app_ventas (id_cliente, usuario) VALUES (?,?) \", \"$id_cliente$_SeparadorCampos_$PCOSESS_LoginUsuario\");\n        $id = PCO_ObtenerUltimoIDInsertado();\n    }\n    $producto = PCO_EjecutarSQL(\"\n        SELECT id, precio_venta, iva, inventario\n        FROM app_productos\n        WHERE id = \'$id_producto\'\n    \")->fetch();\n    if($producto[\"id\"]) {\n        $existe = PCO_EjecutarSQL(\"\n            SELECT count(id)\n            FROM app_ventas_detalle\n            WHERE id_venta = $id AND id_producto = \'$id_producto\'\n        \")->fetchColumn();\n        if($existe > 0) {\n            print_r(\'{\"success\": false, \"msg\": \"El producto ya se ha ingresado\"}\');\n            die();\n        }\n        if($producto[\"inventario\"] < $cantidad) {\n            print_r(\'{\"success\": false, \"msg\": \"La cantidad digitada supera la del invetario\"}\');\n            die();\n        }\n        $inventarioNew = $producto[\"inventario\"] - $cantidad;\n        PCO_EjecutarSQLUnaria(\"UPDATE app_productos SET inventario = $inventarioNew WHERE id = \" . $producto[\"id\"]);\n        PCO_EjecutarSQLUnaria(\"INSERT INTO app_ventas_detalle (id_venta, id_producto, cantidad, precio, iva) VALUES (?,?,?,?,?) \", \n            \"$id$_SeparadorCampos_$id_producto$_SeparadorCampos_$cantidad$_SeparadorCampos_\" . $producto[\"precio_venta\"] . \"$_SeparadorCampos_\" . $producto[\"iva\"]);\n        $result = calcularTotalVenta($id);\n        print_r(\'{\"success\": true, \"id\": \' . $id . \', \' . $result . \'}\');\n        die();\n    }\n    print_r(\'{\"success\": false, \"msg\": \"No se ha encontrado el producto seleccionado\"}\');\n    die();\n}\n\nif($PCO_Accion == \"VENTA_eliminarProducto\") {\n\n    if($id_venta_detalle && $id_venta) {\n        $producto = PCO_EjecutarSQL(\"\n            SELECT p.inventario, vd.cantidad, p.id\n            FROM app_ventas_detalle vd, app_productos p\n            WHERE vd.id_producto = p.id AND vd.id = \'$id_venta_detalle\'\n        \")->fetch();\n        //Restablecemos el inventario\n        $inventarioNew = $producto[\"inventario\"] + $producto[\"cantidad\"];\n        PCO_EjecutarSQLUnaria(\"UPDATE app_productos SET inventario = $inventarioNew WHERE id = \" . $producto[\"id\"]);\n        PCO_EjecutarSQLUnaria(\"DELETE FROM app_ventas_detalle WHERE id_venta = $id_venta AND id = $id_venta_detalle\");\n        $result = calcularTotalVenta($id_venta);\n        print_r(\'{\"success\": true, \"msg\": \"Se ha eliminado el producto exitosamente\", \' . $result . \'}\');\n        die();\n    }\n    print_r(\'{\"success\": false, \"msg\": \"No se pudo eliminar el producto\"}\');\n    die();\n}\n\nif($PCO_Accion == \"VENTA_imprimirFactura\") {\n\n    //sleep(2);\n    // echo \"$PCO_Valor\";\n    if($PCO_Valor)\n        $id = $PCO_Valor;\n    if($id) {\n        include_once \"imprimirFactura.php\";\n    }\n}','A'),(302,'/home/u564937498/domains/cloudecoway.com/public_html/candy/mod/app/dashboard_desktop.php','2022-07-22 17:31:00','admin',153,8280,'<div class=\"well well-sm\" style=\"margin-bottom:0px;\">\n\n            <div class=\"row\">\n                <div class=\"col-xs-12 col-sm-12 col-md-12 col-lg-12\">\n                    <h3 class=\"page-header\" style=\"margin-top:0px;\"><b><i class=\"fa fa-dashboard fa-fw\"></i> <?php echo $MULTILANG_Aplicacion; ?></b> <i>(<?php echo $MULTILANG_MonEstado; ?>)</i></h3>\n                </div>\n                <!-- /.col-lg-12 -->\n            </div>\n            <div class=\"row\">\n                <?php\n                    if ($ModoDesarrolladorPractico != \"-10000\")\n                        $ModoDesarrolladorPractico = 0;\n                                                          //$ClaseColumnas,                         $EstiloPanel,   $ClaseIconoFA,                      $Titulo,                                                                                $SubTitulo,                     $EnlaceTexto,               $EnlaceURL,                                                     $ClaseTextoTitulo=\"huge\")\n    echo PCO_ImprimirPanelSimpleDashboard(\"col-xs-12 col-sm-6 col-md-3 col-lg-2\", \"info\",   \"fa-users fa-3x\", PCO_ContarRegistrosTabla(\"app_clientes\"),   \"Clientes\",     \"Detalles\", \"javascript:document._centro_2.submit();\",   \"\");\n    echo PCO_ImprimirPanelSimpleDashboard(\"col-xs-12 col-sm-6 col-md-3 col-lg-2\", \"primary\",\"fa-cubes fa-3x\", PCO_ContarRegistrosTabla(\"app_productos\"),  \"Productos\",    \"Detalles\", \"javascript:document._centro_4.submit();\",   \"\");\n    echo PCO_ImprimirPanelSimpleDashboard(\"col-xs-12 col-sm-6 col-md-3 col-lg-2\", \"success\",\"fa-truck fa-3x\", PCO_ContarRegistrosTabla(\"app_proveedores\"),\"Proveedores\",  \"Detalles\", \"javascript:document._centro_6.submit();\",   \"\");\n    echo PCO_ImprimirPanelSimpleDashboard(\"col-xs-12 col-sm-6 col-md-3 col-lg-2\", \"default\",\"fa-money fa-3x\", PCO_ContarRegistrosTabla(\"app_ventas\"),     \"Ventas\",       \"Detalles\", \"javascript:document._centro_1.submit();\",   \"\");\n    //echo PCO_ImprimirPanelSimpleDashboard(\"col-xs-12 col-sm-6 col-md-3 col-lg-2\",   \"warning\",  \"fa-picture-o fa-3x\",   PCO_ContarRegistrosTabla(\"app_zona_cobertura\"), \"Zonas\",                \"Detalles\",    \"javascript:document._centro_3.submit();\",   \"\");\n                ?>\n            </div>\n    \n            <div class=\"row\">\n                    <div  class=\"col-md-4 col-lg-4 \">\n                        <div class=\"panel panel-default\">\n                            <div class=\"panel-heading\">\n                                <i class=\"fa fa-bar-chart-o fa-fw\"></i> Ventas por día, último mes\n                            </div>\n                            <div class=\"panel-body\">\n                                <div id=\"uso-general-aplicativo2\"></div>\n                            </div>\n                        </div>\n                    </div>\n                    <div  class=\" col-md-4 col-lg-4\">\n\n                            <div class=\"panel panel-default\">\n                                <div class=\"panel-heading\">\n                                    <i class=\"fa fa-money fa-fw\"></i> Últimas ventas ingresados\n                                </div>\n                                <div class=\"panel-body\">\n                                    <div id=\"\">\n\n                                    <table width=\"100%\">\n                                        <tr>\n                                            <td width=33% align=center>\n                                                    Hoy<br>\n                                                    <i class=\"fa-2x\" style=\"color:green;\"><b>   <?php echo PCO_EjecutarSQL(\"SELECT COUNT(id) FROM app_ventas WHERE fecha = DATE(NOW()) \")->fetchColumn(); ?>   </i></b>\n                                            </td>\n                                            <td width=33% align=center>\n                                                    Hace 1 semana<br>\n                                                    <i class=\"fa-2x\" style=\"color:navy;\"><b>    <?php echo PCO_EjecutarSQL(\"SELECT COUNT(id) FROM app_ventas WHERE fecha >= date_sub(now(),INTERVAL 1 WEEK) \")->fetchColumn(); ?>   </i></b>\n                                            </td>\n                                            <td width=33% align=center>\n                                                    Este mes<br>\n                                                    <i class=\"fa-2x\" style=\"color:red;\"><b>     <?php echo PCO_EjecutarSQL(\"SELECT COUNT(id) FROM app_ventas WHERE MONTH(fecha) = MONTH(NOW()) \")->fetchColumn(); ?>   </i></b>\n                                                    <!--<i class=\"fa-2x\" style=\"color:red;\"><b>     <?php echo PCO_EjecutarSQL(\"SELECT COUNT(id) FROM app_ventas WHERE fecha >= date_sub(now(),INTERVAL 4 WEEK) \")->fetchColumn(); ?>   </i></b>-->\n                                            </td>\n                                        </tr>\n                                    </table>\n\n                                    </div>\n                                </div>\n                            </div>\n\n                        <?php\n                            //$informe,$en_ventana=1,$formato=\"htm\",$estilo=\"Informes\",$embebido=0,$anular_acciones=0,$anular_piepagina=0,$anular_encabezado=0,$SQLPuro=\"\")\n                            //PCO_CargarInforme(7,1,\"\",\"\",1,1,0,0,\"\");\n                        ?>\n\n                    </div>            \n                    <div  class=\"col-md-4 col-lg-4\">\n                        <div class=\"panel panel-default\">\n                            <div class=\"panel-heading\">\n                                <i class=\"fa fa-bar-chart-o fa-fw\"></i> Resumen ventas por mes prueba\n                            </div>\n                            <div class=\"panel-body\">\n                                <div id=\"conteos-generales-aplicacion2\"></div>\n                            </div>\n                        </div>\n                    </div>\n\n            </div>\n    </div>\n    <br>\n    <script language=\"JavaScript\">\n\n$(function() {\n\n    Morris.Area({\n        \n        //Nombre del marco que tiene el grafico\n        element: \'uso-general-aplicativo2\',\n        data: [\n        <?php\n            //Inicia la generacion del arreglo con los datos\n            $facturas = PCO_EjecutarSQL(\"SELECT fecha, COUNT(id) as cantidad FROM app_ventas WHERE fecha >= date_sub(date(now()), INTERVAL 30 DAY) GROUP BY fecha ORDER BY fecha\");\n            $cadena_datos = \"\";\n            while ($factura = $facturas->fetch())\n                {\n                    $fecha_grafico=$factura[\"fecha\"];\n                    $cantidad_grafico=$factura[\"cantidad\"];\n                    $cadena_datos.= \"\n                        {\n                            fecha: \'\".$fecha_grafico.\"\',\n                            Ventas: \".$cantidad_grafico.\"\n                        },\n                        \";\n                }\n            $cadena_datos = substr($cadena_datos, 0, -1);\n            echo $cadena_datos;\n        ?>\n        ],\n        xkey: \'fecha\',\n        ykeys: [\'Ventas\'],\n        labels: [\'Ventas\'],\n        pointSize: 2,\n        hideHover: \'auto\',\n        resize: true\n    });\n\n\n    Morris.Bar({\n      element: \'conteos-generales-aplicacion2\',\n      data: [\n        /*{ y: \'2006\', a: 100, b: 90 },\n        { y: \'2007\', a: 75,  b: 65 },\n        { y: \'2008\', a: 50,  b: 40 },\n        { y: \'2009\', a: 75,  b: 65 },\n        { y: \'2010\', a: 50,  b: 40 },\n        { y: \'2011\', a: 75,  b: 65 },\n        { y: \'2012\', a: 100, b: 90 }*/\n        <?php\n        PCO_EjecutarSQLUnaria(\"SET lc_time_names = \'es_ES\'\");\n        $resumenPagoMes = PCO_EjecutarSQL(\"SELECT MONTHNAME(fecha) Mes, COUNT(IF(fecha, 0, NULL)) Pago, COUNT(IF(ISNULL(fecha), 0, NULL)) noPago\n                                            FROM app_ventas\n                                            GROUP BY MONTHNAME(fecha); \");\n            $cadena_datos=\"\";\n            while ($mes = $resumenPagoMes->fetch())\n                $cadena_datos.= \"{ Mes: \'\" . ucfirst($mes[\'Mes\']) . \"\', Pago: \" . $mes[\'Pago\']. \", noPago: \" . $mes[\'noPago\']. \" },\";\n\n            $cadena_datos = substr($cadena_datos, 0, -1);\n            echo $cadena_datos;\n        ?>\n      ],\n      xkey: \'Mes\',\n      ykeys: [\'Pago\', \'noPago\'],\n      labels: [\'Pagado\', \'no Pagado\'],\n      resize: true,\n      barColors: [\'#26B99A\', \'#DE8244\']\n    });\n});\n\n\n</script>','A'),(303,'/home/u564937498/domains/cloudecoway.com/public_html/candy/mod/app/dashboard_desktop.php','2022-07-22 17:31:00','admin',153,8273,'<div class=\"well well-sm\" style=\"margin-bottom:0px;\">\n\n            <div class=\"row\">\n                <div class=\"col-xs-12 col-sm-12 col-md-12 col-lg-12\">\n                    <h3 class=\"page-header\" style=\"margin-top:0px;\"><b><i class=\"fa fa-dashboard fa-fw\"></i> <?php echo $MULTILANG_Aplicacion; ?></b> <i>(<?php echo $MULTILANG_MonEstado; ?>)</i></h3>\n                </div>\n                <!-- /.col-lg-12 -->\n            </div>\n            <div class=\"row\">\n                <?php\n                    if ($ModoDesarrolladorPractico != \"-10000\")\n                        $ModoDesarrolladorPractico = 0;\n                                                          //$ClaseColumnas,                         $EstiloPanel,   $ClaseIconoFA,                      $Titulo,                                                                                $SubTitulo,                     $EnlaceTexto,               $EnlaceURL,                                                     $ClaseTextoTitulo=\"huge\")\n    echo PCO_ImprimirPanelSimpleDashboard(\"col-xs-12 col-sm-6 col-md-3 col-lg-2\", \"info\",   \"fa-users fa-3x\", PCO_ContarRegistrosTabla(\"app_clientes\"),   \"Clientes\",     \"Detalles\", \"javascript:document._centro_2.submit();\",   \"\");\n    echo PCO_ImprimirPanelSimpleDashboard(\"col-xs-12 col-sm-6 col-md-3 col-lg-2\", \"primary\",\"fa-cubes fa-3x\", PCO_ContarRegistrosTabla(\"app_productos\"),  \"Productos\",    \"Detalles\", \"javascript:document._centro_4.submit();\",   \"\");\n    echo PCO_ImprimirPanelSimpleDashboard(\"col-xs-12 col-sm-6 col-md-3 col-lg-2\", \"success\",\"fa-truck fa-3x\", PCO_ContarRegistrosTabla(\"app_proveedores\"),\"Proveedores\",  \"Detalles\", \"javascript:document._centro_6.submit();\",   \"\");\n    echo PCO_ImprimirPanelSimpleDashboard(\"col-xs-12 col-sm-6 col-md-3 col-lg-2\", \"default\",\"fa-money fa-3x\", PCO_ContarRegistrosTabla(\"app_ventas\"),     \"Ventas\",       \"Detalles\", \"javascript:document._centro_1.submit();\",   \"\");\n    //echo PCO_ImprimirPanelSimpleDashboard(\"col-xs-12 col-sm-6 col-md-3 col-lg-2\",   \"warning\",  \"fa-picture-o fa-3x\",   PCO_ContarRegistrosTabla(\"app_zona_cobertura\"), \"Zonas\",                \"Detalles\",    \"javascript:document._centro_3.submit();\",   \"\");\n                ?>\n            </div>\n    \n            <div class=\"row\">\n                    <div  class=\"col-md-4 col-lg-4 \">\n                        <div class=\"panel panel-default\">\n                            <div class=\"panel-heading\">\n                                <i class=\"fa fa-bar-chart-o fa-fw\"></i> Ventas por día, último mes\n                            </div>\n                            <div class=\"panel-body\">\n                                <div id=\"uso-general-aplicativo2\"></div>\n                            </div>\n                        </div>\n                    </div>\n                    <div  class=\" col-md-4 col-lg-4\">\n\n                            <div class=\"panel panel-default\">\n                                <div class=\"panel-heading\">\n                                    <i class=\"fa fa-money fa-fw\"></i> Últimas ventas ingresados\n                                </div>\n                                <div class=\"panel-body\">\n                                    <div id=\"\">\n\n                                    <table width=\"100%\">\n                                        <tr>\n                                            <td width=33% align=center>\n                                                    Hoy<br>\n                                                    <i class=\"fa-2x\" style=\"color:green;\"><b>   <?php echo PCO_EjecutarSQL(\"SELECT COUNT(id) FROM app_ventas WHERE fecha = DATE(NOW()) \")->fetchColumn(); ?>   </i></b>\n                                            </td>\n                                            <td width=33% align=center>\n                                                    Hace 1 semana<br>\n                                                    <i class=\"fa-2x\" style=\"color:navy;\"><b>    <?php echo PCO_EjecutarSQL(\"SELECT COUNT(id) FROM app_ventas WHERE fecha >= date_sub(now(),INTERVAL 1 WEEK) \")->fetchColumn(); ?>   </i></b>\n                                            </td>\n                                            <td width=33% align=center>\n                                                    Este mes<br>\n                                                    <i class=\"fa-2x\" style=\"color:red;\"><b>     <?php echo PCO_EjecutarSQL(\"SELECT COUNT(id) FROM app_ventas WHERE MONTH(fecha) = MONTH(NOW()) \")->fetchColumn(); ?>   </i></b>\n                                                    <!--<i class=\"fa-2x\" style=\"color:red;\"><b>     <?php echo PCO_EjecutarSQL(\"SELECT COUNT(id) FROM app_ventas WHERE fecha >= date_sub(now(),INTERVAL 4 WEEK) \")->fetchColumn(); ?>   </i></b>-->\n                                            </td>\n                                        </tr>\n                                    </table>\n\n                                    </div>\n                                </div>\n                            </div>\n\n                        <?php\n                            //$informe,$en_ventana=1,$formato=\"htm\",$estilo=\"Informes\",$embebido=0,$anular_acciones=0,$anular_piepagina=0,$anular_encabezado=0,$SQLPuro=\"\")\n                            //PCO_CargarInforme(7,1,\"\",\"\",1,1,0,0,\"\");\n                        ?>\n\n                    </div>            \n                    <div  class=\"col-md-4 col-lg-4\">\n                        <div class=\"panel panel-default\">\n                            <div class=\"panel-heading\">\n                                <i class=\"fa fa-bar-chart-o fa-fw\"></i> Resumen ventas por mes\n                            </div>\n                            <div class=\"panel-body\">\n                                <div id=\"conteos-generales-aplicacion2\"></div>\n                            </div>\n                        </div>\n                    </div>\n\n            </div>\n    </div>\n    <br>\n    <script language=\"JavaScript\">\n\n$(function() {\n\n    Morris.Area({\n        \n        //Nombre del marco que tiene el grafico\n        element: \'uso-general-aplicativo2\',\n        data: [\n        <?php\n            //Inicia la generacion del arreglo con los datos\n            $facturas = PCO_EjecutarSQL(\"SELECT fecha, COUNT(id) as cantidad FROM app_ventas WHERE fecha >= date_sub(date(now()), INTERVAL 30 DAY) GROUP BY fecha ORDER BY fecha\");\n            $cadena_datos = \"\";\n            while ($factura = $facturas->fetch())\n                {\n                    $fecha_grafico=$factura[\"fecha\"];\n                    $cantidad_grafico=$factura[\"cantidad\"];\n                    $cadena_datos.= \"\n                        {\n                            fecha: \'\".$fecha_grafico.\"\',\n                            Ventas: \".$cantidad_grafico.\"\n                        },\n                        \";\n                }\n            $cadena_datos = substr($cadena_datos, 0, -1);\n            echo $cadena_datos;\n        ?>\n        ],\n        xkey: \'fecha\',\n        ykeys: [\'Ventas\'],\n        labels: [\'Ventas\'],\n        pointSize: 2,\n        hideHover: \'auto\',\n        resize: true\n    });\n\n\n    Morris.Bar({\n      element: \'conteos-generales-aplicacion2\',\n      data: [\n        /*{ y: \'2006\', a: 100, b: 90 },\n        { y: \'2007\', a: 75,  b: 65 },\n        { y: \'2008\', a: 50,  b: 40 },\n        { y: \'2009\', a: 75,  b: 65 },\n        { y: \'2010\', a: 50,  b: 40 },\n        { y: \'2011\', a: 75,  b: 65 },\n        { y: \'2012\', a: 100, b: 90 }*/\n        <?php\n        PCO_EjecutarSQLUnaria(\"SET lc_time_names = \'es_ES\'\");\n        $resumenPagoMes = PCO_EjecutarSQL(\"SELECT MONTHNAME(fecha) Mes, COUNT(IF(fecha, 0, NULL)) Pago, COUNT(IF(ISNULL(fecha), 0, NULL)) noPago\n                                            FROM app_ventas\n                                            GROUP BY MONTHNAME(fecha); \");\n            $cadena_datos=\"\";\n            while ($mes = $resumenPagoMes->fetch())\n                $cadena_datos.= \"{ Mes: \'\" . ucfirst($mes[\'Mes\']) . \"\', Pago: \" . $mes[\'Pago\']. \", noPago: \" . $mes[\'noPago\']. \" },\";\n\n            $cadena_datos = substr($cadena_datos, 0, -1);\n            echo $cadena_datos;\n        ?>\n      ],\n      xkey: \'Mes\',\n      ykeys: [\'Pago\', \'noPago\'],\n      labels: [\'Pagado\', \'no Pagado\'],\n      resize: true,\n      barColors: [\'#26B99A\', \'#DE8244\']\n    });\n});\n\n\n</script>','A'),(304,'/home/u564937498/domains/cloudecoway.com/public_html/candy/mod/app/dashboard_desktop.php','2022-07-22 17:33:00','admin',153,8274,'<div class=\"well well-sm\" style=\"margin-bottom:0px;\">\n\n            <div class=\"row\">\n                <div class=\"col-xs-12 col-sm-12 col-md-12 col-lg-12\">\n                    <h3 class=\"page-header\" style=\"margin-top:0px;\"><b><i class=\"fa fa-dashboard fa-fw\"></i> <?php echo $MULTILANG_Aplicacion; ?></b> <i>(<?php echo $MULTILANG_MonEstado; ?>)</i></h3>\n                </div>\n                <!-- /.col-lg-12 -->\n            </div>\n            <div class=\"row\">\n                <?php\n                    if ($ModoDesarrolladorPractico != \"-10000\")\n                        $ModoDesarrolladorPractico = 0;\n                                                          //$ClaseColumnas,                         $EstiloPanel,   $ClaseIconoFA,                      $Titulo,                                                                                $SubTitulo,                     $EnlaceTexto,               $EnlaceURL,                                                     $ClaseTextoTitulo=\"huge\")\n    echo PCO_ImprimirPanelSimpleDashboard(\"col-xs-12 col-sm-6 col-md-3 col-lg-2\", \"info\",   \"fa-users fa-3x\", PCO_ContarRegistrosTabla(\"app_clientes\"),   \"Clientes\",     \"Detalles\", \"javascript:document._centro_2.submit();\",   \"\");\n    echo PCO_ImprimirPanelSimpleDashboard(\"col-xs-12 col-sm-6 col-md-3 col-lg-2\", \"primary\",\"fa-cubes fa-3x\", PCO_ContarRegistrosTabla(\"app_productos\"),  \"Productos\",    \"Detalles\", \"javascript:document._centro_4.submit();\",   \"\");\n    echo PCO_ImprimirPanelSimpleDashboard(\"col-xs-12 col-sm-6 col-md-3 col-lg-2\", \"success\",\"fa-truck fa-3x\", PCO_ContarRegistrosTabla(\"app_proveedores\"),\"Proveedores\",  \"Detalles\", \"javascript:document._centro_6.submit();\",   \"\");\n    echo PCO_ImprimirPanelSimpleDashboard(\"col-xs-12 col-sm-6 col-md-3 col-lg-2\", \"default\",\"fa-money fa-3x\", PCO_ContarRegistrosTabla(\"app_ventas\"),     \"Ventas\",       \"Detalles\", \"javascript:document._centro_1.submit();\",   \"\");\n    //echo PCO_ImprimirPanelSimpleDashboard(\"col-xs-12 col-sm-6 col-md-3 col-lg-2\",   \"warning\",  \"fa-picture-o fa-3x\",   PCO_ContarRegistrosTabla(\"app_zona_cobertura\"), \"Zonas\",                \"Detalles\",    \"javascript:document._centro_3.submit();\",   \"\");\n                ?>\n            </div>\n    \n            <div class=\"row\">\n                    <div  class=\"col-md-4 col-lg-4 \">\n                        <div class=\"panel panel-default\">\n                            <div class=\"panel-heading\">\n                                <i class=\"fa fa-bar-chart-o fa-fw\"></i> Ventas por día, último mes\n                            </div>\n                            <div class=\"panel-body\">\n                                <div id=\"uso-general-aplicativo2\"></div>\n                            </div>\n                        </div>\n                    </div>\n                    <div  class=\" col-md-4 col-lg-4\">\n\n                            <div class=\"panel panel-default\">\n                                <div class=\"panel-heading\">\n                                    <i class=\"fa fa-money fa-fw\"></i> Últimas ventas ingresados\n                                </div>\n                                <div class=\"panel-body\">\n                                    <div id=\"\">\n\n                                    <table width=\"100%\">\n                                        <tr>\n                                            <td width=33% align=center>\n                                                    Hoy<br>\n                                                    <i class=\"fa-2x\" style=\"color:green;\"><b>   <?php echo PCO_EjecutarSQL(\"SELECT COUNT(id) FROM app_ventas WHERE fecha = DATE(NOW()) \")->fetchColumn(); ?>   </i></b>\n                                            </td>\n                                            <td width=33% align=center>\n                                                    Hace 1 semana<br>\n                                                    <i class=\"fa-2x\" style=\"color:navy;\"><b>    <?php echo PCO_EjecutarSQL(\"SELECT COUNT(id) FROM app_ventas WHERE fecha >= date_sub(now(),INTERVAL 1 WEEK) \")->fetchColumn(); ?>   </i></b>\n                                            </td>\n                                            <td width=33% align=center>\n                                                    Este mes<br>\n                                                    <i class=\"fa-2x\" style=\"color:red;\"><b>     <?php echo PCO_EjecutarSQL(\"SELECT COUNT(id) FROM app_ventas WHERE MONTH(fecha) = MONTH(NOW()) \")->fetchColumn(); ?>   </i></b>\n                                                    <!--<i class=\"fa-2x\" style=\"color:red;\"><b>     <?php echo PCO_EjecutarSQL(\"SELECT COUNT(id) FROM app_ventas WHERE fecha >= date_sub(now(),INTERVAL 4 WEEK) \")->fetchColumn(); ?>   </i></b>-->\n                                            </td>\n                                        </tr>\n                                    </table>\n\n                                    </div>\n                                </div>\n                            </div>\n\n                        <?php\n                            //$informe,$en_ventana=1,$formato=\"htm\",$estilo=\"Informes\",$embebido=0,$anular_acciones=0,$anular_piepagina=0,$anular_encabezado=0,$SQLPuro=\"\")\n                            //PCO_CargarInforme(7,1,\"\",\"\",1,1,0,0,\"\");\n                        ?>\n\n                    </div>            \n                    <div  class=\"col-md-4 col-lg-4\">\n                        <div class=\"panel panel-default\">\n                            <div class=\"panel-heading\">\n                                <i class=\"fa fa-bar-chart-o fa-fw\"></i> Resumen ventas por mes\n                            </div>\n                            <div class=\"panel-body\">\n                                <div id=\"conteos-generales-aplicacion2\"></div>\n                            </div>\n                        </div>\n                    </div>\n\n            </div>\n    </div>\n    <br>\n    <script language=\"JavaScript\">\n\n$(function() {\n\n    Morris.Area({\n        \n        //Nombre del marco que tiene el grafico\n        element: \'uso-general-aplicativo2\',\n        data: [\n        <?php\n            //Inicia la generacion del arreglo con los datos\n            $facturas = PCO_EjecutarSQL(\"SELECT fecha, sum(total) as cantidad FROM app_ventas WHERE fecha >= date_sub(date(now()), INTERVAL 30 DAY) GROUP BY fecha ORDER BY fecha\");\n            $cadena_datos = \"\";\n            while ($factura = $facturas->fetch())\n                {\n                    $fecha_grafico=$factura[\"fecha\"];\n                    $cantidad_grafico=$factura[\"cantidad\"];\n                    $cadena_datos.= \"\n                        {\n                            fecha: \'\".$fecha_grafico.\"\',\n                            Ventas: \".$cantidad_grafico.\"\n                        },\n                        \";\n                }\n            $cadena_datos = substr($cadena_datos, 0, -1);\n            echo $cadena_datos;\n        ?>\n        ],\n        xkey: \'fecha\',\n        ykeys: [\'Ventas\'],\n        labels: [\'Ventas\'],\n        pointSize: 2,\n        hideHover: \'auto\',\n        resize: true\n    });\n\n\n    Morris.Bar({\n      element: \'conteos-generales-aplicacion2\',\n      data: [\n        /*{ y: \'2006\', a: 100, b: 90 },\n        { y: \'2007\', a: 75,  b: 65 },\n        { y: \'2008\', a: 50,  b: 40 },\n        { y: \'2009\', a: 75,  b: 65 },\n        { y: \'2010\', a: 50,  b: 40 },\n        { y: \'2011\', a: 75,  b: 65 },\n        { y: \'2012\', a: 100, b: 90 }*/\n        <?php\n        PCO_EjecutarSQLUnaria(\"SET lc_time_names = \'es_ES\'\");\n        $resumenPagoMes = PCO_EjecutarSQL(\"SELECT MONTHNAME(fecha) Mes, COUNT(IF(fecha, 0, NULL)) Pago, COUNT(IF(ISNULL(fecha), 0, NULL)) noPago\n                                            FROM app_ventas\n                                            GROUP BY MONTHNAME(fecha); \");\n            $cadena_datos=\"\";\n            while ($mes = $resumenPagoMes->fetch())\n                $cadena_datos.= \"{ Mes: \'\" . ucfirst($mes[\'Mes\']) . \"\', Pago: \" . $mes[\'Pago\']. \", noPago: \" . $mes[\'noPago\']. \" },\";\n\n            $cadena_datos = substr($cadena_datos, 0, -1);\n            echo $cadena_datos;\n        ?>\n      ],\n      xkey: \'Mes\',\n      ykeys: [\'Pago\', \'noPago\'],\n      labels: [\'Pagado\', \'no Pagado\'],\n      resize: true,\n      barColors: [\'#26B99A\', \'#DE8244\']\n    });\n});\n\n\n</script>','A'),(305,'/home/u564937498/domains/cloudecoway.com/public_html/candy/mod/app/dashboard_desktop.php','2022-07-22 17:38:00','admin',153,8269,'<div class=\"well well-sm\" style=\"margin-bottom:0px;\">\n\n            <div class=\"row\">\n                <div class=\"col-xs-12 col-sm-12 col-md-12 col-lg-12\">\n                    <h3 class=\"page-header\" style=\"margin-top:0px;\"><b><i class=\"fa fa-dashboard fa-fw\"></i> <?php echo $MULTILANG_Aplicacion; ?></b> <i>(<?php echo $MULTILANG_MonEstado; ?>)</i></h3>\n                </div>\n                <!-- /.col-lg-12 -->\n            </div>\n            <div class=\"row\">\n                <?php\n                    if ($ModoDesarrolladorPractico != \"-10000\")\n                        $ModoDesarrolladorPractico = 0;\n                                                          //$ClaseColumnas,                         $EstiloPanel,   $ClaseIconoFA,                      $Titulo,                                                                                $SubTitulo,                     $EnlaceTexto,               $EnlaceURL,                                                     $ClaseTextoTitulo=\"huge\")\n    echo PCO_ImprimirPanelSimpleDashboard(\"col-xs-12 col-sm-6 col-md-3 col-lg-2\", \"info\",   \"fa-users fa-3x\", PCO_ContarRegistrosTabla(\"app_clientes\"),   \"Clientes\",     \"Detalles\", \"javascript:document._centro_2.submit();\",   \"\");\n    echo PCO_ImprimirPanelSimpleDashboard(\"col-xs-12 col-sm-6 col-md-3 col-lg-2\", \"primary\",\"fa-cubes fa-3x\", PCO_ContarRegistrosTabla(\"app_productos\"),  \"Productos\",    \"Detalles\", \"javascript:document._centro_4.submit();\",   \"\");\n    echo PCO_ImprimirPanelSimpleDashboard(\"col-xs-12 col-sm-6 col-md-3 col-lg-2\", \"success\",\"fa-truck fa-3x\", PCO_ContarRegistrosTabla(\"app_proveedores\"),\"Proveedores\",  \"Detalles\", \"javascript:document._centro_6.submit();\",   \"\");\n    echo PCO_ImprimirPanelSimpleDashboard(\"col-xs-12 col-sm-6 col-md-3 col-lg-2\", \"default\",\"fa-money fa-3x\", PCO_ContarRegistrosTabla(\"app_ventas\"),     \"Ventas\",       \"Detalles\", \"javascript:document._centro_1.submit();\",   \"\");\n    //echo PCO_ImprimirPanelSimpleDashboard(\"col-xs-12 col-sm-6 col-md-3 col-lg-2\",   \"warning\",  \"fa-picture-o fa-3x\",   PCO_ContarRegistrosTabla(\"app_zona_cobertura\"), \"Zonas\",                \"Detalles\",    \"javascript:document._centro_3.submit();\",   \"\");\n                ?>\n            </div>\n    \n            <div class=\"row\">\n                    <div  class=\"col-md-4 col-lg-4 \">\n                        <div class=\"panel panel-default\">\n                            <div class=\"panel-heading\">\n                                <i class=\"fa fa-bar-chart-o fa-fw\"></i> Ventas por día, último mes\n                            </div>\n                            <div class=\"panel-body\">\n                                <div id=\"uso-general-aplicativo2\"></div>\n                            </div>\n                        </div>\n                    </div>\n                    <div  class=\" col-md-4 col-lg-4\">\n\n                            <div class=\"panel panel-default\">\n                                <div class=\"panel-heading\">\n                                    <i class=\"fa fa-money fa-fw\"></i> Últimas ventas ingresados\n                                </div>\n                                <div class=\"panel-body\">\n                                    <div id=\"\">\n\n                                    <table width=\"100%\">\n                                        <tr>\n                                            <td width=33% align=center>\n                                                    Hoy<br>\n                                                    <i class=\"fa-2x\" style=\"color:green;\"><b>   <?php echo PCO_EjecutarSQL(\"SELECT COUNT(id) FROM app_ventas WHERE fecha = DATE(NOW()) \")->fetchColumn(); ?>   </i></b>\n                                            </td>\n                                            <td width=33% align=center>\n                                                    Hace 1 semana<br>\n                                                    <i class=\"fa-2x\" style=\"color:navy;\"><b>    <?php echo PCO_EjecutarSQL(\"SELECT COUNT(id) FROM app_ventas WHERE fecha >= date_sub(now(),INTERVAL 1 WEEK) \")->fetchColumn(); ?>   </i></b>\n                                            </td>\n                                            <td width=33% align=center>\n                                                    Este mes<br>\n                                                    <i class=\"fa-2x\" style=\"color:red;\"><b>     <?php echo PCO_EjecutarSQL(\"SELECT COUNT(id) FROM app_ventas WHERE MONTH(fecha) = MONTH(NOW()) \")->fetchColumn(); ?>   </i></b>\n                                                    <!--<i class=\"fa-2x\" style=\"color:red;\"><b>     <?php echo PCO_EjecutarSQL(\"SELECT COUNT(id) FROM app_ventas WHERE fecha >= date_sub(now(),INTERVAL 4 WEEK) \")->fetchColumn(); ?>   </i></b>-->\n                                            </td>\n                                        </tr>\n                                    </table>\n\n                                    </div>\n                                </div>\n                            </div>\n\n                        <?php\n                            //$informe,$en_ventana=1,$formato=\"htm\",$estilo=\"Informes\",$embebido=0,$anular_acciones=0,$anular_piepagina=0,$anular_encabezado=0,$SQLPuro=\"\")\n                            //PCO_CargarInforme(7,1,\"\",\"\",1,1,0,0,\"\");\n                        ?>\n\n                    </div>            \n                    <div  class=\"col-md-4 col-lg-4\">\n                        <div class=\"panel panel-default\">\n                            <div class=\"panel-heading\">\n                                <i class=\"fa fa-bar-chart-o fa-fw\"></i> Resumen ventas por mes\n                            </div>\n                            <div class=\"panel-body\">\n                                <div id=\"conteos-generales-aplicacion2\"></div>\n                            </div>\n                        </div>\n                    </div>\n\n            </div>\n    </div>\n    <br>\n    <script language=\"JavaScript\">\n\n$(function() {\n\n    Morris.Area({\n        \n        //Nombre del marco que tiene el grafico\n        element: \'uso-general-aplicativo2\',\n        data: [\n        <?php\n            //Inicia la generacion del arreglo con los datos\n            $facturas = PCO_EjecutarSQL(\"SELECT fecha, cum(id) as cantidad FROM app_ventas WHERE fecha >= date_sub(date(now()), INTERVAL 30 DAY) GROUP BY fecha ORDER BY fecha\");\n            $cadena_datos = \"\";\n            while ($factura = $facturas->fetch())\n                {\n                    $fecha_grafico=$factura[\"fecha\"];\n                    $cantidad_grafico=$factura[\"cantidad\"];\n                    $cadena_datos.= \"\n                        {\n                            fecha: \'\".$fecha_grafico.\"\',\n                            Ventas: \".$cantidad_grafico.\"\n                        },\n                        \";\n                }\n            $cadena_datos = substr($cadena_datos, 0, -1);\n            echo $cadena_datos;\n        ?>\n        ],\n        xkey: \'fecha\',\n        ykeys: [\'Ventas\'],\n        labels: [\'Ventas\'],\n        pointSize: 2,\n        hideHover: \'auto\',\n        resize: true\n    });\n\n\n    Morris.Bar({\n      element: \'conteos-generales-aplicacion2\',\n      data: [\n        /*{ y: \'2006\', a: 100, b: 90 },\n        { y: \'2007\', a: 75,  b: 65 },\n        { y: \'2008\', a: 50,  b: 40 },\n        { y: \'2009\', a: 75,  b: 65 },\n        { y: \'2010\', a: 50,  b: 40 },\n        { y: \'2011\', a: 75,  b: 65 },\n        { y: \'2012\', a: 100, b: 90 }*/\n        <?php\n        PCO_EjecutarSQLUnaria(\"SET lc_time_names = \'es_ES\'\");\n        $resumenPagoMes = PCO_EjecutarSQL(\"SELECT MONTHNAME(fecha) Mes, sum(IF(total, 0, NULL)) Pago, COUNT(IF(ISNULL(fecha), 0, NULL)) noPago\n                                            FROM app_ventas\n                                            GROUP BY MONTHNAME(fecha); \");\n            $cadena_datos=\"\";\n            while ($mes = $resumenPagoMes->fetch())\n                $cadena_datos.= \"{ Mes: \'\" . ucfirst($mes[\'Mes\']) . \"\', Pago: \" . $mes[\'Pago\']. \", noPago: \" . $mes[\'noPago\']. \" },\";\n\n            $cadena_datos = substr($cadena_datos, 0, -1);\n            echo $cadena_datos;\n        ?>\n      ],\n      xkey: \'Mes\',\n      ykeys: [\'Pago\', \'noPago\'],\n      labels: [\'Pagado\', \'no Pagado\'],\n      resize: true,\n      barColors: [\'#26B99A\', \'#DE8244\']\n    });\n});\n\n\n</script>','A'),(306,'/home/u564937498/domains/cloudecoway.com/public_html/candy/mod/app/dashboard_desktop.php','2022-07-22 17:38:00','admin',153,8271,'<div class=\"well well-sm\" style=\"margin-bottom:0px;\">\n\n            <div class=\"row\">\n                <div class=\"col-xs-12 col-sm-12 col-md-12 col-lg-12\">\n                    <h3 class=\"page-header\" style=\"margin-top:0px;\"><b><i class=\"fa fa-dashboard fa-fw\"></i> <?php echo $MULTILANG_Aplicacion; ?></b> <i>(<?php echo $MULTILANG_MonEstado; ?>)</i></h3>\n                </div>\n                <!-- /.col-lg-12 -->\n            </div>\n            <div class=\"row\">\n                <?php\n                    if ($ModoDesarrolladorPractico != \"-10000\")\n                        $ModoDesarrolladorPractico = 0;\n                                                          //$ClaseColumnas,                         $EstiloPanel,   $ClaseIconoFA,                      $Titulo,                                                                                $SubTitulo,                     $EnlaceTexto,               $EnlaceURL,                                                     $ClaseTextoTitulo=\"huge\")\n    echo PCO_ImprimirPanelSimpleDashboard(\"col-xs-12 col-sm-6 col-md-3 col-lg-2\", \"info\",   \"fa-users fa-3x\", PCO_ContarRegistrosTabla(\"app_clientes\"),   \"Clientes\",     \"Detalles\", \"javascript:document._centro_2.submit();\",   \"\");\n    echo PCO_ImprimirPanelSimpleDashboard(\"col-xs-12 col-sm-6 col-md-3 col-lg-2\", \"primary\",\"fa-cubes fa-3x\", PCO_ContarRegistrosTabla(\"app_productos\"),  \"Productos\",    \"Detalles\", \"javascript:document._centro_4.submit();\",   \"\");\n    echo PCO_ImprimirPanelSimpleDashboard(\"col-xs-12 col-sm-6 col-md-3 col-lg-2\", \"success\",\"fa-truck fa-3x\", PCO_ContarRegistrosTabla(\"app_proveedores\"),\"Proveedores\",  \"Detalles\", \"javascript:document._centro_6.submit();\",   \"\");\n    echo PCO_ImprimirPanelSimpleDashboard(\"col-xs-12 col-sm-6 col-md-3 col-lg-2\", \"default\",\"fa-money fa-3x\", PCO_ContarRegistrosTabla(\"app_ventas\"),     \"Ventas\",       \"Detalles\", \"javascript:document._centro_1.submit();\",   \"\");\n    //echo PCO_ImprimirPanelSimpleDashboard(\"col-xs-12 col-sm-6 col-md-3 col-lg-2\",   \"warning\",  \"fa-picture-o fa-3x\",   PCO_ContarRegistrosTabla(\"app_zona_cobertura\"), \"Zonas\",                \"Detalles\",    \"javascript:document._centro_3.submit();\",   \"\");\n                ?>\n            </div>\n    \n            <div class=\"row\">\n                    <div  class=\"col-md-4 col-lg-4 \">\n                        <div class=\"panel panel-default\">\n                            <div class=\"panel-heading\">\n                                <i class=\"fa fa-bar-chart-o fa-fw\"></i> Ventas por día, último mes\n                            </div>\n                            <div class=\"panel-body\">\n                                <div id=\"uso-general-aplicativo2\"></div>\n                            </div>\n                        </div>\n                    </div>\n                    <div  class=\" col-md-4 col-lg-4\">\n\n                            <div class=\"panel panel-default\">\n                                <div class=\"panel-heading\">\n                                    <i class=\"fa fa-money fa-fw\"></i> Últimas ventas ingresados\n                                </div>\n                                <div class=\"panel-body\">\n                                    <div id=\"\">\n\n                                    <table width=\"100%\">\n                                        <tr>\n                                            <td width=33% align=center>\n                                                    Hoy<br>\n                                                    <i class=\"fa-2x\" style=\"color:green;\"><b>   <?php echo PCO_EjecutarSQL(\"SELECT COUNT(id) FROM app_ventas WHERE fecha = DATE(NOW()) \")->fetchColumn(); ?>   </i></b>\n                                            </td>\n                                            <td width=33% align=center>\n                                                    Hace 1 semana<br>\n                                                    <i class=\"fa-2x\" style=\"color:navy;\"><b>    <?php echo PCO_EjecutarSQL(\"SELECT COUNT(id) FROM app_ventas WHERE fecha >= date_sub(now(),INTERVAL 1 WEEK) \")->fetchColumn(); ?>   </i></b>\n                                            </td>\n                                            <td width=33% align=center>\n                                                    Este mes<br>\n                                                    <i class=\"fa-2x\" style=\"color:red;\"><b>     <?php echo PCO_EjecutarSQL(\"SELECT COUNT(id) FROM app_ventas WHERE MONTH(fecha) = MONTH(NOW()) \")->fetchColumn(); ?>   </i></b>\n                                                    <!--<i class=\"fa-2x\" style=\"color:red;\"><b>     <?php echo PCO_EjecutarSQL(\"SELECT COUNT(id) FROM app_ventas WHERE fecha >= date_sub(now(),INTERVAL 4 WEEK) \")->fetchColumn(); ?>   </i></b>-->\n                                            </td>\n                                        </tr>\n                                    </table>\n\n                                    </div>\n                                </div>\n                            </div>\n\n                        <?php\n                            //$informe,$en_ventana=1,$formato=\"htm\",$estilo=\"Informes\",$embebido=0,$anular_acciones=0,$anular_piepagina=0,$anular_encabezado=0,$SQLPuro=\"\")\n                            //PCO_CargarInforme(7,1,\"\",\"\",1,1,0,0,\"\");\n                        ?>\n\n                    </div>            \n                    <div  class=\"col-md-4 col-lg-4\">\n                        <div class=\"panel panel-default\">\n                            <div class=\"panel-heading\">\n                                <i class=\"fa fa-bar-chart-o fa-fw\"></i> Resumen ventas por mes\n                            </div>\n                            <div class=\"panel-body\">\n                                <div id=\"conteos-generales-aplicacion2\"></div>\n                            </div>\n                        </div>\n                    </div>\n\n            </div>\n    </div>\n    <br>\n    <script language=\"JavaScript\">\n\n$(function() {\n\n    Morris.Area({\n        \n        //Nombre del marco que tiene el grafico\n        element: \'uso-general-aplicativo2\',\n        data: [\n        <?php\n            //Inicia la generacion del arreglo con los datos\n            $facturas = PCO_EjecutarSQL(\"SELECT fecha, cum(id) as cantidad FROM app_ventas WHERE fecha >= date_sub(date(now()), INTERVAL 30 DAY) GROUP BY fecha ORDER BY fecha\");\n            $cadena_datos = \"\";\n            while ($factura = $facturas->fetch())\n                {\n                    $fecha_grafico=$factura[\"fecha\"];\n                    $cantidad_grafico=$factura[\"cantidad\"];\n                    $cadena_datos.= \"\n                        {\n                            fecha: \'\".$fecha_grafico.\"\',\n                            Ventas: \".$cantidad_grafico.\"\n                        },\n                        \";\n                }\n            $cadena_datos = substr($cadena_datos, 0, -1);\n            echo $cadena_datos;\n        ?>\n        ],\n        xkey: \'fecha\',\n        ykeys: [\'Ventas\'],\n        labels: [\'Ventas\'],\n        pointSize: 2,\n        hideHover: \'auto\',\n        resize: true\n    });\n\n\n    Morris.Bar({\n      element: \'conteos-generales-aplicacion2\',\n      data: [\n        /*{ y: \'2006\', a: 100, b: 90 },\n        { y: \'2007\', a: 75,  b: 65 },\n        { y: \'2008\', a: 50,  b: 40 },\n        { y: \'2009\', a: 75,  b: 65 },\n        { y: \'2010\', a: 50,  b: 40 },\n        { y: \'2011\', a: 75,  b: 65 },\n        { y: \'2012\', a: 100, b: 90 }*/\n        <?php\n        PCO_EjecutarSQLUnaria(\"SET lc_time_names = \'es_ES\'\");\n        $resumenPagoMes = PCO_EjecutarSQL(\"SELECT MONTHNAME(fecha) Mes, COUNT(IF(fecha, 0, NULL)) Pago, COUNT(IF(ISNULL(fecha), 0, NULL)) noPago\n                                            FROM app_ventas\n                                            GROUP BY MONTHNAME(fecha); \");\n            $cadena_datos=\"\";\n            while ($mes = $resumenPagoMes->fetch())\n                $cadena_datos.= \"{ Mes: \'\" . ucfirst($mes[\'Mes\']) . \"\', Pago: \" . $mes[\'Pago\']. \", noPago: \" . $mes[\'noPago\']. \" },\";\n\n            $cadena_datos = substr($cadena_datos, 0, -1);\n            echo $cadena_datos;\n        ?>\n      ],\n      xkey: \'Mes\',\n      ykeys: [\'Pago\', \'noPago\'],\n      labels: [\'Pagado\', \'no Pagado\'],\n      resize: true,\n      barColors: [\'#26B99A\', \'#DE8244\']\n    });\n});\n\n\n</script>','A'),(307,'/home/u564937498/domains/cloudecoway.com/public_html/candy/mod/app/dashboard_desktop.php','2022-07-22 17:39:00','admin',153,8271,'<div class=\"well well-sm\" style=\"margin-bottom:0px;\">\n\n            <div class=\"row\">\n                <div class=\"col-xs-12 col-sm-12 col-md-12 col-lg-12\">\n                    <h3 class=\"page-header\" style=\"margin-top:0px;\"><b><i class=\"fa fa-dashboard fa-fw\"></i> <?php echo $MULTILANG_Aplicacion; ?></b> <i>(<?php echo $MULTILANG_MonEstado; ?>)</i></h3>\n                </div>\n                <!-- /.col-lg-12 -->\n            </div>\n            <div class=\"row\">\n                <?php\n                    if ($ModoDesarrolladorPractico != \"-10000\")\n                        $ModoDesarrolladorPractico = 0;\n                                                          //$ClaseColumnas,                         $EstiloPanel,   $ClaseIconoFA,                      $Titulo,                                                                                $SubTitulo,                     $EnlaceTexto,               $EnlaceURL,                                                     $ClaseTextoTitulo=\"huge\")\n    echo PCO_ImprimirPanelSimpleDashboard(\"col-xs-12 col-sm-6 col-md-3 col-lg-2\", \"info\",   \"fa-users fa-3x\", PCO_ContarRegistrosTabla(\"app_clientes\"),   \"Clientes\",     \"Detalles\", \"javascript:document._centro_2.submit();\",   \"\");\n    echo PCO_ImprimirPanelSimpleDashboard(\"col-xs-12 col-sm-6 col-md-3 col-lg-2\", \"primary\",\"fa-cubes fa-3x\", PCO_ContarRegistrosTabla(\"app_productos\"),  \"Productos\",    \"Detalles\", \"javascript:document._centro_4.submit();\",   \"\");\n    echo PCO_ImprimirPanelSimpleDashboard(\"col-xs-12 col-sm-6 col-md-3 col-lg-2\", \"success\",\"fa-truck fa-3x\", PCO_ContarRegistrosTabla(\"app_proveedores\"),\"Proveedores\",  \"Detalles\", \"javascript:document._centro_6.submit();\",   \"\");\n    echo PCO_ImprimirPanelSimpleDashboard(\"col-xs-12 col-sm-6 col-md-3 col-lg-2\", \"default\",\"fa-money fa-3x\", PCO_ContarRegistrosTabla(\"app_ventas\"),     \"Ventas\",       \"Detalles\", \"javascript:document._centro_1.submit();\",   \"\");\n    //echo PCO_ImprimirPanelSimpleDashboard(\"col-xs-12 col-sm-6 col-md-3 col-lg-2\",   \"warning\",  \"fa-picture-o fa-3x\",   PCO_ContarRegistrosTabla(\"app_zona_cobertura\"), \"Zonas\",                \"Detalles\",    \"javascript:document._centro_3.submit();\",   \"\");\n                ?>\n            </div>\n    \n            <div class=\"row\">\n                    <div  class=\"col-md-4 col-lg-4 \">\n                        <div class=\"panel panel-default\">\n                            <div class=\"panel-heading\">\n                                <i class=\"fa fa-bar-chart-o fa-fw\"></i> Ventas por día, último mes\n                            </div>\n                            <div class=\"panel-body\">\n                                <div id=\"uso-general-aplicativo2\"></div>\n                            </div>\n                        </div>\n                    </div>\n                    <div  class=\" col-md-4 col-lg-4\">\n\n                            <div class=\"panel panel-default\">\n                                <div class=\"panel-heading\">\n                                    <i class=\"fa fa-money fa-fw\"></i> Últimas ventas ingresados\n                                </div>\n                                <div class=\"panel-body\">\n                                    <div id=\"\">\n\n                                    <table width=\"100%\">\n                                        <tr>\n                                            <td width=33% align=center>\n                                                    Hoy<br>\n                                                    <i class=\"fa-2x\" style=\"color:green;\"><b>   <?php echo PCO_EjecutarSQL(\"SELECT COUNT(id) FROM app_ventas WHERE fecha = DATE(NOW()) \")->fetchColumn(); ?>   </i></b>\n                                            </td>\n                                            <td width=33% align=center>\n                                                    Hace 1 semana<br>\n                                                    <i class=\"fa-2x\" style=\"color:navy;\"><b>    <?php echo PCO_EjecutarSQL(\"SELECT COUNT(id) FROM app_ventas WHERE fecha >= date_sub(now(),INTERVAL 1 WEEK) \")->fetchColumn(); ?>   </i></b>\n                                            </td>\n                                            <td width=33% align=center>\n                                                    Este mes<br>\n                                                    <i class=\"fa-2x\" style=\"color:red;\"><b>     <?php echo PCO_EjecutarSQL(\"SELECT COUNT(id) FROM app_ventas WHERE MONTH(fecha) = MONTH(NOW()) \")->fetchColumn(); ?>   </i></b>\n                                                    <!--<i class=\"fa-2x\" style=\"color:red;\"><b>     <?php echo PCO_EjecutarSQL(\"SELECT COUNT(id) FROM app_ventas WHERE fecha >= date_sub(now(),INTERVAL 4 WEEK) \")->fetchColumn(); ?>   </i></b>-->\n                                            </td>\n                                        </tr>\n                                    </table>\n\n                                    </div>\n                                </div>\n                            </div>\n\n                        <?php\n                            //$informe,$en_ventana=1,$formato=\"htm\",$estilo=\"Informes\",$embebido=0,$anular_acciones=0,$anular_piepagina=0,$anular_encabezado=0,$SQLPuro=\"\")\n                            //PCO_CargarInforme(7,1,\"\",\"\",1,1,0,0,\"\");\n                        ?>\n\n                    </div>            \n                    <div  class=\"col-md-4 col-lg-4\">\n                        <div class=\"panel panel-default\">\n                            <div class=\"panel-heading\">\n                                <i class=\"fa fa-bar-chart-o fa-fw\"></i> Resumen ventas por mes\n                            </div>\n                            <div class=\"panel-body\">\n                                <div id=\"conteos-generales-aplicacion2\"></div>\n                            </div>\n                        </div>\n                    </div>\n\n            </div>\n    </div>\n    <br>\n    <script language=\"JavaScript\">\n\n$(function() {\n\n    Morris.Area({\n        \n        //Nombre del marco que tiene el grafico\n        element: \'uso-general-aplicativo2\',\n        data: [\n        <?php\n            //Inicia la generacion del arreglo con los datos\n            $facturas = PCO_EjecutarSQL(\"SELECT fecha, cum(id) as cantidad FROM app_ventas WHERE fecha >= date_sub(date(now()), INTERVAL 30 DAY) GROUP BY fecha ORDER BY fecha\");\n            $cadena_datos = \"\";\n            while ($factura = $facturas->fetch())\n                {\n                    $fecha_grafico=$factura[\"fecha\"];\n                    $cantidad_grafico=$factura[\"cantidad\"];\n                    $cadena_datos.= \"\n                        {\n                            fecha: \'\".$fecha_grafico.\"\',\n                            Ventas: \".$cantidad_grafico.\"\n                        },\n                        \";\n                }\n            $cadena_datos = substr($cadena_datos, 0, -1);\n            echo $cadena_datos;\n        ?>\n        ],\n        xkey: \'fecha\',\n        ykeys: [\'Ventas\'],\n        labels: [\'Ventas\'],\n        pointSize: 2,\n        hideHover: \'auto\',\n        resize: true\n    });\n\n\n    Morris.Bar({\n      element: \'conteos-generales-aplicacion2\',\n      data: [\n        /*{ y: \'2006\', a: 100, b: 90 },\n        { y: \'2007\', a: 75,  b: 65 },\n        { y: \'2008\', a: 50,  b: 40 },\n        { y: \'2009\', a: 75,  b: 65 },\n        { y: \'2010\', a: 50,  b: 40 },\n        { y: \'2011\', a: 75,  b: 65 },\n        { y: \'2012\', a: 100, b: 90 }*/\n        <?php\n        PCO_EjecutarSQLUnaria(\"SET lc_time_names = \'es_ES\'\");\n        $resumenPagoMes = PCO_EjecutarSQL(\"SELECT MONTHNAME(fecha) Mes, COUNT(IF(fecha, 0, NULL)) Pago, COUNT(IF(ISNULL(fecha), 0, NULL)) noPago\n                                            FROM app_ventas\n                                            GROUP BY MONTHNAME(fecha); \");\n            $cadena_datos=\"\";\n            while ($mes = $resumenPagoMes->fetch())\n                $cadena_datos.= \"{ Mes: \'\" . ucfirst($mes[\'Mes\']) . \"\', Pago: \" . $mes[\'Pago\']. \", noPago: \" . $mes[\'noPago\']. \" },\";\n\n            $cadena_datos = substr($cadena_datos, 0, -1);\n            echo $cadena_datos;\n        ?>\n      ],\n      xkey: \'Mes\',\n      ykeys: [\'Pago\', \'noPago\'],\n      labels: [\'Pagado\', \'no Pagado\'],\n      resize: true,\n      barColors: [\'#26B99A\', \'#DE8244\']\n    });\n});\n\n\n</script>','A'),(308,'/home/u564937498/domains/cloudecoway.com/public_html/candy/mod/app/dashboard_desktop.php','2022-07-22 17:41:00','admin',153,8258,'<div class=\"well well-sm\" style=\"margin-bottom:0px;\">\n\n            <div class=\"row\">\n                <div class=\"col-xs-12 col-sm-12 col-md-12 col-lg-12\">\n                    <h3 class=\"page-header\" style=\"margin-top:0px;\"><b><i class=\"fa fa-dashboard fa-fw\"></i> <?php echo $MULTILANG_Aplicacion; ?></b> <i>(<?php echo $MULTILANG_MonEstado; ?>)</i></h3>\n                </div>\n                <!-- /.col-lg-12 -->\n            </div>\n            <div class=\"row\">\n                <?php\n                    if ($ModoDesarrolladorPractico != \"-10000\")\n                        $ModoDesarrolladorPractico = 0;\n                                                          //$ClaseColumnas,                         $EstiloPanel,   $ClaseIconoFA,                      $Titulo,                                                                                $SubTitulo,                     $EnlaceTexto,               $EnlaceURL,                                                     $ClaseTextoTitulo=\"huge\")\n    echo PCO_ImprimirPanelSimpleDashboard(\"col-xs-12 col-sm-6 col-md-3 col-lg-2\", \"info\",   \"fa-users fa-3x\", PCO_ContarRegistrosTabla(\"app_clientes\"),   \"Clientes\",     \"Detalles\", \"javascript:document._centro_2.submit();\",   \"\");\n    echo PCO_ImprimirPanelSimpleDashboard(\"col-xs-12 col-sm-6 col-md-3 col-lg-2\", \"primary\",\"fa-cubes fa-3x\", PCO_ContarRegistrosTabla(\"app_productos\"),  \"Productos\",    \"Detalles\", \"javascript:document._centro_4.submit();\",   \"\");\n    echo PCO_ImprimirPanelSimpleDashboard(\"col-xs-12 col-sm-6 col-md-3 col-lg-2\", \"success\",\"fa-truck fa-3x\", PCO_ContarRegistrosTabla(\"app_proveedores\"),\"Proveedores\",  \"Detalles\", \"javascript:document._centro_6.submit();\",   \"\");\n    echo PCO_ImprimirPanelSimpleDashboard(\"col-xs-12 col-sm-6 col-md-3 col-lg-2\", \"default\",\"fa-money fa-3x\", PCO_ContarRegistrosTabla(\"app_ventas\"),     \"Ventas\",       \"Detalles\", \"javascript:document._centro_1.submit();\",   \"\");\n    //echo PCO_ImprimirPanelSimpleDashboard(\"col-xs-12 col-sm-6 col-md-3 col-lg-2\",   \"warning\",  \"fa-picture-o fa-3x\",   PCO_ContarRegistrosTabla(\"app_zona_cobertura\"), \"Zonas\",                \"Detalles\",    \"javascript:document._centro_3.submit();\",   \"\");\n                ?>\n            </div>\n    \n            <div class=\"row\">\n                    <div  class=\"col-md-4 col-lg-4 \">\n                        <div class=\"panel panel-default\">\n                            <div class=\"panel-heading\">\n                                <i class=\"fa fa-bar-chart-o fa-fw\"></i> Ventas por día, último mes\n                            </div>\n                            <div class=\"panel-body\">\n                                <div id=\"uso-general-aplicativo2\"></div>\n                            </div>\n                        </div>\n                    </div>\n                    <div  class=\" col-md-4 col-lg-4\">\n\n                            <div class=\"panel panel-default\">\n                                <div class=\"panel-heading\">\n                                    <i class=\"fa fa-money fa-fw\"></i> Últimas ventas ingresados\n                                </div>\n                                <div class=\"panel-body\">\n                                    <div id=\"\">\n\n                                    <table width=\"100%\">\n                                        <tr>\n                                            <td width=33% align=center>\n                                                    Hoy<br>\n                                                    <i class=\"fa-2x\" style=\"color:green;\"><b>   <?php echo PCO_EjecutarSQL(\"SELECT COUNT(id) FROM app_ventas WHERE fecha = DATE(NOW()) \")->fetchColumn(); ?>   </i></b>\n                                            </td>\n                                            <td width=33% align=center>\n                                                    Hace 1 semana<br>\n                                                    <i class=\"fa-2x\" style=\"color:navy;\"><b>    <?php echo PCO_EjecutarSQL(\"SELECT COUNT(id) FROM app_ventas WHERE fecha >= date_sub(now(),INTERVAL 1 WEEK) \")->fetchColumn(); ?>   </i></b>\n                                            </td>\n                                            <td width=33% align=center>\n                                                    Este mes<br>\n                                                    <i class=\"fa-2x\" style=\"color:red;\"><b>     <?php echo PCO_EjecutarSQL(\"SELECT COUNT(id) FROM app_ventas WHERE MONTH(fecha) = MONTH(NOW()) \")->fetchColumn(); ?>   </i></b>\n                                                    <!--<i class=\"fa-2x\" style=\"color:red;\"><b>     <?php echo PCO_EjecutarSQL(\"SELECT COUNT(id) FROM app_ventas WHERE fecha >= date_sub(now(),INTERVAL 4 WEEK) \")->fetchColumn(); ?>   </i></b>-->\n                                            </td>\n                                        </tr>\n                                    </table>\n\n                                    </div>\n                                </div>\n                            </div>\n\n                        <?php\n                            //$informe,$en_ventana=1,$formato=\"htm\",$estilo=\"Informes\",$embebido=0,$anular_acciones=0,$anular_piepagina=0,$anular_encabezado=0,$SQLPuro=\"\")\n                            //PCO_CargarInforme(7,1,\"\",\"\",1,1,0,0,\"\");\n                        ?>\n\n                    </div>            \n                    <div  class=\"col-md-4 col-lg-4\">\n                        <div class=\"panel panel-default\">\n                            <div class=\"panel-heading\">\n                                <i class=\"fa fa-bar-chart-o fa-fw\"></i> Resumen ventas por mes\n                            </div>\n                            <div class=\"panel-body\">\n                                <div id=\"conteos-generales-aplicacion2\"></div>\n                            </div>\n                        </div>\n                    </div>\n\n            </div>\n    </div>\n    <br>\n    <script language=\"JavaScript\">\n\n$(function() {\n\n    Morris.Area({\n        \n        //Nombre del marco que tiene el grafico\n        element: \'uso-general-aplicativo2\',\n        data: [\n        <?php\n            //Inicia la generacion del arreglo con los datos\n            $facturas = PCO_EjecutarSQL(\"SELECT fecha, count(id) as cantidad FROM app_ventas WHERE fecha >= date_sub(date(now()), INTERVAL 30 DAY) GROUP BY fecha ORDER BY fecha\");\n            $cadena_datos = \"\";\n            while ($factura = $facturas->fetch())\n                {\n                    $fecha_grafico=$factura[\"fecha\"];\n                    $cantidad_grafico=$factura[\"cantidad\"];\n                    $cadena_datos.= \"\n                        {\n                            fecha: \'\".$fecha_grafico.\"\',\n                            Ventas: \".$cantidad_grafico.\"\n                        },\n                        \";\n                }\n            $cadena_datos = substr($cadena_datos, 0, -1);\n            echo $cadena_datos;\n        ?>\n        ],\n        xkey: \'fecha\',\n        ykeys: [\'Ventas\'],\n        labels: [\'Ventas\'],\n        pointSize: 2,\n        hideHover: \'auto\',\n        resize: true\n    });\n\n\n    Morris.Bar({\n      element: \'conteos-generales-aplicacion2\',\n      data: [\n        /*{ y: \'2006\', a: 100, b: 90 },\n        { y: \'2007\', a: 75,  b: 65 },\n        { y: \'2008\', a: 50,  b: 40 },\n        { y: \'2009\', a: 75,  b: 65 },\n        { y: \'2010\', a: 50,  b: 40 },\n        { y: \'2011\', a: 75,  b: 65 },\n        { y: \'2012\', a: 100, b: 90 }*/\n        <?php\n        PCO_EjecutarSQLUnaria(\"SET lc_time_names = \'es_ES\'\");\n        $resumenPagoMes = PCO_EjecutarSQL(\"SELECT MONTHNAME(fecha) Mes, sum(total) Pago, COUNT(IF(ISNULL(fecha), 0, NULL)) noPago\n                                            FROM app_ventas\n                                            GROUP BY MONTHNAME(fecha); \");\n            $cadena_datos=\"\";\n            while ($mes = $resumenPagoMes->fetch())\n                $cadena_datos.= \"{ Mes: \'\" . ucfirst($mes[\'Mes\']) . \"\', Pago: \" . $mes[\'Pago\']. \", noPago: \" . $mes[\'noPago\']. \" },\";\n\n            $cadena_datos = substr($cadena_datos, 0, -1);\n            echo $cadena_datos;\n        ?>\n      ],\n      xkey: \'Mes\',\n      ykeys: [\'Pago\', \'noPago\'],\n      labels: [\'Pagado\', \'no Pagado\'],\n      resize: true,\n      barColors: [\'#26B99A\', \'#DE8244\']\n    });\n});\n\n\n</script>','A'),(309,'/home/u564937498/domains/cloudecoway.com/public_html/candy/mod/app/dashboard_desktop.php','2022-07-22 17:44:00','admin',153,8193,'<div class=\"well well-sm\" style=\"margin-bottom:0px;\">\n\n            <div class=\"row\">\n                <div class=\"col-xs-12 col-sm-12 col-md-12 col-lg-12\">\n                    <h3 class=\"page-header\" style=\"margin-top:0px;\"><b><i class=\"fa fa-dashboard fa-fw\"></i> <?php echo $MULTILANG_Aplicacion; ?></b> <i>(<?php echo $MULTILANG_MonEstado; ?>)</i></h3>\n                </div>\n                <!-- /.col-lg-12 -->\n            </div>\n            <div class=\"row\">\n                <?php\n                    if ($ModoDesarrolladorPractico != \"-10000\")\n                        $ModoDesarrolladorPractico = 0;\n                                                          //$ClaseColumnas,                         $EstiloPanel,   $ClaseIconoFA,                      $Titulo,                                                                                $SubTitulo,                     $EnlaceTexto,               $EnlaceURL,                                                     $ClaseTextoTitulo=\"huge\")\n    echo PCO_ImprimirPanelSimpleDashboard(\"col-xs-12 col-sm-6 col-md-3 col-lg-2\", \"info\",   \"fa-users fa-3x\", PCO_ContarRegistrosTabla(\"app_clientes\"),   \"Clientes\",     \"Detalles\", \"javascript:document._centro_2.submit();\",   \"\");\n    echo PCO_ImprimirPanelSimpleDashboard(\"col-xs-12 col-sm-6 col-md-3 col-lg-2\", \"primary\",\"fa-cubes fa-3x\", PCO_ContarRegistrosTabla(\"app_productos\"),  \"Productos\",    \"Detalles\", \"javascript:document._centro_4.submit();\",   \"\");\n    echo PCO_ImprimirPanelSimpleDashboard(\"col-xs-12 col-sm-6 col-md-3 col-lg-2\", \"success\",\"fa-truck fa-3x\", PCO_ContarRegistrosTabla(\"app_proveedores\"),\"Proveedores\",  \"Detalles\", \"javascript:document._centro_6.submit();\",   \"\");\n    echo PCO_ImprimirPanelSimpleDashboard(\"col-xs-12 col-sm-6 col-md-3 col-lg-2\", \"default\",\"fa-money fa-3x\", PCO_ContarRegistrosTabla(\"app_ventas\"),     \"Ventas\",       \"Detalles\", \"javascript:document._centro_1.submit();\",   \"\");\n    //echo PCO_ImprimirPanelSimpleDashboard(\"col-xs-12 col-sm-6 col-md-3 col-lg-2\",   \"warning\",  \"fa-picture-o fa-3x\",   PCO_ContarRegistrosTabla(\"app_zona_cobertura\"), \"Zonas\",                \"Detalles\",    \"javascript:document._centro_3.submit();\",   \"\");\n                ?>\n            </div>\n    \n            <div class=\"row\">\n                    <div  class=\"col-md-4 col-lg-4 \">\n                        <div class=\"panel panel-default\">\n                            <div class=\"panel-heading\">\n                                <i class=\"fa fa-bar-chart-o fa-fw\"></i> Ventas por día, último mes\n                            </div>\n                            <div class=\"panel-body\">\n                                <div id=\"uso-general-aplicativo2\"></div>\n                            </div>\n                        </div>\n                    </div>\n                    <div  class=\" col-md-4 col-lg-4\">\n\n                            <div class=\"panel panel-default\">\n                                <div class=\"panel-heading\">\n                                    <i class=\"fa fa-money fa-fw\"></i> Últimas ventas ingresados\n                                </div>\n                                <div class=\"panel-body\">\n                                    <div id=\"\">\n\n                                    <table width=\"100%\">\n                                        <tr>\n                                            <td width=33% align=center>\n                                                    Hoy<br>\n                                                    <i class=\"fa-2x\" style=\"color:green;\"><b>   <?php echo PCO_EjecutarSQL(\"SELECT COUNT(id) FROM app_ventas WHERE fecha = DATE(NOW()) \")->fetchColumn(); ?>   </i></b>\n                                            </td>\n                                            <td width=33% align=center>\n                                                    Hace 1 semana<br>\n                                                    <i class=\"fa-2x\" style=\"color:navy;\"><b>    <?php echo PCO_EjecutarSQL(\"SELECT COUNT(id) FROM app_ventas WHERE fecha >= date_sub(now(),INTERVAL 1 WEEK) \")->fetchColumn(); ?>   </i></b>\n                                            </td>\n                                            <td width=33% align=center>\n                                                    Este mes<br>\n                                                    <i class=\"fa-2x\" style=\"color:red;\"><b>     <?php echo PCO_EjecutarSQL(\"SELECT COUNT(id) FROM app_ventas WHERE MONTH(fecha) = MONTH(NOW()) \")->fetchColumn(); ?>   </i></b>\n                                                    <!--<i class=\"fa-2x\" style=\"color:red;\"><b>     <?php echo PCO_EjecutarSQL(\"SELECT COUNT(id) FROM app_ventas WHERE fecha >= date_sub(now(),INTERVAL 4 WEEK) \")->fetchColumn(); ?>   </i></b>-->\n                                            </td>\n                                        </tr>\n                                    </table>\n\n                                    </div>\n                                </div>\n                            </div>\n\n                        <?php\n                            //$informe,$en_ventana=1,$formato=\"htm\",$estilo=\"Informes\",$embebido=0,$anular_acciones=0,$anular_piepagina=0,$anular_encabezado=0,$SQLPuro=\"\")\n                            //PCO_CargarInforme(7,1,\"\",\"\",1,1,0,0,\"\");\n                        ?>\n\n                    </div>            \n                    <div  class=\"col-md-4 col-lg-4\">\n                        <div class=\"panel panel-default\">\n                            <div class=\"panel-heading\">\n                                <i class=\"fa fa-bar-chart-o fa-fw\"></i> Resumen ventas por mes\n                            </div>\n                            <div class=\"panel-body\">\n                                <div id=\"conteos-generales-aplicacion2\"></div>\n                            </div>\n                        </div>\n                    </div>\n\n            </div>\n    </div>\n    <br>\n    <script language=\"JavaScript\">\n\n$(function() {\n\n    Morris.Area({\n        \n        //Nombre del marco que tiene el grafico\n        element: \'uso-general-aplicativo2\',\n        data: [\n        <?php\n            //Inicia la generacion del arreglo con los datos\n            $facturas = PCO_EjecutarSQL(\"SELECT fecha, count(id) as cantidad FROM app_ventas WHERE fecha >= date_sub(date(now()), INTERVAL 30 DAY) GROUP BY fecha ORDER BY fecha\");\n            $cadena_datos = \"\";\n            while ($factura = $facturas->fetch())\n                {\n                    $fecha_grafico=$factura[\"fecha\"];\n                    $cantidad_grafico=$factura[\"cantidad\"];\n                    $cadena_datos.= \"\n                        {\n                            fecha: \'\".$fecha_grafico.\"\',\n                            Ventas: \".$cantidad_grafico.\"\n                        },\n                        \";\n                }\n            $cadena_datos = substr($cadena_datos, 0, -1);\n            echo $cadena_datos;\n        ?>\n        ],\n        xkey: \'fecha\',\n        ykeys: [\'Ventas\'],\n        labels: [\'Ventas\'],\n        pointSize: 2,\n        hideHover: \'auto\',\n        resize: true\n    });\n\n\n    Morris.Bar({\n      element: \'conteos-generales-aplicacion2\',\n      data: [\n        /*{ y: \'2006\', a: 100, b: 90 },\n        { y: \'2007\', a: 75,  b: 65 },\n        { y: \'2008\', a: 50,  b: 40 },\n        { y: \'2009\', a: 75,  b: 65 },\n        { y: \'2010\', a: 50,  b: 40 },\n        { y: \'2011\', a: 75,  b: 65 },\n        { y: \'2012\', a: 100, b: 90 }*/\n        <?php\n        PCO_EjecutarSQLUnaria(\"SET lc_time_names = \'es_ES\'\");\n        $resumenPagoMes = PCO_EjecutarSQL(\"SELECT MONTHNAME(fecha) Mes, sum(total) Total Mes\n                                            FROM app_ventas\n                                            GROUP BY MONTHNAME(fecha); \");\n            $cadena_datos=\"\";\n            while ($mes = $resumenPagoMes->fetch())\n                $cadena_datos.= \"{ Mes: \'\" . ucfirst($mes[\'Mes\']) . \"\', total: \" . $mes[\'Total\'].  \" },\";\n\n            $cadena_datos = substr($cadena_datos, 0, -1);\n            echo $cadena_datos;\n        ?>\n      ],\n      xkey: \'Mes\',\n      ykeys: [\'Pago\', \'noPago\'],\n      labels: [\'Pagado\', \'no Pagado\'],\n      resize: true,\n      barColors: [\'#26B99A\', \'#DE8244\']\n    });\n});\n\n\n</script>','A'),(310,'/home/u564937498/domains/cloudecoway.com/public_html/candy/mod/app/dashboard_desktop.php','2022-07-22 17:44:00','admin',153,8221,'<div class=\"well well-sm\" style=\"margin-bottom:0px;\">\n\n            <div class=\"row\">\n                <div class=\"col-xs-12 col-sm-12 col-md-12 col-lg-12\">\n                    <h3 class=\"page-header\" style=\"margin-top:0px;\"><b><i class=\"fa fa-dashboard fa-fw\"></i> <?php echo $MULTILANG_Aplicacion; ?></b> <i>(<?php echo $MULTILANG_MonEstado; ?>)</i></h3>\n                </div>\n                <!-- /.col-lg-12 -->\n            </div>\n            <div class=\"row\">\n                <?php\n                    if ($ModoDesarrolladorPractico != \"-10000\")\n                        $ModoDesarrolladorPractico = 0;\n                                                          //$ClaseColumnas,                         $EstiloPanel,   $ClaseIconoFA,                      $Titulo,                                                                                $SubTitulo,                     $EnlaceTexto,               $EnlaceURL,                                                     $ClaseTextoTitulo=\"huge\")\n    echo PCO_ImprimirPanelSimpleDashboard(\"col-xs-12 col-sm-6 col-md-3 col-lg-2\", \"info\",   \"fa-users fa-3x\", PCO_ContarRegistrosTabla(\"app_clientes\"),   \"Clientes\",     \"Detalles\", \"javascript:document._centro_2.submit();\",   \"\");\n    echo PCO_ImprimirPanelSimpleDashboard(\"col-xs-12 col-sm-6 col-md-3 col-lg-2\", \"primary\",\"fa-cubes fa-3x\", PCO_ContarRegistrosTabla(\"app_productos\"),  \"Productos\",    \"Detalles\", \"javascript:document._centro_4.submit();\",   \"\");\n    echo PCO_ImprimirPanelSimpleDashboard(\"col-xs-12 col-sm-6 col-md-3 col-lg-2\", \"success\",\"fa-truck fa-3x\", PCO_ContarRegistrosTabla(\"app_proveedores\"),\"Proveedores\",  \"Detalles\", \"javascript:document._centro_6.submit();\",   \"\");\n    echo PCO_ImprimirPanelSimpleDashboard(\"col-xs-12 col-sm-6 col-md-3 col-lg-2\", \"default\",\"fa-money fa-3x\", PCO_ContarRegistrosTabla(\"app_ventas\"),     \"Ventas\",       \"Detalles\", \"javascript:document._centro_1.submit();\",   \"\");\n    //echo PCO_ImprimirPanelSimpleDashboard(\"col-xs-12 col-sm-6 col-md-3 col-lg-2\",   \"warning\",  \"fa-picture-o fa-3x\",   PCO_ContarRegistrosTabla(\"app_zona_cobertura\"), \"Zonas\",                \"Detalles\",    \"javascript:document._centro_3.submit();\",   \"\");\n                ?>\n            </div>\n    \n            <div class=\"row\">\n                    <div  class=\"col-md-4 col-lg-4 \">\n                        <div class=\"panel panel-default\">\n                            <div class=\"panel-heading\">\n                                <i class=\"fa fa-bar-chart-o fa-fw\"></i> Ventas por día, último mes\n                            </div>\n                            <div class=\"panel-body\">\n                                <div id=\"uso-general-aplicativo2\"></div>\n                            </div>\n                        </div>\n                    </div>\n                    <div  class=\" col-md-4 col-lg-4\">\n\n                            <div class=\"panel panel-default\">\n                                <div class=\"panel-heading\">\n                                    <i class=\"fa fa-money fa-fw\"></i> Últimas ventas ingresados\n                                </div>\n                                <div class=\"panel-body\">\n                                    <div id=\"\">\n\n                                    <table width=\"100%\">\n                                        <tr>\n                                            <td width=33% align=center>\n                                                    Hoy<br>\n                                                    <i class=\"fa-2x\" style=\"color:green;\"><b>   <?php echo PCO_EjecutarSQL(\"SELECT COUNT(id) FROM app_ventas WHERE fecha = DATE(NOW()) \")->fetchColumn(); ?>   </i></b>\n                                            </td>\n                                            <td width=33% align=center>\n                                                    Hace 1 semana<br>\n                                                    <i class=\"fa-2x\" style=\"color:navy;\"><b>    <?php echo PCO_EjecutarSQL(\"SELECT COUNT(id) FROM app_ventas WHERE fecha >= date_sub(now(),INTERVAL 1 WEEK) \")->fetchColumn(); ?>   </i></b>\n                                            </td>\n                                            <td width=33% align=center>\n                                                    Este mes<br>\n                                                    <i class=\"fa-2x\" style=\"color:red;\"><b>     <?php echo PCO_EjecutarSQL(\"SELECT COUNT(id) FROM app_ventas WHERE MONTH(fecha) = MONTH(NOW()) \")->fetchColumn(); ?>   </i></b>\n                                                    <!--<i class=\"fa-2x\" style=\"color:red;\"><b>     <?php echo PCO_EjecutarSQL(\"SELECT COUNT(id) FROM app_ventas WHERE fecha >= date_sub(now(),INTERVAL 4 WEEK) \")->fetchColumn(); ?>   </i></b>-->\n                                            </td>\n                                        </tr>\n                                    </table>\n\n                                    </div>\n                                </div>\n                            </div>\n\n                        <?php\n                            //$informe,$en_ventana=1,$formato=\"htm\",$estilo=\"Informes\",$embebido=0,$anular_acciones=0,$anular_piepagina=0,$anular_encabezado=0,$SQLPuro=\"\")\n                            //PCO_CargarInforme(7,1,\"\",\"\",1,1,0,0,\"\");\n                        ?>\n\n                    </div>            \n                    <div  class=\"col-md-4 col-lg-4\">\n                        <div class=\"panel panel-default\">\n                            <div class=\"panel-heading\">\n                                <i class=\"fa fa-bar-chart-o fa-fw\"></i> Resumen ventas por mes\n                            </div>\n                            <div class=\"panel-body\">\n                                <div id=\"conteos-generales-aplicacion2\"></div>\n                            </div>\n                        </div>\n                    </div>\n\n            </div>\n    </div>\n    <br>\n    <script language=\"JavaScript\">\n\n$(function() {\n\n    Morris.Area({\n        \n        //Nombre del marco que tiene el grafico\n        element: \'uso-general-aplicativo2\',\n        data: [\n        <?php\n            //Inicia la generacion del arreglo con los datos\n            $facturas = PCO_EjecutarSQL(\"SELECT fecha, count(id) as cantidad FROM app_ventas WHERE fecha >= date_sub(date(now()), INTERVAL 30 DAY) GROUP BY fecha ORDER BY fecha\");\n            $cadena_datos = \"\";\n            while ($factura = $facturas->fetch())\n                {\n                    $fecha_grafico=$factura[\"fecha\"];\n                    $cantidad_grafico=$factura[\"cantidad\"];\n                    $cadena_datos.= \"\n                        {\n                            fecha: \'\".$fecha_grafico.\"\',\n                            Ventas: \".$cantidad_grafico.\"\n                        },\n                        \";\n                }\n            $cadena_datos = substr($cadena_datos, 0, -1);\n            echo $cadena_datos;\n        ?>\n        ],\n        xkey: \'fecha\',\n        ykeys: [\'Ventas\'],\n        labels: [\'Ventas\'],\n        pointSize: 2,\n        hideHover: \'auto\',\n        resize: true\n    });\n\n\n    Morris.Bar({\n      element: \'conteos-generales-aplicacion2\',\n      data: [\n        /*{ y: \'2006\', a: 100, b: 90 },\n        { y: \'2007\', a: 75,  b: 65 },\n        { y: \'2008\', a: 50,  b: 40 },\n        { y: \'2009\', a: 75,  b: 65 },\n        { y: \'2010\', a: 50,  b: 40 },\n        { y: \'2011\', a: 75,  b: 65 },\n        { y: \'2012\', a: 100, b: 90 }*/\n        <?php\n        PCO_EjecutarSQLUnaria(\"SET lc_time_names = \'es_ES\'\");\n        $resumenPagoMes = PCO_EjecutarSQL(\"SELECT MONTHNAME(fecha) Mes, sum(total) Total Mes\n                                            FROM app_ventas\n                                            GROUP BY MONTHNAME(fecha); \");\n            $cadena_datos=\"\";\n            while ($mes = $resumenPagoMes->fetch())\n                $cadena_datos.= \"{ Mes: \'\" . ucfirst($mes[\'Mes\']) . \"\', Pago: \" . $mes[\'Pago\']. \", noPago: \" . $mes[\'noPago\']. \" },\";\n\n            $cadena_datos = substr($cadena_datos, 0, -1);\n            echo $cadena_datos;\n        ?>\n      ],\n      xkey: \'Mes\',\n      ykeys: [\'Pago\', \'noPago\'],\n      labels: [\'Pagado\', \'no Pagado\'],\n      resize: true,\n      barColors: [\'#26B99A\', \'#DE8244\']\n    });\n});\n\n\n</script>','A'),(311,'/home/u564937498/domains/cloudecoway.com/public_html/candy/mod/app/dashboard_desktop.php','2022-07-22 17:44:00','admin',153,8217,'<div class=\"well well-sm\" style=\"margin-bottom:0px;\">\n\n            <div class=\"row\">\n                <div class=\"col-xs-12 col-sm-12 col-md-12 col-lg-12\">\n                    <h3 class=\"page-header\" style=\"margin-top:0px;\"><b><i class=\"fa fa-dashboard fa-fw\"></i> <?php echo $MULTILANG_Aplicacion; ?></b> <i>(<?php echo $MULTILANG_MonEstado; ?>)</i></h3>\n                </div>\n                <!-- /.col-lg-12 -->\n            </div>\n            <div class=\"row\">\n                <?php\n                    if ($ModoDesarrolladorPractico != \"-10000\")\n                        $ModoDesarrolladorPractico = 0;\n                                                          //$ClaseColumnas,                         $EstiloPanel,   $ClaseIconoFA,                      $Titulo,                                                                                $SubTitulo,                     $EnlaceTexto,               $EnlaceURL,                                                     $ClaseTextoTitulo=\"huge\")\n    echo PCO_ImprimirPanelSimpleDashboard(\"col-xs-12 col-sm-6 col-md-3 col-lg-2\", \"info\",   \"fa-users fa-3x\", PCO_ContarRegistrosTabla(\"app_clientes\"),   \"Clientes\",     \"Detalles\", \"javascript:document._centro_2.submit();\",   \"\");\n    echo PCO_ImprimirPanelSimpleDashboard(\"col-xs-12 col-sm-6 col-md-3 col-lg-2\", \"primary\",\"fa-cubes fa-3x\", PCO_ContarRegistrosTabla(\"app_productos\"),  \"Productos\",    \"Detalles\", \"javascript:document._centro_4.submit();\",   \"\");\n    echo PCO_ImprimirPanelSimpleDashboard(\"col-xs-12 col-sm-6 col-md-3 col-lg-2\", \"success\",\"fa-truck fa-3x\", PCO_ContarRegistrosTabla(\"app_proveedores\"),\"Proveedores\",  \"Detalles\", \"javascript:document._centro_6.submit();\",   \"\");\n    echo PCO_ImprimirPanelSimpleDashboard(\"col-xs-12 col-sm-6 col-md-3 col-lg-2\", \"default\",\"fa-money fa-3x\", PCO_ContarRegistrosTabla(\"app_ventas\"),     \"Ventas\",       \"Detalles\", \"javascript:document._centro_1.submit();\",   \"\");\n    //echo PCO_ImprimirPanelSimpleDashboard(\"col-xs-12 col-sm-6 col-md-3 col-lg-2\",   \"warning\",  \"fa-picture-o fa-3x\",   PCO_ContarRegistrosTabla(\"app_zona_cobertura\"), \"Zonas\",                \"Detalles\",    \"javascript:document._centro_3.submit();\",   \"\");\n                ?>\n            </div>\n    \n            <div class=\"row\">\n                    <div  class=\"col-md-4 col-lg-4 \">\n                        <div class=\"panel panel-default\">\n                            <div class=\"panel-heading\">\n                                <i class=\"fa fa-bar-chart-o fa-fw\"></i> Ventas por día, último mes\n                            </div>\n                            <div class=\"panel-body\">\n                                <div id=\"uso-general-aplicativo2\"></div>\n                            </div>\n                        </div>\n                    </div>\n                    <div  class=\" col-md-4 col-lg-4\">\n\n                            <div class=\"panel panel-default\">\n                                <div class=\"panel-heading\">\n                                    <i class=\"fa fa-money fa-fw\"></i> Últimas ventas ingresados\n                                </div>\n                                <div class=\"panel-body\">\n                                    <div id=\"\">\n\n                                    <table width=\"100%\">\n                                        <tr>\n                                            <td width=33% align=center>\n                                                    Hoy<br>\n                                                    <i class=\"fa-2x\" style=\"color:green;\"><b>   <?php echo PCO_EjecutarSQL(\"SELECT COUNT(id) FROM app_ventas WHERE fecha = DATE(NOW()) \")->fetchColumn(); ?>   </i></b>\n                                            </td>\n                                            <td width=33% align=center>\n                                                    Hace 1 semana<br>\n                                                    <i class=\"fa-2x\" style=\"color:navy;\"><b>    <?php echo PCO_EjecutarSQL(\"SELECT COUNT(id) FROM app_ventas WHERE fecha >= date_sub(now(),INTERVAL 1 WEEK) \")->fetchColumn(); ?>   </i></b>\n                                            </td>\n                                            <td width=33% align=center>\n                                                    Este mes<br>\n                                                    <i class=\"fa-2x\" style=\"color:red;\"><b>     <?php echo PCO_EjecutarSQL(\"SELECT COUNT(id) FROM app_ventas WHERE MONTH(fecha) = MONTH(NOW()) \")->fetchColumn(); ?>   </i></b>\n                                                    <!--<i class=\"fa-2x\" style=\"color:red;\"><b>     <?php echo PCO_EjecutarSQL(\"SELECT COUNT(id) FROM app_ventas WHERE fecha >= date_sub(now(),INTERVAL 4 WEEK) \")->fetchColumn(); ?>   </i></b>-->\n                                            </td>\n                                        </tr>\n                                    </table>\n\n                                    </div>\n                                </div>\n                            </div>\n\n                        <?php\n                            //$informe,$en_ventana=1,$formato=\"htm\",$estilo=\"Informes\",$embebido=0,$anular_acciones=0,$anular_piepagina=0,$anular_encabezado=0,$SQLPuro=\"\")\n                            //PCO_CargarInforme(7,1,\"\",\"\",1,1,0,0,\"\");\n                        ?>\n\n                    </div>            \n                    <div  class=\"col-md-4 col-lg-4\">\n                        <div class=\"panel panel-default\">\n                            <div class=\"panel-heading\">\n                                <i class=\"fa fa-bar-chart-o fa-fw\"></i> Resumen ventas por mes\n                            </div>\n                            <div class=\"panel-body\">\n                                <div id=\"conteos-generales-aplicacion2\"></div>\n                            </div>\n                        </div>\n                    </div>\n\n            </div>\n    </div>\n    <br>\n    <script language=\"JavaScript\">\n\n$(function() {\n\n    Morris.Area({\n        \n        //Nombre del marco que tiene el grafico\n        element: \'uso-general-aplicativo2\',\n        data: [\n        <?php\n            //Inicia la generacion del arreglo con los datos\n            $facturas = PCO_EjecutarSQL(\"SELECT fecha, count(id) as cantidad FROM app_ventas WHERE fecha >= date_sub(date(now()), INTERVAL 30 DAY) GROUP BY fecha ORDER BY fecha\");\n            $cadena_datos = \"\";\n            while ($factura = $facturas->fetch())\n                {\n                    $fecha_grafico=$factura[\"fecha\"];\n                    $cantidad_grafico=$factura[\"cantidad\"];\n                    $cadena_datos.= \"\n                        {\n                            fecha: \'\".$fecha_grafico.\"\',\n                            Ventas: \".$cantidad_grafico.\"\n                        },\n                        \";\n                }\n            $cadena_datos = substr($cadena_datos, 0, -1);\n            echo $cadena_datos;\n        ?>\n        ],\n        xkey: \'fecha\',\n        ykeys: [\'Ventas\'],\n        labels: [\'Ventas\'],\n        pointSize: 2,\n        hideHover: \'auto\',\n        resize: true\n    });\n\n\n    Morris.Bar({\n      element: \'conteos-generales-aplicacion2\',\n      data: [\n        /*{ y: \'2006\', a: 100, b: 90 },\n        { y: \'2007\', a: 75,  b: 65 },\n        { y: \'2008\', a: 50,  b: 40 },\n        { y: \'2009\', a: 75,  b: 65 },\n        { y: \'2010\', a: 50,  b: 40 },\n        { y: \'2011\', a: 75,  b: 65 },\n        { y: \'2012\', a: 100, b: 90 }*/\n        <?php\n        PCO_EjecutarSQLUnaria(\"SET lc_time_names = \'es_ES\'\");\n        $resumenPagoMes = PCO_EjecutarSQL(\"SELECT MONTHNAME(fecha) Mes, sum(total) Total\n                                            FROM app_ventas\n                                            GROUP BY MONTHNAME(fecha); \");\n            $cadena_datos=\"\";\n            while ($mes = $resumenPagoMes->fetch())\n                $cadena_datos.= \"{ Mes: \'\" . ucfirst($mes[\'Mes\']) . \"\', Pago: \" . $mes[\'Pago\']. \", noPago: \" . $mes[\'noPago\']. \" },\";\n\n            $cadena_datos = substr($cadena_datos, 0, -1);\n            echo $cadena_datos;\n        ?>\n      ],\n      xkey: \'Mes\',\n      ykeys: [\'Pago\', \'noPago\'],\n      labels: [\'Pagado\', \'no Pagado\'],\n      resize: true,\n      barColors: [\'#26B99A\', \'#DE8244\']\n    });\n});\n\n\n</script>','A'),(312,'/home/u564937498/domains/cloudecoway.com/public_html/candy/mod/app/dashboard_desktop.php','2022-07-22 17:45:00','admin',153,8219,'<div class=\"well well-sm\" style=\"margin-bottom:0px;\">\n\n            <div class=\"row\">\n                <div class=\"col-xs-12 col-sm-12 col-md-12 col-lg-12\">\n                    <h3 class=\"page-header\" style=\"margin-top:0px;\"><b><i class=\"fa fa-dashboard fa-fw\"></i> <?php echo $MULTILANG_Aplicacion; ?></b> <i>(<?php echo $MULTILANG_MonEstado; ?>)</i></h3>\n                </div>\n                <!-- /.col-lg-12 -->\n            </div>\n            <div class=\"row\">\n                <?php\n                    if ($ModoDesarrolladorPractico != \"-10000\")\n                        $ModoDesarrolladorPractico = 0;\n                                                          //$ClaseColumnas,                         $EstiloPanel,   $ClaseIconoFA,                      $Titulo,                                                                                $SubTitulo,                     $EnlaceTexto,               $EnlaceURL,                                                     $ClaseTextoTitulo=\"huge\")\n    echo PCO_ImprimirPanelSimpleDashboard(\"col-xs-12 col-sm-6 col-md-3 col-lg-2\", \"info\",   \"fa-users fa-3x\", PCO_ContarRegistrosTabla(\"app_clientes\"),   \"Clientes\",     \"Detalles\", \"javascript:document._centro_2.submit();\",   \"\");\n    echo PCO_ImprimirPanelSimpleDashboard(\"col-xs-12 col-sm-6 col-md-3 col-lg-2\", \"primary\",\"fa-cubes fa-3x\", PCO_ContarRegistrosTabla(\"app_productos\"),  \"Productos\",    \"Detalles\", \"javascript:document._centro_4.submit();\",   \"\");\n    echo PCO_ImprimirPanelSimpleDashboard(\"col-xs-12 col-sm-6 col-md-3 col-lg-2\", \"success\",\"fa-truck fa-3x\", PCO_ContarRegistrosTabla(\"app_proveedores\"),\"Proveedores\",  \"Detalles\", \"javascript:document._centro_6.submit();\",   \"\");\n    echo PCO_ImprimirPanelSimpleDashboard(\"col-xs-12 col-sm-6 col-md-3 col-lg-2\", \"default\",\"fa-money fa-3x\", PCO_ContarRegistrosTabla(\"app_ventas\"),     \"Ventas\",       \"Detalles\", \"javascript:document._centro_1.submit();\",   \"\");\n    //echo PCO_ImprimirPanelSimpleDashboard(\"col-xs-12 col-sm-6 col-md-3 col-lg-2\",   \"warning\",  \"fa-picture-o fa-3x\",   PCO_ContarRegistrosTabla(\"app_zona_cobertura\"), \"Zonas\",                \"Detalles\",    \"javascript:document._centro_3.submit();\",   \"\");\n                ?>\n            </div>\n    \n            <div class=\"row\">\n                    <div  class=\"col-md-4 col-lg-4 \">\n                        <div class=\"panel panel-default\">\n                            <div class=\"panel-heading\">\n                                <i class=\"fa fa-bar-chart-o fa-fw\"></i> Ventas por día, último mes\n                            </div>\n                            <div class=\"panel-body\">\n                                <div id=\"uso-general-aplicativo2\"></div>\n                            </div>\n                        </div>\n                    </div>\n                    <div  class=\" col-md-4 col-lg-4\">\n\n                            <div class=\"panel panel-default\">\n                                <div class=\"panel-heading\">\n                                    <i class=\"fa fa-money fa-fw\"></i> Últimas ventas ingresados\n                                </div>\n                                <div class=\"panel-body\">\n                                    <div id=\"\">\n\n                                    <table width=\"100%\">\n                                        <tr>\n                                            <td width=33% align=center>\n                                                    Hoy<br>\n                                                    <i class=\"fa-2x\" style=\"color:green;\"><b>   <?php echo PCO_EjecutarSQL(\"SELECT COUNT(id) FROM app_ventas WHERE fecha = DATE(NOW()) \")->fetchColumn(); ?>   </i></b>\n                                            </td>\n                                            <td width=33% align=center>\n                                                    Hace 1 semana<br>\n                                                    <i class=\"fa-2x\" style=\"color:navy;\"><b>    <?php echo PCO_EjecutarSQL(\"SELECT COUNT(id) FROM app_ventas WHERE fecha >= date_sub(now(),INTERVAL 1 WEEK) \")->fetchColumn(); ?>   </i></b>\n                                            </td>\n                                            <td width=33% align=center>\n                                                    Este mes<br>\n                                                    <i class=\"fa-2x\" style=\"color:red;\"><b>     <?php echo PCO_EjecutarSQL(\"SELECT COUNT(id) FROM app_ventas WHERE MONTH(fecha) = MONTH(NOW()) \")->fetchColumn(); ?>   </i></b>\n                                                    <!--<i class=\"fa-2x\" style=\"color:red;\"><b>     <?php echo PCO_EjecutarSQL(\"SELECT COUNT(id) FROM app_ventas WHERE fecha >= date_sub(now(),INTERVAL 4 WEEK) \")->fetchColumn(); ?>   </i></b>-->\n                                            </td>\n                                        </tr>\n                                    </table>\n\n                                    </div>\n                                </div>\n                            </div>\n\n                        <?php\n                            //$informe,$en_ventana=1,$formato=\"htm\",$estilo=\"Informes\",$embebido=0,$anular_acciones=0,$anular_piepagina=0,$anular_encabezado=0,$SQLPuro=\"\")\n                            //PCO_CargarInforme(7,1,\"\",\"\",1,1,0,0,\"\");\n                        ?>\n\n                    </div>            \n                    <div  class=\"col-md-4 col-lg-4\">\n                        <div class=\"panel panel-default\">\n                            <div class=\"panel-heading\">\n                                <i class=\"fa fa-bar-chart-o fa-fw\"></i> Resumen ventas por mes\n                            </div>\n                            <div class=\"panel-body\">\n                                <div id=\"conteos-generales-aplicacion2\"></div>\n                            </div>\n                        </div>\n                    </div>\n\n            </div>\n    </div>\n    <br>\n    <script language=\"JavaScript\">\n\n$(function() {\n\n    Morris.Area({\n        \n        //Nombre del marco que tiene el grafico\n        element: \'uso-general-aplicativo2\',\n        data: [\n        <?php\n            //Inicia la generacion del arreglo con los datos\n            $facturas = PCO_EjecutarSQL(\"SELECT fecha, count(id) as cantidad FROM app_ventas WHERE fecha >= date_sub(date(now()), INTERVAL 30 DAY) GROUP BY fecha ORDER BY fecha\");\n            $cadena_datos = \"\";\n            while ($factura = $facturas->fetch())\n                {\n                    $fecha_grafico=$factura[\"fecha\"];\n                    $cantidad_grafico=$factura[\"cantidad\"];\n                    $cadena_datos.= \"\n                        {\n                            fecha: \'\".$fecha_grafico.\"\',\n                            Ventas: \".$cantidad_grafico.\"\n                        },\n                        \";\n                }\n            $cadena_datos = substr($cadena_datos, 0, -1);\n            echo $cadena_datos;\n        ?>\n        ],\n        xkey: \'fecha\',\n        ykeys: [\'Ventas\'],\n        labels: [\'Ventas\'],\n        pointSize: 2,\n        hideHover: \'auto\',\n        resize: true\n    });\n\n\n    Morris.Bar({\n      element: \'conteos-generales-aplicacion2\',\n      data: [\n        /*{ y: \'2006\', a: 100, b: 90 },\n        { y: \'2007\', a: 75,  b: 65 },\n        { y: \'2008\', a: 50,  b: 40 },\n        { y: \'2009\', a: 75,  b: 65 },\n        { y: \'2010\', a: 50,  b: 40 },\n        { y: \'2011\', a: 75,  b: 65 },\n        { y: \'2012\', a: 100, b: 90 }*/\n        <?php\n        PCO_EjecutarSQLUnaria(\"SET lc_time_names = \'es_ES\'\");\n        $resumenPagoMes = PCO_EjecutarSQL(\"SELECT MONTHNAME(fecha) Mes, sum(total) Total\n                                            FROM app_ventas\n                                            GROUP BY MONTHNAME(fecha); \");\n            $cadena_datos=\"\";\n            while ($mes = $resumenPagoMes->fetch())\n                $cadena_datos.= \"{ Mes: \'\" . ucfirst($mes[\'Mes\']) . \"\', Total: \" . $mes[\'Total\']. \", noPago: \" . $mes[\'noPago\']. \" },\";\n\n            $cadena_datos = substr($cadena_datos, 0, -1);\n            echo $cadena_datos;\n        ?>\n      ],\n      xkey: \'Mes\',\n      ykeys: [\'Total\', \'noPago\'],\n      labels: [\'Total\', \'no Pagado\'],\n      resize: true,\n      barColors: [\'#26B99A\', \'#DE8244\']\n    });\n});\n\n\n</script>','A'),(313,'/home/u564937498/domains/cloudecoway.com/public_html/candy/mod/app/dashboard_desktop.php','2022-07-22 17:45:00','admin',153,8258,'<div class=\"well well-sm\" style=\"margin-bottom:0px;\">\n\n            <div class=\"row\">\n                <div class=\"col-xs-12 col-sm-12 col-md-12 col-lg-12\">\n                    <h3 class=\"page-header\" style=\"margin-top:0px;\"><b><i class=\"fa fa-dashboard fa-fw\"></i> <?php echo $MULTILANG_Aplicacion; ?></b> <i>(<?php echo $MULTILANG_MonEstado; ?>)</i></h3>\n                </div>\n                <!-- /.col-lg-12 -->\n            </div>\n            <div class=\"row\">\n                <?php\n                    if ($ModoDesarrolladorPractico != \"-10000\")\n                        $ModoDesarrolladorPractico = 0;\n                                                          //$ClaseColumnas,                         $EstiloPanel,   $ClaseIconoFA,                      $Titulo,                                                                                $SubTitulo,                     $EnlaceTexto,               $EnlaceURL,                                                     $ClaseTextoTitulo=\"huge\")\n    echo PCO_ImprimirPanelSimpleDashboard(\"col-xs-12 col-sm-6 col-md-3 col-lg-2\", \"info\",   \"fa-users fa-3x\", PCO_ContarRegistrosTabla(\"app_clientes\"),   \"Clientes\",     \"Detalles\", \"javascript:document._centro_2.submit();\",   \"\");\n    echo PCO_ImprimirPanelSimpleDashboard(\"col-xs-12 col-sm-6 col-md-3 col-lg-2\", \"primary\",\"fa-cubes fa-3x\", PCO_ContarRegistrosTabla(\"app_productos\"),  \"Productos\",    \"Detalles\", \"javascript:document._centro_4.submit();\",   \"\");\n    echo PCO_ImprimirPanelSimpleDashboard(\"col-xs-12 col-sm-6 col-md-3 col-lg-2\", \"success\",\"fa-truck fa-3x\", PCO_ContarRegistrosTabla(\"app_proveedores\"),\"Proveedores\",  \"Detalles\", \"javascript:document._centro_6.submit();\",   \"\");\n    echo PCO_ImprimirPanelSimpleDashboard(\"col-xs-12 col-sm-6 col-md-3 col-lg-2\", \"default\",\"fa-money fa-3x\", PCO_ContarRegistrosTabla(\"app_ventas\"),     \"Ventas\",       \"Detalles\", \"javascript:document._centro_1.submit();\",   \"\");\n    //echo PCO_ImprimirPanelSimpleDashboard(\"col-xs-12 col-sm-6 col-md-3 col-lg-2\",   \"warning\",  \"fa-picture-o fa-3x\",   PCO_ContarRegistrosTabla(\"app_zona_cobertura\"), \"Zonas\",                \"Detalles\",    \"javascript:document._centro_3.submit();\",   \"\");\n                ?>\n            </div>\n    \n            <div class=\"row\">\n                    <div  class=\"col-md-4 col-lg-4 \">\n                        <div class=\"panel panel-default\">\n                            <div class=\"panel-heading\">\n                                <i class=\"fa fa-bar-chart-o fa-fw\"></i> Ventas por día, último mes\n                            </div>\n                            <div class=\"panel-body\">\n                                <div id=\"uso-general-aplicativo2\"></div>\n                            </div>\n                        </div>\n                    </div>\n                    <div  class=\" col-md-4 col-lg-4\">\n\n                            <div class=\"panel panel-default\">\n                                <div class=\"panel-heading\">\n                                    <i class=\"fa fa-money fa-fw\"></i> Últimas ventas ingresados\n                                </div>\n                                <div class=\"panel-body\">\n                                    <div id=\"\">\n\n                                    <table width=\"100%\">\n                                        <tr>\n                                            <td width=33% align=center>\n                                                    Hoy<br>\n                                                    <i class=\"fa-2x\" style=\"color:green;\"><b>   <?php echo PCO_EjecutarSQL(\"SELECT COUNT(id) FROM app_ventas WHERE fecha = DATE(NOW()) \")->fetchColumn(); ?>   </i></b>\n                                            </td>\n                                            <td width=33% align=center>\n                                                    Hace 1 semana<br>\n                                                    <i class=\"fa-2x\" style=\"color:navy;\"><b>    <?php echo PCO_EjecutarSQL(\"SELECT COUNT(id) FROM app_ventas WHERE fecha >= date_sub(now(),INTERVAL 1 WEEK) \")->fetchColumn(); ?>   </i></b>\n                                            </td>\n                                            <td width=33% align=center>\n                                                    Este mes<br>\n                                                    <i class=\"fa-2x\" style=\"color:red;\"><b>     <?php echo PCO_EjecutarSQL(\"SELECT COUNT(id) FROM app_ventas WHERE MONTH(fecha) = MONTH(NOW()) \")->fetchColumn(); ?>   </i></b>\n                                                    <!--<i class=\"fa-2x\" style=\"color:red;\"><b>     <?php echo PCO_EjecutarSQL(\"SELECT COUNT(id) FROM app_ventas WHERE fecha >= date_sub(now(),INTERVAL 4 WEEK) \")->fetchColumn(); ?>   </i></b>-->\n                                            </td>\n                                        </tr>\n                                    </table>\n\n                                    </div>\n                                </div>\n                            </div>\n\n                        <?php\n                            //$informe,$en_ventana=1,$formato=\"htm\",$estilo=\"Informes\",$embebido=0,$anular_acciones=0,$anular_piepagina=0,$anular_encabezado=0,$SQLPuro=\"\")\n                            //PCO_CargarInforme(7,1,\"\",\"\",1,1,0,0,\"\");\n                        ?>\n\n                    </div>            \n                    <div  class=\"col-md-4 col-lg-4\">\n                        <div class=\"panel panel-default\">\n                            <div class=\"panel-heading\">\n                                <i class=\"fa fa-bar-chart-o fa-fw\"></i> Resumen ventas por mes\n                            </div>\n                            <div class=\"panel-body\">\n                                <div id=\"conteos-generales-aplicacion2\"></div>\n                            </div>\n                        </div>\n                    </div>\n\n            </div>\n    </div>\n    <br>\n    <script language=\"JavaScript\">\n\n$(function() {\n\n    Morris.Area({\n        \n        //Nombre del marco que tiene el grafico\n        element: \'uso-general-aplicativo2\',\n        data: [\n        <?php\n            //Inicia la generacion del arreglo con los datos\n            $facturas = PCO_EjecutarSQL(\"SELECT fecha, count(id) as cantidad FROM app_ventas WHERE fecha >= date_sub(date(now()), INTERVAL 30 DAY) GROUP BY fecha ORDER BY fecha\");\n            $cadena_datos = \"\";\n            while ($factura = $facturas->fetch())\n                {\n                    $fecha_grafico=$factura[\"fecha\"];\n                    $cantidad_grafico=$factura[\"cantidad\"];\n                    $cadena_datos.= \"\n                        {\n                            fecha: \'\".$fecha_grafico.\"\',\n                            Ventas: \".$cantidad_grafico.\"\n                        },\n                        \";\n                }\n            $cadena_datos = substr($cadena_datos, 0, -1);\n            echo $cadena_datos;\n        ?>\n        ],\n        xkey: \'fecha\',\n        ykeys: [\'Ventas\'],\n        labels: [\'Ventas\'],\n        pointSize: 2,\n        hideHover: \'auto\',\n        resize: true\n    });\n\n\n    Morris.Bar({\n      element: \'conteos-generales-aplicacion2\',\n      data: [\n        /*{ y: \'2006\', a: 100, b: 90 },\n        { y: \'2007\', a: 75,  b: 65 },\n        { y: \'2008\', a: 50,  b: 40 },\n        { y: \'2009\', a: 75,  b: 65 },\n        { y: \'2010\', a: 50,  b: 40 },\n        { y: \'2011\', a: 75,  b: 65 },\n        { y: \'2012\', a: 100, b: 90 }*/\n        <?php\n        PCO_EjecutarSQLUnaria(\"SET lc_time_names = \'es_ES\'\");\n        $resumenPagoMes = PCO_EjecutarSQL(\"SELECT MONTHNAME(fecha) Mes, sum(total) Pago, COUNT(IF(ISNULL(fecha), 0, NULL)) noPago\n                                            FROM app_ventas\n                                            GROUP BY MONTHNAME(fecha); \");\n            $cadena_datos=\"\";\n            while ($mes = $resumenPagoMes->fetch())\n                $cadena_datos.= \"{ Mes: \'\" . ucfirst($mes[\'Mes\']) . \"\', Pago: \" . $mes[\'Pago\']. \", noPago: \" . $mes[\'noPago\']. \" },\";\n\n            $cadena_datos = substr($cadena_datos, 0, -1);\n            echo $cadena_datos;\n        ?>\n      ],\n      xkey: \'Mes\',\n      ykeys: [\'Pago\', \'noPago\'],\n      labels: [\'Pagado\', \'no Pagado\'],\n      resize: true,\n      barColors: [\'#26B99A\', \'#DE8244\']\n    });\n});\n\n\n</script>','A'),(314,'/home/u564937498/domains/cloudecoway.com/public_html/candy/mod/app/dashboard_desktop.php','2022-07-22 17:46:00','admin',153,8265,'<div class=\"well well-sm\" style=\"margin-bottom:0px;\">\n\n            <div class=\"row\">\n                <div class=\"col-xs-12 col-sm-12 col-md-12 col-lg-12\">\n                    <h3 class=\"page-header\" style=\"margin-top:0px;\"><b><i class=\"fa fa-dashboard fa-fw\"></i> <?php echo $MULTILANG_Aplicacion; ?></b> <i>(<?php echo $MULTILANG_MonEstado; ?>)</i></h3>\n                </div>\n                <!-- /.col-lg-12 -->\n            </div>\n            <div class=\"row\">\n                <?php\n                    if ($ModoDesarrolladorPractico != \"-10000\")\n                        $ModoDesarrolladorPractico = 0;\n                                                          //$ClaseColumnas,                         $EstiloPanel,   $ClaseIconoFA,                      $Titulo,                                                                                $SubTitulo,                     $EnlaceTexto,               $EnlaceURL,                                                     $ClaseTextoTitulo=\"huge\")\n    echo PCO_ImprimirPanelSimpleDashboard(\"col-xs-12 col-sm-6 col-md-3 col-lg-2\", \"info\",   \"fa-users fa-3x\", PCO_ContarRegistrosTabla(\"app_clientes\"),   \"Clientes\",     \"Detalles\", \"javascript:document._centro_2.submit();\",   \"\");\n    echo PCO_ImprimirPanelSimpleDashboard(\"col-xs-12 col-sm-6 col-md-3 col-lg-2\", \"primary\",\"fa-cubes fa-3x\", PCO_ContarRegistrosTabla(\"app_productos\"),  \"Productos\",    \"Detalles\", \"javascript:document._centro_4.submit();\",   \"\");\n    echo PCO_ImprimirPanelSimpleDashboard(\"col-xs-12 col-sm-6 col-md-3 col-lg-2\", \"success\",\"fa-truck fa-3x\", PCO_ContarRegistrosTabla(\"app_proveedores\"),\"Proveedores\",  \"Detalles\", \"javascript:document._centro_6.submit();\",   \"\");\n    echo PCO_ImprimirPanelSimpleDashboard(\"col-xs-12 col-sm-6 col-md-3 col-lg-2\", \"default\",\"fa-money fa-3x\", PCO_ContarRegistrosTabla(\"app_ventas\"),     \"Ventas\",       \"Detalles\", \"javascript:document._centro_1.submit();\",   \"\");\n    //echo PCO_ImprimirPanelSimpleDashboard(\"col-xs-12 col-sm-6 col-md-3 col-lg-2\",   \"warning\",  \"fa-picture-o fa-3x\",   PCO_ContarRegistrosTabla(\"app_zona_cobertura\"), \"Zonas\",                \"Detalles\",    \"javascript:document._centro_3.submit();\",   \"\");\n                ?>\n            </div>\n    \n            <div class=\"row\">\n                    <div  class=\"col-md-4 col-lg-4 \">\n                        <div class=\"panel panel-default\">\n                            <div class=\"panel-heading\">\n                                <i class=\"fa fa-bar-chart-o fa-fw\"></i> Ventas por día, último mes\n                            </div>\n                            <div class=\"panel-body\">\n                                <div id=\"uso-general-aplicativo2\"></div>\n                            </div>\n                        </div>\n                    </div>\n                    <div  class=\" col-md-4 col-lg-4\">\n\n                            <div class=\"panel panel-default\">\n                                <div class=\"panel-heading\">\n                                    <i class=\"fa fa-money fa-fw\"></i> Últimas ventas ingresados\n                                </div>\n                                <div class=\"panel-body\">\n                                    <div id=\"\">\n\n                                    <table width=\"100%\">\n                                        <tr>\n                                            <td width=33% align=center>\n                                                    Hoy<br>\n                                                    <i class=\"fa-2x\" style=\"color:green;\"><b>   <?php echo PCO_EjecutarSQL(\"SELECT COUNT(id) FROM app_ventas WHERE fecha = DATE(NOW()) \")->fetchColumn(); ?>   </i></b>\n                                            </td>\n                                            <td width=33% align=center>\n                                                    Hace 1 semana<br>\n                                                    <i class=\"fa-2x\" style=\"color:navy;\"><b>    <?php echo PCO_EjecutarSQL(\"SELECT COUNT(id) FROM app_ventas WHERE fecha >= date_sub(now(),INTERVAL 1 WEEK) \")->fetchColumn(); ?>   </i></b>\n                                            </td>\n                                            <td width=33% align=center>\n                                                    Este mes<br>\n                                                    <i class=\"fa-2x\" style=\"color:red;\"><b>     <?php echo PCO_EjecutarSQL(\"SELECT COUNT(id) FROM app_ventas WHERE MONTH(fecha) = MONTH(NOW()) \")->fetchColumn(); ?>   </i></b>\n                                                    <!--<i class=\"fa-2x\" style=\"color:red;\"><b>     <?php echo PCO_EjecutarSQL(\"SELECT COUNT(id) FROM app_ventas WHERE fecha >= date_sub(now(),INTERVAL 4 WEEK) \")->fetchColumn(); ?>   </i></b>-->\n                                            </td>\n                                        </tr>\n                                    </table>\n\n                                    </div>\n                                </div>\n                            </div>\n\n                        <?php\n                            //$informe,$en_ventana=1,$formato=\"htm\",$estilo=\"Informes\",$embebido=0,$anular_acciones=0,$anular_piepagina=0,$anular_encabezado=0,$SQLPuro=\"\")\n                            //PCO_CargarInforme(7,1,\"\",\"\",1,1,0,0,\"\");\n                        ?>\n\n                    </div>            \n                    <div  class=\"col-md-4 col-lg-4\">\n                        <div class=\"panel panel-default\">\n                            <div class=\"panel-heading\">\n                                <i class=\"fa fa-bar-chart-o fa-fw\"></i> Resumen ventas por mes\n                            </div>\n                            <div class=\"panel-body\">\n                                <div id=\"conteos-generales-aplicacion2\"></div>\n                            </div>\n                        </div>\n                    </div>\n\n            </div>\n    </div>\n    <br>\n    <script language=\"JavaScript\">\n\n$(function() {\n\n    Morris.Area({\n        \n        //Nombre del marco que tiene el grafico\n        element: \'uso-general-aplicativo2\',\n        data: [\n        <?php\n            //Inicia la generacion del arreglo con los datos\n            $facturas = PCO_EjecutarSQL(\"SELECT fecha, count(id) as cantidad FROM app_ventas WHERE fecha >= date_sub(date(now()), INTERVAL 30 DAY) GROUP BY fecha ORDER BY fecha\");\n            $cadena_datos = \"\";\n            while ($factura = $facturas->fetch())\n                {\n                    $fecha_grafico=$factura[\"fecha\"];\n                    $cantidad_grafico=$factura[\"cantidad\"];\n                    $cadena_datos.= \"\n                        {\n                            fecha: \'\".$fecha_grafico.\"\',\n                            Ventas: \".$cantidad_grafico.\"\n                        },\n                        \";\n                }\n            $cadena_datos = substr($cadena_datos, 0, -1);\n            echo $cadena_datos;\n        ?>\n        ],\n        xkey: \'fecha\',\n        ykeys: [\'Ventas\'],\n        labels: [\'Ventas\'],\n        pointSize: 2,\n        hideHover: \'auto\',\n        resize: true\n    });\n\n\n    Morris.Bar({\n      element: \'conteos-generales-aplicacion2\',\n      data: [\n        /*{ y: \'2006\', a: 100, b: 90 },\n        { y: \'2007\', a: 75,  b: 65 },\n        { y: \'2008\', a: 50,  b: 40 },\n        { y: \'2009\', a: 75,  b: 65 },\n        { y: \'2010\', a: 50,  b: 40 },\n        { y: \'2011\', a: 75,  b: 65 },\n        { y: \'2012\', a: 100, b: 90 }*/\n        <?php\n        PCO_EjecutarSQLUnaria(\"SET lc_time_names = \'es_ES\'\");\n        $resumenPagoMes = PCO_EjecutarSQL(\"SELECT MONTHNAME(fecha) Mes, sum(total) Total, COUNT(IF(ISNULL(fecha), 0, NULL)) noPago\n                                            FROM app_ventas\n                                            GROUP BY MONTHNAME(fecha); \");\n            $cadena_datos=\"\";\n            while ($mes = $resumenPagoMes->fetch())\n                $cadena_datos.= \"{ Mes: \'\" . ucfirst($mes[\'Mes\']) . \"\', Total: \" . $mes[\'Total\']. \", noPago: \" . $mes[\'noPago\']. \" },\";\n\n            $cadena_datos = substr($cadena_datos, 0, -1);\n            echo $cadena_datos;\n        ?>\n      ],\n      xkey: \'Mes\',\n      ykeys: [\'Total\', \'noPago\'],\n      labels: [\'Total Mes\', \'no Pagado\'],\n      resize: true,\n      barColors: [\'#26B99A\', \'#DE8244\']\n    });\n});\n\n\n</script>','A'),(315,'/home/u564937498/domains/cloudecoway.com/public_html/candy/mod/app/dashboard_desktop.php','2022-07-22 17:47:00','admin',153,8158,'<div class=\"well well-sm\" style=\"margin-bottom:0px;\">\n\n            <div class=\"row\">\n                <div class=\"col-xs-12 col-sm-12 col-md-12 col-lg-12\">\n                    <h3 class=\"page-header\" style=\"margin-top:0px;\"><b><i class=\"fa fa-dashboard fa-fw\"></i> <?php echo $MULTILANG_Aplicacion; ?></b> <i>(<?php echo $MULTILANG_MonEstado; ?>)</i></h3>\n                </div>\n                <!-- /.col-lg-12 -->\n            </div>\n            <div class=\"row\">\n                <?php\n                    if ($ModoDesarrolladorPractico != \"-10000\")\n                        $ModoDesarrolladorPractico = 0;\n                                                          //$ClaseColumnas,                         $EstiloPanel,   $ClaseIconoFA,                      $Titulo,                                                                                $SubTitulo,                     $EnlaceTexto,               $EnlaceURL,                                                     $ClaseTextoTitulo=\"huge\")\n    echo PCO_ImprimirPanelSimpleDashboard(\"col-xs-12 col-sm-6 col-md-3 col-lg-2\", \"info\",   \"fa-users fa-3x\", PCO_ContarRegistrosTabla(\"app_clientes\"),   \"Clientes\",     \"Detalles\", \"javascript:document._centro_2.submit();\",   \"\");\n    echo PCO_ImprimirPanelSimpleDashboard(\"col-xs-12 col-sm-6 col-md-3 col-lg-2\", \"primary\",\"fa-cubes fa-3x\", PCO_ContarRegistrosTabla(\"app_productos\"),  \"Productos\",    \"Detalles\", \"javascript:document._centro_4.submit();\",   \"\");\n    echo PCO_ImprimirPanelSimpleDashboard(\"col-xs-12 col-sm-6 col-md-3 col-lg-2\", \"success\",\"fa-truck fa-3x\", PCO_ContarRegistrosTabla(\"app_proveedores\"),\"Proveedores\",  \"Detalles\", \"javascript:document._centro_6.submit();\",   \"\");\n    echo PCO_ImprimirPanelSimpleDashboard(\"col-xs-12 col-sm-6 col-md-3 col-lg-2\", \"default\",\"fa-money fa-3x\", PCO_ContarRegistrosTabla(\"app_ventas\"),     \"Ventas\",       \"Detalles\", \"javascript:document._centro_1.submit();\",   \"\");\n    //echo PCO_ImprimirPanelSimpleDashboard(\"col-xs-12 col-sm-6 col-md-3 col-lg-2\",   \"warning\",  \"fa-picture-o fa-3x\",   PCO_ContarRegistrosTabla(\"app_zona_cobertura\"), \"Zonas\",                \"Detalles\",    \"javascript:document._centro_3.submit();\",   \"\");\n                ?>\n            </div>\n    \n            <div class=\"row\">\n                    <div  class=\"col-md-4 col-lg-4 \">\n                        <div class=\"panel panel-default\">\n                            <div class=\"panel-heading\">\n                                <i class=\"fa fa-bar-chart-o fa-fw\"></i> Ventas por día, último mes\n                            </div>\n                            <div class=\"panel-body\">\n                                <div id=\"uso-general-aplicativo2\"></div>\n                            </div>\n                        </div>\n                    </div>\n                    <div  class=\" col-md-4 col-lg-4\">\n\n                            <div class=\"panel panel-default\">\n                                <div class=\"panel-heading\">\n                                    <i class=\"fa fa-money fa-fw\"></i> Últimas ventas ingresados\n                                </div>\n                                <div class=\"panel-body\">\n                                    <div id=\"\">\n\n                                    <table width=\"100%\">\n                                        <tr>\n                                            <td width=33% align=center>\n                                                    Hoy<br>\n                                                    <i class=\"fa-2x\" style=\"color:green;\"><b>   <?php echo PCO_EjecutarSQL(\"SELECT COUNT(id) FROM app_ventas WHERE fecha = DATE(NOW()) \")->fetchColumn(); ?>   </i></b>\n                                            </td>\n                                            <td width=33% align=center>\n                                                    Hace 1 semana<br>\n                                                    <i class=\"fa-2x\" style=\"color:navy;\"><b>    <?php echo PCO_EjecutarSQL(\"SELECT COUNT(id) FROM app_ventas WHERE fecha >= date_sub(now(),INTERVAL 1 WEEK) \")->fetchColumn(); ?>   </i></b>\n                                            </td>\n                                            <td width=33% align=center>\n                                                    Este mes<br>\n                                                    <i class=\"fa-2x\" style=\"color:red;\"><b>     <?php echo PCO_EjecutarSQL(\"SELECT COUNT(id) FROM app_ventas WHERE MONTH(fecha) = MONTH(NOW()) \")->fetchColumn(); ?>   </i></b>\n                                                    <!--<i class=\"fa-2x\" style=\"color:red;\"><b>     <?php echo PCO_EjecutarSQL(\"SELECT COUNT(id) FROM app_ventas WHERE fecha >= date_sub(now(),INTERVAL 4 WEEK) \")->fetchColumn(); ?>   </i></b>-->\n                                            </td>\n                                        </tr>\n                                    </table>\n\n                                    </div>\n                                </div>\n                            </div>\n\n                        <?php\n                            //$informe,$en_ventana=1,$formato=\"htm\",$estilo=\"Informes\",$embebido=0,$anular_acciones=0,$anular_piepagina=0,$anular_encabezado=0,$SQLPuro=\"\")\n                            //PCO_CargarInforme(7,1,\"\",\"\",1,1,0,0,\"\");\n                        ?>\n\n                    </div>            \n                    <div  class=\"col-md-4 col-lg-4\">\n                        <div class=\"panel panel-default\">\n                            <div class=\"panel-heading\">\n                                <i class=\"fa fa-bar-chart-o fa-fw\"></i> Resumen ventas por mes\n                            </div>\n                            <div class=\"panel-body\">\n                                <div id=\"conteos-generales-aplicacion2\"></div>\n                            </div>\n                        </div>\n                    </div>\n\n            </div>\n    </div>\n    <br>\n    <script language=\"JavaScript\">\n\n$(function() {\n\n    Morris.Area({\n        \n        //Nombre del marco que tiene el grafico\n        element: \'uso-general-aplicativo2\',\n        data: [\n        <?php\n            //Inicia la generacion del arreglo con los datos\n            $facturas = PCO_EjecutarSQL(\"SELECT fecha, count(id) as cantidad FROM app_ventas WHERE fecha >= date_sub(date(now()), INTERVAL 30 DAY) GROUP BY fecha ORDER BY fecha\");\n            $cadena_datos = \"\";\n            while ($factura = $facturas->fetch())\n                {\n                    $fecha_grafico=$factura[\"fecha\"];\n                    $cantidad_grafico=$factura[\"cantidad\"];\n                    $cadena_datos.= \"\n                        {\n                            fecha: \'\".$fecha_grafico.\"\',\n                            Ventas: \".$cantidad_grafico.\"\n                        },\n                        \";\n                }\n            $cadena_datos = substr($cadena_datos, 0, -1);\n            echo $cadena_datos;\n        ?>\n        ],\n        xkey: \'fecha\',\n        ykeys: [\'Ventas\'],\n        labels: [\'Ventas\'],\n        pointSize: 2,\n        hideHover: \'auto\',\n        resize: true\n    });\n\n\n    Morris.Bar({\n      element: \'conteos-generales-aplicacion2\',\n      data: [\n        /*{ y: \'2006\', a: 100, b: 90 },\n        { y: \'2007\', a: 75,  b: 65 },\n        { y: \'2008\', a: 50,  b: 40 },\n        { y: \'2009\', a: 75,  b: 65 },\n        { y: \'2010\', a: 50,  b: 40 },\n        { y: \'2011\', a: 75,  b: 65 },\n        { y: \'2012\', a: 100, b: 90 }*/\n        <?php\n        PCO_EjecutarSQLUnaria(\"SET lc_time_names = \'es_ES\'\");\n        $resumenPagoMes = PCO_EjecutarSQL(\"SELECT MONTHNAME(fecha) Mes, sum(total) Total\n                                            FROM app_ventas\n                                            GROUP BY MONTHNAME(fecha); \");\n            $cadena_datos=\"\";\n            while ($mes = $resumenPagoMes->fetch())\n                $cadena_datos.= \"{ Mes: \'\" . ucfirst($mes[\'Mes\']) . \"\', Total: \" . $mes[\'Total\']. \" },\";\n\n            $cadena_datos = substr($cadena_datos, 0, -1);\n            echo $cadena_datos;\n        ?>\n      ],\n      xkey: \'Mes\',\n      ykeys: [\'Total\'],\n      labels: [\'Total Mes\'],\n      resize: true,\n      barColors: [\'#26B99A\']\n    });\n});\n\n\n</script>','A'),(316,'/home/u564937498/domains/cloudecoway.com/public_html/candy/mod/app/dashboard_desktop.php','2022-07-22 17:49:00','admin',153,8159,'<div class=\"well well-sm\" style=\"margin-bottom:0px;\">\n\n            <div class=\"row\">\n                <div class=\"col-xs-12 col-sm-12 col-md-12 col-lg-12\">\n                    <h3 class=\"page-header\" style=\"margin-top:0px;\"><b><i class=\"fa fa-dashboard fa-fw\"></i> <?php echo $MULTILANG_Aplicacion; ?></b> <i>(<?php echo $MULTILANG_MonEstado; ?>)</i></h3>\n                </div>\n                <!-- /.col-lg-12 -->\n            </div>\n            <div class=\"row\">\n                <?php\n                    if ($ModoDesarrolladorPractico != \"-10000\")\n                        $ModoDesarrolladorPractico = 0;\n                                                          //$ClaseColumnas,                         $EstiloPanel,   $ClaseIconoFA,                      $Titulo,                                                                                $SubTitulo,                     $EnlaceTexto,               $EnlaceURL,                                                     $ClaseTextoTitulo=\"huge\")\n    echo PCO_ImprimirPanelSimpleDashboard(\"col-xs-12 col-sm-6 col-md-3 col-lg-2\", \"info\",   \"fa-users fa-3x\", PCO_ContarRegistrosTabla(\"app_clientes\"),   \"Clientes\",     \"Detalles\", \"javascript:document._centro_2.submit();\",   \"\");\n    echo PCO_ImprimirPanelSimpleDashboard(\"col-xs-12 col-sm-6 col-md-3 col-lg-2\", \"primary\",\"fa-cubes fa-3x\", PCO_ContarRegistrosTabla(\"app_productos\"),  \"Productos\",    \"Detalles\", \"javascript:document._centro_4.submit();\",   \"\");\n    echo PCO_ImprimirPanelSimpleDashboard(\"col-xs-12 col-sm-6 col-md-3 col-lg-2\", \"success\",\"fa-truck fa-3x\", PCO_ContarRegistrosTabla(\"app_proveedores\"),\"Proveedores\",  \"Detalles\", \"javascript:document._centro_6.submit();\",   \"\");\n    echo PCO_ImprimirPanelSimpleDashboard(\"col-xs-12 col-sm-6 col-md-3 col-lg-2\", \"default\",\"fa-money fa-3x\", PCO_ContarRegistrosTabla(\"app_ventas\"),     \"Ventas\",       \"Detalles\", \"javascript:document._centro_1.submit();\",   \"\");\n    //echo PCO_ImprimirPanelSimpleDashboard(\"col-xs-12 col-sm-6 col-md-3 col-lg-2\",   \"warning\",  \"fa-picture-o fa-3x\",   PCO_ContarRegistrosTabla(\"app_zona_cobertura\"), \"Zonas\",                \"Detalles\",    \"javascript:document._centro_3.submit();\",   \"\");\n                ?>\n            </div>\n    \n            <div class=\"row\">\n                    <div  class=\"col-md-4 col-lg-4 \">\n                        <div class=\"panel panel-default\">\n                            <div class=\"panel-heading\">\n                                <i class=\"fa fa-bar-chart-o fa-fw\"></i> Ventas por día, último mes\n                            </div>\n                            <div class=\"panel-body\">\n                                <div id=\"uso-general-aplicativo2\"></div>\n                            </div>\n                        </div>\n                    </div>\n                    <div  class=\" col-md-4 col-lg-4\">\n\n                            <div class=\"panel panel-default\">\n                                <div class=\"panel-heading\">\n                                    <i class=\"fa fa-money fa-fw\"></i> Últimas ventas ingresados\n                                </div>\n                                <div class=\"panel-body\">\n                                    <div id=\"\">\n\n                                    <table width=\"100%\">\n                                        <tr>\n                                            <td width=33% align=center>\n                                                    Hoy<br>\n                                                    <i class=\"fa-2x\" style=\"color:green;\"><b>   <?php echo PCO_EjecutarSQL(\"SELECT COUNT(id) FROM app_ventas WHERE fecha >= DATE(NOW()) \")->fetchColumn(); ?>   </i></b>\n                                            </td>\n                                            <td width=33% align=center>\n                                                    Hace 1 semana<br>\n                                                    <i class=\"fa-2x\" style=\"color:navy;\"><b>    <?php echo PCO_EjecutarSQL(\"SELECT COUNT(id) FROM app_ventas WHERE fecha >= date_sub(now(),INTERVAL 1 WEEK) \")->fetchColumn(); ?>   </i></b>\n                                            </td>\n                                            <td width=33% align=center>\n                                                    Este mes<br>\n                                                    <i class=\"fa-2x\" style=\"color:red;\"><b>     <?php echo PCO_EjecutarSQL(\"SELECT COUNT(id) FROM app_ventas WHERE MONTH(fecha) = MONTH(NOW()) \")->fetchColumn(); ?>   </i></b>\n                                                    <!--<i class=\"fa-2x\" style=\"color:red;\"><b>     <?php echo PCO_EjecutarSQL(\"SELECT COUNT(id) FROM app_ventas WHERE fecha >= date_sub(now(),INTERVAL 4 WEEK) \")->fetchColumn(); ?>   </i></b>-->\n                                            </td>\n                                        </tr>\n                                    </table>\n\n                                    </div>\n                                </div>\n                            </div>\n\n                        <?php\n                            //$informe,$en_ventana=1,$formato=\"htm\",$estilo=\"Informes\",$embebido=0,$anular_acciones=0,$anular_piepagina=0,$anular_encabezado=0,$SQLPuro=\"\")\n                            //PCO_CargarInforme(7,1,\"\",\"\",1,1,0,0,\"\");\n                        ?>\n\n                    </div>            \n                    <div  class=\"col-md-4 col-lg-4\">\n                        <div class=\"panel panel-default\">\n                            <div class=\"panel-heading\">\n                                <i class=\"fa fa-bar-chart-o fa-fw\"></i> Resumen ventas por mes\n                            </div>\n                            <div class=\"panel-body\">\n                                <div id=\"conteos-generales-aplicacion2\"></div>\n                            </div>\n                        </div>\n                    </div>\n\n            </div>\n    </div>\n    <br>\n    <script language=\"JavaScript\">\n\n$(function() {\n\n    Morris.Area({\n        \n        //Nombre del marco que tiene el grafico\n        element: \'uso-general-aplicativo2\',\n        data: [\n        <?php\n            //Inicia la generacion del arreglo con los datos\n            $facturas = PCO_EjecutarSQL(\"SELECT fecha, count(id) as cantidad FROM app_ventas WHERE fecha >= date_sub(date(now()), INTERVAL 30 DAY) GROUP BY fecha ORDER BY fecha\");\n            $cadena_datos = \"\";\n            while ($factura = $facturas->fetch())\n                {\n                    $fecha_grafico=$factura[\"fecha\"];\n                    $cantidad_grafico=$factura[\"cantidad\"];\n                    $cadena_datos.= \"\n                        {\n                            fecha: \'\".$fecha_grafico.\"\',\n                            Ventas: \".$cantidad_grafico.\"\n                        },\n                        \";\n                }\n            $cadena_datos = substr($cadena_datos, 0, -1);\n            echo $cadena_datos;\n        ?>\n        ],\n        xkey: \'fecha\',\n        ykeys: [\'Ventas\'],\n        labels: [\'Ventas\'],\n        pointSize: 2,\n        hideHover: \'auto\',\n        resize: true\n    });\n\n\n    Morris.Bar({\n      element: \'conteos-generales-aplicacion2\',\n      data: [\n        /*{ y: \'2006\', a: 100, b: 90 },\n        { y: \'2007\', a: 75,  b: 65 },\n        { y: \'2008\', a: 50,  b: 40 },\n        { y: \'2009\', a: 75,  b: 65 },\n        { y: \'2010\', a: 50,  b: 40 },\n        { y: \'2011\', a: 75,  b: 65 },\n        { y: \'2012\', a: 100, b: 90 }*/\n        <?php\n        PCO_EjecutarSQLUnaria(\"SET lc_time_names = \'es_ES\'\");\n        $resumenPagoMes = PCO_EjecutarSQL(\"SELECT MONTHNAME(fecha) Mes, sum(total) Total\n                                            FROM app_ventas\n                                            GROUP BY MONTHNAME(fecha); \");\n            $cadena_datos=\"\";\n            while ($mes = $resumenPagoMes->fetch())\n                $cadena_datos.= \"{ Mes: \'\" . ucfirst($mes[\'Mes\']) . \"\', Total: \" . $mes[\'Total\']. \" },\";\n\n            $cadena_datos = substr($cadena_datos, 0, -1);\n            echo $cadena_datos;\n        ?>\n      ],\n      xkey: \'Mes\',\n      ykeys: [\'Total\'],\n      labels: [\'Total Mes\'],\n      resize: true,\n      barColors: [\'#26B99A\']\n    });\n});\n\n\n</script>','A'),(317,'/home/u564937498/domains/cloudecoway.com/public_html/candy/mod/app/dashboard_desktop.php','2022-07-22 17:52:00','admin',153,8161,'<div class=\"well well-sm\" style=\"margin-bottom:0px;\">\n\n            <div class=\"row\">\n                <div class=\"col-xs-12 col-sm-12 col-md-12 col-lg-12\">\n                    <h3 class=\"page-header\" style=\"margin-top:0px;\"><b><i class=\"fa fa-dashboard fa-fw\"></i> <?php echo $MULTILANG_Aplicacion; ?></b> <i>(<?php echo $MULTILANG_MonEstado; ?>)</i></h3>\n                </div>\n                <!-- /.col-lg-12 -->\n            </div>\n            <div class=\"row\">\n                <?php\n                    if ($ModoDesarrolladorPractico != \"-10000\")\n                        $ModoDesarrolladorPractico = 0;\n                                                          //$ClaseColumnas,                         $EstiloPanel,   $ClaseIconoFA,                      $Titulo,                                                                                $SubTitulo,                     $EnlaceTexto,               $EnlaceURL,                                                     $ClaseTextoTitulo=\"huge\")\n   # echo PCO_ImprimirPanelSimpleDashboard(\"col-xs-12 col-sm-6 col-md-3 col-lg-2\", \"info\",   \"fa-users fa-3x\", PCO_ContarRegistrosTabla(\"app_clientes\"),   \"Clientes\",     \"Detalles\", \"javascript:document._centro_2.submit();\",   \"\");\n    echo PCO_ImprimirPanelSimpleDashboard(\"col-xs-12 col-sm-6 col-md-3 col-lg-2\", \"primary\",\"fa-cubes fa-3x\", PCO_ContarRegistrosTabla(\"app_productos\"),  \"Productos\",    \"Detalles\", \"javascript:document._centro_4.submit();\",   \"\");\n#    echo PCO_ImprimirPanelSimpleDashboard(\"col-xs-12 col-sm-6 col-md-3 col-lg-2\", \"success\",\"fa-truck fa-3x\", PCO_ContarRegistrosTabla(\"app_proveedores\"),\"Proveedores\",  \"Detalles\", \"javascript:document._centro_6.submit();\",   \"\");\n    echo PCO_ImprimirPanelSimpleDashboard(\"col-xs-12 col-sm-6 col-md-3 col-lg-2\", \"default\",\"fa-money fa-3x\", PCO_ContarRegistrosTabla(\"app_ventas\"),     \"Ventas\",       \"Detalles\", \"javascript:document._centro_1.submit();\",   \"\");\n    //echo PCO_ImprimirPanelSimpleDashboard(\"col-xs-12 col-sm-6 col-md-3 col-lg-2\",   \"warning\",  \"fa-picture-o fa-3x\",   PCO_ContarRegistrosTabla(\"app_zona_cobertura\"), \"Zonas\",                \"Detalles\",    \"javascript:document._centro_3.submit();\",   \"\");\n                ?>\n            </div>\n    \n            <div class=\"row\">\n                    <div  class=\"col-md-4 col-lg-4 \">\n                        <div class=\"panel panel-default\">\n                            <div class=\"panel-heading\">\n                                <i class=\"fa fa-bar-chart-o fa-fw\"></i> Ventas por día, último mes\n                            </div>\n                            <div class=\"panel-body\">\n                                <div id=\"uso-general-aplicativo2\"></div>\n                            </div>\n                        </div>\n                    </div>\n                    <div  class=\" col-md-4 col-lg-4\">\n\n                            <div class=\"panel panel-default\">\n                                <div class=\"panel-heading\">\n                                    <i class=\"fa fa-money fa-fw\"></i> Últimas ventas ingresados\n                                </div>\n                                <div class=\"panel-body\">\n                                    <div id=\"\">\n\n                                    <table width=\"100%\">\n                                        <tr>\n                                            <td width=33% align=center>\n                                                    Hoy<br>\n                                                    <i class=\"fa-2x\" style=\"color:green;\"><b>   <?php echo PCO_EjecutarSQL(\"SELECT COUNT(id) FROM app_ventas WHERE fecha >= DATE(NOW()) \")->fetchColumn(); ?>   </i></b>\n                                            </td>\n                                            <td width=33% align=center>\n                                                    Hace 1 semana<br>\n                                                    <i class=\"fa-2x\" style=\"color:navy;\"><b>    <?php echo PCO_EjecutarSQL(\"SELECT COUNT(id) FROM app_ventas WHERE fecha >= date_sub(now(),INTERVAL 1 WEEK) \")->fetchColumn(); ?>   </i></b>\n                                            </td>\n                                            <td width=33% align=center>\n                                                    Este mes<br>\n                                                    <i class=\"fa-2x\" style=\"color:red;\"><b>     <?php echo PCO_EjecutarSQL(\"SELECT COUNT(id) FROM app_ventas WHERE MONTH(fecha) = MONTH(NOW()) \")->fetchColumn(); ?>   </i></b>\n                                                    <!--<i class=\"fa-2x\" style=\"color:red;\"><b>     <?php echo PCO_EjecutarSQL(\"SELECT COUNT(id) FROM app_ventas WHERE fecha >= date_sub(now(),INTERVAL 4 WEEK) \")->fetchColumn(); ?>   </i></b>-->\n                                            </td>\n                                        </tr>\n                                    </table>\n\n                                    </div>\n                                </div>\n                            </div>\n\n                        <?php\n                            //$informe,$en_ventana=1,$formato=\"htm\",$estilo=\"Informes\",$embebido=0,$anular_acciones=0,$anular_piepagina=0,$anular_encabezado=0,$SQLPuro=\"\")\n                            //PCO_CargarInforme(7,1,\"\",\"\",1,1,0,0,\"\");\n                        ?>\n\n                    </div>            \n                    <div  class=\"col-md-4 col-lg-4\">\n                        <div class=\"panel panel-default\">\n                            <div class=\"panel-heading\">\n                                <i class=\"fa fa-bar-chart-o fa-fw\"></i> Resumen ventas por mes\n                            </div>\n                            <div class=\"panel-body\">\n                                <div id=\"conteos-generales-aplicacion2\"></div>\n                            </div>\n                        </div>\n                    </div>\n\n            </div>\n    </div>\n    <br>\n    <script language=\"JavaScript\">\n\n$(function() {\n\n    Morris.Area({\n        \n        //Nombre del marco que tiene el grafico\n        element: \'uso-general-aplicativo2\',\n        data: [\n        <?php\n            //Inicia la generacion del arreglo con los datos\n            $facturas = PCO_EjecutarSQL(\"SELECT fecha, count(id) as cantidad FROM app_ventas WHERE fecha >= date_sub(date(now()), INTERVAL 30 DAY) GROUP BY fecha ORDER BY fecha\");\n            $cadena_datos = \"\";\n            while ($factura = $facturas->fetch())\n                {\n                    $fecha_grafico=$factura[\"fecha\"];\n                    $cantidad_grafico=$factura[\"cantidad\"];\n                    $cadena_datos.= \"\n                        {\n                            fecha: \'\".$fecha_grafico.\"\',\n                            Ventas: \".$cantidad_grafico.\"\n                        },\n                        \";\n                }\n            $cadena_datos = substr($cadena_datos, 0, -1);\n            echo $cadena_datos;\n        ?>\n        ],\n        xkey: \'fecha\',\n        ykeys: [\'Ventas\'],\n        labels: [\'Ventas\'],\n        pointSize: 2,\n        hideHover: \'auto\',\n        resize: true\n    });\n\n\n    Morris.Bar({\n      element: \'conteos-generales-aplicacion2\',\n      data: [\n        /*{ y: \'2006\', a: 100, b: 90 },\n        { y: \'2007\', a: 75,  b: 65 },\n        { y: \'2008\', a: 50,  b: 40 },\n        { y: \'2009\', a: 75,  b: 65 },\n        { y: \'2010\', a: 50,  b: 40 },\n        { y: \'2011\', a: 75,  b: 65 },\n        { y: \'2012\', a: 100, b: 90 }*/\n        <?php\n        PCO_EjecutarSQLUnaria(\"SET lc_time_names = \'es_ES\'\");\n        $resumenPagoMes = PCO_EjecutarSQL(\"SELECT MONTHNAME(fecha) Mes, sum(total) Total\n                                            FROM app_ventas\n                                            GROUP BY MONTHNAME(fecha); \");\n            $cadena_datos=\"\";\n            while ($mes = $resumenPagoMes->fetch())\n                $cadena_datos.= \"{ Mes: \'\" . ucfirst($mes[\'Mes\']) . \"\', Total: \" . $mes[\'Total\']. \" },\";\n\n            $cadena_datos = substr($cadena_datos, 0, -1);\n            echo $cadena_datos;\n        ?>\n      ],\n      xkey: \'Mes\',\n      ykeys: [\'Total\'],\n      labels: [\'Total Mes\'],\n      resize: true,\n      barColors: [\'#26B99A\']\n    });\n});\n\n\n</script>','A'),(318,'/home/u564937498/domains/cloudecoway.com/public_html/candy/mod/app/dashboard_desktop.php','2022-07-22 18:02:00','admin',158,8575,'<div class=\"well well-sm\" style=\"margin-bottom:0px;\">\n\n            <div class=\"row\">\n                <div class=\"col-xs-12 col-sm-12 col-md-12 col-lg-12\">\n                    <h3 class=\"page-header\" style=\"margin-top:0px;\"><b><i class=\"fa fa-dashboard fa-fw\"></i> <?php echo $MULTILANG_Aplicacion; ?></b> <i>(<?php echo $MULTILANG_MonEstado; ?>)</i></h3>\n                </div>\n                <!-- /.col-lg-12 -->\n            </div>\n            <div class=\"row\">\n                <?php\n                    if ($ModoDesarrolladorPractico != \"-10000\")\n                        $ModoDesarrolladorPractico = 0;\n                                                          //$ClaseColumnas,                         $EstiloPanel,   $ClaseIconoFA,                      $Titulo,                                                                                $SubTitulo,                     $EnlaceTexto,               $EnlaceURL,                                                     $ClaseTextoTitulo=\"huge\")\n   # echo PCO_ImprimirPanelSimpleDashboard(\"col-xs-12 col-sm-6 col-md-3 col-lg-2\", \"info\",   \"fa-users fa-3x\", PCO_ContarRegistrosTabla(\"app_clientes\"),   \"Clientes\",     \"Detalles\", \"javascript:document._centro_2.submit();\",   \"\");\n    echo PCO_ImprimirPanelSimpleDashboard(\"col-xs-12 col-sm-6 col-md-3 col-lg-2\", \"primary\",\"fa-cubes fa-3x\", PCO_ContarRegistrosTabla(\"app_productos\"),  \"Productos\",    \"Detalles\", \"javascript:document._centro_4.submit();\",   \"\");\n#    echo PCO_ImprimirPanelSimpleDashboard(\"col-xs-12 col-sm-6 col-md-3 col-lg-2\", \"success\",\"fa-truck fa-3x\", PCO_ContarRegistrosTabla(\"app_proveedores\"),\"Proveedores\",  \"Detalles\", \"javascript:document._centro_6.submit();\",   \"\");\n    echo PCO_ImprimirPanelSimpleDashboard(\"col-xs-12 col-sm-6 col-md-3 col-lg-2\", \"default\",\"fa-money fa-3x\", PCO_ContarRegistrosTabla(\"app_ventas\"),     \"Ventas\",       \"Detalles\", \"javascript:document._centro_1.submit();\",   \"\");\n    //echo PCO_ImprimirPanelSimpleDashboard(\"col-xs-12 col-sm-6 col-md-3 col-lg-2\",   \"warning\",  \"fa-picture-o fa-3x\",   PCO_ContarRegistrosTabla(\"app_zona_cobertura\"), \"Zonas\",                \"Detalles\",    \"javascript:document._centro_3.submit();\",   \"\");\n        echo PCO_ImprimirPanelSimpleDashboard(\"col-xs-12 col-sm-6 col-md-3 col-lg-2\", \"default\",\"fa-money fa-3x\", (\"SELECT app_productos.nombre, COUNT( id_producto )  AS cantidad\nFROM  app_ventas_detalle, app_productos  where app_productos.id = app_ventas_detalle.id_producto\nGROUP BY id_producto\nORDER BY cantidad DESC limit 3\"),     \"Ventas\",       \"Detalles\", \"javascript:document._centro_1.submit();\",   \"\");\n\n                ?>\n            </div>\n    \n            <div class=\"row\">\n                    <div  class=\"col-md-4 col-lg-4 \">\n                        <div class=\"panel panel-default\">\n                            <div class=\"panel-heading\">\n                                <i class=\"fa fa-bar-chart-o fa-fw\"></i> Ventas por día, último mes\n                            </div>\n                            <div class=\"panel-body\">\n                                <div id=\"uso-general-aplicativo2\"></div>\n                            </div>\n                        </div>\n                    </div>\n                    <div  class=\" col-md-4 col-lg-4\">\n\n                            <div class=\"panel panel-default\">\n                                <div class=\"panel-heading\">\n                                    <i class=\"fa fa-money fa-fw\"></i> Últimas ventas ingresados\n                                </div>\n                                <div class=\"panel-body\">\n                                    <div id=\"\">\n\n                                    <table width=\"100%\">\n                                        <tr>\n                                            <td width=33% align=center>\n                                                    Hoy<br>\n                                                    <i class=\"fa-2x\" style=\"color:green;\"><b>   <?php echo PCO_EjecutarSQL(\"SELECT COUNT(id) FROM app_ventas WHERE fecha >= DATE(NOW()) \")->fetchColumn(); ?>   </i></b>\n                                            </td>\n                                            <td width=33% align=center>\n                                                    Hace 1 semana<br>\n                                                    <i class=\"fa-2x\" style=\"color:navy;\"><b>    <?php echo PCO_EjecutarSQL(\"SELECT COUNT(id) FROM app_ventas WHERE fecha >= date_sub(now(),INTERVAL 1 WEEK) \")->fetchColumn(); ?>   </i></b>\n                                            </td>\n                                            <td width=33% align=center>\n                                                    Este mes<br>\n                                                    <i class=\"fa-2x\" style=\"color:red;\"><b>     <?php echo PCO_EjecutarSQL(\"SELECT COUNT(id) FROM app_ventas WHERE MONTH(fecha) = MONTH(NOW()) \")->fetchColumn(); ?>   </i></b>\n                                                    <!--<i class=\"fa-2x\" style=\"color:red;\"><b>     <?php echo PCO_EjecutarSQL(\"SELECT COUNT(id) FROM app_ventas WHERE fecha >= date_sub(now(),INTERVAL 4 WEEK) \")->fetchColumn(); ?>   </i></b>-->\n                                            </td>\n                                        </tr>\n                                    </table>\n\n                                    </div>\n                                </div>\n                            </div>\n\n                        <?php\n                            //$informe,$en_ventana=1,$formato=\"htm\",$estilo=\"Informes\",$embebido=0,$anular_acciones=0,$anular_piepagina=0,$anular_encabezado=0,$SQLPuro=\"\")\n                            //PCO_CargarInforme(7,1,\"\",\"\",1,1,0,0,\"\");\n                        ?>\n\n                    </div>            \n                    <div  class=\"col-md-4 col-lg-4\">\n                        <div class=\"panel panel-default\">\n                            <div class=\"panel-heading\">\n                                <i class=\"fa fa-bar-chart-o fa-fw\"></i> Resumen ventas por mes\n                            </div>\n                            <div class=\"panel-body\">\n                                <div id=\"conteos-generales-aplicacion2\"></div>\n                            </div>\n                        </div>\n                    </div>\n\n            </div>\n    </div>\n    <br>\n    <script language=\"JavaScript\">\n\n$(function() {\n\n    Morris.Area({\n        \n        //Nombre del marco que tiene el grafico\n        element: \'uso-general-aplicativo2\',\n        data: [\n        <?php\n            //Inicia la generacion del arreglo con los datos\n            $facturas = PCO_EjecutarSQL(\"SELECT fecha, count(id) as cantidad FROM app_ventas WHERE fecha >= date_sub(date(now()), INTERVAL 30 DAY) GROUP BY fecha ORDER BY fecha\");\n            $cadena_datos = \"\";\n            while ($factura = $facturas->fetch())\n                {\n                    $fecha_grafico=$factura[\"fecha\"];\n                    $cantidad_grafico=$factura[\"cantidad\"];\n                    $cadena_datos.= \"\n                        {\n                            fecha: \'\".$fecha_grafico.\"\',\n                            Ventas: \".$cantidad_grafico.\"\n                        },\n                        \";\n                }\n            $cadena_datos = substr($cadena_datos, 0, -1);\n            echo $cadena_datos;\n        ?>\n        ],\n        xkey: \'fecha\',\n        ykeys: [\'Ventas\'],\n        labels: [\'Ventas\'],\n        pointSize: 2,\n        hideHover: \'auto\',\n        resize: true\n    });\n\n\n    Morris.Bar({\n      element: \'conteos-generales-aplicacion2\',\n      data: [\n        /*{ y: \'2006\', a: 100, b: 90 },\n        { y: \'2007\', a: 75,  b: 65 },\n        { y: \'2008\', a: 50,  b: 40 },\n        { y: \'2009\', a: 75,  b: 65 },\n        { y: \'2010\', a: 50,  b: 40 },\n        { y: \'2011\', a: 75,  b: 65 },\n        { y: \'2012\', a: 100, b: 90 }*/\n        <?php\n        PCO_EjecutarSQLUnaria(\"SET lc_time_names = \'es_ES\'\");\n        $resumenPagoMes = PCO_EjecutarSQL(\"SELECT MONTHNAME(fecha) Mes, sum(total) Total\n                                            FROM app_ventas\n                                            GROUP BY MONTHNAME(fecha); \");\n            $cadena_datos=\"\";\n            while ($mes = $resumenPagoMes->fetch())\n                $cadena_datos.= \"{ Mes: \'\" . ucfirst($mes[\'Mes\']) . \"\', Total: \" . $mes[\'Total\']. \" },\";\n\n            $cadena_datos = substr($cadena_datos, 0, -1);\n            echo $cadena_datos;\n        ?>\n      ],\n      xkey: \'Mes\',\n      ykeys: [\'Total\'],\n      labels: [\'Total Mes\'],\n      resize: true,\n      barColors: [\'#26B99A\']\n    });\n});\n\n\n</script>','A'),(319,'/home/u564937498/domains/cloudecoway.com/public_html/candy/mod/app/dashboard_desktop.php','2022-07-22 18:03:00','admin',155,8171,'<div class=\"well well-sm\" style=\"margin-bottom:0px;\">\n\n            <div class=\"row\">\n                <div class=\"col-xs-12 col-sm-12 col-md-12 col-lg-12\">\n                    <h3 class=\"page-header\" style=\"margin-top:0px;\"><b><i class=\"fa fa-dashboard fa-fw\"></i> <?php echo $MULTILANG_Aplicacion; ?></b> <i>(<?php echo $MULTILANG_MonEstado; ?>)</i></h3>\n                </div>\n                <!-- /.col-lg-12 -->\n            </div>\n            <div class=\"row\">\n                <?php\n                    if ($ModoDesarrolladorPractico != \"-10000\")\n                        $ModoDesarrolladorPractico = 0;\n                                                          //$ClaseColumnas,                         $EstiloPanel,   $ClaseIconoFA,                      $Titulo,                                                                                $SubTitulo,                     $EnlaceTexto,               $EnlaceURL,                                                     $ClaseTextoTitulo=\"huge\")\n   # echo PCO_ImprimirPanelSimpleDashboard(\"col-xs-12 col-sm-6 col-md-3 col-lg-2\", \"info\",   \"fa-users fa-3x\", PCO_ContarRegistrosTabla(\"app_clientes\"),   \"Clientes\",     \"Detalles\", \"javascript:document._centro_2.submit();\",   \"\");\n    echo PCO_ImprimirPanelSimpleDashboard(\"col-xs-12 col-sm-6 col-md-3 col-lg-2\", \"primary\",\"fa-cubes fa-3x\", PCO_ContarRegistrosTabla(\"app_productos\"),  \"Productos\",    \"Detalles\", \"javascript:document._centro_4.submit();\",   \"\");\n#    echo PCO_ImprimirPanelSimpleDashboard(\"col-xs-12 col-sm-6 col-md-3 col-lg-2\", \"success\",\"fa-truck fa-3x\", PCO_ContarRegistrosTabla(\"app_proveedores\"),\"Proveedores\",  \"Detalles\", \"javascript:document._centro_6.submit();\",   \"\");\n    echo PCO_ImprimirPanelSimpleDashboard(\"col-xs-12 col-sm-6 col-md-3 col-lg-2\", \"default\",\"fa-money fa-3x\", PCO_ContarRegistrosTabla(\"app_ventas\"),     \"Ventas\",       \"Detalles\", \"javascript:document._centro_1.submit();\",   \"\");\n    //echo PCO_ImprimirPanelSimpleDashboard(\"col-xs-12 col-sm-6 col-md-3 col-lg-2\",   \"warning\",  \"fa-picture-o fa-3x\",   PCO_ContarRegistrosTabla(\"app_zona_cobertura\"), \"Zonas\",                \"Detalles\",    \"javascript:document._centro_3.submit();\",   \"\");\n        \n\n                ?>\n            </div>\n    \n            <div class=\"row\">\n                    <div  class=\"col-md-4 col-lg-4 \">\n                        <div class=\"panel panel-default\">\n                            <div class=\"panel-heading\">\n                                <i class=\"fa fa-bar-chart-o fa-fw\"></i> Ventas por día, último mes\n                            </div>\n                            <div class=\"panel-body\">\n                                <div id=\"uso-general-aplicativo2\"></div>\n                            </div>\n                        </div>\n                    </div>\n                    <div  class=\" col-md-4 col-lg-4\">\n\n                            <div class=\"panel panel-default\">\n                                <div class=\"panel-heading\">\n                                    <i class=\"fa fa-money fa-fw\"></i> Últimas ventas ingresados\n                                </div>\n                                <div class=\"panel-body\">\n                                    <div id=\"\">\n\n                                    <table width=\"100%\">\n                                        <tr>\n                                            <td width=33% align=center>\n                                                    Hoy<br>\n                                                    <i class=\"fa-2x\" style=\"color:green;\"><b>   <?php echo PCO_EjecutarSQL(\"SELECT COUNT(id) FROM app_ventas WHERE fecha >= DATE(NOW()) \")->fetchColumn(); ?>   </i></b>\n                                            </td>\n                                            <td width=33% align=center>\n                                                    Hace 1 semana<br>\n                                                    <i class=\"fa-2x\" style=\"color:navy;\"><b>    <?php echo PCO_EjecutarSQL(\"SELECT COUNT(id) FROM app_ventas WHERE fecha >= date_sub(now(),INTERVAL 1 WEEK) \")->fetchColumn(); ?>   </i></b>\n                                            </td>\n                                            <td width=33% align=center>\n                                                    Este mes<br>\n                                                    <i class=\"fa-2x\" style=\"color:red;\"><b>     <?php echo PCO_EjecutarSQL(\"SELECT COUNT(id) FROM app_ventas WHERE MONTH(fecha) = MONTH(NOW()) \")->fetchColumn(); ?>   </i></b>\n                                                    <!--<i class=\"fa-2x\" style=\"color:red;\"><b>     <?php echo PCO_EjecutarSQL(\"SELECT COUNT(id) FROM app_ventas WHERE fecha >= date_sub(now(),INTERVAL 4 WEEK) \")->fetchColumn(); ?>   </i></b>-->\n                                            </td>\n                                        </tr>\n                                    </table>\n\n                                    </div>\n                                </div>\n                            </div>\n\n                        <?php\n                            //$informe,$en_ventana=1,$formato=\"htm\",$estilo=\"Informes\",$embebido=0,$anular_acciones=0,$anular_piepagina=0,$anular_encabezado=0,$SQLPuro=\"\")\n                            //PCO_CargarInforme(7,1,\"\",\"\",1,1,0,0,\"\");\n                        ?>\n\n                    </div>            \n                    <div  class=\"col-md-4 col-lg-4\">\n                        <div class=\"panel panel-default\">\n                            <div class=\"panel-heading\">\n                                <i class=\"fa fa-bar-chart-o fa-fw\"></i> Resumen ventas por mes\n                            </div>\n                            <div class=\"panel-body\">\n                                <div id=\"conteos-generales-aplicacion2\"></div>\n                            </div>\n                        </div>\n                    </div>\n\n            </div>\n    </div>\n    <br>\n    <script language=\"JavaScript\">\n\n$(function() {\n\n    Morris.Area({\n        \n        //Nombre del marco que tiene el grafico\n        element: \'uso-general-aplicativo2\',\n        data: [\n        <?php\n            //Inicia la generacion del arreglo con los datos\n            $facturas = PCO_EjecutarSQL(\"SELECT fecha, count(id) as cantidad FROM app_ventas WHERE fecha >= date_sub(date(now()), INTERVAL 30 DAY) GROUP BY fecha ORDER BY fecha\");\n            $cadena_datos = \"\";\n            while ($factura = $facturas->fetch())\n                {\n                    $fecha_grafico=$factura[\"fecha\"];\n                    $cantidad_grafico=$factura[\"cantidad\"];\n                    $cadena_datos.= \"\n                        {\n                            fecha: \'\".$fecha_grafico.\"\',\n                            Ventas: \".$cantidad_grafico.\"\n                        },\n                        \";\n                }\n            $cadena_datos = substr($cadena_datos, 0, -1);\n            echo $cadena_datos;\n        ?>\n        ],\n        xkey: \'fecha\',\n        ykeys: [\'Ventas\'],\n        labels: [\'Ventas\'],\n        pointSize: 2,\n        hideHover: \'auto\',\n        resize: true\n    });\n\n\n    Morris.Bar({\n      element: \'conteos-generales-aplicacion2\',\n      data: [\n        /*{ y: \'2006\', a: 100, b: 90 },\n        { y: \'2007\', a: 75,  b: 65 },\n        { y: \'2008\', a: 50,  b: 40 },\n        { y: \'2009\', a: 75,  b: 65 },\n        { y: \'2010\', a: 50,  b: 40 },\n        { y: \'2011\', a: 75,  b: 65 },\n        { y: \'2012\', a: 100, b: 90 }*/\n        <?php\n        PCO_EjecutarSQLUnaria(\"SET lc_time_names = \'es_ES\'\");\n        $resumenPagoMes = PCO_EjecutarSQL(\"SELECT MONTHNAME(fecha) Mes, sum(total) Total\n                                            FROM app_ventas\n                                            GROUP BY MONTHNAME(fecha); \");\n            $cadena_datos=\"\";\n            while ($mes = $resumenPagoMes->fetch())\n                $cadena_datos.= \"{ Mes: \'\" . ucfirst($mes[\'Mes\']) . \"\', Total: \" . $mes[\'Total\']. \" },\";\n\n            $cadena_datos = substr($cadena_datos, 0, -1);\n            echo $cadena_datos;\n        ?>\n      ],\n      xkey: \'Mes\',\n      ykeys: [\'Total\'],\n      labels: [\'Total Mes\'],\n      resize: true,\n      barColors: [\'#26B99A\']\n    });\n});\n\n\n</script>','A'),(320,'/home/u564937498/domains/cloudecoway.com/public_html/candy/mod/app/dashboard_desktop.php','2022-07-22 18:04:00','admin',196,10951,'<div class=\"well well-sm\" style=\"margin-bottom:0px;\">\n\n            <div class=\"row\">\n                <div class=\"col-xs-12 col-sm-12 col-md-12 col-lg-12\">\n                    <h3 class=\"page-header\" style=\"margin-top:0px;\"><b><i class=\"fa fa-dashboard fa-fw\"></i> <?php echo $MULTILANG_Aplicacion; ?></b> <i>(<?php echo $MULTILANG_MonEstado; ?>)</i></h3>\n                </div>\n                <!-- /.col-lg-12 -->\n            </div>\n            <div class=\"row\">\n                <?php\n                    if ($ModoDesarrolladorPractico != \"-10000\")\n                        $ModoDesarrolladorPractico = 0;\n                                                          //$ClaseColumnas,                         $EstiloPanel,   $ClaseIconoFA,                      $Titulo,                                                                                $SubTitulo,                     $EnlaceTexto,               $EnlaceURL,                                                     $ClaseTextoTitulo=\"huge\")\n   # echo PCO_ImprimirPanelSimpleDashboard(\"col-xs-12 col-sm-6 col-md-3 col-lg-2\", \"info\",   \"fa-users fa-3x\", PCO_ContarRegistrosTabla(\"app_clientes\"),   \"Clientes\",     \"Detalles\", \"javascript:document._centro_2.submit();\",   \"\");\n    echo PCO_ImprimirPanelSimpleDashboard(\"col-xs-12 col-sm-6 col-md-3 col-lg-2\", \"primary\",\"fa-cubes fa-3x\", PCO_ContarRegistrosTabla(\"app_productos\"),  \"Productos\",    \"Detalles\", \"javascript:document._centro_4.submit();\",   \"\");\n#    echo PCO_ImprimirPanelSimpleDashboard(\"col-xs-12 col-sm-6 col-md-3 col-lg-2\", \"success\",\"fa-truck fa-3x\", PCO_ContarRegistrosTabla(\"app_proveedores\"),\"Proveedores\",  \"Detalles\", \"javascript:document._centro_6.submit();\",   \"\");\n    echo PCO_ImprimirPanelSimpleDashboard(\"col-xs-12 col-sm-6 col-md-3 col-lg-2\", \"default\",\"fa-money fa-3x\", PCO_ContarRegistrosTabla(\"app_ventas\"),     \"Ventas\",       \"Detalles\", \"javascript:document._centro_1.submit();\",   \"\");\n    //echo PCO_ImprimirPanelSimpleDashboard(\"col-xs-12 col-sm-6 col-md-3 col-lg-2\",   \"warning\",  \"fa-picture-o fa-3x\",   PCO_ContarRegistrosTabla(\"app_zona_cobertura\"), \"Zonas\",                \"Detalles\",    \"javascript:document._centro_3.submit();\",   \"\");\n        \n\n                ?>\n            </div>\n    \n            <div class=\"row\">\n                    <div  class=\"col-md-4 col-lg-4 \">\n                        <div class=\"panel panel-default\">\n                            <div class=\"panel-heading\">\n                                <i class=\"fa fa-bar-chart-o fa-fw\"></i> Ventas por día, último mes\n                            </div>\n                            <div class=\"panel-body\">\n                                <div id=\"uso-general-aplicativo2\"></div>\n                            </div>\n                        </div>\n                    </div>\n                    <div  class=\" col-md-4 col-lg-4\">\n\n                            <div class=\"panel panel-default\">\n                                <div class=\"panel-heading\">\n                                    <i class=\"fa fa-money fa-fw\"></i> Últimas ventas ingresados\n                                </div>\n                                <div class=\"panel-body\">\n                                    <div id=\"\">\n\n                                    <table width=\"100%\">\n                                        <tr>\n                                            <td width=33% align=center>\n                                                    Hoy<br>\n                                                    <i class=\"fa-2x\" style=\"color:green;\"><b>   <?php echo PCO_EjecutarSQL(\"SELECT COUNT(id) FROM app_ventas WHERE fecha >= DATE(NOW()) \")->fetchColumn(); ?>   </i></b>\n                                            </td>\n                                            <td width=33% align=center>\n                                                    Hace 1 semana<br>\n                                                    <i class=\"fa-2x\" style=\"color:navy;\"><b>    <?php echo PCO_EjecutarSQL(\"SELECT COUNT(id) FROM app_ventas WHERE fecha >= date_sub(now(),INTERVAL 1 WEEK) \")->fetchColumn(); ?>   </i></b>\n                                            </td>\n                                            <td width=33% align=center>\n                                                    Este mes<br>\n                                                    <i class=\"fa-2x\" style=\"color:red;\"><b>     <?php echo PCO_EjecutarSQL(\"SELECT COUNT(id) FROM app_ventas WHERE MONTH(fecha) = MONTH(NOW()) \")->fetchColumn(); ?>   </i></b>\n                                                    <!--<i class=\"fa-2x\" style=\"color:red;\"><b>     <?php echo PCO_EjecutarSQL(\"SELECT COUNT(id) FROM app_ventas WHERE fecha >= date_sub(now(),INTERVAL 4 WEEK) \")->fetchColumn(); ?>   </i></b>-->\n                                            </td>\n                                        </tr>\n                                    </table>\n\n                                    </div>\n                                </div>\n                            </div>\n                             <div class=\"row\">\n                    <div  class=\"col-md-4 col-lg-4 \">\n                        <div class=\"panel panel-default\">\n                            <div class=\"panel-heading\">\n                                <i class=\"fa fa-bar-chart-o fa-fw\"></i> Ventas por día, último mes\n                            </div>\n                            <div class=\"panel-body\">\n                                <div id=\"uso-general-aplicativo2\"></div>\n                            </div>\n                        </div>\n                    </div>\n                    <div  class=\" col-md-4 col-lg-4\">\n\n                            <div class=\"panel panel-default\">\n                                <div class=\"panel-heading\">\n                                    <i class=\"fa fa-money fa-fw\"></i> Últimas ventas ingresados\n                                </div>\n                                <div class=\"panel-body\">\n                                    <div id=\"\">\n\n                                    <table width=\"100%\">\n                                        <tr>\n                                            <td width=33% align=center>\n                                                    Hoy<br>\n                                                    <i class=\"fa-2x\" style=\"color:green;\"><b>   <?php echo PCO_EjecutarSQL(\"SELECT COUNT(id) FROM app_ventas WHERE fecha >= DATE(NOW()) \")->fetchColumn(); ?>   </i></b>\n                                            </td>\n                                            <td width=33% align=center>\n                                                    Hace 1 semana<br>\n                                                    <i class=\"fa-2x\" style=\"color:navy;\"><b>    <?php echo PCO_EjecutarSQL(\"SELECT COUNT(id) FROM app_ventas WHERE fecha >= date_sub(now(),INTERVAL 1 WEEK) \")->fetchColumn(); ?>   </i></b>\n                                            </td>\n                                            <td width=33% align=center>\n                                                    Este mes<br>\n                                                    <i class=\"fa-2x\" style=\"color:red;\"><b>     <?php echo PCO_EjecutarSQL(\"SELECT COUNT(id) FROM app_ventas WHERE MONTH(fecha) = MONTH(NOW()) \")->fetchColumn(); ?>   </i></b>\n                                                    <!--<i class=\"fa-2x\" style=\"color:red;\"><b>     <?php echo PCO_EjecutarSQL(\"SELECT COUNT(id) FROM app_ventas WHERE fecha >= date_sub(now(),INTERVAL 4 WEEK) \")->fetchColumn(); ?>   </i></b>-->\n                                            </td>\n                                        </tr>\n                                    </table>\n\n                                    </div>\n                                </div>\n                            </div>\n\n                        <?php\n                            //$informe,$en_ventana=1,$formato=\"htm\",$estilo=\"Informes\",$embebido=0,$anular_acciones=0,$anular_piepagina=0,$anular_encabezado=0,$SQLPuro=\"\")\n                            //PCO_CargarInforme(7,1,\"\",\"\",1,1,0,0,\"\");\n                        ?>\n\n                    </div>            \n                    <div  class=\"col-md-4 col-lg-4\">\n                        <div class=\"panel panel-default\">\n                            <div class=\"panel-heading\">\n                                <i class=\"fa fa-bar-chart-o fa-fw\"></i> Resumen ventas por mes\n                            </div>\n                            <div class=\"panel-body\">\n                                <div id=\"conteos-generales-aplicacion2\"></div>\n                            </div>\n                        </div>\n                    </div>\n\n            </div>\n    </div>\n    <br>\n    <script language=\"JavaScript\">\n\n$(function() {\n\n    Morris.Area({\n        \n        //Nombre del marco que tiene el grafico\n        element: \'uso-general-aplicativo2\',\n        data: [\n        <?php\n            //Inicia la generacion del arreglo con los datos\n            $facturas = PCO_EjecutarSQL(\"SELECT fecha, count(id) as cantidad FROM app_ventas WHERE fecha >= date_sub(date(now()), INTERVAL 30 DAY) GROUP BY fecha ORDER BY fecha\");\n            $cadena_datos = \"\";\n            while ($factura = $facturas->fetch())\n                {\n                    $fecha_grafico=$factura[\"fecha\"];\n                    $cantidad_grafico=$factura[\"cantidad\"];\n                    $cadena_datos.= \"\n                        {\n                            fecha: \'\".$fecha_grafico.\"\',\n                            Ventas: \".$cantidad_grafico.\"\n                        },\n                        \";\n                }\n            $cadena_datos = substr($cadena_datos, 0, -1);\n            echo $cadena_datos;\n        ?>\n        ],\n        xkey: \'fecha\',\n        ykeys: [\'Ventas\'],\n        labels: [\'Ventas\'],\n        pointSize: 2,\n        hideHover: \'auto\',\n        resize: true\n    });\n\n\n    Morris.Bar({\n      element: \'conteos-generales-aplicacion2\',\n      data: [\n        /*{ y: \'2006\', a: 100, b: 90 },\n        { y: \'2007\', a: 75,  b: 65 },\n        { y: \'2008\', a: 50,  b: 40 },\n        { y: \'2009\', a: 75,  b: 65 },\n        { y: \'2010\', a: 50,  b: 40 },\n        { y: \'2011\', a: 75,  b: 65 },\n        { y: \'2012\', a: 100, b: 90 }*/\n        <?php\n        PCO_EjecutarSQLUnaria(\"SET lc_time_names = \'es_ES\'\");\n        $resumenPagoMes = PCO_EjecutarSQL(\"SELECT MONTHNAME(fecha) Mes, sum(total) Total\n                                            FROM app_ventas\n                                            GROUP BY MONTHNAME(fecha); \");\n            $cadena_datos=\"\";\n            while ($mes = $resumenPagoMes->fetch())\n                $cadena_datos.= \"{ Mes: \'\" . ucfirst($mes[\'Mes\']) . \"\', Total: \" . $mes[\'Total\']. \" },\";\n\n            $cadena_datos = substr($cadena_datos, 0, -1);\n            echo $cadena_datos;\n        ?>\n      ],\n      xkey: \'Mes\',\n      ykeys: [\'Total\'],\n      labels: [\'Total Mes\'],\n      resize: true,\n      barColors: [\'#26B99A\']\n    });\n});\n\n\n</script>','A'),(321,'/home/u564937498/domains/cloudecoway.com/public_html/candy/mod/app/dashboard_desktop.php','2022-07-22 18:05:00','admin',185,10391,'<div class=\"well well-sm\" style=\"margin-bottom:0px;\">\n\n            <div class=\"row\">\n                <div class=\"col-xs-12 col-sm-12 col-md-12 col-lg-12\">\n                    <h3 class=\"page-header\" style=\"margin-top:0px;\"><b><i class=\"fa fa-dashboard fa-fw\"></i> <?php echo $MULTILANG_Aplicacion; ?></b> <i>(<?php echo $MULTILANG_MonEstado; ?>)</i></h3>\n                </div>\n                <!-- /.col-lg-12 -->\n            </div>\n            <div class=\"row\">\n                <?php\n                    if ($ModoDesarrolladorPractico != \"-10000\")\n                        $ModoDesarrolladorPractico = 0;\n                                                          //$ClaseColumnas,                         $EstiloPanel,   $ClaseIconoFA,                      $Titulo,                                                                                $SubTitulo,                     $EnlaceTexto,               $EnlaceURL,                                                     $ClaseTextoTitulo=\"huge\")\n   # echo PCO_ImprimirPanelSimpleDashboard(\"col-xs-12 col-sm-6 col-md-3 col-lg-2\", \"info\",   \"fa-users fa-3x\", PCO_ContarRegistrosTabla(\"app_clientes\"),   \"Clientes\",     \"Detalles\", \"javascript:document._centro_2.submit();\",   \"\");\n    echo PCO_ImprimirPanelSimpleDashboard(\"col-xs-12 col-sm-6 col-md-3 col-lg-2\", \"primary\",\"fa-cubes fa-3x\", PCO_ContarRegistrosTabla(\"app_productos\"),  \"Productos\",    \"Detalles\", \"javascript:document._centro_4.submit();\",   \"\");\n#    echo PCO_ImprimirPanelSimpleDashboard(\"col-xs-12 col-sm-6 col-md-3 col-lg-2\", \"success\",\"fa-truck fa-3x\", PCO_ContarRegistrosTabla(\"app_proveedores\"),\"Proveedores\",  \"Detalles\", \"javascript:document._centro_6.submit();\",   \"\");\n    echo PCO_ImprimirPanelSimpleDashboard(\"col-xs-12 col-sm-6 col-md-3 col-lg-2\", \"default\",\"fa-money fa-3x\", PCO_ContarRegistrosTabla(\"app_ventas\"),     \"Ventas\",       \"Detalles\", \"javascript:document._centro_1.submit();\",   \"\");\n    //echo PCO_ImprimirPanelSimpleDashboard(\"col-xs-12 col-sm-6 col-md-3 col-lg-2\",   \"warning\",  \"fa-picture-o fa-3x\",   PCO_ContarRegistrosTabla(\"app_zona_cobertura\"), \"Zonas\",                \"Detalles\",    \"javascript:document._centro_3.submit();\",   \"\");\n        \n\n                ?>\n            </div>\n    \n            <div class=\"row\">\n                    <div  class=\"col-md-4 col-lg-4 \">\n                        <div class=\"panel panel-default\">\n                            <div class=\"panel-heading\">\n                                <i class=\"fa fa-bar-chart-o fa-fw\"></i> Ventas por día, último mes\n                            </div>\n                            <div class=\"panel-body\">\n                                <div id=\"uso-general-aplicativo2\"></div>\n                            </div>\n                        </div>\n                    </div>\n                    <div  class=\" col-md-4 col-lg-4\">\n\n                            <div class=\"panel panel-default\">\n                                <div class=\"panel-heading\">\n                                    <i class=\"fa fa-money fa-fw\"></i> Últimas ventas ingresados\n                                </div>\n                                <div class=\"panel-body\">\n                                    <div id=\"\">\n\n                                    <table width=\"100%\">\n                                        <tr>\n                                            <td width=33% align=center>\n                                                    Hoy<br>\n                                                    <i class=\"fa-2x\" style=\"color:green;\"><b>   <?php echo PCO_EjecutarSQL(\"SELECT COUNT(id) FROM app_ventas WHERE fecha >= DATE(NOW()) \")->fetchColumn(); ?>   </i></b>\n                                            </td>\n                                            <td width=33% align=center>\n                                                    Hace 1 semana<br>\n                                                    <i class=\"fa-2x\" style=\"color:navy;\"><b>    <?php echo PCO_EjecutarSQL(\"SELECT COUNT(id) FROM app_ventas WHERE fecha >= date_sub(now(),INTERVAL 1 WEEK) \")->fetchColumn(); ?>   </i></b>\n                                            </td>\n                                            <td width=33% align=center>\n                                                    Este mes<br>\n                                                    <i class=\"fa-2x\" style=\"color:red;\"><b>     <?php echo PCO_EjecutarSQL(\"SELECT COUNT(id) FROM app_ventas WHERE MONTH(fecha) = MONTH(NOW()) \")->fetchColumn(); ?>   </i></b>\n                                                    <!--<i class=\"fa-2x\" style=\"color:red;\"><b>     <?php echo PCO_EjecutarSQL(\"SELECT COUNT(id) FROM app_ventas WHERE fecha >= date_sub(now(),INTERVAL 4 WEEK) \")->fetchColumn(); ?>   </i></b>-->\n                                            </td>\n                                        </tr>\n                                    </table>\n\n                                    </div>\n                                </div>\n                            </div>\n                            <div  class=\" col-md-4 col-lg-4\">\n\n                            <div class=\"panel panel-default\">\n                                <div class=\"panel-heading\">\n                                    <i class=\"fa fa-money fa-fw\"></i> Últimas ventas ingresados\n                                </div>\n                                <div class=\"panel-body\">\n                                    <div id=\"\">\n\n                                    <table width=\"100%\">\n                                        <tr>\n                                            <td width=33% align=center>\n                                                    Hoy<br>\n                                                    <i class=\"fa-2x\" style=\"color:green;\"><b>   <?php echo PCO_EjecutarSQL(\"SELECT COUNT(id) FROM app_ventas WHERE fecha >= DATE(NOW()) \")->fetchColumn(); ?>   </i></b>\n                                            </td>\n                                            <td width=33% align=center>\n                                                    Hace 1 semana<br>\n                                                    <i class=\"fa-2x\" style=\"color:navy;\"><b>    <?php echo PCO_EjecutarSQL(\"SELECT COUNT(id) FROM app_ventas WHERE fecha >= date_sub(now(),INTERVAL 1 WEEK) \")->fetchColumn(); ?>   </i></b>\n                                            </td>\n                                            <td width=33% align=center>\n                                                    Este mes<br>\n                                                    <i class=\"fa-2x\" style=\"color:red;\"><b>     <?php echo PCO_EjecutarSQL(\"SELECT COUNT(id) FROM app_ventas WHERE MONTH(fecha) = MONTH(NOW()) \")->fetchColumn(); ?>   </i></b>\n                                                    <!--<i class=\"fa-2x\" style=\"color:red;\"><b>     <?php echo PCO_EjecutarSQL(\"SELECT COUNT(id) FROM app_ventas WHERE fecha >= date_sub(now(),INTERVAL 4 WEEK) \")->fetchColumn(); ?>   </i></b>-->\n                                            </td>\n                                        </tr>\n                                    </table>\n\n                                    </div>\n                                </div>\n                            </div>\n\n                        <?php\n                            //$informe,$en_ventana=1,$formato=\"htm\",$estilo=\"Informes\",$embebido=0,$anular_acciones=0,$anular_piepagina=0,$anular_encabezado=0,$SQLPuro=\"\")\n                            //PCO_CargarInforme(7,1,\"\",\"\",1,1,0,0,\"\");\n                        ?>\n\n                    </div>            \n                    <div  class=\"col-md-4 col-lg-4\">\n                        <div class=\"panel panel-default\">\n                            <div class=\"panel-heading\">\n                                <i class=\"fa fa-bar-chart-o fa-fw\"></i> Resumen ventas por mes\n                            </div>\n                            <div class=\"panel-body\">\n                                <div id=\"conteos-generales-aplicacion2\"></div>\n                            </div>\n                        </div>\n                    </div>\n\n            </div>\n    </div>\n    <br>\n    <script language=\"JavaScript\">\n\n$(function() {\n\n    Morris.Area({\n        \n        //Nombre del marco que tiene el grafico\n        element: \'uso-general-aplicativo2\',\n        data: [\n        <?php\n            //Inicia la generacion del arreglo con los datos\n            $facturas = PCO_EjecutarSQL(\"SELECT fecha, count(id) as cantidad FROM app_ventas WHERE fecha >= date_sub(date(now()), INTERVAL 30 DAY) GROUP BY fecha ORDER BY fecha\");\n            $cadena_datos = \"\";\n            while ($factura = $facturas->fetch())\n                {\n                    $fecha_grafico=$factura[\"fecha\"];\n                    $cantidad_grafico=$factura[\"cantidad\"];\n                    $cadena_datos.= \"\n                        {\n                            fecha: \'\".$fecha_grafico.\"\',\n                            Ventas: \".$cantidad_grafico.\"\n                        },\n                        \";\n                }\n            $cadena_datos = substr($cadena_datos, 0, -1);\n            echo $cadena_datos;\n        ?>\n        ],\n        xkey: \'fecha\',\n        ykeys: [\'Ventas\'],\n        labels: [\'Ventas\'],\n        pointSize: 2,\n        hideHover: \'auto\',\n        resize: true\n    });\n\n\n    Morris.Bar({\n      element: \'conteos-generales-aplicacion2\',\n      data: [\n        /*{ y: \'2006\', a: 100, b: 90 },\n        { y: \'2007\', a: 75,  b: 65 },\n        { y: \'2008\', a: 50,  b: 40 },\n        { y: \'2009\', a: 75,  b: 65 },\n        { y: \'2010\', a: 50,  b: 40 },\n        { y: \'2011\', a: 75,  b: 65 },\n        { y: \'2012\', a: 100, b: 90 }*/\n        <?php\n        PCO_EjecutarSQLUnaria(\"SET lc_time_names = \'es_ES\'\");\n        $resumenPagoMes = PCO_EjecutarSQL(\"SELECT MONTHNAME(fecha) Mes, sum(total) Total\n                                            FROM app_ventas\n                                            GROUP BY MONTHNAME(fecha); \");\n            $cadena_datos=\"\";\n            while ($mes = $resumenPagoMes->fetch())\n                $cadena_datos.= \"{ Mes: \'\" . ucfirst($mes[\'Mes\']) . \"\', Total: \" . $mes[\'Total\']. \" },\";\n\n            $cadena_datos = substr($cadena_datos, 0, -1);\n            echo $cadena_datos;\n        ?>\n      ],\n      xkey: \'Mes\',\n      ykeys: [\'Total\'],\n      labels: [\'Total Mes\'],\n      resize: true,\n      barColors: [\'#26B99A\']\n    });\n});\n\n\n</script>','A'),(322,'/home/u564937498/domains/cloudecoway.com/public_html/candy/mod/app/dashboard_desktop.php','2022-07-22 18:06:00','admin',156,8200,'<div class=\"well well-sm\" style=\"margin-bottom:0px;\">\n\n            <div class=\"row\">\n                <div class=\"col-xs-12 col-sm-12 col-md-12 col-lg-12\">\n                    <h3 class=\"page-header\" style=\"margin-top:0px;\"><b><i class=\"fa fa-dashboard fa-fw\"></i> <?php echo $MULTILANG_Aplicacion; ?></b> <i>(<?php echo $MULTILANG_MonEstado; ?>)</i></h3>\n                </div>\n                <!-- /.col-lg-12 -->\n            </div>\n            <div class=\"row\">\n                <?php\n                    if ($ModoDesarrolladorPractico != \"-10000\")\n                        $ModoDesarrolladorPractico = 0;\n                                                          //$ClaseColumnas,                         $EstiloPanel,   $ClaseIconoFA,                      $Titulo,                                                                                $SubTitulo,                     $EnlaceTexto,               $EnlaceURL,                                                     $ClaseTextoTitulo=\"huge\")\n   # echo PCO_ImprimirPanelSimpleDashboard(\"col-xs-12 col-sm-6 col-md-3 col-lg-2\", \"info\",   \"fa-users fa-3x\", PCO_ContarRegistrosTabla(\"app_clientes\"),   \"Clientes\",     \"Detalles\", \"javascript:document._centro_2.submit();\",   \"\");\n    echo PCO_ImprimirPanelSimpleDashboard(\"col-xs-12 col-sm-6 col-md-3 col-lg-2\", \"primary\",\"fa-cubes fa-3x\", PCO_ContarRegistrosTabla(\"app_productos\"),  \"Productos\",    \"Detalles\", \"javascript:document._centro_4.submit();\",   \"\");\n#    echo PCO_ImprimirPanelSimpleDashboard(\"col-xs-12 col-sm-6 col-md-3 col-lg-2\", \"success\",\"fa-truck fa-3x\", PCO_ContarRegistrosTabla(\"app_proveedores\"),\"Proveedores\",  \"Detalles\", \"javascript:document._centro_6.submit();\",   \"\");\n    echo PCO_ImprimirPanelSimpleDashboard(\"col-xs-12 col-sm-6 col-md-3 col-lg-2\", \"default\",\"fa-money fa-3x\", PCO_ContarRegistrosTabla(\"app_ventas\"),     \"Ventas\",       \"Detalles\", \"javascript:document._centro_1.submit();\",   \"\");\n    //echo PCO_ImprimirPanelSimpleDashboard(\"col-xs-12 col-sm-6 col-md-3 col-lg-2\",   \"warning\",  \"fa-picture-o fa-3x\",   PCO_ContarRegistrosTabla(\"app_zona_cobertura\"), \"Zonas\",                \"Detalles\",    \"javascript:document._centro_3.submit();\",   \"\");\n        \n\n                ?>\n            </div>\n    \n            <div class=\"row\">\n                    <div  class=\"col-md-4 col-lg-4 \">\n                        <div class=\"panel panel-default\">\n                            <div class=\"panel-heading\">\n                                <i class=\"fa fa-bar-chart-o fa-fw\"></i> Ventas por día, último mes\n                            </div>\n                            <div class=\"panel-body\">\n                                <div id=\"uso-general-aplicativo2\"></div>\n                            </div>\n                        </div>\n                    </div>\n                    <div  class=\" col-md-4 col-lg-4\">\n\n                            <div class=\"panel panel-default\">\n                                <div class=\"panel-heading\">\n                                    <i class=\"fa fa-money fa-fw\"></i> Últimas ventas ingresados\n                                </div>\n                                <div class=\"panel-body\">\n                                    <div id=\"\">\n\n                                    <table width=\"100%\">\n                                        <tr>\n                                            <td width=33% align=center>\n                                                    Hoy<br>\n                                                    <i class=\"fa-2x\" style=\"color:green;\"><b>   <?php echo PCO_EjecutarSQL(\"SELECT COUNT(id) FROM app_ventas WHERE fecha >= DATE(NOW()) \")->fetchColumn(); ?>   </i></b>\n                                            </td>\n                                            <td width=33% align=center>\n                                                    Hace 1 semana<br>\n                                                    <i class=\"fa-2x\" style=\"color:navy;\"><b>    <?php echo PCO_EjecutarSQL(\"SELECT COUNT(id) FROM app_ventas WHERE fecha >= date_sub(now(),INTERVAL 1 WEEK) \")->fetchColumn(); ?>   </i></b>\n                                            </td>\n                                            <td width=33% align=center>\n                                                    Este mes<br>\n                                                    <i class=\"fa-2x\" style=\"color:red;\"><b>     <?php echo PCO_EjecutarSQL(\"SELECT COUNT(id) FROM app_ventas WHERE MONTH(fecha) = MONTH(NOW()) \")->fetchColumn(); ?>   </i></b>\n                                                    <!--<i class=\"fa-2x\" style=\"color:red;\"><b>     <?php echo PCO_EjecutarSQL(\"SELECT COUNT(id) FROM app_ventas WHERE fecha >= date_sub(now(),INTERVAL 4 WEEK) \")->fetchColumn(); ?>   </i></b>-->\n                                            </td>\n                                        </tr>\n                                    </table>\n\n                                    </div>\n                                </div>\n                            </div>\n                            \n\n                        <?php\n                            //$informe,$en_ventana=1,$formato=\"htm\",$estilo=\"Informes\",$embebido=0,$anular_acciones=0,$anular_piepagina=0,$anular_encabezado=0,$SQLPuro=\"\")\n                            //PCO_CargarInforme(7,1,\"\",\"\",1,1,0,0,\"\");\n                        ?>\n\n                    </div>            \n                    <div  class=\"col-md-4 col-lg-4\">\n                        <div class=\"panel panel-default\">\n                            <div class=\"panel-heading\">\n                                <i class=\"fa fa-bar-chart-o fa-fw\"></i> Resumen ventas por mes\n                            </div>\n                            <div class=\"panel-body\">\n                                <div id=\"conteos-generales-aplicacion2\"></div>\n                            </div>\n                        </div>\n                    </div>\n\n            </div>\n    </div>\n    <br>\n    <script language=\"JavaScript\">\n\n$(function() {\n\n    Morris.Area({\n        \n        //Nombre del marco que tiene el grafico\n        element: \'uso-general-aplicativo2\',\n        data: [\n        <?php\n            //Inicia la generacion del arreglo con los datos\n            $facturas = PCO_EjecutarSQL(\"SELECT fecha, count(id) as cantidad FROM app_ventas WHERE fecha >= date_sub(date(now()), INTERVAL 30 DAY) GROUP BY fecha ORDER BY fecha\");\n            $cadena_datos = \"\";\n            while ($factura = $facturas->fetch())\n                {\n                    $fecha_grafico=$factura[\"fecha\"];\n                    $cantidad_grafico=$factura[\"cantidad\"];\n                    $cadena_datos.= \"\n                        {\n                            fecha: \'\".$fecha_grafico.\"\',\n                            Ventas: \".$cantidad_grafico.\"\n                        },\n                        \";\n                }\n            $cadena_datos = substr($cadena_datos, 0, -1);\n            echo $cadena_datos;\n        ?>\n        ],\n        xkey: \'fecha\',\n        ykeys: [\'Ventas\'],\n        labels: [\'Ventas\'],\n        pointSize: 2,\n        hideHover: \'auto\',\n        resize: true\n    });\n\n\n    Morris.Bar({\n      element: \'conteos-generales-aplicacion2\',\n      data: [\n        /*{ y: \'2006\', a: 100, b: 90 },\n        { y: \'2007\', a: 75,  b: 65 },\n        { y: \'2008\', a: 50,  b: 40 },\n        { y: \'2009\', a: 75,  b: 65 },\n        { y: \'2010\', a: 50,  b: 40 },\n        { y: \'2011\', a: 75,  b: 65 },\n        { y: \'2012\', a: 100, b: 90 }*/\n        <?php\n        PCO_EjecutarSQLUnaria(\"SET lc_time_names = \'es_ES\'\");\n        $resumenPagoMes = PCO_EjecutarSQL(\"SELECT MONTHNAME(fecha) Mes, sum(total) Total\n                                            FROM app_ventas\n                                            GROUP BY MONTHNAME(fecha); \");\n            $cadena_datos=\"\";\n            while ($mes = $resumenPagoMes->fetch())\n                $cadena_datos.= \"{ Mes: \'\" . ucfirst($mes[\'Mes\']) . \"\', Total: \" . $mes[\'Total\']. \" },\";\n\n            $cadena_datos = substr($cadena_datos, 0, -1);\n            echo $cadena_datos;\n        ?>\n      ],\n      xkey: \'Mes\',\n      ykeys: [\'Total\'],\n      labels: [\'Total Mes\'],\n      resize: true,\n      barColors: [\'#26B99A\']\n    });\n});\n\n\n</script>','A'),