espace-paie-odentas/migrations/add_custom_amount_to_salary_transfer_payslips.sql
odentas 266eb3598a feat: Implémenter store global Zustand + calcul total quantités + fix structure field + montants personnalisés virements
- Créer hook useStaffOrgSelection avec persistence localStorage
- Ajouter badge StaffOrgBadge dans Sidebar
- Synchroniser filtres org dans toutes les pages (contrats, cotisations, facturation, etc.)
- Fix calcul cachets: utiliser totalQuantities au lieu de dates.length
- Fix structure field bug: ne plus écraser avec production_name
- Ajouter création note lors modification contrat
- Implémenter montants personnalisés pour virements salaires
- Migrations SQL: custom_amount + fix_structure_field
- Réorganiser boutons ContractEditor en carte flottante droite
2025-12-01 21:51:57 +01:00

27 lines
979 B
SQL

-- Migration: Ajout du champ custom_amount à salary_transfer_payslips
-- Date: 2025-12-01
-- Description: Permet de spécifier un montant personnalisé pour chaque paie dans un virement
-- 1. Ajouter le champ custom_amount
ALTER TABLE salary_transfer_payslips
ADD COLUMN IF NOT EXISTS custom_amount DECIMAL(10, 2);
-- 2. Commentaire pour documenter le champ
COMMENT ON COLUMN salary_transfer_payslips.custom_amount IS
'Montant personnalisé pour cette paie dans le virement. Si NULL, le montant de la paie (net_after_withholding ou net_amount) sera utilisé.';
-- 3. Vérification
DO $$
BEGIN
-- Vérifier que la colonne custom_amount existe
IF NOT EXISTS (
SELECT 1 FROM information_schema.columns
WHERE table_name = 'salary_transfer_payslips'
AND column_name = 'custom_amount'
) THEN
RAISE EXCEPTION 'Colonne custom_amount non créée';
END IF;
RAISE NOTICE 'Migration réussie: custom_amount ajouté à salary_transfer_payslips';
END;
$$;