示例#1
0
 public function getTotal()
 {
     $products = BuyProductData::getAllByBuyId($this->id);
     $total = 0;
     foreach ($products as $px) {
         $p = ProductData::getById($px->product_id);
         $total += $p->price * $px->q;
     }
     return $total;
 }
示例#2
0
<?php

if (isset($_GET["product_id"])) {
    $product = ProductData::getById($_GET["product_id"]);
    $operations = OperationData::getAllByProductIdCutIdUnOficial($product->id, $_GET["cutid"]);
    ?>
<div class="row">
	<div class="col-md-12">
<a href="index.php?view=cuthistory&product_id=<?php 
    echo $_GET["product_id"];
    ?>
&cutid=<?php 
    echo $_GET["cutid"];
    ?>
" class="btn btn-default pull-right btn-lg"><i class="glyphicon glyphicon-chevron-left"></i> Operaciones con Factura </a>

<h1><i class="glyphicon glyphicon-time"></i> Historial</h1>
<h2><?php 
    echo $product->name;
    ?>
 <small>Operaciones sin factura</small></h2>
	</div>
	</div>

<div class="row">


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


	<?php 
示例#3
0
    $total = 0;
    ?>
<h2>Lista de venta</h2>
<table class="table table-bordered table-hover">
<thead>
	<th style="width:30px;">Codigo</th>
	<th style="width:30px;">Cantidad</th>
	<th style="width:30px;">Unidad</th>
	<th>Producto</th>
	<th style="width:30px;">Precio Unitario</th>
	<th style="width:30px;">Precio Total</th>
	<th ></th>
</thead>
<?php 
    foreach ($_SESSION["cart"] as $p) {
        $product = ProductData::getById($p["product_id"]);
        ?>
<tr >
	<td><?php 
        echo $product->id;
        ?>
</td>
	<td ><?php 
        echo $p["q"];
        ?>
</td>
	<td><?php 
        echo $product->unit;
        ?>
</td>
	<td><?php 
示例#4
0
		<h2>Confirmacion de compra</h2>
		<h4>Metodo de pago: <b><?php 
    echo $pm->name;
    ?>
</b></h4>
<table class="table table-bordered">
<thead>
	<th>Codigo</th>
	<th>Producto</th>
	<th>Cantidad</th>
	<th>Precio Unitario</th>
	<th>Total</th>
</thead>
<?php 
    foreach ($_SESSION["cart"] as $s) {
        $p = ProductData::getById($s["product_id"]);
        ?>
<tr>
<td><?php 
        echo $p->code;
        ?>
</td>
<td><?php 
        echo $p->name;
        ?>
</td>
<td style="width:100px;">
<?php 
        echo $s["q"];
        ?>
</td>
示例#5
0
 public function getProduct()
 {
     return ProductData::getById($this->product_id);
 }
示例#6
0
<?php

$product = ProductData::getById($_GET['product_id']);
?>

<?php 
if ($product != null) {
    ?>
<div class="row">
	<div class="col-md-8">
  <div style="font-size:34px;">Alta en inventario</div>
		<h2>Producto: <?php 
    echo $product->name;
    ?>
</h2>

<br><form class="form-horizontal" method="post" action="index.php?view=processinput" role="form">
   <div class="form-group">
    <label for="inputEmail1" class="col-lg-2 control-label">Unidad</label>
    <div class="col-lg-10">
      <input type="text" value="<?php 
    echo $product->unit;
    ?>
" readonly="readonly" class="form-control" id="inputEmail1" placeholder="Cantidad de productos">
    </div>
  </div>
  <div class="form-group">
    <label for="inputEmail1" class="col-lg-2 control-label">Cantidad</label>
    <div class="col-lg-10">
      <input type="float" required name="q" class="form-control" id="inputEmail1" placeholder="Cantidad de productos">
    </div>
示例#7
0
                <td>Mesero: <?php 
                echo $mesero->name . " " . $mesero->lastname;
                ?>
</td>
                <td></td>
            </tr>
            <tr>
                <th>Producto</th>
                <th>Cant.</th>
                <th>Tiempo (mins)</th>
            </tr>
                <?php 
                $np = 0;
                $nd = 0;
                foreach ($operations as $operation) {
                    $product = ProductData::getById($operation->product_id);
                    ?>
                    <tr>
                        <td><?php 
                    echo $product->name;
                    ?>
</td>
                        <td><?php 
                    echo $operation->q;
                    ?>
</td>
                        <td><?php 
                    echo $product->duration * $operation->q;
                    ?>
</td>
                    </tr>
示例#8
0
 public function getCategory()
 {
     return ProductData::getById($this->category_id);
 }
示例#9
0
<?php

$cat = ProductData::getById($_GET["id"]);
$cat->active();
Core::redir("index.php?view=products");
示例#10
0
<?php

$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();