Overview
Comment:Suite [16af9ccf928fd8f199465fdd4e8192c83846d301] simplification du report à nouveau (suggéré par @arf)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 7857bf1593166bbc7e7c1190d3b0ab5cb2224a69
User & Date: bohwaz on 2015-02-14 01:20:19
Other Links: manifest | tags
Context
2015-02-14
01:48
Correction typo check-in: 34e80f5aa5 user: bohwaz tags: trunk
01:20
Suite [16af9ccf928fd8f199465fdd4e8192c83846d301] simplification du report à nouveau (suggéré par @arf) check-in: 7857bf1593 user: bohwaz tags: trunk
2015-02-13
03:35
Vérifions que les comptes existent avant de les utiliser check-in: a0f927b030 user: bohwaz tags: trunk
Changes

Modified src/include/lib/Garradin/Compta/Exercices.php from [e2c23e747c] to [f31307da50].

174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200

            // Solde du compte à zéro : aucun report à faire
            if (empty($solde))
            {
                continue;
            }

            // ce qui est à l'actif est en débit sauf les valeurs négatives
            // ce qui est au passif est en crédit, sauf valeurs négatives
            // cf. ticket [16af9ccf92]
            if ($row['position'] & \Garradin\Compta\Comptes::ACTIF)
            {
                $compte_debit = $solde < 0 ? NULL : $row['compte'];
                $compte_credit = $solde > 0 ? NULL : $row['compte'];
            }
            else
            {
                $compte_debit = $solde > 0 ? NULL : $row['compte'];
                $compte_credit = $solde < 0 ? NULL : $row['compte'];
            }

            $diff += $solde;
            $solde = round(abs($solde), 2);

            // Chaque solde de compte est reporté dans le nouvel exercice
            $journal->add([
                'libelle'       =>  'Report à nouveau',







<
<
<
<
<
|
|
<
<
<
<
<
<







174
175
176
177
178
179
180





181
182






183
184
185
186
187
188
189

            // Solde du compte à zéro : aucun report à faire
            if (empty($solde))
            {
                continue;
            }






            $compte_debit = $solde < 0 ? NULL : $row['compte'];
            $compte_credit = $solde > 0 ? NULL : $row['compte'];







            $diff += $solde;
            $solde = round(abs($solde), 2);

            // Chaque solde de compte est reporté dans le nouvel exercice
            $journal->add([
                'libelle'       =>  'Report à nouveau',