Exemplo n.º 1
0
    ?>
</h1>
</center>
</div>
<div class="clearfix"></div>
<br>
<?php 
    ?>

</div>

	<div class="col-md-4">


	<?php 
    $ototal = -1 * Operation2Data::GetOutputQYesF($product->id);
    ?>
<div class="jumbotron">
<center>
	<h2>Salidas</h2>
	<h1><?php 
    echo $ototal;
    ?>
</h1>
</center>
</div>


<div class="clearfix"></div>
<br>
<?php 
Exemplo n.º 2
0
    <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 = Sell2Data::getById($_GET["id"]);
    $operations = Operation2Data::getAllProductsBySellId($_GET["id"]);
    $total = 0;
    if (isset($_COOKIE["selled"])) {
        foreach ($operations as $operation) {
            //		print_r($operation);
            $qx = Operation2Data::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) {
                        echo "<p class='alert alert-warning'>El producto <b style='text-transform:uppercase;'> {$p->name}</b> tiene pocas existencias en inventario.</p>";
                    }
                }
            }
        }
        setcookie("selled", "", time() - 18600);
Exemplo n.º 3
0
<?php

if (!isset($_SESSION["reabastecer"])) {
    $product = array("product_id" => $_POST["product_id"], "q" => $_POST["q"]);
    $_SESSION["reabastecer"] = array($product);
    $cart = $_SESSION["reabastecer"];
    ///////////////////////////////////////////////////////////////////
    ///////////////////////////////////////////////////////////////////
    $process = true;
} else {
    $found = false;
    $cart = $_SESSION["reabastecer"];
    $index = 0;
    $q = Operation2Data::getQYesF($_POST["product_id"]);
    $can = true;
    ?>

<?php 
    if ($can == true) {
        foreach ($cart as $c) {
            if ($c["product_id"] == $_POST["product_id"]) {
                echo "found";
                $found = true;
                break;
            }
            $index++;
            //	print_r($c);
            //	print "<br>";
        }
        if ($found == true) {
            $q1 = $cart[$index]["q"];
Exemplo n.º 4
0
<?php 
    }
    ?>
</div>
<div class="clearfix"></div>
<br><table class="table table-bordered table-hover">
	<thead>
		<th>Codigo</th>
		<th>Nombre</th>
		<th>Unidad</th>
		<th>Disponible</th>
		<th></th>
	</thead>
	<?php 
    foreach ($curr_products as $product) {
        $q = Operation2Data::getQYesF($product->id);
        ?>
	<tr class="<?php 
        if ($q <= $product->inventary_min / 2) {
            echo "danger";
        } else {
            if ($q <= $product->inventary_min) {
                echo "warning";
            }
        }
        ?>
">
		<td style="width:100px;"><?php 
        echo $product->code;
        ?>
</td>
Exemplo n.º 5
0
$sell = Selldata::getById($_GET["id"]);
$sell->cajero_id = Session::getUID();
$sell2 = new Sell2Data();
$sell2->user_id = $_SESSION["user_id"];
$s = $sell2->add_re_out();
$products = OperationData::getAllProductsBySellId($sell->id);
foreach ($products as $prod) {
    $product = ProductData::getById($prod->product_id);
    if ($product->use_ingredient) {
        $ingredients = ProductIngredientData::getAllByProductId($prod->product_id);
        foreach ($ingredients as $ing) {
            $ingredient = IngredientData::getById($ing->ingredient_id);
            $q = Operation2Data::getQYesF($ing->ingredient_id);
            if ($q > 0) {
                $op = new Operation2Data();
                $op->ingredient_id = $ingredient->id;
                $op->operation_type_id = 2;
                // 2 - salida
                $op->sell_id = $s[1];
                $op->q = $prod->q * $ing->q;
                $add = $op->add();
            }
        }
    }
    # code...
}
// inventariemos
//print_r(expression)
$sell->apply();
// print_r($sell);