update invoice
This commit is contained in:
@@ -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>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user