Overview
Comment: | bon positionnement des reports à nouveau selon actif/passif |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: |
544747b54285e9e2a85e955f533af120 |
User & Date: | bohwaz on 2014-02-12 14:09:11 |
Other Links: | manifest | tags |
Context
2014-02-12
| ||
14:14 | Debug des arguments check-in: dd669f5faa user: bohwaz tags: trunk | |
14:09 | bon positionnement des reports à nouveau selon actif/passif check-in: 544747b542 user: bohwaz tags: trunk | |
13:56 | Ne pas faire de report à nouveau pour les soldes nuls check-in: 3f1fa166ed user: bohwaz tags: trunk | |
Changes
Modified src/include/class.compta_exercices.php from [7388ed724c] to [45811f4d52].
︙ | ︙ | |||
150 151 152 153 154 155 156 | GROUP BY compta_comptes.id;', array('id' => $old_id)); $diff = 0; $journal = new Compta_Journal; while ($row = $statement->fetchArray(SQLITE3_ASSOC)) { | | > > | 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 | GROUP BY compta_comptes.id;', array('id' => $old_id)); $diff = 0; $journal = new Compta_Journal; while ($row = $statement->fetchArray(SQLITE3_ASSOC)) { $solde = ($row['position'] & Compta_Comptes::ACTIF) ? abs($row['solde']) : -abs($row['solde']); $solde = round($solde, 2); $diff += $solde; if (empty($solde)) { continue; } // Chaque solde de compte est reporté dans le nouvel exercice $journal->add(array( 'libelle' => 'Report à nouveau', 'date' => $date, 'montant' => abs($solde), 'compte_debit' => ($solde < 0 ? NULL : $row['compte']), 'compte_credit' => ($solde > 0 ? NULL : $row['compte']), 'remarques' => 'Report de solde créé automatiquement à la clôture de l\'exercice précédent', )); } // FIXME utiliser $diff pour équilibrer $db->exec('END;'); return true; } /** * Solder les comptes de charge et de produits de l'exercice N |
︙ | ︙ |