mirror of
https://github.com/itflow-org/itflow
synced 2026-02-28 02:44:53 +00:00
Deduplicate sql payment years query
This commit is contained in:
@@ -27,9 +27,6 @@ if(isset($_GET['year'])){
|
||||
//GET unique years from expenses, payments and revenues
|
||||
$sql_payment_years = mysqli_query($mysqli,"SELECT YEAR(expense_date) AS all_years FROM expenses WHERE company_id = $session_company_id UNION DISTINCT SELECT YEAR(payment_date) FROM payments WHERE company_id = $session_company_id UNION DISTINCT SELECT YEAR(revenue_date) FROM revenues WHERE company_id = $session_company_id ORDER BY all_years DESC");
|
||||
|
||||
|
||||
//GET unique years from expenses, payments and revenues
|
||||
$sql_payment_years = mysqli_query($mysqli,"SELECT YEAR(expense_date) AS all_years FROM expenses WHERE company_id = $session_company_id UNION DISTINCT SELECT YEAR(payment_date) FROM payments WHERE company_id = $session_company_id UNION DISTINCT SELECT YEAR(revenue_date) FROM revenues WHERE company_id = $session_company_id ORDER BY all_years DESC");
|
||||
//Define var so it doesnt throw errors in logs
|
||||
$largest_income_month = 0;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user