PageSourceSearch

https://digital-hub-shop.emergent.host/static/js/2400.e8079f44.chunk.js

js digital-hub-shop.emergent.host collected 2026-10-03 03:21:43 UTC 23,629 bytes, 2 lines download raw bytes

1"use strict";(self.webpackChunkfrontend=self.webpackChunkfrontend||[]).push([[2400],{45730(e,t,a){a.d(t,{z:()=>r});var o=a(89379),n=a(65043),s=a(96667);const l=new Map([["bold",n.createElement(n.Fragment,null,n.createElement("path",{d:"M228,144v64a12,12,0,0,1-12,12H40a12,12,0,0,1-12-12V144a12,12,0,0,1,24,0v52H204V144a12,12,0,0,1,24,0Zm-108.49,8.49a12,12,0,0,0,17,0l40-40a12,12,0,0,0-17-17L140,115V32a12,12,0,0,0-24,0v83L96.49,95.51a12,12,0,0,0-17,17Z"}))],["duotone",n.createElement(n.Fragment,null,n.createElement("path",{d:"M216,48V208H40V48A16,16,0,0,1,56,32H200A16,16,0,0,1,216,48Z",opacity:"0.2"}),n.createElement("path",{d:"M224,144v64a8,8,0,0,1-8,8H40a8,8,0,0,1-8-8V144a8,8,0,0,1,16,0v56H208V144a8,8,0,0,1,16,0Zm-101.66,5.66a8,8,0,0,0,11.32,0l40-40a8,8,0,0,0-11.32-11.32L136,124.69V32a8,8,0,0,0-16,0v92.69L93.66,98.34a8,8,0,0,0-11.32,11.32Z"}))],["fill",n.createElement(n.Fragment,null,n.createElement("path",{d:"M224,144v64a8,8,0,0,1-8,8H40a8,8,0,0,1-8-8V144a8,8,0,0,1,16,0v56H208V144a8,8,0,0,1,16,0Zm-101.66,5.66a8,8,0,0,0,11.32,0l40-40A8,8,0,0,0,168,96H136V32a8,8,0,0,0-16,0V96H88a8,8,0,0,0-5.66,13.66Z"}))],["light",n.createElement(n.Fragment,null,n.createElement("path",{d:"M222,144v64a6,6,0,0,1-6,6H40a6,6,0,0,1-6-6V144a6,6,0,0,1,12,0v58H210V144a6,6,0,0,1,12,0Zm-98.24,4.24a6,6,0,0,0,8.48,0l40-40a6,6,0,0,0-8.48-8.48L134,129.51V32a6,6,0,0,0-12,0v97.51L92.24,99.76a6,6,0,0,0-8.48,8.48Z"}))],["regular",n.createElement(n.Fragment,null,n.createElement("path",{d:"M224,144v64a8,8,0,0,1-8,8H40a8,8,0,0,1-8-8V144a8,8,0,0,1,16,0v56H208V144a8,8,0,0,1,16,0Zm-101.66,5.66a8,8,0,0,0,11.32,0l40-40a8,8,0,0,0-11.32-11.32L136,124.69V32a8,8,0,0,0-16,0v92.69L93.66,98.34a8,8,0,0,0-11.32,11.32Z"}))],["thin",n.createElement(n.Fragment,null,n.createElement("path",{d:"M220,144v64a4,4,0,0,1-4,4H40a4,4,0,0,1-4-4V144a4,4,0,0,1,8,0v60H212V144a4,4,0,0,1,8,0Zm-94.83,2.83a4,4,0,0,0,5.66,0l40-40a4,4,0,1,0-5.66-5.66L132,134.34V32a4,4,0,0,0-8,0V134.34L90.83,101.17a4,4,0,0,0-5.66,5.66Z"}))]]),i=n.forwardRef((e,t)=>n.createElement(s.A,(0,o.A)((0,o.A)({ref:t},e),{},{weights:l})));i.displayName="DownloadSimpleIcon";const r=i},72400(e,t,a){a.r(t),a.d(t,{default:()=>Ce});var o=a(65043),n=a(45685),s=a(4980),l=a(13390),i=a(91140),r=a(89379),c=a(53986),d=a(21862),m=a(82814),u=a(57427),x=a(30858),h=a(70579);var g=Symbol("radix.slottable");function p(e){const t=e=>{let{children:t}=e;return(0,h.jsx)(h.Fragment,{children:t})};return t.displayName="".concat(e,".Slottable"),t.__radixId=g,t}const f=["__scopeAlertDialog"],b=["__scopeAlertDialog"],v=["__scopeAlertDialog"],j=["__scopeAlertDialog"],y=["__scopeAlertDialog","children"],F=["__scopeAlertDialog"],A=["__scopeAlertDialog"],N=["__scopeAlertDialog"],_=["__scopeAlertDialog"];var w="AlertDialog",[S,C]=(0,d.A)(w,[u.Hs]),D=(0,u.Hs)(),T=e=>{const{__scopeAlertDialog:t}=e,a=(0,c.A)(e,f),o=D(t);return(0,h.jsx)(u.bL,(0,r.A)((0,r.A)((0,r.A)({},o),a),{},{modal:!0}))};T.displayName=w;var R=o.forwardRef((e,t)=>{const{__scopeAlertDialog:a}=e,o=(0,c.A)(e,b),n=D(a);return(0,h.jsx)(u.l9,(0,r.A)((0,r.A)((0,r.A)({},n),o),{},{ref:t}))});R.displayName="AlertDialogTrigger";var z=e=>{const{__scopeAlertDialog:t}=e,a=(0,c.A)(e,v),o=D(t);return(0,h.jsx)(u.ZL,(0,r.A)((0,r.A)({},o),a))};z.displayName="AlertDialogPortal";var E=o.forwardRef((e,t)=>{const{__scopeAlertDialog:a}=e,o=(0,c.A)(e,j),n=D(a);return(0,h.jsx)(u.hJ,(0,r.A)((0,r.A)((0,r.A)({},n),o),{},{ref:t}))});E.displayName="AlertDialogOverlay";var I="AlertDialogContent",[L,k]=S(I),B=p("AlertDialogContent"),P=o.forwardRef((e,t)=>{const{__scopeAlertDialog:a,children:n}=e,s=(0,c.A)(e,y),l=D(a),i=o.useRef(null),d=(0,m.s)(t,i),g=o.useRef(null);return(0,h.jsx)(u.G$,{contentName:I,titleName:H,docsSlug:"alert-dialog",children:(0,h.jsx)(L,{scope:a,cancelRef:g,children:(0,h.jsxs)(u.UC,(0,r.A)((0,r.A)((0,r.A)({role:"alertdialog"},l),s),{},{ref:d,onOpenAutoFocus:(0,x.mK)(s.onOpenAutoFocus,e=>{var t;e.preventDefault(),null===(t=g.current)||void 0===t||t.focus({preventScroll:!0})}),onPointerDownOutside:e=>e.preventDefault(),onInteractOutside:e=>e.preventDefault(),children:[(0,h.jsx)(B,{children:n}),(0,h.jsx)(U,{contentRef:i})]}))})})});P.displayName=I;var H="AlertDialogTitle",M=o.forwardRef((e,t)=>
1{const{__scopeAlertDialog:a}=e,o=(0,c.A)(e,F),n=D(a);return(0,h.jsx)(u.hE,(0,r.A)((0,r.A)((0,r.A)({},n),o),{},{ref:t}))});M.displayName=H;var V="AlertDialogDescription",O=o.forwardRef((e,t)=>{const{__scopeAlertDialog:a}=e,o=(0,c.A)(e,A),n=D(a);return(0,h.jsx)(u.VY,(0,r.A)((0,r.A)((0,r.A)({},n),o),{},{ref:t}))});O.displayName=V;var Z=o.forwardRef((e,t)=>{const{__scopeAlertDialog:a}=e,o=(0,c.A)(e,N),n=D(a);return(0,h.jsx)(u.bm,(0,r.A)((0,r.A)((0,r.A)({},n),o),{},{ref:t}))});Z.displayName="AlertDialogAction";var W="AlertDialogCancel",G=o.forwardRef((e,t)=>{const{__scopeAlertDialog:a}=e,o=(0,c.A)(e,_),{cancelRef:n}=k(W,a),s=D(a),l=(0,m.s)(t,n);return(0,h.jsx)(u.bm,(0,r.A)((0,r.A)((0,r.A)({},s),o),{},{ref:l}))});G.displayName=W;var U=e=>{let{contentRef:t}=e;const a="`".concat(I,"` requires a description for the component to be accessible for screen reader users.\n\nYou can add a description to the `").concat(I,"` by passing a `").concat(V,"` component as a child, which also benefits sighted users by adding visible context to the dialog.\n\nAlternatively, you can use your own component as a description by assigning it an `id` and passing the same value to the `aria-describedby` prop in `").concat(I,"`. If the description is confusing or duplicative for sighted users, you can use the `@radix-ui/react-visually-hidden` primitive as a wrapper around your description component.\n\nFor more information, see https://radix-ui.com/primitives/docs/components/alert-dialog");return o.useEffect(()=>{var e;document.getElementById(null===(e=t.current)||void 0===e?void 0:e.getAttribute("aria-describedby"))||console.warn(a)},[a,t]),null},Y=T,q=z,K=E,$=P,J=Z,Q=G,X=M,ee=O,te=a(99766);const ae=["className"],oe=["className"],ne=["className"],se=["className"],le=["className"],ie=["className"],re=["className"],ce=["className"],de=Y,me=q,ue=o.forwardRef((e,t)=>{let{className:a}=e,o=(0,c.A)(e,ae);return(0,h.jsx)(K,(0,r.A)((0,r.A)({className:(0,te.cn)("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",a)},o),{},{ref:t}))});ue.displayName=K.displayName;const xe=o.forwardRef((e,t)=>{let{className:a}=e,o=(0,c.A)(e,oe);return(0,h.jsxs)(me,{children:[(0,h.jsx)(ue,{}),(0,h.jsx)($,(0,r.A)({ref:t,className:(0,te.cn)("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",a)},o))]})});xe.displayName=$.displayName;const he=e=>{let{className:t}=e,a=(0,c.A)(e,ne);return(0,h.jsx)("div",(0,r.A)({className:(0,te.cn)("flex flex-col space-y-2 text-center sm:text-left",t)},a))};he.displayName="AlertDialogHeader";const ge=e=>{let{className:t}=e,a=(0,c.A)(e,se);return(0,h.jsx)("div",(0,r.A)({className:(0,te.cn)("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t)},a))};ge.displayName="AlertDialogFooter";const pe=o.forwardRef((e,t)=>{let{className:a}=e,o=(0,c.A)(e,le);return(0,h.jsx)(X,(0,r.A)({ref:t,className:(0,te.cn)("text-lg font-semibold",a)},o))});pe.displayName=X.displayName;const fe=o.forwardRef((e,t)=>{let{className:a}=e,o=(0,c.A)(e,ie);return(0,h.jsx)(ee,(0,r.A)({ref:t,className:(0,te.cn)("text-sm text-muted-foreground",a)},o))});fe.displayName=ee.displayName;const be=o.forwardRef((e,t)=>{let{className:a}=e,o=(0,c.A)(e,re);return(0,h.jsx)(J,(0,r.A)({ref:t,className:(0,te.cn)((0,l.r)(),a)},o))});be.displayName=J.displayName;const ve=o.forwardRef((e,t)=>{let{className:a}=e,o=(0,c.A)(e,ce);return(0,h.jsx)(Q,(0,r.A)({ref:t,className:(0,te.cn)((0,l.r)({variant:"outline"}),"mt-2 sm:mt-0",a)},o))});ve.displayName=Q.displayName;var je=a(56328),ye=a(51314),Fe=a(40645),Ae=a(75892),Ne=a(45730),_e=a(32013),we=a(46381),Se=a(83020);const Ce=()=>{const e=(0,n.Zp)(),{selectedBranch:t,branches:a}=(0,n.KC)(),[r,c]=(0,o.useState)([]),[d,m]=(0,o.useState)(!0),[u,x]=(0,o.useState)(null),[g,p]=(0,o.useState)(null),f=(0,o.useCallback)(async()=>
1{if(t){m(!0);try{const[e,a]=await Promise.all([s.F.bajaj.list(t),s.F.settings.get().catch(()=>({data:null}))]);c(e.data||[]),x(a.data)}catch(e){c([])}finally{m(!1)}}},[t]);(0,o.useEffect)(()=>{f()},[f]);const b=(a||[]).find(e=>e.id===t);return(0,h.jsxs)("div",{className:"p-4 md:p-8 max-w-6xl mx-auto","data-testid":"bajaj-billing-page",children:[(0,h.jsxs)("div",{className:"flex items-center justify-between mb-6",children:[(0,h.jsxs)("div",{className:"flex items-center gap-3",children:[(0,h.jsx)("div",{className:"h-10 w-10 rounded-xl bg-orange-100 flex items-center justify-center",children:(0,h.jsx)(ye.T,{size:22,className:"text-orange-600",weight:"duotone"})}),(0,h.jsxs)("div",{children:[(0,h.jsx)("h1",{className:"text-2xl font-bold text-slate-900",children:"Bajaj Billing"}),(0,h.jsx)("p",{className:"text-sm text-slate-500",children:"Document-only invoices for Bajaj Finance \u2014 no stock, sales or accounting impact."})]})]}),(0,h.jsxs)(l.$,{onClick:()=>e("/bajaj-billing/new"),className:"gap-2","data-testid":"bajaj-new-btn",children:[(0,h.jsx)(Fe.F,{size:18})," New Bajaj Invoice"]})]}),(0,h.jsx)(i.Zp,{className:"overflow-hidden",children:(0,h.jsx)("div",{className:"overflow-x-auto",children:(0,h.jsxs)("table",{className:"w-full text-sm",children:[(0,h.jsx)("thead",{className:"bg-slate-50 border-b",children:(0,h.jsxs)("tr",{className:"text-left text-slate-500",children:[(0,h.jsx)("th",{className:"px-4 py-3 font-medium",children:"Document No."}),(0,h.jsx)("th",{className:"px-4 py-3 font-medium",children:"Customer"}),(0,h.jsx)("th",{className:"px-4 py-3 font-medium",children:"Mobile"}),(0,h.jsx)("th",{className:"px-4 py-3 font-medium text-right",children:"Total"}),(0,h.jsx)("th",{className:"px-4 py-3 font-medium",children:"Date"}),(0,h.jsx)("th",{className:"px-4 py-3 font-medium text-right",children:"Actions"})]})}),(0,h.jsx)("tbody",{children:d?(0,h.jsx)("tr",{children:(0,h.jsx)("td",{colSpan:6,className:"px-4 py-10 text-center text-slate-400",children:"Loading\u2026"})}):0===r.length?(0,h.jsx)("tr",{children:(0,h.jsxs)("td",{colSpan:6,className:"px-4 py-14 text-center text-slate-400",children:[(0,h.jsx)(Ae.i,{size:40,className:"mx-auto mb-3 text-slate-300"}),"No Bajaj invoices yet. Create one to generate a Bajaj Finance PDF."]})}):r.map(t=>{return(0,h.jsxs)("tr",{className:"border-b last:border-0 hover:bg-slate-50","data-testid":"bajaj-row-".concat(t.id),children:[(0,h.jsx)("td",{className:"px-4 py-3 font-mono text-orange-700",children:t.invoice_number}),(0,h.jsx)("td",{className:"px-4 py-3 font-medium text-slate-800",children:t.customer_name}),(0,h.jsx)("td",{className:"px-4 py-3 text-slate-600",children:t.customer_mobile}),(0,h.jsx)("td",{className:"px-4 py-3 text-right font-semibold",children:(a=t.final_total||t.total,"\u20b9".concat(Number(a||0).toLocaleString("en-IN")))}),(0,h.jsx)("td",{className:"px-4 py-3 text-slate-500",children:t.created_at?new Date(t.created_at).toLocaleDateString("en-IN"):""}),(0,h.jsx)("td",{className:"px-4 py-3",children:(0,h.jsxs)("div",{className:"flex items-center justify-end gap-1",children:[(0,h.jsxs)(l.$,{size:"sm",variant:"ghost",className:"gap-1",onClick:()=>(async e=>{try{await(0,Se.j)({invoice:e,branch:b,settings:u}),je.toast.success("Bajaj PDF downloaded")}catch(t){je.toast.error("Failed to generate PDF")}})(t),"data-testid":"bajaj-pdf-".concat(t.id),children:[(0,h.jsx)(Ne.z,{size:16})," PDF"]}),(0,h.jsxs)(l.$,{size:"sm",variant:"ghost",className:"gap-1",onClick:()=>e("/bajaj-billing/edit/".concat(t.id)),"data-testid":"bajaj-edit-".concat(t.id),children:[(0,h.jsx)(_e.I,{size:16})," Edit"]}),(0,h.jsx)(l.$,{size:"sm",variant:"ghost",className:"gap-1 text-red-600 hover:text-red-700",onClick:()=>p(t),"data-testid":"bajaj-delete-".concat(t.id),children:(0,h.jsx)(we.l,{size:16})})]})})]},t.id);var a})})]})})}),(0,h.jsx)(de,{open:!!g,onOpenChange:e=>!e&&p(null),children:(0,h.jsxs)(xe,{children:[(0,h.jsxs)(he,{children:[(0,h.jsx)(pe,{children:"Delete Bajaj document?"}),(0,h.jsxs)(fe,{children:["This deletes only the Bajaj document ",(0,h.jsx)("strong",{children:null===g||void 0===g?void 0:g.invoice_number}),". It has no effect on any sale, stock, ledger or report."]})]}),(0,h.jsxs)(ge,{children:[(0,h.jsx)(ve,{children:"Cancel"}),(0,h.jsx)(be,{onClick:async()=>
1{if(g)try{await s.F.bajaj.remove(g.id),je.toast.success("Bajaj document deleted"),p(null),f()}catch(e){je.toast.error("Delete failed")}},className:"bg-red-600 hover:bg-red-700","data-testid":"bajaj-delete-confirm",children:"Delete"})]})]})})]})}},83020(e,t,a){a.d(t,{j:()=>i});const o={name:"THE DIGITAL HUB",tagline:"Pre-owned Mobile & Electronics",email:"[email protected]",branches:{Gandhinagar:{address:"Shop No 120/121, First Floor, Radhe Square, Reliance Cross Rd, Kudasan, Gandhinagar",gst:"24BWOPR1508R1ZU",phone:"+91 7550700700"},Ahmedabad:{address:"B-19 Sobo Center, Gala Gymkhana Rd, South Bopal, Ahmedabad",gst:"24CCOPK2800C1Z3",phone:"+91 8347700700"},Bodakdev:{address:"Shop No 39/40 Rudra Squre Complex, Opp Hotel Pride, Judges Bunglow Road, Bodakdev, Ahmedabad 380015",gst:"24EEZPK7839Q1Z4",phone:"+91 7890 700 700",email:"[email protected]"}}};let n=null;const s=(e,t,a)=>{let{invoice:n,branch:s,settings:l,logoBase64:i}=a;const r=new e({orientation:"portrait",unit:"mm",format:"a4"}),c=210,d=202,m=194,u=e=>Number(e||0).toLocaleString("en-IN"),x=(null===s||void 0===s?void 0:s.name)||"Gandhinagar",h=o.branches[x]||{address:(null===s||void 0===s?void 0:s.location)||"",gst:(null===s||void 0===s?void 0:s.gst_number)||(null===s||void 0===s?void 0:s.gst)||"",phone:(null===s||void 0===s?void 0:s.contact)||(null===s||void 0===s?void 0:s.phone)||"",email:(null===s||void 0===s?void 0:s.email)||""},g=new Date(n.created_at||Date.now()),p=(null===l||void 0===l?void 0:l.invoice_color_mode)||"color",f=(null===l||void 0===l?void 0:l.invoice_primary_color)||"#EA580C";let b,v,j;if("bw"===p)b=30,v=30,j=30;else if("custom"===p){const e=f.replace("#","");b=parseInt(e.substr(0,2),16),v=parseInt(e.substr(2,2),16),j=parseInt(e.substr(4,2),16)}else b=234,v=88,j=12;const y="bw"===p?[245,245,245]:[255,251,235],F="bw"===p?[80,53,15]:[120,53,15];r.setFillColor(b,v,j),r.rect(0,0,c,34,"F");if(i){r.setFillColor(255,255,255),r.roundedRect(8.5,3.5,19,19,1.5,1.5,"F");try{r.addImage(i,"JPEG",9,4,18,18)}catch(P){}}r.setTextColor(255,255,255),r.setFontSize(18),r.setFont(void 0,"bold"),r.text(o.name,32,13),r.setFontSize(8),r.setFont(void 0,"normal");const A=r.splitTextToSize(h.address,95);r.text(A,32,19);const N=h.email||o.email;r.text("Ph: ".concat(h.phone,"  |  ").concat(N),32,28),r.setFillColor(255,255,255),r.roundedRect(148,4,52,26,2,2,"F"),r.setTextColor(b,v,j),r.setFontSize(9),r.setFont(void 0,"bold"),r.text("BILL OF SUPPLY",174,12,{align:"center"}),r.setTextColor(40,40,40),r.setFontSize(8),r.text(n.invoice_number||"",174,19,{align:"center"}),r.setFontSize(7),r.text(g.toLocaleDateString("en-IN")+"  "+g.toLocaleTimeString("en-IN",{hour:"2-digit",minute:"2-digit"}),174,26,{align:"center"});let _=37;r.setFillColor(...y),r.rect(8,_,m,7,"F"),r.setTextColor(...F),r.setFontSize(8),r.setFont(void 0,"bold"),r.text("GSTIN: ".concat(h.gst),105,_+5,{align:"center"}),_+=10;const w=95;r.setFillColor(249,250,251),r.rect(8,_,w,28,"F"),r.setDrawColor(210,210,210),r.rect(8,_,w,28),r.setFillColor(b,v,j),r.rect(8,_,w,5,"F"),r.setTextColor(255,255,255),r.setFontSize(6.5),r.setFont(void 0,"bold"),r.text("BILL TO",11,_+3.5),r.setTextColor(30,30,30),r.setFontSize(11),r.text(n.customer_name||"",11,_+11,{maxWidth:89}),r.setFontSize(8),r.setFont(void 0,"normal"),r.text("Mobile: ".concat(n.customer_mobile||""),11,_+18);let S=_+24;n.customer_gst&&(r.setFontSize(7),r.text("GST: ".concat(n.customer_gst),11,S),S+=4),n.customer_address&&(r.setFontSize(7),r.text(r.splitTextToSize("Addr: ".concat(n.customer_address),89).slice(0,1),11,S));const C=107;r.setFillColor(249,250,251),r.rect(C,_,w,28,"F"),r.setDrawColor(210,210,210),r.rect(C,_,w,28),r.setFillColor(b,v,j),r.rect(C,_,w,5,"F"),r.setTextColor(255,255,255),r.setFontSize(6.5),r.setFont(void 0,"bold"),r.text("DETAILS",110,_+3.5),r.setTextColor(50,50,50),r.setFontSize(7),r.setFont(void 0,"normal");let D=_+10;n.sold_by&&(r.text("Sales: ".concat(n.sold_by),110,D),D+=5),n.reference&&(r.text("Ref: ".concat(n.reference),110,D),D+=5),n.finance_file_number&&r.text("Finance: ".concat(n.finance_file_number),110,D),_+=31;const T=(n.items||[]).map((e,t)=>
1[String(t+1),(e.product_name||e.name||"")+(e.imei&&"-"!==e.imei&&"N/A"!==e.imei?"\nIMEI: "+e.imei:"")+(e.warranty&&"N/A"!==e.warranty?"\nWarranty: "+e.warranty:""),e.hsn_sac||"851712",String(e.quantity||1),u(e.price),u((e.price||0)*(e.quantity||1))]);if(t(r,{startY:_,head:[["#","Description","HSN/SAC","Qty","Rate (Rs.)","Amount (Rs.)"]],body:T,theme:"grid",tableWidth:m,margin:{left:8,right:8},styles:{fontSize:9,cellPadding:{top:3,right:3,bottom:3,left:3},lineColor:[200,200,200],lineWidth:.2,overflow:"linebreak",valign:"middle"},headStyles:{fillColor:[b,v,j],textColor:[255,255,255],fontStyle:"bold",halign:"center",fontSize:9},columnStyles:{0:{cellWidth:10,halign:"center"},1:{cellWidth:"auto",halign:"left"},2:{cellWidth:20,halign:"center"},3:{cellWidth:12,halign:"center"},4:{cellWidth:30,halign:"right"},5:{cellWidth:35,halign:"right",fontStyle:"bold"}}}),_=r.lastAutoTable.finalY+2,n.buy_back_items&&n.buy_back_items.length>0){const e=10,t=6+n.buy_back_items.length*e;r.setFillColor(255,247,237),r.rect(8,_,m,t,"F"),r.setDrawColor(b,v,j),r.rect(8,_,m,t),r.setFillColor(b,v,j),r.rect(8,_,m,5,"F"),r.setTextColor(255,255,255),r.setFontSize(6.5),r.setFont(void 0,"bold"),r.text("EXCHANGE ITEMS",11,_+3.5);let a=_+9;n.buy_back_items.forEach((t,o)=>{r.setTextColor(30,30,30),r.setFontSize(7),r.setFont(void 0,"normal");let n="".concat(o+1,". ").concat(t.name||"Exchange Item");t.imei&&"-"!==t.imei&&"N/A"!==t.imei&&(n+="  |  IMEI: ".concat(t.imei)),r.text(n,11,a,{maxWidth:144}),r.setFont(void 0,"bold"),r.setTextColor(200,30,30),r.text("- Rs. "+u(t.buy_back_value||0),199,a,{align:"right"}),a+=e}),_+=t+2}const R=115;r.setFillColor(249,250,251),r.rect(8,_,R,42,"F"),r.setDrawColor(210,210,210),r.rect(8,_,R,42),r.setTextColor(100,100,100),r.setFontSize(7),r.setFont(void 0,"bold"),r.text("AMOUNT IN WORDS",11,_+6),r.setTextColor(30,30,30),r.setFontSize(9),r.setFont(void 0,"italic");const z=r.splitTextToSize((e=>{const t=["","One","Two","Three","Four","Five","Six","Seven","Eight","Nine","Ten","Eleven","Twelve","Thirteen","Fourteen","Fifteen","Sixteen","Seventeen","Eighteen","Nineteen"],a=["","","Twenty","Thirty","Forty","Fifty","Sixty","Seventy","Eighty","Ninety"];if(0===e)return"Zero";const o=e=>0===e?"":e<20?t[e]:e<100?a[Math.floor(e/10)]+(e%10?" "+t[e%10]:""):t[Math.floor(e/100)]+" Hundred"+(e%100?" "+o(e%100):""),n=e=>e<1e3?o(e):e<1e5?o(Math.floor(e/1e3))+" Thousand"+(e%1e3?" "+o(e%1e3):""):e<1e7?o(Math.floor(e/1e5))+" Lakh"+(e%1e5?" "+n(e%1e5):""):o(Math.floor(e/1e7))+" Crore"+(e%1e7?" "+n(e%1e7):"");return n(Math.round(e))+" Rupees Only"})(n.final_total||n.total||0),109);r.text(z.slice(0,2),11,_+13);const E=n.payment_methods||[];if(E.length>0){r.setTextColor(100,100,100),r.setFontSize(6),r.setFont(void 0,"bold"),r.text("PAYMENT",11,_+22),r.setTextColor(30,30,30),r.setFontSize(7),r.setFont(void 0,"normal");const e=E.map(e=>"".concat("Other"===e.method&&e.custom_method?e.custom_method:e.method,": Rs.").concat(u(e.amount))).join("  |  ");r.text(e,11,_+28,{maxWidth:109})}r.setFillColor(b,v,j),r.roundedRect(127,_,75,42,2,2,"F"),r.setTextColor(255,255,255);const I=132,L=197;let k=_+9;r.setFontSize(8),r.setFont(void 0,"normal"),r.text("Subtotal:",I,k),r.text("Rs. "+u(n.total||n.subtotal||0),L,k,{align:"right"}),k+=7,n.gst_amount>0&&(n.margin_amount>0&&(r.text("Margin:",I,k),r.text("Rs. "+u(n.margin_amount),L,k,{align:"right"}),k+=5),r.text("CGST (9%):",I,k),r.text("Rs. "+u(n.cgst_amount||n.gst_amount/2),L,k,{align:"right"}),k+=5,r.text("SGST (9%):",I,k),r.text("Rs. "+u(n.sgst_amount||n.gst_amount/2),L,k,{align:"right"}),k+=6),n.buy_back_total>0&&(r.text("Exchange:",I,k),r.text("- Rs. "+u(n.buy_back_total),L,k,{align:"right"}),k+=6),r.setDrawColor(255,255,255),r.setLineWidth(.3),r.line(I,k-2,L,k-2),r.setFontSize(12),r.setFont(void 0,"bold"),r.text("TOTAL:",I,k+2),r.text("Rs. "+u(n.final_total||n.total||0),L,k+2,{align:"right"}),k+=10,r.setFontSize(8),r.setFont(void 0,"normal");const B=E.reduce((e,t)=>e+(t.amount||0),0);if(r.text("Received:",I,k),r.text("Rs. "+u(B),L,k,{align:"right"}),_+=46,n.narration){const e=r.splitTextToSize(n.narration,184),t=6+4*e.length;r.setFillColor(255,251,235),r.rect(8,_,m,t,"F"),r.setDrawColor(234,179,8),r.rect(8,_,m,t),r.setFillColor(234,179,8),r.rect(8,_,m,5,"F"),r.setTextColor(255,255,255),r.setFontSize(6),r.setFont(void 0,"bold"),r.text("NOTE",11,_+3.5),r.setTextColor(120,53,15),r.setFont(void 0,"normal"),r.setFontSize(7),r.text(e,11,_+9),_+=t+3}return r.setFillColor(249,250,251),r.rect(8,_,m,20,"F"),r.setDrawColor(210,210,210),r.rect(8,_,m,20),r.setFillColor(b,v,j),r.rect(8,_,m,6,"F"),r.setTextColor(255,255,255),r.setFontSize(7),r.setFont(void 0,"bold"),r.text("TERMS & CONDITIONS",11,_+4),r.setTextColor(60,60,60),r.setFont(void 0,"normal"),r.setFontSize(6.5),r.text("1. Goods once sold will not be taken back or exch
1anged.",11,_+11),r.text("2. All disputes subject to Ahmedabad jurisdiction.",11,_+16),r.text("3. Physical/water damage not covered under warranty.",103,_+11),r.text("4. Applying UV glass voids warranty.",103,_+16),_+=24,r.setDrawColor(160,160,160),r.setLineWidth(.2),r.setTextColor(100,100,100),r.setFontSize(7),r.line(8,_+15,63,_+15),r.text("Customer Signature",35,_+20,{align:"center"}),r.line(147,_+15,d,_+15),r.text("Authorized Signatory",175,_+20,{align:"center"}),r.setFillColor(b,v,j),r.rect(0,285,c,12,"F"),r.setTextColor(255,255,255),r.setFontSize(9),r.setFont(void 0,"bold"),r.text("Thank you for your business!",105,292,{align:"center"}),r},l=async e=>{let{invoice:t,branch:o,settings:l=null}=e;const{jsPDF:i}=await a.e(1578).then(a.bind(a,1578)),{autoTable:r}=await a.e(4857).then(a.bind(a,64857)),{PDFDocument:c}=await a.e(1105).then(a.bind(a,81105)),d=await(async()=>{if(null!==n)return n;try{const e=await fetch("/logo.jpg");if(!e.ok)return n="","";const t=await e.blob();return await new Promise(e=>{const a=new FileReader;a.onloadend=()=>{n=a.result,e(a.result)},a.onerror=()=>{n="",e("")},a.readAsDataURL(t)})}catch(e){return n="",""}})(),m=s(i,r,{invoice:t,branch:o,settings:l,logoBase64:d}).output("arraybuffer");try{const[e,t]=await Promise.all([c.load(m),fetch("/terms_conditions.pdf")]);if(t.ok){const a=await t.arrayBuffer(),o=await c.load(a);(await e.copyPages(o,o.getPageIndices())).forEach(t=>e.addPage(t));const n=await e.save();return new Blob([n],{type:"application/pdf"})}}catch(u){}return new Blob([m],{type:"application/pdf"})},i=async e=>{let{invoice:t,branch:a,settings:o=null}=e;const n=await l({invoice:t,branch:a,settings:o}),s=URL.createObjectURL(n),i=document.createElement("a");return i.href=s,i.download="".concat(t.invoice_number||"Bajaj-Invoice",".pdf"),document.body.appendChild(i),i.click(),i.remove(),URL.revokeObjectURL(s),n}}}]);
2//# sourceMappingURL=2400.e8079f44.chunk.js.map

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.