feat: add completion_date field to projects and update related functionalities in forms and queries
This commit is contained in:
@@ -22,6 +22,7 @@ const ProjectForm = forwardRef(function ProjectForm({ initialData = null }, ref)
|
||||
city: "",
|
||||
investment_number: "",
|
||||
finish_date: "",
|
||||
completion_date: "",
|
||||
wp: "",
|
||||
contact: "",
|
||||
notes: "",
|
||||
@@ -62,6 +63,7 @@ const ProjectForm = forwardRef(function ProjectForm({ initialData = null }, ref)
|
||||
city: "",
|
||||
investment_number: "",
|
||||
finish_date: "",
|
||||
completion_date: "",
|
||||
wp: "",
|
||||
contact: "",
|
||||
notes: "",
|
||||
@@ -74,10 +76,13 @@ const ProjectForm = forwardRef(function ProjectForm({ initialData = null }, ref)
|
||||
project_type: initialData.project_type || "design",
|
||||
assigned_to: initialData.assigned_to || "",
|
||||
wartosc_zlecenia: initialData.wartosc_zlecenia || "",
|
||||
// Format finish_date for input if it exists
|
||||
// Format dates for input if they exist
|
||||
finish_date: initialData.finish_date
|
||||
? formatDateForInput(initialData.finish_date)
|
||||
: "",
|
||||
completion_date: initialData.completion_date
|
||||
? formatDateForInput(initialData.completion_date)
|
||||
: "",
|
||||
});
|
||||
}
|
||||
}, [initialData]);
|
||||
@@ -295,6 +300,18 @@ const ProjectForm = forwardRef(function ProjectForm({ initialData = null }, ref)
|
||||
onChange={handleChange}
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label className="block text-sm font-medium text-gray-700 mb-2">
|
||||
Data zakończenia projektu
|
||||
</label>
|
||||
<Input
|
||||
type="date"
|
||||
name="completion_date"
|
||||
value={formatDateForInput(form.completion_date)}
|
||||
onChange={handleChange}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user