Overview
Comment:Correction : ne pas autoriser les comptes vides ou NULL, merci à @zou via le ticket [9c3ea0c6aa8c18405e90b72b8eaf16b253a44612]
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk | stable
Files: files | file ages | folders
SHA1: 1e77de77403c1d1c632dcc7617813c995ede5668
User & Date: bohwaz on 2019-05-10 10:44:44
Other Links: manifest | tags
Context
2019-05-24
09:32
Correction : affichage du champ membre de type date au format français check-in: 1694c75ab2 user: bohwaz tags: trunk, stable
2019-05-10
10:44
Correction : ne pas autoriser les comptes vides ou NULL, merci à @zou via le ticket [9c3ea0c6aa8c18405e90b72b8eaf16b253a44612] check-in: 1e77de7740 user: bohwaz tags: trunk, stable
2019-04-27
22:09
Ne pas rendre le champ email obligatoire par défaut, source d'incompréhension check-in: a88f4cd865 user: bohwaz tags: trunk, stable
Changes

Modified src/include/lib/Garradin/Compta/Import.php from [e0565043bb] to [85a128e4c5].

155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
			{
				continue;
			}

			$debit = $col('Compte de débit - numéro');
			$credit = $col('Compte de crédit - numéro');

			if (trim($debit) == '' && trim($credit) != '')
			{
				$debit = null;
			}
			elseif (trim($debit) != '' && trim($credit) == '')
			{
				$credit = null;
			}

			$cat = $col('Catégorie');
			$moyen = strtoupper(substr($col('Moyen de paiement'), 0, 2));

			if (!$moyen || !array_key_exists($moyen, $liste_moyens))
			{
				$moyen = false;
				$cat = false;







<
<
<
<
<
<
<
<
<







155
156
157
158
159
160
161









162
163
164
165
166
167
168
			{
				continue;
			}

			$debit = $col('Compte de débit - numéro');
			$credit = $col('Compte de crédit - numéro');










			$cat = $col('Catégorie');
			$moyen = strtoupper(substr($col('Moyen de paiement'), 0, 2));

			if (!$moyen || !array_key_exists($moyen, $liste_moyens))
			{
				$moyen = false;
				$cat = false;

Modified src/include/lib/Garradin/Compta/Journal.php from [2a385b6769] to [602c41aa91].

273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
            }
            else
            {
                $data[$champ] = trim($data[$champ]);
            }
        }

        if (!array_key_exists('compte_debit', $data) || 
            (!is_null($data['compte_debit']) && 
                !$db->test('compta_comptes', $db->where('id', $data['compte_debit']))))
        {
            throw new UserException('Compte débité inconnu.');
        }

        if (!array_key_exists('compte_credit', $data) || 
            (!is_null($data['compte_credit']) && 
                !$db->test('compta_comptes', $db->where('id', $data['compte_credit']))))
        {
            throw new UserException('Compte crédité inconnu.');
        }

        $data['compte_credit'] = is_null($data['compte_credit']) ? null : strtoupper(trim($data['compte_credit']));
        $data['compte_debit'] = is_null($data['compte_debit']) ? null : strtoupper(trim($data['compte_debit']));

        if ($data['compte_credit'] == $data['compte_debit'])
        {
            throw new UserException('Compte crédité identique au compte débité.');
        }

        if (isset($data['id_categorie']))







<
<
|




<
<
|




|
|







273
274
275
276
277
278
279


280
281
282
283
284


285
286
287
288
289
290
291
292
293
294
295
296
297
298
            }
            else
            {
                $data[$champ] = trim($data[$champ]);
            }
        }



        if (empty($data['compte_debit']) || !$db->test('compta_comptes', $db->where('id', $data['compte_debit'])))
        {
            throw new UserException('Compte débité inconnu.');
        }



        if (empty($data['compte_credit']) || !$db->test('compta_comptes', $db->where('id', $data['compte_credit'])))
        {
            throw new UserException('Compte crédité inconnu.');
        }

        $data['compte_credit'] = strtoupper(trim($data['compte_credit']));
        $data['compte_debit'] = strtoupper(trim($data['compte_debit']));

        if ($data['compte_credit'] == $data['compte_debit'])
        {
            throw new UserException('Compte crédité identique au compte débité.');
        }

        if (isset($data['id_categorie']))