Skip to content

Commit 230c04e

Browse files
committed
Reports from extracts/finance
1 parent 82a6546 commit 230c04e

2 files changed

Lines changed: 50 additions & 0 deletions

File tree

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Invoice Aging Report
2+
3+
Displays customer invoice balances by aging buckets in both original currency and USD, along with invoice and account details.
4+
5+
The snapshot view is: `v_report_invoice_aging`
6+
7+
## Prerequisites
8+
9+
Run stored proc
10+
11+
## Report Configuration
12+
13+
```
14+
curl -v \
15+
-X POST \
16+
-u admin:password \
17+
-H "X-Killbill-ApiKey:bob" \
18+
-H "X-Killbill-ApiSecret:lazar" \
19+
-H 'Content-Type: application/json' \
20+
-d '{"reportName": "report_invoice_aging",
21+
"reportType": "TABLE",
22+
"reportPrettyName": "Invoice Aging Report",
23+
"sourceTableName": "report_invoice_aging",
24+
"refreshProcedureName": "refresh_report_invoice_aging",
25+
"refreshFrequency": "DAILY"}' \
26+
"http://127.0.0.1:8080/plugins/killbill-analytics/reports"
27+
```
28+
29+
## Report UI:
30+
31+
![invoice-aging.png](invoice-aging.png)
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
create table report_invoices_monthly as select * from v_report_invoices_monthly limit 0;
2+
3+
drop procedure if exists refresh_report_invoices_monthly;
4+
DELIMITER //
5+
CREATE PROCEDURE refresh_report_invoices_monthly()
6+
BEGIN
7+
8+
DECLARE EXIT HANDLER FOR SQLEXCEPTION ROLLBACK;
9+
DECLARE EXIT HANDLER FOR SQLWARNING ROLLBACK;
10+
11+
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
12+
START TRANSACTION;
13+
delete from report_invoices_monthly;
14+
insert into report_invoices_monthly select * from v_report_invoices_monthly;
15+
COMMIT;
16+
17+
END;
18+
//
19+
DELIMITER ;

0 commit comments

Comments
 (0)