mirror of https://github.com/itflow-org/itflow
Combine Montly Recurring and Yearly Recurring to together to create a new monthly recurring
This commit is contained in:
parent
1bacabc72b
commit
bec2156fa2
|
|
@ -77,16 +77,19 @@ $sql_latest_expenses = mysqli_query(
|
|||
ORDER BY expense_id DESC LIMIT 5"
|
||||
);
|
||||
|
||||
//Get Monthly Recurring Total
|
||||
$sql_recurring_monthly_total = mysqli_query($mysqli, "SELECT SUM(recurring_amount) AS recurring_monthly_total FROM recurring WHERE recurring_status = 1 AND recurring_frequency = 'month'");
|
||||
$row = mysqli_fetch_array($sql_recurring_monthly_total);
|
||||
$recurring_monthly_total = floatval($row['recurring_monthly_total']);
|
||||
|
||||
//Get Yearly Recurring Total
|
||||
$sql_recurring_yearly_total = mysqli_query($mysqli, "SELECT SUM(recurring_amount) AS recurring_yearly_total FROM recurring WHERE recurring_status = 1 AND recurring_frequency = 'year'");
|
||||
$row = mysqli_fetch_array($sql_recurring_yearly_total);
|
||||
$recurring_yearly_total = floatval($row['recurring_yearly_total']);
|
||||
|
||||
//Get Monthly Recurring Total
|
||||
$sql_recurring_monthly_total = mysqli_query($mysqli, "SELECT SUM(recurring_amount) AS recurring_monthly_total FROM recurring WHERE recurring_status = 1 AND recurring_frequency = 'month'");
|
||||
$row = mysqli_fetch_array($sql_recurring_monthly_total);
|
||||
$recurring_monthly_total = floatval($row['recurring_monthly_total']) + ($recurring_yearly_total / 12);
|
||||
|
||||
|
||||
|
||||
|
||||
//Get Total Miles Driven
|
||||
$sql_miles_driven = mysqli_query($mysqli, "SELECT SUM(trip_miles) AS total_miles FROM trips WHERE YEAR(trip_date) = $year");
|
||||
$row = mysqli_fetch_array($sql_miles_driven);
|
||||
|
|
@ -181,20 +184,6 @@ $vendors_added = intval($row['vendors_added']);
|
|||
</div>
|
||||
<!-- ./col -->
|
||||
|
||||
<div class="col-lg-4 col-md-6 col-sm-12">
|
||||
<!-- small box -->
|
||||
<div class="small-box bg-info">
|
||||
<div class="inner">
|
||||
<h3><?php echo numfmt_format_currency($currency_format, $recurring_yearly_total, "$session_company_currency"); ?></h3>
|
||||
<p>Yearly Recurring</p>
|
||||
</div>
|
||||
<div class="icon">
|
||||
<i class="fa fa-sync-alt"></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- ./col -->
|
||||
|
||||
<div class="col-lg-4 col-md-6 col-sm-12">
|
||||
<!-- small box -->
|
||||
<a class="small-box bg-secondary" href="trips.php?dtf=<?php echo $year; ?>-01-01&dtt=<?php echo $year; ?>-12-31">
|
||||
|
|
|
|||
Loading…
Reference in New Issue