示例#1
0
echo '<?xml-stylesheet href="' . $_BasePath . 'css/xul.css" type="text/css"?>';
define("TALLAJE_DEFECTO", 5);
$TallajeDefecto = "Varios";
$op = new Producto();
$op->Crea();
$modo = CleanText($_GET["modo"]);
$Referencia = $op->get("Referencia");
//$Nombre              = $op->get("Nombre");
$Marca = _("Generico");
$FamDefecto = _("Varias");
$primerCB = $op->get("CodigoBarras");
$IdFamiliaDefecto = getFirstNotNull("ges_familias", "IdFamilia");
$IdSubFamiliaDefecto = getSubFamiliaAleatoria($IdFamiliaDefecto);
$FamDefecto = getIdFamilia2Texto($IdFamiliaDefecto) . " - " . getIdSubFamilia2Texto($IdFamiliaDefecto, $IdSubFamiliaDefecto);
$Nombre = '';
$txtMoDet = getModeloDetalle2txt();
$esBTCA = $txtMoDet[0] == "BTCA";
$txtModelo = $txtMoDet[1];
$txtDetalle = $txtMoDet[2];
$txtalias = $txtMoDet[3];
$txtref = $txtMoDet[4];
$btca = $esBTCA ? 'false' : 'true';
$esInvent = $modo == 'altainventario' ? true : false;
$btnAlta = $esInvent ? "AltaProductoInventario()" : "AltaProducto()";
$lbtnAlta = $esInvent ? " Registrar..." : " Comprar...";
$ibtnAlta = $esInvent ? "{$_BasePath}" . "img/gpos_registrarinventarioalta.png" : "{$_BasePath}" . "img/gpos_compras.png";
$btnVaciar = $esInvent ? "parent.volverStock()" : "volverPresupuestos()";
$lbtnVaciar = $esInvent ? " Volver Stock" : " Volver Presupuestos";
$ibtnVaciar = $esInvent ? "{$_BasePath}" . "img/gpos_volver.png" : "{$_BasePath}" . "img/gpos_volver.png";
$DSTOGR = getSesionDato("DescuentoTienda");
$MUGR = getSesionDato("MargenUtilidad");
示例#2
0
function GeneraXul($retorno)
{
    $txtMoDet = getModeloDetalle2txt();
    $esBTCA = $txtMoDet[0] == "BTCA";
    $btca = $esBTCA ? '' : 'collapsed="true"';
    $txtalias = $txtMoDet[3];
    $txtModelo = $txtMoDet[1];
    $txtDetalle = $txtMoDet[2];
    ?>
	
<grid> 
<columns> 
  <column flex="1"/><column flex="1"/>
</columns>
<rows>
  <row>
    <caption label="<?php 
    echo _("Proveedor");
    ?>
"/>				    
    <menulist id="idprov">
      <menupopup>
	<menuitem label="Elije Proveedor" style="font-weight: bold"/>
	<?php 
    echo genXulComboProveedores(false, "menuitem");
    ?>
      </menupopup>
    </menulist>
  </row>

  <row <?php 
    echo $btca;
    ?>
>
    <caption label="<?php 
    echo _("Laborarotio");
    ?>
"/>				    
    <menulist id="idlab">
      <menupopup>
	<menuitem label="Elije Laboratorio" style="font-weight: bold"/>
	<?php 
    echo genXulComboLaboratorios(false, "menuitem");
    ?>
      </menupopup>
    </menulist>
  </row>

  <row>
    <caption label="<?php 
    echo _("Marca");
    ?>
"/>
    <menulist  id="idmarca">
      <menupopup>
	<menuitem label="Elije Marca" style="font-weight: bold"/>
	<?php 
    echo genXulComboMarcas(false, "menuitem");
    ?>
      </menupopup>
    </menulist>
  </row>
  <row>
    <caption label="<?php 
    echo _("Familia");
    ?>
"/>
    <menulist  id="idfamilia" oncommand="changeFam(this.value)">
      <menupopup>
	<menuitem label="Elije Familia" style="font-weight: bold"/>
	<?php 
    echo genXulComboFamilias(false, "menuitem");
    ?>
      </menupopup>
    </menulist>
  </row>
  <row>
    <caption label="<?php 
    echo _("Sub Familia");
    ?>
"/>
    <menulist  id="idsubfamilia">
      <menupopup id="elementosSubFamilias">
	<menuitem label="Elije Sub Familia" style="font-weight: bold"/>
        <?php 
    echo genXulComboSubFamilias(false, 1, "menuitem");
    ?>
      </menupopup>
    </menulist>
  </row>
  <row>
    <caption label="<?php 
    echo $txtModelo;
    ?>
"/>
    <menulist  id="idcolor" >
      <menupopup id="elementosColores">
	<menuitem value="0" label="Elije Modelo" style="font-weight: bold" />
	<?php 
    echo genXulComboColores(0, "menuitem", 1, "def");
    ?>
      </menupopup>
    </menulist>
  </row>
  <row>
    <caption label="<?php 
    echo $txtDetalle;
    ?>
"/>
    <menulist  id="idtalla">
      <menupopup id="elementosTallas">
	<menuitem value="0" label="Elije Detalle" style="font-weight: bold"/>
	<?php 
    echo genXulComboTallas(0, "menuitem", 5, "def", 1);
    ?>
  	
      </menupopup>
    </menulist>
  </row>

 <row>
    <caption label="<?php 
    echo $txtalias;
    ?>
"/>				    
    <menulist id="idalias">
      <menupopup  id="elementosAlias">
	<menuitem value="0" label="Elije <?php 
    echo $txtalias;
    ?>
" style="font-weight: bold"/>
        <?php 
    echo genXulComboProductoAlias(0, 'menuitem', 1, 'def');
    ?>
      </menupopup>
    </menulist>
  </row>
 <row>
   <caption label="Nombre"></caption>
   <textbox id="p_Nombre" onkeypress="if (event.which == 13) { buscar() }" onfocus="select()"></textbox>
 </row>
</rows>
</grid>
<button  image="img/gpos_buscar.png"  label='<?php 
    echo _("Buscar");
    ?>
' oncommand="buscar()"/>

<script><![CDATA[
function id(nombre) { return document.getElementById(nombre) };

function buscar()
{
  var tc;

  var idprov  = id("idprov").value;
  var idlab   = id("idlab").value;
  var idalias = id("idalias").value;
  var idcolor = id("idcolor").value;
  var idmarca = id("idmarca").value;
  var idtalla = id("idtalla").value;
  var idfam   = id("idfamilia").value;
  var nombre  = id("p_Nombre").value;
  var idsubfam= id("idsubfamilia").value;

  window.parent.Productos_buscarextra(idprov,idcolor,idmarca,idtalla,idfam,idlab,idalias,tc,nombre,idsubfam);
     
}

var isubfamilias = 0;
var icolores     = 0;//Indice de color llenada
var itallas      = 0;//Indice de talla llenada
var ialias       = 0;//Indice de talla llenada

function changeFam(){
        setTimeout("RegenSubFamilias()",50);
    	setTimeout("RegenColores()",50);
    	setTimeout("RegenTallajes()",50);
    	setTimeout("RegenAlias()",50);
}


function RegenSubFamilias() {
	 VaciarSubFamilias();

	 var idfam = id("idfamilia").value;
	 var xrequest = new XMLHttpRequest();
	 var url = "selcb.php?modo=subfamilia&IdFamilia="+idfam;

	 xrequest.open("GET",url,false);
	 xrequest.send(null);
	 var res = xrequest.responseText;
	 
	 var lines = res.split("\n");
	 var actual;
	 var ln = lines.length-1;
	 for(var t=0;t<ln;t++){
	    actual = lines[t];
	    actual = actual.split("=");
	    AddSubFamiliaLine(actual[0],actual[1]);		
	 }				
}

function AddSubFamiliaLine(nombre, valor) {
	var xlistitem = id("elementosSubFamilias");	
	
	var xsubfamilia = document.createElement("menuitem");
	xsubfamilia.setAttribute("id","subfamilia_def_" + isubfamilias);
			
	xsubfamilia.setAttribute("value",valor);
	xsubfamilia.setAttribute("label",nombre);
	
	xlistitem.appendChild( xsubfamilia);var xlistitem = id("elementosSubFamilias");	
	isubfamilias++;
}

function VaciarSubFamilias(){

	var xlistitem = id("elementosSubFamilias");
	var iditem;
	var t = 0;
	while( el = id("subfamilia_def_"+ t ) ) 
	{
		if (el) {
			//alert('gPOS: \n\n '+ el.id );
			xlistitem.removeChild( el ) ;	
		}
		t = t + 1;
	}

	isubfamilias = 0;

	id("idsubfamilia").setAttribute("label","");	
}

function RegenColores() {
	VaciarColores();

	var idfam = id("idfamilia").value;
	var xrequest = new XMLHttpRequest();
	var url = "selcb.php?modo=colores&IdFamilia="+idfam;
	
	xrequest.open("GET",url,false);
	xrequest.send(null);
	var res = xrequest.responseText;

	var lines = res.split("\n");
	var actual;
	var ln = lines.length-1;
	for(var t=0;t<ln;t++){
	   actual = lines[t];
	   actual = actual.split("=");
	   AddColorLine(actual[0],actual[1]);		
	}				
}

function AddColorLine(nombre, valor) {
	var xlistitem = id("elementosColores");	
	
	var xcolor = document.createElement("menuitem");
	xcolor.setAttribute("id","color_def_" + icolores);
			
	xcolor.setAttribute("value",valor);
	xcolor.setAttribute("label",nombre);
	
	xlistitem.appendChild( xcolor);var xlistitem = id("elementosColores");	
	icolores++;
}

function VaciarColores(){

	var xlistitem = id("elementosColores");
	var iditem;
	var t = 0;
	while( el = id("color_def_"+ t ) ) 
	{
		if (el) {
			//alert('gPOS: \n\n '+ el.id );
			xlistitem.removeChild( el ) ;	
		}
		t = t + 1;
	}

	icolores = 0;

	id("idcolor").setAttribute("label","");	
}

function RegenTallajes() {
	VaciarTallas();
		
	var mitallaje = 5;
	var idfam = id("idfamilia").value;			
	var xrequest = new XMLHttpRequest();
	var url = "selcb.php?modo=tallas&IdTallaje="+mitallaje+'&IdFamilia='+idfam;
	xrequest.open("GET",url,false);
	xrequest.send(null);
	var res = xrequest.responseText;
	
	var lines = res.split("\n");
	var actual;
	var ln = lines.length-1;	
	for(var t=0;t<ln;t++){
	   actual = lines[t];
	   actual = actual.split("=");
	   AddTallaLine(actual[0],actual[1]);		
	}				
}


function VaciarTallas(){
	var xlistitem = id("elementosTallas");
	var iditem;
	var t = 0;

	while( el = id("talla_def_"+ t) ) {
		if (el) {
			//alert('gPOS: \n\n '+ el.id );
			xlistitem.removeChild( el ) ;	
		}
		t = t + 1;
	}
	
	itallas = 0;

	id("idtalla").setAttribute("label","");	
}

function AddTallaLine(nombre, valor) {
	var xlistitem = id("elementosTallas");	
	
	var xtalla = document.createElement("menuitem");
	xtalla.setAttribute("id","talla_def_" + itallas);
			
	xtalla.setAttribute("value",valor);
	xtalla.setAttribute("label",nombre);

	xlistitem.appendChild( xtalla);var xlistitem = id("elementosTallas");	
	itallas ++;
}


function RegenAlias() {
	VaciarAlias();
	var idfam = id("idfamilia").value;			
	var xrequest = new XMLHttpRequest();
	var url = "selcb.php?modo=alias&IdFamilia="+idfam;
	
	xrequest.open("GET",url,false);
	xrequest.send(null);
	var res = xrequest.responseText;
	
	var lines = res.split("\n");
	var actual;
	var ln = lines.length-1;	
	for(var t=0;t<ln;t++){
	   actual = lines[t];
	   actual = actual.split("=");
	   AddAliasLine(actual[0],actual[1]);		
	}				
}


function VaciarAlias(){
	var xlistitem = id("elementosAlias");
	var iditem;
	var t = 0;

	while( el = id("alias_def_"+ t) ) {
		if (el) {
			//alert('gPOS: \n\n '+ el.id );
			xlistitem.removeChild( el ) ;	
		}
		t = t + 1;
	}
	
	ialias = 0;

	id("idalias").setAttribute("label","");	
}

function AddAliasLine(nombre, valor) {

	var xlistitem = id("elementosAlias");	
	
	var xalias = document.createElement("menuitem");
	xalias.setAttribute("id","alias_def_" + ialias);
			
	xalias.setAttribute("value",valor);
	xalias.setAttribute("label",nombre);

	xlistitem.appendChild(xalias);var xlistitem = id("elementosAlias");	
	ialias ++;
}

]]></script>

<?php 
}
示例#3
0
function FormularioEditarArticulo($id)
{
    global $action;
    $ot = getTemplate("FormEditarArticulo");
    if (!$ot) {
        error(__FILE__ . __LINE__, "Error: template busqueda no encontrado");
        return false;
    }
    $articulo = new articulo();
    $oProducto = new producto();
    if (!$articulo->Load($id)) {
        error(__FILE__ . __LINE__, "Error: no puedo modificar ese producto");
        return false;
    }
    $oProducto->Load($articulo->get("IdProducto"));
    $igv = getSesionDato("IGV");
    $local = $_SESSION["LocalMostrado"];
    $idProducto = $articulo->get("Id");
    $CostoUnitario = $articulo->get("CostoUnitario");
    $PVD = $articulo->get("PrecioVenta");
    $PVDD = $articulo->get("PVDDescontado");
    $IGVD = round($PVD / (1 + $igv / 100) * ($igv / 100) * 100) / 100;
    $MUD = round(($PVD - $IGVD - $CostoUnitario) * 100) / 100;
    $PVC = $articulo->get("PrecioVentaCorporativo");
    $PVCD = $articulo->get("PVCDescontado");
    $IGVC = round($PVC / (1 + $igv / 100) * ($igv / 100) * 100) / 100;
    $MUC = round(($PVC - $IGVC - $CostoUnitario) * 100) / 100;
    $disponible = $articulo->is("Disponible") ? "checked" : "";
    $dispOnline = $articulo->is("DisponibleOnline") ? "checked" : "";
    $obsoleto = $oProducto->get("Obsoleto") ? "checked" : "";
    $esLote = $oProducto->get("Lote");
    $esVence = $oProducto->get("FechaVencimiento");
    $esSerie = $oProducto->get("Serie");
    $oferta = $articulo->is("Oferta") ? "checked" : "";
    $stockilimitado = $articulo->is("StockIlimitado") ? "checked" : "";
    $esIlimitado = $esSerie ? 'none' : 'table-row';
    $esIlimitado = $esLote ? 'none' : $esIlimitado;
    $esIlimitado = $esVence ? 'none' : $esIlimitado;
    $existencias = $articulo->get("Unidades");
    $stockunidades = $existencias;
    $producto = getDatosProductosExtra($articulo->get("IdProducto"), 'nombretodos');
    $nombre = $producto["Nombre"];
    $esMenudeo = $producto["Menudeo"];
    $unidad = $producto["Und"];
    $unidxemp = $producto["UndxEmp"];
    $empaque = $producto["Empaque"];
    $resmenudeo = $esMenudeo ? "  ( " . $stockunidades . " " . $unidad . " a " . $unidxemp . $unidad . "x" . $empaque . " )" : "";
    $disponibleunid = $articulo->get("DisponibleUnidades");
    $reservadaunid = $disponibleunid > 0 ? $existencias - $disponibleunid : 0;
    $resto = $esMenudeo ? $existencias % $unidxemp : 0;
    $empaques = $esMenudeo ? ($existencias - $resto) / $unidxemp : 0;
    $existencias = $esMenudeo ? $empaques . " " . $empaque . " + " . $resto : $existencias;
    $disponibleunid = $disponibleunid > 0 ? $disponibleunid : $stockunidades;
    $txtMoDet = getModeloDetalle2txt();
    $txtModelo = $txtMoDet[1];
    $txtDetalle = $txtMoDet[2];
    $txtalias = $txtMoDet[3];
    $txtref = $txtMoDet[4];
    $ot->fijar("tTituloAux", _("Otras tiendas"));
    $ot->fijar("tIgualar", _("Todas las tiendas el mismo precio"));
    $ot->fijar("tMotivo", _("Motivo mod. existencias"));
    $ot->fijar("tTitulo", _("Modificar existencias"));
    $ot->fijar("vRefProvHab", $articulo->get("RefProvHab"));
    $ot->fijar("tRefProvHab", $txtref);
    $ot->fijar("vPresentacion", $oProducto->getTextColor());
    $ot->fijar("tPresentacion", $txtModelo);
    $ot->fijar("vProductoAlias0", getIdProductoAlias2Texto($articulo->get("IdProductoAlias0")));
    $ot->fijar("tProductoAlias0", $txtalias);
    $ot->fijar("vProductoAlias1", getIdProductoAlias2Texto($articulo->get("IdProductoAlias1")));
    $ot->fijar("tProductoAlias1", $txtalias);
    $ot->fijar("vSubPresentacion", $oProducto->getTextTalla());
    $ot->fijar("tSubPresentacion", $txtDetalle);
    $ot->fijar("vReferencia", $articulo->get("Referencia"));
    $ot->fijar("tReferencia", _("Referencia"));
    $ot->fijar("vDescripcion", $nombre);
    $ot->fijar("tDescripcion", _("Nombre"));
    $ot->fijar("vUnidades", $existencias);
    $ot->fijar("tUnidades", _("Stock"));
    $ot->fijar("mUnidad", $resmenudeo);
    $ot->fijar("vIGV", $igv);
    $ot->fijar("tIGV", "IGV");
    $ot->fijar("vCostoUnitario", round($articulo->get("CostoUnitario") * 100) / 100);
    $ot->fijar("tCostoUnitario", _("CU"));
    $ot->fijar("vCostoUnitarioC", round($articulo->get("CostoUnitario") * 100) / 100);
    $ot->fijar("tCostoUnitarioC", _("CU"));
    $ot->fijar("vMUD", $MUD);
    $ot->fijar("tMUD", _("MU"));
    $ot->fijar("vIGVD", $IGVD);
    $ot->fijar("tIGVD", _("IGV"));
    $ot->fijar("vPVD", $PVD);
    $ot->fijar("tPVD", _("PVP"));
    $ot->fijar("vPVDD", $PVDD);
    $ot->fijar("tPVDD", _("PVPD"));
    $ot->fijar("vMUC", $MUC);
    $ot->fijar("tMUC", _("MU"));
    $ot->fijar("vIGVC", $IGVC);
    $ot->fijar("tIGVC", _("IGV"));
    $ot->fijar("vPVC", $PVC);
    $ot->fijar("tPVC", _("PVC"));
    $ot->fijar("vPVCD", $PVCD);
    $ot->fijar("tPVCD", _("PVCD"));
    $ot->fijar("tTipoImpuesto", _("Impuesto"));
    $ot->fijar("vTipoImpuesto", $articulo->get("TipoImpuesto"));
    $ot->fijar("vImpuesto", $articulo->get("Impuesto"));
    $ot->fijar("vStockMin", $articulo->get("StockMin"));
    $ot->fijar("vStockUnidades", $stockunidades);
    $ot->fijar("tOfertaUnidades", _("Unidades en Oferta "));
    $ot->fijar("vOfertaUnidades", $articulo->get("OfertaUnidades"));
    $ot->fijar("tPrecioVentaOferta", _("Precio de Oferta"));
    $ot->fijar("vPrecioVentaOferta", $articulo->get("PrecioVentaOferta"));
    $ot->fijar("tDisponibleUnidades", _("Unidades Disponibles"));
    $ot->fijar("vDisponibleUnidades", $disponibleunid);
    $ot->fijar("tUnidad", $unidad);
    $ot->fijar("tUnidadesReservadas", _("Unidades Reservadas"));
    $ot->fijar("vUnidadesReservadas", $reservadaunid);
    $ot->fijar("cDisponible", $disponible);
    $ot->fijar("cDisponibleOnline", $dispOnline);
    $ot->fijar("cOferta", $oferta);
    $ot->fijar("cStockIlimitado", $stockilimitado);
    $ot->fijar("esStockIlimitado", $esIlimitado);
    $ot->fijar("tDisponible", _("Disponible"));
    $ot->fijar("tDisponibleOnline", _("Disponible Online"));
    $ot->fijar("tObsoleto", _("Obsoleto"));
    $ot->fijar("cObsoleto", $obsoleto);
    $ot->fijar("tOferta", _("En oferta"));
    $ot->fijar("tStockIlimitado", _("Stock ilimitado"));
    $ot->fijar("tStockMin", _("Stock minimo"));
    $ot->fijar("action", $action);
    $ot->fijar("vId", $articulo->get("Id"));
    echo $ot->Output();
}
示例#4
0
 function formClon($action, $lang = false, $volver = false)
 {
     $ot = getTemplate("ClonProducto");
     if (!$ot) {
         return false;
     }
     $modo = "salvaclon";
     $ListadoCombinado = genListadoCruzado($this->getId(), $this->get("IdTallaje"));
     $tieneserie = $this->get("Serie");
     $incluidons = $this->get("Serie") == 1 ? "checked" : "";
     $incluidolt = $this->get("Lote") == 1 ? "checked" : "";
     $incluidofv = $this->get("FechaVencimiento") == 1 ? "checked" : "";
     $incluidomd = $this->get("VentaMenudeo") == 1 ? "checked" : "";
     $motivomd = $this->get("VentaMenudeo") == 1 ? "visible" : "hidden";
     $tienefechavencimiento = $this->get("FechaVencimiento");
     $volver = $volver == "modcompras" ? "modcompras.php" : "modproductos.php";
     $numreg = ObtenerNumeroProductosPorReferencia($this->getReferencia());
     $readonlyUM = "readonly";
     $readonly = "readonly";
     $um = "";
     $ounidad = "";
     $ometro = "";
     $olitro = "";
     $okilo = "";
     switch ($this->get("UnidadMedida")) {
         case 'und':
             $um = "Unidades";
             $ounidad = "selected";
             break;
         case 'mts':
             $um = "Metros";
             $ometro = "selected";
             break;
         case 'lts':
             $um = "Litros";
             $olitro = "selected";
             break;
         case 'kls':
             $um = "Kilos";
             $okilo = "selected";
             break;
     }
     $osrm = "";
     $ocrm = "";
     $ocrmr = "";
     switch ($this->get("CondicionVenta")) {
         case '0':
             $osrm = "selected";
             break;
         case 'CRM':
             $ocrm = "selected";
             break;
         case 'CRMR':
             $ocrmr = "selected";
             break;
     }
     $txtMoDet = getModeloDetalle2txt();
     $esBTCA = $txtMoDet[0] == "BTCA";
     $hidden = "style='display:none;'";
     $btca = $esBTCA ? false : $hidden;
     $txtref = $txtMoDet[4];
     $ismtposerv = $this->get("Servicio") || $this->get("MetaProducto") ? $hidden : false;
     $isserie = $this->get("Serie") ? $hidden : false;
     $txtalias = $txtMoDet[3];
     $txtModelo = $txtMoDet[1];
     $txtDetalle = $txtMoDet[2];
     $txtTitulo = $esBTCA ? 'Nueva' : 'Nuevo';
     $titulo = _("{$txtTitulo} {$txtModelo} / {$txtDetalle}");
     $cambios = array("tPrecioVenta" => _("Previo Venta"), "vPrecioVenta" => $this->getPrecioVenta(), "vIdTallaje" => $this->get("IdTallaje"), "ListaCombinada" => $ListadoCombinado, "tImprimirCodigoBarras" => _("Imprimir código barras"), "vRefProvHab" => $this->get("RefProvHab"), "tRefProvHab" => $txtref, "vIdMarca" => $this->get("IdMarca"), "tMarca" => _("Marca"), "vMarca" => getIdMarca2Texto($this->get("IdMarca")), "vIdContenedor" => $this->get("IdContenedor"), "tContenedor" => _("Contenedor"), "vContenedor" => getIdContenedor2Texto($this->get("IdContenedor")), "vIdTalla" => $this->get("IdTalla"), "tModelo" => $txtModelo, "vTalla" => getIdTalla2Texto($this->get("IdTalla"), $this->get("IdIdioma")), "vIdColor" => $this->get("IdColor"), "tDetalle" => $txtDetalle, "vColor" => getIdColor2Texto($this->get("IdColor"), $this->get("IdIdioma")), "tCodigoBarras" => _("Código barras"), "vCodigoBarras" => $this->get("CodigoBarras"), "tTitulo" => $titulo, "HIDDENDATA" => Hidden("id", $this->getId()), "action" => "{$action}?modo={$modo}&idBase=", "Referencia" => _("Referencia"), "vReferencia" => $this->getReferencia(), "tCosteSinIVA" => _("Costo Ref."), "vCosteSinIVA" => $this->get("Costo") * 1, "Descripcion" => _("Nombre"), "vDescripcion" => $this->getDescripcion(), "isbtca" => $btca, "ismtposerv" => $ismtposerv, "isserie" => $isserie, "vIdProductoAlias0" => $this->get("IdProductoAlias0"), "tProductoAlias0" => $txtalias, "vProductoAlias0" => getIdProductoAlias2Texto($this->get("IdProductoAlias0"), $this->get("IdIdioma")), "vIdProductoAlias1" => $this->get("IdProductoAlias1"), "tProductoAlias1" => $txtalias, "vProductoAlias1" => getIdProductoAlias2Texto($this->get("IdProductoAlias1"), $this->get("IdIdioma")), "PrecioVenta" => _("Precio venta"), "vPrecioVenta" => $this->getPrecioVenta(), "PrecioOnline" => _("Precio online"), "vPrecioOnline" => $this->getPrecioOnline(), "tVentaMenudeo" => _("Venta al menudeo"), "cVentaMenudeo" => $incluidomd, "vMotivoMd" => $motivomd, "cNumeroSerie" => $incluidons, "cLote" => $incluidolt, "cFechaVencimiento" => $incluidofv, "tUnidadesPorContenedor" => _("Unidades Por Contenedor"), "vUnidadesPorContenedor" => $this->get("UnidadesPorContenedor"), "tUnidadMedida" => _("Unidad Medida"), "vUnidadMedida" => $this->get("UnidadMedida"), "vUM" => $um, "ounidad" => $ounidad, "ometro" => $ometro, "olitro" => $olitro, "okilo" => $okilo, "oSRM" => $osrm, "oCRM" => $ocrm, "oCRMR" => $ocrmr, "vReadOnly" => $readonly, "vReadOnlyUM" => $readonlyUM, "vSerie" => $tieneserie, "vFechaVencimiento" => $tienefechavencimiento, "tFamilia" => _("Familia..."), "tSubFamilia" => _("Sub familia..."), "TipoImpuesto" => _("Impuesto"), "tIdProvHab" => _("Proveedor hab."), "vIdProvHab" => $this->get("IdProvHab"), "vProveedorHab" => getNombreProveedor($this->get("IdProvHab")), "tIdLabHab" => _("Laboratorio hab."), "vIdLabHab" => $this->get("IdLabHab"), "vLaboratorioHab" => getNombreLaboratorio($this->get("IdLabHab")), "vTipoImpuesto" => $this->getTipoImpuesto(), "vIdFamilia" => $this->get("IdFamilia"), "vIdSubFamilia" => $this->get("IdSubFamilia"), "vFamilia" => $this->get("Familia"), "vSubFamilia" => $this->get("SubFamilia"), "vImpuesto" => $this->getImpuesto());
     return $ot->makear($cambios);
 }
示例#5
0
function ListarProductos($idprov, $idmarca, $idcolor, $idtalla, $seleccion, $idprod, $idbase, $nombre = false, $ref = false, $cb = false, $obsoletos = false, $idlab = false, $idalias = false, $porproveedor = false, $stockminimo = false)
{
    global $action, $tamPagina;
    $oProducto = new producto();
    $idalias = $nombre ? getLikeProductoAlias2Id($nombre, $IdIdioma = false) : $idalias;
    $base = $idbase;
    //$idprod???
    $indice = getSesionDato("PaginadorCompras");
    $Moneda = getSesionDato("Moneda");
    $txtMoDet = getModeloDetalle2txt();
    $txtModelo = $txtMoDet[1];
    $txtDetalle = $txtMoDet[2];
    $hayProductos = $oProducto->ListadoFlexibleCompras($idprov, $idmarca, $idcolor, $idtalla, false, $indice, $base, false, false, $tamPagina, $ref, $cb, $nombre, $obsoletos = false, $idalias, $idlab, $porproveedor, $stockminimo);
    $num = 0;
    $jsOut = "";
    $jsLex = new jsLextable();
    $jsOut .= jsLabel("color", $txtModelo);
    $jsOut .= jsLabel("talla", $txtDetalle);
    $jsOut .= jsLabel("comprar", _("Comprar"));
    $jsOut .= jsLabel("modificar", _("Modificar"));
    $jsOut .= jsLabel("referencia", _("Referencia"));
    $jsOut .= jsLabel("unid", _("Unid"));
    $jsOut .= jsLabel("pv", _("PV"));
    $jsOut .= jsLabel("nuevatallacolor", _("Nuevo {$txtModelo} o {$txtDetalle}"));
    $oldId = -1;
    $num = 0;
    while ($oProducto->SiguienteProducto()) {
        $num++;
        $id = $oProducto->getId();
        $cb = $oProducto->getCB();
        $nombre = $oProducto->getNombre();
        $descripcion = $oProducto->get("Descripcion");
        $marca = getIdMarca2Texto($oProducto->get("IdMarca"));
        $lab = getNombreLaboratorio($oProducto->get("IdLabHab"));
        $ref = $oProducto->getReferencia();
        $talla = getIdTalla2Texto($oProducto->get("IdTalla"));
        $color = getIdColor2Texto($oProducto->get("IdColor"));
        $manejaserie = $oProducto->get("Serie");
        $manejalote = $oProducto->get("Lote");
        $manejafv = $oProducto->get("FechaVencimiento");
        $eservicio = $oProducto->get("Servicio") > 0 ? 1 : 0;
        //Servicio
        $eservicio = $oProducto->get("MetaProducto") ? 1 : $eservicio;
        //MetaProducto
        $lextalla = $jsLex->add($talla);
        $lexcolor = $jsLex->add($color);
        $fam = getIdFamilia2Texto($oProducto->get("IdFamilia"));
        $sub = getIdSubFamilia2Texto($oProducto->get("IdFamilia"), $oProducto->get("IdSubFamilia"));
        $lexfam = $jsLex->add($fam);
        $lexsub = $jsLex->add($sub);
        $idBase = $oProducto->get("IdProdBase");
        if ($idBase != $oldId) {
            $ref = addslashes($ref);
            $nombre = addslashes($nombre);
            $jsOut .= "cLH({$id},'{$nombre}','{$ref}',{$lexfam},{$lexsub},'{$descripcion}','{$marca}','{$lab}','{$idBase}');\n";
        }
        $jsOut .= "cL({$id},{$cb},{$lextalla},{$lexcolor},{$manejaserie},{$manejalote},{$manejafv},{$eservicio});\n";
        $oldId = $idBase;
    }
    $jsOut = $jsLex->jsDump() . $jsOut;
    $paginador = jsPaginador($indice, $tamPagina, $num);
    $jsOut .= $paginador;
    $jsOut .= "cListProductos();";
    $jsOut .= $paginador;
    $jsOut .= AutoOpen();
    $detadoc = getSesionDato("detadoc");
    $documento = getNombreDocumentoCompra($detadoc);
    $tipodoc = $detadoc[0];
    $idprov = !$detadoc[1] ? 1 : $detadoc[1];
    $nombreprov = !$idprov ? 'CASAS VARIAS' : $detadoc[2];
    $fechapago = $detadoc[8];
    $idsubsid = !$detadoc[9] ? '' : $detadoc[9];
    $nombresubsid = !$detadoc[10] ? '' : $detadoc[10];
    $nrodoc = $detadoc[3];
    $anrodoc = explode("-", $nrodoc);
    $sdoc = $anrodoc[0];
    $ndoc = isset($anrodoc[1]) ? $anrodoc[1] : '';
    $fdoc = $detadoc[4];
    $tipocambio = $detadoc[6];
    $fcambio = $detadoc[7];
    $tipomoneda = $detadoc[5];
    $tpfecha = 'Fecha Emisión : ';
    $checkigv = getSesionDato("incImpuestoDet") == 'true' ? 'CHECKED' : '';
    $checkipc = getSesionDato("incPercepcion") == 'true' ? 'CHECKED' : '';
    $checkcredt = getSesionDato("aCredito") == 'true' ? 'CHECKED' : '';
    $admiteCompra = !selAdmite('Compras');
    $tipodoc = selAdmite('Compras') ? "O" : $tipodoc;
    $checkF = '';
    $checkO = '';
    $checkR = '';
    $checkG = '';
    $checkSD = '';
    switch ($tipodoc) {
        case "F":
            $habilita = "apareceCapa('prov');" . "apareceCapa('ndoc');" . "apareceCapa('fdoc');" . "apareceCapa('acred');" . "apareceCapa('pgdoc');" . "cambiodoc('F');";
            $checkF = 'selected';
            break;
        case "O":
            $habilita = "apareceCapa('prov');" . "apareceCapa('acred');" . "desapareceCapa('ndoc');" . "apareceCapa('fdoc');" . "apareceCapa('pgdoc');" . "cambiodoc('O');" . "CambiaTextDoc(1);";
            $checkigv = 'selected';
            setSesionDato("incImpuestoDet", 'true');
            $checkO = 'selected';
            break;
        case "R":
            $habilita = "apareceCapa('prov');" . "apareceCapa('ndoc');" . "apareceCapa('acred');" . "apareceCapa('pgdoc');" . "apareceCapa('fdoc');" . "cambiodoc('R'); ";
            $checkR = 'selected';
            break;
        case "G":
            $habilita = "apareceCapa('prov');" . "apareceCapa('ndoc');" . "apareceCapa('fdoc');" . "apareceCapa('acred');" . "apareceCapa('pgdoc');" . "cambiodoc('G'); ";
            $checkG = 'selected';
            break;
        case "SD":
            $habilita = "apareceCapa('prov');" . "desapareceCapa('ndoc');" . "desapareceCapa('acred');" . "apareceCapa('fdoc');" . "apareceCapa('pgdoc');" . "cambiodoc('SD'); ";
            $checkSD = 'selected';
    }
    $tnrodoc = $nrodoc ? 'Nro ' . $nrodoc : '';
    $titulo = selAdmite('Compras') ? 'Pedido' : $documento . ' ' . $tnrodoc;
    $tpfecha = $detadoc[0] == 'O' ? 'Fecha Entrega : ' : $tpfecha;
    $checkTS = $tipomoneda == 1 ? 'CHECKED' : '';
    $habilita_tmoneda = $tipomoneda == 1 ? "desapareceCapa('cambiomoneda');" : "";
    $checkTD = $tipomoneda == 2 ? 'CHECKED' : '';
    $habilita_tmoneda = $tipomoneda == 2 ? "apareceCapa('cambiomoneda');" : '';
    echo "<script type='text/JavaScript' language='javascript' " . "src='modulos/calendario/calendar.js'></script>" . "<script type='text/JavaScript' language='javascript' " . "src='modulos/calendario/lang/calendar-sp.js'></script>" . "<script type='text/JavaScript' language='javascript' " . "src='modulos/calendario/calendar-setup.js'></script>\n\n<center>\n<table border='0' class='listado'>\n  <tr class='formaCabeza'>\n    <td colspan='3' height='16'>\n      <div id='t_comprov' class='formaTitulo'>{$titulo}</div>\n    </td>\n  </tr>\n  <tr>\n  <td  class='lh' colspan='3' style='padding: 0em 1em 0.3em 0.6em'>\n\n    <div id=prov style='display: none;color:#000000;'> \n      <b>Proveedor :</b>\n      <input type=hidden id=IdProvHab name=IdProvHab value='{$idprov}' > \n      <input type=hidden id=modopagina name=modopagina value='Compras'>\n      <input class=btn onclick='auxAltaProv();' type='button' value='+'> \n      <input class=btn onclick='auxProveedorHab();' type='button' value='...'> \n      <input class=xbtlh name=TextoProvHab id=TextoProvHab value='{$nombreprov}' readonly/>\n    </div>\n\n    &nbsp;&nbsp;&nbsp;&nbsp; \n      <b>Presupuesto :</b>\n\t<select>\n                ";
    if ($admiteCompra) {
        echo "<option  onclick=" . '"' . "s_radioComprobante('F');" . '"' . "  {$checkF} >Factura</option>\n\t\t<option  onclick=" . '"' . "s_radioComprobante('R');" . '"' . "  {$checkR}>Boleta</option>\n\t\t<option  onclick=" . '"' . "s_radioComprobante('G');" . '"' . "  {$checkG}>Albarán</option>\n\t\t<option  onclick=" . '"' . "s_radioComprobante('SD');" . '"' . "  {$checkSD}>Ticket</option>";
    }
    echo "\n\t</select>\n   </td>\n  </tr>\n  <tr>   \n   <td colspan='3' style='' Align='center'>\n\n     <div id=ndoc style='display: none;color:#000000;'>\n       <b>Serie :</b> \n     <input class=cbt id='SDoc' name='SDoc' value='{$sdoc}' class='cajaPequena' type='text'\n      size='4' maxlength='4' onkeypress='return soloAlfaNumericoSerieBase(event);' onblur='setndoc(this.value);' onkeyup='this.value=this.value.toUpperCase()'>\n       <b>Nro :</b> \n     <input class=cbt id='NDoc' name='NDoc' value='{$ndoc}' class='cajaPequena' type='text' \n      size='7' maxlength='7' onkeypress='return soloNumerosEnterosBase(event,this.value);' onblur='setndoc(this.value);'>\n     </div>\n\n\n\n     <div id=fdoc style='display: none;color:#000000;'>\n      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\n      <b><span id='fecha_op'>{$tpfecha}</span></b> \n\n      <input class=cbt name='FechaDoc' type='text' id='FechaDoc' class='cajaPequena'\n       size='8' maxlength='10' value='{$fdoc}' readonly> \n\n      <img  style='margin-top:-6px' src='img/gpos_calendario.png' name='Image1' id='Image11' \n       border='0'  onMouseOver=" . '"' . "this.style.cursor='pointer'" . '"' . " >\n      <script>Calendar.setup( \n      {inputField : 'FechaDoc',ifFormat   : '%d/%m/%Y', button : 'Image11', onUpdate : setfechadoc });\n      </script>\n\n    </div>\n\n    <div id=pgdoc style='display: none;color:#000000;'>\n      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\n      <b> Fecha Pago :</b>\n        <input class=cbt NAME='FechaPago' type='text' id='FechaPago' class='cajaPequena' \n         size='8' maxlength='10' value='{$fechapago}' readonly> \n         <img src='img/gpos_calendario.png' name='Image2' id='Image22' \n         border='0'  onMouseOver=" . '"' . "this.style.cursor='pointer'" . '"' . " >\n        <script>Calendar.setup( \n        {inputField : 'FechaPago',ifFormat : '%d/%m/%Y', button : 'Image22', \n         onUpdate : setfechapagodoc });\n        </script>\n      </div>\n\n   </td>\n  </tr> \n  <tr>\n    <td  class='lh'  colspan='3' style='padding: 0em 1em 0.2em 1em' Align='center'>\n     \n      <input type=radio id ='tipoSoles' name='grupo2' value='0' \n      onclick=" . '"' . "desapareceCapa('cambiomoneda'); cambiomoneda(1);" . '"' . " {$checkTS} >\n      " . $Moneda[1]['T'] . "\n      <input type=radio id='tipoDolar' name='grupo2' value='1' \n      onclick=" . '"' . "apareceCapa('cambiomoneda'); cambiomoneda(2);" . '"' . " {$checkTD} >\n      " . $Moneda[2]['T'] . "\n\n      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\n\n        <div id=acred style='display: none;color:#000000; '>\n        <input type=checkbox  onclick=aCredito(this.checked); {$checkcredt} >\n        Crédito\n        <input type=checkbox  onclick=incluirPercepcion(this.checked); {$checkipc} >\n        Percepción\n        </div> \n        <input type=checkbox  onclick=incluirIGV(this.checked); {$checkigv} >\n        Impuesto\n\n\n    </td>\n  </tr>\n  <tr>\n   <td colspan='3' Align='center'>\n     <div id=cambiomoneda style='display: none; color:#000000'> \n\n      <b>Cambio : </b>  \n       <input class=cbt name='TipoCambio' class='InputPrecio'  value='{$tipocambio}' \n        onblur='settipocambio(this.value);' onkeypress='return soloNumerosBase(event,this.value);' size='5'>  \n      <input class=cbt NAME='FechaCambio' type='text' id='FechaCambio' class='cajaPequena' \n       value='{$fcambio}'  size='8' maxlength='10' value='' readonly> \n\n      <img src='img/gpos_calendario.png' name='Image' id='Image'\n       border='0'  onMouseOver=" . '"' . "this.style.cursor='pointer'" . '"' . ">\n      <script>Calendar.setup( \n      {inputField : 'FechaCambio',ifFormat   : '%d/%m/%Y', button     : 'Image',  \n       onUpdate : setfechacambio  });\n      </script>\n\n     </div>\n   </td>\n  </tr>\n</table>\n</center>\n\n<script>{$habilita} {$habilita_tmoneda} parent.Compras_cambiaBtnCarrito('Ver');</script>";
    echo "<center>";
    echo jsBody($jsOut);
    echo "</center>";
}