Example #1
0
function ListaFormaDeUnidades()
{
    //FormaListaCompraCantidades
    global $action;
    $oProducto = new producto();
    $ot = getTemplate("PopupCarritoCompra");
    if (!$ot) {
        error(__FILE__ . __LINE__, "Info: template no encontrado");
        return false;
    }
    $ot->resetSeries(array("IdProducto", "Referencia", "Nombre", "tBorrar", "tEditar", "tSeleccion", "vUnidades"));
    $tamPagina = $ot->getPagina();
    $indice = getSesionDato("PaginadorSeleccionCompras2");
    $carrito = getSesionDato("CarritoMover");
    //echo q($carrito,"Carrito Cantidades");
    $costescarrito = getSesionDato("CarroCostesMover");
    $quitar = _("Quitar");
    $ot->fijar("tTitulo", _("Carrito para Traslado"));
    //$ot->fijar("comboAlmacenes",getSesionDato("ComboAlmacenes"));
    $ot->fijar("comboAlmacenes", genComboAlmacenes(getParametro("AlmacenCentral")));
    $salta = 0;
    $num = 0;
    foreach ($carrito as $key => $value) {
        $salta++;
        if ($num <= $tamPagina and $salta >= $indice) {
            $num++;
            if ($oProducto->Load($key)) {
                $referencia = $oProducto->getReferencia();
                $nombre = $oProducto->getNombre();
            } else {
                $referencia = "";
                $nombre = "";
            }
            $ot->fijarSerie("vReferencia", $referencia);
            $ot->fijarSerie("vNombre", $nombre);
            $ot->fijarSerie("tBorrar", $quitar);
            $ot->fijarSerie("vUnidades", $value);
            $ot->fijarSerie("vPrecio", $costescarrito[$key]);
            $ot->fijarSerie("IdProducto", $oProducto->getId());
        }
    }
    if (!$salta) {
        $ot->fijar("aviso", gas("aviso", _("Carrito vacío")));
        $ot->eliminaSeccion("haydatos");
    } else {
        $ot->fijar("aviso");
        $ot->confirmaSeccion("haydatos");
    }
    $ot->paginador($indice, false, $num);
    $ot->fijar("action", $action);
    $ot->terminaSerie();
    echo $ot->Output();
}
Example #2
0
function genComboPaises($selected = false)
{
    $sql = "SELECT IdPais,NombrePais  FROM ges_paises  WHERE Eliminado=0 ORDER BY NombrePais ASC";
    $res = query($sql);
    if (!$res) {
        return false;
    }
    $out = '';
    while ($row = Row($res)) {
        $key = $row["IdPais"];
        $value = $row["NombrePais"];
        if (getParametro("PaisesLatin1")) {
            $value = iso2utf($value);
            //Puede necesitar una conversion, si la tabla de paises esta en Latin1
        }
        $value_s = CleanParaWeb($value);
        if ($key != $selected) {
            $out .= "<option value='{$key}'>{$value_s}</option>";
        } else {
            $out .= "<option selected value='{$key}'>{$value_s}</option>";
        }
    }
    return $out;
}
Example #3
0
 function getTextColor()
 {
     $lang = $this->getLang();
     $IdColor = $this->get("IdColor");
     $sql = "SELECT Color FROM ges_modelos WHERE IdIdioma='{$lang}' AND IdColor='{$IdColor}'";
     $row = queryrow($sql, "Lee texto color");
     if (!$row) {
         return false;
     }
     if (getParametro("ColoresLatin1")) {
         return iso2utf($row["Color"]);
     } else {
         return $row["Color"];
     }
 }
Example #4
0
header("Content-type: application/vnd.mozilla.xul+xml");
header("Content-languaje: es");
header("Pragma: no-cache");
header("Cache-control: no-cache");
$titulo = "TPV " . $TipoVentaText;
$cr = "<?";
$crf = "?>";
$titulobreve = str_replace(" ", "-", trim(strtolower($titulo)));
//Config: el impuesto no lo vamos a mostrar
$esOcultoImpuesto = "true";
$pvpUnidad = _("PV/U");
$modosDePago = array(0 => _("EFECTIVO"), 1 => _("TARJETA"), 2 => _("TRANSFERENCIA"), 3 => _("GIRO"), 4 => _("ENVIO"), 5 => _("BONO"));
$statusServicios = array('Pdte Envio' => _("Pdte Envío"), 'Enviado' => _("Enviado"), 'Recibido' => _("Recibido"), 'Entregado' => _("Entregado"));
$NombreEmpresa = $_SESSION["GlobalNombreNegocio"];
$tNombreEmpresa = $NombreEmpresa == 'gPOS' ? '' : $NombreEmpresa;
$MensajePromo = $PROMActivo != '' ? $PROMActivo : getParametro("MensajePromocion");
echo str_replace("@", "?", '<@xml version="1.0" encoding="UTF-8"@>');
echo str_replace("@", "?", '<@xml-stylesheet href="chrome://global/skin/" type="text/css"@>');
echo str_replace("@", "?", '<@xml-stylesheet href="css/xultpv.css" type="text/css"@>');
echo '<?xml-stylesheet href="' . $_BasePath . 'css/xul.css" type="text/css"?>';
?>
	
<window id="window-tpv"  xml:lang="es" onload="accionInicioTPV();"
        title="<?php 
echo 'gPOS ' . $tNombreEmpresa . ' // TPV ' . $TipoVentaText . ' ' . $NombreLocalActivo;
?>
"
        xmlns:html="http://www.w3.org/1999/xhtml"        
        xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">        

<!--  no-visuales -->  
Example #5
0
function ListarAlmacen($referencia, $donde, $marcadotrans = false, $cb = false, $idbase = false, $soloLlenos = false, $obsoletos = false, $soloNS = false, $soloLote = false, $soloOferta = false, $reservados = false)
{
    global $action, $tamPagina;
    $base = getSesionDato("BusquedaProdBase");
    $ot = getTemplate("ListadoMonoProductoMultiAlmacen");
    if (!$ot) {
        error(__FILE__ . __LINE__, "Info: template no encontrado");
        return false;
    }
    //Extraemos datos
    $almacen = getSesionDato("Articulos");
    $IdLocal = $donde ? $donde : "";
    if ($referencia) {
        $id = genReferencia2IdProducto($referencia);
        $idbase = getProdBaseFromId($id);
    }
    $IdProducto = !$base ? getIdFromCodigoBarras($cb) : "";
    if (!$IdLocal and !$IdProducto) {
        echo gas("Aviso", _("Sin resultados"));
        if (!$IdProducto) {
            setSesionDato("BusquedaReferencia", false);
            if (!$base) {
                setSesionDato("BusquedaCB", false);
            }
            //si no encontro nada, no se busca en esa ref
        }
        return false;
    }
    $indice = getSesionDato("PaginadorAlmacen");
    $idalias = "";
    $nombre = "";
    if (isset($_SESSION["BusquedaNombre"]) and $_SESSION["BusquedaNombre"]) {
        $nombre = $_SESSION["BusquedaNombre"];
    }
    if ($nombre) {
        $idalias = getLikeProductoAlias2Id($nombre, $IdIdioma = false);
    }
    $res = $almacen->ListadoModular($IdLocal, $IdProducto, $indice, $tamPagina, $idbase, $nombre, $soloLlenos, $obsoletos, $soloNS, $soloLote, $soloOferta, $idalias, $reservados);
    $haytrans = is_array($marcadotrans) and count($marcadotrans);
    $num = 0;
    $jsOut = "";
    $jsLex = new jsLextable();
    $jsOut .= jsLabel("comprar", _("Comprar"));
    $jsOut .= jsLabel("modificar", _("Modificar"));
    $jsOut .= jsLabel("referencia", _("Referencia"));
    $jsOut .= jsLabel("unid", _("Unid"));
    $jsOut .= jsLabel("pv", _("PV"));
    $jsOut .= jsLabel("seleccionar", _("Seleccionar"));
    $jsOut .= jsLabel("cuantasunidades", _("¿Cuántas unidades?"), false);
    $oldId = -1;
    while ($almacen->SiguienteArticulo()) {
        $num++;
        $transid = $almacen->get("Id");
        $ref = $almacen->get("Referencia");
        $cb = $almacen->get("CodigoBarras");
        $nombre = $almacen->get("Nombre");
        $nombre = getParametro("ProductosLatin1") ? iso2utf($nombre) : $nombre;
        $unidades = $almacen->get("Unidades");
        $contenedor = $almacen->get("Contenedor");
        $ucontenedor = $almacen->get("UnidadesPorContenedor");
        $precio = $almacen->get("CostoUnitario");
        $ident = $almacen->get("Identificacion");
        $id = $almacen->get("IdProducto");
        $iconos = $almacen->Iconos();
        $talla = getIdTalla2Texto($almacen->get("IdTalla"));
        $lextalla = $jsLex->add($talla);
        $color = getIdColor2Texto($almacen->get("IdColor"));
        $lexcolor = $jsLex->add($color);
        $desc = $almacen->get("Descripcion");
        $nombreLocal = getNombreLocalId($almacen->get("IdLocal"));
        $lexlocal = $jsLex->add($nombreLocal);
        $ManejaSerie = $almacen->get("Serie");
        $statusns = $almacen->get("StatusNS");
        $ventamenudeo = $almacen->get("VentaMenudeo");
        $UnidadMedida = $almacen->get("UnidadMedida");
        $fam = getIdFamilia2Texto($almacen->get("IdFamilia"));
        $sub = getIdSubFamilia2Texto($almacen->get("IdFamilia"), $almacen->get("IdSubFamilia"));
        $lexfam = $jsLex->add($fam);
        $lexsub = $jsLex->add($sub);
        $sel = ($haytrans and in_array($transid, $marcadotrans)) ? 1 : 0;
        $idBase = $almacen->get("IdProdBase");
        $marca = getIdMarca2Texto($almacen->get("IdMarca"));
        $lab = getNombreLaboratorio(getIdLaboratorioFromIdProducto($id));
        if ($idBase != $oldId) {
            $numlex = $jsLex->add($ident);
            $nombre = addslashes($nombre);
            $ref = addslashes($ref);
            $jsOut .= "cAH({$idBase},'{$nombre}','{$ref}','{$desc}',{$numlex},{$lexfam},{$lexsub},{$ManejaSerie},'{$UnidadMedida}','{$contenedor}',{$ucontenedor},'{$marca}','{$ventamenudeo}','{$lab}');\n";
        }
        $jsOut .= "cA({$id},'{$iconos}','{$cb}',{$unidades},'{$precio}',{$sel},{$transid},{$lextalla},{$lexcolor},{$lexlocal},{$ManejaSerie},'{$UnidadMedida}','{$contenedor}',{$ucontenedor},'{$ventamenudeo}','{$statusns}');\n";
        $oldId = $idBase;
    }
    $jsOut = $jsLex->jsDump() . $jsOut;
    $jsOut .= AutoOpen();
    $paginador = $ot->jsPaginador($indice, $tamPagina, $num);
    $jsOut .= $paginador;
    $jsOut .= "cListAlmacen();";
    $jsOut .= $paginador;
    echo "<center>";
    echo jsBody($jsOut);
    echo "</center>";
}
Example #6
0
 function ApilaProducto($oProducto, $local, $unidades)
 {
     //CHON:Para no actualizar las unidades. las unidades los igualo a cero
     $unidades = 0;
     //Comprobar que no estaba
     $id = $oProducto->getId();
     //echo "Existe con anterioridad?<br>";
     $num = ContarFilas("Almacen", "(IdProducto='{$id}') AND (IdLocal ='{$local}')");
     if ($num) {
         //error(__FILE__ . __LINE__ ,"E: ya fue apilado");
         //return $this->AgnadeCantidad($id,$unidades,$local);
     }
     //TODO: no hay que negar esto?
     $esInventario = intval(getParametro("Inventario"));
     $tipoimpuesto = getTipoImpuesto($oProducto, $local);
     $Servicio = $oProducto->get("Servicio") > 0 ? 1 : 0;
     //error(__FILE__ . __LINE__ ,"Infor: Precio aqui es ". $oProducto->getPrecioVenta());
     $datos = array("IdLocal" => $local, "IdProducto" => $oProducto->getId(), "PrecioVenta" => $oProducto->getPrecioVenta(), "Unidades" => $unidades, "StockMin" => 0, "TipoImpuesto" => $tipoimpuesto, "Impuesto" => $oProducto->get("Impuesto"), "StockIlimitado" => $Servicio, "Disponible" => 1, "Oferta" => 0);
     $sql = CreaInsercion(false, $datos, "ges_almacenes");
     //"INSERT INTO dat_almacenes ($key) VALUES ($values)";
     query($sql, "Apilando producto en almacén");
 }
Example #7
0
     }
     if ($nuevaFoto) {
         ModificarProductoFoto($id, $nuevaFoto);
     }
     if (ModificarProductoBar($id, $codigobarras, $refprovhab, $idcontenedor, $ventamenudeo, $unidxcont, $unidadmedida, $color, $talla, $nombre, $tieneserie, $tienelote, $fechav, $idalias0, $idalias1, $condventa)) {
         PaginaBasica();
     } else {
         MostrarProductoBarParaEdicion($id, $lang);
     }
     break;
 case "modsave":
     $id = CleanID($_POST["id"]);
     $nombre = CleanText($_POST["Nombre"]);
     $idalias0 = CleanID($_POST["IdProductoAlias0"]);
     $idalias1 = CleanID($_POST["IdProductoAlias1"]);
     if (getParametro("ProductosLatin1")) {
         //NOTA: si tenemos la tabla en latin1, la recepcion de nombre como utf8
         // requiere una conversion. Asi en memoria estara igual que terminara en la base de datos
         // y hay que hacer menos suposiciones en el codigo.
         //Desde luego seria mejor si no hubiera tablas en latin1, pero lamentablemente
         // algunas tablas heredadas estan asi.
         $nombre = utf8iso($nombre);
     }
     $tieneserie = isset($_POST["NumeroSerie"]) ? CleanText($_POST["NumeroSerie"]) : 'off';
     $ns = $tieneserie == "on" ? 1 : 0;
     $tienelote = isset($_POST["Lote"]) ? CleanText($_POST["Lote"]) : 'off';
     $mlote = $tienelote == "on" ? 1 : 0;
     $fechav = isset($_POST["FechaVencimiento"]) ? CleanText($_POST["FechaVencimiento"]) : false;
     $fv = $fechav == "on" ? 1 : 0;
     $referencia = CleanReferencia($_POST["Referencia"]);
     $descripcion = CleanCadena($_POST["Descripcion"]);
Example #8
0
function ListaFormaDeUnidades()
{
    //Se usa esto aqui?
    //FormaListaCompraCantidades
    global $action, $tamPagina;
    $oProducto = new producto();
    $ot = getTemplate("FormaListaCompraCantidades");
    if (!$ot) {
        error(__FILE__ . __LINE__, "Info: template no encontrado");
        return false;
    }
    $ot->resetSeries(array("IdProducto", "Referencia", "Nombre", "tBorrar", "tEditar", "tSeleccion", "vUnidades"));
    //$tamPagina      = $ot->getPagina();
    $detadoc = getSesionDato("detadoc");
    $documento = getNombreDocumentoCompra($detadoc);
    $indice = getSesionDato("PaginadorSeleccionCompras2");
    $carrito = getSesionDato("CarritoCompras");
    $costescarrito = getSesionDato("CarroCostesCompra");
    $DestinoAlmacen = getSesionDato("DestinoAlmacen");
    $descuentos = getSesionDato("descuentos");
    $Moneda = getSesionDato("Moneda");
    $quitar = _("Quitar");
    $DestinoAlmacen = !$DestinoAlmacen ? getParametro("AlmacenCentral") : $DestinoAlmacen;
    $salta = 0;
    $num = 0;
    $ot->fijar("tTitulo", _("Detalle de " . $documento . ": " . count($carrito) . " productos"));
    $ot->fijar("comboAlmacenes", genComboAlmacenes($DestinoAlmacen));
    if ($carrito) {
        foreach ($carrito as $key => $value) {
            if ($num <= $tamPagina) {
                $num++;
                $cb = $oProducto->Load($key) ? $oProducto->getCB() : "";
                $nombre = $oProducto->Load($key) ? $oProducto->getDescripcion() . " " . getIdMarca2Texto($oProducto->get("IdMarca")) . " " . $oProducto->getColorTexto() . " " . $oProducto->getTallaTexto() . " " . getNombreLaboratorio($oProducto->get("IdLabHab")) : "";
                $vdescuento = isset($descuentos[$key][0]) ? $descuentos[$key][0] / $value : 0;
                $vcoste = round($costescarrito[$key] - $vdescuento, 2);
                $item = $num;
                //if($indice==10||$indice==20) $item--;
                $ot->fijarSerie("vItem", $item . ".");
                $ot->fijarSerie("vReferencia", $cb);
                $ot->fijarSerie("vNombre", $nombre);
                $ot->fijarSerie("tBorrar", $quitar);
                $ot->fijarSerie("vUnidades", $value . " " . $oProducto->getUnidadMedida());
                $ot->fijarSerie("vPrecio", $vcoste);
                $ot->fijarSerie("IdProducto", $oProducto->getId());
            }
        }
    }
    $tpfecha = 'Fecha Emisión : ';
    $tipodoc = $detadoc[0];
    $aCredito = getSesionDato("aCredito") != 'true' ? 'hidden' : '';
    $nrodoc = $detadoc[3];
    $anrodoc = explode("-", $nrodoc);
    $sdoc = $anrodoc[0];
    $ndoc = isset($anrodoc[1]) ? $anrodoc[1] : '';
    $tnrodoc = $nrodoc ? 'Nro ' . $nrodoc : '';
    $titulo = $documento . ' ' . $tnrodoc;
    $tpfecha = $detadoc[0] == 'O' ? 'Fecha Entrega : ' : $tpfecha;
    $idprov = $detadoc[1];
    $nomprov = $detadoc[2];
    $nrodoc = $detadoc[3];
    $fecdoc = $detadoc[4];
    $tipomoneda = $detadoc[5];
    $checked = $tipomoneda == 1 ? $Moneda[1]['T'] : $Moneda[2]['T'];
    $tipocambio = $detadoc[6];
    $fechacambio = $detadoc[7];
    $fechapago = $detadoc[8];
    $idsubsid = $detadoc[9];
    $nombresubsid = $detadoc[10];
    $tcp = getSesionDato("incImpuestoDet") == 'true' ? 'Precio/Unid.' : 'Costo/Unid.';
    $ot->fijar("vTDoc", $tipodoc);
    $ot->fijar("vTipoDoc", $titulo);
    $ot->fijar("vIdProvHab", $idprov);
    $ot->fijar("vProveedorHab", $nomprov);
    $ot->fijar("vNDoc", $nrodoc);
    $ot->fijar("vCP", $tcp);
    $ot->fijar("vFechaDoc", $fecdoc);
    $ot->fijar("vFechaTxDoc", $tpfecha);
    $ot->fijar("vTipoMoneda", $tipomoneda);
    $ot->fijar("vTipoMoneda2", $checked);
    $ot->fijar("vTipoCambio", $tipocambio);
    $ot->fijar("vFechaCambio", $fechacambio);
    $ot->fijar("vFechaPago", $fechapago);
    $ot->fijar("vFletadorHab", $nombresubsid);
    $ot->fijar("aCredito", $aCredito);
    $ot->paginador($indice, false, $num);
    $ot->fijar("action", $action);
    $ot->terminaSerie();
    echo $ot->Output();
}
Example #9
0
function ListaFormaDeUnidades()
{
    //FormaListaCompraCantidades
    global $action;
    $jsOut = "";
    $idprodseriebuy = getSesionDato("idprodseriebuy");
    $seriesbuy = getSesionDato("seriesbuy");
    $Moneda = getSesionDato("Moneda");
    setSesionDato("idprodseriecart", $idprodseriebuy);
    setSesionDato("seriescart", $seriesbuy);
    $oProducto = new producto();
    $ot = getTemplate("PopupCarritoCompra");
    if (!$ot) {
        error(__FILE__ . __LINE__, "Info: template no encontrado");
        return false;
    }
    $ot->resetSeries(array("IdProducto", "Referencia", "Nombre", "tBorrar", "tEditar", "tSeleccion", "vUnidades", "vTalla", "vColor", "Serie"));
    $tamPagina = $ot->getPagina();
    $indice = getSesionDato("PaginadorSeleccionCompras2");
    $carrito = getSesionDato("CarritoCompras");
    //echo q($carrito,"Carrito Cantidades");
    $costescarrito = getSesionDato("CarroCostesCompra");
    $descuentos = getSesionDato("descuentos");
    $quitar = _("Quitar");
    $ot->fijar("tTitulo", _("Carrito de compra"));
    $ot->fijar("comboAlmacenes", getSesionDato("ComboAlmacenes"));
    $ot->fijar("comboAlmacenes", genComboAlmacenes(getParametro("AlmacenCentral")));
    $salta = 0;
    $num = 0;
    $detadoc = getSesionDato("detadoc");
    $incImpuestoDet = getSesionDato("incImpuestoDet");
    $incPercepcion = getSesionDato("incPercepcion");
    $igv = getSesionDato("IGV");
    $ipc = getSesionDato("IPC");
    $TotalNeto = 0;
    $TotalBruto = 0;
    $ImporteFlete = $detadoc[13];
    $ImportePercepcion = $detadoc[14];
    $ImportePago = 0;
    $TotalDescuento = 0;
    $BrutoNeto = 0;
    $TotalImpuesto = 0;
    if ($carrito) {
        foreach ($carrito as $key => $value) {
            $TotalBruto = $TotalBruto + $costescarrito[$key] * $value;
            //$costescarrito[$key];
            $dscto = isset($descuentos[$key][0]) ? $descuentos[$key][0] : 0;
            $TotalDescuento = $TotalDescuento + $dscto;
            $BrutoNeto = $BrutoNeto + $descuentos[$key][1];
        }
        $TotalImpuesto = $BrutoNeto * $igv / 100;
        $TotalNeto = $incImpuestoDet == "true" ? $BrutoNeto : $BrutoNeto + $TotalImpuesto;
        $BrutoNeto = $incImpuestoDet == "true" ? $TotalNeto / ($igv / 100 + 1) : $BrutoNeto;
        $TotalBruto = $incImpuestoDet == "true" ? $TotalBruto / ($igv / 100 + 1) : $TotalBruto;
        $TotalImpuesto = $BrutoNeto * $igv / 100;
        $TotalImpuesto = round($TotalImpuesto * 100) / 100;
        $TotalDescuento = $TotalBruto - $BrutoNeto;
        $ImportePercepcion = $incPercepcion == "true" && $ImportePercepcion == 0 ? round($TotalNeto * $ipc / 100 * 100) / 100 : $ImportePercepcion;
        $ImportePago = $TotalNeto + $ImporteFlete + $ImportePercepcion;
        foreach ($carrito as $key => $value) {
            $salta++;
            if ($num <= $tamPagina and $salta >= $indice) {
                $num++;
                $oProducto->Load($key);
                $precioventa = $descuentos[$key][1] * $igv / 100;
                $precioventa = $descuentos[$key][1] + $precioventa;
                $vdescuento = isset($descuentos[$key][0]) ? $descuentos[$key][0] : 0;
                $pdescuento = isset($descuentos[$key][2]) ? $descuentos[$key][2] : 0;
                $item = $indice + $num;
                if ($indice == 10 || $indice == 20) {
                    $item--;
                }
                $ot->fijarSerie("vItem", $item . ".");
                $ot->fijarSerie("vReferencia", $oProducto->getCB());
                $ot->fijarSerie("vNombre", getDatosProductosExtra($key, "nombre"));
                $ot->fijarSerie("tBorrar", $quitar);
                $ot->fijarSerie("vUnidades", $value);
                $ot->fijarSerie("vPrecio", dosdecimales($costescarrito[$key]));
                $ot->fijarSerie("IdProducto", $oProducto->getId());
                $ot->fijarSerie("Serie", $oProducto->getSerie());
                $ot->fijarSerie("vDescuento", dosdecimales($vdescuento));
                $ot->fijarSerie("PorcentajeDescuento", dosdecimales($pdescuento));
                $ot->fijarSerie("vImporte", dosdecimales($descuentos[$key][1]));
                $ot->fijarSerie("vPrecioVenta", dosdecimales($precioventa));
                $ot->fijarSerie("vVentaMenudeo", $oProducto->getVentaMenudeo());
                $ot->fijarSerie("vUnidadesPorContenedor", $oProducto->getUnidadesPorContenedor());
                $ot->fijarSerie("vUnidadMedida", $oProducto->getUnidadMedida());
                $unimedida = $oProducto->getUnidadMedida();
                $menudeo = $oProducto->getVentaMenudeo();
                $lt = $oProducto->getLote();
                $fv = $oProducto->getFechaVencimiento();
                $ns = $oProducto->getSerie();
                $contenedor = $oProducto->getContenedor();
                $vbtn = $menudeo ? true : false;
                $vbtn = $lt ? true : $vbtn;
                $vbtn = $fv ? true : $vbtn;
                $contunid = $menudeo ? intval($value / $oProducto->getUnidadesPorContenedor()) : "";
                $unid = $menudeo ? $value % $oProducto->getUnidadesPorContenedor() : "";
                $cadena = $contunid . " " . $contenedor . " + " . $unid . " " . $unimedida;
                $cadena = $menudeo ? $cadena : $contenedor;
                $svalbtn = validaxdtCarritoProducto($key) ? "+" : "?";
                $rbtnns = $ns ? "readonly" : "";
                $rbtnns = $detadoc[0] == 'O' ? "" : $rbtnns;
                $sbtnns = $ns ? "button" : "hidden";
                $sbtn = $vbtn ? "button" : "hidden";
                $svalbtn = $detadoc[0] == 'O' ? "+" : $svalbtn;
                $sbtnns = $detadoc[0] == 'O' ? "hidden" : $sbtnns;
                $sbtn = $detadoc[0] == 'O' ? "hidden" : $sbtn;
                $sbtn = $menudeo ? "button" : $sbtn;
                $sbtncsto = $menudeo ? "button" : "hidden";
                $ot->fijarSerie("vUnidMedida", $unimedida);
                $ot->fijarSerie("vTotalContenedor", $cadena);
                $ot->fijarSerie("vButton", $sbtn);
                $ot->fijarSerie("vButtonCosto", $sbtncsto);
                $ot->fijarSerie("vValButton", $svalbtn);
                $ot->fijarSerie("vReadOnly", $rbtnns);
                $ot->fijarSerie("vBotonSerie", $sbtnns);
            }
        }
    }
    if (!$salta) {
        $ot->fijar("aviso", gas("aviso", _("Carrito vacío")));
        $ot->eliminaSeccion("haydatos");
    } else {
        $ot->fijar("aviso");
        $ot->confirmaSeccion("haydatos");
    }
    $tpfecha = 'Fecha Emisión :';
    $tipodoc = $detadoc[0];
    $nrodoc = $detadoc[3];
    $anrodoc = explode("-", $nrodoc);
    $sdoc = $anrodoc[0];
    $ndoc = isset($anrodoc[1]) ? $anrodoc[1] : false;
    $tnrodoc = $nrodoc ? 'Nro. ' . $nrodoc : '';
    $titulo = $tipodoc == 'F' ? 'Factura ' . $tnrodoc : '';
    $titulo = $tipodoc == 'O' ? 'Pedido ' . $tnrodoc : $titulo;
    $titulo = $tipodoc == 'R' ? 'Boleta ' . $tnrodoc : $titulo;
    $titulo = $tipodoc == 'G' ? 'Albar&aacute;n ' . $tnrodoc : $titulo;
    $titulo = $tipodoc == 'SD' ? 'Ticket' . $tnrodoc : $titulo;
    $tpfecha = $tipodoc == 'O' ? 'Fecha Entrega : ' : $tpfecha;
    $idprov = $detadoc[1];
    $nomprov = $detadoc[2];
    $fecdoc = $detadoc[4];
    $tipomoneda = $detadoc[5];
    $checkedTS = $tipomoneda == 1 ? 'CHECKED' : '';
    $checkedTD = $tipomoneda == 2 ? 'CHECKED' : '';
    $tipocambio = $detadoc[6];
    $fechacambio = $detadoc[7];
    $fechapago = $detadoc[8];
    $idsubsid = $detadoc[9];
    $nomsubsid = $detadoc[10];
    $incluyeigv = getSesionDato("incImpuestoDet") == 'true' ? true : false;
    $incluyeipc = getSesionDato("incPercepcion") == 'true' ? true : false;
    $checkipc = $incluyeipc ? 'CHECKED' : '';
    $checkigv = $incluyeigv ? 'CHECKED' : '';
    $tpv = 'PC';
    $xipc = $incluyeipc ? '' : 'display:none';
    $tvv = $incluyeigv ? $tpv : 'VC';
    $tcp = $incluyeigv ? 'Precio/Unid.' : 'Costo/Unid.';
    $pv = $incluyeigv ? 'hidden' : 'text';
    $tdpv = $incluyeigv ? '1' : '0';
    $colheadcart = $incluyeigv ? '16' : '17';
    $checkcredt = getSesionDato("aCredito") == 'true' ? 'CHECKED' : '';
    $ot->fijar("vTDoc", $tipodoc);
    $ot->fijar("vTxFecha", $tpfecha);
    $ot->fijar("vCheckIGV", $checkigv);
    $ot->fijar("vCheckPercepcion", $checkipc);
    $ot->fijar("vxPercepcion", $xipc);
    $ot->fijar("vMoneda1", $Moneda[1]['T']);
    $ot->fijar("vMoneda2", $Moneda[2]['T']);
    $ot->fijar("vSimboloMoneda1", $Moneda[1]['S']);
    $ot->fijar("vSimboloMoneda2", $Moneda[2]['S']);
    $ot->fijar("vCheckCredt", $checkcredt);
    $ot->fijar("vTipoDoc", $titulo);
    $ot->fijar("vIdProvHab", $idprov);
    $ot->fijar("vIdSubsiHab", $idsubsid);
    $ot->fijar("vProveedorHab", $nomprov);
    $ot->fijar("vSubsiHab", $nomsubsid);
    $ot->fijar("vSDoc", $sdoc);
    $ot->fijar("vNDoc", $ndoc);
    $ot->fijar("vFechaDoc", $fecdoc);
    $ot->fijar("vFechaPago", $fechapago);
    $ot->fijar("vTipoMoneda", $tipomoneda);
    $ot->fijar("vCheckedTS", $checkedTS);
    $ot->fijar("vCheckedTD", $checkedTD);
    $ot->fijar("vTipoCambio", $tipocambio);
    $ot->fijar("vFechaCambio", $fechacambio);
    $ot->fijar("vIGV", $igv);
    $ot->fijar("vInputPV", $pv);
    $ot->fijar("vVV", $tvv);
    $ot->fijar("vPV", $tpv);
    $ot->fijar("vCP", $tcp);
    $ot->fijar("vTDPV", $tdpv);
    $ot->fijar("vColHeadCart", $colheadcart);
    $totallst = count($carrito);
    $ot->fijar("vTotalLst", $totallst);
    $ot->fijar("vTotalNeto", dosdecimales($TotalNeto));
    $ot->fijar("vTotalDescuento", dosdecimales($TotalDescuento));
    $ot->fijar("vTotalImpuesto", dosdecimales($TotalImpuesto));
    $ot->fijar("vTotalBruto", dosdecimales($TotalBruto));
    $ot->fijar("vBrutoNeto", dosdecimales($BrutoNeto));
    $ot->fijar("vImporteFlete", dosdecimales($ImporteFlete));
    $ot->fijar("vImportePercepcion", dosdecimales($ImportePercepcion));
    $ot->fijar("vImportePago", dosdecimales($ImportePago));
    $jsOut .= jsPaginador($indice, $ot->getPagina(), $num);
    $ot->fijar("CLIST", $jsOut);
    $ot->paginador($indice, false, $num);
    $ot->fijar("action", $action);
    $ot->terminaSerie();
    echo $ot->Output();
}
Example #10
0
             $txtalla = iso2utf($txtalla);
         }
         echo "<button label='" . $txtalla . "' oncommand='changeNuestroTallaje(\"" . $idtalla . "\",\"" . $txtalla . "\",opener);'/>";
     }
     echo "<spacer flex='1'/>";
     echo "<button label='" . _("Cerrar") . "' oncommand='window.close()'/>";
     echo "<script>\n        function changeNuestroTallaje(idtallaje,txt,padre) {\n            padre.changeTallaje(idtallaje,txt);\n            window.close(); \t\t\t\n        }\n        </script>";
     echo "</groupbox>";
     break;
 case "tallaje":
     echo "<groupbox flex='1'> <caption label='" . $txtDetalle . " :'/>";
     $sql = "SELECT IdTallaje,Tallaje FROM ges_detallescategoria ORDER BY Tallaje ASC";
     $res = query($sql);
     while ($row = Row($res)) {
         $txtalla = $row["Tallaje"];
         if (getParametro("TallajeLatin1")) {
             $txtalla = iso2utf($txtalla);
         }
         echo "<button label='" . $txtalla . "' oncommand='UsaTallaje(" . $row["IdTallaje"] . "," . $idfamilia . ")'/>";
     }
     echo "<spacer flex='1'/>";
     echo "<button label='" . _("Cerrar") . "' oncommand='window.close()'/>";
     echo "<script>\n            function UsaTallaje(id,idfamilia){\t\t\n                document.location.href = 'selmodelo.php?modo=talla&amp;IdTallaje='+id+'&amp;idfamilia='+idfamilia;\n            }\n\n            function changeTalla(me,val) {\n                document.opener.changeTalla(me,val);\n            }\n            </script>";
     echo "</groupbox>";
     break;
 case "nuevatalla":
     $talla = CleanRealMysql(CleanText($_GET["talla"]));
     $tallaje = CleanID($_GET["IdTallaje"]);
     $sql = "SELECT IdTalla FROM ges_detalles WHERE IdFamilia={$idfamilia} AND IdTallaje = {$tallaje} AND Talla='{$talla}' ";
     $row = queryrow($sql);
     if (!isset($row["IdTalla"]) && $tallaje != 0) {