mirror of
https://github.com/itflow-org/itflow
synced 2026-07-27 10:47:14 +00:00
Combined Payments and Revenues as one View called income keeps all income in one place and still can add revenue not related to invoice
This commit is contained in:
@@ -304,13 +304,13 @@
|
||||
|
||||
<?php if (lookupUserPermission("module_financial") >= 1) { ?>
|
||||
<li class="nav-item">
|
||||
<a href="/agent/payments.php?client_id=<?php echo $client_id; ?>" class="nav-link <?php if (basename($_SERVER["PHP_SELF"]) == "payments.php") { echo "active"; } ?>">
|
||||
<i class="nav-icon fas fa-credit-card"></i>
|
||||
<a href="/agent/income.php?client_id=<?php echo $client_id; ?>" class="nav-link <?php if (basename($_SERVER["PHP_SELF"]) == "income.php") { echo "active"; } ?>">
|
||||
<i class="nav-icon fas fa-hand-holding-usd"></i>
|
||||
<p>
|
||||
Payments
|
||||
Income
|
||||
<?php
|
||||
if ($num_payments > 0) { ?>
|
||||
<span class="right badge text-light"><?php echo $num_payments; ?></span>
|
||||
if ($num_income > 0) { ?>
|
||||
<span class="right badge text-light"><?php echo $num_income; ?></span>
|
||||
<?php } ?>
|
||||
</p>
|
||||
</a>
|
||||
|
||||
@@ -201,8 +201,11 @@ if (isset($_GET['client_id'])) {
|
||||
$row = mysqli_fetch_assoc(mysqli_query($mysqli, "SELECT COUNT('recurring_invoice_id') AS num FROM recurring_invoices WHERE recurring_invoice_archived_at IS NULL AND recurring_invoice_client_id = $client_id"));
|
||||
$num_recurring_invoices = $row['num'];
|
||||
|
||||
$row = mysqli_fetch_assoc(mysqli_query($mysqli, "SELECT COUNT('payment_id') AS num FROM payments, invoices WHERE payment_invoice_id = invoice_id AND invoice_client_id = $client_id"));
|
||||
$num_payments = $row['num'];
|
||||
$row = mysqli_fetch_assoc(mysqli_query($mysqli, "SELECT
|
||||
(SELECT COUNT(payment_id) FROM payments, invoices WHERE payment_invoice_id = invoice_id AND payment_archived_at IS NULL AND invoice_client_id = $client_id)
|
||||
+ (SELECT COUNT(revenue_id) FROM revenues LEFT JOIN transfers ON transfer_revenue_id = revenue_id WHERE transfer_id IS NULL AND revenue_archived_at IS NULL AND revenue_client_id = $client_id)
|
||||
AS num"));
|
||||
$num_income = $row['num'];
|
||||
|
||||
$row = mysqli_fetch_assoc(mysqli_query($mysqli, "SELECT COUNT('file_id') AS num FROM files WHERE file_archived_at IS NULL AND file_client_id = $client_id"));
|
||||
$num_files = $row['num'];
|
||||
|
||||
@@ -139,15 +139,9 @@
|
||||
<li class="nav-header mt-3">FINANCE</li>
|
||||
<?php if (lookupUserPermission("module_financial") >= 1) { ?>
|
||||
<li class="nav-item">
|
||||
<a href="/agent/payments.php" class="nav-link <?php if (basename($_SERVER["PHP_SELF"]) == "payments.php") { echo "active"; } ?>">
|
||||
<i class="nav-icon fas fa-credit-card"></i>
|
||||
<p>Payments</p>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a href="/agent/revenues.php" class="nav-link <?php if (basename($_SERVER["PHP_SELF"]) == "revenues.php") { echo "active"; } ?>">
|
||||
<a href="/agent/income.php" class="nav-link <?php if (basename($_SERVER["PHP_SELF"]) == "income.php") { echo "active"; } ?>">
|
||||
<i class="nav-icon fas fa-hand-holding-usd"></i>
|
||||
<p>Revenues</p>
|
||||
<p>Income</p>
|
||||
</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
|
||||
Reference in New Issue
Block a user