<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;
  }
  .link {
    width: 20px;
    height: 20px;
    display: block;
  }
  .accept-link {
    background: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAYdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAuNWWFMmUAAAOiSURBVDhPnZR9TFNXGMZPW9YGiqOwUTspCOuK1E73FZhDOgwUaopCCwXpam2hmAqi1DLExtmhaRE0WxMyROfKBIeZEJkmfLjUqaXUhTGo6fCDbXHLErJkf+iSJZtZ2J4duprNj8TiL3lyk3Oe98n75r33kifGRRikg4jjjz9jSXInO9gd7AJiJdzw7RNAw0S94psWXzOs4zaUjW66y3XFvhe+XSQuwuK7BSebr9hh8NThjYFCqIf1EJ5cfjfsWCQdRF80rJpv8O1BzuB6ZA8qUDyiRdopEcKORdBJlr3Qlz7rnDqMjSOVyD2nRMGQCpUeI4Qdyf6wK3J47vhW65Xmv3b4m1A4UoL1o2pUe2tpl7JfYyu45rAtQjpJ1tqzst9bA4dR7KmgKofOWw3NF5VIaOUNMGLIqrAzArpIXOIJ/tih4Puo8ddBc1kLnc+I+okGZLhXBKNSotZRF4+QFvo+vUv49JlK7CSRHjJCAQ8Q81GMsXZ8+3zLVQcqxnTQ+vWwTr8N+ZD8zpLS2K3UIqRiERpSKP4gPZDzybofnz8mmiEOsptkEU4o5R5dJEnSL/nFETwI1ZgGG30qGCerUOotxdID/G4GlyGlrn9rhK7k7+zjTjR4bWj07UP+GcUf0W0xB0jJQvuULsKh3Q3YpvbCPFmLsi81MEwZsCtogfSEJEAdWVRxIe8Coi4xTJ6dyDotx+v9Bcj9rIhuLHee4+L0EiVJYB9lKzZdrPyt7UY73vpKh6qAEfZv90JxXn6bV8Yz0YgkKmYobIGUI8tnai7sCIUt7U7Hcz0rIDunQMnnGizpfPpsal/aTNu1dpinzai+asTu2UZsmzYhySH4mJZnULFDQfdg72Pnp7nFP68ZKICwR0o/Hwky+l9F/qgSeq8BloldsH1jo50ZYL25E/u/fwev9b709VOCKBkt/2/U/8EiDUSR+KFgLntQDsnpTEjPZGLN8Jso92mxJ2hDTcCE+uvbcOgnJyouq+/EF8VtoXX3j/oALGYTK493PGEub0iJtUP5yDmfB6V3A7QTWtQETbDfsqEusBVprandTC5zJa25f9RHwKL/M0VC97Nzqgvl2HBJjeJxNTZP6WC5UQ/nrRZkn8p8eKuPgcVqZMlSelJm9f4qbJ7YQhdRBecP+1F2seS2oDzx4a1GACvaGP2i9NOV18yT5r+brjdie8CM9HbRo7caIUxBM3/1y32rLuWN5v75yrHVHs4yTg49f8yohPwDmFCDYDwVFvcAAAAASUVORK5CYII=') no-repeat center center;
    background-size: cover;
    float: left;
  }

  .decline-link {
    background: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAYdEVYdFNvZnR3YXJlAHBhaW50Lm5ldCA0LjAu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sjpQW2sPVlT8QY3ECBJQhGNIMiGVwgSfD35UHODxYAZ/z0ql4UmVat5Kkmc/ZrP/I8V1YuDlm/7KSkeAIsPuDickwDCm6sAU3dnZKzaJZAEVPw8KhWGK7AaeWzt2wG2VKjyt19+zKZWnm5OSqHpG0frF4tev1tQ4g1VVf3owTRuSUZ21czgwlpW13CsUzrVs23aiUyjs8SsUT67n5q7ewnH6CedxHhs0r9evzBkM94fy8r55n83OouF+np+pr386rtOtjYmVwYBhrNkon7+EozFLjQYjKkr0IYtluiyTXZpSq0N3FYrVeXw8hISLGPfAbAaM/+W9xMQDtJ6cnGZ3Wdm9ET5/xYo1u4zdHN6+fak7O3vakppqWZ8zajRiTvF4mlGFouOGXr/wq04Xfox7/8RoXP3ZbH42pFSOH2Qy99FaWaxt36WlfT2YkXHfxuOt2NLTl7uzsmZQWcv6Bvy7Tgj65wRR7FSrL90xGkO/lZXB/bKyZw6d7soxDuddtKevee2JjWW3I6lVJLrTJRBMY4Gb13dzwzohok7yeAXugoL2a0bjgk2lWiPDj2YG2hgRF8RHCQn8L9nst5uYzDpBTIwEr16+ThHQmzkc+XE2+606JvMg/n8ND5LRaH8DTAM+hOMg+wkAAAAASUVORK5CYII=') no-repeat center center;
    background-size: cover;
    float: right;
  }
  .accept {
    background-color: lightgreen;
  }
  .decline {
    background-color: lightpink;
  }
  .links-wrapper {
    width: 50px;
    margin: 0 auto;
  }
  </style>
 </head>
<body>
<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>
<TH>Действия</TH>
</tr>
%%#xsl:for-each select='{RootNode / AllChildren}' sort='{LeftIndex}'%%
<tr data-level='%%{TreeLevel}%%' data-itemid='%%{VisitPlanItemID}%%' class='%%{Status}=2?"accept":{Status}=3?"decline":""%%'>
%%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>
      <td>
      <div class='links-wrapper'>
        <a class="link accept-link" href='#' data-command='AcceptVisitItem'></a>
        <a class="link decline-link" href='#' data-command='DeclineVisitItem'></a></div>
      </td>
</tr>
%%#xsl:for-each select='{SumVisitPlanValues}' sort='{SortOrder};{VisitPlanItem/TreeLevel}' filter='<lx:Criterion type="=" xmlns:lx="lexem">    <lx:Path OwnerQueryLevel="0">        <lx:StepInt index="5160003" />        <lx:StepInt index="5060003" />        <lx:StepInt index="5040004" />    </lx:Path>    <lx:ConstOperand type="Boolean">True</lx:ConstOperand></lx:Criterion>'%%
<tr data-level='-1' class='%%{VisitPlanItem/Status}=2?"accept":{VisitPlanItem/Status}=3?"decline":""%%'>
%%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>
      <td></td>
</tr>
%%#xsl:end%%
%%#xsl:end%%
</table>
</body>
</html>
