@@ -8,7 +8,7 @@ namespace ROLAC.API.Services;
|
||||
/// <summary>
|
||||
/// Read-only aggregation that produces the IRS Form 990 Part IX Statement of Functional
|
||||
/// Expenses. Expense scope matches FinanceDashboardService: Paid + Approved only.
|
||||
/// Single function per expense (direct-charge); no cost splitting.
|
||||
/// Each expense line is categorized independently, so one invoice can span multiple lines.
|
||||
/// </summary>
|
||||
public class Form990ReportService : IForm990ReportService
|
||||
{
|
||||
@@ -40,13 +40,14 @@ public class Form990ReportService : IForm990ReportService
|
||||
|
||||
var rows = await (
|
||||
from e in expenses
|
||||
join l in _db.ExpenseLines on e.Id equals l.ExpenseId
|
||||
join m in _db.Ministries on e.MinistryId equals m.Id
|
||||
join sub in _db.ExpenseSubCategories on e.SubCategoryId equals sub.Id
|
||||
join grp in _db.ExpenseCategoryGroups on e.CategoryGroupId equals grp.Id
|
||||
join sub in _db.ExpenseSubCategories on l.SubCategoryId equals sub.Id
|
||||
join grp in _db.ExpenseCategoryGroups on l.CategoryGroupId equals grp.Id
|
||||
select new
|
||||
{
|
||||
e.Amount,
|
||||
e.FunctionalClass,
|
||||
l.Amount,
|
||||
l.FunctionalClass,
|
||||
MinistryDefault = m.DefaultFunctionalClass,
|
||||
SubLineId = sub.Form990LineId,
|
||||
GroupLineId = grp.Form990LineId,
|
||||
|
||||
Reference in New Issue
Block a user