update invoice

This commit is contained in:
hamid zarghami
2026-02-21 14:28:32 +03:30
parent 002e45de0b
commit f2ebdc9836
8 changed files with 384 additions and 11 deletions
+6 -6
View File
@@ -40,13 +40,13 @@ const CreateInvoice: FC = () => {
const [items, setItems] = useState<CreatePreInvoiceItemType[]>([createEmptyItem()]);
const [attachmentFiles, setAttachmentFiles] = useState<File[]>([]);
const formik = useFormik<Pick<CreatePreInvoiceType, "userId" | "enableTax" | "approvalDeadline" | "paymentMethod" | "notes">>({
const formik = useFormik<Pick<CreatePreInvoiceType, "userId" | "enableTax" | "approvalDeadline" | "paymentMethod" | "description">>({
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 = () => {
<Textarea
label="توضیحات"
placeholder="توضیحات پیش فاکتور را وارد کنید..."
value={formik.values.notes}
onChange={(e) => formik.setFieldValue("notes", e.target.value)}
value={formik.values.description}
onChange={(e) => formik.setFieldValue("description", e.target.value)}
onBlur={formik.handleBlur}
name="notes"
name="description"
/>
</div>