Class ReceivablesReportsController
- Namespace
- KadicErp.WebApi.Controllers.AdminReporting.Reports
- Assembly
- KadicErp.WebApi.dll
[ApiController]
public class ReceivablesReportsController : ControllerBase
- Inheritance
-
objectControllerBaseReceivablesReportsController
Constructors
ReceivablesReportsController(IMediator, IReportExportService)
public ReceivablesReportsController(IMediator mediator, IReportExportService exportService)
Parameters
mediatorIMediatorexportServiceIReportExportService
Methods
Export(ReportExportRequest)
Exports a receivables report as CSV, Excel, or PDF. Pass report=aging|customer-statement|dunning-activity. CustomerId carries customerAccountId; Search carries the aging bucket filter.
[HttpPost("api/admin-reporting/reports/receivables/export")]
[Authorize(Policy = "ADMIN_REPORTING_REPORTS_EXPORT")]
public Task<IActionResult> Export(ReportExportRequest request)
Parameters
requestReportExportRequest
Returns
- Task<IActionResult>
GetArAging(Guid?, string?, int, int)
Returns open receivable documents with aging bucket classification. Filter by bucket: CURRENT | 1-30 | 31-60 | 61-90 | 91-120 | 120+
[HttpGet("api/admin-reporting/reports/receivables/aging")]
[Authorize(Policy = "ADMIN_REPORTING_REPORTS_RECEIVABLES_VIEW")]
public Task<IActionResult> GetArAging(Guid? branchId, string? bucket, int page = 1, int pageSize = 50)
Parameters
branchIdGuid?bucketstringpageintpageSizeint
Returns
- Task<IActionResult>
GetCollectionsSummary(Guid?, DateOnly?, DateOnly?)
Returns collection metrics: total collected, receipt count, avg days to collect, and collection efficiency % for the given period.
[HttpGet("api/admin-reporting/reports/receivables/collections-summary")]
[Authorize(Policy = "ADMIN_REPORTING_REPORTS_RECEIVABLES_VIEW")]
public Task<IActionResult> GetCollectionsSummary(Guid? branchId, DateOnly? dateFrom, DateOnly? dateTo)
Parameters
branchIdGuid?dateFromDateOnly?dateToDateOnly?
Returns
- Task<IActionResult>
GetCustomerStatement(Guid, Guid?, DateOnly?, DateOnly?, int, int)
Returns the full subledger ledger for a specific customer account: date, doc#, type, description, debit, credit, running balance.
[HttpGet("api/admin-reporting/reports/receivables/customer-statement")]
[Authorize(Policy = "ADMIN_REPORTING_REPORTS_RECEIVABLES_VIEW")]
public Task<IActionResult> GetCustomerStatement(Guid customerAccountId, Guid? branchId, DateOnly? dateFrom, DateOnly? dateTo, int page = 1, int pageSize = 50)
Parameters
customerAccountIdGuidbranchIdGuid?dateFromDateOnly?dateToDateOnly?pageintpageSizeint
Returns
- Task<IActionResult>
GetDunningActivity(Guid?, DateOnly?, DateOnly?, int, int)
Returns all dunning log entries with customer, level, action type, and date.
[HttpGet("api/admin-reporting/reports/receivables/dunning-activity")]
[Authorize(Policy = "ADMIN_REPORTING_REPORTS_RECEIVABLES_VIEW")]
public Task<IActionResult> GetDunningActivity(Guid? branchId, DateOnly? dateFrom, DateOnly? dateTo, int page = 1, int pageSize = 50)
Parameters
branchIdGuid?dateFromDateOnly?dateToDateOnly?pageintpageSizeint
Returns
- Task<IActionResult>
GetReceivablesSummary(Guid?)
Returns aggregated AR KPIs: total open, overdue, current, advances, aging buckets (0-30, 31-60, 61-90, 91-120, 120+), and top-10 debtors.
[HttpGet("api/admin-reporting/reports/receivables/summary")]
[Authorize(Policy = "ADMIN_REPORTING_REPORTS_RECEIVABLES_VIEW")]
public Task<IActionResult> GetReceivablesSummary(Guid? branchId)
Parameters
branchIdGuid?
Returns
- Task<IActionResult>