- Added views for listing fixed-price agreements, displaying agreement details, and a reporting dashboard. - Created HTML templates for listing, detailing, and reporting on fixed-price agreements. - Introduced API endpoint to fetch active customers for agreement creation. - Added migration scripts for creating necessary database tables and views for fixed-price agreements, billing periods, and reporting. - Implemented triggers for auto-generating agreement numbers and updating timestamps. - Enhanced ticket management with archived ticket views and filtering capabilities.
14 lines
581 B
SQL
14 lines
581 B
SQL
-- Migration: Add rounded_hours to tticket_worklog for prepaid card billing
|
|
|
|
-- Add rounded_hours column (actual hours deducted from prepaid card after rounding)
|
|
ALTER TABLE tticket_worklog
|
|
ADD COLUMN IF NOT EXISTS rounded_hours DECIMAL(5,2);
|
|
|
|
COMMENT ON COLUMN tticket_worklog.rounded_hours IS 'Rounded hours (actual amount deducted from prepaid card). NULL if not prepaid or no rounding applied.';
|
|
|
|
-- Backfill: Set rounded_hours = hours for existing prepaid entries
|
|
UPDATE tticket_worklog
|
|
SET rounded_hours = hours
|
|
WHERE prepaid_card_id IS NOT NULL
|
|
AND rounded_hours IS NULL;
|