recaho-print-react 0.0.152 → 0.0.154

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.
@@ -8731,7 +8731,7 @@ const Ke = (e) => {
8731
8731
  } catch (o) {
8732
8732
  l(o);
8733
8733
  }
8734
- }), Hh = async (e, t, n) => (console.log("inside handleBill print", n), new Promise(async (r, l) => {
8734
+ }), Hh = async (e, t, n) => new Promise(async (r, l) => {
8735
8735
  try {
8736
8736
  let o = await Ea(e, t, n), a = [];
8737
8737
  await new Promise(async (u) => {
@@ -8783,7 +8783,7 @@ const Ke = (e) => {
8783
8783
  } catch (o) {
8784
8784
  l(o);
8785
8785
  }
8786
- })), Bh = async (e, t, n, r) => new Promise(async (l, o) => {
8786
+ }), Bh = async (e, t, n, r) => new Promise(async (l, o) => {
8787
8787
  try {
8788
8788
  let a = await Rd(e);
8789
8789
  if (a && Object.keys(a.Category).length !== 0) {
@@ -51,4 +51,4 @@ R.version="2.30.1",oi(ye),R.fn=M,R.min=Ql,R.max=Zl,R.now=Jl,R.utc=Je,R.unix=Ic,R
51
51
  * @license qrcode.react
52
52
  * Copyright (c) Paul O'Shannessy
53
53
  * SPDX-License-Identifier: ISC
54
- */var Wa={L:Kt.QrCode.Ecc.LOW,M:Kt.QrCode.Ecc.MEDIUM,Q:Kt.QrCode.Ecc.QUARTILE,H:Kt.QrCode.Ecc.HIGH},za=128,Va="L",qa="#FFFFFF",Ka="#000000",Qa=!1,fr=4,Th=.1;function Za(e,t=0){const n=[];return e.forEach(function(r,l){let o=null;r.forEach(function(a,m){if(!a&&o!==null){n.push(`M${o+t} ${l+t}h${m-o}v1H${o+t}z`),o=null;return}if(m===r.length-1){if(!a)return;o===null?n.push(`M${m+t},${l+t} h1v1H${m+t}z`):n.push(`M${o+t},${l+t} h${m+1-o}v1H${o+t}z`);return}a&&o===null&&(o=m)})}),n.join("")}function Ja(e,t){return e.slice().map((n,r)=>r<t.y||r>=t.y+t.h?n:n.map((l,o)=>o<t.x||o>=t.x+t.w?l:!1))}function Xa(e,t,n,r){if(r==null)return null;const l=n?fr:0,o=e.length+l*2,a=Math.floor(t*Th),m=o/t,u=(r.width||a)*m,i=(r.height||a)*m,c=r.x==null?e.length/2-u/2:r.x*m,h=r.y==null?e.length/2-i/2:r.y*m;let f=null;if(r.excavate){let y=Math.floor(c),p=Math.floor(h),v=Math.ceil(u+c-y),_=Math.ceil(i+h-p);f={x:y,y:p,w:v,h:_}}return{x:c,y:h,h:i,w:u,excavation:f}}var wh=function(){try{new Path2D().addPath(new Path2D)}catch{return!1}return!0}();function Ih(e){const t=e,{value:n,size:r=za,level:l=Va,bgColor:o=qa,fgColor:a=Ka,includeMargin:m=Qa,style:u,imageSettings:i}=t,c=mr(t,["value","size","level","bgColor","fgColor","includeMargin","style","imageSettings"]),h=i==null?void 0:i.src,f=ge.useRef(null),y=ge.useRef(null),[p,v]=ge.useState(!1);ge.useEffect(()=>{if(f.current!=null){const S=f.current,T=S.getContext("2d");if(!T)return;let D=Kt.QrCode.encodeText(n,Wa[l]).getModules();const $=m?fr:0,k=D.length+$*2,J=Xa(D,r,m,i),re=y.current,te=J!=null&&re!==null&&re.complete&&re.naturalHeight!==0&&re.naturalWidth!==0;te&&J.excavation!=null&&(D=Ja(D,J.excavation));const de=window.devicePixelRatio||1;S.height=S.width=r*de;const be=r/k*de;T.scale(be,be),T.fillStyle=o,T.fillRect(0,0,k,k),T.fillStyle=a,wh?T.fill(new Path2D(Za(D,$))):D.forEach(function(Z,X){Z.forEach(function(q,ue){q&&T.fillRect(ue+$,X+$,1,1)})}),te&&T.drawImage(re,J.x+$,J.y+$,J.w,J.h)}}),ge.useEffect(()=>{v(!1)},[h]);const _=ys({height:r,width:r},u);let E=null;return h!=null&&(E=ge.createElement("img",{src:h,key:h,style:{display:"none"},onLoad:()=>{v(!0)},ref:y})),ge.createElement(ge.Fragment,null,ge.createElement("canvas",ys({style:_,height:r,width:r,ref:f},c)),E)}function Ch(e){const t=e,{value:n,size:r=za,level:l=Va,bgColor:o=qa,fgColor:a=Ka,includeMargin:m=Qa,imageSettings:u}=t,i=mr(t,["value","size","level","bgColor","fgColor","includeMargin","imageSettings"]);let c=Kt.QrCode.encodeText(n,Wa[l]).getModules();const h=m?fr:0,f=c.length+h*2,y=Xa(c,r,m,u);let p=null;u!=null&&y!=null&&(y.excavation!=null&&(c=Ja(c,y.excavation)),p=ge.createElement("image",{xlinkHref:u.src,height:y.h,width:y.w,x:y.x+h,y:y.y+h,preserveAspectRatio:"none"}));const v=Za(c,h);return ge.createElement("svg",ys({height:r,width:r,viewBox:`0 0 ${f} ${f}`},i),ge.createElement("path",{fill:o,d:`M0,0 h${f}v${f}H0z`,shapeRendering:"crispEdges"}),ge.createElement("path",{fill:a,d:v,shapeRendering:"crispEdges"}),p)}var ei=e=>{const t=e,{renderAs:n}=t,r=mr(t,["renderAs"]);return n==="svg"?ge.createElement(Ch,ys({},r)):ge.createElement(Ih,ys({},r))};const gs=(e,t)=>t*100/e,Oh=e=>!!(e||e===0),Mh={ABSOLUTE:"AMT",RELATIVE:"%",COMPLIMENTARY:"COMPLIMENTARY",NON_CHARGEABLE:"NON CHARGEABLE"},L=new Object({"3INCH":{lines:"- - - - - - - - - - - - - - - - - - - - - - - - - - - - -",paperSize:"36rem",itemName:"Item Name ",dynamicClassname:"size-3inch",textSize:19},"2INCH":{lines:"- - - - - - - - - - - - - - - - - - - -",paperSize:"23rem",itemName:"Item Name ",dynamicClassname:"size-2inch",textSize:13},"2.5INCH":{paperSize:"28rem",itemName:"Item Name ",dynamicClassname:"size-2inch",textSize:13},"2.7INCH":{paperSize:"30.6rem",itemName:"Item Name ",dynamicClassname:"size-3inch",textSize:19},"1.8INCH":{paperSize:"20.7rem",itemName:"Item Name ",dynamicClassname:"size-2inch",textSize:13},A4:{paperSize:"297mm",itemName:"Item Name ",dynamicClassname:"size-a4",textSize:13},A5:{paperSize:"148mm",itemName:"Item Name ",dynamicClassname:"size-a5",textSize:9}});var Mt=tr(),_e="normal-class";(Mt=="Android OS"||Mt==="iOS")&&(_e="bold-class");const qe=e=>{var Et,se,Se,yt,Ke;const t=e.additionalActions??{},{invoiceFormat:n={}}=e,r=ge.useRef(null),l=e.settingData?e.settingData:e.value.settingData,o=localStorage.getItem("siteId"),{staticDataKOT:a,printer:m,type:u}=e.printerDataObject,i=((se=(Et=e.value)==null?void 0:Et.settingData)==null?void 0:se.curr)??((Se=e.settingData)==null?void 0:Se.curr)??"INR";l==null||l.fontTheme;let c=e.printerDataObject.paperSize,h=lr(m,{type:u,siteSetting:e.settingData?e.settingData:e.value.settingData},t);const f=l.customLabels??xd();c=h?(yt=h[0])!=null&&yt.paperSize?(Ke=h[0])==null?void 0:Ke.paperSize:c||"3INCH":e.printerDataObject.paperSize;function y(g){const d=Math.abs(parseFloat(g));return p(d)}function p(g){switch(i){case"BHD":case"KWD":case"MUR":case"OMR":return Zs(g).format("0,00.000");default:return Zs(g).format("0,00.00")}}ge.useEffect(()=>{S()},[e.newId]);const v=()=>new Promise(async(g,d)=>{if(Mt=="Android OS"||Mt==="iOS"){let C=await bh(r.current);if(C){const j=await E(C);g(j)}}else{let C=await $a(r.current);C&&g(C)}}),_=()=>new Promise(async(g,d)=>{const C=await v();g(C)}),E=g=>new Promise((d,C)=>{let j=new Image;j.src=g,j.onload=()=>{let w=document.createElement("canvas");const Y=600,b=j.height;let F=j.width,V=j.height;F>V?F>Y&&(V*=Y/F,F=Y):V>b&&(F*=b/V,V=b),w.width=F,w.height=V,w.getContext("2d").drawImage(j,0,0,F,V),d(w.toDataURL())}}),S=async()=>{if(r&&r.current){const g=await _();e.onImageGenerated(g)}},T=g=>{let d=new Array;for(const C in g.menusCollection)C.endsWith("collection")||(g.menusCollection[`${C}_collection`]||g.menusCollection[C])&&d.push(s.jsxs("h5",{className:"left-align-entity level3-bold display-percentage",children:[s.jsx("span",{children:` -- ${C.replace("_"," ")}(${g.menusCollection[C]}):`}),s.jsx("span",{children:le(g.menusCollection[`${C}_collection`],i)}),s.jsx("span",{children:p(gs(g.salesCollection.totalCollection,g.menusCollection[`${C}_collection`]??0))+"%"})]}));return g.salesCollection.online_aggregator_collection&&d.push(s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:` -- Aggregator(${g.salesCollection.online_aggregator}):`}),s.jsx("span",{children:le(g.salesCollection.online_aggregator_collection,i)})]}),s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:` -- Zomato(${g.salesCollection.zomato_aggregator??0}):`}),s.jsx("span",{children:le(g.salesCollection.zomato_aggregator_collection,i)})]}),s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:` -- Swiggy(${g.salesCollection.swiggy_aggregator??0}):`}),s.jsx("span",{children:le(g.salesCollection.swiggy_aggregator_collection,i)})]})),d},D=g=>{let d=new Array,C=new Object;for(let j=0;j<g.todayCollection.length;j++)C=g.todayCollection[j],d.push(s.jsxs("h5",{className:"left-align-entity level3-bold display-percentage",children:[s.jsx("span",{children:` -- ${C.displayName}:`}),s.jsx("span",{children:le(C.value,i)}),s.jsx("span",{children:p(gs(g.totalCollection,C.value))+"%"})]}));return d},$=(g,d,C,j,w={})=>{let Y=g.includes("upi://");const b=`upi://pay?pa=${g}&pn=${C}&cu=INR&am=${j}&tr=${d}`;return s.jsx(ei,{value:Y?g:b,renderAs:"canvas",size:w.size??250})},k=(g,d)=>{var Y,b;let C=0;if((Y=d.taxObj)!=null&&Y.VAT.length){let F,V,fe;for(V=0;V<((b=d.taxObj)==null?void 0:b.VAT.length);V++){F=d.taxObj.VAT[V];for(fe in F)C+=ve(F[fe])}}const j={sellerName:d.companyInfo.companyName,vatRegistrationNumber:g,invoiceTimestamp:new Date(d.orderInfo.timestamp*1e3).toISOString(),invoiceTotal:d.finalAmount,invoiceVatTotal:C},w=gd(j.sellerName,j.vatRegistrationNumber,j.invoiceTimestamp,j.invoiceTotal,j.invoiceVatTotal.toFixed(2));return s.jsx(ei,{value:w,renderAs:"canvas",size:250})},J=g=>{const d=[];return(g.totalBalanceAmt||g.refundAmt||g.writeOffAmt||g.rewardAmt||g.cashCard)&&(d.push(s.jsx("hr",{})),g.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:le(g.rewardAmt,i)})]})),g.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:le(g.totalBalanceAmt,i)})]})),g.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:le(g.writeOffAmt,i)})]})),g.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:le(g.refundAmt,i)})]})),g.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:le(g.cashCard,i)})]}))),d},re=(g,d)=>{if(d&&d.length){for(let C=0;C<d.length;C++)if(d[C].slugName===g)return d[C]}return!1},te=(g,d)=>{if(d&&d.length){for(let C=0;C<d.length;C++)if(d[C].itemType===g)return d[C]}return!1},de=new Object({CREDIT:"Other Income",DEBIT:"Expense"}),be=g=>g.discountType==="COMPLIMENTARY"?"@ COMPLIMENTARY":g.discountType==="NON_CHARGEABLE"?"@ NON CHARGEABLE":`@ ${g.discountValue}${Mh[g.discountType]}`,Z=g=>{const d=new Array;if(g&&Object.keys(g).length!==0){d.push(s.jsx("h4",{className:"single-entity-and-center",children:"ACCOUNTS"}));for(const C in g)if(d.push(s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:`Total ${de[C]}:`}),s.jsx("span",{children:le(g[C].total,i)})]})),C&&Object.keys(C).length!==0)for(const j in g[C])j!=="total"&&g[C][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:le(g[C][j],i)})]}))}return d},X=(g,d)=>{let C=!1;g.totalValue&&(C=Object.keys(g.totalValue).length>1);let j=new Object;return s.jsxs(s.Fragment,{children:[g.totalValue&&Object.keys(g.totalValue).map(Y=>{if(j=g.totalValue[Y],Y==="GST")return s.jsxs(s.Fragment,{children:[s.jsx("hr",{}),s.jsxs("section",{className:"products-section",children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h4",{className:`items products-heading-name ${L[c].dynamicClassname}`,dangerouslySetInnerHTML:{__html:d.item_name}}),s.jsx("h4",{className:`items products-heading-qty ${L[c].dynamicClassname}`,dangerouslySetInnerHTML:{__html:d.qty}}),s.jsx("h4",{className:`items products-heading-rate ${L[c].dynamicClassname}`,dangerouslySetInnerHTML:{__html:d.rate}}),s.jsx("h4",{className:`items products-heading-amt ${L[c].dynamicClassname}`,dangerouslySetInnerHTML:{__html:d.amt}})]}),s.jsx("hr",{})]}),s.jsxs("section",{className:"products-section",style:{paddingTop:"12px"},children:[g.itemList&&g.itemList.length&&g.itemList.length>0&&g.itemList.map(b=>{if(b.taxType===Y||!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 ${L[c].dynamicClassname}`,style:{fontWeight:"lighter",lineHeight:1.2},children:[b.status==="RETURNED"?"(R) ":"",b.name.toUpperCase()]}),s.jsxs("h6",{className:`items products-heading-qty ${L[c].dynamicClassname}`,style:{fontWeight:"lighter"},children:[b.status==="RETURNED"?"-":"",b.quantity]}),s.jsx("h6",{className:`items products-heading-rate ${L[c].dynamicClassname}`,style:{fontWeight:"lighter"},children:b.rate?y(b.rate):""}),s.jsx("h6",{className:`items products-heading-amt ${L[c].dynamicClassname}`,style:{fontWeight:"lighter"},children:b.status==="RETURNED"?b.serviceAmount?p(b.serviceAmount):"":b.price?p(b.price):""})]}),b.addons&&b.addons.length&&b.addons.map(F=>s.jsx("h6",{className:`items products-heading-addon-kot ${L[c].dynamicClassname}`,children:"- "+Ve(F.serviceName)})),b.instruction&&g.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 ${L[c].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:g.curr+" "+p(j.gstTTL)})]}),o=="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=re(b,g.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:g.curr+" "+p(j.cat[b])})]})}):"",g.totalItemDisc&&j&&j.itemTypes&&Object.keys(j.itemTypes).length>0?Object.keys(j.itemTypes).map(b=>{const F=te(b,g.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:g.curr+" "+p(j.itemTypes[b])})]})}):"",g.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${g.segMentObj.segmentName.toLowerCase()}`]??g.segMentObj.segmentName.toUpperCase()+"DISC"}}),s.jsx("span",{children:" @"+g.segMentObj.discountValue+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+p(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:g.couponCode?d.coupon_disc??"COUPON DISC":d.order_disc??"ORDER DISC"}}),":",s.jsxs("span",{children:[g.couponCode?`(${g.couponCode.toUpperCase()})`:"",p(g.dicsEnterValue)?`@${g.dicsEnterValue}${g.discountType=="RELATIVE"||g.discountType=="COMPLIMENTARY"||g.discountType=="NON_CHARGEABLE"?"%":"AMT"}`:""]})]})}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+p(j.orderDisc)})]}):"",o=="25e5f1e4-68ff-43a7-b042-bebb93f42b94"&&j&&j.orderDisc?s.jsxs("div",{className:"bottom-section-div",children:[s.jsxs("h5",{className:"total-qty",children:["  ",g.couponCode?"COUPON DISC":"خصم الطلب",g.couponCode?`(${g.couponCode.toUpperCase()})`:""]}),s.jsx("h5",{className:"actual-qty"})]}):"",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:g.curr+" "+p(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:g.curr+" "+p(j.aftDisc)})]}):"",o=="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"})]}):"",g.taxObj&&g.taxObj[Y]&&j?s.jsx(s.Fragment,{children:Y==="GST"?g.taxObj[Y].map(b=>{let F=new Array;for(const V in b)if(b[V]&&b[V]!=0){let fe=V/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:" @"+fe+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+p(b[V]/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[g.taxLabel.toLowerCase()]}}),s.jsx("span",{children:" @"+fe+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+p(b[V]/2)})]})]}))}return F}):g.taxObj[Y].map(b=>{let F=new Array;for(const V in b)if(b[V]&&b[V]!=0){let fe=V;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:" @"+fe+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+p(b[V])})]})}))}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:g.curr+" "+p((j.total||0)+(j.aftDisc||0)+j.taxOnCharges)})]}),o=="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"})]}),g.totalValue&&(Object.keys(g.totalValue).length||0)>1?s.jsx("h4",{className:"single-entity-and-center",style:{marginTop:"10px"},children:"- - - - -"}):"",C&&s.jsx("div",{className:"space-2rem"})]})]})}),g.totalValue&&Object.keys(g.totalValue).map(Y=>{if(j=g.totalValue[Y],Y==="VAT")return s.jsxs(s.Fragment,{children:[s.jsx("hr",{}),s.jsxs("section",{className:"products-section",children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h6",{className:`items products-heading-name ${L[c].dynamicClassname}`,dangerouslySetInnerHTML:{__html:d.item_name}}),s.jsx("h6",{className:`items products-heading-qty ${L[c].dynamicClassname}`,dangerouslySetInnerHTML:{__html:d.qty}}),s.jsx("h6",{className:`items products-heading-rate ${L[c].dynamicClassname}`,dangerouslySetInnerHTML:{__html:d.rate}}),s.jsx("h6",{className:`items products-heading-amt ${L[c].dynamicClassname}`,dangerouslySetInnerHTML:{__html:d.amt}})]}),s.jsx("hr",{})]}),s.jsxs("section",{className:"products-section",style:{paddingTop:"12px"},children:[g.itemList&&g.itemList.length&&g.itemList.length>0&&g.itemList.map(b=>{if(b.taxType===Y)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 ${L[c].dynamicClassname}`,children:[b.status==="RETURNED"?"(R) ":"",b.name.toUpperCase()]}),s.jsxs("h6",{className:`items products-heading-qty ${L[c].dynamicClassname}`,children:[b.status==="RETURNED"?"-":"",b.quantity]}),s.jsx("h6",{className:`items products-heading-rate ${L[c].dynamicClassname}`,children:b.rate?y(b.rate):""}),s.jsx("h6",{className:`items products-heading-amt ${L[c].dynamicClassname}`,children:b.status==="RETURNED"?b.serviceAmount?p(b.serviceAmount):"":b.price?p(b.price):""})]}),b.addons&&b.addons.length&&b.addons.map(F=>s.jsx("h6",{className:`items products-heading-addon-kot ${L[c].dynamicClassname}`,children:"- "+Ve(F.serviceName)})),b.instruction&&g.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 ${L[c].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:g.curr+" "+p(j.vatTTL)})]}),o=="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=re(b,g.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:g.curr+" "+p(j.cat[b])})]})}):"",g.totalItemDisc&&j&&j.itemTypes&&Object.keys(j.itemTypes).length>0?Object.keys(j.itemTypes).map(b=>{const F=te(b,g.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:g.curr+" "+p(j.itemTypes[b])})]})}):"",g.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${g.segMentObj.segmentName.toLowerCase()}`]??g.segMentObj.segmentName.toUpperCase()+"DISC"}}),s.jsx("span",{children:" @"+g.segMentObj.discountValue+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+p(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:g.couponCode?d.coupon_disc??"COUPON DISC":d.order_disc??"ORDER DISC"}}),":",s.jsxs("span",{children:[g.couponCode?`(${g.couponCode.toUpperCase()})`:"",p(g.dicsEnterValue)?`@${g.dicsEnterValue}${g.discountType=="RELATIVE"||g.discountType=="COMPLIMENTARY"||g.discountType=="NON_CHARGEABLE"?"%":"AMT"}`:""]})]})}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+p(j.orderDisc)})]}):"",o=="25e5f1e4-68ff-43a7-b042-bebb93f42b94"&&j&&j.orderDisc?s.jsxs("div",{className:"bottom-section-div",children:[s.jsxs("h5",{className:"total-qty",children:["  ",g.couponCode?"COUPON DISC":"خصم الطلب",g.couponCode?`(${g.couponCode.toUpperCase()})`:""]}),s.jsx("h5",{className:"actual-qty"})]}):"",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:g.curr+" "+p(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:g.curr+" "+p(j.aftDisc)})]}):"",o=="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:g.curr+" "+p(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[g.taxLabel.toLowerCase()]}}),s.jsx("span",{children:" @"+b.tax/2+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+p(b.taxOnAmount/2)})]})]}):""})):"",g.taxObj&&g.taxObj[Y]&&j?s.jsx(s.Fragment,{children:Y==="GST"?g.taxObj[Y].map(b=>{let F=new Array;for(const V in b)if(b[V]&&b[V]!=0){let fe=V/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:" @"+fe+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+p(b[V]/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[g.taxLabel.toLowerCase()]}}),s.jsx("span",{children:" @"+fe+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+p(b[V]/2)})]})]}))}return F}):g.taxObj[Y].map(b=>{let F=new Array;for(const V in b)if(b[V]&&b[V]!=0){let fe=V;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:" @"+fe+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+p(b[V])})]})}))}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:g.curr+" "+p((j.total||0)+(j.aftDisc||0)+j.taxOnCharges)})]}),o=="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"})]})]})]})})]})},q=(g,d,{labels:C,doMultipleTax:j,type:w})=>{var b,F,V,fe,Me,Le,Ce,Ye,Qe,gt,Rt;const Y=g.discounts;return s.jsxs(s.Fragment,{children:[s.jsx("hr",{}),s.jsxs("section",{className:"products-section",children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h4",{className:`items products-heading-name ${L[c].dynamicClassname}`,dangerouslySetInnerHTML:{__html:C.item_name}}),s.jsx("h4",{className:`items products-heading-qty ${L[c].dynamicClassname}`,dangerouslySetInnerHTML:{__html:C.qty}}),s.jsx("h4",{className:`items products-heading-rate ${L[c].dynamicClassname}`,dangerouslySetInnerHTML:{__html:C.rate}}),s.jsx("h4",{className:`items products-heading-amt ${L[c].dynamicClassname}`,dangerouslySetInnerHTML:{__html:C.amt}})]}),s.jsx("hr",{})]}),s.jsxs("section",{className:"products-section",style:{paddingTop:"12px"},children:[g.itemList.map(Q=>{var St;return s.jsxs("div",{style:Q.serviceName.startsWith("+ ")?{}:{paddingTop:"12px"},children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsxs("h6",{className:`items products-heading-name ${L[c].dynamicClassname}`,style:{lineHeight:1.2},children:[Q.status==="RETURNED"?"(R) ":"",Q.serviceName.toUpperCase()]}),s.jsxs("h6",{className:`items products-heading-qty ${L[c].dynamicClassname}`,children:[Q.status==="RETURNED"?"-":"",Q.qty]}),s.jsx("h6",{className:`items products-heading-rate ${L[c].dynamicClassname}`,children:Q.serviceRate?y(Q.serviceRate):""}),s.jsx("h6",{className:`items products-heading-amt ${L[c].dynamicClassname}`,children:Q.sub_total?p(Q.sub_total):""})]}),Q.hsnCode&&d.printHSNCodeOnBill&&s.jsxs("h6",{className:`items products-heading-name ${L[c].dynamicClassname}`,style:{lineHeight:1.2},children:["HSN: ",Q.hsnCode]}),(St=Q.addons)!=null&&St.length?Q.addons.map(rt=>s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h6",{className:`items products-heading-name ${L[c].dynamicClassname}`,style:{lineHeight:1.2},children:"+ "+Ve(rt.serviceName)}),s.jsxs("h6",{className:`items products-heading-qty ${L[c].dynamicClassname}`,children:[Q.status==="RETURNED"?"-":"",rt.qty*Q.qty]}),s.jsx("h6",{className:`items products-heading-rate ${L[c].dynamicClassname}`}),s.jsx("h6",{className:`items products-heading-amt ${L[c].dynamicClassname}`})]}),s.jsx("div",{children:rt.hsnCode&&d.printHSNCodeOnBill&&s.jsxs("h6",{className:`items products-heading-name ${L[c].dynamicClassname}`,style:{lineHeight:1.2},children:["HSN: ",rt.hsnCode]})})]})):"",Q.instruction&&d.itemInstructionOnBill?s.jsx("h6",{className:"left-align-entity level2-bold",children:s.jsx("h6",{className:"items products-heading-addon-kot",children:" ("+Q.instruction+")"})}):""]})}),s.jsx("hr",{})]}),s.jsxs("div",{className:`bottom-section ${L[c].dynamicClassname} ${_e}`,children:[s.jsxs("div",{className:"bottom-section-div inline-display",style:{paddingTop:"12px"},children:[s.jsx("h5",{className:"total-qty",dangerouslySetInnerHTML:{__html:C.subtotal}}),s.jsx("h5",{className:"actual-qty",children:d.curr+" "+p(g.subTotal)})]}),o=="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=Y.DISCOUNT_ITEMS)!=null&&b.length?Y.DISCOUNT_ITEMS.map(Q=>s.jsxs("div",{className:`bottom-section-div inline-display ${_e}`,children:[s.jsx("h5",{className:"total-qty",children:s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:C[`disc_${Q.discountName.toLowerCase()}`]??"DISC-"+Q.discountName.toUpperCase()}}),s.jsx("span",{children:be(Q)})]})}),s.jsx("h5",{className:"actual-qty",children:d.curr+" "+p(Q.discountAmt)})]})):"",(F=Y.CATEGORY_DISCOUNT)!=null&&F.length?Y.CATEGORY_DISCOUNT.map(Q=>s.jsxs("div",{className:`bottom-section-div inline-display ${_e}`,children:[s.jsx("h5",{className:"total-qty",children:s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:C[`disc_${Q.discountName.toLowerCase()}`]??"DISC-"+Q.discountName.toUpperCase()}}),s.jsx("span",{children:" @"+Q.discountValue+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:d.curr+" "+p(Q.discountAmt)})]})):"",(V=Y.ITEM_DISCOUNT)!=null&&V.length?Y.ITEM_DISCOUNT.map(Q=>s.jsxs("div",{className:`bottom-section-div inline-display ${_e}`,children:[s.jsx("h5",{className:"total-qty",children:s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:C[`disc_${Q.discountName.toLowerCase()}`]??"DISC-"+ts(Q.discountName).toUpperCase()}}),s.jsx("span",{children:" @"+Q.discountValue+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:d.curr+" "+p(Q.discountAmt)})]})):"",(Me=(fe=Y.SEGMENT_DISCOUNT)==null?void 0:fe[0])!=null&&Me.discountAmt?s.jsxs("div",{className:`bottom-section-div inline-display ${_e}`,children:[s.jsx("h5",{className:"total-qty",children:s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:C[`segment_disc${Y.SEGMENT_DISCOUNT[0].discountName.toLowerCase()}`]??"DISC-"+Y.SEGMENT_DISCOUNT[0].discountName.toUpperCase()}}),":",s.jsx("span",{children:" @"+Y.SEGMENT_DISCOUNT[0].discountValue+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:d.curr+" "+p(Y.SEGMENT_DISCOUNT[0].discountAmt)})]}):"",(Ce=(Le=Y.COUPON_DISCOUNT)==null?void 0:Le[0])!=null&&Ce.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:`(${Y.COUPON_DISCOUNT[0].discountName.toUpperCase()}) @${Y.COUPON_DISCOUNT[0].discountValue}${Y.COUPON_DISCOUNT[0].discountType=="RELATIVE"?"%":"AMT"}`})]})}),s.jsx("h5",{className:"actual-qty",children:d.curr+" "+p(Y.COUPON_DISCOUNT[0].discountAmt)})]}):"",(Qe=(Ye=Y.ORDER_DISCOUNT)==null?void 0:Ye[0])!=null&&Qe.discountAmt?s.jsxs("div",{className:`bottom-section-div inline-display ${_e}`,children:[s.jsx("h5",{className:"total-qty",children:s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:C.order_disc??"ORDER DISC"}}),":",s.jsx("span",{children:p(Y.ORDER_DISCOUNT[0].discountValue)?`@${Y.ORDER_DISCOUNT[0].discountValue}${Y.ORDER_DISCOUNT[0].discountType=="RELATIVE"||Y.ORDER_DISCOUNT[0].discountType=="COMPLIMENTARY"||Y.ORDER_DISCOUNT[0].discountType=="NON_CHARGEABLE"?"%":"AMT"}`:""})]})}),s.jsx("h5",{className:"actual-qty",children:d.curr+" "+p(Y.ORDER_DISCOUNT[0].discountAmt)})]}):"",o=="25e5f1e4-68ff-43a7-b042-bebb93f42b94"&&g&&g.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"})]}):"",(gt=g.charges)!=null&&gt.length?g.charges.map(Q=>s.jsx(s.Fragment,{children:s.jsxs("div",{className:`bottom-section-div inline-display ${_e}`,children:[s.jsx("h5",{className:"total-qty",children:s.jsx("span",{dangerouslySetInnerHTML:{__html:C[`charges_${Q.name.toLowerCase()}`]??Q.name}})}),d.invoiceType=="INCLUSIVE_SIMPLIFIED"?s.jsx("h5",{className:"actual-qty",children:d.curr+" "+p(Q.amt+Q.taxAmt)}):s.jsx("h5",{className:"actual-qty",children:d.curr+" "+p(Q.amt)})]})})):"",g.subTotal!==g.afterCharges&&g.afterCharges!==g.total&&d.invoiceType!=="INCLUSIVE_SIMPLIFIED"?s.jsxs("div",{className:`bottom-section-div inline-display ${_e}`,children:[s.jsx("h5",{className:"total-qty",dangerouslySetInnerHTML:{__html:C.amt_before_tax}}),s.jsx("h5",{className:"actual-qty",children:d.curr+" "+p(g.afterCharges)})]}):"",o=="25e5f1e4-68ff-43a7-b042-bebb93f42b94"&&g.subTotal!==g.afterCharges?s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h5",{className:"total-qty",children:"المبلغ قبل الضريبة"}),s.jsx("h5",{className:"actual-qty"})]}):"",d.invoiceType!=="INCLUSIVE_SIMPLIFIED"&&((Rt=g.taxation)!=null&&Rt.length)?g.taxation.map(Q=>{if(Q.taxAmt)return Q.taxType==="GST"?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:`bottom-section-div ${_e}`,children:[s.jsx("h5",{className:"total-qty",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:C.cgst}}),s.jsx("span",{children:"@"+Q.tax/2+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:d.curr+" "+p(Q.taxAmt/2)})]}),s.jsxs("div",{className:`bottom-section-div ${_e}`,children:[s.jsx("h5",{className:"total-qty",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:C[d.taxLabel.toLowerCase()]}}),s.jsx("span",{children:"@"+Q.tax/2+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:d.curr+" "+p(Q.taxAmt/2)})]})]}):s.jsxs("div",{className:`bottom-section-div ${_e}`,children:[s.jsx("h5",{className:"total-qty",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:C.vat}}),s.jsx("span",{children:"@"+Q.tax+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:d.curr+" "+p(Q.taxAmt)})]})}):"",s.jsxs("div",{className:`bottom-section-div inline-display ${_e}`,children:[s.jsx("h5",{className:"total-qty",dangerouslySetInnerHTML:{__html:C.total}}),s.jsx("h5",{className:"actual-qty",children:d.curr+" "+p(g.total)})]}),j?s.jsx(s.Fragment,{children:w==="GST"?s.jsxs(s.Fragment,{children:[s.jsx("h4",{className:"single-entity-and-center",style:{marginTop:"10px"},children:"- - - - -"}),s.jsx("div",{className:"space-2rem"})]}):""}):""]})},ue=(g,d)=>{var Y,b;let C=!1;const j=g.distributedData;return g.distributedData&&(C=Object.keys(g.distributedData).length>1),s.jsxs(s.Fragment,{children:[((Y=j.GST)==null?void 0:Y.itemList)&&q(j.GST,g,{labels:d,doMultipleTax:C,type:"GST"}),((b=j.VAT)==null?void 0:b.itemList)&&q(j.VAT,g,{labels:d,doMultipleTax:C,type:"VAT"})]})},z=g=>{const d=g.services,C=Object.keys(g.services),j=C.length;return s.jsxs(s.Fragment,{children:[s.jsx("hr",{}),s.jsxs("section",{className:`products-section ${_e}`,children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h5",{className:"items products-heading-name-kot",children:L[c].itemName}),s.jsx("h5",{className:"items products-heading-qty-kot",children:"QTY"})]}),s.jsx("hr",{})]}),s.jsxs("section",{className:"products-section",children:[j&&C.map((Y,b)=>s.jsxs(s.Fragment,{children:[s.jsx("h4",{className:"left-align-entity level3-bold",children:s.jsxs("u",{children:[Y.toUpperCase(),":"]})}),d[Y].map(F=>{var V;return s.jsxs("div",{children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h4",{className:`items products-heading-name-kot ${L[c].dynamicClassname}`,children:Ve(F.serviceName)}),s.jsx("h4",{className:`items products-heading-qty-kot ${L[c].dynamicClassname}`,children:F.qty})]}),((V=F.addons)==null?void 0:V.length)&&F.addons.map(fe=>{var Me;return s.jsx("h5",{className:"items products-heading-addon-kot",children:"- "+((Me=fe.serviceName)==null?void 0:Me.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",{})]})]})},ee=g=>{const d=g.slice(0,-4),C=g.slice(-4);return{firstDigits:d,last4Dgits:C}},De=(g,d,C,j={})=>{const w=Object.keys(d??{});let Y=[],b,F="flex-two-items";if(j.action==="addCharges"&&(F="display-percentage"),g&&w.length){Y.push(s.jsxs(s.Fragment,{children:[s.jsx("h4",{className:"single-entity-and-center",children:`${C.toUpperCase()} BREAK-UP`}),s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsxs("span",{children:["Total ",C,":"]}),s.jsx("span",{children:le(g,i)})]})]}));for(let V=0;V<w.length;V++)b=w[V],d[b]&&Y.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:le(d[b],i)}),j.action==="addCharges"?s.jsx("span",{children:p(gs(g,d[b]))+"%"}):""]}));Y.push(s.jsx("hr",{}))}return Y},nt=g=>{const d=Object.keys(g.Category),C=Object.keys(g.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((w,Y)=>{const b=g.Category[w];let F=[];j.push(s.jsxs(s.Fragment,{children:[s.jsxs("h4",{className:"left-align-entity level3-bold",children:[" - "," ",ts(w)]}),s.jsxs("section",{className:"products-section",children:[b.forEach(V=>{F.push(s.jsx(s.Fragment,{children:s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h6",{className:`items products-heading-name-kot ${L["3INCH"].dynamicClassname}`,children:V.serviceName}),s.jsx("h6",{className:`items products-heading-qty-kot ${L["3INCH"].dynamicClassname}`,children:parseFloat(V.qty.toFixed(2))})]})}))}),F,Y!=d.length-1&&s.jsx("hr",{})]})]}))}),C.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"})]})),C.forEach((w,Y)=>{const b=g.Addon[w];let F=[];j.push(s.jsxs(s.Fragment,{children:[s.jsxs("h4",{className:"left-align-entity level3-bold",children:[" - "," ",ts(w)]}),s.jsxs("section",{className:"products-section",children:[b.forEach(V=>{F.push(s.jsx(s.Fragment,{children:s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h6",{className:`items products-heading-name-kot ${L["3INCH"].dynamicClassname}`,children:V.serviceName}),s.jsx("h6",{className:`items products-heading-qty-kot ${L["3INCH"].dynamicClassname}`,children:parseFloat(V.qty.toFixed(2))})]})}))}),F,Y!=C.length-1&&s.jsx("hr",{className:"dashed"})]})]}))})),j},At=g=>{var C;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",nonChargeable_disc:"NON CHARGEABLE BILL",amt_before_tax:"AMT BEFORE TAX",total:"TOTAL",grand_total:"GRAND TOTAL",reward_point_balance:"REWARD POINT BALANCE",balance_amt:"BALANCE AMOUNT",rewards_redeemed:"REWARDS REDEEMED",vat:"VAT",sgst:"SGST",cgst:"CGST",utgst:"UTGST",igst:"IGST",previous_outstanding:"PREVIOUS OUTSTANDING",total_payable:"TOTAL PAYABLE",delivery_code:"Delivery Code",online_order_id:"Online Order ID",area_name:"Area Name",table_name:"Table Name",captain_name:"Captain Name"};if((C=g==null?void 0:g.customBillLabels)!=null&&C.length){let j;for(let w=0;w<g.customBillLabels.length;w++)j=g.customBillLabels[w],d[j.defaultName]=j.displayName}return d},pt=(g,d,C,j)=>{var V,fe,Me,Le,Ce,Ye,Qe,gt,Rt,Q,St,rt,xs,an,Ns,js,ln,on,cn,dn,hn,un,mn,Qt,vs,xt,Zt,Jt,_s,fn,bs,pn,Ss,Ts,yn,gn,ws,Is,xn,Nn,jn,vn,x,O,U;const w=At(l.customLabelsMap),Y=ms(Nd(l.paymentModes),"internalName"),b=P=>{var N;return(N=Y[P])!=null&&N.displayName?Y[P].displayName.toUpperCase():P};if(g==="BILL"){let P;if(c==="A4"||c==="A5"){let N={...d},H=0,W=N.distributedData;const A=W.discounts;P=s.jsx("div",{className:`invoiceContainer main-div ${L[c].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:`${w.order_no}:`},className:"font-weight-bold"}),s.jsx("span",{children:N.orderId})]}),s.jsxs("td",{width:"50%",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:`${w.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:C&&s.jsx("img",{src:C,width:90})})})]}),s.jsx("tr",{children:s.jsx("td",{colSpan:12,className:"text-center border-right",style:{padding:"0px 1.4rem"},children:s.jsx("h6",{children:s.jsx("strong",{children:"Tax Invoice"})})})}),s.jsxs("tr",{children:[s.jsx("td",{colSpan:6,className:"v-align-baseline col-6",children:s.jsxs("div",{className:"divPadding",children:[(N.customerInfo.custName||((V=N.customFields)==null?void 0:V.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})}),(fe=N.customFields)!=null&&fe.length?N.customFields.map(I=>s.jsx("tr",{children:s.jsxs("td",{width:"10%",children:[I.customName,": ",I.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:`${w.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:`${w.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:`${w.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(I=>{var Ae;let he="",Ne=[];return H++,Ne.push(s.jsxs(s.Fragment,{children:[s.jsxs("tr",{style:{lineHeight:"10px"},className:he,children:[s.jsx("td",{className:"text-align-left",children:I.serviceRate?H:""}),s.jsx("td",{style:{width:"40%"},className:"text-align-left",children:I.serviceName.toUpperCase()}),s.jsx("td",{className:"text-align-left",children:I.qty}),s.jsx("td",{className:"text-align-right",children:I.serviceRate?G(I.serviceRate,i):""}),s.jsx("td",{className:"text-align-right",children:I.sub_total?G(I.sub_total,i):""})]}),I.instruction&&s.jsxs("tr",{children:[s.jsx("td",{}),s.jsx("td",{style:{width:"40%"},children:"("+I.instruction+")"})]})]})),(Ae=I.addons)!=null&&Ae.length&&I.addons.map(Ze=>{Ne.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:["+ ",Ze.serviceName.toUpperCase()]}),s.jsx("td",{children:Ze.qty*I.qty})]}),Ze.instruction&&s.jsxs("tr",{children:[s.jsx("td",{}),s.jsx("td",{style:{width:"40%"},children:"("+Ze.instruction+")"})]})]}))}),Ne}),s.jsx("tr",{style:{lineHeight:"10px",fontSize:"14px"},children:s.jsx("td",{colSpan:5,children:s.jsx("strong",{className:"font-weight-bold",children:`Total ${H} Items and ${ve(W.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",{}),pd(Oe(N.finalAmount,i).toFixed(Wt[i].minimumFractionDigits??2))]})}),s.jsx("hr",{}),N.upiId&&d.companyInfo.companyName&&d.paymentStatus!=="PAID"&&(!d.splitDetails||d.splitDetails&&((Me=d.splitDetails)==null?void 0:Me.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.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:w.subtotal}})})}),s.jsx("td",{width:"50%",className:"text-align-right",children:G(W.subTotal,i)})]}),(Le=A==null?void 0:A.DISCOUNT_ITEMS)!=null&&Le.length?A.DISCOUNT_ITEMS.map(I=>s.jsxs("tr",{className:"subtotalTr",children:[s.jsxs("td",{width:"50%",children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:w[`disc_${I.discountName.toLowerCase()}`]??"DISC-"+I.discountName.toUpperCase()}}),s.jsx("span",{children:be(I)})]}),s.jsx("td",{className:"text-align-right",width:"50%",children:G(I.discountAmt,i)})]})):"",(Ce=A==null?void 0:A.CATEGORY_DISCOUNT)!=null&&Ce.length?A.CATEGORY_DISCOUNT.map(I=>s.jsxs("tr",{className:"subtotalTr",children:[s.jsxs("td",{width:"50%",children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:w[`disc_${I.discountName.toLowerCase()}`]??"DISC-"+I.discountName.toUpperCase()}}),s.jsx("span",{children:" @"+I.discountValue+"%"})]}),s.jsx("td",{className:"text-align-right",width:"50%",children:G(I.discountAmt,i)})]})):"",(Ye=A==null?void 0:A.ITEM_DISCOUNT)!=null&&Ye.length?A.ITEM_DISCOUNT.map(I=>s.jsxs("tr",{className:"subtotalTr",children:[s.jsxs("td",{width:"50%",children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:w[`disc_${I.discountName.toLowerCase()}`]??"DISC-"+I.discountName.toUpperCase()}}),s.jsx("span",{children:" @"+I.discountValue+"%"})]}),s.jsx("td",{className:"text-align-right",width:"50%",children:G(I.discountAmt,i)})]})):"",(gt=(Qe=A==null?void 0:A.SEGMENT_DISCOUNT)==null?void 0:Qe[0])!=null&&gt.discountAmt?s.jsxs("tr",{className:"subtotalTr",children:[s.jsxs("td",{width:"50%",children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:w[`segment_disc${A.SEGMENT_DISCOUNT[0].discountName.toLowerCase()}`]??"DISC-"+A.SEGMENT_DISCOUNT[0].discountName.toUpperCase()}}),s.jsx("span",{children:" @"+A.SEGMENT_DISCOUNT[0].discountValue+"%"})]}),s.jsx("td",{className:"text-align-right",width:"50%",children:G(A.SEGMENT_DISCOUNT[0].discountAmt,i)})]}):"",(Q=(Rt=A==null?void 0:A.COUPON_DISCOUNT)==null?void 0:Rt[0])!=null&&Q.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:`(${A.COUPON_DISCOUNT[0].discountName.toUpperCase()}) @${A.COUPON_DISCOUNT[0].discountValue}${A.COUPON_DISCOUNT[0].discountType=="RELATIVE"?"%":"AMT"}`})]}),s.jsx("td",{className:"text-align-right",width:"50%",children:G(A.COUPON_DISCOUNT[0].discountAmt,i)})]}):"",(rt=(St=A==null?void 0:A.ORDER_DISCOUNT)==null?void 0:St[0])!=null&&rt.discountAmt?s.jsxs("tr",{className:"subtotalTr",children:[s.jsxs("td",{width:"50%",children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:w.order_disc??"ORDER DISC"}}),s.jsx("span",{children:p(A.ORDER_DISCOUNT[0].discountValue)?`@${A.ORDER_DISCOUNT[0].discountValue}${A.ORDER_DISCOUNT[0].discountType=="RELATIVE"||A.ORDER_DISCOUNT[0].discountType=="COMPLIMENTARY"||A.ORDER_DISCOUNT[0].discountType=="NON_CHARGEABLE"?"%":"AMT"}`:""})]}),s.jsx("td",{className:"text-align-right",width:"50%",children:G(A.ORDER_DISCOUNT[0].discountAmt,i)})]}):"",(xs=W.charges)!=null&&xs.length?W.charges.map(I=>s.jsxs("tr",{className:"subtotalTr",children:[s.jsx("td",{width:"50%",children:s.jsx("span",{dangerouslySetInnerHTML:{__html:w[`charges_${I.name.toLowerCase()}`]??I.name}})}),s.jsx("td",{className:"text-align-right",width:"50%",children:G(I.amt,i)})]})):"",W.subTotal!==W.afterCharges?s.jsxs("tr",{className:"subtotalTr",children:[s.jsx("td",{width:"50%",children:s.jsx("span",{dangerouslySetInnerHTML:{__html:w.amt_before_tax}})}),s.jsx("td",{className:"text-align-right",width:"50%",children:G(W.afterCharges,i)})]}):"",(an=W.taxation)!=null&&an.length?W.taxation.map(I=>I.taxType==="GST"?s.jsxs(s.Fragment,{children:[s.jsxs("tr",{className:"subtotalTr",children:[s.jsxs("td",{width:"50%",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:w.cgst}}),s.jsx("span",{children:" @"+I.tax/2+"%"})]}),s.jsx("td",{className:"text-align-right",width:"50%",children:G(I.taxAmt/2,i)})]}),s.jsxs("tr",{className:"subtotalTr",children:[s.jsxs("td",{width:"50%",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:w.sgst}}),s.jsx("span",{children:" @"+I.tax/2+"%"})]}),s.jsx("td",{className:"text-align-right",width:"50%",children:G(I.taxAmt/2,i)})]})]}):s.jsxs("tr",{className:"subtotalTr",children:[s.jsxs("td",{width:"50%",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:w.vat}}),s.jsx("span",{children:" @"+I.tax+"%"})]}),s.jsx("td",{className:"text-align-right",width:"50%",children:G(I.taxAmt,i)})]})):"",s.jsxs("tr",{className:"font-weight-bold subtotalTr",children:[s.jsx("td",{width:"50%",children:s.jsx("strong",{dangerouslySetInnerHTML:{__html:w.grand_total}})}),s.jsx("td",{className:"text-align-right",width:"50%",children:G(N.finalAmount,i)})]}),(Ns=d==null?void 0:d.custoutStandingData)!=null&&Ns.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:w.previous_outstanding}})}),s.jsx("td",{className:"text-align-right",width:"50%",children:G((js=N==null?void 0:N.custoutStandingData)==null?void 0:js.balanceAmt,i)})]}),s.jsxs("tr",{className:"font-weight-bold subtotalTr",children:[s.jsx("td",{width:"50%",children:s.jsx("strong",{dangerouslySetInnerHTML:{__html:w.total_payable}})}),s.jsx("td",{className:"text-align-right",width:"50%",children:G(N.grandTotal+((ln=N==null?void 0:N.custoutStandingData)==null?void 0:ln.balanceAmt),i)})]})]}):"",N.rewardAmt?s.jsxs("tr",{className:"subtotalTr",children:[s.jsx("td",{width:"50%",children:s.jsx("span",{dangerouslySetInnerHTML:{__html:w.rewards_redeemed}})}),s.jsx("td",{className:"text-align-right",width:"50%",children:G(N.rewardAmt,i)})]}):"",(on=d.paymentMethods)!=null&&on.length?d.paymentMethods.map(I=>{var he;if(I.paidAmt)return s.jsxs("tr",{className:"subtotalTr",children:[s.jsxs("td",{width:"50%",children:["-"," ",s.jsx("span",{dangerouslySetInnerHTML:{__html:w[`${(he=I.paymentMode)==null?void 0:he.toLowerCase()}`]??b(I.paymentMode)??"CASH"}}),s.jsx("span",{children:I.isRefund?"(Refund)":""})]}),I.isRefund?s.jsx("td",{className:"text-align-right",width:"50%",children:"("+G(I.paidAmt,i)+")"}):s.jsx("td",{className:"text-align-right",width:"50%",children:G(I.paidAmt,i)})]})}):"",N.balanceAmt&&d.balanceAmt!=0?s.jsxs("tr",{className:"subtotalTr",children:[s.jsx("td",{width:"50%",children:s.jsx("span",{dangerouslySetInnerHTML:{__html:w.balance_amt}})}),s.jsx("td",{className:"text-align-right",width:"50%",children:G(d.balanceAmt,i)})]}):"",d.balPoint&&!Number.isNaN(d.balPoint)?s.jsxs("tr",{className:"subtotalTr",children:[s.jsx("td",{width:"50%",children:s.jsx("span",{dangerouslySetInnerHTML:{__html:w.reward_point_balance}})}),s.jsx("td",{className:"text-align-right",width:"50%",children:d.balPoint})]}):"",(cn=d.splitDetails)!=null&&cn.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(I=>s.jsxs("tr",{className:"subtotalTr",children:[s.jsx("td",{width:"50%",children:s.jsx("span",{dangerouslySetInnerHTML:{__html:I.name}})}),s.jsx("td",{className:"text-align-right",width:"50%",children:d.curr+" "+I.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 P=s.jsx("div",{className:"main-div bill",style:{width:L[c].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",{}),C&&s.jsx("div",{className:"image-bill",children:s.jsx("img",{src:C,className:"single-entity-and-center",style:{width:L[c].logoWidth}})}),s.jsxs("div",{className:`details-section ${L[c].dynamicClassname}`,children:[!C&&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:w.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:w.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:w.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:w.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:w.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.menuDisplayName?d.menuDisplayName: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:w.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 ${L[c].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:w.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:w.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:w.address}}),": ",s.jsx("span",{children:d.customerInfo.custAddress})]})}),ft(d.appliedDiscounts??[],"COMPLIMENTARY","discountType").discountType&&s.jsx("h5",{className:"left-align-entity level2-bold",dangerouslySetInnerHTML:{__html:w.complementary_disc}}),ft(d.appliedDiscounts??[],"NON_CHARGEABLE","discountType").discountType&&s.jsx("h5",{className:"left-align-entity level2-bold",dangerouslySetInnerHTML:{__html:w.nonChargeable_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:w.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:w.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:w.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:w.captain_name}}),":",s.jsx("span",{children:d.captainName})]})})]}),(dn=d.customFields)!=null&&dn.length?s.jsxs("div",{className:`details-section ${L[c].dynamicClassname}`,children:[s.jsx("hr",{}),d.customFields.map(N=>s.jsx("h4",{className:"left-align-entity",children:N.customName+": "+N.customValue}))]}):"",d.newFormat?ue(d,w):X(d,w),s.jsx("br",{}),s.jsxs("div",{className:`bottom-section ${L[c].dynamicClassname}`,children:[s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h6",{className:`total-qty ${(hn=d.custoutStandingData)!=null&&hn.balanceAmt||d.rewardAmt&&d.paymentMethods&&d.paymentMethods.length>0?"level3-bold":"level2-bold"}`,style:{fontSize:c==="2INCH"||c==="1.8INCH"?"1.50rem":"1.75rem"},dangerouslySetInnerHTML:{__html:w.grand_total}}),s.jsx("h6",{className:`actual-qty ${(un=d.custoutStandingData)!=null&&un.balanceAmt||d.rewardAmt&&d.paymentMethods&&d.paymentMethods.length>0?"level3-bold":"level2-bold"}`,style:{fontSize:c==="2INCH"||c==="1.8INCH"?"1.40rem":"1.75rem"},children:d.curr+" "+p(d.finalAmount)})]}),(mn=d.custoutStandingData)!=null&&mn.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:w.previous_outstanding}})}),s.jsx("h5",{children:d.curr+" "+p(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:c==="2INCH"||c==="1.8INCH"?"1.50rem":"1.75rem"},dangerouslySetInnerHTML:{__html:w.total_payable}}),s.jsx("h6",{className:"actual-qty level2-bold",style:{fontSize:c==="2INCH"||c==="1.8INCH"?"1.40rem":"1.75rem"},children:d.curr+" "+p(d.finalAmount+d.custoutStandingData.balanceAmt)})]}):""]}):"",o=="25e5f1e4-68ff-43a7-b042-bebb93f42b94"?s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h6",{className:"total-qty level2-bold",style:{fontSize:c==="2INCH"||c==="1.8INCH"?"1.50rem":"1.75rem"},children:"المجموع الإجمالي"}),s.jsx("h6",{className:"actual-qty level2-bold",style:{fontSize:c==="2INCH"||c==="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:w.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 H;if(N.paidAmt)return s.jsxs("div",{className:`bottom-section-div inline-display ${_e}`,children:[s.jsxs("h5",{children:["-",s.jsx("span",{dangerouslySetInnerHTML:{__html:w[`${(H=N.paymentMode)==null?void 0:H.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+" ("+p(N.paidAmt)+")"}):s.jsx(s.Fragment,{children:d.curr+" "+p(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:c==="2INCH"||c==="1.8INCH"?"1.50rem":"1.75rem"},dangerouslySetInnerHTML:{__html:w.total_payable}}),s.jsx("h6",{className:"actual-qty level2-bold",style:{fontSize:c==="2INCH"||c==="1.8INCH"?"1.40rem":"1.75rem"},children:d.curr+" "+p(d.finalAmount+(((Qt=d==null?void 0:d.custoutStandingData)==null?void 0:Qt.balanceAmt)||0)-d.rewardAmt)})]})}):"",Oh((vs=d.convertedCurrValue)==null?void 0:vs.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:`(${G(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:w.balance_amt}}),s.jsx("h5",{children:d.curr+" "+p(d.balanceAmt)})]}):"",s.jsx("hr",{})]}),d.earnPoints&&d.paymentMethods&&!(n!=null&&n.hideRewardPoints)?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)&&!(n!=null&&n.hideRewardPoints)?s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h6",{className:"total-qty line-gaps",dangerouslySetInnerHTML:{__html:w.reward_point_balance}}),s.jsx("h6",{className:"actual-qty",children:d.balPoint+d.earnPoints||0})]}):"",(xt=d.splitDetails)!=null&&xt.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"&&((Zt=d.taxation)!=null&&Zt.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:L[c].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 Mt==="Android OS"||Mt==="iOS"?N.taxType==="GST"?s.jsxs(s.Fragment,{children:[s.jsxs("tr",{className:L[c].dynamicClassname,children:[s.jsx("th",{dangerouslySetInnerHTML:{__html:`${w.cgst} ${N.tax/2}%`}}),s.jsx("th",{children:d.curr+" "+Oe(N.taxableAmt,i)}),s.jsx("th",{children:d.curr+" "+Oe(N.taxAmt/2,i)})]}),s.jsxs("tr",{className:L[c].dynamicClassname,children:[s.jsx("th",{dangerouslySetInnerHTML:{__html:`${w[d.taxLabel.toLowerCase()]} ${N.tax/2}%`}}),s.jsx("th",{children:d.curr+" "+Oe(N.taxableAmt,i)}),s.jsx("th",{children:d.curr+" "+Oe(N.taxAmt/2,i)})]})]}):s.jsxs("tr",{className:L[c].dynamicClassname,children:[s.jsx("th",{dangerouslySetInnerHTML:{__html:`${w.vat} ${N.tax}%`}}),s.jsx("th",{children:d.curr+" "+Oe(N.taxableAmt,i)}),s.jsx("th",{children:d.curr+" "+Oe(N.taxAmt,i)})]}):N.taxType==="GST"?s.jsxs(s.Fragment,{children:[s.jsxs("tr",{className:L[c].dynamicClassname,children:[s.jsx("td",{dangerouslySetInnerHTML:{__html:`${w.cgst} ${N.tax/2}%`}}),s.jsx("td",{children:d.curr+" "+Oe(N.taxableAmt,i)}),s.jsx("td",{children:d.curr+" "+Oe(N.taxAmt/2,i)})]}),s.jsxs("tr",{className:L[c].dynamicClassname,children:[s.jsx("td",{dangerouslySetInnerHTML:{__html:`${w[d.taxLabel.toLowerCase()]} ${N.tax/2}%`}}),s.jsx("td",{children:d.curr+" "+Oe(N.taxableAmt,i)}),s.jsx("td",{children:d.curr+" "+Oe(N.taxAmt/2,i)})]})]}):s.jsxs("tr",{className:L[c].dynamicClassname,children:[s.jsx("td",{dangerouslySetInnerHTML:{__html:`${w.vat} ${N.tax}%`}}),s.jsx("td",{children:d.curr+" "+Oe(N.taxableAmt,i)}),s.jsx("td",{children:d.curr+" "+Oe(N.taxAmt,i)})]})})]})})]}):"",d.upiId&&d.companyInfo.companyName&&(!d.splitDetails||d.splitDetails&&((Jt=d.splitDetails)==null?void 0:Jt.length)==0)&&s.jsxs("div",{className:"single-entity-and-center",children:[s.jsx("h6",{style:{marginTop:"6px"},children:"Scan this QRCode to Pay"}),$(d.upiId,d.orderId,d.companyInfo.companyName,d.paidAmount)]}),d.curr==="SAR"&&l.vatNo&&s.jsxs("div",{className:"single-entity-and-center",children:[s.jsx("h6",{style:{marginTop:"6px"},children:"Scan with ZATCA app for invoice details."}),k(l.vatNo,d)]}),j?s.jsx("div",{className:"image-bill",children:s.jsx("img",{src:`${j}`,className:"single-entity-and-center",style:{width:L[c].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 P}else if(g==="PRINT_DASHBOARD"&&d.salesCollection){const P=d.salesCollection.totalDiscountAmt?gs(d.salesCollection.grandTotal,d.salesCollection.totalDiscountAmt):null,N=d.salesCollection.totalCollection-d.salesCollection.totalTax;var F=R().format("DD/MM/YYYY LT");const H=(_s=d.monthTillDateSalesColl)!=null&&_s.totalDiscountAmt?gs(d.monthTillDateSalesColl.grandTotal,d.monthTillDateSalesColl.totalDiscountAmt):null;return s.jsxs("div",{className:`main-div ${L[c].dynamicClassname}`,style:{width:L[c].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:le(d.monthTillDateSalesColl.grandTotal,i)})]}),s.jsxs("h5",{className:"level3-bold flex-two-items",children:[s.jsx("span",{children:"DISCOUNT:"}),s.jsx("span",{children:`${le(d.monthTillDateSalesColl.totalDiscountAmt,i)}${H?`(${p(H)}%)`:""}`})]}),s.jsxs("h5",{className:"level3-bold flex-two-items",children:[s.jsx("span",{children:"CHARGES:"}),s.jsx("span",{children:le(d.monthTillDateSalesColl.totalOtherCharges,i)})]}),s.jsxs("h5",{className:"level3-bold flex-two-items",children:[s.jsx("span",{children:"NET SALES BEFORE TAX:"}),s.jsx("span",{children:le(d.monthTillDateSalesColl.totalCollection-d.monthTillDateSalesColl.totalTax,i)})]}),s.jsxs("h5",{className:"level3-bold flex-two-items",children:[s.jsx("span",{children:"TAX:"}),s.jsx("span",{children:le(d.monthTillDateSalesColl.totalTax,i)})]}),s.jsxs("h5",{className:"level3-bold flex-two-items",children:[s.jsx("span",{children:"NET SALES AFTER TAX:"}),s.jsx("span",{children:le(d.monthTillDateSalesColl.totalCollection,i)})]})]}),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:le(d.salesCollection.grandTotal,i)})]}),s.jsxs("h5",{className:"level3-bold flex-two-items",children:[s.jsx("span",{children:"DISCOUNT:"}),s.jsx("span",{children:`${le(d.salesCollection.totalDiscountAmt,i)}${P?`(${p(P)}%)`:""}`})]}),s.jsxs("h5",{className:"level3-bold flex-two-items",children:[s.jsx("span",{children:"CHARGES:"}),s.jsx("span",{children:le(d.salesCollection.totalOtherCharges,i)})]}),s.jsxs("h5",{className:"level3-bold flex-two-items",children:[s.jsx("span",{children:"NET SALES BEFORE TAX:"}),s.jsx("span",{children:le(N,i)})]}),s.jsxs("h5",{className:"level3-bold flex-two-items",children:[s.jsx("span",{children:"TAX:"}),s.jsx("span",{children:le(d.salesCollection.totalTax,i)})]}),s.jsxs("h5",{className:"level3-bold flex-two-items",children:[s.jsx("span",{children:"NET SALES AFTER TAX:"}),s.jsx("span",{children:le(d.salesCollection.totalCollection,i)})]})]}),s.jsx("hr",{}),De(d.otherFields.totalDiscountAmt,d.otherFields.discountList,"Discount",{action:"addCharges"}),De(d.otherFields.totalOtherCharges,d.otherFields.otherChargesList,"Charges"),De(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:le(d.salesCollection.totalCollection,i)})]}),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})]}),T(d)]}),s.jsx("hr",{}),d.otherFields.totalItemType?s.jsx("div",{children:De(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 ",l.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:le(d.averageCollection.avgorderValue,i)})]}):"",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:le(d.averageCollection.avgPerCover,i)})]}):"",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:le(d.totalCollection,i)})]}),D(d)]}),J(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:le(d.otherFields.salesCollection,i)})]}),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:le(d.otherFields.outstandingAmt,i)})]}):""]})]}):"",s.jsx("hr",{}),Z(d.averageCollection.dailyExpanse)]}),s.jsx("br",{}),Mt=="Android OS"&&s.jsx("div",{className:"space-3rem"})]})}else if(g==="AGGREGATOR_BILL"){let P;return a.aggregatorOrderId&&a.aggregatorOrderId!==""&&(P=ee(a.aggregatorOrderId)),s.jsx("div",{className:"main-div bill",style:{width:L[c].paperSize},children:s.jsxs("div",{children:[s.jsxs("div",{style:{width:"100%",textAlign:"left",marginLeft:"auto"},children:[s.jsx("br",{}),C&&s.jsx("div",{className:"image-bill",children:s.jsx("img",{src:C,className:"single-entity-and-center",style:{width:L[c].logoWidth}})}),s.jsxs("div",{className:`details-section ${L[c].dynamicClassname}`,children:[!C&&a.companyInfo.companyName&&a.companyInfo.companyName!=""&&s.jsx("h1",{className:"single-entity-and-center",children:a.companyInfo.companyName}),a.companyInfo.companyAddress&&a.companyInfo.companyAddress!==""&&s.jsx("h3",{className:"single-entity-and-center",dangerouslySetInnerHTML:{__html:a.companyInfo.companyAddress}}),a.companyInfo.companyContact&&a.companyInfo.companyContact!==""&&s.jsx("h3",{className:"single-entity-and-center",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:w.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:w.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:w.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:w.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:w.company_VAT}}),": ",s.jsx("span",{children:a.vatNo})]})}),a.orderFrom&&s.jsx("h3",{className:"single-entity-and-center level2-bold",children:a.menuDisplayName?a.menuDisplayName:a.orderFrom}),a.orderSource&&P&&s.jsxs("h4",{className:"single-entity-and-center",children:[`${a.orderSource}: ${P.firstDigits||""}`,s.jsxs("span",{style:{fontSize:"2rem"},children:["-",P.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:w.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:w.token_no}})," ",s.jsx("span",{children:a.tokenId})]})})]}),s.jsx("hr",{}),s.jsxs("div",{className:`details-section ${L[c].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:w.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:w.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:w.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:w.order_no}}),": ",s.jsx("span",{children:a.orderId})]})}),a.orderFrom&&s.jsx("h5",{className:"single-entity-and-center",children:a.menuDisplayName?a.menuDisplayName: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:w.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:w.delivery_date}}),":",s.jsx("span",{children:a.deliveryTimestamp})]})})]})]}),s.jsx("hr",{}),s.jsxs("section",{className:"products-section",children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h6",{className:"items products-heading-name-kot",children:L[c].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:[((fn=a.services)==null?void 0:fn.length)&&a.services.map(H=>{var W;return s.jsxs("div",{style:H.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:H.serviceName.toUpperCase()}),s.jsx("h6",{className:"items products-heading-qty-kot",children:H.qty})]}),((W=H.addons)==null?void 0:W.length)&&H.addons.map(A=>s.jsx("h6",{className:"items products-heading-addon-kot",children:"- "+Ve(A.serviceName)})),H.instruction&&a.itemInstructionOnBill&&s.jsx("h6",{className:"left-align-entity level2-bold",children:s.jsx("h6",{className:"items products-heading-addon-kot",children:H.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:le(a.discountAmt,i)})]}):"",a.otherCharges&&a.otherCharges.length>0?a.otherCharges.map(H=>{if(H.amt)return s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h5",{children:H.name}),s.jsx("h5",{children:a.curr+" "+p(H.amt)})]})}):"",a.taxObj&&a.taxObj.GST?s.jsx(s.Fragment,{children:a.taxObj.GST.map(H=>{let W=new Array;for(const A in H)if(H[A]&&H[A]!=0){let I=A/2;W.push(s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"bottom-section-div",children:[s.jsxs("h5",{children:["CGST @",I]}),s.jsx("h5",{children:a.curr+" "+p(H[A]/2)})]}),s.jsxs("div",{className:"bottom-section-div",children:[s.jsxs("h5",{children:[d.taxLabel+" "," @",I,"%"]}),s.jsx("h5",{children:a.curr+" "+p(H[A]/2)})]})]}))}return W})}):"",s.jsx("div",{style:{marginTop:"6px"},children:(bs=a.customFeilds)==null?void 0:bs.map(H=>s.jsx("h4",{className:"left-align-entity",children:H.customName+": "+H.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:L[c].logoWidth}})}):"",a.footerMessage?s.jsx("h4",{className:"single-entity-and-center",dangerouslySetInnerHTML:{__html:a.footerMessage}}):"",a.printedBy&&a.printOperatorInfo?s.jsx("h6",{className:"left-align-entity",children:`Printed By: ${a.printedBy}`}):"",a.printTime&&a.printOperatorInfo?s.jsx("h6",{className:"left-align-entity",children:`Printed On: ${a.printTime}`}):"",a.disabledPoweredBy?"":s.jsx("h6",{className:"single-entity-and-center",children:"Powered By: www.recaho.com"})]})})}else if(g==="UPDATE_TABLE"){let P="";return a.action==="SWITCH_TABLE"?P=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:["**",(pn=f.Table)==null?void 0:pn.toUpperCase()," SWITCH**"]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:"From"}),s.jsx("h5",{className:"left-align-entity level3-bold",children:(Ss=a.from)==null?void 0:Ss.map((N,H)=>{var W,A,I;return`${(A=(W=e.tableData[N])==null?void 0:W.attachedArea)==null?void 0:A.toUpperCase()} - ${(I=e.tableData[N])==null?void 0:I.tableName}${H+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:`${(yn=(Ts=e.tableData[a.to[0]])==null?void 0:Ts.attachedArea)==null?void 0:yn.toUpperCase()} - ${(gn=e.tableData[a.to[0]])==null?void 0:gn.tableName}`}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["Running ",`${f.KOT}`,"s: ",Object.keys(a.activeKots).join(", ")]})]})}):P=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 ",(ws=f.Table)==null?void 0:ws.toUpperCase(),"**"]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:"From"}),s.jsx("h5",{className:"left-align-entity level3-bold",children:(Is=a.from)==null?void 0:Is.map((N,H)=>{var W,A,I;return`${(A=(W=e.tableData[N])==null?void 0:W.attachedArea)==null?void 0:A.toUpperCase()} - ${(I=e.tableData[N])==null?void 0:I.tableName}${H+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:`${(Nn=(xn=e.tableData[a.to[0]])==null?void 0:xn.attachedArea)==null?void 0:Nn.toUpperCase()} - ${(jn=e.tableData[a.to[0]])==null?void 0:jn.tableName}`}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["Running ",`${f.KOT}`,"s: ",Object.keys(a.activeKots).join(", ")]})]})}),P}else if(g==="COUNTER_OPERATION"){let P;return c=="2INCH"||c=="1.8INCH"?P=s.jsx("div",{className:"main-div",style:{width:L[c].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: ",G(a.totalSale,i)," "]}),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: ",G(a.cashSale,i)," "]}),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," : ",G(N.value,i)]})})]}),s.jsxs("h4",{className:"left-align-entity level3-bold",children:["Cash Balance: ",G(a.closingActualBalance,i)]}),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:["    ",G(a.openingBalance,i)," "]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" -- Actual Opening Balance : "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["    ",G(a.actualOpeningBalance,i)]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" -- Opening Difference Amt : "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["    ",G(a.openingShort,i)," "]}),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:i=="INR"?"denomination-container":"denomination-container-other-country",children:[s.jsxs("h5",{className:"left-align-entity level3-bold",children:["   ",i=="INR"?G(N.denomination,i):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:[" ",G(N.total,i)," "]})]})),a.openingTotalDenomations>0&&s.jsxs("div",{class:i=="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:G(a.openingTotalDenomations,i)})]}),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:["    ",G(a.cashSale,i)," "]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" -- System Closing Balance : "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["    ",G(a.closingBalance,i)," "]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" -- Actual Closing Balance : "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["   ",G(a.closingActualBalance,i)]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" -- Closing Difference Amt : "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["    ",G(a.closingShort,i)," "]}),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:["    -",G(a.debitEntry,i)," "]})]}),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:["    +",G(a.creditEntry,i)," "]})]}),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:["   -",G(a.internalTransferDebit,i)]})]}),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:["   +",G(a.internalTransferCredit,i)]})]}),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:i=="INR"?"denomination-container":"denomination-container-other-country",children:[s.jsxs("h5",{className:"left-align-entity level3-bold",children:["  ",i=="INR"?G(N.denomination,i):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:[" ",G(N.total,i)," "]})]})),a.TotalDenomationsAmount>0&&s.jsxs("div",{class:i=="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:G(a.TotalDenomationsAmount,i)})]})]})}):P=s.jsx("div",{className:"main-div",style:{width:L[c].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: ",G(a.totalSale,i)," "]}),a.totalSale>0&&s.jsxs(s.Fragment,{children:[a.cashSale>0&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" -- Cash: ",G(a.cashSale,i)," "]}),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," : ",G(N.value,i)]})})]}),s.jsxs("h4",{className:"left-align-entity level3-bold",children:["Cash Balance: ",G(a.closingActualBalance,i)]}),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 : ",G(a.openingBalance,i)]}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- Actual Opening Balance : ",G(a.actualOpeningBalance,i)]}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- Opening Difference Amt : ",G(a.openingShort,i)]}),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:i=="INR"?"denomination-container":"denomination-container-other-country",children:[s.jsxs("h5",{className:"left-align-entity level3-bold",children:["   ",i=="INR"?G(N.denomination,i):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:[" ",G(N.total,i)," "]})]})),a.openingTotalDenomations>0&&s.jsxs("div",{class:i=="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:G(a.openingTotalDenomations,i)})]}),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 : ",G(a.cashSale,i)," "]}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- System Closing Balance : ",G(a.closingBalance,i)]}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- Actual Closing Balance : ",G(a.closingActualBalance,i)]}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- Closing Difference Amt : ",G(a.closingShort,i)]}),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 : -",G(a.debitEntry,i)]}),a.creditEntry>0&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- Other Cash Income : +",G(a.creditEntry,i)]}),a.internalTransferDebit>0&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- Internal Transfer(cash to bank): -",G(a.internalTransferDebit,i)]}),a.internalTransferCredit>0&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- Internal Transfer(bank to cash): +",G(a.internalTransferCredit,i)]}),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:i=="INR"?"denomination-container":"denomination-container-other-country",children:[s.jsxs("h5",{className:"left-align-entity level3-bold",children:["  ",i=="INR"?G(N.denomination,i):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:[" ",G(N.total,i)," "]})]})),a.TotalDenomationsAmount>0&&s.jsxs("div",{class:i=="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:G(a.TotalDenomationsAmount,i)})]})]})}),P}else if(g==="ITEMWISE_SALES_COUNTER"){let P,{counterDetails:N}=e.printerDataObject;return P=s.jsx("div",{className:"main-div",style:{width:L[c].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",{}),nt(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}`})]})}),P}else if(g==="CARD_RECHARGE_DETAILS"){let{staticDataKOT:P}=e.printerDataObject;return getRechargeDetails(P)}else if(g==="PACKAGING_SLIP"){let P,N=0;d.aggregatorOrderId&&d.aggregatorOrderId!==""&&(P=ee(d.aggregatorOrderId));const H=d.services;for(let A in H)N+=H[A].length;return s.jsx("div",{className:"main-div",style:{width:L[c].paperSize},children:s.jsxs("div",{style:{width:"100%",textAlign:"left",marginLeft:"auto"},children:[s.jsx("br",{}),s.jsxs("div",{className:`details-section ${L[c].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&&P&&s.jsxs("h4",{className:"single-entity-and-center level2-bold",children:[`${d.orderSource}: ${P.firstDigits||""}`,s.jsx("span",{style:{fontSize:"2rem"},children:P.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:`${f.Waiter} Name: `+d.waiterName})]}),z(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)]})]}),(vn=d.customFields)==null?void 0:vn.map(A=>s.jsx("h4",{className:"left-align-entity",children:A.customName+": "+A.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(g==="ORDER_AGGREGATED_PRINT")return s.jsx("div",{className:"main-div",style:{width:L[c].paperSize},children:s.jsxs("div",{style:{width:"100%",textAlign:"left",marginLeft:"auto"},children:[a.logo&&s.jsx("div",{className:"image-bill",children:s.jsx("img",{src:a.logo,className:"single-entity-and-center"})}),s.jsxs("div",{className:`details-section ${L[c].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:w.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:w.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:w.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:w.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:w.name}}),": ",s.jsx("span",{children:a.name})]}),a.mobile&&s.jsxs("h5",{children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:w.mobile}}),": ",s.jsx("span",{children:a.mobile})]}),s.jsxs("div",{className:"mt-2",children:[s.jsx("hr",{}),s.jsx("section",{className:"products-section",children:s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h5",{className:`items products-heading-name ${L[c].dynamicClassname}`,children:"Date"}),s.jsx("h5",{className:`items products-heading-orderId ${L[c].dynamicClassname}`,children:"Order Id"}),s.jsx("h5",{className:`items products-heading-amount ${L[c].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 ${L[c].dynamicClassname}`,children:rr(N.date)}),s.jsx("h6",{className:`items products-heading-orderId ${L[c].dynamicClassname}`,children:N.orderId}),s.jsx("h6",{className:`items products-heading-amount ${L[c].dynamicClassname}`,children:a.curr+" "+p(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+" "+p(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+" "+p(a.totalPaid)})]})]}),(x=a.transactions)!=null&&x.length?s.jsxs("div",{children:[s.jsx("hr",{}),s.jsx("section",{className:"products-section",children:s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h5",{className:`items products-heading-name ${L[c].dynamicClassname}`,children:"Date"}),s.jsx("h5",{className:`items products-heading-orderId ${L[c].dynamicClassname}`,children:"Payment Mode"}),s.jsx("h5",{className:`items products-heading-amount ${L[c].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 ${L[c].dynamicClassname}`,children:N.date}),s.jsx("h6",{className:`items products-heading-orderId ${L[c].dynamicClassname}`,children:N.paymentMode}),s.jsx("h6",{className:`items products-heading-amount ${L[c].dynamicClassname}`,children:a.curr+" "+p(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+" "+p(a.totalPayable)})]})]})]})});{let P,N=0,H,W;for(let I=0;I<(((O=a.services)==null?void 0:O.length)||0);I++)W=a.services[I],W.status==="CANCELLED"&&!a.onlyCancelledItems&&(N+=W.qty);return a.aggregatorOrderId&&a.aggregatorOrderId!==""&&(P=ee(a.aggregatorOrderId)),s.jsx("div",{className:"main-div",style:{width:L[c].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&&P&&s.jsxs("h4",{className:"single-entity-and-center level2-bold",children:[`${a.orderSource}: ${P.firstDigits||""}`,s.jsx("span",{style:{fontSize:"2rem"},children:P.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:`${f.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:`${f.Waiter} Name: `+a.waiterName})]}),s.jsx("hr",{}),s.jsxs("section",{className:`products-section ${_e}`,children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h5",{className:"items products-heading-name-kot",children:L[c].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(I=>(I.status==="CANCELLED"?H=s.jsxs("strike",{children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h2",{className:"items products-heading-name-kot ",children:Ve(I.serviceName)}),s.jsx("h2",{className:"items products-heading-qty-kot ",children:I.qty})]}),I.addons&&I.addons.length&&I.addons.map(he=>s.jsx("h2",{className:"items products-heading-addon-kot",children:"- "+Ve(he.serviceName)})),I.instruction&&s.jsx("h4",{className:"left-align-entity level2-bold",children:s.jsx("h4",{className:"items products-heading-addon-kot",children:" "+I.instruction})})]}):H=s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h2",{className:"items products-heading-name-kot ",children:Ve(I.serviceName)}),s.jsx("h2",{className:"items products-heading-qty-kot ",children:I.qty})]}),I.addons&&I.addons.length&&I.addons.map(he=>s.jsx("h2",{className:"items products-heading-addon-kot",children:"- "+Ve(he.serviceName)})),I.instruction&&s.jsx("h4",{className:"left-align-entity level2-bold",children:s.jsx("h4",{className:"items products-heading-addon-kot",children:" "+I.instruction})})]}),s.jsx("div",{children:H}))),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)]})]}),(U=a.customFields)==null?void 0:U.map(I=>s.jsx("h4",{className:"left-align-entity",children:I.customName+": "+I.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:r,className:"html-bill-print",style:{maxWidth:L[c].paperSize,zIndex:"-10",backgroundColor:"#fff"},children:pt(u,a.obj,a.companyLogo,a.companyQrCode)})})},Ah=async(e,t,n,r={})=>new Promise(async(l,o)=>{var a,m,u;try{const{needPackagingSlip:i=!0}=r;e.primaryWaiter&&n&&(e.primaryWaiter=((a=n[e.primaryWaiter])==null?void 0:a.name)||null);const{obj:c,printersMap:h}=bd(e,t,r);let f=[],y=[];const p=[];if(Sa(c).flatMap(v=>{(h[v.station]||[]).forEach(E=>{const S=new Promise(T=>{p.push(s.jsx(qe,{printerDataObject:{staticDataKOT:v,paperSize:E.paperSize,printer:E.printer},newId:v.newId,value:{settingData:t},onImageGenerated:D=>{f.push({paperSize:E.paperSize,printer:E.printer,image:D,type:"KOT"}),T()},additionalActions:r},v.newId+"::"+E.printer))});y.push(S)})}),i&&((m=t.packagingSlipPrinters)!=null&&m.length)){const v=Sd(e,t,r);(u=v.printers)!=null&&u.length&&v.printers.forEach(_=>{y.push(new Promise(E=>{p.push(s.jsx(qe,{printerDataObject:{staticDataKOT:{obj:_.obj},paperSize:_.paperSize,printer:_.printer,type:"PACKAGING_SLIP"},newId:_.obj.newId,value:{settingData:t},onImageGenerated:S=>{f.push({paperSize:_.paperSize,printer:_.printer,image:S,type:"PACKAGING_SLIP"}),E()},additionalActions:r},_.obj.newId))}))})}p.length&&bt("root2",p),await Promise.all(y),l(f)}catch(i){o(i)}}),Eh=(e,t,n)=>new Promise(async(r,l)=>{try{const{tableData:o}=n;let a=[],m=[];if(n!=null&&n.action){const{obj:u,paperSize:i,printersMap:c}=Td(e,t,n),h=Sa(u).flatMap(f=>{var y;return(y=c[f.station])==null?void 0:y.map(p=>new Promise(v=>{const _=s.jsx(qe,{printerDataObject:{staticDataKOT:f,paperSize:i,printer:p.printer,type:f.type},newId:f.newId,settingData:t,tableData:ms(o,"typeValue"),onImageGenerated:E=>{a.push({paperSize:p.paperSize,printer:p.printer,image:E,type:"UPDATE_TABLE"}),v()},additionalActions:n});return m.push(v),_}))});h.length&&bt("root1",h),await Promise.all(m.map(f=>new Promise(f)))}r(a)}catch(o){l(o)}}),Rh=(e,t)=>new Promise(async(n,r)=>{try{const l=wd(e,t);let o=[];await new Promise(m=>{const u=s.jsx(qe,{printerDataObject:{staticDataKOT:{obj:l},paperSize:e.printerSize,type:"PRINT_DASHBOARD"},newId:l.id,settingData:e,onImageGenerated:i=>{o.push({paperSize:e.printerSize,image:i,type:"PRINT_DASHBOARD"}),m()},additionalActions:t});bt("root1",u)}),n(o)}catch(l){r(l)}}),Lh=async(e,t,n)=>new Promise(async(r,l)=>{try{const{obj:o}=await Id(e,t,n);let a=[];await new Promise(u=>{const i=s.jsx(qe,{printerDataObject:{staticDataKOT:o,paperSize:o.paperSize,type:"AGGREGATOR_BILL"},newId:Math.random(),settingData:t,onImageGenerated:c=>{a.push({paperSize:o.paperSize,image:c,type:"AGGREGATOR_BILL"}),u()},additionalActions:n});bt("root1",i)}),r(a)}catch(o){l(o)}}),kh=async(e,t,n)=>(console.log("inside handleBill print",n),new Promise(async(r,l)=>{try{let o=await ba(e,t,n),a=[];await new Promise(async u=>{if(n.isSplitBill&&o.obj.splitDetails&&o.obj.splitDetails.length){const i=o.obj.splitDetails.map((c,h)=>new Promise(f=>{let y=JSON.parse(JSON.stringify(o));y.obj.splitDetails=[c];const p=s.jsx(qe,{printerDataObject:{staticDataKOT:y,paperSize:y.paperSize,type:"BILL"},newId:Math.random(),settingData:t,onImageGenerated:v=>{a.push({paperSize:y.paperSize,image:v,type:"BILL"}),f()},additionalActions:n,invoiceFormat:n.invoiceFormat||{}});ti(p)}));await Promise.all(i),u()}else{const i=s.jsx(qe,{printerDataObject:{staticDataKOT:o,paperSize:o.paperSize,type:"BILL"},newId:Math.random(),settingData:t,onImageGenerated:c=>{a.push({paperSize:o.paperSize,image:c,type:"BILL"}),u()},additionalActions:n,invoiceFormat:n.invoiceFormat||{}});ti(i)}}),r(a)}catch(o){l(o)}})),Ph=async(e,t,n,r)=>new Promise(async(l,o)=>{try{let a=await Cd(e);if(a&&Object.keys(a.Category).length!==0){let u=`ItemWiseSales:::${Math.floor(Math.random()*1e3)}`,i=[];await new Promise(h=>{const f=s.jsx(qe,{printerDataObject:{staticDataKOT:a,paperSize:t.printerSize,type:"ITEMWISE_SALES_COUNTER",counterDetails:n},newId:u,settingData:t,onImageGenerated:y=>{i.push({paperSize:t.printerSize,image:y,type:"ITEMWISE_SALES_COUNTER"}),h()},additionalActions:r});bt("root1",f)}),l(i)}else l([])}catch(a){o(a)}}),Fh=async(e,t,n)=>new Promise(async(r,l)=>{try{let a=`counterDetailsPrint:::${Math.floor(Math.random()*1e3)}`,m=[];await new Promise(i=>{const c=s.jsx(qe,{printerDataObject:{staticDataKOT:e,paperSize:t.printerSize,type:"COUNTER_OPERATION"},newId:a,settingData:t,onImageGenerated:h=>{m.push({paperSize:t.printerSize,image:h,type:"COUNTER_OPERATION"}),i()},additionalActions:n});bt("root1",c)}),r(m)}catch(o){l(o)}}),Dh=async(e,t,n={},r={})=>new Promise(async(l,o)=>{var a;try{const m=await Md(e,t);let u=[],i=lr(null,{fontTheme:t.fontTheme,type:"ORDER_AGGREGATED_PRINT",siteSetting:t}),c=i?(a=i[0])==null?void 0:a.paperSize:t.printerSize;await new Promise(f=>{const y=s.jsx(qe,{printerDataObject:{staticDataKOT:{...m,name:n.name,mobile:n.mobile},paperSize:c,type:"ORDER_AGGREGATED_PRINT"},newId:Math.random(),settingData:t,onImageGenerated:p=>{u.push({paperSize:c,image:p,type:"ORDER_AGGREGATED_PRINT"}),f()},additionalActions:r});bt("root1",y)}),l(u)}catch(m){o(m)}}),Yh=async(e,t,n={})=>new Promise(async(r,l)=>{var o;try{const a=[];let m=[];for(let u=0;u<e.length;u++){let i=e[u];if((o=i.invoiceFormats)!=null&&o.length){let c=dd(i.invoiceFormats,"createdAt")[0],h=await Ad(c);await new Promise(y=>{const p=s.jsx(qe,{printerDataObject:{staticDataKOT:h,paperSize:h.paperSize,type:"BILL"},newId:Math.random(),settingData:t,onImageGenerated:v=>{m.push({paperSize:h.paperSize,image:v,type:"BILL"}),y()},additionalActions:n,invoiceFormat:n.invoiceFormat||{}});a.push(p)})}}a.length&&bt("root1",a),r(m)}catch(a){l(a)}}),bt=(e,t)=>{const n=document.getElementById(e);n&&vr.createRoot(n).render(t)},ti=e=>{try{const t=Object.assign(document.createElement("div"),{id:`react-root-${Math.random().toString(36).slice(2,11)}`,style:"position:absolute; top:-9999px; left:-9999px;"});document.body.appendChild(t);const n=vr.createRoot(t),r=()=>{n.unmount(),t.remove()};n.render(ge.cloneElement(e,{handleUnmount:r}))}catch(t){console.log("renderComponentsV2 err :::",t)}};we.counterDetailsPrint=Fh,we.handleAggregatorBillPrint=Lh,we.handleBillPrint=kh,we.handleDashboardPrint=Rh,we.handleItemWisePrint=Ph,we.handleKOTPrint=Ah,we.handleOldBillPrints=Yh,we.handleSummaryPrint=Dh,we.handleUpdateTablePrint=Eh,Object.defineProperty(we,Symbol.toStringTag,{value:"Module"})});
54
+ */var Wa={L:Kt.QrCode.Ecc.LOW,M:Kt.QrCode.Ecc.MEDIUM,Q:Kt.QrCode.Ecc.QUARTILE,H:Kt.QrCode.Ecc.HIGH},za=128,Va="L",qa="#FFFFFF",Ka="#000000",Qa=!1,fr=4,Th=.1;function Za(e,t=0){const n=[];return e.forEach(function(r,l){let o=null;r.forEach(function(a,m){if(!a&&o!==null){n.push(`M${o+t} ${l+t}h${m-o}v1H${o+t}z`),o=null;return}if(m===r.length-1){if(!a)return;o===null?n.push(`M${m+t},${l+t} h1v1H${m+t}z`):n.push(`M${o+t},${l+t} h${m+1-o}v1H${o+t}z`);return}a&&o===null&&(o=m)})}),n.join("")}function Ja(e,t){return e.slice().map((n,r)=>r<t.y||r>=t.y+t.h?n:n.map((l,o)=>o<t.x||o>=t.x+t.w?l:!1))}function Xa(e,t,n,r){if(r==null)return null;const l=n?fr:0,o=e.length+l*2,a=Math.floor(t*Th),m=o/t,u=(r.width||a)*m,i=(r.height||a)*m,c=r.x==null?e.length/2-u/2:r.x*m,h=r.y==null?e.length/2-i/2:r.y*m;let f=null;if(r.excavate){let y=Math.floor(c),p=Math.floor(h),v=Math.ceil(u+c-y),_=Math.ceil(i+h-p);f={x:y,y:p,w:v,h:_}}return{x:c,y:h,h:i,w:u,excavation:f}}var wh=function(){try{new Path2D().addPath(new Path2D)}catch{return!1}return!0}();function Ih(e){const t=e,{value:n,size:r=za,level:l=Va,bgColor:o=qa,fgColor:a=Ka,includeMargin:m=Qa,style:u,imageSettings:i}=t,c=mr(t,["value","size","level","bgColor","fgColor","includeMargin","style","imageSettings"]),h=i==null?void 0:i.src,f=ge.useRef(null),y=ge.useRef(null),[p,v]=ge.useState(!1);ge.useEffect(()=>{if(f.current!=null){const S=f.current,T=S.getContext("2d");if(!T)return;let D=Kt.QrCode.encodeText(n,Wa[l]).getModules();const $=m?fr:0,k=D.length+$*2,J=Xa(D,r,m,i),re=y.current,te=J!=null&&re!==null&&re.complete&&re.naturalHeight!==0&&re.naturalWidth!==0;te&&J.excavation!=null&&(D=Ja(D,J.excavation));const de=window.devicePixelRatio||1;S.height=S.width=r*de;const be=r/k*de;T.scale(be,be),T.fillStyle=o,T.fillRect(0,0,k,k),T.fillStyle=a,wh?T.fill(new Path2D(Za(D,$))):D.forEach(function(Z,X){Z.forEach(function(q,ue){q&&T.fillRect(ue+$,X+$,1,1)})}),te&&T.drawImage(re,J.x+$,J.y+$,J.w,J.h)}}),ge.useEffect(()=>{v(!1)},[h]);const _=ys({height:r,width:r},u);let E=null;return h!=null&&(E=ge.createElement("img",{src:h,key:h,style:{display:"none"},onLoad:()=>{v(!0)},ref:y})),ge.createElement(ge.Fragment,null,ge.createElement("canvas",ys({style:_,height:r,width:r,ref:f},c)),E)}function Ch(e){const t=e,{value:n,size:r=za,level:l=Va,bgColor:o=qa,fgColor:a=Ka,includeMargin:m=Qa,imageSettings:u}=t,i=mr(t,["value","size","level","bgColor","fgColor","includeMargin","imageSettings"]);let c=Kt.QrCode.encodeText(n,Wa[l]).getModules();const h=m?fr:0,f=c.length+h*2,y=Xa(c,r,m,u);let p=null;u!=null&&y!=null&&(y.excavation!=null&&(c=Ja(c,y.excavation)),p=ge.createElement("image",{xlinkHref:u.src,height:y.h,width:y.w,x:y.x+h,y:y.y+h,preserveAspectRatio:"none"}));const v=Za(c,h);return ge.createElement("svg",ys({height:r,width:r,viewBox:`0 0 ${f} ${f}`},i),ge.createElement("path",{fill:o,d:`M0,0 h${f}v${f}H0z`,shapeRendering:"crispEdges"}),ge.createElement("path",{fill:a,d:v,shapeRendering:"crispEdges"}),p)}var ei=e=>{const t=e,{renderAs:n}=t,r=mr(t,["renderAs"]);return n==="svg"?ge.createElement(Ch,ys({},r)):ge.createElement(Ih,ys({},r))};const gs=(e,t)=>t*100/e,Oh=e=>!!(e||e===0),Mh={ABSOLUTE:"AMT",RELATIVE:"%",COMPLIMENTARY:"COMPLIMENTARY",NON_CHARGEABLE:"NON CHARGEABLE"},L=new Object({"3INCH":{lines:"- - - - - - - - - - - - - - - - - - - - - - - - - - - - -",paperSize:"36rem",itemName:"Item Name ",dynamicClassname:"size-3inch",textSize:19},"2INCH":{lines:"- - - - - - - - - - - - - - - - - - - -",paperSize:"23rem",itemName:"Item Name ",dynamicClassname:"size-2inch",textSize:13},"2.5INCH":{paperSize:"28rem",itemName:"Item Name ",dynamicClassname:"size-2inch",textSize:13},"2.7INCH":{paperSize:"30.6rem",itemName:"Item Name ",dynamicClassname:"size-3inch",textSize:19},"1.8INCH":{paperSize:"20.7rem",itemName:"Item Name ",dynamicClassname:"size-2inch",textSize:13},A4:{paperSize:"297mm",itemName:"Item Name ",dynamicClassname:"size-a4",textSize:13},A5:{paperSize:"148mm",itemName:"Item Name ",dynamicClassname:"size-a5",textSize:9}});var Mt=tr(),_e="normal-class";(Mt=="Android OS"||Mt==="iOS")&&(_e="bold-class");const qe=e=>{var Et,se,Se,yt,Ke;const t=e.additionalActions??{},{invoiceFormat:n={}}=e,r=ge.useRef(null),l=e.settingData?e.settingData:e.value.settingData,o=localStorage.getItem("siteId"),{staticDataKOT:a,printer:m,type:u}=e.printerDataObject,i=((se=(Et=e.value)==null?void 0:Et.settingData)==null?void 0:se.curr)??((Se=e.settingData)==null?void 0:Se.curr)??"INR";l==null||l.fontTheme;let c=e.printerDataObject.paperSize,h=lr(m,{type:u,siteSetting:e.settingData?e.settingData:e.value.settingData},t);const f=l.customLabels??xd();c=h?(yt=h[0])!=null&&yt.paperSize?(Ke=h[0])==null?void 0:Ke.paperSize:c||"3INCH":e.printerDataObject.paperSize;function y(g){const d=Math.abs(parseFloat(g));return p(d)}function p(g){switch(i){case"BHD":case"KWD":case"MUR":case"OMR":return Zs(g).format("0,00.000");default:return Zs(g).format("0,00.00")}}ge.useEffect(()=>{S()},[e.newId]);const v=()=>new Promise(async(g,d)=>{if(Mt=="Android OS"||Mt==="iOS"){let C=await bh(r.current);if(C){const j=await E(C);g(j)}}else{let C=await $a(r.current);C&&g(C)}}),_=()=>new Promise(async(g,d)=>{const C=await v();g(C)}),E=g=>new Promise((d,C)=>{let j=new Image;j.src=g,j.onload=()=>{let w=document.createElement("canvas");const Y=600,b=j.height;let F=j.width,V=j.height;F>V?F>Y&&(V*=Y/F,F=Y):V>b&&(F*=b/V,V=b),w.width=F,w.height=V,w.getContext("2d").drawImage(j,0,0,F,V),d(w.toDataURL())}}),S=async()=>{if(r&&r.current){const g=await _();e.onImageGenerated(g)}},T=g=>{let d=new Array;for(const C in g.menusCollection)C.endsWith("collection")||(g.menusCollection[`${C}_collection`]||g.menusCollection[C])&&d.push(s.jsxs("h5",{className:"left-align-entity level3-bold display-percentage",children:[s.jsx("span",{children:` -- ${C.replace("_"," ")}(${g.menusCollection[C]}):`}),s.jsx("span",{children:le(g.menusCollection[`${C}_collection`],i)}),s.jsx("span",{children:p(gs(g.salesCollection.totalCollection,g.menusCollection[`${C}_collection`]??0))+"%"})]}));return g.salesCollection.online_aggregator_collection&&d.push(s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:` -- Aggregator(${g.salesCollection.online_aggregator}):`}),s.jsx("span",{children:le(g.salesCollection.online_aggregator_collection,i)})]}),s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:` -- Zomato(${g.salesCollection.zomato_aggregator??0}):`}),s.jsx("span",{children:le(g.salesCollection.zomato_aggregator_collection,i)})]}),s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:` -- Swiggy(${g.salesCollection.swiggy_aggregator??0}):`}),s.jsx("span",{children:le(g.salesCollection.swiggy_aggregator_collection,i)})]})),d},D=g=>{let d=new Array,C=new Object;for(let j=0;j<g.todayCollection.length;j++)C=g.todayCollection[j],d.push(s.jsxs("h5",{className:"left-align-entity level3-bold display-percentage",children:[s.jsx("span",{children:` -- ${C.displayName}:`}),s.jsx("span",{children:le(C.value,i)}),s.jsx("span",{children:p(gs(g.totalCollection,C.value))+"%"})]}));return d},$=(g,d,C,j,w={})=>{let Y=g.includes("upi://");const b=`upi://pay?pa=${g}&pn=${C}&cu=INR&am=${j}&tr=${d}`;return s.jsx(ei,{value:Y?g:b,renderAs:"canvas",size:w.size??250})},k=(g,d)=>{var Y,b;let C=0;if((Y=d.taxObj)!=null&&Y.VAT.length){let F,V,fe;for(V=0;V<((b=d.taxObj)==null?void 0:b.VAT.length);V++){F=d.taxObj.VAT[V];for(fe in F)C+=ve(F[fe])}}const j={sellerName:d.companyInfo.companyName,vatRegistrationNumber:g,invoiceTimestamp:new Date(d.orderInfo.timestamp*1e3).toISOString(),invoiceTotal:d.finalAmount,invoiceVatTotal:C},w=gd(j.sellerName,j.vatRegistrationNumber,j.invoiceTimestamp,j.invoiceTotal,j.invoiceVatTotal.toFixed(2));return s.jsx(ei,{value:w,renderAs:"canvas",size:250})},J=g=>{const d=[];return(g.totalBalanceAmt||g.refundAmt||g.writeOffAmt||g.rewardAmt||g.cashCard)&&(d.push(s.jsx("hr",{})),g.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:le(g.rewardAmt,i)})]})),g.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:le(g.totalBalanceAmt,i)})]})),g.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:le(g.writeOffAmt,i)})]})),g.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:le(g.refundAmt,i)})]})),g.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:le(g.cashCard,i)})]}))),d},re=(g,d)=>{if(d&&d.length){for(let C=0;C<d.length;C++)if(d[C].slugName===g)return d[C]}return!1},te=(g,d)=>{if(d&&d.length){for(let C=0;C<d.length;C++)if(d[C].itemType===g)return d[C]}return!1},de=new Object({CREDIT:"Other Income",DEBIT:"Expense"}),be=g=>g.discountType==="COMPLIMENTARY"?"@ COMPLIMENTARY":g.discountType==="NON_CHARGEABLE"?"@ NON CHARGEABLE":`@ ${g.discountValue}${Mh[g.discountType]}`,Z=g=>{const d=new Array;if(g&&Object.keys(g).length!==0){d.push(s.jsx("h4",{className:"single-entity-and-center",children:"ACCOUNTS"}));for(const C in g)if(d.push(s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsx("span",{children:`Total ${de[C]}:`}),s.jsx("span",{children:le(g[C].total,i)})]})),C&&Object.keys(C).length!==0)for(const j in g[C])j!=="total"&&g[C][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:le(g[C][j],i)})]}))}return d},X=(g,d)=>{let C=!1;g.totalValue&&(C=Object.keys(g.totalValue).length>1);let j=new Object;return s.jsxs(s.Fragment,{children:[g.totalValue&&Object.keys(g.totalValue).map(Y=>{if(j=g.totalValue[Y],Y==="GST")return s.jsxs(s.Fragment,{children:[s.jsx("hr",{}),s.jsxs("section",{className:"products-section",children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h4",{className:`items products-heading-name ${L[c].dynamicClassname}`,dangerouslySetInnerHTML:{__html:d.item_name}}),s.jsx("h4",{className:`items products-heading-qty ${L[c].dynamicClassname}`,dangerouslySetInnerHTML:{__html:d.qty}}),s.jsx("h4",{className:`items products-heading-rate ${L[c].dynamicClassname}`,dangerouslySetInnerHTML:{__html:d.rate}}),s.jsx("h4",{className:`items products-heading-amt ${L[c].dynamicClassname}`,dangerouslySetInnerHTML:{__html:d.amt}})]}),s.jsx("hr",{})]}),s.jsxs("section",{className:"products-section",style:{paddingTop:"12px"},children:[g.itemList&&g.itemList.length&&g.itemList.length>0&&g.itemList.map(b=>{if(b.taxType===Y||!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 ${L[c].dynamicClassname}`,style:{fontWeight:"lighter",lineHeight:1.2},children:[b.status==="RETURNED"?"(R) ":"",b.name.toUpperCase()]}),s.jsxs("h6",{className:`items products-heading-qty ${L[c].dynamicClassname}`,style:{fontWeight:"lighter"},children:[b.status==="RETURNED"?"-":"",b.quantity]}),s.jsx("h6",{className:`items products-heading-rate ${L[c].dynamicClassname}`,style:{fontWeight:"lighter"},children:b.rate?y(b.rate):""}),s.jsx("h6",{className:`items products-heading-amt ${L[c].dynamicClassname}`,style:{fontWeight:"lighter"},children:b.status==="RETURNED"?b.serviceAmount?p(b.serviceAmount):"":b.price?p(b.price):""})]}),b.addons&&b.addons.length&&b.addons.map(F=>s.jsx("h6",{className:`items products-heading-addon-kot ${L[c].dynamicClassname}`,children:"- "+Ve(F.serviceName)})),b.instruction&&g.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 ${L[c].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:g.curr+" "+p(j.gstTTL)})]}),o=="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=re(b,g.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:g.curr+" "+p(j.cat[b])})]})}):"",g.totalItemDisc&&j&&j.itemTypes&&Object.keys(j.itemTypes).length>0?Object.keys(j.itemTypes).map(b=>{const F=te(b,g.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:g.curr+" "+p(j.itemTypes[b])})]})}):"",g.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${g.segMentObj.segmentName.toLowerCase()}`]??g.segMentObj.segmentName.toUpperCase()+"DISC"}}),s.jsx("span",{children:" @"+g.segMentObj.discountValue+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+p(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:g.couponCode?d.coupon_disc??"COUPON DISC":d.order_disc??"ORDER DISC"}}),":",s.jsxs("span",{children:[g.couponCode?`(${g.couponCode.toUpperCase()})`:"",p(g.dicsEnterValue)?`@${g.dicsEnterValue}${g.discountType=="RELATIVE"||g.discountType=="COMPLIMENTARY"||g.discountType=="NON_CHARGEABLE"?"%":"AMT"}`:""]})]})}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+p(j.orderDisc)})]}):"",o=="25e5f1e4-68ff-43a7-b042-bebb93f42b94"&&j&&j.orderDisc?s.jsxs("div",{className:"bottom-section-div",children:[s.jsxs("h5",{className:"total-qty",children:["  ",g.couponCode?"COUPON DISC":"خصم الطلب",g.couponCode?`(${g.couponCode.toUpperCase()})`:""]}),s.jsx("h5",{className:"actual-qty"})]}):"",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:g.curr+" "+p(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:g.curr+" "+p(j.aftDisc)})]}):"",o=="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"})]}):"",g.taxObj&&g.taxObj[Y]&&j?s.jsx(s.Fragment,{children:Y==="GST"?g.taxObj[Y].map(b=>{let F=new Array;for(const V in b)if(b[V]&&b[V]!=0){let fe=V/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:" @"+fe+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+p(b[V]/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[g.taxLabel.toLowerCase()]}}),s.jsx("span",{children:" @"+fe+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+p(b[V]/2)})]})]}))}return F}):g.taxObj[Y].map(b=>{let F=new Array;for(const V in b)if(b[V]&&b[V]!=0){let fe=V;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:" @"+fe+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+p(b[V])})]})}))}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:g.curr+" "+p((j.total||0)+(j.aftDisc||0)+j.taxOnCharges)})]}),o=="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"})]}),g.totalValue&&(Object.keys(g.totalValue).length||0)>1?s.jsx("h4",{className:"single-entity-and-center",style:{marginTop:"10px"},children:"- - - - -"}):"",C&&s.jsx("div",{className:"space-2rem"})]})]})}),g.totalValue&&Object.keys(g.totalValue).map(Y=>{if(j=g.totalValue[Y],Y==="VAT")return s.jsxs(s.Fragment,{children:[s.jsx("hr",{}),s.jsxs("section",{className:"products-section",children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h6",{className:`items products-heading-name ${L[c].dynamicClassname}`,dangerouslySetInnerHTML:{__html:d.item_name}}),s.jsx("h6",{className:`items products-heading-qty ${L[c].dynamicClassname}`,dangerouslySetInnerHTML:{__html:d.qty}}),s.jsx("h6",{className:`items products-heading-rate ${L[c].dynamicClassname}`,dangerouslySetInnerHTML:{__html:d.rate}}),s.jsx("h6",{className:`items products-heading-amt ${L[c].dynamicClassname}`,dangerouslySetInnerHTML:{__html:d.amt}})]}),s.jsx("hr",{})]}),s.jsxs("section",{className:"products-section",style:{paddingTop:"12px"},children:[g.itemList&&g.itemList.length&&g.itemList.length>0&&g.itemList.map(b=>{if(b.taxType===Y)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 ${L[c].dynamicClassname}`,children:[b.status==="RETURNED"?"(R) ":"",b.name.toUpperCase()]}),s.jsxs("h6",{className:`items products-heading-qty ${L[c].dynamicClassname}`,children:[b.status==="RETURNED"?"-":"",b.quantity]}),s.jsx("h6",{className:`items products-heading-rate ${L[c].dynamicClassname}`,children:b.rate?y(b.rate):""}),s.jsx("h6",{className:`items products-heading-amt ${L[c].dynamicClassname}`,children:b.status==="RETURNED"?b.serviceAmount?p(b.serviceAmount):"":b.price?p(b.price):""})]}),b.addons&&b.addons.length&&b.addons.map(F=>s.jsx("h6",{className:`items products-heading-addon-kot ${L[c].dynamicClassname}`,children:"- "+Ve(F.serviceName)})),b.instruction&&g.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 ${L[c].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:g.curr+" "+p(j.vatTTL)})]}),o=="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=re(b,g.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:g.curr+" "+p(j.cat[b])})]})}):"",g.totalItemDisc&&j&&j.itemTypes&&Object.keys(j.itemTypes).length>0?Object.keys(j.itemTypes).map(b=>{const F=te(b,g.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:g.curr+" "+p(j.itemTypes[b])})]})}):"",g.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${g.segMentObj.segmentName.toLowerCase()}`]??g.segMentObj.segmentName.toUpperCase()+"DISC"}}),s.jsx("span",{children:" @"+g.segMentObj.discountValue+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+p(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:g.couponCode?d.coupon_disc??"COUPON DISC":d.order_disc??"ORDER DISC"}}),":",s.jsxs("span",{children:[g.couponCode?`(${g.couponCode.toUpperCase()})`:"",p(g.dicsEnterValue)?`@${g.dicsEnterValue}${g.discountType=="RELATIVE"||g.discountType=="COMPLIMENTARY"||g.discountType=="NON_CHARGEABLE"?"%":"AMT"}`:""]})]})}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+p(j.orderDisc)})]}):"",o=="25e5f1e4-68ff-43a7-b042-bebb93f42b94"&&j&&j.orderDisc?s.jsxs("div",{className:"bottom-section-div",children:[s.jsxs("h5",{className:"total-qty",children:["  ",g.couponCode?"COUPON DISC":"خصم الطلب",g.couponCode?`(${g.couponCode.toUpperCase()})`:""]}),s.jsx("h5",{className:"actual-qty"})]}):"",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:g.curr+" "+p(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:g.curr+" "+p(j.aftDisc)})]}):"",o=="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:g.curr+" "+p(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[g.taxLabel.toLowerCase()]}}),s.jsx("span",{children:" @"+b.tax/2+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+p(b.taxOnAmount/2)})]})]}):""})):"",g.taxObj&&g.taxObj[Y]&&j?s.jsx(s.Fragment,{children:Y==="GST"?g.taxObj[Y].map(b=>{let F=new Array;for(const V in b)if(b[V]&&b[V]!=0){let fe=V/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:" @"+fe+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+p(b[V]/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[g.taxLabel.toLowerCase()]}}),s.jsx("span",{children:" @"+fe+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+p(b[V]/2)})]})]}))}return F}):g.taxObj[Y].map(b=>{let F=new Array;for(const V in b)if(b[V]&&b[V]!=0){let fe=V;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:" @"+fe+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:g.curr+" "+p(b[V])})]})}))}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:g.curr+" "+p((j.total||0)+(j.aftDisc||0)+j.taxOnCharges)})]}),o=="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"})]})]})]})})]})},q=(g,d,{labels:C,doMultipleTax:j,type:w})=>{var b,F,V,fe,Me,Le,Ce,Ye,Qe,gt,Rt;const Y=g.discounts;return s.jsxs(s.Fragment,{children:[s.jsx("hr",{}),s.jsxs("section",{className:"products-section",children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h4",{className:`items products-heading-name ${L[c].dynamicClassname}`,dangerouslySetInnerHTML:{__html:C.item_name}}),s.jsx("h4",{className:`items products-heading-qty ${L[c].dynamicClassname}`,dangerouslySetInnerHTML:{__html:C.qty}}),s.jsx("h4",{className:`items products-heading-rate ${L[c].dynamicClassname}`,dangerouslySetInnerHTML:{__html:C.rate}}),s.jsx("h4",{className:`items products-heading-amt ${L[c].dynamicClassname}`,dangerouslySetInnerHTML:{__html:C.amt}})]}),s.jsx("hr",{})]}),s.jsxs("section",{className:"products-section",style:{paddingTop:"12px"},children:[g.itemList.map(Q=>{var St;return s.jsxs("div",{style:Q.serviceName.startsWith("+ ")?{}:{paddingTop:"12px"},children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsxs("h6",{className:`items products-heading-name ${L[c].dynamicClassname}`,style:{lineHeight:1.2},children:[Q.status==="RETURNED"?"(R) ":"",Q.serviceName.toUpperCase()]}),s.jsxs("h6",{className:`items products-heading-qty ${L[c].dynamicClassname}`,children:[Q.status==="RETURNED"?"-":"",Q.qty]}),s.jsx("h6",{className:`items products-heading-rate ${L[c].dynamicClassname}`,children:Q.serviceRate?y(Q.serviceRate):""}),s.jsx("h6",{className:`items products-heading-amt ${L[c].dynamicClassname}`,children:Q.sub_total?p(Q.sub_total):""})]}),Q.hsnCode&&d.printHSNCodeOnBill&&s.jsxs("h6",{className:`items products-heading-name ${L[c].dynamicClassname}`,style:{lineHeight:1.2},children:["HSN: ",Q.hsnCode]}),(St=Q.addons)!=null&&St.length?Q.addons.map(rt=>s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h6",{className:`items products-heading-name ${L[c].dynamicClassname}`,style:{lineHeight:1.2},children:"+ "+Ve(rt.serviceName)}),s.jsxs("h6",{className:`items products-heading-qty ${L[c].dynamicClassname}`,children:[Q.status==="RETURNED"?"-":"",rt.qty*Q.qty]}),s.jsx("h6",{className:`items products-heading-rate ${L[c].dynamicClassname}`}),s.jsx("h6",{className:`items products-heading-amt ${L[c].dynamicClassname}`})]}),s.jsx("div",{children:rt.hsnCode&&d.printHSNCodeOnBill&&s.jsxs("h6",{className:`items products-heading-name ${L[c].dynamicClassname}`,style:{lineHeight:1.2},children:["HSN: ",rt.hsnCode]})})]})):"",Q.instruction&&d.itemInstructionOnBill?s.jsx("h6",{className:"left-align-entity level2-bold",children:s.jsx("h6",{className:"items products-heading-addon-kot",children:" ("+Q.instruction+")"})}):""]})}),s.jsx("hr",{})]}),s.jsxs("div",{className:`bottom-section ${L[c].dynamicClassname} ${_e}`,children:[s.jsxs("div",{className:"bottom-section-div inline-display",style:{paddingTop:"12px"},children:[s.jsx("h5",{className:"total-qty",dangerouslySetInnerHTML:{__html:C.subtotal}}),s.jsx("h5",{className:"actual-qty",children:d.curr+" "+p(g.subTotal)})]}),o=="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=Y.DISCOUNT_ITEMS)!=null&&b.length?Y.DISCOUNT_ITEMS.map(Q=>s.jsxs("div",{className:`bottom-section-div inline-display ${_e}`,children:[s.jsx("h5",{className:"total-qty",children:s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:C[`disc_${Q.discountName.toLowerCase()}`]??"DISC-"+Q.discountName.toUpperCase()}}),s.jsx("span",{children:be(Q)})]})}),s.jsx("h5",{className:"actual-qty",children:d.curr+" "+p(Q.discountAmt)})]})):"",(F=Y.CATEGORY_DISCOUNT)!=null&&F.length?Y.CATEGORY_DISCOUNT.map(Q=>s.jsxs("div",{className:`bottom-section-div inline-display ${_e}`,children:[s.jsx("h5",{className:"total-qty",children:s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:C[`disc_${Q.discountName.toLowerCase()}`]??"DISC-"+Q.discountName.toUpperCase()}}),s.jsx("span",{children:" @"+Q.discountValue+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:d.curr+" "+p(Q.discountAmt)})]})):"",(V=Y.ITEM_DISCOUNT)!=null&&V.length?Y.ITEM_DISCOUNT.map(Q=>s.jsxs("div",{className:`bottom-section-div inline-display ${_e}`,children:[s.jsx("h5",{className:"total-qty",children:s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:C[`disc_${Q.discountName.toLowerCase()}`]??"DISC-"+ts(Q.discountName).toUpperCase()}}),s.jsx("span",{children:" @"+Q.discountValue+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:d.curr+" "+p(Q.discountAmt)})]})):"",(Me=(fe=Y.SEGMENT_DISCOUNT)==null?void 0:fe[0])!=null&&Me.discountAmt?s.jsxs("div",{className:`bottom-section-div inline-display ${_e}`,children:[s.jsx("h5",{className:"total-qty",children:s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:C[`segment_disc${Y.SEGMENT_DISCOUNT[0].discountName.toLowerCase()}`]??"DISC-"+Y.SEGMENT_DISCOUNT[0].discountName.toUpperCase()}}),":",s.jsx("span",{children:" @"+Y.SEGMENT_DISCOUNT[0].discountValue+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:d.curr+" "+p(Y.SEGMENT_DISCOUNT[0].discountAmt)})]}):"",(Ce=(Le=Y.COUPON_DISCOUNT)==null?void 0:Le[0])!=null&&Ce.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:`(${Y.COUPON_DISCOUNT[0].discountName.toUpperCase()}) @${Y.COUPON_DISCOUNT[0].discountValue}${Y.COUPON_DISCOUNT[0].discountType=="RELATIVE"?"%":"AMT"}`})]})}),s.jsx("h5",{className:"actual-qty",children:d.curr+" "+p(Y.COUPON_DISCOUNT[0].discountAmt)})]}):"",(Qe=(Ye=Y.ORDER_DISCOUNT)==null?void 0:Ye[0])!=null&&Qe.discountAmt?s.jsxs("div",{className:`bottom-section-div inline-display ${_e}`,children:[s.jsx("h5",{className:"total-qty",children:s.jsxs(s.Fragment,{children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:C.order_disc??"ORDER DISC"}}),":",s.jsx("span",{children:p(Y.ORDER_DISCOUNT[0].discountValue)?`@${Y.ORDER_DISCOUNT[0].discountValue}${Y.ORDER_DISCOUNT[0].discountType=="RELATIVE"||Y.ORDER_DISCOUNT[0].discountType=="COMPLIMENTARY"||Y.ORDER_DISCOUNT[0].discountType=="NON_CHARGEABLE"?"%":"AMT"}`:""})]})}),s.jsx("h5",{className:"actual-qty",children:d.curr+" "+p(Y.ORDER_DISCOUNT[0].discountAmt)})]}):"",o=="25e5f1e4-68ff-43a7-b042-bebb93f42b94"&&g&&g.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"})]}):"",(gt=g.charges)!=null&&gt.length?g.charges.map(Q=>s.jsx(s.Fragment,{children:s.jsxs("div",{className:`bottom-section-div inline-display ${_e}`,children:[s.jsx("h5",{className:"total-qty",children:s.jsx("span",{dangerouslySetInnerHTML:{__html:C[`charges_${Q.name.toLowerCase()}`]??Q.name}})}),d.invoiceType=="INCLUSIVE_SIMPLIFIED"?s.jsx("h5",{className:"actual-qty",children:d.curr+" "+p(Q.amt+Q.taxAmt)}):s.jsx("h5",{className:"actual-qty",children:d.curr+" "+p(Q.amt)})]})})):"",g.subTotal!==g.afterCharges&&g.afterCharges!==g.total&&d.invoiceType!=="INCLUSIVE_SIMPLIFIED"?s.jsxs("div",{className:`bottom-section-div inline-display ${_e}`,children:[s.jsx("h5",{className:"total-qty",dangerouslySetInnerHTML:{__html:C.amt_before_tax}}),s.jsx("h5",{className:"actual-qty",children:d.curr+" "+p(g.afterCharges)})]}):"",o=="25e5f1e4-68ff-43a7-b042-bebb93f42b94"&&g.subTotal!==g.afterCharges?s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h5",{className:"total-qty",children:"المبلغ قبل الضريبة"}),s.jsx("h5",{className:"actual-qty"})]}):"",d.invoiceType!=="INCLUSIVE_SIMPLIFIED"&&((Rt=g.taxation)!=null&&Rt.length)?g.taxation.map(Q=>{if(Q.taxAmt)return Q.taxType==="GST"?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:`bottom-section-div ${_e}`,children:[s.jsx("h5",{className:"total-qty",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:C.cgst}}),s.jsx("span",{children:"@"+Q.tax/2+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:d.curr+" "+p(Q.taxAmt/2)})]}),s.jsxs("div",{className:`bottom-section-div ${_e}`,children:[s.jsx("h5",{className:"total-qty",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:C[d.taxLabel.toLowerCase()]}}),s.jsx("span",{children:"@"+Q.tax/2+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:d.curr+" "+p(Q.taxAmt/2)})]})]}):s.jsxs("div",{className:`bottom-section-div ${_e}`,children:[s.jsx("h5",{className:"total-qty",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:C.vat}}),s.jsx("span",{children:"@"+Q.tax+"%"})]})}),s.jsx("h5",{className:"actual-qty",children:d.curr+" "+p(Q.taxAmt)})]})}):"",s.jsxs("div",{className:`bottom-section-div inline-display ${_e}`,children:[s.jsx("h5",{className:"total-qty",dangerouslySetInnerHTML:{__html:C.total}}),s.jsx("h5",{className:"actual-qty",children:d.curr+" "+p(g.total)})]}),j?s.jsx(s.Fragment,{children:w==="GST"?s.jsxs(s.Fragment,{children:[s.jsx("h4",{className:"single-entity-and-center",style:{marginTop:"10px"},children:"- - - - -"}),s.jsx("div",{className:"space-2rem"})]}):""}):""]})},ue=(g,d)=>{var Y,b;let C=!1;const j=g.distributedData;return g.distributedData&&(C=Object.keys(g.distributedData).length>1),s.jsxs(s.Fragment,{children:[((Y=j.GST)==null?void 0:Y.itemList)&&q(j.GST,g,{labels:d,doMultipleTax:C,type:"GST"}),((b=j.VAT)==null?void 0:b.itemList)&&q(j.VAT,g,{labels:d,doMultipleTax:C,type:"VAT"})]})},z=g=>{const d=g.services,C=Object.keys(g.services),j=C.length;return s.jsxs(s.Fragment,{children:[s.jsx("hr",{}),s.jsxs("section",{className:`products-section ${_e}`,children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h5",{className:"items products-heading-name-kot",children:L[c].itemName}),s.jsx("h5",{className:"items products-heading-qty-kot",children:"QTY"})]}),s.jsx("hr",{})]}),s.jsxs("section",{className:"products-section",children:[j&&C.map((Y,b)=>s.jsxs(s.Fragment,{children:[s.jsx("h4",{className:"left-align-entity level3-bold",children:s.jsxs("u",{children:[Y.toUpperCase(),":"]})}),d[Y].map(F=>{var V;return s.jsxs("div",{children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h4",{className:`items products-heading-name-kot ${L[c].dynamicClassname}`,children:Ve(F.serviceName)}),s.jsx("h4",{className:`items products-heading-qty-kot ${L[c].dynamicClassname}`,children:F.qty})]}),((V=F.addons)==null?void 0:V.length)&&F.addons.map(fe=>{var Me;return s.jsx("h5",{className:"items products-heading-addon-kot",children:"- "+((Me=fe.serviceName)==null?void 0:Me.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",{})]})]})},ee=g=>{const d=g.slice(0,-4),C=g.slice(-4);return{firstDigits:d,last4Dgits:C}},De=(g,d,C,j={})=>{const w=Object.keys(d??{});let Y=[],b,F="flex-two-items";if(j.action==="addCharges"&&(F="display-percentage"),g&&w.length){Y.push(s.jsxs(s.Fragment,{children:[s.jsx("h4",{className:"single-entity-and-center",children:`${C.toUpperCase()} BREAK-UP`}),s.jsxs("h5",{className:"left-align-entity level3-bold flex-two-items",children:[s.jsxs("span",{children:["Total ",C,":"]}),s.jsx("span",{children:le(g,i)})]})]}));for(let V=0;V<w.length;V++)b=w[V],d[b]&&Y.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:le(d[b],i)}),j.action==="addCharges"?s.jsx("span",{children:p(gs(g,d[b]))+"%"}):""]}));Y.push(s.jsx("hr",{}))}return Y},nt=g=>{const d=Object.keys(g.Category),C=Object.keys(g.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((w,Y)=>{const b=g.Category[w];let F=[];j.push(s.jsxs(s.Fragment,{children:[s.jsxs("h4",{className:"left-align-entity level3-bold",children:[" - "," ",ts(w)]}),s.jsxs("section",{className:"products-section",children:[b.forEach(V=>{F.push(s.jsx(s.Fragment,{children:s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h6",{className:`items products-heading-name-kot ${L["3INCH"].dynamicClassname}`,children:V.serviceName}),s.jsx("h6",{className:`items products-heading-qty-kot ${L["3INCH"].dynamicClassname}`,children:parseFloat(V.qty.toFixed(2))})]})}))}),F,Y!=d.length-1&&s.jsx("hr",{})]})]}))}),C.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"})]})),C.forEach((w,Y)=>{const b=g.Addon[w];let F=[];j.push(s.jsxs(s.Fragment,{children:[s.jsxs("h4",{className:"left-align-entity level3-bold",children:[" - "," ",ts(w)]}),s.jsxs("section",{className:"products-section",children:[b.forEach(V=>{F.push(s.jsx(s.Fragment,{children:s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h6",{className:`items products-heading-name-kot ${L["3INCH"].dynamicClassname}`,children:V.serviceName}),s.jsx("h6",{className:`items products-heading-qty-kot ${L["3INCH"].dynamicClassname}`,children:parseFloat(V.qty.toFixed(2))})]})}))}),F,Y!=C.length-1&&s.jsx("hr",{className:"dashed"})]})]}))})),j},At=g=>{var C;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",nonChargeable_disc:"NON CHARGEABLE BILL",amt_before_tax:"AMT BEFORE TAX",total:"TOTAL",grand_total:"GRAND TOTAL",reward_point_balance:"REWARD POINT BALANCE",balance_amt:"BALANCE AMOUNT",rewards_redeemed:"REWARDS REDEEMED",vat:"VAT",sgst:"SGST",cgst:"CGST",utgst:"UTGST",igst:"IGST",previous_outstanding:"PREVIOUS OUTSTANDING",total_payable:"TOTAL PAYABLE",delivery_code:"Delivery Code",online_order_id:"Online Order ID",area_name:"Area Name",table_name:"Table Name",captain_name:"Captain Name"};if((C=g==null?void 0:g.customBillLabels)!=null&&C.length){let j;for(let w=0;w<g.customBillLabels.length;w++)j=g.customBillLabels[w],d[j.defaultName]=j.displayName}return d},pt=(g,d,C,j)=>{var V,fe,Me,Le,Ce,Ye,Qe,gt,Rt,Q,St,rt,xs,an,Ns,js,ln,on,cn,dn,hn,un,mn,Qt,vs,xt,Zt,Jt,_s,fn,bs,pn,Ss,Ts,yn,gn,ws,Is,xn,Nn,jn,vn,x,O,U;const w=At(l.customLabelsMap),Y=ms(Nd(l.paymentModes),"internalName"),b=P=>{var N;return(N=Y[P])!=null&&N.displayName?Y[P].displayName.toUpperCase():P};if(g==="BILL"){let P;if(c==="A4"||c==="A5"){let N={...d},H=0,W=N.distributedData;const A=W.discounts;P=s.jsx("div",{className:`invoiceContainer main-div ${L[c].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:`${w.order_no}:`},className:"font-weight-bold"}),s.jsx("span",{children:N.orderId})]}),s.jsxs("td",{width:"50%",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:`${w.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:C&&s.jsx("img",{src:C,width:90})})})]}),s.jsx("tr",{children:s.jsx("td",{colSpan:12,className:"text-center border-right",style:{padding:"0px 1.4rem"},children:s.jsx("h6",{children:s.jsx("strong",{children:"Tax Invoice"})})})}),s.jsxs("tr",{children:[s.jsx("td",{colSpan:6,className:"v-align-baseline col-6",children:s.jsxs("div",{className:"divPadding",children:[(N.customerInfo.custName||((V=N.customFields)==null?void 0:V.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})}),(fe=N.customFields)!=null&&fe.length?N.customFields.map(I=>s.jsx("tr",{children:s.jsxs("td",{width:"10%",children:[I.customName,": ",I.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:`${w.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:`${w.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:`${w.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(I=>{var Ae;let he="",Ne=[];return H++,Ne.push(s.jsxs(s.Fragment,{children:[s.jsxs("tr",{style:{lineHeight:"10px"},className:he,children:[s.jsx("td",{className:"text-align-left",children:I.serviceRate?H:""}),s.jsx("td",{style:{width:"40%"},className:"text-align-left",children:I.serviceName.toUpperCase()}),s.jsx("td",{className:"text-align-left",children:I.qty}),s.jsx("td",{className:"text-align-right",children:I.serviceRate?G(I.serviceRate,i):""}),s.jsx("td",{className:"text-align-right",children:I.sub_total?G(I.sub_total,i):""})]}),I.instruction&&s.jsxs("tr",{children:[s.jsx("td",{}),s.jsx("td",{style:{width:"40%"},children:"("+I.instruction+")"})]})]})),(Ae=I.addons)!=null&&Ae.length&&I.addons.map(Ze=>{Ne.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:["+ ",Ze.serviceName.toUpperCase()]}),s.jsx("td",{children:Ze.qty*I.qty})]}),Ze.instruction&&s.jsxs("tr",{children:[s.jsx("td",{}),s.jsx("td",{style:{width:"40%"},children:"("+Ze.instruction+")"})]})]}))}),Ne}),s.jsx("tr",{style:{lineHeight:"10px",fontSize:"14px"},children:s.jsx("td",{colSpan:5,children:s.jsx("strong",{className:"font-weight-bold",children:`Total ${H} Items and ${ve(W.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",{}),pd(Oe(N.finalAmount,i).toFixed(Wt[i].minimumFractionDigits??2))]})}),s.jsx("hr",{}),N.upiId&&d.companyInfo.companyName&&d.paymentStatus!=="PAID"&&(!d.splitDetails||d.splitDetails&&((Me=d.splitDetails)==null?void 0:Me.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.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:w.subtotal}})})}),s.jsx("td",{width:"50%",className:"text-align-right",children:G(W.subTotal,i)})]}),(Le=A==null?void 0:A.DISCOUNT_ITEMS)!=null&&Le.length?A.DISCOUNT_ITEMS.map(I=>s.jsxs("tr",{className:"subtotalTr",children:[s.jsxs("td",{width:"50%",children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:w[`disc_${I.discountName.toLowerCase()}`]??"DISC-"+I.discountName.toUpperCase()}}),s.jsx("span",{children:be(I)})]}),s.jsx("td",{className:"text-align-right",width:"50%",children:G(I.discountAmt,i)})]})):"",(Ce=A==null?void 0:A.CATEGORY_DISCOUNT)!=null&&Ce.length?A.CATEGORY_DISCOUNT.map(I=>s.jsxs("tr",{className:"subtotalTr",children:[s.jsxs("td",{width:"50%",children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:w[`disc_${I.discountName.toLowerCase()}`]??"DISC-"+I.discountName.toUpperCase()}}),s.jsx("span",{children:" @"+I.discountValue+"%"})]}),s.jsx("td",{className:"text-align-right",width:"50%",children:G(I.discountAmt,i)})]})):"",(Ye=A==null?void 0:A.ITEM_DISCOUNT)!=null&&Ye.length?A.ITEM_DISCOUNT.map(I=>s.jsxs("tr",{className:"subtotalTr",children:[s.jsxs("td",{width:"50%",children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:w[`disc_${I.discountName.toLowerCase()}`]??"DISC-"+I.discountName.toUpperCase()}}),s.jsx("span",{children:" @"+I.discountValue+"%"})]}),s.jsx("td",{className:"text-align-right",width:"50%",children:G(I.discountAmt,i)})]})):"",(gt=(Qe=A==null?void 0:A.SEGMENT_DISCOUNT)==null?void 0:Qe[0])!=null&&gt.discountAmt?s.jsxs("tr",{className:"subtotalTr",children:[s.jsxs("td",{width:"50%",children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:w[`segment_disc${A.SEGMENT_DISCOUNT[0].discountName.toLowerCase()}`]??"DISC-"+A.SEGMENT_DISCOUNT[0].discountName.toUpperCase()}}),s.jsx("span",{children:" @"+A.SEGMENT_DISCOUNT[0].discountValue+"%"})]}),s.jsx("td",{className:"text-align-right",width:"50%",children:G(A.SEGMENT_DISCOUNT[0].discountAmt,i)})]}):"",(Q=(Rt=A==null?void 0:A.COUPON_DISCOUNT)==null?void 0:Rt[0])!=null&&Q.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:`(${A.COUPON_DISCOUNT[0].discountName.toUpperCase()}) @${A.COUPON_DISCOUNT[0].discountValue}${A.COUPON_DISCOUNT[0].discountType=="RELATIVE"?"%":"AMT"}`})]}),s.jsx("td",{className:"text-align-right",width:"50%",children:G(A.COUPON_DISCOUNT[0].discountAmt,i)})]}):"",(rt=(St=A==null?void 0:A.ORDER_DISCOUNT)==null?void 0:St[0])!=null&&rt.discountAmt?s.jsxs("tr",{className:"subtotalTr",children:[s.jsxs("td",{width:"50%",children:[s.jsx("span",{className:"spaced-text",dangerouslySetInnerHTML:{__html:w.order_disc??"ORDER DISC"}}),s.jsx("span",{children:p(A.ORDER_DISCOUNT[0].discountValue)?`@${A.ORDER_DISCOUNT[0].discountValue}${A.ORDER_DISCOUNT[0].discountType=="RELATIVE"||A.ORDER_DISCOUNT[0].discountType=="COMPLIMENTARY"||A.ORDER_DISCOUNT[0].discountType=="NON_CHARGEABLE"?"%":"AMT"}`:""})]}),s.jsx("td",{className:"text-align-right",width:"50%",children:G(A.ORDER_DISCOUNT[0].discountAmt,i)})]}):"",(xs=W.charges)!=null&&xs.length?W.charges.map(I=>s.jsxs("tr",{className:"subtotalTr",children:[s.jsx("td",{width:"50%",children:s.jsx("span",{dangerouslySetInnerHTML:{__html:w[`charges_${I.name.toLowerCase()}`]??I.name}})}),s.jsx("td",{className:"text-align-right",width:"50%",children:G(I.amt,i)})]})):"",W.subTotal!==W.afterCharges?s.jsxs("tr",{className:"subtotalTr",children:[s.jsx("td",{width:"50%",children:s.jsx("span",{dangerouslySetInnerHTML:{__html:w.amt_before_tax}})}),s.jsx("td",{className:"text-align-right",width:"50%",children:G(W.afterCharges,i)})]}):"",(an=W.taxation)!=null&&an.length?W.taxation.map(I=>I.taxType==="GST"?s.jsxs(s.Fragment,{children:[s.jsxs("tr",{className:"subtotalTr",children:[s.jsxs("td",{width:"50%",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:w.cgst}}),s.jsx("span",{children:" @"+I.tax/2+"%"})]}),s.jsx("td",{className:"text-align-right",width:"50%",children:G(I.taxAmt/2,i)})]}),s.jsxs("tr",{className:"subtotalTr",children:[s.jsxs("td",{width:"50%",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:w.sgst}}),s.jsx("span",{children:" @"+I.tax/2+"%"})]}),s.jsx("td",{className:"text-align-right",width:"50%",children:G(I.taxAmt/2,i)})]})]}):s.jsxs("tr",{className:"subtotalTr",children:[s.jsxs("td",{width:"50%",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:w.vat}}),s.jsx("span",{children:" @"+I.tax+"%"})]}),s.jsx("td",{className:"text-align-right",width:"50%",children:G(I.taxAmt,i)})]})):"",s.jsxs("tr",{className:"font-weight-bold subtotalTr",children:[s.jsx("td",{width:"50%",children:s.jsx("strong",{dangerouslySetInnerHTML:{__html:w.grand_total}})}),s.jsx("td",{className:"text-align-right",width:"50%",children:G(N.finalAmount,i)})]}),(Ns=d==null?void 0:d.custoutStandingData)!=null&&Ns.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:w.previous_outstanding}})}),s.jsx("td",{className:"text-align-right",width:"50%",children:G((js=N==null?void 0:N.custoutStandingData)==null?void 0:js.balanceAmt,i)})]}),s.jsxs("tr",{className:"font-weight-bold subtotalTr",children:[s.jsx("td",{width:"50%",children:s.jsx("strong",{dangerouslySetInnerHTML:{__html:w.total_payable}})}),s.jsx("td",{className:"text-align-right",width:"50%",children:G(N.grandTotal+((ln=N==null?void 0:N.custoutStandingData)==null?void 0:ln.balanceAmt),i)})]})]}):"",N.rewardAmt?s.jsxs("tr",{className:"subtotalTr",children:[s.jsx("td",{width:"50%",children:s.jsx("span",{dangerouslySetInnerHTML:{__html:w.rewards_redeemed}})}),s.jsx("td",{className:"text-align-right",width:"50%",children:G(N.rewardAmt,i)})]}):"",(on=d.paymentMethods)!=null&&on.length?d.paymentMethods.map(I=>{var he;if(I.paidAmt)return s.jsxs("tr",{className:"subtotalTr",children:[s.jsxs("td",{width:"50%",children:["-"," ",s.jsx("span",{dangerouslySetInnerHTML:{__html:w[`${(he=I.paymentMode)==null?void 0:he.toLowerCase()}`]??b(I.paymentMode)??"CASH"}}),s.jsx("span",{children:I.isRefund?"(Refund)":""})]}),I.isRefund?s.jsx("td",{className:"text-align-right",width:"50%",children:"("+G(I.paidAmt,i)+")"}):s.jsx("td",{className:"text-align-right",width:"50%",children:G(I.paidAmt,i)})]})}):"",N.balanceAmt&&d.balanceAmt!=0?s.jsxs("tr",{className:"subtotalTr",children:[s.jsx("td",{width:"50%",children:s.jsx("span",{dangerouslySetInnerHTML:{__html:w.balance_amt}})}),s.jsx("td",{className:"text-align-right",width:"50%",children:G(d.balanceAmt,i)})]}):"",d.balPoint&&!Number.isNaN(d.balPoint)?s.jsxs("tr",{className:"subtotalTr",children:[s.jsx("td",{width:"50%",children:s.jsx("span",{dangerouslySetInnerHTML:{__html:w.reward_point_balance}})}),s.jsx("td",{className:"text-align-right",width:"50%",children:d.balPoint})]}):"",(cn=d.splitDetails)!=null&&cn.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(I=>s.jsxs("tr",{className:"subtotalTr",children:[s.jsx("td",{width:"50%",children:s.jsx("span",{dangerouslySetInnerHTML:{__html:I.name}})}),s.jsx("td",{className:"text-align-right",width:"50%",children:d.curr+" "+I.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 P=s.jsx("div",{className:"main-div bill",style:{width:L[c].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",{}),C&&s.jsx("div",{className:"image-bill",children:s.jsx("img",{src:C,className:"single-entity-and-center",style:{width:L[c].logoWidth}})}),s.jsxs("div",{className:`details-section ${L[c].dynamicClassname}`,children:[!C&&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:w.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:w.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:w.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:w.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:w.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.menuDisplayName?d.menuDisplayName: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:w.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 ${L[c].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:w.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:w.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:w.address}}),": ",s.jsx("span",{children:d.customerInfo.custAddress})]})}),ft(d.appliedDiscounts??[],"COMPLIMENTARY","discountType").discountType&&s.jsx("h5",{className:"left-align-entity level2-bold",dangerouslySetInnerHTML:{__html:w.complementary_disc}}),ft(d.appliedDiscounts??[],"NON_CHARGEABLE","discountType").discountType&&s.jsx("h5",{className:"left-align-entity level2-bold",dangerouslySetInnerHTML:{__html:w.nonChargeable_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:w.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:w.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:w.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:w.captain_name}}),":",s.jsx("span",{children:d.captainName})]})})]}),(dn=d.customFields)!=null&&dn.length?s.jsxs("div",{className:`details-section ${L[c].dynamicClassname}`,children:[s.jsx("hr",{}),d.customFields.map(N=>s.jsx("h4",{className:"left-align-entity",children:N.customName+": "+N.customValue}))]}):"",d.newFormat?ue(d,w):X(d,w),s.jsx("br",{}),s.jsxs("div",{className:`bottom-section ${L[c].dynamicClassname}`,children:[s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h6",{className:`total-qty ${(hn=d.custoutStandingData)!=null&&hn.balanceAmt||d.rewardAmt&&d.paymentMethods&&d.paymentMethods.length>0?"level3-bold":"level2-bold"}`,style:{fontSize:c==="2INCH"||c==="1.8INCH"?"1.50rem":"1.75rem"},dangerouslySetInnerHTML:{__html:w.grand_total}}),s.jsx("h6",{className:`actual-qty ${(un=d.custoutStandingData)!=null&&un.balanceAmt||d.rewardAmt&&d.paymentMethods&&d.paymentMethods.length>0?"level3-bold":"level2-bold"}`,style:{fontSize:c==="2INCH"||c==="1.8INCH"?"1.40rem":"1.75rem"},children:d.curr+" "+p(d.finalAmount)})]}),(mn=d.custoutStandingData)!=null&&mn.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:w.previous_outstanding}})}),s.jsx("h5",{children:d.curr+" "+p(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:c==="2INCH"||c==="1.8INCH"?"1.50rem":"1.75rem"},dangerouslySetInnerHTML:{__html:w.total_payable}}),s.jsx("h6",{className:"actual-qty level2-bold",style:{fontSize:c==="2INCH"||c==="1.8INCH"?"1.40rem":"1.75rem"},children:d.curr+" "+p(d.finalAmount+d.custoutStandingData.balanceAmt)})]}):""]}):"",o=="25e5f1e4-68ff-43a7-b042-bebb93f42b94"?s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h6",{className:"total-qty level2-bold",style:{fontSize:c==="2INCH"||c==="1.8INCH"?"1.50rem":"1.75rem"},children:"المجموع الإجمالي"}),s.jsx("h6",{className:"actual-qty level2-bold",style:{fontSize:c==="2INCH"||c==="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:w.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 H;if(N.paidAmt)return s.jsxs("div",{className:`bottom-section-div inline-display ${_e}`,children:[s.jsxs("h5",{children:["-",s.jsx("span",{dangerouslySetInnerHTML:{__html:w[`${(H=N.paymentMode)==null?void 0:H.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+" ("+p(N.paidAmt)+")"}):s.jsx(s.Fragment,{children:d.curr+" "+p(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:c==="2INCH"||c==="1.8INCH"?"1.50rem":"1.75rem"},dangerouslySetInnerHTML:{__html:w.total_payable}}),s.jsx("h6",{className:"actual-qty level2-bold",style:{fontSize:c==="2INCH"||c==="1.8INCH"?"1.40rem":"1.75rem"},children:d.curr+" "+p(d.finalAmount+(((Qt=d==null?void 0:d.custoutStandingData)==null?void 0:Qt.balanceAmt)||0)-d.rewardAmt)})]})}):"",Oh((vs=d.convertedCurrValue)==null?void 0:vs.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:`(${G(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:w.balance_amt}}),s.jsx("h5",{children:d.curr+" "+p(d.balanceAmt)})]}):"",s.jsx("hr",{})]}),d.earnPoints&&d.paymentMethods&&!(n!=null&&n.hideRewardPoints)?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)&&!(n!=null&&n.hideRewardPoints)?s.jsxs("div",{className:"bottom-section-div inline-display",children:[s.jsx("h6",{className:"total-qty line-gaps",dangerouslySetInnerHTML:{__html:w.reward_point_balance}}),s.jsx("h6",{className:"actual-qty",children:d.balPoint+d.earnPoints||0})]}):"",(xt=d.splitDetails)!=null&&xt.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"&&((Zt=d.taxation)!=null&&Zt.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:L[c].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 Mt==="Android OS"||Mt==="iOS"?N.taxType==="GST"?s.jsxs(s.Fragment,{children:[s.jsxs("tr",{className:L[c].dynamicClassname,children:[s.jsx("th",{dangerouslySetInnerHTML:{__html:`${w.cgst} ${N.tax/2}%`}}),s.jsx("th",{children:d.curr+" "+Oe(N.taxableAmt,i)}),s.jsx("th",{children:d.curr+" "+Oe(N.taxAmt/2,i)})]}),s.jsxs("tr",{className:L[c].dynamicClassname,children:[s.jsx("th",{dangerouslySetInnerHTML:{__html:`${w[d.taxLabel.toLowerCase()]} ${N.tax/2}%`}}),s.jsx("th",{children:d.curr+" "+Oe(N.taxableAmt,i)}),s.jsx("th",{children:d.curr+" "+Oe(N.taxAmt/2,i)})]})]}):s.jsxs("tr",{className:L[c].dynamicClassname,children:[s.jsx("th",{dangerouslySetInnerHTML:{__html:`${w.vat} ${N.tax}%`}}),s.jsx("th",{children:d.curr+" "+Oe(N.taxableAmt,i)}),s.jsx("th",{children:d.curr+" "+Oe(N.taxAmt,i)})]}):N.taxType==="GST"?s.jsxs(s.Fragment,{children:[s.jsxs("tr",{className:L[c].dynamicClassname,children:[s.jsx("td",{dangerouslySetInnerHTML:{__html:`${w.cgst} ${N.tax/2}%`}}),s.jsx("td",{children:d.curr+" "+Oe(N.taxableAmt,i)}),s.jsx("td",{children:d.curr+" "+Oe(N.taxAmt/2,i)})]}),s.jsxs("tr",{className:L[c].dynamicClassname,children:[s.jsx("td",{dangerouslySetInnerHTML:{__html:`${w[d.taxLabel.toLowerCase()]} ${N.tax/2}%`}}),s.jsx("td",{children:d.curr+" "+Oe(N.taxableAmt,i)}),s.jsx("td",{children:d.curr+" "+Oe(N.taxAmt/2,i)})]})]}):s.jsxs("tr",{className:L[c].dynamicClassname,children:[s.jsx("td",{dangerouslySetInnerHTML:{__html:`${w.vat} ${N.tax}%`}}),s.jsx("td",{children:d.curr+" "+Oe(N.taxableAmt,i)}),s.jsx("td",{children:d.curr+" "+Oe(N.taxAmt,i)})]})})]})})]}):"",d.upiId&&d.companyInfo.companyName&&(!d.splitDetails||d.splitDetails&&((Jt=d.splitDetails)==null?void 0:Jt.length)==0)&&s.jsxs("div",{className:"single-entity-and-center",children:[s.jsx("h6",{style:{marginTop:"6px"},children:"Scan this QRCode to Pay"}),$(d.upiId,d.orderId,d.companyInfo.companyName,d.paidAmount)]}),d.curr==="SAR"&&l.vatNo&&s.jsxs("div",{className:"single-entity-and-center",children:[s.jsx("h6",{style:{marginTop:"6px"},children:"Scan with ZATCA app for invoice details."}),k(l.vatNo,d)]}),j?s.jsx("div",{className:"image-bill",children:s.jsx("img",{src:`${j}`,className:"single-entity-and-center",style:{width:L[c].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 P}else if(g==="PRINT_DASHBOARD"&&d.salesCollection){const P=d.salesCollection.totalDiscountAmt?gs(d.salesCollection.grandTotal,d.salesCollection.totalDiscountAmt):null,N=d.salesCollection.totalCollection-d.salesCollection.totalTax;var F=R().format("DD/MM/YYYY LT");const H=(_s=d.monthTillDateSalesColl)!=null&&_s.totalDiscountAmt?gs(d.monthTillDateSalesColl.grandTotal,d.monthTillDateSalesColl.totalDiscountAmt):null;return s.jsxs("div",{className:`main-div ${L[c].dynamicClassname}`,style:{width:L[c].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:le(d.monthTillDateSalesColl.grandTotal,i)})]}),s.jsxs("h5",{className:"level3-bold flex-two-items",children:[s.jsx("span",{children:"DISCOUNT:"}),s.jsx("span",{children:`${le(d.monthTillDateSalesColl.totalDiscountAmt,i)}${H?`(${p(H)}%)`:""}`})]}),s.jsxs("h5",{className:"level3-bold flex-two-items",children:[s.jsx("span",{children:"CHARGES:"}),s.jsx("span",{children:le(d.monthTillDateSalesColl.totalOtherCharges,i)})]}),s.jsxs("h5",{className:"level3-bold flex-two-items",children:[s.jsx("span",{children:"NET SALES BEFORE TAX:"}),s.jsx("span",{children:le(d.monthTillDateSalesColl.totalCollection-d.monthTillDateSalesColl.totalTax,i)})]}),s.jsxs("h5",{className:"level3-bold flex-two-items",children:[s.jsx("span",{children:"TAX:"}),s.jsx("span",{children:le(d.monthTillDateSalesColl.totalTax,i)})]}),s.jsxs("h5",{className:"level3-bold flex-two-items",children:[s.jsx("span",{children:"NET SALES AFTER TAX:"}),s.jsx("span",{children:le(d.monthTillDateSalesColl.totalCollection,i)})]})]}),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:le(d.salesCollection.grandTotal,i)})]}),s.jsxs("h5",{className:"level3-bold flex-two-items",children:[s.jsx("span",{children:"DISCOUNT:"}),s.jsx("span",{children:`${le(d.salesCollection.totalDiscountAmt,i)}${P?`(${p(P)}%)`:""}`})]}),s.jsxs("h5",{className:"level3-bold flex-two-items",children:[s.jsx("span",{children:"CHARGES:"}),s.jsx("span",{children:le(d.salesCollection.totalOtherCharges,i)})]}),s.jsxs("h5",{className:"level3-bold flex-two-items",children:[s.jsx("span",{children:"NET SALES BEFORE TAX:"}),s.jsx("span",{children:le(N,i)})]}),s.jsxs("h5",{className:"level3-bold flex-two-items",children:[s.jsx("span",{children:"TAX:"}),s.jsx("span",{children:le(d.salesCollection.totalTax,i)})]}),s.jsxs("h5",{className:"level3-bold flex-two-items",children:[s.jsx("span",{children:"NET SALES AFTER TAX:"}),s.jsx("span",{children:le(d.salesCollection.totalCollection,i)})]})]}),s.jsx("hr",{}),De(d.otherFields.totalDiscountAmt,d.otherFields.discountList,"Discount",{action:"addCharges"}),De(d.otherFields.totalOtherCharges,d.otherFields.otherChargesList,"Charges"),De(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:le(d.salesCollection.totalCollection,i)})]}),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})]}),T(d)]}),s.jsx("hr",{}),d.otherFields.totalItemType?s.jsx("div",{children:De(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 ",l.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:le(d.averageCollection.avgorderValue,i)})]}):"",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:le(d.averageCollection.avgPerCover,i)})]}):"",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:le(d.totalCollection,i)})]}),D(d)]}),J(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:le(d.otherFields.salesCollection,i)})]}),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:le(d.otherFields.outstandingAmt,i)})]}):""]})]}):"",s.jsx("hr",{}),Z(d.averageCollection.dailyExpanse)]}),s.jsx("br",{}),Mt=="Android OS"&&s.jsx("div",{className:"space-3rem"})]})}else if(g==="AGGREGATOR_BILL"){let P;return a.aggregatorOrderId&&a.aggregatorOrderId!==""&&(P=ee(a.aggregatorOrderId)),s.jsx("div",{className:"main-div bill",style:{width:L[c].paperSize},children:s.jsxs("div",{children:[s.jsxs("div",{style:{width:"100%",textAlign:"left",marginLeft:"auto"},children:[s.jsx("br",{}),C&&s.jsx("div",{className:"image-bill",children:s.jsx("img",{src:C,className:"single-entity-and-center",style:{width:L[c].logoWidth}})}),s.jsxs("div",{className:`details-section ${L[c].dynamicClassname}`,children:[!C&&a.companyInfo.companyName&&a.companyInfo.companyName!=""&&s.jsx("h1",{className:"single-entity-and-center",children:a.companyInfo.companyName}),a.companyInfo.companyAddress&&a.companyInfo.companyAddress!==""&&s.jsx("h3",{className:"single-entity-and-center",dangerouslySetInnerHTML:{__html:a.companyInfo.companyAddress}}),a.companyInfo.companyContact&&a.companyInfo.companyContact!==""&&s.jsx("h3",{className:"single-entity-and-center",children:s.jsxs("div",{className:"inline-display",children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:w.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:w.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:w.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:w.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:w.company_VAT}}),": ",s.jsx("span",{children:a.vatNo})]})}),a.orderFrom&&s.jsx("h3",{className:"single-entity-and-center level2-bold",children:a.menuDisplayName?a.menuDisplayName:a.orderFrom}),a.orderSource&&P&&s.jsxs("h4",{className:"single-entity-and-center",children:[`${a.orderSource}: ${P.firstDigits||""}`,s.jsxs("span",{style:{fontSize:"2rem"},children:["-",P.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:w.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:w.token_no}})," ",s.jsx("span",{children:a.tokenId})]})})]}),s.jsx("hr",{}),s.jsxs("div",{className:`details-section ${L[c].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:w.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:w.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:w.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:w.order_no}}),": ",s.jsx("span",{children:a.orderId})]})}),a.orderFrom&&s.jsx("h5",{className:"single-entity-and-center",children:a.menuDisplayName?a.menuDisplayName: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:w.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:w.delivery_date}}),":",s.jsx("span",{children:a.deliveryTimestamp})]})})]})]}),s.jsx("hr",{}),s.jsxs("section",{className:"products-section",children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h6",{className:"items products-heading-name-kot",children:L[c].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:[((fn=a.services)==null?void 0:fn.length)&&a.services.map(H=>{var W;return s.jsxs("div",{style:H.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:H.serviceName.toUpperCase()}),s.jsx("h6",{className:"items products-heading-qty-kot",children:H.qty})]}),((W=H.addons)==null?void 0:W.length)&&H.addons.map(A=>s.jsx("h6",{className:"items products-heading-addon-kot",children:"- "+Ve(A.serviceName)})),H.instruction&&a.itemInstructionOnBill&&s.jsx("h6",{className:"left-align-entity level2-bold",children:s.jsx("h6",{className:"items products-heading-addon-kot",children:H.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:le(a.discountAmt,i)})]}):"",a.otherCharges&&a.otherCharges.length>0?a.otherCharges.map(H=>{if(H.amt)return s.jsxs("div",{className:"bottom-section-div",children:[s.jsx("h5",{children:H.name}),s.jsx("h5",{children:a.curr+" "+p(H.amt)})]})}):"",a.taxObj&&a.taxObj.GST?s.jsx(s.Fragment,{children:a.taxObj.GST.map(H=>{let W=new Array;for(const A in H)if(H[A]&&H[A]!=0){let I=A/2;W.push(s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"bottom-section-div",children:[s.jsxs("h5",{children:["CGST @",I]}),s.jsx("h5",{children:a.curr+" "+p(H[A]/2)})]}),s.jsxs("div",{className:"bottom-section-div",children:[s.jsxs("h5",{children:[d.taxLabel+" "," @",I,"%"]}),s.jsx("h5",{children:a.curr+" "+p(H[A]/2)})]})]}))}return W})}):"",s.jsx("div",{style:{marginTop:"6px"},children:(bs=a.customFeilds)==null?void 0:bs.map(H=>s.jsx("h4",{className:"left-align-entity",children:H.customName+": "+H.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:L[c].logoWidth}})}):"",a.footerMessage?s.jsx("h4",{className:"single-entity-and-center",dangerouslySetInnerHTML:{__html:a.footerMessage}}):"",a.printedBy&&a.printOperatorInfo?s.jsx("h6",{className:"left-align-entity",children:`Printed By: ${a.printedBy}`}):"",a.printTime&&a.printOperatorInfo?s.jsx("h6",{className:"left-align-entity",children:`Printed On: ${a.printTime}`}):"",a.disabledPoweredBy?"":s.jsx("h6",{className:"single-entity-and-center",children:"Powered By: www.recaho.com"})]})})}else if(g==="UPDATE_TABLE"){let P="";return a.action==="SWITCH_TABLE"?P=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:["**",(pn=f.Table)==null?void 0:pn.toUpperCase()," SWITCH**"]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:"From"}),s.jsx("h5",{className:"left-align-entity level3-bold",children:(Ss=a.from)==null?void 0:Ss.map((N,H)=>{var W,A,I;return`${(A=(W=e.tableData[N])==null?void 0:W.attachedArea)==null?void 0:A.toUpperCase()} - ${(I=e.tableData[N])==null?void 0:I.tableName}${H+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:`${(yn=(Ts=e.tableData[a.to[0]])==null?void 0:Ts.attachedArea)==null?void 0:yn.toUpperCase()} - ${(gn=e.tableData[a.to[0]])==null?void 0:gn.tableName}`}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["Running ",`${f.KOT}`,"s: ",Object.keys(a.activeKots).join(", ")]})]})}):P=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 ",(ws=f.Table)==null?void 0:ws.toUpperCase(),"**"]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:"From"}),s.jsx("h5",{className:"left-align-entity level3-bold",children:(Is=a.from)==null?void 0:Is.map((N,H)=>{var W,A,I;return`${(A=(W=e.tableData[N])==null?void 0:W.attachedArea)==null?void 0:A.toUpperCase()} - ${(I=e.tableData[N])==null?void 0:I.tableName}${H+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:`${(Nn=(xn=e.tableData[a.to[0]])==null?void 0:xn.attachedArea)==null?void 0:Nn.toUpperCase()} - ${(jn=e.tableData[a.to[0]])==null?void 0:jn.tableName}`}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["Running ",`${f.KOT}`,"s: ",Object.keys(a.activeKots).join(", ")]})]})}),P}else if(g==="COUNTER_OPERATION"){let P;return c=="2INCH"||c=="1.8INCH"?P=s.jsx("div",{className:"main-div",style:{width:L[c].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: ",G(a.totalSale,i)," "]}),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: ",G(a.cashSale,i)," "]}),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," : ",G(N.value,i)]})})]}),s.jsxs("h4",{className:"left-align-entity level3-bold",children:["Cash Balance: ",G(a.closingActualBalance,i)]}),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:["    ",G(a.openingBalance,i)," "]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" -- Actual Opening Balance : "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["    ",G(a.actualOpeningBalance,i)]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" -- Opening Difference Amt : "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["    ",G(a.openingShort,i)," "]}),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:i=="INR"?"denomination-container":"denomination-container-other-country",children:[s.jsxs("h5",{className:"left-align-entity level3-bold",children:["   ",i=="INR"?G(N.denomination,i):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:[" ",G(N.total,i)," "]})]})),a.openingTotalDenomations>0&&s.jsxs("div",{class:i=="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:G(a.openingTotalDenomations,i)})]}),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:["    ",G(a.cashSale,i)," "]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" -- System Closing Balance : "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["    ",G(a.closingBalance,i)," "]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" -- Actual Closing Balance : "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["   ",G(a.closingActualBalance,i)]}),s.jsx("h5",{className:"left-align-entity level3-bold",children:" -- Closing Difference Amt : "}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["    ",G(a.closingShort,i)," "]}),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:["    -",G(a.debitEntry,i)," "]})]}),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:["    +",G(a.creditEntry,i)," "]})]}),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:["   -",G(a.internalTransferDebit,i)]})]}),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:["   +",G(a.internalTransferCredit,i)]})]}),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:i=="INR"?"denomination-container":"denomination-container-other-country",children:[s.jsxs("h5",{className:"left-align-entity level3-bold",children:["  ",i=="INR"?G(N.denomination,i):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:[" ",G(N.total,i)," "]})]})),a.TotalDenomationsAmount>0&&s.jsxs("div",{class:i=="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:G(a.TotalDenomationsAmount,i)})]})]})}):P=s.jsx("div",{className:"main-div",style:{width:L[c].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: ",G(a.totalSale,i)," "]}),a.totalSale>0&&s.jsxs(s.Fragment,{children:[a.cashSale>0&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:[" -- Cash: ",G(a.cashSale,i)," "]}),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," : ",G(N.value,i)]})})]}),s.jsxs("h4",{className:"left-align-entity level3-bold",children:["Cash Balance: ",G(a.closingActualBalance,i)]}),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 : ",G(a.openingBalance,i)]}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- Actual Opening Balance : ",G(a.actualOpeningBalance,i)]}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- Opening Difference Amt : ",G(a.openingShort,i)]}),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:i=="INR"?"denomination-container":"denomination-container-other-country",children:[s.jsxs("h5",{className:"left-align-entity level3-bold",children:["   ",i=="INR"?G(N.denomination,i):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:[" ",G(N.total,i)," "]})]})),a.openingTotalDenomations>0&&s.jsxs("div",{class:i=="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:G(a.openingTotalDenomations,i)})]}),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 : ",G(a.cashSale,i)," "]}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- System Closing Balance : ",G(a.closingBalance,i)]}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- Actual Closing Balance : ",G(a.closingActualBalance,i)]}),s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- Closing Difference Amt : ",G(a.closingShort,i)]}),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 : -",G(a.debitEntry,i)]}),a.creditEntry>0&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- Other Cash Income : +",G(a.creditEntry,i)]}),a.internalTransferDebit>0&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- Internal Transfer(cash to bank): -",G(a.internalTransferDebit,i)]}),a.internalTransferCredit>0&&s.jsxs("h5",{className:"left-align-entity level3-bold",children:["-- Internal Transfer(bank to cash): +",G(a.internalTransferCredit,i)]}),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:i=="INR"?"denomination-container":"denomination-container-other-country",children:[s.jsxs("h5",{className:"left-align-entity level3-bold",children:["  ",i=="INR"?G(N.denomination,i):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:[" ",G(N.total,i)," "]})]})),a.TotalDenomationsAmount>0&&s.jsxs("div",{class:i=="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:G(a.TotalDenomationsAmount,i)})]})]})}),P}else if(g==="ITEMWISE_SALES_COUNTER"){let P,{counterDetails:N}=e.printerDataObject;return P=s.jsx("div",{className:"main-div",style:{width:L[c].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",{}),nt(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}`})]})}),P}else if(g==="CARD_RECHARGE_DETAILS"){let{staticDataKOT:P}=e.printerDataObject;return getRechargeDetails(P)}else if(g==="PACKAGING_SLIP"){let P,N=0;d.aggregatorOrderId&&d.aggregatorOrderId!==""&&(P=ee(d.aggregatorOrderId));const H=d.services;for(let A in H)N+=H[A].length;return s.jsx("div",{className:"main-div",style:{width:L[c].paperSize},children:s.jsxs("div",{style:{width:"100%",textAlign:"left",marginLeft:"auto"},children:[s.jsx("br",{}),s.jsxs("div",{className:`details-section ${L[c].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&&P&&s.jsxs("h4",{className:"single-entity-and-center level2-bold",children:[`${d.orderSource}: ${P.firstDigits||""}`,s.jsx("span",{style:{fontSize:"2rem"},children:P.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:`${f.Waiter} Name: `+d.waiterName})]}),z(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)]})]}),(vn=d.customFields)==null?void 0:vn.map(A=>s.jsx("h4",{className:"left-align-entity",children:A.customName+": "+A.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(g==="ORDER_AGGREGATED_PRINT")return s.jsx("div",{className:"main-div",style:{width:L[c].paperSize},children:s.jsxs("div",{style:{width:"100%",textAlign:"left",marginLeft:"auto"},children:[a.logo&&s.jsx("div",{className:"image-bill",children:s.jsx("img",{src:a.logo,className:"single-entity-and-center"})}),s.jsxs("div",{className:`details-section ${L[c].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:w.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:w.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:w.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:w.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:w.name}}),": ",s.jsx("span",{children:a.name})]}),a.mobile&&s.jsxs("h5",{children:[s.jsx("span",{dangerouslySetInnerHTML:{__html:w.mobile}}),": ",s.jsx("span",{children:a.mobile})]}),s.jsxs("div",{className:"mt-2",children:[s.jsx("hr",{}),s.jsx("section",{className:"products-section",children:s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h5",{className:`items products-heading-name ${L[c].dynamicClassname}`,children:"Date"}),s.jsx("h5",{className:`items products-heading-orderId ${L[c].dynamicClassname}`,children:"Order Id"}),s.jsx("h5",{className:`items products-heading-amount ${L[c].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 ${L[c].dynamicClassname}`,children:rr(N.date)}),s.jsx("h6",{className:`items products-heading-orderId ${L[c].dynamicClassname}`,children:N.orderId}),s.jsx("h6",{className:`items products-heading-amount ${L[c].dynamicClassname}`,children:a.curr+" "+p(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+" "+p(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+" "+p(a.totalPaid)})]})]}),(x=a.transactions)!=null&&x.length?s.jsxs("div",{children:[s.jsx("hr",{}),s.jsx("section",{className:"products-section",children:s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h5",{className:`items products-heading-name ${L[c].dynamicClassname}`,children:"Date"}),s.jsx("h5",{className:`items products-heading-orderId ${L[c].dynamicClassname}`,children:"Payment Mode"}),s.jsx("h5",{className:`items products-heading-amount ${L[c].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 ${L[c].dynamicClassname}`,children:N.date}),s.jsx("h6",{className:`items products-heading-orderId ${L[c].dynamicClassname}`,children:N.paymentMode}),s.jsx("h6",{className:`items products-heading-amount ${L[c].dynamicClassname}`,children:a.curr+" "+p(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+" "+p(a.totalPayable)})]})]})]})});{let P,N=0,H,W;for(let I=0;I<(((O=a.services)==null?void 0:O.length)||0);I++)W=a.services[I],W.status==="CANCELLED"&&!a.onlyCancelledItems&&(N+=W.qty);return a.aggregatorOrderId&&a.aggregatorOrderId!==""&&(P=ee(a.aggregatorOrderId)),s.jsx("div",{className:"main-div",style:{width:L[c].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&&P&&s.jsxs("h4",{className:"single-entity-and-center level2-bold",children:[`${a.orderSource}: ${P.firstDigits||""}`,s.jsx("span",{style:{fontSize:"2rem"},children:P.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:`${f.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:`${f.Waiter} Name: `+a.waiterName})]}),s.jsx("hr",{}),s.jsxs("section",{className:`products-section ${_e}`,children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h5",{className:"items products-heading-name-kot",children:L[c].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(I=>(I.status==="CANCELLED"?H=s.jsxs("strike",{children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h2",{className:"items products-heading-name-kot ",children:Ve(I.serviceName)}),s.jsx("h2",{className:"items products-heading-qty-kot ",children:I.qty})]}),I.addons&&I.addons.length&&I.addons.map(he=>s.jsx("h2",{className:"items products-heading-addon-kot",children:"- "+Ve(he.serviceName)})),I.instruction&&s.jsx("h4",{className:"left-align-entity level2-bold",children:s.jsx("h4",{className:"items products-heading-addon-kot",children:" "+I.instruction})})]}):H=s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"products-heading-div",children:[s.jsx("h2",{className:"items products-heading-name-kot ",children:Ve(I.serviceName)}),s.jsx("h2",{className:"items products-heading-qty-kot ",children:I.qty})]}),I.addons&&I.addons.length&&I.addons.map(he=>s.jsx("h2",{className:"items products-heading-addon-kot",children:"- "+Ve(he.serviceName)})),I.instruction&&s.jsx("h4",{className:"left-align-entity level2-bold",children:s.jsx("h4",{className:"items products-heading-addon-kot",children:" "+I.instruction})})]}),s.jsx("div",{children:H}))),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)]})]}),(U=a.customFields)==null?void 0:U.map(I=>s.jsx("h4",{className:"left-align-entity",children:I.customName+": "+I.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:r,className:"html-bill-print",style:{maxWidth:L[c].paperSize,zIndex:"-10",backgroundColor:"#fff"},children:pt(u,a.obj,a.companyLogo,a.companyQrCode)})})},Ah=async(e,t,n,r={})=>new Promise(async(l,o)=>{var a,m,u;try{const{needPackagingSlip:i=!0}=r;e.primaryWaiter&&n&&(e.primaryWaiter=((a=n[e.primaryWaiter])==null?void 0:a.name)||null);const{obj:c,printersMap:h}=bd(e,t,r);let f=[],y=[];const p=[];if(Sa(c).flatMap(v=>{(h[v.station]||[]).forEach(E=>{const S=new Promise(T=>{p.push(s.jsx(qe,{printerDataObject:{staticDataKOT:v,paperSize:E.paperSize,printer:E.printer},newId:v.newId,value:{settingData:t},onImageGenerated:D=>{f.push({paperSize:E.paperSize,printer:E.printer,image:D,type:"KOT"}),T()},additionalActions:r},v.newId+"::"+E.printer))});y.push(S)})}),i&&((m=t.packagingSlipPrinters)!=null&&m.length)){const v=Sd(e,t,r);(u=v.printers)!=null&&u.length&&v.printers.forEach(_=>{y.push(new Promise(E=>{p.push(s.jsx(qe,{printerDataObject:{staticDataKOT:{obj:_.obj},paperSize:_.paperSize,printer:_.printer,type:"PACKAGING_SLIP"},newId:_.obj.newId,value:{settingData:t},onImageGenerated:S=>{f.push({paperSize:_.paperSize,printer:_.printer,image:S,type:"PACKAGING_SLIP"}),E()},additionalActions:r},_.obj.newId))}))})}p.length&&bt("root2",p),await Promise.all(y),l(f)}catch(i){o(i)}}),Eh=(e,t,n)=>new Promise(async(r,l)=>{try{const{tableData:o}=n;let a=[],m=[];if(n!=null&&n.action){const{obj:u,paperSize:i,printersMap:c}=Td(e,t,n),h=Sa(u).flatMap(f=>{var y;return(y=c[f.station])==null?void 0:y.map(p=>new Promise(v=>{const _=s.jsx(qe,{printerDataObject:{staticDataKOT:f,paperSize:i,printer:p.printer,type:f.type},newId:f.newId,settingData:t,tableData:ms(o,"typeValue"),onImageGenerated:E=>{a.push({paperSize:p.paperSize,printer:p.printer,image:E,type:"UPDATE_TABLE"}),v()},additionalActions:n});return m.push(v),_}))});h.length&&bt("root1",h),await Promise.all(m.map(f=>new Promise(f)))}r(a)}catch(o){l(o)}}),Rh=(e,t)=>new Promise(async(n,r)=>{try{const l=wd(e,t);let o=[];await new Promise(m=>{const u=s.jsx(qe,{printerDataObject:{staticDataKOT:{obj:l},paperSize:e.printerSize,type:"PRINT_DASHBOARD"},newId:l.id,settingData:e,onImageGenerated:i=>{o.push({paperSize:e.printerSize,image:i,type:"PRINT_DASHBOARD"}),m()},additionalActions:t});bt("root1",u)}),n(o)}catch(l){r(l)}}),Lh=async(e,t,n)=>new Promise(async(r,l)=>{try{const{obj:o}=await Id(e,t,n);let a=[];await new Promise(u=>{const i=s.jsx(qe,{printerDataObject:{staticDataKOT:o,paperSize:o.paperSize,type:"AGGREGATOR_BILL"},newId:Math.random(),settingData:t,onImageGenerated:c=>{a.push({paperSize:o.paperSize,image:c,type:"AGGREGATOR_BILL"}),u()},additionalActions:n});bt("root1",i)}),r(a)}catch(o){l(o)}}),kh=async(e,t,n)=>new Promise(async(r,l)=>{try{let o=await ba(e,t,n),a=[];await new Promise(async u=>{if(n.isSplitBill&&o.obj.splitDetails&&o.obj.splitDetails.length){const i=o.obj.splitDetails.map((c,h)=>new Promise(f=>{let y=JSON.parse(JSON.stringify(o));y.obj.splitDetails=[c];const p=s.jsx(qe,{printerDataObject:{staticDataKOT:y,paperSize:y.paperSize,type:"BILL"},newId:Math.random(),settingData:t,onImageGenerated:v=>{a.push({paperSize:y.paperSize,image:v,type:"BILL"}),f()},additionalActions:n,invoiceFormat:n.invoiceFormat||{}});ti(p)}));await Promise.all(i),u()}else{const i=s.jsx(qe,{printerDataObject:{staticDataKOT:o,paperSize:o.paperSize,type:"BILL"},newId:Math.random(),settingData:t,onImageGenerated:c=>{a.push({paperSize:o.paperSize,image:c,type:"BILL"}),u()},additionalActions:n,invoiceFormat:n.invoiceFormat||{}});ti(i)}}),r(a)}catch(o){l(o)}}),Ph=async(e,t,n,r)=>new Promise(async(l,o)=>{try{let a=await Cd(e);if(a&&Object.keys(a.Category).length!==0){let u=`ItemWiseSales:::${Math.floor(Math.random()*1e3)}`,i=[];await new Promise(h=>{const f=s.jsx(qe,{printerDataObject:{staticDataKOT:a,paperSize:t.printerSize,type:"ITEMWISE_SALES_COUNTER",counterDetails:n},newId:u,settingData:t,onImageGenerated:y=>{i.push({paperSize:t.printerSize,image:y,type:"ITEMWISE_SALES_COUNTER"}),h()},additionalActions:r});bt("root1",f)}),l(i)}else l([])}catch(a){o(a)}}),Fh=async(e,t,n)=>new Promise(async(r,l)=>{try{let a=`counterDetailsPrint:::${Math.floor(Math.random()*1e3)}`,m=[];await new Promise(i=>{const c=s.jsx(qe,{printerDataObject:{staticDataKOT:e,paperSize:t.printerSize,type:"COUNTER_OPERATION"},newId:a,settingData:t,onImageGenerated:h=>{m.push({paperSize:t.printerSize,image:h,type:"COUNTER_OPERATION"}),i()},additionalActions:n});bt("root1",c)}),r(m)}catch(o){l(o)}}),Dh=async(e,t,n={},r={})=>new Promise(async(l,o)=>{var a;try{const m=await Md(e,t);let u=[],i=lr(null,{fontTheme:t.fontTheme,type:"ORDER_AGGREGATED_PRINT",siteSetting:t}),c=i?(a=i[0])==null?void 0:a.paperSize:t.printerSize;await new Promise(f=>{const y=s.jsx(qe,{printerDataObject:{staticDataKOT:{...m,name:n.name,mobile:n.mobile},paperSize:c,type:"ORDER_AGGREGATED_PRINT"},newId:Math.random(),settingData:t,onImageGenerated:p=>{u.push({paperSize:c,image:p,type:"ORDER_AGGREGATED_PRINT"}),f()},additionalActions:r});bt("root1",y)}),l(u)}catch(m){o(m)}}),Yh=async(e,t,n={})=>new Promise(async(r,l)=>{var o;try{const a=[];let m=[];for(let u=0;u<e.length;u++){let i=e[u];if((o=i.invoiceFormats)!=null&&o.length){let c=dd(i.invoiceFormats,"createdAt")[0],h=await Ad(c);await new Promise(y=>{const p=s.jsx(qe,{printerDataObject:{staticDataKOT:h,paperSize:h.paperSize,type:"BILL"},newId:Math.random(),settingData:t,onImageGenerated:v=>{m.push({paperSize:h.paperSize,image:v,type:"BILL"}),y()},additionalActions:n,invoiceFormat:n.invoiceFormat||{}});a.push(p)})}}a.length&&bt("root1",a),r(m)}catch(a){l(a)}}),bt=(e,t)=>{const n=document.getElementById(e);n&&vr.createRoot(n).render(t)},ti=e=>{try{const t=Object.assign(document.createElement("div"),{id:`react-root-${Math.random().toString(36).slice(2,11)}`,style:"position:absolute; top:-9999px; left:-9999px;"});document.body.appendChild(t);const n=vr.createRoot(t),r=()=>{n.unmount(),t.remove()};n.render(ge.cloneElement(e,{handleUnmount:r}))}catch(t){console.log("renderComponentsV2 err :::",t)}};we.counterDetailsPrint=Fh,we.handleAggregatorBillPrint=Lh,we.handleBillPrint=kh,we.handleDashboardPrint=Rh,we.handleItemWisePrint=Ph,we.handleKOTPrint=Ah,we.handleOldBillPrints=Yh,we.handleSummaryPrint=Dh,we.handleUpdateTablePrint=Eh,Object.defineProperty(we,Symbol.toStringTag,{value:"Module"})});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "recaho-print-react",
3
- "version": "0.0.152",
3
+ "version": "0.0.154",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist"