mirror of https://github.com/itflow-org/itflow
Tidy up the tax report
This commit is contained in:
parent
e433c819a8
commit
5635cd9b8c
|
|
@ -69,48 +69,48 @@ $sql_tax = mysqli_query($mysqli, "SELECT `tax_name` FROM `taxes`");
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<?php
|
<?php
|
||||||
while ($row = mysqli_fetch_array($sql_tax)) {
|
while ($row = mysqli_fetch_array($sql_tax)) {
|
||||||
$tax_name = sanitizeInput($row['tax_name']);
|
$tax_name = sanitizeInput($row['tax_name']);
|
||||||
echo "<tr>";
|
echo "<tr>";
|
||||||
echo "<td>" . $row['tax_name'] . "</td>";
|
echo "<td>" . $row['tax_name'] . "</td>";
|
||||||
|
|
||||||
if ($view == 'monthly') {
|
if ($view == 'monthly') {
|
||||||
for ($i = 1; $i <= 12; $i++) {
|
for ($i = 1; $i <= 12; $i++) {
|
||||||
$monthly_tax = getMonthlyTax($tax_name, $i, $year, $mysqli);
|
$monthly_tax = getMonthlyTax($tax_name, $i, $year, $mysqli);
|
||||||
echo "<td class='text-right'>" . numfmt_format_currency($currency_format, $monthly_tax, $company_currency) . "</td>";
|
echo "<td class='text-right'>" . numfmt_format_currency($currency_format, $monthly_tax, $company_currency) . "</td>";
|
||||||
}
|
|
||||||
} else {
|
|
||||||
for ($q = 1; $q <= 4; $q++) {
|
|
||||||
$quarterly_tax = getQuarterlyTax($tax_name, $q, $year, $mysqli);
|
|
||||||
echo "<td class='text-right'>" . numfmt_format_currency($currency_format, $quarterly_tax, $company_currency) . "</td>";
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
for ($q = 1; $q <= 4; $q++) {
|
||||||
|
$quarterly_tax = getQuarterlyTax($tax_name, $q, $year, $mysqli);
|
||||||
|
echo "<td class='text-right'>" . numfmt_format_currency($currency_format, $quarterly_tax, $company_currency) . "</td>";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Calculate total for row and echo bold
|
// Calculate total for row and echo bold
|
||||||
$total_tax = getTotalTax($tax_name, $year, $mysqli);
|
$total_tax = getTotalTax($tax_name, $year, $mysqli);
|
||||||
echo "<td class='text-right text-bold'>" . numfmt_format_currency($currency_format, $total_tax, $company_currency) . "</td>";
|
echo "<td class='text-right text-bold'>" . numfmt_format_currency($currency_format, $total_tax, $company_currency) . "</td>";
|
||||||
echo "</tr>";
|
echo "</tr>";
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
<tr>
|
||||||
|
<th>Total</th>
|
||||||
|
<?php
|
||||||
|
if ($view == 'monthly') {
|
||||||
|
for ($i = 1; $i <= 12; $i++) {
|
||||||
|
$monthly_tax = getMonthlyTax($tax_name, $i, $year, $mysqli);
|
||||||
|
echo "<th class='text-right'>" . numfmt_format_currency($currency_format, $monthly_tax, $company_currency) . "</th>";
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
for ($q = 1; $q <= 4; $q++) {
|
||||||
|
$quarterly_tax = getQuarterlyTax($tax_name, $q, $year, $mysqli);
|
||||||
|
echo "<th class='text-right'>" . numfmt_format_currency($currency_format, $quarterly_tax, $company_currency) . "</th>";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
<tr>
|
<td></td>
|
||||||
<th>Total</th>
|
</tr>
|
||||||
<?php
|
|
||||||
if ($view == 'monthly') {
|
|
||||||
for ($i = 1; $i <= 12; $i++) {
|
|
||||||
$monthly_tax = getMonthlyTax($tax_name, $i, $year, $mysqli);
|
|
||||||
echo "<th class='text-right'>" . numfmt_format_currency($currency_format, $monthly_tax, $company_currency) . "</th>";
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
for ($q = 1; $q <= 4; $q++) {
|
|
||||||
$quarterly_tax = getQuarterlyTax($tax_name, $q, $year, $mysqli);
|
|
||||||
echo "<th class='text-right'>" . numfmt_format_currency($currency_format, $quarterly_tax, $company_currency) . "</th>";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
?>
|
|
||||||
<td></td>
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue