bmc_hub/migrations/099_worklog_rounded_hours.sql
Christian e4b9091a1b feat: Implement fixed-price agreements frontend views and related templates
- 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.
2026-02-08 01:45:00 +01:00

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;