Class PayablesReportsController
- Namespace
- KadicErp.WebApi.Controllers.AdminReporting.Reports
- Assembly
- KadicErp.WebApi.dll
[ApiController]
public class PayablesReportsController : ControllerBase
- Inheritance
-
objectControllerBasePayablesReportsController
Constructors
PayablesReportsController(IMediator, IReportExportService)
public PayablesReportsController(IMediator mediator, IReportExportService exportService)
Parameters
mediatorIMediatorexportServiceIReportExportService
Methods
Export(ReportExportRequest)
Exports a payables report as CSV, Excel, or PDF. Pass report=aging|payment-history|withholding-summary. SupplierId carries supplierAccountId.
[HttpPost("api/admin-reporting/reports/payables/export")]
[Authorize(Policy = "ADMIN_REPORTING_REPORTS_EXPORT")]
public Task<IActionResult> Export(ReportExportRequest request)
Parameters
requestReportExportRequest
Returns
- Task<IActionResult>
GetApAging(Guid?, Guid?, int, int)
Returns open invoices with aging buckets (Current, 1-30, 31-60, 61-90, 90+) and days past due. Optionally filter by supplierAccountId.
[HttpGet("api/admin-reporting/reports/payables/aging")]
[Authorize(Policy = "ADMIN_REPORTING_REPORTS_PAYABLES_VIEW")]
public Task<IActionResult> GetApAging(Guid? branchId, Guid? supplierAccountId, int page = 1, int pageSize = 50)
Parameters
branchIdGuid?supplierAccountIdGuid?pageintpageSizeint
Returns
- Task<IActionResult>
GetPayablesSummary(Guid?)
Returns aggregated AP KPIs: total open, overdue, current, due this week/month with 30-day trend.
[HttpGet("api/admin-reporting/reports/payables/summary")]
[Authorize(Policy = "ADMIN_REPORTING_REPORTS_PAYABLES_VIEW")]
public Task<IActionResult> GetPayablesSummary(Guid? branchId)
Parameters
branchIdGuid?
Returns
- Task<IActionResult>
GetPaymentHistory(Guid?, DateOnly?, DateOnly?, Guid?, int, int)
Returns posted supplier payments with applied invoice count, withholding totals, and net amounts.
[HttpGet("api/admin-reporting/reports/payables/payment-history")]
[Authorize(Policy = "ADMIN_REPORTING_REPORTS_PAYABLES_VIEW")]
public Task<IActionResult> GetPaymentHistory(Guid? branchId, DateOnly? dateFrom, DateOnly? dateTo, Guid? supplierAccountId, int page = 1, int pageSize = 50)
Parameters
branchIdGuid?dateFromDateOnly?dateToDateOnly?supplierAccountIdGuid?pageintpageSizeint
Returns
- Task<IActionResult>
GetSupplierStatement(Guid?, Guid, DateOnly?, DateOnly?, int, int)
Returns a per-supplier ledger with invoices as debits, payments as credits, and a running balance. supplierAccountId is required.
[HttpGet("api/admin-reporting/reports/payables/supplier-statement")]
[Authorize(Policy = "ADMIN_REPORTING_REPORTS_PAYABLES_VIEW")]
public Task<IActionResult> GetSupplierStatement(Guid? branchId, Guid supplierAccountId, DateOnly? dateFrom, DateOnly? dateTo, int page = 1, int pageSize = 50)
Parameters
branchIdGuid?supplierAccountIdGuiddateFromDateOnly?dateToDateOnly?pageintpageSizeint
Returns
- Task<IActionResult>
GetWithholdingSummary(Guid?, DateOnly?, DateOnly?, int, int)
Returns withholding totals grouped by supplier and withholding type (ISR / ITBIS), with base and withheld amounts.
[HttpGet("api/admin-reporting/reports/payables/withholding-summary")]
[Authorize(Policy = "ADMIN_REPORTING_REPORTS_PAYABLES_VIEW")]
public Task<IActionResult> GetWithholdingSummary(Guid? branchId, DateOnly? dateFrom, DateOnly? dateTo, int page = 1, int pageSize = 50)
Parameters
branchIdGuid?dateFromDateOnly?dateToDateOnly?pageintpageSizeint
Returns
- Task<IActionResult>