killbill-memoizeit

analytics: add invoice and invoice item reports Signed-off-by:

5/17/2013 8:56:18 PM

Details

diff --git a/osgi-bundles/bundles/analytics/src/main/resources/reports/analytics.ini b/osgi-bundles/bundles/analytics/src/main/resources/reports/analytics.ini
index f3190b7..4396719 100644
--- a/osgi-bundles/bundles/analytics/src/main/resources/reports/analytics.ini
+++ b/osgi-bundles/bundles/analytics/src/main/resources/reports/analytics.ini
@@ -36,6 +36,22 @@ prettyName = Conversions per day
 tableName = v_cancellations_per_day
 prettyName = Effective cancellations per day
 
+[invoices_per_day]
+tableName = v_invoices_per_day
+prettyName = Invoices
+
+[invoice_adjustments_per_day]
+tableName = v_invoice_adjustments_per_day
+prettyName = Invoice adjustments
+
+[invoice_item_adjustments_per_day]
+tableName = v_invoice_item_adjustments_per_day
+prettyName = Invoice item adjustments
+
+[invoice_item_credits_per_day]
+tableName = v_invoice_item_credits_per_day
+prettyName = Invoice item credits
+
 [payments_per_day]
 tableName = v_payments_per_day
 prettyName = Payments
diff --git a/osgi-bundles/bundles/analytics/src/main/resources/reports/invoice_adjustments_per_day.sql b/osgi-bundles/bundles/analytics/src/main/resources/reports/invoice_adjustments_per_day.sql
new file mode 100644
index 0000000..038f4e8
--- /dev/null
+++ b/osgi-bundles/bundles/analytics/src/main/resources/reports/invoice_adjustments_per_day.sql
@@ -0,0 +1,10 @@
+create or replace view v_invoice_adjustments_per_day as
+select
+  currency as pivot
+, date_format(created_date, '%Y-%m-%d') as day
+, sum(amount) as count
+from bia
+where report_group = 'default'
+group by 1, 2
+order by 1, 2 asc
+;
diff --git a/osgi-bundles/bundles/analytics/src/main/resources/reports/invoice_item_adjustments_per_day.sql b/osgi-bundles/bundles/analytics/src/main/resources/reports/invoice_item_adjustments_per_day.sql
new file mode 100644
index 0000000..61e5eb6
--- /dev/null
+++ b/osgi-bundles/bundles/analytics/src/main/resources/reports/invoice_item_adjustments_per_day.sql
@@ -0,0 +1,10 @@
+create or replace view v_invoice_item_adjustments_per_day as
+select
+  currency as pivot
+, date_format(created_date, '%Y-%m-%d') as day
+, sum(amount) as count
+from biia
+where report_group = 'default'
+group by 1, 2
+order by 1, 2 asc
+;
diff --git a/osgi-bundles/bundles/analytics/src/main/resources/reports/invoice_item_credits_per_day.sql b/osgi-bundles/bundles/analytics/src/main/resources/reports/invoice_item_credits_per_day.sql
new file mode 100644
index 0000000..b933bfb
--- /dev/null
+++ b/osgi-bundles/bundles/analytics/src/main/resources/reports/invoice_item_credits_per_day.sql
@@ -0,0 +1,10 @@
+create or replace view v_invoice_item_credits_per_day as
+select
+  currency as pivot
+, date_format(created_date, '%Y-%m-%d') as day
+, sum(amount) as count
+from biic
+where report_group = 'default'
+group by 1, 2
+order by 1, 2 asc
+;
diff --git a/osgi-bundles/bundles/analytics/src/main/resources/reports/invoices_per_day.sql b/osgi-bundles/bundles/analytics/src/main/resources/reports/invoices_per_day.sql
new file mode 100644
index 0000000..d353839
--- /dev/null
+++ b/osgi-bundles/bundles/analytics/src/main/resources/reports/invoices_per_day.sql
@@ -0,0 +1,10 @@
+create or replace view v_invoices_per_day as
+select
+  currency as pivot
+, date_format(created_date, '%Y-%m-%d') as day
+, sum(original_amount_charged) as count
+from bin
+where report_group = 'default'
+group by 1, 2
+order by 1, 2 asc
+;