pay invoice

This commit is contained in:
hamid zarghami
2026-02-24 12:08:03 +03:30
parent 7a34e74e02
commit f5c152ccc6
4 changed files with 261 additions and 11 deletions
+10 -11
View File
@@ -4,12 +4,13 @@ import ModalConfirm from '@/components/ModalConfirm'
import Button from '@/components/Button'
import Table from '@/components/Table'
import type { RowDataType } from '@/components/types/TableTypes'
import { useParams } from 'react-router-dom'
import { Link, useParams } from 'react-router-dom'
import { useQueryClient } from '@tanstack/react-query'
import { useConfirmInvoiceItem, useGetInvoiceDetail } from './hooks/useInvoiceData'
import { NumberFormat } from '@/config/func'
import moment from 'moment-jalaali'
import type { InvoiceItem as ApiInvoiceItem } from './types/InvoiceTypes'
import { Paths } from '@/config/Paths'
interface TableInvoiceItem extends RowDataType {
id: string
@@ -135,7 +136,7 @@ const InvoiceDetail: FC = () => {
)
}
const isPaid = invoice && invoice.paidAmount >= invoice.total && invoice.total > 0
// const isPaid = invoice && invoice.paidAmount >= invoice.total && invoice.total > 0
return (
<div className='mt-4 text-sm'>
@@ -152,15 +153,13 @@ const InvoiceDetail: FC = () => {
<Printer size={20} color='black' />
<span className='text-xs'>چاپ</span>
</Button>
<Button
className={
isPaid
? 'bg-[#E8F5E9] text-[#01AC45] w-[120px] h-9 text-xs'
: 'bg-[#E8F0FF] text-[#0047FF] w-[120px] h-9 text-xs'
}
>
{isPaid ? 'پرداخت شده' : 'پرداخت نشده'}
</Button>
<Link to={`${Paths.payment.payInvoice}${id}`}>
<Button
className='bg-blue-100 text-[#0047FF] w-[120px] h-9 '
>
پرداخت
</Button>
</Link>
</div>
</div>