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