PageSourceSearch

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

js lidomatrip.com collected 2026-09-25 07:11:07 UTC 11,244 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6341],{20268:function(n,t,e){(window.__NEXT_P=window.__NEXT_P||[]).push(["/admin/reservations/[id]/invoice",function(){return e(94478)}])},84858:function(n,t,e){"use strict";e.d(t,{LP:function(){return x},MS:function(){return p},Px:function(){return _},SC:function(){return w},YV:function(){return f},d0:function(){return j},qz:function(){return m}});var r=e(47568),i=e(51438),s=e(28668),o=e(26042),c=e(69396),l=e(25892),d=e(91224),a=e(70655),u="lidoma_admin_token",h="lidoma_admin_refresh_token";function x(){return window.localStorage.getItem(u)}function f(){return window.localStorage.getItem(h)}function j(n,t){window.localStorage.setItem(u,n),window.localStorage.setItem(h,t)}function m(){window.localStorage.removeItem(u),window.localStorage.removeItem(h)}var p=function(n){(0,s.Z)(e,n);var t=(0,d.Z)(e);function e(n,r,s,o){var c;return(0,i.Z)(this,e),(c=t.call(this,r)).status=n,c.code=s,c.details=o,c}return e}((0,l.Z)(Error)),g=null;function v(){return y.apply(this,arguments)}function y(){return(y=(0,r.Z)(function(){return(0,a.__generator)(this,function(n){return g||(g=(0,r.Z)(function(){var n,t,e,r,i,s,o;return(0,a.__generator)(this,function(c){switch(c.label){case 0:if(!(n=f()))return[2,null];c.label=1;case 1:return c.trys.push([1,4,,5]),[4,fetch("/api/auth/refresh",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({refreshToken:n})})];case 2:if(!(r=c.sent()).ok)return[2,null];return[4,r.json().catch(function(){return{}})];case 3:if(s=null==(i=c.sent())?void 0:null===(t=i.data)||void 0===t?void 0:t.accessToken,o=null==i?void 0:null===(e=i.data)||void 0===e?void 0:e.refreshToken,!s||!o)return[2,null];return j(s,o),[2,s];case 4:return c.sent(),[2,null];case 5:return[2]}})})().finally(function(){g=null})),[2,g]})})).apply(this,arguments)}function w(n){return b.apply(this,arguments)}function b(){return(b=(0,r.Z)(function(n){var t,e,i,s,l,d,u,h=arguments;function j(n){return g.apply(this,arguments)}function g(){return(g=(0,r.Z)(function(r){return(0,a.__generator)(this,function(i){return[2,fetch(n,(0,c.Z)((0,o.Z)({},t),{headers:(0,o.Z)({},e?{}:{"Content-Type":"application/json"},r?{Authorization:"Bearer ".concat(r)}:{},t.headers)}))]})})).apply(this,arguments)}return(0,a.__generator)(this,function(r){switch(r.label){case 0:return t=h.length>1&&void 0!==h[1]?h[1]:{},e="undefined"!=typeof FormData&&t.body instanceof FormData,[4,j(x())];case 1:if(!(401===(i=r.sent()).status&&f()&&!n.startsWith("/api/auth/")))return[3,4];return[4,v()];case 2:if(!(s=r.sent()))return[3,4];return[4,j(s)];case 3:i=r.sent(),r.label=4;case 4:return[4,i.json().catch(function(){return{}})];case 5:if(l=r.sent(),!i.ok)throw 401===i.status&&(m(),window.location.href="/admin/login"),new p(i.status,null!==(d=null==l?void 0:l.message)&&void 0!==d?d:"خطای غیرمنتظره",null==l?void 0:l.code,null==l?void 0:l.details);return[2,null!==(u=l.data)&&void 0!==u?u:l]}})})).apply(this,arguments)}function _(n){return C.apply(this,arguments)}function C(){return(C=(0,r.Z)(function(n){var t,e,i,s,l,d=arguments;function u(n){return h.apply(this,arguments)}function h(){return(h=(0,r.Z)(function(e){return(0,a.__generator)(this,function(r){return[2,fetch(n,(0,c.Z)((0,o.Z)({},t),{headers:(0,o.Z)({"Content-Type":"application/json"},e?{Authorization:"Bearer ".concat(e)}:{},t.headers)}))]})})).apply(this,arguments)}return(0,a.__generator)(this,function(n){switch(n.label){case 0:return t=d.length>1&&void 0!==d[1]?d[1]:{},[4,u(x())];case 1:if(!(401===(e=n.sent()).status&&f()))return[3,4];return[4,v()];case 2:if(!(i=n.sent()))return[3,4];return[4,u(i)];case 3:e=n.sent(),n.label=4;case 4:return[4,e.json()];case 5:if(s=n.sent(),!e.ok)throw 401===e.status&&(m(),window.location.href="/admin/login"),new p(e.status,null!==(l=null==s?void 0:s.message)&&void 0!==l?l:"خطا",null==s?void 0:s.code);return[2,{items:s.data,meta:s.meta}]}})})).apply(this,arguments)}},94478:function(n,t,e){"use strict";e.r(t),e.d(t,{default:function(){return u}});var r=e(85893),i=e(67294),s=e(11163),o=e(44389),c=e(84858),l=function(n){return(null!=n?n:0).toLocaleStr
1ing("fa-IR")},d=function(n){return n?new Intl.DateTimeFormat("fa-IR",{dateStyle:"medium"}).format(new Date(n)):"—"},a={DRAFT:"در انتظار ثبت درخواست",HOST_APPROVAL:"در انتظار تایید میزبان",SECOND_PAYMENT:"در انتظار پرداخت مهمان",DONE:"قطعی",CANCEL:"لغو شده",EXPIRED:"منقضی شده"};function u(){var n,t,e=(0,s.useRouter)().query.id,u=(0,o.u)(e?"/api/admin/reservations/".concat(e,"/invoice"):null,function(n){return(0,c.SC)(n)}).data;if((0,i.useEffect)(function(){if(u){var n=setTimeout(function(){return window.print()},350);return function(){return clearTimeout(n)}}},[u]),!u)return(0,r.jsx)("p",{style:{padding:40,fontFamily:"inherit"},children:"در حال آماده‌سازی فاکتور…"});var h=u.invoice,x=u.guestNameOverride||u.guest.name||"—",f=u.guestPhoneOverride||u.guest.phone;return(0,r.jsxs)("div",{style:{maxWidth:780,margin:"0 auto",padding:32,color:"#111",lineHeight:1.9},children:[(0,r.jsx)("style",{children:"\n        @media print {\n          .no-print { display: none !important; }\n          @page { margin: 14mm; }\n        }\n        table { width: 100%; border-collapse: collapse; }\n        td, th { padding: 7px 8px; border-bottom: 1px solid #e5e5e5; text-align: right; font-size: 13px; }\n        th { font-weight: 600; }\n        h1 { font-size: 20px; margin: 0 0 2px; }\n        h2 { font-size: 14px; margin: 22px 0 6px; }\n      "}),(0,r.jsx)("div",{className:"no-print",style:{marginBottom:20},children:(0,r.jsx)("button",{onClick:function(){return window.print()},style:{padding:"8px 18px",cursor:"pointer"},children:"چاپ"})}),(0,r.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-start"},children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("h1",{children:"فاکتور رزرو"}),(0,r.jsxs)("p",{style:{margin:0,fontSize:13,color:"#555"},children:["کد رزرو: ",u.reference," \xb7 وضعیت: ",null!==(n=a[u.state])&&void 0!==n?n:u.state]})]}),(0,r.jsxs)("div",{style:{textAlign:"left",fontSize:13,color:"#555"},children:[(0,r.jsx)("div",{children:"لیدوما تریپ"}),(0,r.jsxs)("div",{children:["تاریخ صدور: ",d(new Date().toISOString())]})]})]}),(0,r.jsx)("h2",{children:"مشخصات اقامت"}),(0,r.jsx)("table",{children:(0,r.jsxs)("tbody",{children:[(0,r.jsxs)("tr",{children:[(0,r.jsx)("th",{style:{width:160},children:"اقامتگاه"}),(0,r.jsxs)("td",{children:[u.residence.name,u.residence.reference?" (".concat(u.residence.reference,")"):""]})]}),u.residence.address&&(0,r.jsxs)("tr",{children:[(0,r.jsx)("th",{children:"نشانی"}),(0,r.jsx)("td",{children:u.residence.address})]}),(0,r.jsxs)("tr",{children:[(0,r.jsx)("th",{children:"تاریخ اقامت"}),(0,r.jsxs)("td",{children:[d(u.startDate)," تا ",d(u.endDate)," \xb7 ",l(u.daysCount)," شب"]})]}),(0,r.jsxs)("tr",{children:[(0,r.jsx)("th",{children:"تعداد مهمان"}),(0,r.jsxs)("td",{children:[l(u.guestsCount)," نفر"]})]})]})}),(0,r.jsx)("h2",{children:"طرفین"}),(0,r.jsx)("table",{children:(0,r.jsxs)("tbody",{children:[(0,r.jsxs)("tr",{children:[(0,r.jsx)("th",{style:{width:160},children:"مهمان"}),(0,r.jsxs)("td",{children:[x," — ",f]})]}),(0,r.jsxs)("tr",{children:[(0,r.jsx)("th",{children:"میزبان"}),(0,r.jsxs)("td",{children:[null!==(t=u.host.name)&&void 0!==t?t:"—"," — ",u.host.phone]})]})]})}),(0,r.jsx)("h2",{children:"صورتحساب"}),(0,r.jsx)("table",{children:(0,r.jsxs)("tbody",{children:[(0,r.jsxs)("tr",{children:[(0,r.jsx)("th",{style:{width:260},children:"مبلغ کل رزرو"}),(0,r.jsxs)("td",{children:[l(h.totalAmount)," تومان"]})]}),h.codeDiscount>0&&(0,r.jsxs)("tr",{children:[(0,r.jsxs)("th",{children:["کد تخفیف",h.discountCode?" (".concat(h.discountCode,")"):""]}),(0,r.jsxs)("td",{style:{color:"#C62828"},children:["−",l(h.codeDiscount)," تومان"]})]}),h.hostGiftDiscount>0&&(0,r.jsxs)("tr",{children:[(0,r.jsx)("th",{children:"تخفیف هدیه میزبان"}),(0,r.jsxs)("td",{style:{color:"#C62828"},children:["−",l(h.hostGiftDiscount)," تومان"]})]}),h.siteGiftDiscount>0&&(0,r.jsxs)("tr",{children:[(0,r.jsx)("th",{children:"تخفیف هدیه سایت"}),(0,r.jsxs)("td",{style:{color:"#C62828"},children:["−",l(h.siteGiftDiscount)," تومان"]})]}),h.totalDiscount>0&&(0,r.jsxs)("tr",{children:[(0,r.jsx)("th",{children:"مبلغ نهایی صورتحساب"}),(0,r.jsxs)("td",{children:[l(h.invoiceAmount)," تومان"]})]}),!!h.guestCommission&&(0,r.jsxs)("tr",{children:[(0,r.jsxs)("th",{children:["کارمزد رزرو مهمان",h.guestCommissionPercent?" (".concat(l(h.guestCommissionPercent),"٪)"):""]}),(0,r.jsxs)("td",{children:[l(h.guestCommission)," تومان"]})]}),(0,r.jsxs)("tr",{children:[(0,r.jsx)("th",{children:"مبلغ نهایی قابل پرداخت مهمان"}),(0,r.jsx)("td",{children:(0,r.jsxs)("b",{children:[l(h.guestPayable)," تومان"]})})]}),(0,r.jsxs)("tr",{children:[(0,r.jsx)("th",{children:"جمع پرداختی مهمان"}),(0,r.jsxs)("td",{children:[l(u.paidAmount)," تومان"]})]}
1),u.remainingAmount>0&&(0,r.jsxs)("tr",{children:[(0,r.jsx)("th",{children:"باقی‌مانده"}),(0,r.jsxs)("td",{children:[l(u.remainingAmount)," تومان"]})]})]})}),(0,r.jsx)("h2",{children:"تسویه با میزبان"}),(0,r.jsx)("table",{children:(0,r.jsxs)("tbody",{children:[(0,r.jsxs)("tr",{children:[(0,r.jsxs)("th",{style:{width:260},children:["سهم لیدوما",h.commissionPercent?" (".concat(l(h.commissionPercent),"٪)"):""]}),(0,r.jsxs)("td",{children:[l(h.websiteShare)," تومان"]})]}),(0,r.jsxs)("tr",{children:[(0,r.jsxs)("th",{children:["ارزش افزوده",h.vatPercent?" (".concat(l(h.vatPercent),"٪ از سهم لیدوما)"):""]}),(0,r.jsxs)("td",{children:[l(h.vatAmount)," تومان"]})]}),h.hostGiftDiscount>0&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("tr",{children:[(0,r.jsx)("th",{children:"دریافتی میزبان پیش از هدیه"}),(0,r.jsxs)("td",{children:[l(h.hostShareBeforeGift)," تومان"]})]}),(0,r.jsxs)("tr",{children:[(0,r.jsx)("th",{children:"تخفیف هدیه میزبان"}),(0,r.jsxs)("td",{style:{color:"#C62828"},children:["−",l(h.hostGiftDiscount)," تومان"]})]})]}),(0,r.jsxs)("tr",{children:[(0,r.jsx)("th",{children:"مبلغ نهایی دریافت میزبان"}),(0,r.jsx)("td",{children:(0,r.jsxs)("b",{children:[l(h.hostShare)," تومان"]})})]}),(0,r.jsxs)("tr",{children:[(0,r.jsx)("th",{children:"واریز شده"}),(0,r.jsxs)("td",{children:[l(u.settledAmount)," تومان"]})]}),(0,r.jsxs)("tr",{children:[(0,r.jsx)("th",{children:"مانده واریز"}),(0,r.jsx)("td",{children:(0,r.jsxs)("b",{children:[l(u.clearRemainder)," تومان"]})})]})]})}),(0,r.jsx)("p",{style:{marginTop:28,fontSize:11,color:"#777"},children:"این فاکتور از پنل مدیریت لیدوما تریپ صادر شده و مبالغ آن بر اساس آخرین وضعیت ثبت‌شده‌ی رزرو است."})]})}}},function(n){n.O(0,[9791,9774,2888,179],function(){return n(n.s=20268)}),_N_E=n.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.