function ProductoConfigurado(){
this.codigo="";
this.producto=null;
this.local=null;
this.indicadorComponenteAgregado=INHABILITADO;
this.restaurante=null;
this.productoLocal=null;
this.valorAtributoPrincipalProductoLocal=null;
this.valorAtributoPrincipalProducto=null;
this.arrayMatrizValorAtributoProducto=null;
this.arrayIngredienteAdicional=null;
this.arrayIngrediente=null;
this.arrayOtroAdicional=null;
this.cantidad=1;
this.arrayIngredienteAdicionalParte=null;
this.arrayComplementario=null;
this.indicadorIngrediente=INHABILITADO;
this.indicadorIngredienteParte=INHABILITADO;
this.indicadorSustitucionIngrediente=INHABILITADO;
this.codigoTipoProducto="";
this.cantidadIngredienteOriginal=0;
this.arrayIngredienteCompuesto=null;
this.precioAutoCalculado=INHABILITADO;
this.indicadorTextoAdicional;
this.tituloTextoAdicional;
this.arrayIngredienteProductoCombo=null;
}
function pintarGlosaPNE(){
var _1="";
var _2;
var _3=false;
var _4="";
if(!this.valorAtributoPrincipalProducto.valorAtributoPrincipal.atributoPrincipal.codigo==ATRIBUTO_PRINCIPAL_NINGUNO){
_1=_1+this.valorAtributoPrincipalProducto.valorAtributoPrincipal.atributoPrincipal.nombre+" ";
_1=_1+this.valorAtributoPrincipalProducto.valorAtributoPrincipal.valor;
}
if(this.arrayMatrizValorAtributoProducto!=null){
if(this.arrayMatrizValorAtributoProducto.length>0){
_1=_1+" <br> ";
_2=this.arrayMatrizValorAtributoProducto.length;
for(var i=0;i<_2;i++){
_1=_1+this.arrayMatrizValorAtributoProducto[i].matrizValorAtributo.valorAtributoSecundario.atributoSecundario.nombre+": ";
_1=_1+this.arrayMatrizValorAtributoProducto[i].matrizValorAtributo.valorAtributoSecundario.valor;
_1=_1+", ";
}
_1=_1.substr(0,_1.length-2);
}
}
if(this.arrayIngrediente!=null&&this.indicadorIngrediente==HABILITADO){
if(this.arrayIngrediente.length>0){
_4="";
_2=this.arrayIngrediente.length;
for(var i=0;i<_2;i++){
if(this.arrayIngrediente[i].cantidad>this.arrayIngrediente[i].componente.numeroVeces){
_4=_4+this.arrayIngrediente[i].componente.componente.nombre;
if(this.arrayIngrediente[i].cantidad-this.arrayIngrediente[i].componente.numeroVeces>1){
_4=_4+" ("+(this.arrayIngrediente[i].cantidad-this.arrayIngrediente[i].componente.numeroVeces)+")";
}
_4=_4+", ";
_3=true;
}
}
if(_3){
_4=_4.substr(0,_4.length-2);
_1=_1+"<br>Con extra de "+_4;
}
}
}
if(this.arrayIngredienteAdicional!=null&&this.indicadorIngrediente==HABILITADO){
if(this.arrayIngredienteAdicional.length>0){
_4="";
_2=this.arrayIngredienteAdicional.length;
for(var i=0;i<_2;i++){
_4=_4+this.arrayIngredienteAdicional[i].componente.componente.nombre;
if(this.arrayIngredienteAdicional[i].cantidad>1){
if(this.arrayIngredienteAdicional[i].cantidad-this.arrayIngredienteAdicional[i].componente.numeroVeces>0){
_4=_4+" ("+(this.arrayIngredienteAdicional[i].cantidad)+")";
}
}
if(_2>i+1){
_4=_4+", ";
}
}
if(!_3){
_4=_4;
_1=_1+"<br>Con extra de "+_4;
}else{
_4=_4;
_1=_1+", "+_4;
}
}
}
if(this.arrayIngrediente!=null&&this.indicadorIngrediente==HABILITADO){
if(this.arrayIngrediente.length>0){
_4="";
_3=false;
_2=this.arrayIngrediente.length;
for(var i=0;i<_2;i++){
if(this.arrayIngrediente[i].cantidad<this.arrayIngrediente[i].componente.numeroVeces){
_4=_4+this.arrayIngrediente[i].componente.componente.nombre;
if(this.arrayIngrediente[i].componente.numeroVeces>1){
_4=_4+" ("+(this.arrayIngrediente[i].componente.numeroVeces-this.arrayIngrediente[i].cantidad)+")";
}
_4=_4+", ";
_3=true;
}
}
if(_3){
_4=_4;
_1=_1+"<br>Sin "+_4;
}
}
}
if(this.arrayIngredienteAdicionalParte!=null&&this.indicadorIngrediente==HABILITADO&&this.indicadorIngredienteParte==HABILITADO){
if(this.arrayIngredienteAdicionalParte.length>0){
var _6=this.valorAtributoPrincipalProducto.parte;
for(var j=0;j<_6;j++){
if(this.arrayIngredienteAdicionalParte[j]!=null&&this.arrayIngredienteAdicionalParte[j]!=undefined){
_4="";
_2=this.arrayIngredienteAdicionalParte[j].length;
for(var i=0;i<_2;i++){
_4=_4+this.arrayIngredienteAdicionalParte[j][i].componente.componente.nombre;
if(this.arrayIngredienteAdicionalParte[j][i].cantidad>1){
_4=_4+" ("+(this.arrayIngredienteAdicionalParte[j][i].cantidad)+")";
}
_4=_4+", ";
}
if(_2>0){
_4=_4;
_1=_1+"<br>Parte "+(j+1)+" de "+_6+" : ";
_1=_1+"<br>Con extra de "+_4;
}
}
}
}
}
if(this.arrayOtroAdicional!=null){
if(this.arrayOtroAdicional.length>0){
_2=this.arrayOtroAdicional.length;
_1=_1+"<br>Incluir : ";
for(var i=0;i<_2;i++){
_1=_1+this.arrayOtroAdicional[i].componente.componente.nombre;
if(_2>i+1){
_1=_1+", ";
}
}
}
}
return _1;
}
function pintarGlosaPCP(){
var _8="";
var _9;
var _a=false;
var _b="";
if(!this.valorAtributoPrincipalProducto.valorAtributoPrincipal.atributoPrincipal.codigo==ATRIBUTO_PRINCIPAL_NINGUNO){
_8=_8+this.valorAtributoPrincipalProducto.valorAtributoPrincipal.atributoPrincipal.nombre+" ";
_8=_8+this.valorAtributoPrincipalProducto.valorAtributoPrincipal.valor;
}
if(this.arrayMatrizValorAtributoProducto!=null){
if(this.arrayMatrizValorAtributoProducto.length>0){
_8=_8+" <br> ";
_9=this.arrayMatrizValorAtributoProducto.length;
for(var i=0;i<_9;i++){
_8=_8+this.arrayMatrizValorAtributoProducto[i].matrizValorAtributo.valorAtributoSecundario.atributoSecundario.nombre+": ";
_8=_8+this.arrayMatrizValorAtributoProducto[i].matrizValorAtributo.valorAtributoSecundario.valor;
_8=_8+", ";
}
_8=_8.substr(0,_8.length-2);
}
}
if(this.arrayIngredienteCompuesto){
for(var k=0;k<this.arrayIngredienteCompuesto.length;k++){
var _e=this.arrayIngredienteCompuesto[k];
if(_e.componente==null){
var _f=k+1;
if(this.codigoTipoProducto==PRODUCTO_COMPUESTO_PARTES){
_8=_8+"<br> - Parte "+_f+": "+_e.producto.nombre;
}
if(this.codigoTipoProducto==PRODUCTO_OFERTA_X_POR_Y){
_8=_8+"<br> - Producto "+_f+": "+_e.producto.nombre;
}
if(_e.arrayIngrediente!=null){
if(_e.arrayIngrediente.length>0){
_b="";
_9=_e.arrayIngrediente.length;
for(var i=0;i<_9;i++){
if(_e.arrayIngrediente[i].cantidad>_e.arrayIngrediente[i].componente.numeroVeces){
_b=_b+_e.arrayIngrediente[i].componente.componente.nombre;
if(_e.arrayIngrediente[i].cantidad-_e.arrayIngrediente[i].componente.numeroVeces>1){
_b=_b+" ("+(_e.arrayIngrediente[i].cantidad-_e.arrayIngrediente[i].componente.numeroVeces)+")";
}
_b=_b+", ";
_a=true;
}
}
if(_a){
_b=_b.substr(0,_b.length-2);
_8=_8+" Con extra de "+_b;
}
}
}
if(_e.arrayIngredienteAdicional!=null){
var _10=_e.arrayIngredienteAdicional;
var _11=_10.length;
if(_e.arrayIngredienteAdicional.length>0){
_b="";
_9=_e.arrayIngredienteAdicional.length;
for(var i=0;i<_9;i++){
_b=_b+_e.arrayIngredienteAdicional[i].componente.componente.nombre;
if(_e.arrayIngredienteAdicional[i].cantidad>1){
if(_e.arrayIngredienteAdicional[i].cantidad-_e.arrayIngredienteAdicional[i].componente.numeroVeces>0){
_b=_b+" ("+(_e.arrayIngredienteAdicional[i].cantidad)+")";
}
}
if(_9>i+1){
_b=_b+", ";
}
}
if(!_a){
_b=_b;
_8=_8+" Con extra de "+_b;
}else{
_b=_b;
_8=_8+", "+_b;
}
}
}
if(_e.arrayIngrediente!=null){
if(_e.arrayIngrediente.length>0){
_b="";
_a=false;
_9=_e.arrayIngrediente.length;
for(var i=0;i<_9;i++){
if(_e.arrayIngrediente[i].cantidad<_e.arrayIngrediente[i].componente.numeroVeces){
_b=_b+_e.arrayIngrediente[i].componente.componente.nombre;
if(_e.arrayIngrediente[i].componente.numeroVeces>1){
_b=_b+" ("+(_e.arrayIngrediente[i].componente.numeroVeces-_e.arrayIngrediente[i].cantidad)+")";
}
_b=_b+", ";
_a=true;
}
}
if(_a){
_b=_b;
_8=_8+"<br>Sin "+_b;
}
}
}
}
}
}
if(this.arrayOtroAdicional!=null){
if(this.arrayOtroAdicional.length>0){
_9=this.arrayOtroAdicional.length;
_8=_8+"<br>Incluir : ";
for(var i=0;i<_9;i++){
_8=_8+this.arrayOtroAdicional[i].componente.componente.nombre;
if(_9>i+1){
_8=_8+", ";
}
}
}
}
return _8;
}
function getXMLPC(_12){
var xml="";
var _14="";
var num;
var _16;
_14=_14+getXML("cantidad",TAG_TIPO_DATO_PRIMITIVO,TAG_TIPO_INTEGER,this.cantidad);
_14=_14+this.restaurante.getXML("restaurante");
if(this.indicadorTextoAdicional){
_14=_14+getXML("indicadorTextoAdicional",TAG_TIPO_DATO_PRIMITIVO,TAG_TIPO_LONG,this.indicadorTextoAdicional);
_14=_14+getXML("comentarioAdicional",TAG_TIPO_DATO_PRIMITIVO,TAG_TIPO_STRING,this.comentarioAdicional);
}
_14=_14+this.producto.getXML("producto");
_14=_14+this.local.getXML("local");
if(this.valorAtributoPrincipalProducto!=null){
_14=_14+this.valorAtributoPrincipalProducto.getXML("valorAtributoPrincipalProducto");
}
if(this.valorAtributoPrincipalProductoLocal!=null){
_14=_14+this.valorAtributoPrincipalProductoLocal.getXML("valorAtributoPrincipalProductoLocal");
}
if(this.arrayMatrizValorAtributoProducto!=null){
num=this.arrayMatrizValorAtributoProducto.length;
var _17="";
for(var i=0;i<num;i++){
_17=_17+this.arrayMatrizValorAtributoProducto[i].getXML(i);
}
_14=_14+getXML("arrayMatrizValorAtributo",TAG_TIPO_DATO_ARRAY,"MatrizValorAtributoImpl",_17);
}
if(this.indicadorIngrediente==HABILITADO){
if(this.arrayIngrediente!=null){
num=this.arrayIngrediente.length;
var _17="";
for(var i=0;i<num;i++){
var _19=this.valorAtributoPrincipalProducto.valorAtributoPrincipal.atributoPrincipal.codigo;
var _1a=this.valorAtributoPrincipalProducto.valorAtributoPrincipal.codigo;
var _1b=1;
this.arrayIngrediente[i].valorAtributoPrincipalProducto=this.arrayIngrediente[i].componente.buscarValorAtributoPrincipalProducto(_19,_1a,_1b);
_17=_17+this.arrayIngrediente[i].getXML(i);
}
_14=_14+getXML("arrayIngrediente",TAG_TIPO_DATO_ARRAY,"ComponenteProductoPedidoBean",_17);
}
if(this.indicadorIngredienteParte==HABILITADO){
if(this.arrayIngredienteAdicionalParte!=null){
num=this.arrayIngredienteAdicionalParte.length;
var _17="";
for(var i=0;i<num;i++){
if(this.arrayIngredienteAdicionalParte[i]!=null&&this.arrayIngredienteAdicionalParte[i]!=undefined){
_16=this.arrayIngredienteAdicionalParte[i].length;
for(var j=0;j<_16;j++){
var _19=this.valorAtributoPrincipalProducto.valorAtributoPrincipal.atributoPrincipal.codigo;
var _1a=this.valorAtributoPrincipalProducto.valorAtributoPrincipal.codigo;
var _1b=i+1;
var _1d=this.valorAtributoPrincipalProducto.parte;
this.arrayIngredienteAdicionalParte[i][j].valorAtributoPrincipalProducto=this.arrayIngredienteAdicionalParte[i][j].componente.buscarValorAtributoPrincipalProducto(_19,_1a,_1d);
this.arrayIngredienteAdicionalParte[i][j].numeroParte=_1b;
this.arrayIngredienteAdicionalParte[i][j].cantidadPartes=num;
_17=_17+this.arrayIngredienteAdicionalParte[i][j].getXML(i);
}
}
}
if(_17!=""){
_14=_14+getXML("arrayIngredienteAdicionalParte",TAG_TIPO_DATO_ARRAY,"ComponenteProductoPedidoBean",_17);
}
}
}
if(this.arrayIngredienteAdicional!=null){
num=this.arrayIngredienteAdicional.length;
var _17="";
for(var i=0;i<num;i++){
var _19=this.valorAtributoPrincipalProducto.valorAtributoPrincipal.atributoPrincipal.codigo;
var _1a=this.valorAtributoPrincipalProducto.valorAtributoPrincipal.codigo;
var _1b=1;
this.arrayIngredienteAdicional[i].valorAtributoPrincipalProducto=this.arrayIngredienteAdicional[i].componente.buscarValorAtributoPrincipalProducto(_19,_1a,_1b);
_17=_17+this.arrayIngredienteAdicional[i].getXML(i);
}
_14=_14+getXML("arrayIngredienteAdicional",TAG_TIPO_DATO_ARRAY,"ComponenteProductoPedidoBean",_17);
}
}else{
if(this.arrayIngrediente!=null){
var _1e;
this.arrayIngrediente=new Array();
num=this.producto.arrayIngrediente.length;
for(var i=0;i<num;i++){
_1e=new ComponenteCliente();
_1e.componente=this.producto.arrayIngrediente[i];
_1e.cantidad=this.producto.arrayIngrediente[i].numeroVeces;
_1e.precio=0;
this.arrayIngrediente.push(_1e);
}
if(this.arrayIngrediente!=null){
num=this.arrayIngrediente.length;
var _17="";
for(var i=0;i<num;i++){
var _19=this.valorAtributoPrincipalProducto.valorAtributoPrincipal.atributoPrincipal.codigo;
var _1a=this.valorAtributoPrincipalProducto.valorAtributoPrincipal.codigo;
var _1b=1;
this.arrayIngrediente[i].valorAtributoPrincipalProducto=this.arrayIngrediente[i].componente.buscarValorAtributoPrincipalProducto(_19,_1a,_1b);
_17=_17+this.arrayIngrediente[i].getXML(i);
}
_14=_14+getXML("arrayIngrediente",TAG_TIPO_DATO_ARRAY,"ComponenteProductoPedidoBean",_17);
}
}
}
if(this.arrayOtroAdicional!=null){
num=this.arrayOtroAdicional.length;
var _17="";
for(var i=0;i<num;i++){
_17=_17+this.arrayOtroAdicional[i].getXML(i);
}
_14=_14+getXML("arrayOtroAdicional",TAG_TIPO_DATO_ARRAY,"ComponenteProductoPedidoBean",_17);
}
if(this.arrayIngredienteCompuesto!=null){
var _1e;
var _17="";
this.arrayComponente=new Array();
num=this.arrayIngredienteCompuesto.length;
for(var i=0;i<num;i++){
if(this.indicadorIngrediente==HABILITADO){
this.arrayIngredienteCompuesto[i].indicadorIngrediente=HABILITADO;
}
this.valorAtributoPrincipalProducto.parte=this.cantidadIngredienteOriginal;
_17=_17+this.arrayIngredienteCompuesto[i].getXML(i);
}
_14=_14+getXML("arrayIngredienteCompuesto",TAG_TIPO_DATO_ARRAY,"ProductoPedidoNormalEstaticoImpl",_17);
}
if(this.codigoTipoProducto==PRODUCTO_NORMAL_ESTATICO){
xml=xml+getXML(_12,TAG_TIPO_DATO_OBJETO,"ProductoPedidoNormalEstaticoImpl",_14);
}
if(this.codigoTipoProducto==PRODUCTO_NORMAL_DINAMICO){
xml=xml+getXML(_12,TAG_TIPO_DATO_OBJETO,"ProductoPedidoNormalDinamicoImpl",_14);
}
if(this.codigoTipoProducto==PRODUCTO_COMPUESTO_PARTES){
xml=xml+getXML(_12,TAG_TIPO_DATO_OBJETO,"ProductoPedidoCompuestoPartesImpl",_14);
}
if(this.codigoTipoProducto==PRODUCTO_OFERTA_X_POR_Y){
xml=xml+getXML(_12,TAG_TIPO_DATO_OBJETO,"ProductoPedidoOfertaXporYImpl",_14);
}
return xml;
}
function buscarMatrizValorAtributoProductoPC(_1f,_20,_21,_22){
var num;
var _24;
var _25=null;
var _26;
var _27;
var _28;
var _29;
_24=this.arrayMatrizValorAtributoProducto;
if(_24!=null){
num=_24.length;
for(var i=0;i<num;i++){
_26=_24[i].matrizValorAtributo.valorAtributoPrincipal.codigo;
_27=_24[i].matrizValorAtributo.valorAtributoPrincipal.atributoPrincipal.codigo;
_28=_24[i].matrizValorAtributo.valorAtributoSecundario.atributoSecundario.codigo;
_29=_24[i].matrizValorAtributo.valorAtributoSecundario.codigo;
if(_26==_20&&_27==_1f&&_28==_21&&_29==_22){
_25=_24[i];
break;
}
}
}
return _25;
}
function iniciarPNEPC(_2b){
var num;
var _2d;
this.producto=_2b;
this.restaurante=_2b.restaurante;
this.codigoTipoProducto=_2b.codigoTipoProducto;
this.indicadorSustitucionIngrediente=_2b.indicadorSustitucionIngrediente;
this.cantidadIngredienteOriginal=_2b.cantidadIngredienteOriginal;
this.local=_2b.productoLocalActual.local;
if(_2b.productoLocalActual.arrayValorAtributoPrincipalProductoLocal!=null){
this.valorAtributoPrincipalProductoLocal=_2b.productoLocalActual.arrayValorAtributoPrincipalProductoLocal[0];
}
if(_2b.arrayValorAtributoPrincipalProducto!=null){
this.valorAtributoPrincipalProducto=_2b.arrayValorAtributoPrincipalProducto[0];
}
if(_2b.arrayIngrediente==null){
return;
}
this.arrayIngrediente=new Array();
num=_2b.arrayIngrediente.length;
for(var i=0;i<num;i++){
_2d=new ComponenteCliente();
_2d.componente=_2b.arrayIngrediente[i];
_2d.cantidad=_2b.arrayIngrediente[i].numeroVeces;
_2d.precio=0;
this.arrayIngrediente.push(_2d);
}
}
function migrarAtributoSecundarioPC(_2f){
var _30=this.valorAtributoPrincipalProductoLocal.valorAtributoPrincipal.atributoPrincipal.codigo;
var _31=this.valorAtributoPrincipalProductoLocal.valorAtributoPrincipal.codigo;
var _32=this.arrayMatrizValorAtributoProducto;
if(_32==null){
return;
}
var _33;
var _34;
var _35;
var num=_32.length;
this.arrayMatrizValorAtributoProducto=new Array();
for(var i=0;i<num;i++){
_34=_32[i].matrizValorAtributo.valorAtributoSecundario.atributoSecundario.codigo;
_33=_32[i].matrizValorAtributo.valorAtributoSecundario.codigo;
if(_33!=null&&_33!=" "){
}
_35=_2f.buscarMatrizValorAtributoProducto(_30,_31,_34,_33);
if(_35!=null){
this.arrayMatrizValorAtributoProducto.push(_35);
}
}
}
function buscarIngredienteAdicionalPorCodigoPC(_38){
var _39=null;
var num;
var i;
if(this.arrayIngredienteAdicional!=null){
num=this.arrayIngredienteAdicional.length;
for(var i=0;i<num;i++){
if(this.arrayIngredienteAdicional[i].componente.componente.codigo==_38){
_39=this.arrayIngredienteAdicional[i];
break;
}
}
}
return _39;
}
function buscarIngredientePorCodigoPC(_3c){
var _3d=null;
var num;
var i;
if(this.arrayIngrediente!=null){
num=this.arrayIngrediente.length;
for(var i=0;i<num;i++){
if(this.arrayIngrediente[i].componente.componente.codigo==_3c){
_3d=this.arrayIngrediente[i];
break;
}
}
}
return _3d;
}
function agregarIngredienteAdicionalPC(_40){
var _41=_40.componente.codigo;
var _42=null;
var _43=null;
_42=this.buscarIngredientePorCodigo(_41);
if(_42==null){
_42=this.buscarIngredienteAdicionalPorCodigo(_41);
if(_42==null){
_43=new ComponenteCliente();
_43.componente=_40;
_43.cantidad=1;
if(this.arrayIngredienteAdicional==null){
this.arrayIngredienteAdicional=new Array();
}
this.arrayIngredienteAdicional.push(_43);
}else{
_42.cantidad=_42.cantidad+1;
}
}else{
_42.cantidad=_42.cantidad+1;
}
}
function eliminarDisponiblePC(_44){
var _45=null;
var _46;
_45=this.buscarIngredientePorCodigo(_44);
if(_45==null){
_45=this.buscarDisponiblePorCodigo(_44);
if(_45!=null){
if(_45.cantidad==1){
_46=this.buscarIndiceDisponiblePorCodigo(_44);
this.arrayIngredienteAdicional.splice(_46,1);
}
if(_45.cantidad>1){
_45.cantidad=_45.cantidad-1;
}
}
}else{
if(_45.cantidad>0){
_45.cantidad=_45.cantidad-1;
}
}
}
function buscarIndiceDisponiblePorCodigoPC(_47){
var _48=null;
var num;
if(this.arrayIngredienteAdicional!=null){
num=this.arrayIngredienteAdicional.length;
for(var i=0;i<num;i++){
if(this.arrayIngredienteAdicional[i].componente.componente.codigo==_47){
_48=i;
break;
}
}
}
return _48;
}
function buscarArrayIngredienteNoSustituidoPC(){
var _4b=null;
var num;
if(this.arrayIngrediente!=null){
num=this.arrayIngrediente.length;
_4b=new Array();
for(var i=0;i<num;i++){
if(this.arrayIngrediente[i].cantidad<this.arrayIngrediente[i].componente.numeroVeces){
_4b.push(this.arrayIngrediente[i]);
}
}
}
if(_4b.length==0){
_4b=null;
}
return _4b;
}
function buscarArrayIngredienteSustituyentePC(){
var _4e=null;
var num;
if(this.arrayIngrediente!=null){
num=this.arrayIngrediente.length;
_4e=new Array();
for(var i=0;i<num;i++){
if(this.arrayIngrediente[i].cantidad>this.arrayIngrediente[i].componente.numeroVeces){
_4e.push(this.arrayIngrediente[i]);
}
}
}
if(_4e.length==0){
_4e=null;
}
return _4e;
}
function sustituirPC(_51){
var _52;
var _53;
var _54;
var _55;
var _56;
var _57;
var _58;
var _59;
var _5a=1;
var _5b=this.valorAtributoPrincipalProducto.valorAtributoPrincipal.atributoPrincipal.codigo;
if(this.indicadorSustitucionIngrediente!=HABILITADO){
return;
}
this.iniciarCantidadSustitucion(this.arrayIngredienteAdicional);
this.iniciarCantidadSustitucion(this.arrayIngrediente);
if(this.arrayIngrediente==null){
return;
}
_54=this.buscarArrayIngredienteNoSustituido();
_55=this.buscarArrayIngredienteSustituyente();
if(_54==null){
return;
}
if(_55!=null){
_52=_55.length;
_53=_54.length;
for(var i=0;i<_53;i++){
for(var j=0;j<_52;j++){
_59=_54[i].componente.numeroVeces-_54[i].cantidad-_54[i].cantidadSustitucion;
if(_59==0){
break;
}
_56=_54[i].componente.componente.getPrecioPorCodigoAtributoCodigoValorPorParte(_5b,_51,_5a);
_57=_55[j].componente.componente.getPrecioPorCodigoAtributoCodigoValorPorParte(_5b,_51,_5a);
if(_56==_57){
_58=_55[j].cantidad-_55[j].cantidadSustitucion-_55[j].componente.numeroVeces;
if(_58!=0){
if(_58>=_59){
_55[j].cantidadSustitucion=_55[j].cantidadSustitucion+_59;
_54[i].cantidadSustitucion=_54[i].cantidadSustitucion+_59;
}else{
_55[j].cantidadSustitucion=_55[j].cantidadSustitucion+_58;
_54[i].cantidadSustitucion=_54[i].cantidadSustitucion+_58;
}
}
}
}
}
}
if(this.arrayIngredienteAdicional!=null){
_54=this.buscarArrayIngredienteNoSustituido();
_52=this.arrayIngredienteAdicional.length;
_53=_54.length;
for(var i=0;i<_53;i++){
for(var j=0;j<_52;j++){
_59=_54[i].componente.numeroVeces-_54[i].cantidad-_54[i].cantidadSustitucion;
if(_59==0){
break;
}
_56=_54[i].componente.componente.getPrecioPorCodigoAtributoCodigoValorPorParte(_5b,_51,_5a);
_57=this.arrayIngredienteAdicional[j].componente.componente.getPrecioPorCodigoAtributoCodigoValorPorParte(_5b,_51,_5a);
if(_56==_57){
_58=this.arrayIngredienteAdicional[j].cantidad-this.arrayIngredienteAdicional[j].cantidadSustitucion;
if(_58!=0){
if(_58>=_59){
this.arrayIngredienteAdicional[j].cantidadSustitucion=this.arrayIngredienteAdicional[j].cantidadSustitucion+_59;
_54[i].cantidadSustitucion=_54[i].cantidadSustitucion+_59;
}else{
this.arrayIngredienteAdicional[j].cantidadSustitucion=this.arrayIngredienteAdicional[j].cantidadSustitucion+_58;
_54[i].cantidadSustitucion=_54[i].cantidadSustitucion+_58;
}
}
}
}
}
}
}
function iniciarCantidadSustitucionPC(_5e){
var num;
if(_5e==null){
return;
}
num=_5e.length;
for(var i=0;i<num;i++){
_5e[i].cantidadSustitucion=0;
}
}
function buscarDisponiblePorCodigoPC(_61){
var _62=null;
var num;
var i;
if(this.arrayIngredienteAdicional!=null){
num=this.arrayIngredienteAdicional.length;
for(var i=0;i<num;i++){
if(this.arrayIngredienteAdicional[i].componente.componente.codigo==_61){
_62=this.arrayIngredienteAdicional[i];
break;
}
}
}
return _62;
}
function restituirOriginalPC(_65,_66,_67){
var _68=null;
var _69;
var _6a=0;
_68=this.buscarIngredientePorCodigo(_65);
if(_68!=null){
_6a=this.getCantidadMaximaAgregar(_65,_66,_67);
if(_6a!=0){
if(_6a>=_68.componente.numeroVeces){
_68.cantidad=_68.componente.numeroVeces;
}else{
_68.cantidad=_6a;
}
return true;
}else{
return false;
}
}else{
return false;
}
}
function getPrecioPC(){
if(this.codigoTipoProducto==PRODUCTO_NORMAL_ESTATICO){
return this.getPrecioPNE();
}
if(this.codigoTipoProducto==PRODUCTO_NORMAL_DINAMICO){
return this.getPrecioPND();
}
if(this.codigoTipoProducto==PRODUCTO_COMPUESTO_PARTES){
return this.getPrecioPCP();
}
if(this.codigoTipoProducto==PRODUCTO_COMBO){
return this.getPrecioPC();
}
if(this.codigoTipoProducto==PRODUCTO_OFERTA_X_POR_Y){
return this.getPrecioPOXY();
}
}
function getPrecioTotalPC(){
var _6b=0;
var num;
if(this.codigoTipoProducto!=PRODUCTO_COMBO){
if(this.valorAtributoPrincipalProductoLocal!=null){
_6b=this.getPrecio()*this.cantidad;
}
}else{
_6b=this.getPrecio()*this.cantidad;
}
if(this.arrayComplementario!=null){
num=this.arrayComplementario.length;
for(var i=0;i<num;i++){
_6b=_6b+this.arrayComplementario[i].complementario.valorAtributoPrincipalProductoLocal.precio*this.arrayComplementario[i].cantidad;
}
}
return _6b;
}
function buscarIngredienteAdicionalPartePorCodigoPorPartePC(_6e,_6f){
var _70=null;
var _71;
var num;
if(this.arrayIngredienteAdicionalParte==null){
return null;
}
if(this.arrayIngredienteAdicionalParte[_6f-1]==undefined){
return null;
}
_71=this.arrayIngredienteAdicionalParte[_6f-1];
num=_71.length;
for(var i=0;i<num;i++){
if(_71[i].componente.componente.codigo==_6e){
_70=_71[i];
break;
}
}
return _70;
}
function agregarIngredienteAdicionalPartePC(_74,_75){
var _76;
var _77;
if(this.arrayIngredienteAdicionalParte==null){
this.arrayIngredienteAdicionalParte=new Array(this.valorAtributoPrincipalProducto.parte);
}
if(this.arrayIngredienteAdicionalParte.length!=this.valorAtributoPrincipalProducto.parte){
this.arrayIngredienteAdicionalParte=new Array(this.valorAtributoPrincipalProducto.parte);
}
if(this.arrayIngredienteAdicionalParte[_75-1]==undefined){
this.arrayIngredienteAdicionalParte[_75-1]=new Array();
}
_77=this.buscarIngredienteAdicionalPartePorCodigoPorParte(_74.componente.codigo,_75);
if(_77==null){
elementoTemp2=new ComponenteCliente();
elementoTemp2.componente=_74;
elementoTemp2.cantidad=1;
this.arrayIngredienteAdicionalParte[_75-1].push(elementoTemp2);
}else{
_77.cantidad=_77.cantidad+1;
}
}
function eliminarIngredienteAdicionalPartePC(_78,_79){
var _7a=null;
var _7b;
_7a=this.buscarIngredienteAdicionalPartePorCodigoPorParte(_78,_79);
if(_7a!=null){
if(_7a.cantidad==1){
_7b=this.buscarIndiceIngredienteAdicionalPartePorCodigoPorParte(_78,_79);
this.arrayIngredienteAdicionalParte[_79-1].splice(_7b,1);
}else{
_7a.cantidad=_7a.cantidad-1;
}
}
}
function buscarIndiceIngredienteAdicionalPartePorCodigoPorPartePC(_7c,_7d){
var _7e=null;
var _7f;
var num;
if(this.arrayIngredienteAdicionalParte==null){
return -1;
}
if(this.arrayIngredienteAdicionalParte[_7d-1]==undefined){
return -1;
}
_7f=this.arrayIngredienteAdicionalParte[_7d-1];
num=_7f.length;
for(var i=0;i<num;i++){
if(_7f[i].componente.componente.codigo==_7c){
_7e=i;
break;
}
}
return _7e;
}
function sustituirPartePC(_82){
var _83=this.valorAtributoPrincipalProducto.parte;
var _84=this.valorAtributoPrincipalProducto.valorAtributoPrincipal.codigo;
var _85=null;
for(var _86=1;_86<=_83;_86++){
_85=this.buscarIngredienteAdicionalPartePorCodigoPorParte(_82,_86);
if(_85==null){
return false;
}
}
for(var _86=1;_86<=_83;_86++){
this.eliminarIngredienteAdicionalParte(_82,_86);
}
this.agregarIngredienteAdicional(_85.componente);
return true;
}
function buscarComplementarioPorCodigoPC(_87){
var _88=null;
var num;
if(this.arrayComplementario==null){
return _88;
}
num=this.arrayComplementario.length;
for(var i=0;i<num;i++){
if(this.arrayComplementario[i].complementario.complementario.codigo==_87){
_88=this.arrayComplementario[i];
break;
}
}
return _88;
}
function buscarIndiceComplementarioPorCodigoPC(_8b){
var _8c=-1;
var num;
if(this.arrayComplementario==null){
return _8c;
}
num=this.arrayComplementario.length;
for(var i=0;i<num;i++){
if(this.arrayComplementario[i].complementario.complementario.codigo==_8b){
_8c=i;
break;
}
}
return _8c;
}
function agregarComplementarioPC(_8f,_90){
var _91=null;
if(this.arrayComplementario==null){
this.arrayComplementario=new Array();
}
_91=this.buscarComplementarioPorCodigo(_8f.complementario.codigo);
if(_91!=null){
_91.cantidad=_91.cantidad+_90;
}else{
var _92=new ComplementarioConfigurado();
_92.complementario=_8f;
_92.cantidad=_90;
this.arrayComplementario.push(_92);
}
}
function eliminarComplementarioPC(_93){
var _94=null;
if(this.arrayComplementario==null){
this.arrayComplementario=new Array();
}
_94=this.buscarComplementarioPorCodigo(_93);
if(_94!=null){
if(_94.cantidad==1){
var _95=this.buscarIndiceComplementarioPorCodigo(_93);
this.arrayComplementario.splice(_95,1);
}else{
_94.cantidad=_94.cantidad-1;
}
}
}
function puedeEliminarIngredientePC(_96,_97){
var _98=null;
var num;
var _9a=0;
var _9b=true;
_98=this.buscarIngredientePorCodigo(_96);
if(_98!=null){
num=this.arrayIngrediente.length;
for(var i=0;i<num;i++){
if(this.arrayIngrediente[i].componente.numeroVeces>=this.arrayIngrediente[i].cantidad){
_9a=_9a+this.arrayIngrediente[i].cantidad;
}else{
_9a=_9a+this.arrayIngrediente[i].componente.numeroVeces;
}
}
if(_98.cantidad>_98.componente.numeroVeces){
_9a=_9a+1;
}
if(_9a-1<_97){
_9b=false;
}
}
return _9b;
}
function getCantidadIngredientePC(_9d){
var _9e=null;
var _9f=0;
_9e=this.buscarIngredientePorCodigo(_9d);
if(_9e==null){
_9e=this.buscarIngredienteAdicionalPorCodigo(_9d);
}
if(_9e!=null){
_9f=_9e.cantidad;
}
return _9f;
}
function getCantidadIngredientePartePC(_a0,_a1){
var _a2=null;
var _a3=0;
_a2=this.buscarIngredienteAdicionalPartePorCodigoPorParte(_a0,_a1);
if(_a2!=null){
_a3=elementoTemp2.cantidad;
}
return _a3;
}
function getCantidadTotalIngredientesPC(){
var num;
var _a5=0;
if(this.arrayIngrediente!=null){
num=this.arrayIngrediente.length;
for(var i=0;i<num;i++){
_a5=_a5+this.arrayIngrediente[i].cantidad;
}
}
if(this.arrayIngredienteAdicional!=null){
num=this.arrayIngredienteAdicional.length;
for(var i=0;i<num;i++){
_a5=_a5+this.arrayIngredienteAdicional[i].cantidad;
}
}
return _a5;
}
function getCantidadTotalIngredientesPartePC(_a7){
var _a8=0;
var num;
if(this.arrayIngredienteAdicionalParte==null){
return _a8;
}
if(this.arrayIngredienteAdicionalParte[_a7-1]==undefined){
return _a8;
}
arrayTemp1=this.arrayIngredienteAdicionalParte[_a7-1];
num=arrayTemp1.length;
for(var i=0;i<num;i++){
_a8=_a8+arrayTemp1[i].cantidad;
}
return _a8;
}
function puedeAgregarIngredientePC(_ab,_ac,_ad,_ae){
var _af;
if(this.valorAtributoPrincipalProducto!=undefined){
_af=this.valorAtributoPrincipalProducto.parte;
}else{
_af=this.cantidadIngredienteOriginal;
}
var _b0=this.getCantidadIngrediente(_ab);
if(_ac==0){
for(var i=1;i<=_af;i++){
if(this.getCantidadIngredienteParte(_ab,i)+_b0+1>_ad){
return 1;
}
}
}else{
if(_b0+this.getCantidadIngredienteParte(_ab,_ac)+1>_ad){
return 1;
}
}
var _b2=this.getCantidadTotalIngredientes();
if(_b2+1>_ae){
return 2;
}
if(_ac==0){
for(var i=1;i<=_af;i++){
if(this.getCantidadTotalIngredientesParte(i)+_b2+1>_ae){
return 2;
}
}
}else{
if(this.getCantidadTotalIngredientesParte(_ac)+_b2+1>_ae){
return 2;
}
}
return 0;
}
function getCantidadMaximaAgregarPC(_b3,_b4,_b5){
var _b6;
if(this.valorAtributoPrincipalProducto){
_b6=this.valorAtributoPrincipalProducto.parte;
}else{
_b6=this.cantidadIngredienteOriginal;
}
var _b7=0;
var _b8=0;
var _b9=this.getCantidadIngrediente(_b3);
_b7=_b4;
if(_b5<_b4){
_b7=_b5;
}
if(_b4-_b9<_b7){
_b7=_b4-_b9;
}
for(var i=1;i<=_b6;i++){
_b8=this.getCantidadIngredienteParte(_b3,i);
if(_b8+_b9>=_b4){
return 0;
}else{
if(_b4-_b8-_b9<_b7){
_b7=_b4-_b8-_b9;
}
}
}
var _bb=this.getCantidadTotalIngredientes();
if(_bb>=_b5){
return 0;
}
if(_b5-_bb<_b7){
_b7=_b5-_b9;
}
for(var i=1;i<=_b6;i++){
_b8=this.getCantidadTotalIngredientesParte(i);
if(_b8+_bb>=_b5){
return 0;
}else{
if(_b5-_b8-_bb<_b7){
_b7=_b5-_b8-_bb;
}
}
}
return _b7;
}
function getPrecioMatrizValorAtributoProductoPNEPC(){
var _bc=0;
var num;
if(this.valorAtributoPrincipalProductoLocal!=null){
if(this.arrayMatrizValorAtributoProducto!=null){
num=this.arrayMatrizValorAtributoProducto.length;
for(var i=0;i<num;i++){
_bc=_bc+this.arrayMatrizValorAtributoProducto[i].matrizValorAtributo.precio;
}
}
}
return _bc;
}
function getPrecioIngredientePNEPC(){
var _bf=0;
var _c0;
var num;
var _c2;
if(this.valorAtributoPrincipalProductoLocal!=null){
_c0=this.valorAtributoPrincipalProductoLocal.valorAtributoPrincipal.codigo;
_c2=this.valorAtributoPrincipalProducto.valorAtributoPrincipal.atributoPrincipal.codigo;
if(this.arrayIngrediente!=null&&this.indicadorIngrediente==HABILITADO){
num=this.arrayIngrediente.length;
for(var i=0;i<num;i++){
_bf=_bf+this.arrayIngrediente[i].getPrecioTotalPorCodigoValorPNE(_c2,_c0);
}
}
if(this.arrayIngredienteAdicional!=null&&this.indicadorIngrediente==HABILITADO){
num=this.arrayIngredienteAdicional.length;
for(var i=0;i<num;i++){
_bf=_bf+this.arrayIngredienteAdicional[i].getPrecioTotalPorCodigoValorPNE(_c2,_c0);
}
}
if(this.arrayMatrizValorAtributoProducto!=null){
num=this.arrayMatrizValorAtributoProducto.length;
for(var i=0;i<num;i++){
_bf=_bf+this.arrayMatrizValorAtributoProducto[i].matrizValorAtributo.precio;
}
}
if(this.arrayIngredienteAdicionalParte!=null&&this.indicadorIngredienteParte==HABILITADO){
var _c4=this.valorAtributoPrincipalProducto.parte;
if(this.arrayIngredienteAdicionalParte.length==_c4){
for(var _c5=0;_c5<_c4;_c5++){
if(this.arrayIngredienteAdicionalParte[_c5]!=undefined){
num=this.arrayIngredienteAdicionalParte[_c5].length;
for(var i=0;i<num;i++){
_bf=_bf+this.arrayIngredienteAdicionalParte[_c5][i].getPrecioPorCodigoAtributoCodigoValorPorParte(_c2,_c0,_c4);
}
}
}
}
}
}
return _bf;
}
function getPrecioIngredienteProductoComponentePOXYPC(){
var _c6=0;
var _c7;
var num;
var _c9=this.cantidadMaximaIngrediente;
var _c7=this.valorAtributoPrincipalProductoLocal.valorAtributoPrincipal.codigo;
var _ca=this.valorAtributoPrincipalProducto.valorAtributoPrincipal.atributoPrincipal.codigo;
if(this.valorAtributoPrincipalProductoLocal!=null){
if(this.arrayMatrizValorAtributoProducto!=null){
num=this.arrayMatrizValorAtributoProducto.length;
for(var i=0;i<num;i++){
_c6=_c6+this.arrayMatrizValorAtributoProducto[i].matrizValorAtributo.precio;
}
}
if(this.arrayIngrediente!=null){
num=this.arrayIngrediente.length;
for(var i=0;i<num;i++){
_c6=_c6+this.arrayIngrediente[i].getPrecioTotalPorCodigoValorPCP(_ca,_c7,_c9);
}
}
if(this.arrayIngredienteAdicional!=null){
num=this.arrayIngredienteAdicional.length;
for(var i=0;i<num;i++){
_c6=_c6+this.arrayIngredienteAdicional[i].getPrecioTotalPorCodigoValorPCP(_ca,_c7,1);
}
}
}
return _c6;
}
function getPrecioPNEPC(){
var _cc=0;
if(this.valorAtributoPrincipalProductoLocal!=null){
_cc=this.valorAtributoPrincipalProductoLocal.precio;
_cc=_cc+this.getPrecioIngredientePNE();
}
return _cc;
}
function extraeMayorIngredienteAdicionalPorPrecioPC(_cd){
var _ce=null;
var num;
var _d0=0;
var _d1=0;
var _d2=0;
var _d3=1;
var _d4=null;
var _d5;
if(this.arrayIngredienteAdicional==null){
return null;
}
num=this.arrayIngredienteAdicional.length;
_d5=this.valorAtributoPrincipalProducto.valorAtributoPrincipal.atributoPrincipal.codigo;
for(var i=0;i<num;i++){
_d1=this.arrayIngredienteAdicional[i].componente.componente.getPrecioPorCodigoAtributoCodigoValorPorParte(_d5,_cd,_d3);
if(_d0<_d1){
_d0=_d1;
_d2=i;
}
}
_d4=this.arrayIngredienteAdicional[_d2];
this.arrayIngredienteAdicional.splice(_d2,1);
return _d4;
}
function ordenarArrayIngredienteAdicionalPorPrecioPC(_d7){
var _d8=null;
var _d9=null;
var _da=this.cantidadIngredienteOriginal;
var num;
if(this.arrayIngredienteAdicional==null){
return null;
}
_d8=new Array();
num=this.arrayIngredienteAdicional.length;
for(var i=0;i<num;i++){
_d9=this.extraeMayorIngredienteAdicionalPorPrecio(_d7);
_d9.cantidadSustitucion=0;
if(_da>0){
if(_da>=_d9.cantidad){
_d9.cantidadSustitucion=_d9.cantidad;
_da=_da-_d9.cantidad;
}else{
_d9.cantidadSustitucion=_da;
_da=0;
}
}
_d8.push(_d9);
}
this.arrayIngredienteAdicional=_d8;
}
function getPrecioMatrizValorAtributoProductoPNDPC(){
var _dd=0;
var num;
if(this.valorAtributoPrincipalProductoLocal!=null){
if(this.arrayMatrizValorAtributoProducto!=null){
num=this.arrayMatrizValorAtributoProducto.length;
for(var i=0;i<num;i++){
_dd=_dd+this.arrayMatrizValorAtributoProducto[i].matrizValorAtributo.precio;
}
}
}
return _dd;
}
function getPrecioIngredientePNDPC(){
var _e0=0;
var _e1;
var num;
var _e3;
this.indicadorIngrediente=HABILITADO;
if(this.valorAtributoPrincipalProductoLocal!=null){
_e1=this.valorAtributoPrincipalProductoLocal.valorAtributoPrincipal.codigo;
_e3=this.valorAtributoPrincipalProducto.valorAtributoPrincipal.atributoPrincipal.codigo;
if(this.arrayIngredienteAdicional!=null&&this.indicadorIngrediente==HABILITADO){
num=this.arrayIngredienteAdicional.length;
for(var i=0;i<num;i++){
_e0=_e0+this.arrayIngredienteAdicional[i].getPrecioTotalPorCodigoValorPND(_e3,_e1);
}
}
if(this.arrayMatrizValorAtributoProducto!=null){
num=this.arrayMatrizValorAtributoProducto.length;
for(var i=0;i<num;i++){
_e0=_e0+this.arrayMatrizValorAtributoProducto[i].matrizValorAtributo.precio;
}
}
if(this.arrayIngredienteAdicionalParte!=null&&this.indicadorIngredienteParte==HABILITADO){
var _e5=this.valorAtributoPrincipalProducto.parte;
if(this.arrayIngredienteAdicionalParte.length==_e5){
for(var _e6=0;_e6<_e5;_e6++){
if(this.arrayIngredienteAdicionalParte[_e6]!=undefined){
num=this.arrayIngredienteAdicionalParte[_e6].length;
for(var i=0;i<num;i++){
_e0=_e0+this.arrayIngredienteAdicionalParte[_e6][i].getPrecioPorCodigoAtributoCodigoValorPorParte(_e3,_e1,_e5);
}
}
}
}
}
}
return _e0;
}
function getPrecioPNDPC(){
var _e7=0;
if(this.valorAtributoPrincipalProductoLocal!=null){
_e7=this.valorAtributoPrincipalProductoLocal.precio;
_e7=_e7+this.getPrecioIngredientePND();
}
return _e7;
}
function iniciarPCPPC(_e8){
var num;
var _ea;
this.producto=_e8;
this.restaurante=_e8.restaurante;
this.codigoTipoProducto=_e8.codigoTipoProducto;
if(this.codigoTipoProducto==PRODUCTO_COMPUESTO_PARTES){
this.indicadorSustitucionIngrediente=INHABILITADO;
}else{
if(this.codigoTipoProducto==PRODUCTO_OFERTA_X_POR_Y){
this.indicadorSustitucionIngrediente=_e8.indicadorSustitucionIngrediente;
}
}
this.cantidadIngredienteOriginal=_e8.cantidadIngredienteOriginal;
this.cantidadMaximaIngrediente=_e8.cantidadMaximaIngrediente;
this.indicadorCriterioPrecio=_e8.indicadorCriterioPrecio;
this.precioAutoCalculado=_e8.precioAutoCalculado;
this.local=_e8.productoLocalActual.local;
this.producto.productoLocalActual.producto=_e8;
if(_e8.productoLocalActual.arrayValorAtributoPrincipalProductoLocal!=null){
this.valorAtributoPrincipalProductoLocal=_e8.productoLocalActual.arrayValorAtributoPrincipalProductoLocal[0];
}
if(_e8.arrayValorAtributoPrincipalProducto!=null){
this.valorAtributoPrincipalProducto=_e8.arrayValorAtributoPrincipalProducto[0];
}
}
function agregarIngredienteCompuestoPCPPC(_eb,_ec){
var _ed;
if(this.codigoTipoProducto==PRODUCTO_COMPUESTO_PARTES){
_ed=this.cantidadIngredienteOriginal;
}else{
if(this.codigoTipoProducto==PRODUCTO_OFERTA_X_POR_Y){
_ed=this.cantidadMaximaIngrediente;
}
}
var _ee=null;
if(this.arrayIngredienteCompuesto==null){
this.arrayIngredienteCompuesto=new Array(_ed);
}
if(this.arrayIngredienteCompuesto.length!=_ed){
this.arrayIngredienteCompuesto=new Array(_ed);
}
var _ef=new ProductoConfigurado();
var _f0=this.valorAtributoPrincipalProducto.valorAtributoPrincipal.codigo;
var _f1=this.valorAtributoPrincipalProducto.valorAtributoPrincipal.atributoPrincipal.codigo;
_ef.codigo=_eb.componente.codigo;
_ef.producto=_eb.componente;
_ef.iniciarPNE(_eb.componente);
_ef.indicadorComponenteAgregado=HABILITADO;
_ef.indicadorSustitucionIngrediente=INHABILITADO;
this.arrayIngredienteCompuesto[_ec-1]=_ef;
}
function iniciarIngredienteCompuestoPCPPC(_f2){
var _f3;
if(this.codigoTipoProducto==PRODUCTO_COMPUESTO_PARTES){
_f3=this.cantidadIngredienteOriginal;
}else{
if(this.codigoTipoProducto==PRODUCTO_OFERTA_X_POR_Y){
_f3=this.cantidadMaximaIngrediente;
}
}
var _f4=null;
if(this.arrayIngredienteCompuesto==null){
this.arrayIngredienteCompuesto=new Array(_f3);
}
if(this.arrayIngredienteCompuesto.length!=_f3){
this.arrayIngredienteCompuesto=new Array(_f3);
}else{
if(this.arrayIngredienteCompuesto[0].indicadorComponenteAgregado==HABILITADO){
return;
}
}
for(var _f5=0;_f5<_f3;_f5++){
var _f6=new ProductoConfigurado();
var _f7=this.valorAtributoPrincipalProducto.valorAtributoPrincipal.codigo;
var _f8=this.valorAtributoPrincipalProducto.valorAtributoPrincipal.atributoPrincipal.codigo;
_f6.codigo=_f2.componente.codigo;
_f6.producto=_f2.componente;
_f6.iniciarPNE(_f2.componente);
this.arrayIngredienteCompuesto[_f5]=_f6;
}
}
function getPrecioMatrizValorAtributoProductoPCPPC(){
var _f9=0;
var num;
if(this.valorAtributoPrincipalProductoLocal!=null){
if(this.arrayMatrizValorAtributoProducto!=null){
num=this.arrayMatrizValorAtributoProducto.length;
for(var i=0;i<num;i++){
_f9=_f9+this.arrayMatrizValorAtributoProducto[i].matrizValorAtributo.precio;
}
}
}
return _f9;
}
function getPrecioIngredientePCPPC(){
var _fc=0;
var _fd;
var num;
var _ff;
if(this.codigoTipoProducto==PRODUCTO_COMPUESTO_PARTES){
_ff=this.cantidadIngredienteOriginal;
}else{
if(this.codigoTipoProducto==PRODUCTO_OFERTA_X_POR_Y){
_ff=this.cantidadMaximaIngrediente;
}
}
var _fd=this.valorAtributoPrincipalProductoLocal.valorAtributoPrincipal.codigo;
var _100=this.valorAtributoPrincipalProducto.valorAtributoPrincipal.atributoPrincipal.codigo;
if(this.valorAtributoPrincipalProductoLocal!=null){
if(this.arrayMatrizValorAtributoProducto!=null){
num=this.arrayMatrizValorAtributoProducto.length;
for(var i=0;i<num;i++){
_fc=_fc+this.arrayMatrizValorAtributoProducto[i].matrizValorAtributo.precio;
}
}
if(this.indicadorIngrediente==HABILITADO){
for(var _102=1;_102<=_ff;_102++){
if(this.arrayIngredienteCompuesto[_102-1].arrayIngrediente!=null){
num=this.arrayIngredienteCompuesto[_102-1].arrayIngrediente.length;
for(var i=0;i<num;i++){
_fc=_fc+this.arrayIngredienteCompuesto[_102-1].arrayIngrediente[i].getPrecioTotalPorCodigoValorPCP(_100,_fd,_ff);
}
}
if(this.arrayIngredienteCompuesto[_102-1].arrayIngredienteAdicional!=null){
num=this.arrayIngredienteCompuesto[_102-1].arrayIngredienteAdicional.length;
for(var i=0;i<num;i++){
if(this.codigoTipoProducto==PRODUCTO_COMPUESTO_PARTES){
_fc=_fc+this.arrayIngredienteCompuesto[_102-1].arrayIngredienteAdicional[i].getPrecioTotalPorCodigoValorPCP(_100,_fd,_ff);
}else{
if(this.codigoTipoProducto==PRODUCTO_OFERTA_X_POR_Y){
_fc=_fc+this.arrayIngredienteCompuesto[_102-1].arrayIngredienteAdicional[i].getPrecioTotalPorCodigoValorPCP(_100,_fd,1);
}
}
}
}
}
}
}
return _fc;
}
function getPrecioPCPPC(){
var _103=0;
var _104;
var num;
var _106;
if(this.codigoTipoProducto==PRODUCTO_COMPUESTO_PARTES){
_106=this.cantidadIngredienteOriginal;
}
var _104=this.valorAtributoPrincipalProductoLocal.valorAtributoPrincipal.codigo;
if(this.valorAtributoPrincipalProductoLocal!=null){
if(this.precioAutoCalculado==INHABILITADO){
_103=this.valorAtributoPrincipalProductoLocal.precio;
}else{
var num=this.producto.arrayComponente.length;
for(var i=0;i<_106;i++){
for(var j=0;j<num;j++){
if(this.arrayIngredienteCompuesto[i].codigo==this.producto.arrayComponente[j].componente.codigo){
this.arrayIngredienteCompuesto[i].valorAtributoPrincipalProductoLocal=this.producto.arrayComponente[j].componente.productoLocalActual.buscarValorAtributoPrincipalProductoLocalPorCodigoValor(_104);
this.arrayIngredienteCompuesto[i].valorAtributoPrincipalProducto=this.producto.arrayComponente[j].componente.buscarValorAtributoPrincipalProductoPorCodigoValor(_104);
break;
}
}
if(this.arrayIngredienteCompuesto[i].valorAtributoPrincipalProductoLocal){
if(this.arrayIngredienteCompuesto[i].indicadorComponenteAgregado==1){
_103=_103+this.arrayIngredienteCompuesto[i].valorAtributoPrincipalProductoLocal.precio/_106;
}
}
}
}
_103=_103+this.getPrecioIngredientePCP();
}
return _103;
}
function getPrecioPOXYPC(){
var _109=0;
var _10a=0;
var _10b=0;
var _10c;
var num;
var _10e=0;
var _10f=0;
var _110;
if(this.codigoTipoProducto==PRODUCTO_OFERTA_X_POR_Y){
_110=this.cantidadMaximaIngrediente;
_10e=this.cantidadIngredienteOriginal;
}
var _111=new Array(_110);
var _112=new Array();
var _10c=this.valorAtributoPrincipalProductoLocal.valorAtributoPrincipal.codigo;
if(this.valorAtributoPrincipalProductoLocal!=null){
if(this.precioAutoCalculado==INHABILITADO){
_109=this.valorAtributoPrincipalProductoLocal.precio;
}else{
var num=this.producto.arrayComponente.length;
for(var i=0;i<_110;i++){
for(var j=0;j<num;j++){
if(this.arrayIngredienteCompuesto[i].codigo==this.producto.arrayComponente[j].componente.codigo){
this.arrayIngredienteCompuesto[i].valorAtributoPrincipalProductoLocal=this.producto.arrayComponente[j].componente.productoLocalActual.buscarValorAtributoPrincipalProductoLocalPorCodigoValor(_10c);
this.arrayIngredienteCompuesto[i].valorAtributoPrincipalProducto=this.producto.arrayComponente[j].componente.buscarValorAtributoPrincipalProductoPorCodigoValor(_10c);
break;
}
}
if(this.arrayMatrizValorAtributoProducto!=null){
_10a=0;
var num2=this.arrayMatrizValorAtributoProducto.length;
for(var k=0;k<num2;k++){
_10a=_10a+this.arrayMatrizValorAtributoProducto[k].matrizValorAtributo.precio;
}
}
if(this.arrayIngredienteCompuesto[i].valorAtributoPrincipalProductoLocal){
if(this.arrayIngredienteCompuesto[i].indicadorComponenteAgregado==1){
_109=_10a+this.arrayIngredienteCompuesto[i].valorAtributoPrincipalProductoLocal.precio;
_109=_109+this.arrayIngredienteCompuesto[i].getPrecioIngredienteProductoComponentePOXY();
_111[i]=_109;
}
}
}
}
}
if(this.indicadorCriterioPrecio==TIPO_PRECIO_LAS_Y_MAS_CARAS_VALOR){
_112=_111.sort(ordenarDesc);
for(var i=0;i<_10e;i++){
_10b=_10b+_112[i];
}
}else{
if(this.indicadorCriterioPrecio==TIPO_PRECIO_PROMEDIO_VALOR){
for(var i=0;i<_111.length;i++){
if(_111[i]!=undefined){
_10f=_10f+_111[i];
}
}
_10b=(_10f/_110)*_10e;
}else{
if(this.indicadorCriterioPrecio==TIPO_PRECIO_FIJO_VALOR){
_10b=_109;
}
}
}
return _10b;
}
function esCantidadMinimaIngredienteOriginalPC(_117){
var _118=null;
var num;
var _11a=0;
var _11b=false;
if(this.arrayIngrediente!=null){
num=this.arrayIngrediente.length;
for(var i=0;i<num;i++){
if(this.arrayIngrediente[i].componente.numeroVeces>=this.arrayIngrediente[i].cantidad){
_11a=_11a+this.arrayIngrediente[i].cantidad;
}else{
_11a=_11a+this.arrayIngrediente[i].componente.numeroVeces;
}
}
if(_11a==_117){
_11b=true;
}
}
return _11b;
}
function getPrecioPCPC(){
var _11d=0;
var num;
var _11f=null;
var num2;
var _121=1;
if(this.productoLocal!=null){
_11d=_11d+this.productoLocal.precioCombo;
if(this.arrayIngredienteProductoCombo!=null){
num=this.arrayIngredienteProductoCombo.length;
for(var i=0;i<num;i++){
if(this.arrayIngredienteProductoCombo[i].indicadorProductoConfigurado!=INHABILITADO){
if(this.arrayIngredienteProductoCombo[i].indicadorProductoSeparado==INHABILITADO){
num2=1;
if(this.arrayIngredienteProductoCombo[i].ingredienteProducto!=null){
_121=this.arrayIngredienteProductoCombo[i].ingredienteProducto.cantidad;
}else{
_121=this.arrayIngredienteProductoCombo[i].ingredienteOpcion.cantidad;
}
}else{
if(this.arrayIngredienteProductoCombo[i].ingredienteProducto!=null){
num2=this.arrayIngredienteProductoCombo[i].ingredienteProducto.cantidad;
}else{
num2=this.arrayIngredienteProductoCombo[i].ingredienteOpcion.cantidad;
}
}
for(var j=0;j<num2;j++){
_11f=this.arrayIngredienteProductoCombo[i].arrayProductoConfigurado[j];
if(_11f.codigoTipoProducto==PRODUCTO_NORMAL_ESTATICO){
_11d=_11d+_11f.getPrecioIngredientePNE()*_121;
}
if(_11f.codigoTipoProducto==PRODUCTO_NORMAL_DINAMICO){
_11d=_11d+_11f.getPrecioIngredientePND()*_121;
}
if(_11f.codigoTipoProducto==PRODUCTO_COMPUESTO_PARTES){
_11d=_11d+_11f.getPrecioIngredientePCP()*_121;
}
}
}else{
num2=1;
if(this.arrayIngredienteProductoCombo[i].ingredienteProducto!=null){
_121=this.arrayIngredienteProductoCombo[i].ingredienteProducto.cantidad;
}else{
_121=this.arrayIngredienteProductoCombo[i].ingredienteOpcion.cantidad;
}
for(var j=0;j<num2;j++){
_11f=this.arrayIngredienteProductoCombo[i].arrayProductoConfigurado[j];
if(_11f.codigoTipoProducto==PRODUCTO_NORMAL_ESTATICO){
_11d=_11d+_11f.getPrecioMatrizValorAtributoProductoPNE()*_121;
}
if(_11f.codigoTipoProducto==PRODUCTO_NORMAL_DINAMICO){
_11d=_11d+_11f.getPrecioMatrizValorAtributoProductoPND()*_121;
}
if(_11f.codigoTipoProducto==PRODUCTO_COMPUESTO_PARTES){
_11d=_11d+_11f.getPrecioMatrizValorAtributoProductoPCP()*_121;
}
}
}
}
}
}
return _11d;
}
function iniciarPCPC(_124){
var num;
var num2;
var num3;
var _128;
var _129;
var _12a;
this.productoLocal=_124.productoLocalActual;
if(_124.arrayIngredienteProductoCombo==null){
return;
}
this.codigoTipoProducto=_124.codigoTipoProducto;
this.indicadorTextoAdicional=_124.indicadorTextoAdicional;
this.arrayIngredienteProductoCombo=new Array();
num=_124.arrayIngredienteProductoCombo.length;
for(var i=0;i<num;i++){
var _128=new IngredienteComboConfigurado();
if(_124.arrayIngredienteProductoCombo[i].indicadorTipoIngrediente==INGREDIENTE_COMBO_PRODUCTO){
_128.ingredienteProducto=_124.arrayIngredienteProductoCombo[i].ingredienteProducto;
_128.arrayProductoConfigurado=new Array();
num2=_124.arrayIngredienteProductoCombo[i].ingredienteProducto.cantidad;
for(var j=0;j<num2;j++){
_129=new ProductoConfigurado();
_129.producto=_124.arrayIngredienteProductoCombo[i].ingredienteProducto.ingrediente;
if(_129.producto.codigoTipoProducto==PRODUCTO_NORMAL_ESTATICO||_129.producto.codigoTipoProducto==PRODUCTO_NORMAL_DINAMICO){
_129.iniciarPNE(_129.producto);
_129.valorAtributoPrincipalProducto=_124.arrayIngredienteProductoCombo[i].ingredienteProducto.valorAtributoPrincipalProducto;
}else{
_129.iniciarPCP(_129.producto);
_129.valorAtributoPrincipalProducto=_124.arrayIngredienteProductoCombo[i].ingredienteProducto.valorAtributoPrincipalProducto;
}
_128.arrayProductoConfigurado.push(_129);
}
}else{
num3=_124.arrayIngredienteProductoCombo[i].arrayIngredienteOpcion.length;
_128.ingredienteOpcion=_124.arrayIngredienteProductoCombo[i].arrayIngredienteOpcion[0];
_128.arrayArrayProductoConfigurado=new Array();
for(var y=0;y<num3;y++){
_12a=new Array();
num2=_124.arrayIngredienteProductoCombo[i].arrayIngredienteOpcion[y].cantidad;
for(var j=0;j<num2;j++){
_129=new ProductoConfigurado();
_129.producto=_124.arrayIngredienteProductoCombo[i].arrayIngredienteOpcion[y].ingrediente;
if(_129.producto.codigoTipoProducto==PRODUCTO_NORMAL_ESTATICO||_129.producto.codigoTipoProducto==PRODUCTO_NORMAL_DINAMICO){
_129.iniciarPNE(_129.producto);
_129.valorAtributoPrincipalProducto=_124.arrayIngredienteProductoCombo[i].arrayIngredienteOpcion[y].valorAtributoPrincipalProducto;
}else{
_129.iniciarPCP(_129.producto);
_129.valorAtributoPrincipalProducto=_124.arrayIngredienteProductoCombo[i].arrayIngredienteOpcion[y].valorAtributoPrincipalProducto;
}
_12a.push(_129);
}
_128.arrayArrayProductoConfigurado.push(_12a);
}
_128.arrayProductoConfigurado=_128.arrayArrayProductoConfigurado[0];
}
this.arrayIngredienteProductoCombo.push(_128);
}
}
function getIngredienteProductoPorNumeroOrdenPorNumeroTabPCPC(_12e,_12f){
valor=null;
if(this.arrayIngredienteProductoCombo!=null){
if(this.arrayIngredienteProductoCombo[_12e]!=undefined||this.arrayIngredienteProductoCombo[_12e]!=null){
if(this.arrayIngredienteProductoCombo[_12e].arrayProductoConfigurado!=null){
if(this.arrayIngredienteProductoCombo[_12e].arrayProductoConfigurado[_12f]!=undefined||this.arrayIngredienteProductoCombo[_12e].arrayProductoConfigurado[_12f]!=null){
valor=this.arrayIngredienteProductoCombo[_12e].arrayProductoConfigurado[_12f];
}
}
}
}
return valor;
}
ProductoConfigurado.prototype.getXML=getXMLPC;
ProductoConfigurado.prototype.getPrecioMatrizValorAtributoProductoPNE=getPrecioMatrizValorAtributoProductoPNEPC;
ProductoConfigurado.prototype.getPrecioMatrizValorAtributoProductoPND=getPrecioMatrizValorAtributoProductoPNDPC;
ProductoConfigurado.prototype.getPrecioMatrizValorAtributoProductoPCP=getPrecioMatrizValorAtributoProductoPCPPC;
ProductoConfigurado.prototype.getPrecioPC=getPrecioPCPC;
ProductoConfigurado.prototype.getIngredienteProductoPorNumeroOrdenPorNumeroTabPC=getIngredienteProductoPorNumeroOrdenPorNumeroTabPCPC;
ProductoConfigurado.prototype.iniciarPC=iniciarPCPC;
ProductoConfigurado.prototype.iniciarPCP=iniciarPCPPC;
ProductoConfigurado.prototype.getPrecioPCP=getPrecioPCPPC;
ProductoConfigurado.prototype.getPrecioPOXY=getPrecioPOXYPC;
ProductoConfigurado.prototype.agregarIngredienteCompuestoPCP=agregarIngredienteCompuestoPCPPC;
ProductoConfigurado.prototype.iniciarIngredienteCompuestoPCP=iniciarIngredienteCompuestoPCPPC;
ProductoConfigurado.prototype.extraeMayorIngredienteAdicionalPorPrecio=extraeMayorIngredienteAdicionalPorPrecioPC;
ProductoConfigurado.prototype.ordenarArrayIngredienteAdicionalPorPrecio=ordenarArrayIngredienteAdicionalPorPrecioPC;
ProductoConfigurado.prototype.getPrecioPND=getPrecioPNDPC;
ProductoConfigurado.prototype.getPrecioPNE=getPrecioPNEPC;
ProductoConfigurado.prototype.getCantidadMaximaAgregar=getCantidadMaximaAgregarPC;
ProductoConfigurado.prototype.getCantidadIngredienteParte=getCantidadIngredientePartePC;
ProductoConfigurado.prototype.getCantidadIngrediente=getCantidadIngredientePC;
ProductoConfigurado.prototype.getCantidadTotalIngredientes=getCantidadTotalIngredientesPC;
ProductoConfigurado.prototype.getCantidadTotalIngredientesParte=getCantidadTotalIngredientesPartePC;
ProductoConfigurado.prototype.puedeAgregarIngrediente=puedeAgregarIngredientePC;
ProductoConfigurado.prototype.puedeEliminarIngrediente=puedeEliminarIngredientePC;
ProductoConfigurado.prototype.buscarIndiceComplementarioPorCodigo=buscarIndiceComplementarioPorCodigoPC;
ProductoConfigurado.prototype.eliminarComplementario=eliminarComplementarioPC;
ProductoConfigurado.prototype.buscarComplementarioPorCodigo=buscarComplementarioPorCodigoPC;
ProductoConfigurado.prototype.agregarComplementario=agregarComplementarioPC;
ProductoConfigurado.prototype.sustituirParte=sustituirPartePC;
ProductoConfigurado.prototype.buscarIndiceIngredienteAdicionalPartePorCodigoPorParte=buscarIndiceIngredienteAdicionalPartePorCodigoPorPartePC;
ProductoConfigurado.prototype.eliminarIngredienteAdicionalParte=eliminarIngredienteAdicionalPartePC;
ProductoConfigurado.prototype.agregarIngredienteAdicionalParte=agregarIngredienteAdicionalPartePC;
ProductoConfigurado.prototype.migrarAtributoSecundario=migrarAtributoSecundarioPC;
ProductoConfigurado.prototype.buscarIngredienteAdicionalPorCodigo=buscarIngredienteAdicionalPorCodigoPC;
ProductoConfigurado.prototype.buscarIngredientePorCodigo=buscarIngredientePorCodigoPC;
ProductoConfigurado.prototype.agregarIngredienteAdicional=agregarIngredienteAdicionalPC;
ProductoConfigurado.prototype.eliminarDisponible=eliminarDisponiblePC;
ProductoConfigurado.prototype.buscarIndiceDisponiblePorCodigo=buscarIndiceDisponiblePorCodigoPC;
ProductoConfigurado.prototype.buscarArrayIngredienteNoSustituido=buscarArrayIngredienteNoSustituidoPC;
ProductoConfigurado.prototype.iniciarCantidadSustitucion=iniciarCantidadSustitucionPC;
ProductoConfigurado.prototype.sustituir=sustituirPC;
ProductoConfigurado.prototype.buscarDisponiblePorCodigo=buscarDisponiblePorCodigoPC;
ProductoConfigurado.prototype.restituirOriginal=restituirOriginalPC;
ProductoConfigurado.prototype.iniciarPNE=iniciarPNEPC;
ProductoConfigurado.prototype.getPrecio=getPrecioPC;
ProductoConfigurado.prototype.getPrecioTotal=getPrecioTotalPC;
ProductoConfigurado.prototype.esCantidadMinimaIngredienteOriginal=esCantidadMinimaIngredienteOriginalPC;
ProductoConfigurado.prototype.buscarIngredienteAdicionalPartePorCodigoPorParte=buscarIngredienteAdicionalPartePorCodigoPorPartePC;
ProductoConfigurado.prototype.getPrecioIngredientePCP=getPrecioIngredientePCPPC;
ProductoConfigurado.prototype.getPrecioIngredientePND=getPrecioIngredientePNDPC;
ProductoConfigurado.prototype.getPrecioIngredientePNE=getPrecioIngredientePNEPC;
ProductoConfigurado.prototype.getPrecioIngredienteProductoComponentePOXY=getPrecioIngredienteProductoComponentePOXYPC;
ProductoConfigurado.prototype.buscarMatrizValorAtributoProducto=buscarMatrizValorAtributoProductoPC;
ProductoConfigurado.prototype.pintarGlosaPNE=pintarGlosaPNE;
ProductoConfigurado.prototype.pintarGlosaPCP=pintarGlosaPCP;
ProductoConfigurado.prototype.buscarArrayIngredienteSustituyente=buscarArrayIngredienteSustituyentePC;
function ComponenteCliente(){
this.componente=null;
this.nombre=null;
this.cantidad=0;
this.precio=0;
this.cantidadSustitucion=0;
this.numeroParte=1;
this.cantidadPartes=1;
this.valorAtributoPrincipalProducto=null;
}
function getXMLComponente(_130,_131,_132){
var xml="";
var _134="";
_134=_134+getXML("cantidadPartes",TAG_TIPO_DATO_PRIMITIVO,TAG_TIPO_INTEGER,this.cantidadPartes);
_134=_134+getXML("cantidad",TAG_TIPO_DATO_PRIMITIVO,TAG_TIPO_INTEGER,this.cantidad);
_134=_134+getXML("numeroParte",TAG_TIPO_DATO_PRIMITIVO,TAG_TIPO_INTEGER,this.numeroParte);
_134=_134+getXML("cantidadSustitucion",TAG_TIPO_DATO_PRIMITIVO,TAG_TIPO_INTEGER,this.cantidadSustitucion);
if(this.componente!=null){
_134=_134+this.componente.getXML("componente");
}
if(this.valorAtributoPrincipalProducto!=null){
_134=_134+this.valorAtributoPrincipalProducto.getXML("valorAtributoPrincipalProducto");
}
xml=xml+getXML(_130,TAG_TIPO_DATO_OBJETO,"ComponenteProductoPedidoBean",_134);
return xml;
}
function getPrecioTotalPorCodigoValorPNDCC(_135,_136){
var _137=0;
if(this.componente==null){
return;
}
if(this.componente.componente==null){
return;
}
if(this.componente.componente.arrayValorAtributoPrincipalProducto==null){
return;
}
var _138=1;
_137=this.componente.componente.getPrecioPorCodigoAtributoCodigoValorPorParte(_135,_136,_138);
return _137*(this.cantidad-this.cantidadSustitucion);
}
function getPrecioTotalPorCodigoValorPNECC(_139,_13a){
var _13b=0;
var _13c=0;
if(this.componente==null){
return;
}
if(this.componente.componente==null){
return;
}
if(this.componente.componente.arrayValorAtributoPrincipalProducto==null){
return;
}
var _13d=1;
_13b=this.componente.componente.getPrecioPorCodigoAtributoCodigoValorPorParte(_139,_13a,_13d);
if(this.componente.codigoTipoComponente==1){
_13c=this.cantidad-this.componente.numeroVeces-this.cantidadSustitucion;
if(_13c<0){
_13c=0;
}
}else{
_13c=this.cantidad-this.cantidadSustitucion;
}
return _13b*_13c;
}
function getPrecioTotalPorCodigoValorPCPCC(_13e,_13f,_140){
var _141=0;
var _142=0;
if(this.componente==null){
return;
}
if(this.componente.componente==null){
return;
}
if(this.componente.componente.arrayValorAtributoPrincipalProducto==null){
return;
}
_141=this.componente.componente.getPrecioPorCodigoAtributoCodigoValorPorParte(_13e,_13f,_140);
if(this.componente.codigoTipoComponente==INGREDIENTE){
_142=this.cantidad-this.componente.numeroVeces;
if(_142<0){
_142=0;
}
}else{
_142=this.cantidad-this.cantidadSustitucion;
}
return _141*_142;
}
function getPrecioPorCodigoAtributoCodigoValorPorParteCC(_143,_144,_145){
var _146=0;
if(this.componente==null){
return;
}
if(this.componente.componente==null){
return;
}
if(this.componente.componente.arrayValorAtributoPrincipalProducto==null){
return;
}
_146=this.componente.componente.getPrecioPorCodigoAtributoCodigoValorPorParte(_143,_144,_145);
return _146*this.cantidad;
}
ComponenteCliente.prototype.getXML=getXMLComponente;
ComponenteCliente.prototype.getPrecioTotalPorCodigoValorPCP=getPrecioTotalPorCodigoValorPCPCC;
ComponenteCliente.prototype.getPrecioTotalPorCodigoValorPNE=getPrecioTotalPorCodigoValorPNECC;
ComponenteCliente.prototype.getPrecioTotalPorCodigoValorPND=getPrecioTotalPorCodigoValorPNDCC;
ComponenteCliente.prototype.getPrecioPorCodigoAtributoCodigoValorPorParte=getPrecioPorCodigoAtributoCodigoValorPorParteCC;
function ComplementarioConfigurado(){
this.complementario=null;
this.cantidad=0;
}
function IngredienteComboConfigurado(){
this.arrayProductoConfigurado=null;
this.arrayArrayProductoConfigurado=null;
this.ingredienteOpcion=null;
this.ingredienteProducto=null;
this.indicadorProductoConfigurado=INHABILITADO;
this.indicadorProductoSeparado=INHABILITADO;
}


