import{j as a,aO as p6,aP as g6,aQ as f6,aR as j6,aS as A6,aT as v6,T as r,bl as D6,bm as y6,cn as B6,B as f,ak as eu,p as S,i as I6,I as B}from"./mui-vendor-CkIVaoQP.js";import{r as b,b as E6}from"./react-vendor-CmFgShSM.js";import{L as X,j as F6,h as Z,A as S6,a0 as k6,u as tu,c as lu,M as E,b as nu,G as n,S as l,p as T6,m as L6,N as ou,hZ as m6,r as P6,h_ as R6,C as N6,X as I,O as z,_ as w6}from"./index-Cr86_nOs.js";import{a as b6,u as cu,f as _6}from"./redux-vendor-B7uoacJt.js";import{N as ru}from"./NumberFormatCustom-DwWPj40N.js";import{S as iu}from"./SimpleTable-CWlU9uE0.js";import{A as M6}from"./index-D5z1lNNf.js";import{I as O6,f as U6}from"./toBase64-CmPKyXM7.js";import{u as q6}from"./useRequestFile-ByYalRZI.js";const x6=b6("PROVINCE_CHECK_REQUEST",async(u,{dispatch:c})=>{c(X());try{const{data:d,status:g}=await F6.post("province_check_info/",u);return c(Z()),{data:d,status:g}}catch(d){return c(Z()),{error:d.response.data.result}}}),W6=({item:u})=>{var k,T,L,P,R,N,w,_,M,O,U,q,W,K,H,V,G;const[c,,d,,g]=b.useContext(S6),h=cu();b.useEffect(()=>{h(k6()),C.validateForm(),e.validateForm()},[]);const{avicultureChickenPrice:s}=_6(y=>y.avicultureSlice),i=s==null?void 0:s.liveChickenPrice;parseFloat((u.barInfo.killHouseNetWeight/u.barInfo.realQuantity).toFixed(2));const C=tu({initialValues:{rejectText:""},validationSchema:lu({rejectText:E().required("این فیلد اجباری است!").typeError("لطفا دلیل خود را بیان کنید.")})}),[m,D]=b.useState(!1),p=y=>{D(y),m||(e.setFieldValue("reason",""),e.setFieldValue("amount",""))},e=tu({initialValues:{fee:"",paymentType:"together",wage:0,amount:"",reason:""},validationSchema:lu({fee:nu().required("این فیلد اجباری است!"),amount:nu(),paymentType:E().required("این فیلد اجباری است!"),reason:m?E().required("این فیلد اجباری است!"):E(),wage:nu().required("این فیلد اجباری است!")})});let x=(e.values.fee+e.values.wage)*u.killHouseNetWeight;m==="plus"?x+=Number(e.values.amount):m==="decrease"&&(x-=Number(e.values.amount));let j=x-u.killRequestPaymentRemainAmount;u.smsPayment&&(j+=5e4);const[uu,Q]=b.useState(!1),au=!e.isValid,[A,$]=E6.useState("union"),J=(y,Y)=>{Y&&$(Y)};return a.jsxs(p6,{sx:{alignSelf:"flex-start",width:"100%"},children:[a.jsxs(g6,{children:[a.jsx(f6,{color:"secondary"}),a.jsx(j6,{})]}),a.jsx(n,{container:!0,direction:"column",flexWrap:"nowrap",flex:"1",children:a.jsxs(a.Fragment,{children:[a.jsxs(n,{container:!0,justifyContent:"space-between",children:[a.jsxs(n,{container:!0,children:[a.jsx(n,{children:a.jsx(A6,{variant:"body1",fontWeight:"bold",color:"secondary",children:"انجام عملیات"})}),a.jsx(n,{children:a.jsx(v6,{color:"textSecondary",children:a.jsx(r,{variant:"body2",children:"درخواست را بررسی و سپس تایید یا رد کنید."})})})]}),a.jsx(n,{container:!0,gap:l.SMALL,mb:l.TINY,justifyContent:"space-between",children:a.jsxs(n,{container:!0,mt:l.TINY,gap:l.TINY,alignItems:"center",children:[a.jsx(r,{color:y=>y.palette.grey.A700,variant:"caption",children:"موجودی کیف پول کشتارگاه:"}),a.jsx(r,{variant:"button",color:"primary",children:`${(k=u.killHouseWalletAmount)==null?void 0:k.toLocaleString()} ﷼`})]})})]}),a.jsx(n,{container:!0,width:"100%",children:a.jsxs(n,{container:!0,alignItems:"start",direction:"row-reverse",justifyContent:"start",children:[a.jsxs(n,{container:!0,gap:l.TINY,mt:l.TINY,alignItems:"center",ml:l.LARGE,children:[a.jsx(r,{variant:"caption",color:"error",children:"صدور فاکتور بنام:"}),a.jsxs(D6,{color:"primary",value:A,orientation:"vertical",exclusive:!0,onChange:J,"aria-label":"Platform",children:[a.jsx(y6,{value:"union",children:"اتحادیه"}),a.jsx(y6,{value:"poultry",children:"مرغدار"})]}),a.jsxs(n,{ml:l.MEDIUM,children:[A==="union"&&a.jsxs(n,{container:!0,alignItems:"center",gap:l.SMALL,children:[a.jsx(n,{children:a.jsx(r,{children:"اطلاعات حساب اتحادیه"})}),a.jsxs(n,{style:{border:"1px solid #ccc",padding:"10px",borderRadius:"4px"},children:[a.jsxs(r,{children:["شماره کارت: ",(T=u==null?void 0:u.provinceBank)==null?void 0:T.card]}),a.jsxs(r,{children:["شماره شبا: ",(L=u==null?void 0:u.provinceBank)==null?void 0:L.shaba]}),a.jsxs(r,{children:["شماره حساب: ",(P=u==null?void 0:u.provinceBank)==null?void 0:P.account]}),a.jsxs(r,{children:["بانک ",(R=u==null?void 0:u.provinceBank)==null?void 0:R.bankName," - بنام"," ",(N=u.provinceBank)==null?void 0:N.nameOfBankUser]})]})]}),A==="poultry"&&a.jsxs(n,{container:!0,alignItems:"center",gap:l.SMALL,children:[a.jsx(n,{children:a.jsx(r,{children:"اطلاعات حساب مرغدار"})}),a.jsxs(n,{style:{border:"1px solid #ccc",padding:"10px",borderRadius:"4px"},children:[a.jsxs(r,{children:["شماره کارت:"," ",(w=u==null?void 0:u.poultryBank)!=null&&w.card?(_=u==null?void 0:u.poultryBank)==null?void 0:_.card:"ندارد"]}),a.jsxs(r,{children:["شماره شبا:"," ",(M=u==null?void 0:u.poultryBank)!=null&&M.shaba?(O=u==null?void 0:u.poultryBank)==null?void 0:O.shaba:"ندارد"]}),a.jsxs(r,{children:["شماره حساب:"," ",(U=u==null?void 0:u.poultryBank)!=null&&U.account?(q=u==null?void 0:u.poultryBank)==null?void 0:q.account:"ندارد"]}),a.jsxs(r,{children:["بانک"," ",(W=u==null?void 0:u.poultryBank)!=null&&W.bankName?(K=u==null?void 0:u.poultryBank)==null?void 0:K.bankName:"نامشخص"," ","- بنام"," ",(H=u.poultryBank)!=null&&H.nameOfBankUser?(V=u.poultryBank)==null?void 0:V.nameOfBankUser:"نامشخص"]})]})]})]})]}),a.jsxs(n,{container:!0,direction:"column",gap:l.SMALL,mt:l.TINY,alignItems:"start",children:[a.jsxs(n,{container:!0,gap:l.SMALL,children:[a.jsx(n,{children:a.jsx(ru,{allowLeadingZeros:!0,thousandSeparator:",",id:"fee",label:"قیمت (﷼)",variant:"outlined",error:e.touched.fee?!!e.errors.fee:null,onChange:e.handleChange,onBlur:e.handleBlur,helperText:e.touched.fee&&e.errors.fee?e.errors.fee:null})}),a.jsx(n,{children:a.jsx(ru,{allowLeadingZeros:!0,thousandSeparator:",",id:"wage",label:"تعرفه استان (﷼)",variant:"outlined",value:e.values.wage,error:e.touched.wage?!!e.errors.wage:null,onChange:e.handleChange,onBlur:e.handleBlur,helperText:e.touched.wage&&e.errors.wage?e.errors.wage:null})})]}),a.jsx(n,{children:a.jsxs(n,{container:!0,gap:l.SMALL,children:[a.jsxs(n,{container:!0,direction:"column",gap:l.SMALL,alignItems:"start",children:[a.jsx(r,{children:"اضافه یا کسر از فاکتور"}),a.jsxs(B6,{color:"primary","aria-label":"outlined primary button group",children:[a.jsx(f,{onClick:()=>p("plus"),variant:m==="plus"?"contained":"outlined",color:"primary",children:"+"}),a.jsx(f,{onClick:()=>p("decrease"),variant:m==="decrease"?"contained":"outlined",color:"primary",children:"-"}),a.jsx(f,{onClick:()=>p(!1),color:"error",children:"حذف"})]})]}),a.jsx(n,{children:!!m&&a.jsxs(n,{container:!0,gap:l.SMALL,children:[a.jsx(n,{children:a.jsx(eu,{id:"amount",label:"مبلغ اضافه/کسر از فاکتور",variant:"outlined",error:e.touched.amount?!!e.errors.amount:null,onChange:e.handleChange,onBlur:e.handleBlur,helperText:e.touched.amount&&e.errors.amount?e.errors.amount:null})}),a.jsx(n,{children:a.jsx(eu,{id:"reason",label:"شرح موضوع",variant:"outlined",error:e.touched.reason?!!e.errors.reason:null,multiline:!0,rows:2,onChange:e.handleChange,onBlur:e.handleBlur,helperText:e.touched.reason&&e.errors.reason?e.errors.reason:null})})]})})]})})]}),a.jsxs(n,{width:"100%",children:[a.jsxs(n,{container:!0,gap:l.TINY,my:l.TINY,children:[a.jsxs(n,{container:!0,gap:l.TINY,alignItems:"center",children:[a.jsx(r,{color:"green",variant:"caption",children:"قیمت مرغ:"}),a.jsxs(r,{variant:"button",children:[i==null?void 0:i.toLocaleString()," ﷼"]})]}),a.jsxs(n,{container:!0,gap:l.TINY,alignItems:"center",children:[a.jsx(r,{variant:"caption",color:"green",children:"آخرین تاریخ قیمت گذاری:"}),a.jsx(r,{variant:"button",children:(s==null?void 0:s.createDate)&&T6(s==null?void 0:s.createDate)})]})]}),a.jsx(iu,{columns:["قیمت کل","هزینه پیامک اطلاع رسانی","مبلغ خالص بار","مبلغ کل فاکتور","سهم مرغدار","سهم استان","مانده واریزی اولیه","مبلغ فاکتور نهایی"],data:[[(e.values.fee+e.values.wage).toLocaleString()+" ﷼",u.smsPayment?"دارد : 50,000 ﷼":"ندارد",((e.values.fee+e.values.wage)*u.killHouseNetWeight).toLocaleString()+" ﷼",(x==null?void 0:x.toLocaleString())+" ﷼",(e.values.fee*u.killHouseNetWeight).toLocaleString()+" ﷼",(e.values.wage*u.killHouseNetWeight).toLocaleString()+" ﷼",((G=u.killRequestPaymentRemainAmount)==null?void 0:G.toLocaleString())+" ﷼",j<0?0:(j==null?void 0:j.toLocaleString())+" ﷼"]]})]}),a.jsx(n,{xs:12,children:a.jsx(n,{container:!0,gap:l.SMALL,padding:l.SMALL,children:a.jsx(M6,{children:uu?a.jsx(L6.div,{animate:{x:-10,opacity:1},transition:{duration:.3},initial:{opacity:0},exit:{opacity:0},children:a.jsxs(n,{flexDirection:"column",container:!0,gap:l.SMALL,children:[a.jsx(n,{children:a.jsx(eu,{multiline:!0,rows:4,fullWidth:!0,id:"rejectText",label:"پیام خود را وارد کنید",variant:"outlined",value:C.values.rejectText,error:C.touched.rejectText?!!C.errors.rejectText:null,onChange:C.handleChange,onBlur:C.handleBlur,helperText:C.touched.rejectText&&C.errors.rejectText?C.errors.rejectText:null})}),a.jsxs(n,{container:!0,gap:l.SMALL,children:[a.jsx(n,{children:a.jsx(f,{variant:"outlined",color:"secondary",onClick:()=>{Q(!1)},children:"لغو"})}),a.jsx(n,{children:a.jsx(f,{variant:"outlined",onClick:()=>{h(X()),h(x6({message:C.values.rejectText,kill_house_info_key:u.barInfo.killHouseAssignmentKey,state:"rejected"})).then(y=>{y.error?c({vertical:"top",horizontal:"center",msg:"مشکلی پیش آمده است!",severity:"error"}):(h(ou({right:!1,bottom:!1,content:null})),h(m6({selectedDate1:d,selectedDate2:g})),c({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"})),h(Z())})},children:"رد درخواست"})})]})]})}):a.jsxs(n,{container:!0,gap:l.SMALL,children:[a.jsx(f,{variant:"outlined",color:"secondary",onClick:()=>{Q(!0)},children:"رد درخواست"}),a.jsx(f,{disabled:au,variant:"outlined",onClick:()=>{if(x<0){e.setFieldError("amount","مبلغ کسر نمی تواند بزرگتر از مبلغ کل فاکتور باشد!");return}h(X()),h(x6({kill_house_info_key:u.barInfo.killHouseAssignmentKey,pay:e.values.paymentType,fee:e.values.fee,real_weight:u.barInfo.killHouseNetWeight/u.quantity,province_input_wage:e.values.wage,province_input_amount:e.values.amount?e.values.amount:null,province_input_amount_state:m,state:"accepted",reason:e.values.reason,bank:A})).then(y=>{y.payload.error?c({vertical:"top",horizontal:"center",msg:y.payload.error,severity:"error"}):(h(m6({selectedDate1:d,selectedDate2:g})),h(ou({right:!1,bottom:!1,top:!1,content:null})),c({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"})),h(Z())})},children:"صدور فاکتور"})]})})})})]})})]})})]})};W6.propTypes={item:S.PropTypes.object,file:S.PropTypes.object};var su={},K6=I6;Object.defineProperty(su,"__esModule",{value:!0});var v=su.default=void 0,H6=K6(P6()),V6=a;v=su.default=(0,H6.default)((0,V6.jsx)("path",{d:"M14 2H6c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8zm2 14h-3v3h-2v-3H8v-2h3v-3h2v3h3zm-3-7V3.5L18.5 9z"}),"NoteAdd");const G6=b6("DEPOSITE_ALLOCATION",async u=>{const{data:c,status:d}=await F6.put("deposit_allocation/0/",u);return{data:c,status:d}}),F=({share:u,allocationKey:c,paymentPrice:d,fileId:g})=>{const[h]=b.useContext(S6),s=cu(),i=tu({initialValues:{factorImg:"",payment:d},validationSchema:lu({factorImg:E().required("این فیلد اجباری است!").typeError("لطفا عدد وارد کنید!"),payment:E().required("این فیلد اجباری است!").typeError("لطفا عدد وارد کنید!")})}),[C,m]=b.useState([]),D=(p,e)=>{var x;p[0]?i.setFieldValue("factorImg",U6((x=p[0])==null?void 0:x.data_url)):i.setFieldValue("factorImg",""),m(p)};return b.useEffect(()=>{i.validateForm()},[]),a.jsxs(n,{container:!0,gap:l.SMALL,justifyContent:"center",children:[a.jsx(ru,{allowLeadingZeros:!0,thousandSeparator:",",fullWidth:!0,label:"مبلغ پرداختی",name:"payment",id:"payment",variant:"outlined",InputProps:{readOnly:!0},value:i.values.payment,error:i.touched.payment?!!i.errors.payment:null,onChange:i.handleChange,onBlur:i.handleBlur,helperText:i.touched.payment&&i.errors.payment?i.errors.payment:null}),a.jsx(n,{children:a.jsx(O6,{onChange:D,images:C,maxNumber:1,title:"بارگذاری سند"})}),a.jsx(f,{fullWidth:!0,variant:"contained",disabled:!i.isValid,onClick:()=>{s(X()),s(G6({key:c,type:u,image:i.values.factorImg,payment:i.values.payment})).then(p=>{p.error?h({vertical:"top",horizontal:"center",msg:"مشکلی پیش آمده است!",severity:"error"}):(s(R6()),s(N6()),s(Z()),h({vertical:"top",horizontal:"center",msg:"عملیات با موفقیت انجام شد.",severity:"success"}))})},children:"ثبت"})]})};F.propTypes={share:S.PropTypes.string,allocationKey:S.PropTypes.string,paymentPrice:S.PropTypes.any,fileId:S.PropTypes.any};const Y6=({process:u,id:c})=>{var A,$,J,k,T,L,P,R,N,w,_,M,O,U,q,W,K,H,V,G,y,Y,du,hu,Cu,yu,mu,xu,pu,gu,fu,ju,Au,vu,Fu,Su,bu,Du,Bu,Iu,Eu,ku,Tu,Lu,Pu,Ru,Nu,wu,_u,Mu,Ou,Uu,qu,Wu,Ku,Hu,Vu,Gu,Yu,zu,Zu,Qu,$u,Ju,Xu,u6,a6,e6,n6,t6,l6,o6,r6,i6,c6,s6,d6,h6,C6;const d=cu(),g=q6(c);u=u||((A=g==null?void 0:g.file)==null?void 0:A.process);let h,s,i,C,m,D;const p=I()==="ProvinceFinancial"&&!((J=($=u.allocation)==null?void 0:$.provincePaymentDocuments)!=null&&J.length)&&!!((k=u.allocation)!=null&&k.provinceShareRemaining),e=I()==="ProvinceFinancial"&&!((L=(T=u.allocation)==null?void 0:T.fanavaPaymentDocuments)!=null&&L.length)&&!!((P=u.allocation)!=null&&P.fanavaShareRemaining),x=I()==="ProvinceFinancial"&&!((N=(R=u.allocation)==null?void 0:R.cityPaymentDocuments)!=null&&N.length)&&!!((w=u.allocation)!=null&&w.cityShareRemaining),j=I()==="ProvinceFinancial"&&!((M=(_=u.allocation)==null?void 0:_.companyPaymentDocuments)!=null&&M.length)&&!!((O=u.allocation)!=null&&O.companyShareRemaining),uu=I()==="ProvinceFinancial"&&!((q=(U=u.allocation)==null?void 0:U.centralUnionPaymentDocuments)!=null&&q.length)&&!!((W=u.allocation)!=null&&W.centralUnionShareRemaining),Q=I()==="ProvinceFinancial"&&!((H=(K=u.allocation)==null?void 0:K.poultryPaymentDocuments)!=null&&H.length)&&!!((V=u.allocation)!=null&&V.poultryRemaining);(G=u.allocation)!=null&&G.provinceShareDigit&&(h=["سهم اتحادیه",(y=u.allocation)==null?void 0:y.provinceCardNumber,(Y=u.allocation)==null?void 0:Y.provinceShaba,(du=u.allocation)==null?void 0:du.provinceBankInfo,((hu=u.allocation)==null?void 0:hu.provinceShareDigit)+" ریال",((Cu=u.allocation)==null?void 0:Cu.provinceSharePayment)+" ریال",((yu=u.allocation)==null?void 0:yu.provinceShareRemaining)+" ریال",(xu=(mu=u.allocation)==null?void 0:mu.provincePaymentDocuments)==null?void 0:xu.map((t,o)=>a.jsx("a",{href:t.image,children:a.jsx("img",{alt:"document",width:"40",height:"40",src:t.image,style:{borderRadius:"5px"}})},"document"+o)),a.jsx(B,{color:"primary",component:"label",disabled:!p,onClick:()=>{var t,o;d(z({title:"ثبت سند مالی",content:a.jsx(F,{fileId:c,allocationKey:(t=u.allocation)==null?void 0:t.allocationKey,paymentPrice:(o=u.allocation)==null?void 0:o.provinceShareRemaining,share:"ProvinceOperator"})}))},children:a.jsx(v,{})},"fff")]),(pu=u.allocation)!=null&&pu.fanavaShareDigit&&(i=["سهم فن آوا",(gu=u.allocation)==null?void 0:gu.fanavaCardNumber,(fu=u.allocation)==null?void 0:fu.fanavaShaba,(ju=u.allocation)==null?void 0:ju.fanavaBankInfo,((Au=u.allocation)==null?void 0:Au.fanavaShareDigit)+" ریال",((vu=u.allocation)==null?void 0:vu.fanavaSharePayment)+" ریال",((Fu=u.allocation)==null?void 0:Fu.fanavaShareRemaining)+" ریال",(bu=(Su=u.allocation)==null?void 0:Su.fanavaPaymentDocuments)==null?void 0:bu.map((t,o)=>a.jsx("a",{href:t.image,children:a.jsx("img",{alt:"document",width:"40",height:"40",src:t.image,style:{borderRadius:"5px"}})},"fanavaPaymentDocuments"+o)),a.jsx(B,{color:"primary",component:"label",disabled:!e,onClick:()=>{var t,o;d(ou({right:!0,title:"ثبت سند مالی",content:a.jsx(F,{share:"fanava",fileId:c,paymentPrice:(t=u.allocation)==null?void 0:t.fanavaShareRemaining,allocationKey:(o=u.allocation)==null?void 0:o.allocationKey})}))},children:a.jsx(v,{})},"fff")]),(Du=u.allocation)!=null&&Du.cityShareDigit&&(s=["سهم شهرستان",(Bu=u.allocation)==null?void 0:Bu.cityCardNumber,(Iu=u.allocation)==null?void 0:Iu.cityShaba,(Eu=u.allocation)==null?void 0:Eu.cityBankInfo,((ku=u.allocation)==null?void 0:ku.cityShareDigit)+" ریال",((Tu=u.allocation)==null?void 0:Tu.citySharePayment)+" ریال",((Lu=u.allocation)==null?void 0:Lu.cityShareRemaining)+" ریال",(Ru=(Pu=u.allocation)==null?void 0:Pu.cityPaymentDocuments)==null?void 0:Ru.map((t,o)=>a.jsx("a",{href:t.image,children:a.jsx("img",{alt:"document",width:"40",height:"40",src:t.image,style:{borderRadius:"5px"}})},"cityPaymentDocuments"+o)),a.jsx(B,{color:"primary",component:"label",disabled:!x,onClick:()=>{var t,o;d(z({title:"ثبت سند مالی",content:a.jsx(F,{share:"CityOperator",fileId:c,paymentPrice:(t=u.allocation)==null?void 0:t.cityShareRemaining,allocationKey:(o=u.allocation)==null?void 0:o.allocationKey})}))},children:a.jsx(v,{})},"fff")]),(Nu=u.allocation)!=null&&Nu.companyShareDigit&&(C=["سهم شرکت",(wu=u.allocation)==null?void 0:wu.companyCardNumber,(_u=u.allocation)==null?void 0:_u.companyShaba,(Mu=u.allocation)==null?void 0:Mu.companyBankInfo,((Ou=u.allocation)==null?void 0:Ou.companyShareDigit)+" ریال",((Uu=u.allocation)==null?void 0:Uu.companySharePayment)+" ریال",((qu=u.allocation)==null?void 0:qu.companyShareRemaining)+" ریال",(Ku=(Wu=u.allocation)==null?void 0:Wu.companyPaymentDocuments)==null?void 0:Ku.map((t,o)=>a.jsx("a",{href:t.image,children:a.jsx("img",{alt:"document",width:"40",height:"40",src:t.image,style:{borderRadius:"5px"}})},"companyPaymentDocuments"+o)),a.jsx(B,{color:"primary",component:"label",disabled:!j,onClick:()=>{var t,o;d(z({right:!0,title:"ثبت سند مالی",content:a.jsx(F,{share:"company",fileId:c,paymentPrice:(t=u.allocation)==null?void 0:t.companyShareRemaining,allocationKey:(o=u.allocation)==null?void 0:o.allocationKey})}))},children:a.jsx(v,{})},"fff")]),(Hu=u.allocation)!=null&&Hu.centralUnionShareDigit&&(m=["سهم اتحادیه مرکزی",(Vu=u.allocation)==null?void 0:Vu.centralUnionCardNumber,(Gu=u.allocation)==null?void 0:Gu.centralUnionShaba,(Yu=u.allocation)==null?void 0:Yu.centralUnionBankInfo,((zu=u.allocation)==null?void 0:zu.centralUnionShareDigit)+" ریال",((Zu=u.allocation)==null?void 0:Zu.centralUnionSharePayment)+" ریال",((Qu=u.allocation)==null?void 0:Qu.centralUnionShareRemaining)+" ریال",(Ju=($u=u.allocation)==null?void 0:$u.centralUnionPaymentDocuments)==null?void 0:Ju.map((t,o)=>a.jsx("a",{href:t.image,children:a.jsx("img",{alt:"document",width:"40",height:"40",src:t.image,style:{borderRadius:"5px"}})},"centralUnionPaymentDocuments"+o)),a.jsx(B,{color:"primary",component:"label",disabled:!uu,onClick:()=>{var t,o;d(z({title:"ثبت سند مالی",content:a.jsx(F,{share:"central",fileId:c,paymentPrice:(t=u.allocation)==null?void 0:t.centralUnionShareRemaining,allocationKey:(o=u.allocation)==null?void 0:o.allocationKey})}))},children:a.jsx(v,{})},"fff")]),(Xu=u.allocation)!=null&&Xu.poultryShareDigit&&(D=["سهم مرغدار",(u6=u.allocation)==null?void 0:u6.poultryCardNumber,(a6=u.allocation)==null?void 0:a6.poultryShaba,(e6=u.allocation)==null?void 0:e6.poultryBankInfo,((n6=u.allocation)==null?void 0:n6.poultryShareDigit)+" ریال",((t6=u.allocation)==null?void 0:t6.poultrySharePayment)+" ریال",((l6=u.allocation)==null?void 0:l6.poultryRemaining)+" ریال",(r6=(o6=u.allocation)==null?void 0:o6.poultryPaymentDocuments)==null?void 0:r6.map((t,o)=>a.jsx("a",{href:t.image,children:a.jsx("img",{alt:"document",width:"40",height:"40",src:t.image,style:{borderRadius:"5px"}})},"poultryPaymentDocuments"+o)),a.jsx(B,{color:"primary",component:"label",disabled:!Q,onClick:()=>{var t,o;d(z({title:"ثبت سند مالی",content:a.jsx(F,{share:"Poultry",fileId:c,paymentPrice:(t=u.allocation)==null?void 0:t.poultryRemaining,allocationKey:(o=u.allocation)==null?void 0:o.allocationKey})}))},children:a.jsx(v,{})},"fff")]);const au=[h,s,i,C,m,D].filter(t=>!!t);return a.jsx(a.Fragment,{children:a.jsxs(p6,{sx:{alignSelf:"flex-start",width:"100%"},children:[a.jsxs(g6,{children:[a.jsx(f6,{}),a.jsx(j6,{})]}),a.jsxs(n,{container:!0,direction:"column",flexWrap:"nowrap",flex:"1",children:[a.jsxs(n,{container:!0,alignItems:"flex-start",children:[a.jsx(n,{children:a.jsx(A6,{children:a.jsx(r,{variant:"body1",fontWeight:"bold",children:"فاکتور نهایی"})})}),a.jsx(n,{children:a.jsx(v6,{color:"textSecondary",children:a.jsxs(n,{container:!0,direction:"row",justifyContent:"space-between",alignItems:"center",gap:l.SMALL,children:[a.jsx(r,{variant:"body2",display:"flex",gap:l.SMALL,children:"ﺷﻤﺎﺭﻩ ﻓﺎﮐﺘﻮﺭ:"}),a.jsx(r,{variant:"body2",fontWeight:"bold",children:(i6=u==null?void 0:u.poultry)==null?void 0:i6.poultryOrderCode}),a.jsx(r,{variant:"body2",display:"flex",gap:l.SMALL,children:"تاریخ:"}),a.jsx(r,{variant:"body2",fontWeight:"bold",children:w6((c6=u==null?void 0:u.poultry)==null?void 0:c6.poultrySendDate)})]})})})]}),a.jsx(n,{container:!0,mt:l.SMALL,spacing:l.TINY,children:a.jsx(n,{width:"100%",children:a.jsxs(n,{children:[a.jsx(iu,{columns:["اطلاعات مالی","شماره کارت","شبا","صاحب حساب","جمع کل","جمع پرداختی","مانده","اسناد","ثبت"],data:au}),((s6=u.allocation)==null?void 0:s6.totalMoney)&&a.jsx(iu,{columns:["مبلغ کل به عدد","مبلغ کل به حروف"],data:[[((h6=(d6=u.allocation)==null?void 0:d6.totalMoney)==null?void 0:h6.toLocaleString())+" ریال",(C6=u.allocation)==null?void 0:C6.totalMoneyChar]]})]})})})]})]})})};Y6.propTypes={process:S.PropTypes.any};export{W6 as F,Y6 as a};