Example #1
0
                                <div class="">
                                    <div class="table-responsive ">
                                        <!-- .table - Uses sparkline charts-->
<?php 
$meseros = UserData::getAllMeseros();
if (count($meseros) > 0) {
    ?>
<table class="table table-striped table-bordered datatable ">
                                            <thead>
                                            <th></th>
                                                <th>Nombre</th>
                                                <th>Total</th>
                                            </thead>
<?php 
    foreach ($meseros as $mesero) {
        $sells = SellData::getAllDayliByMesero($mesero->id);
        $total = 0;
        if (count($sells) > 0) {
            foreach ($sells as $sell) {
                $total += $sell->total;
            }
        }
        ?>
                                            <tr>
                                            <td><a href="index.php?view=reportbymesero&mesero_id=<?php 
        echo $mesero->id;
        ?>
" class="btn btn-default btn-xs"><i class="glyphicon glyphicon-chevron-right"></i></a> </td>
                                                <td><?php 
        echo $mesero->name . " " . $mesero->lastname;
        ?>
Example #2
0
<div class="btn-group pull-right">
  <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
    <i class="fa fa-download"></i> Descargar <span class="caret"></span>
  </button>
  <ul class="dropdown-menu" role="menu">
    <li><a href="report/onere-word.php?id=<?php 
echo $_GET["id"];
?>
">Word 2007 (.docx)</a></li>
  </ul>
</div>
<h1>Resumen de Reabastecimiento</h1>
<?php 
if (isset($_GET["id"]) && $_GET["id"] != "") {
    $sell = SellData::getById($_GET["id"]);
    $operations = OperationData::getAllProductsBySellId($_GET["id"]);
    $total = 0;
    if (isset($_COOKIE["selled"])) {
        foreach ($operations as $operation) {
            //		print_r($operation);
            $qx = OperationData::getQYesF($operation->product_id);
            // print "qx=$qx";
            $p = $operation->getProduct();
            if ($qx == 0) {
                echo "<p class='alert alert-danger'>El producto <b style='text-transform:uppercase;'> {$p->name}</b> no tiene existencias en inventario.</p>";
            } else {
                if ($qx <= $p->inventary_min / 2) {
                    echo "<p class='alert alert-danger'>El producto <b style='text-transform:uppercase;'> {$p->name}</b> tiene muy pocas existencias en inventario.</p>";
                } else {
                    if ($qx <= $p->inventary_min) {
Autoloader::register();
$word = new PhpOffice\PhpWord\PhpWord();
$clients = PersonData::getClients();
$section1 = $word->AddSection();
$section1->addText("HISTORIAL DE CAJA", array("size" => 22, "bold" => true, "align" => "right"));
$boxes = BoxData::getAll();
$products = SellData::getSellsUnBoxed();
$styleTable = array('borderSize' => 6, 'borderColor' => '888888', 'cellMargin' => 40);
$styleFirstRow = array('borderBottomColor' => '0000FF', 'bgColor' => 'AAAAAA');
$table1 = $section1->addTable("table1");
$table1->addRow();
$table1->addCell()->addText("Total");
$table1->addCell()->addText("Fecha");
$total_total = 0;
foreach ($boxes as $box) {
    $sells = SellData::getByBoxId($box->id);
    $total = 0;
    foreach ($sells as $sell) {
        $operations = OperationData::getAllProductsBySellId($sell->id);
        foreach ($operations as $operation) {
            $product = $operation->getProduct();
            $total += $operation->q * $product->price_out;
        }
    }
    $total_total += $total;
    $table1->addRow();
    $table1->addCell(5000)->addText("\$ " . number_format($total, 2, ".", ","));
    $table1->addCell(2500)->addText($box->created_at);
}
$section1->addText("");
$section1->addText("Total: \$" . number_format($total_total, 2, ".", ","), array("size" => 22));
Example #4
0
	</div>
	</div>
<br><!--- -->
<div class="row">
	
	<div class="col-md-12">
		<?php 
if (isset($_GET["sd"]) && isset($_GET["ed"])) {
    if ($_GET["sd"] != "" && $_GET["ed"] != "") {
        ?>
			<?php 
        $operations = array();
        if ($_GET["client_id"] == "") {
            $operations = SellData::getAllByDateOp($_GET["sd"], $_GET["ed"], 2);
        } else {
            $operations = SellData::getAllByDateBCOp($_GET["client_id"], $_GET["sd"], $_GET["ed"], 2);
        }
        ?>

			 <?php 
        if (count($operations) > 0) {
            ?>
			 	<?php 
            $supertotal = 0;
            ?>
<table class="table table-bordered">
	<thead>
		<th>Id</th>
		<th>Subtotal</th>
		<th>Descuento</th>
		<th>Total</th>
Example #5
0
<table class="table table-bordered table-hover datatable">
<thead>
    <th>Numero</th>
    <th></th>
</thead>
<?php 
foreach (ItemData::getAll() as $career) {
    ?>
<tr>
    <td><b><?php 
    echo $career->name;
    ?>
</b></td>
    <td>
<?php 
    $sells = SellData::getAllUnAppliedByItemId($career->id);
    if (count($sells) > 0) {
        ?>
    <?php 
        foreach ($sells as $s) {
            ?>
    <?php 
            $operations = OperationData::getAllProductsBySellId($s->id);
            $mesero = UserData::getById($s->mesero_id);
            ?>
        <?php 
            if (count($operations) > 0) {
                ?>
            <table class="table table-bordered">
            <tr>
                <td><a href="./?view=onesell&id=<?php 
Example #6
0
        }
        if ($num_succ == count($cart)) {
            $process = true;
        }
        if ($process == false) {
            $_SESSION["errors"] = $errors;
            ?>
	
<script>
	window.location="index.php?view=sell";
</script>
<?php 
        }
        //////////////////////////////////
        if ($process == true) {
            $sell = new SellData();
            $sell->q = $_POST["q"];
            $sell->mesero_id = $_POST["mesero_id"];
            $sell->item_id = $_POST["mesa"];
            $s = $sell->add();
            foreach ($cart as $c) {
                print_r($c);
                print "<br>";
                $op = new OperationData();
                $op->product_id = $c["product_id"];
                $op->operation_type_id = OperationTypeData::getByName("salida")->id;
                $op->sell_id = $s[1];
                $op->q = $c["q"];
                if (isset($_POST["is_oficial"])) {
                    $op->is_oficial = 1;
                }
Example #7
0
    <li><a href="report/box-word.php?id=<?php 
echo $_GET["id"];
?>
">Word 2007 (.docx)</a></li>
  </ul>
</div>
</div>
		<h1><i class='fa fa-archive'></i> Corte de Caja #<?php 
echo $_GET["id"];
?>
</h1>
		<div class="clearfix"></div>


<?php 
$products = SellData::getByBoxId($_GET["id"]);
if (count($products) > 0) {
    $total_total = 0;
    ?>
<br>
<table class="table table-bordered table-hover	">
	<thead>
		<th></th>
		<th>Total</th>
		<th>Fecha</th>
	</thead>
	<?php 
    foreach ($products as $sell) {
        ?>

	<tr>
Example #8
0
include "../core/autoload.php";
include "../core/app/model/BoxData.php";
include "../core/app/model/SellData.php";
include "../core/app/model/PersonData.php";
include "../core/app/model/OperationData.php";
include "../core/app/model/ProductData.php";
require_once '../PhpWord/Autoloader.php';
use PhpOffice\PhpWord\Autoloader;
use PhpOffice\PhpWord\Settings;
Autoloader::register();
$word = new PhpOffice\PhpWord\PhpWord();
$clients = PersonData::getClients();
$section1 = $word->AddSection();
$section1->addText("CORTE DE CAJA #" . $_GET["id"], array("size" => 22, "bold" => true, "align" => "right"));
$sells = SellData::getByBoxId($_GET["id"]);
$styleTable = array('borderSize' => 6, 'borderColor' => '888888', 'cellMargin' => 40);
$styleFirstRow = array('borderBottomColor' => '0000FF', 'bgColor' => 'AAAAAA');
$table1 = $section1->addTable("table1");
$table1->addRow();
$table1->addCell()->addText("Total");
$table1->addCell()->addText("Fecha");
$total_total = 0;
foreach ($sells as $sell) {
    $total = 0;
    $operations = OperationData::getAllProductsBySellId($sell->id);
    foreach ($operations as $operation) {
        $product = $operation->getProduct();
        $total += $operation->q * $product->price_out;
    }
    $total_total += $total;
Example #9
0
if (isset($_GET["page"])) {
    $page = $_GET["page"];
}
$limit = 10;
if (isset($_GET["limit"]) && $_GET["limit"] != "" && $_GET["limit"] != $limit) {
    $limit = $_GET["limit"];
}
$products = null;
if (!isset($_GET["t"])) {
    $products = SellData::getAll();
} else {
    if (isset($_GET["t"]) && $_GET["t"] == "0") {
        $products = SellData::getAllUnApplied();
    } else {
        if (isset($_GET["t"]) && $_GET["t"] == "1") {
            $products = SellData::getAllApplied();
        }
    }
}
if (count($products) > 0) {
    ?>

<div class="box box-solid box-primary">
                                <div class="box-header">
                                    <h3 class="box-title"></h3>
                                </div>
                                <div class="box-body table-responsive">
<table class="table table-bordered table-hover datatable">
	<thead>
		<th></th>
		<th>Id</th>
Example #10
0
        }
        if ($num_succ == count($cart)) {
            $process = true;
        }
        if ($process == false) {
            $_SESSION["errors"] = $errors;
            ?>
	
<script>
	window.location="index.php?view=sell";
</script>
<?php 
        }
        //////////////////////////////////
        if ($process == true) {
            $sell = new SellData();
            $sell->user_id = $_SESSION["user_id"];
            $sell->total = $_POST["total"];
            $sell->discount = $_POST["discount"];
            if (isset($_POST["client_id"]) && $_POST["client_id"] != "") {
                $sell->person_id = $_POST["client_id"];
                $s = $sell->add_with_client();
            } else {
                $s = $sell->add();
            }
            foreach ($cart as $c) {
                $op = new OperationData();
                $op->product_id = $c["product_id"];
                $op->operation_type_id = OperationTypeData::getByName("salida")->id;
                $op->sell_id = $s[1];
                $op->q = $c["q"];
Example #11
0
<div class="row">
	<div class="col-md-12">
<div class="btn-group pull-right">
<a href="./index.php?view=boxhistory" class="btn btn-primary "><i class="fa fa-clock-o"></i> Historial</a>
<a href="./index.php?view=processbox" class="btn btn-primary ">Procesar Ventas <i class="fa fa-arrow-right"></i></a>
</div>
		<h1><i class='fa fa-archive'></i> Caja</h1>
		<div class="clearfix"></div>


<?php 
$products = SellData::getSellsUnBoxed();
if (count($products) > 0) {
    $total_total = 0;
    ?>
<br>
<table class="table table-bordered table-hover	">
	<thead>
		<th></th>
		<th>Producto</th>
		<th>Total</th>
		<th>Fecha</th>
	</thead>
	<?php 
    foreach ($products as $sell) {
        ?>

	<tr>
		<td style="width:30px;">

		<td>
Example #12
0
<div class="row">
	<div class="col-md-12">
		<h1><i class='glyphicon glyphicon-shopping-cart'></i> Lista de Ventas</h1>
		<div class="clearfix"></div>


<?php 
$products = SellData::getSells();
if (count($products) > 0) {
    ?>
<br>
<table class="table table-bordered table-hover	">
	<thead>
		<th></th>
		<th>Producto</th>
		<th>Total</th>
		<th>Fecha</th>
		<th></th>
	</thead>
	<?php 
    foreach ($products as $sell) {
        ?>

	<tr>
		<td style="width:30px;">
		<a href="index.php?view=onesell&id=<?php 
        echo $sell->id;
        ?>
" class="btn btn-xs btn-default"><i class="glyphicon glyphicon-eye-open"></i></a></td>

		<td>
Example #13
0
<div class="row">
	<div class="col-md-12">
		<h1><i class='glyphicon glyphicon-shopping-cart'></i> Reabastecimientos</h1>
		<div class="clearfix"></div>


<?php 
$products = SellData::getRes();
if (count($products) > 0) {
    ?>
<br>
<table class="table table-bordered table-hover	">
	<thead>
		<th></th>
		<th>Producto</th>
		<th>Total</th>
		<th>Fecha</th>
		<th></th>
	</thead>
	<?php 
    foreach ($products as $sell) {
        ?>

	<tr>
		<td style="width:30px;"><a href="index.php?view=onere&id=<?php 
        echo $sell->id;
        ?>
" class="btn btn-xs btn-default"><i class="glyphicon glyphicon-eye-open"></i></a></td>

		<td>
Example #14
0
<?php

$sells = SellData::getSellsUnBoxed();
if (count($sells)) {
    $box = new BoxData();
    $b = $box->add();
    foreach ($sells as $sell) {
        $sell->box_id = $b[1];
        $sell->update_box();
    }
    Core::redir("./index.php?view=b&id=" . $b[1]);
}
Example #15
0
<?php

if (isset($_SESSION["reabastecer"])) {
    $cart = $_SESSION["reabastecer"];
    if (count($cart) > 0) {
        $process = true;
        //////////////////////////////////
        if ($process == true) {
            $sell = new SellData();
            $sell->user_id = $_SESSION["user_id"];
            if (isset($_POST["client_id"]) && $_POST["client_id"] != "") {
                $sell->person_id = $_POST["client_id"];
                $s = $sell->add_re_with_client();
            } else {
                $s = $sell->add_re();
            }
            foreach ($cart as $c) {
                $op = new OperationData();
                $op->product_id = $c["product_id"];
                $op->operation_type_id = 1;
                // 1 - entrada
                $op->sell_id = $s[1];
                $op->q = $c["q"];
                if (isset($_POST["is_oficial"])) {
                    $op->is_oficial = 1;
                }
                $add = $op->add();
            }
            unset($_SESSION["reabastecer"]);
            setcookie("selled", "selled");
            ////////////////////