recaho-print-react 0.0.1301 → 0.0.1302
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -8490,6 +8490,7 @@ const st = (e) => {
|
|
|
8490
8490
|
const { needPackagingSlip: l = !0 } = r;
|
|
8491
8491
|
e.primaryWaiter && n && (e.primaryWaiter = ((h = n[e.primaryWaiter]) == null ? void 0 : h.name) || null);
|
|
8492
8492
|
const { obj: c, printersMap: d } = Id(e, t, r);
|
|
8493
|
+
console.log({ obj: c, printersMap: d });
|
|
8493
8494
|
let p = [], m = [];
|
|
8494
8495
|
const x = Aa(c).flatMap(
|
|
8495
8496
|
(j) => {
|
|
@@ -8552,7 +8553,7 @@ const st = (e) => {
|
|
|
8552
8553
|
);
|
|
8553
8554
|
});
|
|
8554
8555
|
}
|
|
8555
|
-
x.length && gt("root2", x), await Promise.all(m), i(p);
|
|
8556
|
+
console.log("kotComponents :::", x), x.length && gt("root2", x), await Promise.all(m), i(p);
|
|
8556
8557
|
} catch (l) {
|
|
8557
8558
|
a(l);
|
|
8558
8559
|
}
|
|
@@ -51,4 +51,4 @@ E.version="2.30.1",li(ge),E.fn=M,E.min=Kl,E.max=Ql,E.now=Zl,E.utc=Qe,E.unix=wc,E
|
|
|
51
51
|
* @license qrcode.react
|
|
52
52
|
* Copyright (c) Paul O'Shannessy
|
|
53
53
|
* SPDX-License-Identifier: ISC
|
|
54
|
-
*/var Wa={L:qt.QrCode.Ecc.LOW,M:qt.QrCode.Ecc.MEDIUM,Q:qt.QrCode.Ecc.QUARTILE,H:qt.QrCode.Ecc.HIGH},za=128,Ga="L",Va="#FFFFFF",qa="#000000",Ka=!1,fr=4,Sh=.1;function Qa(e,t=0){const n=[];return e.forEach(function(r,i){let a=null;r.forEach(function(h,f){if(!h&&a!==null){n.push(`M${a+t} ${i+t}h${f-a}v1H${a+t}z`),a=null;return}if(f===r.length-1){if(!h)return;a===null?n.push(`M${f+t},${i+t} h1v1H${f+t}z`):n.push(`M${a+t},${i+t} h${f+1-a}v1H${a+t}z`);return}h&&a===null&&(a=f)})}),n.join("")}function Za(e,t){return e.slice().map((n,r)=>r<t.y||r>=t.y+t.h?n:n.map((i,a)=>a<t.x||a>=t.x+t.w?i:!1))}function Ja(e,t,n,r){if(r==null)return null;const i=n?fr:0,a=e.length+i*2,h=Math.floor(t*Sh),f=a/t,o=(r.width||h)*f,l=(r.height||h)*f,c=r.x==null?e.length/2-o/2:r.x*f,d=r.y==null?e.length/2-l/2:r.y*f;let p=null;if(r.excavate){let m=Math.floor(c),x=Math.floor(d),j=Math.ceil(o+c-m),S=Math.ceil(l+d-x);p={x:m,y:x,w:j,h:S}}return{x:c,y:d,h:l,w:o,excavation:p}}var Th=function(){try{new Path2D().addPath(new Path2D)}catch{return!1}return!0}();function wh(e){const t=e,{value:n,size:r=za,level:i=Ga,bgColor:a=Va,fgColor:h=qa,includeMargin:f=Ka,style:o,imageSettings:l}=t,c=mr(t,["value","size","level","bgColor","fgColor","includeMargin","style","imageSettings"]),d=l==null?void 0:l.src,p=Ne.useRef(null),m=Ne.useRef(null),[x,j]=Ne.useState(!1);Ne.useEffect(()=>{if(p.current!=null){const w=p.current,I=w.getContext("2d");if(!I)return;let P=qt.QrCode.encodeText(n,Wa[i]).getModules();const D=f?fr:0,R=P.length+D*2,q=Ja(P,r,f,l),se=m.current,J=q!=null&&se!==null&&se.complete&&se.naturalHeight!==0&&se.naturalWidth!==0;J&&q.excavation!=null&&(P=Za(P,q.excavation));const ce=window.devicePixelRatio||1;w.height=w.width=r*ce;const Te=r/R*ce;I.scale(Te,Te),I.fillStyle=a,I.fillRect(0,0,R,R),I.fillStyle=h,Th?I.fill(new Path2D(Qa(P,D))):P.forEach(function(G,K){G.forEach(function(B,me){B&&I.fillRect(me+D,K+D,1,1)})}),J&&I.drawImage(se,q.x+D,q.y+D,q.w,q.h)}}),Ne.useEffect(()=>{j(!1)},[d]);const S=ys({height:r,width:r},o);let A=null;return d!=null&&(A=Ne.createElement("img",{src:d,key:d,style:{display:"none"},onLoad:()=>{j(!0)},ref:m})),Ne.createElement(Ne.Fragment,null,Ne.createElement("canvas",ys({style:S,height:r,width:r,ref:p},c)),A)}function Ih(e){const t=e,{value:n,size:r=za,level:i=Ga,bgColor:a=Va,fgColor:h=qa,includeMargin:f=Ka,imageSettings:o}=t,l=mr(t,["value","size","level","bgColor","fgColor","includeMargin","imageSettings"]);let c=qt.QrCode.encodeText(n,Wa[i]).getModules();const d=f?fr:0,p=c.length+d*2,m=Ja(c,r,f,o);let x=null;o!=null&&m!=null&&(m.excavation!=null&&(c=Za(c,m.excavation)),x=Ne.createElement("image",{xlinkHref:o.src,height:m.h,width:m.w,x:m.x+d,y:m.y+d,preserveAspectRatio:"none"}));const j=Qa(c,d);return Ne.createElement("svg",ys({height:r,width:r,viewBox:`0 0 ${p} ${p}`},l),Ne.createElement("path",{fill:a,d:`M0,0 h${p}v${p}H0z`,shapeRendering:"crispEdges"}),Ne.createElement("path",{fill:h,d:j,shapeRendering:"crispEdges"}),x)}var Xa=e=>{const t=e,{renderAs:n}=t,r=mr(t,["renderAs"]);return n==="svg"?Ne.createElement(Ih,ys({},r)):Ne.createElement(wh,ys({},r))};const gs=(e,t)=>t*100/e,Ch=e=>!!(e||e===0),Oh={ABSOLUTE:"AMT",RELATIVE:"%",COMPLIMENTARY:"COMPLIMENTARY"},L=new Object({"3INCH":{lines:"- - - - - - - - - - - - - - - - - - - - - - - - - - - - -",paperSize:"36rem",itemName:"Item Name ",dynamicClassname:"size-3inch",textSize:19},"2INCH":{lines:"- - - - - - - - - - - - - - - - - - - -",paperSize:"23rem",itemName:"Item Name ",dynamicClassname:"size-2inch",textSize:13},"2.5INCH":{paperSize:"28rem",itemName:"Item Name ",dynamicClassname:"size-2inch",textSize:13},"2.7INCH":{paperSize:"30.6rem",itemName:"Item Name ",dynamicClassname:"size-3inch",textSize:19},"1.8INCH":{paperSize:"20.7rem",itemName:"Item Name ",dynamicClassname:"size-2inch",textSize:13},A4:{paperSize:"297mm",itemName:"Item Name ",dynamicClassname:"size-a4",textSize:13},A5:{paperSize:"148mm",itemName:"Item Name ",dynamicClassname:"size-a5",textSize:9}});var xs=er(),_e="normal-class";(xs=="Android OS"||xs==="iOS")&&(_e="bold-class");const tt=e=>{var rt,Mt,Z,be,yt;const t=e.additionalActions??{},n=Ne.useRef(null),r=e.settingData?e.settingData:e.value.settingData,i=localStorage.getItem("siteId"),{staticDataKOT:a,printer:h,type:f}=e.printerDataObject,o=((Mt=(rt=e.value)==null?void 0:rt.settingData)==null?void 0:Mt.curr)??((Z=e.settingData)==null?void 0:Z.curr)??"INR";r==null||r.fontTheme;let l=e.printerDataObject.paperSize,c=lr(h,{type:f,siteSetting:e.settingData?e.settingData:e.value.settingData},t);const d=r.customLabels??gd();l=c?(be=c[0])!=null&&be.paperSize?(yt=c[0])==null?void 0:yt.paperSize:l||"3INCH":e.printerDataObject.paperSize;function p(g){const u=Math.abs(parseFloat(g));return m(u)}function m(g){switch(o){case"BHD":case"KWD":case"MUR":case"OMR":return Xs(g).format("0,00.000");default:return Xs(g).format("0,00.00")}}Ne.useEffect(()=>{A()},[e.newId]);const x=()=>new Promise(async(g,u)=>{if(xs=="Android OS"||xs==="iOS"){let C=await _h(n.current);if(C){const N=await S(C);g(N)}}else{let C=await Ua(n.current);C&&g(C)}}),j=()=>new Promise(async(g,u)=>{const C=await x();g(C)}),S=g=>new Promise((u,C)=>{let N=new Image;N.src=g,N.onload=()=>{let O=document.createElement("canvas");const F=600,T=N.height;let k=N.width,H=N.height;k>H?k>F&&(H*=F/k,k=F):H>T&&(k*=T/H,H=T),O.width=k,O.height=H,O.getContext("2d").drawImage(N,0,0,k,H),u(O.toDataURL())}}),A=async()=>{if(n&&n.current){const g=await j();e.onImageGenerated(g)}},w=g=>{let u=new Array;for(const C in g.menusCollection)C.endsWith("collection")||(g.menusCollection[`${C}_collection`]||g.menusCollection[C])&&u.push(s.jsxs("h5",{className:"left-align-entity level3-bold display-percentage",children:[s.jsx("span",{children:` -- ${C.replace("_"," ")}(${g.menusCollection[C]}):`}),s.jsx("span",{children:oe(g.menusCollection[`${C}_collection`],o)}),s.jsx("span",{children:m(gs(g.salesCollection.totalCollection,g.menusCollection[`${C}_collection`]??0))+"%"})]}));return g.salesCollection.online_aggregator_collection&&u.push(s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:` -- Aggregator(${g.salesCollection.online_aggregator}):`}),s.jsx("span",{children:oe(g.salesCollection.online_aggregator_collection,o)})]}),s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:` -- Zomato(${g.salesCollection.zomato_aggregator??0}):`}),s.jsx("span",{children:oe(g.salesCollection.zomato_aggregator_collection,o)})]}),s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:` -- Swiggy(${g.salesCollection.swiggy_aggregator??0}):`}),s.jsx("span",{children:oe(g.salesCollection.swiggy_aggregator_collection,o)})]})),u},I=g=>{let u=new Array,C=new Object;for(let N=0;N<g.todayCollection.length;N++)C=g.todayCollection[N],u.push(s.jsxs("h5",{className:"left-align-entity level3-bold display-percentage",children:[s.jsx("span",{children:` -- ${C.displayName}:`}),s.jsx("span",{children:oe(C.value,o)}),s.jsx("span",{children:m(gs(g.totalCollection,C.value))+"%"})]}));return u},P=(g,u,C,N,O={})=>{let F=g.includes("upi://");const T=`upi://pay?pa=${g}&pn=${C}&cu=INR&am=${N}&tr=${u}`;return s.jsx(Xa,{value:F?g:T,renderAs:"canvas",size:O.size??250})},D=(g,u)=>{var F,T;let C=0;if((F=u.taxObj)!=null&&F.VAT.length){let k,H,fe;for(H=0;H<((T=u.taxObj)==null?void 0:T.VAT.length);H++){k=u.taxObj.VAT[H];for(fe in k)C+=ve(k[fe])}}const N={sellerName:u.companyInfo.companyName,vatRegistrationNumber:g,invoiceTimestamp:new Date(u.orderInfo.timestamp*1e3).toISOString(),invoiceTotal:u.finalAmount,invoiceVatTotal:C},O=yd(N.sellerName,N.vatRegistrationNumber,N.invoiceTimestamp,N.invoiceTotal,N.invoiceVatTotal.toFixed(2));return s.jsx(Xa,{value:O,renderAs:"canvas",size:250})},R=g=>{const u=[];return(g.totalBalanceAmt||g.refundAmt||g.writeOffAmt||g.rewardAmt||g.cashCard)&&(u.push(s.jsx("hr",{})),g.rewardAmt&&u.push(s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:"REWARDS:"}),s.jsx("span",{children:oe(g.rewardAmt,o)})]})),g.totalBalanceAmt&&u.push(s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:"OUTSTANDING AMOUNT:"}),s.jsx("span",{children:oe(g.totalBalanceAmt,o)})]})),g.writeOffAmt&&u.push(s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:"WRITE OFF AMOUNT:"}),s.jsx("span",{children:oe(g.writeOffAmt,o)})]})),g.refundAmt&&u.push(s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:"REFUND AMOUNT:"}),s.jsx("span",{children:oe(g.refundAmt,o)})]})),g.cashCard&&u.push(s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:"CASH CARD:"}),s.jsx("span",{children:oe(g.cashCard,o)})]}))),u},q=(g,u)=>{if(u&&u.length){for(let C=0;C<u.length;C++)if(u[C].slugName===g)return u[C]}return!1},se=(g,u)=>{if(u&&u.length){for(let C=0;C<u.length;C++)if(u[C].itemType===g)return u[C]}return!1},J=new Object({CREDIT:"Other Income",DEBIT:"Expense"}),ce=g=>g.discountType==="COMPLIMENTARY"?"@ COMPLIMENTARY":`@ ${g.discountValue}${Oh[g.discountType]}`,Te=g=>{const u=new Array;if(g&&Object.keys(g).length!==0){u.push(s.jsx("h4",{className:"single-entity-and-center",children:"ACCOUNTS"}));for(const C in g)if(u.push(s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:`Total ${J[C]}:`}),s.jsx("span",{children:oe(g[C].total,o)})]})),C&&Object.keys(C).length!==0)for(const N in g[C])N!=="total"&&g[C][N]&&u.push(s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:` -- ${Ke(N)}:`}),s.jsx("span",{children:oe(g[C][N],o)})]}))}return u},G=(g,u)=>{let C=!1;g.totalValue&&(C=Object.keys(g.totalValue).length>1);let N=new Object;return s.jsxs(s.Fragment,{children:[g.totalValue&&Object.keys(g.totalValue).map(F=>{if(N=g.totalValue[F],F==="GST")return s.jsxs(s.Fragment,{children:[s.jsx("hr",{}),s.jsxs("section",{className:"products-section",children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h4",{className:`items products-heading-name ${L[l].dynamicClassname}`,dangerouslySetInnerHTML:{__html:u.item_name}}),s.jsx("h4",{className:`items products-heading-qty ${L[l].dynamicClassname}`,dangerouslySetInnerHTML:{__html:u.qty}}),s.jsx("h4",{className:`items products-heading-rate ${L[l].dynamicClassname}`,dangerouslySetInnerHTML:{__html:u.rate}}),s.jsx("h4",{className:`items products-heading-amt ${L[l].dynamicClassname}`,dangerouslySetInnerHTML:{__html:u.amt}})]}),s.jsx("hr",{})]}),s.jsxs("section",{className:"products-section",style:{paddingTop:"12px"},children:[g.itemList&&g.itemList.length&&g.itemList.length>0&&g.itemList.map(T=>{if(T.taxType===F||!T.taxType)return s.jsxs("div",{style:T.name.startsWith("+ ")?{}:{paddingTop:"12px"},children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsxs("h6",{className:`items products-heading-name ${L[l].dynamicClassname}`,style:{fontWeight:"lighter",lineHeight:1.2},children:[T.status==="RETURNED"?"(R) ":"",T.name.toUpperCase()]}),s.jsxs("h6",{className:`items products-heading-qty ${L[l].dynamicClassname}`,style:{fontWeight:"lighter"},children:[T.status==="RETURNED"?"-":"",T.quantity]}),s.jsx("h6",{className:`items products-heading-rate ${L[l].dynamicClassname}`,style:{fontWeight:"lighter"},children:T.rate?p(T.rate):""}),s.jsx("h6",{className:`items products-heading-amt ${L[l].dynamicClassname}`,style:{fontWeight:"lighter"},children:T.status==="RETURNED"?T.serviceAmount?m(T.serviceAmount):"":T.price?m(T.price):""})]}),T.addons&&T.addons.length&&T.addons.map(k=>s.jsx("h6",{className:`items products-heading-addon-kot ${L[l].dynamicClassname}`,children:"- "+Ke(k.serviceName)})),T.instruction&&g.itemInstructionOnBill&&s.jsx("h6",{className:"left-align-entity level2-bold",children:s.jsx("h6",{className:"items products-heading-addon-kot",children:" ("+T.instruction+")"})})]})}),s.jsx("hr",{})]}),s.jsxs("div",{className:`bottom-section ${L[l].dynamicClassname}`,children:[s.jsxs("div",{className:"bottom-section-div inline-display",style:{paddingTop:"12px"},children:[s.jsx("h5",{className:"total-qty",dangerouslySetInnerHTML:{__html:u.subtotal}}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+m(N.gstTTL)})]}),i=="25e5f1e4-68ff-43a7-b042-bebb93f42b94"?s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h5",{className:"total-qty",children:"المجموع الفرعي"}),s.jsx("h5",{className:"actual-qty"})]}):"",N&&N.cat&&Object.keys(N.cat).length>0?Object.keys(N.cat).map(T=>{const k=q(T,g.discArr);if(k&&N.cat[T]!==0&&k.serviceName)return s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{className:"total-qty",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:u[`disc_${k.serviceName.toLowerCase()}`]??"DISC-"+k.serviceName.toUpperCase()}}),s.jsx("span",{children:" @"+k.discountValue+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+m(N.cat[T])})]})}):"",g.totalItemDisc&&N&&N.itemTypes&&Object.keys(N.itemTypes).length>0?Object.keys(N.itemTypes).map(T=>{const k=se(T,g.itemTypeDiscObj);if(k&&N.itemTypes[T]!==0&&k.itemType&&k.value)return s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{className:"total-qty",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:u[`disc_${k.itemType.toLowerCase()}`]??"DISC-"+k.itemType.toUpperCase()}}),s.jsx("span",{children:" @"+k.value+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+m(N.itemTypes[T])})]})}):"",g.segMentDisc&&N&&N.segDisc?s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{className:"total-qty",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:u[`segment_disc${g.segMentObj.segmentName.toLowerCase()}`]??g.segMentObj.segmentName.toUpperCase()+"DISC"}}),s.jsx("span",{children:" @"+g.segMentObj.discountValue+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+m(N.segDisc)})]}):"",N&&N.orderDisc?s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{className:"total-qty",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:g.couponCode?u.coupon_disc??"COUPON DISC":u.order_disc??"ORDER DISC"}}),":",s.jsxs("span",{children:[g.couponCode?`(${g.couponCode.toUpperCase()})`:"",m(g.dicsEnterValue)?`@${g.dicsEnterValue}${g.discountType=="RELATIVE"||g.discountType=="COMPLIMENTARY"?"%":"AMT"}`:""]})]})}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+m(N.orderDisc)})]}):"",i=="25e5f1e4-68ff-43a7-b042-bebb93f42b94"&&N&&N.orderDisc?s.jsxs("div",{className:"bottom-section-div",children:[s.jsxs("h5",{className:"total-qty",children:[" ",g.couponCode?"COUPON DISC":"خصم الطلب",g.couponCode?`(${g.couponCode.toUpperCase()})`:""]}),s.jsx("h5",{className:"actual-qty"})]}):"",N.otherCharges&&N.otherCharges.length>0?N.otherCharges.map(T=>s.jsx(s.Fragment,{children:s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{className:"total-qty",dangerouslySetInnerHTML:{__html:u[`charges_${T.name.toLowerCase()}`]??T.name}}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+m(T.amt)})]})})):"",N&&N.aftDisc&&N.gstTTL!==N.aftDisc?s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{className:"total-qty",dangerouslySetInnerHTML:{__html:u.amt_before_tax}}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+m(N.aftDisc)})]}):"",i=="25e5f1e4-68ff-43a7-b042-bebb93f42b94"&&N&&N.aftDisc&&N.gstTTL!==N.aftDisc?s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h5",{className:"total-qty",children:"المبلغ قبل الضريبة"}),s.jsx("h5",{className:"actual-qty"})]}):"",g.taxObj&&g.taxObj[F]&&N?s.jsx(s.Fragment,{children:F==="GST"?g.taxObj[F].map(T=>{let k=new Array;for(const H in T)if(T[H]&&T[H]!=0){let fe=H/2;k.push(s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h5",{className:"total-qty",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:u.cgst}}),s.jsx("span",{children:" @"+fe+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+m(T[H]/2)})]}),s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h5",{className:"total-qty",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:u[g.taxLabel.toLowerCase()]}}),s.jsx("span",{children:" @"+fe+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+m(T[H]/2)})]})]}))}return k}):g.taxObj[F].map(T=>{let k=new Array;for(const H in T)if(T[H]&&T[H]!=0){let fe=H;k.push(s.jsx(s.Fragment,{children:s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h5",{className:"total-qty",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:u.vat}}),s.jsx("span",{children:" @"+fe+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+m(T[H])})]})}))}return k})}):"",N.gstTTL!==(N.total||0)+(N.aftDisc||0)+N.taxOnCharges&&s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{className:"total-qty",dangerouslySetInnerHTML:{__html:u.total}}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+m((N.total||0)+(N.aftDisc||0)+N.taxOnCharges)})]}),i=="25e5f1e4-68ff-43a7-b042-bebb93f42b94"&&N.gstTTL!==(N.total||0)+(N.aftDisc||0)+N.taxOnCharges&&s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h5",{className:"total-qty",children:"المجموع"}),s.jsx("h5",{className:"actual-qty"})]}),g.totalValue&&(Object.keys(g.totalValue).length||0)>1?s.jsx("h4",{className:"single-entity-and-center",style:{marginTop:"10px"},children:"- - - - -"}):"",C&&s.jsx("div",{className:"space-2rem"})]})]})}),g.totalValue&&Object.keys(g.totalValue).map(F=>{if(N=g.totalValue[F],F==="VAT")return s.jsxs(s.Fragment,{children:[s.jsx("hr",{}),s.jsxs("section",{className:"products-section",children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h6",{className:`items products-heading-name ${L[l].dynamicClassname}`,dangerouslySetInnerHTML:{__html:u.item_name}}),s.jsx("h6",{className:`items products-heading-qty ${L[l].dynamicClassname}`,dangerouslySetInnerHTML:{__html:u.qty}}),s.jsx("h6",{className:`items products-heading-rate ${L[l].dynamicClassname}`,dangerouslySetInnerHTML:{__html:u.rate}}),s.jsx("h6",{className:`items products-heading-amt ${L[l].dynamicClassname}`,dangerouslySetInnerHTML:{__html:u.amt}})]}),s.jsx("hr",{})]}),s.jsxs("section",{className:"products-section",style:{paddingTop:"12px"},children:[g.itemList&&g.itemList.length&&g.itemList.length>0&&g.itemList.map(T=>{if(T.taxType===F)return s.jsxs("div",{style:T.name.startsWith("+ ")?{}:{paddingTop:"12px"},children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsxs("h6",{className:`items products-heading-name ${L[l].dynamicClassname}`,children:[T.status==="RETURNED"?"(R) ":"",T.name.toUpperCase()]}),s.jsxs("h6",{className:`items products-heading-qty ${L[l].dynamicClassname}`,children:[T.status==="RETURNED"?"-":"",T.quantity]}),s.jsx("h6",{className:`items products-heading-rate ${L[l].dynamicClassname}`,children:T.rate?p(T.rate):""}),s.jsx("h6",{className:`items products-heading-amt ${L[l].dynamicClassname}`,children:T.status==="RETURNED"?T.serviceAmount?m(T.serviceAmount):"":T.price?m(T.price):""})]}),T.addons&&T.addons.length&&T.addons.map(k=>s.jsx("h6",{className:`items products-heading-addon-kot ${L[l].dynamicClassname}`,children:"- "+Ke(k.serviceName)})),T.instruction&&g.itemInstructionOnBill&&s.jsx("h6",{className:"left-align-entity level2-bold",children:s.jsx("h6",{className:"items products-heading-addon-kot",children:" ("+T.instruction+")"})})]})}),s.jsx("hr",{})]}),s.jsxs("div",{className:`bottom-section ${L[l].dynamicClassname}`,children:[s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{className:"total-qty",dangerouslySetInnerHTML:{__html:u.subtotal}}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+m(N.vatTTL)})]}),i=="25e5f1e4-68ff-43a7-b042-bebb93f42b94"?s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h5",{className:"total-qty",children:"المجموع الفرعي"}),s.jsx("h5",{className:"actual-qty"})]}):"",N&&N.cat&&Object.keys(N.cat).length>0?Object.keys(N.cat).map(T=>{const k=q(T,g.discArr);if(k&&N.cat[T]!==0&&k.serviceName)return s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{className:"total-qty",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:u[`disc_${k.serviceName.toLowerCase()}`]??"DISC-"+k.serviceName.toUpperCase()}}),s.jsx("span",{children:" @"+k.discountValue+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+m(N.cat[T])})]})}):"",g.totalItemDisc&&N&&N.itemTypes&&Object.keys(N.itemTypes).length>0?Object.keys(N.itemTypes).map(T=>{const k=se(T,g.itemTypeDiscObj);if(k&&N.itemTypes[T]!==0&&k.itemType&&k.value)return s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{className:"total-qty",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:u[`disc_${k.itemType.toLowerCase()}`]??"DISC-"+k.itemType.toUpperCase()}}),s.jsx("span",{children:" @"+k.value+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+m(N.itemTypes[T])})]})}):"",g.segMentDisc&&N&&N.segDisc?s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{className:"total-qty",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:u[`segment_disc${g.segMentObj.segmentName.toLowerCase()}`]??g.segMentObj.segmentName.toUpperCase()+"DISC"}}),s.jsx("span",{children:" @"+g.segMentObj.discountValue+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+m(N.segDisc)})]}):"",N&&N.orderDisc?s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{className:"total-qty",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:g.couponCode?u.coupon_disc??"COUPON DISC":u.order_disc??"ORDER DISC"}}),":",s.jsxs("span",{children:[g.couponCode?`(${g.couponCode.toUpperCase()})`:"",m(g.dicsEnterValue)?`@${g.dicsEnterValue}${g.discountType=="RELATIVE"||g.discountType=="COMPLIMENTARY"?"%":"AMT"}`:""]})]})}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+m(N.orderDisc)})]}):"",i=="25e5f1e4-68ff-43a7-b042-bebb93f42b94"&&N&&N.orderDisc?s.jsxs("div",{className:"bottom-section-div",children:[s.jsxs("h5",{className:"total-qty",children:[" ",g.couponCode?"COUPON DISC":"خصم الطلب",g.couponCode?`(${g.couponCode.toUpperCase()})`:""]}),s.jsx("h5",{className:"actual-qty"})]}):"",N.otherCharges&&N.otherCharges.length>0?N.otherCharges.map(T=>s.jsx(s.Fragment,{children:s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{className:"total-qty",dangerouslySetInnerHTML:{__html:u[`charges_${T.name.toLowerCase()}`]??T.name}}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+m(T.amt)})]})})):"",N&&N.aftDisc&&N.vatTTL!==N.aftDisc?s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{className:"total-qty",dangerouslySetInnerHTML:{__html:u.amt_before_tax}}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+m(N.aftDisc)})]}):"",i=="25e5f1e4-68ff-43a7-b042-bebb93f42b94"&&N&&N.aftDisc&&N.vatTTL!==N.aftDisc?s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h5",{className:"total-qty",children:"المبلغ قبل الضريبة"}),s.jsx("h5",{className:"actual-qty"})]}):"",N.otherCharges&&N.otherCharges.length>0?N.otherCharges.map(T=>s.jsx(s.Fragment,{children:T.taxOnAmount&&T.taxOnAmount!=0?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h5",{className:"total-qty",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:u.cgst}}),s.jsx("span",{children:" @"+T.tax/2+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+m(T.taxOnAmount/2)})]}),s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h5",{className:"total-qty",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:u[g.taxLabel.toLowerCase()]}}),s.jsx("span",{children:" @"+T.tax/2+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+m(T.taxOnAmount/2)})]})]}):""})):"",g.taxObj&&g.taxObj[F]&&N?s.jsx(s.Fragment,{children:F==="GST"?g.taxObj[F].map(T=>{let k=new Array;for(const H in T)if(T[H]&&T[H]!=0){let fe=H/2;k.push(s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h5",{className:"total-qty",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:u.cgst}}),s.jsx("span",{children:" @"+fe+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+m(T[H]/2)})]}),s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h5",{className:"total-qty",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:u[g.taxLabel.toLowerCase()]}}),s.jsx("span",{children:" @"+fe+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+m(T[H]/2)})]})]}))}return k}):g.taxObj[F].map(T=>{let k=new Array;for(const H in T)if(T[H]&&T[H]!=0){let fe=H;k.push(s.jsx(s.Fragment,{children:s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h5",{className:"total-qty",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:u.vat}}),s.jsx("span",{children:" @"+fe+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+m(T[H])})]})}))}return k})}):"",N.vatTTL!==(N.total||0)+(N.aftDisc||0)+N.taxOnCharges&&s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{className:"total-qty",dangerouslySetInnerHTML:{__html:u.total}}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+m((N.total||0)+(N.aftDisc||0)+N.taxOnCharges)})]}),i=="25e5f1e4-68ff-43a7-b042-bebb93f42b94"&&N.vatTTL!==(N.total||0)+(N.aftDisc||0)+N.taxOnCharges&&s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h5",{className:"total-qty",children:"المجموع"}),s.jsx("h5",{className:"actual-qty"})]})]})]})})]})},K=(g,u,{labels:C,doMultipleTax:N,type:O})=>{var T,k,H,fe,Ae,Le,Pe,Me,Ue,At,gt;const F=g.discounts;return s.jsxs(s.Fragment,{children:[s.jsx("hr",{}),s.jsxs("section",{className:"products-section",children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h4",{className:`items products-heading-name ${L[l].dynamicClassname}`,dangerouslySetInnerHTML:{__html:C.item_name}}),s.jsx("h4",{className:`items products-heading-qty ${L[l].dynamicClassname}`,dangerouslySetInnerHTML:{__html:C.qty}}),s.jsx("h4",{className:`items products-heading-rate ${L[l].dynamicClassname}`,dangerouslySetInnerHTML:{__html:C.rate}}),s.jsx("h4",{className:`items products-heading-amt ${L[l].dynamicClassname}`,dangerouslySetInnerHTML:{__html:C.amt}})]}),s.jsx("hr",{})]}),s.jsxs("section",{className:"products-section",style:{paddingTop:"12px"},children:[g.itemList.map(V=>{var Et;return s.jsxs("div",{style:V.serviceName.startsWith("+ ")?{}:{paddingTop:"12px"},children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsxs("h6",{className:`items products-heading-name ${L[l].dynamicClassname}`,style:{lineHeight:1.2},children:[V.status==="RETURNED"?"(R) ":"",V.serviceName.toUpperCase()]}),s.jsxs("h6",{className:`items products-heading-qty ${L[l].dynamicClassname}`,children:[V.status==="RETURNED"?"-":"",V.qty]}),s.jsx("h6",{className:`items products-heading-rate ${L[l].dynamicClassname}`,children:V.serviceRate?p(V.serviceRate):""}),s.jsx("h6",{className:`items products-heading-amt ${L[l].dynamicClassname}`,children:V.sub_total?m(V.sub_total):""})]}),V.hsnCode&&u.printHSNCodeOnBill&&s.jsxs("h6",{className:`items products-heading-name ${L[l].dynamicClassname}`,style:{lineHeight:1.2},children:["HSN: ",V.hsnCode]}),(Et=V.addons)!=null&&Et.length?V.addons.map(at=>s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h6",{className:`items products-heading-name ${L[l].dynamicClassname}`,style:{lineHeight:1.2},children:"+ "+Ke(at.serviceName)}),s.jsxs("h6",{className:`items products-heading-qty ${L[l].dynamicClassname}`,children:[V.status==="RETURNED"?"-":"",at.qty*V.qty]}),s.jsx("h6",{className:`items products-heading-rate ${L[l].dynamicClassname}`}),s.jsx("h6",{className:`items products-heading-amt ${L[l].dynamicClassname}`})]}),s.jsx("div",{children:at.hsnCode&&u.printHSNCodeOnBill&&s.jsxs("h6",{className:`items products-heading-name ${L[l].dynamicClassname}`,style:{lineHeight:1.2},children:["HSN: ",at.hsnCode]})})]})):"",V.instruction?s.jsx("h6",{className:"left-align-entity level2-bold",children:s.jsx("h6",{className:"items products-heading-addon-kot",children:" ("+V.instruction+")"})}):""]})}),s.jsx("hr",{})]}),s.jsxs("div",{className:`bottom-section ${L[l].dynamicClassname} ${_e}`,children:[s.jsxs("div",{className:"bottom-section-div inline-display",style:{paddingTop:"12px"},children:[s.jsx("h5",{className:"total-qty",dangerouslySetInnerHTML:{__html:C.subtotal}}),s.jsx("h5",{className:"actual-qty",children:u.curr+" "+m(g.subTotal)})]}),i=="25e5f1e4-68ff-43a7-b042-bebb93f42b94"?s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h5",{className:"total-qty",children:"المجموع الفرعي"}),s.jsx("h5",{className:"actual-qty"})]}):""]}),(T=F.DISCOUNT_ITEMS)!=null&&T.length?F.DISCOUNT_ITEMS.map(V=>s.jsxs("div",{className:`bottom-section-div inline-display ${_e}`,children:[s.jsx("h5",{className:"total-qty",children:s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:C[`disc_${V.discountName.toLowerCase()}`]??"DISC-"+V.discountName.toUpperCase()}}),s.jsx("span",{children:ce(V)})]})}),s.jsx("h5",{className:"actual-qty",children:u.curr+" "+m(V.discountAmt)})]})):"",(k=F.CATEGORY_DISCOUNT)!=null&&k.length?F.CATEGORY_DISCOUNT.map(V=>s.jsxs("div",{className:`bottom-section-div inline-display ${_e}`,children:[s.jsx("h5",{className:"total-qty",children:s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:C[`disc_${V.discountName.toLowerCase()}`]??"DISC-"+V.discountName.toUpperCase()}}),s.jsx("span",{children:" @"+V.discountValue+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:u.curr+" "+m(V.discountAmt)})]})):"",(H=F.ITEM_DISCOUNT)!=null&&H.length?F.ITEM_DISCOUNT.map(V=>s.jsxs("div",{className:`bottom-section-div inline-display ${_e}`,children:[s.jsx("h5",{className:"total-qty",children:s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:C[`disc_${V.discountName.toLowerCase()}`]??"DISC-"+ts(V.discountName).toUpperCase()}}),s.jsx("span",{children:" @"+V.discountValue+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:u.curr+" "+m(V.discountAmt)})]})):"",(Ae=(fe=F.SEGMENT_DISCOUNT)==null?void 0:fe[0])!=null&&Ae.discountAmt?s.jsxs("div",{className:`bottom-section-div inline-display ${_e}`,children:[s.jsx("h5",{className:"total-qty",children:s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:C[`segment_disc${F.SEGMENT_DISCOUNT[0].discountName.toLowerCase()}`]??"DISC-"+F.SEGMENT_DISCOUNT[0].discountName.toUpperCase()}}),":",s.jsx("span",{children:" @"+F.SEGMENT_DISCOUNT[0].discountValue+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:u.curr+" "+m(F.SEGMENT_DISCOUNT[0].discountAmt)})]}):"",(Pe=(Le=F.COUPON_DISCOUNT)==null?void 0:Le[0])!=null&&Pe.discountAmt?s.jsxs("div",{className:`bottom-section-div inline-display ${_e}`,children:[s.jsx("h5",{className:"total-qty",children:s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:"COUPON DISC"}}),":",s.jsx("span",{children:`(${F.COUPON_DISCOUNT[0].discountName.toUpperCase()}) @${F.COUPON_DISCOUNT[0].discountValue}${F.COUPON_DISCOUNT[0].discountType=="RELATIVE"?"%":"AMT"}`})]})}),s.jsx("h5",{className:"actual-qty",children:u.curr+" "+m(F.COUPON_DISCOUNT[0].discountAmt)})]}):"",(Ue=(Me=F.ORDER_DISCOUNT)==null?void 0:Me[0])!=null&&Ue.discountAmt?s.jsxs("div",{className:`bottom-section-div inline-display ${_e}`,children:[s.jsx("h5",{className:"total-qty",children:s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:C.order_disc??"ORDER DISC"}}),":",s.jsx("span",{children:m(F.ORDER_DISCOUNT[0].discountValue)?`@${F.ORDER_DISCOUNT[0].discountValue}${F.ORDER_DISCOUNT[0].discountType=="RELATIVE"||F.ORDER_DISCOUNT[0].discountType=="COMPLIMENTARY"?"%":"AMT"}`:""})]})}),s.jsx("h5",{className:"actual-qty",children:u.curr+" "+m(F.ORDER_DISCOUNT[0].discountAmt)})]}):"",i=="25e5f1e4-68ff-43a7-b042-bebb93f42b94"&&g&&g.orderDisc?s.jsxs("div",{className:`bottom-section-div ${_e}`,children:[s.jsxs("h5",{className:"total-qty",children:[" ",u.couponCode?"COUPON DISC":"خصم الطلب",u.couponCode?`(${u.couponCode.toUpperCase()})`:""]}),s.jsx("h5",{className:"actual-qty"})]}):"",(At=g.charges)!=null&&At.length?g.charges.map(V=>s.jsx(s.Fragment,{children:s.jsxs("div",{className:`bottom-section-div inline-display ${_e}`,children:[s.jsx("h5",{className:"total-qty",children:s.jsx("span",{dangerouslySetInnerHTML:{__html:C[`charges_${V.name.toLowerCase()}`]??V.name}})}),s.jsx("h5",{className:"actual-qty",children:u.curr+" "+m(V.amt)})]})})):"",g.subTotal!==g.afterCharges&&g.afterCharges!==g.total?s.jsxs("div",{className:`bottom-section-div inline-display ${_e}`,children:[s.jsx("h5",{className:"total-qty",dangerouslySetInnerHTML:{__html:C.amt_before_tax}}),s.jsx("h5",{className:"actual-qty",children:u.curr+" "+m(g.afterCharges)})]}):"",i=="25e5f1e4-68ff-43a7-b042-bebb93f42b94"&&g.subTotal!==g.afterCharges?s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h5",{className:"total-qty",children:"المبلغ قبل الضريبة"}),s.jsx("h5",{className:"actual-qty"})]}):"",(gt=g.taxation)!=null&>.length?g.taxation.map(V=>{if(V.taxAmt)return V.taxType==="GST"?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:`bottom-section-div ${_e}`,children:[s.jsx("h5",{className:"total-qty",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:C.cgst}}),s.jsx("span",{children:"@"+V.tax/2+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:u.curr+" "+m(V.taxAmt/2)})]}),s.jsxs("div",{className:`bottom-section-div ${_e}`,children:[s.jsx("h5",{className:"total-qty",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:C[u.taxLabel.toLowerCase()]}}),s.jsx("span",{children:"@"+V.tax/2+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:u.curr+" "+m(V.taxAmt/2)})]})]}):s.jsxs("div",{className:`bottom-section-div ${_e}`,children:[s.jsx("h5",{className:"total-qty",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:C.vat}}),s.jsx("span",{children:"@"+V.tax+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:u.curr+" "+m(V.taxAmt)})]})}):"",s.jsxs("div",{className:`bottom-section-div inline-display ${_e}`,children:[s.jsx("h5",{className:"total-qty",dangerouslySetInnerHTML:{__html:C.total}}),s.jsx("h5",{className:"actual-qty",children:u.curr+" "+m(g.total)})]}),N?s.jsx(s.Fragment,{children:O==="GST"?s.jsxs(s.Fragment,{children:[s.jsx("h4",{className:"single-entity-and-center",style:{marginTop:"10px"},children:"- - - - -"}),s.jsx("div",{className:"space-2rem"})]}):""}):""]})},B=(g,u)=>{var F,T;let C=!1;const N=g.distributedData;return g.distributedData&&(C=Object.keys(g.distributedData).length>1),s.jsxs(s.Fragment,{children:[((F=N.GST)==null?void 0:F.itemList)&&K(N.GST,g,{labels:u,doMultipleTax:C,type:"GST"}),((T=N.VAT)==null?void 0:T.itemList)&&K(N.VAT,g,{labels:u,doMultipleTax:C,type:"VAT"})]})},me=g=>{const u=g.services,C=Object.keys(g.services),N=C.length;return s.jsxs(s.Fragment,{children:[s.jsx("hr",{}),s.jsxs("section",{className:`products-section ${_e}`,children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h5",{className:"items products-heading-name-kot",children:L[l].itemName}),s.jsx("h5",{className:"items products-heading-qty-kot",children:"QTY"})]}),s.jsx("hr",{})]}),s.jsxs("section",{className:"products-section",children:[N&&C.map((F,T)=>s.jsxs(s.Fragment,{children:[s.jsx("h4",{className:"left-align-entity level3-bold",children:s.jsxs("u",{children:[F.toUpperCase(),":"]})}),u[F].map(k=>{var H;return s.jsxs("div",{children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h4",{className:`items products-heading-name-kot ${L[l].dynamicClassname}`,children:Ke(k.serviceName)}),s.jsx("h4",{className:`items products-heading-qty-kot ${L[l].dynamicClassname}`,children:k.qty})]}),((H=k.addons)==null?void 0:H.length)&&k.addons.map(fe=>{var Ae;return s.jsx("h5",{className:"items products-heading-addon-kot",children:"- "+((Ae=fe.serviceName)==null?void 0:Ae.toUpperCase())})}),k.instruction&&s.jsx("h5",{className:"left-align-entity",children:s.jsx("h5",{className:"items products-heading-addon-kot",children:" ("+k.instruction+")"})})]})}),N!==T+1&&s.jsx("br",{})]})),s.jsx("hr",{})]})]})},$=g=>{const u=g.slice(0,-4),C=g.slice(-4);return{firstDigits:u,last4Dgits:C}},Q=(g,u,C,N={})=>{const O=Object.keys(u??{});let F=[],T,k="flex-two-items";if(N.action==="addCharges"&&(k="display-percentage"),g&&O.length){F.push(s.jsxs(s.Fragment,{children:[s.jsx("h4",{className:"single-entity-and-center",children:`${C.toUpperCase()} BREAK-UP`}),s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsxs("span",{children:["Total ",C,":"]}),s.jsx("span",{children:oe(g,o)})]})]}));for(let H=0;H<O.length;H++)T=O[H],u[T]&&F.push(s.jsxs("h5",{className:`left-align-entity level3-bold ${k} second-span-right`,children:[s.jsx("span",{children:` -- ${T.replaceAll("_"," ")}:`}),s.jsx("span",{children:oe(u[T],o)}),N.action==="addCharges"?s.jsx("span",{children:m(gs(g,u[T]))+"%"}):""]}));F.push(s.jsx("hr",{}))}return F},st=g=>{const u=Object.keys(g.Category),C=Object.keys(g.Addon);let N=new Array;return N.push(s.jsxs(s.Fragment,{children:[s.jsx("h3",{className:"left-align-entity level3-bold",children:"Product Category"}),s.jsx("hr",{className:"dashed"})]})),u.forEach((O,F)=>{const T=g.Category[O];let k=[];N.push(s.jsxs(s.Fragment,{children:[s.jsxs("h4",{className:"left-align-entity level3-bold",children:[" - "," ",ts(O)]}),s.jsxs("section",{className:"products-section",children:[T.forEach(H=>{k.push(s.jsx(s.Fragment,{children:s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h6",{className:`items products-heading-name-kot ${L["3INCH"].dynamicClassname}`,children:H.serviceName}),s.jsx("h6",{className:`items products-heading-qty-kot ${L["3INCH"].dynamicClassname}`,children:parseFloat(H.qty.toFixed(2))})]})}))}),k,F!=u.length-1&&s.jsx("hr",{})]})]}))}),C.length>0&&(N.push(s.jsxs(s.Fragment,{children:[s.jsx("hr",{}),s.jsx("h3",{className:"left-align-entity level3-bold",children:"Addon Category"}),s.jsx("hr",{className:"dashed"})]})),C.forEach((O,F)=>{const T=g.Addon[O];let k=[];N.push(s.jsxs(s.Fragment,{children:[s.jsxs("h4",{className:"left-align-entity level3-bold",children:[" - "," ",ts(O)]}),s.jsxs("section",{className:"products-section",children:[T.forEach(H=>{k.push(s.jsx(s.Fragment,{children:s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h6",{className:`items products-heading-name-kot ${L["3INCH"].dynamicClassname}`,children:H.serviceName}),s.jsx("h6",{className:`items products-heading-qty-kot ${L["3INCH"].dynamicClassname}`,children:parseFloat(H.qty.toFixed(2))})]})}))}),k,F!=C.length-1&&s.jsx("hr",{className:"dashed"})]})]}))})),N},nt=g=>{var C;const u={company_mobile:"Mob",company_Email:"Email",company_GST:"GST",company_VAT:"VAT",company_FSSAI:"FSSAI",name:"Name",mobile:"Mobile",address:"Address",email:"Email",token_no:"Token No",order_no:"Order No",date:"Date",delivery_date:"Delivery Date",item_name:"Item Name",qty:"Qty",rate:"Rate",amt:"Amt",subtotal:"SUB TOTAL",order_disc:"ORDER DISC",coupon_disc:"COUPON DISC",complementary_disc:"COMPLIMENTARY BILL",amt_before_tax:"AMT BEFORE TAX",total:"TOTAL",grand_total:"GRAND TOTAL",reward_point_balance:"REWARD POINT BALANCE",balance_amt:"BALANCE AMOUNT",rewards_redeemed:"REWARDS REDEEMED",vat:"VAT",sgst:"SGST",cgst:"CGST",utgst:"UTGST",igst:"IGST",previous_outstanding:"PREVIOUS OUTSTANDING",total_payable:"TOTAL PAYABLE",delivery_code:"Delivery Code",online_order_id:"Online Order ID",area_name:"Area Name",table_name:"Table Name",captain_name:"Captain Name"};if((C=g==null?void 0:g.customBillLabels)!=null&&C.length){let N;for(let O=0;O<g.customBillLabels.length;O++)N=g.customBillLabels[O],u[N.defaultName]=N.displayName}return u},Ot=(g,u,C,N)=>{var H,fe,Ae,Le,Pe,Me,Ue,At,gt,V,Et,at,Ns,js,ln,vs,_s,on,cn,dn,hn,un,mn,fn,Kt,bs,xt,Qt,Zt,Ss,pn,Ts,yn,ws,Is,gn,xn,Cs,Os,Nn;const O=nt(r.customLabelsMap),F=ms(xd(r.paymentModes),"internalName"),T=te=>{var b;return(b=F[te])!=null&&b.displayName?F[te].displayName.toUpperCase():te};if(g==="BILL"){let te;if(l==="A4"||l==="A5"){let b={...u},X=0,y=b.distributedData;const _=y.discounts;te=s.jsx("div",{className:`invoiceContainer main-div ${L[l].dynamicClassname}`,children:s.jsxs("div",{id:"page-wrap",children:[s.jsx("table",{width:"100%",className:"custom-table custom-table-bordered",children:s.jsxs("tbody",{children:[s.jsxs("tr",{children:[s.jsxs("td",{colSpan:9,children:[s.jsx("tr",{className:"subtotalTr",children:s.jsx("td",{colSpan:12,style:{borderBottom:"1px solid black",width:"100%"},children:s.jsx("h5",{children:s.jsxs("strong",{children:[b.companyInfo.companyName,":"]})})})}),s.jsxs("tr",{className:"subtotalTr",children:[s.jsxs("td",{width:"50%",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:`${O.order_no}:`},className:"font-weight-bold"}),s.jsx("span",{children:b.orderId})]}),s.jsxs("td",{width:"50%",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:`${O.date}:`},className:"font-weight-bold"}),s.jsx("span",{children:b.orderInfo.orderDate})]})]})]}),s.jsx("td",{colSpan:3,className:"text-right",children:s.jsx("div",{className:"d-flex justify-content-center",children:C&&s.jsx("img",{src:C,width:90})})})]}),s.jsx("tr",{children:s.jsx("td",{colSpan:12,className:"text-center border-right",style:{padding:"0px 1.4rem"},children:s.jsx("h6",{children:s.jsx("strong",{children:"Tax Invoice"})})})}),s.jsxs("tr",{children:[s.jsx("td",{colSpan:6,className:"v-align-baseline col-6",children:s.jsxs("div",{className:"divPadding",children:[(b.customerInfo.custName||((H=b.customFields)==null?void 0:H.length))&&s.jsx("tr",{children:s.jsx("td",{colSpan:"2",className:"text-center border-right",children:s.jsx("strong",{children:"Bill To"})})}),b.customerInfo.custName&&b.customerInfo.custName!==""&&s.jsx("tr",{children:s.jsx("td",{width:"10%",children:b.customerInfo.custName})}),b.customerInfo.custContact&&b.customerInfo.custContact!==""&&s.jsx("tr",{children:s.jsx("td",{width:"10%",children:b.customerInfo.custContact})}),b.customerInfo.custAddress&&b.customerInfo.custAddress!==""&&s.jsx("tr",{children:s.jsx("td",{width:"10%",children:b.customerInfo.custAddress})}),b.deliveryTimestamp&&s.jsx("tr",{children:s.jsx("td",{width:"10%",children:b.deliveryTimestamp})}),(fe=b.customFields)!=null&&fe.length?b.customFields.map(v=>s.jsx("tr",{children:s.jsxs("td",{width:"10%",children:[v.customName,": ",v.customValue]})})):""]})}),s.jsx("td",{colSpan:6,className:"v-align-baseline",children:s.jsxs("div",{className:"divPadding",children:[s.jsx("tr",{children:s.jsx("td",{colSpan:"2",className:"text-center border-right",children:s.jsx("strong",{children:"Bill From"})})}),s.jsx("tr",{children:s.jsx("td",{width:"10%",children:b.companyInfo.companyName})}),b.companyInfo.companyAddress&&b.companyInfo.companyAddress!==""&&s.jsx("tr",{children:s.jsx("td",{width:"10%",children:b.companyInfo.companyAddress})}),b.companyInfo.companyEmail&&b.companyInfo.companyEmail!==""&&s.jsx("tr",{children:s.jsx("td",{width:"10%",children:b.companyInfo.companyEmail})}),b.companyInfo.companyContact&&b.companyInfo.companyContact!==""&&s.jsx("tr",{children:s.jsx("td",{width:"10%",children:b.companyInfo.companyContact})}),b.fssai&&b.fssai!==""&&s.jsx("tr",{children:s.jsxs("td",{width:"10%",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:`${O.company_FSSAI}:`}}),s.jsx("span",{children:b.fssai})]})}),b.gst&&b.gst!==""&&s.jsx("tr",{children:s.jsxs("td",{width:"10%",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:`${O.company_GST}:`}}),s.jsx("span",{children:b.gst})]})}),b.vatNo&&b.vatNo!==""&&s.jsx("tr",{children:s.jsxs("td",{width:"10%",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:`${O.company_VAT}:`}}),s.jsx("span",{children:b.vatNo})]})})]})})]}),s.jsx("tr",{children:s.jsx("td",{colSpan:12,children:s.jsxs("table",{width:"100%",className:"custom-table productTable ",children:[s.jsx("thead",{children:s.jsxs("tr",{className:"border-right",style:{lineHeight:"10px"},children:[s.jsx("th",{className:"text-align-left",children:"Sr No"}),s.jsx("th",{className:"text-align-left",style:{width:"40%"},children:"Item Name"}),s.jsx("th",{className:"text-align-left",children:"Quantity"}),s.jsx("th",{className:"text-align-right",children:"Price/Unit"}),s.jsx("th",{className:"text-align-right",children:"Amount"})]})}),s.jsxs("tbody",{children:[b.itemList.map(v=>{var ue;let z="",le=[];return X++,le.push(s.jsxs(s.Fragment,{children:[s.jsxs("tr",{style:{lineHeight:"10px"},className:z,children:[s.jsx("td",{className:"text-align-left",children:v.serviceRate?X:""}),s.jsx("td",{style:{width:"40%"},className:"text-align-left",children:v.serviceName.toUpperCase()}),s.jsx("td",{className:"text-align-left",children:v.qty}),s.jsx("td",{className:"text-align-right",children:v.serviceRate?U(v.serviceRate,o):""}),s.jsx("td",{className:"text-align-right",children:v.sub_total?U(v.sub_total,o):""})]}),v.instruction&&s.jsxs("tr",{children:[s.jsx("td",{}),s.jsx("td",{style:{width:"40%"},children:"("+v.instruction+")"})]})]})),(ue=v.addons)!=null&&ue.length&&v.addons.map(ne=>{le.push(s.jsxs(s.Fragment,{children:[s.jsxs("tr",{style:{lineHeight:"10px"},className:"fs-8",children:[s.jsx("td",{}),s.jsxs("td",{style:{width:"40%"},children:["+ ",ne.serviceName.toUpperCase()]}),s.jsx("td",{children:ne.qty*v.qty})]}),ne.instruction&&s.jsxs("tr",{children:[s.jsx("td",{}),s.jsx("td",{style:{width:"40%"},children:"("+ne.instruction+")"})]})]}))}),le}),s.jsx("tr",{style:{lineHeight:"10px",fontSize:"14px"},children:s.jsx("td",{colSpan:5,children:s.jsx("strong",{className:"font-weight-bold",children:`Total ${X} Items and ${ve(y.qty)} Quantity`})})})]})]})})}),s.jsxs("tr",{className:"avoid-page-break",children:[s.jsx("td",{colSpan:6,style:{verticalAlign:"top"},children:s.jsx("div",{children:s.jsxs("div",{width:"100%",children:[s.jsx("tr",{children:s.jsxs("td",{colSpan:"2",children:[s.jsx("strong",{className:"font-weight-bold",children:"Amount in words"}),s.jsx("br",{}),fd(Xn(b.finalAmount,o).toFixed(Wt[o].minimumFractionDigits??2))]})}),s.jsx("hr",{}),b.upiId&&u.companyInfo.companyName&&s.jsxs(s.Fragment,{children:[s.jsx("tr",{children:s.jsx("td",{width:"50%",className:"font-weight-bold",children:"Scan To Pay"})}),s.jsx("tr",{children:s.jsx("td",{width:"50%",children:s.jsx("div",{className:"image-bill",children:P(u.upiId,u.orderId,u.companyInfo.companyName,u.paidAmt,{size:100})})})})]}),b.footerMessage?s.jsx("tr",{children:s.jsx("td",{colSpan:"2",children:s.jsx("div",{className:"single-entity-and-center",dangerouslySetInnerHTML:{__html:b.footerMessage}})})}):""]})})}),s.jsx("td",{colSpan:6,style:{verticalAlign:"top"},children:s.jsx(s.Fragment,{children:s.jsxs(s.Fragment,{children:[s.jsxs("tr",{className:"subtotalTr",children:[s.jsx("td",{width:"50%",children:s.jsx("span",{children:s.jsx("strong",{dangerouslySetInnerHTML:{__html:O.subtotal}})})}),s.jsx("td",{width:"50%",className:"text-align-right",children:U(y.subTotal,o)})]}),(Ae=_==null?void 0:_.DISCOUNT_ITEMS)!=null&&Ae.length?_.DISCOUNT_ITEMS.map(v=>s.jsxs("tr",{className:"subtotalTr",children:[s.jsxs("td",{width:"50%",children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:O[`disc_${v.discountName.toLowerCase()}`]??"DISC-"+v.discountName.toUpperCase()}}),s.jsx("span",{children:ce(v)})]}),s.jsx("td",{className:"text-align-right",width:"50%",children:U(v.discountAmt,o)})]})):"",(Le=_==null?void 0:_.CATEGORY_DISCOUNT)!=null&&Le.length?_.CATEGORY_DISCOUNT.map(v=>s.jsxs("tr",{className:"subtotalTr",children:[s.jsxs("td",{width:"50%",children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:O[`disc_${v.discountName.toLowerCase()}`]??"DISC-"+v.discountName.toUpperCase()}}),s.jsx("span",{children:" @"+v.discountValue+"%"})]}),s.jsx("td",{className:"text-align-right",width:"50%",children:U(v.discountAmt,o)})]})):"",(Pe=_==null?void 0:_.ITEM_DISCOUNT)!=null&&Pe.length?_.ITEM_DISCOUNT.map(v=>s.jsxs("tr",{className:"subtotalTr",children:[s.jsxs("td",{width:"50%",children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:O[`disc_${v.discountName.toLowerCase()}`]??"DISC-"+v.discountName.toUpperCase()}}),s.jsx("span",{children:" @"+v.discountValue+"%"})]}),s.jsx("td",{className:"text-align-right",width:"50%",children:U(v.discountAmt,o)})]})):"",(Ue=(Me=_==null?void 0:_.SEGMENT_DISCOUNT)==null?void 0:Me[0])!=null&&Ue.discountAmt?s.jsxs("tr",{className:"subtotalTr",children:[s.jsxs("td",{width:"50%",children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:O[`segment_disc${_.SEGMENT_DISCOUNT[0].discountName.toLowerCase()}`]??"DISC-"+_.SEGMENT_DISCOUNT[0].discountName.toUpperCase()}}),s.jsx("span",{children:" @"+_.SEGMENT_DISCOUNT[0].discountValue+"%"})]}),s.jsx("td",{className:"text-align-right",width:"50%",children:U(_.SEGMENT_DISCOUNT[0].discountAmt,o)})]}):"",(gt=(At=_==null?void 0:_.COUPON_DISCOUNT)==null?void 0:At[0])!=null&>.discountAmt?s.jsxs("tr",{className:"subtotalTr",children:[s.jsxs("td",{width:"50%",children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:"COUPON DISC"}}),s.jsx("span",{children:`(${_.COUPON_DISCOUNT[0].discountName.toUpperCase()}) @${_.COUPON_DISCOUNT[0].discountValue}${_.COUPON_DISCOUNT[0].discountType=="RELATIVE"?"%":"AMT"}`})]}),s.jsx("td",{className:"text-align-right",width:"50%",children:U(_.COUPON_DISCOUNT[0].discountAmt,o)})]}):"",(Et=(V=_==null?void 0:_.ORDER_DISCOUNT)==null?void 0:V[0])!=null&&Et.discountAmt?s.jsxs("tr",{className:"subtotalTr",children:[s.jsxs("td",{width:"50%",children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:O.order_disc??"ORDER DISC"}}),s.jsx("span",{children:m(_.ORDER_DISCOUNT[0].discountValue)?`@${_.ORDER_DISCOUNT[0].discountValue}${_.ORDER_DISCOUNT[0].discountType=="RELATIVE"||_.ORDER_DISCOUNT[0].discountType=="COMPLIMENTARY"?"%":"AMT"}`:""})]}),s.jsx("td",{className:"text-align-right",width:"50%",children:U(_.ORDER_DISCOUNT[0].discountAmt,o)})]}):"",(at=y.charges)!=null&&at.length?y.charges.map(v=>s.jsxs("tr",{className:"subtotalTr",children:[s.jsx("td",{width:"50%",children:s.jsx("span",{dangerouslySetInnerHTML:{__html:O[`charges_${v.name.toLowerCase()}`]??v.name}})}),s.jsx("td",{className:"text-align-right",width:"50%",children:U(v.amt,o)})]})):"",y.subTotal!==y.afterCharges?s.jsxs("tr",{className:"subtotalTr",children:[s.jsx("td",{width:"50%",children:s.jsx("span",{dangerouslySetInnerHTML:{__html:O.amt_before_tax}})}),s.jsx("td",{className:"text-align-right",width:"50%",children:U(y.afterCharges,o)})]}):"",(Ns=y.taxation)!=null&&Ns.length?y.taxation.map(v=>v.taxType==="GST"?s.jsxs(s.Fragment,{children:[s.jsxs("tr",{className:"subtotalTr",children:[s.jsxs("td",{width:"50%",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:O.cgst}}),s.jsx("span",{children:" @"+v.tax/2+"%"})]}),s.jsx("td",{className:"text-align-right",width:"50%",children:U(v.taxAmt/2,o)})]}),s.jsxs("tr",{className:"subtotalTr",children:[s.jsxs("td",{width:"50%",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:O.sgst}}),s.jsx("span",{children:" @"+v.tax/2+"%"})]}),s.jsx("td",{className:"text-align-right",width:"50%",children:U(v.taxAmt/2,o)})]})]}):s.jsxs("tr",{className:"subtotalTr",children:[s.jsxs("td",{width:"50%",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:O.vat}}),s.jsx("span",{children:" @"+v.tax+"%"})]}),s.jsx("td",{className:"text-align-right",width:"50%",children:U(v.taxAmt,o)})]})):"",s.jsxs("tr",{className:"font-weight-bold subtotalTr",children:[s.jsx("td",{width:"50%",children:s.jsx("strong",{dangerouslySetInnerHTML:{__html:O.grand_total}})}),s.jsx("td",{className:"text-align-right",width:"50%",children:U(b.finalAmount,o)})]}),(js=u==null?void 0:u.custoutStandingData)!=null&&js.balanceAmt?s.jsxs(s.Fragment,{children:[s.jsxs("tr",{className:"font-weight-bold subtotalTr",children:[s.jsx("td",{width:"50%",children:s.jsx("span",{dangerouslySetInnerHTML:{__html:O.previous_outstanding}})}),s.jsx("td",{className:"text-align-right",width:"50%",children:U((ln=b==null?void 0:b.custoutStandingData)==null?void 0:ln.balanceAmt,o)})]}),s.jsxs("tr",{className:"font-weight-bold subtotalTr",children:[s.jsx("td",{width:"50%",children:s.jsx("strong",{dangerouslySetInnerHTML:{__html:O.total_payable}})}),s.jsx("td",{className:"text-align-right",width:"50%",children:U(b.grandTotal+((vs=b==null?void 0:b.custoutStandingData)==null?void 0:vs.balanceAmt),o)})]})]}):"",b.rewardAmt?s.jsxs("tr",{className:"subtotalTr",children:[s.jsx("td",{width:"50%",children:s.jsx("span",{dangerouslySetInnerHTML:{__html:O.rewards_redeemed}})}),s.jsx("td",{className:"text-align-right",width:"50%",children:U(b.rewardAmt,o)})]}):"",(_s=u.paymentMethods)!=null&&_s.length?u.paymentMethods.map(v=>{var z;if(v.paidAmt)return s.jsxs("tr",{className:"subtotalTr",children:[s.jsxs("td",{width:"50%",children:["-"," ",s.jsx("span",{dangerouslySetInnerHTML:{__html:O[`${(z=v.paymentMode)==null?void 0:z.toLowerCase()}`]??T(v.paymentMode)??"CASH"}}),s.jsx("span",{children:v.isRefund?"(Refund)":""})]}),v.isRefund?s.jsx("td",{className:"text-align-right",width:"50%",children:"("+U(v.paidAmt,o)+")"}):s.jsx("td",{className:"text-align-right",width:"50%",children:U(v.paidAmt,o)})]})}):"",b.balanceAmt&&u.balanceAmt!=0?s.jsxs("tr",{className:"subtotalTr",children:[s.jsx("td",{width:"50%",children:s.jsx("span",{dangerouslySetInnerHTML:{__html:O.balance_amt}})}),s.jsx("td",{className:"text-align-right",width:"50%",children:U(u.balanceAmt,o)})]}):"",u.balPoint&&!Number.isNaN(u.balPoint)?s.jsxs("tr",{className:"subtotalTr",children:[s.jsx("td",{width:"50%",children:s.jsx("span",{dangerouslySetInnerHTML:{__html:O.reward_point_balance}})}),s.jsx("td",{className:"text-align-right",width:"50%",children:u.balPoint})]}):"",s.jsx("tr",{className:"subtotalTr",children:s.jsxs("td",{className:"text-center",width:"100%",children:[s.jsx("hr",{}),s.jsx("strong",{children:"Authorised Signatory"})]})}),s.jsx("tr",{className:"subtotalTr",children:s.jsx("td",{colSpan:2,width:"50%",children:s.jsx("div",{className:"p-4"})})})]})})})]})]})}),s.jsx("p",{className:"single-entity-and-center f-12 mt-2 avoid-page-break",style:{marginTop:"10px"},children:`Printed By :${b.printby} Printed On: ${b.printTime}`}),b.disabledPoweredBy?"":s.jsx("p",{className:"single-entity-and-center f-12 mt-2 avoid-page-break",children:"Powered By: www.recaho.com"})]})})}else te=s.jsx("div",{className:"main-div bill",style:{width:L[l].paperSize},children:s.jsxs("div",{style:{width:"100%",textAlign:"left",marginLeft:"auto"},children:[u.duplicateBill?s.jsx("h4",{className:"single-entity-and-center",children:"DUPLICATE BILL"}):"",s.jsx("br",{}),C&&s.jsx("div",{className:"image-bill",children:s.jsx("img",{src:C,className:"single-entity-and-center",style:{width:L[l].logoWidth}})}),s.jsxs("div",{className:`details-section ${L[l].dynamicClassname}`,children:[!C&&u.companyInfo.companyName&&u.companyInfo.companyName!=""&&s.jsx("h1",{className:"single-entity-and-center",children:u.companyInfo.companyName}),u.companyInfo.companyAddress&&u.companyInfo.companyAddress!==""&&s.jsx("h3",{className:"single-entity-and-center",dangerouslySetInnerHTML:{__html:u.companyInfo.companyAddress}}),u.companyInfo.companyContact&&u.companyInfo.companyContact!==""&&s.jsx("h3",{className:"single-entity-and-center",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:O.company_mobile}}),": ",s.jsx("span",{children:u.companyInfo.companyContact})]})}),u.companyInfo.companyEmail&&u.companyInfo.companyEmail!==""&&s.jsx("h3",{className:"single-entity-and-center",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:O.company_Email}}),": ",s.jsx("span",{children:u.companyInfo.companyEmail})]})}),u.fssai&&u.fssai!==""&&s.jsx("h3",{className:"single-entity-and-center",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:O.company_FSSAI}}),": ",s.jsx("span",{children:u.fssai})]})}),u.gst&&u.gst!==""&&s.jsx("h3",{className:"single-entity-and-center",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:O.company_GST}}),": ",s.jsx("span",{children:u.gst})]})}),u.vatNo&&u.vatNo!==""&&s.jsx("h3",{className:"single-entity-and-center",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:O.company_VAT}}),": ",s.jsx("span",{children:u.vatNo})]})}),s.jsx("hr",{}),u.orderFrom&&s.jsx("h2",{className:"single-entity-and-center level2-bold",children:u.orderFrom}),u.area&&s.jsxs("h3",{className:"single-entity-and-center level2-bold",children:[u.area," : ",u.tableName?u.tableName:u.tableNo]}),u.tokenId&&s.jsx("h2",{className:"single-entity-and-center level2-bold",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:O.token_no}})," ",s.jsx("span",{children:u.tokenId})]})}),u.parentOrderRef&&s.jsx("h4",{className:"single-entity-and-center",children:"RETURN/EXCHANGE"})]}),s.jsx("hr",{}),s.jsxs("div",{className:`details-section ${L[l].dynamicClassname} ${_e}`,children:[u.customerInfo.custName&&u.customerInfo.custName!==""&&s.jsx("h5",{className:"left-align-entity",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:O.name}}),": ",s.jsx("span",{children:u.customerInfo.custName})]})}),u.customerInfo.custContact&&u.customerInfo.custContact!==""&&s.jsx("h5",{className:"left-align-entity",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:O.mobile}}),": ",s.jsx("span",{children:u.customerInfo.custContact})]})}),u.customerInfo.custAddress&&u.customerInfo.custAddress!==""&&s.jsx("h5",{className:"left-align-entity",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:O.address}}),": ",s.jsx("span",{children:u.customerInfo.custAddress})]})}),_t(u.appliedDiscounts??[],"COMPLIMENTARY","discountType").discountType&&s.jsx("h5",{className:"left-align-entity level2-bold",dangerouslySetInnerHTML:{__html:O.complementary_disc}}),u.orderId&&s.jsx("h5",{className:"left-align-entity",style:{flexShrink:0},children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:O.order_no}}),": ",s.jsx("span",{children:u.orderId})]})}),u.orderInfo.orderDate&&s.jsx("h5",{className:"left-align-entity",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:O.date}}),":",s.jsx("span",{children:u.orderInfo.orderDate})]})}),u.deliveryTimestamp&&s.jsx("h5",{className:"left-align-entity",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:O.delivery_date}}),":",s.jsx("span",{children:u.deliveryTimestamp})]})}),u.captainName&&s.jsx("h5",{className:"left-align-entity",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:O.captain_name}}),":",s.jsx("span",{children:u.captainName})]})})]}),(on=u.customFields)!=null&&on.length?s.jsxs("div",{className:`details-section ${L[l].dynamicClassname}`,children:[s.jsx("hr",{}),u.customFields.map(b=>s.jsx("h4",{className:"left-align-entity",children:b.customName+": "+b.customValue}))]}):"",u.newFormat?B(u,O):G(u,O),s.jsx("br",{}),s.jsxs("div",{className:`bottom-section ${L[l].dynamicClassname}`,children:[s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h6",{className:`total-qty ${(cn=u.custoutStandingData)!=null&&cn.balanceAmt||u.rewardAmt&&u.paymentMethods&&u.paymentMethods.length>0?"level3-bold":"level2-bold"}`,style:{fontSize:l==="2INCH"||l==="1.8INCH"?"1.50rem":"1.75rem"},dangerouslySetInnerHTML:{__html:O.grand_total}}),s.jsx("h6",{className:`actual-qty ${(dn=u.custoutStandingData)!=null&&dn.balanceAmt||u.rewardAmt&&u.paymentMethods&&u.paymentMethods.length>0?"level3-bold":"level2-bold"}`,style:{fontSize:l==="2INCH"||l==="1.8INCH"?"1.40rem":"1.75rem"},children:u.curr+" "+m(u.finalAmount)})]}),(hn=u.custoutStandingData)!=null&&hn.balanceAmt?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{children:s.jsx("span",{dangerouslySetInnerHTML:{__html:O.previous_outstanding}})}),s.jsx("h5",{children:u.curr+" "+m(u.custoutStandingData.balanceAmt)})]}),!u.rewardAmt&&!u.paymentMethods?s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h6",{className:"total-qty level2-bold",style:{fontSize:l==="2INCH"||l==="1.8INCH"?"1.50rem":"1.75rem"},dangerouslySetInnerHTML:{__html:O.total_payable}}),s.jsx("h6",{className:"actual-qty level2-bold",style:{fontSize:l==="2INCH"||l==="1.8INCH"?"1.40rem":"1.75rem"},children:u.curr+" "+m(u.finalAmount+u.custoutStandingData.balanceAmt)})]}):""]}):"",i=="25e5f1e4-68ff-43a7-b042-bebb93f42b94"?s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h6",{className:"total-qty level2-bold",style:{fontSize:l==="2INCH"||l==="1.8INCH"?"1.50rem":"1.75rem"},children:"المجموع الإجمالي"}),s.jsx("h6",{className:"actual-qty level2-bold",style:{fontSize:l==="2INCH"||l==="1.8INCH"?"1.40rem":"1.75rem"}})]}):"",u.rewardAmt?s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsxs("h5",{children:["- ",s.jsx("span",{dangerouslySetInnerHTML:{__html:O.rewards_redeemed}}),s.jsx("span",{children:"("+u.usedPoints+" Points)"})]}),s.jsx("h5",{children:u.curr+" "+u.rewardAmt})]}):"",u.paymentMethods&&u.paymentMethods.length?u.paymentMethods.map(b=>{var X;if(b.paidAmt)return s.jsxs("div",{className:`bottom-section-div inline-display ${_e}`,children:[s.jsxs("h5",{children:["-",s.jsx("span",{dangerouslySetInnerHTML:{__html:O[`${(X=b.paymentMode)==null?void 0:X.toLowerCase()}`]??T(b.paymentMode)??"CASH"}}),s.jsx("span",{children:b.isRefund?"(Refund)":""})]}),s.jsx("h5",{children:b.isRefund?s.jsx(s.Fragment,{children:u.curr+" ("+m(b.paidAmt)+")"}):s.jsx(s.Fragment,{children:u.curr+" "+m(b.paidAmt)})})]})}):"",u.rewardAmt&&!u.paymentMethods?s.jsx(s.Fragment,{children:s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h6",{className:"total-qty level2-bold",style:{fontSize:l==="2INCH"||l==="1.8INCH"?"1.50rem":"1.75rem"},dangerouslySetInnerHTML:{__html:O.total_payable}}),s.jsx("h6",{className:"actual-qty level2-bold",style:{fontSize:l==="2INCH"||l==="1.8INCH"?"1.40rem":"1.75rem"},children:u.curr+" "+m(u.finalAmount+(((un=u==null?void 0:u.custoutStandingData)==null?void 0:un.balanceAmt)||0)-u.rewardAmt)})]})}):"",Ch((mn=u.convertedCurrValue)==null?void 0:mn.value)?s.jsxs("div",{className:`bottom-section-div inline-display ${_e}`,children:[s.jsx("h5",{className:"total-qty"}),s.jsx("h5",{className:"actual-qty",children:`(${U(u.convertedCurrValue.value,u.convertedCurrValue.curr)})`})]}):"",u.balanceAmt&&u.balanceAmt!=0?s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{dangerouslySetInnerHTML:{__html:O.balance_amt}}),s.jsx("h5",{children:u.curr+" "+m(u.balanceAmt)})]}):"",s.jsx("hr",{})]}),u.earnPoints&&u.paymentMethods?s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h6",{className:"total-qty line-gaps",children:"EARN POINTS"}),s.jsx("h6",{className:"actual-qty",children:u.earnPoints})]}):"",(u.balPoint||u.earnPoints)&&!Number.isNaN(u.balPoint||u.earnPoints)?s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h6",{className:"total-qty line-gaps",dangerouslySetInnerHTML:{__html:O.reward_point_balance}}),s.jsx("h6",{className:"actual-qty",children:u.balPoint+u.earnPoints||0})]}):"",u.upiId&&u.companyInfo.companyName&&s.jsxs("div",{className:"single-entity-and-center",children:[s.jsx("h6",{style:{marginTop:"6px"},children:"Scan this QRCode to Pay"}),P(u.upiId,u.orderId,u.companyInfo.companyName,u.paidAmount)]}),u.curr==="SAR"&&r.vatNo&&s.jsxs("div",{className:"single-entity-and-center",children:[s.jsx("h6",{style:{marginTop:"6px"},children:"Scan with ZATCA app for invoice details."}),D(r.vatNo,u)]}),N?s.jsx("div",{className:"image-bill",children:s.jsx("img",{src:`${N}`,className:"single-entity-and-center",style:{width:L[l].logoWidth}})}):"",u.footerMessage?s.jsx("h4",{className:"single-entity-and-center",dangerouslySetInnerHTML:{__html:u.footerMessage}}):"",u.printby&&u.printOperatorInfo?s.jsx("h6",{className:"left-align-entity",children:`Printed By:${u.printby}`}):"",u.printTime&&u.printOperatorInfo?s.jsx("h6",{className:"left-align-entity",children:`Printed On:${u.printTime}`}):"",u.disabledPoweredBy?"":s.jsx("h6",{className:"single-entity-and-center",children:"Powered By: www.recaho.com"})]})});return te}else if(g==="PRINT_DASHBOARD"&&u.salesCollection){const te=u.salesCollection.totalDiscountAmt?gs(u.salesCollection.grandTotal,u.salesCollection.totalDiscountAmt):null,b=u.salesCollection.totalCollection-u.salesCollection.totalTax;var k=E().format("DD/MM/YYYY LT");const X=(fn=u.monthTillDateSalesColl)!=null&&fn.totalDiscountAmt?gs(u.monthTillDateSalesColl.grandTotal,u.monthTillDateSalesColl.totalDiscountAmt):null;return s.jsxs("div",{className:`main-div ${L[l].dynamicClassname}`,style:{width:L[l].paperSize},children:[s.jsxs("div",{style:{width:"100%",textAlign:"left",marginLeft:"auto"},children:[s.jsxs("div",{children:[s.jsx("p",{className:"single-entity-and-left-align",children:`Printed On:- ${k}`}),s.jsx("br",{}),s.jsx("h1",{className:"single-entity-and-center level2-bold",children:"Sales Report"}),s.jsx("p",{className:"single-entity-and-center",children:u.selectedDate})]}),s.jsx("hr",{}),u.monthTillDateSalesColl?s.jsxs(s.Fragment,{children:[s.jsxs("div",{children:[s.jsx("h4",{className:"single-entity-and-center flex-two-items",children:"MTD Sales Breakup"}),s.jsxs("h5",{className:"level3-bold flex-two-items",children:[s.jsx("span",{children:"Gross Sales:"}),s.jsx("span",{children:oe(u.monthTillDateSalesColl.grandTotal,o)})]}),s.jsxs("h5",{className:"level3-bold flex-two-items",children:[s.jsx("span",{children:"DISCOUNT:"}),s.jsx("span",{children:`${oe(u.monthTillDateSalesColl.totalDiscountAmt,o)}${X?`(${m(X)}%)`:""}`})]}),s.jsxs("h5",{className:"level3-bold flex-two-items",children:[s.jsx("span",{children:"CHARGES:"}),s.jsx("span",{children:oe(u.monthTillDateSalesColl.totalOtherCharges,o)})]}),s.jsxs("h5",{className:"level3-bold flex-two-items",children:[s.jsx("span",{children:"NET SALES BEFORE TAX:"}),s.jsx("span",{children:oe(u.monthTillDateSalesColl.totalCollection-u.monthTillDateSalesColl.totalTax,o)})]}),s.jsxs("h5",{className:"level3-bold flex-two-items",children:[s.jsx("span",{children:"TAX:"}),s.jsx("span",{children:oe(u.monthTillDateSalesColl.totalTax,o)})]}),s.jsxs("h5",{className:"level3-bold flex-two-items",children:[s.jsx("span",{children:"NET SALES AFTER TAX:"}),s.jsx("span",{children:oe(u.monthTillDateSalesColl.totalCollection,o)})]})]}),s.jsx("hr",{})]}):"",s.jsxs("div",{children:[s.jsx("h4",{className:"single-entity-and-center flex-two-items",children:"SALES BREAK-UP"}),s.jsxs("h5",{className:"level3-bold flex-two-items",children:[s.jsx("span",{children:"Gross Sales:"}),s.jsx("span",{children:oe(u.salesCollection.grandTotal,o)})]}),s.jsxs("h5",{className:"level3-bold flex-two-items",children:[s.jsx("span",{children:"DISCOUNT:"}),s.jsx("span",{children:`${oe(u.salesCollection.totalDiscountAmt,o)}${te?`(${m(te)}%)`:""}`})]}),s.jsxs("h5",{className:"level3-bold flex-two-items",children:[s.jsx("span",{children:"CHARGES:"}),s.jsx("span",{children:oe(u.salesCollection.totalOtherCharges,o)})]}),s.jsxs("h5",{className:"level3-bold flex-two-items",children:[s.jsx("span",{children:"NET SALES BEFORE TAX:"}),s.jsx("span",{children:oe(b,o)})]}),s.jsxs("h5",{className:"level3-bold flex-two-items",children:[s.jsx("span",{children:"TAX:"}),s.jsx("span",{children:oe(u.salesCollection.totalTax,o)})]}),s.jsxs("h5",{className:"level3-bold flex-two-items",children:[s.jsx("span",{children:"NET SALES AFTER TAX:"}),s.jsx("span",{children:oe(u.salesCollection.totalCollection,o)})]})]}),s.jsx("hr",{}),Q(u.otherFields.totalDiscountAmt,u.otherFields.discountList,"Discount",{action:"addCharges"}),Q(u.otherFields.totalOtherCharges,u.otherFields.otherChargesList,"Charges"),Q(u.otherFields.totalTax,u.otherFields.taxList,"Tax"),s.jsxs("div",{children:[s.jsx("h4",{className:"single-entity-and-center",children:"BY BUSINESS"}),s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:"Total Sales:"}),s.jsx("span",{children:oe(u.salesCollection.totalCollection,o)})]}),s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:"Total Orders:"}),s.jsx("span",{children:u.salesCollection.totalOrders})]}),w(u)]}),s.jsx("hr",{}),u.otherFields.totalItemType?s.jsx("div",{children:Q(u.otherFields.totalItemType,u.otherFields.itemTypeList,"Item Type",{action:"addCharges"})}):"",u.averageCollection.avgTableTime||u.averageCollection.avgorderValue||u.averageCollection.noOfGuest?s.jsxs("div",{children:[s.jsx("h4",{className:"single-entity-and-center",children:"PERFORMANCE METRICS"}),u.averageCollection.avgTableTime?s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsxs("span",{children:["Average ",r.customLabels.Table," Time:"]}),s.jsx("span",{children:u.averageCollection.avgTableTime})]}):"",u.averageCollection.avgorderValue?s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:"Average Order Value:"}),s.jsx("span",{children:oe(u.averageCollection.avgorderValue,o)})]}):"",u.averageCollection.noOfGuest?s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:"Covers:"}),s.jsx("span",{children:u.averageCollection.noOfGuest})]}):"",u.averageCollection.avgPerCover?s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:"Average Per Cover:"}),s.jsx("span",{children:oe(u.averageCollection.avgPerCover,o)})]}):"",s.jsx("hr",{})]}):"",s.jsxs("div",{children:[s.jsx("h4",{className:"single-entity-and-center",children:"BY PAYMENT CATEGORY"}),s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:"Total Collection:"}),s.jsx("span",{children:oe(u.totalCollection,o)})]}),I(u)]}),R(u.averageCollection),u.otherFields.outstandingAmt?s.jsxs(s.Fragment,{children:[s.jsx("hr",{}),s.jsxs("div",{children:[s.jsx("h4",{className:"single-entity-and-center",children:"BY PAYMENT STATUS"}),s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:" -- Sales:"}),s.jsx("span",{children:oe(u.otherFields.salesCollection,o)})]}),u.otherFields.outstandingAmt?s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:" -- Outstanding Payment Received:"}),s.jsx("span",{children:oe(u.otherFields.outstandingAmt,o)})]}):""]})]}):"",s.jsx("hr",{}),Te(u.averageCollection.dailyExpanse)]}),s.jsx("br",{}),xs=="Android OS"&&s.jsx("div",{className:"space-3rem"})]})}else if(g==="AGGREGATOR_BILL"){let te;return a.aggregatorOrderId&&a.aggregatorOrderId!==""&&(te=$(a.aggregatorOrderId)),s.jsx("div",{className:"main-div bill",style:{width:L[l].paperSize},children:s.jsxs("div",{children:[s.jsxs("div",{style:{width:"100%",textAlign:"left",marginLeft:"auto"},children:[s.jsx("br",{}),C&&s.jsx("div",{className:"image-bill",children:s.jsx("img",{src:C,className:"single-entity-and-center",style:{width:L[l].logoWidth}})}),s.jsxs("div",{className:`details-section ${L[l].dynamicClassname}`,children:[!C&&a.companyInfo.companyName&&a.companyInfo.companyName!=""&&s.jsx("h1",{className:"single-entity-and-center",children:a.companyInfo.companyName}),a.companyInfo.companyAddress&&a.companyInfo.companyAddress!==""&&s.jsx("h3",{className:"single-entity-and-center",dangerouslySetInnerHTML:{__html:a.companyInfo.companyAddress}}),a.companyInfo.companyContact&&a.companyInfo.companyContact!==""&&s.jsx("h3",{className:"single-entity-and-center",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:O.company_mobile}}),": ",s.jsx("span",{children:a.companyInfo.companyContact})]})}),a.companyInfo.companyEmail&&a.companyInfo.companyEmail!==""&&s.jsx("h3",{className:"single-entity-and-center",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:O.company_Email}}),": ",s.jsx("span",{children:a.companyInfo.companyEmail})]})}),a.fssai&&a.fssai!==""&&s.jsx("h3",{className:"single-entity-and-center",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:O.company_FSSAI}}),": ",s.jsx("span",{children:a.fssai})]})}),a.gst&&a.gst!==""&&s.jsx("h3",{className:"single-entity-and-center",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:O.company_GST}}),": ",s.jsx("span",{children:a.gst})]})}),a.vatNo&&a.vatNo!==""&&s.jsx("h3",{className:"single-entity-and-center",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:O.company_VAT}}),": ",s.jsx("span",{children:a.vatNo})]})}),a.orderFrom&&s.jsx("h3",{className:"single-entity-and-center level2-bold",children:a.orderFrom}),a.orderSource&&te&&s.jsxs("h4",{className:"single-entity-and-center",children:[`${a.orderSource}: ${te.firstDigits||""}`,s.jsxs("span",{style:{fontSize:"2rem"},children:["-",te.last4Dgits||""]})]}),a.zomatoInstant&&s.jsx("h4",{className:"single-entity-and-center",children:a.zomatoInstant}),a.otp&&a.otp!==""&&s.jsx("h3",{className:"single-entity-and-center",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:O.delivery_code}}),": ",s.jsx("span",{children:a.otp})]})}),a.tokenId&&s.jsx("h2",{className:"single-entity-and-center level2-bold",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:O.token_no}})," ",s.jsx("span",{children:a.tokenId})]})})]}),s.jsx("hr",{}),s.jsxs("div",{className:`details-section ${L[l].dynamicClassname}`,children:[a.customerInfo.custName&&a.customerInfo.custName!==""&&s.jsx("h5",{className:"left-align-entity level3-bold",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:O.name}}),": ",s.jsx("span",{children:a.customerInfo.custName})]})}),a.customerInfo.custContact&&a.customerInfo.custContact!==""&&s.jsx("h5",{className:"left-align-entity level3-bold",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:O.mobile}}),": ",s.jsx("span",{children:a.customerInfo.custContact})]})}),a.customerInfo.custAddress&&a.customerInfo.custAddress!==""&&s.jsx("h5",{className:"left-align-entity level3-bold",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:O.address}}),": ",s.jsx("span",{children:a.customerInfo.custAddress})]})}),s.jsxs("div",{className:"flex-two-items",children:[a.orderId&&s.jsx("h5",{className:"left-align-entity level3-bold",style:{flexShrink:0},children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:O.order_no}}),": ",s.jsx("span",{children:a.orderId})]})}),a.orderFrom&&s.jsx("h5",{className:"single-entity-and-center",children:a.orderFrom})]}),a.orderInfo.orderDate&&s.jsx("h5",{className:"left-align-entity level3-bold",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:O.date}}),":",s.jsx("span",{children:a.orderInfo.orderDate})]})}),a.deliveryTimestamp&&s.jsx("h5",{className:"left-align-entity level3-bold",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:O.delivery_date}}),":",s.jsx("span",{children:a.deliveryTimestamp})]})})]})]}),s.jsx("hr",{}),s.jsxs("section",{className:"products-section",children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h6",{className:"items products-heading-name-kot",children:L[l].itemName}),s.jsx("h6",{className:"items products-heading-qty-kot",children:"Qty"})]}),s.jsx("hr",{})]}),s.jsxs("section",{className:"products-section",style:{paddingTop:"12px"},children:[((Kt=a.services)==null?void 0:Kt.length)&&a.services.map(X=>{var y;return s.jsxs("div",{style:X.serviceName.startsWith("+ ")?{}:{paddingTop:"12px"},children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h6",{className:"items products-heading-name-kot",style:{lineHeight:1.2},children:X.serviceName.toUpperCase()}),s.jsx("h6",{className:"items products-heading-qty-kot",children:X.qty})]}),((y=X.addons)==null?void 0:y.length)&&X.addons.map(_=>s.jsx("h6",{className:"items products-heading-addon-kot",children:"- "+Ke(_.serviceName)})),X.instruction&&a.itemInstructionOnBill&&s.jsx("h6",{className:"left-align-entity level2-bold",children:s.jsx("h6",{className:"items products-heading-addon-kot",children:X.instruction})})]})}),s.jsx("hr",{})]}),s.jsxs("div",{className:"bottom-section-div flex-two-items",style:{paddingBottom:"3rem"},children:[s.jsxs("h5",{children:["TOTAL ITEMS: ",a.services.length]}),s.jsxs("h5",{children:["TOTAL QTY: ",ve(a.totalQty)]})]}),a&&a.discountAmt?s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h5",{children:"DISCOUNT AMOUNT"}),s.jsx("h5",{children:oe(a.discountAmt,o)})]}):"",a.otherCharges&&a.otherCharges.length>0?a.otherCharges.map(X=>{if(X.amt)return s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h5",{children:X.name}),s.jsx("h5",{children:a.curr+" "+m(X.amt)})]})}):"",a.taxObj&&a.taxObj.GST?s.jsx(s.Fragment,{children:a.taxObj.GST.map(X=>{let y=new Array;for(const _ in X)if(X[_]&&X[_]!=0){let v=_/2;y.push(s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"bottom-section-div",children:[s.jsxs("h5",{children:["CGST @",v]}),s.jsx("h5",{children:a.curr+" "+m(X[_]/2)})]}),s.jsxs("div",{className:"bottom-section-div",children:[s.jsxs("h5",{children:[u.taxLabel+" "," @",v,"%"]}),s.jsx("h5",{children:a.curr+" "+m(X[_]/2)})]})]}))}return y})}):"",s.jsx("div",{style:{marginTop:"6px"},children:(bs=a.customFeilds)==null?void 0:bs.map(X=>s.jsx("h4",{className:"left-align-entity",children:X.customName+": "+X.customValue}))}),a.paymentState&&s.jsx("h4",{className:"single-entity-and-center",style:{marginTop:"6px"},children:`Payment Status: ${a.paymentState=="PAID_ONLINE"?"Online paid":"COD"}`}),N?s.jsx("div",{className:"image-bill",children:s.jsx("img",{src:`${N}`,className:"single-entity-and-center",style:{width:L[l].logoWidth}})}):"",a.footerMessage?s.jsx("h4",{className:"single-entity-and-center",dangerouslySetInnerHTML:{__html:a.footerMessage}}):"",a.printedBy&&a.printOperatorInfo?s.jsx("h6",{className:"left-align-entity",children:`Printed By: ${a.printedBy}`}):"",a.printTime&&a.printOperatorInfo?s.jsx("h6",{className:"left-align-entity",children:`Printed On: ${a.printTime}`}):"",a.disabledPoweredBy?"":s.jsx("h6",{className:"single-entity-and-center",children:"Powered By: www.recaho.com"})]})})}else if(g==="UPDATE_TABLE"){let te="";return a.action==="SWITCH_TABLE"?te=s.jsx("div",{className:"main-div",style:{width:"100%",height:"auto"},children:s.jsxs("div",{style:{width:"100%",textAlign:"left",marginLeft:"auto"},children:[s.jsxs("h2",{className:"single-entity-and-center level2-bold",children:["**",(xt=d.Table)==null?void 0:xt.toUpperCase()," SWITCH**"]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:"From"}),s.jsx("h5",{className:"left-align-entity level3-bold",children:(Qt=a.from)==null?void 0:Qt.map((b,X)=>{var y,_,v;return`${(_=(y=e.tableData[b])==null?void 0:y.attachedArea)==null?void 0:_.toUpperCase()} - ${(v=e.tableData[b])==null?void 0:v.tableName}${X+1===a.from.length?"":", "} `})}),s.jsx("br",{}),s.jsx("h5",{className:"left-align-entity level3-bold",children:"To"}),s.jsx("h2",{className:"left-align-entity level2-bold",children:`${(Ss=(Zt=e.tableData[a.to[0]])==null?void 0:Zt.attachedArea)==null?void 0:Ss.toUpperCase()} - ${(pn=e.tableData[a.to[0]])==null?void 0:pn.tableName}`}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["Running ",`${d.KOT}`,"s: ",Object.keys(a.activeKots).join(", ")]})]})}):te=s.jsx("div",{className:"main-div",style:{width:"100%",height:"auto"},children:s.jsxs("div",{style:{width:"100%",textAlign:"left",marginLeft:"auto"},children:[s.jsxs("h2",{className:"single-entity-and-center level2-bold",children:["**MERGE ",(Ts=d.Table)==null?void 0:Ts.toUpperCase(),"**"]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:"From"}),s.jsx("h5",{className:"left-align-entity level3-bold",children:(yn=a.from)==null?void 0:yn.map((b,X)=>{var y,_,v;return`${(_=(y=e.tableData[b])==null?void 0:y.attachedArea)==null?void 0:_.toUpperCase()} - ${(v=e.tableData[b])==null?void 0:v.tableName}${X+1===a.from.length?"":", "} `})}),s.jsx("br",{}),s.jsx("h5",{className:"left-align-entity level3-bold",children:"To"}),s.jsx("h2",{className:"left-align-entity level2-bold",children:`${(Is=(ws=e.tableData[a.to[0]])==null?void 0:ws.attachedArea)==null?void 0:Is.toUpperCase()} - ${(gn=e.tableData[a.to[0]])==null?void 0:gn.tableName}`}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["Running ",`${d.KOT}`,"s: ",Object.keys(a.activeKots).join(", ")]})]})}),te}else if(g==="COUNTER_OPERATION"){let te;return l=="2INCH"||l=="1.8INCH"?te=s.jsx("div",{className:"main-div",style:{width:L[l].paperSize},children:s.jsxs("div",{style:{width:"100%",textAlign:"left",marginLeft:"auto"},children:[s.jsxs("h2",{className:"single-entity-and-center level2-bold",children:[a.counterName," Report"]}),s.jsxs("h6",{className:"single-entity-and-center level3-bold",children:[" Printed By: ",a.printedBy," "]}),s.jsxs("h6",{className:"single-entity-and-center level3-bold",children:[" Printed On: ",a.printedOn," "]}),s.jsx("hr",{}),s.jsxs("h4",{className:"left-align-entity level3-bold",children:[" Total Sales: ",U(a.totalSale,o)," "]}),a.totalSale>0&&s.jsxs(s.Fragment,{children:[(a.cashSale>0||a.cashSale<0)&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" -- Cash: ",U(a.cashSale,o)," "]}),a.payModes&&a.payModes.length>0&&a.payModes.map(b=>{if(b.value>0||b.value<0)return s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- ",b.displayName," : ",U(b.value,o)]})})]}),s.jsxs("h4",{className:"left-align-entity level3-bold",children:["Cash Balance: ",U(a.closingActualBalance,o)]}),s.jsx("hr",{}),s.jsx("h5",{className:"left-align-entity level3-bold",children:"Opening Counter Operation"}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" -- Opened By : "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",a.openedBy]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" -- Date/Time : "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",a.openingDateTime]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" -- System Opening Balance : "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",U(a.openingBalance,o)," "]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" -- Actual Opening Balance : "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",U(a.actualOpeningBalance,o)]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" -- Opening Difference Amt : "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",U(a.openingShort,o)," "]}),a.openingShortReason&&s.jsx("h5",{className:"left-align-entity level3-bold",children:" -- Opening Difference Reason : "}),a.openingShortReason&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",a.openingShortReason]}),a.openingTotalDenomations>0&&s.jsx(s.Fragment,{children:s.jsx("h5",{className:"left-align-entity level3-bold",children:"-- Currency Denominations"})}),a.openingDenominations&&a.openingDenominations.length>0&&a.openingDenominations.map(b=>s.jsxs("div",{class:o=="INR"?"denomination-container":"denomination-container-other-country",children:[s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",o=="INR"?U(b.denomination,o):b.denomination]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" X "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",b.count," "]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" = "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",U(b.total,o)," "]})]})),a.openingTotalDenomations>0&&s.jsxs("div",{class:o=="INR"?"total-container":"total-container-other-country",children:[s.jsx("h5",{className:"left-align-entity level3-bold",children:" "}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" Total "}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" = "}),s.jsx("h5",{className:"left-align-entity level3-bold",children:U(a.openingTotalDenomations,o)})]}),s.jsx("hr",{}),s.jsx("h5",{className:"left-align-entity level3-bold",children:"Closing Counter Operation"}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" -- Closed By : "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",a.closedBy," "]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" -- Date/Time :"}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",a.closingDateTime]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" -- Cash Sale : "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",U(a.cashSale,o)," "]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" -- System Closing Balance : "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",U(a.closingBalance,o)," "]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" -- Actual Closing Balance : "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",U(a.closingActualBalance,o)]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" -- Closing Difference Amt : "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",U(a.closingShort,o)," "]}),a.closingShortReason&&s.jsx("h5",{className:"left-align-entity level3-bold",children:" -- Closing Difference Reason : "}),a.closingShortReason&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",a.closingShortReason," "]}),a.debitEntry>0&&s.jsxs(s.Fragment,{children:[s.jsx("h5",{className:"left-align-entity level3-bold",children:" -- Other Cash Expense : "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" -",U(a.debitEntry,o)," "]})]}),a.creditEntry>0&&s.jsxs(s.Fragment,{children:[s.jsx("h5",{className:"left-align-entity level3-bold",children:" -- Other Cash Income : "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" +",U(a.creditEntry,o)," "]})]}),a.internalTransferDebit>0&&s.jsxs(s.Fragment,{children:[s.jsx("h5",{className:"left-align-entity level3-bold",children:" -- Internal Transfer(cash to bank): "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" -",U(a.internalTransferDebit,o)]})]}),a.internalTransferCredit>0&&s.jsxs(s.Fragment,{children:[s.jsx("h5",{className:"left-align-entity level3-bold",children:" -- Internal Transfer(bank to cash) : "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" +",U(a.internalTransferCredit,o)]})]}),a.TotalDenomationsAmount>0&&s.jsx(s.Fragment,{children:s.jsx("h5",{className:"left-align-entity level3-bold",children:"-- Currency Denominations"})}),a.denomations&&a.denomations.length>0&&a.denomations.map(b=>s.jsxs("div",{class:o=="INR"?"denomination-container":"denomination-container-other-country",children:[s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",o=="INR"?U(b.denomination,o):b.curr+" "+b.denomination]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" X "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",b.count," "]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" = "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",U(b.total,o)," "]})]})),a.TotalDenomationsAmount>0&&s.jsxs("div",{class:o=="INR"?"total-container":"total-container-other-country",children:[s.jsx("h5",{className:"left-align-entity level3-bold",children:" "}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" Total "}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" = "}),s.jsx("h5",{className:"left-align-entity level3-bold",children:U(a.TotalDenomationsAmount,o)})]})]})}):te=s.jsx("div",{className:"main-div",style:{width:L[l].paperSize},children:s.jsxs("div",{style:{width:"100%",textAlign:"left",marginLeft:"auto"},children:[s.jsxs("h2",{className:"single-entity-and-center level2-bold",children:[a.counterName," Report"]}),s.jsxs("h6",{className:"single-entity-and-center level3-bold",children:[" Printed By: ",a.printedBy," "]}),s.jsxs("h6",{className:"single-entity-and-center level3-bold",children:[" Printed On: ",a.printedOn," "]}),s.jsx("hr",{}),s.jsxs("h4",{className:"left-align-entity level3-bold",children:[" Total Sales: ",U(a.totalSale,o)," "]}),a.totalSale>0&&s.jsxs(s.Fragment,{children:[a.cashSale>0&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" -- Cash: ",U(a.cashSale,o)," "]}),a.payModes&&a.payModes.length>0&&a.payModes.map(b=>{if(b.value>0)return s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- ",b.displayName," : ",U(b.value,o)]})})]}),s.jsxs("h4",{className:"left-align-entity level3-bold",children:["Cash Balance: ",U(a.closingActualBalance,o)]}),s.jsx("hr",{}),s.jsx("h5",{className:"left-align-entity level3-bold",children:"Opening Counter Operation"}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" -- Opened By : ",a.openedBy]}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" -- Date/Time : ",a.openingDateTime]}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- System Opening Balance : ",U(a.openingBalance,o)]}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- Actual Opening Balance : ",U(a.actualOpeningBalance,o)]}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- Opening Difference Amt : ",U(a.openingShort,o)]}),a.openingShortReason&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" -- Opening Difference Reason : ",a.openingShortReason]}),a.openingTotalDenomations>0&&s.jsx(s.Fragment,{children:s.jsx("h5",{className:"left-align-entity level3-bold",children:"-- Currency Denominations"})}),a.openingDenominations&&a.openingDenominations.length>0&&a.openingDenominations.map(b=>s.jsxs("div",{class:o=="INR"?"denomination-container":"denomination-container-other-country",children:[s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",o=="INR"?U(b.denomination,o):b.denomination]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" X "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",b.count," "]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" = "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",U(b.total,o)," "]})]})),a.openingTotalDenomations>0&&s.jsxs("div",{class:o=="INR"?"total-container":"total-container-other-country",children:[s.jsx("h5",{className:"left-align-entity level3-bold",children:" "}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" Total "}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" = "}),s.jsx("h5",{className:"left-align-entity level3-bold",children:U(a.openingTotalDenomations,o)})]}),s.jsx("hr",{}),s.jsx("h5",{className:"left-align-entity level3-bold",children:"Closing Counter Operation"}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" -- Closed By : ",a.closedBy," "]}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" -- Date/Time : ",a.closingDateTime]}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" -- Cash Sale : ",U(a.cashSale,o)," "]}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- System Closing Balance : ",U(a.closingBalance,o)]}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- Actual Closing Balance : ",U(a.closingActualBalance,o)]}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- Closing Difference Amt : ",U(a.closingShort,o)]}),a.closingShortReason&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" -- Closing Difference Reason : ",a.closingShortReason," "]}),a.debitEntry>0&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- Other Cash Expense : -",U(a.debitEntry,o)]}),a.creditEntry>0&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- Other Cash Income : +",U(a.creditEntry,o)]}),a.internalTransferDebit>0&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- Internal Transfer(cash to bank): -",U(a.internalTransferDebit,o)]}),a.internalTransferCredit>0&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- Internal Transfer(bank to cash): +",U(a.internalTransferCredit,o)]}),a.TotalDenomationsAmount>0&&s.jsx(s.Fragment,{children:s.jsx("h5",{className:"left-align-entity level3-bold",children:"--Currency Denominations"})}),a.denomations&&a.denomations.length>0&&a.denomations.map(b=>s.jsxs("div",{class:o=="INR"?"denomination-container":"denomination-container-other-country",children:[s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",o=="INR"?U(b.denomination,o):b.curr+" "+b.denomination]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" X "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",b.count," "]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" = "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",U(b.total,o)," "]})]})),a.TotalDenomationsAmount>0&&s.jsxs("div",{class:o=="INR"?"total-container":"total-container-other-country",children:[s.jsx("h5",{className:"left-align-entity level3-bold",children:" "}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" Total "}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" = "}),s.jsx("h5",{className:"left-align-entity level3-bold",children:U(a.TotalDenomationsAmount,o)})]})]})}),te}else if(g==="ITEMWISE_SALES_COUNTER"){let te,{counterDetails:b}=e.printerDataObject;return te=s.jsx("div",{className:"main-div",style:{width:L[l].paperSize},children:s.jsxs("div",{style:{width:"100%",textAlign:"left",marginLeft:"auto"},children:[s.jsx("h2",{className:"single-entity-and-center level2-bold",children:"Item Wise Sales Report"}),s.jsx("h5",{className:"single-entity-and-center level3-bold",children:b.currentDate}),s.jsx("hr",{}),b.CounterName&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:["Counter Name: ",b.CounterName]}),b.CounterName&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:["UserName: ",b.openedBy]}),b.CounterName&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:["Login Time: ",b.loginTime]}),b.logoutTime&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:["Logout Time: ",b.logoutTime]}),b.CounterName&&s.jsx("hr",{}),st(a),s.jsx("hr",{}),s.jsx("h6",{className:"left-align-entity",children:`Printed By: ${b.openedBy}`}),s.jsx("h6",{className:"left-align-entity",children:`Printed On: ${b.printedOn}`})]})}),te}else if(g==="CARD_RECHARGE_DETAILS"){let{staticDataKOT:te}=e.printerDataObject;return getRechargeDetails(te)}else if(g==="PACKAGING_SLIP"){let te,b=0;u.aggregatorOrderId&&u.aggregatorOrderId!==""&&(te=$(u.aggregatorOrderId));const X=u.services;for(let _ in X)b+=X[_].length;return s.jsx("div",{className:"main-div",style:{width:L[l].paperSize},children:s.jsxs("div",{style:{width:"100%",textAlign:"left",marginLeft:"auto"},children:[s.jsx("br",{}),s.jsxs("div",{className:`details-section ${L[l].dynamicClassname}`,children:[u.subOrderFrom&&s.jsx("h4",{className:"single-entity-and-center",children:u.subOrderFrom.toUpperCase()}),u.orderFrom!=="dine-in"&&s.jsxs("h2",{className:"single-entity-and-center level2-bold",children:["Token No ",u.tokenId]}),u.tableName&&s.jsx("h2",{className:"single-entity-and-center level2-bold",children:u.tableName}),u.otp&&s.jsx("h4",{className:"single-entity-and-center level2-bold",children:"OTP: "+u.otp}),u.orderSource&&te&&s.jsxs("h4",{className:"single-entity-and-center level2-bold",children:[`${u.orderSource}: ${te.firstDigits||""}`,s.jsx("span",{style:{fontSize:"2rem"},children:te.last4Dgits||""})]}),u.zomatoInstant&&s.jsx("h4",{className:"single-entity-and-center level2-bold",children:u.zomatoInstant}),s.jsx("hr",{}),u.orderId&&s.jsx("h5",{className:"left-align-entity level3-bold",children:"Order Id: "+u.orderId}),u.date&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:["Printed On: ",u.date]}),u.prepareBy?s.jsx("h5",{className:"left-align-entity level3-bold",children:"Prepare By : "+u.prepareBy}):"",u.waiterName&&s.jsx("h5",{className:"left-align-entity level3-bold",children:`${d.Waiter} Name: `+u.waiterName})]}),me(u),s.jsx("br",{}),s.jsxs("div",{className:"bottom-section-div flex-two-items space-3rem",children:[s.jsxs("h5",{children:["TOTAL ITEMS: ",b]}),s.jsxs("h5",{children:["TOTAL QTY: ",ve(u.totalQty)]})]}),(xn=u.customFields)==null?void 0:xn.map(_=>s.jsx("h4",{className:"left-align-entity",children:_.customName+": "+_.customValue})),s.jsx("br",{}),u.orderFrom!=="dine-in"&&s.jsxs("h4",{className:"left-align-entity level3-bold",children:["Payment Status: ",u.paymentStatus.replace("_"," ")]})]})})}else{if(g==="ORDER_AGGREGATED_PRINT")return s.jsx("div",{className:"main-div",style:{width:L[l].paperSize},children:s.jsxs("div",{style:{width:"100%",textAlign:"left",marginLeft:"auto"},children:[a.logo&&s.jsx("div",{className:"image-bill",children:s.jsx("img",{src:a.logo,className:"single-entity-and-center"})}),s.jsxs("div",{className:`details-section ${L[l].dynamicClassname}`,children:[!a.logo&&a.companyName&&a.companyName!=""&&s.jsx("h1",{className:"single-entity-and-center",children:a.companyName}),a.companyAddress&&a.companyAddress!==""&&s.jsx("h3",{className:"single-entity-and-center",dangerouslySetInnerHTML:{__html:a.companyAddress}}),a.companyContact&&a.companyContact!==""&&s.jsx("h3",{className:"single-entity-and-center",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:O.company_mobile}}),": ",s.jsx("span",{children:a.companyContact})]})}),a.fssai&&a.fssai!==""&&s.jsx("h3",{className:"single-entity-and-center",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:O.company_FSSAI}}),": ",s.jsx("span",{children:a.fssai})]})}),a.gst&&a.gst!==""&&s.jsx("h3",{className:"single-entity-and-center",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:O.company_GST}}),": ",s.jsx("span",{children:a.gst})]})}),a.vatNo&&a.vatNo!==""&&s.jsx("h3",{className:"single-entity-and-center",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:O.company_VAT}}),": ",s.jsx("span",{children:a.vatNo})]})})]}),s.jsx("hr",{}),s.jsx("h3",{className:"single-entity-and-center",children:"Outstanding Bill Summary"}),s.jsx("hr",{}),s.jsx("hr",{}),a.name&&s.jsxs("h5",{children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:O.name}}),": ",s.jsx("span",{children:a.name})]}),a.mobile&&s.jsxs("h5",{children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:O.mobile}}),": ",s.jsx("span",{children:a.mobile})]}),s.jsxs("div",{className:"mt-2",children:[s.jsx("hr",{}),s.jsx("section",{className:"products-section",children:s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h5",{className:`items products-heading-name ${L[l].dynamicClassname}`,children:"Date"}),s.jsx("h5",{className:`items products-heading-orderId ${L[l].dynamicClassname}`,children:"Order Id"}),s.jsx("h5",{className:`items products-heading-amount ${L[l].dynamicClassname}`,children:"Amount"})]})}),s.jsx("hr",{}),s.jsx("section",{className:"products-section",children:a.orders.map(b=>s.jsx("div",{style:{paddingTop:"12px"},children:s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h6",{className:`items products-heading-name ${L[l].dynamicClassname}`,children:nr(b.date)}),s.jsx("h6",{className:`items products-heading-orderId ${L[l].dynamicClassname}`,children:b.orderId}),s.jsx("h6",{className:`items products-heading-amount ${L[l].dynamicClassname}`,children:a.curr+" "+m(b.finalAmount)})]})},b.orderId))})]}),s.jsxs("div",{children:[s.jsx("hr",{}),s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{className:"total-qty",children:"Total Bill Amount"}),s.jsx("h5",{className:"actual-qty",children:a.curr+" "+m(a.totalAmount)})]}),s.jsx("hr",{}),s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{className:"total-qty",children:"Total Amount Paid"}),s.jsx("h5",{className:"actual-qty",children:a.curr+" "+m(a.totalPaid)})]})]}),(Cs=a.transactions)!=null&&Cs.length?s.jsxs("div",{children:[s.jsx("hr",{}),s.jsx("section",{className:"products-section",children:s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h5",{className:`items products-heading-name ${L[l].dynamicClassname}`,children:"Date"}),s.jsx("h5",{className:`items products-heading-orderId ${L[l].dynamicClassname}`,children:"Payment Mode"}),s.jsx("h5",{className:`items products-heading-amount ${L[l].dynamicClassname}`,children:"Amount"})]})}),s.jsx("hr",{}),s.jsx("section",{className:"products-section",children:a.transactions.map(b=>s.jsx("div",{style:{paddingTop:"12px"},children:s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h6",{className:`items products-heading-name ${L[l].dynamicClassname}`,children:b.date}),s.jsx("h6",{className:`items products-heading-orderId ${L[l].dynamicClassname}`,children:b.paymentMode}),s.jsx("h6",{className:`items products-heading-amount ${L[l].dynamicClassname}`,children:a.curr+" "+m(b.amount)})]})},b.id))})]}):"",s.jsxs("div",{className:"mt-2 pb-2rem",children:[s.jsx("hr",{}),s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h4",{className:"total-qty-other",children:"Total Payable"}),s.jsx("h4",{className:"actual-qty-other",children:a.curr+" "+m(a.totalPayable)})]})]})]})});{let te,b=0,X,y;for(let v=0;v<(((Os=a.services)==null?void 0:Os.length)||0);v++)y=a.services[v],y.status==="CANCELLED"&&!a.onlyCancelledItems&&(b+=y.qty);return a.aggregatorOrderId&&a.aggregatorOrderId!==""&&(te=$(a.aggregatorOrderId)),s.jsx("div",{className:"main-div",style:{width:L[l].paperSize},children:s.jsxs("div",{style:{maxWidth:"100%",textAlign:"left",marginLeft:"auto"},children:[s.jsx("br",{}),s.jsxs("div",{className:"main-div",children:[a.duplicate&&!a.onlyCancelledItems?s.jsx("h4",{className:"single-entity-and-center",children:"DUPLICATE KOT"}):"",b||a.onlyCancelledItems?s.jsx("h4",{className:"single-entity-and-center",children:"EDITED KOT - ITEM CANCELLED"}):"",a.station&&s.jsx("h4",{className:"single-entity-and-center level2-bold",children:a.station.toUpperCase()}),a.subOrderFrom&&s.jsx("h4",{className:"single-entity-and-center",children:a.subOrderFrom.toUpperCase()}),a.type!="dine-in"&&a.tokenId&&s.jsxs("h2",{className:"single-entity-and-center level2-bold",children:["Token No ",a.tokenId]}),a.type=="dine-in"&&a.type&&s.jsx("h2",{className:"single-entity-and-center level2-bold",children:a.type==="dine-in"?a.tableName?a.tableName:"-":""}),s.jsx("hr",{}),a.otp&&s.jsx("h4",{className:"single-entity-and-center level2-bold",children:"OTP: "+a.otp}),a.orderSource&&te&&s.jsxs("h4",{className:"single-entity-and-center level2-bold",children:[`${a.orderSource}: ${te.firstDigits||""}`,s.jsx("span",{style:{fontSize:"2rem"},children:te.last4Dgits||""})]}),a.zomatoInstant&&s.jsx("h4",{className:"single-entity-and-center level2-bold",children:a.zomatoInstant}),s.jsxs("div",{className:"details-section",children:[a.orderId&&s.jsx("h5",{className:"left-align-entity level3-bold",children:"Order Id: "+Array.from(a.orderId).join(", ")}),s.jsxs("div",{className:"flex-container-kot",children:[a.kotId&&s.jsx("h5",{className:"left-align-entity level3-bold",children:`${d.KOT} Id: `+Array.from(a.kotId).join(", ")}),a.type&&a.type!="dine-in"&&s.jsx("h2",{className:"left-align-entity",children:a.type==="dine-in"?a.tableName?a.tableName:"-":""})]}),a.customerName&&s.jsx("h5",{className:"left-align-entity level3-bold",children:a.customerName}),a.time?s.jsx("h5",{className:"left-align-entity level3-bold",children:"Printed On : "+a.time}):"",a.prepareBy?s.jsx("h5",{className:"left-align-entity level3-bold",children:"Prepare By : "+a.prepareBy}):""]}),a.createdBy&&s.jsx("h5",{className:"left-align-entity level3-bold",children:"Printed By: "+a.createdBy}),a.waiterName&&s.jsx("h5",{className:"left-align-entity level3-bold",children:`${d.Waiter} Name: `+a.waiterName})]}),s.jsx("hr",{}),s.jsxs("section",{className:`products-section ${_e}`,children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h5",{className:"items products-heading-name-kot",children:L[l].itemName}),s.jsx("h5",{className:"items products-heading-qty-kot",children:"QTY"})]}),s.jsx("hr",{})]}),s.jsxs("section",{className:`products-section ${_e}`,style:{paddingTop:"12px"},children:[a.services&&a.services.length&&a.services.length>0&&a.services.reverse().map(v=>(v.status==="CANCELLED"?X=s.jsxs("strike",{children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h2",{className:"items products-heading-name-kot ",children:Ke(v.serviceName)}),s.jsx("h2",{className:"items products-heading-qty-kot ",children:v.qty})]}),v.addons&&v.addons.length&&v.addons.map(z=>s.jsx("h2",{className:"items products-heading-addon-kot",children:"- "+Ke(z.serviceName)})),v.instruction&&s.jsx("h4",{className:"left-align-entity level2-bold",children:s.jsx("h4",{className:"items products-heading-addon-kot",children:" "+v.instruction})})]}):X=s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h2",{className:"items products-heading-name-kot ",children:Ke(v.serviceName)}),s.jsx("h2",{className:"items products-heading-qty-kot ",children:v.qty})]}),v.addons&&v.addons.length&&v.addons.map(z=>s.jsx("h2",{className:"items products-heading-addon-kot",children:"- "+Ke(z.serviceName)})),v.instruction&&s.jsx("h4",{className:"left-align-entity level2-bold",children:s.jsx("h4",{className:"items products-heading-addon-kot",children:" "+v.instruction})})]}),s.jsx("div",{children:X}))),s.jsx("hr",{})]}),s.jsxs("div",{className:"bottom-section-div flex-two-items",style:{paddingBottom:"3rem"},children:[s.jsxs("h5",{className:"level3-bold",children:["TOTAL ITEMS: ",a.services.length]}),s.jsxs("h5",{className:"level3-bold",children:["TOTAL QTY: ",ve(a.totalQty-b)]})]}),(Nn=a.customFields)==null?void 0:Nn.map(v=>s.jsx("h4",{className:"left-align-entity",children:v.customName+": "+v.customValue})),a.deliveryTimestamp&&s.jsx("h5",{className:"left-align-entity level3-bold",children:"Delivery Date: "+a.deliveryTimestamp})]})})}}};return s.jsx("div",{children:a&&Object.keys(a).length!==0&&s.jsx("div",{id:"domEl",ref:n,className:"html-bill-print",style:{maxWidth:L[l].paperSize,zIndex:"-10",backgroundColor:"#fff"},children:Ot(f,a.obj,a.companyLogo,a.companyQrCode)})})},Mh=async(e,t,n,r={})=>new Promise(async(i,a)=>{var h,f,o;try{const{needPackagingSlip:l=!0}=r;e.primaryWaiter&&n&&(e.primaryWaiter=((h=n[e.primaryWaiter])==null?void 0:h.name)||null);const{obj:c,printersMap:d}=_d(e,t,r);let p=[],m=[];const x=ba(c).flatMap(j=>{var S;return(S=d[j.station])==null?void 0:S.map(A=>new Promise(w=>s.jsx(tt,{printerDataObject:{staticDataKOT:j,paperSize:A.paperSize,printer:A.printer},newId:j.newId,value:{settingData:t},onImageGenerated:I=>{p.push({paperSize:A.paperSize,printer:A.printer,image:I,type:"KOT"}),w()},additionalActions:r},j.newId)))});if(l&&((f=t.packagingSlipPrinters)!=null&&f.length)){const j=bd(e,t,r);(o=j.printers)!=null&&o.length&&j.printers.forEach(S=>{m.push(new Promise(A=>{x.push(s.jsx(tt,{printerDataObject:{staticDataKOT:{obj:S.obj},paperSize:S.paperSize,printer:S.printer,type:"PACKAGING_SLIP"},newId:S.obj.newId,value:{settingData:t},onImageGenerated:w=>{p.push({paperSize:S.paperSize,printer:S.printer,image:w,type:"PACKAGING_SLIP"}),A()},additionalActions:r},S.obj.newId))}))})}x.length&&pt("root2",x),await Promise.all(m),i(p)}catch(l){a(l)}}),Ah=(e,t,n)=>new Promise(async(r,i)=>{try{const{tableData:a}=n;let h=[],f=[];if(n!=null&&n.action){const{obj:o,paperSize:l,printersMap:c}=Sd(e,t,n),d=ba(o).flatMap(p=>{var m;return(m=c[p.station])==null?void 0:m.map(x=>new Promise(j=>{const S=s.jsx(tt,{printerDataObject:{staticDataKOT:p,paperSize:l,printer:x.printer,type:p.type},newId:p.newId,settingData:t,tableData:ms(a,"typeValue"),onImageGenerated:A=>{h.push({paperSize:x.paperSize,printer:x.printer,image:A,type:"UPDATE_TABLE"}),j()},additionalActions:n});return f.push(j),S}))});d.length&&pt("root1",d),await Promise.all(f.map(p=>new Promise(p)))}r(h)}catch(a){i(a)}}),Eh=(e,t)=>new Promise(async(n,r)=>{try{const i=Td(e,t);let a=[];await new Promise(f=>{const o=s.jsx(tt,{printerDataObject:{staticDataKOT:{obj:i},paperSize:e.printerSize,type:"PRINT_DASHBOARD"},newId:i.id,settingData:e,onImageGenerated:l=>{a.push({paperSize:e.printerSize,image:l,type:"PRINT_DASHBOARD"}),f()},additionalActions:t});pt("root1",o)}),n(a)}catch(i){r(i)}}),Rh=async(e,t,n)=>new Promise(async(r,i)=>{try{const{obj:a}=await wd(e,t,n);let h=[];await new Promise(o=>{const l=s.jsx(tt,{printerDataObject:{staticDataKOT:a,paperSize:a.paperSize,type:"AGGREGATOR_BILL"},newId:Math.random(),settingData:t,onImageGenerated:c=>{h.push({paperSize:a.paperSize,image:c,type:"AGGREGATOR_BILL"}),o()},additionalActions:n});pt("root1",l)}),r(h)}catch(a){i(a)}}),kh=async(e,t,n)=>new Promise(async(r,i)=>{try{let a=await _a(e,t,n),h=[];await new Promise(o=>{const l=s.jsx(tt,{printerDataObject:{staticDataKOT:a,paperSize:a.paperSize,type:"BILL"},newId:Math.random(),settingData:t,onImageGenerated:c=>{h.push({paperSize:a.paperSize,image:c,type:"BILL"}),o()},additionalActions:n});pt("root1",l)}),r(h)}catch(a){i(a)}}),Lh=async(e,t,n,r)=>new Promise(async(i,a)=>{try{let h=await Id(e);if(h&&Object.keys(h.Category).length!==0){let o=`ItemWiseSales:::${Math.floor(Math.random()*1e3)}`,l=[];await new Promise(d=>{const p=s.jsx(tt,{printerDataObject:{staticDataKOT:h,paperSize:t.printerSize,type:"ITEMWISE_SALES_COUNTER",counterDetails:n},newId:o,settingData:t,onImageGenerated:m=>{l.push({paperSize:t.printerSize,image:m,type:"ITEMWISE_SALES_COUNTER"}),d()},additionalActions:r});pt("root1",p)}),i(l)}else i([])}catch(h){a(h)}}),Ph=async(e,t,n)=>new Promise(async(r,i)=>{try{let h=`counterDetailsPrint:::${Math.floor(Math.random()*1e3)}`,f=[];await new Promise(l=>{const c=s.jsx(tt,{printerDataObject:{staticDataKOT:e,paperSize:t.printerSize,type:"COUNTER_OPERATION"},newId:h,settingData:t,onImageGenerated:d=>{f.push({paperSize:t.printerSize,image:d,type:"COUNTER_OPERATION"}),l()},additionalActions:n});pt("root1",c)}),r(f)}catch(a){i(a)}}),Fh=async(e,t,n={},r={})=>new Promise(async(i,a)=>{var h;try{const f=await Od(e,t);let o=[],l=lr(null,{fontTheme:t.fontTheme,type:"ORDER_AGGREGATED_PRINT",siteSetting:t}),c=l?(h=l[0])==null?void 0:h.paperSize:t.printerSize;await new Promise(p=>{const m=s.jsx(tt,{printerDataObject:{staticDataKOT:{...f,name:n.name,mobile:n.mobile},paperSize:c,type:"ORDER_AGGREGATED_PRINT"},newId:Math.random(),settingData:t,onImageGenerated:x=>{o.push({paperSize:c,image:x,type:"ORDER_AGGREGATED_PRINT"}),p()},additionalActions:r});pt("root1",m)}),i(o)}catch(f){a(f)}}),Dh=async(e,t,n={})=>new Promise(async(r,i)=>{var a;try{const h=[];let f=[];for(let o=0;o<e.length;o++){let l=e[o];if((a=l.invoiceFormats)!=null&&a.length){let c=cd(l.invoiceFormats,"createdAt")[0],d=await Md(c);await new Promise(m=>{const x=s.jsx(tt,{printerDataObject:{staticDataKOT:d,paperSize:d.paperSize,type:"BILL"},newId:Math.random(),settingData:t,onImageGenerated:j=>{f.push({paperSize:d.paperSize,image:j,type:"BILL"}),m()},additionalActions:n});h.push(x)})}}h.length&&pt("root1",h),r(f)}catch(h){i(h)}}),pt=(e,t)=>{const n=document.getElementById(e);n&&ii.createRoot(n).render(t)};Ce.counterDetailsPrint=Ph,Ce.handleAggregatorBillPrint=Rh,Ce.handleBillPrint=kh,Ce.handleDashboardPrint=Eh,Ce.handleItemWisePrint=Lh,Ce.handleKOTPrint=Mh,Ce.handleOldBillPrints=Dh,Ce.handleSummaryPrint=Fh,Ce.handleUpdateTablePrint=Ah,Object.defineProperty(Ce,Symbol.toStringTag,{value:"Module"})});
|
|
54
|
+
*/var Wa={L:qt.QrCode.Ecc.LOW,M:qt.QrCode.Ecc.MEDIUM,Q:qt.QrCode.Ecc.QUARTILE,H:qt.QrCode.Ecc.HIGH},za=128,Ga="L",Va="#FFFFFF",qa="#000000",Ka=!1,fr=4,Sh=.1;function Qa(e,t=0){const n=[];return e.forEach(function(r,i){let a=null;r.forEach(function(h,f){if(!h&&a!==null){n.push(`M${a+t} ${i+t}h${f-a}v1H${a+t}z`),a=null;return}if(f===r.length-1){if(!h)return;a===null?n.push(`M${f+t},${i+t} h1v1H${f+t}z`):n.push(`M${a+t},${i+t} h${f+1-a}v1H${a+t}z`);return}h&&a===null&&(a=f)})}),n.join("")}function Za(e,t){return e.slice().map((n,r)=>r<t.y||r>=t.y+t.h?n:n.map((i,a)=>a<t.x||a>=t.x+t.w?i:!1))}function Ja(e,t,n,r){if(r==null)return null;const i=n?fr:0,a=e.length+i*2,h=Math.floor(t*Sh),f=a/t,o=(r.width||h)*f,l=(r.height||h)*f,c=r.x==null?e.length/2-o/2:r.x*f,d=r.y==null?e.length/2-l/2:r.y*f;let p=null;if(r.excavate){let m=Math.floor(c),x=Math.floor(d),j=Math.ceil(o+c-m),S=Math.ceil(l+d-x);p={x:m,y:x,w:j,h:S}}return{x:c,y:d,h:l,w:o,excavation:p}}var Th=function(){try{new Path2D().addPath(new Path2D)}catch{return!1}return!0}();function wh(e){const t=e,{value:n,size:r=za,level:i=Ga,bgColor:a=Va,fgColor:h=qa,includeMargin:f=Ka,style:o,imageSettings:l}=t,c=mr(t,["value","size","level","bgColor","fgColor","includeMargin","style","imageSettings"]),d=l==null?void 0:l.src,p=Ne.useRef(null),m=Ne.useRef(null),[x,j]=Ne.useState(!1);Ne.useEffect(()=>{if(p.current!=null){const w=p.current,I=w.getContext("2d");if(!I)return;let P=qt.QrCode.encodeText(n,Wa[i]).getModules();const D=f?fr:0,R=P.length+D*2,q=Ja(P,r,f,l),se=m.current,J=q!=null&&se!==null&&se.complete&&se.naturalHeight!==0&&se.naturalWidth!==0;J&&q.excavation!=null&&(P=Za(P,q.excavation));const ce=window.devicePixelRatio||1;w.height=w.width=r*ce;const Te=r/R*ce;I.scale(Te,Te),I.fillStyle=a,I.fillRect(0,0,R,R),I.fillStyle=h,Th?I.fill(new Path2D(Qa(P,D))):P.forEach(function(G,K){G.forEach(function(B,me){B&&I.fillRect(me+D,K+D,1,1)})}),J&&I.drawImage(se,q.x+D,q.y+D,q.w,q.h)}}),Ne.useEffect(()=>{j(!1)},[d]);const S=ys({height:r,width:r},o);let A=null;return d!=null&&(A=Ne.createElement("img",{src:d,key:d,style:{display:"none"},onLoad:()=>{j(!0)},ref:m})),Ne.createElement(Ne.Fragment,null,Ne.createElement("canvas",ys({style:S,height:r,width:r,ref:p},c)),A)}function Ih(e){const t=e,{value:n,size:r=za,level:i=Ga,bgColor:a=Va,fgColor:h=qa,includeMargin:f=Ka,imageSettings:o}=t,l=mr(t,["value","size","level","bgColor","fgColor","includeMargin","imageSettings"]);let c=qt.QrCode.encodeText(n,Wa[i]).getModules();const d=f?fr:0,p=c.length+d*2,m=Ja(c,r,f,o);let x=null;o!=null&&m!=null&&(m.excavation!=null&&(c=Za(c,m.excavation)),x=Ne.createElement("image",{xlinkHref:o.src,height:m.h,width:m.w,x:m.x+d,y:m.y+d,preserveAspectRatio:"none"}));const j=Qa(c,d);return Ne.createElement("svg",ys({height:r,width:r,viewBox:`0 0 ${p} ${p}`},l),Ne.createElement("path",{fill:a,d:`M0,0 h${p}v${p}H0z`,shapeRendering:"crispEdges"}),Ne.createElement("path",{fill:h,d:j,shapeRendering:"crispEdges"}),x)}var Xa=e=>{const t=e,{renderAs:n}=t,r=mr(t,["renderAs"]);return n==="svg"?Ne.createElement(Ih,ys({},r)):Ne.createElement(wh,ys({},r))};const gs=(e,t)=>t*100/e,Ch=e=>!!(e||e===0),Oh={ABSOLUTE:"AMT",RELATIVE:"%",COMPLIMENTARY:"COMPLIMENTARY"},L=new Object({"3INCH":{lines:"- - - - - - - - - - - - - - - - - - - - - - - - - - - - -",paperSize:"36rem",itemName:"Item Name ",dynamicClassname:"size-3inch",textSize:19},"2INCH":{lines:"- - - - - - - - - - - - - - - - - - - -",paperSize:"23rem",itemName:"Item Name ",dynamicClassname:"size-2inch",textSize:13},"2.5INCH":{paperSize:"28rem",itemName:"Item Name ",dynamicClassname:"size-2inch",textSize:13},"2.7INCH":{paperSize:"30.6rem",itemName:"Item Name ",dynamicClassname:"size-3inch",textSize:19},"1.8INCH":{paperSize:"20.7rem",itemName:"Item Name ",dynamicClassname:"size-2inch",textSize:13},A4:{paperSize:"297mm",itemName:"Item Name ",dynamicClassname:"size-a4",textSize:13},A5:{paperSize:"148mm",itemName:"Item Name ",dynamicClassname:"size-a5",textSize:9}});var xs=er(),_e="normal-class";(xs=="Android OS"||xs==="iOS")&&(_e="bold-class");const tt=e=>{var rt,Mt,Z,be,yt;const t=e.additionalActions??{},n=Ne.useRef(null),r=e.settingData?e.settingData:e.value.settingData,i=localStorage.getItem("siteId"),{staticDataKOT:a,printer:h,type:f}=e.printerDataObject,o=((Mt=(rt=e.value)==null?void 0:rt.settingData)==null?void 0:Mt.curr)??((Z=e.settingData)==null?void 0:Z.curr)??"INR";r==null||r.fontTheme;let l=e.printerDataObject.paperSize,c=lr(h,{type:f,siteSetting:e.settingData?e.settingData:e.value.settingData},t);const d=r.customLabels??gd();l=c?(be=c[0])!=null&&be.paperSize?(yt=c[0])==null?void 0:yt.paperSize:l||"3INCH":e.printerDataObject.paperSize;function p(g){const u=Math.abs(parseFloat(g));return m(u)}function m(g){switch(o){case"BHD":case"KWD":case"MUR":case"OMR":return Xs(g).format("0,00.000");default:return Xs(g).format("0,00.00")}}Ne.useEffect(()=>{A()},[e.newId]);const x=()=>new Promise(async(g,u)=>{if(xs=="Android OS"||xs==="iOS"){let C=await _h(n.current);if(C){const N=await S(C);g(N)}}else{let C=await Ua(n.current);C&&g(C)}}),j=()=>new Promise(async(g,u)=>{const C=await x();g(C)}),S=g=>new Promise((u,C)=>{let N=new Image;N.src=g,N.onload=()=>{let O=document.createElement("canvas");const F=600,T=N.height;let k=N.width,H=N.height;k>H?k>F&&(H*=F/k,k=F):H>T&&(k*=T/H,H=T),O.width=k,O.height=H,O.getContext("2d").drawImage(N,0,0,k,H),u(O.toDataURL())}}),A=async()=>{if(n&&n.current){const g=await j();e.onImageGenerated(g)}},w=g=>{let u=new Array;for(const C in g.menusCollection)C.endsWith("collection")||(g.menusCollection[`${C}_collection`]||g.menusCollection[C])&&u.push(s.jsxs("h5",{className:"left-align-entity level3-bold display-percentage",children:[s.jsx("span",{children:` -- ${C.replace("_"," ")}(${g.menusCollection[C]}):`}),s.jsx("span",{children:oe(g.menusCollection[`${C}_collection`],o)}),s.jsx("span",{children:m(gs(g.salesCollection.totalCollection,g.menusCollection[`${C}_collection`]??0))+"%"})]}));return g.salesCollection.online_aggregator_collection&&u.push(s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:` -- Aggregator(${g.salesCollection.online_aggregator}):`}),s.jsx("span",{children:oe(g.salesCollection.online_aggregator_collection,o)})]}),s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:` -- Zomato(${g.salesCollection.zomato_aggregator??0}):`}),s.jsx("span",{children:oe(g.salesCollection.zomato_aggregator_collection,o)})]}),s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:` -- Swiggy(${g.salesCollection.swiggy_aggregator??0}):`}),s.jsx("span",{children:oe(g.salesCollection.swiggy_aggregator_collection,o)})]})),u},I=g=>{let u=new Array,C=new Object;for(let N=0;N<g.todayCollection.length;N++)C=g.todayCollection[N],u.push(s.jsxs("h5",{className:"left-align-entity level3-bold display-percentage",children:[s.jsx("span",{children:` -- ${C.displayName}:`}),s.jsx("span",{children:oe(C.value,o)}),s.jsx("span",{children:m(gs(g.totalCollection,C.value))+"%"})]}));return u},P=(g,u,C,N,O={})=>{let F=g.includes("upi://");const T=`upi://pay?pa=${g}&pn=${C}&cu=INR&am=${N}&tr=${u}`;return s.jsx(Xa,{value:F?g:T,renderAs:"canvas",size:O.size??250})},D=(g,u)=>{var F,T;let C=0;if((F=u.taxObj)!=null&&F.VAT.length){let k,H,fe;for(H=0;H<((T=u.taxObj)==null?void 0:T.VAT.length);H++){k=u.taxObj.VAT[H];for(fe in k)C+=ve(k[fe])}}const N={sellerName:u.companyInfo.companyName,vatRegistrationNumber:g,invoiceTimestamp:new Date(u.orderInfo.timestamp*1e3).toISOString(),invoiceTotal:u.finalAmount,invoiceVatTotal:C},O=yd(N.sellerName,N.vatRegistrationNumber,N.invoiceTimestamp,N.invoiceTotal,N.invoiceVatTotal.toFixed(2));return s.jsx(Xa,{value:O,renderAs:"canvas",size:250})},R=g=>{const u=[];return(g.totalBalanceAmt||g.refundAmt||g.writeOffAmt||g.rewardAmt||g.cashCard)&&(u.push(s.jsx("hr",{})),g.rewardAmt&&u.push(s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:"REWARDS:"}),s.jsx("span",{children:oe(g.rewardAmt,o)})]})),g.totalBalanceAmt&&u.push(s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:"OUTSTANDING AMOUNT:"}),s.jsx("span",{children:oe(g.totalBalanceAmt,o)})]})),g.writeOffAmt&&u.push(s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:"WRITE OFF AMOUNT:"}),s.jsx("span",{children:oe(g.writeOffAmt,o)})]})),g.refundAmt&&u.push(s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:"REFUND AMOUNT:"}),s.jsx("span",{children:oe(g.refundAmt,o)})]})),g.cashCard&&u.push(s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:"CASH CARD:"}),s.jsx("span",{children:oe(g.cashCard,o)})]}))),u},q=(g,u)=>{if(u&&u.length){for(let C=0;C<u.length;C++)if(u[C].slugName===g)return u[C]}return!1},se=(g,u)=>{if(u&&u.length){for(let C=0;C<u.length;C++)if(u[C].itemType===g)return u[C]}return!1},J=new Object({CREDIT:"Other Income",DEBIT:"Expense"}),ce=g=>g.discountType==="COMPLIMENTARY"?"@ COMPLIMENTARY":`@ ${g.discountValue}${Oh[g.discountType]}`,Te=g=>{const u=new Array;if(g&&Object.keys(g).length!==0){u.push(s.jsx("h4",{className:"single-entity-and-center",children:"ACCOUNTS"}));for(const C in g)if(u.push(s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:`Total ${J[C]}:`}),s.jsx("span",{children:oe(g[C].total,o)})]})),C&&Object.keys(C).length!==0)for(const N in g[C])N!=="total"&&g[C][N]&&u.push(s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:` -- ${Ke(N)}:`}),s.jsx("span",{children:oe(g[C][N],o)})]}))}return u},G=(g,u)=>{let C=!1;g.totalValue&&(C=Object.keys(g.totalValue).length>1);let N=new Object;return s.jsxs(s.Fragment,{children:[g.totalValue&&Object.keys(g.totalValue).map(F=>{if(N=g.totalValue[F],F==="GST")return s.jsxs(s.Fragment,{children:[s.jsx("hr",{}),s.jsxs("section",{className:"products-section",children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h4",{className:`items products-heading-name ${L[l].dynamicClassname}`,dangerouslySetInnerHTML:{__html:u.item_name}}),s.jsx("h4",{className:`items products-heading-qty ${L[l].dynamicClassname}`,dangerouslySetInnerHTML:{__html:u.qty}}),s.jsx("h4",{className:`items products-heading-rate ${L[l].dynamicClassname}`,dangerouslySetInnerHTML:{__html:u.rate}}),s.jsx("h4",{className:`items products-heading-amt ${L[l].dynamicClassname}`,dangerouslySetInnerHTML:{__html:u.amt}})]}),s.jsx("hr",{})]}),s.jsxs("section",{className:"products-section",style:{paddingTop:"12px"},children:[g.itemList&&g.itemList.length&&g.itemList.length>0&&g.itemList.map(T=>{if(T.taxType===F||!T.taxType)return s.jsxs("div",{style:T.name.startsWith("+ ")?{}:{paddingTop:"12px"},children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsxs("h6",{className:`items products-heading-name ${L[l].dynamicClassname}`,style:{fontWeight:"lighter",lineHeight:1.2},children:[T.status==="RETURNED"?"(R) ":"",T.name.toUpperCase()]}),s.jsxs("h6",{className:`items products-heading-qty ${L[l].dynamicClassname}`,style:{fontWeight:"lighter"},children:[T.status==="RETURNED"?"-":"",T.quantity]}),s.jsx("h6",{className:`items products-heading-rate ${L[l].dynamicClassname}`,style:{fontWeight:"lighter"},children:T.rate?p(T.rate):""}),s.jsx("h6",{className:`items products-heading-amt ${L[l].dynamicClassname}`,style:{fontWeight:"lighter"},children:T.status==="RETURNED"?T.serviceAmount?m(T.serviceAmount):"":T.price?m(T.price):""})]}),T.addons&&T.addons.length&&T.addons.map(k=>s.jsx("h6",{className:`items products-heading-addon-kot ${L[l].dynamicClassname}`,children:"- "+Ke(k.serviceName)})),T.instruction&&g.itemInstructionOnBill&&s.jsx("h6",{className:"left-align-entity level2-bold",children:s.jsx("h6",{className:"items products-heading-addon-kot",children:" ("+T.instruction+")"})})]})}),s.jsx("hr",{})]}),s.jsxs("div",{className:`bottom-section ${L[l].dynamicClassname}`,children:[s.jsxs("div",{className:"bottom-section-div inline-display",style:{paddingTop:"12px"},children:[s.jsx("h5",{className:"total-qty",dangerouslySetInnerHTML:{__html:u.subtotal}}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+m(N.gstTTL)})]}),i=="25e5f1e4-68ff-43a7-b042-bebb93f42b94"?s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h5",{className:"total-qty",children:"المجموع الفرعي"}),s.jsx("h5",{className:"actual-qty"})]}):"",N&&N.cat&&Object.keys(N.cat).length>0?Object.keys(N.cat).map(T=>{const k=q(T,g.discArr);if(k&&N.cat[T]!==0&&k.serviceName)return s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{className:"total-qty",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:u[`disc_${k.serviceName.toLowerCase()}`]??"DISC-"+k.serviceName.toUpperCase()}}),s.jsx("span",{children:" @"+k.discountValue+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+m(N.cat[T])})]})}):"",g.totalItemDisc&&N&&N.itemTypes&&Object.keys(N.itemTypes).length>0?Object.keys(N.itemTypes).map(T=>{const k=se(T,g.itemTypeDiscObj);if(k&&N.itemTypes[T]!==0&&k.itemType&&k.value)return s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{className:"total-qty",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:u[`disc_${k.itemType.toLowerCase()}`]??"DISC-"+k.itemType.toUpperCase()}}),s.jsx("span",{children:" @"+k.value+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+m(N.itemTypes[T])})]})}):"",g.segMentDisc&&N&&N.segDisc?s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{className:"total-qty",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:u[`segment_disc${g.segMentObj.segmentName.toLowerCase()}`]??g.segMentObj.segmentName.toUpperCase()+"DISC"}}),s.jsx("span",{children:" @"+g.segMentObj.discountValue+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+m(N.segDisc)})]}):"",N&&N.orderDisc?s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{className:"total-qty",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:g.couponCode?u.coupon_disc??"COUPON DISC":u.order_disc??"ORDER DISC"}}),":",s.jsxs("span",{children:[g.couponCode?`(${g.couponCode.toUpperCase()})`:"",m(g.dicsEnterValue)?`@${g.dicsEnterValue}${g.discountType=="RELATIVE"||g.discountType=="COMPLIMENTARY"?"%":"AMT"}`:""]})]})}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+m(N.orderDisc)})]}):"",i=="25e5f1e4-68ff-43a7-b042-bebb93f42b94"&&N&&N.orderDisc?s.jsxs("div",{className:"bottom-section-div",children:[s.jsxs("h5",{className:"total-qty",children:[" ",g.couponCode?"COUPON DISC":"خصم الطلب",g.couponCode?`(${g.couponCode.toUpperCase()})`:""]}),s.jsx("h5",{className:"actual-qty"})]}):"",N.otherCharges&&N.otherCharges.length>0?N.otherCharges.map(T=>s.jsx(s.Fragment,{children:s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{className:"total-qty",dangerouslySetInnerHTML:{__html:u[`charges_${T.name.toLowerCase()}`]??T.name}}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+m(T.amt)})]})})):"",N&&N.aftDisc&&N.gstTTL!==N.aftDisc?s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{className:"total-qty",dangerouslySetInnerHTML:{__html:u.amt_before_tax}}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+m(N.aftDisc)})]}):"",i=="25e5f1e4-68ff-43a7-b042-bebb93f42b94"&&N&&N.aftDisc&&N.gstTTL!==N.aftDisc?s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h5",{className:"total-qty",children:"المبلغ قبل الضريبة"}),s.jsx("h5",{className:"actual-qty"})]}):"",g.taxObj&&g.taxObj[F]&&N?s.jsx(s.Fragment,{children:F==="GST"?g.taxObj[F].map(T=>{let k=new Array;for(const H in T)if(T[H]&&T[H]!=0){let fe=H/2;k.push(s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h5",{className:"total-qty",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:u.cgst}}),s.jsx("span",{children:" @"+fe+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+m(T[H]/2)})]}),s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h5",{className:"total-qty",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:u[g.taxLabel.toLowerCase()]}}),s.jsx("span",{children:" @"+fe+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+m(T[H]/2)})]})]}))}return k}):g.taxObj[F].map(T=>{let k=new Array;for(const H in T)if(T[H]&&T[H]!=0){let fe=H;k.push(s.jsx(s.Fragment,{children:s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h5",{className:"total-qty",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:u.vat}}),s.jsx("span",{children:" @"+fe+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+m(T[H])})]})}))}return k})}):"",N.gstTTL!==(N.total||0)+(N.aftDisc||0)+N.taxOnCharges&&s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{className:"total-qty",dangerouslySetInnerHTML:{__html:u.total}}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+m((N.total||0)+(N.aftDisc||0)+N.taxOnCharges)})]}),i=="25e5f1e4-68ff-43a7-b042-bebb93f42b94"&&N.gstTTL!==(N.total||0)+(N.aftDisc||0)+N.taxOnCharges&&s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h5",{className:"total-qty",children:"المجموع"}),s.jsx("h5",{className:"actual-qty"})]}),g.totalValue&&(Object.keys(g.totalValue).length||0)>1?s.jsx("h4",{className:"single-entity-and-center",style:{marginTop:"10px"},children:"- - - - -"}):"",C&&s.jsx("div",{className:"space-2rem"})]})]})}),g.totalValue&&Object.keys(g.totalValue).map(F=>{if(N=g.totalValue[F],F==="VAT")return s.jsxs(s.Fragment,{children:[s.jsx("hr",{}),s.jsxs("section",{className:"products-section",children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h6",{className:`items products-heading-name ${L[l].dynamicClassname}`,dangerouslySetInnerHTML:{__html:u.item_name}}),s.jsx("h6",{className:`items products-heading-qty ${L[l].dynamicClassname}`,dangerouslySetInnerHTML:{__html:u.qty}}),s.jsx("h6",{className:`items products-heading-rate ${L[l].dynamicClassname}`,dangerouslySetInnerHTML:{__html:u.rate}}),s.jsx("h6",{className:`items products-heading-amt ${L[l].dynamicClassname}`,dangerouslySetInnerHTML:{__html:u.amt}})]}),s.jsx("hr",{})]}),s.jsxs("section",{className:"products-section",style:{paddingTop:"12px"},children:[g.itemList&&g.itemList.length&&g.itemList.length>0&&g.itemList.map(T=>{if(T.taxType===F)return s.jsxs("div",{style:T.name.startsWith("+ ")?{}:{paddingTop:"12px"},children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsxs("h6",{className:`items products-heading-name ${L[l].dynamicClassname}`,children:[T.status==="RETURNED"?"(R) ":"",T.name.toUpperCase()]}),s.jsxs("h6",{className:`items products-heading-qty ${L[l].dynamicClassname}`,children:[T.status==="RETURNED"?"-":"",T.quantity]}),s.jsx("h6",{className:`items products-heading-rate ${L[l].dynamicClassname}`,children:T.rate?p(T.rate):""}),s.jsx("h6",{className:`items products-heading-amt ${L[l].dynamicClassname}`,children:T.status==="RETURNED"?T.serviceAmount?m(T.serviceAmount):"":T.price?m(T.price):""})]}),T.addons&&T.addons.length&&T.addons.map(k=>s.jsx("h6",{className:`items products-heading-addon-kot ${L[l].dynamicClassname}`,children:"- "+Ke(k.serviceName)})),T.instruction&&g.itemInstructionOnBill&&s.jsx("h6",{className:"left-align-entity level2-bold",children:s.jsx("h6",{className:"items products-heading-addon-kot",children:" ("+T.instruction+")"})})]})}),s.jsx("hr",{})]}),s.jsxs("div",{className:`bottom-section ${L[l].dynamicClassname}`,children:[s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{className:"total-qty",dangerouslySetInnerHTML:{__html:u.subtotal}}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+m(N.vatTTL)})]}),i=="25e5f1e4-68ff-43a7-b042-bebb93f42b94"?s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h5",{className:"total-qty",children:"المجموع الفرعي"}),s.jsx("h5",{className:"actual-qty"})]}):"",N&&N.cat&&Object.keys(N.cat).length>0?Object.keys(N.cat).map(T=>{const k=q(T,g.discArr);if(k&&N.cat[T]!==0&&k.serviceName)return s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{className:"total-qty",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:u[`disc_${k.serviceName.toLowerCase()}`]??"DISC-"+k.serviceName.toUpperCase()}}),s.jsx("span",{children:" @"+k.discountValue+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+m(N.cat[T])})]})}):"",g.totalItemDisc&&N&&N.itemTypes&&Object.keys(N.itemTypes).length>0?Object.keys(N.itemTypes).map(T=>{const k=se(T,g.itemTypeDiscObj);if(k&&N.itemTypes[T]!==0&&k.itemType&&k.value)return s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{className:"total-qty",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:u[`disc_${k.itemType.toLowerCase()}`]??"DISC-"+k.itemType.toUpperCase()}}),s.jsx("span",{children:" @"+k.value+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+m(N.itemTypes[T])})]})}):"",g.segMentDisc&&N&&N.segDisc?s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{className:"total-qty",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:u[`segment_disc${g.segMentObj.segmentName.toLowerCase()}`]??g.segMentObj.segmentName.toUpperCase()+"DISC"}}),s.jsx("span",{children:" @"+g.segMentObj.discountValue+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+m(N.segDisc)})]}):"",N&&N.orderDisc?s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{className:"total-qty",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:g.couponCode?u.coupon_disc??"COUPON DISC":u.order_disc??"ORDER DISC"}}),":",s.jsxs("span",{children:[g.couponCode?`(${g.couponCode.toUpperCase()})`:"",m(g.dicsEnterValue)?`@${g.dicsEnterValue}${g.discountType=="RELATIVE"||g.discountType=="COMPLIMENTARY"?"%":"AMT"}`:""]})]})}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+m(N.orderDisc)})]}):"",i=="25e5f1e4-68ff-43a7-b042-bebb93f42b94"&&N&&N.orderDisc?s.jsxs("div",{className:"bottom-section-div",children:[s.jsxs("h5",{className:"total-qty",children:[" ",g.couponCode?"COUPON DISC":"خصم الطلب",g.couponCode?`(${g.couponCode.toUpperCase()})`:""]}),s.jsx("h5",{className:"actual-qty"})]}):"",N.otherCharges&&N.otherCharges.length>0?N.otherCharges.map(T=>s.jsx(s.Fragment,{children:s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{className:"total-qty",dangerouslySetInnerHTML:{__html:u[`charges_${T.name.toLowerCase()}`]??T.name}}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+m(T.amt)})]})})):"",N&&N.aftDisc&&N.vatTTL!==N.aftDisc?s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{className:"total-qty",dangerouslySetInnerHTML:{__html:u.amt_before_tax}}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+m(N.aftDisc)})]}):"",i=="25e5f1e4-68ff-43a7-b042-bebb93f42b94"&&N&&N.aftDisc&&N.vatTTL!==N.aftDisc?s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h5",{className:"total-qty",children:"المبلغ قبل الضريبة"}),s.jsx("h5",{className:"actual-qty"})]}):"",N.otherCharges&&N.otherCharges.length>0?N.otherCharges.map(T=>s.jsx(s.Fragment,{children:T.taxOnAmount&&T.taxOnAmount!=0?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h5",{className:"total-qty",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:u.cgst}}),s.jsx("span",{children:" @"+T.tax/2+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+m(T.taxOnAmount/2)})]}),s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h5",{className:"total-qty",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:u[g.taxLabel.toLowerCase()]}}),s.jsx("span",{children:" @"+T.tax/2+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+m(T.taxOnAmount/2)})]})]}):""})):"",g.taxObj&&g.taxObj[F]&&N?s.jsx(s.Fragment,{children:F==="GST"?g.taxObj[F].map(T=>{let k=new Array;for(const H in T)if(T[H]&&T[H]!=0){let fe=H/2;k.push(s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h5",{className:"total-qty",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:u.cgst}}),s.jsx("span",{children:" @"+fe+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+m(T[H]/2)})]}),s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h5",{className:"total-qty",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:u[g.taxLabel.toLowerCase()]}}),s.jsx("span",{children:" @"+fe+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+m(T[H]/2)})]})]}))}return k}):g.taxObj[F].map(T=>{let k=new Array;for(const H in T)if(T[H]&&T[H]!=0){let fe=H;k.push(s.jsx(s.Fragment,{children:s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h5",{className:"total-qty",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:u.vat}}),s.jsx("span",{children:" @"+fe+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+m(T[H])})]})}))}return k})}):"",N.vatTTL!==(N.total||0)+(N.aftDisc||0)+N.taxOnCharges&&s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{className:"total-qty",dangerouslySetInnerHTML:{__html:u.total}}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+m((N.total||0)+(N.aftDisc||0)+N.taxOnCharges)})]}),i=="25e5f1e4-68ff-43a7-b042-bebb93f42b94"&&N.vatTTL!==(N.total||0)+(N.aftDisc||0)+N.taxOnCharges&&s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h5",{className:"total-qty",children:"المجموع"}),s.jsx("h5",{className:"actual-qty"})]})]})]})})]})},K=(g,u,{labels:C,doMultipleTax:N,type:O})=>{var T,k,H,fe,Ae,Le,Pe,Me,Ue,At,gt;const F=g.discounts;return s.jsxs(s.Fragment,{children:[s.jsx("hr",{}),s.jsxs("section",{className:"products-section",children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h4",{className:`items products-heading-name ${L[l].dynamicClassname}`,dangerouslySetInnerHTML:{__html:C.item_name}}),s.jsx("h4",{className:`items products-heading-qty ${L[l].dynamicClassname}`,dangerouslySetInnerHTML:{__html:C.qty}}),s.jsx("h4",{className:`items products-heading-rate ${L[l].dynamicClassname}`,dangerouslySetInnerHTML:{__html:C.rate}}),s.jsx("h4",{className:`items products-heading-amt ${L[l].dynamicClassname}`,dangerouslySetInnerHTML:{__html:C.amt}})]}),s.jsx("hr",{})]}),s.jsxs("section",{className:"products-section",style:{paddingTop:"12px"},children:[g.itemList.map(V=>{var Et;return s.jsxs("div",{style:V.serviceName.startsWith("+ ")?{}:{paddingTop:"12px"},children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsxs("h6",{className:`items products-heading-name ${L[l].dynamicClassname}`,style:{lineHeight:1.2},children:[V.status==="RETURNED"?"(R) ":"",V.serviceName.toUpperCase()]}),s.jsxs("h6",{className:`items products-heading-qty ${L[l].dynamicClassname}`,children:[V.status==="RETURNED"?"-":"",V.qty]}),s.jsx("h6",{className:`items products-heading-rate ${L[l].dynamicClassname}`,children:V.serviceRate?p(V.serviceRate):""}),s.jsx("h6",{className:`items products-heading-amt ${L[l].dynamicClassname}`,children:V.sub_total?m(V.sub_total):""})]}),V.hsnCode&&u.printHSNCodeOnBill&&s.jsxs("h6",{className:`items products-heading-name ${L[l].dynamicClassname}`,style:{lineHeight:1.2},children:["HSN: ",V.hsnCode]}),(Et=V.addons)!=null&&Et.length?V.addons.map(at=>s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h6",{className:`items products-heading-name ${L[l].dynamicClassname}`,style:{lineHeight:1.2},children:"+ "+Ke(at.serviceName)}),s.jsxs("h6",{className:`items products-heading-qty ${L[l].dynamicClassname}`,children:[V.status==="RETURNED"?"-":"",at.qty*V.qty]}),s.jsx("h6",{className:`items products-heading-rate ${L[l].dynamicClassname}`}),s.jsx("h6",{className:`items products-heading-amt ${L[l].dynamicClassname}`})]}),s.jsx("div",{children:at.hsnCode&&u.printHSNCodeOnBill&&s.jsxs("h6",{className:`items products-heading-name ${L[l].dynamicClassname}`,style:{lineHeight:1.2},children:["HSN: ",at.hsnCode]})})]})):"",V.instruction?s.jsx("h6",{className:"left-align-entity level2-bold",children:s.jsx("h6",{className:"items products-heading-addon-kot",children:" ("+V.instruction+")"})}):""]})}),s.jsx("hr",{})]}),s.jsxs("div",{className:`bottom-section ${L[l].dynamicClassname} ${_e}`,children:[s.jsxs("div",{className:"bottom-section-div inline-display",style:{paddingTop:"12px"},children:[s.jsx("h5",{className:"total-qty",dangerouslySetInnerHTML:{__html:C.subtotal}}),s.jsx("h5",{className:"actual-qty",children:u.curr+" "+m(g.subTotal)})]}),i=="25e5f1e4-68ff-43a7-b042-bebb93f42b94"?s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h5",{className:"total-qty",children:"المجموع الفرعي"}),s.jsx("h5",{className:"actual-qty"})]}):""]}),(T=F.DISCOUNT_ITEMS)!=null&&T.length?F.DISCOUNT_ITEMS.map(V=>s.jsxs("div",{className:`bottom-section-div inline-display ${_e}`,children:[s.jsx("h5",{className:"total-qty",children:s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:C[`disc_${V.discountName.toLowerCase()}`]??"DISC-"+V.discountName.toUpperCase()}}),s.jsx("span",{children:ce(V)})]})}),s.jsx("h5",{className:"actual-qty",children:u.curr+" "+m(V.discountAmt)})]})):"",(k=F.CATEGORY_DISCOUNT)!=null&&k.length?F.CATEGORY_DISCOUNT.map(V=>s.jsxs("div",{className:`bottom-section-div inline-display ${_e}`,children:[s.jsx("h5",{className:"total-qty",children:s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:C[`disc_${V.discountName.toLowerCase()}`]??"DISC-"+V.discountName.toUpperCase()}}),s.jsx("span",{children:" @"+V.discountValue+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:u.curr+" "+m(V.discountAmt)})]})):"",(H=F.ITEM_DISCOUNT)!=null&&H.length?F.ITEM_DISCOUNT.map(V=>s.jsxs("div",{className:`bottom-section-div inline-display ${_e}`,children:[s.jsx("h5",{className:"total-qty",children:s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:C[`disc_${V.discountName.toLowerCase()}`]??"DISC-"+ts(V.discountName).toUpperCase()}}),s.jsx("span",{children:" @"+V.discountValue+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:u.curr+" "+m(V.discountAmt)})]})):"",(Ae=(fe=F.SEGMENT_DISCOUNT)==null?void 0:fe[0])!=null&&Ae.discountAmt?s.jsxs("div",{className:`bottom-section-div inline-display ${_e}`,children:[s.jsx("h5",{className:"total-qty",children:s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:C[`segment_disc${F.SEGMENT_DISCOUNT[0].discountName.toLowerCase()}`]??"DISC-"+F.SEGMENT_DISCOUNT[0].discountName.toUpperCase()}}),":",s.jsx("span",{children:" @"+F.SEGMENT_DISCOUNT[0].discountValue+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:u.curr+" "+m(F.SEGMENT_DISCOUNT[0].discountAmt)})]}):"",(Pe=(Le=F.COUPON_DISCOUNT)==null?void 0:Le[0])!=null&&Pe.discountAmt?s.jsxs("div",{className:`bottom-section-div inline-display ${_e}`,children:[s.jsx("h5",{className:"total-qty",children:s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:"COUPON DISC"}}),":",s.jsx("span",{children:`(${F.COUPON_DISCOUNT[0].discountName.toUpperCase()}) @${F.COUPON_DISCOUNT[0].discountValue}${F.COUPON_DISCOUNT[0].discountType=="RELATIVE"?"%":"AMT"}`})]})}),s.jsx("h5",{className:"actual-qty",children:u.curr+" "+m(F.COUPON_DISCOUNT[0].discountAmt)})]}):"",(Ue=(Me=F.ORDER_DISCOUNT)==null?void 0:Me[0])!=null&&Ue.discountAmt?s.jsxs("div",{className:`bottom-section-div inline-display ${_e}`,children:[s.jsx("h5",{className:"total-qty",children:s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:C.order_disc??"ORDER DISC"}}),":",s.jsx("span",{children:m(F.ORDER_DISCOUNT[0].discountValue)?`@${F.ORDER_DISCOUNT[0].discountValue}${F.ORDER_DISCOUNT[0].discountType=="RELATIVE"||F.ORDER_DISCOUNT[0].discountType=="COMPLIMENTARY"?"%":"AMT"}`:""})]})}),s.jsx("h5",{className:"actual-qty",children:u.curr+" "+m(F.ORDER_DISCOUNT[0].discountAmt)})]}):"",i=="25e5f1e4-68ff-43a7-b042-bebb93f42b94"&&g&&g.orderDisc?s.jsxs("div",{className:`bottom-section-div ${_e}`,children:[s.jsxs("h5",{className:"total-qty",children:[" ",u.couponCode?"COUPON DISC":"خصم الطلب",u.couponCode?`(${u.couponCode.toUpperCase()})`:""]}),s.jsx("h5",{className:"actual-qty"})]}):"",(At=g.charges)!=null&&At.length?g.charges.map(V=>s.jsx(s.Fragment,{children:s.jsxs("div",{className:`bottom-section-div inline-display ${_e}`,children:[s.jsx("h5",{className:"total-qty",children:s.jsx("span",{dangerouslySetInnerHTML:{__html:C[`charges_${V.name.toLowerCase()}`]??V.name}})}),s.jsx("h5",{className:"actual-qty",children:u.curr+" "+m(V.amt)})]})})):"",g.subTotal!==g.afterCharges&&g.afterCharges!==g.total?s.jsxs("div",{className:`bottom-section-div inline-display ${_e}`,children:[s.jsx("h5",{className:"total-qty",dangerouslySetInnerHTML:{__html:C.amt_before_tax}}),s.jsx("h5",{className:"actual-qty",children:u.curr+" "+m(g.afterCharges)})]}):"",i=="25e5f1e4-68ff-43a7-b042-bebb93f42b94"&&g.subTotal!==g.afterCharges?s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h5",{className:"total-qty",children:"المبلغ قبل الضريبة"}),s.jsx("h5",{className:"actual-qty"})]}):"",(gt=g.taxation)!=null&>.length?g.taxation.map(V=>{if(V.taxAmt)return V.taxType==="GST"?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:`bottom-section-div ${_e}`,children:[s.jsx("h5",{className:"total-qty",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:C.cgst}}),s.jsx("span",{children:"@"+V.tax/2+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:u.curr+" "+m(V.taxAmt/2)})]}),s.jsxs("div",{className:`bottom-section-div ${_e}`,children:[s.jsx("h5",{className:"total-qty",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:C[u.taxLabel.toLowerCase()]}}),s.jsx("span",{children:"@"+V.tax/2+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:u.curr+" "+m(V.taxAmt/2)})]})]}):s.jsxs("div",{className:`bottom-section-div ${_e}`,children:[s.jsx("h5",{className:"total-qty",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:C.vat}}),s.jsx("span",{children:"@"+V.tax+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:u.curr+" "+m(V.taxAmt)})]})}):"",s.jsxs("div",{className:`bottom-section-div inline-display ${_e}`,children:[s.jsx("h5",{className:"total-qty",dangerouslySetInnerHTML:{__html:C.total}}),s.jsx("h5",{className:"actual-qty",children:u.curr+" "+m(g.total)})]}),N?s.jsx(s.Fragment,{children:O==="GST"?s.jsxs(s.Fragment,{children:[s.jsx("h4",{className:"single-entity-and-center",style:{marginTop:"10px"},children:"- - - - -"}),s.jsx("div",{className:"space-2rem"})]}):""}):""]})},B=(g,u)=>{var F,T;let C=!1;const N=g.distributedData;return g.distributedData&&(C=Object.keys(g.distributedData).length>1),s.jsxs(s.Fragment,{children:[((F=N.GST)==null?void 0:F.itemList)&&K(N.GST,g,{labels:u,doMultipleTax:C,type:"GST"}),((T=N.VAT)==null?void 0:T.itemList)&&K(N.VAT,g,{labels:u,doMultipleTax:C,type:"VAT"})]})},me=g=>{const u=g.services,C=Object.keys(g.services),N=C.length;return s.jsxs(s.Fragment,{children:[s.jsx("hr",{}),s.jsxs("section",{className:`products-section ${_e}`,children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h5",{className:"items products-heading-name-kot",children:L[l].itemName}),s.jsx("h5",{className:"items products-heading-qty-kot",children:"QTY"})]}),s.jsx("hr",{})]}),s.jsxs("section",{className:"products-section",children:[N&&C.map((F,T)=>s.jsxs(s.Fragment,{children:[s.jsx("h4",{className:"left-align-entity level3-bold",children:s.jsxs("u",{children:[F.toUpperCase(),":"]})}),u[F].map(k=>{var H;return s.jsxs("div",{children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h4",{className:`items products-heading-name-kot ${L[l].dynamicClassname}`,children:Ke(k.serviceName)}),s.jsx("h4",{className:`items products-heading-qty-kot ${L[l].dynamicClassname}`,children:k.qty})]}),((H=k.addons)==null?void 0:H.length)&&k.addons.map(fe=>{var Ae;return s.jsx("h5",{className:"items products-heading-addon-kot",children:"- "+((Ae=fe.serviceName)==null?void 0:Ae.toUpperCase())})}),k.instruction&&s.jsx("h5",{className:"left-align-entity",children:s.jsx("h5",{className:"items products-heading-addon-kot",children:" ("+k.instruction+")"})})]})}),N!==T+1&&s.jsx("br",{})]})),s.jsx("hr",{})]})]})},$=g=>{const u=g.slice(0,-4),C=g.slice(-4);return{firstDigits:u,last4Dgits:C}},Q=(g,u,C,N={})=>{const O=Object.keys(u??{});let F=[],T,k="flex-two-items";if(N.action==="addCharges"&&(k="display-percentage"),g&&O.length){F.push(s.jsxs(s.Fragment,{children:[s.jsx("h4",{className:"single-entity-and-center",children:`${C.toUpperCase()} BREAK-UP`}),s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsxs("span",{children:["Total ",C,":"]}),s.jsx("span",{children:oe(g,o)})]})]}));for(let H=0;H<O.length;H++)T=O[H],u[T]&&F.push(s.jsxs("h5",{className:`left-align-entity level3-bold ${k} second-span-right`,children:[s.jsx("span",{children:` -- ${T.replaceAll("_"," ")}:`}),s.jsx("span",{children:oe(u[T],o)}),N.action==="addCharges"?s.jsx("span",{children:m(gs(g,u[T]))+"%"}):""]}));F.push(s.jsx("hr",{}))}return F},st=g=>{const u=Object.keys(g.Category),C=Object.keys(g.Addon);let N=new Array;return N.push(s.jsxs(s.Fragment,{children:[s.jsx("h3",{className:"left-align-entity level3-bold",children:"Product Category"}),s.jsx("hr",{className:"dashed"})]})),u.forEach((O,F)=>{const T=g.Category[O];let k=[];N.push(s.jsxs(s.Fragment,{children:[s.jsxs("h4",{className:"left-align-entity level3-bold",children:[" - "," ",ts(O)]}),s.jsxs("section",{className:"products-section",children:[T.forEach(H=>{k.push(s.jsx(s.Fragment,{children:s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h6",{className:`items products-heading-name-kot ${L["3INCH"].dynamicClassname}`,children:H.serviceName}),s.jsx("h6",{className:`items products-heading-qty-kot ${L["3INCH"].dynamicClassname}`,children:parseFloat(H.qty.toFixed(2))})]})}))}),k,F!=u.length-1&&s.jsx("hr",{})]})]}))}),C.length>0&&(N.push(s.jsxs(s.Fragment,{children:[s.jsx("hr",{}),s.jsx("h3",{className:"left-align-entity level3-bold",children:"Addon Category"}),s.jsx("hr",{className:"dashed"})]})),C.forEach((O,F)=>{const T=g.Addon[O];let k=[];N.push(s.jsxs(s.Fragment,{children:[s.jsxs("h4",{className:"left-align-entity level3-bold",children:[" - "," ",ts(O)]}),s.jsxs("section",{className:"products-section",children:[T.forEach(H=>{k.push(s.jsx(s.Fragment,{children:s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h6",{className:`items products-heading-name-kot ${L["3INCH"].dynamicClassname}`,children:H.serviceName}),s.jsx("h6",{className:`items products-heading-qty-kot ${L["3INCH"].dynamicClassname}`,children:parseFloat(H.qty.toFixed(2))})]})}))}),k,F!=C.length-1&&s.jsx("hr",{className:"dashed"})]})]}))})),N},nt=g=>{var C;const u={company_mobile:"Mob",company_Email:"Email",company_GST:"GST",company_VAT:"VAT",company_FSSAI:"FSSAI",name:"Name",mobile:"Mobile",address:"Address",email:"Email",token_no:"Token No",order_no:"Order No",date:"Date",delivery_date:"Delivery Date",item_name:"Item Name",qty:"Qty",rate:"Rate",amt:"Amt",subtotal:"SUB TOTAL",order_disc:"ORDER DISC",coupon_disc:"COUPON DISC",complementary_disc:"COMPLIMENTARY BILL",amt_before_tax:"AMT BEFORE TAX",total:"TOTAL",grand_total:"GRAND TOTAL",reward_point_balance:"REWARD POINT BALANCE",balance_amt:"BALANCE AMOUNT",rewards_redeemed:"REWARDS REDEEMED",vat:"VAT",sgst:"SGST",cgst:"CGST",utgst:"UTGST",igst:"IGST",previous_outstanding:"PREVIOUS OUTSTANDING",total_payable:"TOTAL PAYABLE",delivery_code:"Delivery Code",online_order_id:"Online Order ID",area_name:"Area Name",table_name:"Table Name",captain_name:"Captain Name"};if((C=g==null?void 0:g.customBillLabels)!=null&&C.length){let N;for(let O=0;O<g.customBillLabels.length;O++)N=g.customBillLabels[O],u[N.defaultName]=N.displayName}return u},Ot=(g,u,C,N)=>{var H,fe,Ae,Le,Pe,Me,Ue,At,gt,V,Et,at,Ns,js,ln,vs,_s,on,cn,dn,hn,un,mn,fn,Kt,bs,xt,Qt,Zt,Ss,pn,Ts,yn,ws,Is,gn,xn,Cs,Os,Nn;const O=nt(r.customLabelsMap),F=ms(xd(r.paymentModes),"internalName"),T=te=>{var b;return(b=F[te])!=null&&b.displayName?F[te].displayName.toUpperCase():te};if(g==="BILL"){let te;if(l==="A4"||l==="A5"){let b={...u},X=0,y=b.distributedData;const _=y.discounts;te=s.jsx("div",{className:`invoiceContainer main-div ${L[l].dynamicClassname}`,children:s.jsxs("div",{id:"page-wrap",children:[s.jsx("table",{width:"100%",className:"custom-table custom-table-bordered",children:s.jsxs("tbody",{children:[s.jsxs("tr",{children:[s.jsxs("td",{colSpan:9,children:[s.jsx("tr",{className:"subtotalTr",children:s.jsx("td",{colSpan:12,style:{borderBottom:"1px solid black",width:"100%"},children:s.jsx("h5",{children:s.jsxs("strong",{children:[b.companyInfo.companyName,":"]})})})}),s.jsxs("tr",{className:"subtotalTr",children:[s.jsxs("td",{width:"50%",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:`${O.order_no}:`},className:"font-weight-bold"}),s.jsx("span",{children:b.orderId})]}),s.jsxs("td",{width:"50%",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:`${O.date}:`},className:"font-weight-bold"}),s.jsx("span",{children:b.orderInfo.orderDate})]})]})]}),s.jsx("td",{colSpan:3,className:"text-right",children:s.jsx("div",{className:"d-flex justify-content-center",children:C&&s.jsx("img",{src:C,width:90})})})]}),s.jsx("tr",{children:s.jsx("td",{colSpan:12,className:"text-center border-right",style:{padding:"0px 1.4rem"},children:s.jsx("h6",{children:s.jsx("strong",{children:"Tax Invoice"})})})}),s.jsxs("tr",{children:[s.jsx("td",{colSpan:6,className:"v-align-baseline col-6",children:s.jsxs("div",{className:"divPadding",children:[(b.customerInfo.custName||((H=b.customFields)==null?void 0:H.length))&&s.jsx("tr",{children:s.jsx("td",{colSpan:"2",className:"text-center border-right",children:s.jsx("strong",{children:"Bill To"})})}),b.customerInfo.custName&&b.customerInfo.custName!==""&&s.jsx("tr",{children:s.jsx("td",{width:"10%",children:b.customerInfo.custName})}),b.customerInfo.custContact&&b.customerInfo.custContact!==""&&s.jsx("tr",{children:s.jsx("td",{width:"10%",children:b.customerInfo.custContact})}),b.customerInfo.custAddress&&b.customerInfo.custAddress!==""&&s.jsx("tr",{children:s.jsx("td",{width:"10%",children:b.customerInfo.custAddress})}),b.deliveryTimestamp&&s.jsx("tr",{children:s.jsx("td",{width:"10%",children:b.deliveryTimestamp})}),(fe=b.customFields)!=null&&fe.length?b.customFields.map(v=>s.jsx("tr",{children:s.jsxs("td",{width:"10%",children:[v.customName,": ",v.customValue]})})):""]})}),s.jsx("td",{colSpan:6,className:"v-align-baseline",children:s.jsxs("div",{className:"divPadding",children:[s.jsx("tr",{children:s.jsx("td",{colSpan:"2",className:"text-center border-right",children:s.jsx("strong",{children:"Bill From"})})}),s.jsx("tr",{children:s.jsx("td",{width:"10%",children:b.companyInfo.companyName})}),b.companyInfo.companyAddress&&b.companyInfo.companyAddress!==""&&s.jsx("tr",{children:s.jsx("td",{width:"10%",children:b.companyInfo.companyAddress})}),b.companyInfo.companyEmail&&b.companyInfo.companyEmail!==""&&s.jsx("tr",{children:s.jsx("td",{width:"10%",children:b.companyInfo.companyEmail})}),b.companyInfo.companyContact&&b.companyInfo.companyContact!==""&&s.jsx("tr",{children:s.jsx("td",{width:"10%",children:b.companyInfo.companyContact})}),b.fssai&&b.fssai!==""&&s.jsx("tr",{children:s.jsxs("td",{width:"10%",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:`${O.company_FSSAI}:`}}),s.jsx("span",{children:b.fssai})]})}),b.gst&&b.gst!==""&&s.jsx("tr",{children:s.jsxs("td",{width:"10%",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:`${O.company_GST}:`}}),s.jsx("span",{children:b.gst})]})}),b.vatNo&&b.vatNo!==""&&s.jsx("tr",{children:s.jsxs("td",{width:"10%",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:`${O.company_VAT}:`}}),s.jsx("span",{children:b.vatNo})]})})]})})]}),s.jsx("tr",{children:s.jsx("td",{colSpan:12,children:s.jsxs("table",{width:"100%",className:"custom-table productTable ",children:[s.jsx("thead",{children:s.jsxs("tr",{className:"border-right",style:{lineHeight:"10px"},children:[s.jsx("th",{className:"text-align-left",children:"Sr No"}),s.jsx("th",{className:"text-align-left",style:{width:"40%"},children:"Item Name"}),s.jsx("th",{className:"text-align-left",children:"Quantity"}),s.jsx("th",{className:"text-align-right",children:"Price/Unit"}),s.jsx("th",{className:"text-align-right",children:"Amount"})]})}),s.jsxs("tbody",{children:[b.itemList.map(v=>{var ue;let z="",le=[];return X++,le.push(s.jsxs(s.Fragment,{children:[s.jsxs("tr",{style:{lineHeight:"10px"},className:z,children:[s.jsx("td",{className:"text-align-left",children:v.serviceRate?X:""}),s.jsx("td",{style:{width:"40%"},className:"text-align-left",children:v.serviceName.toUpperCase()}),s.jsx("td",{className:"text-align-left",children:v.qty}),s.jsx("td",{className:"text-align-right",children:v.serviceRate?U(v.serviceRate,o):""}),s.jsx("td",{className:"text-align-right",children:v.sub_total?U(v.sub_total,o):""})]}),v.instruction&&s.jsxs("tr",{children:[s.jsx("td",{}),s.jsx("td",{style:{width:"40%"},children:"("+v.instruction+")"})]})]})),(ue=v.addons)!=null&&ue.length&&v.addons.map(ne=>{le.push(s.jsxs(s.Fragment,{children:[s.jsxs("tr",{style:{lineHeight:"10px"},className:"fs-8",children:[s.jsx("td",{}),s.jsxs("td",{style:{width:"40%"},children:["+ ",ne.serviceName.toUpperCase()]}),s.jsx("td",{children:ne.qty*v.qty})]}),ne.instruction&&s.jsxs("tr",{children:[s.jsx("td",{}),s.jsx("td",{style:{width:"40%"},children:"("+ne.instruction+")"})]})]}))}),le}),s.jsx("tr",{style:{lineHeight:"10px",fontSize:"14px"},children:s.jsx("td",{colSpan:5,children:s.jsx("strong",{className:"font-weight-bold",children:`Total ${X} Items and ${ve(y.qty)} Quantity`})})})]})]})})}),s.jsxs("tr",{className:"avoid-page-break",children:[s.jsx("td",{colSpan:6,style:{verticalAlign:"top"},children:s.jsx("div",{children:s.jsxs("div",{width:"100%",children:[s.jsx("tr",{children:s.jsxs("td",{colSpan:"2",children:[s.jsx("strong",{className:"font-weight-bold",children:"Amount in words"}),s.jsx("br",{}),fd(Xn(b.finalAmount,o).toFixed(Wt[o].minimumFractionDigits??2))]})}),s.jsx("hr",{}),b.upiId&&u.companyInfo.companyName&&s.jsxs(s.Fragment,{children:[s.jsx("tr",{children:s.jsx("td",{width:"50%",className:"font-weight-bold",children:"Scan To Pay"})}),s.jsx("tr",{children:s.jsx("td",{width:"50%",children:s.jsx("div",{className:"image-bill",children:P(u.upiId,u.orderId,u.companyInfo.companyName,u.paidAmt,{size:100})})})})]}),b.footerMessage?s.jsx("tr",{children:s.jsx("td",{colSpan:"2",children:s.jsx("div",{className:"single-entity-and-center",dangerouslySetInnerHTML:{__html:b.footerMessage}})})}):""]})})}),s.jsx("td",{colSpan:6,style:{verticalAlign:"top"},children:s.jsx(s.Fragment,{children:s.jsxs(s.Fragment,{children:[s.jsxs("tr",{className:"subtotalTr",children:[s.jsx("td",{width:"50%",children:s.jsx("span",{children:s.jsx("strong",{dangerouslySetInnerHTML:{__html:O.subtotal}})})}),s.jsx("td",{width:"50%",className:"text-align-right",children:U(y.subTotal,o)})]}),(Ae=_==null?void 0:_.DISCOUNT_ITEMS)!=null&&Ae.length?_.DISCOUNT_ITEMS.map(v=>s.jsxs("tr",{className:"subtotalTr",children:[s.jsxs("td",{width:"50%",children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:O[`disc_${v.discountName.toLowerCase()}`]??"DISC-"+v.discountName.toUpperCase()}}),s.jsx("span",{children:ce(v)})]}),s.jsx("td",{className:"text-align-right",width:"50%",children:U(v.discountAmt,o)})]})):"",(Le=_==null?void 0:_.CATEGORY_DISCOUNT)!=null&&Le.length?_.CATEGORY_DISCOUNT.map(v=>s.jsxs("tr",{className:"subtotalTr",children:[s.jsxs("td",{width:"50%",children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:O[`disc_${v.discountName.toLowerCase()}`]??"DISC-"+v.discountName.toUpperCase()}}),s.jsx("span",{children:" @"+v.discountValue+"%"})]}),s.jsx("td",{className:"text-align-right",width:"50%",children:U(v.discountAmt,o)})]})):"",(Pe=_==null?void 0:_.ITEM_DISCOUNT)!=null&&Pe.length?_.ITEM_DISCOUNT.map(v=>s.jsxs("tr",{className:"subtotalTr",children:[s.jsxs("td",{width:"50%",children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:O[`disc_${v.discountName.toLowerCase()}`]??"DISC-"+v.discountName.toUpperCase()}}),s.jsx("span",{children:" @"+v.discountValue+"%"})]}),s.jsx("td",{className:"text-align-right",width:"50%",children:U(v.discountAmt,o)})]})):"",(Ue=(Me=_==null?void 0:_.SEGMENT_DISCOUNT)==null?void 0:Me[0])!=null&&Ue.discountAmt?s.jsxs("tr",{className:"subtotalTr",children:[s.jsxs("td",{width:"50%",children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:O[`segment_disc${_.SEGMENT_DISCOUNT[0].discountName.toLowerCase()}`]??"DISC-"+_.SEGMENT_DISCOUNT[0].discountName.toUpperCase()}}),s.jsx("span",{children:" @"+_.SEGMENT_DISCOUNT[0].discountValue+"%"})]}),s.jsx("td",{className:"text-align-right",width:"50%",children:U(_.SEGMENT_DISCOUNT[0].discountAmt,o)})]}):"",(gt=(At=_==null?void 0:_.COUPON_DISCOUNT)==null?void 0:At[0])!=null&>.discountAmt?s.jsxs("tr",{className:"subtotalTr",children:[s.jsxs("td",{width:"50%",children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:"COUPON DISC"}}),s.jsx("span",{children:`(${_.COUPON_DISCOUNT[0].discountName.toUpperCase()}) @${_.COUPON_DISCOUNT[0].discountValue}${_.COUPON_DISCOUNT[0].discountType=="RELATIVE"?"%":"AMT"}`})]}),s.jsx("td",{className:"text-align-right",width:"50%",children:U(_.COUPON_DISCOUNT[0].discountAmt,o)})]}):"",(Et=(V=_==null?void 0:_.ORDER_DISCOUNT)==null?void 0:V[0])!=null&&Et.discountAmt?s.jsxs("tr",{className:"subtotalTr",children:[s.jsxs("td",{width:"50%",children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:O.order_disc??"ORDER DISC"}}),s.jsx("span",{children:m(_.ORDER_DISCOUNT[0].discountValue)?`@${_.ORDER_DISCOUNT[0].discountValue}${_.ORDER_DISCOUNT[0].discountType=="RELATIVE"||_.ORDER_DISCOUNT[0].discountType=="COMPLIMENTARY"?"%":"AMT"}`:""})]}),s.jsx("td",{className:"text-align-right",width:"50%",children:U(_.ORDER_DISCOUNT[0].discountAmt,o)})]}):"",(at=y.charges)!=null&&at.length?y.charges.map(v=>s.jsxs("tr",{className:"subtotalTr",children:[s.jsx("td",{width:"50%",children:s.jsx("span",{dangerouslySetInnerHTML:{__html:O[`charges_${v.name.toLowerCase()}`]??v.name}})}),s.jsx("td",{className:"text-align-right",width:"50%",children:U(v.amt,o)})]})):"",y.subTotal!==y.afterCharges?s.jsxs("tr",{className:"subtotalTr",children:[s.jsx("td",{width:"50%",children:s.jsx("span",{dangerouslySetInnerHTML:{__html:O.amt_before_tax}})}),s.jsx("td",{className:"text-align-right",width:"50%",children:U(y.afterCharges,o)})]}):"",(Ns=y.taxation)!=null&&Ns.length?y.taxation.map(v=>v.taxType==="GST"?s.jsxs(s.Fragment,{children:[s.jsxs("tr",{className:"subtotalTr",children:[s.jsxs("td",{width:"50%",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:O.cgst}}),s.jsx("span",{children:" @"+v.tax/2+"%"})]}),s.jsx("td",{className:"text-align-right",width:"50%",children:U(v.taxAmt/2,o)})]}),s.jsxs("tr",{className:"subtotalTr",children:[s.jsxs("td",{width:"50%",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:O.sgst}}),s.jsx("span",{children:" @"+v.tax/2+"%"})]}),s.jsx("td",{className:"text-align-right",width:"50%",children:U(v.taxAmt/2,o)})]})]}):s.jsxs("tr",{className:"subtotalTr",children:[s.jsxs("td",{width:"50%",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:O.vat}}),s.jsx("span",{children:" @"+v.tax+"%"})]}),s.jsx("td",{className:"text-align-right",width:"50%",children:U(v.taxAmt,o)})]})):"",s.jsxs("tr",{className:"font-weight-bold subtotalTr",children:[s.jsx("td",{width:"50%",children:s.jsx("strong",{dangerouslySetInnerHTML:{__html:O.grand_total}})}),s.jsx("td",{className:"text-align-right",width:"50%",children:U(b.finalAmount,o)})]}),(js=u==null?void 0:u.custoutStandingData)!=null&&js.balanceAmt?s.jsxs(s.Fragment,{children:[s.jsxs("tr",{className:"font-weight-bold subtotalTr",children:[s.jsx("td",{width:"50%",children:s.jsx("span",{dangerouslySetInnerHTML:{__html:O.previous_outstanding}})}),s.jsx("td",{className:"text-align-right",width:"50%",children:U((ln=b==null?void 0:b.custoutStandingData)==null?void 0:ln.balanceAmt,o)})]}),s.jsxs("tr",{className:"font-weight-bold subtotalTr",children:[s.jsx("td",{width:"50%",children:s.jsx("strong",{dangerouslySetInnerHTML:{__html:O.total_payable}})}),s.jsx("td",{className:"text-align-right",width:"50%",children:U(b.grandTotal+((vs=b==null?void 0:b.custoutStandingData)==null?void 0:vs.balanceAmt),o)})]})]}):"",b.rewardAmt?s.jsxs("tr",{className:"subtotalTr",children:[s.jsx("td",{width:"50%",children:s.jsx("span",{dangerouslySetInnerHTML:{__html:O.rewards_redeemed}})}),s.jsx("td",{className:"text-align-right",width:"50%",children:U(b.rewardAmt,o)})]}):"",(_s=u.paymentMethods)!=null&&_s.length?u.paymentMethods.map(v=>{var z;if(v.paidAmt)return s.jsxs("tr",{className:"subtotalTr",children:[s.jsxs("td",{width:"50%",children:["-"," ",s.jsx("span",{dangerouslySetInnerHTML:{__html:O[`${(z=v.paymentMode)==null?void 0:z.toLowerCase()}`]??T(v.paymentMode)??"CASH"}}),s.jsx("span",{children:v.isRefund?"(Refund)":""})]}),v.isRefund?s.jsx("td",{className:"text-align-right",width:"50%",children:"("+U(v.paidAmt,o)+")"}):s.jsx("td",{className:"text-align-right",width:"50%",children:U(v.paidAmt,o)})]})}):"",b.balanceAmt&&u.balanceAmt!=0?s.jsxs("tr",{className:"subtotalTr",children:[s.jsx("td",{width:"50%",children:s.jsx("span",{dangerouslySetInnerHTML:{__html:O.balance_amt}})}),s.jsx("td",{className:"text-align-right",width:"50%",children:U(u.balanceAmt,o)})]}):"",u.balPoint&&!Number.isNaN(u.balPoint)?s.jsxs("tr",{className:"subtotalTr",children:[s.jsx("td",{width:"50%",children:s.jsx("span",{dangerouslySetInnerHTML:{__html:O.reward_point_balance}})}),s.jsx("td",{className:"text-align-right",width:"50%",children:u.balPoint})]}):"",s.jsx("tr",{className:"subtotalTr",children:s.jsxs("td",{className:"text-center",width:"100%",children:[s.jsx("hr",{}),s.jsx("strong",{children:"Authorised Signatory"})]})}),s.jsx("tr",{className:"subtotalTr",children:s.jsx("td",{colSpan:2,width:"50%",children:s.jsx("div",{className:"p-4"})})})]})})})]})]})}),s.jsx("p",{className:"single-entity-and-center f-12 mt-2 avoid-page-break",style:{marginTop:"10px"},children:`Printed By :${b.printby} Printed On: ${b.printTime}`}),b.disabledPoweredBy?"":s.jsx("p",{className:"single-entity-and-center f-12 mt-2 avoid-page-break",children:"Powered By: www.recaho.com"})]})})}else te=s.jsx("div",{className:"main-div bill",style:{width:L[l].paperSize},children:s.jsxs("div",{style:{width:"100%",textAlign:"left",marginLeft:"auto"},children:[u.duplicateBill?s.jsx("h4",{className:"single-entity-and-center",children:"DUPLICATE BILL"}):"",s.jsx("br",{}),C&&s.jsx("div",{className:"image-bill",children:s.jsx("img",{src:C,className:"single-entity-and-center",style:{width:L[l].logoWidth}})}),s.jsxs("div",{className:`details-section ${L[l].dynamicClassname}`,children:[!C&&u.companyInfo.companyName&&u.companyInfo.companyName!=""&&s.jsx("h1",{className:"single-entity-and-center",children:u.companyInfo.companyName}),u.companyInfo.companyAddress&&u.companyInfo.companyAddress!==""&&s.jsx("h3",{className:"single-entity-and-center",dangerouslySetInnerHTML:{__html:u.companyInfo.companyAddress}}),u.companyInfo.companyContact&&u.companyInfo.companyContact!==""&&s.jsx("h3",{className:"single-entity-and-center",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:O.company_mobile}}),": ",s.jsx("span",{children:u.companyInfo.companyContact})]})}),u.companyInfo.companyEmail&&u.companyInfo.companyEmail!==""&&s.jsx("h3",{className:"single-entity-and-center",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:O.company_Email}}),": ",s.jsx("span",{children:u.companyInfo.companyEmail})]})}),u.fssai&&u.fssai!==""&&s.jsx("h3",{className:"single-entity-and-center",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:O.company_FSSAI}}),": ",s.jsx("span",{children:u.fssai})]})}),u.gst&&u.gst!==""&&s.jsx("h3",{className:"single-entity-and-center",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:O.company_GST}}),": ",s.jsx("span",{children:u.gst})]})}),u.vatNo&&u.vatNo!==""&&s.jsx("h3",{className:"single-entity-and-center",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:O.company_VAT}}),": ",s.jsx("span",{children:u.vatNo})]})}),s.jsx("hr",{}),u.orderFrom&&s.jsx("h2",{className:"single-entity-and-center level2-bold",children:u.orderFrom}),u.area&&s.jsxs("h3",{className:"single-entity-and-center level2-bold",children:[u.area," : ",u.tableName?u.tableName:u.tableNo]}),u.tokenId&&s.jsx("h2",{className:"single-entity-and-center level2-bold",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:O.token_no}})," ",s.jsx("span",{children:u.tokenId})]})}),u.parentOrderRef&&s.jsx("h4",{className:"single-entity-and-center",children:"RETURN/EXCHANGE"})]}),s.jsx("hr",{}),s.jsxs("div",{className:`details-section ${L[l].dynamicClassname} ${_e}`,children:[u.customerInfo.custName&&u.customerInfo.custName!==""&&s.jsx("h5",{className:"left-align-entity",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:O.name}}),": ",s.jsx("span",{children:u.customerInfo.custName})]})}),u.customerInfo.custContact&&u.customerInfo.custContact!==""&&s.jsx("h5",{className:"left-align-entity",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:O.mobile}}),": ",s.jsx("span",{children:u.customerInfo.custContact})]})}),u.customerInfo.custAddress&&u.customerInfo.custAddress!==""&&s.jsx("h5",{className:"left-align-entity",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:O.address}}),": ",s.jsx("span",{children:u.customerInfo.custAddress})]})}),_t(u.appliedDiscounts??[],"COMPLIMENTARY","discountType").discountType&&s.jsx("h5",{className:"left-align-entity level2-bold",dangerouslySetInnerHTML:{__html:O.complementary_disc}}),u.orderId&&s.jsx("h5",{className:"left-align-entity",style:{flexShrink:0},children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:O.order_no}}),": ",s.jsx("span",{children:u.orderId})]})}),u.orderInfo.orderDate&&s.jsx("h5",{className:"left-align-entity",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:O.date}}),":",s.jsx("span",{children:u.orderInfo.orderDate})]})}),u.deliveryTimestamp&&s.jsx("h5",{className:"left-align-entity",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:O.delivery_date}}),":",s.jsx("span",{children:u.deliveryTimestamp})]})}),u.captainName&&s.jsx("h5",{className:"left-align-entity",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:O.captain_name}}),":",s.jsx("span",{children:u.captainName})]})})]}),(on=u.customFields)!=null&&on.length?s.jsxs("div",{className:`details-section ${L[l].dynamicClassname}`,children:[s.jsx("hr",{}),u.customFields.map(b=>s.jsx("h4",{className:"left-align-entity",children:b.customName+": "+b.customValue}))]}):"",u.newFormat?B(u,O):G(u,O),s.jsx("br",{}),s.jsxs("div",{className:`bottom-section ${L[l].dynamicClassname}`,children:[s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h6",{className:`total-qty ${(cn=u.custoutStandingData)!=null&&cn.balanceAmt||u.rewardAmt&&u.paymentMethods&&u.paymentMethods.length>0?"level3-bold":"level2-bold"}`,style:{fontSize:l==="2INCH"||l==="1.8INCH"?"1.50rem":"1.75rem"},dangerouslySetInnerHTML:{__html:O.grand_total}}),s.jsx("h6",{className:`actual-qty ${(dn=u.custoutStandingData)!=null&&dn.balanceAmt||u.rewardAmt&&u.paymentMethods&&u.paymentMethods.length>0?"level3-bold":"level2-bold"}`,style:{fontSize:l==="2INCH"||l==="1.8INCH"?"1.40rem":"1.75rem"},children:u.curr+" "+m(u.finalAmount)})]}),(hn=u.custoutStandingData)!=null&&hn.balanceAmt?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{children:s.jsx("span",{dangerouslySetInnerHTML:{__html:O.previous_outstanding}})}),s.jsx("h5",{children:u.curr+" "+m(u.custoutStandingData.balanceAmt)})]}),!u.rewardAmt&&!u.paymentMethods?s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h6",{className:"total-qty level2-bold",style:{fontSize:l==="2INCH"||l==="1.8INCH"?"1.50rem":"1.75rem"},dangerouslySetInnerHTML:{__html:O.total_payable}}),s.jsx("h6",{className:"actual-qty level2-bold",style:{fontSize:l==="2INCH"||l==="1.8INCH"?"1.40rem":"1.75rem"},children:u.curr+" "+m(u.finalAmount+u.custoutStandingData.balanceAmt)})]}):""]}):"",i=="25e5f1e4-68ff-43a7-b042-bebb93f42b94"?s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h6",{className:"total-qty level2-bold",style:{fontSize:l==="2INCH"||l==="1.8INCH"?"1.50rem":"1.75rem"},children:"المجموع الإجمالي"}),s.jsx("h6",{className:"actual-qty level2-bold",style:{fontSize:l==="2INCH"||l==="1.8INCH"?"1.40rem":"1.75rem"}})]}):"",u.rewardAmt?s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsxs("h5",{children:["- ",s.jsx("span",{dangerouslySetInnerHTML:{__html:O.rewards_redeemed}}),s.jsx("span",{children:"("+u.usedPoints+" Points)"})]}),s.jsx("h5",{children:u.curr+" "+u.rewardAmt})]}):"",u.paymentMethods&&u.paymentMethods.length?u.paymentMethods.map(b=>{var X;if(b.paidAmt)return s.jsxs("div",{className:`bottom-section-div inline-display ${_e}`,children:[s.jsxs("h5",{children:["-",s.jsx("span",{dangerouslySetInnerHTML:{__html:O[`${(X=b.paymentMode)==null?void 0:X.toLowerCase()}`]??T(b.paymentMode)??"CASH"}}),s.jsx("span",{children:b.isRefund?"(Refund)":""})]}),s.jsx("h5",{children:b.isRefund?s.jsx(s.Fragment,{children:u.curr+" ("+m(b.paidAmt)+")"}):s.jsx(s.Fragment,{children:u.curr+" "+m(b.paidAmt)})})]})}):"",u.rewardAmt&&!u.paymentMethods?s.jsx(s.Fragment,{children:s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h6",{className:"total-qty level2-bold",style:{fontSize:l==="2INCH"||l==="1.8INCH"?"1.50rem":"1.75rem"},dangerouslySetInnerHTML:{__html:O.total_payable}}),s.jsx("h6",{className:"actual-qty level2-bold",style:{fontSize:l==="2INCH"||l==="1.8INCH"?"1.40rem":"1.75rem"},children:u.curr+" "+m(u.finalAmount+(((un=u==null?void 0:u.custoutStandingData)==null?void 0:un.balanceAmt)||0)-u.rewardAmt)})]})}):"",Ch((mn=u.convertedCurrValue)==null?void 0:mn.value)?s.jsxs("div",{className:`bottom-section-div inline-display ${_e}`,children:[s.jsx("h5",{className:"total-qty"}),s.jsx("h5",{className:"actual-qty",children:`(${U(u.convertedCurrValue.value,u.convertedCurrValue.curr)})`})]}):"",u.balanceAmt&&u.balanceAmt!=0?s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{dangerouslySetInnerHTML:{__html:O.balance_amt}}),s.jsx("h5",{children:u.curr+" "+m(u.balanceAmt)})]}):"",s.jsx("hr",{})]}),u.earnPoints&&u.paymentMethods?s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h6",{className:"total-qty line-gaps",children:"EARN POINTS"}),s.jsx("h6",{className:"actual-qty",children:u.earnPoints})]}):"",(u.balPoint||u.earnPoints)&&!Number.isNaN(u.balPoint||u.earnPoints)?s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h6",{className:"total-qty line-gaps",dangerouslySetInnerHTML:{__html:O.reward_point_balance}}),s.jsx("h6",{className:"actual-qty",children:u.balPoint+u.earnPoints||0})]}):"",u.upiId&&u.companyInfo.companyName&&s.jsxs("div",{className:"single-entity-and-center",children:[s.jsx("h6",{style:{marginTop:"6px"},children:"Scan this QRCode to Pay"}),P(u.upiId,u.orderId,u.companyInfo.companyName,u.paidAmount)]}),u.curr==="SAR"&&r.vatNo&&s.jsxs("div",{className:"single-entity-and-center",children:[s.jsx("h6",{style:{marginTop:"6px"},children:"Scan with ZATCA app for invoice details."}),D(r.vatNo,u)]}),N?s.jsx("div",{className:"image-bill",children:s.jsx("img",{src:`${N}`,className:"single-entity-and-center",style:{width:L[l].logoWidth}})}):"",u.footerMessage?s.jsx("h4",{className:"single-entity-and-center",dangerouslySetInnerHTML:{__html:u.footerMessage}}):"",u.printby&&u.printOperatorInfo?s.jsx("h6",{className:"left-align-entity",children:`Printed By:${u.printby}`}):"",u.printTime&&u.printOperatorInfo?s.jsx("h6",{className:"left-align-entity",children:`Printed On:${u.printTime}`}):"",u.disabledPoweredBy?"":s.jsx("h6",{className:"single-entity-and-center",children:"Powered By: www.recaho.com"})]})});return te}else if(g==="PRINT_DASHBOARD"&&u.salesCollection){const te=u.salesCollection.totalDiscountAmt?gs(u.salesCollection.grandTotal,u.salesCollection.totalDiscountAmt):null,b=u.salesCollection.totalCollection-u.salesCollection.totalTax;var k=E().format("DD/MM/YYYY LT");const X=(fn=u.monthTillDateSalesColl)!=null&&fn.totalDiscountAmt?gs(u.monthTillDateSalesColl.grandTotal,u.monthTillDateSalesColl.totalDiscountAmt):null;return s.jsxs("div",{className:`main-div ${L[l].dynamicClassname}`,style:{width:L[l].paperSize},children:[s.jsxs("div",{style:{width:"100%",textAlign:"left",marginLeft:"auto"},children:[s.jsxs("div",{children:[s.jsx("p",{className:"single-entity-and-left-align",children:`Printed On:- ${k}`}),s.jsx("br",{}),s.jsx("h1",{className:"single-entity-and-center level2-bold",children:"Sales Report"}),s.jsx("p",{className:"single-entity-and-center",children:u.selectedDate})]}),s.jsx("hr",{}),u.monthTillDateSalesColl?s.jsxs(s.Fragment,{children:[s.jsxs("div",{children:[s.jsx("h4",{className:"single-entity-and-center flex-two-items",children:"MTD Sales Breakup"}),s.jsxs("h5",{className:"level3-bold flex-two-items",children:[s.jsx("span",{children:"Gross Sales:"}),s.jsx("span",{children:oe(u.monthTillDateSalesColl.grandTotal,o)})]}),s.jsxs("h5",{className:"level3-bold flex-two-items",children:[s.jsx("span",{children:"DISCOUNT:"}),s.jsx("span",{children:`${oe(u.monthTillDateSalesColl.totalDiscountAmt,o)}${X?`(${m(X)}%)`:""}`})]}),s.jsxs("h5",{className:"level3-bold flex-two-items",children:[s.jsx("span",{children:"CHARGES:"}),s.jsx("span",{children:oe(u.monthTillDateSalesColl.totalOtherCharges,o)})]}),s.jsxs("h5",{className:"level3-bold flex-two-items",children:[s.jsx("span",{children:"NET SALES BEFORE TAX:"}),s.jsx("span",{children:oe(u.monthTillDateSalesColl.totalCollection-u.monthTillDateSalesColl.totalTax,o)})]}),s.jsxs("h5",{className:"level3-bold flex-two-items",children:[s.jsx("span",{children:"TAX:"}),s.jsx("span",{children:oe(u.monthTillDateSalesColl.totalTax,o)})]}),s.jsxs("h5",{className:"level3-bold flex-two-items",children:[s.jsx("span",{children:"NET SALES AFTER TAX:"}),s.jsx("span",{children:oe(u.monthTillDateSalesColl.totalCollection,o)})]})]}),s.jsx("hr",{})]}):"",s.jsxs("div",{children:[s.jsx("h4",{className:"single-entity-and-center flex-two-items",children:"SALES BREAK-UP"}),s.jsxs("h5",{className:"level3-bold flex-two-items",children:[s.jsx("span",{children:"Gross Sales:"}),s.jsx("span",{children:oe(u.salesCollection.grandTotal,o)})]}),s.jsxs("h5",{className:"level3-bold flex-two-items",children:[s.jsx("span",{children:"DISCOUNT:"}),s.jsx("span",{children:`${oe(u.salesCollection.totalDiscountAmt,o)}${te?`(${m(te)}%)`:""}`})]}),s.jsxs("h5",{className:"level3-bold flex-two-items",children:[s.jsx("span",{children:"CHARGES:"}),s.jsx("span",{children:oe(u.salesCollection.totalOtherCharges,o)})]}),s.jsxs("h5",{className:"level3-bold flex-two-items",children:[s.jsx("span",{children:"NET SALES BEFORE TAX:"}),s.jsx("span",{children:oe(b,o)})]}),s.jsxs("h5",{className:"level3-bold flex-two-items",children:[s.jsx("span",{children:"TAX:"}),s.jsx("span",{children:oe(u.salesCollection.totalTax,o)})]}),s.jsxs("h5",{className:"level3-bold flex-two-items",children:[s.jsx("span",{children:"NET SALES AFTER TAX:"}),s.jsx("span",{children:oe(u.salesCollection.totalCollection,o)})]})]}),s.jsx("hr",{}),Q(u.otherFields.totalDiscountAmt,u.otherFields.discountList,"Discount",{action:"addCharges"}),Q(u.otherFields.totalOtherCharges,u.otherFields.otherChargesList,"Charges"),Q(u.otherFields.totalTax,u.otherFields.taxList,"Tax"),s.jsxs("div",{children:[s.jsx("h4",{className:"single-entity-and-center",children:"BY BUSINESS"}),s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:"Total Sales:"}),s.jsx("span",{children:oe(u.salesCollection.totalCollection,o)})]}),s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:"Total Orders:"}),s.jsx("span",{children:u.salesCollection.totalOrders})]}),w(u)]}),s.jsx("hr",{}),u.otherFields.totalItemType?s.jsx("div",{children:Q(u.otherFields.totalItemType,u.otherFields.itemTypeList,"Item Type",{action:"addCharges"})}):"",u.averageCollection.avgTableTime||u.averageCollection.avgorderValue||u.averageCollection.noOfGuest?s.jsxs("div",{children:[s.jsx("h4",{className:"single-entity-and-center",children:"PERFORMANCE METRICS"}),u.averageCollection.avgTableTime?s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsxs("span",{children:["Average ",r.customLabels.Table," Time:"]}),s.jsx("span",{children:u.averageCollection.avgTableTime})]}):"",u.averageCollection.avgorderValue?s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:"Average Order Value:"}),s.jsx("span",{children:oe(u.averageCollection.avgorderValue,o)})]}):"",u.averageCollection.noOfGuest?s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:"Covers:"}),s.jsx("span",{children:u.averageCollection.noOfGuest})]}):"",u.averageCollection.avgPerCover?s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:"Average Per Cover:"}),s.jsx("span",{children:oe(u.averageCollection.avgPerCover,o)})]}):"",s.jsx("hr",{})]}):"",s.jsxs("div",{children:[s.jsx("h4",{className:"single-entity-and-center",children:"BY PAYMENT CATEGORY"}),s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:"Total Collection:"}),s.jsx("span",{children:oe(u.totalCollection,o)})]}),I(u)]}),R(u.averageCollection),u.otherFields.outstandingAmt?s.jsxs(s.Fragment,{children:[s.jsx("hr",{}),s.jsxs("div",{children:[s.jsx("h4",{className:"single-entity-and-center",children:"BY PAYMENT STATUS"}),s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:" -- Sales:"}),s.jsx("span",{children:oe(u.otherFields.salesCollection,o)})]}),u.otherFields.outstandingAmt?s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:" -- Outstanding Payment Received:"}),s.jsx("span",{children:oe(u.otherFields.outstandingAmt,o)})]}):""]})]}):"",s.jsx("hr",{}),Te(u.averageCollection.dailyExpanse)]}),s.jsx("br",{}),xs=="Android OS"&&s.jsx("div",{className:"space-3rem"})]})}else if(g==="AGGREGATOR_BILL"){let te;return a.aggregatorOrderId&&a.aggregatorOrderId!==""&&(te=$(a.aggregatorOrderId)),s.jsx("div",{className:"main-div bill",style:{width:L[l].paperSize},children:s.jsxs("div",{children:[s.jsxs("div",{style:{width:"100%",textAlign:"left",marginLeft:"auto"},children:[s.jsx("br",{}),C&&s.jsx("div",{className:"image-bill",children:s.jsx("img",{src:C,className:"single-entity-and-center",style:{width:L[l].logoWidth}})}),s.jsxs("div",{className:`details-section ${L[l].dynamicClassname}`,children:[!C&&a.companyInfo.companyName&&a.companyInfo.companyName!=""&&s.jsx("h1",{className:"single-entity-and-center",children:a.companyInfo.companyName}),a.companyInfo.companyAddress&&a.companyInfo.companyAddress!==""&&s.jsx("h3",{className:"single-entity-and-center",dangerouslySetInnerHTML:{__html:a.companyInfo.companyAddress}}),a.companyInfo.companyContact&&a.companyInfo.companyContact!==""&&s.jsx("h3",{className:"single-entity-and-center",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:O.company_mobile}}),": ",s.jsx("span",{children:a.companyInfo.companyContact})]})}),a.companyInfo.companyEmail&&a.companyInfo.companyEmail!==""&&s.jsx("h3",{className:"single-entity-and-center",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:O.company_Email}}),": ",s.jsx("span",{children:a.companyInfo.companyEmail})]})}),a.fssai&&a.fssai!==""&&s.jsx("h3",{className:"single-entity-and-center",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:O.company_FSSAI}}),": ",s.jsx("span",{children:a.fssai})]})}),a.gst&&a.gst!==""&&s.jsx("h3",{className:"single-entity-and-center",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:O.company_GST}}),": ",s.jsx("span",{children:a.gst})]})}),a.vatNo&&a.vatNo!==""&&s.jsx("h3",{className:"single-entity-and-center",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:O.company_VAT}}),": ",s.jsx("span",{children:a.vatNo})]})}),a.orderFrom&&s.jsx("h3",{className:"single-entity-and-center level2-bold",children:a.orderFrom}),a.orderSource&&te&&s.jsxs("h4",{className:"single-entity-and-center",children:[`${a.orderSource}: ${te.firstDigits||""}`,s.jsxs("span",{style:{fontSize:"2rem"},children:["-",te.last4Dgits||""]})]}),a.zomatoInstant&&s.jsx("h4",{className:"single-entity-and-center",children:a.zomatoInstant}),a.otp&&a.otp!==""&&s.jsx("h3",{className:"single-entity-and-center",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:O.delivery_code}}),": ",s.jsx("span",{children:a.otp})]})}),a.tokenId&&s.jsx("h2",{className:"single-entity-and-center level2-bold",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:O.token_no}})," ",s.jsx("span",{children:a.tokenId})]})})]}),s.jsx("hr",{}),s.jsxs("div",{className:`details-section ${L[l].dynamicClassname}`,children:[a.customerInfo.custName&&a.customerInfo.custName!==""&&s.jsx("h5",{className:"left-align-entity level3-bold",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:O.name}}),": ",s.jsx("span",{children:a.customerInfo.custName})]})}),a.customerInfo.custContact&&a.customerInfo.custContact!==""&&s.jsx("h5",{className:"left-align-entity level3-bold",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:O.mobile}}),": ",s.jsx("span",{children:a.customerInfo.custContact})]})}),a.customerInfo.custAddress&&a.customerInfo.custAddress!==""&&s.jsx("h5",{className:"left-align-entity level3-bold",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:O.address}}),": ",s.jsx("span",{children:a.customerInfo.custAddress})]})}),s.jsxs("div",{className:"flex-two-items",children:[a.orderId&&s.jsx("h5",{className:"left-align-entity level3-bold",style:{flexShrink:0},children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:O.order_no}}),": ",s.jsx("span",{children:a.orderId})]})}),a.orderFrom&&s.jsx("h5",{className:"single-entity-and-center",children:a.orderFrom})]}),a.orderInfo.orderDate&&s.jsx("h5",{className:"left-align-entity level3-bold",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:O.date}}),":",s.jsx("span",{children:a.orderInfo.orderDate})]})}),a.deliveryTimestamp&&s.jsx("h5",{className:"left-align-entity level3-bold",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:O.delivery_date}}),":",s.jsx("span",{children:a.deliveryTimestamp})]})})]})]}),s.jsx("hr",{}),s.jsxs("section",{className:"products-section",children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h6",{className:"items products-heading-name-kot",children:L[l].itemName}),s.jsx("h6",{className:"items products-heading-qty-kot",children:"Qty"})]}),s.jsx("hr",{})]}),s.jsxs("section",{className:"products-section",style:{paddingTop:"12px"},children:[((Kt=a.services)==null?void 0:Kt.length)&&a.services.map(X=>{var y;return s.jsxs("div",{style:X.serviceName.startsWith("+ ")?{}:{paddingTop:"12px"},children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h6",{className:"items products-heading-name-kot",style:{lineHeight:1.2},children:X.serviceName.toUpperCase()}),s.jsx("h6",{className:"items products-heading-qty-kot",children:X.qty})]}),((y=X.addons)==null?void 0:y.length)&&X.addons.map(_=>s.jsx("h6",{className:"items products-heading-addon-kot",children:"- "+Ke(_.serviceName)})),X.instruction&&a.itemInstructionOnBill&&s.jsx("h6",{className:"left-align-entity level2-bold",children:s.jsx("h6",{className:"items products-heading-addon-kot",children:X.instruction})})]})}),s.jsx("hr",{})]}),s.jsxs("div",{className:"bottom-section-div flex-two-items",style:{paddingBottom:"3rem"},children:[s.jsxs("h5",{children:["TOTAL ITEMS: ",a.services.length]}),s.jsxs("h5",{children:["TOTAL QTY: ",ve(a.totalQty)]})]}),a&&a.discountAmt?s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h5",{children:"DISCOUNT AMOUNT"}),s.jsx("h5",{children:oe(a.discountAmt,o)})]}):"",a.otherCharges&&a.otherCharges.length>0?a.otherCharges.map(X=>{if(X.amt)return s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h5",{children:X.name}),s.jsx("h5",{children:a.curr+" "+m(X.amt)})]})}):"",a.taxObj&&a.taxObj.GST?s.jsx(s.Fragment,{children:a.taxObj.GST.map(X=>{let y=new Array;for(const _ in X)if(X[_]&&X[_]!=0){let v=_/2;y.push(s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"bottom-section-div",children:[s.jsxs("h5",{children:["CGST @",v]}),s.jsx("h5",{children:a.curr+" "+m(X[_]/2)})]}),s.jsxs("div",{className:"bottom-section-div",children:[s.jsxs("h5",{children:[u.taxLabel+" "," @",v,"%"]}),s.jsx("h5",{children:a.curr+" "+m(X[_]/2)})]})]}))}return y})}):"",s.jsx("div",{style:{marginTop:"6px"},children:(bs=a.customFeilds)==null?void 0:bs.map(X=>s.jsx("h4",{className:"left-align-entity",children:X.customName+": "+X.customValue}))}),a.paymentState&&s.jsx("h4",{className:"single-entity-and-center",style:{marginTop:"6px"},children:`Payment Status: ${a.paymentState=="PAID_ONLINE"?"Online paid":"COD"}`}),N?s.jsx("div",{className:"image-bill",children:s.jsx("img",{src:`${N}`,className:"single-entity-and-center",style:{width:L[l].logoWidth}})}):"",a.footerMessage?s.jsx("h4",{className:"single-entity-and-center",dangerouslySetInnerHTML:{__html:a.footerMessage}}):"",a.printedBy&&a.printOperatorInfo?s.jsx("h6",{className:"left-align-entity",children:`Printed By: ${a.printedBy}`}):"",a.printTime&&a.printOperatorInfo?s.jsx("h6",{className:"left-align-entity",children:`Printed On: ${a.printTime}`}):"",a.disabledPoweredBy?"":s.jsx("h6",{className:"single-entity-and-center",children:"Powered By: www.recaho.com"})]})})}else if(g==="UPDATE_TABLE"){let te="";return a.action==="SWITCH_TABLE"?te=s.jsx("div",{className:"main-div",style:{width:"100%",height:"auto"},children:s.jsxs("div",{style:{width:"100%",textAlign:"left",marginLeft:"auto"},children:[s.jsxs("h2",{className:"single-entity-and-center level2-bold",children:["**",(xt=d.Table)==null?void 0:xt.toUpperCase()," SWITCH**"]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:"From"}),s.jsx("h5",{className:"left-align-entity level3-bold",children:(Qt=a.from)==null?void 0:Qt.map((b,X)=>{var y,_,v;return`${(_=(y=e.tableData[b])==null?void 0:y.attachedArea)==null?void 0:_.toUpperCase()} - ${(v=e.tableData[b])==null?void 0:v.tableName}${X+1===a.from.length?"":", "} `})}),s.jsx("br",{}),s.jsx("h5",{className:"left-align-entity level3-bold",children:"To"}),s.jsx("h2",{className:"left-align-entity level2-bold",children:`${(Ss=(Zt=e.tableData[a.to[0]])==null?void 0:Zt.attachedArea)==null?void 0:Ss.toUpperCase()} - ${(pn=e.tableData[a.to[0]])==null?void 0:pn.tableName}`}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["Running ",`${d.KOT}`,"s: ",Object.keys(a.activeKots).join(", ")]})]})}):te=s.jsx("div",{className:"main-div",style:{width:"100%",height:"auto"},children:s.jsxs("div",{style:{width:"100%",textAlign:"left",marginLeft:"auto"},children:[s.jsxs("h2",{className:"single-entity-and-center level2-bold",children:["**MERGE ",(Ts=d.Table)==null?void 0:Ts.toUpperCase(),"**"]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:"From"}),s.jsx("h5",{className:"left-align-entity level3-bold",children:(yn=a.from)==null?void 0:yn.map((b,X)=>{var y,_,v;return`${(_=(y=e.tableData[b])==null?void 0:y.attachedArea)==null?void 0:_.toUpperCase()} - ${(v=e.tableData[b])==null?void 0:v.tableName}${X+1===a.from.length?"":", "} `})}),s.jsx("br",{}),s.jsx("h5",{className:"left-align-entity level3-bold",children:"To"}),s.jsx("h2",{className:"left-align-entity level2-bold",children:`${(Is=(ws=e.tableData[a.to[0]])==null?void 0:ws.attachedArea)==null?void 0:Is.toUpperCase()} - ${(gn=e.tableData[a.to[0]])==null?void 0:gn.tableName}`}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["Running ",`${d.KOT}`,"s: ",Object.keys(a.activeKots).join(", ")]})]})}),te}else if(g==="COUNTER_OPERATION"){let te;return l=="2INCH"||l=="1.8INCH"?te=s.jsx("div",{className:"main-div",style:{width:L[l].paperSize},children:s.jsxs("div",{style:{width:"100%",textAlign:"left",marginLeft:"auto"},children:[s.jsxs("h2",{className:"single-entity-and-center level2-bold",children:[a.counterName," Report"]}),s.jsxs("h6",{className:"single-entity-and-center level3-bold",children:[" Printed By: ",a.printedBy," "]}),s.jsxs("h6",{className:"single-entity-and-center level3-bold",children:[" Printed On: ",a.printedOn," "]}),s.jsx("hr",{}),s.jsxs("h4",{className:"left-align-entity level3-bold",children:[" Total Sales: ",U(a.totalSale,o)," "]}),a.totalSale>0&&s.jsxs(s.Fragment,{children:[(a.cashSale>0||a.cashSale<0)&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" -- Cash: ",U(a.cashSale,o)," "]}),a.payModes&&a.payModes.length>0&&a.payModes.map(b=>{if(b.value>0||b.value<0)return s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- ",b.displayName," : ",U(b.value,o)]})})]}),s.jsxs("h4",{className:"left-align-entity level3-bold",children:["Cash Balance: ",U(a.closingActualBalance,o)]}),s.jsx("hr",{}),s.jsx("h5",{className:"left-align-entity level3-bold",children:"Opening Counter Operation"}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" -- Opened By : "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",a.openedBy]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" -- Date/Time : "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",a.openingDateTime]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" -- System Opening Balance : "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",U(a.openingBalance,o)," "]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" -- Actual Opening Balance : "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",U(a.actualOpeningBalance,o)]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" -- Opening Difference Amt : "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",U(a.openingShort,o)," "]}),a.openingShortReason&&s.jsx("h5",{className:"left-align-entity level3-bold",children:" -- Opening Difference Reason : "}),a.openingShortReason&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",a.openingShortReason]}),a.openingTotalDenomations>0&&s.jsx(s.Fragment,{children:s.jsx("h5",{className:"left-align-entity level3-bold",children:"-- Currency Denominations"})}),a.openingDenominations&&a.openingDenominations.length>0&&a.openingDenominations.map(b=>s.jsxs("div",{class:o=="INR"?"denomination-container":"denomination-container-other-country",children:[s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",o=="INR"?U(b.denomination,o):b.denomination]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" X "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",b.count," "]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" = "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",U(b.total,o)," "]})]})),a.openingTotalDenomations>0&&s.jsxs("div",{class:o=="INR"?"total-container":"total-container-other-country",children:[s.jsx("h5",{className:"left-align-entity level3-bold",children:" "}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" Total "}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" = "}),s.jsx("h5",{className:"left-align-entity level3-bold",children:U(a.openingTotalDenomations,o)})]}),s.jsx("hr",{}),s.jsx("h5",{className:"left-align-entity level3-bold",children:"Closing Counter Operation"}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" -- Closed By : "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",a.closedBy," "]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" -- Date/Time :"}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",a.closingDateTime]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" -- Cash Sale : "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",U(a.cashSale,o)," "]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" -- System Closing Balance : "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",U(a.closingBalance,o)," "]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" -- Actual Closing Balance : "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",U(a.closingActualBalance,o)]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" -- Closing Difference Amt : "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",U(a.closingShort,o)," "]}),a.closingShortReason&&s.jsx("h5",{className:"left-align-entity level3-bold",children:" -- Closing Difference Reason : "}),a.closingShortReason&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",a.closingShortReason," "]}),a.debitEntry>0&&s.jsxs(s.Fragment,{children:[s.jsx("h5",{className:"left-align-entity level3-bold",children:" -- Other Cash Expense : "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" -",U(a.debitEntry,o)," "]})]}),a.creditEntry>0&&s.jsxs(s.Fragment,{children:[s.jsx("h5",{className:"left-align-entity level3-bold",children:" -- Other Cash Income : "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" +",U(a.creditEntry,o)," "]})]}),a.internalTransferDebit>0&&s.jsxs(s.Fragment,{children:[s.jsx("h5",{className:"left-align-entity level3-bold",children:" -- Internal Transfer(cash to bank): "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" -",U(a.internalTransferDebit,o)]})]}),a.internalTransferCredit>0&&s.jsxs(s.Fragment,{children:[s.jsx("h5",{className:"left-align-entity level3-bold",children:" -- Internal Transfer(bank to cash) : "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" +",U(a.internalTransferCredit,o)]})]}),a.TotalDenomationsAmount>0&&s.jsx(s.Fragment,{children:s.jsx("h5",{className:"left-align-entity level3-bold",children:"-- Currency Denominations"})}),a.denomations&&a.denomations.length>0&&a.denomations.map(b=>s.jsxs("div",{class:o=="INR"?"denomination-container":"denomination-container-other-country",children:[s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",o=="INR"?U(b.denomination,o):b.curr+" "+b.denomination]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" X "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",b.count," "]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" = "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",U(b.total,o)," "]})]})),a.TotalDenomationsAmount>0&&s.jsxs("div",{class:o=="INR"?"total-container":"total-container-other-country",children:[s.jsx("h5",{className:"left-align-entity level3-bold",children:" "}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" Total "}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" = "}),s.jsx("h5",{className:"left-align-entity level3-bold",children:U(a.TotalDenomationsAmount,o)})]})]})}):te=s.jsx("div",{className:"main-div",style:{width:L[l].paperSize},children:s.jsxs("div",{style:{width:"100%",textAlign:"left",marginLeft:"auto"},children:[s.jsxs("h2",{className:"single-entity-and-center level2-bold",children:[a.counterName," Report"]}),s.jsxs("h6",{className:"single-entity-and-center level3-bold",children:[" Printed By: ",a.printedBy," "]}),s.jsxs("h6",{className:"single-entity-and-center level3-bold",children:[" Printed On: ",a.printedOn," "]}),s.jsx("hr",{}),s.jsxs("h4",{className:"left-align-entity level3-bold",children:[" Total Sales: ",U(a.totalSale,o)," "]}),a.totalSale>0&&s.jsxs(s.Fragment,{children:[a.cashSale>0&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" -- Cash: ",U(a.cashSale,o)," "]}),a.payModes&&a.payModes.length>0&&a.payModes.map(b=>{if(b.value>0)return s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- ",b.displayName," : ",U(b.value,o)]})})]}),s.jsxs("h4",{className:"left-align-entity level3-bold",children:["Cash Balance: ",U(a.closingActualBalance,o)]}),s.jsx("hr",{}),s.jsx("h5",{className:"left-align-entity level3-bold",children:"Opening Counter Operation"}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" -- Opened By : ",a.openedBy]}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" -- Date/Time : ",a.openingDateTime]}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- System Opening Balance : ",U(a.openingBalance,o)]}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- Actual Opening Balance : ",U(a.actualOpeningBalance,o)]}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- Opening Difference Amt : ",U(a.openingShort,o)]}),a.openingShortReason&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" -- Opening Difference Reason : ",a.openingShortReason]}),a.openingTotalDenomations>0&&s.jsx(s.Fragment,{children:s.jsx("h5",{className:"left-align-entity level3-bold",children:"-- Currency Denominations"})}),a.openingDenominations&&a.openingDenominations.length>0&&a.openingDenominations.map(b=>s.jsxs("div",{class:o=="INR"?"denomination-container":"denomination-container-other-country",children:[s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",o=="INR"?U(b.denomination,o):b.denomination]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" X "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",b.count," "]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" = "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",U(b.total,o)," "]})]})),a.openingTotalDenomations>0&&s.jsxs("div",{class:o=="INR"?"total-container":"total-container-other-country",children:[s.jsx("h5",{className:"left-align-entity level3-bold",children:" "}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" Total "}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" = "}),s.jsx("h5",{className:"left-align-entity level3-bold",children:U(a.openingTotalDenomations,o)})]}),s.jsx("hr",{}),s.jsx("h5",{className:"left-align-entity level3-bold",children:"Closing Counter Operation"}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" -- Closed By : ",a.closedBy," "]}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" -- Date/Time : ",a.closingDateTime]}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" -- Cash Sale : ",U(a.cashSale,o)," "]}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- System Closing Balance : ",U(a.closingBalance,o)]}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- Actual Closing Balance : ",U(a.closingActualBalance,o)]}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- Closing Difference Amt : ",U(a.closingShort,o)]}),a.closingShortReason&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" -- Closing Difference Reason : ",a.closingShortReason," "]}),a.debitEntry>0&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- Other Cash Expense : -",U(a.debitEntry,o)]}),a.creditEntry>0&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- Other Cash Income : +",U(a.creditEntry,o)]}),a.internalTransferDebit>0&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- Internal Transfer(cash to bank): -",U(a.internalTransferDebit,o)]}),a.internalTransferCredit>0&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- Internal Transfer(bank to cash): +",U(a.internalTransferCredit,o)]}),a.TotalDenomationsAmount>0&&s.jsx(s.Fragment,{children:s.jsx("h5",{className:"left-align-entity level3-bold",children:"--Currency Denominations"})}),a.denomations&&a.denomations.length>0&&a.denomations.map(b=>s.jsxs("div",{class:o=="INR"?"denomination-container":"denomination-container-other-country",children:[s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",o=="INR"?U(b.denomination,o):b.curr+" "+b.denomination]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" X "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",b.count," "]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" = "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",U(b.total,o)," "]})]})),a.TotalDenomationsAmount>0&&s.jsxs("div",{class:o=="INR"?"total-container":"total-container-other-country",children:[s.jsx("h5",{className:"left-align-entity level3-bold",children:" "}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" Total "}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" = "}),s.jsx("h5",{className:"left-align-entity level3-bold",children:U(a.TotalDenomationsAmount,o)})]})]})}),te}else if(g==="ITEMWISE_SALES_COUNTER"){let te,{counterDetails:b}=e.printerDataObject;return te=s.jsx("div",{className:"main-div",style:{width:L[l].paperSize},children:s.jsxs("div",{style:{width:"100%",textAlign:"left",marginLeft:"auto"},children:[s.jsx("h2",{className:"single-entity-and-center level2-bold",children:"Item Wise Sales Report"}),s.jsx("h5",{className:"single-entity-and-center level3-bold",children:b.currentDate}),s.jsx("hr",{}),b.CounterName&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:["Counter Name: ",b.CounterName]}),b.CounterName&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:["UserName: ",b.openedBy]}),b.CounterName&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:["Login Time: ",b.loginTime]}),b.logoutTime&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:["Logout Time: ",b.logoutTime]}),b.CounterName&&s.jsx("hr",{}),st(a),s.jsx("hr",{}),s.jsx("h6",{className:"left-align-entity",children:`Printed By: ${b.openedBy}`}),s.jsx("h6",{className:"left-align-entity",children:`Printed On: ${b.printedOn}`})]})}),te}else if(g==="CARD_RECHARGE_DETAILS"){let{staticDataKOT:te}=e.printerDataObject;return getRechargeDetails(te)}else if(g==="PACKAGING_SLIP"){let te,b=0;u.aggregatorOrderId&&u.aggregatorOrderId!==""&&(te=$(u.aggregatorOrderId));const X=u.services;for(let _ in X)b+=X[_].length;return s.jsx("div",{className:"main-div",style:{width:L[l].paperSize},children:s.jsxs("div",{style:{width:"100%",textAlign:"left",marginLeft:"auto"},children:[s.jsx("br",{}),s.jsxs("div",{className:`details-section ${L[l].dynamicClassname}`,children:[u.subOrderFrom&&s.jsx("h4",{className:"single-entity-and-center",children:u.subOrderFrom.toUpperCase()}),u.orderFrom!=="dine-in"&&s.jsxs("h2",{className:"single-entity-and-center level2-bold",children:["Token No ",u.tokenId]}),u.tableName&&s.jsx("h2",{className:"single-entity-and-center level2-bold",children:u.tableName}),u.otp&&s.jsx("h4",{className:"single-entity-and-center level2-bold",children:"OTP: "+u.otp}),u.orderSource&&te&&s.jsxs("h4",{className:"single-entity-and-center level2-bold",children:[`${u.orderSource}: ${te.firstDigits||""}`,s.jsx("span",{style:{fontSize:"2rem"},children:te.last4Dgits||""})]}),u.zomatoInstant&&s.jsx("h4",{className:"single-entity-and-center level2-bold",children:u.zomatoInstant}),s.jsx("hr",{}),u.orderId&&s.jsx("h5",{className:"left-align-entity level3-bold",children:"Order Id: "+u.orderId}),u.date&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:["Printed On: ",u.date]}),u.prepareBy?s.jsx("h5",{className:"left-align-entity level3-bold",children:"Prepare By : "+u.prepareBy}):"",u.waiterName&&s.jsx("h5",{className:"left-align-entity level3-bold",children:`${d.Waiter} Name: `+u.waiterName})]}),me(u),s.jsx("br",{}),s.jsxs("div",{className:"bottom-section-div flex-two-items space-3rem",children:[s.jsxs("h5",{children:["TOTAL ITEMS: ",b]}),s.jsxs("h5",{children:["TOTAL QTY: ",ve(u.totalQty)]})]}),(xn=u.customFields)==null?void 0:xn.map(_=>s.jsx("h4",{className:"left-align-entity",children:_.customName+": "+_.customValue})),s.jsx("br",{}),u.orderFrom!=="dine-in"&&s.jsxs("h4",{className:"left-align-entity level3-bold",children:["Payment Status: ",u.paymentStatus.replace("_"," ")]})]})})}else{if(g==="ORDER_AGGREGATED_PRINT")return s.jsx("div",{className:"main-div",style:{width:L[l].paperSize},children:s.jsxs("div",{style:{width:"100%",textAlign:"left",marginLeft:"auto"},children:[a.logo&&s.jsx("div",{className:"image-bill",children:s.jsx("img",{src:a.logo,className:"single-entity-and-center"})}),s.jsxs("div",{className:`details-section ${L[l].dynamicClassname}`,children:[!a.logo&&a.companyName&&a.companyName!=""&&s.jsx("h1",{className:"single-entity-and-center",children:a.companyName}),a.companyAddress&&a.companyAddress!==""&&s.jsx("h3",{className:"single-entity-and-center",dangerouslySetInnerHTML:{__html:a.companyAddress}}),a.companyContact&&a.companyContact!==""&&s.jsx("h3",{className:"single-entity-and-center",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:O.company_mobile}}),": ",s.jsx("span",{children:a.companyContact})]})}),a.fssai&&a.fssai!==""&&s.jsx("h3",{className:"single-entity-and-center",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:O.company_FSSAI}}),": ",s.jsx("span",{children:a.fssai})]})}),a.gst&&a.gst!==""&&s.jsx("h3",{className:"single-entity-and-center",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:O.company_GST}}),": ",s.jsx("span",{children:a.gst})]})}),a.vatNo&&a.vatNo!==""&&s.jsx("h3",{className:"single-entity-and-center",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:O.company_VAT}}),": ",s.jsx("span",{children:a.vatNo})]})})]}),s.jsx("hr",{}),s.jsx("h3",{className:"single-entity-and-center",children:"Outstanding Bill Summary"}),s.jsx("hr",{}),s.jsx("hr",{}),a.name&&s.jsxs("h5",{children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:O.name}}),": ",s.jsx("span",{children:a.name})]}),a.mobile&&s.jsxs("h5",{children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:O.mobile}}),": ",s.jsx("span",{children:a.mobile})]}),s.jsxs("div",{className:"mt-2",children:[s.jsx("hr",{}),s.jsx("section",{className:"products-section",children:s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h5",{className:`items products-heading-name ${L[l].dynamicClassname}`,children:"Date"}),s.jsx("h5",{className:`items products-heading-orderId ${L[l].dynamicClassname}`,children:"Order Id"}),s.jsx("h5",{className:`items products-heading-amount ${L[l].dynamicClassname}`,children:"Amount"})]})}),s.jsx("hr",{}),s.jsx("section",{className:"products-section",children:a.orders.map(b=>s.jsx("div",{style:{paddingTop:"12px"},children:s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h6",{className:`items products-heading-name ${L[l].dynamicClassname}`,children:nr(b.date)}),s.jsx("h6",{className:`items products-heading-orderId ${L[l].dynamicClassname}`,children:b.orderId}),s.jsx("h6",{className:`items products-heading-amount ${L[l].dynamicClassname}`,children:a.curr+" "+m(b.finalAmount)})]})},b.orderId))})]}),s.jsxs("div",{children:[s.jsx("hr",{}),s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{className:"total-qty",children:"Total Bill Amount"}),s.jsx("h5",{className:"actual-qty",children:a.curr+" "+m(a.totalAmount)})]}),s.jsx("hr",{}),s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{className:"total-qty",children:"Total Amount Paid"}),s.jsx("h5",{className:"actual-qty",children:a.curr+" "+m(a.totalPaid)})]})]}),(Cs=a.transactions)!=null&&Cs.length?s.jsxs("div",{children:[s.jsx("hr",{}),s.jsx("section",{className:"products-section",children:s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h5",{className:`items products-heading-name ${L[l].dynamicClassname}`,children:"Date"}),s.jsx("h5",{className:`items products-heading-orderId ${L[l].dynamicClassname}`,children:"Payment Mode"}),s.jsx("h5",{className:`items products-heading-amount ${L[l].dynamicClassname}`,children:"Amount"})]})}),s.jsx("hr",{}),s.jsx("section",{className:"products-section",children:a.transactions.map(b=>s.jsx("div",{style:{paddingTop:"12px"},children:s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h6",{className:`items products-heading-name ${L[l].dynamicClassname}`,children:b.date}),s.jsx("h6",{className:`items products-heading-orderId ${L[l].dynamicClassname}`,children:b.paymentMode}),s.jsx("h6",{className:`items products-heading-amount ${L[l].dynamicClassname}`,children:a.curr+" "+m(b.amount)})]})},b.id))})]}):"",s.jsxs("div",{className:"mt-2 pb-2rem",children:[s.jsx("hr",{}),s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h4",{className:"total-qty-other",children:"Total Payable"}),s.jsx("h4",{className:"actual-qty-other",children:a.curr+" "+m(a.totalPayable)})]})]})]})});{let te,b=0,X,y;for(let v=0;v<(((Os=a.services)==null?void 0:Os.length)||0);v++)y=a.services[v],y.status==="CANCELLED"&&!a.onlyCancelledItems&&(b+=y.qty);return a.aggregatorOrderId&&a.aggregatorOrderId!==""&&(te=$(a.aggregatorOrderId)),s.jsx("div",{className:"main-div",style:{width:L[l].paperSize},children:s.jsxs("div",{style:{maxWidth:"100%",textAlign:"left",marginLeft:"auto"},children:[s.jsx("br",{}),s.jsxs("div",{className:"main-div",children:[a.duplicate&&!a.onlyCancelledItems?s.jsx("h4",{className:"single-entity-and-center",children:"DUPLICATE KOT"}):"",b||a.onlyCancelledItems?s.jsx("h4",{className:"single-entity-and-center",children:"EDITED KOT - ITEM CANCELLED"}):"",a.station&&s.jsx("h4",{className:"single-entity-and-center level2-bold",children:a.station.toUpperCase()}),a.subOrderFrom&&s.jsx("h4",{className:"single-entity-and-center",children:a.subOrderFrom.toUpperCase()}),a.type!="dine-in"&&a.tokenId&&s.jsxs("h2",{className:"single-entity-and-center level2-bold",children:["Token No ",a.tokenId]}),a.type=="dine-in"&&a.type&&s.jsx("h2",{className:"single-entity-and-center level2-bold",children:a.type==="dine-in"?a.tableName?a.tableName:"-":""}),s.jsx("hr",{}),a.otp&&s.jsx("h4",{className:"single-entity-and-center level2-bold",children:"OTP: "+a.otp}),a.orderSource&&te&&s.jsxs("h4",{className:"single-entity-and-center level2-bold",children:[`${a.orderSource}: ${te.firstDigits||""}`,s.jsx("span",{style:{fontSize:"2rem"},children:te.last4Dgits||""})]}),a.zomatoInstant&&s.jsx("h4",{className:"single-entity-and-center level2-bold",children:a.zomatoInstant}),s.jsxs("div",{className:"details-section",children:[a.orderId&&s.jsx("h5",{className:"left-align-entity level3-bold",children:"Order Id: "+Array.from(a.orderId).join(", ")}),s.jsxs("div",{className:"flex-container-kot",children:[a.kotId&&s.jsx("h5",{className:"left-align-entity level3-bold",children:`${d.KOT} Id: `+Array.from(a.kotId).join(", ")}),a.type&&a.type!="dine-in"&&s.jsx("h2",{className:"left-align-entity",children:a.type==="dine-in"?a.tableName?a.tableName:"-":""})]}),a.customerName&&s.jsx("h5",{className:"left-align-entity level3-bold",children:a.customerName}),a.time?s.jsx("h5",{className:"left-align-entity level3-bold",children:"Printed On : "+a.time}):"",a.prepareBy?s.jsx("h5",{className:"left-align-entity level3-bold",children:"Prepare By : "+a.prepareBy}):""]}),a.createdBy&&s.jsx("h5",{className:"left-align-entity level3-bold",children:"Printed By: "+a.createdBy}),a.waiterName&&s.jsx("h5",{className:"left-align-entity level3-bold",children:`${d.Waiter} Name: `+a.waiterName})]}),s.jsx("hr",{}),s.jsxs("section",{className:`products-section ${_e}`,children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h5",{className:"items products-heading-name-kot",children:L[l].itemName}),s.jsx("h5",{className:"items products-heading-qty-kot",children:"QTY"})]}),s.jsx("hr",{})]}),s.jsxs("section",{className:`products-section ${_e}`,style:{paddingTop:"12px"},children:[a.services&&a.services.length&&a.services.length>0&&a.services.reverse().map(v=>(v.status==="CANCELLED"?X=s.jsxs("strike",{children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h2",{className:"items products-heading-name-kot ",children:Ke(v.serviceName)}),s.jsx("h2",{className:"items products-heading-qty-kot ",children:v.qty})]}),v.addons&&v.addons.length&&v.addons.map(z=>s.jsx("h2",{className:"items products-heading-addon-kot",children:"- "+Ke(z.serviceName)})),v.instruction&&s.jsx("h4",{className:"left-align-entity level2-bold",children:s.jsx("h4",{className:"items products-heading-addon-kot",children:" "+v.instruction})})]}):X=s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h2",{className:"items products-heading-name-kot ",children:Ke(v.serviceName)}),s.jsx("h2",{className:"items products-heading-qty-kot ",children:v.qty})]}),v.addons&&v.addons.length&&v.addons.map(z=>s.jsx("h2",{className:"items products-heading-addon-kot",children:"- "+Ke(z.serviceName)})),v.instruction&&s.jsx("h4",{className:"left-align-entity level2-bold",children:s.jsx("h4",{className:"items products-heading-addon-kot",children:" "+v.instruction})})]}),s.jsx("div",{children:X}))),s.jsx("hr",{})]}),s.jsxs("div",{className:"bottom-section-div flex-two-items",style:{paddingBottom:"3rem"},children:[s.jsxs("h5",{className:"level3-bold",children:["TOTAL ITEMS: ",a.services.length]}),s.jsxs("h5",{className:"level3-bold",children:["TOTAL QTY: ",ve(a.totalQty-b)]})]}),(Nn=a.customFields)==null?void 0:Nn.map(v=>s.jsx("h4",{className:"left-align-entity",children:v.customName+": "+v.customValue})),a.deliveryTimestamp&&s.jsx("h5",{className:"left-align-entity level3-bold",children:"Delivery Date: "+a.deliveryTimestamp})]})})}}};return s.jsx("div",{children:a&&Object.keys(a).length!==0&&s.jsx("div",{id:"domEl",ref:n,className:"html-bill-print",style:{maxWidth:L[l].paperSize,zIndex:"-10",backgroundColor:"#fff"},children:Ot(f,a.obj,a.companyLogo,a.companyQrCode)})})},Mh=async(e,t,n,r={})=>new Promise(async(i,a)=>{var h,f,o;try{const{needPackagingSlip:l=!0}=r;e.primaryWaiter&&n&&(e.primaryWaiter=((h=n[e.primaryWaiter])==null?void 0:h.name)||null);const{obj:c,printersMap:d}=_d(e,t,r);console.log({obj:c,printersMap:d});let p=[],m=[];const x=ba(c).flatMap(j=>{var S;return(S=d[j.station])==null?void 0:S.map(A=>new Promise(w=>s.jsx(tt,{printerDataObject:{staticDataKOT:j,paperSize:A.paperSize,printer:A.printer},newId:j.newId,value:{settingData:t},onImageGenerated:I=>{p.push({paperSize:A.paperSize,printer:A.printer,image:I,type:"KOT"}),w()},additionalActions:r},j.newId)))});if(l&&((f=t.packagingSlipPrinters)!=null&&f.length)){const j=bd(e,t,r);(o=j.printers)!=null&&o.length&&j.printers.forEach(S=>{m.push(new Promise(A=>{x.push(s.jsx(tt,{printerDataObject:{staticDataKOT:{obj:S.obj},paperSize:S.paperSize,printer:S.printer,type:"PACKAGING_SLIP"},newId:S.obj.newId,value:{settingData:t},onImageGenerated:w=>{p.push({paperSize:S.paperSize,printer:S.printer,image:w,type:"PACKAGING_SLIP"}),A()},additionalActions:r},S.obj.newId))}))})}console.log("kotComponents :::",x),x.length&&pt("root2",x),await Promise.all(m),i(p)}catch(l){a(l)}}),Ah=(e,t,n)=>new Promise(async(r,i)=>{try{const{tableData:a}=n;let h=[],f=[];if(n!=null&&n.action){const{obj:o,paperSize:l,printersMap:c}=Sd(e,t,n),d=ba(o).flatMap(p=>{var m;return(m=c[p.station])==null?void 0:m.map(x=>new Promise(j=>{const S=s.jsx(tt,{printerDataObject:{staticDataKOT:p,paperSize:l,printer:x.printer,type:p.type},newId:p.newId,settingData:t,tableData:ms(a,"typeValue"),onImageGenerated:A=>{h.push({paperSize:x.paperSize,printer:x.printer,image:A,type:"UPDATE_TABLE"}),j()},additionalActions:n});return f.push(j),S}))});d.length&&pt("root1",d),await Promise.all(f.map(p=>new Promise(p)))}r(h)}catch(a){i(a)}}),Eh=(e,t)=>new Promise(async(n,r)=>{try{const i=Td(e,t);let a=[];await new Promise(f=>{const o=s.jsx(tt,{printerDataObject:{staticDataKOT:{obj:i},paperSize:e.printerSize,type:"PRINT_DASHBOARD"},newId:i.id,settingData:e,onImageGenerated:l=>{a.push({paperSize:e.printerSize,image:l,type:"PRINT_DASHBOARD"}),f()},additionalActions:t});pt("root1",o)}),n(a)}catch(i){r(i)}}),Rh=async(e,t,n)=>new Promise(async(r,i)=>{try{const{obj:a}=await wd(e,t,n);let h=[];await new Promise(o=>{const l=s.jsx(tt,{printerDataObject:{staticDataKOT:a,paperSize:a.paperSize,type:"AGGREGATOR_BILL"},newId:Math.random(),settingData:t,onImageGenerated:c=>{h.push({paperSize:a.paperSize,image:c,type:"AGGREGATOR_BILL"}),o()},additionalActions:n});pt("root1",l)}),r(h)}catch(a){i(a)}}),kh=async(e,t,n)=>new Promise(async(r,i)=>{try{let a=await _a(e,t,n),h=[];await new Promise(o=>{const l=s.jsx(tt,{printerDataObject:{staticDataKOT:a,paperSize:a.paperSize,type:"BILL"},newId:Math.random(),settingData:t,onImageGenerated:c=>{h.push({paperSize:a.paperSize,image:c,type:"BILL"}),o()},additionalActions:n});pt("root1",l)}),r(h)}catch(a){i(a)}}),Lh=async(e,t,n,r)=>new Promise(async(i,a)=>{try{let h=await Id(e);if(h&&Object.keys(h.Category).length!==0){let o=`ItemWiseSales:::${Math.floor(Math.random()*1e3)}`,l=[];await new Promise(d=>{const p=s.jsx(tt,{printerDataObject:{staticDataKOT:h,paperSize:t.printerSize,type:"ITEMWISE_SALES_COUNTER",counterDetails:n},newId:o,settingData:t,onImageGenerated:m=>{l.push({paperSize:t.printerSize,image:m,type:"ITEMWISE_SALES_COUNTER"}),d()},additionalActions:r});pt("root1",p)}),i(l)}else i([])}catch(h){a(h)}}),Ph=async(e,t,n)=>new Promise(async(r,i)=>{try{let h=`counterDetailsPrint:::${Math.floor(Math.random()*1e3)}`,f=[];await new Promise(l=>{const c=s.jsx(tt,{printerDataObject:{staticDataKOT:e,paperSize:t.printerSize,type:"COUNTER_OPERATION"},newId:h,settingData:t,onImageGenerated:d=>{f.push({paperSize:t.printerSize,image:d,type:"COUNTER_OPERATION"}),l()},additionalActions:n});pt("root1",c)}),r(f)}catch(a){i(a)}}),Fh=async(e,t,n={},r={})=>new Promise(async(i,a)=>{var h;try{const f=await Od(e,t);let o=[],l=lr(null,{fontTheme:t.fontTheme,type:"ORDER_AGGREGATED_PRINT",siteSetting:t}),c=l?(h=l[0])==null?void 0:h.paperSize:t.printerSize;await new Promise(p=>{const m=s.jsx(tt,{printerDataObject:{staticDataKOT:{...f,name:n.name,mobile:n.mobile},paperSize:c,type:"ORDER_AGGREGATED_PRINT"},newId:Math.random(),settingData:t,onImageGenerated:x=>{o.push({paperSize:c,image:x,type:"ORDER_AGGREGATED_PRINT"}),p()},additionalActions:r});pt("root1",m)}),i(o)}catch(f){a(f)}}),Dh=async(e,t,n={})=>new Promise(async(r,i)=>{var a;try{const h=[];let f=[];for(let o=0;o<e.length;o++){let l=e[o];if((a=l.invoiceFormats)!=null&&a.length){let c=cd(l.invoiceFormats,"createdAt")[0],d=await Md(c);await new Promise(m=>{const x=s.jsx(tt,{printerDataObject:{staticDataKOT:d,paperSize:d.paperSize,type:"BILL"},newId:Math.random(),settingData:t,onImageGenerated:j=>{f.push({paperSize:d.paperSize,image:j,type:"BILL"}),m()},additionalActions:n});h.push(x)})}}h.length&&pt("root1",h),r(f)}catch(h){i(h)}}),pt=(e,t)=>{const n=document.getElementById(e);n&&ii.createRoot(n).render(t)};Ce.counterDetailsPrint=Ph,Ce.handleAggregatorBillPrint=Rh,Ce.handleBillPrint=kh,Ce.handleDashboardPrint=Eh,Ce.handleItemWisePrint=Lh,Ce.handleKOTPrint=Mh,Ce.handleOldBillPrints=Dh,Ce.handleSummaryPrint=Fh,Ce.handleUpdateTablePrint=Ah,Object.defineProperty(Ce,Symbol.toStringTag,{value:"Module"})});
|