Compare commits
No commits in common. "bd1a97716c8c4632900d6726a13ef0da9feaa7fb" and "73f5b46a40b236d3d854e71cfc5d92da64cd7aa6" have entirely different histories.
bd1a97716c
...
73f5b46a40
@ -54,13 +54,7 @@ const ManagePurchase = ({ onClose, purchaseId }) => {
|
||||
|
||||
useEffect(() => {
|
||||
if (purchaseId && data) {
|
||||
reset({
|
||||
...data,
|
||||
title: data.title,
|
||||
projectId: data.project.id,
|
||||
organizationId: data.organization.id,
|
||||
supplierId: data.supplier.id,
|
||||
});
|
||||
reset(data);
|
||||
setCompletedTabs([0, 1, 2]);
|
||||
}
|
||||
}, [purchaseId, data, reset]);
|
||||
@ -84,7 +78,8 @@ const ManagePurchase = ({ onClose, purchaseId }) => {
|
||||
setActiveTab((prev) => Math.max(prev - 1, 0));
|
||||
};
|
||||
|
||||
const { mutate: CreateInvoice, isPending } = useCreatePurchaseInvoice(() => {
|
||||
const { mutate: CreateInvoice, isPending } =
|
||||
useCreatePurchaseInvoice(() => {
|
||||
reset();
|
||||
onClose();
|
||||
});
|
||||
@ -154,7 +149,9 @@ const ManagePurchase = ({ onClose, purchaseId }) => {
|
||||
|
||||
<span className="bs-stepper-label">
|
||||
<span className="bs-stepper-title">{step.name}</span>
|
||||
<span className="bs-stepper-subtitle">{step.subtitle}</span>
|
||||
<span className="bs-stepper-subtitle">
|
||||
{step.subtitle}
|
||||
</span>
|
||||
</span>
|
||||
</button>
|
||||
</div>
|
||||
@ -228,3 +225,4 @@ const ManagePurchase = ({ onClose, purchaseId }) => {
|
||||
};
|
||||
|
||||
export default ManagePurchase;
|
||||
|
||||
|
||||
@ -1,19 +1,12 @@
|
||||
import React from "react";
|
||||
import {
|
||||
AppFormController,
|
||||
useAppFormContext,
|
||||
} from "../../hooks/appHooks/useAppForm";
|
||||
import { AppFormController, useAppFormContext } from "../../hooks/appHooks/useAppForm";
|
||||
import Label from "../common/Label";
|
||||
import DatePicker from "../common/DatePicker";
|
||||
import {
|
||||
SelectFieldSearch,
|
||||
SelectProjectField,
|
||||
} from "../common/Forms/SelectFieldServerSide";
|
||||
import {
|
||||
useGlobaleOrganizations,
|
||||
useOrganization,
|
||||
useOrganizationsList,
|
||||
} from "../../hooks/useOrganization";
|
||||
import { useGlobaleOrganizations, useOrganization, useOrganizationsList } from "../../hooks/useOrganization";
|
||||
import { ITEMS_PER_PAGE } from "../../utils/constants";
|
||||
|
||||
const PurchasePartyDetails = () => {
|
||||
@ -25,6 +18,7 @@ const PurchasePartyDetails = () => {
|
||||
formState: { errors },
|
||||
} = useAppFormContext();
|
||||
|
||||
|
||||
return (
|
||||
<div className="row g-2 text-start">
|
||||
{/* Title */}
|
||||
@ -67,27 +61,35 @@ const PurchasePartyDetails = () => {
|
||||
/>
|
||||
</div>
|
||||
|
||||
{/* Organization */}
|
||||
<div className="col-12 col-md-6">
|
||||
|
||||
|
||||
<AppFormController
|
||||
name="organizationId"
|
||||
control={control}
|
||||
render={({ field }) => (
|
||||
<SelectFieldSearch
|
||||
{...field}
|
||||
label="Organization"
|
||||
placeholder="Select Organization"
|
||||
required
|
||||
value={field.value}
|
||||
onChange={field.onChange}
|
||||
valueKey="id"
|
||||
labelKey="name"
|
||||
useFetchHook={useGlobaleOrganizations}
|
||||
hookParams={[ITEMS_PER_PAGE,1]}
|
||||
error={errors?.organizationId?.message}
|
||||
errors={errors?.organizationId}
|
||||
/>
|
||||
)}
|
||||
/>
|
||||
|
||||
</div>
|
||||
|
||||
{/* Supplier */}
|
||||
<div className="col-12 col-md-6">
|
||||
|
||||
|
||||
<AppFormController
|
||||
name="supplierId"
|
||||
control={control}
|
||||
@ -106,8 +108,11 @@ const PurchasePartyDetails = () => {
|
||||
/>
|
||||
)}
|
||||
/>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
{/* Billing Address */}
|
||||
<div className="col-12 col-md-6">
|
||||
<Label htmlFor="billingAddress">Billing Address</Label>
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user