Пример #1
0
    $client = ClientData::getById($_SESSION["client_id"]);
    ?>
<div class="container">
<div class="row">

<div class="col-md-12">
<h3>Bienvenido, <?php 
    echo $client->name . " " . $client->lastname;
    ?>
</h3>
</div>

</div>
</div>
<?php 
    $buys = BuyData::getAllByClientid($_SESSION["client_id"]);
    ?>
<div class="container">
<div class="row">
	<div class="col-md-12">
	<h2>Mis Compras</h2>
<?php 
    if (count($buys) > 0) {
        ?>
<table class="table table-bordered">
	<thead>
		<th></th>
		<th>Compra</th>
		<th>Total</th>
		<th>Estado</th>
		<th>Fecha</th>
Пример #2
0
<?php

if (!empty($_POST)) {
    // print_r($_POST);
    $buy = BuyData::getById($_POST["buy_id"]);
    $buy->cancel();
    Core::alert("Compra Cancelada!");
    Core::redir("index.php?view=client");
}
Пример #3
0
<?php 
$buy = BuyData::getById($_GET["buy_id"]);
$products = BuyProductData::getAllByBuyId($_GET["buy_id"]);
?>
<div class="row">
	<div class="col-md-12">
	<h2> Compra #<?php 
echo $buy->id;
?>
 [<?php 
echo $buy->getStatus()->name;
?>
]</h2>
<?php 
if (count($products) > 0) {
    ?>
<table class="table table-bordered">
	<thead>
		<th></th>
		<th>Codigo</th>
		<th>Total</th>
		<th>Estado</th>
	</thead>
	<?php 
    foreach ($products as $p) {
        $px = $p->getProduct();
        ?>
	<tr>
		<td><a href="index.php?view=producto&product_id=<?php 
        echo $px->id;
Пример #4
0
 function ImprovedTable($data)
 {
     $iva = ConfigurationData::getByPreffix("general_iva")->val;
     $iva_txt = ConfigurationData::getByPreffix("general_iva_txt")->val;
     $coin = ConfigurationData::getByPreffix("general_coin")->val;
     $service = BuyData::getByCode($_GET["code"]);
     $products = BuyProductData::getAllByBuyId($service->id);
     $client = ClientData::getById($service->client_id);
     $this->setY(31);
     $this->setX(20);
     $this->setY(31);
     $this->setX(20);
     $this->SetFont('Arial', 'B', 8);
     $this->setY(33);
     $this->setX(20);
     $this->setY(40);
     $this->setX(20);
     $this->SetFont('Arial', 'B', 8);
     //         $this->Cell(0,35,"",1);
     $this->setY(38);
     $this->setX(20);
     $this->Cell(0, 10, " NOMBRE:        " . $client->getFullname());
     $this->setY(43);
     $this->setX(20);
     $this->Cell(0, 10, " DIRECCION:        " . $client->address);
     $this->setY(48);
     $this->setX(20);
     $this->Cell(0, 10, "TEL:      " . $client->phone);
     $this->setY(53);
     $this->setX(20);
     $this->setY(80);
     $this->setX(20);
     $this->SetFont('Arial', '', 14);
     $this->Cell(0, 10, " DETALLES DE LA COMPRA ");
     $this->SetFont('Arial', 'B', 10);
     $starty = 0;
     $total = 0;
     //    $inventary_item = InventaryData::getAllBySII($service->id,$ii->id);
     $this->setY(95 + $starty);
     $this->setX(20);
     //// omito el super trabajo
     ///         $this->Cell(0,10,strtoupper($w->getWork()->name));
     $this->setY(95 + $starty);
     $this->setX(65);
     //         $starty+=5;
     //////////////////////// materiales
     if (count($products)) {
         $starty += 5;
         foreach ($products as $itemx) {
             $item = $itemx->getProduct();
             $mtx = null;
             $this->setY(95 + $starty);
             $this->setX(20);
             $this->Cell(0, 10, strtoupper($itemx->q));
             $this->setX(30);
             $this->Cell(0, 10, strtoupper($item->getUnit()->name));
             $this->setX(50);
             $this->Cell(0, 10, strtoupper($item->name));
             $this->setX(180);
             $this->Cell(0, 10, utf8_decode($coin) . " " . number_format($item->price, 2, ".", ","));
             $total += $itemx->q * $item->price;
             $this->setY(95 + $starty);
             $this->setX(65);
             $starty += 5;
         }
     }
     $starty += 5;
     ///////////////////////////////////////////////////////////// Total
     $this->SetFont('Arial', '', 12);
     $this->setY(125 + $starty);
     $this->setX(20);
     $this->Cell(0, 10, "SubTotal:          " . utf8_decode($coin) . " " . number_format($total * (1 - $iva / 100), 2, ".", ","));
     $starty += 5;
     $this->setY(125 + $starty);
     $this->setX(20);
     $this->Cell(0, 10, "{$iva_txt}:                   " . utf8_decode($coin) . " " . number_format($total * ($iva / 100), 2, ".", ","));
     $starty += 5;
     $this->setY(125 + $starty);
     $this->setX(20);
     $this->Cell(0, 10, "Total:                 " . utf8_decode($coin) . " " . number_format($total, 2, ".", ","));
     /////////////////////////////////////////////////////////////
     ////////////////////////////////////////////////////
 }
Пример #5
0
<?php

// print_r($_SESSION);
if (!empty($_POST) && isset($_SESSION["client_id"])) {
    $buy = new BuyData();
    $alphabeth = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWYZ1234567890_-";
    $code = "";
    $k = "";
    for ($i = 0; $i < 11; $i++) {
        $code .= $alphabeth[rand(0, strlen($alphabeth) - 1)];
        $k .= $alphabeth[rand(0, strlen($alphabeth) - 1)];
    }
    $buy->k = $k;
    $buy->code = $code;
    $buy->coupon_id = isset($_SESSION["coupon"]) ? $_SESSION["coupon"] : "NULL";
    $buy->client_id = $_SESSION["client_id"];
    $buy->paymethod_id = $_POST["paymethod_id"];
    $buy->status_id = 1;
    $b = $buy->add();
    foreach ($_SESSION["cart"] as $c) {
        $p = new BuyProductData();
        $p->buy_id = $b[1];
        $p->product_id = $c["product_id"];
        $p->q = $c["q"];
        $p->add();
    }
    /////////////////////////////////////////////////////////////////////////////////////////////////
    ///////////////////////////////////// Emailing
    $client = ClientData::getById($_SESSION["client_id"]);
    $adminemail = $paypal_business = ConfigurationData::getByPreffix("general_main_email")->val;
    $replymessage = '
Пример #6
0
                      <tbody>

<thead>
  <th>Estado</th>
  <th>Cantidad</th>
</thead>
<?php 
    foreach ($status as $cat) {
        ?>
                        <tr>
                        <td><?php 
        echo $cat->name;
        ?>
</td>
                        <td><?php 
        $d = BuyData::countByStatusId($cat->id);
        echo $d->c;
        ?>
</td>
                        </tr>
<?php 
    }
    ?>

                      </tbody>
                    </table>
                  </div> 

<?php 
}
?>
Пример #7
0
 function ImprovedTable($data)
 {
     $service = BuyData::getByCode($_GET["code"]);
     $products = BuyProductData::getAllByBuyId($service->id);
     $client = ClientData::getById($service->client_id);
     $this->setY(31);
     $this->setX(20);
     $this->setY(31);
     $this->setX(20);
     $this->SetFont('Arial', 'B', 8);
     $this->setY(33);
     $this->setX(20);
     $this->setY(40);
     $this->setX(20);
     $this->SetFont('Arial', 'B', 8);
     //         $this->Cell(0,35,"",1);
     $this->setY(38);
     $this->setX(20);
     $this->Cell(0, 10, " NOMBRE:        " . $client->name);
     $this->setY(43);
     $this->setX(20);
     $this->Cell(0, 10, " DIRECCION:        " . $client->address);
     $this->setY(48);
     $this->setX(20);
     $this->Cell(0, 10, "TEL:      " . $client->phone);
     $this->setY(53);
     $this->setX(20);
     $this->setY(80);
     $this->setX(20);
     $this->SetFont('Arial', '', 14);
     $this->Cell(0, 10, " DETALLES DE LA COMPRA ");
     $this->SetFont('Arial', 'B', 10);
     $starty = 0;
     $total = 0;
     //    $inventary_item = InventaryData::getAllBySII($service->id,$ii->id);
     $this->setY(95 + $starty);
     $this->setX(20);
     //// omito el super trabajo
     ///         $this->Cell(0,10,strtoupper($w->getWork()->name));
     $this->setY(95 + $starty);
     $this->setX(65);
     //         $starty+=5;
     //////////////////////// materiales
     if (count($products)) {
         $starty += 5;
         foreach ($products as $itemx) {
             $item = $itemx->getProduct();
             $mtx = null;
             $this->setY(95 + $starty);
             $this->setX(20);
             $this->Cell(0, 10, strtoupper($itemx->q));
             $this->setX(30);
             $this->Cell(0, 10, strtoupper($item->getUnit()->name));
             $this->setX(50);
             $this->Cell(0, 10, strtoupper($item->name));
             $this->setX(180);
             $this->Cell(0, 10, "\$ " . number_format($item->price, 2, ".", ","));
             $total += $itemx->q * $item->price;
             $this->setY(95 + $starty);
             $this->setX(65);
             $starty += 5;
         }
     }
     ////////////////////////
     //////////////////////// materiales
     /*if(count($subworks)){
              $this->setX(20);
              $this->Cell(0,(count($subworks)*5)+10,"",1);
              $this->setY(95+$starty);
              $this->setX(20);
              $this->Cell(0,10,strtoupper("**MATERIALES"));
              $starty+=5;
         foreach($subworks as $item){
             $mtx=null;
             foreach($mts as $mt){ if($mt->material_id==$item->id){ $mtx = $mt; }}
             if($mtx!=null&& $mtx->material_id==$item->id){
                 
              $this->setY(95+$starty);
              $this->setX(20);
              $this->Cell(0,10,strtoupper($item->name));
              $this->setX(180);
              $this->Cell(0,10,"$ ".number_format($item->price,2,".",","));
              $this->setY(95+$starty);
              $this->setX(65);
              $starty+=5;
     
             }
     
         }
     }
     */
     ////////////////////////
     //         $this->Cell(0,10,"|X|__| ");
     //         $this->Cell(0,10,"|__|X| ");
     $starty += 5;
     ///////////////////////////////////////////////////////////// Total
     $this->SetFont('Arial', '', 12);
     $this->setY(125 + $starty);
     $this->setX(20);
     $this->Cell(0, 10, "SubTotal:          \$ " . number_format($total * 0.84, 2, ".", ","));
     $starty += 5;
     $this->setY(125 + $starty);
     $this->setX(20);
     $this->Cell(0, 10, "IVA:                   \$ " . number_format($total * 0.16, 2, ".", ","));
     $starty += 5;
     $this->setY(125 + $starty);
     $this->setX(20);
     $this->Cell(0, 10, "Total:                 \$ " . number_format($total, 2, ".", ","));
     /////////////////////////////////////////////////////////////
     ////////////////////////////////////////////////////
 }
Пример #8
0
if (isset($_GET["start_at"]) && isset($_GET["finish_at"]) && $_GET["start_at"] != "" && $_GET["finish_at"] != "") {
    $start_at = strtotime($_GET["start_at"]);
    $finish_at = strtotime($_GET["finish_at"]);
    ?>
<div class="box box-primary">
<div id="graph" class="animate" data-animate="fadeInUp" ></div>
</div>
<script>

<?php 
    echo "var c=0;";
    echo "var dates=Array();";
    echo "var data=Array();";
    echo "var total=Array();";
    for ($i = $start_at; $i <= $finish_at; $i += 60 * 60 * 24) {
        $operations = BuyData::getAllByDate(date("Y-m-d", $i));
        $total = 0;
        foreach ($operations as $buy) {
            $opxs = BuyProductData::getAllByBuyId($buy->id);
            foreach ($opxs as $op) {
                $product = $op->getProduct();
                $total += $op->q * $product->price;
            }
        }
        //  echo $operations[0]->t;
        //  $sl = $operations[0]->t!=null?$operations[0]->t:0;
        // $sp = $spends[0]->t!=null?$spends[0]->t:0;
        echo "dates[c]=\"" . date("Y-m-d", $i) . "\";";
        echo "data[c]=" . $total . ";";
        echo "total[c]={x: dates[c],y: data[c]};";
        echo "c++;";
Пример #9
0
<?php

$buys = BuyData::getAll();
?>
        <!-- Main Content -->

          <div class="row">
          <div class="col-md-12">
          <h1>Ventas</h1>
          </div>
          </div>

          <div class="row">
            <div class="col-lg-12">
              <div class="panel panel-default">
                <div class="panel-heading">
                  <i class="fa fa-tasks"></i> Ventas
                </div>
                <div class="widget-body medium no-padding">

                  <div class="table-responsive">
<?php 
if (count($buys) > 0) {
    ?>
                    <table class="table table-bordered">
                    <thead>
                      <th></th>
                      <th>Operacion</th>
                      <th>Cliente</th>
                      <th>Total</th>
                      <th>Estado</th>
Пример #10
0
<?php

if (isset($_SESSION["client_id"])) {
    $client = ClientData::getById($_SESSION["client_id"]);
    ?>

<?php 
    $buy = BuyData::getByCode($_GET["code"]);
    $products = BuyProductData::getAllByBuyId($buy->id);
    ?>
<div class="container">
<div class="row">

<div class="col-md-12">
<h3>Bienvenido, <?php 
    echo $client->name . " " . $client->lastname;
    ?>
</h3>
	<a href="./index.php?view=client" class="btn btn-default"><i class="fa fa-chevron-left"></i> Regresar</a>
	<a href="./invoice.php?code=<?php 
    echo $buy->code;
    ?>
" class="btn btn-default"><i class="fa fa-file-o"></i> Imprimir</a>
<br></div>


</div>
</div>
<div class="container">
<div class="row">
	<div class="col-md-12">