https://lidomatrip.com/_next/static/chunks/pages/admin/reservations/[id]/invoice-fefa4e2d3fd408fe.js
1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6341],{20268:function(t,e,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/admin/reservations/[id]/invoice",function(){return n(94478)}])},84858:function(t,e,n){"use strict";n.d(e,{LP:function(){return d},MS:function(){return a},Px:function(){return f},SC:function(){return j},YV:function(){return l},d0:function(){return o},hn:function(){return h},qz:function(){return c}});var i=n(68002);let s="lidoma_admin_token",r="lidoma_admin_refresh_token";function d(){return window.localStorage.getItem(s)}function l(){return window.localStorage.getItem(r)}function o(t,e){window.localStorage.setItem(s,t),window.localStorage.setItem(r,e)}function c(){window.localStorage.removeItem(s),window.localStorage.removeItem(r)}function h(){let t=d(),e=l();return!!t&&!!e&&((0,i.dP)({accessToken:t,refreshToken:e}),!0)}class a extends Error{constructor(t,e,n,i){super(e),this.status=t,this.code=n,this.details=i}}let u=null;async function x(){return u||(u=(async()=>{let t=l();if(!t)return null;try{var e,n;let i=await fetch("/api/auth/refresh",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({refreshToken:t})});if(!i.ok)return null;let s=await i.json().catch(()=>({})),r=null==s?void 0:null===(e=s.data)||void 0===e?void 0:e.accessToken,d=null==s?void 0:null===(n=s.data)||void 0===n?void 0:n.refreshToken;if(!r||!d)return null;return o(r,d),r}catch{return null}})().finally(()=>{u=null})),u}async function j(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n="undefined"!=typeof FormData&&e.body instanceof FormData;async function i(i){return fetch(t,{...e,headers:{...n?{}:{"Content-Type":"application/json"},...i?{Authorization:`Bearer ${i}`}:{},...e.headers}})}let s=await i(d());if(401===s.status&&l()&&!t.startsWith("/api/auth/")){let t=await x();t&&(s=await i(t))}let r=await s.json().catch(()=>({}));if(!s.ok)throw 401===s.status&&(c(),window.location.href="/admin/login"),new a(s.status,(null==r?void 0:r.message)??"Ø®Ø·Ø§Û ØºÛØ±Ù ÙØªØ¸Ø±Ù",null==r?void 0:r.code,null==r?void 0:r.details);return r.data??r}async function f(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};async function n(n){return fetch(t,{...e,headers:{"Content-Type":"application/json",...n?{Authorization:`Bearer ${n}`}:{},...e.headers}})}let i=await n(d());if(401===i.status&&l()){let t=await x();t&&(i=await n(t))}let s=await i.json();if(!i.ok)throw 401===i.status&&(c(),window.location.href="/admin/login"),new a(i.status,(null==s?void 0:s.message)??"خطا",null==s?void 0:s.code);return{items:s.data,meta:s.meta}}},94478:function(t,e,n){"use strict";n.r(e),n.d(e,{default:function(){return a}});var i=n(85893),s=n(67294),r=n(11163),d=n(44389),l=n(84858);let o=t=>(t??0).toLocaleString("fa-IR"),c=t=>t?new Intl.DateTimeFormat("fa-IR",{dateStyle:"medium"}).format(new Date(t)):"â",h={DRAFT:"در Ø§ÙØªØ¸Ø§Ø± ثبت Ø¯Ø±Ø®ÙØ§Ø³Øª",HOST_APPROVAL:"در Ø§ÙØªØ¸Ø§Ø± تاÛÛØ¯ Ù ÛØ²Ø¨Ø§Ù",SECOND_PAYMENT:"در Ø§ÙØªØ¸Ø§Ø± پرداخت Ù Ù٠اÙ",DONE:"ÙØ·Ø¹Û",CANCEL:"ÙØºÙ شدÙ",EXPIRED:"Ù ÙÙØ¶Û شدÙ"};function a(){let t=(0,r.useRouter)(),e=t.query.id,{data:n}=(0,d.u)(e?`/api/admin/reservations/${e}/invoice`:null,t=>(0,l.SC)(t));if((0,s.useEffect)(()=>{if(n){let t=setTimeout(()=>window.print(),350);return()=>clearTimeout(t)}},[n]),!n)return(0,i.jsx)("p",{style:{padding:40,fontFamily:"inherit"},children:"در ØØ§Ù آ٠ادÙâØ³Ø§Ø²Û ÙØ§Ú©ØªÙرâ¦"});let a=n.invoice,u=n.guestNameOverride||n.guest.name||"â",x=n.guestPhoneOverride||n.guest.phone;return(0,i.jsxs)("div",{style:{maxWidth:780,margin:"0 auto",padding:32,color:"#111",lineHeight:1.9},children:[(0,i.jsx)("style",{children:` 2 @media print { 3 .no-print { display: none !important; } 4 @page { margin: 14mm; } 5 } 6 table { width: 100%; border-collapse: collapse; } 7 td, th { padding: 7px 8px; border-bottom: 1px solid #e5e5e5; text-align: right; font-size: 13px; } 8 th { font-weight: 600; } 9 h1 { font-size: 20px; margin: 0 0 2px; } 10 h2 { font-size: 14px; margin: 22px 0 6px; } 11 `}),(0,i.jsx)("div",{className:"no-print",style:{marginBottom:20},children:(0,i.jsx)("button",{onClick:()=>window.print(),style:{padding:"8px 18px",cursor:"pointer"},children:"ÚØ§Ù¾"})}),(0,i.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-start"},children:[(0,i.jsxs)("div",{children:[(0,i.jsx)("h1",{children:"ÙØ§Ú©ØªÙر رزرÙ"}),(0,i.jsxs)("p",{style:{margin:0,fontSize:13,color:"#555"},children:["کد رزرÙ: ",n.reference," \xb7 ÙØ¶Ø¹Ûت: ",h[n.state]??n.state]})]}),(0,i.jsxs)("div",{style:{textAlign:"left",fontSize:13,color:"#555"},children:[(0,i.jsx)("div",{children:"ÙÛØ¯Ù٠ا ترÛÙ¾"}),(0,i.jsxs)("div",{children:["ØªØ§Ø±ÛØ® ØµØ¯ÙØ±: ",c(new Date().toISOString())]})]})]}),(0,i.jsx)("h2",{children:"٠شخصات Ø§ÙØ§Ù ت"}),(0,i.jsx)("table",{children:(0,i.jsxs)("tbody",{children:[(0,i.jsxs)("tr",{children:[(0,i.jsx)("th",{style:{width:160},children:"Ø§ÙØ§Ù تگاÙ"}),(0,i.jsxs)("td",{children:[n.residence.name,n.residence.reference?` (${n.residence.reference})`:""]})]}),n.residence.address&&(0,i.jsxs)("tr",{children:[(0,i.jsx)("th",{children:"ÙØ´Ø§ÙÛ"}),(0,i.jsx)("td",{children:n.residence.address})]}),(0,i.jsxs)("tr",{children:[(0,i.jsx)("th",{children:"ØªØ§Ø±ÛØ® Ø§ÙØ§Ù ت"}),(0,i.jsxs)("td",{children:[c(n.startDate)," تا ",c(n.endDate)," \xb7 ",o(n.daysCount)," شب"]})]}),(0,i.jsxs)("tr",{children:[(0,i.jsx)("th",{children:"تعداد Ù Ù٠اÙ"}),(0,i.jsxs)("td",{children:[o(n.guestsCount)," ÙÙØ±"]})]})]})}),(0,i.jsx)("h2",{children:"طرÙÛÙ"}),(0,i.jsx)("table",{children:(0,i.jsxs)("tbody",{children:[(0,i.jsxs)("tr",{children:[(0,i.jsx)("th",{style:{width:160},children:"Ù Ù٠اÙ"}),(0,i.jsxs)("td",{children:[u," â ",x]})]}),(0,i.jsxs)("tr",{children:[(0,i.jsx)("th",{children:"Ù ÛØ²Ø¨Ø§Ù"}),(0,i.jsxs)("td",{children:[n.host.name??"â"," â ",n.host.phone]}
11)]})]})}),(0,i.jsx)("h2",{children:"ØµÙØ±ØªØØ³Ø§Ø¨"}),(0,i.jsx)("table",{children:(0,i.jsxs)("tbody",{children:[(0,i.jsxs)("tr",{children:[(0,i.jsx)("th",{style:{width:260},children:"Ù
Ø¨ÙØº ک٠رزرÙ"}),(0,i.jsxs)("td",{children:[o(a.totalAmount)," تÙÙ
اÙ"]})]}),a.codeDiscount>0&&(0,i.jsxs)("tr",{children:[(0,i.jsxs)("th",{children:["کد تخÙÛÙ",a.discountCode?` (${a.discountCode})`:""]}),(0,i.jsxs)("td",{style:{color:"#C62828"},children:["â",o(a.codeDiscount)," تÙÙ
اÙ"]})]}),a.hostGiftDiscount>0&&(0,i.jsxs)("tr",{children:[(0,i.jsx)("th",{children:"تخÙÛÙ ÙØ¯ÛÙ Ù
ÛØ²Ø¨Ø§Ù"}),(0,i.jsxs)("td",{style:{color:"#C62828"},children:["â",o(a.hostGiftDiscount)," تÙÙ
اÙ"]})]}),a.siteGiftDiscount>0&&(0,i.jsxs)("tr",{children:[(0,i.jsx)("th",{children:"تخÙÛÙ ÙØ¯ÛÙ Ø³Ø§ÛØª"}),(0,i.jsxs)("td",{style:{color:"#C62828"},children:["â",o(a.siteGiftDiscount)," تÙÙ
اÙ"]})]}),a.totalDiscount>0&&(0,i.jsxs)("tr",{children:[(0,i.jsx)("th",{children:"Ù
Ø¨ÙØº ÙÙØ§ÛÛ ØµÙØ±ØªØØ³Ø§Ø¨"}),(0,i.jsxs)("td",{children:[o(a.invoiceAmount)," تÙÙ
اÙ"]})]}),!!a.guestCommission&&(0,i.jsxs)("tr",{children:[(0,i.jsxs)("th",{children:["کارÙ
زد رزر٠Ù
ÙÙ
اÙ",a.guestCommissionPercent?` (${o(a.guestCommissionPercent)}Ùª)`:""]}),(0,i.jsxs)("td",{children:[o(a.guestCommission)," تÙÙ
اÙ"]})]}),(0,i.jsxs)("tr",{children:[(0,i.jsx)("th",{children:"Ù
Ø¨ÙØº ÙÙØ§ÛÛ ÙØ§Ø¨Ù پرداخت Ù
ÙÙ
اÙ"}),(0,i.jsx)("td",{children:(0,i.jsxs)("b",{children:[o(a.guestPayable)," تÙÙ
اÙ"]})})]}),(0,i.jsxs)("tr",{children:[(0,i.jsx)("th",{children:"جÙ
ع Ù¾Ø±Ø¯Ø§Ø®ØªÛ Ù
ÙÙ
اÙ"}),(0,i.jsxs)("td",{children:[o(n.paidAmount)," تÙÙ
اÙ"]})]}),n.remainingAmount>0&&(0,i.jsxs)("tr",{children:[(0,i.jsx)("th",{children:"باÙÛâÙ
Ø§ÙØ¯Ù"}),(0,i.jsxs)("td",{children:[o(n.remainingAmount)," تÙÙ
اÙ"]})]})]})}),(0,i.jsx)("h2",{children:"تسÙÛ٠با Ù
ÛØ²Ø¨Ø§Ù"}),(0,i.jsx)("table",{children:(0,i.jsxs)("tbody",{children:[(0,i.jsxs)("tr",{children:[(0,i.jsxs)("th",{style:{width:260},children:["سÙÙ
ÙÛØ¯ÙÙ
ا",a.commissionPercent?` (${o(a.commissionPercent)}Ùª)`:""]}),(0,i.jsxs)("td",{children:[o(a.websiteShare)," تÙÙ
اÙ"]})]}),(0,i.jsxs)("tr",{children:[(0,i.jsxs)("th",{children:["ارزش Ø§ÙØ²ÙدÙ",a.vatPercent?` (${o(a.vatPercent)}Ùª از سÙÙ
ÙÛØ¯ÙÙ
ا)`:""]}),(0,i.jsxs)("td",{children:[o(a.vatAmount)," تÙÙ
اÙ"]})]}),a.hostGiftDiscount>0&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)("tr",{children:[(0,i.jsx)("th",{children:"Ø¯Ø±ÛØ§ÙØªÛ Ù
ÛØ²Ø¨Ø§Ù Ù¾ÛØ´ از ÙØ¯ÛÙ"}),(0,i.jsxs)("td",{children:[o(a.hostShareBeforeGift)," تÙÙ
اÙ"]})]}),(0,i.jsxs)("tr",{children:[(0,i.jsx)("th",{children:"تخÙÛÙ ÙØ¯ÛÙ Ù
ÛØ²Ø¨Ø§Ù"}),(0,i.jsxs)("td",{style:{color:"#C62828"},children:["â",o(a.hostGiftDiscount)," تÙÙ
اÙ"]})]})]}),(0,i.jsxs)("tr",{children:[(0,i.jsx)("th",{children:"Ù
Ø¨ÙØº ÙÙØ§ÛÛ Ø¯Ø±ÛØ§Ùت Ù
ÛØ²Ø¨Ø§Ù"}),(0,i.jsx)("td",{children:(0,i.jsxs)("b",{children:[o(a.hostShare)," تÙÙ
اÙ"]})})]}),(0,i.jsxs)("tr",{children:[(0,i.jsx)("th",{children:"ÙØ§Ø±Ûز شدÙ"}),(0,i.jsxs)("td",{children:[o(n.settledAmount)," تÙÙ
اÙ"]})]}),(0,i.jsxs)("tr",{children:[(0,i.jsx)("th",{children:"Ù
Ø§ÙØ¯Ù ÙØ§Ø±Ûز"}),(0,i.jsx)("td",{children:(0,i.jsxs)("b",{children:[o(n.clearRemainder)," تÙÙ
اÙ"]})})]})]})}),(0,i.jsx)("p",{style:{marginTop:28,fontSize:11,color:"#777"},children:"اÛÙ ÙØ§Ú©ØªÙر از Ù¾ÙÙ Ù
Ø¯ÛØ±Ûت ÙÛØ¯ÙÙ
ا ترÛÙ¾ صادر شد٠٠Ù
Ø¨Ø§ÙØº آ٠بر اساس آخرÛÙ ÙØ¶Ø¹Ûت Ø«Ø¨ØªâØ´Ø¯ÙâÛ Ø±Ø²Ø±Ù Ø§Ø³Øª."})]})}}},function(t){t.O(0,[4389,9774,2888,179],function(){return t(t.s=20268)}),_N_E=t.O()}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.