Overview
Comment:Fix: add year to service fees
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | dev | 1.0.0-alpha5
Files: files | file ages | folders
SHA1: af4a573da517f08ffcf1488c4e6e78454150964e
User & Date: bohwaz on 2020-11-08 12:41:09
Other Links: branch diff | manifest | tags
Context
2020-11-08
19:16
Implement "my services" page check-in: 832ba3f247 user: bohwaz tags: dev, 1.0.0-alpha5
12:41
Fix: add year to service fees check-in: af4a573da5 user: bohwaz tags: dev, 1.0.0-alpha5
04:27
Fix wiki link check-in: 966418c7a3 user: bohwaz tags: dev
Changes

Modified src/include/data/1.0.0_migration.sql from [dd9fed4e04] to [f7ccec376e].

112
113
114
115
116
117
118
119
120
121

122
123
124
125
126
127
128
-- Transfert des rapprochements
UPDATE acc_transactions_lines SET reconciled = 1 WHERE id_transaction IN (SELECT id_operation FROM compta_rapprochement);

--------- MIGRATION COTISATIONS ----------

INSERT INTO services SELECT id, intitule, description, duree, debut, fin FROM cotisations;

INSERT INTO services_fees (id, label, amount, id_service, id_account)
	SELECT id, intitule, CAST(montant*100 AS integer), id,
		(SELECT id FROM acc_accounts WHERE code = (SELECT compte FROM compta_categories WHERE id = id_categorie_compta))

	FROM cotisations WHERE montant > 0 OR id_categorie_compta IS NOT NULL;

INSERT INTO services_users SELECT cm.id, cm.id_membre, cm.id_cotisation,
	cm.id_cotisation,
	1,
	NULL,
	cm.date,







|

|
>







112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
-- Transfert des rapprochements
UPDATE acc_transactions_lines SET reconciled = 1 WHERE id_transaction IN (SELECT id_operation FROM compta_rapprochement);

--------- MIGRATION COTISATIONS ----------

INSERT INTO services SELECT id, intitule, description, duree, debut, fin FROM cotisations;

INSERT INTO services_fees (id, label, amount, id_service, id_account, id_year)
	SELECT id, intitule, CAST(montant*100 AS integer), id,
		(SELECT id FROM acc_accounts WHERE code = (SELECT compte FROM compta_categories WHERE id = id_categorie_compta)),
		(SELECT MAX(id) FROM acc_years WHERE closed = 0)
	FROM cotisations WHERE montant > 0 OR id_categorie_compta IS NOT NULL;

INSERT INTO services_users SELECT cm.id, cm.id_membre, cm.id_cotisation,
	cm.id_cotisation,
	1,
	NULL,
	cm.date,