PageSourceSearch

https://lidomatrip.com/_next/static/chunks/pages/admin/settings/reservations-25b45356dcbec34d.js

js lidomatrip.com collected 2026-10-02 20:26:40 UTC 9,872 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9346],{2290:function(e,t,s){(window.__NEXT_P=window.__NEXT_P||[]).push(["/admin/settings/reservations",function(){return s(56666)}])},56666:function(e,t,s){"use strict";s.r(t),s.d(t,{default:function(){return o}});var a=s(85893),n=s(67294),l=s(41664),i=s.n(l),r=s(44389),c=s(49759),d=s(84858),x=s(32474),m=s(70707);function o(){let{data:e,isLoading:t,mutate:s}=(0,r.u)("/api/admin/settings/reservation",e=>(0,d.SC)(e)),[l,i]=(0,n.useState)(null),[c,o]=(0,n.useState)(!1),[j,p]=(0,n.useState)(!1),[N,b]=(0,n.useState)(null);if((0,n.useEffect)(()=>{e&&i(e)},[e]),t||!l)return(0,a.jsx)(u,{children:(0,a.jsx)(x.Od,{className:"h-[420px]"})});let v=(e,t)=>{i(s=>s?{...s,[e]:t}:s),p(!1)},f=(e,t)=>(0,m.W_)(e)??t,y=Math.round(5e6*l.commissionPercent/100),A=Math.round(y*l.vatPercent/100),M=Math.round(5e6*l.guestCommissionPercent/100);async function B(){if(l){o(!0),b(null);try{await (0,d.SC)("/api/admin/settings/reservation",{method:"PUT",body:JSON.stringify({commissionPercent:l.commissionPercent,vatPercent:l.vatPercent,guestCommissionPercent:l.guestCommissionPercent,releaseOnStartDate:l.releaseOnStartDate,minSettlement:Math.round(l.minSettlement),approvalWindowMinutes:Math.max(1,Math.round(l.approvalWindowMinutes)),paymentWindowMinutes:Math.max(1,Math.round(l.paymentWindowMinutes))})}),p(!0),s()}catch(e){b(e instanceof Error?e.message:"ذخیره نشد")}finally{o(!1)}}}return(0,a.jsx)(u,{children:(0,a.jsxs)("div",{className:"grid gap-16 lg:grid-cols-[1fr_360px] items-start",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-y-16",children:[(0,a.jsxs)(x.Zb,{className:"p-20",children:[(0,a.jsx)("h2",{className:"text-16 leading-24 font-m text-black mb-4",children:"کارمزد و مالیات"}),(0,a.jsx)("p",{className:"text-12 leading-20 text-gray-9B9BAA mb-16",children:"این نرخ‌ها در لحظه‌ی ثبت رزرو روی همان رزرو ذخیره می‌شوند. تغییرشان روی رزروهای گذشته اثری ندارد — سهم میزبانی که قبلاً محاسبه شده، دست‌نخورده می‌ماند."}),(0,a.jsxs)("div",{className:"grid md:grid-cols-2 gap-14",children:[(0,a.jsxs)(x.gN,{label:"کارمزد میزبان وبسایت (Ùª)",children:[(0,a.jsx)(x.II,{inputMode:"decimal",value:String(l.commissionPercent),onChange:e=>v("commissionPercent",f(e.target.value,l.commissionPercent))}),(0,a.jsxs)("p",{className:"mt-6 text-11 leading-18 text-gray-9B9BAA",children:["از مبلغ اجاره کسر می‌شود.",l.hostOverrides>0&&(0,a.jsxs)(a.Fragment,{children:[" ",(0,a.jsxs)("b",{className:"text-gray-6C6A7D",children:[(0,x.N)(l.hostOverrides)," میزبان نرخ اختصاصی دارند"]})," ","و این تغییر روی آن‌ها اعمال نمی‌شود."]})]})]}),(0,a.jsxs)(x.gN,{label:"ارزش افزوده (Ùª)",children:[(0,a.jsx)(x.II,{inputMode:"decimal",value:String(l.vatPercent),onChange:e=>v("vatPercent",f(e.target.value,l.vatPercent))}),(0,a.jsxs)("p",{className:"mt-6 text-11 leading-18 text-gray-9B9BAA",children:["روی ",(0,a.jsx)("b",{className:"text-gray-6C6A7D",children:"کارمزد"})," حساب می‌شود، نه روی کل اجاره."]})]}),(0,a.jsxs)(x.gN,{label:"کارمزد مهمان وبسایت (Ùª)",children:[(0,a.jsx)(x.II,{inputMode:"decimal",value:String(l.guestCommissionPercent),onChange:e=>v("guestCommissionPercent",f(e.target.value,l.guestCommissionPercent))}),(0,a.jsxs)("p",{className:"mt-6 text-11 leading-18 text-gray-9B9BAA",children:["به مبلغ پرداختی مهمان ",(0,a.jsx)("b",{className:"text-gray-6C6A7D",children:"اضافه"})," می‌شود."]})]}),(0,a.jsxs)(x.gN,{label:"حداقل مبلغ تسویه (تومان)",children:[(0,a.jsx)(x.II,{inputMode:"numeric",value:l.minSettlement.toLocaleString("fa-IR"),onChange:e=>v("minSettlement",f(e.target.value,l.minSettlement))}),(0,a.jsx)("p",{className:"mt-6 text-11 leading-18 text-gray-9B9BAA",children:"کمتر از این مبلغ، میزبان نمی‌تواند درخواست تسویه بدهد."})]})]})]}),(0,a.jsxs)(x.Zb,{className:"p-20",children:[(0,a.jsx)("h2",{className:"text-16 leading-24 font-m text-black mb-4",children:"مهلت‌ها"}),(0,a.jsxs)("p",{className:"text-12 leading-20 text-gray-9B9BAA mb-16",children:["پس از پایان مهلت، رزرو ",(0,a.jsx)("b",{children:"منقضی"})," می‌شود و تاریخ‌هایش دوباره برای فروش آزاد می‌شوند. این‌ها فقط ",(0,a.jsx)("b",{children:"پیش‌فرض"}),"‌اند — مهلت هر رزرو در صفحه‌ی جزئیات همان رزرو جداگانه قابل تغییر است."]}),(0,a.jsxs)("div",{className:"grid md:grid-cols-2 gap-14",children:[(0,a.jsxs)(x.gN,{label:"مدت زمان تایید میزبان (دقیقه)",children:[(0,a.jsx)(x.II,{inputMode:"numeric",value:String(l.approvalWindowMinutes),onChange:e=>v("approvalWindowMinutes",f(e.target.value,l.approvalWindowMinutes))}),(0,a.jsxs)("p",{className:"mt-6 text-11 leading-18 text-gray-9B9BAA",children:[h(l.approvalWindowMinutes)," — از لحظه‌ی ثبت رزرو."]})]}),(0,a.jsxs)(x.gN,{label:"مدت زمان پرداخت مهمان (دقیقه)",children:[(0,a.jsx)(x.II,{inputMode:"numeric",value:String(l.paymentWindowMinutes),onChange:e=>v("paymentWindowMinutes",f(e.target.value,l.paymentWindowMinutes))}),(0,a.jsxs)("p",{className:"mt-6 text-11 leading-18 text-gray-9B9BAA",children:[h(l.paymentWindowMinutes)," — از لحظه‌ی تایید میزبان."]})]})]}),(0,a.jsx)("p",{className:"mt-12 text-11 leading-18 text-gray-9B9BAA",children:"اودو یک فیلد برای Ù
1‡Ø± دو داشت (\xabمهلت تایید یا پرداخت\xbb) و مقادیر واقعی‌اش ۱۲۰، Û¶Û° و Û·Û²Û° دقیقه بود."})]}),(0,a.jsxs)(x.Zb,{className:"p-20",children:[(0,a.jsx)("h2",{className:"text-16 leading-24 font-m text-black mb-4",children:"زمان آزادسازی سهم میزبان"}),(0,a.jsxs)("p",{className:"text-12 leading-20 text-gray-9B9BAA mb-14",children:["سهم میزبان تا این لحظه ",(0,a.jsx)("b",{children:"مسدود"})," است: در کیف پولش دیده می‌شود ولی قابل برداشت نیست، و لغو رزرو می‌تواند پسش بگیرد."]}),(0,a.jsxs)("label",{className:"flex items-start gap-x-12 cursor-pointer",children:[(0,a.jsx)(x.ZD,{checked:l.releaseOnStartDate,onChange:e=>v("releaseOnStartDate",e)}),(0,a.jsxs)("span",{children:[(0,a.jsx)("span",{className:"block text-14 leading-22 text-black",children:l.releaseOnStartDate?"روز شروع اقامت":"روز پایان اقامت"}),(0,a.jsx)("span",{className:"block text-12 leading-20 text-gray-9B9BAA",children:l.releaseOnStartDate?"مهمان رسیده و رزرو دیگر منتفی نمی‌شود — همان نقطه‌ای که اودو هم انتخاب کرده بود.":"پول تا خروج مهمان مسدود می‌ماند."})]})]})]}),(0,a.jsxs)("div",{className:"flex items-center gap-x-12",children:[(0,a.jsx)(x.zx,{onClick:B,disabled:c,children:c?"در حال ذخیره...":"ذخیره تنظیمات"}),j&&(0,a.jsx)("span",{className:"text-13 text-[#2E7D32]",children:"ذخیره شد"}),!!N&&(0,a.jsx)("span",{className:"text-13 text-[#C62828]",children:N})]})]}),(0,a.jsxs)(x.Zb,{className:"p-20 sticky top-16",children:[(0,a.jsx)("h3",{className:"text-14 leading-22 font-m text-black mb-2",children:"یک رزرو نمونه"}),(0,a.jsxs)("p",{className:"text-11 leading-18 text-gray-9B9BAA mb-14",children:["با نرخ‌های بالا، روی اجاره‌ی ",(0,x.N)(5e6)," تومان"]}),(0,a.jsx)(g,{label:"مبلغ کل اجاره",value:5e6,strong:!0}),(0,a.jsx)(g,{label:`کارمزد میزبان وبسایت (${(0,x.N)(l.commissionPercent)}Ùª)`,value:-y}),(0,a.jsx)(g,{label:`ارزش افزوده (${(0,x.N)(l.vatPercent)}Ùª از کارمزد)`,value:-A}),(0,a.jsx)("div",{className:"my-10 border-t border-dashed border-gray-E5E5E6"}),(0,a.jsx)(g,{label:"سهم میزبان",value:5e6-y-A,strong:!0,tone:"green"}),(0,a.jsxs)("div",{className:"mt-16 pt-14 border-t border-gray-F0F0F0",children:[(0,a.jsx)(g,{label:"مبلغ کل اجاره",value:5e6}),(0,a.jsx)(g,{label:`کارمزد مهمان (${(0,x.N)(l.guestCommissionPercent)}Ùª)`,value:M}),(0,a.jsx)(g,{label:"پرداختی مهمان",value:5e6+M,strong:!0})]}),(0,a.jsxs)("p",{className:"mt-14 text-11 leading-18 text-gray-9B9BAA",children:["درآمد سایت از این رزرو: ",(0,a.jsx)("b",{className:"text-gray-6C6A7D",children:(0,x.N)(y+M)})," ","تومان (ارزش افزوده متعلق به سایت نیست)."]})]})]})})}function g(e){let{label:t,value:s,strong:n,tone:l}=e;return(0,a.jsxs)("div",{className:"flex items-baseline justify-between gap-x-12 py-4",children:[(0,a.jsx)("span",{className:`text-12 leading-20 ${n?"text-black":"text-gray-6C6A7D"}`,children:t}),(0,a.jsxs)("span",{className:`text-13 leading-20 whitespace-nowrap ${n?"font-m":""} ${"green"===l?"text-[#2E7D32]":s<0?"text-gray-6C6A7D":"text-black"}`,children:[s<0?"− ":"",(0,x.N)(Math.abs(s))]})]})}function u(e){let{children:t}=e;return(0,a.jsx)(c.Z,{title:"تنظیمات رزرواسیون",breadcrumb:(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(i(),{href:"/admin",children:"داشبورد"})," / ",(0,a.jsx)(i(),{href:"/admin/settings",children:"تنظیمات"})]}),children:t})}function h(e){if(!Number.isFinite(e)||e<=0)return"—";if(e<60)return`${(0,x.N)(e)} دقیقه`;let t=Math.floor(e/60),s=e%60;if(t<24)return 0===s?`${(0,x.N)(t)} ساعت`:`${(0,x.N)(t)} ساعت و ${(0,x.N)(s)} دقیقه`;let a=Math.floor(t/24),n=t%24;return 0===n?`${(0,x.N)(a)} روز`:`${(0,x.N)(a)} روز و ${(0,x.N)(n)} ساعت`}}},function(e){e.O(0,[4389,9759,9774,2888,179],function(){return e(e.s=2290)}),_N_E=e.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.