invoice users
This commit is contained in:
@@ -5,12 +5,10 @@ import { CloseCircle, FolderOpen, WalletCheck, WalletRemove, WalletSearch } from
|
|||||||
import Td from '../../components/Td'
|
import Td from '../../components/Td'
|
||||||
import { useGetInvoices } from './hooks/useReceiptData'
|
import { useGetInvoices } from './hooks/useReceiptData'
|
||||||
import PageLoading from '../../components/PageLoading'
|
import PageLoading from '../../components/PageLoading'
|
||||||
import { ReceiptItemType } from './types/ReceiptTypes'
|
import { InvoiceUserItemType, ReceiptItemType } from './types/ReceiptTypes'
|
||||||
import { NumberFormat } from '../../config/func'
|
import { NumberFormat } from '../../config/func'
|
||||||
import Select from '../../components/Select'
|
import Select from '../../components/Select'
|
||||||
import { useGetCustomers } from '../customer/hooks/useCustomerData'
|
|
||||||
import Input from '../../components/Input'
|
import Input from '../../components/Input'
|
||||||
import { CustomerItemType } from '../customer/types/CustomerTypes'
|
|
||||||
import DatePickerComponent from '../../components/DatePicker'
|
import DatePickerComponent from '../../components/DatePicker'
|
||||||
import { useSearchParams } from 'react-router-dom'
|
import { useSearchParams } from 'react-router-dom'
|
||||||
import moment from 'moment-jalaali'
|
import moment from 'moment-jalaali'
|
||||||
@@ -27,7 +25,6 @@ const ReceiptsList: FC = () => {
|
|||||||
const [date, setDate] = useState<string>('')
|
const [date, setDate] = useState<string>('')
|
||||||
const [endDate, setEndDate] = useState<string>('')
|
const [endDate, setEndDate] = useState<string>('')
|
||||||
const getInvoices = useGetInvoices(activeTab, customerId, search, date, endDate)
|
const getInvoices = useGetInvoices(activeTab, customerId, search, date, endDate)
|
||||||
const getCustomers = useGetCustomers()
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const urlCustomerId = searchParams.get('user')
|
const urlCustomerId = searchParams.get('user')
|
||||||
@@ -49,9 +46,9 @@ const ReceiptsList: FC = () => {
|
|||||||
<Select
|
<Select
|
||||||
label={t('receip.customer')}
|
label={t('receip.customer')}
|
||||||
placeholder={t('select')}
|
placeholder={t('select')}
|
||||||
items={getCustomers.data?.data?.customers?.map((item: CustomerItemType) => {
|
items={getInvoices.data?.data?.users?.map((item: InvoiceUserItemType) => {
|
||||||
return {
|
return {
|
||||||
label: item.firstName + ' ' + item.lastName,
|
label: item.firstname + ' ' + item.lastname,
|
||||||
value: item.id
|
value: item.id
|
||||||
}
|
}
|
||||||
})}
|
})}
|
||||||
|
|||||||
@@ -35,3 +35,11 @@ export type ReceiptItemType = {
|
|||||||
recurringPeriod?: number;
|
recurringPeriod?: number;
|
||||||
maxRecurringCycles?: number;
|
maxRecurringCycles?: number;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export type InvoiceUserItemType = {
|
||||||
|
id: string;
|
||||||
|
firstname: string;
|
||||||
|
lastname: string;
|
||||||
|
email: string;
|
||||||
|
phone: string;
|
||||||
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user