PageSourceSearch

https://app.stoqui.com.br/assets/OrdersReportPDF-X4V0y0_n.js

js stoqui.com.br collected 2026-09-24 11:57:29 UTC 9,840 bytes, 1 lines download raw bytes

1import{j as e}from"./mui-CRsYZxVY.js";import{StyleSheet as M,Document as E,Page as O,View as o,Image as u,Text as l}from"./react-pdf.browser-1EhQzxMi.js";import{cF as f,bo as T,d4 as C,bp as k}from"./index-TALscxEc.js";import{s as j}from"./stoqui_logo-C1JOQLy2.js";import"./vendor-Dwao9eNC.js";import"./index-BNv7yOC_.js";import"./query-8ViTdhdk.js";import"./datePickers-BIJXYOKG.js";import"./icons-D8aatgQ4.js";import"./lab-DSem1Osk.js";(function(){try{var n=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};n.SENTRY_RELEASE={id:"2ad85febf9735404429b0670d4acf56a0af5a0a2"}}catch{}})();try{(function(){var n=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},s=new n.Error().stack;s&&(n._sentryDebugIds=n._sentryDebugIds||{},n._sentryDebugIds[s]="3a2a549a-eb46-4ec4-8b7d-ba46996e260f",n._sentryDebugIdIdentifier="sentry-dbid-3a2a549a-eb46-4ec4-8b7d-ba46996e260f")})()}catch{}const w=n=>n?[".png",".jpg",".jpeg"].some(a=>n.toLowerCase().includes(a)):!1,t=M.create({page:{flexDirection:"column",backgroundColor:"#ffffff",paddingTop:"10mm",paddingLeft:"10mm",paddingRight:"10mm",paddingBottom:"18mm",fontFamily:"Helvetica",fontSize:8,color:"#000000"},header:{flexDirection:"row",justifyContent:"space-between",alignItems:"flex-start",marginBottom:12,paddingBottom:8,borderBottom:"1pt solid #ddd"},headerLeft:{flexDirection:"column",gap:2},logo:{height:30,maxWidth:100,objectFit:"contain",marginBottom:4},reportTitle:{fontSize:14,fontWeight:"bold",color:"#333"},reportSubtitle:{fontSize:9,color:"#666",marginTop:2},headerRight:{alignItems:"flex-end"},dateText:{fontSize:8,color:"#666"},tableHeader:{flexDirection:"row",backgroundColor:"#f5f5f5",borderBottom:"1pt solid #ddd",paddingVertical:4,paddingHorizontal:4},tableRow:{flexDirection:"row",borderBottom:"1pt solid #eee",paddingVertical:3,paddingHorizontal:4,minHeight:18},tableRowAlt:{backgroundColor:"#fafafa"},headerCell:{fontSize:7,fontWeight:"bold",color:"#333"},cell:{fontSize:7,color:"#333"},colDate:{width:"13%"},colOrder:{width:"7%"},colCustomer:{width:"24%"},colStatus:{width:"10%"},colPaymentStatus:{width:"10%"},colItems:{width:"6%"},colTotal:{width:"15%"},colPaid:{width:"15%"},stoquiLogo:{height:14,objectFit:"contain"},monthlySummary:{marginTop:6,marginBottom:6,padding:6,backgroundColor:"#f8f9fa",borderRadius:4},monthlySummaryTitle:{fontSize:9,fontWeight:"bold",color:"#333",marginBottom:3},monthlySummaryRow:{flexDirection:"row",justifyContent:"space-between",marginBottom:2},monthlySummaryText:{fontSize:8,color:"#555"},monthlySummaryValue:{fontSize:8,fontWeight:"bold",color:"#333"},grandTotal:{marginTop:12,padding:10,backgroundColor:"#f5f5f5",borderRadius:4,borderLeft:"3pt solid #333"},grandTotalTitle:{fontSize:11,fontWeight:"bold",color:"#333",marginBottom:6},grandTotalRow:{flexDirection:"row",justifyContent:"space-between",marginBottom:3},grandTotalText:{fontSize:9,color:"#333"},grandTotalValue:{fontSize:9,fontWeight:"bold",color:"#333"},footer:{position:"absolute",bottom:"6mm",left:"10mm",right:"10mm",paddingTop:4,borderTop:"1pt solid #ddd",flexDirection:"row",justifyContent:"space-between",alignItems:"center"},footerLeft:{flexDirection:"row",alignItems:"center",gap:4},footerText:{fontSize:7,color:"#999"},pageNumber:{fontSize:7,color:"#666"},watermarkContainer:{position:"absolute",top:"50%",left:"15%",opacity:.15,transform:"rotate(-45deg)"},watermarkText:{fontSize:24,fontWeight:"bold",color:"#000"},watermarkLogo:{height:80,marginBottom:12},demoWarning:{color:"#d32f2f",fontSize:8,fontWeight:"bold",textAlign:"center",marginTop:8,marginBottom:4}}),N=n=>{if(!(n.parcelas&&n.parcelas.length>0))return"Não pago";const a=n.parcelas.length,i=n.parcelas.filter(d=>d.status_parcela==="paga").length;return i===a&&a>0?"Pago":i>0?"Parcial":"Não pago"},g=n=>n.toLocaleString("pt-BR",{style:"currency",currency:"BRL"}),W=n=>{const s=new Map;return n.forEach(a=>{const i=f(a.data_pedido),d=T(i,"yyyy-MM");s.has(d)||s.set(d,[]),s.get(d).push(a)}),new Map([...s.entries()].sort((a,i)=>i[0].localeCompare(a[0])))},D=n=>{let s=0,a=0,i=0,d=0;
1return n.forEach(c=>{var h,m;const S=((h=c.frete_pedido)==null?void 0:h.valor_frete)||0,y=c.valor_desconto||0,b=c.taxa_de_venda||0,r=c.subtotal+S+b-y;s+=r,a+=c.total_pago||0,i+=c.total_pendente||r-(c.total_pago||0),d+=((m=c.itens_pedido)==null?void 0:m.reduce((x,p)=>x+p.quantidade,0))||0}),{totalValue:s,totalPaid:a,totalPending:i,totalItems:d,orderCount:n.length}},Q=({orders:n,webCatalog:s,storeUrl:a,isPro:i,dateRange:d})=>{const c=W(n),S=c.size>1,y=D(n),b=[...n].sort((r,h)=>f(h.data_pedido).getTime()-f(r.data_pedido).getTime());return e.jsx(E,{children:e.jsxs(O,{size:"A4",style:t.page,wrap:!0,children:[e.jsxs(o,{style:t.header,children:[e.jsxs(o,{style:t.headerLeft,children:[s!=null&&s.processed_logo_url?e.jsx(u,{src:s.processed_logo_url,style:t.logo}):s!=null&&s.logo_url&&w(s.logo_url)?e.jsx(u,{src:s.logo_url,style:t.logo}):null,e.jsx(l,{style:t.reportTitle,children:"Relatório de pedidos"}),(d==null?void 0:d.label)&&e.jsxs(l,{style:t.reportSubtitle,children:["Período: ",d.label]}),e.jsxs(l,{style:t.reportSubtitle,children:[n.length," pedido(s) encontrado(s)"]})]}),e.jsxs(o,{style:t.headerRight,children:[e.jsxs(l,{style:t.dateText,children:["Gerado em ",T(new Date,"dd/MM/yyyy 'às' HH:mm")]}),e.jsx(l,{style:t.dateText,children:i?a:"stoqui.com.br"})]})]}),e.jsxs(o,{style:t.tableHeader,children:[e.jsx(o,{style:t.colDate,children:e.jsx(l,{style:t.headerCell,children:"DATA/HORA"})}),e.jsx(o,{style:t.colOrder,children:e.jsx(l,{style:t.headerCell,children:"Nº"})}),e.jsx(o,{style:t.colCustomer,children:e.jsx(l,{style:t.headerCell,children:"CLIENTE"})}),e.jsx(o,{style:t.colStatus,children:e.jsx(l,{style:t.headerCell,children:"STATUS"})}),e.jsx(o,{style:t.colPaymentStatus,children:e.jsx(l,{style:t.headerCell,children:"PAGAMENTO"})}),e.jsx(o,{style:t.colItems,children:e.jsx(l,{style:[t.headerCell,{textAlign:"center"}],children:"ITENS"})}),e.jsx(o,{style:t.colTotal,children:e.jsx(l,{style:[t.headerCell,{textAlign:"right"}],children:"TOTAL"})}),e.jsx(o,{style:t.colPaid,children:e.jsx(l,{style:[t.headerCell,{textAlign:"right"}],children:"PAGO"})})]}),b.map((r,h)=>{var _,R,A;const m=f(r.data_pedido),x=N(r),p=((_=r.frete_pedido)==null?void 0:_.valor_frete)||0,P=r.valor_desconto||0,I=r.taxa_de_venda||0,z=r.subtotal+p+I-P,L=((R=r.itens_pedido)==null?void 0:R.reduce((V,B)=>V+B.quantidade,0))||0;return e.jsxs(o,{style:[t.tableRow,h%2===1?t.tableRowAlt:{}],wrap:!1,children:[e.jsx(o,{style:t.colDate,children:e.jsx(l,{style:t.cell,children:T(m,"dd/MM/yy HH:mm")})}),e.jsx(o,{style:t.colOrder,children:e.jsxs(l,{style:t.cell,children:["#",r.numero_pedido||r.pedido_id]})}),e.jsx(o,{style:t.colCustomer,children:e.jsx(l,{style:t.cell,children:(((A=r.cliente)==null?void 0:A.nome)||"Cliente não informado").substring(0,30)})}),e.jsx(o,{style:t.colStatus,children:e.jsx(l,{style:t.cell,children:C(r.status_pedido)})}),e.jsx(o,{style:t.colPaymentStatus,children:e.jsx(l,{style:t.cell,children:x})}),e.jsx(o,{style:t.colItems,children:e.jsx(l,{style:[t.cell,{textAlign:"center"}],children:L})}),e.jsx(o,{style:t.colTotal,children:e.jsx(l,{style:[t.cell,{textAlign:"right"}],children:g(z)})}),e.jsx(o,{style:t.colPaid,children:e.jsx(l,{style:[t.cell,{textAlign:"right"}],children:g(r.total_pago||0)})})]},r.pedido_id)}),S&&e.jsxs(o,{style:{marginTop:16},children:[e.jsx(l,{style:{fontSize:10,fontWeight:"bold",marginBottom:8,color:"#333"},children:"Totais por mês"}),[...c.entries()].map(([r,h])=>{const m=D(h),x=f(`${r}-01`),p=T(x,"MMMM 'de' yyyy",{locale:k});return e.jsxs(o,{style:t.monthlySummary,wrap:!1,children:[e.jsx(l,{style:t.monthlySummaryTitle,children:p.charAt(0).toUpperCase()+p.slice(1)}),e.jsxs(o,{style:t.monthlySummaryRow,children:[e.jsx(l,{style:t.monthlySummaryText,children:"Pedidos:"}),e.jsx(l,{style:t.monthlySummaryValue,children:m.orderCount})]}),e.jsxs(o,{style:t.monthlySummaryRow,children:[e.jsx(l,{style:t.monthlySummaryText,children:"Valor total:"}),e.jsx(l,{style:t.monthlySummaryValue,children:g(m.totalValue)})]}),e.jsxs(o,{style:t.monthlySummaryRow,children:[e.jsx(l,{style:t.monthlySummaryText,children:"Total pago:"}),e.jsx(l,{style:t.monthlySummaryValue,children:g(m.totalPaid)})]})]},r)})]}),e.jsxs(o,{style:t.grandTotal,wrap:!1,children:[e.jsx(l,{style:t.grandTotalTitle,children:"Total geral"}),e.jsxs(o,{style:t.grandTotalRow,children:[e.jsx(l,{style:t.grandTotalText,children:"Total de pedidos:"}),e.jsx(l,{style:t.grandTotalValue,children:y.orderCount})]}),e.jsxs(o,{style:t.grandTotalRow,children:[e.jsx(l,{style:t.grandTotalText,children:"Total de itens:"}),e.jsx(l,{style:t.grandTotalValue,children:y.totalItems})]}),e.jsxs(o,{style:t.grandTotalRow,children:[e.jsx(l,{style:t.grandTotalText,children:"Valor total dos pedidos:"}),e.jsx(l,{style:t.grandTotalValue,children:g(y.totalValue)})]}),e.jsxs(o,{style:t.grandTotalRow,children:[e.jsx(l,{style:t.grandTotalText,children:"Total pago:"}),e.jsx(l,{style:t.grandTotalValue,children:g(y.totalPaid)})]}),e.jsxs(o,{style:t.grandTotalRow,children:[e.jsx(l,{style:t.grandTotalText,children:"Total pendente:"}),e.jsx(l,{style:t.grandTotalValue,children:g(y.totalPending)})]})]}),!i&&e.jsx(l,{style:t.demoWarning,children:"RELATÓRIO APENAS PARA DEMONSTRAÇÃO - Disponível no Stoqui PRO"}),e.jsxs(o,{style:t.footer,fixed:!0,children:[e.jsxs(o,{style:t.footerLeft,children:[w(j)&&e.jsx(u,{src:j,style:t.stoquiLogo}
1),e.jsx(l,{style:t.footerText,children:(s==null?void 0:s.nome_loja)||"Minha loja"})]}),e.jsx(l,{style:t.pageNumber,render:({pageNumber:r,totalPages:h})=>`Página ${r} de ${h}`})]}),!i&&e.jsxs(o,{style:t.watermarkContainer,fixed:!0,children:[w(j)&&e.jsx(u,{src:j,style:t.watermarkLogo}),e.jsx(l,{style:t.watermarkText,children:"VERSÃO DEMONSTRAÇÃO"})]})]})})};export{Q as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.