Differences From Artifact [819dc3ea62]:

To Artifact [40cb96972d]:


147
148
149
150
151
152
153

154

155

156
157
158
159
160
161
162

        // Vérification que l'on peut éditer cette opération
        if (!$this->_checkOpenExercice($db->simpleQuerySingle('SELECT id_exercice FROM compta_journal WHERE id = ?;', false, $id)))
        {
            throw new UserException('Cette opération fait partie d\'un exercice qui a été clôturé.');
        }


        $db->simpleExec('DELETE FROM membres_operations WHERE id_operation = ?;', (int)$id);

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


        return true;
    }

    public function get($id)
    {
        $db = DB::getInstance();







>

>

>







147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165

        // Vérification que l'on peut éditer cette opération
        if (!$this->_checkOpenExercice($db->simpleQuerySingle('SELECT id_exercice FROM compta_journal WHERE id = ?;', false, $id)))
        {
            throw new UserException('Cette opération fait partie d\'un exercice qui a été clôturé.');
        }

        $db->exec('BEGIN;');
        $db->simpleExec('DELETE FROM membres_operations WHERE id_operation = ?;', (int)$id);
        $db->simpleExec('DELETE FROM compta_rapprochement WHERE operation = ?;', (int)$id);
        $db->simpleExec('DELETE FROM compta_journal WHERE id = ?;', (int)$id);
        $db->exec('END;');

        return true;
    }

    public function get($id)
    {
        $db = DB::getInstance();