PageSourceSearch

https://hosternepal.com/static/js/8437.d3c4684f.chunk.js

js hosternepal.com collected 2026-10-08 17:41:15 UTC 6,409 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunksathi_cloud_client=self.webpackChunksathi_cloud_client||[]).push([[8437],{58437:(e,n,s)=>{s.r(n),s.d(n,{default:()=>_});var t=s(9950),r=s(16491),i=s(82053),l=s(11966),o=s(84142),c=s(48089),a=s(50704),d=s(1320),x=s(15769),u=s(69780),h=s(9213),A=s(21671),j=s(34075),v=s(46639),m=s(25277),g=s(25333),y=s(17239),b=s(23266),D=s(96583),f=s(40033),I=s(28170),S=s(65429),p=s(79739),C=s(18216),w=s(60899),N=s(76281),P=s(68179),k=s(85625),E=s(23935),L=s(41920),B=s(28429),F=s(9311),T=s(35887),W=s(68515),Q=s(44414);const U=()=>{const e=(0,L.useQueryClient)(),n=(0,L.useMutation)(()=>F.p9.generateInvoice({serviceIds:[],dueDate:new Date(Date.now()+2592e6).toISOString()}),{onSuccess:n=>{console.log("\u2705 Test invoice created:",n),T.Ay.success("Test invoice created successfully!"),e.invalidateQueries("customer-invoices"),e.invalidateQueries("customer-billing-usage")},onError:e=>{console.error("\u274c Failed to create test invoice:",e),T.Ay.error("Failed to create test invoice")}});return(0,Q.jsx)(C.A,{variant:"outlined",size:"small",startIcon:(0,Q.jsx)(W.A,{}),onClick:()=>{n.mutate()},disabled:n.isLoading,sx:{color:"#1a237e",borderColor:"#1a237e","&:hover":{bgcolor:"#1a237e",color:"white"}},children:n.isLoading?"Creating...":"Generate Test Invoice"})},G=e=>{let{open:n,onClose:s,invoice:t,onPayInvoice:r}=e;if(!t)return null;const l=e=>new Intl.NumberFormat("en-US",{style:"currency",currency:"USD"}).format(e);return(0,Q.jsxs)(D.A,{open:n,onClose:s,maxWidth:"md",fullWidth:!0,children:[(0,Q.jsxs)(f.A,{children:["Invoice Details - ",t.invoiceNumber]}),(0,Q.jsx)(I.A,{children:(0,Q.jsxs)(w.Ay,{container:!0,spacing:3,children:[(0,Q.jsxs)(w.Ay,{item:!0,xs:12,md:6,children:[(0,Q.jsx)(i.A,{variant:"h6",gutterBottom:!0,children:"Invoice Information"}),(0,Q.jsxs)(i.A,{variant:"body2",children:[(0,Q.jsx)("strong",{children:"Invoice Number:"})," ",t.invoiceNumber]}),(0,Q.jsxs)(i.A,{variant:"body2",children:[(0,Q.jsx)("strong",{children:"Date:"})," ",new Date(t.createdAt).toLocaleDateString()]}),(0,Q.jsxs)(i.A,{variant:"body2",children:[(0,Q.jsx)("strong",{children:"Due Date:"})," ",t.dueDate?new Date(t.dueDate).toLocaleDateString():"N/A"]}),(0,Q.jsxs)(i.A,{variant:"body2",children:[(0,Q.jsx)("strong",{children:"Status:"})," ",t.status]})]}),(0,Q.jsxs)(w.Ay,{item:!0,xs:12,md:6,children:[(0,Q.jsx)(i.A,{variant:"h6",gutterBottom:!0,children:"Amount Details"}),(0,Q.jsxs)(i.A,{variant:"body2",children:[(0,Q.jsx)("strong",{children:"Subtotal:"})," ",l(t.subtotal||0)]}),(0,Q.jsxs)(i.A,{variant:"body2",children:[(0,Q.jsx)("strong",{children:"Tax:"})," ",l(t.tax||0)]}),(0,Q.jsxs)(i.A,{variant:"body2",children:[(0,Q.jsx)("strong",{children:"Total:"})," ",l(t.total)]})]})]})}),(0,Q.jsxs)(p.A,{children:[(0,Q.jsx)(C.A,{onClick:s,children:"Close"}),"PENDING"===t.status&&(0,Q.jsxs)(C.A,{variant:"contained",onClick:()=>{r(t),s()},sx:{bgcolor:"#f9bf3b",color:"#1a237e","&:hover":{bgcolor:"#f57f17"}},children:["Pay Now - ",l(t.total)]})]})]})},_=()=>{const[e,n]=(0,t.useState)(0),[s,w]=(0,t.useState)(!1),[W,_]=(0,t.useState)(null),[z,M]=(0,t.useState)(""),[O,V]=(0,t.useState)(!1),[H,R]=(0,t.useState)(!1),[Y,Z]=(0,t.useState)(null),[q,J]=(0,t.useState)(null),{data:K,isLoading:X,refetch:$}=((0,L.useQueryClient)(),(0,B.Zp)(),(0,L.useQuery)("customer-invoices",()=>F.p9.getInvoices(),{onError:e=>{console.error("Invoices fetch error:",e),T.Ay.error("Failed to load invoices")}})),ee=(null===K||void 0===K?void 0:K.data)||[],ne=e=>{_(e),M(e.total.toString()),w(!0)},se=()=>{Z(null),J(null)},te=e=>{switch(e){case"PAID":return"success";case"PENDING":return"warning";case"OVERDUE":return"error";default:return"default"}};return(0,Q.jsxs)(r.A,{sx:{p:3},children:[(0,Q.jsx)(i.A,{variant:"h4",gutterBottom:!0,children:"Billing & Invoices"}),(0,Q.jsxs)(l.A,{value:e,onChange:(e,s)=>{n(s)},sx:{mb:3},children:[(0,Q.jsx)(o.A,{label:"Invoices"}),(0,Q.jsx)(o.A,{label:"Payment Methods"}),(0,Q.jsx)(o.A,{label:"Billing History"})]}),0===e&&(0,Q.jsx)(c.A,{children:(0,Q.jsxs)(a.A,{children:[(0,Q.jsxs)(r.A,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mb:3},children:[(0,Q.jsx)(i.A,{variant:"h6",children:"Your Invoices"}),(0,Q.jsx)(U,{})]}),(0,Q.jsx)(d.A,{children:(0,Q.jsxs)(x.A,{children:[(0,Q.jsx)(u.A,{children:(0,Q.jsxs)(h.A,{children:[(0,Q.jsx)(A.A,{children:"Invoice #"}),(0,Q.jsx)(A.A,{children:"Date"}),(0,Q.jsx)(A.A,{children:"Amount"}),(0,Q.jsx)(A.A,{children:"Status"}),(0,Q.jsx)(A.A,{children:"Due Date"}),(0,Q.jsx)(A.A,{align:"center",children:"Actions"})]})}),(0,Q.jsx)(j.A,{children:X?(0,Q.jsx)(h.A,{children:(0,Q.jsx)(A.A,{colSpan:6,align:"center",children:(0,Q.jsx)(v.A,{})})}):0===ee.length?(0,Q.jsx)(h.A,{children:(0,Q.jsx)(A.A,{colSpan:6,align:"center",children:(0,Q.jsx)(i.A,{variant:"body2",color:"text.secondary",children:"No invoices found"})})}):ee.map(e=>{return(0,Q.jsxs)(h.A,{hover:!0,children:[(0,Q.jsx)(A.A,{children:(0,Q.jsx)(i.A,{variant:"body2",fontWeight:"medium",children:e.invoiceNumber})}),(0,Q.jsx)(A.A,{children:new Date(e.createdAt).toLocaleDateString()}),(0,Q.jsx)(A.A,{children:(0,Q.jsx)(i.A,{variant:"body2",fontWeight:"medium",children:(n=e.total,new Intl.NumberFormat("en-US",{style:"currency",currency:"USD"}).format(n))})}),(0,Q.jsx)(A.A,{children:(0,Q.jsx)(m.A,{label:e.status,color:te(e.status),size:"small"})}),(0,Q.jsx)(A.A,{children:e.dueDate?new Date(e.dueDate).toLocaleDateString():"N/A"}),(0,Q.jsx)(A.A,{align:"center",children:(0,Q.jsx)(g.A,{size:"small",onClick:n=>((e,n)=>{Z(e.currentTarget),J(n)})(n,e),children:(0,Q.jsx)(N.A,{})})})]},e.id);var n})})]})})]})}),(0,Q.jsxs)(y.A,{anchorEl:Y,open:Boolean(Y),onClose:se,children:[(0,Q.jsxs)(b.A,{onClick:()=>{_(q),R(!0),se()},children:[(0,Q.jsx)(P.A,{sx:{mr:1}}),"View Details"]}
1),"PENDING"===(null===q||void 0===q?void 0:q.status)&&(0,Q.jsxs)(b.A,{onClick:()=>{ne(q),se()},children:[(0,Q.jsx)(k.A,{sx:{mr:1}}),"Pay Invoice"]}),(0,Q.jsxs)(b.A,{onClick:se,children:[(0,Q.jsx)(E.A,{sx:{mr:1}}),"Download PDF"]})]}),(0,Q.jsxs)(D.A,{open:s,onClose:()=>w(!1),maxWidth:"sm",fullWidth:!0,children:[(0,Q.jsx)(f.A,{children:"Payment Not Available"}),(0,Q.jsx)(I.A,{children:(0,Q.jsx)(S.A,{severity:"info",children:"Payment processing is temporarily disabled. Please contact support for payment assistance."})}),(0,Q.jsx)(p.A,{children:(0,Q.jsx)(C.A,{onClick:()=>w(!1),children:"Close"})})]}),(0,Q.jsx)(G,{open:H,onClose:()=>R(!1),invoice:W,onPayInvoice:ne})]})}}}]);

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.