fixing recipts in sales
This commit is contained in:
@@ -33,6 +33,8 @@ function SalesInvoiceBatchPrintContent() {
|
||||
const searchParams = useSearchParams()
|
||||
const status = searchParams.get("status") ?? "All"
|
||||
const query = searchParams.get("q") ?? ""
|
||||
const from = searchParams.get("from") ?? undefined
|
||||
const to = searchParams.get("to") ?? undefined
|
||||
const [rows, setRows] = useState<SalesInvoiceSummary[] | null>(null)
|
||||
const [company, setCompany] = useState<CompanyProfile | null>(null)
|
||||
const [template, setTemplate] = useState<InvoiceTemplateConfig | null>(null)
|
||||
@@ -40,7 +42,7 @@ function SalesInvoiceBatchPrintContent() {
|
||||
|
||||
useEffect(() => {
|
||||
Promise.all([
|
||||
salesApi.listInvoices({ page: 1, pageSize: 200 }),
|
||||
salesApi.listInvoices({ page: 1, pageSize: 200, from, to }),
|
||||
companyProfileApi.get().catch(() => ({ data: null, etag: null })),
|
||||
invoiceTemplateConfigApi.get().catch(() => ({ data: null, etag: null })),
|
||||
])
|
||||
@@ -50,7 +52,7 @@ function SalesInvoiceBatchPrintContent() {
|
||||
setTemplate(templateRes.data)
|
||||
})
|
||||
.catch((err) => setError(errorMessage(err)))
|
||||
}, [])
|
||||
}, [from, to])
|
||||
|
||||
const visibleRows = rows?.filter((row) => {
|
||||
const matchesStatus = status === "All" || row.status === status
|
||||
|
||||
Reference in New Issue
Block a user