static public void GetMonthlyFigures(int monthNum, int year, FlowLayoutPanel panel, string BreifOrFull, MonthlyReports reports) { double income = 0; double outgoing = 0; double profit; Dictionary <string, Double> expenses = GetMonthOutgoingByCategory(monthNum, year); if (monthNum == 13) { income = GetAccounts("SELECT Amount From tblIncome where YEAR(Date) = @year", monthNum, year); outgoing = GetAccounts("SELECT Amount From tblOutgoing where YEAR(Date) = @year", monthNum, year); //CreateHeaderLabel("Total", fl13); } else { income = GetAccounts("SELECT Amount From tblIncome where MONTH(Date) = @month AND YEAR(Date) = @year", monthNum, year); outgoing = GetAccounts("SELECT Amount From tblOutgoing where MONTH(Date) = @month AND YEAR(Date) = @year", monthNum, year); } profit = income - outgoing; profit = Math.Round(profit, 2); reports.totalIn += income; reports.totalOut += outgoing; reports.orders += GetSalesThisMonth(monthNum, year); reports.itemsSold += (ItemsSoldInMonth(monthNum, year)); Helper.CreateLabel(GetSalesThisMonth(monthNum, year).ToString(), panel, "None", "BlackAlignCenter"); Helper.CreateLabel(ItemsSoldInMonth(monthNum, year).ToString(), panel, "None", "BlackAlignCenter"); Helper.CreateLabel("£" + income.ToString(), panel, "None", "BlackAlignCenter12"); if (BreifOrFull == "Full") { Helper.CreateLabel("", panel, "None", "BlackAlignCenter12"); DataTable expenseCategory = DatabaseAssist.CreateDataTable("Select CategoryName From tblOutgoingCategory Order by CategoryName Asc", 1, 1); Helper.ChangeBackgoundColour = false; for (int i = 0; i < expenseCategory.Rows.Count; i++) { double cost = Convert.ToDouble(DatabaseAssist.GetOneCellValue("Select Category, SUM(Amount) as Amount From tblOutgoing Where MONTH(Date) = @param And YEAR(Date) =@param2 And Category = @param3 GROUP BY Category ", monthNum, year, expenseCategory.Rows[i]["CategoryName"].ToString(), "Amount")); reports.AddToTotal(i, cost); Helper.CreateLabel("£" + cost, panel, "None", "BlackAlignLeftItalic"); } } Helper.CreateLabel("£" + outgoing, panel, "None", ""); Helper.CreateLabel("£" + profit, panel, "None", "MoneyRedGreen"); }