PageSourceSearch

https://app.bitcointaf.com/assets/index-BhtNrSDK.js

js bitcointaf.com collected 2026-10-03 23:26:08 UTC 12,363 bytes, 1 lines download raw bytes

1import{a as A,j as e,M as V,S as B,aI as K,p as X,t as q,u as ae,bh as ne,Q as te,V as se,W as ie,X as H,Z as v,ce as w,$ as re,T as g,d$ as P,aK as D,ah as u,i as G,k as z,r as m,bb as k,ei as L,c3 as oe,di as le,a0 as ce,z as Y,f as Z,bc as de,G as N,F as U,R as xe,B as M,g as ue,h as me,b as pe,l as he,v as je,ay as fe,b1 as _e,aP as be}from"./index-D5ZfXxeH.js";import{F as ge}from"./index-DDlAXr68.js";import{g as ye,S as C,t as $,p as Fe,a as Re,b as Se,c as J,R as T,d as ve,u as ke,e as we,F as Ae}from"./useGetDepositStatus-Bjrjk_TX.js";import{T as I}from"./index-DslE7V-S.js";import{B as W}from"./Box-C7NcD2wp.js";import{u as Ce}from"./useProductList-CPMmkM9N.js";import{P as Pe}from"./salesReport-BIPGewvs.js";import"./getReport-BO7XRIKf.js";import"./convertDMYToMDY-BmIYi8Qk.js";import"./download-button-DjDnMDPm.js";import"./isAdmin-enOzmEwS.js";import"./config-DUKgyzQX.js";import"./index-D1ARYxLI.js";import"./round-hc-3o_OL.js";import"./use-payment-types-CQqWqFm4.js";import"./DatePicker-BXb1xu2w.js";import"./PureDateInput-C1ja2Md1.js";const Ee=({depositStatus:a,methods:r})=>{const{translate:s}=A(),n=ye(),{getValues:t,reset:l}=r,i=(o,c)=>{l({...t(),...c})};return e.jsx("div",{children:e.jsxs(V,{sx:{p:2},children:[e.jsxs(B,{direction:"row",alignItems:"center",spacing:2,children:[e.jsx(K,{title:s("adminFinancial.financialReport.depositStatus"),sx:{mb:2}})," "]}),e.jsx(C,{label:s("adminFinancial.financialReport.today"),icon:$,onClick:i,amount:a?.total_amount_today,period:{start:n.today}}),e.jsx(C,{label:s("adminFinancial.financialReport.thisWeek"),icon:$,onClick:i,amount:a?.total_amount_this_week,period:n.thisWeek}),e.jsx(C,{label:s("adminFinancial.financialReport.pastWeek"),icon:Fe,onClick:i,amount:a?.total_amount_past_week,period:n.pastWeek}),e.jsx(C,{label:s("adminFinancial.financialReport.thisMonth"),icon:Re,onClick:i,amount:a?.total_amount_this_month,period:n.thisMonth}),e.jsx(C,{label:s("adminFinancial.financialReport.pastMonth"),icon:Se,onClick:i,amount:a?.total_amount_past_month,period:n.pastMonth}),e.jsx(C,{label:s("adminFinancial.financialReport.thisYear"),icon:$,onClick:i,amount:a?.total_amount_this_year,period:n.year})]})})},Be=a=>{const{enqueueSnackbar:r}=X();return async(n,t,l,i)=>{const o=new FormData;o.append("pay_now",n?1:0),o.append("description",t),o.append("product_id",a),o.append("amount",i||""),o.append("analyst_id",l),o.append("paying_type",1),o.append("date",new Date().toLocaleDateString("en-GB"));try{const{status:c,data:d}=await q.post("/api/admin/create-analyst-expense-history",o);c===200&&r(d.message)}catch(c){Object.values(c.errors).flatMap(d=>r(d,{variant:"error"}))}}},Ie=({analyst:a,productId:r,totalAnalyst:s,totalAvailable:n,filter:t})=>{const{translate:l}=A(),{user:i}=ae(),o=Be(r),c=!!i.is_super_admin;return e.jsxs("div",{children:[e.jsx(ne,{children:e.jsx(te,{children:e.jsxs(se,{children:[e.jsx(ie,{children:e.jsxs(H,{children:[e.jsx(v,{children:l("adminFinancial.financialReport.analystsIncome")}),e.jsxs(v,{colSpan:2,align:"right",children:[l("adminFinancial.financialReport.totalAvailable"),e.jsx(w,{children:n})]})]})}),e.jsxs(re,{children:[a?.map(d=>e.jsx(e.Fragment,{children:e.jsx(Te,{filter:t,onSubmit:o,...d,productId:r,isSuperAdmin:c})}
1)),e.jsxs(H,{children:[e.jsx(v,{children:l("adminFinancial.financialReport.analyst")}),e.jsx(v,{children:e.jsx(g,{sx:{color:"#b66dff"},children:e.jsx(w,{children:e.jsx(I,{number:s})})})})]})]})]})})}),e.jsxs(P,{children:[e.jsx(D,{}),e.jsx(u,{item:!0,xs:12,md:12,children:e.jsx(W,{sx:{flexGrow:1,textAlign:"right",mt:2},children:e.jsx(G,{variant:"contained",component:z,to:J(k.financial.report.product.addExpense,t),state:{...t},children:"Add Analyst Expense"})})})]})]})},Te=({id:a,name:r,percentage:s,checkbox:n,amount:t,onSubmit:l,productId:i,isSuperAdmin:o,filter:c})=>{const{translate:d}=A(),[h,x]=m.useState(!1),[_,p]=m.useState(""),y=f=>{x(f.target.checked)},b=f=>{p(f.target.value)},j=async f=>{await l(h,_,a,t)};return m.useEffect(()=>{x(n===1)},[n]),e.jsx(e.Fragment,{children:e.jsxs(H,{children:[e.jsx(v,{sx:{maxWidth:"100px"},children:e.jsxs(B,{direction:"row-reverse",justifyContent:"flex-end",alignItems:"center",children:[e.jsxs(B,{children:[e.jsxs(g,{variant:"subtitle2",sx:{color:"#b66dff",textAlign:"center"},component:L()?"default":z,to:J(k.financial.report.product.addExpense,{analyst_id:a,...c}),children:[r," (",s,"%)"]}),e.jsx(P,{children:e.jsx(g,{variant:"caption",children:e.jsx(w,{children:e.jsx(I,{number:t})})})})]}),e.jsx(P,{children:e.jsx(oe,{sx:{marginRight:0},control:e.jsx(le,{onChange:y,checked:h})})})]})}),e.jsx(v,{children:e.jsx(ce,{when:L(),then:e.jsx(w,{children:e.jsx(I,{number:t})}),otherwise:e.jsx(Y,{sx:{maxWidth:"130px"},size:"small",label:d("adminFinancial.fundCredit.notes"),SelectProps:{native:!0},onChange:b})})}),e.jsx(v,{children:e.jsx(P,{children:e.jsx(G,{fullWidth:!0,variant:"contained",onClick:j,children:"submit"})})})]},t)})},De={product_id:"",config_value:"",key:"operational_fee"},We=a=>{const{enqueueSnackbar:r}=X(),s=Z({defaultValues:De}),n=de(),t=async l=>{const i=new FormData;Object.entries(l).forEach(([o,c])=>i.append(o,c));try{const{status:o,data:c}=await q.post("/api/admin/financial-setting",i);o===200&&(r(c.message),a())}catch(o){n(o)}};return{onSubmit:s.handleSubmit(t),methods:s}},Ve=({productId:a,transaction:r,handleFilter:s})=>{const{translate:n}=A(),{onSubmit:t,methods:l}=We(()=>s()),{setValue:i,watch:o}=l;m.useEffect(()=>{a&&i("product_id",a)},[a]),m.useEffect(()=>{r>-1&&i("config_value",r)},[r]);const{queryObject:c}=N(),{name:d}=c;return e.jsx(U,{methods:l,onSubmit:t,children:e.jsxs(u,{container:!0,spacing:2,sx:{mb:1,mt:2},children:[e.jsx(u,{item:!0,md:6,xs:12,sm:6,children:e.jsx(xe,{size:"small",name:"config_value",label:`${n("adminFinancial.financialReport.operationalExpenseFor")} ${d} (%)`,InputLabelProps:{shrink:!0},sx:{width:"100%"}})}),e.jsx(u,{item:!0,md:6,xs:12,sm:6,children:e.jsx(G,{fullWidth:!0,type:"submit",variant:"contained",children:n("save")})})]})})},Ge=({handleFilter:a,transaction:r,productId:s})=>{const{translate:n}=A(),t=Ce(),{addParam:l,queryObject:i}=N(),o=x=>{const{value:_}=x.target,p=JSON.parse(_);p&&l({name:p.name,product_id:p.id})},c=()=>a(),{product_id:d}=i,h=t.find(({id:x})=>x===parseInt(d));return e.jsx("div",{children:e.jsxs(V,{sx:{p:2},children:[e.jsx(g,{variant:"h6",children:n("adminFinancial.financialReport.financialSettings")}),e.jsx(Ve,{transaction:r,productId:s,handleFilter:a}),e.jsxs(u,{container:!0,spacing:2,sx:{mt:2},children:[e.jsx(u,{item:!0,md:6,xs:12,sm:6,children:e.jsx(Y,{size:"small",select:!0,fullWidth:!0,SelectProps:{native:!0},value:JSON.stringify(h),onChange:o,children:t?.map(x=>e.jsx("option",{value:JSON.stringify(x),children:x.name}))})}),e.jsx(u,{item:!0,md:6,xs:12,sm:6,children:e.jsx(G,{fullWidth:!0,variant:"contained",onClick:c,children:n("adminFinancial.financialReport.filter")})})]})]})})},Oe=({name:a,amount:r,balance:s,filter:n})=>e.jsx("div",{children:e.jsxs(B,{direction:"row",alignItems:"center",spacing:2,sx:{mt:2},children:[e.jsxs(M,{sx:{flexGrow:1,display:"flex"},children:[e.jsx(g,{sx:{mt:1,display:"flex",alignItems:"left",color:"text.secondary"},variant:"subtitle2",children:a}),e.jsx(P,{children:e.jsx(ue,{"aria-label":"Add Admin Expense",component:z,to:J(k.financial.report.adminExpense.root,n),children:e.jsx(me,{icon:"material-symbols:add-box-sharp",style:{color:"blue"}})})})]}),e.jsxs(M,{sx:{flexGrow:1,textAlign:"right"},children:[e.jsx(g,{variant:"subtitle2",sx:{color:"#b66dff",mr:2},children:e.jsx(w,{children:e.jsx(I,{number:r})})}),e.jsx(g,{variant:"subtitle2",sx:{color:"text.disabled",mr:2},children:e.jsx(w,{children:e.jsx(I,{number:s})})})]})]})}),$e=m.forwardRef(({financialReport:a,filter:r},s)=>{const{translate:n}=A(),{admin_expense:t,admin_expense_balance:l,binary_plan:i,binary_plan_balance:o,transaction_fee_amount_balance:c,transaction_fee_percent:d,transaction_fee_amount:h,operational_expense_fee_amount:x,operational_expense_fee_amount_balance:_,operational_expense_fee_percent:p,revenue_plan:y,purchase_income:b,revenue_plan_balance:j,total_left:f}=a,{start_date:F,end_date:S}=r||{},E=pe();return e.jsx("div",{children:e.jsxs(V,{sx:{p:2},children:[e.jsx(u,{container:!0,spacing:2,children:e.jsxs(u,{item:!0,xs:12,sm:6,md:7,sx:{mb:2},children:[e.jsx(K,{title:n("adminFinancial.financialReport.stakeHolders")}),e.jsxs(g,{sx:{color:"text.secondary",ml:3,fontSize:"12px"},children:[n("adminFinancial.financialReport.weekDate")," (",F," - ",S,")"]})]})}),e.jsx(D,{}),e.jsxs(W,{sx:{p:2},children:[e.jsx(T,{name:n("adminFinancial.financialReport.purchaseIncome"),amount:b,onClick:()=>s.current?.scrollIntoView({behavior:"smooth"})}),e.jsx(T,{name:`${n("adminFinancial.financialReport.transactionFee")} (${d||0}%)`,amount:h,balance:c}),e.jsx(D,{}),e.jsx(T,{name:`${n("adminFinancial.financialReport.operationalExpenses")} (${p||0}%)`,amount:x,balance:_}),e.jsx(Oe,{name:n("adminFinancial.financialReport.adminExp"),amount:t,balance:l,filter:r}),e.jsx(ve,{achievementBonus:a?.achievement_bonus,referralBonus:a?.referral_bonus,firstOrderBonus:a?.first_order_bonus,amount:y,balance:j,startDate:F,endDate:S,disableBronze:!0}),e.jsx(T,{name:n("adminFinancial.financialReport.teamBonusExp"),amount:i,balance:o,onClick:L()?null:()=>E(k.financial.eWallet({start_date:F,end_date:S}))}),e.jsxs(B,{direction:"row",alignItems:"center",spacing:2,sx:{mt:2},children:[e.jsx(W,{sx:{flexGrow:1},children:e.jsx(g,{sx:{mt:1,display:"flex",alignItems:"left"},variant:"subtitle2",children:n("adminFinancial.financialReport.totalLeft")})}),e.jsx(W,{sx:{flexGrow:1,textAlign:"right"},children:e.jsx(g,{variant:"subtitle2",sx:{color:"#b66dff",mr:2},children:e.jsx(w,{children:f||0})})})]})]}),e.jsx(D,{sx:{mb:2}})]})})}),He=a=>{const[r,s]=m.useState([]),[n,t]=m.useState([]),[l,i]=m.useState([]),[o,c]=m.useState([]),[d,h]=m.useState([]),x=async(b={})=>{try{const{status:j,data:f}=await q.get("/api/admin/financial-product-report",{params:{...b}});if(j){const{sales_report_data:F,product_progress_bar:S,no_sales_product_progress_bar:E,analysts:O}=f;s(f),t(F),i(E),c(S),h(O)}
1}catch{}},{start_date:_,end_date:p,product_id:y}=a;return m.useEffect(()=>{_&&p&&y&&x(a)},[_,p,y]),{financialReport:r,salesReport:n,noSaleProgressBar:l,productProgressBar:o,analystData:d,fetchProductFinancialReport:x}},Le={start_date:"",end_date:"",payment_types:null,user_id:null,product_id:null},ra=()=>{const{translate:a}=A(),[r]=he(),s=r.get("start_date"),n=r.get("end_date"),t=r.get("product_id"),l=Z({defaultValues:Le}),{setValue:i,watch:o,handleSubmit:c}=l;m.useEffect(()=>{s&&i("start_date",s),n&&i("end_date",n),t&&i("product_id",t)},[s,n,t]);const d=o(),h=o("product_id"),{financialReport:x,analystData:_,fetchProductFinancialReport:p}=He({...d,product_id:t}),{salesReport:y,fetchSalesReport:b,...j}=ke({...d,product_id:t}),{depositStatus:f,fetchStatus:F}=we();m.useEffect(()=>{F(0,{product_id:t})},[t]);const S=c(R=>{p(R),b(1,R)}),E=c(R=>{F(0,{product_id:R.product_id}),b(j.page,R),p(R)}),{queryObject:O}=N(),{name:ee}=O,Q=m.useRef(null);return e.jsx("div",{children:e.jsx(je,{title:a("adminFinancial.financialReport.financialReportTitle"),children:e.jsxs(M,{sx:{p:2},children:[e.jsx(fe,{heading:a("adminFinancial.financialReport.financialReportTitle"),links:[{name:a("dashboard"),href:k.root},{name:a("financial"),href:k.financial.root},{name:a("adminFinancial.financialReport.financialReportTitle"),href:k.financial.report.root},{name:_e(ee||"analyst-financial-report")}]}),e.jsxs(u,{container:!0,spacing:2,children:[e.jsx(P,{children:e.jsx(u,{item:!0,xs:12,md:12,children:e.jsx(Ge,{setProductId:R=>{i("product_id",R)},handleFilter:E,transaction:x?.operational_expense_fee_percent,productId:h})})}),e.jsx(u,{item:!0,xs:12,md:3,children:e.jsx(Ee,{methods:l,depositStatus:f})}),e.jsx(u,{item:!0,xs:12,md:4,children:e.jsx($e,{ref:Q,financialReport:x,filter:d,startDate:d.start_date,endDate:d.end_date})}),e.jsx(u,{item:!0,xs:12,md:5,children:e.jsx(V,{sx:{p:2},children:e.jsx(Ie,{filter:d,analyst:_,productId:h,totalAnalyst:x?.total_analyst,totalAvailable:x?.total_left})})}),e.jsxs(u,{item:!0,xs:12,sm:12,ref:Q,children:[e.jsx(U,{methods:l,onSubmit:S,children:e.jsx(ge,{children:e.jsx(Ae,{setFilter:()=>null,filter:d,handleFilter:p,handleSale:b,productId:h})})}),e.jsx(Pe,{rowStart:j.rowStart,report:y,reload:()=>b(j.page,d)}),e.jsx(be,{...j})]})]})]})})})};export{ra as default};

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.