https://studio--invoicewise-2e140.us-central1.hosted.app/_next/static/chunks/433-1a76cbc96e3e6547.js
1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[433],{24356:function(e,s,t){t.d(s,{I:function(){return b}});var a=t(57437),l=t(2265),r=t(33145),n=t(64269),c=t(27107),i=t(93292),o=t(93448);let d=e=>"number"!=typeof e?"N/A":new Intl.NumberFormat("es-DO",{style:"currency",currency:"DOP"}).format(e),m=e=>{let s=e.replace(/-/g," ").toUpperCase();return"invoice"===e?"FACTURA":"quote"===e?"COTIZACI\xd3N":"conduce"===e?"CONDUCE":s},x=e=>{if(!e||0===e.length)return[[]];let s=[],t=[],a=0,l=1;for(let r of e){let e=1===l?400:750,n=44+(Math.max(1,Math.ceil(r.description.length/50))-1)*24;a+n>e&&t.length>0&&(s.push(t),t=[],a=0,l++),t.push(r),a+=n}return t.length>0&&s.push(t),0===s.length&&s.push([]),s},h=e=>{let{document:s,company:t}=e;return(0,a.jsxs)("header",{className:"flex justify-between items-start pb-4 border-b-2 border-gray-400",children:[(0,a.jsxs)("div",{children:["tecnolam"===s.company&&(0,a.jsx)(r.default,{src:t.logoUrl,alt:"".concat(t.name," Logo"),width:200,height:80,className:"object-contain"}),(0,a.jsxs)("div",{className:(0,o.cn)("tecnolam"===s.company&&"mt-4"),children:[(0,a.jsx)("h2",{className:"font-bold text-xl",children:t.fullName}),(0,a.jsx)("p",{className:"text-lg whitespace-pre-line mt-1",children:t.address.replace(/\|/g,"\n")}),(0,a.jsxs)("p",{className:"text-lg",children:["RNC: ",t.rnc]})]})]}),(0,a.jsxs)("div",{className:"text-right",children:[(0,a.jsx)("h1",{className:"text-4xl font-bold text-gray-800",children:m(s.type)}),(0,a.jsxs)("div",{className:"mt-4 text-lg space-y-1",children:[(0,a.jsxs)("p",{children:[(0,a.jsx)("span",{className:"font-semibold",children:"No.:"})," ",s.docNumber]}),s.ncf&&(0,a.jsxs)("p",{children:[(0,a.jsx)("span",{className:"font-semibold",children:"NCF:"})," ",s.ncf]}),(0,a.jsxs)("p",{children:[(0,a.jsx)("span",{className:"font-semibold",children:"Fecha:"})," ",(0,c.WU)(s.createdAt,"dd/MM/yyyy")]}),s.poNumber&&(0,a.jsxs)("p",{children:[(0,a.jsx)("span",{className:"font-semibold",children:"Orden de Compra:"})," ",s.poNumber]})]})]})]})},p=e=>{let{document:s}=e;return(0,a.jsxs)("section",{className:"mt-8 mb-4",children:[(0,a.jsx)("h3",{className:"font-semibold text-gray-500 mb-2 uppercase tracking-wider text-base",children:"Cliente"}),(0,a.jsxs)("div",{className:"grid grid-cols-2 gap-x-6 text-lg",children:[(0,a.jsxs)("div",{children:[(0,a.jsxs)("p",{children:[(0,a.jsx)("span",{className:"font-semibold",children:"Nombre:"})," ",s.client.name]}),(0,a.jsxs)("p",{children:[(0,a.jsx)("span",{className:"font-semibold",children:"RNC/C\xe9dula:"})," ",s.client.rnc]})]}),(0,a.jsxs)("div",{children:[(0,a.jsxs)("p",{children:[(0,a.jsx)("span",{className:"font-semibold",children:"Direcci\xf3n:"})," ",s.client.address]}),(0,a.jsxs)("p",{children:[(0,a.jsx)("span",{className:"font-semibold",children:"Tel\xe9fono:"})," ",s.client.phone]})]})]})]})},g=e=>{let{document:s,company:t}=e,l="conduce"!==s.type&&"carta-de-ruta"!==s.type;return"carta-de-ruta"===s.type?(0,a.jsxs)(a.Fragment,{children:[s.cartaDeRutaInfo&&(0,a.jsxs)("section",{className:"mb-4 p-2 border rounded-md text-lg",children:[(0,a.jsx)("h3",{className:"font-bold text-gray-500 mb-1 uppercase tracking-wider",children:"Informaci\xf3n de Transporte"}),(0,a.jsxs)("div",{className:"grid grid-cols-2 gap-x-4",children:[(0,a.jsxs)("p",{className:"col-span-2",children:[(0,a.jsx)("span",{className:"font-semibold",children:"Descripci\xf3n de Uso:"})," ",s.cartaDeRutaInfo.usageDescription]}),(0,a.jsxs)("p",{children:[(0,a.jsx)("span",{className:"font-semibold",children:"Transportista:"})," ",s.cartaDeRutaInfo.carrierName]}),(0,a.jsxs)("p",{children:[(0,a.jsx)("span",{className:"font-semibold",children:"C\xe9dula:"})," ",s.cartaDeRutaInfo.carrierId]}),(0,a.jsxs)("p",{children:[(0,a.jsx)("span",{className:"font-semibold",children:"Veh\xedculo:"})," ",s.cartaDeRutaInfo.vehicle]}),(0,a.jsxs)("p",{children:[(0,a.jsx)("span",{className:"font-semibold",children:"Placa:"})," ",s.cartaDeRutaInfo.licensePlate]}),(0,a.jsxs)("p",{children:[(0,a.jsx)("span",{className:"font-semibold",children:"Fecha Estimada de Entrega:"})," ",(0,c.WU)(s.cartaDeRutaInfo.estimatedDeliveryDate,"PPP",{locale:i.es})]})]})]}),s.comments&&(0,a.jsxs)("section",{className:"mb-4 text-lg",children:[(0,a.jsx)("h3",{className:"font-bold text-gray-500 mb-1 uppercase tracking-wider",children:"Comentarios:"}),(0,a.jsx)("p",{className:"text-gray-700 p-2 border-l-2 border-gray-200 bg-gray-50 italic",children:s.comments})]}),(0,a.jsxs)("footer",{className:"pt-8 flex flex-col items-center text-lg",children:[(0,a.jsx)("div",{className:"w-full mb-2",children:(0,a.jsx)(r.default,{src:"https://blogger.googleusercontent.com/img/a/AVvXsEgh02AH8HKtrfsDGe2mTl-O6ZOAd4JUuh7WOAhUYcwx7jJc6qs4kFn0NzPBjKfzWFS3ZS62oz_h6iHznCXOd-HpxsOZqjVpqsU9jitwAj7oD_4xKVeICpWexxECuXCq_meHY387nFuunY4Ui3JdYLhcgGsFOJhifyHx9ym8d-6Rqm8AWQ-K-F9J5XmmKnFC",alt:"Firma",width:736,height:300,className:"mx-auto h-auto w-full object-contain"})}),(0,a.jsxs)("div",{className:"w-full flex justify-between items-end mt-8 pt-2",children:[(0,a.jsx)("div",{className:"w-2/5 text-center",children:(0,a.jsx)("div",{className:"border-t border-gray-400 pt-1 text-base",children:"Hecho por"})}),(0,a.jsx)("div",{className:"w-2/5 text-center",children:(0,a.jsx)("div",{className:"border-t border-gray-400 pt-1 text-base",children:"Recibido por"})})]})]})]}):(0,a.jsxs)(a.Fragment,{children:[l&&(0,a.jsx)("section",{className:"flex justify-end mb-4",children:(0,a.jsxs)("div",{className:"w-1/3 space-y-2 text-xl",children:[(0,a.jsxs)("div",{className:"flex justify-between",children:[(0,a.jsx)("span",{className:"font-semibold",children:"Subtotal:"}),(0,a.jsx)("span",{children:d(s.subtotal)})]}),(0,a.jsxs)("div",{className:"flex justify-between",children:[(0,a.jsx)("span",{className:"font-semibold",children:"ITBIS (18%):"}),(0,a.jsx)("span",{children:d(s.itbis)})]}),(0,a.jsxs)("div",{className:"flex justify-between font-bold text-2xl border-t pt-2 mt-2 border-gray-400",children:[(0,a.jsx)("span",{children:"Total:"}),(0,a.jsx)("span",{children:d(s.total)})]})]})}),s.comments&&(0,a.jsxs)("section",{className:"mb-4 text-lg",children:[(0,a.jsx)("h3",{className:"font-bold text-gray-500 mb-1 uppercase tracking-wider",children:"Comentarios:"}),(0,a.jsx)("p",{className:"text-gray-700 p-2 border-l-2 border-gray-200 bg-gray-50 italic",children:s.comments})]}),(0,a.jsxs)("footer",{className:"pt-8 flex justify-between items-end text-lg",children:[(0,a.jsxs)("div",{className:"w-1/3 text-center",children:[(0,a.jsx)(r.default,{src:"https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiUrplZfMvlMqVX3nvZJS1LSDCq3oLT8CtUJIS6uJNvXImQT5SH3
1UjeiJd0eccqiMakl7hLtxm6UWX7eXayPkyXrAlCwdh-lFhUQCXYD9gbYgZglNyjTEVx9c70s5nFuABYqlEYklRAWc_Qx2efjxYMJ8CCdiEQemfl5i_MSV7SCz-mWuGmTE2liyRwm7yz/s320/firma%20tommy.png",alt:"Firma",width:324,height:144,className:"mx-auto h-auto max-w-full object-contain",style:{maxHeight:"144px"}}),(0,a.jsx)("p",{className:"border-t border-gray-400 mt-2 pt-1 text-base",children:"Hecho por"})]}),(0,a.jsx)("div",{className:"w-1/3 flex justify-center items-center",children:"tecnolam"===s.company&&(0,a.jsx)(r.default,{src:t.stampUrl,alt:"Sello de la empresa",width:144,height:144,className:"h-36 w-36 object-contain"})}),(0,a.jsxs)("div",{className:"w-1/3 text-center",children:[(0,a.jsx)("div",{className:"h-[144px]"}),(0,a.jsx)("p",{className:"border-t border-gray-400 mt-2 pt-1 text-base",children:"Recibido por"})]})]})]})},u=l.forwardRef((e,s)=>{let{document:t,currentPage:l,totalPages:r}=e,c=n.Z[t.company],i="conduce"!==t.type&&"carta-de-ruta"!==t.type,o=t.items;return(0,a.jsx)("div",{ref:s,children:(0,a.jsxs)("div",{className:"document-page bg-white text-black font-sans shadow-lg w-[816px] h-[1056px] p-10 flex flex-col",children:[(0,a.jsx)("div",{className:"flex-shrink-0",children:1===l&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(h,{document:t,company:c}),(0,a.jsx)(p,{document:t})]})}),(0,a.jsx)("main",{className:"flex-grow min-h-0 overflow-hidden",children:(0,a.jsxs)("table",{className:"w-full text-base",style:{borderCollapse:"collapse"},children:[(0,a.jsx)("thead",{style:{display:"table-header-group"},children:(0,a.jsxs)("tr",{className:"border-b-2 border-t-2 border-gray-300",children:[(0,a.jsx)("th",{className:"p-2 text-left font-bold text-gray-600 w-[55%] text-xl",children:"Descripci\xf3n"}),(0,a.jsx)("th",{className:"p-2 text-center font-bold text-gray-600 w-[15%] text-xl",children:"Cantidad"}),i&&(0,a.jsx)("th",{className:"p-2 text-right font-bold text-gray-600 w-[15%] text-xl",children:"Precio Unit."}),i&&(0,a.jsx)("th",{className:"p-2 text-right font-bold text-gray-600 w-[15%] text-xl",children:"Importe"})]})}),(0,a.jsx)("tbody",{children:o.map(e=>(0,a.jsxs)("tr",{className:"border-b border-gray-200",children:[(0,a.jsx)("td",{className:"p-2 align-top text-lg",children:e.description}),(0,a.jsx)("td",{className:"p-2 align-top text-center text-lg",children:e.quantity}),i&&(0,a.jsx)("td",{className:"p-2 text-right align-top text-lg",children:d(e.price)}),i&&(0,a.jsx)("td",{className:"p-2 text-right align-top text-lg",children:d(e.quantity*e.price)})]},e.id))})]})}),(0,a.jsxs)("div",{className:"flex-shrink-0 pt-4",children:[l===r&&(0,a.jsx)(g,{document:t,company:c}),(0,a.jsxs)("div",{className:"text-center text-sm text-gray-500 pt-2",children:["P\xe1gina ",l," de ",r]})]})]})})});u.displayName="DocumentPreview";var f=t(12381),j=t(82521),N=t(76848);function b(e){let{document:s}=e,t=(0,l.useRef)(null),[r,n]=(0,l.useState)(1),[c,i]=(0,l.useState)(1),d=x(s.items),m=d.length||1;return(0,l.useEffect)(()=>{n(1)},[s]),(0,l.useEffect)(()=>{let e=t.current;if(!e)return;let s=()=>{let{width:s,height:t}=e.getBoundingClientRect();if(0===s||0===t)return;let a=Math.min(s/816,t/1056,1);a>0&&i(a)},a=new ResizeObserver(s);a.observe(e),s();let l=setTimeout(s,150);return()=>{clearTimeout(l),a.disconnect()}},[]),(0,a.jsxs)("div",{className:"w-full h-full flex flex-col bg-gray-200",children:[(0,a.jsx)("div",{ref:t,className:"w-full flex-grow flex justify-center items-center overflow-hidden p-2 md:p-4",children:(0,a.jsx)("div",{style:{width:816*c,height:1056*c},children:(0,a.jsx)("div",{className:"printable-area relative",style:{width:816,height:1056,transform:"scale(".concat(c,")"),transformOrigin:"top left",transition:"transform 0.2s ease-out"},children:d.map((e,t)=>{let l=t+1;return(0,a.jsx)("div",{className:(0,o.cn)("absolute inset-0",r===l?"active-page":"hidden-page"),children:(0,a.jsx)(u,{document:{...s,items:e},currentPage:l,totalPages:m})},l)})})})}),m>1&&(0,a.jsxs)("div",{className:"flex-shrink-0 flex items-center justify-center gap-4 py-4 bg-background border-t no-print",children:[(0,a.jsxs)(f.z,{variant:"outline",size:"icon",onClick:()=>{n(e=>Math.max(e-1,1))},disabled:1===r,children:[(0,a.jsx)(j.Z,{className:"h-4 w-4"}),(0,a.jsx)("span",{className:"sr-only",children:"P\xe1gina anterior"})]}),(0,a.jsxs)("span",{className:"text-sm font-medium tabular-nums",children:["P\xe1gina ",r," de ",m]}),(0,a.jsxs)(f.z,{variant:"outline",size:"icon",onClick:()=>{n(e=>Math.min(e+1,m))},disabled:r===m,children:[(0,a.jsx)(N.Z,{className:"h-4 w-4"}),(0,a.jsx)("span",{className:"sr-only",children:"Siguiente p\xe1gina"})]})]})]})}},79820:function(e,s,t){t.d(s,{Ol:function(){return c},SZ:function(){return o},Zb:function(){return n},aY:function(){return d},ll:function(){return i}});var a=t(57437),l=t(2265),r=t(93448);let n=l.forwardRef((e,s)=>{let{className:t,...l}=e;return(0,a.jsx)("div",{ref:s,className:(0,r.cn)("rounded-lg border bg-card text-card-foreground shadow-sm",t),...l})});
1n.displayName="Card";let c=l.forwardRef((e,s)=>{let{className:t,...l}=e;return(0,a.jsx)("div",{ref:s,className:(0,r.cn)("flex flex-col space-y-1.5 p-6",t),...l})});c.displayName="CardHeader";let i=l.forwardRef((e,s)=>{let{className:t,...l}=e;return(0,a.jsx)("div",{ref:s,className:(0,r.cn)("text-2xl font-semibold leading-none tracking-tight",t),...l})});i.displayName="CardTitle";let o=l.forwardRef((e,s)=>{let{className:t,...l}=e;return(0,a.jsx)("div",{ref:s,className:(0,r.cn)("text-sm text-muted-foreground",t),...l})});o.displayName="CardDescription";let d=l.forwardRef((e,s)=>{let{className:t,...l}=e;return(0,a.jsx)("div",{ref:s,className:(0,r.cn)("p-6 pt-0",t),...l})});d.displayName="CardContent",l.forwardRef((e,s)=>{let{className:t,...l}=e;return(0,a.jsx)("div",{ref:s,className:(0,r.cn)("flex items-center p-6 pt-0",t),...l})}).displayName="CardFooter"},64269:function(e,s,t){t.d(s,{Z:function(){return a}});let a={tecnolam:{id:"tecnolam",name:"Tecnolam",fullName:"SOLUCIONES TECNICAS Y DE MANUFACTURA",rnc:"1-31-99148-3",address:"Tel: 829-408-8841 / 809-438-6201 | Email: [email protected]",logoUrl:"https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj2D_6SODgzubPur2wehqgDgCVJvVeDVVf45idkELaUxFzssQhENPmFdHzlNS9i-MQFo-eA2O87m4jsZ8as84sfFIs_5viBA5KyyOzHWaXMaXcGMihmkr_u04e78UNUY1FTPNxD27ks5vTz-IStvc2YUeJTV_3iU0NC4pFMIJ7Q2huCq77Nh_jzvRbFPZfP/s320/LOGO.2.png",stampUrl:"https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEggOfTNA4jwDgFxKf9HDrMwZ0uCXivZw5ZUkeEs1Btf2pXSPzbMapOuQImV4-NnlZehnvIVz30LAB-LsuD99Nw9Ocq2DmHBtGCQWHAc2qBzKABD3QDx9JV0_oCmcnI44rwYAEDmtxsgHCA6T7W7oDFf5an5tns6gMta1H2BZ-sFPw0Y3PVGqhuG6ofthohk/s1600/sello.png"},workshop:{id:"workshop",name:"Taller J.J.",fullName:"Taller de Mec\xe1nica y Soldadura Juan Jos\xe9 Rodr\xedguez",rnc:"1-31-85474-5",address:"Calle Entrada la Ruta No. 7, Los Cantones, San Crist\xf3bal, RD. | Tel: (809) 288-3450, Cel: (849) 207-0379",logoUrl:"https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj2D_6SODgzubPur2wehqgDgCVJvVeDVVf45idkELaUxFzssQhENPmFdHzlNS9i-MQFo-eA2O87m4jsZ8as84sfFIs_5viBA5KyyOzHWaXMaXcGMihmkr_u04e78UNUY1FTPNxD27ks5vTz-IStvc2YUeJTV_3iU0NC4pFMIJ7Q2huCq77Nh_jzvRbFPZfP/s320/LOGO.2.png",stampUrl:"https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEggOfTNA4jwDgFxKf9HDrMwZ0uCXivZw5ZUkeEs1Btf2pXSPzbMapOuQImV4-NnlZehnvIVz30LAB-LsuD99Nw9Ocq2DmHBtGCQWHAc2qBzKABD3QDx9JV0_oCmcnI44rwYAEDmtxsgHCA6T7W7oDFf5an5tns6gMta1H2BZ-sFPw0Y3PVGqhuG6ofthohk/s1600/sello.png"},montaura:{id:"montaura",name:"Montaura",fullName:"Montaura S & A Dominicana, SRL.",rnc:"1-31-00000-3",address:"C/.Gral Cabral Edif Do\xf1a Marina Apto 304 | Cel.: 809-438-6201/829-408-8841 | Emails.: [email protected]/[email protected]",logoUrl:"https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj2D_6SODgzubPur2wehqgDgCVJvVeDVVf45idkELaUxFzssQhENPmFdHzlNS9i-MQFo-eA2O87m4jsZ8as84sfFIs_5viBA5KyyOzHWaXMaXcGMihmkr_u04e78UNUY1FTPNxD27ks5vTz-IStvc2YUeJTV_3iU0NC4pFMIJ7Q2huCq77Nh_jzvRbFPZfP/s320/LOGO.2.png",stampUrl:"https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEggOfTNA4jwDgFxKf9HDrMwZ0uCXivZw5ZUkeEs1Btf2pXSPzbMapOuQImV4-NnlZehnvIVz30LAB-LsuD99Nw9Ocq2DmHBtGCQWHAc2qBzKABD3QDx9JV0_oCmcnI44rwYAEDmtxsgHCA6T7W7oDFf5an5tns6gMta1H2BZ-sFPw0Y3PVGqhuG6ofthohk/s1600/sello.png"}}}}]);
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.