Overview
Comment:Quand on supprime une cotisation on veut aussi supprimer les rappels liés.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 2404bb932f1b3113ad2971d74de78509ddf672b5
User & Date: bohwaz on 2016-05-31 05:40:33
Other Links: manifest | tags
References
2020-12-08
23:25 Wiki page "Changelog/0.9" artifact: b9c916b4d1 user: bohwaz
Context
2016-05-31
05:40
Fix SQL syntaxe invalide, boulet. check-in: 1711419c1c user: bohwaz tags: trunk
05:40
Quand on supprime une cotisation on veut aussi supprimer les rappels liés. check-in: 2404bb932f user: bohwaz tags: trunk
05:38
Encore des soucis de foreign keys: il faut permettre de mettre id_auteur à NULL pour pouvoir supprimer des membres qui ont fait des rapprochements. check-in: 795737be8a user: bohwaz tags: trunk
Changes

Modified src/include/lib/Garradin/Cotisations.php from [c70e00c4d9] to [f70e628896].

119
120
121
122
123
124
125



126
127
128
129
130
131
132

		$db->exec('BEGIN;');

		// Inscrire à NULL les opérations liées à cette cotisation, ainsi on conserve le lien avec les membres
		$db->simpleExec('UPDATE membres_operations SET id_cotisation = NULL 
			WHERE id_cotisation IN (SELECT id FROM cotisations_membres WHERE id_cotisation = ?);', (int) $id);




		$db->simpleExec('DELETE FROM cotisations_membres WHERE id_cotisation = ?;', (int) $id);
		$db->simpleExec('DELETE FROM cotisations WHERE id = ?;', (int) $id);
		$db->exec('END;');

		return true;
	}








>
>
>







119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135

		$db->exec('BEGIN;');

		// Inscrire à NULL les opérations liées à cette cotisation, ainsi on conserve le lien avec les membres
		$db->simpleExec('UPDATE membres_operations SET id_cotisation = NULL 
			WHERE id_cotisation IN (SELECT id FROM cotisations_membres WHERE id_cotisation = ?);', (int) $id);

		$db->simpleExec('DELETE FROM rappels WHERE id_cotisation = ?;', (int) $id);
		$db->simpleExec('DELETE FROM rappels_envoyes WHERE id_cotisation = ?;', (int) $id);

		$db->simpleExec('DELETE FROM cotisations_membres WHERE id_cotisation = ?;', (int) $id);
		$db->simpleExec('DELETE FROM cotisations WHERE id = ?;', (int) $id);
		$db->exec('END;');

		return true;
	}