PageSourceSearch

https://portal.tautom.com/_next/static/chunks/pages/invoice/list-2512751aad79ef5d.js

js tautom.com collected 2026-10-02 00:59:12 UTC 13,801 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5411],{43812:function(e,t,l){(window.__NEXT_P=window.__NEXT_P||[]).push(["/invoice/list",function(){return l(4684)}])},49072:function(e,t,l){"use strict";var o=l(85893),n=l(50657),i=l(37645),a=l(15861),r=l(67720),s=l(6514),d=l(31425),c=l(30653);let u=e=>{let{open:t,handleConfirmClose:l,actionButtons:u,objData:h}=e;return(0,o.jsxs)(n.Z,{open:t,onClose:l,children:[(0,o.jsx)(i.Z,{children:(0,o.jsx)(a.Z,{fontWeight:"bold",children:null==h?void 0:h.title})}),(0,o.jsx)(r.Z,{}),(0,o.jsx)(s.Z,{children:(null==h?void 0:h.text)?(0,c.ZP)(null==h?void 0:h.text):"Message"}),(0,o.jsx)(d.Z,{children:u&&null!==u?u:(0,o.jsx)(o.Fragment,{})})]})};t.Z=u},6834:function(e,t,l){"use strict";var o=l(85893),n=l(67294),i=l(41664),a=l.n(i),r=l(99226),s=l(38333),d=l(67720),c=l(18972),u=l(93946),h=l(79878),m=l(28756),x=l(78963);let v=e=>{let{children:t,option:l}=e;return l.href?(0,o.jsx)(r.Z,{component:a(),href:l.href,...l.linkProps,sx:{px:4,py:1.5,width:"100%",display:"flex",color:"inherit",alignItems:"center",textDecoration:"none"},children:t}):(0,o.jsx)(o.Fragment,{children:t})},g=e=>{let{icon:t,options:l,menuProps:i,iconProps:a,leftAlignMenu:r,iconButtonProps:g}=e,[f,b]=(0,n.useState)(null),{settings:p}=(0,m.r)(),{direction:S}=p,C=e=>{b(e.currentTarget)},j=()=>{b(null)},T=e=>{j(),e.onClick&&e.onClick()};return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(u.Z,{"aria-haspopup":"true",onClick:C,...g,children:t||(0,o.jsx)(h.Z,{icon:"tabler:dots-vertical",...a})}),(0,o.jsx)(s.Z,{keepMounted:!0,anchorEl:f,onClose:j,open:!!f,...!r&&{anchorOrigin:{vertical:"bottom",horizontal:"ltr"===S?"right":"left"},transformOrigin:{vertical:"top",horizontal:"ltr"===S?"right":"left"}},...i,children:l.map((e,t)=>"string"==typeof e?(0,o.jsx)(c.Z,{onClick:()=>T(e),children:e},t):"divider"in e?e.divider&&(0,o.jsx)(d.Z,{...e.dividerProps},t):(null==e?void 0:e.subject)&&(null==e?void 0:e.subject)!==null&&(null==e?void 0:e.subject.length)>0?(0,o.jsx)(x.Z,{I:"read",a:null==e?void 0:e.subject,children:(0,o.jsx)(c.Z,{...e.menuItemProps,...e.href&&{sx:{p:0}},onClick:()=>T(e),children:(0,o.jsxs)(v,{option:e,children:[e.icon?e.icon:null,e.text]})},t)},t):(0,o.jsx)(c.Z,{...e.menuItemProps,...e.href&&{sx:{p:0}},onClick:()=>T(e),children:(0,o.jsxs)(v,{option:e,children:[e.icon?e.icon:null,e.text]})},t))})]})};t.Z=g},4684:function(e,t,l){"use strict";l.r(t);var o=l(85893),n=l(67294),i=l(87918),a=l(86886),r=l(66242),s=l(78445),d=l(26447),c=l(18972),u=l(83321),h=l(44267),m=l(99226),x=l(98456),v=l(15861),g=l(62095),f=l(52443),b=l(30381),p=l.n(b),S=l(79878),C=l(6834),j=l(52186),T=l(22233),D=l(80739),Z=l(11163),y=l(69964),N=l(9473),w=l(95715),F=l(49072),I=l(45353),_=l(66476),Y=l(9198),P=l.n(Y);l(459);var E=l(24704),z=l(86501),A=l(78963),O=l(93214);let k=()=>{let e=(0,f.u)(),t=(0,N.I0)(),l=(0,Z.useRouter)(),{logout:b,user:Y}=(0,w.a)(),{id:k}=l.query,{invoiceList:G,invoiceDelete:L}=(0,N.v9)(e=>e.invoiceStore),[M,R]=(0,n.useState)([]),[W,V]=(0,n.useState)(!1),[q,H]=(0,n.useState)({page:0,pageSize:10}),[J,Q]=(0,n.useState)(!1),[B,U]=(0,n.useState)(!1),[X,K]=(0,n.useState)(null),[$,ee]=(0,n.use
1State)(!1),[et,el]=(0,n.useState)({status:"ALL",from_date:p()().startOf("month").format("YYYY-MM-DD"),to_date:p()().endOf("month").format("YYYY-MM-DD")});(0,n.useEffect)(()=>{V(!0);let e={from_date:et.from_date,to_date:et.to_date};et.status&&(e.status=et.status),t((0,y.hs)(e))},[et]),(0,n.useEffect)(()=>{G&&(t((0,y.m1)()),V(!1),G.result?R(G.response):(R([]),401===G.status&&b()))},[G]),(0,n.useEffect)(()=>{L&&(t((0,y.LQ)()),L.result?(U(!1),ee(!1),z.ZP.success("Invoice Deleted successfully"),t((0,y.hs)())):(ee(!1),L.status===E.WY&&b()))},[L]);let eo=async e=>{let l=null==e?void 0:e.quote_json;if(!l){let o=await t((0,y.i3)(e.id)),n=o.payload;if(!(null==n?void 0:n.success)){z.ZP.error("Quotation data not found");return}l=n.data}"string"==typeof l&&(l=JSON.parse(l)),(0,O.O)(l,"preview")},en=async e=>{let l=null==e?void 0:e.quote_json;if(!l){let o=await t((0,y.i3)(e.id)),n=o.payload;if(!(null==n?void 0:n.success)){z.ZP.error("Quotation data not found");return}l=n.data}"string"==typeof l&&(l=JSON.parse(l)),(0,O.O)(l,"download")},ei=[{width:240,sortable:!1,field:"actions",renderCell:e=>{let t=()=>{l.push({pathname:"/invoice/edit",query:{id:e.row.id}})};return(0,o.jsx)(C.Z,{iconButtonProps:{size:"small",sx:{color:"text.secondary"}},options:[{text:"Preview",icon:(0,o.jsx)(S.Z,{icon:"tabler:eye"}),onClick:()=>eo(e.row)},{text:"Download",icon:(0,o.jsx)(S.Z,{icon:"tabler:download"}),onClick:()=>en(e.row)},{text:"Edit",subject:"INVOICE_EDIT",icon:(0,o.jsx)(S.Z,{icon:"tabler:edit"}),onClick:t},{text:"Delete",subject:"INVOICE_DELETE",icon:(0,o.jsx)(S.Z,{icon:"tabler:trash"}),onClick:()=>{K(e.row),U(!0)}}]})}},{width:270,field:"invoice_number",headerName:"Invoice No"},{width:270,field:"grand_total",headerName:"Total Amount",renderCell:e=>"₹ ".concat(Number(e.value||0).toFixed(2))},{width:260,field:"invoice_date",headerName:"Invoice Date",renderCell:e=>e.value?p()(e.value).format("DD/MM/YYYY"):"-"},{width:260,field:"due_date",headerName:"Due Date",renderCell:e=>e.value?p()(e.value).format("DD/MM/YYYY"):"-"},{width:260,field:"status",headerName:"Status",renderCell:e=>{let t="default";return"FINAL"===e.value?t="success":"DRAFT"===e.value?t="warning":"CANCELLED"===e.value&&(t="error"),(0,o.jsx)(i.Z,{size:"small",color:t,label:e.value})}}];return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(a.ZP,{container:!0,children:(0,o.jsx)(a.ZP,{item:!0,xs:12,children:(0,o.jsxs)(r.Z,{children:[(0,o.jsx)(s.Z,{title:"Invoices",subheader:"Invoice List",action:(0,o.jsxs)(d.Z,{direction:"row",spacing:2,alignItems:"center",children:[(0,o.jsx)(I.Z,{children:(0,o.jsxs)(d.Z,{direction:"row",spacing:2,alignItems:"center",children:[(0,o.jsx)(_.Z,{size:"small",select:!0,value:et.status,onChange:e=>el(t=>({...t,status:e.target.value})),sx:{minWidth:150},children:[{label:"All",value:"ALL"},{label:"Draft",value:"DRAFT"},{label:"Final",value:"FINAL"}].map(e=>(0,o.jsx)(c.Z,{value:e.value,children:e.label},e.value))}),(0,o.jsx)(P(),{selected:p()(et.from_date).toDate(),customInput:(0,o.jsx)(_.Z,{size:"small",placeholder:"From Date"}),onChange:e=>el(t=>({...t,from_date:p()(e).format("YYYY-MM-DD")}))}),(0,o.jsx)(P(),{selected:p()(et.to_date).toDate(),customInput:(0,o.jsx)(_.Z,{size:"small",placeholder:"To Date"}),onChange:e=>el(t=>({...t,to_date:p()(e).format("YYYY-MM-DD")}))})]})}),(0,o.jsx)(A.Z,{I:"read",a:"INVOICE_ADD",children:(0,o.jsx)(u.Z,{variant:"tonal",sx:{border:"1px solid ".concat(e.palette.primary.main),background:"white"},onClick:()=>l.push("/invoice"),children:"Create Invoice"})})]})}),(0,o.jsx)(h.Z,{children:W?(0,o.jsxs)(m.Z,{sx:{mt:5,height:500,display:"flex",alignItems:"center",flexDirection:"column"},children:[(0,o.jsx)(x.Z,{sx:{mb:2}}),(0,o.jsx)(v.Z,{children:"Loading..."})]}):(null==M?void 0:M.length)>0?(0,o.jsx)(m.Z,{sx:{height:600},children:(0,o.jsx)(T.Z,{theme:D.JG,children:(0,o.jsx)(g._,{rows:M,columns:ei,rowHeight:64,disableRowSelectionOnClick:!0,paginationModel:q,onPaginationModelChange:H})})}):(0,o.jsx)(j.Z,{imageUrl:"/images/screens_highlight/no_data_found.png",title:"No Invoices Found"})})]})})}),(0,o.jsx)(F.Z,{open:B,objData:{title:"Delete Record",text:"Are you sure you want to delete this record?"},actionButtons:[(0,o.jsx)(u.Z,{onClick:()=>{U(!1),ee(!1)},children:"Cancel"},"cancel"),(0,o.jsx)(u.Z,{variant:"tonal",onClick:()=>
1{if(!(null==X?void 0:X.id)){z.ZP.error("No quotation selected");return}ee(!0),t((0,y.dv)({id:X.id}))},children:$?(0,o.jsx)(x.Z,{size:18}):"Confirm"},"confirm")]})]})};k.acl={action:"read",subject:"INVOICE"},t.default=k},93214:function(e,t,l){"use strict";l.d(t,{O:function(){return a}});var o=l(91819),n=l(45114);let i=e=>new Intl.NumberFormat("en-IN",{minimumFractionDigits:2,maximumFractionDigits:2}).format(Number(e||0));function a(e){var t,l,a;let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"download";arguments.length>2&&arguments[2];let s=new o.ZP("p","mm","a4"),d=s.internal.pageSize.getWidth();s.internal.pageSize.getHeight();let c=e=>{if(!e)return"";let t=new Date(e);return isNaN(t)?e:t.toLocaleDateString("en-GB")};s.setDrawColor(220),s.roundedRect(8,8,d-16,280,4,4),s.setFillColor(230,240,255),s.roundedRect(10,10,d-20,26,4,4,"F"),s.setFont("helvetica","bold"),s.setFontSize(14),s.setTextColor(25,42,86),s.text(e.from.name||"-",d/2,20,{align:"center"}),s.setFont("helvetica","normal"),s.setFontSize(9),s.setTextColor(60,60,60);let u="GSTIN: ".concat(e.from.gstin||"-"," | Phone: ").concat(e.from.phone||"-");if(s.text(u,d/2,26,{align:"center"}),s.setFont("helvetica","bold"),s.setFontSize(12),s.setTextColor(0,102,204),s.text("INVOICE",d/2,34,{align:"center"}),null===(t=e.business)||void 0===t?void 0:t.logo)try{let t="PNG";e.business.logo.startsWith("data:image/jpeg")||e.business.logo.startsWith("data:image/jpg")?t="JPEG":e.business.logo.startsWith("data:image/png")||(console.warn("Logo is not valid PNG or JPEG, skipping..."),e.business.logo=null),e.business.logo&&s.addImage(e.business.logo,t,14,16,18,12)}catch(e){console.error("Error adding logo to PDF:",e)}let h=(d-22)/2,m=(e,t,l,o)=>{s.setFillColor(235,240,255),s.roundedRect(l,o,h,28,4,4,"F"),s.setFont("helvetica","bold"),s.setFontSize(9),s.setTextColor(0,51,102),s.text(e,l+5,o+7),s.setFont("helvetica","normal"),s.setFontSize(8),s.setTextColor(50,50,50),t.forEach((e,t)=>{let n=o+13+5*t;s.setFont("helvetica","bold"),s.setTextColor(60,60,60),s.text("".concat(e.label,":"),l+5,n),s.setFont("helvetica","normal"),s.setTextColor(25,25,25),s.text(e.value||"-",l+45,n)})},x=(null==e?void 0:e.invoiceDetails)||{},v=c((null==x?void 0:x.date)||(null==x?void 0:x.invoice_date)||(null==e?void 0:e.invoice_date)||(null==e?void 0:e.date)),g=c((null==x?void 0:x.dueDate)||(null==x?void 0:x.due_date)||(null==e?void 0:e.due_date)||(null==e?void 0:e.dueDate));m("INVOICE DETAILS",[{label:"Invoice No",value:x.number||x.invoice_number||"-"},{label:"Date",value:v||"-"},{label:"Due Date",value:x.showDueDate&&g||"-"}],10,40),m("TRANSPORT DETAILS",[{label:"Vehicle No",value:e.transport.vehicleNumber},{label:"Mode",value:e.transport.mode},{label:"Doc No",value:e.transport.docNo}],10+h+2,40);let f=(d-22)/2,b=(e,t,l,o)=>{s.setFillColor(235,245,255),s.roundedRect(l,o,f,42,5,5,"F"),s.setFont("helvetica","bold"),s.setFontSize(9),s.setTextColor(0,51,102),s.text(e,l+5,o+7),s.setFont("helvetica","normal"),s.setFontSize(8),s.setTextColor(50,50,50),s.text(t.name||"-",l+5,o+14);let n=s.splitTextToSize(t.address||"-",f-10);s.text(n,l+5,o+20),s.setFont("helvetica","bold"),s.text("GSTIN: ".concat(t.gstin||"-"),l+5,o+42-12),s.text("Phone: ".concat(t.phone||"-"),l+5,o+42-4)};b("FROM",e.from,10,70),b("BILL TO",e.to,10+f+2,70);let p=Number((null==e?void 0:null===(l=e.summary)||void 0===l?void 0:l.totalIGST)||0)>0,S=Number((null==e?void 0:null===(a=e.summary)||void 0===a?void 0:a.cessTotal)||0)>0,C=e.items.map((e,t)=>{var l;let o=Number(e.qty||0),n=Number(e.rate||0),a=Number(e.gst||0);e.cess;let r=o*n,s=r*a/100,d=Number(null!==(l=e.total)&&void 0!==l?l:r+s),c=e.item||e.name||"-";return p?[t+1,e.showDescription&&e.description?"".concat(c," - ").concat(e.description):c,e.hsn||"-",o,i(n),i(r),i(s),i(d)]:[t+1,e.showDescription&&e.description?"".concat(c," - ").concat(e.description):c,e.hsn||"-",o,i(n),i(r),i(s/2),i(s/2),i(d)]});(0,n.ZP)(s,{startY:114,theme:"grid",tableWidth:"auto",margin:{left:10,right:10},head:[p?["Sr","Product / Service","HSN","Qty","Rate","Taxable","IGST","Total"]:["Sr","Product / Service","HSN","Qty","Rate","Taxable","CGST","SGST","Total"]],body:C,headStyles:{fillColor:[0,51,102],textColor:[255,255,255],fontStyle:"bold",halign:"center"},alternateRowStyles:{fillColor:[235,245,255]},columnStyles:{0:{cellWidth:10,halign:"center"},3:{cellWidth:12,halign:"center"},8:{halign:"right",fontStyle:"bold"}},styles:{fontSize:9,cellPadding:3,valign:"middle",overflow:"linebreak",halign:"left"},didDrawPage:e=>{s.setFontSize(8),s.text("Powered by TAUTOM",d/2,s.internal.pageSize.getHeight()-10,{align:"center"})}}),(0,n.ZP)(s,{startY:s.lastAutoTable.finalY+4,theme:"plain",tableWidth:d-20,margin:{left:10},body:[[{content:"Total (in words): ".concat(i(e.summary.grandTotal)," ONLY"),styles:{fontStyle:"bold",textColor:[0,51,102],fontSize:9}}]]});let j=[["Subtotal",i(e.summary.subtotal)],["Discount",i(e.summary.discount)],["Additional Charges",i(e.summary.additionalCharges)],["Round Off",i(e.summary.roundOff)]];if(p?j.push(["IGST",i(e.summary.totalIGST)]):(j.push(["CGST",i(e.summary.totalCGST)]),j.push(["SGST",i(e.summary.totalSGST)])),S&&j.push(["CESS",i(e.summary.cessTotal)]),j.push(["GRAND TOTAL",i(e.summary.grandTotal)]),(0,n.ZP)(s,{startY:s.lastAutoTable.finalY+3,theme:"grid",tableWidth:d-20,margin:{left:10},head:[["Description","Amount"]],headStyles:{fillColor:[0,51,102],textColor:[255,255,255],fontStyle:"bold",halign:"center"},body:j,columnStyles:{1:{halign:"right",fontStyle:"bold"}},alternateRowStyles:{fillColor:[240,245,250]}}),e.terms){let t=s.lastAutoTable.finalY+10,l=s.splitTextToSize(e.terms,d-20);s.setFont("helvetica","bold"),s.setFontSize(10),s.setTextColor(0,51,102),s.text("Terms & Conditions",12,t),s.setFont("helvetica","normal"),s.setFontSize(8),s.setTextColor(50,50,50),s.text(l,12,t+5)}if(e.signature&&(s.addImage(e.signature,"PNG",d-35-12,s.lastAutoTable.finalY+30,35,14),s.setFontSize(9),s.text("For ".concat(e.from.name),d-14,s.lastAutoTable.finalY+14+8,{align:"right"}),s.text("Authorised Signatory",d-14,s.lastAutoTable.finalY+14+14,{align:"right"})),s.setFontSize(8),s.setTextColor(100),"preview"===r){let e=s.output("bloburl");window.open(e,"_blank");return}let T=x.number||x.invoice_number||"draft";s.save("Invoice-".concat(T,".pdf"))}}},function(e){e.O(0,[7847,2655,3863,9636,390,1010,5353,9774,2888,179],function(){return e(e.s=43812)}),_N_E=e.O()}]);

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.