diff options
author | Romain d'Alverny <rda@mageia.org> | 2012-07-02 10:25:58 +0000 |
---|---|---|
committer | Romain d'Alverny <rda@mageia.org> | 2012-07-02 10:25:58 +0000 |
commit | 904cc09202fa24553d6cd5f065661d52268b26f8 (patch) | |
tree | 3bf754fd3d24ea245af779ec909818ea96639bb7 /en/about | |
parent | 4ccee5f7f5678404768d7848e83671d3dda6cc70 (diff) | |
download | www-904cc09202fa24553d6cd5f065661d52268b26f8.tar www-904cc09202fa24553d6cd5f065661d52268b26f8.tar.gz www-904cc09202fa24553d6cd5f065661d52268b26f8.tar.bz2 www-904cc09202fa24553d6cd5f065661d52268b26f8.tar.xz www-904cc09202fa24553d6cd5f065661d52268b26f8.zip |
compute income statement (rough)
Diffstat (limited to 'en/about')
-rw-r--r-- | en/about/reports/template.php | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/en/about/reports/template.php b/en/about/reports/template.php index e04b5a8ae..d9bb5aaee 100644 --- a/en/about/reports/template.php +++ b/en/about/reports/template.php @@ -261,11 +261,20 @@ $flow['revenue_op'] = $count; <td class="money"><?php echo number_format(str_replace(',', '.', $parsed['# Income Statement > ## Revenues']['Total of revenues']), 2, '.', ','); ?></td> <td>Total of expenses</td> <td class="money"><?php echo number_format(str_replace(',', '.', $parsed['# Income Statement > ## Expenses']['Total of expenses']), 2, '.', ','); ?></td> - </tr> - <tr><td colspan="2"></td> + </tr> + <tr> + <?php + $result = $parsed['# Income Statement > ## Revenues']['Total of revenues'] - $parsed['# Income Statement > ## Expenses']['Total of expenses']; + if ($result > 0): + ?> + <td colspan="2"></td> <td>Net Income</td> - <td class="money"><?php echo number_format(str_replace(',', '.', $parsed['# Income Statement > ## Expenses']['Net Income']), 2, '.', ','); ?></td> - </tr> + <td class="money"><?php echo number_format(str_replace(',', '.', $result), 2, '.', ','); ?></td> + <?php else: ?> + <td>Net Loss</td> + <td class="money"><?php echo number_format(str_replace(',', '.', $result), 2, '.', ','); ?></td> + <?php endif; ?> + </tr> </tfoot> </table> </section> @@ -340,6 +349,7 @@ $flow['revenue_op'] = $count; $sums['count'] > 0 ? number_format(str_replace(',', '.', $sums['total'] / $sums['count']), 2, '.', ',') : '' ); echo '</tfoot></table>'; + $total_expenses = $sums['total']; ?> <h3>Details</h3> @@ -458,6 +468,7 @@ $flow['revenue_op'] = $count; number_format(str_replace(',', '.', $sums['cash']), 2, '.', ','), $sums['count'] > 0 ? number_format(str_replace(',', '.', $sums['total'] / $sums['count']), 2, '.', ',') : '' ); + $total_revenues = $sums['total']; echo '</tfoot></table>'; echo <<<S <script type="text/javascript"> |