feat: track wartosc_zlecenia in project updates and display in ProjectViewPage for team leads
This commit is contained in:
@@ -59,7 +59,7 @@ async function updateProjectHandler(req, { params }) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Track field changes for specific fields we want to monitor
|
// Track field changes for specific fields we want to monitor
|
||||||
const fieldsToTrack = ['finish_date', 'project_status', 'assigned_to', 'contract_id'];
|
const fieldsToTrack = ['finish_date', 'project_status', 'assigned_to', 'contract_id', 'wartosc_zlecenia'];
|
||||||
|
|
||||||
for (const fieldName of fieldsToTrack) {
|
for (const fieldName of fieldsToTrack) {
|
||||||
if (data.hasOwnProperty(fieldName)) {
|
if (data.hasOwnProperty(fieldName)) {
|
||||||
|
|||||||
@@ -422,17 +422,17 @@ export default function ProjectViewPage() {
|
|||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
{session?.user?.role === 'team_lead' && project.wartosc_zlecenia && (
|
{session?.user?.role === 'team_lead' && project.wartosc_zlecenia && (
|
||||||
<div>
|
<FieldWithHistory
|
||||||
<span className="text-sm font-medium text-gray-500 block mb-1">
|
tableName="projects"
|
||||||
Wartość zlecenia
|
recordId={project.project_id}
|
||||||
</span>
|
fieldName="wartosc_zlecenia"
|
||||||
<p className="text-gray-900 font-medium">
|
currentValue={project.wartosc_zlecenia}
|
||||||
{parseFloat(project.wartosc_zlecenia).toLocaleString('pl-PL', {
|
displayValue={parseFloat(project.wartosc_zlecenia).toLocaleString('pl-PL', {
|
||||||
style: 'currency',
|
style: 'currency',
|
||||||
currency: 'PLN'
|
currency: 'PLN'
|
||||||
})}
|
})}
|
||||||
</p>
|
label="Wartość zlecenia"
|
||||||
</div>
|
/>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user