feat: add completion_date field to projects and update related functionalities in forms and queries

This commit is contained in:
2025-11-14 10:01:49 +01:00
parent 6b205f36bb
commit 9b1f42c4ec
5 changed files with 71 additions and 4 deletions

View File

@@ -75,9 +75,9 @@ export function createProject(data, userId = null) {
const stmt = db.prepare(`
INSERT INTO projects (
contract_id, project_name, project_number, address, plot, district, unit, city, investment_number, finish_date,
contract_id, project_name, project_number, address, plot, district, unit, city, investment_number, finish_date, completion_date,
wp, contact, notes, wartosc_zlecenia, project_type, project_status, coordinates, created_by, assigned_to, created_at, updated_at
) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, datetime('now', 'localtime'), datetime('now', 'localtime'))
) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, datetime('now', 'localtime'), datetime('now', 'localtime'))
`);
const result = stmt.run(
@@ -91,6 +91,7 @@ export function createProject(data, userId = null) {
data.city,
data.investment_number,
data.finish_date,
data.completion_date,
data.wp,
data.contact,
data.notes,
@@ -109,7 +110,7 @@ export function updateProject(id, data, userId = null) {
const stmt = db.prepare(`
UPDATE projects SET
contract_id = ?, project_name = ?, project_number = ?, address = ?, plot = ?, district = ?, unit = ?, city = ?,
investment_number = ?, finish_date = ?, wp = ?, contact = ?, notes = ?, wartosc_zlecenia = ?, project_type = ?, project_status = ?,
investment_number = ?, finish_date = ?, completion_date = ?, wp = ?, contact = ?, notes = ?, wartosc_zlecenia = ?, project_type = ?, project_status = ?,
coordinates = ?, assigned_to = ?, updated_at = CURRENT_TIMESTAMP
WHERE project_id = ?
`);
@@ -124,6 +125,7 @@ export function updateProject(id, data, userId = null) {
data.city,
data.investment_number,
data.finish_date,
data.completion_date,
data.wp,
data.contact,
data.notes,