updated zenova custom report

This commit is contained in:
Abhijit 2026-11-05 13:15:04 +05:30
parent e084690999
commit d027721a73
1 changed files with 6 additions and 4 deletions

View File

@ -1,12 +1,14 @@
export const REPORT_TIMEOUT = 120000; export const REPORT_TIMEOUT = 120000;
const DAY_METRICS = ['GLIPIQ Total Rx', 'ABSI Camp Count', 'Patients Screened Count', 'Sitazit Total RX']; const DAY_METRICS = ['Glipiq Total Invoice Count', 'Obesity Strength Invoice Count', 'ABSI Camp Count', 'Patients Screened Count', 'Sitazit Total RX'];
const PERIOD_METRICS = [ const PERIOD_METRICS = [
'GLIPIQ Total Rx', 'Glipiq Total Invoice Count',
'Obesity Strength Invoice Count',
'GLIPIQ New Conversion', 'GLIPIQ New Conversion',
'ABSI Camp Count', 'ABSI Camp Count',
'Patients Screened Count', 'Patients Screened Count',
'GLIPIQ Total POB Units', 'GLIPIQ Total POB Units',
'Obesity Strength POB Units',
'Sitazit Total RX', 'Sitazit Total RX',
'Sitazit New Conversions', 'Sitazit New Conversions',
'Sitazit Total POB Units', 'Sitazit Total POB Units',
@ -14,9 +16,9 @@ const PERIOD_METRICS = [
const GEO_TYPES = ['Zone', 'Region', 'Area']; const GEO_TYPES = ['Zone', 'Region', 'Area'];
export function reportMonths(now = new Date()) { export function reportMonths(now = new Date()) {
const startYear = now.getMonth() >= 3 ? now.getFullYear() : now.getFullYear() - 1; const startYear = now.getMonth() >= 9 ? now.getFullYear() : now.getFullYear() - 1;
const months = []; const months = [];
const cursor = new Date(startYear, 3, 1); const cursor = new Date(startYear, 9, 1);
const end = new Date(now.getFullYear(), now.getMonth(), 1); const end = new Date(now.getFullYear(), now.getMonth(), 1);
while (cursor <= end) { while (cursor <= end) {
const value = `${cursor.getFullYear()}-${String(cursor.getMonth() + 1).padStart(2, '0')}`; const value = `${cursor.getFullYear()}-${String(cursor.getMonth() + 1).padStart(2, '0')}`;