feat(invoice form): added new invoice form

This commit is contained in:
2025-11-05 21:58:28 -06:00
parent 6ce4d84fd0
commit 65304f61ce
13 changed files with 484 additions and 31 deletions

View File

@@ -13,6 +13,7 @@ import { FieldErrors } from "./FieldErrors";
type DateFieldProps = {
label: string;
required: boolean;
};
export const DateField = ({ label }: DateFieldProps) => {
const field = useFieldContext<any>();
@@ -37,6 +38,7 @@ export const DateField = ({ label }: DateFieldProps) => {
<Calendar
mode="single"
selected={date}
//required={required}
captionLayout="dropdown"
startMonth={new Date(new Date().getFullYear() - 10, 0)}
endMonth={new Date(new Date().getFullYear() + 20, 0)}

View File

@@ -0,0 +1,17 @@
import { queryOptions } from "@tanstack/react-query";
import axios from "axios";
export function getInvoices() {
return queryOptions({
queryKey: ["getInvoices"],
queryFn: () => fetch(),
staleTime: 5000,
refetchOnWindowFocus: true,
});
}
const fetch = async () => {
const { data } = await axios.get("/lst/api/forklifts/invoices");
return data.data;
};