<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta http-equiv="Content-Type" content="text/html; charset=windows-1251">
  <style type="text/css">
   table {
    border-collapse: collapse; /* Убираем двойные линии между ячейками */   
    font-family: 'Arial';
    border: 1px solid black;
cursor: default;
   }
   th, td {
    border: 1px solid black; /* Параметры рамки */
    padding: 4px; /* Поля вокруг текста */
   }
   th {
    background: #fc0; /* Цвет фона ячейки */
    height: 40px; /* Высота ячеек */
    font-weight: 700;
    vertical-align: bottom; /* Выравнивание по нижнему краю */
    padding: 0 4px 2px; /* Убираем поля вокруг текста */
   }
  td.num, th {
   text-align: center; /* Выравнивание по центру */
  }
td.num {
  font-size: 0.9em;
}
td.num:hover {
background-color: #88BAEF !important;
}
  td.empty-cell, td.last-empty-cell {
    width: 10px;
    border-top: none;
    border-bottom: none;
  }
td.parameter-cell {
  font-style: italic;
}
td.header-cell {
  font-weight: bold;
}
td.empty-cell {
background-color: #F7EDC3;
}
  td.last-empty-cell { 
    display: none;
  }
  tr:hover > td.last-empty-cell ~ td {
    background-color: #F8DF79;
  }
  </style>
 </head>
<body>
<!-- %%#xsl:group-by select='{VisitPlanItemViewSmos}' paths='{5360010 / 6970005}' sort='{Smo / NAM_SMOK}'%% -->
<!-- %%#xsl:for-each select='{*}'%% -->
<h1>%%{#group-by-groups(0)}%%</h1>
<!-- %%#xsl:for-each select='{*}'%% -->
<table>
<tr>
<TH colspan='%%ChildCount({AllChildren},Max({TreeLevel}))+2%%'>Вид помощи</th>
<TH>Январь</TH>
<TH>Февраль</TH>
<TH>Март</TH>
<TH>Апрель</TH>
<TH>Май</TH>
<TH>Июнь</TH>
<TH>Июль</TH>
<TH>Август</TH>
<TH>Сентябрь</TH>
<TH>Октябрь</TH>
<TH>Ноябрь</TH>
<TH>Декабрь</TH>
</tr>
%%#xsl:for-each select='{RootNode / AllChildren}' sort='{LeftIndex}'%%
<tr>
%%Repeat("<td class='empty-cell' />", {TreeLevel})%% <td class='last-empty-cell' /> <td class='header-cell' colspan='%%ChildCount({RootNode/AllChildren},Max({TreeLevel}))- {TreeLevel}+2%%'> %%{PayCategory / Name}%%</td>  <td class='num'>%%{MonthValuesSum / JAN}%%</td>  <td class='num'>%%{MonthValuesSum / FEB}%%</td> <td class='num'>%%{MonthValuesSum / MAR}%%</td> <td class='num'>%%{MonthValuesSum / APR}%%</td> <td class='num'>%%{MonthValuesSum / MAY}%%</td> <td class='num'>%%{MonthValuesSum / JUN}%%</td> <td class='num'>%%{MonthValuesSum / JUL}%%</td> <td class='num'>%%{MonthValuesSum / AUG}%%</td> <td class='num'>%%{MonthValuesSum / SEP}%%</td> <td class='num'>%%{MonthValuesSum / OCT}%%</td> <td class='num'>%%{MonthValuesSum  / NOV}%%</td>  <td class='num'>%%{MonthValuesSum / DEC}%%</td>
</tr>
%%#xsl:for-each select='{SumVisitPlanValues}'  filter='<lx:Criterion type="=" xmlns:lx="lexem">    <lx:Path OwnerQueryLevel="0">        <lx:StepInt index="5370003" />        <lx:StepInt index="5060003" />        <lx:StepInt index="5040004" />    </lx:Path>    <lx:ConstOperand type="Boolean">True</lx:ConstOperand></lx:Criterion>'%%
<tr>
%%Repeat("<td class='empty-cell' />",{VisitPlanItem/TreeLevel} + 1)%% <td class='last-empty-cell' /> <td class='parameter-cell' colspan='%%ChildCount({VisitPlanItem/RootNode/AllChildren},Max({TreeLevel})) - {VisitPlanItem/TreeLevel}+1%%'> %%{PayParametrService / PayParametr / Name}%%</td>   <td class='num'>%%{VisitPlanMonthValues / JAN}%%</td> <td class='num'>%%{VisitPlanMonthValues / FEB}%%</td> <td class='num'>%%{VisitPlanMonthValues / MAR}%%</td> <td class='num'>%%{VisitPlanMonthValues / APR}%%</td> <td class='num'>%%{VisitPlanMonthValues / MAY}%%</td> <td class='num'>%%{VisitPlanMonthValues / JUN}%%</td> <td class='num'>%%{VisitPlanMonthValues / JUL}%%</td> <td class='num'>%%{VisitPlanMonthValues / AUG}%%</td> <td class='num'>%%{VisitPlanMonthValues / SEP}%%</td> <td class='num'>%%{VisitPlanMonthValues / OCT}%%</td> <td class='num'>%%{VisitPlanMonthValues / NOV}%%</td> <td class='num'>%%{VisitPlanMonthValues / DEC}%%</td> 
</tr>
%%#xsl:end%%
%%#xsl:end%%
</table>
<!-- %%#xsl:end%% -->
<!-- %%#xsl:end%% -->
<!-- %%#xsl:end%% -->
</body>
</html>
