$payments ? "A payment is deleted from its invoice - tick other income to delete it here." : 'Tick the income to delete first.']); exit; } $total = []; $sql = mysqli_query($mysqli, "SELECT revenue_currency_code, SUM(revenue_amount) FROM revenues WHERE revenue_id IN (" . implode(',', $ids['revenue']) . ") AND revenue_archived_at IS NULL AND " . incomeRevenueSql('revenue_id') . ' ' . clientScopeSql('revenue_client_id') . " GROUP BY revenue_currency_code"); while ($row = mysqli_fetch_row($sql)) { $total[] = billingMoney($row[1], $row[0]); } ob_start(); ?>