{strip2}

	{foreach from=$reportData key=rowId item=row}

		{* ===================================================================================== *}
		{* === DISPLAY SUBTITLE ================================================================ *}
		{* ===================================================================================== *}

		{if $row.GROUPING_DISPLAY_SUBTITLE}


			<Row ss:StyleID="tableRow_subtitle">

				{if $columnsConfig[$groupByColumn].type=='string' or !$columnsConfig[$groupByColumn].type}
					<Cell ss:StyleID="tableRow_subtitle"><Data ss:Type="String">{$row.GROUPING_SUBTITLE_NAME}</Data></Cell>
				{/if}

				{if $columnsConfig[$groupByColumn].type=='date'}
					{if $row.GROUPING_SUBTITLE_NAME and $row.GROUPING_SUBTITLE_NAME>='1900-01-01'} {* ignores 0000-00-00 and very old years *}
						<Cell ss:StyleID="tableRow_subtitle_date"><Data ss:Type="DateTime">{$row.GROUPING_SUBTITLE_NAME}T00:00:00.000</Data></Cell>
					{else}
						<Cell ss:StyleID="tableRow_subtitle"><Data ss:Type="String"></Data></Cell>
					{/if}
				{/if}

				{if $columnsConfig[$groupByColumn].type=='yearMonth'}
					{if $row.GROUPING_SUBTITLE_NAME and $GROUPING_SUBTITLE_NAME>='1900-01-01'} {* ignores 0000-00-00 and very old years *}
						<Cell ss:StyleID="tableRow_subtitle_yearMonth"><Data ss:Type="DateTime">{$row.GROUPING_SUBTITLE_NAME}T00:00:00.000</Data></Cell>
					{else}
						<Cell ss:StyleID="tableRow_subtitle"><Data ss:Type="String"></Data></Cell>
					{/if}
				{/if}

				{if $columnsConfig[$groupByColumn].type=='year'}
					{if $row.GROUPING_SUBTITLE_NAME and $row.GROUPING_SUBTITLE_NAME>='1900-01-01'} {* ignores 0000-00-00 and very old years *}
						<Cell ss:StyleID="tableRow_subtitle_year"><Data ss:Type="DateTime">{$row.GROUPING_SUBTITLE_NAME}T00:00:00.000</Data></Cell>
					{else}
						<Cell ss:StyleID="tableRow_subtitle"><Data ss:Type="String"></Data></Cell>
					{/if}
				{/if}

				{if $columnsConfig[$groupByColumn].type=='datetime'}
					{if $row.GROUPING_SUBTITLE_NAME and $row.GROUPING_SUBTITLE_NAME>="1900-01-01 00:00:00"} {* ignores 0000-00-00 and very old years *}
						<Cell ss:StyleID="tableRow_subtitle_time"><Data ss:Type="DateTime">{$row.GROUPING_SUBTITLE_NAME|date_format:"%Y-%m-%dT%H:%M:%S.000"}</Data></Cell>
					{else}
						<Cell ss:StyleID="tableRow_subtitle"><Data ss:Type="String"></Data></Cell>
					{/if}
				{/if}

				{if $columnsConfig[$groupByColumn].type=='numeric'}
					{if $row.GROUPING_SUBTITLE_NAME}
						<Cell ss:StyleID="tableRow_subtitle"><Data ss:Type="Number">{$row.GROUPING_SUBTITLE_NAME}</Data></Cell>
					{else}
						<Cell ss:StyleID="tableRow_subtitle"><Data ss:Type="String"></Data></Cell>
					{/if}
				{/if}

				{if $columnsConfig[$groupByColumn].type=='price'}
					<Cell ss:StyleID="tableRow_subtitle_price"><Data ss:Type="Number">{$row.GROUPING_SUBTITLE_NAME|round:6|default:"0"}</Data></Cell>
				{/if}

				{if $columnsConfig[$groupByColumn].type=='percent'}
					<Cell ss:StyleID="tableRow_subtitle_percent"><Data ss:Type="Number">{$row.GROUPING_SUBTITLE_NAME|round:6|default:"0"}</Data></Cell>
				{/if}

				{if $columnsConfig[$groupByColumn].type=='boolean'}
					<Cell ss:StyleID="tableRow_subtitle"><Data ss:Type="String">{if !is_null($row.GROUPING_SUBTITLE_NAME)}{$row.GROUPING_SUBTITLE_NAME|if:$_LANG.yes:$_LANG.no}{/if}</Data></Cell>
				{/if}

			</Row>

		{/if}



		{* ===================================================================================== *}
		{* === DISPLAY NORMAL RECORD =========================================================== *}
		{* ===================================================================================== *}

		{if !$row.GROUPING_DISPLAY_SUBTITLE and !$row.GROUPING_DISPLAY_SUBTOTALS}

			<Row ss:StyleID="tableRow">

				{foreach from=$columnTypes key=columnKey item=thisColumn}

					{assign var=cellValue value=$row.$columnKey}

					{* ---------- STRING DATA -------------------------------------- *}
					{if $columnTypes.$columnKey=='string'}
						<Cell ss:StyleID="tableRow"><Data ss:Type="String">{$cellValue}</Data></Cell>
					{/if}

					{* ---------- DATE DATA ---------------------------------------- *}
					{if $columnTypes.$columnKey=='date'}
						{if $cellValue and $cellValue>='1900-01-01'} {* ignores 0000-00-00 and very old years *}
							<Cell ss:StyleID="tableRow_date"><Data ss:Type="DateTime">{$cellValue}T00:00:00.000</Data></Cell>
						{else}
							<Cell ss:StyleID="tableRow"><Data ss:Type="String"></Data></Cell>
						{/if}
					{/if}

					{* ---------- YEAR MONTH DATA ---------------------------------- *}
					{if $columnTypes.$columnKey=='yearMonth'}
						{if $cellValue and $cellValue>='1900-01-01'} {* ignores 0000-00-00 and very old years *}
							<Cell ss:StyleID="tableRow_yearMonth"><Data ss:Type="DateTime">{$cellValue}T00:00:00.000</Data></Cell>
						{else}
							<Cell ss:StyleID="tableRow"><Data ss:Type="String"></Data></Cell>
						{/if}
					{/if}

					{* ---------- YEAR DATA ---------------------------------------- *}
					{if $columnTypes.$columnKey=='year'}
						{if $cellValue and $cellValue>='1900-01-01'} {* ignores 0000-00-00 and very old years *}
							<Cell ss:StyleID="tableRow_year"><Data ss:Type="DateTime">{$cellValue}T00:00:00.000</Data></Cell>
						{else}
							<Cell ss:StyleID="tableRow"><Data ss:Type="String"></Data></Cell>
						{/if}
					{/if}


					{* ---------- TIME DATA ---------------------------------------- *}
					{if $columnTypes.$columnKey=='datetime'}
						{if $cellValue}
							<Cell ss:StyleID="tableRow_time"><Data ss:Type="DateTime">{$cellValue|date_format:"%Y-%m-%dT%H:%M:%S.000"}</Data></Cell>
						{else}
							<Cell ss:StyleID="tableRow"><Data ss:Type="String"></Data></Cell>
						{/if}
					{/if}

					{* ---------- NUMERIC DATA ------------------------------------- *}
					{if $columnTypes.$columnKey=='numeric'}
						{if $cellValue}
							<Cell ss:StyleID="tableRow"><Data ss:Type="Number">{$cellValue}</Data></Cell>
						{else}
							<Cell ss:StyleID="tableRow"><Data ss:Type="String"></Data></Cell>
						{/if}
					{/if}

					{* ---------- PRICE DATA --------------------------------------- *}
					{if $columnTypes.$columnKey=='price'}
						<Cell ss:StyleID="tableRow_price"><Data ss:Type="Number">{$cellValue|round:6|default:"0"}</Data></Cell>
					{/if}

					{* ---------- PERCENT DATA ------------------------------------- *}
					{if $columnTypes.$columnKey=='percent'}
						<Cell ss:StyleID="tableRow_percent"><Data ss:Type="Number">{$cellValue|round:6|default:"0"}</Data></Cell>
					{/if}

					{* ---------- BOOLEAN ------------------------------------- *}
					{if $columnTypes.$columnKey=='boolean'}
						<Cell ss:StyleID="tableRow"><Data ss:Type="String">{if !is_null($cellValue)}{$cellValue|if:$_LANG.yes:$_LANG.no}{/if}</Data></Cell>
					{/if}

				{/foreach}

			</Row>

		{/if}



		{* ===================================================================================== *}
		{* === DISPLAY SUBTOTALS =============================================================== *}
		{* ===================================================================================== *}

		{if $row.GROUPING_DISPLAY_SUBTOTALS}

			<Row ss:StyleID="tableRow_subtotals">

				{foreach from=$columnTypes key=columnKey item=thisColumn}

					{if $columnsConfig.$columnKey.subtotals===true or $columnsConfig.$columnKey.subtotals==$groupByColumn}
						<Cell ss:StyleID="tableRow_subtotals_price"><Data ss:Type="Number">{$row.$columnKey|round:6|default:"0"}</Data></Cell>
					{else}
						<Cell ss:StyleID="tableRow_subtotals"><Data ss:Type="String"></Data></Cell>
					{/if}

				{/foreach}

			</Row>

		{/if}


	{/foreach}

{/strip2}