Exemple #1
1
function showCupones()
{
    $database = new DB();
    echo "\n        <table class=\"table table-striped table-bordered bootstrap-datatable datatable\">\n            <thead>\n\t\t\t<tr>\n                <th>&nbsp;</th>\n\t\t\t  <th>Cupon</th>\n\t\t\t  <th>Compra Minima</th>\n\n\t\t\t  <th>Tipo</th>\n\t\t\t  <th>Opciones</th>\n\t\t\t</tr>\n\t\t\t</thead>\n\t\t\t<tbody>";
    $query = "SELECT * from cupon,cupontipo\n        where cupon.cupontipo_id=cupontipo.cupontipo_id";
    $results = $database->get_results($query);
    $i = 0;
    foreach ($results as $row) {
        $i += 1;
        echo "<tr>\n\t\t\t    <td align=right><font >&nbsp;{$i}&nbsp;</td>\n\t\t\t    <td ><a href=\"/index.php?data=cupones&op=generados&bulk=" . $row['bulk'] . "\" >";
        switch ($row['cupontipo_id']) {
            case 1:
                echo "\$ " . dinero($row['cantidad']) . " MX";
                break;
            case 2:
                echo $row['cantidad'] . " %";
                break;
        }
        echo "</b><a>\n\t\t\t    </td>";
        echo "<td><font >" . dinero($row['compra_minima']) . "</td>\n\n\t\t\t<td> <font >" . strtoupper($row['cupontipo']) . "</td>";
        echo "<td><button class=\"btn-primary btn-setting hidden-print\" onclick=\"showData('myModal',\n                        'view/cupones/cupones_agregar.inc.php',\n                        'f=editar&cuid=" . $row['cupon_id'] . "')\">Editar</button>\n\n                  <button class=\"btn-info    btn-setting hidden-print\" onclick=\"showData('myModal',\n                        'view/cupones/cupones.php',\n                        'f=generar&cuid=" . $row['cupon_id'] . "&cupon=" . $row['cupon'] . "&monto=" . $row['cantidad'] . "&compra_minima=" . $row['compra_minima'] . "')\">Generar</button></td>";
        echo "</tr>";
    }
    echo "  </tbody>\n        </table>";
}
function mostrar_transacciones($fecha_inicio, $fecha_fin, $user)
{
    $database = new DB();
    //$fecha=fechaplusweek($fecha);
    $total_pagos = ceil($total / $abono);
    echo "\n\n\t\t\t\t\t<div>\n\t\t\t\t\t\t<table class=\"table table-condensed striped\" width=100% >\n\t\t\t\t\t\t\t  <thead>\n\t\t\t\t\t\t\t\t  <tr>\n\t\t\t\t\t\t\t\t\t  <th style='text-align:right'>Id</th>\n\t\t\t\t\t\t\t\t\t  <th style='text-align:center'>Fecha</th>\n\t\t\t\t\t\t\t\t\t  <th style='text-align:center'>Movimiento</th>\n\t\t\t\t\t\t\t\t\t  <th style='text-align:center'>Total</th>\n\t\t\t\t\t\t\t\t\t  <th style='text-align:center'>Cliente</th>\n\t\t\t\t\t\t\t\t  </tr>\n\t\t\t\t\t\t\t  </thead>\n\t\t\t\t\t\t\t  <tbody>";
    $fecha_inicio_bd = $fecha_inicio;
    $fecha_fin_bd = $fecha_fin;
    $query = "SELECT  * from movimiento,tipomov,admin,cliente\n\t\twhere movimiento.tipomov_id=tipomov.tipomov_id AND movimiento.admin_id=admin.admin_id  AND (movimiento.tipomov_id=1 OR movimiento.tipomov_id=13 or movimiento.tipomov_id=14)\n         AND movimiento.cliente_id=cliente.cliente_id AND cliente.empresa_id=0";
    if ($fecha_inicio) {
        $query .= " AND fecha>='{$fecha_inicio_bd}' AND fecha<='{$fecha_fin_bd} 23:59:59' ";
    }
    if ($user) {
        $query .= " AND movimiento.admin_id={$user} ";
    }
    $query .= " ORDER BY fecha DESC";
    $results = $database->get_results($query);
    foreach ($results as $item) {
        $vendedor = $item['nombre'] . " " . $item['apellidop'];
        echo "<tr><td style='text-align:right' width=30 >" . $item['movimiento_id'] . "</td>\n\t\t\t\t\t\t<td style='text-align:center'><span class='hidden-desktop'>" . fechamysqltous($item['fecha']) . "</span><a class='hidden-print' href=/index.php?data=estadisticas&op=ventas&fi=" . fechamysqltous($fecha_inicio) . "&hi={$hi}&ff=" . fechamysqltous($fecha_fin) . "&hf={$hf}&fid=" . $item['factura_id'] . ">" . fechamysqltomx($item['fecha'], "letra") . "</a></td>\n\t\t\t\t\t\t\t<td style='text-align:center'>" . $item['tipomov'] . "\n\t\t\t\t\t\t\t<br></td>\n\t\t\t\t\t\t\t<td style='text-align:right'>\$ " . dinero($item['cantidad'] + $item['iva']) . "</td>\n\t\t\t\t\t\t\t<td style='text-align:right'>" . $vendedor;
        echo "&nbsp;&nbsp;</td></tr>";
        $n++;
    }
    echo " </tbody>\n\t\t</table> ";
    //echo "Pagos Atrazados: ".$pagos_atrazados;
    echo "</div>";
}
Exemple #3
0
function productos($subcat, $tid)
{
    $database = new DB();
    echo "<div class=\"box-header\">\n\t\t\t\t\t\t<h2><i class=\"halflings-icon align-justify\"></i><span class=\"break\"></span>Productos</h2>\n\t\t\t\t\t\t<div class=\"box-icon\">\n\t\t\t\t\t\t\t<a href=\"#\" class=\"btn-setting\"><i class=\"halflings-icon wrench\"></i></a>\n\t\t\t\t\t\t\t<a href=\"#\" class=\"btn-minimize\"><i class=\"halflings-icon chevron-up\"></i></a>\n\t\t\t\t\t\t\t<a href=\"#\" class=\"btn-close\"><i class=\"halflings-icon remove\"></i></a>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"box-content\">\n\t\t\t\t\t\t<table class=\"table table-striped table-bordered\">   <!-- bootstrap-datatable datatable -->\n\t\t\t\t\t\t\t  <thead>\n\t\t\t\t\t\t\t\t  <tr>\n\t\t\t\t\t\t\t\t\t  <th>Id</th>\n\t\t\t\t\t\t\t\t\t  <th></th>\n\t\t\t\t\t\t\t\t\t  <th>Producto</th>\n\t\t\t\t\t\t\t\t\t  <th>PCM</th>\n                                      <th>PCN</th>\n\t\t\t\t\t\t\t\t\t  <th>Stock</th>\n                                      <th>Desc</th>\n                                      <th>Season</th>\n\t\t\t\t\t\t\t\t  </tr>\n\t\t\t\t\t\t\t  </thead>\n\t\t\t\t\t\t\t  <tbody>";
    $query = "SELECT producto_id,codigo,producto,precio_compra,precio_contado,stock,producto.descuento,temporada,up\n                        FROM producto,temporada where producto.temporada_id=temporada.temporada_id AND subcategoria_id={$subcat} ";
    if ($tid >= 0) {
        $query .= " AND producto.temporada_id={$tid}";
    }
    $subs = $database->get_results($query);
    foreach ($subs as $sub) {
        if ($_GET['prid'] == $sub['producto_id']) {
            echo "<tr bgcolor=green'>";
        } else {
            echo "<tr>";
        }
        if ($sub['up']) {
            $activo = "*";
        } else {
            $activo = "";
        }
        echo "<td>" . $sub['codigo'] . "</td>";
        echo "<td>" . $activo . "</td>";
        echo "<td><a href=\"#\" onclick='showProduct(" . $sub['producto_id'] . ")'\n                            class=\"btn-setting\">" . $sub['producto'] . "</a>&nbsp;&nbsp;";
        if ($_GET['prid'] == $sub['producto_id']) {
            echo "<i class=\"halflings-icon ok \"></i>";
        }
        echo "</td>\n\t\t\t\t\t\t\t<td style='text-align:right'>" . dinero($sub['precio_compra'] * 1.16) . "</td>\n\t\t\t\t\t\t\t<td style='text-align:right'>" . dinero($sub['precio_contado'] * 1.16) . "</td>\n\t\t\t\t\t\t\t<td style='text-align:right'>" . $sub['stock'] . "</td>\n                            <td style='text-align:right'>" . $sub['descuento'] . "%</td>\n                            <td style='text-align:right'>" . strtoupper($sub['temporada']) . "</td>\n\t\t\t\t\t\t\t</tr>";
    }
    echo "\t\t\t\t  </tbody>\n\t\t\t\t\t\t </table>\n\t\t\t\t\t</div>\n\t\t\t\t";
}
Exemple #4
0
function show_pedidos()
{
    $database = new DB();
    echo "<div class=\"box span8 hidden-print\">";
    echo "  <div class=\"box-header\">\n\t\t\t\t<h2><i class=\"halflings-icon align-justify\"></i><span class=\"break\"></span>Pedidos</h2>\n\t\t\t\t<div class=\"box-icon\">\n\t\t\t\t\t<a href=\"#\" class=\"btn-setting\"><i class=\"halflings-icon wrench\"></i></a>\n\t\t\t\t\t<a href=\"#\" class=\"btn-minimize\"><i class=\"halflings-icon chevron-up\"></i></a>\n\t\t\t\t\t<a href=\"#\" class=\"btn-close\"><i class=\"halflings-icon remove\"></i></a>\n\t\t\t    </div>\n\t\t\t</div>\n\t\t\t<div class=\"box-content\">";
    echo "<div id='pedidos'>";
    echo "<table class=\"table table-striped table-bordered\">   <!-- bootstrap-datatable datatable -->\n\t\t\t\t\t\t\t  <thead>\n\t\t\t\t\t\t\t\t  <tr>\n                                      <th>Nombre</th>\n\t\t\t\t\t\t\t\t\t  <th>Fecha de Orden</th>\n\t\t\t\t\t\t\t\t\t  <th>Fecha de Entrega</th>\n                                      <th>Status</th>\n\t\t\t\t\t\t\t\t\t  <th>Total</th>\n                                      <th>Anticipo</th>\n\n\t\t\t\t\t\t\t\t  </tr>\n\t\t\t\t\t\t\t  </thead>\n\t\t\t\t\t\t\t  <tbody>";
    $query = "SELECT * FROM pedido,status,pedido_nombre\n                        where pedido.pedido_nombre_id=pedido_nombre.pedido_nombre_id AND pedido.status_id=status.status_id";
    $subs = $database->get_results($query);
    foreach ($subs as $sub) {
        $status_id = $sub['status_id'];
        echo "<tr>";
        echo "<td>" . $sub['nombre'] . "</td>\n\t\t\t\t\t\t\t<td><a href=\"#\" onclick=\"showData('pedidos','view/pedidos/pedidos.php','case=pedidos')\"\n                            class=\"btn-setting\">" . $sub['fecha_orden'] . "</a>&nbsp;&nbsp;</td>\n\t\t\t\t\t\t\t<td style='text-align:left'>" . $sub['fecha_entrega'] . "</td>\n\t\t\t\t\t\t\t<td style='text-align:left'>" . $sub['status'];
        echo "</td>\n\t\t\t\t\t\t\t<td style='text-align:right'>" . dinero($sub['total']) . "</td>\n                            <td style='text-align:right'>" . dinero($sub['anticipo']) . "</td>\n\n\t\t\t\t\t\t\t</tr>";
    }
    echo "\t\t\t\t  </tbody>\n\t\t  \t\t </table>\n            </div> <!-- fin de la seccion -->\n  \t    </div>\n        </div>\n\t\t\t\t";
}
function catalogo($proveedor_id)
{
    $database = new DB();
    $query = "SELECT categoria_id,categoria  FROM categoria \n\t\twhere 1 ";
    $results = $database->get_results($query);
    foreach ($results as $row) {
        echo "<tr >\n\t\t\t<td><font >" . $row['categoria'] . " </td>\n\t\t\t<td><font > </td>\n\t\t\t<td><font > </td>\n\t\t\t<td><font > </td>\n\t\t\t<td><font > </td>\n\t\t\t</tr>";
        $query = "SELECT subcategoria_id,subcategoria  FROM subcategoria where categoria_id=" . $row['categoria_id'];
        $subs = $database->get_results($query);
        foreach ($subs as $sub) {
            $query = "SELECT MIN(precio_compra) as precio_min,MAX(precio_compra) as precio_max FROM producto \n\t\t\t\t\t\twhere subcategoria_id=" . $sub['subcategoria_id'] . " AND proveedor_id={$proveedor_id}";
            list($precio_min, $precio_max) = $database->get_row($query);
            $query = "SELECT count(producto_id) as productos FROM producto \n\t\t\t\t\twhere subcategoria_id=" . $sub['subcategoria_id'] . " AND proveedor_id={$proveedor_id}";
            list($productos) = $database->get_row($query);
            echo "<tr><td></td><td align=right> \n\t\t\t\t\t\t<a href=/index.php?data=proveedores&op=detalles&pid={$proveedor_id}&subcat=" . $sub['subcategoria_id'] . ">" . $sub['subcategoria'] . "</a>&nbsp;&nbsp; </td>\n\t\t\t\t\t\t<td>{$productos}</td><td style='text-align:right'>" . dinero($precio_min) . "</td><td style='text-align:right'>" . dinero($precio_max) . "</td></tr>";
        }
    }
}
Exemple #6
0
function mostrar_ventas()
{
    $database = new DB();
    //$fecha=fechaplusweek($fecha);
    $total_pagos = ceil($total / $abono);
    echo "\n\t\t\t\t\t<div class=\"box-header\">\n\t\t\t\t\t\t<h2></span>Ventas</h2>\n\t\t\t\t\t\t<div class=\"box-icon\">\n\t\t\t\t\t\t\t<a href=\"#\" class=\"btn-setting\"><i class=\"halflings-icon wrench\"></i></a>\n\t\t\t\t\t\t\t<a href=\"#\" class=\"btn-minimize\"><i class=\"halflings-icon chevron-up\"></i></a>\n\t\t\t\t\t\t\t<a href=\"#\" class=\"btn-close\"><i class=\"halflings-icon remove\"></i></a>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div>\n\t\t\t\t\t\t<table class=\"table table-condensed striped\" width=100% >\n\t\t\t\t\t\t\t  <thead>\n\t\t\t\t\t\t\t\t  <tr>\n\t\t\t\t\t\t\t\t\t  <th style='text-align:right'>Id</th>\n\t\t\t\t\t\t\t\t\t  <th style='text-align:right'>Fecha</th>\n\t\t\t\t\t\t\t\t\t  <th style='text-align:right'>Cliente</th>\n\t\t\t\t\t\t\t\t\t  <th style='text-align:center'>Tipo Venta</th>\n\t\t\t\t\t\t\t\t\t  <th style='text-align:center'>Total</th>\n\t\t\t\t\t\t\t\t\t  <th style='text-align:center'>Desc</th>\n\t\t\t\t\t\t\t\t\t  <th style='text-align:center'>Vendedor</th>\n\t\t\t\t\t\t\t\t  </tr>\n\t\t\t\t\t\t\t  </thead>   \n\t\t\t\t\t\t\t  <tbody>";
    $query = "SELECT  *, (notaventa+cupon+bono) as descuento from factura,tipomov,admin where factura.tipomov_id=tipomov.tipomov_id AND factura.admin_id=admin.admin_id ORDER BY factura_id DESC";
    $results = $database->get_results($query);
    foreach ($results as $item) {
        $vendedor = $item['nombre'] . " " . $item['apellidop'];
        echo "<tr><td style='text-align:right'>" . $item['factura_id'] . "</td>\n\t\t\t\t\t\t<td style='text-align:right'>\n\t\t\t\t\t\t<a href=/index.php?data=estadisticas&op=ventas&fi={$fi}&hi={$hi}&ff={$ff}&hf={$hf}&fid=" . $item['factura_id'] . ">" . $item['fecha'] . "</a></td><td style='text-align:right'>" . $item['cliente_id'] . "</td>\n\t\t\t\t\t\t\t<td>" . $item['tipomov'] . "\n\t\t\t\t\t\t\t<br></td> \n\t\t\t\t\t\t\t<td style='text-align:right'>\$ " . dinero($item['total'] + $item['iva']) . "</td>\n\t\t\t\t\t\t\t<td style='text-align:right'>\$ " . dinero($item['descuento']) . "</td>\n\t\t\t\t\t\t\t<td style='text-align:right'>" . $vendedor;
        echo "&nbsp;&nbsp;</td></tr>";
        $n++;
    }
    echo " </tbody>\n\t\t</table> ";
    //echo "Pagos Atrazados: ".$pagos_atrazados;
    echo "</div>";
}
Exemple #7
0
function autocupon($factura_id)
{
    $database = new DB();
    $query = "SELECT cantidad,sku,cupontipo_id,fecha_fin,compra_minima from cupones where factura_id='{$factura_id}'";
    list($cantidad, $cupon_sku, $cupontipo_id, $fecha_fin, $compra_minima) = $database->get_row($query);
    if ($cantidad) {
        echo "<table width=310 style='border:2px dotted black'>";
        echo "<tr><td align=center>CUPON</td></tr>";
        echo "<tr><td align=center>BUENO POR</td></tr>";
        echo "<tr><td align=center><font size=+3><b>\$ " . dinero($cantidad) . " MX<b></font></td></tr>";
        echo "<tr><td align=center>Compra Minima: \$ " . dinero($compra_minima) . " MX</td></tr>";
        echo "<tr><td align=center><font size=-1>Valido hasta: " . fechamysqltomx($fecha_fin, "letra") . "</center></font></td></tr>";
        echo "<tr><td align=center> <img width=310 src=\"barcode.php?text=" . $cupon_sku . "\" alt=\"barcode\" /></td></tr>";
        echo "<tr><td align=center><font size=-1>Promocion no reembolsable en efectivo, ni combinable con otras promociones\n    o cupones. <br>No aplica con productos en LIQUIDACION</font></td></tr>";
        echo "</table>";
        return $cupon_sku;
    } else {
        return "";
    }
}
function movimientos($cliente_id, $saldo)
{
    $database = new DB();
    $fecha_hoy = date("Y-m-d  H:i:s");
    $fecha = fechaminusmonth($fecha_hoy, 3);
    $query = "SELECT sum(cantidad) FROM cliente,movimiento,admin,tipomov \n\t\twhere movimiento.cliente_id={$cliente_id} AND movimiento.tipomov_id=tipomov.tipomov_id AND movimiento.cliente_id=cliente.cliente_id \n\t\tAND movimiento.admin_id=admin.admin_id AND fecha >= '{$fecha}' AND tipomov.tmov=1 ORDER BY movimiento.fecha ASC limit 100";
    list($total_abonos) = $database->get_row($query);
    $query = "SELECT sum(cantidad) FROM cliente,movimiento,admin,tipomov \n\t\twhere movimiento.cliente_id={$cliente_id} AND movimiento.tipomov_id=tipomov.tipomov_id AND movimiento.cliente_id=cliente.cliente_id \n\t\tAND movimiento.admin_id=admin.admin_id AND fecha >= '{$fecha}' AND tipomov.tmov=0 ORDER BY movimiento.fecha ASC limit 100";
    list($total_cargos) = $database->get_row($query);
    $query = "SELECT factura_id,fecha, cantidad, tipomov.tipomov,tmov, admin.nombre,total_ultimo FROM cliente,movimiento,admin,tipomov \n\t\twhere movimiento.cliente_id={$cliente_id} AND movimiento.tipomov_id=tipomov.tipomov_id AND movimiento.cliente_id=cliente.cliente_id \n\t\tAND movimiento.admin_id=admin.admin_id AND fecha >= '{$fecha}' ORDER BY movimiento.fecha ASC limit 100";
    $saldo = $saldo + $total_cargos - $total_abonos;
    $results = $database->get_results($query);
    $i = 0;
    foreach ($results as $row) {
        if ($row['tmov'] == 0 || $row['tmov'] == 1) {
            $i += 1;
            if ($row['tmov'] == 0) {
                $saldo -= $row['cantidad'];
            }
            if ($row['tmov'] == 1) {
                $saldo += $row['cantidad'];
            }
            echo "<tr >\n\t\t\t<td align=right><font >&nbsp;{$i}&nbsp;</td>\n\t\t\t<td><a class=\"hidden-print\" href=\"/index.php?data=clientes&op=factura&fid=" . $row['factura_id'] . "\">" . $row['fecha'] . "<a>\n\t\t\t\t<a class=\"visible-print\" >" . fechamysqltomx($row['fecha'], 1) . "<a>\n\t\t\t </td>";
            if ($row['tmov'] == 0) {
                echo "<td align=center>---</td>\n\t\t\t\t<td align=right> <font >" . $row['cantidad'] . "&nbsp;&nbsp; </td>";
            }
            if ($row['tmov'] == 1) {
                echo "\n\t\t\t\t<td align=right> <font >" . $row['cantidad'] . "&nbsp;&nbsp; </td>\n\t\t\t\t<td align=center>---</td>";
            }
            $row['admin_id'] = isset($row['admin_id']) ? $row['admin_id'] : '';
            echo "<td><font ><b>" . dinero($saldo) . "</td>\n\t\t\t<td><font >" . $row['tipomov'] . "</td>";
            "<td hidden> <font >" . $row['admin_id'] . "</td>";
            echo "</tr>";
        }
    }
}
    } else {
        echo " style=\"text-align:right;background:red;color:white;\"> ** ";
    }
    echo dinero($vlimp);
    echo "</td>";
    ?>
								<td style="text-align:right;"><?php 
    echo dinero($row['precio_contado'] * 1.16);
    ?>
</td>
								<td style="text-align:right;"><?php 
    echo dinero($row['precio_credito'] * 1.16);
    ?>
</td>
                                <td style="text-align:right;"><?php 
    echo dinero($row['descuento']);
    ?>
</td>
								<td style="text-align:right;"><?php 
    echo $productos_vendidos;
    //$row['stock']
    ?>
</td>
								<td class="center"><a class="hidden-print" href="index.php?data=productos&filtro=proveedor&pid=<?php 
    echo $row['proveedor_id'];
    ?>
"><?php 
    echo $row['proveedor'];
    ?>
</a>
                                <span class=hidden-desktop><?php 
							  <thead>
								  <tr>
									  <th style="text-align:center">Temporada</th><th>Descuento</th><th>Items</th>
								  </tr>
							  </thead>
							  <tbody>



<?php 
$query = "SELECT * from temporada ";
$results = $database->get_results($query);
foreach ($results as $row) {
    $query = "SELECT count(producto_id) as total from producto where temporada_id=" . $row['temporada_id'];
    list($total_items) = $database->get_row($query);
    echo " <tr><td><b>" . strtoupper($row['temporada']) . "</b></td>\n        <td style='text-align:left'><div id='editar_" . strtolower($row['temporada']) . "'>" . dinero($row['descuento']) . "%\n        <a  onclick=\"showData('editar_" . strtolower($row['temporada']) . "','promociones_f.php','data=promociones&case=editar_porcentaje&temporada_id=" . $row['temporada_id'] . "')\">[Editar]</a></div>\n        <td style='text-align:left'>" . $total_items . "</td></tr>";
    $query = "SELECT count(producto_id) as total from producto where temporada_id=" . $row['temporada_id'] . " AND descuento=" . $row['descuento'];
    list($incluidos) = $database->get_row($query);
    $query = "SELECT count(producto_id) as total from producto where temporada_id=" . $row['temporada_id'] . " AND descuento<>" . $row['descuento'];
    list($excluidos) = $database->get_row($query);
    echo " <tr><td>&nbsp;&nbsp;&nbsp;\n                <a href='/index.php?data=promociones&tid=" . $row['temporada_id'] . "&i=1'>Incluidos</a></td><td style='text-align:left'>" . $incluidos . "</td>";
    echo " <td>";
    echo "<form action='/functions/crud_promociones.php' method=post>";
    echo "<input type='hidden' name='data' value='{$data}' />";
    echo "<input type='hidden' name='func' value='a' />";
    echo "<input type='hidden' name='i' value='1' />";
    echo "<input type='hidden' name='temporada_id' value='" . $row['temporada_id'] . "' />";
    echo "<input type=\"submit\" value='Aplicar' />";
    echo "</form>";
    echo "</td></tr>";
    echo " <tr><td>&nbsp;&nbsp;&nbsp;\n                <a href='/index.php?data=promociones&tid=" . $row['temporada_id'] . "&i=0'>excluidos</a></td><td style='text-align:left'>" . $excluidos . "</td>\n                <td>";
Exemple #11
0
									<a href="#refresh"><i class="icon-repeat"></i></a>
								</li>
								<li>
                                    <a href="#">
										<span class="header">
											<span class="title">Hasta</span>
											<span class="percent">Abono</span>
										</span>
                                    </a>
                                </li>

								<?php 
$query = "SELECT abono,limite FROM abono where activado=1 ORDER BY limite ASC";
$results = $database->get_results($query);
foreach ($results as $row) {
    echo "<li>\n                                    \t\t<a href=\"#\">\n\t\t\t\t\t\t\t\t\t\t\t<span class=\"header\">\n\t\t\t\t\t\t\t\t\t\t\t\t<span class=\"title\">" . dinero($row['limite']) . "</span>\n\t\t\t\t\t\t\t\t\t\t\t\t<span class=\"percent\">" . dinero($row['abono']) . "</span>\n\t\t\t\t\t\t\t\t\t\t\t</span>\n                                    \t\t</a>\n                                \t\t</li>";
}
?>



								<li>
                            		<a class="dropdown-menu-sub-footer">Ver todos los planes</a>
								</li>
							</ul>
						</li>
						<!-- end: Notifications Dropdown -->



echo strtoupper($contrato);
?>
</td></tr>
	<tr><td>Nombre del Trabajador:</td><td><?php 
echo strtoupper($cliente);
?>
</td></tr>
<?php 
echo "<tr><td>Domicilio del Trabajador:</td><td>" . strtoupper($domicilio) . "</td></tr>";
if ($empresa_id) {
    echo "<tr><td>Nombre de la Empresa:</td><td>" . strtoupper($empresa) . "</td></tr>";
    echo "<tr><td>Domicilio de la Empresa:</td><td>" . strtoupper($domicilio_empresa) . "</td></tr>";
}
?>
	<tr><td>Importe del Credito Autorizado:</td><td><?php 
echo " \$ " . dinero($credito);
?>
M.N.</td></tr>
</table>
<br>
<?php 
if ($empresa_id) {
    echo "<p>\nManifiesto mi consentimiento para que el monto del crédito autorizado por Tiendas Alberto sea descontado vía nómina por mi patrón, en las fechas correspondientes.<br>\nSi no se hacen los descuentos vía nómina para la amortización del crédito otorgado “el suscriptor” se compromete a pagar directamente en el domicilio de la Tiendas Alberto.\n</p>";
} else {
    echo "<p>Manifiesto estar deacuerdo en pagar el credito otorgado directamente en el domicilio de Tiendas ALberto.</p>";
}
?>

<span>PAGARÉ</span>
<br>
<p>
</td></tr>

                                  <tr bgcolor=gray><td style="color:white;border-top:2px solid"><b>Total</b></td><td style="text-align:right;color:white;border-top:2px solid"><b><?php 
echo dinero($total - $devoluciones);
?>
</b></td></tr>
                                  <tr><td>Pedidos Andrea</td><td style="text-align:right"><?php 
echo dinero($pedidos_andrea);
?>
</td></tr>
                                  <tr><td>Anticipos</td><td style="text-align:right"><?php 
echo dinero($anticipos_andrea);
?>
</td></tr>
                                  <tr><td>Abonos Nomina</td><td style="text-align:right"><?php 
echo dinero($abonos_nomina);
?>
</td></tr>


                              </tbody>
						 </table>








Exemple #14
0
     }
     echo "</table>";
     echo "<table width=100%";
     echo "<tr><td></td><td>&nbsp;Descripcion<br></td><td align=right>Precio<br> Unitario</td></tr>";
     $n = $items - 1;
     $total = 0;
     foreach ($item as $row => $value) {
         echo "<tr><td style='border-top:1px dotted black;'> " . ($n + 1) . " &nbsp;</td>\n\t\t\t\t\t\t\t\t\t\t\t\t<td  style='border-top:1px dotted black;'>" . $item[$n]['sku'] . "<br>" . substr($item[$n]['producto'], 0, 23) . "...</a>\n\t\t\t\t\t\t\t\t\t\t\t<br>" . strtolower($item[$n]['color']) . " " . strtoupper($item[$n]['talla']) . "</td>\n\t\t\t\t\t\t\t\t\t\t\t<td style='text-align:right;border-top:1px dotted black;'><b>";
         if ($cliente_id) {
             echo dinero($item[$n]['precio_credito'] + $item[$n]['precio_credito'] * 0.16);
         } else {
             if ($item[$n]['descuento'] > 0) {
                 echo "(-" . $item[$n]['descuento'] . "%)&nbsp; <s>" . dinero($item[$n]['precio_contado'] * 1.16) . "</s><br>";
                 echo dinero($item[$n]['precio_venta']);
             } else {
                 echo dinero($item[$n]['precio_contado'] * 1.16);
             }
         }
         echo "</td><td><a href=\"/functions/cart.php?func=del_item&i={$n}\" class=\"\">\n\t\t\t\t\t\t\t\t\t\t\t<i class=\"halflings-icon trash\"></i></i></a></td></tr>";
         $total_credito += $item[$n]['precio_credito'];
         $total_contado += $item[$n]['precio_contado'];
         $n--;
     }
 }
 // if ($total_credito AND $cliente_id)
 // {
 // 	$total_iva_credito=$total_credito*.16;
 // 	$disponible=$credito-$saldo-$total_credito-$total_iva_credito;
 // 	$saldo_total=$saldo+$total_credito+$total_iva_credito;
 // 	echo "<tr><td><br><a name=total>$items items.</a>&nbsp;</a></td></td></tr>";
 // 	// echo "<tr><td colspan=4 style=\"border-bottom:1px dotted black\">&nbsp;</td></tr><tr><td></td><td style='text-align:right'>Total</td><td style='text-align:right;boarder-top:2px solid;'>$". dinero($total_credito+$total_iva_credito)."</td></tr>";
Exemple #15
0
function getticket_pedido($peid)
{
    $database = new DB();
    if ($peid) {
        $query = "SELECT nombre, telefono,pedido_id,fecha_orden,fecha_entrega,status,total,anticipo\n                             FROM pedido_nombre,pedido,status\n\t\t\t\t\t\tWHERE  pedido_nombre.pedido_nombre_id=pedido.pedido_nombre_id AND pedido.status_id=status.status_id AND pedido.pedido_id=" . $peid;
        list($nombre, $telefono, $pedido_id, $fecha_orden, $fecha_entrga, $status, $total, $anticipo) = $database->get_row($query);
        $cliente = $apellidop . " " . $apellidom . " " . $nombre;
    }
    echo "<table  width=100% >\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<td style='text-align:center;border-bottom:1px dotted black;' colspan=3>\n\t\t\t\t\t\t\t\t<a href=\"/index.php\"><img width=300 src=/img/logo-tiendas-alberto.jpg></a>\n\t\t\t\t\t\t\t\t<br>R.F.C QUCR750708PM7\n\t\t\t\t\t\t\t\t<center>NOTA DE VENTA</center>";
    echo "<font size=-1>";
    echo "Cliente: " . strtoupper($cliente) . "<br>";
    if ($tipomov_id == 3) {
        echo "Tipo de Venta: <span class=\"label label-inverse\">Credito</span><br>";
    } else {
        echo "<br>";
    }
    //Tipo de Venta: <span class=\"label label-inverse\">Contado</span><br><br>";
    $no_ticket = sprintf('%06d', $pedido_id);
    echo "No.: {$no_ticket} [{$cliente_id}.345]<br>";
    echo "Fecha y Hora: <br>" . $fecha_orden;
    //date("d-m-Y  H:m:s");
    echo "<br>";
    echo "</font></td></tr>";
    echo "<tr><td>&nbsp;</td></tr>";
    if ($tipomov_id == 3) {
        $query = "SELECT  pedido_det_id,pedido_det.producto_id,pedido_det.pedido_id,pedido_det.producto,\n                        pedido_det.precio_contado,pedido_det.iva,producto.codigo,color,talla,pedido_det.sku FROM pedido_det,producto\n\t\t\t\t\tWHERE  pedido_det.producto_id=producto.producto_id AND pedido_det.pedido_id=" . $peid;
        $results = $database->get_results($query);
        $n = 0;
        $total = 0;
        foreach ($results as $item) {
            echo "<tr><td>&nbsp;</td><td>" . $itemaaaaa['facturadet_id'] . " " . $item['sku'] . "<br>\n\t\t\t\t\t\t\t" . substr($item['producto'], 0, 26) . "...</a>\n\t\t\t\t\t\t\t<br>" . $item['color'] . " " . $item['talla'] . "</td>\n\t\t\t\t\t\t\t<td style='text-align:right;vertical-align:text-top'>";
            if ($tipomov_id == 3) {
                echo dinero($item['precio_credito'] * 1.16);
            } else {
                echo dinero($item['precio_contado'] * 1.16);
            }
            echo "&nbsp;&nbsp;</td></tr>";
            $total_credito += $item['precio_credito'];
            $total_contado += $item['precio_contado'];
            $n++;
        }
    }
    if ($total_credito and $cliente_id > 0) {
        $total_iva_credito = $total_credito * 0.16;
        $disponible = $credito - $saldo - $total_credito - $total_iva_credito;
        //$saldo_total=$saldo+$total_credito+$total_iva_credito;
        echo "<tr><td>&nbsp;</td></tr>";
        echo "<tr style=\"border-top:1px dotted black\"><td style=\"border-top:1px dotted black\">&nbsp;</td><td style='text-align:right;border-top:1px dotted black'>Total</td>\n\t\t\t\t\t      \t  <td style='text-align:right;border-top:1px dotted;'>\$" . dinero($total_credito * 1.16) . "&nbsp;&nbsp;</td></tr>";
        echo "<tr><td>&nbsp;</td><td style='text-align:right'>&nbsp;Incluye IVA(16%) por</td><td style='text-align:right;border-bottom:2px solid;'>+&nbsp;" . dinero($total_iva_credito) . "&nbsp;&nbsp;</td></tr>";
        echo "<tr><td>&nbsp;</td><td style='text-align:right'>&nbsp;<strong>Total</strong></td><td style='text-align:right;'><strong>" . dinero($total_iva_credito + $total_credito) . "</strong>&nbsp;&nbsp;</td></tr>";
        echo "<tr><td>&nbsp;</td><td>&nbsp;</td></tr>";
        echo "<tr><td>&nbsp;</td><td style='text-align:right'>Saldo Actual</td><td style='text-align:right'>+  \$ " . dinero($saldo_actual) . "&nbsp;&nbsp;</td></tr>";
        echo "<tr><td>&nbsp;</td><td style='text-align:right;'><strong>Saldo Total</strong></td><td style='text-align:right;border-top:2px solid;'><strong>\$ " . dinero($saldo_total) . "</strong>&nbsp;&nbsp;</td></tr>";
        echo "<tr><td>&nbsp;</td><td style='text-align:right'>Abono</td>";
        $query = "SELECT abono,limite FROM abono ORDER BY limite ASC";
        $results = $database->get_results($query);
        foreach ($results as $row) {
            //echo $total_credito." ".$row['limite']." <br> ";
            if ($saldo_total <= $row['limite']) {
                $abono = $row['abono'];
                break;
            }
        }
        echo "<td style='text-align:right;border-top:2px solid;'>\$" . dinero($abono) . "&nbsp;&nbsp;</td>";
        echo "</tr>";
    } else {
        if ($cliente_id == 0) {
            $query = "SELECT  pedido_det.producto_id,pedido_det.pedido_id,pedido_det.producto,\n                        pedido_det.precio_contado,pedido_det.iva,producto.codigo,color,talla,pedido_det.sku FROM pedido_det,producto\n\t\t\t\t\tWHERE  pedido_det.producto_id=producto.producto_id AND pedido_det.pedido_id=" . $peid;
            $results = $database->get_results($query);
            $n = 0;
            $total = 0;
            foreach ($results as $item) {
                echo "<tr><td>&nbsp;</td><td>" . $itemaaaaaa['facturadet_id'] . " " . $item['sku'] . "<br>\n\t\t\t\t\t\t\t" . substr($item['producto'], 0, 26) . "</a>\n\t\t\t\t\t\t\t<br>" . $item['color'] . " " . $item['talla'] . "</td>\n\t\t\t\t\t\t\t<td style='text-align:right;vertical-align:text-top'>";
                echo dinero($item['precio_contado']);
                echo "&nbsp;&nbsp;</td></tr>";
                $total_contado += $item['precio_contado'];
                $n++;
            }
            $total_iva_contado = $total_contado - $total_contado / 1.16;
            //echo "<tr><td></td><td>&nbsp;</td></tr>";"
            echo "<tr><td>&nbsp;</td></tr>";
            echo "<tr style=\"border-top:1px dotted black\"><td style=\"border-top:1px dotted black\">&nbsp;</td><td style='text-align:right;border-top:1px dotted black'>Total</td>\n\t\t\t\t\t      \t  <td style='text-align:right;border-top:1px dotted;'>\$" . dinero($total_contado) . "&nbsp;&nbsp;</td></tr>";
            // echo "<tr style=\"border-top:1px dotted black\"><td></td><td style='text-align:right'>Total</td><td style='text-align:right'>$". dinero($total_contado+$total_iva_contado)."</td></tr>";
            echo "<tr><td></td><td style='text-align:right'>Incluye IVA(16%) por</td>\n\t\t\t\t\t\t\t<td style='text-align:right'>\$" . dinero($total_iva_contado) . "&nbsp;&nbsp;</td></tr>";
            echo "<tr><td></td><td style='text-align:right'>&nbsp;<strong>Total</strong></td>\n\t\t\t\t\t\t\t<td style='text-align:right;text-align:right;border-top:2px solid;'><strong>" . dinero($total_contado) . "</strong>&nbsp;&nbsp;</td></tr>";
            echo "<tr><td></td><td style='text-align:right'>Anticipo</td>\n\t\t\t\t\t\t\t<td style='text-align:right'>- \$" . dinero($anticipo) . "&nbsp;&nbsp;</td></tr>";
            echo "<tr><td></td><td style='text-align:right'>&nbsp;<strong>Saldo</strong></td>\n\t\t\t\t\t\t\t<td style='text-align:right;text-align:right;border-top:2px solid;'><strong>" . dinero($total_contado - $anticipo) . "</strong>&nbsp;&nbsp;</td></tr>";
            $fecha_hoy = date("Y-m-d");
            $query = "SELECT  promocion_id,promocion,tipodesc from promocion where \"{$fecha_hoy}\">=fecha_inicio AND \"{$fecha_hoy}\"<=fecha_fin";
            list($promocion_id, $promocion, $tipodesc) = $database->get_row($query);
            $promociones = $database->num_rows($query);
            if ($promociones) {
                switch ($tipodesc) {
                    case '1':
                        $promo = get_promo($total_contado);
                        break;
                    case '2':
                        $promo = get_promo_porcentaje($total_contado);
                        break;
                    default:
                        # code...
                        break;
                }
                echo "<tr><td></td><td style='text-align:right'>&nbsp;<font size=+1>{$promocion}</font></td>\n\t\t\t\t\t\t\t\t\t\t\t<td style='text-align:right;text-align:right;color:black;border-bottom:1px solid black;'>\n\t\t\t\t\t\t\t\t\t\t\t<b>- " . dinero($promo) . "</b>&nbsp;&nbsp;</td></tr>";
                echo "<tr><td></td><td style='text-align:right'>&nbsp;<font size=+1>Ud. Pag&oacute;</font></td>\n\t\t\t\t\t\t\t\t\t\t\t<td width=100 style='text-align:right;text-align:right;color:black;border:1px solid black;'>\n\t\t\t\t\t\t\t\t\t\t\t<b> \$ " . dinero($total_contado - $promo) . "</b>&nbsp;&nbsp;</td></tr>";
            }
            if ($efectivo) {
                echo "<tr><td></td><td style='text-align:right'>&nbsp;Efectivo</td>\n\t\t\t\t\t\t\t<td style='text-align:right;text-align:right;'>" . dinero($efectivo) . "&nbsp;&nbsp;</td></tr>";
                echo "<tr><td></td><td style='text-align:right'>&nbsp;Cambio</td>\n\t\t\t\t\t\t\t<td style='text-align:right;text-align:right;border-top:2px solid;'>" . dinero($efectivo - $total_contado + $promo) . "&nbsp;&nbsp;</td></tr>";
            }
        }
    }
    // if ($promociones)
    // {
    // echo "<tr><td colspan=3><br><br>RECUERDE:  En Promociones no hay cambios ni devoluciones</td></tr>";
    // }
    echo "</table>";
}
Exemple #16
0
         $total_contado += $item[$k]['precio_venta'];
         $total_iva_credito += $item[$k]['iva_credito'];
         $total_iva_contado += $item[$k]['iva_contado'];
     }
     $k++;
     echo "<br>\n";
 }
 echo $total_credito;
 echo $total_contado;
 echo $total_iva_credito;
 echo $total_iva_contado;
 if ($tipomov_id == 3) {
     $total = round($total_credito + $total_iva_credito);
 }
 if ($tipomov_id == 14) {
     $total = dinero($total_contado);
 }
 echo "<br>tipomov_id: " . $tipomov_id;
 echo "<br>total: " . $total;
 $saldo = $saldo_anterior - $total;
 //Fields and values to update
 $update = array('total' => $total, 'saldo' => $saldo);
 //Add the WHERE clauses
 $where_clause = array('devolucion_id' => $devolucion_id);
 $updated = $database->update('devolucion', $update, $where_clause, 1);
 //The fields and values to insert
 $names = array('cliente_id' => $cliente_id, 'fecha_actual' => $fecha_hoy, 'fecha' => $fecha_hoy, 'admin_id' => $admin_id, 'tipomov_id' => 2, 'factura_id' => $devolucion_id, 'cantidad' => $total);
 $add_query = $database->insert('movimiento', $names);
 $abono = get_abono($saldo);
 echo "<br>abono" . $abono;
 // if ($saldo>0)
Exemple #17
0
<?php

$relative_path = isset($relative_path) ? $relative_path : "";
$relative_path = "/../..";
$realpath = getcwd();
require_once $realpath . '/../../config/config.php';
$database = new DB();
foreach ($_POST as $key => $value) {
    $_POST[$key] = $database->filter($value);
}
foreach ($_GET as $key => $value) {
    $_GET[$key] = $database->filter($value);
}
$case = isset($_GET['case']) ? $_GET['case'] : "";
$database = new DB();
if ($case == "pedidos") {
    echo "<table class=\"table table-striped table-bordered\">   <!-- bootstrap-datatable datatable -->\n          <thead>\n\t\t  <tr><th>Nombre</th><th>Fecha de Orden</th><th>Fecha de Entrega</th><th>Status</th><th>Total</th><th>Anticipo</th></tr>\n\t\t  </thead>\n\t\t  <tbody>";
    $query = "SELECT * FROM pedido,status,pedido_nombre\n                        where pedido.pedido_nombre_id=pedido_nombre.pedido_nombre_id AND pedido.status_id=status.status_id";
    $subs = $database->get_results($query);
    foreach ($subs as $sub) {
        $status_id = $sub['status_id'];
        echo "<tr>";
        echo "<td><b>" . $sub['nombre'] . "</b></td>\n            <td><a href=\"#\" onclick=\"showData('pedidos','view/pedidos/pedidos.php','case=pedidos')\">\n                                           " . $sub['fecha_orden'] . "</a>&nbsp;&nbsp;</td>\n            <td style   ='text-align:left'>" . $sub['fecha_entrega'] . "</td>\n            <td style   ='text-align:left'>" . $sub['status'] . "</td>\n            <td style   ='text-align:right'>" . dinero($sub['total']) . "</td>\n            <td style   ='text-align:right'>" . dinero($sub['anticipo']) . "</td>\n            </tr>";
    }
    echo "</tbody>\n\t\t  </table>";
}

							</div>
							<div class="tab-pane" id="custom">
								<img class="grayscale hidden-print" src=fotos/images.jpeg width=150 align=right></img>
									<p><b><?php 
echo $nombre . ' ' . $apellidop . ' ' . $apellidom;
?>
</b> &nbsp;&nbsp;</p>
									<table><tr><td valign=top align=right>
									<p>Limite de Credito:<b> <?php 
echo dinero($credito);
?>
</b></p>
									<p>Total Financiado:<b>	<?php 
echo dinero($total_ultimo);
?>
</b>	</p>
								</td>
								<td>&nbsp;&nbsp;</td>
								<td
									<p>Inicio Plazo:<b> <?php 
echo $fecha_total_inicio;
?>
</b></p>
									<p>Fin Plazo: <b><?php 
echo $fecha_total_ultimo;
?>
</b></p>
									</td>
									<td>&nbsp;&nbsp;</td>
Exemple #19
0
<?php

require $realpath . '../config/config.php';
$database = new DB();
foreach ($_POST as $key => $value) {
    $_POST[$key] = $database->filter($value);
}
foreach ($_GET as $key => $value) {
    $_GET[$key] = $database->filter($value);
}
$productos = $_GET['q'];
$producto = explode(" ", $productos);
$n = count($producto);
if ($producto) {
    $query = "SELECT producto_id,producto,precio_compra,precio_contado,precio_credito FROM producto \n\t\t\t\t\t\tWHERE producto like '%" . $producto[0] . "%'";
    for ($i = 1; $i < $n; $i++) {
        $query .= " and producto like '%" . $producto[$n - 1] . "%' ";
    }
    $query .= " Limit 30";
    $results = $database->get_results($query);
    echo "<table width=400>";
    foreach ($results as $row) {
        echo "<tr><td>\n\t\t\t\t\t\t<a href='index.php?data=productos&op=producto_form&f=editar&prid=" . $row['producto_id'] . "'>" . strtoupper($row['producto']) . "</a></td><td align=right>" . dinero($row['precio_compra']) . "</td>\n\t\t\t\t\t\t<td align=right>" . dinero($row['precio_contado']) . "</td>\n\t\t\t\t\t\t<td align=right>" . dinero($row['precio_credito']) . "</td></tr>";
    }
    echo "</table>";
}
?>
				
    echo fechamysqltomx($row['fecha_ini'], "letra");
    ?>
<br><?php 
    echo fechamysqltomx($row['fecha_fin'], "letra");
    ?>
</td>



                                <?php 
    if ($row['cupontipo_id'] == 1) {
        echo "<td class=\"center\">\$ " . dinero($row['cantidad']) . " MX";
    } else {
        echo "<td class=\"center\"> " . dinero($row['cantidad']) . " %";
    }
    echo "<br>CM: \$ " . dinero($row['compra_minima']) . " </td>";
    if ($activo) {
        echo "<td><i class=\"icon-check\"></i></td>";
    } else {
        echo "<td><i class=\"icon-check-empty\"></i></td>";
    }
    if ($row['usado']) {
        echo "<td><i class=\"icon-check\"></i></td>";
    } else {
        echo "<td><i class=\"icon-check-empty\"></i></td>";
    }
    ?>
							</tr>

<?php 
}
Exemple #21
0
function get_vale($did)
{
    $database = new DB();
    $fecha_hoy = date("Y-m-d H:i:s");
    $query = "SELECT fecha,cantidad,codigo from vale where devolucion_id={$did}";
    list($fecha_hoy, $cantidad, $codigo) = $database->get_row($query);
    echo "<table width=100% >";
    echo "<tr><td style='text-align:center'>ESTE ES UN VALE POR:</td></tr>";
    echo "<tr><td style='text-align:center'><font size=-2>Fecha: {$fecha_hoy}</font></td></tr>";
    //echo "<tr><td style='text-align:center'><font size=-2>Valida por 30 dias</font></td></tr>";
    echo "<tr><td style='text-align:center'><br><img width=\"300\" src=\"barcode.php?text=V{$codigo}\" alt=\"barcode\"></td></tr>";
    echo "<tr><td style='text-align:center'><font size=+2>\$ " . dinero($cantidad) . " MXN</font></td></tr>";
    echo "</table>";
}
Exemple #22
0
    echo "<tr><td style='text-align:right'>&nbsp;<strong>Total</strong></td><td width=120 style='text-align:right;'><strong>\$ " . dinero($total_iva_credito + $total_credito) . "</strong></td></tr>";
    echo "<tr><td>&nbsp;</td></tr>";
    echo "<tr><td style='text-align:right'>Saldo Actual</td><td style='text-align:right'>+ \$ " . dinero($saldo) . "</td></tr>";
    echo "<tr><td style='text-align:right'>Saldo Nuevo:</td><td style='text-align:right;border-top:2px solid black;'> \$ " . dinero($saldo_total) . "</td></tr>";
    //echo "<tr><td style='text-align:right'>Saldo Actual</td><td style='text-align:right'>+ &nbsp;&nbsp; &nbsp;&nbsp; &nbsp;$ ".dinero($saldo)."</td></tr>";
    //echo "<tr><td style='text-align:right;'>Saldo Total</td><td style='text-align:right;border-top:2px solid;'>$ ".dinero($saldo_total)."</td></tr>";
    echo "<tr><td style='text-align:right'>Abono:</td><td style='text-align:right'> \$ " . dinero($abono) . "</td></tr>\n\t\t\t\t\t</table>";
    echo "</div>\n\t\t\t\t<div class=\"modal-footer\">\n\t\t\t\t\t<a href=\"#\" class=\"btn\" data-dismiss=\"modal\">Cancelar</a>\n\t\t\t\t\t<a href=\"/functions/cerrarventa.php\" class=\"btn btn-primary\">Continuar</a>\n\t\t\t\t</div>\n\t\t\t</form>\n\t\t\t</div>";
} else {
    echo "<p> Tipo de Venta: <span class=\"label label-inverse\">Contado</span></p><br>\n\t\t\t\t\t<table  width=100%>";
    $total_iva_contado = $total_contado * 0.16;
    echo "<tr><td>&nbsp;</td></tr>";
    // echo "<tr><td>&nbsp;</td><td style='text-align:right'>Total</td><td style='text-align:right'>$". dinero($total_contado+$total_iva_contado)."</td></tr>";
    // echo "<tr><td>&nbsp;</td><td style='text-align:right'>Incluye IVA(16%) por</td><td style='text-align:right'>$". dinero($total_iva_contado)."</td></tr>";
    echo "<tr><td>&nbsp;</td><td style='text-align:right'>&nbsp;<strong>Total</strong></td>\n\t\t\t\t\t\t\t\t\t\t\t<td width=190 style='text-align:right;text-align:right;border-top:0px solid;'><h1> \$ " . dinero($total_contado - $cantidad) . "</h1></td></tr>";
    if ($promociones) {
        echo "<tr><td>&nbsp;</td><td style='text-align:right'>&nbsp;<strong>{$promocion}</strong></td>\n\t\t\t\t\t\t\t\t\t\t\t<td width=190 style='text-align:right;text-align:right;border-top:0px solid;'><h1> - " . dinero($promo) . "</h1></td></tr>";
        echo "<tr><td>&nbsp;</td><td style='text-align:right'>&nbsp;<strong>Ud. Paga</strong></td>\n\t\t\t\t\t\t\t\t\t\t\t<td width=190 style='text-align:right;text-align:right;border:1px solid;'><h1> \$ " . dinero($total_contado - $promo - $cantidad) . "</h1></td></tr>";
    }
    echo "</table>";
    echo "<br><br><form action=/functions/cerrarventa.php>";
    echo "<table width=100%><tr><td>&nbsp;</td><td style='text-align:right;text-align:right;border-top:0px solid;'>\n\t\t\t\t\t\t\t\t\t<div class=\"control-group\"><label class=control-label>Pagar con:</label></td>\n\t\t\t\t\t\t\t\t\t<td style=\"text-align:right\" width=120>\n\t\t\t\t\t\t\t\t\t<div class=controls> <input class=\"input-small\" style=\"text-align:right\" id=cantidad name=efectivo type=text value='" . dinero($total_contado - $promo - $cantidad) . "'></div>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t</td></tr>";
    echo "</table>";
    echo "</div>\n\t\t\t\t<div class=\"modal-footer\">\n\t\t\t\t\t<a href=\"#\" class=\"btn\" data-dismiss=\"modal\">Cancelar</a>\n\t\t\t\t\t <a href=\"/functions/cerrarventa.php\" class=\"btn btn-primary\">Continuar.php</a> \n\t\t\t\t\t<button type=\"submit\" class=\"btn btn-primary\">Continue</button>\n\t\t\t\t</div>\n\t\t\t</form>\n\t\t\t</div>";
}
?>
</div>
</div>


Exemple #23
0
                               <input type="hidden" name="func" value="g">

							  <div class="control-group ">
								<label class="control-label" for="cupon">Bueno por $</label>
								<div class="controls">
								  <input class="input-xlarge" id="cupon" name="cupon" type="text" value="<?php 
    echo dinero($monto);
    ?>
" disabled>
								</div>
							  </div>
                              <div class="control-group ">
								<label class="control-label" for="compra_minima">Compra Minima $</label>
								<div class="controls">
								  <input class="input-xlarge" id="compra_minima" name="compra_minima" type="text" value="<?php 
    echo dinero($compra_minima);
    ?>
" disabled>
								</div>
							  </div>

							<div class="control-group">
							  <label class="control-label" for="fecha_ini">Fecha Inicio (m/d/A)</label>
							  <div class="controls">
								<input type="text" class="input-xlarge datepicker" id="fecha_ini" name="fecha_ini" value="<?php 
    echo fechamysqltous($fecha_ini);
    ?>
">
							  </div>
							</div>
    ?>
							<tr>
								<td><a href=/index.php?data=clientes&op=detalles&cid=<?php 
    echo $row['cliente_id'];
    ?>
 >
									<?php 
    echo strtoupper($row['apellidop'] . ' ' . $row['apellidom'] . ' ' . $row['nombre']);
    ?>
</a></td>
								<td class="center"><?php 
    echo dinero($row['abono']);
    ?>
</td>
								 <td class="center"><?php 
    echo dinero($row['saldo']);
    ?>
</td>
								<td class="center"><?php 
    echo $row['email'];
    ?>
</td>
								 <td class="center">
									<a class="btn btn-success" href="#">
										<i class="halflings-icon white zoom-in"></i>  
									</a>
									<a class="btn btn-info" href="#">
										<i class="halflings-icon white edit"></i>  
									</a>
									<a class="btn btn-danger" href="#">
										<i class="halflings-icon white trash"></i> 
    list($cupones_id, $cupon_id, $sku, $fecha_ini, $fecha_fin, $cantidad, $cupontipo_id, $compra_minima, $activo, $fecha_uso, $usado, $admin_id, $bulk) = $database->get_row($query);
    $apellidos = $apellidop . " " . $apellidom;
}
if ($cupon_id) {
    echo "<center>";
    echo "<table width=400 style=\"border:2px dotted\">";
    echo "<tr><td bgcolor=black><center><h2 ><b><font color=white> CUPON </font></b></h2></center></td></tr>";
    switch ($cupontipo_id) {
        case '1':
            echo "<tr><td><br><center><h1 ><b>\$ " . dinero($cantidad) . " MX </b></h1></center></td></tr>";
            break;
        case '2':
            echo "<tr><td><br><center><h1 ><b>\$ " . dinero($cantidad) . " MX </b></h1></center></td></tr>";
            break;
    }
    echo "<tr><td><center><b>Compra Minima: " . dinero($compra_minima) . "</B></center></td></tr>";
    echo "<tr><td><center><b>Valido: " . fechamysqltomx($fecha_ini, "letra") . " - " . fechamysqltomx($fecha_fin, "letra") . "</B></center></td></tr>";
    if ($fecha_fin < date("Y-m-d")) {
        echo "<tr><td><br><center><span class=\"label label-important\">EXPIRADO</span></B></center></td></tr>";
    }
    //  else echo "<tr><td><center><b>Valido: ".fechamysqltomx($fecha_ini,"letra")." - ".fechamysqltomx($fecha_fin,"letra")."</B></center></td></tr>";
    if (strtotime(date("Y-m-d")) < strtotime($fecha_ini)) {
        echo "<tr bgcolor=yellow><td ><center>Error Fecha: Todavia no se puede usar</center></td></tr>";
    }
    if (!$activo) {
        echo "<tr bgcolor=yellow><td ><center>Status: Sin Activar</center></td></tr>";
    }
    if ($usado) {
        echo "<tr><td> <center>{$cupontipo_id} Usado el: <center></td></tr>";
    }
    echo "<tr><td><center>Hoy es " . fechamysqltomx(date("Y-m-d"), "letra") . "</td></tr>";
    echo "<font color=red><b> -";
}
echo dinero($devoluciones);
?>
</td></tr>

                                <tr bgcolor=gray><td style="color:white;border-top:2px solid"><b>Total</b></td><td style="text-align:right;color:white;border-top:2px solid"><b><?php 
echo dinero($total - $devoluciones);
?>
</b></td></tr>
                                  <tr><td>Pedidos Andrea</td><td style="text-align:right"><?php 
echo dinero($pedidos_andrea);
?>
</td></tr>
                                  <tr><td>Anticipos</td><td style="text-align:right"><?php 
echo dinero($anticipos_andrea);
?>
</td></tr>


                              </tbody>
						 </table>

                </div>




				<div class="widget blue span8" onTablet="span8" onDesktop="span8">

					<h2><span class="glyphicons globe"><i></i></span> Ingresos Netos</h2>
foreach ($results as $row) {
    ?>

<div class="image">
		<div class="header">
			AHORRA
		</div>
	<div class="box">
		<div class="text"><br>
		<span>$ <?php 
    echo dinero($row['cantidad']);
    ?>
 MX</span>
			<br>
			COMPRA MINIMA: $ <?php 
    echo dinero($row['compra_minima']);
    ?>
 MX
			<br>
			<?php 
    if ($row['fecha_ini'] <= date("Y-m-d")) {
        echo "<h2>Vence: " . fechamysqltomx($row['fecha_fin'], "letra") . "</h2>";
    } else {
        echo "<h2>Vigencia " . fechamysqltomx($row['fecha_ini'], "letra") . " al " . fechamysqltomx($row['fecha_fin'], "letra") . "</h2>";
    }
    ?>
		</div>
			<div class="footer">
			<?php 
    echo "<img width=320 src=\"barcode_cupon.php?text=" . $row['sku'] . "\" alt=\"barcode\" />";
    ?>
					<div class="span3 statbox black" onTablet="span6" onDesktop="span3">
						<!--div class="boxchart">5,6,7,2,0,4,2,4,8,2,3,3,2</div-->
						<div class="number"><br><?php 
    echo dinero(32000);
    ?>
&nbsp;<!--i class="icon-arrow-up"></i--></div>
						<div class="title"><br>Total Deuda</div>
						<!--div class="footer">
							<a href="#"> Saldo</a>
						</div-->	
					</div>

					<div class="span3 statbox green" onTablet="span6" onDesktop="span3">
						<!--div class="boxchart">5,6,7,2,0,4,2,4,8,2,3,3,2</div-->
						<div class="number"><br><?php 
    echo dinero(28000);
    ?>
&nbsp;<!--i class="icon-arrow-up"></i--></div>
						<div class="title"><br>Saldo</div>
						<!--div class="footer">
							<a href="#"> Saldo</a>
						</div-->	
					</div>

				</div>

<?php 
}
?>

Exemple #29
0
        $query .= " AND bulk={$bulk}";
    }
    $results = $database->get_results($query);
    echo "<table>";
    foreach ($results as $row) {
        echo "<tr><td>";
        switch ($row['cupontipo_id']) {
            case 1:
                echo "\$ " . dinero($row['cantidad']) . " MX";
                break;
            case 2:
                echo $row['cantidad'] . " %";
                break;
        }
        echo ",*" . strtoupper($row['sku']) . "*," . fechamysqltomx($row['fecha_ini'], "letra") . "," . fechamysqltomx($row['fecha_fin'], "letra");
        echo ",\$ " . dinero($row['compra_minima']) . " MX<td><tr>";
    }
    echo "</table>";
}
if ($location) {
    header($location);
}
function generar_cupones($cuid, $cuantos, $admin_id, $fecha_ini, $fecha_fin)
{
    $array = isset($array) ? $array : "";
    $database = new DB();
    echo $query = "SELECT cupon_id,cantidad,cupontipo_id,compra_minima FROM cupon WHERE cupon_id='{$cuid}' limit 1";
    list($cupon_id, $cantidad, $cupontipo_id, $compra_minima) = $database->get_row($query);
    $query = "SELECT sku FROM cupones  ORDER BY sku DESC limit 1";
    list($sku) = $database->get_row($query);
    $query = "SELECT bulk FROM cupones GROUP BY bulk ORDER BY bulk DESC limit 1";
echo $precio_contado;
?>
"> <?php 
echo dinero($precio_contado / 1.16);
?>
							  </div>
							</div>

							  <div class="control-group">
								<label class="control-label" >Precio Credito</label>
								<div class="controls">
								  <input class="input-small" id="precio_credito" name="precio_credito" type="text" value="<?php 
echo $precio_credito;
?>
"> <?php 
echo dinero($precio_credito / 1.16);
?>
								</div>
							  </div>

							  <div class="control-group">
								<label class="control-label" >Precio Promocion</label>
								<div class="controls">
								  <input class="input-small" id="precio_promocion" name="precio_promocion" type="text" value="<?php 
echo $precio_promocion;
?>
">
								</div>
							  </div>

							  <div class="control-group">