recaho-print-react 0.0.138 → 0.0.139
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.
|
@@ -51,4 +51,4 @@ L.version="2.30.1",li(fe),L.fn=A,L.min=Kl,L.max=Ql,L.now=Zl,L.utc=Qe,L.unix=wc,L
|
|
|
51
51
|
* @license qrcode.react
|
|
52
52
|
* Copyright (c) Paul O'Shannessy
|
|
53
53
|
* SPDX-License-Identifier: ISC
|
|
54
|
-
*/var Wa={L:Vt.QrCode.Ecc.LOW,M:Vt.QrCode.Ecc.MEDIUM,Q:Vt.QrCode.Ecc.QUARTILE,H:Vt.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(u,f){if(!u&&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(!u)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}u&&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,u=Math.floor(t*Sh),f=a/t,o=(r.width||u)*f,l=(r.height||u)*f,c=r.x==null?e.length/2-o/2:r.x*f,h=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(h),v=Math.ceil(o+c-m),_=Math.ceil(l+h-x);p={x:m,y:x,w:v,h:_}}return{x:c,y:h,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:u=qa,includeMargin:f=Ka,style:o,imageSettings:l}=t,c=mr(t,["value","size","level","bgColor","fgColor","includeMargin","style","imageSettings"]),h=l==null?void 0:l.src,p=xe.useRef(null),m=xe.useRef(null),[x,v]=xe.useState(!1);xe.useEffect(()=>{if(p.current!=null){const S=p.current,w=S.getContext("2d");if(!w)return;let D=Vt.QrCode.encodeText(n,Wa[i]).getModules();const $=f?fr:0,P=D.length+$*2,Z=Ja(D,r,f,l),ne=m.current,te=Z!=null&&ne!==null&&ne.complete&&ne.naturalHeight!==0&&ne.naturalWidth!==0;te&&Z.excavation!=null&&(D=Za(D,Z.excavation));const le=window.devicePixelRatio||1;S.height=S.width=r*le;const Se=r/P*le;w.scale(Se,Se),w.fillStyle=a,w.fillRect(0,0,P,P),w.fillStyle=u,Th?w.fill(new Path2D(Qa(D,$))):D.forEach(function(Q,J){Q.forEach(function(G,de){G&&w.fillRect(de+$,J+$,1,1)})}),te&&w.drawImage(ne,Z.x+$,Z.y+$,Z.w,Z.h)}}),xe.useEffect(()=>{v(!1)},[h]);const _=ps({height:r,width:r},o);let E=null;return h!=null&&(E=xe.createElement("img",{src:h,key:h,style:{display:"none"},onLoad:()=>{v(!0)},ref:m})),xe.createElement(xe.Fragment,null,xe.createElement("canvas",ps({style:_,height:r,width:r,ref:p},c)),E)}function Ih(e){const t=e,{value:n,size:r=za,level:i=Ga,bgColor:a=Va,fgColor:u=qa,includeMargin:f=Ka,imageSettings:o}=t,l=mr(t,["value","size","level","bgColor","fgColor","includeMargin","imageSettings"]);let c=Vt.QrCode.encodeText(n,Wa[i]).getModules();const h=f?fr:0,p=c.length+h*2,m=Ja(c,r,f,o);let x=null;o!=null&&m!=null&&(m.excavation!=null&&(c=Za(c,m.excavation)),x=xe.createElement("image",{xlinkHref:o.src,height:m.h,width:m.w,x:m.x+h,y:m.y+h,preserveAspectRatio:"none"}));const v=Qa(c,h);return xe.createElement("svg",ps({height:r,width:r,viewBox:`0 0 ${p} ${p}`},l),xe.createElement("path",{fill:a,d:`M0,0 h${p}v${p}H0z`,shapeRendering:"crispEdges"}),xe.createElement("path",{fill:u,d:v,shapeRendering:"crispEdges"}),x)}var Xa=e=>{const t=e,{renderAs:n}=t,r=mr(t,["renderAs"]);return n==="svg"?xe.createElement(Ih,ps({},r)):xe.createElement(wh,ps({},r))};const ys=(e,t)=>t*100/e,Ch=e=>!!(e||e===0),Oh={ABSOLUTE:"AMT",RELATIVE:"%",COMPLIMENTARY:"COMPLIMENTARY"},k=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 Ct=tr(),_e="normal-class";(Ct=="Android OS"||Ct==="iOS")&&(_e="bold-class");const qe=e=>{var rt,Mt,ee,be,pt;const t=e.additionalActions??{},n=xe.useRef(null),r=e.settingData?e.settingData:e.value.settingData,i=localStorage.getItem("siteId"),{staticDataKOT:a,printer:u,type:f}=e.printerDataObject,o=((Mt=(rt=e.value)==null?void 0:rt.settingData)==null?void 0:Mt.curr)??((ee=e.settingData)==null?void 0:ee.curr)??"INR";r==null||r.fontTheme;let l=e.printerDataObject.paperSize,c=lr(u,{type:f,siteSetting:e.settingData?e.settingData:e.value.settingData},t);const h=r.customLabels??gd();l=c?(be=c[0])!=null&&be.paperSize?(pt=c[0])==null?void 0:pt.paperSize:l||"3INCH":e.printerDataObject.paperSize;function p(y){const d=Math.abs(parseFloat(y));return m(d)}function m(y){switch(o){case"BHD":case"KWD":case"MUR":case"OMR":return Zs(y).format("0,00.000");default:return Zs(y).format("0,00.00")}}xe.useEffect(()=>{E()},[e.newId]);const x=()=>new Promise(async(y,d)=>{if(Ct=="Android OS"||Ct==="iOS"){let O=await _h(n.current);if(O){const j=await _(O);y(j)}}else{let O=await Ua(n.current);O&&y(O)}}),v=()=>new Promise(async(y,d)=>{const O=await x();y(O)}),_=y=>new Promise((d,O)=>{let j=new Image;j.src=y,j.onload=()=>{let I=document.createElement("canvas");const U=600,b=j.height;let F=j.width,z=j.height;F>z?F>U&&(z*=U/F,F=U):z>b&&(F*=b/z,z=b),I.width=F,I.height=z,I.getContext("2d").drawImage(j,0,0,F,z),d(I.toDataURL())}}),E=async()=>{if(n&&n.current){const y=await v();e.onImageGenerated(y)}},S=y=>{let d=new Array;for(const O in y.menusCollection)O.endsWith("collection")||(y.menusCollection[`${O}_collection`]||y.menusCollection[O])&&d.push(s.jsxs("h5",{className:"left-align-entity level3-bold display-percentage",children:[s.jsx("span",{children:` -- ${O.replace("_"," ")}(${y.menusCollection[O]}):`}),s.jsx("span",{children:ie(y.menusCollection[`${O}_collection`],o)}),s.jsx("span",{children:m(ys(y.salesCollection.totalCollection,y.menusCollection[`${O}_collection`]??0))+"%"})]}));return y.salesCollection.online_aggregator_collection&&d.push(s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:` -- Aggregator(${y.salesCollection.online_aggregator}):`}),s.jsx("span",{children:ie(y.salesCollection.online_aggregator_collection,o)})]}),s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:` -- Zomato(${y.salesCollection.zomato_aggregator??0}):`}),s.jsx("span",{children:ie(y.salesCollection.zomato_aggregator_collection,o)})]}),s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:` -- Swiggy(${y.salesCollection.swiggy_aggregator??0}):`}),s.jsx("span",{children:ie(y.salesCollection.swiggy_aggregator_collection,o)})]})),d},w=y=>{let d=new Array,O=new Object;for(let j=0;j<y.todayCollection.length;j++)O=y.todayCollection[j],d.push(s.jsxs("h5",{className:"left-align-entity level3-bold display-percentage",children:[s.jsx("span",{children:` -- ${O.displayName}:`}),s.jsx("span",{children:ie(O.value,o)}),s.jsx("span",{children:m(ys(y.totalCollection,O.value))+"%"})]}));return d},D=(y,d,O,j,I={})=>{let U=y.includes("upi://");const b=`upi://pay?pa=${y}&pn=${O}&cu=INR&am=${j}&tr=${d}`;return s.jsx(Xa,{value:U?y:b,renderAs:"canvas",size:I.size??250})},$=(y,d)=>{var U,b;let O=0;if((U=d.taxObj)!=null&&U.VAT.length){let F,z,he;for(z=0;z<((b=d.taxObj)==null?void 0:b.VAT.length);z++){F=d.taxObj.VAT[z];for(he in F)O+=ve(F[he])}}const j={sellerName:d.companyInfo.companyName,vatRegistrationNumber:y,invoiceTimestamp:new Date(d.orderInfo.timestamp*1e3).toISOString(),invoiceTotal:d.finalAmount,invoiceVatTotal:O},I=yd(j.sellerName,j.vatRegistrationNumber,j.invoiceTimestamp,j.invoiceTotal,j.invoiceVatTotal.toFixed(2));return s.jsx(Xa,{value:I,renderAs:"canvas",size:250})},P=y=>{const d=[];return(y.totalBalanceAmt||y.refundAmt||y.writeOffAmt||y.rewardAmt||y.cashCard)&&(d.push(s.jsx("hr",{})),y.rewardAmt&&d.push(s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:"REWARDS:"}),s.jsx("span",{children:ie(y.rewardAmt,o)})]})),y.totalBalanceAmt&&d.push(s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:"OUTSTANDING AMOUNT:"}),s.jsx("span",{children:ie(y.totalBalanceAmt,o)})]})),y.writeOffAmt&&d.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:ie(y.writeOffAmt,o)})]})),y.refundAmt&&d.push(s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:"REFUND AMOUNT:"}),s.jsx("span",{children:ie(y.refundAmt,o)})]})),y.cashCard&&d.push(s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:"CASH CARD:"}),s.jsx("span",{children:ie(y.cashCard,o)})]}))),d},Z=(y,d)=>{if(d&&d.length){for(let O=0;O<d.length;O++)if(d[O].slugName===y)return d[O]}return!1},ne=(y,d)=>{if(d&&d.length){for(let O=0;O<d.length;O++)if(d[O].itemType===y)return d[O]}return!1},te=new Object({CREDIT:"Other Income",DEBIT:"Expense"}),le=y=>y.discountType==="COMPLIMENTARY"?"@ COMPLIMENTARY":`@ ${y.discountValue}${Oh[y.discountType]}`,Se=y=>{const d=new Array;if(y&&Object.keys(y).length!==0){d.push(s.jsx("h4",{className:"single-entity-and-center",children:"ACCOUNTS"}));for(const O in y)if(d.push(s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:`Total ${te[O]}:`}),s.jsx("span",{children:ie(y[O].total,o)})]})),O&&Object.keys(O).length!==0)for(const j in y[O])j!=="total"&&y[O][j]&&d.push(s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:` -- ${Ve(j)}:`}),s.jsx("span",{children:ie(y[O][j],o)})]}))}return d},Q=(y,d)=>{let O=!1;y.totalValue&&(O=Object.keys(y.totalValue).length>1);let j=new Object;return s.jsxs(s.Fragment,{children:[y.totalValue&&Object.keys(y.totalValue).map(U=>{if(j=y.totalValue[U],U==="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 ${k[l].dynamicClassname}`,dangerouslySetInnerHTML:{__html:d.item_name}}),s.jsx("h4",{className:`items products-heading-qty ${k[l].dynamicClassname}`,dangerouslySetInnerHTML:{__html:d.qty}}),s.jsx("h4",{className:`items products-heading-rate ${k[l].dynamicClassname}`,dangerouslySetInnerHTML:{__html:d.rate}}),s.jsx("h4",{className:`items products-heading-amt ${k[l].dynamicClassname}`,dangerouslySetInnerHTML:{__html:d.amt}})]}),s.jsx("hr",{})]}),s.jsxs("section",{className:"products-section",style:{paddingTop:"12px"},children:[y.itemList&&y.itemList.length&&y.itemList.length>0&&y.itemList.map(b=>{if(b.taxType===U||!b.taxType)return s.jsxs("div",{style:b.name.startsWith("+ ")?{}:{paddingTop:"12px"},children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsxs("h6",{className:`items products-heading-name ${k[l].dynamicClassname}`,style:{fontWeight:"lighter",lineHeight:1.2},children:[b.status==="RETURNED"?"(R) ":"",b.name.toUpperCase()]}),s.jsxs("h6",{className:`items products-heading-qty ${k[l].dynamicClassname}`,style:{fontWeight:"lighter"},children:[b.status==="RETURNED"?"-":"",b.quantity]}),s.jsx("h6",{className:`items products-heading-rate ${k[l].dynamicClassname}`,style:{fontWeight:"lighter"},children:b.rate?p(b.rate):""}),s.jsx("h6",{className:`items products-heading-amt ${k[l].dynamicClassname}`,style:{fontWeight:"lighter"},children:b.status==="RETURNED"?b.serviceAmount?m(b.serviceAmount):"":b.price?m(b.price):""})]}),b.addons&&b.addons.length&&b.addons.map(F=>s.jsx("h6",{className:`items products-heading-addon-kot ${k[l].dynamicClassname}`,children:"- "+Ve(F.serviceName)})),b.instruction&&y.itemInstructionOnBill&&s.jsx("h6",{className:"left-align-entity level2-bold",children:s.jsx("h6",{className:"items products-heading-addon-kot",children:" ("+b.instruction+")"})})]})}),s.jsx("hr",{})]}),s.jsxs("div",{className:`bottom-section ${k[l].dynamicClassname}`,children:[s.jsxs("div",{className:"bottom-section-div inline-display",style:{paddingTop:"12px"},children:[s.jsx("h5",{className:"total-qty",dangerouslySetInnerHTML:{__html:d.subtotal}}),s.jsx("h5",{className:"actual-qty",children:y.curr+" "+m(j.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"})]}):"",j&&j.cat&&Object.keys(j.cat).length>0?Object.keys(j.cat).map(b=>{const F=Z(b,y.discArr);if(F&&j.cat[b]!==0&&F.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:d[`disc_${F.serviceName.toLowerCase()}`]??"DISC-"+F.serviceName.toUpperCase()}}),s.jsx("span",{children:" @"+F.discountValue+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:y.curr+" "+m(j.cat[b])})]})}):"",y.totalItemDisc&&j&&j.itemTypes&&Object.keys(j.itemTypes).length>0?Object.keys(j.itemTypes).map(b=>{const F=ne(b,y.itemTypeDiscObj);if(F&&j.itemTypes[b]!==0&&F.itemType&&F.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:d[`disc_${F.itemType.toLowerCase()}`]??"DISC-"+F.itemType.toUpperCase()}}),s.jsx("span",{children:" @"+F.value+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:y.curr+" "+m(j.itemTypes[b])})]})}):"",y.segMentDisc&&j&&j.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:d[`segment_disc${y.segMentObj.segmentName.toLowerCase()}`]??y.segMentObj.segmentName.toUpperCase()+"DISC"}}),s.jsx("span",{children:" @"+y.segMentObj.discountValue+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:y.curr+" "+m(j.segDisc)})]}):"",j&&j.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:y.couponCode?d.coupon_disc??"COUPON DISC":d.order_disc??"ORDER DISC"}}),":",s.jsxs("span",{children:[y.couponCode?`(${y.couponCode.toUpperCase()})`:"",m(y.dicsEnterValue)?`@${y.dicsEnterValue}${y.discountType=="RELATIVE"||y.discountType=="COMPLIMENTARY"?"%":"AMT"}`:""]})]})}),s.jsx("h5",{className:"actual-qty",children:y.curr+" "+m(j.orderDisc)})]}):"",i=="25e5f1e4-68ff-43a7-b042-bebb93f42b94"&&j&&j.orderDisc?s.jsxs("div",{className:"bottom-section-div",children:[s.jsxs("h5",{className:"total-qty",children:[" ",y.couponCode?"COUPON DISC":"خصم الطلب",y.couponCode?`(${y.couponCode.toUpperCase()})`:""]}),s.jsx("h5",{className:"actual-qty"})]}):"",j.otherCharges&&j.otherCharges.length>0?j.otherCharges.map(b=>s.jsx(s.Fragment,{children:s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{className:"total-qty",dangerouslySetInnerHTML:{__html:d[`charges_${b.name.toLowerCase()}`]??b.name}}),s.jsx("h5",{className:"actual-qty",children:y.curr+" "+m(b.amt)})]})})):"",j&&j.aftDisc&&j.gstTTL!==j.aftDisc?s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{className:"total-qty",dangerouslySetInnerHTML:{__html:d.amt_before_tax}}),s.jsx("h5",{className:"actual-qty",children:y.curr+" "+m(j.aftDisc)})]}):"",i=="25e5f1e4-68ff-43a7-b042-bebb93f42b94"&&j&&j.aftDisc&&j.gstTTL!==j.aftDisc?s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h5",{className:"total-qty",children:"المبلغ قبل الضريبة"}),s.jsx("h5",{className:"actual-qty"})]}):"",y.taxObj&&y.taxObj[U]&&j?s.jsx(s.Fragment,{children:U==="GST"?y.taxObj[U].map(b=>{let F=new Array;for(const z in b)if(b[z]&&b[z]!=0){let he=z/2;F.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:d.cgst}}),s.jsx("span",{children:" @"+he+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:y.curr+" "+m(b[z]/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:d[y.taxLabel.toLowerCase()]}}),s.jsx("span",{children:" @"+he+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:y.curr+" "+m(b[z]/2)})]})]}))}return F}):y.taxObj[U].map(b=>{let F=new Array;for(const z in b)if(b[z]&&b[z]!=0){let he=z;F.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:d.vat}}),s.jsx("span",{children:" @"+he+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:y.curr+" "+m(b[z])})]})}))}return F})}):"",j.gstTTL!==(j.total||0)+(j.aftDisc||0)+j.taxOnCharges&&s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{className:"total-qty",dangerouslySetInnerHTML:{__html:d.total}}),s.jsx("h5",{className:"actual-qty",children:y.curr+" "+m((j.total||0)+(j.aftDisc||0)+j.taxOnCharges)})]}),i=="25e5f1e4-68ff-43a7-b042-bebb93f42b94"&&j.gstTTL!==(j.total||0)+(j.aftDisc||0)+j.taxOnCharges&&s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h5",{className:"total-qty",children:"المجموع"}),s.jsx("h5",{className:"actual-qty"})]}),y.totalValue&&(Object.keys(y.totalValue).length||0)>1?s.jsx("h4",{className:"single-entity-and-center",style:{marginTop:"10px"},children:"- - - - -"}):"",O&&s.jsx("div",{className:"space-2rem"})]})]})}),y.totalValue&&Object.keys(y.totalValue).map(U=>{if(j=y.totalValue[U],U==="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 ${k[l].dynamicClassname}`,dangerouslySetInnerHTML:{__html:d.item_name}}),s.jsx("h6",{className:`items products-heading-qty ${k[l].dynamicClassname}`,dangerouslySetInnerHTML:{__html:d.qty}}),s.jsx("h6",{className:`items products-heading-rate ${k[l].dynamicClassname}`,dangerouslySetInnerHTML:{__html:d.rate}}),s.jsx("h6",{className:`items products-heading-amt ${k[l].dynamicClassname}`,dangerouslySetInnerHTML:{__html:d.amt}})]}),s.jsx("hr",{})]}),s.jsxs("section",{className:"products-section",style:{paddingTop:"12px"},children:[y.itemList&&y.itemList.length&&y.itemList.length>0&&y.itemList.map(b=>{if(b.taxType===U)return s.jsxs("div",{style:b.name.startsWith("+ ")?{}:{paddingTop:"12px"},children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsxs("h6",{className:`items products-heading-name ${k[l].dynamicClassname}`,children:[b.status==="RETURNED"?"(R) ":"",b.name.toUpperCase()]}),s.jsxs("h6",{className:`items products-heading-qty ${k[l].dynamicClassname}`,children:[b.status==="RETURNED"?"-":"",b.quantity]}),s.jsx("h6",{className:`items products-heading-rate ${k[l].dynamicClassname}`,children:b.rate?p(b.rate):""}),s.jsx("h6",{className:`items products-heading-amt ${k[l].dynamicClassname}`,children:b.status==="RETURNED"?b.serviceAmount?m(b.serviceAmount):"":b.price?m(b.price):""})]}),b.addons&&b.addons.length&&b.addons.map(F=>s.jsx("h6",{className:`items products-heading-addon-kot ${k[l].dynamicClassname}`,children:"- "+Ve(F.serviceName)})),b.instruction&&y.itemInstructionOnBill&&s.jsx("h6",{className:"left-align-entity level2-bold",children:s.jsx("h6",{className:"items products-heading-addon-kot",children:" ("+b.instruction+")"})})]})}),s.jsx("hr",{})]}),s.jsxs("div",{className:`bottom-section ${k[l].dynamicClassname}`,children:[s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{className:"total-qty",dangerouslySetInnerHTML:{__html:d.subtotal}}),s.jsx("h5",{className:"actual-qty",children:y.curr+" "+m(j.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"})]}):"",j&&j.cat&&Object.keys(j.cat).length>0?Object.keys(j.cat).map(b=>{const F=Z(b,y.discArr);if(F&&j.cat[b]!==0&&F.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:d[`disc_${F.serviceName.toLowerCase()}`]??"DISC-"+F.serviceName.toUpperCase()}}),s.jsx("span",{children:" @"+F.discountValue+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:y.curr+" "+m(j.cat[b])})]})}):"",y.totalItemDisc&&j&&j.itemTypes&&Object.keys(j.itemTypes).length>0?Object.keys(j.itemTypes).map(b=>{const F=ne(b,y.itemTypeDiscObj);if(F&&j.itemTypes[b]!==0&&F.itemType&&F.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:d[`disc_${F.itemType.toLowerCase()}`]??"DISC-"+F.itemType.toUpperCase()}}),s.jsx("span",{children:" @"+F.value+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:y.curr+" "+m(j.itemTypes[b])})]})}):"",y.segMentDisc&&j&&j.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:d[`segment_disc${y.segMentObj.segmentName.toLowerCase()}`]??y.segMentObj.segmentName.toUpperCase()+"DISC"}}),s.jsx("span",{children:" @"+y.segMentObj.discountValue+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:y.curr+" "+m(j.segDisc)})]}):"",j&&j.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:y.couponCode?d.coupon_disc??"COUPON DISC":d.order_disc??"ORDER DISC"}}),":",s.jsxs("span",{children:[y.couponCode?`(${y.couponCode.toUpperCase()})`:"",m(y.dicsEnterValue)?`@${y.dicsEnterValue}${y.discountType=="RELATIVE"||y.discountType=="COMPLIMENTARY"?"%":"AMT"}`:""]})]})}),s.jsx("h5",{className:"actual-qty",children:y.curr+" "+m(j.orderDisc)})]}):"",i=="25e5f1e4-68ff-43a7-b042-bebb93f42b94"&&j&&j.orderDisc?s.jsxs("div",{className:"bottom-section-div",children:[s.jsxs("h5",{className:"total-qty",children:[" ",y.couponCode?"COUPON DISC":"خصم الطلب",y.couponCode?`(${y.couponCode.toUpperCase()})`:""]}),s.jsx("h5",{className:"actual-qty"})]}):"",j.otherCharges&&j.otherCharges.length>0?j.otherCharges.map(b=>s.jsx(s.Fragment,{children:s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{className:"total-qty",dangerouslySetInnerHTML:{__html:d[`charges_${b.name.toLowerCase()}`]??b.name}}),s.jsx("h5",{className:"actual-qty",children:y.curr+" "+m(b.amt)})]})})):"",j&&j.aftDisc&&j.vatTTL!==j.aftDisc?s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{className:"total-qty",dangerouslySetInnerHTML:{__html:d.amt_before_tax}}),s.jsx("h5",{className:"actual-qty",children:y.curr+" "+m(j.aftDisc)})]}):"",i=="25e5f1e4-68ff-43a7-b042-bebb93f42b94"&&j&&j.aftDisc&&j.vatTTL!==j.aftDisc?s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h5",{className:"total-qty",children:"المبلغ قبل الضريبة"}),s.jsx("h5",{className:"actual-qty"})]}):"",j.otherCharges&&j.otherCharges.length>0?j.otherCharges.map(b=>s.jsx(s.Fragment,{children:b.taxOnAmount&&b.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:d.cgst}}),s.jsx("span",{children:" @"+b.tax/2+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:y.curr+" "+m(b.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:d[y.taxLabel.toLowerCase()]}}),s.jsx("span",{children:" @"+b.tax/2+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:y.curr+" "+m(b.taxOnAmount/2)})]})]}):""})):"",y.taxObj&&y.taxObj[U]&&j?s.jsx(s.Fragment,{children:U==="GST"?y.taxObj[U].map(b=>{let F=new Array;for(const z in b)if(b[z]&&b[z]!=0){let he=z/2;F.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:d.cgst}}),s.jsx("span",{children:" @"+he+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:y.curr+" "+m(b[z]/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:d[y.taxLabel.toLowerCase()]}}),s.jsx("span",{children:" @"+he+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:y.curr+" "+m(b[z]/2)})]})]}))}return F}):y.taxObj[U].map(b=>{let F=new Array;for(const z in b)if(b[z]&&b[z]!=0){let he=z;F.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:d.vat}}),s.jsx("span",{children:" @"+he+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:y.curr+" "+m(b[z])})]})}))}return F})}):"",j.vatTTL!==(j.total||0)+(j.aftDisc||0)+j.taxOnCharges&&s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{className:"total-qty",dangerouslySetInnerHTML:{__html:d.total}}),s.jsx("h5",{className:"actual-qty",children:y.curr+" "+m((j.total||0)+(j.aftDisc||0)+j.taxOnCharges)})]}),i=="25e5f1e4-68ff-43a7-b042-bebb93f42b94"&&j.vatTTL!==(j.total||0)+(j.aftDisc||0)+j.taxOnCharges&&s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h5",{className:"total-qty",children:"المجموع"}),s.jsx("h5",{className:"actual-qty"})]})]})]})})]})},J=(y,d,{labels:O,doMultipleTax:j,type:I})=>{var b,F,z,he,Ae,He,Le,Oe,De,Ke,yt;const U=y.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 ${k[l].dynamicClassname}`,dangerouslySetInnerHTML:{__html:O.item_name}}),s.jsx("h4",{className:`items products-heading-qty ${k[l].dynamicClassname}`,dangerouslySetInnerHTML:{__html:O.qty}}),s.jsx("h4",{className:`items products-heading-rate ${k[l].dynamicClassname}`,dangerouslySetInnerHTML:{__html:O.rate}}),s.jsx("h4",{className:`items products-heading-amt ${k[l].dynamicClassname}`,dangerouslySetInnerHTML:{__html:O.amt}})]}),s.jsx("hr",{})]}),s.jsxs("section",{className:"products-section",style:{paddingTop:"12px"},children:[y.itemList.map(K=>{var At;return s.jsxs("div",{style:K.serviceName.startsWith("+ ")?{}:{paddingTop:"12px"},children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsxs("h6",{className:`items products-heading-name ${k[l].dynamicClassname}`,style:{lineHeight:1.2},children:[K.status==="RETURNED"?"(R) ":"",K.serviceName.toUpperCase()]}),s.jsxs("h6",{className:`items products-heading-qty ${k[l].dynamicClassname}`,children:[K.status==="RETURNED"?"-":"",K.qty]}),s.jsx("h6",{className:`items products-heading-rate ${k[l].dynamicClassname}`,children:K.serviceRate?p(K.serviceRate):""}),s.jsx("h6",{className:`items products-heading-amt ${k[l].dynamicClassname}`,children:K.sub_total?m(K.sub_total):""})]}),K.hsnCode&&d.printHSNCodeOnBill&&s.jsxs("h6",{className:`items products-heading-name ${k[l].dynamicClassname}`,style:{lineHeight:1.2},children:["HSN: ",K.hsnCode]}),(At=K.addons)!=null&&At.length?K.addons.map(at=>s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h6",{className:`items products-heading-name ${k[l].dynamicClassname}`,style:{lineHeight:1.2},children:"+ "+Ve(at.serviceName)}),s.jsxs("h6",{className:`items products-heading-qty ${k[l].dynamicClassname}`,children:[K.status==="RETURNED"?"-":"",at.qty*K.qty]}),s.jsx("h6",{className:`items products-heading-rate ${k[l].dynamicClassname}`}),s.jsx("h6",{className:`items products-heading-amt ${k[l].dynamicClassname}`})]}),s.jsx("div",{children:at.hsnCode&&d.printHSNCodeOnBill&&s.jsxs("h6",{className:`items products-heading-name ${k[l].dynamicClassname}`,style:{lineHeight:1.2},children:["HSN: ",at.hsnCode]})})]})):"",K.instruction?s.jsx("h6",{className:"left-align-entity level2-bold",children:s.jsx("h6",{className:"items products-heading-addon-kot",children:" ("+K.instruction+")"})}):""]})}),s.jsx("hr",{})]}),s.jsxs("div",{className:`bottom-section ${k[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:O.subtotal}}),s.jsx("h5",{className:"actual-qty",children:d.curr+" "+m(y.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"})]}):""]}),(b=U.DISCOUNT_ITEMS)!=null&&b.length?U.DISCOUNT_ITEMS.map(K=>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:O[`disc_${K.discountName.toLowerCase()}`]??"DISC-"+K.discountName.toUpperCase()}}),s.jsx("span",{children:le(K)})]})}),s.jsx("h5",{className:"actual-qty",children:d.curr+" "+m(K.discountAmt)})]})):"",(F=U.CATEGORY_DISCOUNT)!=null&&F.length?U.CATEGORY_DISCOUNT.map(K=>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:O[`disc_${K.discountName.toLowerCase()}`]??"DISC-"+K.discountName.toUpperCase()}}),s.jsx("span",{children:" @"+K.discountValue+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:d.curr+" "+m(K.discountAmt)})]})):"",(z=U.ITEM_DISCOUNT)!=null&&z.length?U.ITEM_DISCOUNT.map(K=>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:O[`disc_${K.discountName.toLowerCase()}`]??"DISC-"+es(K.discountName).toUpperCase()}}),s.jsx("span",{children:" @"+K.discountValue+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:d.curr+" "+m(K.discountAmt)})]})):"",(Ae=(he=U.SEGMENT_DISCOUNT)==null?void 0:he[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:O[`segment_disc${U.SEGMENT_DISCOUNT[0].discountName.toLowerCase()}`]??"DISC-"+U.SEGMENT_DISCOUNT[0].discountName.toUpperCase()}}),":",s.jsx("span",{children:" @"+U.SEGMENT_DISCOUNT[0].discountValue+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:d.curr+" "+m(U.SEGMENT_DISCOUNT[0].discountAmt)})]}):"",(Le=(He=U.COUPON_DISCOUNT)==null?void 0:He[0])!=null&&Le.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:`(${U.COUPON_DISCOUNT[0].discountName.toUpperCase()}) @${U.COUPON_DISCOUNT[0].discountValue}${U.COUPON_DISCOUNT[0].discountType=="RELATIVE"?"%":"AMT"}`})]})}),s.jsx("h5",{className:"actual-qty",children:d.curr+" "+m(U.COUPON_DISCOUNT[0].discountAmt)})]}):"",(De=(Oe=U.ORDER_DISCOUNT)==null?void 0:Oe[0])!=null&&De.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:O.order_disc??"ORDER DISC"}}),":",s.jsx("span",{children:m(U.ORDER_DISCOUNT[0].discountValue)?`@${U.ORDER_DISCOUNT[0].discountValue}${U.ORDER_DISCOUNT[0].discountType=="RELATIVE"||U.ORDER_DISCOUNT[0].discountType=="COMPLIMENTARY"?"%":"AMT"}`:""})]})}),s.jsx("h5",{className:"actual-qty",children:d.curr+" "+m(U.ORDER_DISCOUNT[0].discountAmt)})]}):"",i=="25e5f1e4-68ff-43a7-b042-bebb93f42b94"&&y&&y.orderDisc?s.jsxs("div",{className:`bottom-section-div ${_e}`,children:[s.jsxs("h5",{className:"total-qty",children:[" ",d.couponCode?"COUPON DISC":"خصم الطلب",d.couponCode?`(${d.couponCode.toUpperCase()})`:""]}),s.jsx("h5",{className:"actual-qty"})]}):"",(Ke=y.charges)!=null&&Ke.length?y.charges.map(K=>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:O[`charges_${K.name.toLowerCase()}`]??K.name}})}),d.invoiceType=="INCLUSIVE_SIMPLIFIED"?s.jsx("h5",{className:"actual-qty",children:d.curr+" "+m(K.amt+K.taxAmt)}):s.jsx("h5",{className:"actual-qty",children:d.curr+" "+m(K.amt)})]})})):"",y.subTotal!==y.afterCharges&&y.afterCharges!==y.total&&d.invoiceType!=="INCLUSIVE_SIMPLIFIED"?s.jsxs("div",{className:`bottom-section-div inline-display ${_e}`,children:[s.jsx("h5",{className:"total-qty",dangerouslySetInnerHTML:{__html:O.amt_before_tax}}),s.jsx("h5",{className:"actual-qty",children:d.curr+" "+m(y.afterCharges)})]}):"",i=="25e5f1e4-68ff-43a7-b042-bebb93f42b94"&&y.subTotal!==y.afterCharges?s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h5",{className:"total-qty",children:"المبلغ قبل الضريبة"}),s.jsx("h5",{className:"actual-qty"})]}):"",d.invoiceType!=="INCLUSIVE_SIMPLIFIED"&&((yt=y.taxation)!=null&&yt.length)?y.taxation.map(K=>{if(K.taxAmt)return K.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:O.cgst}}),s.jsx("span",{children:"@"+K.tax/2+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:d.curr+" "+m(K.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:O[d.taxLabel.toLowerCase()]}}),s.jsx("span",{children:"@"+K.tax/2+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:d.curr+" "+m(K.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:O.vat}}),s.jsx("span",{children:"@"+K.tax+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:d.curr+" "+m(K.taxAmt)})]})}):"",s.jsxs("div",{className:`bottom-section-div inline-display ${_e}`,children:[s.jsx("h5",{className:"total-qty",dangerouslySetInnerHTML:{__html:O.total}}),s.jsx("h5",{className:"actual-qty",children:d.curr+" "+m(y.total)})]}),j?s.jsx(s.Fragment,{children:I==="GST"?s.jsxs(s.Fragment,{children:[s.jsx("h4",{className:"single-entity-and-center",style:{marginTop:"10px"},children:"- - - - -"}),s.jsx("div",{className:"space-2rem"})]}):""}):""]})},G=(y,d)=>{var U,b;let O=!1;const j=y.distributedData;return y.distributedData&&(O=Object.keys(y.distributedData).length>1),s.jsxs(s.Fragment,{children:[((U=j.GST)==null?void 0:U.itemList)&&J(j.GST,y,{labels:d,doMultipleTax:O,type:"GST"}),((b=j.VAT)==null?void 0:b.itemList)&&J(j.VAT,y,{labels:d,doMultipleTax:O,type:"VAT"})]})},de=y=>{const d=y.services,O=Object.keys(y.services),j=O.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:k[l].itemName}),s.jsx("h5",{className:"items products-heading-qty-kot",children:"QTY"})]}),s.jsx("hr",{})]}),s.jsxs("section",{className:"products-section",children:[j&&O.map((U,b)=>s.jsxs(s.Fragment,{children:[s.jsx("h4",{className:"left-align-entity level3-bold",children:s.jsxs("u",{children:[U.toUpperCase(),":"]})}),d[U].map(F=>{var z;return s.jsxs("div",{children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h4",{className:`items products-heading-name-kot ${k[l].dynamicClassname}`,children:Ve(F.serviceName)}),s.jsx("h4",{className:`items products-heading-qty-kot ${k[l].dynamicClassname}`,children:F.qty})]}),((z=F.addons)==null?void 0:z.length)&&F.addons.map(he=>{var Ae;return s.jsx("h5",{className:"items products-heading-addon-kot",children:"- "+((Ae=he.serviceName)==null?void 0:Ae.toUpperCase())})}),F.instruction&&s.jsx("h5",{className:"left-align-entity",children:s.jsx("h5",{className:"items products-heading-addon-kot",children:" ("+F.instruction+")"})})]})}),j!==b+1&&s.jsx("br",{})]})),s.jsx("hr",{})]})]})},W=y=>{const d=y.slice(0,-4),O=y.slice(-4);return{firstDigits:d,last4Dgits:O}},X=(y,d,O,j={})=>{const I=Object.keys(d??{});let U=[],b,F="flex-two-items";if(j.action==="addCharges"&&(F="display-percentage"),y&&I.length){U.push(s.jsxs(s.Fragment,{children:[s.jsx("h4",{className:"single-entity-and-center",children:`${O.toUpperCase()} BREAK-UP`}),s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsxs("span",{children:["Total ",O,":"]}),s.jsx("span",{children:ie(y,o)})]})]}));for(let z=0;z<I.length;z++)b=I[z],d[b]&&U.push(s.jsxs("h5",{className:`left-align-entity level3-bold ${F} second-span-right`,children:[s.jsx("span",{children:` -- ${b.replaceAll("_"," ")}:`}),s.jsx("span",{children:ie(d[b],o)}),j.action==="addCharges"?s.jsx("span",{children:m(ys(y,d[b]))+"%"}):""]}));U.push(s.jsx("hr",{}))}return U},st=y=>{const d=Object.keys(y.Category),O=Object.keys(y.Addon);let j=new Array;return j.push(s.jsxs(s.Fragment,{children:[s.jsx("h3",{className:"left-align-entity level3-bold",children:"Product Category"}),s.jsx("hr",{className:"dashed"})]})),d.forEach((I,U)=>{const b=y.Category[I];let F=[];j.push(s.jsxs(s.Fragment,{children:[s.jsxs("h4",{className:"left-align-entity level3-bold",children:[" - "," ",es(I)]}),s.jsxs("section",{className:"products-section",children:[b.forEach(z=>{F.push(s.jsx(s.Fragment,{children:s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h6",{className:`items products-heading-name-kot ${k["3INCH"].dynamicClassname}`,children:z.serviceName}),s.jsx("h6",{className:`items products-heading-qty-kot ${k["3INCH"].dynamicClassname}`,children:parseFloat(z.qty.toFixed(2))})]})}))}),F,U!=d.length-1&&s.jsx("hr",{})]})]}))}),O.length>0&&(j.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"})]})),O.forEach((I,U)=>{const b=y.Addon[I];let F=[];j.push(s.jsxs(s.Fragment,{children:[s.jsxs("h4",{className:"left-align-entity level3-bold",children:[" - "," ",es(I)]}),s.jsxs("section",{className:"products-section",children:[b.forEach(z=>{F.push(s.jsx(s.Fragment,{children:s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h6",{className:`items products-heading-name-kot ${k["3INCH"].dynamicClassname}`,children:z.serviceName}),s.jsx("h6",{className:`items products-heading-qty-kot ${k["3INCH"].dynamicClassname}`,children:parseFloat(z.qty.toFixed(2))})]})}))}),F,U!=O.length-1&&s.jsx("hr",{className:"dashed"})]})]}))})),j},nt=y=>{var O;const d={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((O=y==null?void 0:y.customBillLabels)!=null&&O.length){let j;for(let I=0;I<y.customBillLabels.length;I++)j=y.customBillLabels[I],d[j.defaultName]=j.displayName}return d},Ot=(y,d,O,j)=>{var z,he,Ae,He,Le,Oe,De,Ke,yt,K,At,at,gs,xs,an,Ns,js,ln,on,cn,dn,hn,un,mn,qt,vs,gt,Kt,Qt,_s,fn,bs,pn,Ss,Ts,yn,gn,ws,Is,xn,Nn,jn,vn,g,M;const I=nt(r.customLabelsMap),U=us(xd(r.paymentModes),"internalName"),b=C=>{var N;return(N=U[C])!=null&&N.displayName?U[C].displayName.toUpperCase():C};if(y==="BILL"){let C;if(l==="A4"||l==="A5"){let N={...d},Y=0,V=N.distributedData;const R=V.discounts;C=s.jsx("div",{className:`invoiceContainer main-div ${k[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:[N.companyInfo.companyName,":"]})})})}),s.jsxs("tr",{className:"subtotalTr",children:[s.jsxs("td",{width:"50%",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:`${I.order_no}:`},className:"font-weight-bold"}),s.jsx("span",{children:N.orderId})]}),s.jsxs("td",{width:"50%",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:`${I.date}:`},className:"font-weight-bold"}),s.jsx("span",{children:N.orderInfo.orderDate})]})]})]}),s.jsx("td",{colSpan:3,className:"text-right",children:s.jsx("div",{className:"d-flex justify-content-center",children:O&&s.jsx("img",{src:O,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:[(N.customerInfo.custName||((z=N.customFields)==null?void 0:z.length))&&s.jsx("tr",{children:s.jsx("td",{colSpan:"2",className:"text-center border-right",children:s.jsx("strong",{children:"Bill To"})})}),N.customerInfo.custName&&N.customerInfo.custName!==""&&s.jsx("tr",{children:s.jsx("td",{width:"10%",children:N.customerInfo.custName})}),N.customerInfo.custContact&&N.customerInfo.custContact!==""&&s.jsx("tr",{children:s.jsx("td",{width:"10%",children:N.customerInfo.custContact})}),N.customerInfo.custAddress&&N.customerInfo.custAddress!==""&&s.jsx("tr",{children:s.jsx("td",{width:"10%",children:N.customerInfo.custAddress})}),N.deliveryTimestamp&&s.jsx("tr",{children:s.jsx("td",{width:"10%",children:N.deliveryTimestamp})}),(he=N.customFields)!=null&&he.length?N.customFields.map(T=>s.jsx("tr",{children:s.jsxs("td",{width:"10%",children:[T.customName,": ",T.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:N.companyInfo.companyName})}),N.companyInfo.companyAddress&&N.companyInfo.companyAddress!==""&&s.jsx("tr",{children:s.jsx("td",{width:"10%",children:N.companyInfo.companyAddress})}),N.companyInfo.companyEmail&&N.companyInfo.companyEmail!==""&&s.jsx("tr",{children:s.jsx("td",{width:"10%",children:N.companyInfo.companyEmail})}),N.companyInfo.companyContact&&N.companyInfo.companyContact!==""&&s.jsx("tr",{children:s.jsx("td",{width:"10%",children:N.companyInfo.companyContact})}),N.fssai&&N.fssai!==""&&s.jsx("tr",{children:s.jsxs("td",{width:"10%",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:`${I.company_FSSAI}:`}}),s.jsx("span",{children:N.fssai})]})}),N.gst&&N.gst!==""&&s.jsx("tr",{children:s.jsxs("td",{width:"10%",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:`${I.company_GST}:`}}),s.jsx("span",{children:N.gst})]})}),N.vatNo&&N.vatNo!==""&&s.jsx("tr",{children:s.jsxs("td",{width:"10%",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:`${I.company_VAT}:`}}),s.jsx("span",{children:N.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:[N.itemList.map(T=>{var Ne;let ge="",pe=[];return Y++,pe.push(s.jsxs(s.Fragment,{children:[s.jsxs("tr",{style:{lineHeight:"10px"},className:ge,children:[s.jsx("td",{className:"text-align-left",children:T.serviceRate?Y:""}),s.jsx("td",{style:{width:"40%"},className:"text-align-left",children:T.serviceName.toUpperCase()}),s.jsx("td",{className:"text-align-left",children:T.qty}),s.jsx("td",{className:"text-align-right",children:T.serviceRate?B(T.serviceRate,o):""}),s.jsx("td",{className:"text-align-right",children:T.sub_total?B(T.sub_total,o):""})]}),T.instruction&&s.jsxs("tr",{children:[s.jsx("td",{}),s.jsx("td",{style:{width:"40%"},children:"("+T.instruction+")"})]})]})),(Ne=T.addons)!=null&&Ne.length&&T.addons.map(we=>{pe.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:["+ ",we.serviceName.toUpperCase()]}),s.jsx("td",{children:we.qty*T.qty})]}),we.instruction&&s.jsxs("tr",{children:[s.jsx("td",{}),s.jsx("td",{style:{width:"40%"},children:"("+we.instruction+")"})]})]}))}),pe}),s.jsx("tr",{style:{lineHeight:"10px",fontSize:"14px"},children:s.jsx("td",{colSpan:5,children:s.jsx("strong",{className:"font-weight-bold",children:`Total ${Y} Items and ${ve(V.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(Me(N.finalAmount,o).toFixed(Bt[o].minimumFractionDigits??2))]})}),s.jsx("hr",{}),N.upiId&&d.companyInfo.companyName&&d.paymentStatus!=="PAID"&&(!d.splitDetails||((Ae=d.splitDetails)==null?void 0:Ae.length)==0)(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:D(d.upiId,d.orderId,d.companyInfo.companyName,d.paidAmt,{size:100})})})})]})),N.footerMessage?s.jsx("tr",{children:s.jsx("td",{colSpan:"2",children:s.jsx("div",{className:"single-entity-and-center",dangerouslySetInnerHTML:{__html:N.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:I.subtotal}})})}),s.jsx("td",{width:"50%",className:"text-align-right",children:B(V.subTotal,o)})]}),(He=R==null?void 0:R.DISCOUNT_ITEMS)!=null&&He.length?R.DISCOUNT_ITEMS.map(T=>s.jsxs("tr",{className:"subtotalTr",children:[s.jsxs("td",{width:"50%",children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:I[`disc_${T.discountName.toLowerCase()}`]??"DISC-"+T.discountName.toUpperCase()}}),s.jsx("span",{children:le(T)})]}),s.jsx("td",{className:"text-align-right",width:"50%",children:B(T.discountAmt,o)})]})):"",(Le=R==null?void 0:R.CATEGORY_DISCOUNT)!=null&&Le.length?R.CATEGORY_DISCOUNT.map(T=>s.jsxs("tr",{className:"subtotalTr",children:[s.jsxs("td",{width:"50%",children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:I[`disc_${T.discountName.toLowerCase()}`]??"DISC-"+T.discountName.toUpperCase()}}),s.jsx("span",{children:" @"+T.discountValue+"%"})]}),s.jsx("td",{className:"text-align-right",width:"50%",children:B(T.discountAmt,o)})]})):"",(Oe=R==null?void 0:R.ITEM_DISCOUNT)!=null&&Oe.length?R.ITEM_DISCOUNT.map(T=>s.jsxs("tr",{className:"subtotalTr",children:[s.jsxs("td",{width:"50%",children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:I[`disc_${T.discountName.toLowerCase()}`]??"DISC-"+T.discountName.toUpperCase()}}),s.jsx("span",{children:" @"+T.discountValue+"%"})]}),s.jsx("td",{className:"text-align-right",width:"50%",children:B(T.discountAmt,o)})]})):"",(Ke=(De=R==null?void 0:R.SEGMENT_DISCOUNT)==null?void 0:De[0])!=null&&Ke.discountAmt?s.jsxs("tr",{className:"subtotalTr",children:[s.jsxs("td",{width:"50%",children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:I[`segment_disc${R.SEGMENT_DISCOUNT[0].discountName.toLowerCase()}`]??"DISC-"+R.SEGMENT_DISCOUNT[0].discountName.toUpperCase()}}),s.jsx("span",{children:" @"+R.SEGMENT_DISCOUNT[0].discountValue+"%"})]}),s.jsx("td",{className:"text-align-right",width:"50%",children:B(R.SEGMENT_DISCOUNT[0].discountAmt,o)})]}):"",(K=(yt=R==null?void 0:R.COUPON_DISCOUNT)==null?void 0:yt[0])!=null&&K.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:`(${R.COUPON_DISCOUNT[0].discountName.toUpperCase()}) @${R.COUPON_DISCOUNT[0].discountValue}${R.COUPON_DISCOUNT[0].discountType=="RELATIVE"?"%":"AMT"}`})]}),s.jsx("td",{className:"text-align-right",width:"50%",children:B(R.COUPON_DISCOUNT[0].discountAmt,o)})]}):"",(at=(At=R==null?void 0:R.ORDER_DISCOUNT)==null?void 0:At[0])!=null&&at.discountAmt?s.jsxs("tr",{className:"subtotalTr",children:[s.jsxs("td",{width:"50%",children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:I.order_disc??"ORDER DISC"}}),s.jsx("span",{children:m(R.ORDER_DISCOUNT[0].discountValue)?`@${R.ORDER_DISCOUNT[0].discountValue}${R.ORDER_DISCOUNT[0].discountType=="RELATIVE"||R.ORDER_DISCOUNT[0].discountType=="COMPLIMENTARY"?"%":"AMT"}`:""})]}),s.jsx("td",{className:"text-align-right",width:"50%",children:B(R.ORDER_DISCOUNT[0].discountAmt,o)})]}):"",(gs=V.charges)!=null&&gs.length?V.charges.map(T=>s.jsxs("tr",{className:"subtotalTr",children:[s.jsx("td",{width:"50%",children:s.jsx("span",{dangerouslySetInnerHTML:{__html:I[`charges_${T.name.toLowerCase()}`]??T.name}})}),s.jsx("td",{className:"text-align-right",width:"50%",children:B(T.amt,o)})]})):"",V.subTotal!==V.afterCharges?s.jsxs("tr",{className:"subtotalTr",children:[s.jsx("td",{width:"50%",children:s.jsx("span",{dangerouslySetInnerHTML:{__html:I.amt_before_tax}})}),s.jsx("td",{className:"text-align-right",width:"50%",children:B(V.afterCharges,o)})]}):"",(xs=V.taxation)!=null&&xs.length?V.taxation.map(T=>T.taxType==="GST"?s.jsxs(s.Fragment,{children:[s.jsxs("tr",{className:"subtotalTr",children:[s.jsxs("td",{width:"50%",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.cgst}}),s.jsx("span",{children:" @"+T.tax/2+"%"})]}),s.jsx("td",{className:"text-align-right",width:"50%",children:B(T.taxAmt/2,o)})]}),s.jsxs("tr",{className:"subtotalTr",children:[s.jsxs("td",{width:"50%",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.sgst}}),s.jsx("span",{children:" @"+T.tax/2+"%"})]}),s.jsx("td",{className:"text-align-right",width:"50%",children:B(T.taxAmt/2,o)})]})]}):s.jsxs("tr",{className:"subtotalTr",children:[s.jsxs("td",{width:"50%",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.vat}}),s.jsx("span",{children:" @"+T.tax+"%"})]}),s.jsx("td",{className:"text-align-right",width:"50%",children:B(T.taxAmt,o)})]})):"",s.jsxs("tr",{className:"font-weight-bold subtotalTr",children:[s.jsx("td",{width:"50%",children:s.jsx("strong",{dangerouslySetInnerHTML:{__html:I.grand_total}})}),s.jsx("td",{className:"text-align-right",width:"50%",children:B(N.finalAmount,o)})]}),(an=d==null?void 0:d.custoutStandingData)!=null&&an.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:I.previous_outstanding}})}),s.jsx("td",{className:"text-align-right",width:"50%",children:B((Ns=N==null?void 0:N.custoutStandingData)==null?void 0:Ns.balanceAmt,o)})]}),s.jsxs("tr",{className:"font-weight-bold subtotalTr",children:[s.jsx("td",{width:"50%",children:s.jsx("strong",{dangerouslySetInnerHTML:{__html:I.total_payable}})}),s.jsx("td",{className:"text-align-right",width:"50%",children:B(N.grandTotal+((js=N==null?void 0:N.custoutStandingData)==null?void 0:js.balanceAmt),o)})]})]}):"",N.rewardAmt?s.jsxs("tr",{className:"subtotalTr",children:[s.jsx("td",{width:"50%",children:s.jsx("span",{dangerouslySetInnerHTML:{__html:I.rewards_redeemed}})}),s.jsx("td",{className:"text-align-right",width:"50%",children:B(N.rewardAmt,o)})]}):"",(ln=d.paymentMethods)!=null&&ln.length?d.paymentMethods.map(T=>{var ge;if(T.paidAmt)return s.jsxs("tr",{className:"subtotalTr",children:[s.jsxs("td",{width:"50%",children:["-"," ",s.jsx("span",{dangerouslySetInnerHTML:{__html:I[`${(ge=T.paymentMode)==null?void 0:ge.toLowerCase()}`]??b(T.paymentMode)??"CASH"}}),s.jsx("span",{children:T.isRefund?"(Refund)":""})]}),T.isRefund?s.jsx("td",{className:"text-align-right",width:"50%",children:"("+B(T.paidAmt,o)+")"}):s.jsx("td",{className:"text-align-right",width:"50%",children:B(T.paidAmt,o)})]})}):"",N.balanceAmt&&d.balanceAmt!=0?s.jsxs("tr",{className:"subtotalTr",children:[s.jsx("td",{width:"50%",children:s.jsx("span",{dangerouslySetInnerHTML:{__html:I.balance_amt}})}),s.jsx("td",{className:"text-align-right",width:"50%",children:B(d.balanceAmt,o)})]}):"",d.balPoint&&!Number.isNaN(d.balPoint)?s.jsxs("tr",{className:"subtotalTr",children:[s.jsx("td",{width:"50%",children:s.jsx("span",{dangerouslySetInnerHTML:{__html:I.reward_point_balance}})}),s.jsx("td",{className:"text-align-right",width:"50%",children:d.balPoint})]}):"",(on=d.splitDetails)!=null&&on.length?s.jsxs(s.Fragment,{children:[s.jsx("div",{style:{marginTop:"6px"},children:s.jsx("h7",{className:"level2-bold",children:"Split Bill by Guest Details:"})}),d.splitDetails.map(T=>s.jsxs("tr",{className:"subtotalTr",children:[s.jsx("td",{width:"50%",children:s.jsx("span",{dangerouslySetInnerHTML:{__html:T.name}})}),s.jsx("td",{className:"text-align-right",width:"50%",children:d.curr+" "+T.amount})]}))]}):"",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 :${N.printby} Printed On: ${N.printTime}`}),N.disabledPoweredBy?"":s.jsx("p",{className:"single-entity-and-center f-12 mt-2 avoid-page-break",children:"Powered By: www.recaho.com"})]})})}else C=s.jsx("div",{className:"main-div bill",style:{width:k[l].paperSize},children:s.jsxs("div",{style:{width:"100%",textAlign:"left",marginLeft:"auto"},children:[d.duplicateBill?s.jsx("h4",{className:"single-entity-and-center",children:"DUPLICATE BILL"}):"",s.jsx("br",{}),O&&s.jsx("div",{className:"image-bill",children:s.jsx("img",{src:O,className:"single-entity-and-center",style:{width:k[l].logoWidth}})}),s.jsxs("div",{className:`details-section ${k[l].dynamicClassname}`,children:[!O&&d.companyInfo.companyName&&d.companyInfo.companyName!=""&&s.jsx("h1",{className:"single-entity-and-center",children:d.companyInfo.companyName}),d.companyInfo.companyAddress&&d.companyInfo.companyAddress!==""&&s.jsx("h3",{className:"single-entity-and-center",dangerouslySetInnerHTML:{__html:d.companyInfo.companyAddress}}),d.companyInfo.companyContact&&d.companyInfo.companyContact!==""&&s.jsx("h3",{className:"single-entity-and-center",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.company_mobile}}),": ",s.jsx("span",{children:d.companyInfo.companyContact})]})}),d.companyInfo.companyEmail&&d.companyInfo.companyEmail!==""&&s.jsx("h3",{className:"single-entity-and-center",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.company_Email}}),": ",s.jsx("span",{children:d.companyInfo.companyEmail})]})}),d.fssai&&d.fssai!==""&&s.jsx("h3",{className:"single-entity-and-center",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.company_FSSAI}}),": ",s.jsx("span",{children:d.fssai})]})}),d.gst&&d.gst!==""&&s.jsx("h3",{className:"single-entity-and-center",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.company_GST}}),": ",s.jsx("span",{children:d.gst})]})}),d.vatNo&&d.vatNo!==""&&s.jsx("h3",{className:"single-entity-and-center",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.company_VAT}}),": ",s.jsx("span",{children:d.vatNo})]})}),s.jsx("hr",{}),d.orderFrom&&s.jsx("h2",{className:"single-entity-and-center level2-bold",children:d.orderFrom}),d.area&&s.jsxs("h3",{className:"single-entity-and-center level2-bold",children:[d.area," : ",d.tableName?d.tableName:d.tableNo]}),d.tokenId&&s.jsx("h2",{className:"single-entity-and-center level2-bold",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.token_no}})," ",s.jsx("span",{children:d.tokenId})]})}),d.parentOrderRef&&s.jsx("h4",{className:"single-entity-and-center",children:"RETURN/EXCHANGE"})]}),s.jsx("hr",{}),s.jsxs("div",{className:`details-section ${k[l].dynamicClassname} ${_e}`,children:[d.customerInfo.custName&&d.customerInfo.custName!==""&&s.jsx("h5",{className:"left-align-entity",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.name}}),": ",s.jsx("span",{children:d.customerInfo.custName})]})}),d.customerInfo.custContact&&d.customerInfo.custContact!==""&&s.jsx("h5",{className:"left-align-entity",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.mobile}}),": ",s.jsx("span",{children:d.customerInfo.custContact})]})}),d.customerInfo.custAddress&&d.customerInfo.custAddress!==""&&s.jsx("h5",{className:"left-align-entity",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.address}}),": ",s.jsx("span",{children:d.customerInfo.custAddress})]})}),vt(d.appliedDiscounts??[],"COMPLIMENTARY","discountType").discountType&&s.jsx("h5",{className:"left-align-entity level2-bold",dangerouslySetInnerHTML:{__html:I.complementary_disc}}),d.orderId&&s.jsx("h5",{className:"left-align-entity",style:{flexShrink:0},children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.order_no}}),": ",s.jsx("span",{children:d.orderId})]})}),d.orderInfo.orderDate&&s.jsx("h5",{className:"left-align-entity",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.date}}),":",s.jsx("span",{children:d.orderInfo.orderDate})]})}),d.deliveryTimestamp&&s.jsx("h5",{className:"left-align-entity",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.delivery_date}}),":",s.jsx("span",{children:d.deliveryTimestamp})]})}),d.captainName&&s.jsx("h5",{className:"left-align-entity",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.captain_name}}),":",s.jsx("span",{children:d.captainName})]})})]}),(cn=d.customFields)!=null&&cn.length?s.jsxs("div",{className:`details-section ${k[l].dynamicClassname}`,children:[s.jsx("hr",{}),d.customFields.map(N=>s.jsx("h4",{className:"left-align-entity",children:N.customName+": "+N.customValue}))]}):"",d.newFormat?G(d,I):Q(d,I),s.jsx("br",{}),s.jsxs("div",{className:`bottom-section ${k[l].dynamicClassname}`,children:[s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h6",{className:`total-qty ${(dn=d.custoutStandingData)!=null&&dn.balanceAmt||d.rewardAmt&&d.paymentMethods&&d.paymentMethods.length>0?"level3-bold":"level2-bold"}`,style:{fontSize:l==="2INCH"||l==="1.8INCH"?"1.50rem":"1.75rem"},dangerouslySetInnerHTML:{__html:I.grand_total}}),s.jsx("h6",{className:`actual-qty ${(hn=d.custoutStandingData)!=null&&hn.balanceAmt||d.rewardAmt&&d.paymentMethods&&d.paymentMethods.length>0?"level3-bold":"level2-bold"}`,style:{fontSize:l==="2INCH"||l==="1.8INCH"?"1.40rem":"1.75rem"},children:d.curr+" "+m(d.finalAmount)})]}),(un=d.custoutStandingData)!=null&&un.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:I.previous_outstanding}})}),s.jsx("h5",{children:d.curr+" "+m(d.custoutStandingData.balanceAmt)})]}),!d.rewardAmt&&!d.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:I.total_payable}}),s.jsx("h6",{className:"actual-qty level2-bold",style:{fontSize:l==="2INCH"||l==="1.8INCH"?"1.40rem":"1.75rem"},children:d.curr+" "+m(d.finalAmount+d.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"}})]}):"",d.rewardAmt?s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsxs("h5",{children:["- ",s.jsx("span",{dangerouslySetInnerHTML:{__html:I.rewards_redeemed}}),s.jsx("span",{children:"("+d.usedPoints+" Points)"})]}),s.jsx("h5",{children:d.curr+" "+d.rewardAmt})]}):"",d.paymentMethods&&d.paymentMethods.length?d.paymentMethods.map(N=>{var Y;if(N.paidAmt)return s.jsxs("div",{className:`bottom-section-div inline-display ${_e}`,children:[s.jsxs("h5",{children:["-",s.jsx("span",{dangerouslySetInnerHTML:{__html:I[`${(Y=N.paymentMode)==null?void 0:Y.toLowerCase()}`]??b(N.paymentMode)??"CASH"}}),s.jsx("span",{children:N.isRefund?"(Refund)":""})]}),s.jsx("h5",{children:N.isRefund?s.jsx(s.Fragment,{children:d.curr+" ("+m(N.paidAmt)+")"}):s.jsx(s.Fragment,{children:d.curr+" "+m(N.paidAmt)})})]})}):"",d.rewardAmt&&!d.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:I.total_payable}}),s.jsx("h6",{className:"actual-qty level2-bold",style:{fontSize:l==="2INCH"||l==="1.8INCH"?"1.40rem":"1.75rem"},children:d.curr+" "+m(d.finalAmount+(((mn=d==null?void 0:d.custoutStandingData)==null?void 0:mn.balanceAmt)||0)-d.rewardAmt)})]})}):"",Ch((qt=d.convertedCurrValue)==null?void 0:qt.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:`(${B(d.convertedCurrValue.value,d.convertedCurrValue.curr)})`})]}):"",d.balanceAmt&&d.balanceAmt!=0?s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{dangerouslySetInnerHTML:{__html:I.balance_amt}}),s.jsx("h5",{children:d.curr+" "+m(d.balanceAmt)})]}):"",s.jsx("hr",{})]}),d.earnPoints&&d.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:d.earnPoints})]}):"",(d.balPoint||d.earnPoints)&&!Number.isNaN(d.balPoint||d.earnPoints)?s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h6",{className:"total-qty line-gaps",dangerouslySetInnerHTML:{__html:I.reward_point_balance}}),s.jsx("h6",{className:"actual-qty",children:d.balPoint+d.earnPoints||0})]}):"",(vs=d.splitDetails)!=null&&vs.length?s.jsxs(s.Fragment,{children:[s.jsx("div",{style:{marginTop:"6px"},children:s.jsx("h5",{className:"level2-bold",children:"Split Bill by Guest Details:"})}),d.splitDetails.map(N=>s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{className:"total-qty line-gaps level3-bold",dangerouslySetInnerHTML:{__html:N.name}}),s.jsx("h5",{className:"actual-qty level3-bold",children:d.curr+" "+N.amount})]}))]}):"",d.invoiceType==="INCLUSIVE_SIMPLIFIED"&&((gt=d.taxation)!=null&>.length)?s.jsxs("div",{children:[s.jsx("div",{className:"single-entity-and-center",style:{marginTop:"6px"},children:s.jsx("h6",{className:"level2-bold",children:"Tax Summary"})}),s.jsx("div",{className:"single-entity-and-center",style:{marginTop:"6px"},children:s.jsxs("table",{border:"1",style:{textAlign:"center",margin:"0 auto",marginBottom:"6px",width:"100%"},children:[s.jsxs("tr",{className:k[l].dynamicClassname,children:[s.jsx("th",{children:"Tax Name"}),s.jsx("th",{children:"Taxable Amt"}),s.jsx("th",{children:"Tax Amt"})]}),d.taxation.map(N=>{if(N.taxAmt)return Ct==="Android OS"||Ct==="iOS"?N.taxType==="GST"?s.jsxs(s.Fragment,{children:[s.jsxs("tr",{className:k[l].dynamicClassname,children:[s.jsx("th",{dangerouslySetInnerHTML:{__html:`${I.cgst} ${N.tax/2}%`}}),s.jsx("th",{children:d.curr+" "+Me(N.taxableAmt,o)}),s.jsx("th",{children:d.curr+" "+Me(N.taxAmt/2,o)})]}),s.jsxs("tr",{className:k[l].dynamicClassname,children:[s.jsx("th",{dangerouslySetInnerHTML:{__html:`${I[d.taxLabel.toLowerCase()]} ${N.tax/2}%`}}),s.jsx("th",{children:d.curr+" "+Me(N.taxableAmt,o)}),s.jsx("th",{children:d.curr+" "+Me(N.taxAmt/2,o)})]})]}):s.jsxs("tr",{className:k[l].dynamicClassname,children:[s.jsx("th",{dangerouslySetInnerHTML:{__html:`${I.vat} ${N.tax}%`}}),s.jsx("th",{children:d.curr+" "+Me(N.taxableAmt,o)}),s.jsx("th",{children:d.curr+" "+Me(N.taxAmt,o)})]}):N.taxType==="GST"?s.jsxs(s.Fragment,{children:[s.jsxs("tr",{className:k[l].dynamicClassname,children:[s.jsx("td",{dangerouslySetInnerHTML:{__html:`${I.cgst} ${N.tax/2}%`}}),s.jsx("td",{children:d.curr+" "+Me(N.taxableAmt,o)}),s.jsx("td",{children:d.curr+" "+Me(N.taxAmt/2,o)})]}),s.jsxs("tr",{className:k[l].dynamicClassname,children:[s.jsx("td",{dangerouslySetInnerHTML:{__html:`${I[d.taxLabel.toLowerCase()]} ${N.tax/2}%`}}),s.jsx("td",{children:d.curr+" "+Me(N.taxableAmt,o)}),s.jsx("td",{children:d.curr+" "+Me(N.taxAmt/2,o)})]})]}):s.jsxs("tr",{className:k[l].dynamicClassname,children:[s.jsx("td",{dangerouslySetInnerHTML:{__html:`${I.vat} ${N.tax}%`}}),s.jsx("td",{children:d.curr+" "+Me(N.taxableAmt,o)}),s.jsx("td",{children:d.curr+" "+Me(N.taxAmt,o)})]})})]})})]}):"",d.upiId&&d.companyInfo.companyName&&(!d.splitDetails||((Kt=d.splitDetails)==null?void 0:Kt.length)==0)&&s.jsxs("div",{className:"single-entity-and-center",children:[s.jsx("h6",{style:{marginTop:"6px"},children:"Scan this QRCode to Pay"}),D(d.upiId,d.orderId,d.companyInfo.companyName,d.paidAmount)]}),d.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."}),$(r.vatNo,d)]}),j?s.jsx("div",{className:"image-bill",children:s.jsx("img",{src:`${j}`,className:"single-entity-and-center",style:{width:k[l].logoWidth}})}):"",d.footerMessage?s.jsx("h4",{className:"single-entity-and-center",dangerouslySetInnerHTML:{__html:d.footerMessage}}):"",d.printby&&d.printOperatorInfo?s.jsx("h6",{className:"left-align-entity",children:`Printed By:${d.printby}`}):"",d.printTime&&d.printOperatorInfo?s.jsx("h6",{className:"left-align-entity",children:`Printed On:${d.printTime}`}):"",d.disabledPoweredBy?"":s.jsx("h6",{className:"single-entity-and-center",children:"Powered By: www.recaho.com"})]})});return C}else if(y==="PRINT_DASHBOARD"&&d.salesCollection){const C=d.salesCollection.totalDiscountAmt?ys(d.salesCollection.grandTotal,d.salesCollection.totalDiscountAmt):null,N=d.salesCollection.totalCollection-d.salesCollection.totalTax;var F=L().format("DD/MM/YYYY LT");const Y=(Qt=d.monthTillDateSalesColl)!=null&&Qt.totalDiscountAmt?ys(d.monthTillDateSalesColl.grandTotal,d.monthTillDateSalesColl.totalDiscountAmt):null;return s.jsxs("div",{className:`main-div ${k[l].dynamicClassname}`,style:{width:k[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:- ${F}`}),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:d.selectedDate})]}),s.jsx("hr",{}),d.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:ie(d.monthTillDateSalesColl.grandTotal,o)})]}),s.jsxs("h5",{className:"level3-bold flex-two-items",children:[s.jsx("span",{children:"DISCOUNT:"}),s.jsx("span",{children:`${ie(d.monthTillDateSalesColl.totalDiscountAmt,o)}${Y?`(${m(Y)}%)`:""}`})]}),s.jsxs("h5",{className:"level3-bold flex-two-items",children:[s.jsx("span",{children:"CHARGES:"}),s.jsx("span",{children:ie(d.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:ie(d.monthTillDateSalesColl.totalCollection-d.monthTillDateSalesColl.totalTax,o)})]}),s.jsxs("h5",{className:"level3-bold flex-two-items",children:[s.jsx("span",{children:"TAX:"}),s.jsx("span",{children:ie(d.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:ie(d.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:ie(d.salesCollection.grandTotal,o)})]}),s.jsxs("h5",{className:"level3-bold flex-two-items",children:[s.jsx("span",{children:"DISCOUNT:"}),s.jsx("span",{children:`${ie(d.salesCollection.totalDiscountAmt,o)}${C?`(${m(C)}%)`:""}`})]}),s.jsxs("h5",{className:"level3-bold flex-two-items",children:[s.jsx("span",{children:"CHARGES:"}),s.jsx("span",{children:ie(d.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:ie(N,o)})]}),s.jsxs("h5",{className:"level3-bold flex-two-items",children:[s.jsx("span",{children:"TAX:"}),s.jsx("span",{children:ie(d.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:ie(d.salesCollection.totalCollection,o)})]})]}),s.jsx("hr",{}),X(d.otherFields.totalDiscountAmt,d.otherFields.discountList,"Discount",{action:"addCharges"}),X(d.otherFields.totalOtherCharges,d.otherFields.otherChargesList,"Charges"),X(d.otherFields.totalTax,d.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:ie(d.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:d.salesCollection.totalOrders})]}),S(d)]}),s.jsx("hr",{}),d.otherFields.totalItemType?s.jsx("div",{children:X(d.otherFields.totalItemType,d.otherFields.itemTypeList,"Item Type",{action:"addCharges"})}):"",d.averageCollection.avgTableTime||d.averageCollection.avgorderValue||d.averageCollection.noOfGuest?s.jsxs("div",{children:[s.jsx("h4",{className:"single-entity-and-center",children:"PERFORMANCE METRICS"}),d.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:d.averageCollection.avgTableTime})]}):"",d.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:ie(d.averageCollection.avgorderValue,o)})]}):"",d.averageCollection.noOfGuest?s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:"Covers:"}),s.jsx("span",{children:d.averageCollection.noOfGuest})]}):"",d.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:ie(d.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:ie(d.totalCollection,o)})]}),w(d)]}),P(d.averageCollection),d.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:ie(d.otherFields.salesCollection,o)})]}),d.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:ie(d.otherFields.outstandingAmt,o)})]}):""]})]}):"",s.jsx("hr",{}),Se(d.averageCollection.dailyExpanse)]}),s.jsx("br",{}),Ct=="Android OS"&&s.jsx("div",{className:"space-3rem"})]})}else if(y==="AGGREGATOR_BILL"){let C;return a.aggregatorOrderId&&a.aggregatorOrderId!==""&&(C=W(a.aggregatorOrderId)),s.jsx("div",{className:"main-div bill",style:{width:k[l].paperSize},children:s.jsxs("div",{children:[s.jsxs("div",{style:{width:"100%",textAlign:"left",marginLeft:"auto"},children:[s.jsx("br",{}),O&&s.jsx("div",{className:"image-bill",children:s.jsx("img",{src:O,className:"single-entity-and-center",style:{width:k[l].logoWidth}})}),s.jsxs("div",{className:`details-section ${k[l].dynamicClassname}`,children:[!O&&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:I.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:I.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:I.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:I.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:I.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&&C&&s.jsxs("h4",{className:"single-entity-and-center",children:[`${a.orderSource}: ${C.firstDigits||""}`,s.jsxs("span",{style:{fontSize:"2rem"},children:["-",C.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:I.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:I.token_no}})," ",s.jsx("span",{children:a.tokenId})]})})]}),s.jsx("hr",{}),s.jsxs("div",{className:`details-section ${k[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:I.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:I.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:I.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:I.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:I.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:I.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:k[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:[((_s=a.services)==null?void 0:_s.length)&&a.services.map(Y=>{var V;return s.jsxs("div",{style:Y.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:Y.serviceName.toUpperCase()}),s.jsx("h6",{className:"items products-heading-qty-kot",children:Y.qty})]}),((V=Y.addons)==null?void 0:V.length)&&Y.addons.map(R=>s.jsx("h6",{className:"items products-heading-addon-kot",children:"- "+Ve(R.serviceName)})),Y.instruction&&a.itemInstructionOnBill&&s.jsx("h6",{className:"left-align-entity level2-bold",children:s.jsx("h6",{className:"items products-heading-addon-kot",children:Y.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:ie(a.discountAmt,o)})]}):"",a.otherCharges&&a.otherCharges.length>0?a.otherCharges.map(Y=>{if(Y.amt)return s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h5",{children:Y.name}),s.jsx("h5",{children:a.curr+" "+m(Y.amt)})]})}):"",a.taxObj&&a.taxObj.GST?s.jsx(s.Fragment,{children:a.taxObj.GST.map(Y=>{let V=new Array;for(const R in Y)if(Y[R]&&Y[R]!=0){let T=R/2;V.push(s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"bottom-section-div",children:[s.jsxs("h5",{children:["CGST @",T]}),s.jsx("h5",{children:a.curr+" "+m(Y[R]/2)})]}),s.jsxs("div",{className:"bottom-section-div",children:[s.jsxs("h5",{children:[d.taxLabel+" "," @",T,"%"]}),s.jsx("h5",{children:a.curr+" "+m(Y[R]/2)})]})]}))}return V})}):"",s.jsx("div",{style:{marginTop:"6px"},children:(fn=a.customFeilds)==null?void 0:fn.map(Y=>s.jsx("h4",{className:"left-align-entity",children:Y.customName+": "+Y.customValue}))}),a.paymentState&&s.jsx("h4",{className:"single-entity-and-center",style:{marginTop:"6px"},children:`Payment Status: ${a.paymentState=="PAID_ONLINE"?"Online paid":"COD"}`}),j?s.jsx("div",{className:"image-bill",children:s.jsx("img",{src:`${j}`,className:"single-entity-and-center",style:{width:k[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(y==="UPDATE_TABLE"){let C="";return a.action==="SWITCH_TABLE"?C=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:["**",(bs=h.Table)==null?void 0:bs.toUpperCase()," SWITCH**"]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:"From"}),s.jsx("h5",{className:"left-align-entity level3-bold",children:(pn=a.from)==null?void 0:pn.map((N,Y)=>{var V,R,T;return`${(R=(V=e.tableData[N])==null?void 0:V.attachedArea)==null?void 0:R.toUpperCase()} - ${(T=e.tableData[N])==null?void 0:T.tableName}${Y+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:`${(Ts=(Ss=e.tableData[a.to[0]])==null?void 0:Ss.attachedArea)==null?void 0:Ts.toUpperCase()} - ${(yn=e.tableData[a.to[0]])==null?void 0:yn.tableName}`}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["Running ",`${h.KOT}`,"s: ",Object.keys(a.activeKots).join(", ")]})]})}):C=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 ",(gn=h.Table)==null?void 0:gn.toUpperCase(),"**"]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:"From"}),s.jsx("h5",{className:"left-align-entity level3-bold",children:(ws=a.from)==null?void 0:ws.map((N,Y)=>{var V,R,T;return`${(R=(V=e.tableData[N])==null?void 0:V.attachedArea)==null?void 0:R.toUpperCase()} - ${(T=e.tableData[N])==null?void 0:T.tableName}${Y+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:`${(xn=(Is=e.tableData[a.to[0]])==null?void 0:Is.attachedArea)==null?void 0:xn.toUpperCase()} - ${(Nn=e.tableData[a.to[0]])==null?void 0:Nn.tableName}`}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["Running ",`${h.KOT}`,"s: ",Object.keys(a.activeKots).join(", ")]})]})}),C}else if(y==="COUNTER_OPERATION"){let C;return l=="2INCH"||l=="1.8INCH"?C=s.jsx("div",{className:"main-div",style:{width:k[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: ",B(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: ",B(a.cashSale,o)," "]}),a.payModes&&a.payModes.length>0&&a.payModes.map(N=>{if(N.value>0||N.value<0)return s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- ",N.displayName," : ",B(N.value,o)]})})]}),s.jsxs("h4",{className:"left-align-entity level3-bold",children:["Cash Balance: ",B(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:[" ",B(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:[" ",B(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:[" ",B(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(N=>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"?B(N.denomination,o):N.denomination]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" X "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",N.count," "]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" = "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",B(N.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:B(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:[" ",B(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:[" ",B(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:[" ",B(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:[" ",B(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:[" -",B(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:[" +",B(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:[" -",B(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:[" +",B(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(N=>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"?B(N.denomination,o):N.curr+" "+N.denomination]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" X "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",N.count," "]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" = "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",B(N.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:B(a.TotalDenomationsAmount,o)})]})]})}):C=s.jsx("div",{className:"main-div",style:{width:k[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: ",B(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: ",B(a.cashSale,o)," "]}),a.payModes&&a.payModes.length>0&&a.payModes.map(N=>{if(N.value>0)return s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- ",N.displayName," : ",B(N.value,o)]})})]}),s.jsxs("h4",{className:"left-align-entity level3-bold",children:["Cash Balance: ",B(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 : ",B(a.openingBalance,o)]}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- Actual Opening Balance : ",B(a.actualOpeningBalance,o)]}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- Opening Difference Amt : ",B(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(N=>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"?B(N.denomination,o):N.denomination]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" X "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",N.count," "]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" = "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",B(N.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:B(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 : ",B(a.cashSale,o)," "]}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- System Closing Balance : ",B(a.closingBalance,o)]}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- Actual Closing Balance : ",B(a.closingActualBalance,o)]}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- Closing Difference Amt : ",B(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 : -",B(a.debitEntry,o)]}),a.creditEntry>0&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- Other Cash Income : +",B(a.creditEntry,o)]}),a.internalTransferDebit>0&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- Internal Transfer(cash to bank): -",B(a.internalTransferDebit,o)]}),a.internalTransferCredit>0&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- Internal Transfer(bank to cash): +",B(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(N=>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"?B(N.denomination,o):N.curr+" "+N.denomination]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" X "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",N.count," "]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" = "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",B(N.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:B(a.TotalDenomationsAmount,o)})]})]})}),C}else if(y==="ITEMWISE_SALES_COUNTER"){let C,{counterDetails:N}=e.printerDataObject;return C=s.jsx("div",{className:"main-div",style:{width:k[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:N.currentDate}),s.jsx("hr",{}),N.CounterName&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:["Counter Name: ",N.CounterName]}),N.CounterName&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:["UserName: ",N.openedBy]}),N.CounterName&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:["Login Time: ",N.loginTime]}),N.logoutTime&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:["Logout Time: ",N.logoutTime]}),N.CounterName&&s.jsx("hr",{}),st(a),s.jsx("hr",{}),s.jsx("h6",{className:"left-align-entity",children:`Printed By: ${N.openedBy}`}),s.jsx("h6",{className:"left-align-entity",children:`Printed On: ${N.printedOn}`})]})}),C}else if(y==="CARD_RECHARGE_DETAILS"){let{staticDataKOT:C}=e.printerDataObject;return getRechargeDetails(C)}else if(y==="PACKAGING_SLIP"){let C,N=0;d.aggregatorOrderId&&d.aggregatorOrderId!==""&&(C=W(d.aggregatorOrderId));const Y=d.services;for(let R in Y)N+=Y[R].length;return s.jsx("div",{className:"main-div",style:{width:k[l].paperSize},children:s.jsxs("div",{style:{width:"100%",textAlign:"left",marginLeft:"auto"},children:[s.jsx("br",{}),s.jsxs("div",{className:`details-section ${k[l].dynamicClassname}`,children:[d.subOrderFrom&&s.jsx("h4",{className:"single-entity-and-center",children:d.subOrderFrom.toUpperCase()}),d.orderFrom!=="dine-in"&&s.jsxs("h2",{className:"single-entity-and-center level2-bold",children:["Token No ",d.tokenId]}),d.tableName&&s.jsx("h2",{className:"single-entity-and-center level2-bold",children:d.tableName}),d.otp&&s.jsx("h4",{className:"single-entity-and-center level2-bold",children:"OTP: "+d.otp}),d.orderSource&&C&&s.jsxs("h4",{className:"single-entity-and-center level2-bold",children:[`${d.orderSource}: ${C.firstDigits||""}`,s.jsx("span",{style:{fontSize:"2rem"},children:C.last4Dgits||""})]}),d.zomatoInstant&&s.jsx("h4",{className:"single-entity-and-center level2-bold",children:d.zomatoInstant}),s.jsx("hr",{}),d.orderId&&s.jsx("h5",{className:"left-align-entity level3-bold",children:"Order Id: "+d.orderId}),d.date&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:["Printed On: ",d.date]}),d.prepareBy?s.jsx("h5",{className:"left-align-entity level3-bold",children:"Prepare By : "+d.prepareBy}):"",d.waiterName&&s.jsx("h5",{className:"left-align-entity level3-bold",children:`${h.Waiter} Name: `+d.waiterName})]}),de(d),s.jsx("br",{}),s.jsxs("div",{className:"bottom-section-div flex-two-items space-3rem",children:[s.jsxs("h5",{children:["TOTAL ITEMS: ",N]}),s.jsxs("h5",{children:["TOTAL QTY: ",ve(d.totalQty)]})]}),(jn=d.customFields)==null?void 0:jn.map(R=>s.jsx("h4",{className:"left-align-entity",children:R.customName+": "+R.customValue})),s.jsx("br",{}),d.orderFrom!=="dine-in"&&s.jsxs("h4",{className:"left-align-entity level3-bold",children:["Payment Status: ",d.paymentStatus.replace("_"," ")]})]})})}else{if(y==="ORDER_AGGREGATED_PRINT")return s.jsx("div",{className:"main-div",style:{width:k[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 ${k[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:I.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:I.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:I.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:I.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:I.name}}),": ",s.jsx("span",{children:a.name})]}),a.mobile&&s.jsxs("h5",{children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.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 ${k[l].dynamicClassname}`,children:"Date"}),s.jsx("h5",{className:`items products-heading-orderId ${k[l].dynamicClassname}`,children:"Order Id"}),s.jsx("h5",{className:`items products-heading-amount ${k[l].dynamicClassname}`,children:"Amount"})]})}),s.jsx("hr",{}),s.jsx("section",{className:"products-section",children:a.orders.map(N=>s.jsx("div",{style:{paddingTop:"12px"},children:s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h6",{className:`items products-heading-name ${k[l].dynamicClassname}`,children:rr(N.date)}),s.jsx("h6",{className:`items products-heading-orderId ${k[l].dynamicClassname}`,children:N.orderId}),s.jsx("h6",{className:`items products-heading-amount ${k[l].dynamicClassname}`,children:a.curr+" "+m(N.finalAmount)})]})},N.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)})]})]}),(vn=a.transactions)!=null&&vn.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 ${k[l].dynamicClassname}`,children:"Date"}),s.jsx("h5",{className:`items products-heading-orderId ${k[l].dynamicClassname}`,children:"Payment Mode"}),s.jsx("h5",{className:`items products-heading-amount ${k[l].dynamicClassname}`,children:"Amount"})]})}),s.jsx("hr",{}),s.jsx("section",{className:"products-section",children:a.transactions.map(N=>s.jsx("div",{style:{paddingTop:"12px"},children:s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h6",{className:`items products-heading-name ${k[l].dynamicClassname}`,children:N.date}),s.jsx("h6",{className:`items products-heading-orderId ${k[l].dynamicClassname}`,children:N.paymentMode}),s.jsx("h6",{className:`items products-heading-amount ${k[l].dynamicClassname}`,children:a.curr+" "+m(N.amount)})]})},N.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 C,N=0,Y,V;for(let T=0;T<(((g=a.services)==null?void 0:g.length)||0);T++)V=a.services[T],V.status==="CANCELLED"&&!a.onlyCancelledItems&&(N+=V.qty);return a.aggregatorOrderId&&a.aggregatorOrderId!==""&&(C=W(a.aggregatorOrderId)),s.jsx("div",{className:"main-div",style:{width:k[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"}):"",N||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&&C&&s.jsxs("h4",{className:"single-entity-and-center level2-bold",children:[`${a.orderSource}: ${C.firstDigits||""}`,s.jsx("span",{style:{fontSize:"2rem"},children:C.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:`${h.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:`${h.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:k[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(T=>(T.status==="CANCELLED"?Y=s.jsxs("strike",{children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h2",{className:"items products-heading-name-kot ",children:Ve(T.serviceName)}),s.jsx("h2",{className:"items products-heading-qty-kot ",children:T.qty})]}),T.addons&&T.addons.length&&T.addons.map(ge=>s.jsx("h2",{className:"items products-heading-addon-kot",children:"- "+Ve(ge.serviceName)})),T.instruction&&s.jsx("h4",{className:"left-align-entity level2-bold",children:s.jsx("h4",{className:"items products-heading-addon-kot",children:" "+T.instruction})})]}):Y=s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h2",{className:"items products-heading-name-kot ",children:Ve(T.serviceName)}),s.jsx("h2",{className:"items products-heading-qty-kot ",children:T.qty})]}),T.addons&&T.addons.length&&T.addons.map(ge=>s.jsx("h2",{className:"items products-heading-addon-kot",children:"- "+Ve(ge.serviceName)})),T.instruction&&s.jsx("h4",{className:"left-align-entity level2-bold",children:s.jsx("h4",{className:"items products-heading-addon-kot",children:" "+T.instruction})})]}),s.jsx("div",{children:Y}))),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-N)]})]}),(M=a.customFields)==null?void 0:M.map(T=>s.jsx("h4",{className:"left-align-entity",children:T.customName+": "+T.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:k[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 u,f,o;try{const{needPackagingSlip:l=!0}=r;e.primaryWaiter&&n&&(e.primaryWaiter=((u=n[e.primaryWaiter])==null?void 0:u.name)||null);const{obj:c,printersMap:h}=_d(e,t,r);let p=[],m=[];const x=[];if(ba(c).flatMap(v=>{(h[v.station]||[]).forEach(E=>{const S=new Promise(w=>{x.push(s.jsx(qe,{printerDataObject:{staticDataKOT:v,paperSize:E.paperSize,printer:E.printer},newId:v.newId,value:{settingData:t},onImageGenerated:D=>{p.push({paperSize:E.paperSize,printer:E.printer,image:D,type:"KOT"}),w()},additionalActions:r},v.newId+"::"+E.printer))});m.push(S)})}),l&&((f=t.packagingSlipPrinters)!=null&&f.length)){const v=bd(e,t,r);(o=v.printers)!=null&&o.length&&v.printers.forEach(_=>{m.push(new Promise(E=>{x.push(s.jsx(qe,{printerDataObject:{staticDataKOT:{obj:_.obj},paperSize:_.paperSize,printer:_.printer,type:"PACKAGING_SLIP"},newId:_.obj.newId,value:{settingData:t},onImageGenerated:S=>{p.push({paperSize:_.paperSize,printer:_.printer,image:S,type:"PACKAGING_SLIP"}),E()},additionalActions:r},_.obj.newId))}))})}x.length&&tt("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 u=[],f=[];if(n!=null&&n.action){const{obj:o,paperSize:l,printersMap:c}=Sd(e,t,n),h=ba(o).flatMap(p=>{var m;return(m=c[p.station])==null?void 0:m.map(x=>new Promise(v=>{const _=s.jsx(qe,{printerDataObject:{staticDataKOT:p,paperSize:l,printer:x.printer,type:p.type},newId:p.newId,settingData:t,tableData:us(a,"typeValue"),onImageGenerated:E=>{u.push({paperSize:x.paperSize,printer:x.printer,image:E,type:"UPDATE_TABLE"}),v()},additionalActions:n});return f.push(v),_}))});h.length&&tt("root1",h),await Promise.all(f.map(p=>new Promise(p)))}r(u)}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(qe,{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});tt("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 u=[];await new Promise(o=>{const l=s.jsx(qe,{printerDataObject:{staticDataKOT:a,paperSize:a.paperSize,type:"AGGREGATOR_BILL"},newId:Math.random(),settingData:t,onImageGenerated:c=>{u.push({paperSize:a.paperSize,image:c,type:"AGGREGATOR_BILL"}),o()},additionalActions:n});tt("root1",l)}),r(u)}catch(a){i(a)}}),Lh=async(e,t,n)=>new Promise(async(r,i)=>{try{let a=await _a(e,t,n),u=[];await new Promise(o=>{if(n.isSplitBill&&a.obj.splitDetails&&a.obj.splitDetails.length)for(let l=0;l<a.obj.splitDetails.length;l++){const c=a.obj.splitDetails[l];let h=JSON.parse(JSON.stringify(a));h.obj.splitDetails=[c];const p=s.jsx(qe,{printerDataObject:{staticDataKOT:h,paperSize:a.paperSize,type:"BILL"},newId:Math.random(),settingData:t});tt(p)}else{const l=s.jsx(qe,{printerDataObject:{staticDataKOT:a,paperSize:a.paperSize,type:"BILL"},newId:Math.random(),settingData:t,onImageGenerated:c=>{u.push({paperSize:a.paperSize,image:c,type:"BILL"}),o()},additionalActions:n});tt("root1",l)}}),r(u)}catch(a){i(a)}}),kh=async(e,t,n,r)=>new Promise(async(i,a)=>{try{let u=await Id(e);if(u&&Object.keys(u.Category).length!==0){let o=`ItemWiseSales:::${Math.floor(Math.random()*1e3)}`,l=[];await new Promise(h=>{const p=s.jsx(qe,{printerDataObject:{staticDataKOT:u,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"}),h()},additionalActions:r});tt("root1",p)}),i(l)}else i([])}catch(u){a(u)}}),Ph=async(e,t,n)=>new Promise(async(r,i)=>{try{let u=`counterDetailsPrint:::${Math.floor(Math.random()*1e3)}`,f=[];await new Promise(l=>{const c=s.jsx(qe,{printerDataObject:{staticDataKOT:e,paperSize:t.printerSize,type:"COUNTER_OPERATION"},newId:u,settingData:t,onImageGenerated:h=>{f.push({paperSize:t.printerSize,image:h,type:"COUNTER_OPERATION"}),l()},additionalActions:n});tt("root1",c)}),r(f)}catch(a){i(a)}}),Fh=async(e,t,n={},r={})=>new Promise(async(i,a)=>{var u;try{const f=await Od(e,t);let o=[],l=lr(null,{fontTheme:t.fontTheme,type:"ORDER_AGGREGATED_PRINT",siteSetting:t}),c=l?(u=l[0])==null?void 0:u.paperSize:t.printerSize;await new Promise(p=>{const m=s.jsx(qe,{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});tt("root1",m)}),i(o)}catch(f){a(f)}}),Dh=async(e,t,n={})=>new Promise(async(r,i)=>{var a;try{const u=[];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],h=await Md(c);await new Promise(m=>{const x=s.jsx(qe,{printerDataObject:{staticDataKOT:h,paperSize:h.paperSize,type:"BILL"},newId:Math.random(),settingData:t,onImageGenerated:v=>{f.push({paperSize:h.paperSize,image:v,type:"BILL"}),m()},additionalActions:n});u.push(x)})}}u.length&&tt("root1",u),r(f)}catch(u){i(u)}}),tt=(e,t)=>{const n=document.getElementById(e);n&&ii.createRoot(n).render(t)};Ie.counterDetailsPrint=Ph,Ie.handleAggregatorBillPrint=Rh,Ie.handleBillPrint=Lh,Ie.handleDashboardPrint=Eh,Ie.handleItemWisePrint=kh,Ie.handleKOTPrint=Mh,Ie.handleOldBillPrints=Dh,Ie.handleSummaryPrint=Fh,Ie.handleUpdateTablePrint=Ah,Object.defineProperty(Ie,Symbol.toStringTag,{value:"Module"})});
|
|
54
|
+
*/var Wa={L:Vt.QrCode.Ecc.LOW,M:Vt.QrCode.Ecc.MEDIUM,Q:Vt.QrCode.Ecc.QUARTILE,H:Vt.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(u,f){if(!u&&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(!u)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}u&&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,u=Math.floor(t*Sh),f=a/t,o=(r.width||u)*f,l=(r.height||u)*f,c=r.x==null?e.length/2-o/2:r.x*f,h=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(h),v=Math.ceil(o+c-m),_=Math.ceil(l+h-x);p={x:m,y:x,w:v,h:_}}return{x:c,y:h,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:u=qa,includeMargin:f=Ka,style:o,imageSettings:l}=t,c=mr(t,["value","size","level","bgColor","fgColor","includeMargin","style","imageSettings"]),h=l==null?void 0:l.src,p=xe.useRef(null),m=xe.useRef(null),[x,v]=xe.useState(!1);xe.useEffect(()=>{if(p.current!=null){const S=p.current,w=S.getContext("2d");if(!w)return;let D=Vt.QrCode.encodeText(n,Wa[i]).getModules();const $=f?fr:0,P=D.length+$*2,Z=Ja(D,r,f,l),ne=m.current,te=Z!=null&&ne!==null&&ne.complete&&ne.naturalHeight!==0&&ne.naturalWidth!==0;te&&Z.excavation!=null&&(D=Za(D,Z.excavation));const le=window.devicePixelRatio||1;S.height=S.width=r*le;const Se=r/P*le;w.scale(Se,Se),w.fillStyle=a,w.fillRect(0,0,P,P),w.fillStyle=u,Th?w.fill(new Path2D(Qa(D,$))):D.forEach(function(Q,J){Q.forEach(function(G,de){G&&w.fillRect(de+$,J+$,1,1)})}),te&&w.drawImage(ne,Z.x+$,Z.y+$,Z.w,Z.h)}}),xe.useEffect(()=>{v(!1)},[h]);const _=ps({height:r,width:r},o);let E=null;return h!=null&&(E=xe.createElement("img",{src:h,key:h,style:{display:"none"},onLoad:()=>{v(!0)},ref:m})),xe.createElement(xe.Fragment,null,xe.createElement("canvas",ps({style:_,height:r,width:r,ref:p},c)),E)}function Ih(e){const t=e,{value:n,size:r=za,level:i=Ga,bgColor:a=Va,fgColor:u=qa,includeMargin:f=Ka,imageSettings:o}=t,l=mr(t,["value","size","level","bgColor","fgColor","includeMargin","imageSettings"]);let c=Vt.QrCode.encodeText(n,Wa[i]).getModules();const h=f?fr:0,p=c.length+h*2,m=Ja(c,r,f,o);let x=null;o!=null&&m!=null&&(m.excavation!=null&&(c=Za(c,m.excavation)),x=xe.createElement("image",{xlinkHref:o.src,height:m.h,width:m.w,x:m.x+h,y:m.y+h,preserveAspectRatio:"none"}));const v=Qa(c,h);return xe.createElement("svg",ps({height:r,width:r,viewBox:`0 0 ${p} ${p}`},l),xe.createElement("path",{fill:a,d:`M0,0 h${p}v${p}H0z`,shapeRendering:"crispEdges"}),xe.createElement("path",{fill:u,d:v,shapeRendering:"crispEdges"}),x)}var Xa=e=>{const t=e,{renderAs:n}=t,r=mr(t,["renderAs"]);return n==="svg"?xe.createElement(Ih,ps({},r)):xe.createElement(wh,ps({},r))};const ys=(e,t)=>t*100/e,Ch=e=>!!(e||e===0),Oh={ABSOLUTE:"AMT",RELATIVE:"%",COMPLIMENTARY:"COMPLIMENTARY"},k=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 Ct=tr(),_e="normal-class";(Ct=="Android OS"||Ct==="iOS")&&(_e="bold-class");const qe=e=>{var rt,Mt,ee,be,pt;const t=e.additionalActions??{},n=xe.useRef(null),r=e.settingData?e.settingData:e.value.settingData,i=localStorage.getItem("siteId"),{staticDataKOT:a,printer:u,type:f}=e.printerDataObject,o=((Mt=(rt=e.value)==null?void 0:rt.settingData)==null?void 0:Mt.curr)??((ee=e.settingData)==null?void 0:ee.curr)??"INR";r==null||r.fontTheme;let l=e.printerDataObject.paperSize,c=lr(u,{type:f,siteSetting:e.settingData?e.settingData:e.value.settingData},t);const h=r.customLabels??gd();l=c?(be=c[0])!=null&&be.paperSize?(pt=c[0])==null?void 0:pt.paperSize:l||"3INCH":e.printerDataObject.paperSize;function p(y){const d=Math.abs(parseFloat(y));return m(d)}function m(y){switch(o){case"BHD":case"KWD":case"MUR":case"OMR":return Zs(y).format("0,00.000");default:return Zs(y).format("0,00.00")}}xe.useEffect(()=>{E()},[e.newId]);const x=()=>new Promise(async(y,d)=>{if(Ct=="Android OS"||Ct==="iOS"){let O=await _h(n.current);if(O){const j=await _(O);y(j)}}else{let O=await Ua(n.current);O&&y(O)}}),v=()=>new Promise(async(y,d)=>{const O=await x();y(O)}),_=y=>new Promise((d,O)=>{let j=new Image;j.src=y,j.onload=()=>{let I=document.createElement("canvas");const U=600,b=j.height;let F=j.width,z=j.height;F>z?F>U&&(z*=U/F,F=U):z>b&&(F*=b/z,z=b),I.width=F,I.height=z,I.getContext("2d").drawImage(j,0,0,F,z),d(I.toDataURL())}}),E=async()=>{if(n&&n.current){const y=await v();e.onImageGenerated(y)}},S=y=>{let d=new Array;for(const O in y.menusCollection)O.endsWith("collection")||(y.menusCollection[`${O}_collection`]||y.menusCollection[O])&&d.push(s.jsxs("h5",{className:"left-align-entity level3-bold display-percentage",children:[s.jsx("span",{children:` -- ${O.replace("_"," ")}(${y.menusCollection[O]}):`}),s.jsx("span",{children:ie(y.menusCollection[`${O}_collection`],o)}),s.jsx("span",{children:m(ys(y.salesCollection.totalCollection,y.menusCollection[`${O}_collection`]??0))+"%"})]}));return y.salesCollection.online_aggregator_collection&&d.push(s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:` -- Aggregator(${y.salesCollection.online_aggregator}):`}),s.jsx("span",{children:ie(y.salesCollection.online_aggregator_collection,o)})]}),s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:` -- Zomato(${y.salesCollection.zomato_aggregator??0}):`}),s.jsx("span",{children:ie(y.salesCollection.zomato_aggregator_collection,o)})]}),s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:` -- Swiggy(${y.salesCollection.swiggy_aggregator??0}):`}),s.jsx("span",{children:ie(y.salesCollection.swiggy_aggregator_collection,o)})]})),d},w=y=>{let d=new Array,O=new Object;for(let j=0;j<y.todayCollection.length;j++)O=y.todayCollection[j],d.push(s.jsxs("h5",{className:"left-align-entity level3-bold display-percentage",children:[s.jsx("span",{children:` -- ${O.displayName}:`}),s.jsx("span",{children:ie(O.value,o)}),s.jsx("span",{children:m(ys(y.totalCollection,O.value))+"%"})]}));return d},D=(y,d,O,j,I={})=>{let U=y.includes("upi://");const b=`upi://pay?pa=${y}&pn=${O}&cu=INR&am=${j}&tr=${d}`;return s.jsx(Xa,{value:U?y:b,renderAs:"canvas",size:I.size??250})},$=(y,d)=>{var U,b;let O=0;if((U=d.taxObj)!=null&&U.VAT.length){let F,z,he;for(z=0;z<((b=d.taxObj)==null?void 0:b.VAT.length);z++){F=d.taxObj.VAT[z];for(he in F)O+=ve(F[he])}}const j={sellerName:d.companyInfo.companyName,vatRegistrationNumber:y,invoiceTimestamp:new Date(d.orderInfo.timestamp*1e3).toISOString(),invoiceTotal:d.finalAmount,invoiceVatTotal:O},I=yd(j.sellerName,j.vatRegistrationNumber,j.invoiceTimestamp,j.invoiceTotal,j.invoiceVatTotal.toFixed(2));return s.jsx(Xa,{value:I,renderAs:"canvas",size:250})},P=y=>{const d=[];return(y.totalBalanceAmt||y.refundAmt||y.writeOffAmt||y.rewardAmt||y.cashCard)&&(d.push(s.jsx("hr",{})),y.rewardAmt&&d.push(s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:"REWARDS:"}),s.jsx("span",{children:ie(y.rewardAmt,o)})]})),y.totalBalanceAmt&&d.push(s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:"OUTSTANDING AMOUNT:"}),s.jsx("span",{children:ie(y.totalBalanceAmt,o)})]})),y.writeOffAmt&&d.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:ie(y.writeOffAmt,o)})]})),y.refundAmt&&d.push(s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:"REFUND AMOUNT:"}),s.jsx("span",{children:ie(y.refundAmt,o)})]})),y.cashCard&&d.push(s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:"CASH CARD:"}),s.jsx("span",{children:ie(y.cashCard,o)})]}))),d},Z=(y,d)=>{if(d&&d.length){for(let O=0;O<d.length;O++)if(d[O].slugName===y)return d[O]}return!1},ne=(y,d)=>{if(d&&d.length){for(let O=0;O<d.length;O++)if(d[O].itemType===y)return d[O]}return!1},te=new Object({CREDIT:"Other Income",DEBIT:"Expense"}),le=y=>y.discountType==="COMPLIMENTARY"?"@ COMPLIMENTARY":`@ ${y.discountValue}${Oh[y.discountType]}`,Se=y=>{const d=new Array;if(y&&Object.keys(y).length!==0){d.push(s.jsx("h4",{className:"single-entity-and-center",children:"ACCOUNTS"}));for(const O in y)if(d.push(s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:`Total ${te[O]}:`}),s.jsx("span",{children:ie(y[O].total,o)})]})),O&&Object.keys(O).length!==0)for(const j in y[O])j!=="total"&&y[O][j]&&d.push(s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:` -- ${Ve(j)}:`}),s.jsx("span",{children:ie(y[O][j],o)})]}))}return d},Q=(y,d)=>{let O=!1;y.totalValue&&(O=Object.keys(y.totalValue).length>1);let j=new Object;return s.jsxs(s.Fragment,{children:[y.totalValue&&Object.keys(y.totalValue).map(U=>{if(j=y.totalValue[U],U==="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 ${k[l].dynamicClassname}`,dangerouslySetInnerHTML:{__html:d.item_name}}),s.jsx("h4",{className:`items products-heading-qty ${k[l].dynamicClassname}`,dangerouslySetInnerHTML:{__html:d.qty}}),s.jsx("h4",{className:`items products-heading-rate ${k[l].dynamicClassname}`,dangerouslySetInnerHTML:{__html:d.rate}}),s.jsx("h4",{className:`items products-heading-amt ${k[l].dynamicClassname}`,dangerouslySetInnerHTML:{__html:d.amt}})]}),s.jsx("hr",{})]}),s.jsxs("section",{className:"products-section",style:{paddingTop:"12px"},children:[y.itemList&&y.itemList.length&&y.itemList.length>0&&y.itemList.map(b=>{if(b.taxType===U||!b.taxType)return s.jsxs("div",{style:b.name.startsWith("+ ")?{}:{paddingTop:"12px"},children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsxs("h6",{className:`items products-heading-name ${k[l].dynamicClassname}`,style:{fontWeight:"lighter",lineHeight:1.2},children:[b.status==="RETURNED"?"(R) ":"",b.name.toUpperCase()]}),s.jsxs("h6",{className:`items products-heading-qty ${k[l].dynamicClassname}`,style:{fontWeight:"lighter"},children:[b.status==="RETURNED"?"-":"",b.quantity]}),s.jsx("h6",{className:`items products-heading-rate ${k[l].dynamicClassname}`,style:{fontWeight:"lighter"},children:b.rate?p(b.rate):""}),s.jsx("h6",{className:`items products-heading-amt ${k[l].dynamicClassname}`,style:{fontWeight:"lighter"},children:b.status==="RETURNED"?b.serviceAmount?m(b.serviceAmount):"":b.price?m(b.price):""})]}),b.addons&&b.addons.length&&b.addons.map(F=>s.jsx("h6",{className:`items products-heading-addon-kot ${k[l].dynamicClassname}`,children:"- "+Ve(F.serviceName)})),b.instruction&&y.itemInstructionOnBill&&s.jsx("h6",{className:"left-align-entity level2-bold",children:s.jsx("h6",{className:"items products-heading-addon-kot",children:" ("+b.instruction+")"})})]})}),s.jsx("hr",{})]}),s.jsxs("div",{className:`bottom-section ${k[l].dynamicClassname}`,children:[s.jsxs("div",{className:"bottom-section-div inline-display",style:{paddingTop:"12px"},children:[s.jsx("h5",{className:"total-qty",dangerouslySetInnerHTML:{__html:d.subtotal}}),s.jsx("h5",{className:"actual-qty",children:y.curr+" "+m(j.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"})]}):"",j&&j.cat&&Object.keys(j.cat).length>0?Object.keys(j.cat).map(b=>{const F=Z(b,y.discArr);if(F&&j.cat[b]!==0&&F.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:d[`disc_${F.serviceName.toLowerCase()}`]??"DISC-"+F.serviceName.toUpperCase()}}),s.jsx("span",{children:" @"+F.discountValue+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:y.curr+" "+m(j.cat[b])})]})}):"",y.totalItemDisc&&j&&j.itemTypes&&Object.keys(j.itemTypes).length>0?Object.keys(j.itemTypes).map(b=>{const F=ne(b,y.itemTypeDiscObj);if(F&&j.itemTypes[b]!==0&&F.itemType&&F.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:d[`disc_${F.itemType.toLowerCase()}`]??"DISC-"+F.itemType.toUpperCase()}}),s.jsx("span",{children:" @"+F.value+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:y.curr+" "+m(j.itemTypes[b])})]})}):"",y.segMentDisc&&j&&j.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:d[`segment_disc${y.segMentObj.segmentName.toLowerCase()}`]??y.segMentObj.segmentName.toUpperCase()+"DISC"}}),s.jsx("span",{children:" @"+y.segMentObj.discountValue+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:y.curr+" "+m(j.segDisc)})]}):"",j&&j.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:y.couponCode?d.coupon_disc??"COUPON DISC":d.order_disc??"ORDER DISC"}}),":",s.jsxs("span",{children:[y.couponCode?`(${y.couponCode.toUpperCase()})`:"",m(y.dicsEnterValue)?`@${y.dicsEnterValue}${y.discountType=="RELATIVE"||y.discountType=="COMPLIMENTARY"?"%":"AMT"}`:""]})]})}),s.jsx("h5",{className:"actual-qty",children:y.curr+" "+m(j.orderDisc)})]}):"",i=="25e5f1e4-68ff-43a7-b042-bebb93f42b94"&&j&&j.orderDisc?s.jsxs("div",{className:"bottom-section-div",children:[s.jsxs("h5",{className:"total-qty",children:[" ",y.couponCode?"COUPON DISC":"خصم الطلب",y.couponCode?`(${y.couponCode.toUpperCase()})`:""]}),s.jsx("h5",{className:"actual-qty"})]}):"",j.otherCharges&&j.otherCharges.length>0?j.otherCharges.map(b=>s.jsx(s.Fragment,{children:s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{className:"total-qty",dangerouslySetInnerHTML:{__html:d[`charges_${b.name.toLowerCase()}`]??b.name}}),s.jsx("h5",{className:"actual-qty",children:y.curr+" "+m(b.amt)})]})})):"",j&&j.aftDisc&&j.gstTTL!==j.aftDisc?s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{className:"total-qty",dangerouslySetInnerHTML:{__html:d.amt_before_tax}}),s.jsx("h5",{className:"actual-qty",children:y.curr+" "+m(j.aftDisc)})]}):"",i=="25e5f1e4-68ff-43a7-b042-bebb93f42b94"&&j&&j.aftDisc&&j.gstTTL!==j.aftDisc?s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h5",{className:"total-qty",children:"المبلغ قبل الضريبة"}),s.jsx("h5",{className:"actual-qty"})]}):"",y.taxObj&&y.taxObj[U]&&j?s.jsx(s.Fragment,{children:U==="GST"?y.taxObj[U].map(b=>{let F=new Array;for(const z in b)if(b[z]&&b[z]!=0){let he=z/2;F.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:d.cgst}}),s.jsx("span",{children:" @"+he+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:y.curr+" "+m(b[z]/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:d[y.taxLabel.toLowerCase()]}}),s.jsx("span",{children:" @"+he+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:y.curr+" "+m(b[z]/2)})]})]}))}return F}):y.taxObj[U].map(b=>{let F=new Array;for(const z in b)if(b[z]&&b[z]!=0){let he=z;F.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:d.vat}}),s.jsx("span",{children:" @"+he+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:y.curr+" "+m(b[z])})]})}))}return F})}):"",j.gstTTL!==(j.total||0)+(j.aftDisc||0)+j.taxOnCharges&&s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{className:"total-qty",dangerouslySetInnerHTML:{__html:d.total}}),s.jsx("h5",{className:"actual-qty",children:y.curr+" "+m((j.total||0)+(j.aftDisc||0)+j.taxOnCharges)})]}),i=="25e5f1e4-68ff-43a7-b042-bebb93f42b94"&&j.gstTTL!==(j.total||0)+(j.aftDisc||0)+j.taxOnCharges&&s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h5",{className:"total-qty",children:"المجموع"}),s.jsx("h5",{className:"actual-qty"})]}),y.totalValue&&(Object.keys(y.totalValue).length||0)>1?s.jsx("h4",{className:"single-entity-and-center",style:{marginTop:"10px"},children:"- - - - -"}):"",O&&s.jsx("div",{className:"space-2rem"})]})]})}),y.totalValue&&Object.keys(y.totalValue).map(U=>{if(j=y.totalValue[U],U==="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 ${k[l].dynamicClassname}`,dangerouslySetInnerHTML:{__html:d.item_name}}),s.jsx("h6",{className:`items products-heading-qty ${k[l].dynamicClassname}`,dangerouslySetInnerHTML:{__html:d.qty}}),s.jsx("h6",{className:`items products-heading-rate ${k[l].dynamicClassname}`,dangerouslySetInnerHTML:{__html:d.rate}}),s.jsx("h6",{className:`items products-heading-amt ${k[l].dynamicClassname}`,dangerouslySetInnerHTML:{__html:d.amt}})]}),s.jsx("hr",{})]}),s.jsxs("section",{className:"products-section",style:{paddingTop:"12px"},children:[y.itemList&&y.itemList.length&&y.itemList.length>0&&y.itemList.map(b=>{if(b.taxType===U)return s.jsxs("div",{style:b.name.startsWith("+ ")?{}:{paddingTop:"12px"},children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsxs("h6",{className:`items products-heading-name ${k[l].dynamicClassname}`,children:[b.status==="RETURNED"?"(R) ":"",b.name.toUpperCase()]}),s.jsxs("h6",{className:`items products-heading-qty ${k[l].dynamicClassname}`,children:[b.status==="RETURNED"?"-":"",b.quantity]}),s.jsx("h6",{className:`items products-heading-rate ${k[l].dynamicClassname}`,children:b.rate?p(b.rate):""}),s.jsx("h6",{className:`items products-heading-amt ${k[l].dynamicClassname}`,children:b.status==="RETURNED"?b.serviceAmount?m(b.serviceAmount):"":b.price?m(b.price):""})]}),b.addons&&b.addons.length&&b.addons.map(F=>s.jsx("h6",{className:`items products-heading-addon-kot ${k[l].dynamicClassname}`,children:"- "+Ve(F.serviceName)})),b.instruction&&y.itemInstructionOnBill&&s.jsx("h6",{className:"left-align-entity level2-bold",children:s.jsx("h6",{className:"items products-heading-addon-kot",children:" ("+b.instruction+")"})})]})}),s.jsx("hr",{})]}),s.jsxs("div",{className:`bottom-section ${k[l].dynamicClassname}`,children:[s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{className:"total-qty",dangerouslySetInnerHTML:{__html:d.subtotal}}),s.jsx("h5",{className:"actual-qty",children:y.curr+" "+m(j.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"})]}):"",j&&j.cat&&Object.keys(j.cat).length>0?Object.keys(j.cat).map(b=>{const F=Z(b,y.discArr);if(F&&j.cat[b]!==0&&F.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:d[`disc_${F.serviceName.toLowerCase()}`]??"DISC-"+F.serviceName.toUpperCase()}}),s.jsx("span",{children:" @"+F.discountValue+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:y.curr+" "+m(j.cat[b])})]})}):"",y.totalItemDisc&&j&&j.itemTypes&&Object.keys(j.itemTypes).length>0?Object.keys(j.itemTypes).map(b=>{const F=ne(b,y.itemTypeDiscObj);if(F&&j.itemTypes[b]!==0&&F.itemType&&F.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:d[`disc_${F.itemType.toLowerCase()}`]??"DISC-"+F.itemType.toUpperCase()}}),s.jsx("span",{children:" @"+F.value+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:y.curr+" "+m(j.itemTypes[b])})]})}):"",y.segMentDisc&&j&&j.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:d[`segment_disc${y.segMentObj.segmentName.toLowerCase()}`]??y.segMentObj.segmentName.toUpperCase()+"DISC"}}),s.jsx("span",{children:" @"+y.segMentObj.discountValue+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:y.curr+" "+m(j.segDisc)})]}):"",j&&j.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:y.couponCode?d.coupon_disc??"COUPON DISC":d.order_disc??"ORDER DISC"}}),":",s.jsxs("span",{children:[y.couponCode?`(${y.couponCode.toUpperCase()})`:"",m(y.dicsEnterValue)?`@${y.dicsEnterValue}${y.discountType=="RELATIVE"||y.discountType=="COMPLIMENTARY"?"%":"AMT"}`:""]})]})}),s.jsx("h5",{className:"actual-qty",children:y.curr+" "+m(j.orderDisc)})]}):"",i=="25e5f1e4-68ff-43a7-b042-bebb93f42b94"&&j&&j.orderDisc?s.jsxs("div",{className:"bottom-section-div",children:[s.jsxs("h5",{className:"total-qty",children:[" ",y.couponCode?"COUPON DISC":"خصم الطلب",y.couponCode?`(${y.couponCode.toUpperCase()})`:""]}),s.jsx("h5",{className:"actual-qty"})]}):"",j.otherCharges&&j.otherCharges.length>0?j.otherCharges.map(b=>s.jsx(s.Fragment,{children:s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{className:"total-qty",dangerouslySetInnerHTML:{__html:d[`charges_${b.name.toLowerCase()}`]??b.name}}),s.jsx("h5",{className:"actual-qty",children:y.curr+" "+m(b.amt)})]})})):"",j&&j.aftDisc&&j.vatTTL!==j.aftDisc?s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{className:"total-qty",dangerouslySetInnerHTML:{__html:d.amt_before_tax}}),s.jsx("h5",{className:"actual-qty",children:y.curr+" "+m(j.aftDisc)})]}):"",i=="25e5f1e4-68ff-43a7-b042-bebb93f42b94"&&j&&j.aftDisc&&j.vatTTL!==j.aftDisc?s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h5",{className:"total-qty",children:"المبلغ قبل الضريبة"}),s.jsx("h5",{className:"actual-qty"})]}):"",j.otherCharges&&j.otherCharges.length>0?j.otherCharges.map(b=>s.jsx(s.Fragment,{children:b.taxOnAmount&&b.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:d.cgst}}),s.jsx("span",{children:" @"+b.tax/2+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:y.curr+" "+m(b.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:d[y.taxLabel.toLowerCase()]}}),s.jsx("span",{children:" @"+b.tax/2+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:y.curr+" "+m(b.taxOnAmount/2)})]})]}):""})):"",y.taxObj&&y.taxObj[U]&&j?s.jsx(s.Fragment,{children:U==="GST"?y.taxObj[U].map(b=>{let F=new Array;for(const z in b)if(b[z]&&b[z]!=0){let he=z/2;F.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:d.cgst}}),s.jsx("span",{children:" @"+he+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:y.curr+" "+m(b[z]/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:d[y.taxLabel.toLowerCase()]}}),s.jsx("span",{children:" @"+he+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:y.curr+" "+m(b[z]/2)})]})]}))}return F}):y.taxObj[U].map(b=>{let F=new Array;for(const z in b)if(b[z]&&b[z]!=0){let he=z;F.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:d.vat}}),s.jsx("span",{children:" @"+he+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:y.curr+" "+m(b[z])})]})}))}return F})}):"",j.vatTTL!==(j.total||0)+(j.aftDisc||0)+j.taxOnCharges&&s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{className:"total-qty",dangerouslySetInnerHTML:{__html:d.total}}),s.jsx("h5",{className:"actual-qty",children:y.curr+" "+m((j.total||0)+(j.aftDisc||0)+j.taxOnCharges)})]}),i=="25e5f1e4-68ff-43a7-b042-bebb93f42b94"&&j.vatTTL!==(j.total||0)+(j.aftDisc||0)+j.taxOnCharges&&s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h5",{className:"total-qty",children:"المجموع"}),s.jsx("h5",{className:"actual-qty"})]})]})]})})]})},J=(y,d,{labels:O,doMultipleTax:j,type:I})=>{var b,F,z,he,Ae,He,Le,Oe,De,Ke,yt;const U=y.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 ${k[l].dynamicClassname}`,dangerouslySetInnerHTML:{__html:O.item_name}}),s.jsx("h4",{className:`items products-heading-qty ${k[l].dynamicClassname}`,dangerouslySetInnerHTML:{__html:O.qty}}),s.jsx("h4",{className:`items products-heading-rate ${k[l].dynamicClassname}`,dangerouslySetInnerHTML:{__html:O.rate}}),s.jsx("h4",{className:`items products-heading-amt ${k[l].dynamicClassname}`,dangerouslySetInnerHTML:{__html:O.amt}})]}),s.jsx("hr",{})]}),s.jsxs("section",{className:"products-section",style:{paddingTop:"12px"},children:[y.itemList.map(K=>{var At;return s.jsxs("div",{style:K.serviceName.startsWith("+ ")?{}:{paddingTop:"12px"},children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsxs("h6",{className:`items products-heading-name ${k[l].dynamicClassname}`,style:{lineHeight:1.2},children:[K.status==="RETURNED"?"(R) ":"",K.serviceName.toUpperCase()]}),s.jsxs("h6",{className:`items products-heading-qty ${k[l].dynamicClassname}`,children:[K.status==="RETURNED"?"-":"",K.qty]}),s.jsx("h6",{className:`items products-heading-rate ${k[l].dynamicClassname}`,children:K.serviceRate?p(K.serviceRate):""}),s.jsx("h6",{className:`items products-heading-amt ${k[l].dynamicClassname}`,children:K.sub_total?m(K.sub_total):""})]}),K.hsnCode&&d.printHSNCodeOnBill&&s.jsxs("h6",{className:`items products-heading-name ${k[l].dynamicClassname}`,style:{lineHeight:1.2},children:["HSN: ",K.hsnCode]}),(At=K.addons)!=null&&At.length?K.addons.map(at=>s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h6",{className:`items products-heading-name ${k[l].dynamicClassname}`,style:{lineHeight:1.2},children:"+ "+Ve(at.serviceName)}),s.jsxs("h6",{className:`items products-heading-qty ${k[l].dynamicClassname}`,children:[K.status==="RETURNED"?"-":"",at.qty*K.qty]}),s.jsx("h6",{className:`items products-heading-rate ${k[l].dynamicClassname}`}),s.jsx("h6",{className:`items products-heading-amt ${k[l].dynamicClassname}`})]}),s.jsx("div",{children:at.hsnCode&&d.printHSNCodeOnBill&&s.jsxs("h6",{className:`items products-heading-name ${k[l].dynamicClassname}`,style:{lineHeight:1.2},children:["HSN: ",at.hsnCode]})})]})):"",K.instruction?s.jsx("h6",{className:"left-align-entity level2-bold",children:s.jsx("h6",{className:"items products-heading-addon-kot",children:" ("+K.instruction+")"})}):""]})}),s.jsx("hr",{})]}),s.jsxs("div",{className:`bottom-section ${k[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:O.subtotal}}),s.jsx("h5",{className:"actual-qty",children:d.curr+" "+m(y.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"})]}):""]}),(b=U.DISCOUNT_ITEMS)!=null&&b.length?U.DISCOUNT_ITEMS.map(K=>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:O[`disc_${K.discountName.toLowerCase()}`]??"DISC-"+K.discountName.toUpperCase()}}),s.jsx("span",{children:le(K)})]})}),s.jsx("h5",{className:"actual-qty",children:d.curr+" "+m(K.discountAmt)})]})):"",(F=U.CATEGORY_DISCOUNT)!=null&&F.length?U.CATEGORY_DISCOUNT.map(K=>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:O[`disc_${K.discountName.toLowerCase()}`]??"DISC-"+K.discountName.toUpperCase()}}),s.jsx("span",{children:" @"+K.discountValue+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:d.curr+" "+m(K.discountAmt)})]})):"",(z=U.ITEM_DISCOUNT)!=null&&z.length?U.ITEM_DISCOUNT.map(K=>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:O[`disc_${K.discountName.toLowerCase()}`]??"DISC-"+es(K.discountName).toUpperCase()}}),s.jsx("span",{children:" @"+K.discountValue+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:d.curr+" "+m(K.discountAmt)})]})):"",(Ae=(he=U.SEGMENT_DISCOUNT)==null?void 0:he[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:O[`segment_disc${U.SEGMENT_DISCOUNT[0].discountName.toLowerCase()}`]??"DISC-"+U.SEGMENT_DISCOUNT[0].discountName.toUpperCase()}}),":",s.jsx("span",{children:" @"+U.SEGMENT_DISCOUNT[0].discountValue+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:d.curr+" "+m(U.SEGMENT_DISCOUNT[0].discountAmt)})]}):"",(Le=(He=U.COUPON_DISCOUNT)==null?void 0:He[0])!=null&&Le.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:`(${U.COUPON_DISCOUNT[0].discountName.toUpperCase()}) @${U.COUPON_DISCOUNT[0].discountValue}${U.COUPON_DISCOUNT[0].discountType=="RELATIVE"?"%":"AMT"}`})]})}),s.jsx("h5",{className:"actual-qty",children:d.curr+" "+m(U.COUPON_DISCOUNT[0].discountAmt)})]}):"",(De=(Oe=U.ORDER_DISCOUNT)==null?void 0:Oe[0])!=null&&De.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:O.order_disc??"ORDER DISC"}}),":",s.jsx("span",{children:m(U.ORDER_DISCOUNT[0].discountValue)?`@${U.ORDER_DISCOUNT[0].discountValue}${U.ORDER_DISCOUNT[0].discountType=="RELATIVE"||U.ORDER_DISCOUNT[0].discountType=="COMPLIMENTARY"?"%":"AMT"}`:""})]})}),s.jsx("h5",{className:"actual-qty",children:d.curr+" "+m(U.ORDER_DISCOUNT[0].discountAmt)})]}):"",i=="25e5f1e4-68ff-43a7-b042-bebb93f42b94"&&y&&y.orderDisc?s.jsxs("div",{className:`bottom-section-div ${_e}`,children:[s.jsxs("h5",{className:"total-qty",children:[" ",d.couponCode?"COUPON DISC":"خصم الطلب",d.couponCode?`(${d.couponCode.toUpperCase()})`:""]}),s.jsx("h5",{className:"actual-qty"})]}):"",(Ke=y.charges)!=null&&Ke.length?y.charges.map(K=>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:O[`charges_${K.name.toLowerCase()}`]??K.name}})}),d.invoiceType=="INCLUSIVE_SIMPLIFIED"?s.jsx("h5",{className:"actual-qty",children:d.curr+" "+m(K.amt+K.taxAmt)}):s.jsx("h5",{className:"actual-qty",children:d.curr+" "+m(K.amt)})]})})):"",y.subTotal!==y.afterCharges&&y.afterCharges!==y.total&&d.invoiceType!=="INCLUSIVE_SIMPLIFIED"?s.jsxs("div",{className:`bottom-section-div inline-display ${_e}`,children:[s.jsx("h5",{className:"total-qty",dangerouslySetInnerHTML:{__html:O.amt_before_tax}}),s.jsx("h5",{className:"actual-qty",children:d.curr+" "+m(y.afterCharges)})]}):"",i=="25e5f1e4-68ff-43a7-b042-bebb93f42b94"&&y.subTotal!==y.afterCharges?s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h5",{className:"total-qty",children:"المبلغ قبل الضريبة"}),s.jsx("h5",{className:"actual-qty"})]}):"",d.invoiceType!=="INCLUSIVE_SIMPLIFIED"&&((yt=y.taxation)!=null&&yt.length)?y.taxation.map(K=>{if(K.taxAmt)return K.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:O.cgst}}),s.jsx("span",{children:"@"+K.tax/2+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:d.curr+" "+m(K.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:O[d.taxLabel.toLowerCase()]}}),s.jsx("span",{children:"@"+K.tax/2+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:d.curr+" "+m(K.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:O.vat}}),s.jsx("span",{children:"@"+K.tax+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:d.curr+" "+m(K.taxAmt)})]})}):"",s.jsxs("div",{className:`bottom-section-div inline-display ${_e}`,children:[s.jsx("h5",{className:"total-qty",dangerouslySetInnerHTML:{__html:O.total}}),s.jsx("h5",{className:"actual-qty",children:d.curr+" "+m(y.total)})]}),j?s.jsx(s.Fragment,{children:I==="GST"?s.jsxs(s.Fragment,{children:[s.jsx("h4",{className:"single-entity-and-center",style:{marginTop:"10px"},children:"- - - - -"}),s.jsx("div",{className:"space-2rem"})]}):""}):""]})},G=(y,d)=>{var U,b;let O=!1;const j=y.distributedData;return y.distributedData&&(O=Object.keys(y.distributedData).length>1),s.jsxs(s.Fragment,{children:[((U=j.GST)==null?void 0:U.itemList)&&J(j.GST,y,{labels:d,doMultipleTax:O,type:"GST"}),((b=j.VAT)==null?void 0:b.itemList)&&J(j.VAT,y,{labels:d,doMultipleTax:O,type:"VAT"})]})},de=y=>{const d=y.services,O=Object.keys(y.services),j=O.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:k[l].itemName}),s.jsx("h5",{className:"items products-heading-qty-kot",children:"QTY"})]}),s.jsx("hr",{})]}),s.jsxs("section",{className:"products-section",children:[j&&O.map((U,b)=>s.jsxs(s.Fragment,{children:[s.jsx("h4",{className:"left-align-entity level3-bold",children:s.jsxs("u",{children:[U.toUpperCase(),":"]})}),d[U].map(F=>{var z;return s.jsxs("div",{children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h4",{className:`items products-heading-name-kot ${k[l].dynamicClassname}`,children:Ve(F.serviceName)}),s.jsx("h4",{className:`items products-heading-qty-kot ${k[l].dynamicClassname}`,children:F.qty})]}),((z=F.addons)==null?void 0:z.length)&&F.addons.map(he=>{var Ae;return s.jsx("h5",{className:"items products-heading-addon-kot",children:"- "+((Ae=he.serviceName)==null?void 0:Ae.toUpperCase())})}),F.instruction&&s.jsx("h5",{className:"left-align-entity",children:s.jsx("h5",{className:"items products-heading-addon-kot",children:" ("+F.instruction+")"})})]})}),j!==b+1&&s.jsx("br",{})]})),s.jsx("hr",{})]})]})},W=y=>{const d=y.slice(0,-4),O=y.slice(-4);return{firstDigits:d,last4Dgits:O}},X=(y,d,O,j={})=>{const I=Object.keys(d??{});let U=[],b,F="flex-two-items";if(j.action==="addCharges"&&(F="display-percentage"),y&&I.length){U.push(s.jsxs(s.Fragment,{children:[s.jsx("h4",{className:"single-entity-and-center",children:`${O.toUpperCase()} BREAK-UP`}),s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsxs("span",{children:["Total ",O,":"]}),s.jsx("span",{children:ie(y,o)})]})]}));for(let z=0;z<I.length;z++)b=I[z],d[b]&&U.push(s.jsxs("h5",{className:`left-align-entity level3-bold ${F} second-span-right`,children:[s.jsx("span",{children:` -- ${b.replaceAll("_"," ")}:`}),s.jsx("span",{children:ie(d[b],o)}),j.action==="addCharges"?s.jsx("span",{children:m(ys(y,d[b]))+"%"}):""]}));U.push(s.jsx("hr",{}))}return U},st=y=>{const d=Object.keys(y.Category),O=Object.keys(y.Addon);let j=new Array;return j.push(s.jsxs(s.Fragment,{children:[s.jsx("h3",{className:"left-align-entity level3-bold",children:"Product Category"}),s.jsx("hr",{className:"dashed"})]})),d.forEach((I,U)=>{const b=y.Category[I];let F=[];j.push(s.jsxs(s.Fragment,{children:[s.jsxs("h4",{className:"left-align-entity level3-bold",children:[" - "," ",es(I)]}),s.jsxs("section",{className:"products-section",children:[b.forEach(z=>{F.push(s.jsx(s.Fragment,{children:s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h6",{className:`items products-heading-name-kot ${k["3INCH"].dynamicClassname}`,children:z.serviceName}),s.jsx("h6",{className:`items products-heading-qty-kot ${k["3INCH"].dynamicClassname}`,children:parseFloat(z.qty.toFixed(2))})]})}))}),F,U!=d.length-1&&s.jsx("hr",{})]})]}))}),O.length>0&&(j.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"})]})),O.forEach((I,U)=>{const b=y.Addon[I];let F=[];j.push(s.jsxs(s.Fragment,{children:[s.jsxs("h4",{className:"left-align-entity level3-bold",children:[" - "," ",es(I)]}),s.jsxs("section",{className:"products-section",children:[b.forEach(z=>{F.push(s.jsx(s.Fragment,{children:s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h6",{className:`items products-heading-name-kot ${k["3INCH"].dynamicClassname}`,children:z.serviceName}),s.jsx("h6",{className:`items products-heading-qty-kot ${k["3INCH"].dynamicClassname}`,children:parseFloat(z.qty.toFixed(2))})]})}))}),F,U!=O.length-1&&s.jsx("hr",{className:"dashed"})]})]}))})),j},nt=y=>{var O;const d={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((O=y==null?void 0:y.customBillLabels)!=null&&O.length){let j;for(let I=0;I<y.customBillLabels.length;I++)j=y.customBillLabels[I],d[j.defaultName]=j.displayName}return d},Ot=(y,d,O,j)=>{var z,he,Ae,He,Le,Oe,De,Ke,yt,K,At,at,gs,xs,an,Ns,js,ln,on,cn,dn,hn,un,mn,qt,vs,gt,Kt,Qt,_s,fn,bs,pn,Ss,Ts,yn,gn,ws,Is,xn,Nn,jn,vn,g,M;const I=nt(r.customLabelsMap),U=us(xd(r.paymentModes),"internalName"),b=C=>{var N;return(N=U[C])!=null&&N.displayName?U[C].displayName.toUpperCase():C};if(y==="BILL"){let C;if(l==="A4"||l==="A5"){let N={...d},Y=0,V=N.distributedData;const R=V.discounts;C=s.jsx("div",{className:`invoiceContainer main-div ${k[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:[N.companyInfo.companyName,":"]})})})}),s.jsxs("tr",{className:"subtotalTr",children:[s.jsxs("td",{width:"50%",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:`${I.order_no}:`},className:"font-weight-bold"}),s.jsx("span",{children:N.orderId})]}),s.jsxs("td",{width:"50%",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:`${I.date}:`},className:"font-weight-bold"}),s.jsx("span",{children:N.orderInfo.orderDate})]})]})]}),s.jsx("td",{colSpan:3,className:"text-right",children:s.jsx("div",{className:"d-flex justify-content-center",children:O&&s.jsx("img",{src:O,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:[(N.customerInfo.custName||((z=N.customFields)==null?void 0:z.length))&&s.jsx("tr",{children:s.jsx("td",{colSpan:"2",className:"text-center border-right",children:s.jsx("strong",{children:"Bill To"})})}),N.customerInfo.custName&&N.customerInfo.custName!==""&&s.jsx("tr",{children:s.jsx("td",{width:"10%",children:N.customerInfo.custName})}),N.customerInfo.custContact&&N.customerInfo.custContact!==""&&s.jsx("tr",{children:s.jsx("td",{width:"10%",children:N.customerInfo.custContact})}),N.customerInfo.custAddress&&N.customerInfo.custAddress!==""&&s.jsx("tr",{children:s.jsx("td",{width:"10%",children:N.customerInfo.custAddress})}),N.deliveryTimestamp&&s.jsx("tr",{children:s.jsx("td",{width:"10%",children:N.deliveryTimestamp})}),(he=N.customFields)!=null&&he.length?N.customFields.map(T=>s.jsx("tr",{children:s.jsxs("td",{width:"10%",children:[T.customName,": ",T.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:N.companyInfo.companyName})}),N.companyInfo.companyAddress&&N.companyInfo.companyAddress!==""&&s.jsx("tr",{children:s.jsx("td",{width:"10%",children:N.companyInfo.companyAddress})}),N.companyInfo.companyEmail&&N.companyInfo.companyEmail!==""&&s.jsx("tr",{children:s.jsx("td",{width:"10%",children:N.companyInfo.companyEmail})}),N.companyInfo.companyContact&&N.companyInfo.companyContact!==""&&s.jsx("tr",{children:s.jsx("td",{width:"10%",children:N.companyInfo.companyContact})}),N.fssai&&N.fssai!==""&&s.jsx("tr",{children:s.jsxs("td",{width:"10%",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:`${I.company_FSSAI}:`}}),s.jsx("span",{children:N.fssai})]})}),N.gst&&N.gst!==""&&s.jsx("tr",{children:s.jsxs("td",{width:"10%",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:`${I.company_GST}:`}}),s.jsx("span",{children:N.gst})]})}),N.vatNo&&N.vatNo!==""&&s.jsx("tr",{children:s.jsxs("td",{width:"10%",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:`${I.company_VAT}:`}}),s.jsx("span",{children:N.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:[N.itemList.map(T=>{var Ne;let ge="",pe=[];return Y++,pe.push(s.jsxs(s.Fragment,{children:[s.jsxs("tr",{style:{lineHeight:"10px"},className:ge,children:[s.jsx("td",{className:"text-align-left",children:T.serviceRate?Y:""}),s.jsx("td",{style:{width:"40%"},className:"text-align-left",children:T.serviceName.toUpperCase()}),s.jsx("td",{className:"text-align-left",children:T.qty}),s.jsx("td",{className:"text-align-right",children:T.serviceRate?B(T.serviceRate,o):""}),s.jsx("td",{className:"text-align-right",children:T.sub_total?B(T.sub_total,o):""})]}),T.instruction&&s.jsxs("tr",{children:[s.jsx("td",{}),s.jsx("td",{style:{width:"40%"},children:"("+T.instruction+")"})]})]})),(Ne=T.addons)!=null&&Ne.length&&T.addons.map(we=>{pe.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:["+ ",we.serviceName.toUpperCase()]}),s.jsx("td",{children:we.qty*T.qty})]}),we.instruction&&s.jsxs("tr",{children:[s.jsx("td",{}),s.jsx("td",{style:{width:"40%"},children:"("+we.instruction+")"})]})]}))}),pe}),s.jsx("tr",{style:{lineHeight:"10px",fontSize:"14px"},children:s.jsx("td",{colSpan:5,children:s.jsx("strong",{className:"font-weight-bold",children:`Total ${Y} Items and ${ve(V.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(Me(N.finalAmount,o).toFixed(Bt[o].minimumFractionDigits??2))]})}),s.jsx("hr",{}),N.upiId&&d.companyInfo.companyName&&d.paymentStatus!=="PAID"&&(!d.splitDetails||((Ae=d.splitDetails)==null?void 0:Ae.length)==0)(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:D(d.upiId,d.orderId,d.companyInfo.companyName,d.paidAmt,{size:100})})})})]})),N.footerMessage?s.jsx("tr",{children:s.jsx("td",{colSpan:"2",children:s.jsx("div",{className:"single-entity-and-center",dangerouslySetInnerHTML:{__html:N.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:I.subtotal}})})}),s.jsx("td",{width:"50%",className:"text-align-right",children:B(V.subTotal,o)})]}),(He=R==null?void 0:R.DISCOUNT_ITEMS)!=null&&He.length?R.DISCOUNT_ITEMS.map(T=>s.jsxs("tr",{className:"subtotalTr",children:[s.jsxs("td",{width:"50%",children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:I[`disc_${T.discountName.toLowerCase()}`]??"DISC-"+T.discountName.toUpperCase()}}),s.jsx("span",{children:le(T)})]}),s.jsx("td",{className:"text-align-right",width:"50%",children:B(T.discountAmt,o)})]})):"",(Le=R==null?void 0:R.CATEGORY_DISCOUNT)!=null&&Le.length?R.CATEGORY_DISCOUNT.map(T=>s.jsxs("tr",{className:"subtotalTr",children:[s.jsxs("td",{width:"50%",children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:I[`disc_${T.discountName.toLowerCase()}`]??"DISC-"+T.discountName.toUpperCase()}}),s.jsx("span",{children:" @"+T.discountValue+"%"})]}),s.jsx("td",{className:"text-align-right",width:"50%",children:B(T.discountAmt,o)})]})):"",(Oe=R==null?void 0:R.ITEM_DISCOUNT)!=null&&Oe.length?R.ITEM_DISCOUNT.map(T=>s.jsxs("tr",{className:"subtotalTr",children:[s.jsxs("td",{width:"50%",children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:I[`disc_${T.discountName.toLowerCase()}`]??"DISC-"+T.discountName.toUpperCase()}}),s.jsx("span",{children:" @"+T.discountValue+"%"})]}),s.jsx("td",{className:"text-align-right",width:"50%",children:B(T.discountAmt,o)})]})):"",(Ke=(De=R==null?void 0:R.SEGMENT_DISCOUNT)==null?void 0:De[0])!=null&&Ke.discountAmt?s.jsxs("tr",{className:"subtotalTr",children:[s.jsxs("td",{width:"50%",children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:I[`segment_disc${R.SEGMENT_DISCOUNT[0].discountName.toLowerCase()}`]??"DISC-"+R.SEGMENT_DISCOUNT[0].discountName.toUpperCase()}}),s.jsx("span",{children:" @"+R.SEGMENT_DISCOUNT[0].discountValue+"%"})]}),s.jsx("td",{className:"text-align-right",width:"50%",children:B(R.SEGMENT_DISCOUNT[0].discountAmt,o)})]}):"",(K=(yt=R==null?void 0:R.COUPON_DISCOUNT)==null?void 0:yt[0])!=null&&K.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:`(${R.COUPON_DISCOUNT[0].discountName.toUpperCase()}) @${R.COUPON_DISCOUNT[0].discountValue}${R.COUPON_DISCOUNT[0].discountType=="RELATIVE"?"%":"AMT"}`})]}),s.jsx("td",{className:"text-align-right",width:"50%",children:B(R.COUPON_DISCOUNT[0].discountAmt,o)})]}):"",(at=(At=R==null?void 0:R.ORDER_DISCOUNT)==null?void 0:At[0])!=null&&at.discountAmt?s.jsxs("tr",{className:"subtotalTr",children:[s.jsxs("td",{width:"50%",children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:I.order_disc??"ORDER DISC"}}),s.jsx("span",{children:m(R.ORDER_DISCOUNT[0].discountValue)?`@${R.ORDER_DISCOUNT[0].discountValue}${R.ORDER_DISCOUNT[0].discountType=="RELATIVE"||R.ORDER_DISCOUNT[0].discountType=="COMPLIMENTARY"?"%":"AMT"}`:""})]}),s.jsx("td",{className:"text-align-right",width:"50%",children:B(R.ORDER_DISCOUNT[0].discountAmt,o)})]}):"",(gs=V.charges)!=null&&gs.length?V.charges.map(T=>s.jsxs("tr",{className:"subtotalTr",children:[s.jsx("td",{width:"50%",children:s.jsx("span",{dangerouslySetInnerHTML:{__html:I[`charges_${T.name.toLowerCase()}`]??T.name}})}),s.jsx("td",{className:"text-align-right",width:"50%",children:B(T.amt,o)})]})):"",V.subTotal!==V.afterCharges?s.jsxs("tr",{className:"subtotalTr",children:[s.jsx("td",{width:"50%",children:s.jsx("span",{dangerouslySetInnerHTML:{__html:I.amt_before_tax}})}),s.jsx("td",{className:"text-align-right",width:"50%",children:B(V.afterCharges,o)})]}):"",(xs=V.taxation)!=null&&xs.length?V.taxation.map(T=>T.taxType==="GST"?s.jsxs(s.Fragment,{children:[s.jsxs("tr",{className:"subtotalTr",children:[s.jsxs("td",{width:"50%",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.cgst}}),s.jsx("span",{children:" @"+T.tax/2+"%"})]}),s.jsx("td",{className:"text-align-right",width:"50%",children:B(T.taxAmt/2,o)})]}),s.jsxs("tr",{className:"subtotalTr",children:[s.jsxs("td",{width:"50%",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.sgst}}),s.jsx("span",{children:" @"+T.tax/2+"%"})]}),s.jsx("td",{className:"text-align-right",width:"50%",children:B(T.taxAmt/2,o)})]})]}):s.jsxs("tr",{className:"subtotalTr",children:[s.jsxs("td",{width:"50%",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.vat}}),s.jsx("span",{children:" @"+T.tax+"%"})]}),s.jsx("td",{className:"text-align-right",width:"50%",children:B(T.taxAmt,o)})]})):"",s.jsxs("tr",{className:"font-weight-bold subtotalTr",children:[s.jsx("td",{width:"50%",children:s.jsx("strong",{dangerouslySetInnerHTML:{__html:I.grand_total}})}),s.jsx("td",{className:"text-align-right",width:"50%",children:B(N.finalAmount,o)})]}),(an=d==null?void 0:d.custoutStandingData)!=null&&an.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:I.previous_outstanding}})}),s.jsx("td",{className:"text-align-right",width:"50%",children:B((Ns=N==null?void 0:N.custoutStandingData)==null?void 0:Ns.balanceAmt,o)})]}),s.jsxs("tr",{className:"font-weight-bold subtotalTr",children:[s.jsx("td",{width:"50%",children:s.jsx("strong",{dangerouslySetInnerHTML:{__html:I.total_payable}})}),s.jsx("td",{className:"text-align-right",width:"50%",children:B(N.grandTotal+((js=N==null?void 0:N.custoutStandingData)==null?void 0:js.balanceAmt),o)})]})]}):"",N.rewardAmt?s.jsxs("tr",{className:"subtotalTr",children:[s.jsx("td",{width:"50%",children:s.jsx("span",{dangerouslySetInnerHTML:{__html:I.rewards_redeemed}})}),s.jsx("td",{className:"text-align-right",width:"50%",children:B(N.rewardAmt,o)})]}):"",(ln=d.paymentMethods)!=null&&ln.length?d.paymentMethods.map(T=>{var ge;if(T.paidAmt)return s.jsxs("tr",{className:"subtotalTr",children:[s.jsxs("td",{width:"50%",children:["-"," ",s.jsx("span",{dangerouslySetInnerHTML:{__html:I[`${(ge=T.paymentMode)==null?void 0:ge.toLowerCase()}`]??b(T.paymentMode)??"CASH"}}),s.jsx("span",{children:T.isRefund?"(Refund)":""})]}),T.isRefund?s.jsx("td",{className:"text-align-right",width:"50%",children:"("+B(T.paidAmt,o)+")"}):s.jsx("td",{className:"text-align-right",width:"50%",children:B(T.paidAmt,o)})]})}):"",N.balanceAmt&&d.balanceAmt!=0?s.jsxs("tr",{className:"subtotalTr",children:[s.jsx("td",{width:"50%",children:s.jsx("span",{dangerouslySetInnerHTML:{__html:I.balance_amt}})}),s.jsx("td",{className:"text-align-right",width:"50%",children:B(d.balanceAmt,o)})]}):"",d.balPoint&&!Number.isNaN(d.balPoint)?s.jsxs("tr",{className:"subtotalTr",children:[s.jsx("td",{width:"50%",children:s.jsx("span",{dangerouslySetInnerHTML:{__html:I.reward_point_balance}})}),s.jsx("td",{className:"text-align-right",width:"50%",children:d.balPoint})]}):"",(on=d.splitDetails)!=null&&on.length?s.jsxs(s.Fragment,{children:[s.jsx("div",{style:{marginTop:"6px"},children:s.jsx("h7",{className:"level2-bold",children:"Split Bill by Guest Details:"})}),d.splitDetails.map(T=>s.jsxs("tr",{className:"subtotalTr",children:[s.jsx("td",{width:"50%",children:s.jsx("span",{dangerouslySetInnerHTML:{__html:T.name}})}),s.jsx("td",{className:"text-align-right",width:"50%",children:d.curr+" "+T.amount})]}))]}):"",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 :${N.printby} Printed On: ${N.printTime}`}),N.disabledPoweredBy?"":s.jsx("p",{className:"single-entity-and-center f-12 mt-2 avoid-page-break",children:"Powered By: www.recaho.com"})]})})}else C=s.jsx("div",{className:"main-div bill",style:{width:k[l].paperSize},children:s.jsxs("div",{style:{width:"100%",textAlign:"left",marginLeft:"auto"},children:[d.duplicateBill?s.jsx("h4",{className:"single-entity-and-center",children:"DUPLICATE BILL"}):"",s.jsx("br",{}),O&&s.jsx("div",{className:"image-bill",children:s.jsx("img",{src:O,className:"single-entity-and-center",style:{width:k[l].logoWidth}})}),s.jsxs("div",{className:`details-section ${k[l].dynamicClassname}`,children:[!O&&d.companyInfo.companyName&&d.companyInfo.companyName!=""&&s.jsx("h1",{className:"single-entity-and-center",children:d.companyInfo.companyName}),d.companyInfo.companyAddress&&d.companyInfo.companyAddress!==""&&s.jsx("h3",{className:"single-entity-and-center",dangerouslySetInnerHTML:{__html:d.companyInfo.companyAddress}}),d.companyInfo.companyContact&&d.companyInfo.companyContact!==""&&s.jsx("h3",{className:"single-entity-and-center",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.company_mobile}}),": ",s.jsx("span",{children:d.companyInfo.companyContact})]})}),d.companyInfo.companyEmail&&d.companyInfo.companyEmail!==""&&s.jsx("h3",{className:"single-entity-and-center",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.company_Email}}),": ",s.jsx("span",{children:d.companyInfo.companyEmail})]})}),d.fssai&&d.fssai!==""&&s.jsx("h3",{className:"single-entity-and-center",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.company_FSSAI}}),": ",s.jsx("span",{children:d.fssai})]})}),d.gst&&d.gst!==""&&s.jsx("h3",{className:"single-entity-and-center",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.company_GST}}),": ",s.jsx("span",{children:d.gst})]})}),d.vatNo&&d.vatNo!==""&&s.jsx("h3",{className:"single-entity-and-center",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.company_VAT}}),": ",s.jsx("span",{children:d.vatNo})]})}),s.jsx("hr",{}),d.orderFrom&&s.jsx("h2",{className:"single-entity-and-center level2-bold",children:d.orderFrom}),d.area&&s.jsxs("h3",{className:"single-entity-and-center level2-bold",children:[d.area," : ",d.tableName?d.tableName:d.tableNo]}),d.tokenId&&s.jsx("h2",{className:"single-entity-and-center level2-bold",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.token_no}})," ",s.jsx("span",{children:d.tokenId})]})}),d.parentOrderRef&&s.jsx("h4",{className:"single-entity-and-center",children:"RETURN/EXCHANGE"})]}),s.jsx("hr",{}),s.jsxs("div",{className:`details-section ${k[l].dynamicClassname} ${_e}`,children:[d.customerInfo.custName&&d.customerInfo.custName!==""&&s.jsx("h5",{className:"left-align-entity",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.name}}),": ",s.jsx("span",{children:d.customerInfo.custName})]})}),d.customerInfo.custContact&&d.customerInfo.custContact!==""&&s.jsx("h5",{className:"left-align-entity",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.mobile}}),": ",s.jsx("span",{children:d.customerInfo.custContact})]})}),d.customerInfo.custAddress&&d.customerInfo.custAddress!==""&&s.jsx("h5",{className:"left-align-entity",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.address}}),": ",s.jsx("span",{children:d.customerInfo.custAddress})]})}),vt(d.appliedDiscounts??[],"COMPLIMENTARY","discountType").discountType&&s.jsx("h5",{className:"left-align-entity level2-bold",dangerouslySetInnerHTML:{__html:I.complementary_disc}}),d.orderId&&s.jsx("h5",{className:"left-align-entity",style:{flexShrink:0},children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.order_no}}),": ",s.jsx("span",{children:d.orderId})]})}),d.orderInfo.orderDate&&s.jsx("h5",{className:"left-align-entity",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.date}}),":",s.jsx("span",{children:d.orderInfo.orderDate})]})}),d.deliveryTimestamp&&s.jsx("h5",{className:"left-align-entity",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.delivery_date}}),":",s.jsx("span",{children:d.deliveryTimestamp})]})}),d.captainName&&s.jsx("h5",{className:"left-align-entity",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.captain_name}}),":",s.jsx("span",{children:d.captainName})]})})]}),(cn=d.customFields)!=null&&cn.length?s.jsxs("div",{className:`details-section ${k[l].dynamicClassname}`,children:[s.jsx("hr",{}),d.customFields.map(N=>s.jsx("h4",{className:"left-align-entity",children:N.customName+": "+N.customValue}))]}):"",d.newFormat?G(d,I):Q(d,I),s.jsx("br",{}),s.jsxs("div",{className:`bottom-section ${k[l].dynamicClassname}`,children:[s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h6",{className:`total-qty ${(dn=d.custoutStandingData)!=null&&dn.balanceAmt||d.rewardAmt&&d.paymentMethods&&d.paymentMethods.length>0?"level3-bold":"level2-bold"}`,style:{fontSize:l==="2INCH"||l==="1.8INCH"?"1.50rem":"1.75rem"},dangerouslySetInnerHTML:{__html:I.grand_total}}),s.jsx("h6",{className:`actual-qty ${(hn=d.custoutStandingData)!=null&&hn.balanceAmt||d.rewardAmt&&d.paymentMethods&&d.paymentMethods.length>0?"level3-bold":"level2-bold"}`,style:{fontSize:l==="2INCH"||l==="1.8INCH"?"1.40rem":"1.75rem"},children:d.curr+" "+m(d.finalAmount)})]}),(un=d.custoutStandingData)!=null&&un.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:I.previous_outstanding}})}),s.jsx("h5",{children:d.curr+" "+m(d.custoutStandingData.balanceAmt)})]}),!d.rewardAmt&&!d.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:I.total_payable}}),s.jsx("h6",{className:"actual-qty level2-bold",style:{fontSize:l==="2INCH"||l==="1.8INCH"?"1.40rem":"1.75rem"},children:d.curr+" "+m(d.finalAmount+d.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"}})]}):"",d.rewardAmt?s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsxs("h5",{children:["- ",s.jsx("span",{dangerouslySetInnerHTML:{__html:I.rewards_redeemed}}),s.jsx("span",{children:"("+d.usedPoints+" Points)"})]}),s.jsx("h5",{children:d.curr+" "+d.rewardAmt})]}):"",d.paymentMethods&&d.paymentMethods.length?d.paymentMethods.map(N=>{var Y;if(N.paidAmt)return s.jsxs("div",{className:`bottom-section-div inline-display ${_e}`,children:[s.jsxs("h5",{children:["-",s.jsx("span",{dangerouslySetInnerHTML:{__html:I[`${(Y=N.paymentMode)==null?void 0:Y.toLowerCase()}`]??b(N.paymentMode)??"CASH"}}),s.jsx("span",{children:N.isRefund?"(Refund)":""})]}),s.jsx("h5",{children:N.isRefund?s.jsx(s.Fragment,{children:d.curr+" ("+m(N.paidAmt)+")"}):s.jsx(s.Fragment,{children:d.curr+" "+m(N.paidAmt)})})]})}):"",d.rewardAmt&&!d.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:I.total_payable}}),s.jsx("h6",{className:"actual-qty level2-bold",style:{fontSize:l==="2INCH"||l==="1.8INCH"?"1.40rem":"1.75rem"},children:d.curr+" "+m(d.finalAmount+(((mn=d==null?void 0:d.custoutStandingData)==null?void 0:mn.balanceAmt)||0)-d.rewardAmt)})]})}):"",Ch((qt=d.convertedCurrValue)==null?void 0:qt.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:`(${B(d.convertedCurrValue.value,d.convertedCurrValue.curr)})`})]}):"",d.balanceAmt&&d.balanceAmt!=0?s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{dangerouslySetInnerHTML:{__html:I.balance_amt}}),s.jsx("h5",{children:d.curr+" "+m(d.balanceAmt)})]}):"",s.jsx("hr",{})]}),d.earnPoints&&d.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:d.earnPoints})]}):"",(d.balPoint||d.earnPoints)&&!Number.isNaN(d.balPoint||d.earnPoints)?s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h6",{className:"total-qty line-gaps",dangerouslySetInnerHTML:{__html:I.reward_point_balance}}),s.jsx("h6",{className:"actual-qty",children:d.balPoint+d.earnPoints||0})]}):"",(vs=d.splitDetails)!=null&&vs.length?s.jsxs(s.Fragment,{children:[s.jsx("div",{style:{marginTop:"6px"},children:s.jsx("h5",{className:"level2-bold",children:"Split Bill by Guest Details:"})}),d.splitDetails.map(N=>s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h5",{className:"total-qty line-gaps level3-bold",dangerouslySetInnerHTML:{__html:N.name}}),s.jsx("h5",{className:"actual-qty level3-bold",children:d.curr+" "+N.amount})]}))]}):"",d.invoiceType==="INCLUSIVE_SIMPLIFIED"&&((gt=d.taxation)!=null&>.length)?s.jsxs("div",{children:[s.jsx("div",{className:"single-entity-and-center",style:{marginTop:"6px"},children:s.jsx("h6",{className:"level2-bold",children:"Tax Summary"})}),s.jsx("div",{className:"single-entity-and-center",style:{marginTop:"6px"},children:s.jsxs("table",{border:"1",style:{textAlign:"center",margin:"0 auto",marginBottom:"6px",width:"100%"},children:[s.jsxs("tr",{className:k[l].dynamicClassname,children:[s.jsx("th",{children:"Tax Name"}),s.jsx("th",{children:"Taxable Amt"}),s.jsx("th",{children:"Tax Amt"})]}),d.taxation.map(N=>{if(N.taxAmt)return Ct==="Android OS"||Ct==="iOS"?N.taxType==="GST"?s.jsxs(s.Fragment,{children:[s.jsxs("tr",{className:k[l].dynamicClassname,children:[s.jsx("th",{dangerouslySetInnerHTML:{__html:`${I.cgst} ${N.tax/2}%`}}),s.jsx("th",{children:d.curr+" "+Me(N.taxableAmt,o)}),s.jsx("th",{children:d.curr+" "+Me(N.taxAmt/2,o)})]}),s.jsxs("tr",{className:k[l].dynamicClassname,children:[s.jsx("th",{dangerouslySetInnerHTML:{__html:`${I[d.taxLabel.toLowerCase()]} ${N.tax/2}%`}}),s.jsx("th",{children:d.curr+" "+Me(N.taxableAmt,o)}),s.jsx("th",{children:d.curr+" "+Me(N.taxAmt/2,o)})]})]}):s.jsxs("tr",{className:k[l].dynamicClassname,children:[s.jsx("th",{dangerouslySetInnerHTML:{__html:`${I.vat} ${N.tax}%`}}),s.jsx("th",{children:d.curr+" "+Me(N.taxableAmt,o)}),s.jsx("th",{children:d.curr+" "+Me(N.taxAmt,o)})]}):N.taxType==="GST"?s.jsxs(s.Fragment,{children:[s.jsxs("tr",{className:k[l].dynamicClassname,children:[s.jsx("td",{dangerouslySetInnerHTML:{__html:`${I.cgst} ${N.tax/2}%`}}),s.jsx("td",{children:d.curr+" "+Me(N.taxableAmt,o)}),s.jsx("td",{children:d.curr+" "+Me(N.taxAmt/2,o)})]}),s.jsxs("tr",{className:k[l].dynamicClassname,children:[s.jsx("td",{dangerouslySetInnerHTML:{__html:`${I[d.taxLabel.toLowerCase()]} ${N.tax/2}%`}}),s.jsx("td",{children:d.curr+" "+Me(N.taxableAmt,o)}),s.jsx("td",{children:d.curr+" "+Me(N.taxAmt/2,o)})]})]}):s.jsxs("tr",{className:k[l].dynamicClassname,children:[s.jsx("td",{dangerouslySetInnerHTML:{__html:`${I.vat} ${N.tax}%`}}),s.jsx("td",{children:d.curr+" "+Me(N.taxableAmt,o)}),s.jsx("td",{children:d.curr+" "+Me(N.taxAmt,o)})]})})]})})]}):"",d.upiId&&d.companyInfo.companyName&&(!d.splitDetails||((Kt=d.splitDetails)==null?void 0:Kt.length)==0)&&s.jsxs("div",{className:"single-entity-and-center",children:[s.jsx("h6",{style:{marginTop:"6px"},children:"Scan this QRCode to Pay"}),D(d.upiId,d.orderId,d.companyInfo.companyName,d.paidAmount)]}),d.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."}),$(r.vatNo,d)]}),j?s.jsx("div",{className:"image-bill",children:s.jsx("img",{src:`${j}`,className:"single-entity-and-center",style:{width:k[l].logoWidth}})}):"",d.footerMessage?s.jsx("h4",{className:"single-entity-and-center",dangerouslySetInnerHTML:{__html:d.footerMessage}}):"",d.printby&&d.printOperatorInfo?s.jsx("h6",{className:"left-align-entity",children:`Printed By:${d.printby}`}):"",d.printTime&&d.printOperatorInfo?s.jsx("h6",{className:"left-align-entity",children:`Printed On:${d.printTime}`}):"",d.disabledPoweredBy?"":s.jsx("h6",{className:"single-entity-and-center",children:"Powered By: www.recaho.com"})]})});return C}else if(y==="PRINT_DASHBOARD"&&d.salesCollection){const C=d.salesCollection.totalDiscountAmt?ys(d.salesCollection.grandTotal,d.salesCollection.totalDiscountAmt):null,N=d.salesCollection.totalCollection-d.salesCollection.totalTax;var F=L().format("DD/MM/YYYY LT");const Y=(Qt=d.monthTillDateSalesColl)!=null&&Qt.totalDiscountAmt?ys(d.monthTillDateSalesColl.grandTotal,d.monthTillDateSalesColl.totalDiscountAmt):null;return s.jsxs("div",{className:`main-div ${k[l].dynamicClassname}`,style:{width:k[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:- ${F}`}),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:d.selectedDate})]}),s.jsx("hr",{}),d.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:ie(d.monthTillDateSalesColl.grandTotal,o)})]}),s.jsxs("h5",{className:"level3-bold flex-two-items",children:[s.jsx("span",{children:"DISCOUNT:"}),s.jsx("span",{children:`${ie(d.monthTillDateSalesColl.totalDiscountAmt,o)}${Y?`(${m(Y)}%)`:""}`})]}),s.jsxs("h5",{className:"level3-bold flex-two-items",children:[s.jsx("span",{children:"CHARGES:"}),s.jsx("span",{children:ie(d.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:ie(d.monthTillDateSalesColl.totalCollection-d.monthTillDateSalesColl.totalTax,o)})]}),s.jsxs("h5",{className:"level3-bold flex-two-items",children:[s.jsx("span",{children:"TAX:"}),s.jsx("span",{children:ie(d.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:ie(d.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:ie(d.salesCollection.grandTotal,o)})]}),s.jsxs("h5",{className:"level3-bold flex-two-items",children:[s.jsx("span",{children:"DISCOUNT:"}),s.jsx("span",{children:`${ie(d.salesCollection.totalDiscountAmt,o)}${C?`(${m(C)}%)`:""}`})]}),s.jsxs("h5",{className:"level3-bold flex-two-items",children:[s.jsx("span",{children:"CHARGES:"}),s.jsx("span",{children:ie(d.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:ie(N,o)})]}),s.jsxs("h5",{className:"level3-bold flex-two-items",children:[s.jsx("span",{children:"TAX:"}),s.jsx("span",{children:ie(d.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:ie(d.salesCollection.totalCollection,o)})]})]}),s.jsx("hr",{}),X(d.otherFields.totalDiscountAmt,d.otherFields.discountList,"Discount",{action:"addCharges"}),X(d.otherFields.totalOtherCharges,d.otherFields.otherChargesList,"Charges"),X(d.otherFields.totalTax,d.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:ie(d.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:d.salesCollection.totalOrders})]}),S(d)]}),s.jsx("hr",{}),d.otherFields.totalItemType?s.jsx("div",{children:X(d.otherFields.totalItemType,d.otherFields.itemTypeList,"Item Type",{action:"addCharges"})}):"",d.averageCollection.avgTableTime||d.averageCollection.avgorderValue||d.averageCollection.noOfGuest?s.jsxs("div",{children:[s.jsx("h4",{className:"single-entity-and-center",children:"PERFORMANCE METRICS"}),d.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:d.averageCollection.avgTableTime})]}):"",d.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:ie(d.averageCollection.avgorderValue,o)})]}):"",d.averageCollection.noOfGuest?s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:"Covers:"}),s.jsx("span",{children:d.averageCollection.noOfGuest})]}):"",d.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:ie(d.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:ie(d.totalCollection,o)})]}),w(d)]}),P(d.averageCollection),d.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:ie(d.otherFields.salesCollection,o)})]}),d.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:ie(d.otherFields.outstandingAmt,o)})]}):""]})]}):"",s.jsx("hr",{}),Se(d.averageCollection.dailyExpanse)]}),s.jsx("br",{}),Ct=="Android OS"&&s.jsx("div",{className:"space-3rem"})]})}else if(y==="AGGREGATOR_BILL"){let C;return a.aggregatorOrderId&&a.aggregatorOrderId!==""&&(C=W(a.aggregatorOrderId)),s.jsx("div",{className:"main-div bill",style:{width:k[l].paperSize},children:s.jsxs("div",{children:[s.jsxs("div",{style:{width:"100%",textAlign:"left",marginLeft:"auto"},children:[s.jsx("br",{}),O&&s.jsx("div",{className:"image-bill",children:s.jsx("img",{src:O,className:"single-entity-and-center",style:{width:k[l].logoWidth}})}),s.jsxs("div",{className:`details-section ${k[l].dynamicClassname}`,children:[!O&&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:I.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:I.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:I.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:I.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:I.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&&C&&s.jsxs("h4",{className:"single-entity-and-center",children:[`${a.orderSource}: ${C.firstDigits||""}`,s.jsxs("span",{style:{fontSize:"2rem"},children:["-",C.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:I.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:I.token_no}})," ",s.jsx("span",{children:a.tokenId})]})})]}),s.jsx("hr",{}),s.jsxs("div",{className:`details-section ${k[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:I.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:I.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:I.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:I.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:I.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:I.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:k[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:[((_s=a.services)==null?void 0:_s.length)&&a.services.map(Y=>{var V;return s.jsxs("div",{style:Y.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:Y.serviceName.toUpperCase()}),s.jsx("h6",{className:"items products-heading-qty-kot",children:Y.qty})]}),((V=Y.addons)==null?void 0:V.length)&&Y.addons.map(R=>s.jsx("h6",{className:"items products-heading-addon-kot",children:"- "+Ve(R.serviceName)})),Y.instruction&&a.itemInstructionOnBill&&s.jsx("h6",{className:"left-align-entity level2-bold",children:s.jsx("h6",{className:"items products-heading-addon-kot",children:Y.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:ie(a.discountAmt,o)})]}):"",a.otherCharges&&a.otherCharges.length>0?a.otherCharges.map(Y=>{if(Y.amt)return s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h5",{children:Y.name}),s.jsx("h5",{children:a.curr+" "+m(Y.amt)})]})}):"",a.taxObj&&a.taxObj.GST?s.jsx(s.Fragment,{children:a.taxObj.GST.map(Y=>{let V=new Array;for(const R in Y)if(Y[R]&&Y[R]!=0){let T=R/2;V.push(s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"bottom-section-div",children:[s.jsxs("h5",{children:["CGST @",T]}),s.jsx("h5",{children:a.curr+" "+m(Y[R]/2)})]}),s.jsxs("div",{className:"bottom-section-div",children:[s.jsxs("h5",{children:[d.taxLabel+" "," @",T,"%"]}),s.jsx("h5",{children:a.curr+" "+m(Y[R]/2)})]})]}))}return V})}):"",s.jsx("div",{style:{marginTop:"6px"},children:(fn=a.customFeilds)==null?void 0:fn.map(Y=>s.jsx("h4",{className:"left-align-entity",children:Y.customName+": "+Y.customValue}))}),a.paymentState&&s.jsx("h4",{className:"single-entity-and-center",style:{marginTop:"6px"},children:`Payment Status: ${a.paymentState=="PAID_ONLINE"?"Online paid":"COD"}`}),j?s.jsx("div",{className:"image-bill",children:s.jsx("img",{src:`${j}`,className:"single-entity-and-center",style:{width:k[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(y==="UPDATE_TABLE"){let C="";return a.action==="SWITCH_TABLE"?C=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:["**",(bs=h.Table)==null?void 0:bs.toUpperCase()," SWITCH**"]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:"From"}),s.jsx("h5",{className:"left-align-entity level3-bold",children:(pn=a.from)==null?void 0:pn.map((N,Y)=>{var V,R,T;return`${(R=(V=e.tableData[N])==null?void 0:V.attachedArea)==null?void 0:R.toUpperCase()} - ${(T=e.tableData[N])==null?void 0:T.tableName}${Y+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:`${(Ts=(Ss=e.tableData[a.to[0]])==null?void 0:Ss.attachedArea)==null?void 0:Ts.toUpperCase()} - ${(yn=e.tableData[a.to[0]])==null?void 0:yn.tableName}`}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["Running ",`${h.KOT}`,"s: ",Object.keys(a.activeKots).join(", ")]})]})}):C=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 ",(gn=h.Table)==null?void 0:gn.toUpperCase(),"**"]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:"From"}),s.jsx("h5",{className:"left-align-entity level3-bold",children:(ws=a.from)==null?void 0:ws.map((N,Y)=>{var V,R,T;return`${(R=(V=e.tableData[N])==null?void 0:V.attachedArea)==null?void 0:R.toUpperCase()} - ${(T=e.tableData[N])==null?void 0:T.tableName}${Y+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:`${(xn=(Is=e.tableData[a.to[0]])==null?void 0:Is.attachedArea)==null?void 0:xn.toUpperCase()} - ${(Nn=e.tableData[a.to[0]])==null?void 0:Nn.tableName}`}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["Running ",`${h.KOT}`,"s: ",Object.keys(a.activeKots).join(", ")]})]})}),C}else if(y==="COUNTER_OPERATION"){let C;return l=="2INCH"||l=="1.8INCH"?C=s.jsx("div",{className:"main-div",style:{width:k[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: ",B(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: ",B(a.cashSale,o)," "]}),a.payModes&&a.payModes.length>0&&a.payModes.map(N=>{if(N.value>0||N.value<0)return s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- ",N.displayName," : ",B(N.value,o)]})})]}),s.jsxs("h4",{className:"left-align-entity level3-bold",children:["Cash Balance: ",B(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:[" ",B(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:[" ",B(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:[" ",B(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(N=>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"?B(N.denomination,o):N.denomination]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" X "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",N.count," "]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" = "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",B(N.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:B(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:[" ",B(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:[" ",B(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:[" ",B(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:[" ",B(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:[" -",B(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:[" +",B(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:[" -",B(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:[" +",B(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(N=>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"?B(N.denomination,o):N.curr+" "+N.denomination]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" X "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",N.count," "]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" = "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",B(N.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:B(a.TotalDenomationsAmount,o)})]})]})}):C=s.jsx("div",{className:"main-div",style:{width:k[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: ",B(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: ",B(a.cashSale,o)," "]}),a.payModes&&a.payModes.length>0&&a.payModes.map(N=>{if(N.value>0)return s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- ",N.displayName," : ",B(N.value,o)]})})]}),s.jsxs("h4",{className:"left-align-entity level3-bold",children:["Cash Balance: ",B(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 : ",B(a.openingBalance,o)]}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- Actual Opening Balance : ",B(a.actualOpeningBalance,o)]}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- Opening Difference Amt : ",B(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(N=>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"?B(N.denomination,o):N.denomination]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" X "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",N.count," "]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" = "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",B(N.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:B(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 : ",B(a.cashSale,o)," "]}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- System Closing Balance : ",B(a.closingBalance,o)]}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- Actual Closing Balance : ",B(a.closingActualBalance,o)]}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- Closing Difference Amt : ",B(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 : -",B(a.debitEntry,o)]}),a.creditEntry>0&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- Other Cash Income : +",B(a.creditEntry,o)]}),a.internalTransferDebit>0&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- Internal Transfer(cash to bank): -",B(a.internalTransferDebit,o)]}),a.internalTransferCredit>0&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- Internal Transfer(bank to cash): +",B(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(N=>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"?B(N.denomination,o):N.curr+" "+N.denomination]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" X "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",N.count," "]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" = "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" ",B(N.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:B(a.TotalDenomationsAmount,o)})]})]})}),C}else if(y==="ITEMWISE_SALES_COUNTER"){let C,{counterDetails:N}=e.printerDataObject;return C=s.jsx("div",{className:"main-div",style:{width:k[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:N.currentDate}),s.jsx("hr",{}),N.CounterName&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:["Counter Name: ",N.CounterName]}),N.CounterName&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:["UserName: ",N.openedBy]}),N.CounterName&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:["Login Time: ",N.loginTime]}),N.logoutTime&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:["Logout Time: ",N.logoutTime]}),N.CounterName&&s.jsx("hr",{}),st(a),s.jsx("hr",{}),s.jsx("h6",{className:"left-align-entity",children:`Printed By: ${N.openedBy}`}),s.jsx("h6",{className:"left-align-entity",children:`Printed On: ${N.printedOn}`})]})}),C}else if(y==="CARD_RECHARGE_DETAILS"){let{staticDataKOT:C}=e.printerDataObject;return getRechargeDetails(C)}else if(y==="PACKAGING_SLIP"){let C,N=0;d.aggregatorOrderId&&d.aggregatorOrderId!==""&&(C=W(d.aggregatorOrderId));const Y=d.services;for(let R in Y)N+=Y[R].length;return s.jsx("div",{className:"main-div",style:{width:k[l].paperSize},children:s.jsxs("div",{style:{width:"100%",textAlign:"left",marginLeft:"auto"},children:[s.jsx("br",{}),s.jsxs("div",{className:`details-section ${k[l].dynamicClassname}`,children:[d.subOrderFrom&&s.jsx("h4",{className:"single-entity-and-center",children:d.subOrderFrom.toUpperCase()}),d.orderFrom!=="dine-in"&&s.jsxs("h2",{className:"single-entity-and-center level2-bold",children:["Token No ",d.tokenId]}),d.tableName&&s.jsx("h2",{className:"single-entity-and-center level2-bold",children:d.tableName}),d.otp&&s.jsx("h4",{className:"single-entity-and-center level2-bold",children:"OTP: "+d.otp}),d.orderSource&&C&&s.jsxs("h4",{className:"single-entity-and-center level2-bold",children:[`${d.orderSource}: ${C.firstDigits||""}`,s.jsx("span",{style:{fontSize:"2rem"},children:C.last4Dgits||""})]}),d.zomatoInstant&&s.jsx("h4",{className:"single-entity-and-center level2-bold",children:d.zomatoInstant}),s.jsx("hr",{}),d.orderId&&s.jsx("h5",{className:"left-align-entity level3-bold",children:"Order Id: "+d.orderId}),d.date&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:["Printed On: ",d.date]}),d.prepareBy?s.jsx("h5",{className:"left-align-entity level3-bold",children:"Prepare By : "+d.prepareBy}):"",d.waiterName&&s.jsx("h5",{className:"left-align-entity level3-bold",children:`${h.Waiter} Name: `+d.waiterName})]}),de(d),s.jsx("br",{}),s.jsxs("div",{className:"bottom-section-div flex-two-items space-3rem",children:[s.jsxs("h5",{children:["TOTAL ITEMS: ",N]}),s.jsxs("h5",{children:["TOTAL QTY: ",ve(d.totalQty)]})]}),(jn=d.customFields)==null?void 0:jn.map(R=>s.jsx("h4",{className:"left-align-entity",children:R.customName+": "+R.customValue})),s.jsx("br",{}),d.orderFrom!=="dine-in"&&s.jsxs("h4",{className:"left-align-entity level3-bold",children:["Payment Status: ",d.paymentStatus.replace("_"," ")]})]})})}else{if(y==="ORDER_AGGREGATED_PRINT")return s.jsx("div",{className:"main-div",style:{width:k[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 ${k[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:I.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:I.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:I.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:I.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:I.name}}),": ",s.jsx("span",{children:a.name})]}),a.mobile&&s.jsxs("h5",{children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:I.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 ${k[l].dynamicClassname}`,children:"Date"}),s.jsx("h5",{className:`items products-heading-orderId ${k[l].dynamicClassname}`,children:"Order Id"}),s.jsx("h5",{className:`items products-heading-amount ${k[l].dynamicClassname}`,children:"Amount"})]})}),s.jsx("hr",{}),s.jsx("section",{className:"products-section",children:a.orders.map(N=>s.jsx("div",{style:{paddingTop:"12px"},children:s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h6",{className:`items products-heading-name ${k[l].dynamicClassname}`,children:rr(N.date)}),s.jsx("h6",{className:`items products-heading-orderId ${k[l].dynamicClassname}`,children:N.orderId}),s.jsx("h6",{className:`items products-heading-amount ${k[l].dynamicClassname}`,children:a.curr+" "+m(N.finalAmount)})]})},N.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)})]})]}),(vn=a.transactions)!=null&&vn.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 ${k[l].dynamicClassname}`,children:"Date"}),s.jsx("h5",{className:`items products-heading-orderId ${k[l].dynamicClassname}`,children:"Payment Mode"}),s.jsx("h5",{className:`items products-heading-amount ${k[l].dynamicClassname}`,children:"Amount"})]})}),s.jsx("hr",{}),s.jsx("section",{className:"products-section",children:a.transactions.map(N=>s.jsx("div",{style:{paddingTop:"12px"},children:s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h6",{className:`items products-heading-name ${k[l].dynamicClassname}`,children:N.date}),s.jsx("h6",{className:`items products-heading-orderId ${k[l].dynamicClassname}`,children:N.paymentMode}),s.jsx("h6",{className:`items products-heading-amount ${k[l].dynamicClassname}`,children:a.curr+" "+m(N.amount)})]})},N.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 C,N=0,Y,V;for(let T=0;T<(((g=a.services)==null?void 0:g.length)||0);T++)V=a.services[T],V.status==="CANCELLED"&&!a.onlyCancelledItems&&(N+=V.qty);return a.aggregatorOrderId&&a.aggregatorOrderId!==""&&(C=W(a.aggregatorOrderId)),s.jsx("div",{className:"main-div",style:{width:k[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"}):"",N||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&&C&&s.jsxs("h4",{className:"single-entity-and-center level2-bold",children:[`${a.orderSource}: ${C.firstDigits||""}`,s.jsx("span",{style:{fontSize:"2rem"},children:C.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:`${h.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:`${h.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:k[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(T=>(T.status==="CANCELLED"?Y=s.jsxs("strike",{children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h2",{className:"items products-heading-name-kot ",children:Ve(T.serviceName)}),s.jsx("h2",{className:"items products-heading-qty-kot ",children:T.qty})]}),T.addons&&T.addons.length&&T.addons.map(ge=>s.jsx("h2",{className:"items products-heading-addon-kot",children:"- "+Ve(ge.serviceName)})),T.instruction&&s.jsx("h4",{className:"left-align-entity level2-bold",children:s.jsx("h4",{className:"items products-heading-addon-kot",children:" "+T.instruction})})]}):Y=s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h2",{className:"items products-heading-name-kot ",children:Ve(T.serviceName)}),s.jsx("h2",{className:"items products-heading-qty-kot ",children:T.qty})]}),T.addons&&T.addons.length&&T.addons.map(ge=>s.jsx("h2",{className:"items products-heading-addon-kot",children:"- "+Ve(ge.serviceName)})),T.instruction&&s.jsx("h4",{className:"left-align-entity level2-bold",children:s.jsx("h4",{className:"items products-heading-addon-kot",children:" "+T.instruction})})]}),s.jsx("div",{children:Y}))),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-N)]})]}),(M=a.customFields)==null?void 0:M.map(T=>s.jsx("h4",{className:"left-align-entity",children:T.customName+": "+T.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:k[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 u,f,o;try{const{needPackagingSlip:l=!0}=r;e.primaryWaiter&&n&&(e.primaryWaiter=((u=n[e.primaryWaiter])==null?void 0:u.name)||null);const{obj:c,printersMap:h}=_d(e,t,r);let p=[],m=[];const x=[];if(ba(c).flatMap(v=>{(h[v.station]||[]).forEach(E=>{const S=new Promise(w=>{x.push(s.jsx(qe,{printerDataObject:{staticDataKOT:v,paperSize:E.paperSize,printer:E.printer},newId:v.newId,value:{settingData:t},onImageGenerated:D=>{p.push({paperSize:E.paperSize,printer:E.printer,image:D,type:"KOT"}),w()},additionalActions:r},v.newId+"::"+E.printer))});m.push(S)})}),l&&((f=t.packagingSlipPrinters)!=null&&f.length)){const v=bd(e,t,r);(o=v.printers)!=null&&o.length&&v.printers.forEach(_=>{m.push(new Promise(E=>{x.push(s.jsx(qe,{printerDataObject:{staticDataKOT:{obj:_.obj},paperSize:_.paperSize,printer:_.printer,type:"PACKAGING_SLIP"},newId:_.obj.newId,value:{settingData:t},onImageGenerated:S=>{p.push({paperSize:_.paperSize,printer:_.printer,image:S,type:"PACKAGING_SLIP"}),E()},additionalActions:r},_.obj.newId))}))})}x.length&&tt("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 u=[],f=[];if(n!=null&&n.action){const{obj:o,paperSize:l,printersMap:c}=Sd(e,t,n),h=ba(o).flatMap(p=>{var m;return(m=c[p.station])==null?void 0:m.map(x=>new Promise(v=>{const _=s.jsx(qe,{printerDataObject:{staticDataKOT:p,paperSize:l,printer:x.printer,type:p.type},newId:p.newId,settingData:t,tableData:us(a,"typeValue"),onImageGenerated:E=>{u.push({paperSize:x.paperSize,printer:x.printer,image:E,type:"UPDATE_TABLE"}),v()},additionalActions:n});return f.push(v),_}))});h.length&&tt("root1",h),await Promise.all(f.map(p=>new Promise(p)))}r(u)}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(qe,{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});tt("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 u=[];await new Promise(o=>{const l=s.jsx(qe,{printerDataObject:{staticDataKOT:a,paperSize:a.paperSize,type:"AGGREGATOR_BILL"},newId:Math.random(),settingData:t,onImageGenerated:c=>{u.push({paperSize:a.paperSize,image:c,type:"AGGREGATOR_BILL"}),o()},additionalActions:n});tt("root1",l)}),r(u)}catch(a){i(a)}}),Lh=async(e,t,n)=>new Promise(async(r,i)=>{try{let a=await _a(e,t,n),u=[];await new Promise(o=>{if(n.isSplitBill&&a.obj.splitDetails&&a.obj.splitDetails.length)for(let l=0;l<a.obj.splitDetails.length;l++){const c=a.obj.splitDetails[l];let h=JSON.parse(JSON.stringify(a));h.obj.splitDetails=[c];const p=s.jsx(qe,{printerDataObject:{staticDataKOT:h,paperSize:a.paperSize,type:"BILL"},newId:Math.random(),settingData:t});tt("root1",p)}else{const l=s.jsx(qe,{printerDataObject:{staticDataKOT:a,paperSize:a.paperSize,type:"BILL"},newId:Math.random(),settingData:t,onImageGenerated:c=>{u.push({paperSize:a.paperSize,image:c,type:"BILL"}),o()},additionalActions:n});tt("root1",l)}}),r(u)}catch(a){i(a)}}),kh=async(e,t,n,r)=>new Promise(async(i,a)=>{try{let u=await Id(e);if(u&&Object.keys(u.Category).length!==0){let o=`ItemWiseSales:::${Math.floor(Math.random()*1e3)}`,l=[];await new Promise(h=>{const p=s.jsx(qe,{printerDataObject:{staticDataKOT:u,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"}),h()},additionalActions:r});tt("root1",p)}),i(l)}else i([])}catch(u){a(u)}}),Ph=async(e,t,n)=>new Promise(async(r,i)=>{try{let u=`counterDetailsPrint:::${Math.floor(Math.random()*1e3)}`,f=[];await new Promise(l=>{const c=s.jsx(qe,{printerDataObject:{staticDataKOT:e,paperSize:t.printerSize,type:"COUNTER_OPERATION"},newId:u,settingData:t,onImageGenerated:h=>{f.push({paperSize:t.printerSize,image:h,type:"COUNTER_OPERATION"}),l()},additionalActions:n});tt("root1",c)}),r(f)}catch(a){i(a)}}),Fh=async(e,t,n={},r={})=>new Promise(async(i,a)=>{var u;try{const f=await Od(e,t);let o=[],l=lr(null,{fontTheme:t.fontTheme,type:"ORDER_AGGREGATED_PRINT",siteSetting:t}),c=l?(u=l[0])==null?void 0:u.paperSize:t.printerSize;await new Promise(p=>{const m=s.jsx(qe,{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});tt("root1",m)}),i(o)}catch(f){a(f)}}),Dh=async(e,t,n={})=>new Promise(async(r,i)=>{var a;try{const u=[];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],h=await Md(c);await new Promise(m=>{const x=s.jsx(qe,{printerDataObject:{staticDataKOT:h,paperSize:h.paperSize,type:"BILL"},newId:Math.random(),settingData:t,onImageGenerated:v=>{f.push({paperSize:h.paperSize,image:v,type:"BILL"}),m()},additionalActions:n});u.push(x)})}}u.length&&tt("root1",u),r(f)}catch(u){i(u)}}),tt=(e,t)=>{const n=document.getElementById(e);n&&ii.createRoot(n).render(t)};Ie.counterDetailsPrint=Ph,Ie.handleAggregatorBillPrint=Rh,Ie.handleBillPrint=Lh,Ie.handleDashboardPrint=Eh,Ie.handleItemWisePrint=kh,Ie.handleKOTPrint=Mh,Ie.handleOldBillPrints=Dh,Ie.handleSummaryPrint=Fh,Ie.handleUpdateTablePrint=Ah,Object.defineProperty(Ie,Symbol.toStringTag,{value:"Module"})});
|