import calendar
from _decimal import Decimal

from django.db.models import Q

from claim.models import Claim, ClaimDetail
from core.datetimes.ad_datetime import date
from location.models import Location, HealthFacility
from product.models import Product

template = """
{
    "docElements": [
        {
            "elementType": "text",
            "id": 3,
            "containerId": "0_header",
            "x": 120,
            "y": 20,
            "width": 575,
            "height": 40,
            "content": "Claims - Primary Operational Indicators",
            "richText": false,
            "richTextContent": null,
            "richTextHtml": "",
            "eval": false,
            "styleId": "",
            "bold": true,
            "italic": false,
            "underline": false,
            "strikethrough": false,
            "horizontalAlignment": "center",
            "verticalAlignment": "middle",
            "textColor": "#006374",
            "backgroundColor": "",
            "font": "notosans",
            "fontSize": "24",
            "lineSpacing": 1,
            "borderColor": "#000000",
            "borderWidth": 1,
            "borderAll": false,
            "borderLeft": false,
            "borderTop": false,
            "borderRight": false,
            "borderBottom": false,
            "paddingLeft": 2,
            "paddingTop": 2,
            "paddingRight": 2,
            "paddingBottom": 2,
            "printIf": "",
            "removeEmptyElement": false,
            "alwaysPrintOnSamePage": true,
            "pattern": "",
            "link": "",
            "cs_condition": "",
            "cs_styleId": "",
            "cs_bold": false,
            "cs_italic": false,
            "cs_underline": false,
            "cs_strikethrough": false,
            "cs_horizontalAlignment": "left",
            "cs_verticalAlignment": "top",
            "cs_textColor": "#000000",
            "cs_backgroundColor": "",
            "cs_font": "helvetica",
            "cs_fontSize": 12,
            "cs_lineSpacing": 1,
            "cs_borderColor": "#000000",
            "cs_borderWidth": "1",
            "cs_borderAll": false,
            "cs_borderLeft": false,
            "cs_borderTop": false,
            "cs_borderRight": false,
            "cs_borderBottom": false,
            "cs_paddingLeft": 2,
            "cs_paddingTop": 2,
            "cs_paddingRight": 2,
            "cs_paddingBottom": 2,
            "spreadsheet_hide": false,
            "spreadsheet_column": "",
            "spreadsheet_colspan": "",
            "spreadsheet_addEmptyRow": false,
            "spreadsheet_textWrap": false
        },
        {
            "elementType": "line",
            "id": 158,
            "containerId": "0_content",
            "x": 0,
            "y": 0,
            "width": 820,
            "height": 1,
            "color": "#000000",
            "printIf": ""
        },
        {
            "elementType": "table",
            "id": 297,
            "containerId": "0_content",
            "width": 630,
            "x": 100,
            "y": 181,
            "dataSource": "",
            "columns": "2",
            "header": false,
            "contentRows": "1",
            "footer": false,
            "border": "grid",
            "borderColor": "#000000",
            "borderWidth": "1",
            "printIf": "${error}",
            "removeEmptyElement": false,
            "spreadsheet_hide": false,
            "spreadsheet_column": "",
            "spreadsheet_addEmptyRow": false,
            "headerData": {
                "elementType": "none",
                "id": 298,
                "height": 20,
                "backgroundColor": "",
                "repeatHeader": false,
                "columnData": [
                    {
                        "elementType": "table_text",
                        "id": 299,
                        "width": 260,
                        "content": "",
                        "eval": false,
                        "colspan": "",
                        "styleId": "",
                        "bold": false,
                        "italic": false,
                        "underline": false,
                        "strikethrough": false,
                        "horizontalAlignment": "left",
                        "verticalAlignment": "top",
                        "textColor": "#000000",
                        "backgroundColor": "",
                        "font": "helvetica",
                        "fontSize": 12,
                        "lineSpacing": 1,
                        "paddingLeft": 2,
                        "paddingTop": 2,
                        "paddingRight": 2,
                        "paddingBottom": 2,
                        "pattern": "",
                        "link": "",
                        "cs_condition": "",
                        "cs_styleId": "",
                        "cs_bold": false,
                        "cs_italic": false,
                        "cs_underline": false,
                        "cs_strikethrough": false,
                        "cs_horizontalAlignment": "left",
                        "cs_verticalAlignment": "top",
                        "cs_textColor": "#000000",
                        "cs_backgroundColor": "",
                        "cs_font": "helvetica",
                        "cs_fontSize": 12,
                        "cs_lineSpacing": 1,
                        "cs_paddingLeft": 2,
                        "cs_paddingTop": 2,
                        "cs_paddingRight": 2,
                        "cs_paddingBottom": 2,
                        "spreadsheet_textWrap": false,
                        "printIf": "",
                        "growWeight": 0,
                        "borderWidth": 1
                    },
                    {
                        "elementType": "table_text",
                        "id": 300,
                        "width": 370,
                        "content": "",
                        "eval": false,
                        "colspan": "",
                        "styleId": "",
                        "bold": false,
                        "italic": false,
                        "underline": false,
                        "strikethrough": false,
                        "horizontalAlignment": "left",
                        "verticalAlignment": "top",
                        "textColor": "#000000",
                        "backgroundColor": "",
                        "font": "helvetica",
                        "fontSize": 12,
                        "lineSpacing": 1,
                        "paddingLeft": 2,
                        "paddingTop": 2,
                        "paddingRight": 2,
                        "paddingBottom": 2,
                        "pattern": "",
                        "link": "",
                        "cs_condition": "",
                        "cs_styleId": "",
                        "cs_bold": false,
                        "cs_italic": false,
                        "cs_underline": false,
                        "cs_strikethrough": false,
                        "cs_horizontalAlignment": "left",
                        "cs_verticalAlignment": "top",
                        "cs_textColor": "#000000",
                        "cs_backgroundColor": "",
                        "cs_font": "helvetica",
                        "cs_fontSize": 12,
                        "cs_lineSpacing": 1,
                        "cs_paddingLeft": 2,
                        "cs_paddingTop": 2,
                        "cs_paddingRight": 2,
                        "cs_paddingBottom": 2,
                        "spreadsheet_textWrap": false,
                        "printIf": "",
                        "growWeight": 0,
                        "borderWidth": 1
                    }
                ]
            },
            "contentDataRows": [
                {
                    "elementType": "none",
                    "id": 301,
                    "height": 20,
                    "backgroundColor": "",
                    "alternateBackgroundColor": "",
                    "groupExpression": "",
                    "printIf": "",
                    "alwaysPrintOnSamePage": true,
                    "pageBreak": false,
                    "repeatGroupHeader": false,
                    "columnData": [
                        {
                            "elementType": "table_text",
                            "id": 302,
                            "width": 260,
                            "content": "${error}",
                            "eval": false,
                            "colspan": "2",
                            "styleId": "307",
                            "bold": true,
                            "italic": false,
                            "underline": false,
                            "strikethrough": false,
                            "horizontalAlignment": "center",
                            "verticalAlignment": "middle",
                            "textColor": "#ff0000",
                            "backgroundColor": "",
                            "font": "notosans",
                            "fontSize": "16",
                            "lineSpacing": 1,
                            "paddingLeft": 2,
                            "paddingTop": 2,
                            "paddingRight": 2,
                            "paddingBottom": 2,
                            "pattern": "",
                            "link": "",
                            "cs_condition": "",
                            "cs_styleId": "",
                            "cs_bold": false,
                            "cs_italic": false,
                            "cs_underline": false,
                            "cs_strikethrough": false,
                            "cs_horizontalAlignment": "left",
                            "cs_verticalAlignment": "top",
                            "cs_textColor": "#000000",
                            "cs_backgroundColor": "",
                            "cs_font": "helvetica",
                            "cs_fontSize": 12,
                            "cs_lineSpacing": 1,
                            "cs_paddingLeft": 2,
                            "cs_paddingTop": 2,
                            "cs_paddingRight": 2,
                            "cs_paddingBottom": 2,
                            "spreadsheet_textWrap": false,
                            "borderWidth": 1,
                            "growWeight": 0
                        },
                        {
                            "elementType": "table_text",
                            "id": 303,
                            "width": 370,
                            "content": "${error}",
                            "eval": false,
                            "colspan": "",
                            "styleId": "",
                            "bold": true,
                            "italic": false,
                            "underline": false,
                            "strikethrough": false,
                            "horizontalAlignment": "left",
                            "verticalAlignment": "middle",
                            "textColor": "#ff0000",
                            "backgroundColor": "",
                            "font": "helvetica",
                            "fontSize": 12,
                            "lineSpacing": 1,
                            "paddingLeft": 2,
                            "paddingTop": 2,
                            "paddingRight": 2,
                            "paddingBottom": 2,
                            "pattern": "",
                            "link": "",
                            "cs_condition": "",
                            "cs_styleId": "",
                            "cs_bold": false,
                            "cs_italic": false,
                            "cs_underline": false,
                            "cs_strikethrough": false,
                            "cs_horizontalAlignment": "left",
                            "cs_verticalAlignment": "top",
                            "cs_textColor": "#000000",
                            "cs_backgroundColor": "",
                            "cs_font": "helvetica",
                            "cs_fontSize": 12,
                            "cs_lineSpacing": 1,
                            "cs_paddingLeft": 2,
                            "cs_paddingTop": 2,
                            "cs_paddingRight": 2,
                            "cs_paddingBottom": 2,
                            "spreadsheet_textWrap": false,
                            "borderWidth": 1,
                            "growWeight": 0
                        }
                    ]
                }
            ],
            "footerData": {
                "elementType": "none",
                "id": 304,
                "height": 20,
                "backgroundColor": "",
                "columnData": [
                    {
                        "elementType": "table_text",
                        "id": 305,
                        "width": 260,
                        "content": "",
                        "eval": false,
                        "colspan": "",
                        "styleId": "",
                        "bold": false,
                        "italic": false,
                        "underline": false,
                        "strikethrough": false,
                        "horizontalAlignment": "left",
                        "verticalAlignment": "top",
                        "textColor": "#000000",
                        "backgroundColor": "",
                        "font": "helvetica",
                        "fontSize": 12,
                        "lineSpacing": 1,
                        "paddingLeft": 2,
                        "paddingTop": 2,
                        "paddingRight": 2,
                        "paddingBottom": 2,
                        "pattern": "",
                        "link": "",
                        "cs_condition": "",
                        "cs_styleId": "",
                        "cs_bold": false,
                        "cs_italic": false,
                        "cs_underline": false,
                        "cs_strikethrough": false,
                        "cs_horizontalAlignment": "left",
                        "cs_verticalAlignment": "top",
                        "cs_textColor": "#000000",
                        "cs_backgroundColor": "",
                        "cs_font": "helvetica",
                        "cs_fontSize": 12,
                        "cs_lineSpacing": 1,
                        "cs_paddingLeft": 2,
                        "cs_paddingTop": 2,
                        "cs_paddingRight": 2,
                        "cs_paddingBottom": 2,
                        "spreadsheet_textWrap": false,
                        "borderWidth": 1,
                        "growWeight": 0
                    },
                    {
                        "elementType": "table_text",
                        "id": 306,
                        "width": 370,
                        "content": "",
                        "eval": false,
                        "colspan": "",
                        "styleId": "",
                        "bold": false,
                        "italic": false,
                        "underline": false,
                        "strikethrough": false,
                        "horizontalAlignment": "left",
                        "verticalAlignment": "top",
                        "textColor": "#000000",
                        "backgroundColor": "",
                        "font": "helvetica",
                        "fontSize": 12,
                        "lineSpacing": 1,
                        "paddingLeft": 2,
                        "paddingTop": 2,
                        "paddingRight": 2,
                        "paddingBottom": 2,
                        "pattern": "",
                        "link": "",
                        "cs_condition": "",
                        "cs_styleId": "",
                        "cs_bold": false,
                        "cs_italic": false,
                        "cs_underline": false,
                        "cs_strikethrough": false,
                        "cs_horizontalAlignment": "left",
                        "cs_verticalAlignment": "top",
                        "cs_textColor": "#000000",
                        "cs_backgroundColor": "",
                        "cs_font": "helvetica",
                        "cs_fontSize": 12,
                        "cs_lineSpacing": 1,
                        "cs_paddingLeft": 2,
                        "cs_paddingTop": 2,
                        "cs_paddingRight": 2,
                        "cs_paddingBottom": 2,
                        "spreadsheet_textWrap": false,
                        "borderWidth": 1,
                        "growWeight": 0
                    }
                ]
            }
        },
        {
            "elementType": "table",
            "id": 262,
            "containerId": "0_content",
            "width": 360,
            "x": 240,
            "y": 20,
            "dataSource": "${header}",
            "columns": "2",
            "header": false,
            "contentRows": 7,
            "footer": false,
            "border": "grid",
            "borderColor": "#000000",
            "borderWidth": "1",
            "printIf": "",
            "removeEmptyElement": false,
            "spreadsheet_hide": false,
            "spreadsheet_column": "",
            "spreadsheet_addEmptyRow": false,
            "headerData": {
                "elementType": "none",
                "id": 263,
                "height": 20,
                "backgroundColor": "",
                "repeatHeader": false,
                "columnData": [
                    {
                        "elementType": "table_text",
                        "id": 264,
                        "width": 100,
                        "content": "From",
                        "eval": false,
                        "colspan": "",
                        "styleId": "33",
                        "bold": true,
                        "italic": false,
                        "underline": false,
                        "strikethrough": false,
                        "horizontalAlignment": "left",
                        "verticalAlignment": "middle",
                        "textColor": "#000000",
                        "backgroundColor": "",
                        "font": "notosans",
                        "fontSize": "12",
                        "lineSpacing": 1,
                        "paddingLeft": 2,
                        "paddingTop": 2,
                        "paddingRight": 2,
                        "paddingBottom": 2,
                        "pattern": "",
                        "link": "",
                        "cs_condition": "",
                        "cs_styleId": "",
                        "cs_bold": false,
                        "cs_italic": false,
                        "cs_underline": false,
                        "cs_strikethrough": false,
                        "cs_horizontalAlignment": "left",
                        "cs_verticalAlignment": "top",
                        "cs_textColor": "#000000",
                        "cs_backgroundColor": "",
                        "cs_font": "helvetica",
                        "cs_fontSize": 12,
                        "cs_lineSpacing": 1,
                        "cs_paddingLeft": 2,
                        "cs_paddingTop": 2,
                        "cs_paddingRight": 2,
                        "cs_paddingBottom": 2,
                        "spreadsheet_textWrap": false,
                        "printIf": "",
                        "growWeight": 0,
                        "borderWidth": 1
                    },
                    {
                        "elementType": "table_text",
                        "id": 265,
                        "width": 260,
                        "content": "",
                        "eval": false,
                        "colspan": "",
                        "styleId": "34",
                        "bold": false,
                        "italic": false,
                        "underline": false,
                        "strikethrough": false,
                        "horizontalAlignment": "left",
                        "verticalAlignment": "middle",
                        "textColor": "#000000",
                        "backgroundColor": "",
                        "font": "notosans",
                        "fontSize": "11",
                        "lineSpacing": 1,
                        "paddingLeft": 2,
                        "paddingTop": 2,
                        "paddingRight": 2,
                        "paddingBottom": 2,
                        "pattern": "",
                        "link": "",
                        "cs_condition": "",
                        "cs_styleId": "",
                        "cs_bold": false,
                        "cs_italic": false,
                        "cs_underline": false,
                        "cs_strikethrough": false,
                        "cs_horizontalAlignment": "left",
                        "cs_verticalAlignment": "top",
                        "cs_textColor": "#000000",
                        "cs_backgroundColor": "",
                        "cs_font": "helvetica",
                        "cs_fontSize": 12,
                        "cs_lineSpacing": 1,
                        "cs_paddingLeft": 2,
                        "cs_paddingTop": 2,
                        "cs_paddingRight": 2,
                        "cs_paddingBottom": 2,
                        "spreadsheet_textWrap": false,
                        "printIf": "",
                        "growWeight": 0,
                        "borderWidth": 1
                    }
                ]
            },
            "contentDataRows": [
                {
                    "elementType": "none",
                    "id": 628,
                    "height": 20,
                    "backgroundColor": "",
                    "alternateBackgroundColor": "",
                    "groupExpression": "",
                    "printIf": "",
                    "alwaysPrintOnSamePage": true,
                    "pageBreak": false,
                    "repeatGroupHeader": false,
                    "columnData": [
                        {
                            "elementType": "table_text",
                            "id": 629,
                            "width": 100,
                            "content": "Region",
                            "eval": false,
                            "colspan": "",
                            "styleId": "33",
                            "bold": true,
                            "italic": false,
                            "underline": false,
                            "strikethrough": false,
                            "horizontalAlignment": "left",
                            "verticalAlignment": "middle",
                            "textColor": "#000000",
                            "backgroundColor": "",
                            "font": "notosans",
                            "fontSize": "12",
                            "lineSpacing": 1,
                            "paddingLeft": 2,
                            "paddingTop": 2,
                            "paddingRight": 2,
                            "paddingBottom": 2,
                            "pattern": "",
                            "link": "",
                            "cs_condition": "",
                            "cs_styleId": "",
                            "cs_bold": false,
                            "cs_italic": false,
                            "cs_underline": false,
                            "cs_strikethrough": false,
                            "cs_horizontalAlignment": "left",
                            "cs_verticalAlignment": "top",
                            "cs_textColor": "#000000",
                            "cs_backgroundColor": "",
                            "cs_font": "helvetica",
                            "cs_fontSize": 12,
                            "cs_lineSpacing": 1,
                            "cs_paddingLeft": 2,
                            "cs_paddingTop": 2,
                            "cs_paddingRight": 2,
                            "cs_paddingBottom": 2,
                            "spreadsheet_textWrap": false,
                            "borderWidth": 1,
                            "growWeight": 0
                        },
                        {
                            "elementType": "table_text",
                            "id": 630,
                            "width": 260,
                            "content": "${region}",
                            "eval": false,
                            "colspan": "",
                            "styleId": "34",
                            "bold": false,
                            "italic": false,
                            "underline": false,
                            "strikethrough": false,
                            "horizontalAlignment": "left",
                            "verticalAlignment": "middle",
                            "textColor": "#000000",
                            "backgroundColor": "",
                            "font": "notosans",
                            "fontSize": "11",
                            "lineSpacing": 1,
                            "paddingLeft": 2,
                            "paddingTop": 2,
                            "paddingRight": 2,
                            "paddingBottom": 2,
                            "pattern": "",
                            "link": "",
                            "cs_condition": "",
                            "cs_styleId": "",
                            "cs_bold": false,
                            "cs_italic": false,
                            "cs_underline": false,
                            "cs_strikethrough": false,
                            "cs_horizontalAlignment": "left",
                            "cs_verticalAlignment": "top",
                            "cs_textColor": "#000000",
                            "cs_backgroundColor": "",
                            "cs_font": "helvetica",
                            "cs_fontSize": 12,
                            "cs_lineSpacing": 1,
                            "cs_paddingLeft": 2,
                            "cs_paddingTop": 2,
                            "cs_paddingRight": 2,
                            "cs_paddingBottom": 2,
                            "spreadsheet_textWrap": false,
                            "borderWidth": 1,
                            "growWeight": 0
                        }
                    ]
                },
                {
                    "elementType": "none",
                    "id": 625,
                    "height": 20,
                    "backgroundColor": "",
                    "alternateBackgroundColor": "",
                    "groupExpression": "",
                    "printIf": "",
                    "alwaysPrintOnSamePage": true,
                    "pageBreak": false,
                    "repeatGroupHeader": false,
                    "columnData": [
                        {
                            "elementType": "table_text",
                            "id": 626,
                            "width": 100,
                            "content": "District",
                            "eval": false,
                            "colspan": "",
                            "styleId": "33",
                            "bold": true,
                            "italic": false,
                            "underline": false,
                            "strikethrough": false,
                            "horizontalAlignment": "left",
                            "verticalAlignment": "middle",
                            "textColor": "#000000",
                            "backgroundColor": "",
                            "font": "notosans",
                            "fontSize": "12",
                            "lineSpacing": 1,
                            "paddingLeft": 2,
                            "paddingTop": 2,
                            "paddingRight": 2,
                            "paddingBottom": 2,
                            "pattern": "",
                            "link": "",
                            "cs_condition": "",
                            "cs_styleId": "",
                            "cs_bold": false,
                            "cs_italic": false,
                            "cs_underline": false,
                            "cs_strikethrough": false,
                            "cs_horizontalAlignment": "left",
                            "cs_verticalAlignment": "top",
                            "cs_textColor": "#000000",
                            "cs_backgroundColor": "",
                            "cs_font": "helvetica",
                            "cs_fontSize": 12,
                            "cs_lineSpacing": 1,
                            "cs_paddingLeft": 2,
                            "cs_paddingTop": 2,
                            "cs_paddingRight": 2,
                            "cs_paddingBottom": 2,
                            "spreadsheet_textWrap": false,
                            "borderWidth": 1,
                            "growWeight": 0
                        },
                        {
                            "elementType": "table_text",
                            "id": 627,
                            "width": 260,
                            "content": "${district}",
                            "eval": false,
                            "colspan": "",
                            "styleId": "34",
                            "bold": false,
                            "italic": false,
                            "underline": false,
                            "strikethrough": false,
                            "horizontalAlignment": "left",
                            "verticalAlignment": "middle",
                            "textColor": "#000000",
                            "backgroundColor": "",
                            "font": "notosans",
                            "fontSize": "11",
                            "lineSpacing": 1,
                            "paddingLeft": 2,
                            "paddingTop": 2,
                            "paddingRight": 2,
                            "paddingBottom": 2,
                            "pattern": "",
                            "link": "",
                            "cs_condition": "",
                            "cs_styleId": "",
                            "cs_bold": false,
                            "cs_italic": false,
                            "cs_underline": false,
                            "cs_strikethrough": false,
                            "cs_horizontalAlignment": "left",
                            "cs_verticalAlignment": "top",
                            "cs_textColor": "#000000",
                            "cs_backgroundColor": "",
                            "cs_font": "helvetica",
                            "cs_fontSize": 12,
                            "cs_lineSpacing": 1,
                            "cs_paddingLeft": 2,
                            "cs_paddingTop": 2,
                            "cs_paddingRight": 2,
                            "cs_paddingBottom": 2,
                            "spreadsheet_textWrap": false,
                            "borderWidth": 1,
                            "growWeight": 0
                        }
                    ]
                },
                {
                    "elementType": "none",
                    "id": 622,
                    "height": 20,
                    "backgroundColor": "",
                    "alternateBackgroundColor": "",
                    "groupExpression": "",
                    "printIf": "",
                    "alwaysPrintOnSamePage": true,
                    "pageBreak": false,
                    "repeatGroupHeader": false,
                    "columnData": [
                        {
                            "elementType": "table_text",
                            "id": 623,
                            "width": 100,
                            "content": "Health Facility",
                            "eval": false,
                            "colspan": "",
                            "styleId": "33",
                            "bold": true,
                            "italic": false,
                            "underline": false,
                            "strikethrough": false,
                            "horizontalAlignment": "left",
                            "verticalAlignment": "middle",
                            "textColor": "#000000",
                            "backgroundColor": "",
                            "font": "notosans",
                            "fontSize": "12",
                            "lineSpacing": 1,
                            "paddingLeft": 2,
                            "paddingTop": 2,
                            "paddingRight": 2,
                            "paddingBottom": 2,
                            "pattern": "",
                            "link": "",
                            "cs_condition": "",
                            "cs_styleId": "",
                            "cs_bold": false,
                            "cs_italic": false,
                            "cs_underline": false,
                            "cs_strikethrough": false,
                            "cs_horizontalAlignment": "left",
                            "cs_verticalAlignment": "top",
                            "cs_textColor": "#000000",
                            "cs_backgroundColor": "",
                            "cs_font": "helvetica",
                            "cs_fontSize": 12,
                            "cs_lineSpacing": 1,
                            "cs_paddingLeft": 2,
                            "cs_paddingTop": 2,
                            "cs_paddingRight": 2,
                            "cs_paddingBottom": 2,
                            "spreadsheet_textWrap": false,
                            "borderWidth": 1,
                            "growWeight": 0
                        },
                        {
                            "elementType": "table_text",
                            "id": 624,
                            "width": 260,
                            "content": "${hf}",
                            "eval": false,
                            "colspan": "",
                            "styleId": "34",
                            "bold": false,
                            "italic": false,
                            "underline": false,
                            "strikethrough": false,
                            "horizontalAlignment": "left",
                            "verticalAlignment": "middle",
                            "textColor": "#000000",
                            "backgroundColor": "",
                            "font": "notosans",
                            "fontSize": "11",
                            "lineSpacing": 1,
                            "paddingLeft": 2,
                            "paddingTop": 2,
                            "paddingRight": 2,
                            "paddingBottom": 2,
                            "pattern": "",
                            "link": "",
                            "cs_condition": "",
                            "cs_styleId": "",
                            "cs_bold": false,
                            "cs_italic": false,
                            "cs_underline": false,
                            "cs_strikethrough": false,
                            "cs_horizontalAlignment": "left",
                            "cs_verticalAlignment": "top",
                            "cs_textColor": "#000000",
                            "cs_backgroundColor": "",
                            "cs_font": "helvetica",
                            "cs_fontSize": 12,
                            "cs_lineSpacing": 1,
                            "cs_paddingLeft": 2,
                            "cs_paddingTop": 2,
                            "cs_paddingRight": 2,
                            "cs_paddingBottom": 2,
                            "spreadsheet_textWrap": false,
                            "borderWidth": 1,
                            "growWeight": 0
                        }
                    ]
                },
                {
                    "elementType": "none",
                    "id": 555,
                    "height": 20,
                    "backgroundColor": "",
                    "alternateBackgroundColor": "",
                    "groupExpression": "",
                    "printIf": "",
                    "alwaysPrintOnSamePage": true,
                    "pageBreak": false,
                    "repeatGroupHeader": false,
                    "columnData": [
                        {
                            "elementType": "table_text",
                            "id": 556,
                            "width": 100,
                            "content": "Product",
                            "eval": false,
                            "colspan": "",
                            "styleId": "33",
                            "bold": true,
                            "italic": false,
                            "underline": false,
                            "strikethrough": false,
                            "horizontalAlignment": "left",
                            "verticalAlignment": "middle",
                            "textColor": "#000000",
                            "backgroundColor": "",
                            "font": "notosans",
                            "fontSize": "12",
                            "lineSpacing": 1,
                            "paddingLeft": 2,
                            "paddingTop": 2,
                            "paddingRight": 2,
                            "paddingBottom": 2,
                            "pattern": "",
                            "link": "",
                            "cs_condition": "",
                            "cs_styleId": "",
                            "cs_bold": false,
                            "cs_italic": false,
                            "cs_underline": false,
                            "cs_strikethrough": false,
                            "cs_horizontalAlignment": "left",
                            "cs_verticalAlignment": "top",
                            "cs_textColor": "#000000",
                            "cs_backgroundColor": "",
                            "cs_font": "helvetica",
                            "cs_fontSize": 12,
                            "cs_lineSpacing": 1,
                            "cs_paddingLeft": 2,
                            "cs_paddingTop": 2,
                            "cs_paddingRight": 2,
                            "cs_paddingBottom": 2,
                            "spreadsheet_textWrap": false,
                            "borderWidth": 1,
                            "growWeight": 0
                        },
                        {
                            "elementType": "table_text",
                            "id": 557,
                            "width": 260,
                            "content": "${product}",
                            "eval": false,
                            "colspan": "",
                            "styleId": "34",
                            "bold": false,
                            "italic": false,
                            "underline": false,
                            "strikethrough": false,
                            "horizontalAlignment": "left",
                            "verticalAlignment": "middle",
                            "textColor": "#000000",
                            "backgroundColor": "",
                            "font": "notosans",
                            "fontSize": "11",
                            "lineSpacing": 1,
                            "paddingLeft": 2,
                            "paddingTop": 2,
                            "paddingRight": 2,
                            "paddingBottom": 2,
                            "pattern": "",
                            "link": "",
                            "cs_condition": "",
                            "cs_styleId": "",
                            "cs_bold": false,
                            "cs_italic": false,
                            "cs_underline": false,
                            "cs_strikethrough": false,
                            "cs_horizontalAlignment": "left",
                            "cs_verticalAlignment": "top",
                            "cs_textColor": "#000000",
                            "cs_backgroundColor": "",
                            "cs_font": "helvetica",
                            "cs_fontSize": 12,
                            "cs_lineSpacing": 1,
                            "cs_paddingLeft": 2,
                            "cs_paddingTop": 2,
                            "cs_paddingRight": 2,
                            "cs_paddingBottom": 2,
                            "spreadsheet_textWrap": false,
                            "borderWidth": 1,
                            "growWeight": 0
                        }
                    ]
                },
                {
                    "elementType": "none",
                    "id": 561,
                    "height": 20,
                    "backgroundColor": "",
                    "alternateBackgroundColor": "",
                    "groupExpression": "",
                    "printIf": "",
                    "alwaysPrintOnSamePage": true,
                    "pageBreak": false,
                    "repeatGroupHeader": false,
                    "columnData": [
                        {
                            "elementType": "table_text",
                            "id": 562,
                            "width": 100,
                            "content": "Year",
                            "eval": false,
                            "colspan": "",
                            "styleId": "33",
                            "bold": true,
                            "italic": false,
                            "underline": false,
                            "strikethrough": false,
                            "horizontalAlignment": "left",
                            "verticalAlignment": "middle",
                            "textColor": "#000000",
                            "backgroundColor": "",
                            "font": "notosans",
                            "fontSize": "12",
                            "lineSpacing": 1,
                            "paddingLeft": 2,
                            "paddingTop": 2,
                            "paddingRight": 2,
                            "paddingBottom": 2,
                            "pattern": "",
                            "link": "",
                            "cs_condition": "",
                            "cs_styleId": "",
                            "cs_bold": false,
                            "cs_italic": false,
                            "cs_underline": false,
                            "cs_strikethrough": false,
                            "cs_horizontalAlignment": "left",
                            "cs_verticalAlignment": "top",
                            "cs_textColor": "#000000",
                            "cs_backgroundColor": "",
                            "cs_font": "helvetica",
                            "cs_fontSize": 12,
                            "cs_lineSpacing": 1,
                            "cs_paddingLeft": 2,
                            "cs_paddingTop": 2,
                            "cs_paddingRight": 2,
                            "cs_paddingBottom": 2,
                            "spreadsheet_textWrap": false,
                            "borderWidth": 1,
                            "growWeight": 0
                        },
                        {
                            "elementType": "table_text",
                            "id": 563,
                            "width": 260,
                            "content": "${year}",
                            "eval": false,
                            "colspan": "",
                            "styleId": "34",
                            "bold": false,
                            "italic": false,
                            "underline": false,
                            "strikethrough": false,
                            "horizontalAlignment": "left",
                            "verticalAlignment": "middle",
                            "textColor": "#000000",
                            "backgroundColor": "",
                            "font": "notosans",
                            "fontSize": "11",
                            "lineSpacing": 1,
                            "paddingLeft": 2,
                            "paddingTop": 2,
                            "paddingRight": 2,
                            "paddingBottom": 2,
                            "pattern": "",
                            "link": "",
                            "cs_condition": "",
                            "cs_styleId": "",
                            "cs_bold": false,
                            "cs_italic": false,
                            "cs_underline": false,
                            "cs_strikethrough": false,
                            "cs_horizontalAlignment": "left",
                            "cs_verticalAlignment": "top",
                            "cs_textColor": "#000000",
                            "cs_backgroundColor": "",
                            "cs_font": "helvetica",
                            "cs_fontSize": 12,
                            "cs_lineSpacing": 1,
                            "cs_paddingLeft": 2,
                            "cs_paddingTop": 2,
                            "cs_paddingRight": 2,
                            "cs_paddingBottom": 2,
                            "spreadsheet_textWrap": false,
                            "borderWidth": 1,
                            "growWeight": 0
                        }
                    ]
                },
                {
                    "elementType": "none",
                    "id": 631,
                    "height": 20,
                    "backgroundColor": "",
                    "alternateBackgroundColor": "",
                    "groupExpression": "",
                    "printIf": "",
                    "alwaysPrintOnSamePage": true,
                    "pageBreak": false,
                    "repeatGroupHeader": false,
                    "columnData": [
                        {
                            "elementType": "table_text",
                            "id": 632,
                            "width": 100,
                            "content": "Quarter",
                            "eval": false,
                            "colspan": "",
                            "styleId": "33",
                            "bold": true,
                            "italic": false,
                            "underline": false,
                            "strikethrough": false,
                            "horizontalAlignment": "left",
                            "verticalAlignment": "middle",
                            "textColor": "#000000",
                            "backgroundColor": "",
                            "font": "notosans",
                            "fontSize": "12",
                            "lineSpacing": 1,
                            "paddingLeft": 2,
                            "paddingTop": 2,
                            "paddingRight": 2,
                            "paddingBottom": 2,
                            "pattern": "",
                            "link": "",
                            "cs_condition": "",
                            "cs_styleId": "",
                            "cs_bold": false,
                            "cs_italic": false,
                            "cs_underline": false,
                            "cs_strikethrough": false,
                            "cs_horizontalAlignment": "left",
                            "cs_verticalAlignment": "top",
                            "cs_textColor": "#000000",
                            "cs_backgroundColor": "",
                            "cs_font": "helvetica",
                            "cs_fontSize": 12,
                            "cs_lineSpacing": 1,
                            "cs_paddingLeft": 2,
                            "cs_paddingTop": 2,
                            "cs_paddingRight": 2,
                            "cs_paddingBottom": 2,
                            "spreadsheet_textWrap": false,
                            "borderWidth": 1,
                            "growWeight": 0
                        },
                        {
                            "elementType": "table_text",
                            "id": 633,
                            "width": 260,
                            "content": "${quarter}",
                            "eval": false,
                            "colspan": "",
                            "styleId": "34",
                            "bold": false,
                            "italic": false,
                            "underline": false,
                            "strikethrough": false,
                            "horizontalAlignment": "left",
                            "verticalAlignment": "middle",
                            "textColor": "#000000",
                            "backgroundColor": "",
                            "font": "notosans",
                            "fontSize": "11",
                            "lineSpacing": 1,
                            "paddingLeft": 2,
                            "paddingTop": 2,
                            "paddingRight": 2,
                            "paddingBottom": 2,
                            "pattern": "",
                            "link": "",
                            "cs_condition": "",
                            "cs_styleId": "",
                            "cs_bold": false,
                            "cs_italic": false,
                            "cs_underline": false,
                            "cs_strikethrough": false,
                            "cs_horizontalAlignment": "left",
                            "cs_verticalAlignment": "top",
                            "cs_textColor": "#000000",
                            "cs_backgroundColor": "",
                            "cs_font": "helvetica",
                            "cs_fontSize": 12,
                            "cs_lineSpacing": 1,
                            "cs_paddingLeft": 2,
                            "cs_paddingTop": 2,
                            "cs_paddingRight": 2,
                            "cs_paddingBottom": 2,
                            "spreadsheet_textWrap": false,
                            "borderWidth": 1,
                            "growWeight": 0
                        }
                    ]
                },
                {
                    "elementType": "none",
                    "id": 564,
                    "height": 20,
                    "backgroundColor": "",
                    "alternateBackgroundColor": "",
                    "groupExpression": "",
                    "printIf": "",
                    "alwaysPrintOnSamePage": true,
                    "pageBreak": false,
                    "repeatGroupHeader": false,
                    "columnData": [
                        {
                            "elementType": "table_text",
                            "id": 565,
                            "width": 100,
                            "content": "Month",
                            "eval": false,
                            "colspan": "",
                            "styleId": "33",
                            "bold": true,
                            "italic": false,
                            "underline": false,
                            "strikethrough": false,
                            "horizontalAlignment": "left",
                            "verticalAlignment": "middle",
                            "textColor": "#000000",
                            "backgroundColor": "",
                            "font": "notosans",
                            "fontSize": "12",
                            "lineSpacing": 1,
                            "paddingLeft": 2,
                            "paddingTop": 2,
                            "paddingRight": 2,
                            "paddingBottom": 2,
                            "pattern": "",
                            "link": "",
                            "cs_condition": "",
                            "cs_styleId": "",
                            "cs_bold": false,
                            "cs_italic": false,
                            "cs_underline": false,
                            "cs_strikethrough": false,
                            "cs_horizontalAlignment": "left",
                            "cs_verticalAlignment": "top",
                            "cs_textColor": "#000000",
                            "cs_backgroundColor": "",
                            "cs_font": "helvetica",
                            "cs_fontSize": 12,
                            "cs_lineSpacing": 1,
                            "cs_paddingLeft": 2,
                            "cs_paddingTop": 2,
                            "cs_paddingRight": 2,
                            "cs_paddingBottom": 2,
                            "spreadsheet_textWrap": false,
                            "borderWidth": 1,
                            "growWeight": 0
                        },
                        {
                            "elementType": "table_text",
                            "id": 566,
                            "width": 260,
                            "content": "${month}",
                            "eval": false,
                            "colspan": "",
                            "styleId": "34",
                            "bold": false,
                            "italic": false,
                            "underline": false,
                            "strikethrough": false,
                            "horizontalAlignment": "left",
                            "verticalAlignment": "middle",
                            "textColor": "#000000",
                            "backgroundColor": "",
                            "font": "notosans",
                            "fontSize": "11",
                            "lineSpacing": 1,
                            "paddingLeft": 2,
                            "paddingTop": 2,
                            "paddingRight": 2,
                            "paddingBottom": 2,
                            "pattern": "",
                            "link": "",
                            "cs_condition": "",
                            "cs_styleId": "",
                            "cs_bold": false,
                            "cs_italic": false,
                            "cs_underline": false,
                            "cs_strikethrough": false,
                            "cs_horizontalAlignment": "left",
                            "cs_verticalAlignment": "top",
                            "cs_textColor": "#000000",
                            "cs_backgroundColor": "",
                            "cs_font": "helvetica",
                            "cs_fontSize": 12,
                            "cs_lineSpacing": 1,
                            "cs_paddingLeft": 2,
                            "cs_paddingTop": 2,
                            "cs_paddingRight": 2,
                            "cs_paddingBottom": 2,
                            "spreadsheet_textWrap": false,
                            "borderWidth": 1,
                            "growWeight": 0
                        }
                    ]
                }
            ],
            "footerData": {
                "elementType": "none",
                "id": 269,
                "height": 20,
                "backgroundColor": "",
                "columnData": [
                    {
                        "elementType": "table_text",
                        "id": 270,
                        "width": 100,
                        "content": "",
                        "eval": false,
                        "colspan": "",
                        "styleId": "",
                        "bold": false,
                        "italic": false,
                        "underline": false,
                        "strikethrough": false,
                        "horizontalAlignment": "left",
                        "verticalAlignment": "top",
                        "textColor": "#000000",
                        "backgroundColor": "",
                        "font": "helvetica",
                        "fontSize": 12,
                        "lineSpacing": 1,
                        "paddingLeft": 2,
                        "paddingTop": 2,
                        "paddingRight": 2,
                        "paddingBottom": 2,
                        "pattern": "",
                        "link": "",
                        "cs_condition": "",
                        "cs_styleId": "",
                        "cs_bold": false,
                        "cs_italic": false,
                        "cs_underline": false,
                        "cs_strikethrough": false,
                        "cs_horizontalAlignment": "left",
                        "cs_verticalAlignment": "top",
                        "cs_textColor": "#000000",
                        "cs_backgroundColor": "",
                        "cs_font": "helvetica",
                        "cs_fontSize": 12,
                        "cs_lineSpacing": 1,
                        "cs_paddingLeft": 2,
                        "cs_paddingTop": 2,
                        "cs_paddingRight": 2,
                        "cs_paddingBottom": 2,
                        "spreadsheet_textWrap": false,
                        "borderWidth": 1,
                        "growWeight": 0
                    },
                    {
                        "elementType": "table_text",
                        "id": 271,
                        "width": 260,
                        "content": "",
                        "eval": false,
                        "colspan": "",
                        "styleId": "",
                        "bold": false,
                        "italic": false,
                        "underline": false,
                        "strikethrough": false,
                        "horizontalAlignment": "left",
                        "verticalAlignment": "top",
                        "textColor": "#000000",
                        "backgroundColor": "",
                        "font": "helvetica",
                        "fontSize": 12,
                        "lineSpacing": 1,
                        "paddingLeft": 2,
                        "paddingTop": 2,
                        "paddingRight": 2,
                        "paddingBottom": 2,
                        "pattern": "",
                        "link": "",
                        "cs_condition": "",
                        "cs_styleId": "",
                        "cs_bold": false,
                        "cs_italic": false,
                        "cs_underline": false,
                        "cs_strikethrough": false,
                        "cs_horizontalAlignment": "left",
                        "cs_verticalAlignment": "top",
                        "cs_textColor": "#000000",
                        "cs_backgroundColor": "",
                        "cs_font": "helvetica",
                        "cs_fontSize": 12,
                        "cs_lineSpacing": 1,
                        "cs_paddingLeft": 2,
                        "cs_paddingTop": 2,
                        "cs_paddingRight": 2,
                        "cs_paddingBottom": 2,
                        "spreadsheet_textWrap": false,
                        "borderWidth": 1,
                        "growWeight": 0
                    }
                ]
            }
        },
        {
            "elementType": "table",
            "id": 195,
            "containerId": "0_content",
            "width": 822,
            "x": 0,
            "y": 180,
            "dataSource": "${data}",
            "columns": 6,
            "header": false,
            "contentRows": 7,
            "footer": true,
            "border": "grid",
            "borderColor": "#000000",
            "borderWidth": "1",
            "printIf": "",
            "removeEmptyElement": false,
            "spreadsheet_hide": false,
            "spreadsheet_column": "",
            "spreadsheet_addEmptyRow": false,
            "headerData": {
                "elementType": "none",
                "id": 196,
                "height": 20,
                "backgroundColor": "",
                "repeatHeader": true,
                "columnData": [
                    {
                        "elementType": "table_text",
                        "id": 197,
                        "width": 42,
                        "content": "Username: {user_name}",
                        "eval": false,
                        "colspan": "4",
                        "styleId": "286",
                        "bold": true,
                        "italic": false,
                        "underline": false,
                        "strikethrough": false,
                        "horizontalAlignment": "left",
                        "verticalAlignment": "middle",
                        "textColor": "#ffffff",
                        "backgroundColor": "#006374",
                        "font": "notosans",
                        "fontSize": 12,
                        "lineSpacing": 1,
                        "paddingLeft": 2,
                        "paddingTop": 2,
                        "paddingRight": 2,
                        "paddingBottom": 2,
                        "pattern": "",
                        "link": "",
                        "cs_condition": "",
                        "cs_styleId": "",
                        "cs_bold": false,
                        "cs_italic": false,
                        "cs_underline": false,
                        "cs_strikethrough": false,
                        "cs_horizontalAlignment": "left",
                        "cs_verticalAlignment": "top",
                        "cs_textColor": "#000000",
                        "cs_backgroundColor": "",
                        "cs_font": "helvetica",
                        "cs_fontSize": 12,
                        "cs_lineSpacing": 1,
                        "cs_paddingLeft": 2,
                        "cs_paddingTop": 2,
                        "cs_paddingRight": 2,
                        "cs_paddingBottom": 2,
                        "spreadsheet_textWrap": false,
                        "printIf": "",
                        "growWeight": 0,
                        "borderWidth": 1
                    },
                    {
                        "elementType": "table_text",
                        "id": 206,
                        "width": 80,
                        "content": "",
                        "eval": false,
                        "colspan": "",
                        "styleId": "33",
                        "bold": true,
                        "italic": false,
                        "underline": false,
                        "strikethrough": false,
                        "horizontalAlignment": "left",
                        "verticalAlignment": "middle",
                        "textColor": "#000000",
                        "backgroundColor": "",
                        "font": "notosans",
                        "fontSize": "12",
                        "lineSpacing": 1,
                        "paddingLeft": 2,
                        "paddingTop": 2,
                        "paddingRight": 2,
                        "paddingBottom": 2,
                        "pattern": "",
                        "link": "",
                        "cs_condition": "",
                        "cs_styleId": "",
                        "cs_bold": false,
                        "cs_italic": false,
                        "cs_underline": false,
                        "cs_strikethrough": false,
                        "cs_horizontalAlignment": "left",
                        "cs_verticalAlignment": "top",
                        "cs_textColor": "#000000",
                        "cs_backgroundColor": "",
                        "cs_font": "helvetica",
                        "cs_fontSize": 12,
                        "cs_lineSpacing": 1,
                        "cs_paddingLeft": 2,
                        "cs_paddingTop": 2,
                        "cs_paddingRight": 2,
                        "cs_paddingBottom": 2,
                        "spreadsheet_textWrap": false,
                        "printIf": "",
                        "growWeight": 0,
                        "borderWidth": 1
                    },
                    {
                        "elementType": "table_text",
                        "id": 592,
                        "width": 310,
                        "content": "",
                        "eval": false,
                        "colspan": "",
                        "styleId": "",
                        "bold": false,
                        "italic": false,
                        "underline": false,
                        "strikethrough": false,
                        "horizontalAlignment": "left",
                        "verticalAlignment": "top",
                        "textColor": "#000000",
                        "backgroundColor": "",
                        "font": "helvetica",
                        "fontSize": 12,
                        "lineSpacing": 1,
                        "paddingLeft": 2,
                        "paddingTop": 2,
                        "paddingRight": 2,
                        "paddingBottom": 2,
                        "pattern": "",
                        "link": "",
                        "cs_condition": "",
                        "cs_styleId": "",
                        "cs_bold": false,
                        "cs_italic": false,
                        "cs_underline": false,
                        "cs_strikethrough": false,
                        "cs_horizontalAlignment": "left",
                        "cs_verticalAlignment": "top",
                        "cs_textColor": "#000000",
                        "cs_backgroundColor": "",
                        "cs_font": "helvetica",
                        "cs_fontSize": 12,
                        "cs_lineSpacing": 1,
                        "cs_paddingLeft": 2,
                        "cs_paddingTop": 2,
                        "cs_paddingRight": 2,
                        "cs_paddingBottom": 2,
                        "spreadsheet_textWrap": false,
                        "printIf": "",
                        "growWeight": 0,
                        "borderWidth": 1
                    },
                    {
                        "elementType": "table_text",
                        "id": 391,
                        "width": 130,
                        "content": "",
                        "eval": false,
                        "colspan": "",
                        "styleId": "",
                        "bold": false,
                        "italic": false,
                        "underline": false,
                        "strikethrough": false,
                        "horizontalAlignment": "left",
                        "verticalAlignment": "top",
                        "textColor": "#000000",
                        "backgroundColor": "",
                        "font": "helvetica",
                        "fontSize": 12,
                        "lineSpacing": 1,
                        "paddingLeft": 2,
                        "paddingTop": 2,
                        "paddingRight": 2,
                        "paddingBottom": 2,
                        "pattern": "",
                        "link": "",
                        "cs_condition": "",
                        "cs_styleId": "",
                        "cs_bold": false,
                        "cs_italic": false,
                        "cs_underline": false,
                        "cs_strikethrough": false,
                        "cs_horizontalAlignment": "left",
                        "cs_verticalAlignment": "top",
                        "cs_textColor": "#000000",
                        "cs_backgroundColor": "",
                        "cs_font": "helvetica",
                        "cs_fontSize": 12,
                        "cs_lineSpacing": 1,
                        "cs_paddingLeft": 2,
                        "cs_paddingTop": 2,
                        "cs_paddingRight": 2,
                        "cs_paddingBottom": 2,
                        "spreadsheet_textWrap": false,
                        "printIf": "",
                        "growWeight": 0,
                        "borderWidth": 1
                    },
                    {
                        "elementType": "table_text",
                        "id": 401,
                        "width": 130,
                        "content": "",
                        "eval": false,
                        "colspan": "",
                        "styleId": "",
                        "bold": false,
                        "italic": false,
                        "underline": false,
                        "strikethrough": false,
                        "horizontalAlignment": "left",
                        "verticalAlignment": "top",
                        "textColor": "#000000",
                        "backgroundColor": "",
                        "font": "helvetica",
                        "fontSize": 12,
                        "lineSpacing": 1,
                        "paddingLeft": 2,
                        "paddingTop": 2,
                        "paddingRight": 2,
                        "paddingBottom": 2,
                        "pattern": "",
                        "link": "",
                        "cs_condition": "",
                        "cs_styleId": "",
                        "cs_bold": false,
                        "cs_italic": false,
                        "cs_underline": false,
                        "cs_strikethrough": false,
                        "cs_horizontalAlignment": "left",
                        "cs_verticalAlignment": "top",
                        "cs_textColor": "#000000",
                        "cs_backgroundColor": "",
                        "cs_font": "helvetica",
                        "cs_fontSize": 12,
                        "cs_lineSpacing": 1,
                        "cs_paddingLeft": 2,
                        "cs_paddingTop": 2,
                        "cs_paddingRight": 2,
                        "cs_paddingBottom": 2,
                        "spreadsheet_textWrap": false,
                        "printIf": "",
                        "growWeight": 0,
                        "borderWidth": 1
                    },
                    {
                        "elementType": "table_text",
                        "id": 599,
                        "width": 130,
                        "content": "",
                        "eval": false,
                        "colspan": "",
                        "styleId": "",
                        "bold": false,
                        "italic": false,
                        "underline": false,
                        "strikethrough": false,
                        "horizontalAlignment": "left",
                        "verticalAlignment": "top",
                        "textColor": "#000000",
                        "backgroundColor": "",
                        "font": "helvetica",
                        "fontSize": 12,
                        "lineSpacing": 1,
                        "paddingLeft": 2,
                        "paddingTop": 2,
                        "paddingRight": 2,
                        "paddingBottom": 2,
                        "pattern": "",
                        "link": "",
                        "cs_condition": "",
                        "cs_styleId": "",
                        "cs_bold": false,
                        "cs_italic": false,
                        "cs_underline": false,
                        "cs_strikethrough": false,
                        "cs_horizontalAlignment": "left",
                        "cs_verticalAlignment": "top",
                        "cs_textColor": "#000000",
                        "cs_backgroundColor": "",
                        "cs_font": "helvetica",
                        "cs_fontSize": 12,
                        "cs_lineSpacing": 1,
                        "cs_paddingLeft": 2,
                        "cs_paddingTop": 2,
                        "cs_paddingRight": 2,
                        "cs_paddingBottom": 2,
                        "spreadsheet_textWrap": false,
                        "printIf": "",
                        "growWeight": 0,
                        "borderWidth": 1
                    }
                ]
            },
            "contentDataRows": [
                {
                    "elementType": "none",
                    "id": 496,
                    "height": 20,
                    "backgroundColor": "",
                    "alternateBackgroundColor": "",
                    "groupExpression": "${month_nbr}",
                    "printIf": "",
                    "alwaysPrintOnSamePage": true,
                    "pageBreak": false,
                    "repeatGroupHeader": false,
                    "columnData": [
                        {
                            "elementType": "table_text",
                            "id": 497,
                            "width": 42,
                            "content": "",
                            "eval": false,
                            "colspan": "2",
                            "styleId": "",
                            "bold": false,
                            "italic": false,
                            "underline": false,
                            "strikethrough": false,
                            "horizontalAlignment": "left",
                            "verticalAlignment": "top",
                            "textColor": "#000000",
                            "backgroundColor": "",
                            "font": "helvetica",
                            "fontSize": 12,
                            "lineSpacing": 1,
                            "paddingLeft": 2,
                            "paddingTop": 2,
                            "paddingRight": 2,
                            "paddingBottom": 2,
                            "pattern": "",
                            "link": "",
                            "cs_condition": "",
                            "cs_styleId": "",
                            "cs_bold": false,
                            "cs_italic": false,
                            "cs_underline": false,
                            "cs_strikethrough": false,
                            "cs_horizontalAlignment": "left",
                            "cs_verticalAlignment": "top",
                            "cs_textColor": "#000000",
                            "cs_backgroundColor": "",
                            "cs_font": "helvetica",
                            "cs_fontSize": 12,
                            "cs_lineSpacing": 1,
                            "cs_paddingLeft": 2,
                            "cs_paddingTop": 2,
                            "cs_paddingRight": 2,
                            "cs_paddingBottom": 2,
                            "spreadsheet_textWrap": false,
                            "borderWidth": 1,
                            "growWeight": 0
                        },
                        {
                            "elementType": "table_text",
                            "id": 499,
                            "width": 80,
                            "content": "",
                            "eval": false,
                            "colspan": "",
                            "styleId": "",
                            "bold": false,
                            "italic": false,
                            "underline": false,
                            "strikethrough": false,
                            "horizontalAlignment": "left",
                            "verticalAlignment": "top",
                            "textColor": "#000000",
                            "backgroundColor": "",
                            "font": "helvetica",
                            "fontSize": 12,
                            "lineSpacing": 1,
                            "paddingLeft": 2,
                            "paddingTop": 2,
                            "paddingRight": 2,
                            "paddingBottom": 2,
                            "pattern": "",
                            "link": "",
                            "cs_condition": "",
                            "cs_styleId": "",
                            "cs_bold": false,
                            "cs_italic": false,
                            "cs_underline": false,
                            "cs_strikethrough": false,
                            "cs_horizontalAlignment": "left",
                            "cs_verticalAlignment": "top",
                            "cs_textColor": "#000000",
                            "cs_backgroundColor": "",
                            "cs_font": "helvetica",
                            "cs_fontSize": 12,
                            "cs_lineSpacing": 1,
                            "cs_paddingLeft": 2,
                            "cs_paddingTop": 2,
                            "cs_paddingRight": 2,
                            "cs_paddingBottom": 2,
                            "spreadsheet_textWrap": false,
                            "borderWidth": 1,
                            "growWeight": 0
                        },
                        {
                            "elementType": "table_text",
                            "id": 593,
                            "width": 310,
                            "content": "Product",
                            "eval": false,
                            "colspan": "",
                            "styleId": "349",
                            "bold": true,
                            "italic": false,
                            "underline": false,
                            "strikethrough": false,
                            "horizontalAlignment": "center",
                            "verticalAlignment": "middle",
                            "textColor": "#000000",
                            "backgroundColor": "",
                            "font": "notosans",
                            "fontSize": 12,
                            "lineSpacing": 1,
                            "paddingLeft": 2,
                            "paddingTop": 2,
                            "paddingRight": 2,
                            "paddingBottom": 2,
                            "pattern": "",
                            "link": "",
                            "cs_condition": "",
                            "cs_styleId": "",
                            "cs_bold": false,
                            "cs_italic": false,
                            "cs_underline": false,
                            "cs_strikethrough": false,
                            "cs_horizontalAlignment": "left",
                            "cs_verticalAlignment": "top",
                            "cs_textColor": "#000000",
                            "cs_backgroundColor": "",
                            "cs_font": "helvetica",
                            "cs_fontSize": 12,
                            "cs_lineSpacing": 1,
                            "cs_paddingLeft": 2,
                            "cs_paddingTop": 2,
                            "cs_paddingRight": 2,
                            "cs_paddingBottom": 2,
                            "spreadsheet_textWrap": false,
                            "borderWidth": 1,
                            "growWeight": 0
                        },
                        {
                            "elementType": "table_text",
                            "id": 502,
                            "width": 130,
                            "content": "Total (#)",
                            "eval": false,
                            "colspan": "",
                            "styleId": "349",
                            "bold": true,
                            "italic": false,
                            "underline": false,
                            "strikethrough": false,
                            "horizontalAlignment": "center",
                            "verticalAlignment": "middle",
                            "textColor": "#000000",
                            "backgroundColor": "",
                            "font": "notosans",
                            "fontSize": 12,
                            "lineSpacing": 1,
                            "paddingLeft": 2,
                            "paddingTop": 2,
                            "paddingRight": 2,
                            "paddingBottom": 2,
                            "pattern": "",
                            "link": "",
                            "cs_condition": "",
                            "cs_styleId": "",
                            "cs_bold": false,
                            "cs_italic": false,
                            "cs_underline": false,
                            "cs_strikethrough": false,
                            "cs_horizontalAlignment": "left",
                            "cs_verticalAlignment": "top",
                            "cs_textColor": "#000000",
                            "cs_backgroundColor": "",
                            "cs_font": "helvetica",
                            "cs_fontSize": 12,
                            "cs_lineSpacing": 1,
                            "cs_paddingLeft": 2,
                            "cs_paddingTop": 2,
                            "cs_paddingRight": 2,
                            "cs_paddingBottom": 2,
                            "spreadsheet_textWrap": false,
                            "borderWidth": 1,
                            "growWeight": 0
                        },
                        {
                            "elementType": "table_text",
                            "id": 503,
                            "width": 130,
                            "content": "Paid ($)",
                            "eval": false,
                            "colspan": "",
                            "styleId": "349",
                            "bold": true,
                            "italic": false,
                            "underline": false,
                            "strikethrough": false,
                            "horizontalAlignment": "center",
                            "verticalAlignment": "middle",
                            "textColor": "#000000",
                            "backgroundColor": "",
                            "font": "notosans",
                            "fontSize": 12,
                            "lineSpacing": 1,
                            "paddingLeft": 2,
                            "paddingTop": 2,
                            "paddingRight": 2,
                            "paddingBottom": 2,
                            "pattern": "",
                            "link": "",
                            "cs_condition": "",
                            "cs_styleId": "",
                            "cs_bold": false,
                            "cs_italic": false,
                            "cs_underline": false,
                            "cs_strikethrough": false,
                            "cs_horizontalAlignment": "left",
                            "cs_verticalAlignment": "top",
                            "cs_textColor": "#000000",
                            "cs_backgroundColor": "",
                            "cs_font": "helvetica",
                            "cs_fontSize": 12,
                            "cs_lineSpacing": 1,
                            "cs_paddingLeft": 2,
                            "cs_paddingTop": 2,
                            "cs_paddingRight": 2,
                            "cs_paddingBottom": 2,
                            "spreadsheet_textWrap": false,
                            "borderWidth": 1,
                            "growWeight": 0
                        },
                        {
                            "elementType": "table_text",
                            "id": 600,
                            "width": 130,
                            "content": "Rejected (#)",
                            "eval": false,
                            "colspan": "",
                            "styleId": "349",
                            "bold": true,
                            "italic": false,
                            "underline": false,
                            "strikethrough": false,
                            "horizontalAlignment": "center",
                            "verticalAlignment": "middle",
                            "textColor": "#000000",
                            "backgroundColor": "",
                            "font": "notosans",
                            "fontSize": 12,
                            "lineSpacing": 1,
                            "paddingLeft": 2,
                            "paddingTop": 2,
                            "paddingRight": 2,
                            "paddingBottom": 2,
                            "pattern": "",
                            "link": "",
                            "cs_condition": "",
                            "cs_styleId": "",
                            "cs_bold": false,
                            "cs_italic": false,
                            "cs_underline": false,
                            "cs_strikethrough": false,
                            "cs_horizontalAlignment": "left",
                            "cs_verticalAlignment": "top",
                            "cs_textColor": "#000000",
                            "cs_backgroundColor": "",
                            "cs_font": "helvetica",
                            "cs_fontSize": 12,
                            "cs_lineSpacing": 1,
                            "cs_paddingLeft": 2,
                            "cs_paddingTop": 2,
                            "cs_paddingRight": 2,
                            "cs_paddingBottom": 2,
                            "spreadsheet_textWrap": false,
                            "borderWidth": 1,
                            "growWeight": 0
                        }
                    ]
                },
                {
                    "elementType": "none",
                    "id": 257,
                    "height": 20,
                    "backgroundColor": "",
                    "alternateBackgroundColor": "",
                    "groupExpression": "${month_nbr}",
                    "printIf": "",
                    "alwaysPrintOnSamePage": true,
                    "pageBreak": false,
                    "repeatGroupHeader": false,
                    "columnData": [
                        {
                            "elementType": "table_text",
                            "id": 258,
                            "width": 42,
                            "content": "${month_txt}",
                            "eval": false,
                            "colspan": "9",
                            "styleId": "286",
                            "bold": true,
                            "italic": false,
                            "underline": false,
                            "strikethrough": false,
                            "horizontalAlignment": "left",
                            "verticalAlignment": "middle",
                            "textColor": "#ffffff",
                            "backgroundColor": "#006374",
                            "font": "notosans",
                            "fontSize": 12,
                            "lineSpacing": 1,
                            "paddingLeft": 2,
                            "paddingTop": 2,
                            "paddingRight": 2,
                            "paddingBottom": 2,
                            "pattern": "",
                            "link": "",
                            "cs_condition": "",
                            "cs_styleId": "",
                            "cs_bold": false,
                            "cs_italic": false,
                            "cs_underline": false,
                            "cs_strikethrough": false,
                            "cs_horizontalAlignment": "left",
                            "cs_verticalAlignment": "top",
                            "cs_textColor": "#000000",
                            "cs_backgroundColor": "",
                            "cs_font": "helvetica",
                            "cs_fontSize": 12,
                            "cs_lineSpacing": 1,
                            "cs_paddingLeft": 2,
                            "cs_paddingTop": 2,
                            "cs_paddingRight": 2,
                            "cs_paddingBottom": 2,
                            "spreadsheet_textWrap": false,
                            "borderWidth": 1,
                            "growWeight": 0
                        },
                        {
                            "elementType": "table_text",
                            "id": 260,
                            "width": 80,
                            "content": "Description",
                            "eval": false,
                            "colspan": "",
                            "styleId": "33",
                            "bold": true,
                            "italic": false,
                            "underline": false,
                            "strikethrough": false,
                            "horizontalAlignment": "left",
                            "verticalAlignment": "middle",
                            "textColor": "#000000",
                            "backgroundColor": "",
                            "font": "notosans",
                            "fontSize": "12",
                            "lineSpacing": 1,
                            "paddingLeft": 2,
                            "paddingTop": 2,
                            "paddingRight": 2,
                            "paddingBottom": 2,
                            "pattern": "",
                            "link": "",
                            "cs_condition": "",
                            "cs_styleId": "",
                            "cs_bold": false,
                            "cs_italic": false,
                            "cs_underline": false,
                            "cs_strikethrough": false,
                            "cs_horizontalAlignment": "left",
                            "cs_verticalAlignment": "top",
                            "cs_textColor": "#000000",
                            "cs_backgroundColor": "",
                            "cs_font": "helvetica",
                            "cs_fontSize": 12,
                            "cs_lineSpacing": 1,
                            "cs_paddingLeft": 2,
                            "cs_paddingTop": 2,
                            "cs_paddingRight": 2,
                            "cs_paddingBottom": 2,
                            "spreadsheet_textWrap": false,
                            "borderWidth": 1,
                            "growWeight": 0
                        },
                        {
                            "elementType": "table_text",
                            "id": 594,
                            "width": 310,
                            "content": "",
                            "eval": false,
                            "colspan": "",
                            "styleId": "",
                            "bold": false,
                            "italic": false,
                            "underline": false,
                            "strikethrough": false,
                            "horizontalAlignment": "left",
                            "verticalAlignment": "top",
                            "textColor": "#000000",
                            "backgroundColor": "",
                            "font": "helvetica",
                            "fontSize": 12,
                            "lineSpacing": 1,
                            "paddingLeft": 2,
                            "paddingTop": 2,
                            "paddingRight": 2,
                            "paddingBottom": 2,
                            "pattern": "",
                            "link": "",
                            "cs_condition": "",
                            "cs_styleId": "",
                            "cs_bold": false,
                            "cs_italic": false,
                            "cs_underline": false,
                            "cs_strikethrough": false,
                            "cs_horizontalAlignment": "left",
                            "cs_verticalAlignment": "top",
                            "cs_textColor": "#000000",
                            "cs_backgroundColor": "",
                            "cs_font": "helvetica",
                            "cs_fontSize": 12,
                            "cs_lineSpacing": 1,
                            "cs_paddingLeft": 2,
                            "cs_paddingTop": 2,
                            "cs_paddingRight": 2,
                            "cs_paddingBottom": 2,
                            "spreadsheet_textWrap": false,
                            "borderWidth": 1,
                            "growWeight": 0
                        },
                        {
                            "elementType": "table_text",
                            "id": 392,
                            "width": 130,
                            "content": "",
                            "eval": false,
                            "colspan": "",
                            "styleId": "",
                            "bold": false,
                            "italic": false,
                            "underline": false,
                            "strikethrough": false,
                            "horizontalAlignment": "left",
                            "verticalAlignment": "top",
                            "textColor": "#000000",
                            "backgroundColor": "",
                            "font": "helvetica",
                            "fontSize": 12,
                            "lineSpacing": 1,
                            "paddingLeft": 2,
                            "paddingTop": 2,
                            "paddingRight": 2,
                            "paddingBottom": 2,
                            "pattern": "",
                            "link": "",
                            "cs_condition": "",
                            "cs_styleId": "",
                            "cs_bold": false,
                            "cs_italic": false,
                            "cs_underline": false,
                            "cs_strikethrough": false,
                            "cs_horizontalAlignment": "left",
                            "cs_verticalAlignment": "top",
                            "cs_textColor": "#000000",
                            "cs_backgroundColor": "",
                            "cs_font": "helvetica",
                            "cs_fontSize": 12,
                            "cs_lineSpacing": 1,
                            "cs_paddingLeft": 2,
                            "cs_paddingTop": 2,
                            "cs_paddingRight": 2,
                            "cs_paddingBottom": 2,
                            "spreadsheet_textWrap": false,
                            "borderWidth": 1,
                            "growWeight": 0
                        },
                        {
                            "elementType": "table_text",
                            "id": 402,
                            "width": 130,
                            "content": "",
                            "eval": false,
                            "colspan": "",
                            "styleId": "",
                            "bold": false,
                            "italic": false,
                            "underline": false,
                            "strikethrough": false,
                            "horizontalAlignment": "left",
                            "verticalAlignment": "top",
                            "textColor": "#000000",
                            "backgroundColor": "",
                            "font": "helvetica",
                            "fontSize": 12,
                            "lineSpacing": 1,
                            "paddingLeft": 2,
                            "paddingTop": 2,
                            "paddingRight": 2,
                            "paddingBottom": 2,
                            "pattern": "",
                            "link": "",
                            "cs_condition": "",
                            "cs_styleId": "",
                            "cs_bold": false,
                            "cs_italic": false,
                            "cs_underline": false,
                            "cs_strikethrough": false,
                            "cs_horizontalAlignment": "left",
                            "cs_verticalAlignment": "top",
                            "cs_textColor": "#000000",
                            "cs_backgroundColor": "",
                            "cs_font": "helvetica",
                            "cs_fontSize": 12,
                            "cs_lineSpacing": 1,
                            "cs_paddingLeft": 2,
                            "cs_paddingTop": 2,
                            "cs_paddingRight": 2,
                            "cs_paddingBottom": 2,
                            "spreadsheet_textWrap": false,
                            "borderWidth": 1,
                            "growWeight": 0
                        },
                        {
                            "elementType": "table_text",
                            "id": 601,
                            "width": 130,
                            "content": "",
                            "eval": false,
                            "colspan": "",
                            "styleId": "",
                            "bold": false,
                            "italic": false,
                            "underline": false,
                            "strikethrough": false,
                            "horizontalAlignment": "left",
                            "verticalAlignment": "top",
                            "textColor": "#000000",
                            "backgroundColor": "",
                            "font": "helvetica",
                            "fontSize": 12,
                            "lineSpacing": 1,
                            "paddingLeft": 2,
                            "paddingTop": 2,
                            "paddingRight": 2,
                            "paddingBottom": 2,
                            "pattern": "",
                            "link": "",
                            "cs_condition": "",
                            "cs_styleId": "",
                            "cs_bold": false,
                            "cs_italic": false,
                            "cs_underline": false,
                            "cs_strikethrough": false,
                            "cs_horizontalAlignment": "left",
                            "cs_verticalAlignment": "top",
                            "cs_textColor": "#000000",
                            "cs_backgroundColor": "",
                            "cs_font": "helvetica",
                            "cs_fontSize": 12,
                            "cs_lineSpacing": 1,
                            "cs_paddingLeft": 2,
                            "cs_paddingTop": 2,
                            "cs_paddingRight": 2,
                            "cs_paddingBottom": 2,
                            "spreadsheet_textWrap": false,
                            "borderWidth": 1,
                            "growWeight": 0
                        }
                    ]
                },
                {
                    "elementType": "none",
                    "id": 642,
                    "height": 20,
                    "backgroundColor": "",
                    "alternateBackgroundColor": "",
                    "groupExpression": "${month_hf_code}",
                    "printIf": "",
                    "alwaysPrintOnSamePage": true,
                    "pageBreak": false,
                    "repeatGroupHeader": false,
                    "columnData": [
                        {
                            "elementType": "table_text",
                            "id": 643,
                            "width": 42,
                            "content": "",
                            "eval": false,
                            "colspan": "",
                            "styleId": "338",
                            "bold": false,
                            "italic": false,
                            "underline": false,
                            "strikethrough": false,
                            "horizontalAlignment": "left",
                            "verticalAlignment": "top",
                            "textColor": "#cccccc",
                            "backgroundColor": "#cccccc",
                            "font": "helvetica",
                            "fontSize": 12,
                            "lineSpacing": 1,
                            "paddingLeft": 0,
                            "paddingTop": 0,
                            "paddingRight": 0,
                            "paddingBottom": 0,
                            "pattern": "",
                            "link": "",
                            "cs_condition": "",
                            "cs_styleId": "",
                            "cs_bold": false,
                            "cs_italic": false,
                            "cs_underline": false,
                            "cs_strikethrough": false,
                            "cs_horizontalAlignment": "left",
                            "cs_verticalAlignment": "top",
                            "cs_textColor": "#000000",
                            "cs_backgroundColor": "",
                            "cs_font": "helvetica",
                            "cs_fontSize": 12,
                            "cs_lineSpacing": 1,
                            "cs_paddingLeft": 2,
                            "cs_paddingTop": 2,
                            "cs_paddingRight": 2,
                            "cs_paddingBottom": 2,
                            "spreadsheet_textWrap": false,
                            "borderWidth": 1,
                            "growWeight": 0
                        },
                        {
                            "elementType": "table_text",
                            "id": 644,
                            "width": 80,
                            "content": "'Health Facility: ' + ${hf_code} + ' - ' + ${hf_name} if ${hf_code} != '????????' else 'Health Facility: /'",
                            "eval": true,
                            "colspan": "6",
                            "styleId": "337",
                            "bold": true,
                            "italic": false,
                            "underline": false,
                            "strikethrough": false,
                            "horizontalAlignment": "left",
                            "verticalAlignment": "middle",
                            "textColor": "#ffffff",
                            "backgroundColor": "#80B0B9",
                            "font": "notosans",
                            "fontSize": 12,
                            "lineSpacing": 1,
                            "paddingLeft": 2,
                            "paddingTop": 2,
                            "paddingRight": 2,
                            "paddingBottom": 2,
                            "pattern": "",
                            "link": "",
                            "cs_condition": "",
                            "cs_styleId": "",
                            "cs_bold": false,
                            "cs_italic": false,
                            "cs_underline": false,
                            "cs_strikethrough": false,
                            "cs_horizontalAlignment": "left",
                            "cs_verticalAlignment": "top",
                            "cs_textColor": "#000000",
                            "cs_backgroundColor": "",
                            "cs_font": "helvetica",
                            "cs_fontSize": 12,
                            "cs_lineSpacing": 1,
                            "cs_paddingLeft": 2,
                            "cs_paddingTop": 2,
                            "cs_paddingRight": 2,
                            "cs_paddingBottom": 2,
                            "spreadsheet_textWrap": false,
                            "borderWidth": 1,
                            "growWeight": 0
                        },
                        {
                            "elementType": "table_text",
                            "id": 645,
                            "width": 310,
                            "content": "",
                            "eval": false,
                            "colspan": "",
                            "styleId": "",
                            "bold": false,
                            "italic": false,
                            "underline": false,
                            "strikethrough": false,
                            "horizontalAlignment": "left",
                            "verticalAlignment": "top",
                            "textColor": "#000000",
                            "backgroundColor": "",
                            "font": "helvetica",
                            "fontSize": 12,
                            "lineSpacing": 1,
                            "paddingLeft": 2,
                            "paddingTop": 2,
                            "paddingRight": 2,
                            "paddingBottom": 2,
                            "pattern": "",
                            "link": "",
                            "cs_condition": "",
                            "cs_styleId": "",
                            "cs_bold": false,
                            "cs_italic": false,
                            "cs_underline": false,
                            "cs_strikethrough": false,
                            "cs_horizontalAlignment": "left",
                            "cs_verticalAlignment": "top",
                            "cs_textColor": "#000000",
                            "cs_backgroundColor": "",
                            "cs_font": "helvetica",
                            "cs_fontSize": 12,
                            "cs_lineSpacing": 1,
                            "cs_paddingLeft": 2,
                            "cs_paddingTop": 2,
                            "cs_paddingRight": 2,
                            "cs_paddingBottom": 2,
                            "spreadsheet_textWrap": false,
                            "borderWidth": 1,
                            "growWeight": 0
                        },
                        {
                            "elementType": "table_text",
                            "id": 647,
                            "width": 130,
                            "content": "",
                            "eval": false,
                            "colspan": "",
                            "styleId": "",
                            "bold": false,
                            "italic": false,
                            "underline": false,
                            "strikethrough": false,
                            "horizontalAlignment": "left",
                            "verticalAlignment": "top",
                            "textColor": "#000000",
                            "backgroundColor": "",
                            "font": "helvetica",
                            "fontSize": 12,
                            "lineSpacing": 1,
                            "paddingLeft": 2,
                            "paddingTop": 2,
                            "paddingRight": 2,
                            "paddingBottom": 2,
                            "pattern": "",
                            "link": "",
                            "cs_condition": "",
                            "cs_styleId": "",
                            "cs_bold": false,
                            "cs_italic": false,
                            "cs_underline": false,
                            "cs_strikethrough": false,
                            "cs_horizontalAlignment": "left",
                            "cs_verticalAlignment": "top",
                            "cs_textColor": "#000000",
                            "cs_backgroundColor": "",
                            "cs_font": "helvetica",
                            "cs_fontSize": 12,
                            "cs_lineSpacing": 1,
                            "cs_paddingLeft": 2,
                            "cs_paddingTop": 2,
                            "cs_paddingRight": 2,
                            "cs_paddingBottom": 2,
                            "spreadsheet_textWrap": false,
                            "borderWidth": 1,
                            "growWeight": 0
                        },
                        {
                            "elementType": "table_text",
                            "id": 648,
                            "width": 130,
                            "content": "",
                            "eval": false,
                            "colspan": "",
                            "styleId": "",
                            "bold": false,
                            "italic": false,
                            "underline": false,
                            "strikethrough": false,
                            "horizontalAlignment": "left",
                            "verticalAlignment": "top",
                            "textColor": "#000000",
                            "backgroundColor": "",
                            "font": "helvetica",
                            "fontSize": 12,
                            "lineSpacing": 1,
                            "paddingLeft": 2,
                            "paddingTop": 2,
                            "paddingRight": 2,
                            "paddingBottom": 2,
                            "pattern": "",
                            "link": "",
                            "cs_condition": "",
                            "cs_styleId": "",
                            "cs_bold": false,
                            "cs_italic": false,
                            "cs_underline": false,
                            "cs_strikethrough": false,
                            "cs_horizontalAlignment": "left",
                            "cs_verticalAlignment": "top",
                            "cs_textColor": "#000000",
                            "cs_backgroundColor": "",
                            "cs_font": "helvetica",
                            "cs_fontSize": 12,
                            "cs_lineSpacing": 1,
                            "cs_paddingLeft": 2,
                            "cs_paddingTop": 2,
                            "cs_paddingRight": 2,
                            "cs_paddingBottom": 2,
                            "spreadsheet_textWrap": false,
                            "borderWidth": 1,
                            "growWeight": 0
                        },
                        {
                            "elementType": "table_text",
                            "id": 649,
                            "width": 130,
                            "content": "",
                            "eval": false,
                            "colspan": "",
                            "styleId": "",
                            "bold": false,
                            "italic": false,
                            "underline": false,
                            "strikethrough": false,
                            "horizontalAlignment": "left",
                            "verticalAlignment": "top",
                            "textColor": "#000000",
                            "backgroundColor": "",
                            "font": "helvetica",
                            "fontSize": 12,
                            "lineSpacing": 1,
                            "paddingLeft": 2,
                            "paddingTop": 2,
                            "paddingRight": 2,
                            "paddingBottom": 2,
                            "pattern": "",
                            "link": "",
                            "cs_condition": "",
                            "cs_styleId": "",
                            "cs_bold": false,
                            "cs_italic": false,
                            "cs_underline": false,
                            "cs_strikethrough": false,
                            "cs_horizontalAlignment": "left",
                            "cs_verticalAlignment": "top",
                            "cs_textColor": "#000000",
                            "cs_backgroundColor": "",
                            "cs_font": "helvetica",
                            "cs_fontSize": 12,
                            "cs_lineSpacing": 1,
                            "cs_paddingLeft": 2,
                            "cs_paddingTop": 2,
                            "cs_paddingRight": 2,
                            "cs_paddingBottom": 2,
                            "spreadsheet_textWrap": false,
                            "borderWidth": 1,
                            "growWeight": 0
                        }
                    ]
                },
                {
                    "elementType": "none",
                    "id": 571,
                    "height": 20,
                    "backgroundColor": "",
                    "alternateBackgroundColor": "",
                    "groupExpression": "",
                    "printIf": "",
                    "alwaysPrintOnSamePage": true,
                    "pageBreak": false,
                    "repeatGroupHeader": false,
                    "columnData": [
                        {
                            "elementType": "table_text",
                            "id": 572,
                            "width": 42,
                            "content": "",
                            "eval": false,
                            "colspan": "2",
                            "styleId": "338",
                            "bold": false,
                            "italic": false,
                            "underline": false,
                            "strikethrough": false,
                            "horizontalAlignment": "left",
                            "verticalAlignment": "top",
                            "textColor": "#cccccc",
                            "backgroundColor": "#cccccc",
                            "font": "helvetica",
                            "fontSize": 12,
                            "lineSpacing": 1,
                            "paddingLeft": 0,
                            "paddingTop": 0,
                            "paddingRight": 0,
                            "paddingBottom": 0,
                            "pattern": "",
                            "link": "",
                            "cs_condition": "",
                            "cs_styleId": "",
                            "cs_bold": false,
                            "cs_italic": false,
                            "cs_underline": false,
                            "cs_strikethrough": false,
                            "cs_horizontalAlignment": "left",
                            "cs_verticalAlignment": "top",
                            "cs_textColor": "#000000",
                            "cs_backgroundColor": "",
                            "cs_font": "helvetica",
                            "cs_fontSize": 12,
                            "cs_lineSpacing": 1,
                            "cs_paddingLeft": 2,
                            "cs_paddingTop": 2,
                            "cs_paddingRight": 2,
                            "cs_paddingBottom": 2,
                            "spreadsheet_textWrap": false,
                            "borderWidth": 1,
                            "growWeight": 0
                        },
                        {
                            "elementType": "table_text",
                            "id": 573,
                            "width": 80,
                            "content": "",
                            "eval": false,
                            "colspan": "",
                            "styleId": "",
                            "bold": false,
                            "italic": false,
                            "underline": false,
                            "strikethrough": false,
                            "horizontalAlignment": "left",
                            "verticalAlignment": "top",
                            "textColor": "#000000",
                            "backgroundColor": "",
                            "font": "helvetica",
                            "fontSize": 12,
                            "lineSpacing": 1,
                            "paddingLeft": 2,
                            "paddingTop": 2,
                            "paddingRight": 2,
                            "paddingBottom": 2,
                            "pattern": "",
                            "link": "",
                            "cs_condition": "",
                            "cs_styleId": "",
                            "cs_bold": false,
                            "cs_italic": false,
                            "cs_underline": false,
                            "cs_strikethrough": false,
                            "cs_horizontalAlignment": "left",
                            "cs_verticalAlignment": "top",
                            "cs_textColor": "#000000",
                            "cs_backgroundColor": "",
                            "cs_font": "helvetica",
                            "cs_fontSize": 12,
                            "cs_lineSpacing": 1,
                            "cs_paddingLeft": 2,
                            "cs_paddingTop": 2,
                            "cs_paddingRight": 2,
                            "cs_paddingBottom": 2,
                            "spreadsheet_textWrap": false,
                            "borderWidth": 1,
                            "growWeight": 0
                        },
                        {
                            "elementType": "table_text",
                            "id": 595,
                            "width": 310,
                            "content": "${product_code} + ' - ' + ${product_name} if ${product_code} != '????????' else '/'",
                            "eval": true,
                            "colspan": "",
                            "styleId": "296",
                            "bold": false,
                            "italic": false,
                            "underline": false,
                            "strikethrough": false,
                            "horizontalAlignment": "center",
                            "verticalAlignment": "middle",
                            "textColor": "#000000",
                            "backgroundColor": "",
                            "font": "notosans",
                            "fontSize": "11",
                            "lineSpacing": 1,
                            "paddingLeft": 2,
                            "paddingTop": 2,
                            "paddingRight": 2,
                            "paddingBottom": 2,
                            "pattern": "",
                            "link": "",
                            "cs_condition": "",
                            "cs_styleId": "",
                            "cs_bold": false,
                            "cs_italic": false,
                            "cs_underline": false,
                            "cs_strikethrough": false,
                            "cs_horizontalAlignment": "left",
                            "cs_verticalAlignment": "top",
                            "cs_textColor": "#000000",
                            "cs_backgroundColor": "",
                            "cs_font": "helvetica",
                            "cs_fontSize": 12,
                            "cs_lineSpacing": 1,
                            "cs_paddingLeft": 2,
                            "cs_paddingTop": 2,
                            "cs_paddingRight": 2,
                            "cs_paddingBottom": 2,
                            "spreadsheet_textWrap": false,
                            "borderWidth": 1,
                            "growWeight": 0
                        },
                        {
                            "elementType": "table_text",
                            "id": 575,
                            "width": 130,
                            "content": "${product_total_t}",
                            "eval": false,
                            "colspan": "",
                            "styleId": "296",
                            "bold": false,
                            "italic": false,
                            "underline": false,
                            "strikethrough": false,
                            "horizontalAlignment": "center",
                            "verticalAlignment": "middle",
                            "textColor": "#000000",
                            "backgroundColor": "",
                            "font": "notosans",
                            "fontSize": "11",
                            "lineSpacing": 1,
                            "paddingLeft": 2,
                            "paddingTop": 2,
                            "paddingRight": 2,
                            "paddingBottom": 2,
                            "pattern": "",
                            "link": "",
                            "cs_condition": "",
                            "cs_styleId": "",
                            "cs_bold": false,
                            "cs_italic": false,
                            "cs_underline": false,
                            "cs_strikethrough": false,
                            "cs_horizontalAlignment": "left",
                            "cs_verticalAlignment": "top",
                            "cs_textColor": "#000000",
                            "cs_backgroundColor": "",
                            "cs_font": "helvetica",
                            "cs_fontSize": 12,
                            "cs_lineSpacing": 1,
                            "cs_paddingLeft": 2,
                            "cs_paddingTop": 2,
                            "cs_paddingRight": 2,
                            "cs_paddingBottom": 2,
                            "spreadsheet_textWrap": false,
                            "borderWidth": 1,
                            "growWeight": 0
                        },
                        {
                            "elementType": "table_text",
                            "id": 576,
                            "width": 130,
                            "content": "${product_total_p}",
                            "eval": false,
                            "colspan": "",
                            "styleId": "296",
                            "bold": false,
                            "italic": false,
                            "underline": false,
                            "strikethrough": false,
                            "horizontalAlignment": "center",
                            "verticalAlignment": "middle",
                            "textColor": "#000000",
                            "backgroundColor": "",
                            "font": "notosans",
                            "fontSize": "11",
                            "lineSpacing": 1,
                            "paddingLeft": 2,
                            "paddingTop": 2,
                            "paddingRight": 2,
                            "paddingBottom": 2,
                            "pattern": "",
                            "link": "",
                            "cs_condition": "",
                            "cs_styleId": "",
                            "cs_bold": false,
                            "cs_italic": false,
                            "cs_underline": false,
                            "cs_strikethrough": false,
                            "cs_horizontalAlignment": "left",
                            "cs_verticalAlignment": "top",
                            "cs_textColor": "#000000",
                            "cs_backgroundColor": "",
                            "cs_font": "helvetica",
                            "cs_fontSize": 12,
                            "cs_lineSpacing": 1,
                            "cs_paddingLeft": 2,
                            "cs_paddingTop": 2,
                            "cs_paddingRight": 2,
                            "cs_paddingBottom": 2,
                            "spreadsheet_textWrap": false,
                            "borderWidth": 1,
                            "growWeight": 0
                        },
                        {
                            "elementType": "table_text",
                            "id": 602,
                            "width": 130,
                            "content": "${product_total_r}",
                            "eval": false,
                            "colspan": "",
                            "styleId": "296",
                            "bold": false,
                            "italic": false,
                            "underline": false,
                            "strikethrough": false,
                            "horizontalAlignment": "center",
                            "verticalAlignment": "middle",
                            "textColor": "#000000",
                            "backgroundColor": "",
                            "font": "notosans",
                            "fontSize": "11",
                            "lineSpacing": 1,
                            "paddingLeft": 2,
                            "paddingTop": 2,
                            "paddingRight": 2,
                            "paddingBottom": 2,
                            "pattern": "",
                            "link": "",
                            "cs_condition": "",
                            "cs_styleId": "",
                            "cs_bold": false,
                            "cs_italic": false,
                            "cs_underline": false,
                            "cs_strikethrough": false,
                            "cs_horizontalAlignment": "left",
                            "cs_verticalAlignment": "top",
                            "cs_textColor": "#000000",
                            "cs_backgroundColor": "",
                            "cs_font": "helvetica",
                            "cs_fontSize": 12,
                            "cs_lineSpacing": 1,
                            "cs_paddingLeft": 2,
                            "cs_paddingTop": 2,
                            "cs_paddingRight": 2,
                            "cs_paddingBottom": 2,
                            "spreadsheet_textWrap": false,
                            "borderWidth": 1,
                            "growWeight": 0
                        }
                    ]
                },
                {
                    "elementType": "none",
                    "id": 658,
                    "height": 20,
                    "backgroundColor": "",
                    "alternateBackgroundColor": "",
                    "groupExpression": "${month_hf_code}",
                    "printIf": "",
                    "alwaysPrintOnSamePage": true,
                    "pageBreak": false,
                    "repeatGroupHeader": false,
                    "columnData": [
                        {
                            "elementType": "table_text",
                            "id": 659,
                            "width": 42,
                            "content": "",
                            "eval": false,
                            "colspan": "",
                            "styleId": "338",
                            "bold": false,
                            "italic": false,
                            "underline": false,
                            "strikethrough": false,
                            "horizontalAlignment": "left",
                            "verticalAlignment": "top",
                            "textColor": "#cccccc",
                            "backgroundColor": "#cccccc",
                            "font": "helvetica",
                            "fontSize": 12,
                            "lineSpacing": 1,
                            "paddingLeft": 0,
                            "paddingTop": 0,
                            "paddingRight": 0,
                            "paddingBottom": 0,
                            "pattern": "",
                            "link": "",
                            "cs_condition": "",
                            "cs_styleId": "",
                            "cs_bold": false,
                            "cs_italic": false,
                            "cs_underline": false,
                            "cs_strikethrough": false,
                            "cs_horizontalAlignment": "left",
                            "cs_verticalAlignment": "top",
                            "cs_textColor": "#000000",
                            "cs_backgroundColor": "",
                            "cs_font": "helvetica",
                            "cs_fontSize": 12,
                            "cs_lineSpacing": 1,
                            "cs_paddingLeft": 2,
                            "cs_paddingTop": 2,
                            "cs_paddingRight": 2,
                            "cs_paddingBottom": 2,
                            "spreadsheet_textWrap": false,
                            "borderWidth": 1,
                            "growWeight": 0
                        },
                        {
                            "elementType": "table_text",
                            "id": 660,
                            "width": 80,
                            "content": "'Total for ' + ${hf_code} + ' - ' + ${hf_name} if ${hf_code} != '????????' else 'Total'",
                            "eval": true,
                            "colspan": "2",
                            "styleId": "666",
                            "bold": true,
                            "italic": false,
                            "underline": false,
                            "strikethrough": false,
                            "horizontalAlignment": "center",
                            "verticalAlignment": "middle",
                            "textColor": "#80B0B9",
                            "backgroundColor": "",
                            "font": "notosans",
                            "fontSize": 12,
                            "lineSpacing": 1,
                            "paddingLeft": 2,
                            "paddingTop": 2,
                            "paddingRight": 2,
                            "paddingBottom": 2,
                            "pattern": "",
                            "link": "",
                            "cs_condition": "",
                            "cs_styleId": "",
                            "cs_bold": false,
                            "cs_italic": false,
                            "cs_underline": false,
                            "cs_strikethrough": false,
                            "cs_horizontalAlignment": "left",
                            "cs_verticalAlignment": "top",
                            "cs_textColor": "#000000",
                            "cs_backgroundColor": "",
                            "cs_font": "helvetica",
                            "cs_fontSize": 12,
                            "cs_lineSpacing": 1,
                            "cs_paddingLeft": 2,
                            "cs_paddingTop": 2,
                            "cs_paddingRight": 2,
                            "cs_paddingBottom": 2,
                            "spreadsheet_textWrap": false,
                            "borderWidth": 1,
                            "growWeight": 0
                        },
                        {
                            "elementType": "table_text",
                            "id": 661,
                            "width": 310,
                            "content": "",
                            "eval": false,
                            "colspan": "",
                            "styleId": "",
                            "bold": false,
                            "italic": false,
                            "underline": false,
                            "strikethrough": false,
                            "horizontalAlignment": "left",
                            "verticalAlignment": "top",
                            "textColor": "#000000",
                            "backgroundColor": "",
                            "font": "helvetica",
                            "fontSize": 12,
                            "lineSpacing": 1,
                            "paddingLeft": 2,
                            "paddingTop": 2,
                            "paddingRight": 2,
                            "paddingBottom": 2,
                            "pattern": "",
                            "link": "",
                            "cs_condition": "",
                            "cs_styleId": "",
                            "cs_bold": false,
                            "cs_italic": false,
                            "cs_underline": false,
                            "cs_strikethrough": false,
                            "cs_horizontalAlignment": "left",
                            "cs_verticalAlignment": "top",
                            "cs_textColor": "#000000",
                            "cs_backgroundColor": "",
                            "cs_font": "helvetica",
                            "cs_fontSize": 12,
                            "cs_lineSpacing": 1,
                            "cs_paddingLeft": 2,
                            "cs_paddingTop": 2,
                            "cs_paddingRight": 2,
                            "cs_paddingBottom": 2,
                            "spreadsheet_textWrap": false,
                            "borderWidth": 1,
                            "growWeight": 0
                        },
                        {
                            "elementType": "table_text",
                            "id": 663,
                            "width": 130,
                            "content": "${hf_total_t}",
                            "eval": false,
                            "colspan": "",
                            "styleId": "666",
                            "bold": true,
                            "italic": false,
                            "underline": false,
                            "strikethrough": false,
                            "horizontalAlignment": "center",
                            "verticalAlignment": "middle",
                            "textColor": "#80B0B9",
                            "backgroundColor": "",
                            "font": "notosans",
                            "fontSize": 12,
                            "lineSpacing": 1,
                            "paddingLeft": 2,
                            "paddingTop": 2,
                            "paddingRight": 2,
                            "paddingBottom": 2,
                            "pattern": "",
                            "link": "",
                            "cs_condition": "",
                            "cs_styleId": "",
                            "cs_bold": false,
                            "cs_italic": false,
                            "cs_underline": false,
                            "cs_strikethrough": false,
                            "cs_horizontalAlignment": "left",
                            "cs_verticalAlignment": "top",
                            "cs_textColor": "#000000",
                            "cs_backgroundColor": "",
                            "cs_font": "helvetica",
                            "cs_fontSize": 12,
                            "cs_lineSpacing": 1,
                            "cs_paddingLeft": 2,
                            "cs_paddingTop": 2,
                            "cs_paddingRight": 2,
                            "cs_paddingBottom": 2,
                            "spreadsheet_textWrap": false,
                            "borderWidth": 1,
                            "growWeight": 0
                        },
                        {
                            "elementType": "table_text",
                            "id": 664,
                            "width": 130,
                            "content": "${hf_total_p}",
                            "eval": false,
                            "colspan": "",
                            "styleId": "666",
                            "bold": true,
                            "italic": false,
                            "underline": false,
                            "strikethrough": false,
                            "horizontalAlignment": "center",
                            "verticalAlignment": "middle",
                            "textColor": "#80B0B9",
                            "backgroundColor": "",
                            "font": "notosans",
                            "fontSize": 12,
                            "lineSpacing": 1,
                            "paddingLeft": 2,
                            "paddingTop": 2,
                            "paddingRight": 2,
                            "paddingBottom": 2,
                            "pattern": "",
                            "link": "",
                            "cs_condition": "",
                            "cs_styleId": "",
                            "cs_bold": false,
                            "cs_italic": false,
                            "cs_underline": false,
                            "cs_strikethrough": false,
                            "cs_horizontalAlignment": "left",
                            "cs_verticalAlignment": "top",
                            "cs_textColor": "#000000",
                            "cs_backgroundColor": "",
                            "cs_font": "helvetica",
                            "cs_fontSize": 12,
                            "cs_lineSpacing": 1,
                            "cs_paddingLeft": 2,
                            "cs_paddingTop": 2,
                            "cs_paddingRight": 2,
                            "cs_paddingBottom": 2,
                            "spreadsheet_textWrap": false,
                            "borderWidth": 1,
                            "growWeight": 0
                        },
                        {
                            "elementType": "table_text",
                            "id": 665,
                            "width": 130,
                            "content": "${hf_total_r}",
                            "eval": false,
                            "colspan": "",
                            "styleId": "666",
                            "bold": true,
                            "italic": false,
                            "underline": false,
                            "strikethrough": false,
                            "horizontalAlignment": "center",
                            "verticalAlignment": "middle",
                            "textColor": "#80B0B9",
                            "backgroundColor": "",
                            "font": "notosans",
                            "fontSize": 12,
                            "lineSpacing": 1,
                            "paddingLeft": 2,
                            "paddingTop": 2,
                            "paddingRight": 2,
                            "paddingBottom": 2,
                            "pattern": "",
                            "link": "",
                            "cs_condition": "",
                            "cs_styleId": "",
                            "cs_bold": false,
                            "cs_italic": false,
                            "cs_underline": false,
                            "cs_strikethrough": false,
                            "cs_horizontalAlignment": "left",
                            "cs_verticalAlignment": "top",
                            "cs_textColor": "#000000",
                            "cs_backgroundColor": "",
                            "cs_font": "helvetica",
                            "cs_fontSize": 12,
                            "cs_lineSpacing": 1,
                            "cs_paddingLeft": 2,
                            "cs_paddingTop": 2,
                            "cs_paddingRight": 2,
                            "cs_paddingBottom": 2,
                            "spreadsheet_textWrap": false,
                            "borderWidth": 1,
                            "growWeight": 0
                        }
                    ]
                },
                {
                    "elementType": "none",
                    "id": 650,
                    "height": 20,
                    "backgroundColor": "",
                    "alternateBackgroundColor": "",
                    "groupExpression": "${month_nbr}",
                    "printIf": "",
                    "alwaysPrintOnSamePage": true,
                    "pageBreak": false,
                    "repeatGroupHeader": false,
                    "columnData": [
                        {
                            "elementType": "table_text",
                            "id": 651,
                            "width": 42,
                            "content": "Total for ${month_txt}",
                            "eval": false,
                            "colspan": "3",
                            "styleId": "615",
                            "bold": true,
                            "italic": false,
                            "underline": false,
                            "strikethrough": false,
                            "horizontalAlignment": "center",
                            "verticalAlignment": "middle",
                            "textColor": "#006374",
                            "backgroundColor": "",
                            "font": "notosans",
                            "fontSize": 12,
                            "lineSpacing": 1,
                            "paddingLeft": 2,
                            "paddingTop": 2,
                            "paddingRight": 2,
                            "paddingBottom": 2,
                            "pattern": "",
                            "link": "",
                            "cs_condition": "",
                            "cs_styleId": "",
                            "cs_bold": false,
                            "cs_italic": false,
                            "cs_underline": false,
                            "cs_strikethrough": false,
                            "cs_horizontalAlignment": "left",
                            "cs_verticalAlignment": "top",
                            "cs_textColor": "#000000",
                            "cs_backgroundColor": "",
                            "cs_font": "helvetica",
                            "cs_fontSize": 12,
                            "cs_lineSpacing": 1,
                            "cs_paddingLeft": 2,
                            "cs_paddingTop": 2,
                            "cs_paddingRight": 2,
                            "cs_paddingBottom": 2,
                            "spreadsheet_textWrap": false,
                            "borderWidth": 1,
                            "growWeight": 0
                        },
                        {
                            "elementType": "table_text",
                            "id": 652,
                            "width": 80,
                            "content": "",
                            "eval": false,
                            "colspan": "",
                            "styleId": "",
                            "bold": false,
                            "italic": false,
                            "underline": false,
                            "strikethrough": false,
                            "horizontalAlignment": "left",
                            "verticalAlignment": "top",
                            "textColor": "#000000",
                            "backgroundColor": "",
                            "font": "helvetica",
                            "fontSize": 12,
                            "lineSpacing": 1,
                            "paddingLeft": 2,
                            "paddingTop": 2,
                            "paddingRight": 2,
                            "paddingBottom": 2,
                            "pattern": "",
                            "link": "",
                            "cs_condition": "",
                            "cs_styleId": "",
                            "cs_bold": false,
                            "cs_italic": false,
                            "cs_underline": false,
                            "cs_strikethrough": false,
                            "cs_horizontalAlignment": "left",
                            "cs_verticalAlignment": "top",
                            "cs_textColor": "#000000",
                            "cs_backgroundColor": "",
                            "cs_font": "helvetica",
                            "cs_fontSize": 12,
                            "cs_lineSpacing": 1,
                            "cs_paddingLeft": 2,
                            "cs_paddingTop": 2,
                            "cs_paddingRight": 2,
                            "cs_paddingBottom": 2,
                            "spreadsheet_textWrap": false,
                            "borderWidth": 1,
                            "growWeight": 0
                        },
                        {
                            "elementType": "table_text",
                            "id": 653,
                            "width": 310,
                            "content": "",
                            "eval": false,
                            "colspan": "",
                            "styleId": "",
                            "bold": false,
                            "italic": false,
                            "underline": false,
                            "strikethrough": false,
                            "horizontalAlignment": "left",
                            "verticalAlignment": "top",
                            "textColor": "#000000",
                            "backgroundColor": "",
                            "font": "helvetica",
                            "fontSize": 12,
                            "lineSpacing": 1,
                            "paddingLeft": 2,
                            "paddingTop": 2,
                            "paddingRight": 2,
                            "paddingBottom": 2,
                            "pattern": "",
                            "link": "",
                            "cs_condition": "",
                            "cs_styleId": "",
                            "cs_bold": false,
                            "cs_italic": false,
                            "cs_underline": false,
                            "cs_strikethrough": false,
                            "cs_horizontalAlignment": "left",
                            "cs_verticalAlignment": "top",
                            "cs_textColor": "#000000",
                            "cs_backgroundColor": "",
                            "cs_font": "helvetica",
                            "cs_fontSize": 12,
                            "cs_lineSpacing": 1,
                            "cs_paddingLeft": 2,
                            "cs_paddingTop": 2,
                            "cs_paddingRight": 2,
                            "cs_paddingBottom": 2,
                            "spreadsheet_textWrap": false,
                            "borderWidth": 1,
                            "growWeight": 0
                        },
                        {
                            "elementType": "table_text",
                            "id": 655,
                            "width": 130,
                            "content": "${monthly_total_t}",
                            "eval": false,
                            "colspan": "",
                            "styleId": "615",
                            "bold": true,
                            "italic": false,
                            "underline": false,
                            "strikethrough": false,
                            "horizontalAlignment": "center",
                            "verticalAlignment": "middle",
                            "textColor": "#006374",
                            "backgroundColor": "",
                            "font": "notosans",
                            "fontSize": 12,
                            "lineSpacing": 1,
                            "paddingLeft": 2,
                            "paddingTop": 2,
                            "paddingRight": 2,
                            "paddingBottom": 2,
                            "pattern": "",
                            "link": "",
                            "cs_condition": "",
                            "cs_styleId": "",
                            "cs_bold": false,
                            "cs_italic": false,
                            "cs_underline": false,
                            "cs_strikethrough": false,
                            "cs_horizontalAlignment": "left",
                            "cs_verticalAlignment": "top",
                            "cs_textColor": "#000000",
                            "cs_backgroundColor": "",
                            "cs_font": "helvetica",
                            "cs_fontSize": 12,
                            "cs_lineSpacing": 1,
                            "cs_paddingLeft": 2,
                            "cs_paddingTop": 2,
                            "cs_paddingRight": 2,
                            "cs_paddingBottom": 2,
                            "spreadsheet_textWrap": false,
                            "borderWidth": 1,
                            "growWeight": 0
                        },
                        {
                            "elementType": "table_text",
                            "id": 656,
                            "width": 130,
                            "content": "${monthly_total_p}",
                            "eval": false,
                            "colspan": "",
                            "styleId": "615",
                            "bold": true,
                            "italic": false,
                            "underline": false,
                            "strikethrough": false,
                            "horizontalAlignment": "center",
                            "verticalAlignment": "middle",
                            "textColor": "#006374",
                            "backgroundColor": "",
                            "font": "notosans",
                            "fontSize": 12,
                            "lineSpacing": 1,
                            "paddingLeft": 2,
                            "paddingTop": 2,
                            "paddingRight": 2,
                            "paddingBottom": 2,
                            "pattern": "",
                            "link": "",
                            "cs_condition": "",
                            "cs_styleId": "",
                            "cs_bold": false,
                            "cs_italic": false,
                            "cs_underline": false,
                            "cs_strikethrough": false,
                            "cs_horizontalAlignment": "left",
                            "cs_verticalAlignment": "top",
                            "cs_textColor": "#000000",
                            "cs_backgroundColor": "",
                            "cs_font": "helvetica",
                            "cs_fontSize": 12,
                            "cs_lineSpacing": 1,
                            "cs_paddingLeft": 2,
                            "cs_paddingTop": 2,
                            "cs_paddingRight": 2,
                            "cs_paddingBottom": 2,
                            "spreadsheet_textWrap": false,
                            "borderWidth": 1,
                            "growWeight": 0
                        },
                        {
                            "elementType": "table_text",
                            "id": 657,
                            "width": 130,
                            "content": "${monthly_total_r}",
                            "eval": false,
                            "colspan": "",
                            "styleId": "615",
                            "bold": true,
                            "italic": false,
                            "underline": false,
                            "strikethrough": false,
                            "horizontalAlignment": "center",
                            "verticalAlignment": "middle",
                            "textColor": "#006374",
                            "backgroundColor": "",
                            "font": "notosans",
                            "fontSize": 12,
                            "lineSpacing": 1,
                            "paddingLeft": 2,
                            "paddingTop": 2,
                            "paddingRight": 2,
                            "paddingBottom": 2,
                            "pattern": "",
                            "link": "",
                            "cs_condition": "",
                            "cs_styleId": "",
                            "cs_bold": false,
                            "cs_italic": false,
                            "cs_underline": false,
                            "cs_strikethrough": false,
                            "cs_horizontalAlignment": "left",
                            "cs_verticalAlignment": "top",
                            "cs_textColor": "#000000",
                            "cs_backgroundColor": "",
                            "cs_font": "helvetica",
                            "cs_fontSize": 12,
                            "cs_lineSpacing": 1,
                            "cs_paddingLeft": 2,
                            "cs_paddingTop": 2,
                            "cs_paddingRight": 2,
                            "cs_paddingBottom": 2,
                            "spreadsheet_textWrap": false,
                            "borderWidth": 1,
                            "growWeight": 0
                        }
                    ]
                },
                {
                    "elementType": "none",
                    "id": 199,
                    "height": 20,
                    "backgroundColor": "",
                    "alternateBackgroundColor": "",
                    "groupExpression": "${month_nbr}",
                    "printIf": "",
                    "alwaysPrintOnSamePage": true,
                    "pageBreak": false,
                    "repeatGroupHeader": false,
                    "columnData": [
                        {
                            "elementType": "table_text",
                            "id": 200,
                            "width": 42,
                            "content": "",
                            "eval": false,
                            "colspan": "9",
                            "styleId": "338",
                            "bold": false,
                            "italic": false,
                            "underline": false,
                            "strikethrough": false,
                            "horizontalAlignment": "left",
                            "verticalAlignment": "top",
                            "textColor": "#cccccc",
                            "backgroundColor": "#cccccc",
                            "font": "helvetica",
                            "fontSize": 12,
                            "lineSpacing": 1,
                            "paddingLeft": 0,
                            "paddingTop": 0,
                            "paddingRight": 0,
                            "paddingBottom": 0,
                            "pattern": "",
                            "link": "",
                            "cs_condition": "",
                            "cs_styleId": "",
                            "cs_bold": false,
                            "cs_italic": false,
                            "cs_underline": false,
                            "cs_strikethrough": false,
                            "cs_horizontalAlignment": "left",
                            "cs_verticalAlignment": "top",
                            "cs_textColor": "#000000",
                            "cs_backgroundColor": "",
                            "cs_font": "helvetica",
                            "cs_fontSize": 12,
                            "cs_lineSpacing": 1,
                            "cs_paddingLeft": 2,
                            "cs_paddingTop": 2,
                            "cs_paddingRight": 2,
                            "cs_paddingBottom": 2,
                            "spreadsheet_textWrap": false,
                            "borderWidth": 1,
                            "growWeight": 0
                        },
                        {
                            "elementType": "table_text",
                            "id": 209,
                            "width": 80,
                            "content": "",
                            "eval": false,
                            "colspan": "",
                            "styleId": "",
                            "bold": false,
                            "italic": false,
                            "underline": false,
                            "strikethrough": false,
                            "horizontalAlignment": "left",
                            "verticalAlignment": "top",
                            "textColor": "#000000",
                            "backgroundColor": "",
                            "font": "helvetica",
                            "fontSize": 12,
                            "lineSpacing": 1,
                            "paddingLeft": 2,
                            "paddingTop": 2,
                            "paddingRight": 2,
                            "paddingBottom": 2,
                            "pattern": "yyyy/MM/dd",
                            "link": "",
                            "cs_condition": "",
                            "cs_styleId": "",
                            "cs_bold": false,
                            "cs_italic": false,
                            "cs_underline": false,
                            "cs_strikethrough": false,
                            "cs_horizontalAlignment": "left",
                            "cs_verticalAlignment": "top",
                            "cs_textColor": "#000000",
                            "cs_backgroundColor": "",
                            "cs_font": "helvetica",
                            "cs_fontSize": 12,
                            "cs_lineSpacing": 1,
                            "cs_paddingLeft": 2,
                            "cs_paddingTop": 2,
                            "cs_paddingRight": 2,
                            "cs_paddingBottom": 2,
                            "spreadsheet_textWrap": false,
                            "borderWidth": 1,
                            "growWeight": 0
                        },
                        {
                            "elementType": "table_text",
                            "id": 597,
                            "width": 310,
                            "content": "",
                            "eval": false,
                            "colspan": "",
                            "styleId": "",
                            "bold": false,
                            "italic": false,
                            "underline": false,
                            "strikethrough": false,
                            "horizontalAlignment": "left",
                            "verticalAlignment": "top",
                            "textColor": "#000000",
                            "backgroundColor": "",
                            "font": "helvetica",
                            "fontSize": 12,
                            "lineSpacing": 1,
                            "paddingLeft": 2,
                            "paddingTop": 2,
                            "paddingRight": 2,
                            "paddingBottom": 2,
                            "pattern": "",
                            "link": "",
                            "cs_condition": "",
                            "cs_styleId": "",
                            "cs_bold": false,
                            "cs_italic": false,
                            "cs_underline": false,
                            "cs_strikethrough": false,
                            "cs_horizontalAlignment": "left",
                            "cs_verticalAlignment": "top",
                            "cs_textColor": "#000000",
                            "cs_backgroundColor": "",
                            "cs_font": "helvetica",
                            "cs_fontSize": 12,
                            "cs_lineSpacing": 1,
                            "cs_paddingLeft": 2,
                            "cs_paddingTop": 2,
                            "cs_paddingRight": 2,
                            "cs_paddingBottom": 2,
                            "spreadsheet_textWrap": false,
                            "borderWidth": 1,
                            "growWeight": 0
                        },
                        {
                            "elementType": "table_text",
                            "id": 399,
                            "width": 130,
                            "content": "",
                            "eval": false,
                            "colspan": "",
                            "styleId": "",
                            "bold": false,
                            "italic": false,
                            "underline": false,
                            "strikethrough": false,
                            "horizontalAlignment": "left",
                            "verticalAlignment": "top",
                            "textColor": "#000000",
                            "backgroundColor": "",
                            "font": "helvetica",
                            "fontSize": 12,
                            "lineSpacing": 1,
                            "paddingLeft": 2,
                            "paddingTop": 2,
                            "paddingRight": 2,
                            "paddingBottom": 2,
                            "pattern": "",
                            "link": "",
                            "cs_condition": "",
                            "cs_styleId": "",
                            "cs_bold": false,
                            "cs_italic": false,
                            "cs_underline": false,
                            "cs_strikethrough": false,
                            "cs_horizontalAlignment": "left",
                            "cs_verticalAlignment": "top",
                            "cs_textColor": "#000000",
                            "cs_backgroundColor": "",
                            "cs_font": "helvetica",
                            "cs_fontSize": 12,
                            "cs_lineSpacing": 1,
                            "cs_paddingLeft": 2,
                            "cs_paddingTop": 2,
                            "cs_paddingRight": 2,
                            "cs_paddingBottom": 2,
                            "spreadsheet_textWrap": false,
                            "borderWidth": 1,
                            "growWeight": 0
                        },
                        {
                            "elementType": "table_text",
                            "id": 409,
                            "width": 130,
                            "content": "",
                            "eval": false,
                            "colspan": "",
                            "styleId": "",
                            "bold": false,
                            "italic": false,
                            "underline": false,
                            "strikethrough": false,
                            "horizontalAlignment": "left",
                            "verticalAlignment": "top",
                            "textColor": "#000000",
                            "backgroundColor": "",
                            "font": "helvetica",
                            "fontSize": 12,
                            "lineSpacing": 1,
                            "paddingLeft": 2,
                            "paddingTop": 2,
                            "paddingRight": 2,
                            "paddingBottom": 2,
                            "pattern": "",
                            "link": "",
                            "cs_condition": "",
                            "cs_styleId": "",
                            "cs_bold": false,
                            "cs_italic": false,
                            "cs_underline": false,
                            "cs_strikethrough": false,
                            "cs_horizontalAlignment": "left",
                            "cs_verticalAlignment": "top",
                            "cs_textColor": "#000000",
                            "cs_backgroundColor": "",
                            "cs_font": "helvetica",
                            "cs_fontSize": 12,
                            "cs_lineSpacing": 1,
                            "cs_paddingLeft": 2,
                            "cs_paddingTop": 2,
                            "cs_paddingRight": 2,
                            "cs_paddingBottom": 2,
                            "spreadsheet_textWrap": false,
                            "borderWidth": 1,
                            "growWeight": 0
                        },
                        {
                            "elementType": "table_text",
                            "id": 604,
                            "width": 130,
                            "content": "",
                            "eval": false,
                            "colspan": "",
                            "styleId": "",
                            "bold": false,
                            "italic": false,
                            "underline": false,
                            "strikethrough": false,
                            "horizontalAlignment": "left",
                            "verticalAlignment": "top",
                            "textColor": "#000000",
                            "backgroundColor": "",
                            "font": "helvetica",
                            "fontSize": 12,
                            "lineSpacing": 1,
                            "paddingLeft": 2,
                            "paddingTop": 2,
                            "paddingRight": 2,
                            "paddingBottom": 2,
                            "pattern": "",
                            "link": "",
                            "cs_condition": "",
                            "cs_styleId": "",
                            "cs_bold": false,
                            "cs_italic": false,
                            "cs_underline": false,
                            "cs_strikethrough": false,
                            "cs_horizontalAlignment": "left",
                            "cs_verticalAlignment": "top",
                            "cs_textColor": "#000000",
                            "cs_backgroundColor": "",
                            "cs_font": "helvetica",
                            "cs_fontSize": 12,
                            "cs_lineSpacing": 1,
                            "cs_paddingLeft": 2,
                            "cs_paddingTop": 2,
                            "cs_paddingRight": 2,
                            "cs_paddingBottom": 2,
                            "spreadsheet_textWrap": false,
                            "borderWidth": 1,
                            "growWeight": 0
                        }
                    ]
                }
            ],
            "footerData": {
                "elementType": "none",
                "id": 202,
                "height": 20,
                "backgroundColor": "",
                "columnData": [
                    {
                        "elementType": "table_text",
                        "id": 203,
                        "width": 42,
                        "content": "Grand Total:",
                        "eval": false,
                        "colspan": "3",
                        "styleId": "349",
                        "bold": true,
                        "italic": false,
                        "underline": false,
                        "strikethrough": false,
                        "horizontalAlignment": "center",
                        "verticalAlignment": "middle",
                        "textColor": "#000000",
                        "backgroundColor": "",
                        "font": "notosans",
                        "fontSize": 12,
                        "lineSpacing": 1,
                        "paddingLeft": 2,
                        "paddingTop": 2,
                        "paddingRight": 2,
                        "paddingBottom": 2,
                        "pattern": "",
                        "link": "",
                        "cs_condition": "",
                        "cs_styleId": "",
                        "cs_bold": false,
                        "cs_italic": false,
                        "cs_underline": false,
                        "cs_strikethrough": false,
                        "cs_horizontalAlignment": "left",
                        "cs_verticalAlignment": "top",
                        "cs_textColor": "#000000",
                        "cs_backgroundColor": "",
                        "cs_font": "helvetica",
                        "cs_fontSize": 12,
                        "cs_lineSpacing": 1,
                        "cs_paddingLeft": 2,
                        "cs_paddingTop": 2,
                        "cs_paddingRight": 2,
                        "cs_paddingBottom": 2,
                        "spreadsheet_textWrap": false,
                        "borderWidth": 1,
                        "growWeight": 0
                    },
                    {
                        "elementType": "table_text",
                        "id": 212,
                        "width": 80,
                        "content": "",
                        "eval": false,
                        "colspan": "",
                        "styleId": "",
                        "bold": false,
                        "italic": false,
                        "underline": false,
                        "strikethrough": false,
                        "horizontalAlignment": "left",
                        "verticalAlignment": "top",
                        "textColor": "#000000",
                        "backgroundColor": "",
                        "font": "helvetica",
                        "fontSize": 12,
                        "lineSpacing": 1,
                        "paddingLeft": 2,
                        "paddingTop": 2,
                        "paddingRight": 2,
                        "paddingBottom": 2,
                        "pattern": "",
                        "link": "",
                        "cs_condition": "",
                        "cs_styleId": "",
                        "cs_bold": false,
                        "cs_italic": false,
                        "cs_underline": false,
                        "cs_strikethrough": false,
                        "cs_horizontalAlignment": "left",
                        "cs_verticalAlignment": "top",
                        "cs_textColor": "#000000",
                        "cs_backgroundColor": "",
                        "cs_font": "helvetica",
                        "cs_fontSize": 12,
                        "cs_lineSpacing": 1,
                        "cs_paddingLeft": 2,
                        "cs_paddingTop": 2,
                        "cs_paddingRight": 2,
                        "cs_paddingBottom": 2,
                        "spreadsheet_textWrap": false,
                        "borderWidth": 1,
                        "growWeight": 0
                    },
                    {
                        "elementType": "table_text",
                        "id": 598,
                        "width": 310,
                        "content": "",
                        "eval": false,
                        "colspan": "",
                        "styleId": "",
                        "bold": false,
                        "italic": false,
                        "underline": false,
                        "strikethrough": false,
                        "horizontalAlignment": "left",
                        "verticalAlignment": "top",
                        "textColor": "#000000",
                        "backgroundColor": "",
                        "font": "helvetica",
                        "fontSize": 12,
                        "lineSpacing": 1,
                        "paddingLeft": 2,
                        "paddingTop": 2,
                        "paddingRight": 2,
                        "paddingBottom": 2,
                        "pattern": "",
                        "link": "",
                        "cs_condition": "",
                        "cs_styleId": "",
                        "cs_bold": false,
                        "cs_italic": false,
                        "cs_underline": false,
                        "cs_strikethrough": false,
                        "cs_horizontalAlignment": "left",
                        "cs_verticalAlignment": "top",
                        "cs_textColor": "#000000",
                        "cs_backgroundColor": "",
                        "cs_font": "helvetica",
                        "cs_fontSize": 12,
                        "cs_lineSpacing": 1,
                        "cs_paddingLeft": 2,
                        "cs_paddingTop": 2,
                        "cs_paddingRight": 2,
                        "cs_paddingBottom": 2,
                        "spreadsheet_textWrap": false,
                        "borderWidth": 1,
                        "growWeight": 0
                    },
                    {
                        "elementType": "table_text",
                        "id": 400,
                        "width": 130,
                        "content": "${total_t}",
                        "eval": false,
                        "colspan": "",
                        "styleId": "349",
                        "bold": true,
                        "italic": false,
                        "underline": false,
                        "strikethrough": false,
                        "horizontalAlignment": "center",
                        "verticalAlignment": "middle",
                        "textColor": "#000000",
                        "backgroundColor": "",
                        "font": "notosans",
                        "fontSize": 12,
                        "lineSpacing": 1,
                        "paddingLeft": 2,
                        "paddingTop": 2,
                        "paddingRight": 2,
                        "paddingBottom": 2,
                        "pattern": "",
                        "link": "",
                        "cs_condition": "",
                        "cs_styleId": "",
                        "cs_bold": false,
                        "cs_italic": false,
                        "cs_underline": false,
                        "cs_strikethrough": false,
                        "cs_horizontalAlignment": "left",
                        "cs_verticalAlignment": "top",
                        "cs_textColor": "#000000",
                        "cs_backgroundColor": "",
                        "cs_font": "helvetica",
                        "cs_fontSize": 12,
                        "cs_lineSpacing": 1,
                        "cs_paddingLeft": 2,
                        "cs_paddingTop": 2,
                        "cs_paddingRight": 2,
                        "cs_paddingBottom": 2,
                        "spreadsheet_textWrap": false,
                        "borderWidth": 1,
                        "growWeight": 0
                    },
                    {
                        "elementType": "table_text",
                        "id": 410,
                        "width": 130,
                        "content": "${total_paid}",
                        "eval": false,
                        "colspan": "",
                        "styleId": "349",
                        "bold": true,
                        "italic": false,
                        "underline": false,
                        "strikethrough": false,
                        "horizontalAlignment": "center",
                        "verticalAlignment": "middle",
                        "textColor": "#000000",
                        "backgroundColor": "",
                        "font": "notosans",
                        "fontSize": 12,
                        "lineSpacing": 1,
                        "paddingLeft": 2,
                        "paddingTop": 2,
                        "paddingRight": 2,
                        "paddingBottom": 2,
                        "pattern": "",
                        "link": "",
                        "cs_condition": "",
                        "cs_styleId": "",
                        "cs_bold": false,
                        "cs_italic": false,
                        "cs_underline": false,
                        "cs_strikethrough": false,
                        "cs_horizontalAlignment": "left",
                        "cs_verticalAlignment": "top",
                        "cs_textColor": "#000000",
                        "cs_backgroundColor": "",
                        "cs_font": "helvetica",
                        "cs_fontSize": 12,
                        "cs_lineSpacing": 1,
                        "cs_paddingLeft": 2,
                        "cs_paddingTop": 2,
                        "cs_paddingRight": 2,
                        "cs_paddingBottom": 2,
                        "spreadsheet_textWrap": false,
                        "borderWidth": 1,
                        "growWeight": 0
                    },
                    {
                        "elementType": "table_text",
                        "id": 605,
                        "width": 130,
                        "content": "${total_rejected}",
                        "eval": false,
                        "colspan": "",
                        "styleId": "349",
                        "bold": true,
                        "italic": false,
                        "underline": false,
                        "strikethrough": false,
                        "horizontalAlignment": "center",
                        "verticalAlignment": "middle",
                        "textColor": "#000000",
                        "backgroundColor": "",
                        "font": "notosans",
                        "fontSize": 12,
                        "lineSpacing": 1,
                        "paddingLeft": 2,
                        "paddingTop": 2,
                        "paddingRight": 2,
                        "paddingBottom": 2,
                        "pattern": "",
                        "link": "",
                        "cs_condition": "",
                        "cs_styleId": "",
                        "cs_bold": false,
                        "cs_italic": false,
                        "cs_underline": false,
                        "cs_strikethrough": false,
                        "cs_horizontalAlignment": "left",
                        "cs_verticalAlignment": "top",
                        "cs_textColor": "#000000",
                        "cs_backgroundColor": "",
                        "cs_font": "helvetica",
                        "cs_fontSize": 12,
                        "cs_lineSpacing": 1,
                        "cs_paddingLeft": 2,
                        "cs_paddingTop": 2,
                        "cs_paddingRight": 2,
                        "cs_paddingBottom": 2,
                        "spreadsheet_textWrap": false,
                        "borderWidth": 1,
                        "growWeight": 0
                    }
                ]
            }
        },
        {
            "elementType": "text",
            "id": 7,
            "containerId": "0_footer",
            "x": 567,
            "y": 0,
            "width": 255,
            "height": 30,
            "content": "Page ${page_number} / ${page_count}",
            "richText": false,
            "richTextContent": null,
            "richTextHtml": "",
            "eval": false,
            "styleId": "",
            "bold": false,
            "italic": false,
            "underline": false,
            "strikethrough": false,
            "horizontalAlignment": "right",
            "verticalAlignment": "middle",
            "textColor": "#666666",
            "backgroundColor": "",
            "font": "notosans",
            "fontSize": 12,
            "lineSpacing": 1,
            "borderColor": "#000000",
            "borderWidth": 1,
            "borderAll": false,
            "borderLeft": false,
            "borderTop": false,
            "borderRight": false,
            "borderBottom": false,
            "paddingLeft": 2,
            "paddingTop": 2,
            "paddingRight": 2,
            "paddingBottom": 2,
            "printIf": "",
            "removeEmptyElement": false,
            "alwaysPrintOnSamePage": true,
            "pattern": "",
            "link": "",
            "cs_condition": "",
            "cs_styleId": "",
            "cs_bold": false,
            "cs_italic": false,
            "cs_underline": false,
            "cs_strikethrough": false,
            "cs_horizontalAlignment": "left",
            "cs_verticalAlignment": "top",
            "cs_textColor": "#000000",
            "cs_backgroundColor": "",
            "cs_font": "helvetica",
            "cs_fontSize": 12,
            "cs_lineSpacing": 1,
            "cs_borderColor": "#000000",
            "cs_borderWidth": "1",
            "cs_borderAll": false,
            "cs_borderLeft": false,
            "cs_borderTop": false,
            "cs_borderRight": false,
            "cs_borderBottom": false,
            "cs_paddingLeft": 2,
            "cs_paddingTop": 2,
            "cs_paddingRight": 2,
            "cs_paddingBottom": 2,
            "spreadsheet_hide": false,
            "spreadsheet_column": "",
            "spreadsheet_colspan": "",
            "spreadsheet_addEmptyRow": false,
            "spreadsheet_textWrap": false
        },
        {
            "elementType": "text",
            "id": 8,
            "containerId": "0_footer",
            "x": 0,
            "y": 0,
            "width": 290,
            "height": 30,
            "content": "Created on ${current_date}",
            "richText": false,
            "richTextContent": null,
            "richTextHtml": "",
            "eval": false,
            "styleId": "",
            "bold": false,
            "italic": false,
            "underline": false,
            "strikethrough": false,
            "horizontalAlignment": "left",
            "verticalAlignment": "middle",
            "textColor": "#666666",
            "backgroundColor": "",
            "font": "notosans",
            "fontSize": 12,
            "lineSpacing": 1,
            "borderColor": "#000000",
            "borderWidth": 1,
            "borderAll": false,
            "borderLeft": false,
            "borderTop": false,
            "borderRight": false,
            "borderBottom": false,
            "paddingLeft": 2,
            "paddingTop": 2,
            "paddingRight": 2,
            "paddingBottom": 2,
            "printIf": "",
            "removeEmptyElement": false,
            "alwaysPrintOnSamePage": true,
            "pattern": "",
            "link": "",
            "cs_condition": "",
            "cs_styleId": "",
            "cs_bold": false,
            "cs_italic": false,
            "cs_underline": false,
            "cs_strikethrough": false,
            "cs_horizontalAlignment": "left",
            "cs_verticalAlignment": "top",
            "cs_textColor": "#000000",
            "cs_backgroundColor": "",
            "cs_font": "helvetica",
            "cs_fontSize": 12,
            "cs_lineSpacing": 1,
            "cs_borderColor": "#000000",
            "cs_borderWidth": "1",
            "cs_borderAll": false,
            "cs_borderLeft": false,
            "cs_borderTop": false,
            "cs_borderRight": false,
            "cs_borderBottom": false,
            "cs_paddingLeft": 2,
            "cs_paddingTop": 2,
            "cs_paddingRight": 2,
            "cs_paddingBottom": 2,
            "spreadsheet_hide": false,
            "spreadsheet_column": "",
            "spreadsheet_colspan": "",
            "spreadsheet_addEmptyRow": false,
            "spreadsheet_textWrap": false
        }
    ],
    "parameters": [
        {
            "id": 1,
            "name": "page_count",
            "type": "number",
            "arrayItemType": "string",
            "eval": false,
            "nullable": false,
            "pattern": "",
            "expression": "",
            "showOnlyNameType": true,
            "testData": ""
        },
        {
            "id": 2,
            "name": "page_number",
            "type": "number",
            "arrayItemType": "string",
            "eval": false,
            "nullable": false,
            "pattern": "",
            "expression": "",
            "showOnlyNameType": true,
            "testData": ""
        },
        {
            "id": 9,
            "name": "current_date",
            "type": "date",
            "arrayItemType": "string",
            "eval": false,
            "nullable": false,
            "pattern": "d/M/yyyy H:mm",
            "expression": "",
            "showOnlyNameType": false,
            "testData": ""
        },
        {
            "id": 272,
            "name": "data",
            "type": "array",
            "arrayItemType": "string",
            "eval": false,
            "nullable": false,
            "pattern": "",
            "expression": "",
            "showOnlyNameType": false,
            "testData": "",
            "children": [
                {
                    "id": 273,
                    "name": "row_number",
                    "type": "number",
                    "arrayItemType": "string",
                    "eval": false,
                    "nullable": false,
                    "pattern": "",
                    "expression": "",
                    "showOnlyNameType": true,
                    "testData": ""
                },
                {
                    "id": 321,
                    "name": "hf_code",
                    "type": "string",
                    "arrayItemType": "string",
                    "eval": false,
                    "nullable": false,
                    "pattern": "",
                    "expression": "",
                    "showOnlyNameType": false,
                    "testData": ""
                },
                {
                    "id": 322,
                    "name": "hf_name",
                    "type": "string",
                    "arrayItemType": "string",
                    "eval": false,
                    "nullable": false,
                    "pattern": "",
                    "expression": "",
                    "showOnlyNameType": false,
                    "testData": ""
                },
                {
                    "id": 585,
                    "name": "product_code",
                    "type": "string",
                    "arrayItemType": "string",
                    "eval": false,
                    "nullable": false,
                    "pattern": "",
                    "expression": "",
                    "showOnlyNameType": false,
                    "testData": ""
                },
                {
                    "id": 586,
                    "name": "product_name",
                    "type": "string",
                    "arrayItemType": "string",
                    "eval": false,
                    "nullable": false,
                    "pattern": "",
                    "expression": "",
                    "showOnlyNameType": false,
                    "testData": ""
                },
                {
                    "id": 591,
                    "name": "month_txt",
                    "type": "string",
                    "arrayItemType": "string",
                    "eval": false,
                    "nullable": false,
                    "pattern": "00",
                    "expression": "",
                    "showOnlyNameType": false,
                    "testData": ""
                },
                {
                    "id": 609,
                    "name": "product_total_t",
                    "type": "number",
                    "arrayItemType": "string",
                    "eval": false,
                    "nullable": false,
                    "pattern": "#,##0",
                    "expression": "",
                    "showOnlyNameType": false,
                    "testData": ""
                },
                {
                    "id": 610,
                    "name": "product_total_p",
                    "type": "number",
                    "arrayItemType": "string",
                    "eval": false,
                    "nullable": false,
                    "pattern": "$ #,##0.00",
                    "expression": "",
                    "showOnlyNameType": false,
                    "testData": ""
                },
                {
                    "id": 611,
                    "name": "product_total_r",
                    "type": "number",
                    "arrayItemType": "string",
                    "eval": false,
                    "nullable": false,
                    "pattern": "#,##0",
                    "expression": "",
                    "showOnlyNameType": false,
                    "testData": ""
                },
                {
                    "id": 621,
                    "name": "month_nbr",
                    "type": "number",
                    "arrayItemType": "string",
                    "eval": false,
                    "nullable": false,
                    "pattern": "",
                    "expression": "",
                    "showOnlyNameType": false,
                    "testData": ""
                },
                {
                    "id": 636,
                    "name": "hf_total_t",
                    "type": "number",
                    "arrayItemType": "string",
                    "eval": false,
                    "nullable": false,
                    "pattern": "#,##0",
                    "expression": "",
                    "showOnlyNameType": false,
                    "testData": ""
                },
                {
                    "id": 637,
                    "name": "hf_total_p",
                    "type": "number",
                    "arrayItemType": "string",
                    "eval": false,
                    "nullable": false,
                    "pattern": "$ #,##0.00",
                    "expression": "",
                    "showOnlyNameType": false,
                    "testData": ""
                },
                {
                    "id": 638,
                    "name": "hf_total_r",
                    "type": "number",
                    "arrayItemType": "string",
                    "eval": false,
                    "nullable": false,
                    "pattern": "#,##0",
                    "expression": "",
                    "showOnlyNameType": false,
                    "testData": ""
                },
                {
                    "id": 639,
                    "name": "monthly_total_t",
                    "type": "number",
                    "arrayItemType": "string",
                    "eval": false,
                    "nullable": false,
                    "pattern": "#,##0",
                    "expression": "",
                    "showOnlyNameType": false,
                    "testData": ""
                },
                {
                    "id": 640,
                    "name": "monthly_total_p",
                    "type": "number",
                    "arrayItemType": "string",
                    "eval": false,
                    "nullable": false,
                    "pattern": "$ #,##0.00",
                    "expression": "",
                    "showOnlyNameType": false,
                    "testData": ""
                },
                {
                    "id": 641,
                    "name": "monthly_total_r",
                    "type": "number",
                    "arrayItemType": "string",
                    "eval": false,
                    "nullable": false,
                    "pattern": "#,##0",
                    "expression": "",
                    "showOnlyNameType": false,
                    "testData": ""
                },
                {
                    "id": 667,
                    "name": "month_hf_code",
                    "type": "string",
                    "arrayItemType": "string",
                    "eval": false,
                    "nullable": false,
                    "pattern": "",
                    "expression": "",
                    "showOnlyNameType": false,
                    "testData": ""
                }
            ]
        },
        {
            "id": 274,
            "name": "header",
            "type": "array",
            "arrayItemType": "string",
            "eval": false,
            "nullable": false,
            "pattern": "",
            "expression": "",
            "showOnlyNameType": false,
            "testData": "",
            "children": [
                {
                    "id": 275,
                    "name": "row_number",
                    "type": "number",
                    "arrayItemType": "string",
                    "eval": false,
                    "nullable": false,
                    "pattern": "",
                    "expression": "",
                    "showOnlyNameType": true,
                    "testData": ""
                },
                {
                    "id": 278,
                    "name": "region",
                    "type": "string",
                    "arrayItemType": "string",
                    "eval": false,
                    "nullable": false,
                    "pattern": "",
                    "expression": "",
                    "showOnlyNameType": false,
                    "testData": ""
                },
                {
                    "id": 279,
                    "name": "district",
                    "type": "string",
                    "arrayItemType": "string",
                    "eval": false,
                    "nullable": false,
                    "pattern": "",
                    "expression": "",
                    "showOnlyNameType": false,
                    "testData": ""
                },
                {
                    "id": 567,
                    "name": "product",
                    "type": "string",
                    "arrayItemType": "string",
                    "eval": false,
                    "nullable": false,
                    "pattern": "",
                    "expression": "",
                    "showOnlyNameType": false,
                    "testData": ""
                },
                {
                    "id": 569,
                    "name": "year",
                    "type": "number",
                    "arrayItemType": "string",
                    "eval": false,
                    "nullable": false,
                    "pattern": "",
                    "expression": "",
                    "showOnlyNameType": false,
                    "testData": ""
                },
                {
                    "id": 570,
                    "name": "month",
                    "type": "string",
                    "arrayItemType": "string",
                    "eval": false,
                    "nullable": false,
                    "pattern": "",
                    "expression": "",
                    "showOnlyNameType": false,
                    "testData": ""
                },
                {
                    "id": 634,
                    "name": "hf",
                    "type": "string",
                    "arrayItemType": "string",
                    "eval": false,
                    "nullable": false,
                    "pattern": "",
                    "expression": "",
                    "showOnlyNameType": false,
                    "testData": ""
                },
                {
                    "id": 635,
                    "name": "quarter",
                    "type": "string",
                    "arrayItemType": "string",
                    "eval": false,
                    "nullable": false,
                    "pattern": "",
                    "expression": "",
                    "showOnlyNameType": false,
                    "testData": ""
                }
            ]
        },
        {
            "id": 309,
            "name": "error",
            "type": "string",
            "arrayItemType": "string",
            "eval": false,
            "nullable": false,
            "pattern": "",
            "expression": "",
            "showOnlyNameType": false,
            "testData": ""
        },
        {
            "id": 542,
            "name": "total_t",
            "type": "number",
            "arrayItemType": "string",
            "eval": false,
            "nullable": true,
            "pattern": "#,##0",
            "expression": "",
            "showOnlyNameType": false,
            "testData": ""
        },
        {
            "id": 613,
            "name": "total_paid",
            "type": "number",
            "arrayItemType": "string",
            "eval": false,
            "nullable": false,
            "pattern": "$ #,##0.00",
            "expression": "",
            "showOnlyNameType": false,
            "testData": ""
        },
        {
            "id": 614,
            "name": "total_rejected",
            "type": "number",
            "arrayItemType": "string",
            "eval": false,
            "nullable": false,
            "pattern": "#,##0",
            "expression": "",
            "showOnlyNameType": false,
            "testData": ""
        }
    ],
    "styles": [
        {
            "id": 33,
            "name": "Table Header",
            "bold": true,
            "italic": false,
            "underline": false,
            "strikethrough": false,
            "horizontalAlignment": "left",
            "verticalAlignment": "middle",
            "textColor": "#000000",
            "backgroundColor": "",
            "font": "notosans",
            "fontSize": "12",
            "lineSpacing": 1,
            "borderColor": "#000000",
            "borderWidth": "1",
            "borderAll": false,
            "borderLeft": false,
            "borderTop": false,
            "borderRight": false,
            "borderBottom": false,
            "paddingLeft": "2",
            "paddingTop": "2",
            "paddingRight": "2",
            "paddingBottom": "2"
        },
        {
            "id": 34,
            "name": "Table Content",
            "bold": false,
            "italic": false,
            "underline": false,
            "strikethrough": false,
            "horizontalAlignment": "left",
            "verticalAlignment": "middle",
            "textColor": "#000000",
            "backgroundColor": "",
            "font": "notosans",
            "fontSize": "11",
            "lineSpacing": 1,
            "borderColor": "#000000",
            "borderWidth": "1",
            "borderAll": false,
            "borderLeft": false,
            "borderTop": false,
            "borderRight": false,
            "borderBottom": false,
            "paddingLeft": "2",
            "paddingTop": "2",
            "paddingRight": "2",
            "paddingBottom": "2"
        },
        {
            "id": 35,
            "name": "Table Content Highlight",
            "bold": true,
            "italic": false,
            "underline": false,
            "strikethrough": false,
            "horizontalAlignment": "center",
            "verticalAlignment": "middle",
            "textColor": "#3d85c6",
            "backgroundColor": "",
            "font": "notosans",
            "fontSize": "9",
            "lineSpacing": 1,
            "borderColor": "#000000",
            "borderWidth": "1",
            "borderAll": false,
            "borderLeft": false,
            "borderTop": false,
            "borderRight": false,
            "borderBottom": false,
            "paddingLeft": "2",
            "paddingTop": "2",
            "paddingRight": "2",
            "paddingBottom": "2"
        },
        {
            "id": 286,
            "name": "Content header 1",
            "bold": true,
            "italic": false,
            "underline": false,
            "strikethrough": false,
            "horizontalAlignment": "left",
            "verticalAlignment": "middle",
            "textColor": "#ffffff",
            "backgroundColor": "#006374",
            "font": "notosans",
            "fontSize": 12,
            "lineSpacing": 1,
            "borderColor": "#000000",
            "borderWidth": "1",
            "borderAll": false,
            "borderLeft": false,
            "borderTop": false,
            "borderRight": false,
            "borderBottom": false,
            "paddingLeft": "2",
            "paddingTop": "2",
            "paddingRight": "2",
            "paddingBottom": "2"
        },
        {
            "id": 295,
            "name": "Content title",
            "bold": true,
            "italic": false,
            "underline": false,
            "strikethrough": false,
            "horizontalAlignment": "center",
            "verticalAlignment": "middle",
            "textColor": "#000000",
            "backgroundColor": "",
            "font": "notosans",
            "fontSize": 12,
            "lineSpacing": 1,
            "borderColor": "#000000",
            "borderWidth": "1",
            "borderAll": false,
            "borderLeft": false,
            "borderTop": false,
            "borderRight": false,
            "borderBottom": false,
            "paddingLeft": "2",
            "paddingTop": "2",
            "paddingRight": "2",
            "paddingBottom": "2"
        },
        {
            "id": 296,
            "name": "Content content",
            "bold": false,
            "italic": false,
            "underline": false,
            "strikethrough": false,
            "horizontalAlignment": "center",
            "verticalAlignment": "middle",
            "textColor": "#000000",
            "backgroundColor": "",
            "font": "notosans",
            "fontSize": "11",
            "lineSpacing": 1,
            "borderColor": "#000000",
            "borderWidth": "1",
            "borderAll": false,
            "borderLeft": false,
            "borderTop": false,
            "borderRight": false,
            "borderBottom": false,
            "paddingLeft": "2",
            "paddingTop": "2",
            "paddingRight": "2",
            "paddingBottom": "2"
        },
        {
            "id": 307,
            "name": "Error",
            "bold": true,
            "italic": false,
            "underline": false,
            "strikethrough": false,
            "horizontalAlignment": "center",
            "verticalAlignment": "middle",
            "textColor": "#ff0000",
            "backgroundColor": "",
            "font": "notosans",
            "fontSize": "16",
            "lineSpacing": 1,
            "borderColor": "#000000",
            "borderWidth": "1",
            "borderAll": false,
            "borderLeft": false,
            "borderTop": false,
            "borderRight": false,
            "borderBottom": false,
            "paddingLeft": "2",
            "paddingTop": "2",
            "paddingRight": "2",
            "paddingBottom": "2"
        },
        {
            "id": 337,
            "name": "Content header 2",
            "bold": true,
            "italic": false,
            "underline": false,
            "strikethrough": false,
            "horizontalAlignment": "left",
            "verticalAlignment": "middle",
            "textColor": "#ffffff",
            "backgroundColor": "#80B0B9",
            "font": "notosans",
            "fontSize": 12,
            "lineSpacing": 1,
            "borderColor": "#000000",
            "borderWidth": "1",
            "borderAll": false,
            "borderLeft": false,
            "borderTop": false,
            "borderRight": false,
            "borderBottom": false,
            "paddingLeft": "2",
            "paddingTop": "2",
            "paddingRight": "2",
            "paddingBottom": "2"
        },
        {
            "id": 338,
            "name": "No content",
            "bold": false,
            "italic": false,
            "underline": false,
            "strikethrough": false,
            "horizontalAlignment": "left",
            "verticalAlignment": "top",
            "textColor": "#cccccc",
            "backgroundColor": "#cccccc",
            "font": "helvetica",
            "fontSize": 12,
            "lineSpacing": 1,
            "borderColor": "#000000",
            "borderWidth": "1",
            "borderAll": false,
            "borderLeft": false,
            "borderTop": false,
            "borderRight": false,
            "borderBottom": false,
            "paddingLeft": "",
            "paddingTop": "",
            "paddingRight": "",
            "paddingBottom": ""
        },
        {
            "id": 341,
            "name": "Content header 3",
            "bold": true,
            "italic": false,
            "underline": false,
            "strikethrough": false,
            "horizontalAlignment": "left",
            "verticalAlignment": "middle",
            "textColor": "#ffffff",
            "backgroundColor": "#F4AE2B",
            "font": "notosans",
            "fontSize": 12,
            "lineSpacing": 1,
            "borderColor": "#000000",
            "borderWidth": "1",
            "borderAll": false,
            "borderLeft": false,
            "borderTop": false,
            "borderRight": false,
            "borderBottom": false,
            "paddingLeft": "2",
            "paddingTop": "2",
            "paddingRight": "2",
            "paddingBottom": "2"
        },
        {
            "id": 349,
            "name": "Footer",
            "bold": true,
            "italic": false,
            "underline": false,
            "strikethrough": false,
            "horizontalAlignment": "center",
            "verticalAlignment": "middle",
            "textColor": "#000000",
            "backgroundColor": "",
            "font": "notosans",
            "fontSize": 12,
            "lineSpacing": 1,
            "borderColor": "#000000",
            "borderWidth": "1",
            "borderAll": false,
            "borderLeft": false,
            "borderTop": false,
            "borderRight": false,
            "borderBottom": false,
            "paddingLeft": "2",
            "paddingTop": "2",
            "paddingRight": "2",
            "paddingBottom": "2"
        },
        {
            "id": 366,
            "name": "Subtotals",
            "bold": false,
            "italic": false,
            "underline": false,
            "strikethrough": false,
            "horizontalAlignment": "right",
            "verticalAlignment": "middle",
            "textColor": "#000000",
            "backgroundColor": "",
            "font": "notosans",
            "fontSize": 12,
            "lineSpacing": 1,
            "borderColor": "#000000",
            "borderWidth": "1",
            "borderAll": false,
            "borderLeft": false,
            "borderTop": false,
            "borderRight": false,
            "borderBottom": false,
            "paddingLeft": "2",
            "paddingTop": "2",
            "paddingRight": "2",
            "paddingBottom": "2"
        },
        {
            "id": 615,
            "name": "Colored subtotal 1",
            "bold": true,
            "italic": false,
            "underline": false,
            "strikethrough": false,
            "horizontalAlignment": "center",
            "verticalAlignment": "middle",
            "textColor": "#006374",
            "backgroundColor": "",
            "font": "notosans",
            "fontSize": 12,
            "lineSpacing": 1,
            "borderColor": "#000000",
            "borderWidth": "1",
            "borderAll": false,
            "borderLeft": false,
            "borderTop": false,
            "borderRight": false,
            "borderBottom": false,
            "paddingLeft": "2",
            "paddingTop": "2",
            "paddingRight": "2",
            "paddingBottom": "2"
        },
        {
            "id": 666,
            "name": "Colored subtotal 2",
            "bold": true,
            "italic": false,
            "underline": false,
            "strikethrough": false,
            "horizontalAlignment": "center",
            "verticalAlignment": "middle",
            "textColor": "#80B0B9",
            "backgroundColor": "",
            "font": "notosans",
            "fontSize": 12,
            "lineSpacing": 1,
            "borderColor": "#000000",
            "borderWidth": "1",
            "borderAll": false,
            "borderLeft": false,
            "borderTop": false,
            "borderRight": false,
            "borderBottom": false,
            "paddingLeft": "2",
            "paddingTop": "2",
            "paddingRight": "2",
            "paddingBottom": "2"
        }
    ],
    "version": 3,
    "documentProperties": {
        "pageFormat": "A4",
        "pageWidth": "",
        "pageHeight": "",
        "unit": "mm",
        "orientation": "landscape",
        "contentHeight": "",
        "marginLeft": "10",
        "marginTop": "10",
        "marginRight": "10",
        "marginBottom": "10",
        "header": true,
        "headerSize": "80",
        "headerDisplay": "always",
        "footer": true,
        "footerSize": "30",
        "footerDisplay": "always",
        "patternLocale": "en",
        "patternCurrencySymbol": "$"
    }
}
"""

CATEGORY_TOTAL = "T"
CATEGORY_PAID = "P"
CATEGORY_REJECTED = "R"

NO_DATA_CODE = "????????"
NO_DATA_NAME = "NO_DATA"

Q1 = 1
Q2 = 2
Q3 = 3
Q4 = 4
AVAILABLE_QUARTERS = [Q1, Q2, Q3, Q4]

DEFAULT_YEAR = 0
ALL_MONTHS = -1
ALL_QUARTERS = -2
DEFAULT_REGION = -3
ALL_DISTRICTS = -4
ALL_PRODUCTS = -5
ALL_HFS = -6


def generate_subtotal():
    return {
        CATEGORY_TOTAL: Decimal(0.00),
        CATEGORY_PAID: Decimal(0.00),
        CATEGORY_REJECTED: Decimal(0.00),
    }


def prepare_product_info():
    # Prepares the required Product information and returns it in a dict[product_id:product_info]
    product_info_mapping = {}
    products = Product.objects.values("id",
                                      "code",
                                      "name")
    for product in products:
        product_info_mapping[product["id"]] = product
    return product_info_mapping


def prepare_hf_info():
    # Prepares the required HealthFacility information and returns it in a dict[hf_id:hf_info]
    hf_info_mapping = {}
    hfs = HealthFacility.objects.values("id",
                                        "code",
                                        "name")
    for hf in hfs:
        hf_info_mapping[hf["id"]] = hf
    return hf_info_mapping


def prepare_list_of_working_months(month: int, quarter: int):
    # Returns the list of months for which data will be calculated in this report
    if quarter == ALL_QUARTERS:
        if month == ALL_MONTHS:
            return list(range(1, 13))
        return [month]

    quarters = {
        1: [1, 2, 3],
        2: [4, 5, 6],
        3: [7, 8, 9],
        4: [10, 11, 12],
    }
    return quarters[quarter]


def calculate_start_end_month_dates(year: int, month: int):
    num_days = calendar.monthrange(year, month)[1]
    start_date = date(year, month, 1)
    end_date = date(year, month, num_days)
    return start_date, end_date


def prepare_all_monthly_totals(subtotals: dict, working_months: list):
    # Prepares subtotals for each month
    # This is required in order to display a month without any information in the report
    for month in working_months:
        subtotals[month] = {
            "total": generate_subtotal()
        }


def get_claim_product(claim: Claim):
    # Returns the Product linked to a Claim, whether through its ClaimItem or its ClaimService
    for item in claim.items.all():
        if item.product_id:
            return item.product_id
    for service in claim.services.all():
        if service.product_id:
            return service.product_id
    return None


def dispatch_subtotals(subtotals: dict, claim: Claim, month: int):
    # Takes Claim data and dispatches it in various subtotals
    # The subtotals' structure is the following:
    # { month: {
    #       hf_id: {
    #           product_id: {
    #               categories: value
    #           },
    #           "total": { # for the HF
    #               categories: value
    #           },
    #       },
    #       "total": { # for the month
    #           categories: value
    #       },
    #   },
    #   "total": { # grand total
    #       categories: value
    #   },
    # }
    product_id = get_claim_product(claim)
    hf_id = claim.health_facility_id

    if hf_id not in subtotals[month]:
        subtotals[month][hf_id] = {
            "total": generate_subtotal()
        }
        if product_id:
            subtotals[month][hf_id][product_id] = generate_subtotal()
    elif product_id and product_id not in subtotals[month][hf_id]:
        subtotals[month][hf_id][product_id] = generate_subtotal()

    add_value_to_category(subtotals, month, hf_id, product_id, CATEGORY_TOTAL, Decimal(1.00))

    if claim.status == Claim.STATUS_REJECTED:
        add_value_to_category(subtotals, month, hf_id, product_id, CATEGORY_REJECTED, Decimal(1.00))
    elif claim.status == Claim.STATUS_VALUATED:
        total_remunerated = calculate_total_remunerated(claim)
        add_value_to_category(subtotals, month, hf_id, product_id, CATEGORY_PAID, total_remunerated)


def add_value_to_category(subtotals: dict, month: int, hf_id: int, product_id: int, category: str, value: Decimal):
    # Adds a given value for a given category in each subtotal level
    subtotals["total"][category] += value
    subtotals[month]["total"][category] += value
    subtotals[month][hf_id]["total"][category] += value
    if product_id:
        subtotals[month][hf_id][product_id][category] += value


def calculate_total_remunerated(claim: Claim):
    total_valuated = Decimal(0.00)
    for item in claim.items.all():
        if item.remunerated_amount and item.status == ClaimDetail.STATUS_PASSED:
            total_valuated += item.remunerated_amount
    for service in claim.services.all():
        if service.remunerated_amount and service.status == ClaimDetail.STATUS_PASSED:
            total_valuated += service.remunerated_amount
    return total_valuated


def format_totals(subtotals: dict, report_data: dict):
    # Adds and formats total figures to the report data
    report_data["total_t"] = subtotals["total"][CATEGORY_TOTAL]
    report_data["total_paid"] = subtotals["total"][CATEGORY_PAID]
    report_data["total_rejected"] = subtotals["total"][CATEGORY_REJECTED]


def format_final_data(subtotals: dict, hf_info: dict, product_info: dict, month_info: list):
    # Formats the data in order to match what is expected by the report
    data = []
    subtotals.pop("total")  # Removing the total figures that were already taken care of
    for month_id, monthly_values in subtotals.items():
        monthly_total = subtotals[month_id].pop("total")  # Totals for the given month
        monthly_data = {
            "month_nbr": month_id,
            "month_txt": month_info[month_id - 1],
            "monthly_total_t": monthly_total[CATEGORY_TOTAL],
            "monthly_total_p": monthly_total[CATEGORY_PAID],
            "monthly_total_r": monthly_total[CATEGORY_REJECTED],
        }
        if not monthly_values:  # If there is no data for this month, a line must still appear for the report
            new_data_line = {
                **monthly_data,
                "month_hf_code": f"{month_id}-{NO_DATA_CODE}",  # Required for the section split in the report
                "hf_name": NO_DATA_NAME,
                "hf_code": NO_DATA_CODE,
                "product_name": NO_DATA_NAME,
                "product_code": NO_DATA_CODE,
            }
            data.append(new_data_line)
            continue

        for hf_id, hf_values in monthly_values.items():
            hf_total = subtotals[month_id][hf_id].pop("total")  # Totals for the given HF
            hf_code = hf_info[hf_id]["code"]
            hf_data = {
                "month_hf_code": f"{month_id}-{hf_code}",  # Required for the section split in the report
                "hf_name": hf_info[hf_id]["name"],
                "hf_code": hf_code,
                "hf_total_t": hf_total[CATEGORY_TOTAL],
                "hf_total_p": hf_total[CATEGORY_PAID],
                "hf_total_r": hf_total[CATEGORY_REJECTED],
            }
            if not hf_values:  # If there is no data for this HF, a line must still appear for the report
                new_data_line = {
                    **monthly_data,
                    **hf_data,
                    "product_name": NO_DATA_NAME,
                    "product_code": NO_DATA_CODE,
                }
                data.append(new_data_line)
                continue

            for product_id, product_values in hf_values.items():
                new_data_line = {
                    **monthly_data,
                    **hf_data,
                    "product_code": product_info[product_id]["code"],
                    "product_name": product_info[product_id]["name"],
                    "product_total_t": product_values[CATEGORY_TOTAL],
                    "product_total_p": product_values[CATEGORY_PAID],
                    "product_total_r": product_values[CATEGORY_REJECTED],
                }
                data.append(new_data_line)

    data.sort(key=lambda x: (x["month_nbr"], x["hf_code"], x["product_code"]))
    return data


def claims_primary_operational_indicators_query(user,
                                                requested_month=ALL_MONTHS,
                                                requested_quarter=ALL_QUARTERS,
                                                requested_year=DEFAULT_YEAR,
                                                requested_region_id=DEFAULT_REGION,
                                                requested_district_id=ALL_DISTRICTS,
                                                requested_product_id=ALL_PRODUCTS,
                                                requested_hf_id=ALL_HFS,
                                                **kwargs):
    # Checking the parameters received and returning an error if anything is wrong
    validated_parameters = {}
    month = int(requested_month)
    if month not in range(1, 13) and month != ALL_MONTHS:
        return {"error": "Error - the selected month is invalid"}
    quarter = int(requested_quarter)
    if quarter not in range(1, 5) and quarter != ALL_QUARTERS:
        return {"error": "Error - the selected quarter is invalid"}
    year = int(requested_year)
    if year not in range(2010, 2100):
        return {"error": "Error - the selected year is invalid"}
    product_id = int(requested_product_id)
    if product_id != ALL_PRODUCTS:
        product = Product.objects.filter(validity_to=None, id=product_id).first()
        if not product:
            return {"error": "Error - the requested product does not exist"}
        validated_parameters["product"] = product
    region_id = int(requested_region_id)
    region = Location.objects.filter(validity_to=None, type='R', id=region_id).first()
    if not region:
        return {"error": "Error - the requested region does not exist"}
    validated_parameters["region"] = region
    district_id = int(requested_district_id)
    if district_id != ALL_DISTRICTS:
        district_filters = Q(validity_to__isnull=True) & Q(type="D") & Q(id=district_id) & Q(parent_id=region_id)
        district = Location.objects.filter(district_filters).first()
        if not district:
            return {"error": "Error - the requested district does not exist"}
        validated_parameters["district"] = district
    hf_id = int(requested_hf_id)
    if hf_id != ALL_HFS:
        hf = HealthFacility.objects.filter(validity_to=None, id=hf_id).first()
        if not hf:
            return {"error": "Error - the requested health facility does not exist"}
        validated_parameters["hf"] = hf

    # Preparing reference data that will be used later
    months_txt = calendar.month_name[1:]
    product_info_mapping = prepare_product_info()
    hf_info_mapping = prepare_hf_info()

    # Preparing data for the header table
    header = {
        "region": f"{validated_parameters['region'].code} - {validated_parameters['region'].name}",
        "district": "All districts" if district_id == ALL_DISTRICTS else f"{validated_parameters['district'].code} - {validated_parameters['district'].name}",
        "hf": "All health facilities" if hf_id == ALL_HFS else f"{validated_parameters['hf'].code} - {validated_parameters['hf'].name}",
        "product": "All products" if product_id == ALL_PRODUCTS else f"{validated_parameters['product'].code} - {validated_parameters['product'].name}",
        "month": "All months" if month == ALL_MONTHS else months_txt[month - 1],
        "quarter": "All quarters" if quarter == ALL_QUARTERS else f"Q{quarter}",
        "year": year,
    }
    report_data = {
        "header": [header],
    }

    # Preparing filters based on received parameters
    default_search_filters = (Q(validity_to__isnull=True)
                              & Q(health_facility__validity_to__isnull=True)
                              & Q(health_facility__location__validity_to__isnull=True)
                              & Q(health_facility__location__parent_id=region_id)
                              & (
                                      (
                                              Q(items__isnull=True)
                                              | (
                                                      Q(items__validity_to__isnull=True)
                                                      & Q(items__product__validity_to__isnull=True)
                                               )
                                      ) & (
                                              Q(services__isnull=True)
                                              | (
                                                   Q(services__validity_to__isnull=True)
                                                   & Q(services__product__validity_to__isnull=True)
                                              )
                                      )
                              )
                              & Q(insuree__validity_to__isnull=True))
    if product_id != ALL_PRODUCTS:
        default_search_filters &= (Q(items__product_id=product_id) | Q(services__product_id=product_id))
    if hf_id != ALL_HFS:
        default_search_filters &= Q(health_facility_id=hf_id)
    elif district_id != ALL_DISTRICTS:
        default_search_filters &= Q(health_facility__location=district_id)

    subtotals = {
        "total": generate_subtotal()
    }

    # Preparing the list of months for which data will be calculated
    working_months = prepare_list_of_working_months(month, quarter)
    prepare_all_monthly_totals(subtotals, working_months)

    for current_month in working_months:

        start_date, end_date = calculate_start_end_month_dates(year, current_month)
        search_filters = default_search_filters & Q(date_from__range=[start_date, end_date])

        claims = (Claim.objects.filter(search_filters)
                               .distinct("id"))
        for claim in claims:
            dispatch_subtotals(subtotals, claim, current_month)

    format_totals(subtotals, report_data)
    report_data["data"] = format_final_data(subtotals, hf_info_mapping, product_info_mapping, months_txt)

    return report_data
