예제 #1
0
 public function actionCortesDiarios()
 {
     $this->perfil();
     /*$totalVentasNormales             = array();
       $totalBoletosDuros               = array();
       $totalVentasNormalesSinDescuento = array();
       $totalCortesias                  = array();
       $totalBoletos                    = array();
       $totalBoletosCancelados          = array();*/
     $totalVentas = array();
     $eventos = array();
     $model = new Ventas();
     if (!empty($_POST)) {
         $usuario_id = $_POST['usuario_id'];
         $desde = $_POST['desde'];
         $hasta = $_POST['hasta'];
         //print_r($_POST);
         /*$totalVentasNormales             = $model->getTotalVentasNormales($usuario_id,$desde,$hasta);
           $totalBoletosDuros               = $model->getTotalBoletosDuros($usuario_id,$desde,$hasta);
           $totalVentasNormalesSinDescuento = $model->getTotalVentasNormalSinDescuento($usuario_id,$desde,$hasta);
           $totalCortesias                  = $model->getTotalCortesias($usuario_id,$desde,$hasta);
           $totalBoletos                    = $model->getTotalBoletos($usuario_id,$desde,$hasta);
           $totalBoletosCancelados          = $model->getTotalBoletosCancelados($usuario_id,$desde,$hasta);*/
         $totalVentas = $model->getTotalVentas($usuario_id, $desde, $hasta);
         $eventos = $model->getEventos($usuario_id, $desde, $hasta);
     }
     $this->render('cortesDiarios', compact('totalVentas', 'eventos', 'model'));
 }
 function insertVenta(Ventas $v)
 {
     require_once '../conexion.php';
     require_once '../model.business/Ventas.php';
     try {
         $conexion = new conexion();
         $conn = $conexion->conn();
         $subTotal = $v->getSubTotal();
         $iva = $v->getIva();
         $total = $v->getTotal();
         $metodoPago = $v->getMetodosDePago();
         $rutCliente = $v->getCliente();
         $fecha = $v->getFecha();
         $idCarro = $v->getCarrito();
         $idDespacho = $v->getDespacho();
         $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
         $sql = $conn->prepare("INSERT INTO venta VALUES(null,:subTotal, :iva, :total, :metodoPago, :rutCliente, :fecha, :idCarro, :idDespacho);");
         $sql->bindParam(':subTotal', $subTotal);
         $sql->bindParam(':iva', $iva);
         $sql->bindParam(':total', $total);
         $sql->bindParam(':metodoPago', $metodoPago);
         $sql->bindParam(':rutCliente', $rutCliente);
         $sql->bindParam(':fecha', $fecha);
         $sql->bindParam(':idCarro', $idCarro);
         $sql->bindParam(':idDespacho', $idDespacho);
         return $sql->execute();
     } catch (PDOException $exc) {
         echo $exc->getMessage();
     }
 }
예제 #3
0
파일: Reportes.php 프로젝트: cicb/tpc
 public function conciliarFarmatodo($rutaArchivo, $desde = 0, $hasta = 0)
 {
     $data = array();
     if (($gestor = fopen($rutaArchivo, "r")) !== FALSE) {
         while (($datos = fgetcsv($gestor, 1000, ",")) !== FALSE) {
             if ($datos[0] == 1) {
                 // Si se trata de un registro se incluye en la matriz de data
                 $data[] = array('sucursal' => $datos[1], 'fecha' => strtotime($datos[2] . " " . $datos[3]), 'clave' => substr($datos[4], 0, 16), 'monto' => (int) $datos[6], 'total' => 0, 'farmatodo' => true, 'taquillacero' => false);
             }
         }
         fclose($gestor);
     }
     $rango = '1';
     $matrix = array();
     if ($desde and $hasta and preg_match("(\\d{4}-\\d{2}-\\d{2})", $desde) == 1 and preg_match("(\\d{4}-\\d{2}-\\d{2})", $hasta) == 1) {
         $rango = sprintf(" VentasFecHor BETWEEN '%s' and '%s' ", $desde, $hasta);
     }
     $criteria = new CDbCriteria();
     $criteria->addCondition($rango);
     $criteria->addCondition("VentasSta<>'CANCELADO'");
     $criteria->addCondition("UsuariosId=2");
     $criteria->order = "t.VentasId";
     $ventas = Ventas::model()->with('total', 'puntoventa')->findAll($criteria);
     foreach ($ventas as $venta) {
         $matrix[$venta->VentasId] = array('id' => $venta->VentasId, 'sucursal' => $venta->puntoventa->PuntosventaNom, 'fecha' => strtotime($venta->VentasFecHor), 'clave' => $venta->VentasNumRef, 'monto' => 0, 'total' => $venta->total, 'farmatodo' => false, 'taquillacero' => true);
     }
     foreach ($data as $i => $fila) {
         $venta = Ventas::model()->with('total')->findByAttributes(array('VentasNumRef' => $fila['clave']));
         if (is_object($venta)) {
             $data[$i]['total'] = $venta->total;
             $data[$i]['taquillacero'] = true;
             $data[$i]['id'] = $venta->VentasId;
             $matrix[$venta->VentasId] = $data[$i];
         } else {
             ${$data}[$i]['id'] = mktime();
             $matrix[] = $data[$i];
         }
     }
     return new CArrayDataProvider(array_values($matrix), array('pagination' => false));
 }
예제 #4
0
$obj_config = new ConfigVars();
// Archivo de mensajes
require_once '.' . $obj_config->GetVar('ruta_config') . 'mensajes.php';
// Clase Generica
require '.' . $obj_config->GetVar('ruta_libreria') . 'Generica.php';
$obj_generico = new Generica();
// Conexion a la bases de datos
require '.' . $obj_config->GetVar('ruta_libreria') . 'Bd.php';
$obj_conexion = new Bd();
if (!$obj_conexion->ConnectDataBase($obj_config->GetVar('host'), $obj_config->GetVar('data_base'), $obj_config->GetVar('usuario_db'), $obj_config->GetVar('clave_db'))) {
    echo "sin_conexion_bd";
}
session_start();
// Modelo asignado
require '.' . $obj_config->GetVar('ruta_modelo') . 'Ventas.php';
$obj_modelo = new Ventas($obj_conexion);
$taquilla = $obj_modelo->GetIdTaquilla();
$impreso = $obj_modelo->ExisteTicketNoImpreso($taquilla);
if ($impreso == 1 || $impreso == 2) {
    $resultTT = $obj_modelo->GetDatosTicketTransaccional();
    if ($obj_conexion->GetNumberRows($resultTT) > 0) {
        // Generacion del Id del Ticket
        $id_ticket = $obj_modelo->GeneraIDTicket();
        // Generacion del serial del ticket
        $serial = "";
        $serial = $obj_modelo->GeneraSerialTicket();
        while ($obj_modelo->GetExisteSerialTicket($serial)) {
            $serial = $obj_modelo->GeneraSerialTicket();
        }
        if ($result = $obj_modelo->GetDatosTicketTransaccional()) {
            $total_ticket = 0;
예제 #5
0
<?php

date_default_timezone_set("America/Caracas");
// Archivo de variables de configuracion
require_once '../config/config.php';
$obj_config = new ConfigVars();
// Archivo de mensajes
require_once '.' . $obj_config->GetVar('ruta_config') . 'mensajes.php';
// Clase Generica
require '.' . $obj_config->GetVar('ruta_libreria') . 'Generica.php';
$obj_generico = new Generica();
// Conexion a la bases de datos
require '.' . $obj_config->GetVar('ruta_libreria') . 'Bd.php';
$obj_conexion = new Bd();
if (!$obj_conexion->ConnectDataBase($obj_config->GetVar('host'), $obj_config->GetVar('data_base'), $obj_config->GetVar('usuario_db'), $obj_config->GetVar('clave_db'))) {
    echo "sin_conexion_bd";
}
// Modelo asignado
require '.' . $obj_config->GetVar('ruta_modelo') . 'Ventas.php';
$obj_modelo = new Ventas($obj_conexion);
session_start();
// Listado de Jugadas...
if ($result = $obj_modelo->GetDatosTicketTransaccional()) {
    $total = 0;
    while ($row = $obj_conexion->GetArrayInfo($result)) {
        // acumula y suma el total a la variable
        $total += $row['monto'];
    }
    echo $total;
}
예제 #6
0
/* @var $this VentasDetalleController */
/* @var $model VentasDetalle */
$this->breadcrumbs = array('Ventas Detalles' => array('index'), 'Manage');
$this->menu = array(array('label' => 'List VentasDetalle', 'url' => array('index')), array('label' => 'Create VentasDetalle', 'url' => array('create')));
Yii::app()->clientScript->registerScript('search', "\n\$('.search-button').click(function(){\n\t\$('.search-form').toggle();\n\treturn false;\n});\n\$('.search-form form').submit(function(){\n\t\$('#ventas-detalle-grid').yiiGridView('update', {\n\t\tdata: \$(this).serialize()\n\t});\n\treturn false;\n});\n");
?>

<h1>Relación de Productos - <a href="#exportar" class="btn btn-warning" role="button" data-toggle="modal"><i class="icon-share-alt icon-white"></i> Exportar</a></h1>

<?php 
//echo CHtml::link('Advanced Search','#',array('class'=>'search-button'));
?>
<div class="search-form" style="display:none">
<?php 
$this->renderPartial('_search', array('model' => $model));
$lasVentas = Ventas::model()->findAll();
?>
</div><!-- search-form -->

<?php 
$this->widget('zii.widgets.grid.CGridView', array('id' => 'ventas-detalle-grid', 'dataProvider' => $model->search(), 'afterAjaxUpdate' => 'reinstallDatePickerVentas', 'filter' => $model, 'columns' => array(array('header' => 'ID.', 'name' => 'id', 'value' => '$data->id', 'htmlOptions' => array('width' => '30')), array('name' => 'nombre_paciente', 'value' => '$data->paciente->nombre', 'htmlOptions' => array('width' => '100'), 'headerHtmlOptions' => array('style' => 'width:150px;text-align:center;')), array('name' => 'apellido_paciente', 'value' => '$data->paciente->apellido', 'htmlOptions' => array('width' => '100'), 'headerHtmlOptions' => array('style' => 'width:150px;text-align:center;')), array('header' => 'Producto', 'name' => 'producto_id', 'filter' => CHtml::listData(ProductoInventario::model()->findAll(array('order' => 'nombre_producto ASC')), 'id', 'nombre_producto'), 'value' => '$data[\'producto\'][\'nombre_producto\']', 'htmlOptions' => array('width' => '250')), array('header' => 'Vendedor', 'name' => 'vendedor_id', 'value' => '$data->venta->vendedor->nombreCompleto', 'filter' => CHtml::listData(Personal::model()->findAll(array('order' => 'nombres ASC')), 'id', 'nombreCompleto'), 'htmlOptions' => array('width' => '200'), 'headerHtmlOptions' => array('style' => 'width:150px;text-align:center;')), array('name' => 'cantidad', 'value' => '$data->cantidad', 'htmlOptions' => array('width' => '50'), 'footer' => "<h5>" . number_format($model->getTotal4($model->searchSuma())) . '</h5>'), array('name' => 'valor', 'value' => 'number_format($data->valor,2)', 'footer' => "<h5>\$ " . number_format($model->getTotal($model->searchSuma()), 2) . '</h5>'), array('name' => 'iva', 'value' => 'number_format($data->iva,2)', 'footer' => "<h5>\$ " . number_format($model->getTotal2($model->searchSuma()), 2) . '</h5>'), array('name' => 'total', 'value' => 'number_format($data->total,2)', 'footer' => "<h5>\$ " . number_format($model->getTotal3($model->searchSuma()), 2) . '</h5>'), array('header' => 'Fecha', 'name' => 'fecha', 'filter' => $this->widget('zii.widgets.jui.CJuiDatePicker', array('language' => 'es', 'model' => $model, 'attribute' => 'fecha', 'options' => array('showAnim' => 'fold', 'language' => 'es', 'dateFormat' => 'dd-mm-yy', 'changeMonth' => true, 'changeYear' => true, 'yearRange' => '2014:2025'), 'htmlOptions' => array('id' => 'datepicker_for_fecha', 'style' => 'height:20px;width:80px;'), 'defaultOptions' => array('showOn' => 'focus', 'showOtherMonths' => true, 'selectOtherMonths' => true, 'changeMonth' => true, 'changeYear' => true, 'showButtonPanel' => true)), true), 'value' => 'Yii::app()->dateformatter->format("dd-MM-yyyy",$data[\'fecha\']);', 'htmlOptions' => array('width' => '80')), array('class' => 'CButtonColumn', 'template' => '{view}'))));
Yii::app()->clientScript->registerScript('re-install-date-picker', "\nfunction reinstallDatePickerVentas(id, data) {\n        //use the same parameters that you had set in your widget else the datepicker will be refreshed by default\n    \$('#datepicker_for_fecha').datepicker(jQuery.extend({showMonthAfterYear:false},jQuery.datepicker.regional['es'],{'dateFormat':'dd-mm-yy'}));\n    //\$('#datepicker_for_fecha').datepicker(\$.datepicker.regional[ 'es' ]);\n  //\$('#datepicker_for_fecha').datepicker({dateFormat: 'dd-mm-yy'});\n}\n");
?>

<div id="exportar" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
  <div class="modal-header">
    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
    <h3 id="myModalLabel">Exportar a un archivo de Excel </h3>
  </div>
  <div class="modal-body">
  	<p>Seleccione las opciones de Exportar</p>
예제 #7
0
<?php

require '../impresion/mc_table.php';
require_once "../clases/ventas_data.php";
$venta = new Ventas();
$comprobante = new Comprobante();
$cliente = new Cliente();
$pdf = new PDF_MC_Table();
class PDF extends FPDF
{
    //Pie de página
    function Footer()
    {
        //Posición: a 1,5 cm del final
        $this->SetY(-15);
        //Arial italic 8
        $this->SetFont('Arial', 'I', 8);
        //Número de página
        $this->Cell(0, 10, 'Page ' . $this->PageNo() . '/{nb}', 0, 0, 'C');
    }
}
$pdf->FPDF('L', 'mm', 'A4');
//$pdf->Open();
$pdf->AliasNbPages();
$pdf->SetLeftMargin(10);
$pdf->PageNo();
//$pdf->SetTopMargin(0);
$pdf->AddPage();
$pdf->SetFont('Arial', '', 7);
/*$almacen_reporte=$almacen->nombre_almacen($_REQUEST['almacen'],'');
	
예제 #8
0
            
             <div id="menu">
            <nav>
                <ul>
                    <li ><a href="../index.php"><img src="../img/casa.png" width="25" height="25"></a></li>
                    <li> <a href="vistaBogota.php">Zapatos</a></li>
                    <li> <a href="vendedorB.php">Vendedor</a></li>
                    <li> <a href="ventasB.php">Venta</a></li>
                    <li> <a href="venderBogota.php">Vender</a></li>   
                </ul>

            </nav>
        </div> 
        
        
            <div id="content" class="center_content">
                <div class="datagrid">
          <?php 
include '../conex.php';
include '../modelo/ventas.php';
Ventas::listar_ventas_sucursal(3);
?>
                    </div>
        </div>
        
       
            </div>
    </body>
</html>

예제 #9
0
require_once '../config/config.php';
$obj_config = new ConfigVars();
// Archivo de mensajes
require_once '.' . $obj_config->GetVar('ruta_config') . 'mensajes.php';
// Clase Generica
require '.' . $obj_config->GetVar('ruta_libreria') . 'Generica.php';
$obj_generico = new Generica();
// Conexion a la bases de datos
require '.' . $obj_config->GetVar('ruta_libreria') . 'Bd.php';
$obj_conexion = new Bd();
if (!$obj_conexion->ConnectDataBase($obj_config->GetVar('host'), $obj_config->GetVar('data_base'), $obj_config->GetVar('usuario_db'), $obj_config->GetVar('clave_db'))) {
    echo "sin_conexion_bd";
}
// Modelo asignado
require '.' . $obj_config->GetVar('ruta_modelo') . 'Ventas.php';
$obj_modelo = new Ventas($obj_conexion);
session_start();
//$id_taquilla=2;
// Obtenemos los datos de la taquilla
$id_taquilla = $obj_modelo->GetIdTaquilla();
/************* CABLEADO **********************/
//id_taquilla debe venir de una variable de sesion
$info_ticket = $obj_modelo->GetLastTicket($id_taquilla);
$id_ticket = $info_ticket["id_ticket"];
//echo "<pre>".print_r($info_ticket)."</pre>";
//$serial=$info_ticket["serial"];
$string = $info_ticket["fecha_hora"];
$year = substr($string, 0, 4);
$month = substr($string, 5, 2);
$day = substr($string, 8, 2);
$hour = substr($string, 11, 2);
예제 #10
0
<?php

// Ruta actual
$_SESSION['Ruta_Lista'] = $obj_generico->RutaRegreso();
// Vista asignada
$obj_xtpl->assign_file('contenido', $obj_config->GetVar('ruta_vista') . 'ventas' . $obj_config->GetVar('ext_vista'));
// Modelo asignado
require $obj_config->GetVar('ruta_modelo') . 'Ventas.php';
$obj_modelo = new Ventas($obj_conexion);
// Accion a realizar
$obj_xtpl->assign('tipo_accion', 'add');
$turno_array = array();
if ($result = $obj_modelo->GetTurnos()) {
    //$i=1;
    while ($row = $obj_conexion->GetArrayInfo($result)) {
        $turno_array[$row['id_turno']] = strtolower($row['nom_turno']);
    }
}
// Listado de Sorteos
if ($result = $obj_modelo->GetSorteosxTurno()) {
    $i = 1;
    while ($row = $obj_conexion->GetArrayInfo($result)) {
        if ($i == 1) {
            $id_turno_anterior = $row['id_turno'];
        }
        $id_turno = $row['id_turno'];
        $obj_xtpl->assign($obj_generico->CleanTextDb($row));
        //Colocar una clase a los Tradicionales de la manana
        $estradicional = $row['tradicional'];
        $obj_xtpl->assign('claset', '');
        if ($estradicional == '1') {
예제 #11
0
require_once '../config/config.php';
$obj_config = new ConfigVars();
// Archivo de mensajes
require_once '.' . $obj_config->GetVar('ruta_config') . 'mensajes.php';
// Clase Generica
require '.' . $obj_config->GetVar('ruta_libreria') . 'Generica.php';
$obj_generico = new Generica();
// Conexion a la bases de datos
require '.' . $obj_config->GetVar('ruta_libreria') . 'Bd.php';
$obj_conexion = new Bd();
if (!$obj_conexion->ConnectDataBase($obj_config->GetVar('host'), $obj_config->GetVar('data_base'), $obj_config->GetVar('usuario_db'), $obj_config->GetVar('clave_db'))) {
    echo "sin_conexion_bd";
}
// Modelo asignado
require '.' . $obj_config->GetVar('ruta_modelo') . 'Ventas.php';
$obj_modelo = new Ventas($obj_conexion);
session_start();
// Listado de Jugadas Agregadas
if ($result = $obj_modelo->GetDatosTicketTransaccional()) {
    if ($obj_conexion->GetNumberRows($result) > 0) {
        echo "<br><table class='table_ticket' align='center' border='1' width='90%'>";
        while ($row = $obj_conexion->GetArrayInfo($result)) {
            $inc = "";
            $span1 = "";
            $span2 = "";
            //determinando si es un numero inc..
            if ($row['incompleto'] == 1) {
                $inc = "Inc ...";
                $span1 = "<span class='requerido'>";
                $span2 = "</span>";
            }
 /**
  * Returns the data model based on the primary key given in the GET variable.
  * If the data model is not found, an HTTP exception will be raised.
  * @param integer $id the ID of the model to be loaded
  * @return Ventas the loaded model
  * @throws CHttpException
  */
 public function loadModel($id)
 {
     $model = Ventas::model()->findByPk($id);
     if ($model === null) {
         throw new CHttpException(404, 'The requested page does not exist.');
     }
     return $model;
 }
예제 #13
0
<?php

require '../impresion/mc_table2.php';
require_once "../clases/ventas_data.php";
require_once "../clases/numeros_a_letras_data.php";
$venta = new Ventas();
$comprobante = new Comprobante();
$cliente = new Cliente();
$numerosletras = new Numeros_a_letras();
$pdf = new PDF_MC_Table();
/*class PDF extends FPDF
{

//Pie de página
function Footer()
{
    //Posición: a 1,5 cm del final
    $this->SetY(-15);
    //Arial italic 8
    $this->SetFont('Arial','I',8);
    //Número de página
    $this->Cell(0,10,'Page '.$this->PageNo().'/{nb}',0,0,'C');
}
}*/
$pdf = new FPDF('P', 'cm', 'custom', 597.73, 467.42);
//ingreso medida puntos
//$pdf->Open();
$pdf->AliasNbPages();
$pdf->SetLeftMargin(0.9);
$pdf->PageNo();
$pdf->SetTopMargin(5.5);
예제 #14
0
<?php

date_default_timezone_set("America/Caracas");
// Archivo de variables de configuracion
require_once '../config/config.php';
$obj_config = new ConfigVars();
// Archivo de mensajes
require_once '.' . $obj_config->GetVar('ruta_config') . 'mensajes.php';
// Clase Generica
require '.' . $obj_config->GetVar('ruta_libreria') . 'Generica.php';
$obj_generico = new Generica();
// Conexion a la bases de datos
require '.' . $obj_config->GetVar('ruta_libreria') . 'Bd.php';
$obj_conexion = new Bd();
if (!$obj_conexion->ConnectDataBase($obj_config->GetVar('host'), $obj_config->GetVar('data_base'), $obj_config->GetVar('usuario_db'), $obj_config->GetVar('clave_db'))) {
    echo "sin_conexion_bd";
}
// Modelo asignado
require '.' . $obj_config->GetVar('ruta_modelo') . 'Ventas.php';
$obj_modelo = new Ventas($obj_conexion);
session_start();
$resultTT = $obj_modelo->GetDatosTicketTransaccional();
if ($obj_conexion->GetNumberRows($resultTT) > 0) {
    echo "Ok";
} else {
    echo "NotOk";
}
예제 #15
0
<?php

session_start();
require_once "../clases/ventas_data.php";
require_once "../clases/parametros_data.php";
require_once "../clases/PHPPaging.lib.php";
$paging = new PHPPaging();
$ventas = new Ventas();
$comprobante = new Comprobante();
$parametro = new Parametros();
$cliente = new Cliente();
if (!isset($_SESSION['usu_id'])) {
    die("Usted no tiene acceso a esta area");
}
if (!isset($_REQUEST['npaginas'])) {
    $_REQUEST['npaginas'] = 10;
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>PM Express v1.0 - SISTEMA DE REGISTRO DE CARGOS POR COURIER</title>

<link href="../imagenes/logo.ico" type="image/x-icon" rel="shortcut icon">
<script src="../javascript/valida.js"></script>
<script language="Javascript" src="../javascript/PopCalendar.js"></script>
<link href="../estilos/css_sistema.css" rel="stylesheet" type="text/css" />
</head>
<?php 
if ($_REQUEST['id'] == '1') {
예제 #16
0
require_once '../config/config.php';
$obj_config = new ConfigVars();
// Archivo de mensajes
require_once '.' . $obj_config->GetVar('ruta_config') . 'mensajes.php';
// Clase Generica
require '.' . $obj_config->GetVar('ruta_libreria') . 'Generica.php';
$obj_generico = new Generica();
// Conexion a la bases de datos
require '.' . $obj_config->GetVar('ruta_libreria') . 'Bd.php';
$obj_conexion = new Bd();
if (!$obj_conexion->ConnectDataBase($obj_config->GetVar('host'), $obj_config->GetVar('data_base'), $obj_config->GetVar('usuario_db'), $obj_config->GetVar('clave_db'))) {
    echo "sin_conexion_bd";
}
// Modelo asignado
require '.' . $obj_config->GetVar('ruta_modelo') . 'Ventas.php';
$obj_modelo = new Ventas($obj_conexion);
session_start();
//$id_taquilla=2;
// Obtenemos los datos de la taquilla
$id_taquilla = $obj_modelo->GetIdTaquilla();
/************* CABLEADO **********************/
//id_taquilla debe venir de una variable de sesion
$info_ticket = $obj_modelo->GetLastTicket($id_taquilla);
//echo "<pre>".print_r($info_ticket)."</pre>";
$id_ticket = $info_ticket["id_ticket_diario"];
$id_ticket1 = substr($id_ticket, 0, 3);
$id_ticket2 = substr($id_ticket, 3, 3);
$id_ticket3 = substr($id_ticket, 6);
$formato_id_ticket = $id_ticket1 . "-" . $id_ticket2 . "-" . $id_ticket3;
$serial = $info_ticket["serial"];
$serial1 = substr($serial, 0, 3);
예제 #17
0
<?php

date_default_timezone_set("America/Caracas");
// Archivo de variables de configuracion
require_once '../config/config.php';
$obj_config = new ConfigVars();
// Archivo de mensajes
require_once '.' . $obj_config->GetVar('ruta_config') . 'mensajes.php';
// Clase Generica
require '.' . $obj_config->GetVar('ruta_libreria') . 'Generica.php';
$obj_generico = new Generica();
// Conexion a la bases de datos
require '.' . $obj_config->GetVar('ruta_libreria') . 'Bd.php';
$obj_conexion = new Bd();
if (!$obj_conexion->ConnectDataBase($obj_config->GetVar('host'), $obj_config->GetVar('data_base'), $obj_config->GetVar('usuario_db'), $obj_config->GetVar('clave_db'))) {
    echo "sin_conexion_bd";
}
// Modelo asignado
require '.' . $obj_config->GetVar('ruta_modelo') . 'Ventas.php';
$obj_modelo = new Ventas($obj_conexion);
session_start();
$resultTT = $obj_modelo->GetAstralesTicketTransaccional();
if ($obj_conexion->GetNumberRows($resultTT) > 0) {
    //echo "Ok", $obj_conexion->GetNumberRows($resultTT);
    echo "Ok";
} else {
    //echo "NotOk", $obj_conexion->GetNumberRows($resultTT);
    echo "NotOk";
}
예제 #18
0
<?php

//Detalles
$numVentas = $_GET['id'];
$lasVentas = Ventas::model()->findByPk($numVentas);
$detalleVenta = VentasDetalle::model()->findAll("venta_id={$numVentas}");
?>

			<style type="text/css">
			p{
				margin: 2px 0px;
			}
				
			</style>

<table>
	<tr>
		<td width="200">
			<p>MARIA ANGELICA DIAZ</p>
			<br>
			<p>NIT: 39.017.694-2</p>
			<p>CALLE 87 N° 47 – 47</p>
			<p>PBX: 3177190</p>
			<p>RES. REGIMEN SIMPLIFICADO</p>
			<p>ORDEN DE PAGO N°: <?php 
echo $lasVentas->id;
?>
</p>
			<p>FECHA: <?php 
echo $lasVentas->fecha;
?>
예제 #19
0
require_once '../config/config.php';
$obj_config = new ConfigVars();
// Archivo de mensajes
require_once '.' . $obj_config->GetVar('ruta_config') . 'mensajes.php';
// Clase Generica
require '.' . $obj_config->GetVar('ruta_libreria') . 'Generica.php';
$obj_generico = new Generica();
// Conexion a la bases de datos
require '.' . $obj_config->GetVar('ruta_libreria') . 'Bd.php';
$obj_conexion = new Bd();
if (!$obj_conexion->ConnectDataBase($obj_config->GetVar('host'), $obj_config->GetVar('data_base'), $obj_config->GetVar('usuario_db'), $obj_config->GetVar('clave_db'))) {
    echo "sin_conexion_bd";
}
// Modelo asignado
require '.' . $obj_config->GetVar('ruta_modelo') . 'Ventas.php';
$obj_modelo = new Ventas($obj_conexion);
session_start();
//$id_taquilla=2;
// Obtenemos los datos de la taquilla
$id_taquilla = $obj_modelo->GetIdTaquilla();
// Generacion del Id del Ticket
$id_ticket = $obj_modelo->GeneraIDTicket();
// Generacion del serial del ticket
$serial = "";
$serial = $obj_modelo->GeneraSerialTicket();
while ($obj_modelo->GetExisteSerialTicket($serial)) {
    $serial = $obj_modelo->GeneraSerialTicket();
}
/************* CABLEADO **********************/
//id_taquilla debe venir de una variable de sesion
$info_ticket = $obj_modelo->GetLastTicket($id_taquilla);
예제 #20
0
<?php

session_start();
require_once "../clases/ventas_data.php";
//require_once "../clases/productos_data.php";
//$producto =  new Producto;
$venta = new Ventas();
if (!isset($_SESSION['usu_id'])) {
    die("Usted no tiene acceso a esta area");
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>DETALLE COMPROBANTE</title>

<link href="../imagenes/logo.ico" type="image/x-icon" rel="shortcut icon">
<script src="../javascript/valida.js">  </script>
<link href="../estilos/css_sistema.css" rel="stylesheet" type="text/css" />
</head>
<?php 
$venta->ventas_ver($_REQUEST['codigo']);
if ($_REQUEST['id'] == '1') {
    /*if($venta->_ven_incluyeigv==0)
    	{
    		$precio = $_REQUEST['precio'] / 1.19;
    	}
    	
    	if($venta->_ven_incluyeigv==1)
    	{
 require_once '../model.dal/DespachoDal.php';
 require_once '../model.dal/MetodoDePagosDal.php';
 require_once '../model.dal/CarroDal.php';
 require_once '../model.dal/VentaProductoDal.php';
 require_once '../model.dal/ProductoDal.php';
 if (isset($_POST['txt_subtotal'])) {
     //SESSION
     $sessionCliente = $_SESSION['cliente'];
     $sessionDespacho = $_SESSION['despacho'];
     $sessionMetodo = $_SESSION['metodo_pago'];
     $listCarro = $_SESSION['carro'];
     //CLASS
     //BUSINESS
     $despacho = new Despacho();
     $carro = new Carro();
     $venta = new Ventas();
     //DAL
     $despachoDal = new DespachoDal();
     $carroDal = new CarroDal();
     $ventaDAl = new VentaProductoDal();
     $productoDal = new ProductoDal();
     //SET DESPACHO
     $despacho->setDireccion($sessionDespacho['direccion']);
     $despacho->setNombrePersonaAEntregar($sessionDespacho['nombrePersona']);
     $despacho->setIdComuna($sessionDespacho['idComuna']);
     //INSERT DESPACHO
     $insertDespacho = $despachoDal->insertDespacho($despacho);
     switch ($insertDespacho) {
         case 1:
             echo 'despacho OK';
             break;
예제 #22
0
파일: ReportesVentas.php 프로젝트: cicb/tpc
 public function getResumenEvento($eventoId, $funcionId = 'TODAS', $desde = 0, $hasta = 0)
 {
     $modelo = new ReportesFlex();
     $funcion = "";
     if ($funcionId > 0) {
         $funcion = sprintf(" AND FuncionesId = '%s' ", $funcionId);
     }
     $aforo = Lugares::model()->count(sprintf("EventoId = '%s' AND LugaresStatus<>'OFF'  %s", $eventoId, $funcion));
     $porvender = Lugares::model()->count(sprintf("EventoId = '%s' AND LugaresStatus='TRUE'  %s", $eventoId, $funcion));
     $vendidas = Lugares::model()->count(sprintf("EventoId = '%s' AND LugaresStatus IN ('RESERVADO','SELECTED','FALSE')  %s", $eventoId, $funcion));
     //$vendidas = Ventaslevel1::model()->with(
     //array(
     //'venta'=> array('having'=>"VentasSta NOT LIKE 'CANCELADO' ")
     //)
     //)->count(sprintf("EventoId = '%s' %s ",$eventoId,$funcion) );
     //$porvender=$aforo-$vendidas;
     $matrix = array('aforo' => array('titulo' => 'Aforo', 'boletos' => $aforo, 'importe' => 0, 'porcentaje' => 100), 'por vender' => array('titulo' => 'Por vender', 'boletos' => $porvender, 'importe' => 0, 'porcentaje' => $porvender / max($aforo, 1)), 'cortesia' => array('titulo' => 'Cortesías', 'boletos' => 0, 'importe' => 0, 'porcentaje' => 0), 'boleto duro' => array('titulo' => 'Boletos duros', 'boletos' => 0, 'importe' => 0, 'porcentaje' => 0), 'normal' => array('titulo' => 'Ventas', 'boletos' => 0, 'importe' => 0, 'porcentaje' => 0), 'total' => array('titulo' => 'Total', 'boletos' => 0, 'importe' => 0, 'porcentaje' => 0));
     //$matrix['por vender']['importe'] = Lugares::model()->count(sprintf("EventoId = '%s' AND LugaresStatus='TRUE'  %s",$eventoId,$funcion) );
     $model = new Ventas();
     $matrix['aforo']['importe'] = $model->getDbConnection()->createCommand(sprintf("\n\t\t\t\t\tSELECT SUM(ZonasCosBol) as ventas FROM lugares as t\n\t\t\t\t\tINNER JOIN zonas as t2 \n\t\t\t\t\t\tON t.EventoId     = t2.EventoId\n\t\t\t\t\t\tAND t.FuncionesId = t2.FuncionesId\n\t\t\t\t\t\tAND t.ZonasId     = t2.ZonasId\n\t\t\t\t\tWHERE t.EventoId      = %d and t.LugaresStatus<>'OFF'\n\t\t\t\t\tGROUP BY t.EventoId;", $eventoId))->queryScalar();
     $matrix['por vender']['importe'] = $model->getDbConnection()->createCommand(sprintf("\n\t\t\t\t\tSELECT SUM(ZonasCosBol) as ventas FROM lugares as t\n\t\t\t\t\tINNER JOIN zonas as t2 \n\t\t\t\t\t\tON t.EventoId     = t2.EventoId\n\t\t\t\t\t\tAND t.FuncionesId = t2.FuncionesId\n\t\t\t\t\t\tAND t.ZonasId     = t2.ZonasId\n\t\t\t\t\tWHERE t.EventoId      = %d and t.LugaresStatus='TRUE'\n\t\t\t\t\tGROUP BY t.EventoId;", $eventoId))->queryScalar();
     //$matrix['por vender']['importe']=$matrix['aforo']['importe']-$model->getDbConnection()->createCommand(sprintf("
     //SELECT sum(VentasCosBol-VentasMonDes) as ventas FROM ventaslevel1 as t
     //INNER JOIN zonas as t2
     //ON t.EventoId                     = t2.EventoId
     //AND t.FuncionesId                 = t2.FuncionesId
     //AND t.ZonasId                     = t2.ZonasId
     //INNER JOIN ventas as t3 ON t.VentasId = t3.VentasId
     //WHERE t.EventoId                      = %d
     //AND t3.VentasSta <> 'CANCELADO' AND  t.VentasSta<>'CANCELADO'
     //GROUP BY t.EventoId;",$eventoId))->queryScalar();
     $reporte = $modelo->getReporte($eventoId, $funcionId, $desde, $hasta, false, 'NORMAL,CORTESIA,BOLETO DURO', '', 'VentasBolTip');
     if (is_object($reporte)) {
         foreach ($reporte->getData() as $fila) {
             $index = strtolower($fila['VentasBolTip']);
             $matrix[$index] = array('boleto' => 0, 'titulo' => $index, 'importe' => 0, 'porcentaje' => 0);
             $matrix['total']['boletos'] += $matrix[$index]['boletos'] = $fila['cantidad'];
             $matrix['total']['importe'] += $matrix[$index]['importe'] = $fila['total'];
         }
     }
     foreach ($matrix as &$fila) {
         $fila['porcentaje'] = number_format($fila['boletos'] * 100 / max($aforo, 1), 0);
         $fila['boletos'] = number_format($fila['boletos'], 0);
         $fila['importe'] = number_format($fila['importe'], 0);
     }
     return $matrix;
 }
예제 #23
0
 *
 * @author     Jaime Llanos
 * @copyright  imasd
 * @version    1.0
 * @example    http://url/administrar_ventas.php?op=1
 */
$accion = $_POST['accion'];
switch ($accion) {
    case 1:
        session_start();
        require 'administrar_ventas.model.php';
        $venta = new Ventas();
        $venta->set_host(0);
        $resultado = $venta->obtener_ventas_recientes();
        $resultado['edicion'] = $_SESSION['tipo_cuenta'];
        break;
    case 2:
        session_start();
        require 'administrar_ventas.model.php';
        $codigo = $_POST['codigo'];
        $usuario = $_SESSION['id'];
        $venta = new Ventas();
        $venta->set_host(0);
        if ($venta->verificar_permisos($_SESSION['id'], $_SESSION['empresa'], 0)) {
            $resultado['resultado'] = $venta->anular_venta($codigo, $usuario);
        } else {
            $resultado['resultado'] = 0;
        }
        break;
}
echo json_encode($resultado);
예제 #24
0
<?php

date_default_timezone_set("America/Caracas");
// Archivo de variables de configuracion
require_once '../config/config.php';
$obj_config = new ConfigVars();
// Archivo de mensajes
require_once '.' . $obj_config->GetVar('ruta_config') . 'mensajes.php';
// Clase Generica
require '.' . $obj_config->GetVar('ruta_libreria') . 'Generica.php';
$obj_generico = new Generica();
// Conexion a la bases de datos
require '.' . $obj_config->GetVar('ruta_libreria') . 'Bd.php';
$obj_conexion = new Bd();
if (!$obj_conexion->ConnectDataBase($obj_config->GetVar('host'), $obj_config->GetVar('data_base'), $obj_config->GetVar('usuario_db'), $obj_config->GetVar('clave_db'))) {
    echo "sin_conexion_bd";
}
// Modelo asignado
require '.' . $obj_config->GetVar('ruta_modelo') . 'Ventas.php';
$obj_modelo = new Ventas($obj_conexion);
session_start();
$resultTT = $obj_modelo->GetLastTicketTransaccional();
if ($obj_conexion->GetNumberRows($resultTT) > 0) {
    if ($obj_modelo->EliminarAllTicketTransaccional()) {
        echo "Ok";
    }
} else {
    echo "NotOk";
}
include_once 'include/formulario.php';
include_once 'include/campo.php';
include_once 'include/campo_oculto.php';
include_once 'include/campo_combo.php';
include_once 'include/campo_decimal.php';
include_once 'include/boton.php';
include_once 'include/boton_flat.php';
include_once 'include/table_handler.php';
include_once 'include/tabla.php';
include_once 'include/fondos/fondos.php';
include_once 'include/ventas/ventas.php';
include_once 'include/clientes/clientes.php';
include_once 'include/url_util.php';
include_once 'include/formatter.php';
$ventas = new Ventas();
$venta = $ventas->get_row($_REQUEST['codigo']);
$url = new UrlUtil();
$formulario = new Formulario();
$formulario->set_action_uri($url->get_uri() . '&action=grabar_pago');
$campo_codigo = new Campo('codigo', Formatter::code_format($venta[0]), 'Código de la operación', 'text');
$campo_codigo->set_disabled();
$campo_fecha = new Campo('fecha', Formatter::datetime_format($venta[2]), 'Fecha de emisión:', 'text');
$campo_fecha->set_disabled();
$clientes = new Clientes();
$campo_cliente = new CampoOculto('cliente', $venta[3]);
$campo_razon_cliente = new Campo('cliente', $clientes->get_field(1, $venta[3]), 'Cliente:', 'text');
$campo_razon_cliente->set_disabled();
$campo_monto_factura = new Campo('monto_fac', $venta[6], 'Monto de la factura:', 'text');
$campo_monto_factura->set_disabled();
$campo_saldo_factura = new Campo('saldo_fac', $venta[7], 'Saldo de la factura:', 'text');
예제 #26
0
require_once '../config/config.php';
$obj_config = new ConfigVars();
// Archivo de mensajes
require_once '.' . $obj_config->GetVar('ruta_config') . 'mensajes.php';
// Clase Generica
require '.' . $obj_config->GetVar('ruta_libreria') . 'Generica.php';
$obj_generico = new Generica();
// Conexion a la bases de datos
require '.' . $obj_config->GetVar('ruta_libreria') . 'Bd.php';
$obj_conexion = new Bd();
if (!$obj_conexion->ConnectDataBase($obj_config->GetVar('host'), $obj_config->GetVar('data_base'), $obj_config->GetVar('usuario_db'), $obj_config->GetVar('clave_db'))) {
    echo "sin_conexion_bd";
}
// Modelo asignado
require '.' . $obj_config->GetVar('ruta_modelo') . 'Ventas.php';
$obj_modelo = new Ventas($obj_conexion);
session_start();
$result = $obj_modelo->EsZodiacal();
$retorno = '';
while ($row = $obj_conexion->GetArrayInfo($result)) {
    $retorno .= $row['id_sorteo'] . "-";
}
echo $retorno;
/*
If ($obj_conexion->GetNumberRows($resultTT)>0){
      //echo "Ok", $obj_conexion->GetNumberRows($resultTT);
      echo "Ok"; 
}else{
     //echo "NotOk", $obj_conexion->GetNumberRows($resultTT);
     echo "NotOk"; 
}*/
예제 #27
0
<?
	include("Ventas.php");
	
	$venta = new Ventas();
	$cosa = $venta->getGeneralMes();
	
	print_r($cosa);
  ?>
예제 #28
0
        $zapatos_idzapatos = $_POST['txt_idzapa'];
        $mensaje = Ventas::insertarVenta($fecha, $valorT, $nombreC, $cedula, $vendedorCe, $zapatos_idzapatos);
        echo "<script>alert('venta Agregada');location.href='../general/ventasG.php'</script>";
        break;
    case 'Eliminar':
        $id = $_REQUEST['id'];
        $mensaje = Ventas::eliminar_factura($id);
        echo "<script>alert('venta Eliminada');location.href='../general/ventasG.php'</script>";
        break;
    case 'Vender':
        $fecha = $_POST['txt_fecha'];
        $zapatos_idzapatos = $_POST['txt_id'];
        $valorUni = $_POST['valorUni'];
        $cant = $_POST['txt_cant'];
        $valorT = $cant * $valorUni;
        $nomcomprador = $_POST['txt_cliente'];
        $cedulacomprador = $_POST['txt_cedCli'];
        $vendedor_cedula = $_POST['txt_cedVend'];
        $cantDis = $_POST['cantDisp'];
        $total = $cantDis - $cant;
        if ($total > 10) {
            Ventas::insertarVenta($fecha, $valorT, $nomcomprador, $cedulacomprador, $vendedor_cedula, $zapatos_idzapatos);
            include './zapatos.php';
            Zapatos::actualizar_venta($zapatos_idzapatos, $cant);
            echo "<script>alert('venta realizada');location.href='javascript:history.go(-2);'</script>";
        } else {
            if ($total < 10) {
                echo "<script>alert('No se puede Realizar venta');location.href='javascript:history.go(-2);';</script>";
            }
        }
}
예제 #29
0
require_once '../config/config.php';
$obj_config = new ConfigVars();
// Archivo de mensajes
require_once '.' . $obj_config->GetVar('ruta_config') . 'mensajes.php';
// Clase Generica
require '.' . $obj_config->GetVar('ruta_libreria') . 'Generica.php';
$obj_generico = new Generica();
// Conexion a la bases de datos
require '.' . $obj_config->GetVar('ruta_libreria') . 'Bd.php';
$obj_conexion = new Bd();
if (!$obj_conexion->ConnectDataBase($obj_config->GetVar('host'), $obj_config->GetVar('data_base'), $obj_config->GetVar('usuario_db'), $obj_config->GetVar('clave_db'))) {
    echo "sin_conexion_bd";
}
// Modelo asignado
require '.' . $obj_config->GetVar('ruta_modelo') . 'Ventas.php';
$obj_modelo = new Ventas($obj_conexion);
session_start();
// Obtenemos los datos de la taquilla
$taquilla = $obj_modelo->GetIdTaquilla();
$id_insert_taquilla = $obj_modelo->GetUltimoIdInsert($taquilla) + 1;
// Inicio del proceso
$resultTT = $obj_modelo->GetDatosTicketTransaccional();
if ($obj_conexion->GetNumberRows($resultTT) > 0) {
    $catidad_apuestas = $obj_conexion->GetNumberRows($resultTT);
    $txt_monto = $_GET['monto'];
    $monto_prorrateado = round($txt_monto / $catidad_apuestas, 2, PHP_ROUND_HALF_EVEN);
    // echo $monto_prorrateado;
    $obj_modelo->EliminarTicketTransaccionalByTaquilla($taquilla);
    while ($row = $obj_conexion->GetArrayInfo($resultTT)) {
        $txt_numero = $row['numero'];
        $sorteo = $row['id_sorteo'];
예제 #30
0
require_once '../config/config.php';
$obj_config = new ConfigVars();
// Archivo de mensajes
require '.' . $obj_config->GetVar('ruta_config') . 'mensajes.php';
// Clase Generica
require '.' . $obj_config->GetVar('ruta_libreria') . 'Generica.php';
$obj_generico = new Generica();
// Conexion a la bases de datos
require '.' . $obj_config->GetVar('ruta_libreria') . 'Bd.php';
$obj_conexion = new Bd();
if (!$obj_conexion->ConnectDataBase($obj_config->GetVar('host'), $obj_config->GetVar('data_base'), $obj_config->GetVar('usuario_db'), $obj_config->GetVar('clave_db'))) {
    echo "sin_conexion_bd";
}
// Modelo asignado
require '.' . $obj_config->GetVar('ruta_modelo') . 'Ventas.php';
$obj_modelo = new Ventas($obj_conexion);
session_start();
// Obtenemos los datos de la taquilla
$taquilla = $obj_modelo->GetIdTaquilla();
//Verificando que escriban el numero y el monto
if (isset($_POST['txt_numero'])) {
    $txt_numero = $_POST['txt_numero'];
    $txt_numero = $obj_generico->ConvertirSoloNumero($txt_numero);
    $tamano_numero = strlen($txt_numero);
    if ($tamano_numero == 1) {
        $txt_numero = '0' . $_POST['txt_numero'];
    }
}
//verifica que el numero no sea un campo vacio
if (empty($_POST['txt_numero']) == true) {
    if ($_POST['txt_numero'] == '') {