58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
|
if (!$db->simpleQuerySingle('SELECT 1 FROM compta_comptes_bancaires WHERE id = ?;',
false, $data['banque']))
{
throw new UserException('Le compte bancaire choisi n\'existe pas.');
}
}
if (empty($data['montant']) || !is_numeric($data['montant']))
{
throw new UserException('Le montant indiqué n\'est pas un nombre valide.');
}
}
}
/**
* Enregistrer un événement de cotisation
* @param array $data Tableau des champs à insérer
|
|
|
|
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
|
if (!$db->simpleQuerySingle('SELECT 1 FROM compta_comptes_bancaires WHERE id = ?;',
false, $data['banque']))
{
throw new UserException('Le compte bancaire choisi n\'existe pas.');
}
}
if (!isset($data['montant']) || !is_numeric($data['montant']) || $data['montant'] < 0)
{
throw new UserException('Le montant indiqué n\'est pas un nombre valide : doit être supérieur ou égal à zéro.');
}
}
}
/**
* Enregistrer un événement de cotisation
* @param array $data Tableau des champs à insérer
|
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
|
'date' => $data['date'],
'id_cotisation' => $data['id_cotisation'],
'id_membre' => $data['id_membre'],
]);
$id = $db->lastInsertRowId();
if ($co['id_categorie_compta'] && $co['montant'] > 0)
{
try {
$id_operation = $this->addOperationCompta($id, [
'id_categorie' => $co['id_categorie_compta'],
'libelle' => 'Cotisation (automatique)',
'montant' => $data['montant'],
'date' => $data['date'],
|
|
|
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
|
'date' => $data['date'],
'id_cotisation' => $data['id_cotisation'],
'id_membre' => $data['id_membre'],
]);
$id = $db->lastInsertRowId();
if ($co['id_categorie_compta'] && $data['montant'] > 0)
{
try {
$id_operation = $this->addOperationCompta($id, [
'id_categorie' => $co['id_categorie_compta'],
'libelle' => 'Cotisation (automatique)',
'montant' => $data['montant'],
'date' => $data['date'],
|