-- RETRAIT EN MASSE DES BENEFICIAIRES


-- 1 -- A LANCER UNE SEULE FOIS
CALL sp_init_retrait_rp('vitalis','156','2022-12-31','lionel','A LA DEMANDE DU GARANT RETRAIT ASSURES ET BENEFICIAIRES 2022');


-- 2 -- RETRAIT EN MASSE DES BENEFICIAIRES
CALL sp_avenantRetraitMasse('156','0156088501','lionel');




CALL sp_avenantRetraitMasse('156','0156077201','lionel');
CALL sp_avenantRetraitMasse('156','0156104101','lionel');

CALL sp_avenantRetraitMasse('156','0156088301','lionel');
CALL sp_avenantRetraitMasse('156','0156086801','lionel');
CALL sp_avenantRetraitMasse('156','0156130901','lionel');
CALL sp_avenantRetraitMasse('156','0156182901','lionel');
CALL sp_avenantRetraitMasse('156','0156101101','lionel');
CALL sp_avenantRetraitMasse('156','0156171501','lionel');
CALL sp_avenantRetraitMasse('156','0156128001','lionel');
CALL sp_avenantRetraitMasse('156','0156170301','lionel');
CALL sp_avenantRetraitMasse('156','0156174401','lionel');
CALL sp_avenantRetraitMasse('156','0156175201','lionel');
CALL sp_avenantRetraitMasse('156','0156132601','lionel');
CALL sp_avenantRetraitMasse('156','0156159301','lionel');
CALL sp_avenantRetraitMasse('156','0156156601','lionel');
CALL sp_avenantRetraitMasse('156','0156118701','lionel');

-- 3 -- EMISSION
CALL sp_emissionRetraitMasse('156','lionel');

SELECT * FROM avenant WHERE idPolice='156' ORDER BY id DESC LIMIT 2

SELECT * FROM beneficiaire WHERE idAdherent='3276'


SELECT * FROM beneficiaire WHERE numeroBeneficiaire='0156170301'
	