$output = tally ($dbh, "Ausgaben", $where . "price < 0.0");
$input = tally ($dbh, "Einnahmen", $where . "price > 0.0");
- printf ("<p>Summe Steuern: %.2f", $input["tax"] - $output["tax"]);
+ $foo = $input["tax"] - $output["tax"];
+ printf ("<p>Summe Steuern: %.2f", $foo);
+ if ($foo > 0)
+ echo (" (<strong>Nachzahlung</strong>)");
+ elseif ($foo < 0)
+ echo (" (<strong>Rückzahlung</strong>)");
printf ("<br>Summe netto: %.2f", $input["netto"] - $output["netto"]);
- printf ("<br>Summe brutto: %.2f</p>", $input["brutto"] - $output["brutto"]);
+ $foo = $input["brutto"] - $output["brutto"];
+ printf ("<br>Summe brutto: %.2f</p>", $foo);
+ if ($foo > 0)
+ echo (" (<strong>Gewinn</strong>)");
+ elseif ($foo < 0)
+ echo (" (<strong>Verlust</strong>)");
}
function tally ($dbh, $head, $where)
{
echo ("<div align=\"center\"><table class=\"font\" width=\"80%\" border=\"0\" cellpadding=\"2\" cellspacing=\"0\" summary=\"\">");
- printf ("<tr bgcolor=\"#<colh>\"><th colspan=\"4\"><strong>%s</strong></td></tr>", $head);
+ printf ("<tr bgcolor=\"#<colh>\"><th colspan=\"4\" align=\"left\"><strong>%s</strong></td></tr>", $head);
printf ("<tr bgcolor=\"#<colh>\">"
."<th width=\"10%%\">%%</th>"
."<th width=\"30%%\">Steuer</th>"