PageSourceSearch

https://lidomatrip.com/_next/static/chunks/pages/admin/reservations/[id]/invoice-fefa4e2d3fd408fe.js

js lidomatrip.com collected 2026-10-02 20:26:02 UTC 9,700 bytes, 11 lines download raw bytes

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.