text: function __processArg(e,i){var t=null;return e&&(t=e[i]||null,delete e[i]),t}function Controller(){function e(){var e=[],t=0,a=consultaCarrinhoPedidoByPedido(p);if(a.isValidRow()){var l=a.fieldByName("cl_razao"),_=a.fieldByName("cl_cnpj"),r=a.fieldByName("crp_forma_pagamento"),d=a.fieldByName("ped_data_pag"),n=a.fieldByName("ped_entrega_prazo"),s=a.fieldByName("ped_entrega"),c=a.fieldByName("cl_end_unid"),I=a.fieldByName("cl_n_unid"),h=a.fieldByName("cl_bairro_unid"),f=a.fieldByName("cl_cidade_unid"),w=a.fieldByName("cl_uf_unid"),v=a.fieldByName("cl_comp_unid"),u=a.fieldByName("cl_cep_unid"),T=a.fieldByName("crp_data"),g=a.fieldByName("desconto"),y=a.fieldByName("desconto_parcela"),b=a.fieldByName("desconto_especial"),E=i(n,s),m=1;if(new RegExp("/").test(d)){var N=d.split("/");m=N.length}var A=c+","+I+"\n"+h+", "+f+" - "+w+"\nComp.:"+v+" CEP: "+u;o.label_razao.text=l,o.label_cnpj.text=_,o.label_forma_pgto.text=r,o.label_parcelas.text=m,o.label_prazo_medio.text="imediato",o.label_prazo_entrega.text=E,o.label_representante.text=Ti.App.Properties.getString(CURRENT_USER_NAME),o.label_endereco.text=A}for(var U=0,C=0,k=0,L=0,x=0,S=0,R=0,g=0;a.isValidRow();){var V,z=a.fieldByName("prd_id"),M=a.fieldByName("prd_referencia"),B=a.fieldByName("prd_nome_colecao"),n=a.fieldByName("ped_entrega_prazo"),s=a.fieldByName("ped_entrega"),P=a.fieldByName("ped_entrega"),O=a.fieldByName("crp_preco_unitario"),G=a.fieldByName("ifp_peso"),D=a.fieldByName("ifp_cub_a"),F=a.fieldByName("ifp_cub_l"),X=a.fieldByName("ifp_cub_p"),$=a.fieldByName("crp_quantidade"),q=a.fieldByName("prd_ipi"),W=a.fieldByName("ped_numero"),E=i(n,s),j=O*$,Y=j*q/100,H=j+Y;k+=G,L+=D,x+=F,S+=X,U+=j,C+=Y,0==t?(V="pedido_lista_escuro",t++):(t=0,V="pedido_lista_claro"),R+=H,e.push({template:V,imagem_produto:{image:getImagesFolder()+selectImagemPrincipal(z)},label_ref:{text:M},label_colecao:{text:B},label_prazo:{text:E},label_tam:{text:P},label_preco:{text:formatCurrency(O)},label_peso:{text:G},label_cubagem:{text:D+" x "+F+" x "+X},label_quantidade:{text:$},label_precototal:{text:formatCurrency(j)},label_ipi:{text:q+"%\n"+formatCurrency(Y)},label_sustrib:{text:"0,00%\n R$ 0,00"},label_valorfinal:{text:formatCurrency(H)}}),a.next()}var J=0;U=U-C-J;var Q=U/m;o.listapedidos.sections[0].setItems(e),o.label_ipi.text=formatCurrency(C),o.label_valor_parcelas.text=formatCurrency(Q),o.label_cubagem.text=L*x*S+" m3",o.label_peso.text=k+" Kg",o.numeroPedido.text="NÚMERO DO PEDIDO: "+W,o.dataPedido.text="DATA: "+T,o.label_total.text="TOTAL: "+formatCurrency(R);var K=R*g/100,Z=R-K,ei=Z*y/100;Z-=ei;var ii=Z*b/100;g=K+ei+ii,Z-=ii,o.label_desconto.text="DESCONTOS: "+formatCurrency(g),o.label_totalcomdesconto.text="TOTAL COM DESCONTOS: "+formatCurrency(Z)}function i(e,i){var t="",o=i.substring(0,4)+"-"+i.substring(4,6)+"-"+i.substring(6,8),a=new Date(o),l=a.getMonth()+1,_=new Date,r=new Date;switch(i="quinzenal"){case"mensal":_=new Date(a.getFullYear(),l,1),r=new Date(a.getFullYear(),l,0),t=l+" mês\n"+_.getDate()+" de "+getMonth(l)+" a "+r.getDate()+" de "+getMonth(l);break;case"semanal":_=a.getDate()-a.getDay(),r=_+6,t=getWeekOfYear(a)+" semana\n"+_+" de "+getMonth(l)+" a "+r+" de "+getMonth(l);break;case"quinzenal":var d=0;if(a.getDate()<=15)d=2*(l+1),_=1,r=15;else{d=2*(l+1)+1,_=16;var n=new Date(a.getFullYear(),l,0);r=n.getDate()}t=getWeekOfYear(a)+" semana\n"+_+" de "+getMonth(l)+" a "+r+" de "+getMonth(l)}return t}function t(){o.window.close()}require("alloy/controllers/BaseController").apply(this,Array.prototype.slice.call(arguments)),this.__controllerPath="detalhe",this.args=arguments[0]||{},arguments[0]&&(__processArg(arguments[0],"__parentSymbol"),__processArg(arguments[0],"$model"),__processArg(arguments[0],"__itemTemplate"));var o=this,a={},l={};o.__views.window=Ti.UI.createWindow({backgroundColor:"#ffffff",id:"window"}),o.__views.window&&o.addTopLevelView(o.__views.window),o.__views.__alloyId339=Ti.UI.createView({height:"10%",top:"0",width:"99%",id:"__alloyId339"}),o.__views.window.add(o.__views.__alloyId339),o.__views.__alloyId340=Ti.UI.createLabel({color:"#008382",font:{fontSize:22},height:"50%",textAlign:Ti.UI.TEXT_ALIGNMENT_CENTER,top:"0%",width:"98%",text:"Informações do pedido",id:"__alloyId340"}),o.__views.__alloyId339.add(o.__views.__alloyId340),o.__views.numeroPedido=Ti.UI.createLabel({color:"#333333",font:{fontSize:15},height:"50%",left:"1%",textAlign:Ti.UI.TEXT_ALIGNMENT_LEFT,top:"50%",width:"48%",id:"numeroPedido"}),o.__views.__alloyId339.add(o.__views.numeroPedido),o.__views.dataPedido=Ti.UI.createLabel({color:"#333333",font:{fontSize:15},height:"50%",right:"1%",textAlign:Ti.UI.TEXT_ALIGNMENT_RIGHT,top:"50%",width:"48%",text:"00/00/0000 às 00:00",id:"dataPedido"}),o.__views.__alloyId339.add(o.__views.dataPedido),o.__views.__alloyId341=Ti.UI.createView({height:"39%",top:"10%",layout:"horizontal",width:"100%",id:"__alloyId341"}),o.__views.window.add(o.__views.__alloyId341),o.__views.__alloyId342=Ti.UI.createView({height:"100%",layout:"vertical",left:"1%",width:"32%",id:"__alloyId342"}),o.__views.__alloyId341.add(o.__views.__alloyId342),o.__views.__alloyId343=Ti.UI.createLabel({backgroundColor:"#ececec",color:"#000000",font:{fontSize:13},textAlign:Ti.UI.TEXT_ALIGNMENT_CENTER,height:"8%",top:"2%",width:"100%",text:"CNPJ",id:"__alloyId343"}),o.__views.__alloyId342.add(o.__views.__alloyId343),o.__views.label_cnpj=Ti.UI.createLabel({backgroundColor:"#ffffff",borderColor:"#a6aaad",borderWidth:"1",color:"#000000",font:{fontSize:13},textAlign:Ti.UI.TEXT_ALIGNMENT_CENTER,height:"10%",width:"100%",id:"label_cnpj"}),o.__views.__alloyId342.add(o.__views.label_cnpj),o.__views.__alloyId344=Ti.UI.createLabel({backgroundColor:"#ececec",color:"#000000",font:{fontSize:13},textAlign:Ti.UI.TEXT_ALIGNMENT_CENTER,height:"8%",top:"2%",width:"100%",text:"RAZÃO SOCIAL",id:"__alloyId344"}),o.__views.__alloyId342.add(o.__views.__alloyId344),o.__views.label_razao=Ti.UI.createLabel({backgroundColor:"#ffffff",borderColor:"#a6aaad",borderWidth:"1",color:"#000000",font:{fontSize:13},textAlign:Ti.UI.TEXT_ALIGNMENT_CENTER,height:"20%",width:"100%",id:"label_razao"}),o.__views.__alloyId342.add(o.__views.label_razao),o.__views.__alloyId345=Ti.UI.createLabel({backgroundColor:"#ececec",color:"#000000",font:{fontSize:13},textAlign:Ti.UI.TEXT_ALIGNMENT_CENTER,height:"8%",top:"2%",width:"100%",text:"ICMS SOMENTE PARA CRÉDITO",id:"__alloyId345"}),o.__views.__alloyId342.add(o.__views.__alloyId345),o.__views.label_icms=Ti.UI.createLabel({backgroundColor:"#ffffff",borderColor:"#a6aaad",borderWidth:"1",color:"#000000",font:{fontSize:13},textAlign:Ti.UI.TEXT_ALIGNMENT_CENTER,height:"10%",width:"100%",text:"R$ 0,00",id:"label_icms"}),o.__views.__alloyId342.add(o.__views.label_icms),o.__views.__alloyId346=Ti.UI.createLabel({backgroundColor:"#ececec",color:"#000000",font:{fontSize:13},textAlign:Ti.UI.TEXT_ALIGNMENT_CENTER,height:"8%",top:"2%",width:"100%",text:"IPI DESTACADO",id:"__alloyId346"}),o.__views.__alloyId342.add(o.__views.__alloyId346),o.__views.label_ipi=Ti.UI.createLabel({backgroundColor:"#ffffff",borderColor:"#a6aaad",borderWidth:"1",color:"#000000",font:{fontSize:13},textAlign:Ti.UI.TEXT_ALIGNMENT_CENTER,height:"10%",width:"100%",id:"label_ipi"}),o.__views.__alloyId342.add(o.__views.label_ipi),o.__views.__alloyId347=Ti.UI.createView({height:"100%",layout:"vertical",left:"1%",width:"32%",id:"__alloyId347"}),o.__views.__alloyId341.add(o.__views.__alloyId347),o.__views.__alloyId348=Ti.UI.createLabel({backgroundColor:"#ececec",color:"#000000",font:{fontSize:13},textAlign:Ti.UI.TEXT_ALIGNMENT_CENTER,height:"8%",top:"2%",width:"100%",text:"FORMA DE PAGAMENTO",id:"__alloyId348"}),o.__views.__alloyId347.add(o.__views.__alloyId348),o.__views.label_forma_pgto=Ti.UI.createLabel({backgroundColor:"#ffffff",borderColor:"#a6aaad",borderWidth:"1",color:"#000000",font:{fontSize:13},textAlign:Ti.UI.TEXT_ALIGNMENT_CENTER,height:"10%",width:"100%",id:"label_forma_pgto"}),o.__views.__alloyId347.add(o.__views.label_forma_pgto),o.__views.__alloyId349=Ti.UI.createLabel({backgroundColor:"#ececec",color:"#000000",font:{fontSize:13},textAlign:Ti.UI.TEXT_ALIGNMENT_CENTER,height:"8%",top:"2%",width:"100%",text:"NÚMERO DE PARCELAS",id:"__alloyId349"}),o.__views.__alloyId347.add(o.__views.__alloyId349),o.__views.label_parcelas=Ti.UI.createLabel({backgroundColor:"#ffffff",borderColor:"#a6aaad",borderWidth:"1",color:"#000000",font:{fontSize:13},textAlign:Ti.UI.TEXT_ALIGNMENT_CENTER,height:"10%",width:"100%",id:"label_parcelas"}),o.__views.__alloyId347.add(o.__views.label_parcelas),o.__views.__alloyId350=Ti.UI.createLabel({backgroundColor:"#ececec",color:"#000000",font:{fontSize:13},textAlign:Ti.UI.TEXT_ALIGNMENT_CENTER,height:"8%",top:"2%",width:"100%",text:"VALOR DAS PARCELAS",id:"__alloyId350"}),o.__views.__alloyId347.add(o.__views.__alloyId350),o.__views.label_valor_parcelas=Ti.UI.createLabel({backgroundColor:"#ffffff",borderColor:"#a6aaad",borderWidth:"1",color:"#000000",font:{fontSize:13},textAlign:Ti.UI.TEXT_ALIGNMENT_CENTER,height:"10%",width:"100%",id:"label_valor_parcelas"}),o.__views.__alloyId347.add(o.__views.label_valor_parcelas),o.__views.__alloyId351=Ti.UI.createLabel({backgroundColor:"#ececec",color:"#000000",font:{fontSize:13},textAlign:Ti.UI.TEXT_ALIGNMENT_CENTER,height:"8%",top:"2%",width:"100%",text:"PRAZO MÉDIO",id:"__alloyId351"}),o.__views.__alloyId347.add(o.__views.__alloyId351),o.__views.label_prazo_medio=Ti.UI.createLabel({backgroundColor:"#ffffff",borderColor:"#a6aaad",borderWidth:"1",color:"#000000",font:{fontSize:13},textAlign:Ti.UI.TEXT_ALIGNMENT_CENTER,height:"10%",width:"100%",id:"label_prazo_medio"}),o.__views.__alloyId347.add(o.__views.label_prazo_medio),o.__views.__alloyId352=Ti.UI.createLabel({backgroundColor:"#ececec",color:"#000000",font:{fontSize:13},textAlign:Ti.UI.TEXT_ALIGNMENT_CENTER,height:"8%",top:"2%",width:"100%",text:"REPRESENTANTE",id:"__alloyId352"}),o.__views.__alloyId347.add(o.__views.__alloyId352),o.__views.label_representante=Ti.UI.createLabel({backgroundColor:"#ffffff",borderColor:"#a6aaad",borderWidth:"1",color:"#000000",font:{fontSize:13},textAlign:Ti.UI.TEXT_ALIGNMENT_CENTER,height:"10%",width:"100%",id:"label_representante"}),o.__views.__alloyId347.add(o.__views.label_representante),o.__views.__alloyId353=Ti.UI.createView({height:"100%",layout:"vertical",left:"1%",width:"32%",id:"__alloyId353"}),o.__views.__alloyId341.add(o.__views.__alloyId353),o.__views.__alloyId354=Ti.UI.createLabel({backgroundColor:"#ececec",color:"#000000",font:{fontSize:13},textAlign:Ti.UI.TEXT_ALIGNMENT_CENTER,height:"8%",top:"2%",width:"100%",text:"PRAZO DE ENTREGA",id:"__alloyId354"}),o.__views.__alloyId353.add(o.__views.__alloyId354),o.__views.label_prazo_entrega=Ti.UI.createLabel({backgroundColor:"#ffffff",borderColor:"#a6aaad",borderWidth:"1",color:"#000000",font:{fontSize:13},textAlign:Ti.UI.TEXT_ALIGNMENT_CENTER,height:"20%",width:"100%",id:"label_prazo_entrega"}),o.__views.__alloyId353.add(o.__views.label_prazo_entrega),o.__views.__alloyId355=Ti.UI.createLabel({backgroundColor:"#ececec",color:"#000000",font:{fontSize:13},textAlign:Ti.UI.TEXT_ALIGNMENT_CENTER,height:"8%",top:"2%",width:"100%",text:"CUBAGEM",id:"__alloyId355"}),o.__views.__alloyId353.add(o.__views.__alloyId355),o.__views.label_cubagem=Ti.UI.createLabel({backgroundColor:"#ffffff",borderColor:"#a6aaad",borderWidth:"1",color:"#000000",font:{fontSize:13},textAlign:Ti.UI.TEXT_ALIGNMENT_CENTER,height:"10%",width:"100%",id:"label_cubagem"}),o.__views.__alloyId353.add(o.__views.label_cubagem),o.__views.__alloyId356=Ti.UI.createLabel({backgroundColor:"#ececec",color:"#000000",font:{fontSize:13},textAlign:Ti.UI.TEXT_ALIGNMENT_CENTER,height:"8%",top:"2%",width:"100%",text:"PESO",id:"__alloyId356"}),o.__views.__alloyId353.add(o.__views.__alloyId356),o.__views.label_peso=Ti.UI.createLabel({backgroundColor:"#ffffff",borderColor:"#a6aaad",borderWidth:"1",color:"#000000",font:{fontSize:13},textAlign:Ti.UI.TEXT_ALIGNMENT_CENTER,height:"10%",width:"100%",id:"label_peso"}),o.__views.__alloyId353.add(o.__views.label_peso),o.__views.__alloyId357=Ti.UI.createLabel({backgroundColor:"#ececec",color:"#000000",font:{fontSize:13},textAlign:Ti.UI.TEXT_ALIGNMENT_CENTER,height:"8%",top:"2%",width:"100%",text:"ENDEREÇO DE ENTREGA",id:"__alloyId357"}),o.__views.__alloyId353.add(o.__views.__alloyId357),o.__views.label_endereco=Ti.UI.createLabel({backgroundColor:"#ffffff",borderColor:"#a6aaad",borderWidth:"1",color:"#000000",font:{fontSize:13},textAlign:Ti.UI.TEXT_ALIGNMENT_CENTER,height:"20%",width:"100%",id:"label_endereco"}),o.__views.__alloyId353.add(o.__views.label_endereco),o.__views.__alloyId358=Ti.UI.createView({height:"36%",top:"50%",width:"99%",id:"__alloyId358"}),o.__views.window.add(o.__views.__alloyId358),o.__views.__alloyId359=Ti.UI.createView({backgroundColor:"#008382",height:"12%",font:{fontSize:15},top:"0%",color:"#008382",width:"100%",layout:"horizontal",id:"__alloyId359"}),o.__views.__alloyId358.add(o.__views.__alloyId359),o.__views.__alloyId360=Ti.UI.createLabel({textAlign:Ti.UI.TEXT_ALIGNMENT_CENTER,backgroundColor:"#008382",color:"#ffffff",font:{fontSize:13},height:"100%",width:"7%",text:"Produto",id:"__alloyId360"}),o.__views.__alloyId359.add(o.__views.__alloyId360),o.__views.__alloyId361=Ti.UI.createView({width:1,height:"100%",backgroundColor:"black",id:"__alloyId361"}),o.__views.__alloyId359.add(o.__views.__alloyId361),o.__views.__alloyId362=Ti.UI.createLabel({textAlign:Ti.UI.TEXT_ALIGNMENT_CENTER,backgroundColor:"#008382",color:"#ffffff",font:{fontSize:13},height:"100%",width:"7%",text:"Marca / Ref.",id:"__alloyId362"}),o.__views.__alloyId359.add(o.__views.__alloyId362),o.__views.__alloyId363=Ti.UI.createView({width:1,height:"100%",backgroundColor:"black",id:"__alloyId363"}),o.__views.__alloyId359.add(o.__views.__alloyId363),o.__views.__alloyId364=Ti.UI.createLabel({textAlign:Ti.UI.TEXT_ALIGNMENT_CENTER,backgroundColor:"#008382",color:"#ffffff",font:{fontSize:13},height:"100%",width:"5%",text:"Coleção",id:"__alloyId364"}),o.__views.__alloyId359.add(o.__views.__alloyId364),o.__views.__alloyId365=Ti.UI.createView({width:1,height:"100%",backgroundColor:"black",id:"__alloyId365"}),o.__views.__alloyId359.add(o.__views.__alloyId365),o.__views.__alloyId366=Ti.UI.createLabel({textAlign:Ti.UI.TEXT_ALIGNMENT_CENTER,backgroundColor:"#008382",color:"#ffffff",font:{fontSize:13},height:"100%",width:"14%",text:"Prazo de entrega",id:"__alloyId366"}),o.__views.__alloyId359.add(o.__views.__alloyId366),o.__views.__alloyId367=Ti.UI.createView({width:1,height:"100%",backgroundColor:"black",id:"__alloyId367"}),o.__views.__alloyId359.add(o.__views.__alloyId367),o.__views.__alloyId368=Ti.UI.createLabel({textAlign:Ti.UI.TEXT_ALIGNMENT_CENTER,backgroundColor:"#008382",color:"#ffffff",font:{fontSize:13},height:"100%",width:"4%",text:"Tam.",id:"__alloyId368"}),o.__views.__alloyId359.add(o.__views.__alloyId368),o.__views.__alloyId369=Ti.UI.createView({width:1,height:"100%",backgroundColor:"black",id:"__alloyId369"}),o.__views.__alloyId359.add(o.__views.__alloyId369),o.__views.__alloyId370=Ti.UI.createLabel({textAlign:Ti.UI.TEXT_ALIGNMENT_CENTER,backgroundColor:"#008382",color:"#ffffff",font:{fontSize:13},height:"100%",width:"7%",text:"Preço Unitário",id:"__alloyId370"}),o.__views.__alloyId359.add(o.__views.__alloyId370),o.__views.__alloyId371=Ti.UI.createView({width:1,height:"100%",backgroundColor:"black",id:"__alloyId371"}),o.__views.__alloyId359.add(o.__views.__alloyId371),o.__views.__alloyId372=Ti.UI.createLabel({textAlign:Ti.UI.TEXT_ALIGNMENT_CENTER,backgroundColor:"#008382",color:"#ffffff",font:{fontSize:13},height:"100%",width:"4%",text:"Peso",id:"__alloyId372"}),o.__views.__alloyId359.add(o.__views.__alloyId372),o.__views.__alloyId373=Ti.UI.createView({width:1,height:"100%",backgroundColor:"black",id:"__alloyId373"}),o.__views.__alloyId359.add(o.__views.__alloyId373),o.__views.__alloyId374=Ti.UI.createLabel({textAlign:Ti.UI.TEXT_ALIGNMENT_CENTER,backgroundColor:"#008382",color:"#ffffff",font:{fontSize:13},height:"100%",width:"13%",text:"Cubagem (A x L x P)",id:"__alloyId374"}),o.__views.__alloyId359.add(o.__views.__alloyId374),o.__views.__alloyId375=Ti.UI.createView({width:1,height:"100%",backgroundColor:"black",id:"__alloyId375"}),o.__views.__alloyId359.add(o.__views.__alloyId375),o.__views.__alloyId376=Ti.UI.createLabel({textAlign:Ti.UI.TEXT_ALIGNMENT_CENTER,backgroundColor:"#008382",color:"#ffffff",font:{fontSize:13},height:"100%",width:"6%",text:"Quantidade",id:"__alloyId376"}),o.__views.__alloyId359.add(o.__views.__alloyId376),o.__views.__alloyId377=Ti.UI.createView({width:1,height:"100%",backgroundColor:"black",id:"__alloyId377"}),o.__views.__alloyId359.add(o.__views.__alloyId377),o.__views.__alloyId378=Ti.UI.createLabel({textAlign:Ti.UI.TEXT_ALIGNMENT_CENTER,backgroundColor:"#008382",color:"#ffffff",font:{fontSize:13},height:"100%",width:"7%",text:"Preço total",id:"__alloyId378"}),o.__views.__alloyId359.add(o.__views.__alloyId378),o.__views.__alloyId379=Ti.UI.createView({width:1,height:"100%",backgroundColor:"black",id:"__alloyId379"}),o.__views.__alloyId359.add(o.__views.__alloyId379),o.__views.__alloyId380=Ti.UI.createLabel({textAlign:Ti.UI.TEXT_ALIGNMENT_CENTER,backgroundColor:"#008382",color:"#ffffff",font:{fontSize:13},height:"100%",width:"7%",text:"IPI",id:"__alloyId380"}),o.__views.__alloyId359.add(o.__views.__alloyId380),o.__views.__alloyId381=Ti.UI.createView({width:1,height:"100%",backgroundColor:"black",id:"__alloyId381"}),o.__views.__alloyId359.add(o.__views.__alloyId381),o.__views.__alloyId382=Ti.UI.createLabel({textAlign:Ti.UI.TEXT_ALIGNMENT_CENTER,backgroundColor:"#008382",color:"#ffffff",font:{fontSize:13},height:"100%",width:"6%",text:"Sus. Trib.",id:"__alloyId382"}),o.__views.__alloyId359.add(o.__views.__alloyId382),o.__views.__alloyId383=Ti.UI.createView({width:1,height:"100%",backgroundColor:"black",id:"__alloyId383"}),o.__views.__alloyId359.add(o.__views.__alloyId383),o.__views.__alloyId384=Ti.UI.createLabel({textAlign:Ti.UI.TEXT_ALIGNMENT_CENTER,backgroundColor:"#008382",color:"#ffffff",font:{fontSize:13},height:"100%",width:"11%",text:"Valor final do produto",id:"__alloyId384"}),o.__views.__alloyId359.add(o.__views.__alloyId384);var r={},d=[],n={type:"Ti.UI.View",childTemplates:function(){var e=[],i={type:"Ti.UI.View",childTemplates:function(){var e=[],i={type:"Ti.UI.ImageView",bindId:"imagem_produto",properties:{height:"95%",bindId:"imagem_produto"}};return e.push(i),e}(),properties:{width:"7%"}};e.push(i);var t={type:"Ti.UI.View",properties:{width:1,height:"100%",backgroundColor:"black"}};e.push(t);var o={type:"Ti.UI.Label",bindId:"label_ref",properties:{textAlign:Ti.UI.TEXT_ALIGNMENT_CENTER,width:"7%",font:{fontSize:13},color:"black",bindId:"label_ref"}};e.push(o);var a={type:"Ti.UI.View",properties:{width:1,height:"100%",backgroundColor:"black"}};e.push(a);var l={type:"Ti.UI.Label",bindId:"label_colecao",properties:{textAlign:Ti.UI.TEXT_ALIGNMENT_CENTER,width:"5%",font:{fontSize:13},color:"black",bindId:"label_colecao"}};e.push(l);var _={type:"Ti.UI.View",properties:{width:1,height:"100%",backgroundColor:"black"}};e.push(_);var r={type:"Ti.UI.Label",bindId:"label_prazo",properties:{textAlign:Ti.UI.TEXT_ALIGNMENT_CENTER,width:"14%",font:{fontSize:13},color:"black",bindId:"label_prazo"}};e.push(r);var d={type:"Ti.UI.View",properties:{width:1,height:"100%",backgroundColor:"black"}};e.push(d);var n={type:"Ti.UI.Label",bindId:"label_tam",properties:{textAlign:Ti.UI.TEXT_ALIGNMENT_CENTER,width:"4%",font:{fontSize:13},color:"black",bindId:"label_tam"}};e.push(n);var s={type:"Ti.UI.View",properties:{width:1,height:"100%",backgroundColor:"black"}};e.push(s);var c={type:"Ti.UI.Label",bindId:"label_preco",properties:{textAlign:Ti.UI.TEXT_ALIGNMENT_CENTER,width:"7%",font:{fontSize:13},color:"black",bindId:"label_preco"}};e.push(c);var I={type:"Ti.UI.View",properties:{width:1,height:"100%",backgroundColor:"black"}};e.push(I);var h={type:"Ti.UI.Label",bindId:"label_peso",properties:{textAlign:Ti.UI.TEXT_ALIGNMENT_CENTER,width:"4%",font:{fontSize:13},color:"black",bindId:"label_peso"}};e.push(h);var f={type:"Ti.UI.View",properties:{width:1,height:"100%",backgroundColor:"black"}};e.push(f);var w={type:"Ti.UI.Label",bindId:"label_cubagem",properties:{textAlign:Ti.UI.TEXT_ALIGNMENT_CENTER,width:"13%",font:{fontSize:13},color:"black",bindId:"label_cubagem"}};e.push(w);var p={type:"Ti.UI.View",properties:{width:1,height:"100%",backgroundColor:"black"}};e.push(p);var v={type:"Ti.UI.Label",bindId:"label_quantidade",properties:{textAlign:Ti.UI.TEXT_ALIGNMENT_CENTER,width:"6%",color:"black",font:{fontSize:13},bindId:"label_quantidade"}};e.push(v);var u={type:"Ti.UI.View",properties:{width:1,height:"100%",backgroundColor:"black"}};e.push(u);var T={type:"Ti.UI.Label",bindId:"label_precototal",properties:{textAlign:Ti.UI.TEXT_ALIGNMENT_CENTER,width:"7%",color:"black",bindId:"label_precototal"}};e.push(T);var g={type:"Ti.UI.View",properties:{width:1,height:"100%",backgroundColor:"black"}};e.push(g);var y={type:"Ti.UI.Label",bindId:"label_ipi",properties:{textAlign:Ti.UI.TEXT_ALIGNMENT_CENTER,width:"7%",color:"black",bindId:"label_ipi"}};e.push(y);var b={type:"Ti.UI.View",properties:{width:1,height:"100%",backgroundColor:"black"}};e.push(b);var E={type:"Ti.UI.Label",bindId:"label_sustrib",properties:{textAlign:Ti.UI.TEXT_ALIGNMENT_CENTER,width:"6%",color:"black",bindId:"label_sustrib"}};e.push(E);var m={type:"Ti.UI.View",properties:{width:1,height:"100%",backgroundColor:"black"}};e.push(m);var N={type:"Ti.UI.Label",bindId:"label_valorfinal",properties:{textAlign:Ti.UI.TEXT_ALIGNMENT_CENTER,width:"12%",color:"black",bindId:"label_valorfinal"}};return e.push(N),e}(),properties:{layout:"horizontal"}};d.push(n);var s={properties:{width:"100%",backgroundColor:"#EBEBEB",height:100,name:"pedido_lista_escuro"},childTemplates:d};r.pedido_lista_escuro=s;var c=[],I={type:"Ti.UI.View",childTemplates:function(){var e=[],i={type:"Ti.UI.View",childTemplates:function(){var e=[],i={type:"Ti.UI.ImageView",bindId:"imagem_produto",properties:{height:"95%",bindId:"imagem_produto"}};return e.push(i),e}(),properties:{width:"7%"}};e.push(i);var t={type:"Ti.UI.View",properties:{width:1,height:"100%",backgroundColor:"black"}};e.push(t);var o={type:"Ti.UI.Label",bindId:"label_ref",properties:{textAlign:Ti.UI.TEXT_ALIGNMENT_CENTER,width:"7%",font:{fontSize:13},color:"black",bindId:"label_ref"}};e.push(o);var a={type:"Ti.UI.View",properties:{width:1,height:"100%",backgroundColor:"black"}};e.push(a);var l={type:"Ti.UI.Label",bindId:"label_colecao",properties:{textAlign:Ti.UI.TEXT_ALIGNMENT_CENTER,width:"5%",font:{fontSize:13},color:"black",bindId:"label_colecao"}};e.push(l);var _={type:"Ti.UI.View",properties:{width:1,height:"100%",backgroundColor:"black"}};e.push(_);var r={type:"Ti.UI.Label",bindId:"label_prazo",properties:{textAlign:Ti.UI.TEXT_ALIGNMENT_CENTER,width:"14%",font:{fontSize:13},color:"black",bindId:"label_prazo"}};e.push(r);var d={type:"Ti.UI.View",properties:{width:1,height:"100%",backgroundColor:"black"}};e.push(d);var n={type:"Ti.UI.Label",bindId:"label_tam",properties:{textAlign:Ti.UI.TEXT_ALIGNMENT_CENTER,width:"4%",font:{fontSize:13},color:"black",bindId:"label_tam"}};e.push(n);var s={type:"Ti.UI.View",properties:{width:1,height:"100%",backgroundColor:"black"}};e.push(s);var c={type:"Ti.UI.Label",bindId:"label_preco",properties:{textAlign:Ti.UI.TEXT_ALIGNMENT_CENTER,width:"7%",font:{fontSize:13},color:"black",bindId:"label_preco"}};e.push(c);var I={type:"Ti.UI.View",properties:{width:1,height:"100%",backgroundColor:"black"}};e.push(I);var h={type:"Ti.UI.Label",bindId:"label_peso",properties:{textAlign:Ti.UI.TEXT_ALIGNMENT_CENTER,width:"4%",font:{fontSize:13},color:"black",bindId:"label_peso"}};e.push(h);var f={type:"Ti.UI.View",properties:{width:1,height:"100%",backgroundColor:"black"}};e.push(f);var w={type:"Ti.UI.Label",bindId:"label_cubagem",properties:{textAlign:Ti.UI.TEXT_ALIGNMENT_CENTER,width:"13%",font:{fontSize:13},color:"black",bindId:"label_cubagem"}};e.push(w);var p={type:"Ti.UI.View",properties:{width:1,height:"100%",backgroundColor:"black"}};e.push(p);var v={type:"Ti.UI.Label",bindId:"label_quantidade",properties:{textAlign:Ti.UI.TEXT_ALIGNMENT_CENTER,width:"6%",color:"black",font:{fontSize:13},bindId:"label_quantidade"}};e.push(v);var u={type:"Ti.UI.View",properties:{width:1,height:"100%",backgroundColor:"black"}};e.push(u);var T={type:"Ti.UI.Label",bindId:"label_precototal",properties:{textAlign:Ti.UI.TEXT_ALIGNMENT_CENTER,width:"7%",color:"black",bindId:"label_precototal"}};e.push(T);var g={type:"Ti.UI.View",properties:{width:1,height:"100%",backgroundColor:"black"}};e.push(g);var y={type:"Ti.UI.Label",bindId:"label_ipi",properties:{textAlign:Ti.UI.TEXT_ALIGNMENT_CENTER,width:"7%",color:"black",bindId:"label_ipi"}};e.push(y);var b={type:"Ti.UI.View",properties:{width:1,height:"100%",backgroundColor:"black"}};e.push(b);var E={type:"Ti.UI.Label",bindId:"label_sustrib",properties:{textAlign:Ti.UI.TEXT_ALIGNMENT_CENTER,width:"6%",color:"black",bindId:"label_sustrib"}};e.push(E);var m={type:"Ti.UI.View",properties:{width:1,height:"100%",backgroundColor:"black"}};e.push(m);var N={type:"Ti.UI.Label",bindId:"label_valorfinal",properties:{textAlign:Ti.UI.TEXT_ALIGNMENT_CENTER,width:"12%",color:"black",bindId:"label_valorfinal"}};return e.push(N),e}(),properties:{layout:"horizontal"}};c.push(I);var h={properties:{width:"100%",backgroundColor:"#FBFBFB",height:100,name:"pedido_lista_claro"},childTemplates:c};r.pedido_lista_claro=h,o.__views.__alloyId504=Ti.UI.createListSection({id:"__alloyId504"});var f=[];f.push(o.__views.__alloyId504),o.__views.listapedidos=Ti.UI.createListView({width:"100%",top:"10%",sections:f,templates:r,id:"listapedidos",defaultItemTemplate:"pedido_lista"}),o.__views.__alloyId358.add(o.__views.listapedidos),o.__views.__alloyId507=Ti.UI.createView({backgroundColor:"#008382",height:"4%",top:"86%",width:"99%",layout:"horizontal",id:"__alloyId507"}),o.__views.window.add(o.__views.__alloyId507),o.__views.label_total=Ti.UI.createLabel({color:"#ffffff",font:{fontSize:13},height:"100%",width:"33%",id:"label_total"}),o.__views.__alloyId507.add(o.__views.label_total),o.__views.__alloyId508=Ti.UI.createView({width:1,height:"100%",backgroundColor:"black",id:"__alloyId508"}),o.__views.__alloyId507.add(o.__views.__alloyId508),o.__views.label_desconto=Ti.UI.createLabel({color:"#ffffff",font:{fontSize:13},height:"100%",width:"33%",id:"label_desconto"}),o.__views.__alloyId507.add(o.__views.label_desconto),o.__views.__alloyId509=Ti.UI.createView({width:1,height:"100%",backgroundColor:"black",id:"__alloyId509"}),o.__views.__alloyId507.add(o.__views.__alloyId509),o.__views.label_totalcomdesconto=Ti.UI.createLabel({color:"#ffffff",font:{fontSize:13},height:"100%",width:"33%",id:"label_totalcomdesconto"}),o.__views.__alloyId507.add(o.__views.label_totalcomdesconto),o.__views.__alloyId510=Ti.UI.createView({backgroundColor:"#59595b",bottom:"1%",height:"7%",width:"99%",id:"__alloyId510"}),o.__views.window.add(o.__views.__alloyId510),o.__views.__alloyId511=Ti.UI.createView({id:"__alloyId511"}),o.__views.__alloyId510.add(o.__views.__alloyId511),o.__views.__alloyId512=Ti.UI.createButton({title:"Voltar",id:"__alloyId512"}),o.__views.__alloyId511.add(o.__views.__alloyId512),t?o.__views.__alloyId512.addEventListener("click",t):l["$.__views.__alloyId512!click!voltar"]=!0,o.__views.__alloyId513=Ti.UI.createView({height:"auto",width:"auto",backgroundColor:"white",layout:"horizontal",id:"__alloyId513"}),o.__views.__alloyId510.add(o.__views.__alloyId513),o.__views.__alloyId514=Ti.UI.createButton({backgroundGradient:{type:"linear",colors:["#2c8f8e","#206764"]},borderRadius:"5",color:"#ffffff",height:"80%",right:"14%",width:"14%",title:"Voltar Pedidos",id:"__alloyId514"}),o.__views.__alloyId510.add(o.__views.__alloyId514),t?o.__views.__alloyId514.addEventListener("click",t):l["$.__views.__alloyId514!click!voltar"]=!0,a.destroy=function(){},_.extend(o,o.__views),Ti.include("/api/config.js"),Ti.include("/database/carrinho.js"),Ti.include("/database/carrinho_pedido.js"),Ti.include("/database/imagens_produtos.js"),Ti.include("/database/pedido.js");var w=arguments[0]||{},p=w.ped_id||0;e(),l["$.__views.__alloyId512!click!voltar"]&&o.__views.__alloyId512.addEventListener("click",t),l["$.__views.__alloyId514!click!voltar"]&&o.__views.__alloyId514.addEventListener("click",t),_.extend(o,a)}var Alloy=require("alloy"),Backbone=Alloy.Backbone,_=Alloy._;module.exports=Controller;