receip + active or in active service + ...
This commit is contained in:
+1
-1
@@ -38,7 +38,7 @@ const queryClient = new QueryClient({
|
|||||||
defaultOptions: {
|
defaultOptions: {
|
||||||
queries: {
|
queries: {
|
||||||
refetchOnWindowFocus: false,
|
refetchOnWindowFocus: false,
|
||||||
staleTime: 86400000 // 1 day in milliseconds
|
// staleTime: 86400000 // 1 day in milliseconds
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import { FC } from 'react'
|
|||||||
import { ItemServiceType } from '../pages/service/types/ServiecTypes'
|
import { ItemServiceType } from '../pages/service/types/ServiecTypes'
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
item: ItemServiceType
|
item: ItemServiceType,
|
||||||
}
|
}
|
||||||
|
|
||||||
const ServiceSection: FC<Props> = (props: Props) => {
|
const ServiceSection: FC<Props> = (props: Props) => {
|
||||||
|
|||||||
+4
-2
@@ -233,13 +233,13 @@
|
|||||||
"date_receipt": "تاریخ صورتحساب",
|
"date_receipt": "تاریخ صورتحساب",
|
||||||
"last_date_receipt": "آخرین مهلت پرداخت",
|
"last_date_receipt": "آخرین مهلت پرداخت",
|
||||||
"service": "سرویس",
|
"service": "سرویس",
|
||||||
"status": "وضعیت تایید",
|
"status": "وضعیت ",
|
||||||
"status_paid": "وضعیت پرداخت",
|
"status_paid": "وضعیت پرداخت",
|
||||||
"PENDING": "در انتظار ",
|
"PENDING": "در انتظار ",
|
||||||
"PAID": "پرداخت شده",
|
"PAID": "پرداخت شده",
|
||||||
"CANCELED": "لغو شده",
|
"CANCELED": "لغو شده",
|
||||||
"EXPIRED": "منقضی شده",
|
"EXPIRED": "منقضی شده",
|
||||||
"APPROVED": "تایید شده",
|
"WAIT_PAYMENT": "در انتظار پرداخت",
|
||||||
"real_person": "شخص حقیقی",
|
"real_person": "شخص حقیقی",
|
||||||
"fullName": "نام و نام خانوادگی",
|
"fullName": "نام و نام خانوادگی",
|
||||||
"compelete_financal_info_error": "برای دریافت فاکتور رسمی اطلاعات مالی خود را وارد کنید",
|
"compelete_financal_info_error": "برای دریافت فاکتور رسمی اطلاعات مالی خود را وارد کنید",
|
||||||
@@ -256,6 +256,8 @@
|
|||||||
"apply": "اعمال",
|
"apply": "اعمال",
|
||||||
"pending": "تایید نشده"
|
"pending": "تایید نشده"
|
||||||
},
|
},
|
||||||
|
"active": "فعال",
|
||||||
|
"inactive": "غیرفعال",
|
||||||
"confrim": {
|
"confrim": {
|
||||||
"subject": "حذف",
|
"subject": "حذف",
|
||||||
"content": "برای حذف این آیتم مطمئن هستید؟",
|
"content": "برای حذف این آیتم مطمئن هستید؟",
|
||||||
|
|||||||
@@ -139,17 +139,20 @@ const ReceiptsDetail: FC = () => {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className='bg-white xl:w-sidebar text-sm h-fit rounded-3xl p-8'>
|
<div className='bg-white xl:w-sidebar text-sm h-fit rounded-3xl p-8'>
|
||||||
<div className='p-6 bg-green-50 rounded-2xl text-green-400 text-xs mb-6'>
|
{
|
||||||
<p>{t('receip.thank_pay_1')}</p>
|
getInvoce.data?.data?.invoice?.status === 'PAID' &&
|
||||||
<p className='mt-1'>{t('receip.thank_pay_2')}</p>
|
<div className='p-6 bg-green-50 rounded-2xl text-green-400 text-xs mb-6'>
|
||||||
</div>
|
<p>{t('receip.thank_pay_1')}</p>
|
||||||
|
<p className='mt-1'>{t('receip.thank_pay_2')}</p>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
<div className='flex justify-between items-center'>
|
<div className='flex justify-between items-center'>
|
||||||
<div>
|
<div>
|
||||||
{t('receip.receip_information')}
|
{t('receip.receip_information')}
|
||||||
</div>
|
</div>
|
||||||
<div className={clx(
|
<div className={clx(
|
||||||
'border border-orange-400 text-orange-400 rounded-lg text-[9px] h-6 flex items-center px-1',
|
'border border-orange-400 text-orange-400 rounded-lg text-[9px] h-6 flex items-center px-1',
|
||||||
getInvoce.data?.data?.invoice?.status === 'PAID' || getInvoce.data?.data?.invoice?.status === 'APPROVED' ? 'border-green-400 text-green-400' : getInvoce.data?.data?.invoice?.status !== 'PENDING' ? 'border-red-400 text-red-400' : 'border-orange-400 text-orange-400'
|
getInvoce.data?.data?.invoice?.status === 'PAID' ? 'border-green-400 text-green-400' : getInvoce.data?.data?.invoice?.status !== 'PENDING' ? 'border-red-400 text-red-400' : 'border-orange-400 text-orange-400'
|
||||||
)}>
|
)}>
|
||||||
<div>{t(`receip.${getInvoce.data?.data?.invoice?.status}`)}</div>
|
<div>{t(`receip.${getInvoce.data?.data?.invoice?.status}`)}</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -190,7 +193,7 @@ const ReceiptsDetail: FC = () => {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
{
|
{
|
||||||
getInvoce.data?.data?.invoice?.status === 'APPROVED' &&
|
getInvoce.data?.data?.invoice?.status === 'WAIT_PAYMENT' &&
|
||||||
<div className='flex gap-4 items-center mt-8'>
|
<div className='flex gap-4 items-center mt-8'>
|
||||||
<Button
|
<Button
|
||||||
label={t('receip.get_factor')}
|
label={t('receip.get_factor')}
|
||||||
|
|||||||
@@ -115,7 +115,7 @@ const ReceiptsList: FC = () => {
|
|||||||
</div>
|
</div>
|
||||||
</Td>
|
</Td>
|
||||||
<Td text={t(`receip.${item.status}`)} />
|
<Td text={t(`receip.${item.status}`)} />
|
||||||
<Td text={item.paidAt ? t('receip.paid') : t('receip.not_paid')} />
|
<Td text={item.status === 'PAID' ? moment(item.paidAt).format('jYYYY-jMM-jDD') : t('receip.not_paid')} />
|
||||||
<Td text={''}>
|
<Td text={''}>
|
||||||
<Link to={Pages.receipts.detail + item.id}>
|
<Link to={Pages.receipts.detail + item.id}>
|
||||||
<Eye size={20} color='black' />
|
<Eye size={20} color='black' />
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ const ApproveInvoice: FC<Props> = ({ id, refetch, status }) => {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
if (status === 'PENDING' || status === 'APPROVED' && getProfile.isSuccess)
|
if (status === 'PENDING' || status === 'WAIT_PAYMENT' && getProfile.isSuccess)
|
||||||
return (
|
return (
|
||||||
<Fragment>
|
<Fragment>
|
||||||
<Button
|
<Button
|
||||||
@@ -62,7 +62,7 @@ const ApproveInvoice: FC<Props> = ({ id, refetch, status }) => {
|
|||||||
onClick={() => status === 'PENDING' ? handleShowModal() : null}
|
onClick={() => status === 'PENDING' ? handleShowModal() : null}
|
||||||
className={clx(
|
className={clx(
|
||||||
'px-9 w-fit bg-white bg-opacity-70 text-description',
|
'px-9 w-fit bg-white bg-opacity-70 text-description',
|
||||||
status === 'APPROVED' && 'bg-green-300 text-[#00BA4B] bg-opacity-10'
|
status === 'WAIT_PAYMENT' && 'bg-green-300 text-[#00BA4B] bg-opacity-10'
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
<div className='flex gap-2.5'>
|
<div className='flex gap-2.5'>
|
||||||
@@ -72,7 +72,7 @@ const ApproveInvoice: FC<Props> = ({ id, refetch, status }) => {
|
|||||||
/>
|
/>
|
||||||
<div className='whitespace-nowrap'>
|
<div className='whitespace-nowrap'>
|
||||||
{
|
{
|
||||||
status === 'APPROVED' ?
|
status === 'WAIT_PAYMENT' ?
|
||||||
t('receip.accepted')
|
t('receip.accepted')
|
||||||
:
|
:
|
||||||
t('receip.confrim_factor')
|
t('receip.confrim_factor')
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ import { useGetAds } from '../ads/hooks/useAdsData'
|
|||||||
import { AdsDisplayLocation } from '../ads/types/AdsTypes'
|
import { AdsDisplayLocation } from '../ads/types/AdsTypes'
|
||||||
import { Helmet } from 'react-helmet-async'
|
import { Helmet } from 'react-helmet-async'
|
||||||
import ServiceItemSkeleton from './components/ServiceItemSkeleton'
|
import ServiceItemSkeleton from './components/ServiceItemSkeleton'
|
||||||
|
import { clx } from '../../helpers/utils'
|
||||||
|
|
||||||
const MyServices: FC = () => {
|
const MyServices: FC = () => {
|
||||||
|
|
||||||
@@ -60,7 +61,10 @@ const MyServices: FC = () => {
|
|||||||
:
|
:
|
||||||
getServices.data?.data?.subscriptions?.map((item: MyServicesItem) => {
|
getServices.data?.data?.subscriptions?.map((item: MyServicesItem) => {
|
||||||
return (
|
return (
|
||||||
<Link key={item.id} to={Pages.services.detail + item.id} className='flex-1 min-w-[40%] xl:min-w-[20%] bg-white rounded-3xl p-6'>
|
<Link key={item.id} to={item.status === 'ACTIVE' ? Pages.services.detail + item.id : ''} className={clx(
|
||||||
|
'flex-1 min-w-[40%] xl:min-w-[20%] bg-white rounded-3xl p-6',
|
||||||
|
item.status === 'INACTIVE' && 'opacity-50'
|
||||||
|
)}>
|
||||||
<ServiceSection
|
<ServiceSection
|
||||||
item={{
|
item={{
|
||||||
author: item.plan.service.author,
|
author: item.plan.service.author,
|
||||||
@@ -77,14 +81,21 @@ const MyServices: FC = () => {
|
|||||||
serviceLanguage: item.plan.service.serviceLanguage,
|
serviceLanguage: item.plan.service.serviceLanguage,
|
||||||
softwareLanguage: item.plan.service.softwareLanguage,
|
softwareLanguage: item.plan.service.softwareLanguage,
|
||||||
updatedAt: item.plan.service.updatedAt,
|
updatedAt: item.plan.service.updatedAt,
|
||||||
userCount: item.plan.service?.userCount
|
userCount: item.plan.service?.userCount,
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<div className='mt-6 flex gap-1 items-center'>
|
<div className='mt-6 flex gap-1 items-center'>
|
||||||
<StatusCircle
|
<StatusCircle
|
||||||
color='#00BA4B'
|
color={item.status === 'ACTIVE' ? '#00BA4B' : '#FF0000'}
|
||||||
/>
|
/>
|
||||||
<div className='text-xs text-description'>1 {t('service.active_menu')}</div>
|
<div className='text-xs text-description'>
|
||||||
|
{
|
||||||
|
item.status === 'ACTIVE' ?
|
||||||
|
t('active')
|
||||||
|
:
|
||||||
|
t('inactive')
|
||||||
|
}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</Link>
|
</Link>
|
||||||
|
|||||||
@@ -85,6 +85,7 @@ export type MyServicesItem = {
|
|||||||
createdAt: string;
|
createdAt: string;
|
||||||
duration: number;
|
duration: number;
|
||||||
isActive: boolean;
|
isActive: boolean;
|
||||||
|
status: "ACTIVE" | "INACTIVE";
|
||||||
name: string;
|
name: string;
|
||||||
price: number;
|
price: number;
|
||||||
service: {
|
service: {
|
||||||
|
|||||||
Reference in New Issue
Block a user