From f2ebdc98362031edb393991f8f76f96c78e54979 Mon Sep 17 00:00:00 2001 From: hamid zarghami Date: Sat, 21 Feb 2026 14:28:32 +0330 Subject: [PATCH] update invoice --- src/config/Paths.tsx | 1 + src/pages/invoice/Create.tsx | 12 +- src/pages/invoice/ProformaInvoice.tsx | 8 +- src/pages/invoice/Update.tsx | 315 ++++++++++++++++++++ src/pages/invoice/hooks/useInvoiceData.ts | 26 ++ src/pages/invoice/service/InvoiceService.ts | 17 +- src/pages/invoice/types/Types.ts | 14 +- src/router/MainRouter.tsx | 2 + 8 files changed, 384 insertions(+), 11 deletions(-) create mode 100644 src/pages/invoice/Update.tsx diff --git a/src/config/Paths.tsx b/src/config/Paths.tsx index 9ac18a5..7b4bd93 100644 --- a/src/config/Paths.tsx +++ b/src/config/Paths.tsx @@ -54,6 +54,7 @@ export const Paths = { list: '/invoice/list', create: '/invoice/create', detail: '/invoice/', + update: '/invoice/update/', }, newOrder: '/new-order', orderDetails: '/order/', diff --git a/src/pages/invoice/Create.tsx b/src/pages/invoice/Create.tsx index 4ea71b1..65a7368 100644 --- a/src/pages/invoice/Create.tsx +++ b/src/pages/invoice/Create.tsx @@ -40,13 +40,13 @@ const CreateInvoice: FC = () => { const [items, setItems] = useState([createEmptyItem()]); const [attachmentFiles, setAttachmentFiles] = useState([]); - const formik = useFormik>({ + const formik = useFormik>({ initialValues: { userId: "", enableTax: false, approvalDeadline: "", paymentMethod: "", - notes: "", + description: "", }, validationSchema: Yup.object({ userId: !requestId @@ -87,7 +87,7 @@ const CreateInvoice: FC = () => { enableTax: values.enableTax, approvalDeadline: moment(values.approvalDeadline, 'jYYYY/jMM/jDD').format('YYYY-MM-DD'), ...(values.paymentMethod ? { paymentMethod: values.paymentMethod } : {}), - notes: values.notes, + description: values.description, ...(attachments.length ? { attachments } : {}), }; @@ -243,10 +243,10 @@ const CreateInvoice: FC = () => {