{$headstyle= "font-size:11px; font-weight: bold; border-width:2px; border-color:lightgrey; background-color: #F4F6F7;"}
{$headstyle_pre= "font-size:11px; border-width:2px; border-color:lightgrey; background-color: #F4F6F7; color: darkslategray;"}

{$bodystyle="text-align:right; font-size:11px; border-width:2px; border-color:lightgrey;"}
{$bodystyle_pre="text-align:right; font-size:11px; border-width:2px; border-color:lightgrey; color: darkslategray;"}

{$footstyle="text-align:right; font-size:11px; font-weight:bold; border-width:2px; border-color:lightgrey;"}
{$footstyle_pre="text-align:right; font-size:11px; font-weight:bold; border-width:2px; border-color:lightgrey; background-color:F4F6F7; color: darkslategray;"}

<table class="editablepop result" style="width: 100%; margin-top:10px;">
    <thead>
        <tr>
            <th style="{$headstyle}" colspan="2">
                {$i.filter_work_package}
            </th>
            <th style="{$headstyle}">
                {$i.controlpanel_kostenstelle}
            </th>
            {if $keydate_diff_to_pre!==false}
                <th style="{$headstyle_pre}" title="{$i.controlpanel_sollhonorar}" class="hoverhelp">
                    {$i.controlpanel_sollhonorar} {$keydate_pre->us_date()}
                </th>
            {/if}
            <th style="{$headstyle}" title="{$i.controlpanel_sollhonorar}" class="hoverhelp">
                {$i.controlpanel_sollhonorar}
            </th>
            {if $keydate_diff_to_pre!==false}
                <th style="{$headstyle_pre}" title="Sollhonorar extern" class="hoverhelp">
                    {$i.controlpanel_sollhonorar_extern} {$keydate_pre->us_date()}
                </th>
            {/if}
            <th style="{$headstyle}" title="{$i.controlpanel_sollhonorar}" class="hoverhelp">
                {$i.controlpanel_sollhonorar_extern}
            </th>
            {if $keydate_diff_to_pre!==false}
                <th style="{$headstyle_pre}" title="{$i.controlpanel_gepl_honverm_kosten}" class="hoverhelp">
                    {$i.controlpanel_gepl_honverm_kosten} {$keydate_pre->us_date()}
                </th>
            {/if}
            <th style="{$headstyle}" title="{$i.controlpanel_gepl_honverm_kosten_beschreibung}" class="hoverhelp">
                {$i.controlpanel_gepl_honverm_kosten}
            </th>
            {if $keydate_diff_to_pre!==false}
                <th style="{$headstyle_pre}" title="{$i.controlpanel_honorarintern}" class="hoverhelp">
                    {$i.controlpanel_honorarintern} {$keydate_pre->us_date()}
                </th>
            {/if}
            <th style="{$headstyle}" title="{$i.controlpanel_verfuegbares_sollhonorar}" class="hoverhelp">
                {$i.controlpanel_honorarintern}
            </th>
            {if $not_show_columns.portlet_psp_anteil_vom_gesamt_honorar}
                <th style="{$headstyle}" title="{$i.controlpanel_anteil_vom_gesamt_honorar_beschreibung}" class="hoverhelp">
                    {$i.controlpanel_anteil_vom_gesamt_honorar}
                </th>
            {/if}
            {if $not_show_columns.portlet_psp_anteil_vom_honorar_bereich}
                <th style="{$headstyle}" title="{$i.controlpanel_anteil_vom_honorar_bereich_beschreibung}" class="hoverhelp">
                    {$i.controlpanel_anteil_vom_honorar_bereich}
                </th>
            {/if}
            {if $not_show_columns.portlet_psp_budget}
                {if $keydate_diff_to_pre!==false}
                    <th style="{$headstyle_pre}" title="{$i.controlpanel_budget}" class="hoverhelp">
                        {$i.controlpanel_budget} {$keydate_pre->us_date()}
                    </th>
                {/if}
                <th style="{$headstyle}" title="{$i.controlpanel_budget_beschreibung}" class="hoverhelp">
                    {$i.controlpanel_budget}
                    <a href="javascript:fullPopup.view('work_packages', 'index', {$value_project->project_id})" target="_self" class="dialog_make_btn16 edit"></a>
                </th>
            {/if}
            {if $not_show_columns.portlet_psp_zeitkosten}
                {if $keydate_diff_to_pre!==false}
                    <th style="{$headstyle_pre}" title="{$i.controlpanel_zeitkosten_beschreibung}" class="hoverhelp">
                        {$i.controlpanel_zeitkosten} {$keydate_pre->us_date()}
                    </th>
                {/if}
                <th style="{$headstyle}" title="{$i.controlpanel_zeitkosten_beschreibung}" class="hoverhelp">
                    {$i.controlpanel_zeitkosten}
                </th>
            {/if}
            {if $not_show_columns.portlet_psp_reise_nebenkosten}
                {if $keydate_diff_to_pre!==false}
                    <th style="{$headstyle_pre}" title="{$i.controlpanel_reise_nebenkosten}" class="hoverhelp">
                        {$i.controlpanel_reise_nebenkosten} {$keydate_pre->us_date()}
                    </th>
                {/if}
                <th style="{$headstyle}" >
                    {$i.controlpanel_reise_nebenkosten}
                </th>
            {/if}
            {if $not_show_columns.portlet_psp_verrechnete_kosten}
                {if $keydate_diff_to_pre!==false}
                    <th style="{$headstyle_pre}" title="{$i.controlpanel_verrechnete_kosten_beschreibung}" class="hoverhelp">
                        {$i.controlpanel_verrechnete_kosten} {$keydate_pre->us_date()}
                    </th>
                {/if}
                <th style="{$headstyle}" title="{$i.controlpanel_verrechnete_kosten_beschreibung}" class="hoverhelp">
                    {$i.controlpanel_verrechnete_kosten}
                </th>
            {/if}
            {if $not_show_columns.portlet_psp_kosten}
                {if $keydate_diff_to_pre!==false}
                    <th style="{$headstyle_pre}" title="{$i.controlpanel_kosten}" class="hoverhelp">
                        &nbsp;&nbsp;{$i.controlpanel_kosten}&nbsp;&nbsp; {$keydate_pre->us_date()}
                    </th>
                {/if}
                <th style="{$headstyle}" >
                    &nbsp;&nbsp;{$i.controlpanel_kosten}&nbsp;&nbsp;
                </th>
            {/if}
            {if $not_show_columns.portlet_psp_geplante_kosten}
                <th style="{$headstyle}" >
                    {$i.controlpanel_geplante_kosten}
                </th>
            {/if}
            {if $not_show_columns.portlet_psp_kosten_plus_geplante_kosten}
                <th style="{$headstyle}" >
                    {$i.controlpanel_kosten_plus_geplante_kosten}
                </th>
            {/if}
            {if $keydate_diff_to_pre!==false}
                <th style="{$headstyle_pre}" title="{$i.controlpanel_projektkosten}" class="hoverhelp">
                    {$i.controlpanel_projektkosten} {$keydate_pre->us_date()}
                </th>
            {/if}
            <th style="{$headstyle}" title="{$i.controlpanel_projektkosten_beschreibung}" class="hoverhelp">
                {$i.controlpanel_projektkosten}
            </th>
            {if $not_show_columns.portlet_psp_arbbereichmittelsatz}
                <th style="{$headstyle}" title="{$i.controlpanel_arbbereichmittelsatz_beschreibung}" class="hoverhelp">
                    {$i.controlpanel_arbbereichmittelsatz}
                </th>
            {/if}

            {if $keydate_diff_to_pre!==false}
                <th style="{$headstyle_pre}">
                    {$i.controlpanel_sollstunden} {$keydate_pre->us_date()}
                </th>
            {/if}
            <th style="{$headstyle}" >{$i.controlpanel_sollstunden}</th>
                {if $keydate_diff_to_pre!==false}
                <th style="{$headstyle_pre}">
                    {$i.controlpanel_budget_hours} {$keydate_pre->us_date()}
                </th>
            {/if}
            <th style="{$headstyle}" >{$i.controlpanel_budget_hours}</th>

            {if $keydate_diff_to_pre!==false}
                <th style="{$headstyle}">
                    {$i.controlpanel_iststunden} {$keydate_pre->us_date()}
                </th>
            {/if}
            <th style="{$headstyle}" >
                {$i.controlpanel_iststunden}
            </th>

            {if $not_show_columns.portlet_psp_show_deduction_values}
                {if $keydate_diff_to_pre!==false}
                    <th style="{$headstyle_pre}" >
                        {$i.controlpanel_abgerechnete_stunden} {$keydate_pre->us_date()}
                    </th>
                {/if}
                <th style="{$headstyle}" >
                    {$i.controlpanel_abgerechnete_stunden}
                </th>
                {if $keydate_diff_to_pre!==false}
                    <th style="{$headstyle_pre}" >
                        {$i.controlpanel_deducted_hours_money} {$keydate_pre->us_date()}
                    </th>
                {/if}
                <th style="{$headstyle}" >
                    {$i.controlpanel_deducted_hours_money}
                </th>

                {if $keydate_diff_to_pre!==false}
                    <th style="{$headstyle_pre}" >
                        {$i.controlpanel_deducted_travels_money} {$keydate_pre->us_date()}
                    </th>
                {/if}
                <th style="{$headstyle}" >
                    {$i.controlpanel_deducted_travels_money}
                </th>
                {if $keydate_diff_to_pre!==false}
                    <th style="{$headstyle_pre}" >
                        {$i.controlpanel_deducted_extras_money} {$keydate_pre->us_date()}
                    </th>
                {/if}
                <th style="{$headstyle}" >
                    {$i.controlpanel_deducted_extras_money}
                </th>
                {if $keydate_diff_to_pre!==false}
                    <th style="{$headstyle}" >
                        {$i.controlpanel_deducted_externalexpenses_money} {$keydate_pre->us_date()}
                    </th>
                {/if}
                <th style="{$headstyle}" >
                    {$i.controlpanel_deducted_externalexpenses_money}
                </th>
                {if $keydate_diff_to_pre!==false}
                    <th style="{$headstyle_pre}" >
                        {$i.controlpanel_deducted_sum} {$keydate_pre->us_date()}
                    </th>
                {/if}
                <th style="{$headstyle}" >
                    {$i.controlpanel_deducted_sum}
                </th>
                {if $keydate_diff_to_pre!==false}
                    <th style="{$headstyle_pre}" >
                        {$i.controlpanel_sollhonorar_abzgl_abgerechnet} {$keydate_pre->us_date()}
                    </th>
                {/if}
                <th style="{$headstyle}" >
                    {$i.controlpanel_sollhonorar_abzgl_abgerechnet}
                </th>
                <th style="{$headstyle}" >
                    {$i.controlpanel_abzurechnende_stunden}
                </th>
                <th style="{$headstyle}" >
                    {$i.controlpanel_to_deduct_hours_money}
                </th>
                <th style="{$headstyle}" >
                    {$i.controlpanel_to_deduct_travels_money}
                </th>
                <th style="{$headstyle}" >
                    {$i.controlpanel_to_deduct_extras_money}
                </th>
                <th style="{$headstyle}" >
                    {$i.controlpanel_to_deduct_externalexpenses_money}
                </th>
                <th style="{$headstyle}" >
                    {$i.controlpanel_to_deduct_sum}
                </th>
                <th style="{$headstyle}" title="{$i.controlpanel_irrecoverable_desc}" class="hoverhelp">
                    {$i.controlpanel_irrecoverable_hours}
                </th>
                <th style="{$headstyle}" title="{$i.controlpanel_irrecoverable_desc}" class="hoverhelp">
                    {$i.controlpanel_irrecoverable_hours_money}
                </th>
                <th style="{$headstyle}" title="{$i.controlpanel_irrecoverable_desc}" class="hoverhelp">
                    {$i.controlpanel_irrecoverable_travels_money}
                </th>
                <th style="{$headstyle}" title="{$i.controlpanel_irrecoverable_desc}" class="hoverhelp">
                    {$i.controlpanel_irrecoverable_extras_money}
                </th>
                <th style="{$headstyle}" title="{$i.controlpanel_irrecoverable_desc}" class="hoverhelp">
                    {$i.controlpanel_irrecoverable_externalexpenses_money}
                </th>
                <th style="{$headstyle}" title="{$i.controlpanel_irrecoverable_desc}" class="hoverhelp">
                    {$i.controlpanel_irrecoverable_sum}
                </th>
            {/if}

            {if $keydate_diff_to_pre!==false}
                <th style="{$headstyle_pre}">
                    {$i.controlpanel_warnschwelle} {$keydate_pre->us_date()}
                </th>
            {/if}

            <th style="{$headstyle}" title="{$i.controlpanel_warnschwelle}" class="hoverhelp">
                {$i.controlpanel_warnschwelle}
                <a href="javascript:fullPopup.view('work_packages', 'index', {$value_project->project_id})" target="_self" class="dialog_make_btn16 edit"></a>
            </th>

            {if $keydate_diff_to_pre!==false}
                <th style="{$headstyle_pre}">
                    {$i.controlpanel_ist_durch_sollstunden} {$keydate_pre->us_date()}
                </th>
            {/if}
            <th style="{$headstyle}" >{$i.controlpanel_ist_durch_sollstunden}</th>

            {if $keydate_diff_to_pre!==false}
                <th style="{$headstyle_pre}">
                    {$i.controlpanel_fertigstellungsgrad} {$keydate_pre->us_date()}
                </th>
            {/if}
            <th style="{$headstyle}" title="{$i.controlpanel_fertigstellungsgrad_beschreibung}" class="hoverhelp">
                {$i.controlpanel_fertigstellungsgrad}
                <a href="{site_url url="start/open/projectadmin/index/`$xjxcookie`/view_completion_level/`$value_project->project_id`"}" target="_blank" onclick="usComm.windowOpen(this.href); return false;" class="dialog_make_btn16 edit"></a>
            </th>

            <th style="{$headstyle}" >{$i.controlpanel_aenderungsdatum}</th>

            {if $keydate_diff_to_pre!==false}
                <th style="{$headstyle_pre}">
                    {$i.reporting_rep_fee_internal_completed} {$keydate_pre->us_date()}
                </th>
            {/if}
            <th style="{$headstyle}" title="{if $use_verfuegbares_sollhonorar}{$i.reporting_rep_fee_internal_completed_title}{else}{$i.reporting_rep_fee_internal_completed_all_title}{/if}" class="hoverhelp">
        {if $use_verfuegbares_sollhonorar}{$i.reporting_rep_fee_internal_completed}{else}{$i.reporting_rep_fee_internal_completed_all}{/if}
    </th>
    {if $keydate_diff_to_pre!==false}
        <th style="{$headstyle_pre}">
            {$i.controlpanel_ergebnis_aktuell_honorarbasis} {$keydate_pre->us_date()}
        </th>
    {/if}
    <th style="{$headstyle}" title="{$i.controlpanel_ergebnis_aktuell_honorarbasis_beschreibung}" class="hoverhelp">
        {$i.controlpanel_ergebnis_aktuell_honorarbasis}
    </th>
    {if $keydate_diff_to_pre!==false}
        <th style="{$headstyle_pre}">
            {$i.controlpanel_ergebnis_prognose_honorarbasis} {$keydate_pre->us_date()}
        </th>
    {/if}
    <th style="{$headstyle}" title="{$i.controlpanel_ergebnis_prognose_honorarbasis_beschreibung}" class="hoverhelp">
        {$i.controlpanel_ergebnis_prognose_honorarbasis}
    </th>
    <th style="{$headstyle}" title="{$i.controlpanel_gepl_honverm_kosten_beschreibung}" class="hoverhelp">
        {$i.controlpanel_gepl_honverm_kosten}
    </th>

    {if $keydate_diff_to_pre!==false}
        <th style="{$headstyle_pre}">
            {$i.controlpanel_restgeld} {$keydate_pre->us_date()}
        </th>
    {/if}
    <th style="{$headstyle}" title="{$i.controlpanel_restgeld_beschreibung}" class="hoverhelp">
        {$i.controlpanel_restgeld}
    </th>
    <th style="{$headstyle}" title="{$i.controlpanel_restgeld_honorarbasis_minus_gepl_honverm_kosten_beschreibung}" class="hoverhelp">
        {$i.controlpanel_restgeld_honorarbasis_minus_gepl_honverm_kosten}
    </th>
    {if $not_show_columns.portlet_psp_erbrachte_leistung_budgetbasis}
        {if $keydate_diff_to_pre!==false}
            <th style="{$headstyle_pre}">
                {$i.controlpanel_budget} {$i.controlpanel_erbrachte_leistung_budgetbasis} {$keydate_pre->us_date()}
            </th>
        {/if}
        <th style="{$headstyle}" title="{$i.controlpanel_erbrachte_leistung_budgetbasis_beschreibung}" class="hoverhelp">
            {$i.controlpanel_budget} {$i.controlpanel_erbrachte_leistung_budgetbasis}
        </th>
    {/if}
    {if $not_show_columns.portlet_psp_ergebnis_aktuell_budgetbasis}
        {if $keydate_diff_to_pre!==false}
            <th style="{$headstyle_pre}">
                {$i.controlpanel_budget} {$i.controlpanel_ergebnis_aktuell_budgetbasis} {$keydate_pre->us_date()}
            </th>
        {/if}
        <th style="{$headstyle}" title="{$i.controlpanel_ergebnis_aktuell_budgetbasis_beschreibung}" class="hoverhelp">
            {$i.controlpanel_budget} {$i.controlpanel_ergebnis_aktuell_budgetbasis}
        </th>
    {/if}
    {if $not_show_columns.portlet_psp_ergebnis_prognose_budgetbasis}
        {if $keydate_diff_to_pre!==false}
            <th style="{$headstyle_pre}">
                {$i.controlpanel_budget} {$i.controlpanel_ergebnis_prognose_budgetbasis} {$keydate_pre->us_date()}
            </th>
        {/if}
        <th style="{$headstyle}" title="{$i.controlpanel_ergebnis_prognose_budgetbasis_beschreibung}" class="hoverhelp">
            {$i.controlpanel_budget} {$i.controlpanel_ergebnis_prognose_budgetbasis}
        </th>
    {/if}
    {if $not_show_columns.portlet_psp_gepl_honverm_kosten_budgetbasis}
        <th style="{$headstyle}" title="{$i.controlpanel_gepl_honverm_kosten_beschreibung}" class="hoverhelp">
            {$i.controlpanel_budget} {$i.controlpanel_gepl_honverm_kosten_budgetbasis}
        </th>
    {/if}
    {if $not_show_columns.portlet_psp_restgeld_budget}
        {if $keydate_diff_to_pre!==false}
            <th style="{$headstyle_pre}">
                {$i.controlpanel_budget} {$i.controlpanel_restgeld} {$keydate_pre->us_date()}
            </th>
        {/if}
        <th style="{$headstyle}" title="{$i.controlpanel_restgeld_budget_beschreibung}" class="hoverhelp">
            {$i.controlpanel_budget} {$i.controlpanel_restgeld}
        </th>
    {/if}
    {if $not_show_columns.portlet_psp_restgeld_budget_minus_gepl_honverm_kosten}
        <th style="{$headstyle}" title="{$i.controlpanel_restgeld_budget_minus_gepl_honverm_kosten_beschreibung}" class="hoverhelp">
            {$i.controlpanel_budget} {$i.controlpanel_restgeld_budget_minus_gepl_honverm_kosten}
        </th>
    {/if}
    {if $not_show_columns.portlet_psp_geplanter_beginn}
        <th style="{$headstyle}" >
            {$i.controlpanel_geplanter_beginn}
        </th>
    {/if}
    {if $not_show_columns.portlet_psp_geplantes_ende}
        <th style="{$headstyle}" >
            {$i.controlpanel_geplantes_ende}
        </th>
    {/if}

    {if $colspan8 != 0}
        {if $value_project->invoiced_fees_without_wkp > 0}
            {if $keydate_diff_to_pre!==false}
                <th style="{$headstyle_pre}" title="{$i.controlpanel_invoiced_name}" class="hoverhelp">
                    {$i.controlpanel_invoiced_name} {$keydate_pre->us_date()} {isfloat value=$value_project->invoiced_fees_without_wkp_pre maxf=2}
                </th>
            {/if}
            <th style="{$headstyle}" title="{$i.controlpanel_invoiced_desc}"
                class="hoverhelp">{$i.controlpanel_invoiced_name} {isfloat value=$value_project->invoiced_fees_without_wkp maxf=2}
            </th>
        {else}
            {if $keydate_diff_to_pre!==false}
                <th style="{$headstyle_pre}" title="{$i.controlpanel_invoiced_name}" class="hoverhelp">
                    {$i.controlpanel_invoiced_name} {$keydate_pre->us_date()}
                </th>
            {/if}
            <th style="{$headstyle}" title="{$i.controlpanel_invoiced_desc}">
                {$i.controlpanel_invoiced_name}
            </th>
        {/if}

        {if $value_project->remited_without_wkp > 1}
            {if $keydate_diff_to_pre!==false}
                <th style="{$headstyle_pre}" title="{$i.controlpanel_remitted_desc}" class="hoverhelp">
                    {$i.controlpanel_remited} {$keydate_pre->us_date()} {isfloat value=$value_project->remited_without_wkp_pre maxf=2}
                </th>
            {/if}
            <th style="{$headstyle}" title="{$i.controlpanel_remitted_desc}"
                class="hoverhelp">{$i.controlpanel_remited} {isfloat value=$value_project->remited_without_wkp maxf=2}
            </th>
        {else}
            {if $keydate_diff_to_pre!==false}
                <th style="{$headstyle_pre}" title="{$i.controlpanel_remited}" class="hoverhelp">
                    {$i.controlpanel_remited} {$keydate_pre->us_date()}
                </th>
            {/if}
            <th style="{$headstyle}" title="{$i.controlpanel_invoiced_desc}">
                {$i.controlpanel_remited}
            </th>
        {/if}
        {if $value_project->planned_fees_without_wkp > 1}
            <th style="{$headstyle}" title="{$i.controlpanel_fees_planned_desc}"
                class="hoverhelp">{$i.controlpanel_fees_planned_name} {isfloat value=$value_project->planned_fees_without_wkp maxf=2}
            </th>
        {else}
            <th style="{$headstyle}" title="{$i.controlpanel_invoiced_desc}">{$i.controlpanel_fees_planned_name}
            </th>
        {/if}
    {/if}

    {if $not_show_columns.portlet_psp_show_staffs}
        {foreach item=fields key=id from=$value_project->staffs_for_hours}
            {if $id < $max_staff}
                {if $fields->staff_name != ''}
                    {if $keydate_diff_to_pre!==false}
                        <th style="{$headstyle_pre}" class="hoverhelp">
                            {$fields->staff_name} {$keydate_pre->us_date()}
                        </th>
                    {/if}
                    <th style="{$headstyle}" >
                        {$fields->staff_name}
                    </th>
                {/if}
            {/if}
        {/foreach}
        {if $value_project->hours_more_than_30_flag == 1}
            {if $keydate_diff_to_pre!==false}
                <th style="{$headstyle_pre}" class="hoverhelp">
                    {if $value_project->how_many_staffs_more !==false}
                        {$value_project->how_many_staffs_more} {$i.controlpanel_more_staff} {$keydate_pre->us_date()}
                    {else}
                        {$value_project->how_many_staffs_more} {$i.controlpanel_more_staff} {$keydate_pre->us_date()}
                    {/if}
                </th>
            {/if}
            <th style="{$headstyle}" >
                {if $value_project->how_many_staffs_more !==false}
                    {$value_project->how_many_staffs_more} {$i.controlpanel_more_staff}
                {else}
                    {$value_project->how_many_staffs_more}{$i.controlpanel_more_staff}
                {/if}
            </th>
        {/if}
    {/if}
</tr>

</thead>
<tbody style="white-space:nowrap">
    {foreach item=field name="areas" key=id from=$value_project->w_areas}

        {if !$smarty.foreach.areas.first}

            <tr class="{if $smarty.foreach.areas.iteration is even}even{/if} depth_{$field->depth}">

                {$decoration=''}
                {if $field->depth==2}
                    {$decoration='text-decoration: underline; text-decoration-skip-ink: auto; text-decoration-skip: edges;'}
                {/if}

                {$faktor=0.05}
                {if $field->depth<5}
                    {$f=1+$faktor-($field->depth*$faktor)}
                {else}
                    {$f=1+$faktor-(4*$faktor)}
                {/if}

                {$sz=$decoration|cat:'font-size: '|cat:$f|cat:'em;'}
                {$styles_1=';font-style:italic; '|cat:$sz}
                {$styles_2=';font-weight: border-style: solid;'|cat:$sz}

                {if ($field->is_fee_area==1)}
                    {$styles=$styles_2}
                {else}
                    {$styles=$styles_1}
                {/if}

                <td {$bodystyle}>
                    {if !$smarty.foreach.areas.last}
                        {$next_id = $id + 1}
                        {if $field->depth < $value_project->w_areas.$next_id->depth}
                            {*$styles=$styles_2*}
                            <span onclick="controlpanel.togglerows(this, {$field->depth});" class="dialog_make_btn16 close mobile_big smallbtns ui-corner-all"></span>
                        {else}
                            {*$styles=$styles_1*}
                        {/if}
                    {/if}
                </td>
                <td style="{$styles}{$bodystyle};white-space: nowrap; text-align: left;" title="{$field->full_name}">{$field->full_name}</td>
                <td style="{$styles}{$bodystyle};white-space: nowrap; text-align: left;" title="{$field->full_name}">{$field->cost_centre_name}</td>
                {if $keydate_diff_to_pre!==false}
                    <td style="{$styles}{$bodystyle_pre}" class="floatval" title="{$field->full_name}">{isfloat value=$field->fee_costs_pre maxf=2}</td>
                {/if}
                <td style="{$styles}{$bodystyle}" class="floatval" title="{$field->full_name}">{isfloat value=$field->fee_costs maxf=2}</td>
                {if $keydate_diff_to_pre!==false}
                    <td style="{$styles}{$bodystyle_pre}" class="floatval" title="{$field->full_name}">{isfloat value=$field->fee_costs_external_pre maxf=2}</td>
                {/if}
                <td style="{$styles}{$bodystyle}" class="floatval" title="{$field->full_name}">{isfloat value=$field->fee_costs_external maxf=2}</td>

                {if $keydate_diff_to_pre!==false}
                    <td class="floatval" style="{$styles}{$bodystyle}" title="{$field->full_name}">{isfloat value=$field->honvermgeplextkst_value_pre maxf=2}</td>
                {/if}
                <td class="floatval" style="{$styles}{$bodystyle}{if $field->honvermgeplextkst_value<0}color:red;{/if}" title="{$field->full_name}">{isfloat value=$field->honvermgeplextkst_value maxf=2}</td>

                {if $keydate_diff_to_pre!==false}
                    <td style="{$styles}{$bodystyle_pre}" class="floatval" title="{$field->full_name}">{isfloat value=$field->verfuegbares_sollhonorar_pre maxf=2}</td>
                {/if}
                <td style="{$styles}{$bodystyle}" class="floatval" title="{$field->full_name}">{isfloat value=$field->verfuegbares_sollhonorar maxf=2}</td>

                {if $not_show_columns.portlet_psp_anteil_vom_gesamt_honorar}
                    {if $field->budget_proportion !=0 && $cost_centre_id == 0}
                        <td style="{$styles}{$bodystyle}" class="floatval" title="{$field->full_name}">{isfloat value=$field->budget_proportion*100 maxf=2} %</td>
                    {else}
                        <td style="{$styles}{$bodystyle}" class="floatval" title="{$field->full_name}"></td>
                    {/if}
                {/if}
                {if $not_show_columns.portlet_psp_anteil_vom_honorar_bereich}
                    {if $field->fee_costs !=0 && $cost_centre_id == 0}
                        <td style="{$styles}{$bodystyle}" class="floatval" title="{$field->full_name}">{isfloat value=$field->budget_planned_costs/$field->fee_costs * 100 maxf=2} %</td>
                    {else}
                        <td style="{$styles}{$bodystyle}" class="floatval" title="{$field->full_name}"></td>
                    {/if}
                {/if}
                {if $not_show_columns.portlet_psp_budget}
                    {if $keydate_diff_to_pre!==false}
                        <td style="{$styles}{$bodystyle_pre}" class="floatval" title="{$field->full_name}">{isfloat value=$field->budget_planned_costs_pre maxf=2}</td>
                    {/if}
                    <td style="{$styles}{$bodystyle}" class="floatval" title="{$field->full_name}">{isfloat value=$field->budget_planned_costs maxf=2}</td>
                {/if}
                {if $not_show_columns.portlet_psp_zeitkosten}
                    {if $keydate_diff_to_pre!==false}
                        <td style="{$styles}{$bodystyle_pre}" class="floatval" title="{$field->full_name}">{isfloat value=$field->times_kosten_pre maxf=2}</td>
                    {/if}
                    <td style="{$styles}{$bodystyle}" class="floatval" title="{$field->full_name}">{isfloat value=$field->times_kosten maxf=2}</td>
                {/if}
                {if $not_show_columns.portlet_psp_reise_nebenkosten}
                    {if $keydate_diff_to_pre!==false}
                        <td style="{$styles}{$bodystyle_pre}" class="floatval" title="{$field->full_name}">{isfloat value=$field->interne_nebenkosten_pre maxf=2}</td>
                    {/if}
                    <td style="{$styles}{$bodystyle}" class="floatval" title="{$field->full_name}">{isfloat value=$field->interne_nebenkosten maxf=2}</td>
                {/if}
                {if $not_show_columns.portlet_psp_verrechnete_kosten}
                    {if $keydate_diff_to_pre!==false}
                        <td style="{$styles}{$bodystyle_pre}" class="floatval" title="{$field->full_name}">{isfloat value=$field->externalexpenses_charged_pre maxf=2}</td>
                    {/if}
                    <td style="{$styles}{$bodystyle}" class="floatval" title="{$field->full_name}">{isfloat value=$field->externalexpenses_charged maxf=2}</td>
                {/if}
                {if $not_show_columns.portlet_psp_kosten}
                    {if $keydate_diff_to_pre!==false}
                        <td style="{$styles}{$bodystyle_pre}" class="floatval" title="{$field->full_name}">{isfloat value=$field->externalexpenses_kosten_pre maxf=2}</td>
                    {/if}
                    <td style="{$styles}{$bodystyle}" class="floatval" title="{$field->full_name}">{isfloat value=$field->externalexpenses_kosten maxf=2}</td>
                {/if}
                {if $not_show_columns.portlet_psp_geplante_kosten}
                    <td style="{$styles}{$bodystyle}" class="floatval" title="{$field->full_name}">{isfloat value=$field->externalexpenses_kosten_planned maxf=2}</td>
                {/if}
                {if $not_show_columns.portlet_psp_kosten_plus_geplante_kosten}
                    <td style="{$styles}{$bodystyle}" class="floatval" title="{$field->full_name}">{isfloat value=$field->ext_kosten_plus_planned maxf=2}</td>
                {/if}

                {if $keydate_diff_to_pre!==false}
                    <td class="floatval" style="{$styles}{$bodystyle_pre}">{isfloat value=$field->summekostenist_pre maxf=2}</td>
                {/if}
                {$color = ''}
                {if $field->depth == 1 && ($field->fee_costs<$field->summekostenist)}
                    {$color = 'color:red'}
                {/if}
                <td class="floatval" style="{$styles}{$bodystyle} {$color}" title="{$field->full_name}">{isfloat value=$field->summekostenist maxf=2}</td>

                {if $not_show_columns.portlet_psp_arbbereichmittelsatz}
                    {if isset($arbeitsbereichsmittelsatz[$field->id])}
                        <td style="{$styles}{$bodystyle}" class="floatval" title="{$field->full_name}">{isfloat value=$arbeitsbereichsmittelsatz[$field->id] maxf=2}</td>
                    {else}
                        <td style="{$styles}{$bodystyle}" class="floatval" title="{$field->full_name}">{isfloat value=0 maxf=2}</td>
                    {/if}
                {/if}

                {if $keydate_diff_to_pre!==false}
                    <td style="{$styles}{$bodystyle_pre}" class="floatval" title="{$field->full_name}">{isfloat value=$field->fee_hours_pre maxf=2}</td>
                {/if}
                <td style="{$styles}{$bodystyle}" class="floatval" title="{$field->full_name}">{isfloat value=$field->fee_hours maxf=2}</td>
                {if $keydate_diff_to_pre!==false}
                    <td style="{$styles}{$bodystyle_pre}" class="floatval" title="{$field->full_name}">{isfloat value=$field->budget_planned_hours_pre maxf=2}</td>
                {/if}
                <td style="{$styles}{$bodystyle}" class="floatval" title="{$field->full_name}">{isfloat value=$field->budget_planned_hours maxf=2}</td>
                {if $keydate_diff_to_pre!==false}
                    <td style="{$styles}{$bodystyle_pre}" class="floatval" title="{$field->full_name}">{isfloat value=$field->ist_times_pre maxf=2}</td>
                {/if}
                <td style="{$styles}{$bodystyle}" class="floatval" title="{$field->full_name}">{isfloat value=$field->ist_times maxf=2}</td>

                {if $not_show_columns.portlet_psp_show_deduction_values}
                    {if $keydate_diff_to_pre!==false}
                        <td style="{$styles}{$bodystyle_pre}" class="floatval" title="{$field->full_name}">{isfloat value=$field->abgerechnete_stunden_pre maxf=2}</td>
                    {/if}
                    <td style="{$styles}{$bodystyle}" class="floatval" title="{$field->full_name}">{isfloat value=$field->abgerechnete_stunden maxf=2}</td>

                    {if $keydate_diff_to_pre!==false}
                        <td style="{$styles}{$bodystyle_pre}" class="floatval" title="{$field->full_name}">{isfloat value=$field->deducted_hours_money_pre maxf=2}</td>
                    {/if}
                    <td style="{$styles}{$bodystyle}" class="floatval" title="{$field->full_name}">{isfloat value=$field->deducted_hours_money maxf=2}</td>

                    {if $keydate_diff_to_pre!==false}
                        <td style="{$styles}{$bodystyle_pre}" class="floatval" title="{$field->full_name}">{isfloat value=$field->deducted_travels_money_pre maxf=2}</td>
                    {/if}
                    <td style="{$styles}{$bodystyle}" class="floatval" title="{$field->full_name}">{isfloat value=$field->deducted_travels_money maxf=2}</td>

                    {if $keydate_diff_to_pre!==false}
                        <td style="{$styles}{$bodystyle_pre}" class="floatval" title="{$field->full_name}">{isfloat value=$field->deducted_extras_money_pre maxf=2}</td>
                    {/if}
                    <td style="{$styles}{$bodystyle}" class="floatval" title="{$field->full_name}">{isfloat value=$field->deducted_extras_money maxf=2}</td>

                    {if $keydate_diff_to_pre!==false}
                        <td style="{$styles}{$bodystyle_pre}" class="floatval" title="{$field->full_name}">{isfloat value=$field->deducted_externalexpenses_money_pre maxf=2}</td>
                    {/if}
                    <td style="{$styles}{$bodystyle}" class="floatval" title="{$field->full_name}">{isfloat value=$field->deducted_externalexpenses_money maxf=2}</td>
                    {if $keydate_diff_to_pre!==false}
                        <td style="{$styles}{$bodystyle_pre}" class="floatval" title="{$field->full_name}">{isfloat value=$field->deducted_money_sum_pre maxf=2}</td>
                    {/if}
                    <td style="{$styles}{$bodystyle}" class="floatval" title="{$field->full_name}">{isfloat value=$field->deducted_money_sum maxf=2}</td>
                    {if $keydate_diff_to_pre!==false}
                        <td style="{$styles}{$bodystyle_pre}" class="floatval" title="{$field->full_name}">{isfloat value=$field->fee_costs_minus_deducted_money_sum_pre maxf=2}</td>
                    {/if}
                    <td style="{$styles}{$bodystyle}" class="floatval" title="{$field->full_name}">{isfloat value=$field->fee_costs_minus_deducted_money_sum maxf=2}</td>

                    <td style="{$styles}{$bodystyle}" class="floatval" title="{$field->full_name}">{isfloat value=$field->abzurechnende_stunden maxf=2}</td>
                    <td style="{$styles}{$bodystyle}" class="floatval" title="{$field->full_name}">{isfloat value=$field->to_deduct_hours_money maxf=2}</td>
                    <td style="{$styles}{$bodystyle}" class="floatval" title="{$field->full_name}">{isfloat value=$field->to_deduct_travels_money maxf=2}</td>
                    <td style="{$styles}{$bodystyle}" class="floatval" title="{$field->full_name}">{isfloat value=$field->to_deduct_extras_money maxf=2}</td>
                    <td style="{$styles}{$bodystyle}" class="floatval" title="{$field->full_name}">{isfloat value=$field->to_deduct_externalexpenses_money maxf=2}</td>
                    <td style="{$styles}{$bodystyle}" class="floatval" title="{$field->full_name}">{isfloat value=$field->to_deduct_money_sum maxf=2}</td>
                    <td style="{$styles}{$bodystyle}" class="floatval" title="{$field->full_name}">{isfloat value=$field->irrecoverable_hours maxf=2}</td>
                    <td style="{$styles}{$bodystyle}" class="floatval" title="{$field->full_name}">{isfloat value=$field->irrecoverable_hours_money maxf=2}</td>
                    <td style="{$styles}{$bodystyle}" class="floatval" title="{$field->full_name}">{isfloat value=$field->irrecoverable_travels_money maxf=2}</td>
                    <td style="{$styles}{$bodystyle}" class="floatval" title="{$field->full_name}">{isfloat value=$field->irrecoverable_extras_money maxf=2}</td>
                    <td style="{$styles}{$bodystyle}" class="floatval" title="{$field->full_name}">{isfloat value=$field->irrecoverable_externalexpenses_money maxf=2}</td>
                    <td style="{$styles}{$bodystyle}" class="floatval" title="{$field->full_name}">{isfloat value=$field->irrecoverable_money_sum maxf=2}</td>
                {/if}

                {if $keydate_diff_to_pre!==false}
                    <td style="{$styles}{$bodystyle_pre}" class="floatval" title="{$field->full_name}">{isfloat value=$field->budget_threshold_pre*100 maxf=2} %</td>
                {/if}
                <td style="{$styles}{$bodystyle}" class="floatval" title="{$field->full_name}">{isfloat value=$field->budget_threshold*100 maxf=2} %</td>

                {if $keydate_diff_to_pre!==false}
                    {if $field->fee_hours_pre !=0}
                        <td style="{$styles}{$bodystyle_pre}" class="floatval" title="{$field->full_name}">{isfloat value=($field->ist_times_pre/$field->fee_hours_pre)*100 maxf=2} %</td>
                    {else}
                        <td style="{$styles}{$bodystyle_pre}" class="floatval" title="{$field->full_name}">{isfloat value=0 maxf=2} %</td>
                    {/if}
                {/if}
                {if $field->fee_hours !=0}
                    <td style="{$styles}{$bodystyle}" class="floatval" title="{$field->full_name}">{isfloat value=($field->ist_times/$field->fee_hours)*100 maxf=2} %</td>
                {else}
                    <td style="{$styles}{$bodystyle}" class="floatval" title="{$field->full_name}">{isfloat value=0 maxf=2} %</td>
                {/if}
                {if $keydate_diff_to_pre!==false}
                    <td style="{$styles}{$bodystyle_pre}" class="floatval" title="{$field->full_name}">{isfloat value=$field->completion_level_pre*100 maxf=2} %</td>
                {/if}
                <td style="{$styles}{$bodystyle}" class="floatval" title="{$field->full_name}">{isfloat value=$field->completion_level*100 maxf=2} %</td>
                <td style="{$styles}{$bodystyle}" title="{$field->full_name}">{$field->loc_estimation_date->us_date()}</td>

                {if $keydate_diff_to_pre!==false}
                    <td style="{$styles}{$bodystyle_pre}" class="floatval" title="{$field->full_name}">{isfloat value=$field->erbrachte_leistung_honorarbasis_pre maxf=2}</td>
                {/if}
                <td style="{$styles}{$bodystyle}" class="floatval" title="{$field->full_name}">{isfloat value=$field->erbrachte_leistung_honorarbasis maxf=2}</td>
                {if $keydate_diff_to_pre!==false}
                    <td class="floatval" style="{$styles}{$bodystyle_pre}{if $field->ergebnis_aktuell_honorarbasis_pre<0}color:red;{/if}" title="{$field->full_name}">{isfloat value=$field->ergebnis_aktuell_honorarbasis_pre maxf=2}</td>
                {/if}
                <td class="floatval" style="{$styles}{$bodystyle}{if $field->ergebnis_aktuell_honorarbasis<0}color:red;{/if}" title="{$field->full_name}">{isfloat value=$field->ergebnis_aktuell_honorarbasis maxf=2}</td>
                {if $keydate_diff_to_pre!==false}
                    <td class="floatval" style="{$styles}{$bodystyle_pre}{if $field->ergebnis_prognose_honorarbasis_pre<0}color:red;{/if}" title="{$field->full_name}">{isfloat value=$field->ergebnis_prognose_honorarbasis_pre maxf=2}</td>
                {/if}
                <td class="floatval" style="{$styles}{$bodystyle}{if $field->ergebnis_prognose_honorarbasis<0}color:red;{/if}" title="{$field->full_name}">{isfloat value=$field->ergebnis_prognose_honorarbasis maxf=2}</td>

                {if $keydate_diff_to_pre!==false}
                    <td class="floatval" style="{$styles}{$bodystyle_pre}" title="{$field->full_name}">{isfloat value=$field->honvermgeplextkst_value_pre maxf=2}</td>
                {/if}
                <td class="floatval" style="{$styles}{$bodystyle}" title="{$field->full_name}">{isfloat value=$field->honvermgeplextkst_value maxf=2}</td>

                {if $keydate_diff_to_pre!==false}
                    <td class="floatval" style="{$styles}{$bodystyle_pre}{if $field->restgeld_pre<0}color:red;{/if}" title="{$field->full_name}">{isfloat value=$field->restgeld_pre maxf=2}</td>
                {/if}
                <td class="floatval" style="{$styles}{$bodystyle}{if $field->restgeld<0}color:red;{/if}" title="{$field->full_name}">{isfloat value=$field->restgeld maxf=2}</td>
                <td class="floatval" style="{$styles}{$bodystyle}{if $field->restgeld_minus_gepl_ext_kosten<0}color:red;{/if}" title="{$field->full_name}">{isfloat value=$field->restgeld_minus_gepl_ext_kosten maxf=2}</td>
                {if $not_show_columns.portlet_psp_erbrachte_leistung_budgetbasis}
                    {if $keydate_diff_to_pre!==false}
                        <td style="{$styles}{$bodystyle_pre}" class="floatval" title="{$field->full_name}">{isfloat value=$field->erbrachte_leistung_budgetbasis_pre maxf=2}</td>
                    {/if}
                    <td style="{$styles}{$bodystyle}" class="floatval" title="{$field->full_name}">{isfloat value=$field->erbrachte_leistung_budgetbasis maxf=2}</td>
                {/if}
                {if $not_show_columns.portlet_psp_ergebnis_aktuell_budgetbasis}
                    {if $keydate_diff_to_pre!==false}
                        <td class="floatval" style="{$styles}{$bodystyle_pre}{if $field->ergebnis_aktuell_budgetbasis_pre<0}color:red;{/if}" title="{$field->full_name}">{isfloat value=$field->ergebnis_aktuell_budgetbasis_pre maxf=2}</td>
                    {/if}
                    <td class="floatval" style="{$styles}{$bodystyle}{if $field->ergebnis_aktuell_budgetbasis<0}color:red;{/if}" title="{$field->full_name}">{isfloat value=$field->ergebnis_aktuell_budgetbasis maxf=2}</td>
                {/if}
                {if $not_show_columns.portlet_psp_ergebnis_prognose_budgetbasis}
                    <td class="floatval" style="{$styles}{$bodystyle}{if $field->ergebnis_prognose_budgetbasis<0}color:red;{/if}" title="{$field->full_name}">{isfloat value= $field->ergebnis_prognose_budgetbasis maxf=2}</td>
                {/if}
                {if $not_show_columns.portlet_psp_gepl_honverm_kosten_budgetbasis}
                    <td class="floatval" style="{$styles}{$bodystyle}{if $field->honvermgeplextkst_value<0}color:red;{/if}" title="{$field->full_name}">{isfloat value=$field->honvermgeplextkst_value maxf=2}</td>
                {/if}
                {if $not_show_columns.portlet_psp_restgeld_budget}
                    {if $keydate_diff_to_pre!==false}
                        <td class="floatval" style="{$styles}{$bodystyle_pre}{if $field->restgeld_budget_pre<0}color:red;{/if}" title="{$field->full_name}">{isfloat value=$field->restgeld_budget_pre maxf=2}</td>
                    {/if}
                    <td class="floatval" style="{$styles}{$bodystyle}{if $field->restgeld_budget<0}color:red;{/if}" title="{$field->full_name}">{isfloat value=$field->restgeld_budget maxf=2}</td>
                {/if}
                {if $not_show_columns.portlet_psp_restgeld_budget_minus_gepl_honverm_kosten}
                    <td class="floatval" style="{$styles}{$bodystyle}{if $field->restgeld_budgetbasis_minus_gepl_ext_kosten<0}color:red;{/if}" title="{$field->full_name}">{isfloat value=$field->restgeld_budgetbasis_minus_gepl_ext_kosten maxf=2}</td>
                {/if}
                {if $not_show_columns.portlet_psp_geplanter_beginn}
                    <td style="{$styles}{$bodystyle}" title="{$field->full_name}">{$field->budget_start->us_date()}</td>
                {/if}
                {if $not_show_columns.portlet_psp_geplantes_ende}
                    <td style="{$styles}{$bodystyle}" title="{$field->full_name}">{$field->budget_end->us_date()}</td>
                {/if}
                {if $colspan8 != 0}
                    {if $keydate_diff_to_pre!==false}
                        <td style="{$styles}{$bodystyle_pre}" class="floatval" title="{$field->full_name}">{isfloat value=$field->invoiced_fee_wp_pre_single maxf=2}</td>
                    {/if}
                    <td style="{$styles}{$bodystyle}" class="floatval" title="{$field->full_name}">{isfloat value=$field->invoiced_fee_wp_single maxf=2}</td>
                    {if $keydate_diff_to_pre!==false}
                        <td style="{$styles}{$bodystyle_pre}" class="floatval" title="{$field->full_name}">{isfloat value=$field->remited_wkp_pre_single maxf=2}</td>
                    {/if}
                    <td style="{$styles}{$bodystyle}" class="floatval" title="{$field->full_name}">{isfloat value=$field->remited_wkp_single maxf=2}</td>
                    <td style="{$styles}{$bodystyle}" class="floatval" title="{$field->full_name}">{isfloat value=$field->planned_fee_wp_single maxf=2}</td>
                {/if}

                {if $not_show_columns.portlet_psp_show_staffs}
                    {foreach item=fields key=id from=$value_project->staffs_for_hours}
                        {if ($id) < $max_staff}
                            {$number=($id)}
                            {$hours = 'hours_'|cat:($number)}
                            {if $keydate_diff_to_pre!==false}
                                {$hours_pre = 'hours_pre_'|cat:($number)}
                                <td style="{$styles}{$bodystyle_pre}" class="floatval" title="{$field->full_name}">{isfloat value=$field->$hours_pre maxf=2}</td>
                            {/if}
                            <td style="{$styles}{$bodystyle}" class="floatval" title="{$field->full_name}">{isfloat value=$field->$hours maxf=2}</td>
                        {/if}
                    {/foreach}
                    {if $value_project->hours_more_than_30_flag == 1}
                        {$hours = 'hours_'|cat:($number+1)}
                        {$hours_pre = 'hours_pre_'|cat:($number+1)}
                        {if $keydate_diff_to_pre!==false}
                            <td style="{$styles}{$bodystyle_pre}" class="floatval" title="{$field->full_name}">{isfloat value=$field->$hours_pre maxf=2}</td>
                        {/if}
                        <td style="{$styles}{$bodystyle}" class="floatval" title="{$field->full_name}">{isfloat value=$field->$hours maxf=2}</td>
                    {/if}
                {/if}

            </tr>
        {/if}
    {/foreach}
</tbody>
<tfoot style="white-space:nowrap">

    <tr>
        <td style="{$footstyle} text-align:left" colspan="3">{$i.controlpanel_ergebnisse}</td>
        {if $keydate_diff_to_pre!==false}
            <td style="{$footstyle_pre}" class="floatval">{isfloat value=$value_project->w_areas[0]->fee_costs_pre maxf=2}</td>
        {/if}
        <td style="{$footstyle}" class="floatval">{isfloat value=$value_project->w_areas[0]->fee_costs maxf=2}</td>
        {if $keydate_diff_to_pre!==false}
            <td style="{$footstyle_pre}" class="floatval">{isfloat value=$value_project->w_areas[0]->fee_costs_external_pre maxf=2}</td>
        {/if}
        <td style="{$footstyle}" class="floatval">{isfloat value=$value_project->w_areas[0]->fee_costs_external maxf=2}</td>

        {if $keydate_diff_to_pre!==false}
            <td class="floatval" style="{$footstyle_pre}">{isfloat value=$value_project->w_areas[0]->honvermgeplextkst_value_pre maxf=2}</td>
        {/if}
        <td class="floatval" style="{$footstyle} {if $value_project->w_areas[0]->honvermgeplextkst_value <0}color:red;{/if}">{isfloat value=$value_project->w_areas[0]->honvermgeplextkst_value maxf=2}</td>

        {if $keydate_diff_to_pre!==false}
            <td class="floatval" style="{$footstyle_pre}">{isfloat value=$value_project->w_areas[0]->verfuegbares_sollhonorar_pre maxf=2}</td>
        {/if}
        <td style="{$footstyle}" class="floatval">{isfloat value=$value_project->w_areas[0]->verfuegbares_sollhonorar maxf=2}</td>

        {if $not_show_columns.portlet_psp_anteil_vom_gesamt_honorar}
            {if $value_project->w_areas[0]->budget_proportion !=0 && $cost_centre_id == 0}
                <td style="{$footstyle}" class="floatval">{isfloat value=$value_project->w_areas[0]->budget_proportion*100 maxf=2} %</td>
            {else}
                <td style="{$footstyle}"></td>
            {/if}
        {/if}
        {if $not_show_columns.portlet_psp_anteil_vom_honorar_bereich}
            <td style="{$footstyle}"></td>
        {/if}
        {if $not_show_columns.portlet_psp_budget}
            {if $keydate_diff_to_pre!==false}
                <td style="{$footstyle_pre}" class="floatval">{isfloat value=$value_project->w_areas[0]->budget_planned_costs_pre maxf=2}</td>
            {/if}
            <td style="{$footstyle}" class="floatval">{isfloat value=$value_project->w_areas[0]->budget_planned_costs maxf=2}</td>
        {/if}
        {if $not_show_columns.portlet_psp_zeitkosten}
            {if $keydate_diff_to_pre!==false}
                <td style="{$footstyle_pre}" class="floatval">{isfloat value=$value_project->w_areas[0]->times_kosten_pre maxf=2}</td>
            {/if}
            <td style="{$footstyle}" class="floatval">{isfloat value=$value_project->w_areas[0]->times_kosten maxf=2}</td>
        {/if}
        {if $not_show_columns.portlet_psp_reise_nebenkosten}
            {if $keydate_diff_to_pre!==false}
                <td style="{$footstyle_pre}" class="floatval">{isfloat value=$value_project->w_areas[0]->interne_nebenkosten_pre maxf=2}</td>
            {/if}
            <td style="{$footstyle}" class="floatval">{isfloat value=$value_project->w_areas[0]->interne_nebenkosten maxf=2}</td>
        {/if}
        {if $not_show_columns.portlet_psp_verrechnete_kosten}
            {if $keydate_diff_to_pre!==false}
                <td style="{$footstyle_pre}" class="floatval">{isfloat value=$value_project->w_areas[0]->externalexpenses_charged_pre maxf=2}</td>
            {/if}
            <td style="{$footstyle}" class="floatval">{isfloat value=$value_project->w_areas[0]->externalexpenses_charged maxf=2}</td>
        {/if}
        {if $not_show_columns.portlet_psp_kosten}
            {if $keydate_diff_to_pre!==false}
                <td style="{$footstyle_pre}" class="floatval">{isfloat value=$value_project->w_areas[0]->externalexpenses_kosten_pre maxf=2}</td>
            {/if}
            <td style="{$footstyle}" class="floatval">{isfloat value=$value_project->w_areas[0]->externalexpenses_kosten maxf=2}</td>
        {/if}
        {if $not_show_columns.portlet_psp_geplante_kosten}
            <td style="{$footstyle}" class="floatval">{isfloat value=$value_project->w_areas[0]->externalexpenses_kosten_planned maxf=2}</td>
        {/if}
        {if $not_show_columns.portlet_psp_kosten_plus_geplante_kosten}
            <td style="{$footstyle}" class="floatval">{isfloat value=$value_project->w_areas[0]->externalexpenses_kosten + $value_project->w_areas[0]->externalexpenses_kosten_planned maxf=2}</td>
        {/if}

        {if $keydate_diff_to_pre!==false}
            <td class="floatval" style="{$footstyle_pre} {$color}">{isfloat value=$value_project->w_areas[0]->summekostenist_pre maxf=2}</td>
        {/if}
        {$color = ''}
        {if $value_project->w_areas[0]->fee_costs<$value_project->w_areas[0]->summekostenist}
            {$color = 'color:red'}
        {/if}
        <td class="floatval" style="{$footstyle} {$color}">{isfloat value=$value_project->w_areas[0]->summekostenist maxf=2}</td>
        {if $not_show_columns.portlet_psp_arbbereichmittelsatz}
            <td style="{$footstyle}"></td>
        {/if}
        {if $keydate_diff_to_pre!==false}
            <td style="{$footstyle_pre}" class="floatval">{isfloat value=$value_project->w_areas[0]->fee_hours_pre maxf=2}</td>
        {/if}
        <td style="{$footstyle}" class="floatval">{isfloat value=$value_project->w_areas[0]->fee_hours maxf=2}</td>
        {if $keydate_diff_to_pre!==false}
            <td style="{$footstyle_pre}" class="floatval">{isfloat value=$value_project->w_areas[0]->budget_planned_hours_pre maxf=2}</td>
        {/if}
        <td style="{$footstyle}" class="floatval">{isfloat value=$value_project->w_areas[0]->budget_planned_hours maxf=2}</td>
        {if $keydate_diff_to_pre!==false}
            <td style="{$footstyle_pre}" class="floatval">{isfloat value=$value_project->w_areas[0]->ist_times_pre maxf=2}</td>
        {/if}
        <td style="{$footstyle}" class="floatval">{isfloat value=$value_project->w_areas[0]->ist_times maxf=2}</td>
        {if $not_show_columns.portlet_psp_show_deduction_values}
            {if $keydate_diff_to_pre!==false}
                <td style="{$footstyle_pre}" class="floatval">{isfloat value=$value_project->w_areas[0]->abgerechnete_stunden_pre maxf=2}</td>
            {/if}
            <td style="{$footstyle}" class="floatval">{isfloat value=$value_project->w_areas[0]->abgerechnete_stunden maxf=2}</td>

            {if $keydate_diff_to_pre!==false}
                <td style="{$footstyle_pre}" class="floatval">{isfloat value=$value_project->w_areas[0]->deducted_hours_money_pre maxf=2}</td>
            {/if}
            <td style="{$footstyle}" class="floatval">{isfloat value=$value_project->w_areas[0]->deducted_hours_money maxf=2}</td>

            {if $keydate_diff_to_pre!==false}
                <td style="{$footstyle_pre}" class="floatval">{isfloat value=$value_project->w_areas[0]->deducted_travels_money_pre maxf=2}</td>
            {/if}
            <td style="{$footstyle}" class="floatval">{isfloat value=$value_project->w_areas[0]->deducted_travels_money maxf=2}</td>

            {if $keydate_diff_to_pre!==false}
                <td style="{$footstyle_pre}" class="floatval">{isfloat value=$value_project->w_areas[0]->deducted_extras_money_pre maxf=2}</td>
            {/if}
            <td style="{$footstyle}" class="floatval">{isfloat value=$value_project->w_areas[0]->deducted_extras_money maxf=2}</td>

            {if $keydate_diff_to_pre!==false}
                <td style="{$footstyle_pre}" class="floatval">{isfloat value=$value_project->w_areas[0]->deducted_externalexpenses_money_pre maxf=2}</td>
            {/if}
            <td style="{$footstyle}" class="floatval">{isfloat value=$value_project->w_areas[0]->deducted_externalexpenses_money maxf=2}</td>
            {if $keydate_diff_to_pre!==false}
                {$gesamt_pre=$value_project->w_areas[0]->deducted_hours_money_pre + $value_project->w_areas[0]->deducted_travels_money_pre + $value_project->w_areas[0]->deducted_extras_money_pre + $value_project->w_areas[0]->deducted_externalexpenses_money_pre}
                <td style="{$footstyle_pre}" class="floatval">{isfloat value=$gesamt_pre maxf=2}</td>
            {/if}
            {$gesamt=$value_project->w_areas[0]->deducted_hours_money + $value_project->w_areas[0]->deducted_travels_money + $value_project->w_areas[0]->deducted_extras_money + $value_project->w_areas[0]->deducted_externalexpenses_money}
            <td style="{$footstyle}" class="floatval">{isfloat value=$gesamt maxf=2}</td>
            {if $keydate_diff_to_pre!==false}
                <td style="{$footstyle_pre}" class="floatval">{isfloat value=$value_project->w_areas[0]->fee_costs_pre-$gesamt_pre maxf=2}</td>
            {/if}
            <td style="{$footstyle}" class="floatval">{isfloat value=$value_project->w_areas[0]->fee_costs-$gesamt maxf=2}</td>
            <td style="{$footstyle}" class="floatval">{isfloat value=$value_project->w_areas[0]->abzurechnende_stunden maxf=2}</td>
            <td style="{$footstyle}" class="floatval">{isfloat value=$value_project->w_areas[0]->to_deduct_hours_money maxf=2}</td>
            <td style="{$footstyle}" class="floatval">{isfloat value=$value_project->w_areas[0]->to_deduct_travels_money maxf=2}</td>
            <td style="{$footstyle}" class="floatval">{isfloat value=$value_project->w_areas[0]->to_deduct_extras_money maxf=2}</td>
            <td style="{$footstyle}" class="floatval">{isfloat value=$value_project->w_areas[0]->to_deduct_externalexpenses_money maxf=2}</td>
            <td style="{$footstyle}" class="floatval">{isfloat value=$value_project->w_areas[0]->to_deduct_hours_money + $value_project->w_areas[0]->to_deduct_travels_money + $value_project->w_areas[0]->to_deduct_extras_money + $value_project->w_areas[0]->to_deduct_externalexpenses_money maxf=2}</td>
            <td style="{$footstyle}" class="floatval">{isfloat value=$value_project->w_areas[0]->irrecoverable_hours maxf=2}</td>
            <td style="{$footstyle}" class="floatval">{isfloat value=$value_project->w_areas[0]->irrecoverable_hours_money maxf=2}</td>
            <td style="{$footstyle}" class="floatval">{isfloat value=$value_project->w_areas[0]->irrecoverable_travels_money maxf=2}</td>
            <td style="{$footstyle}" class="floatval">{isfloat value=$value_project->w_areas[0]->irrecoverable_extras_money maxf=2}</td>
            <td style="{$footstyle}" class="floatval">{isfloat value=$value_project->w_areas[0]->irrecoverable_externalexpenses_money maxf=2}</td>
            <td style="{$footstyle}" class="floatval">{isfloat value=$value_project->w_areas[0]->irrecoverable_hours_money + $value_project->w_areas[0]->irrecoverable_travels_money + $value_project->w_areas[0]->irrecoverable_extras_money + $value_project->w_areas[0]->irrecoverable_externalexpenses_money maxf=2}</td>

        {/if}
        {if $keydate_diff_to_pre!==false}
            <td style="{$footstyle_pre}"></td>
        {/if}
        <td style="{$footstyle}"></td>

        {if $keydate_diff_to_pre!==false}
            {if $value_project->w_areas[0]->fee_hours_pre !=0}
                <td style="{$footstyle_pre}">{isfloat value=($value_project->w_areas[0]->ist_times_pre/$value_project->w_areas[0]->fee_hours_pre)*100 maxf=2} %</td>
            {else}
                <td style="{$footstyle_pre}"></td>
            {/if}
        {/if}
        {if $value_project->w_areas[0]->fee_hours !=0}
            <td style="{$footstyle}">{isfloat value=($value_project->w_areas[0]->ist_times/$value_project->w_areas[0]->fee_hours)*100 maxf=2} %</td>
        {else}
            <td style="{$footstyle}"></td>
        {/if}

        {if $keydate_diff_to_pre!==false}
            {if $value_project->w_areas[0]->completion_level_pre !=0 && $cost_centre_id == 0}
                {if $value_project->w_areas[0]->completion_level_pre > 100}
                    <td style="{$footstyle_pre}" title="{$i.controlpanel_fertigstellungsgrad_ueber_100_prozent}" class="hoverhelp floatval">{isfloat value=$value_project->w_areas[0]->completion_level_pre*100 maxf=2} %</td>
                {else}
                    <td style="{$footstyle_pre}" class="floatval">{isfloat value=$value_project->w_areas[0]->completion_level_pre*100 maxf=2} %</td>
                {/if}
            {else}
                <td style="{$footstyle}"></td>
            {/if}
        {/if}

        {if $value_project->w_areas[0]->completion_level !=0 && $cost_centre_id == 0}
            {if $value_project->w_areas[0]->completion_level > 100}
                <td title="{$i.controlpanel_fertigstellungsgrad_ueber_100_prozent}" class="hoverhelp floatval">{isfloat value=$value_project->w_areas[0]->completion_level*100 maxf=2} %</td>
            {else}
                <td style="{$footstyle}" class="floatval">{isfloat value=$value_project->w_areas[0]->completion_level*100 maxf=2} %</td>
            {/if}
        {else}
            <td style="{$footstyle}"></td>
        {/if}

        <td style="{$footstyle}">abc</td>

        {if $keydate_diff_to_pre!==false}
            <td style="{$footstyle_pre}" class="floatval">{isfloat value=$value_project->w_areas[0]->erbrachte_leistung_honorarbasis_pre maxf=2}</td>
        {/if}
        <td style="{$footstyle}" class="floatval">{isfloat value=$value_project->w_areas[0]->erbrachte_leistung_honorarbasis maxf=2}</td>

        {if $keydate_diff_to_pre!==false}
            <td class="floatval" style="{$footstyle_pre} {if $value_project->w_areas[0]->ergebnis_aktuell_honorarbasis_pre <0}color:red;{/if}">{isfloat value=$value_project->w_areas[0]->ergebnis_aktuell_honorarbasis_pre maxf=2}</td>
        {/if}
        <td class="floatval" style="{$footstyle} {if $value_project->w_areas[0]->ergebnis_aktuell_honorarbasis <0}color:red;{/if}">{isfloat value=$value_project->w_areas[0]->ergebnis_aktuell_honorarbasis maxf=2}</td>

        {if $keydate_diff_to_pre!==false}
            <td class="floatval" style="{$footstyle_pre}{if $value_project->w_areas[0]->ergebnis_prognose_honorarbasis_pre<0}color:red;{/if}" title="{$field->full_name}">{isfloat value=$value_project->w_areas[0]->ergebnis_prognose_honorarbasis_pre maxf=2}</td>
        {/if}
        <td class="floatval" style="{$footstyle} {if $value_project->w_areas[0]->ergebnis_prognose_honorarbasis <0}color:red;{/if}">{isfloat value=$value_project->w_areas[0]->ergebnis_prognose_honorarbasis maxf=2}</td>

        <td class="floatval" style="{$footstyle} {if $value_project->w_areas[0]->honvermgeplextkst_value <0}color:red;{/if}">{isfloat value=$value_project->w_areas[0]->honvermgeplextkst_value maxf=2}</td>

        {if $keydate_diff_to_pre!==false}
            <td class="floatval" style="{$footstyle} {if $value_project->w_areas[0]->honvermgeplextkst_value <0}color:red;{/if}">{isfloat value=$value_project->w_areas[0]->honvermgeplextkst_value maxf=2}</td>
            <td class="floatval" style="{$footstyle_pre} {if $value_project->w_areas[0]->restgeld_pre <0}color:red;{/if}">{isfloat value=$value_project->w_areas[0]->restgeld_pre maxf=2}</td>         
        {/if}   
        <td class="floatval" style="{$footstyle_pre} {if $value_project->w_areas[0]->restgeld <0}color:red;{/if}">{isfloat value=$value_project->w_areas[0]->restgeld maxf=2}</td>         

        <td class="floatval" style="{$footstyle} {if $value_project->w_areas[0]->restgeld_minus_gepl_ext_kosten <0}color:red;{/if}">{isfloat value=$value_project->w_areas[0]->restgeld_minus_gepl_ext_kosten maxf=2}</td>

        {if $not_show_columns.portlet_psp_erbrachte_leistung_budgetbasis}
            {if $keydate_diff_to_pre!==false}
                <td style="{$footstyle_pre}" class="floatval">{isfloat value=$value_project->w_areas[0]->erbrachte_leistung_budgetbasis_pre maxf=2}</td>
            {/if}
            <td style="{$footstyle}" class="floatval">{isfloat value=$value_project->w_areas[0]->erbrachte_leistung_budgetbasis maxf=2}</td>
        {/if}

        {if $not_show_columns.portlet_psp_ergebnis_aktuell_budgetbasis}
            {if $keydate_diff_to_pre!==false}
                <td class="floatval" style="{$footstyle_pre} {if $value_project->w_areas[0]->ergebnis_aktuell_budgetbasis_pre<0}color:red;{/if}" >{isfloat value=$value_project->w_areas[0]->ergebnis_aktuell_budgetbasis_pre maxf=2}</td>
            {/if}
            <td class="floatval" style="{$footstyle}{if $value_project->w_areas[0]->ergebnis_aktuell_budgetbasis<0}color:red;{/if}" >{isfloat value=$value_project->w_areas[0]->ergebnis_aktuell_budgetbasis maxf=2}</td>
        {/if}
        {if $not_show_columns.portlet_psp_ergebnis_prognose_budgetbasis}
            <td class="floatval" style="{$footstyle}{if $value_project->w_areas[0]->ergebnis_prognose_budgetbasis<0}color:red;{/if}">{isfloat value=$value_project->w_areas[0]->ergebnis_prognose_budgetbasis maxf=2}</td>
        {/if}
        {if $not_show_columns.portlet_psp_gepl_honverm_kosten_budgetbasis}
            <td class="floatval" style="{$footstyle}{if $value_project->w_areas[0]->honvermgeplextkst_value<0}color:red;{/if}" >{isfloat value=$value_project->w_areas[0]->honvermgeplextkst_value maxf=2}</td>
        {/if}
        {if $not_show_columns.portlet_psp_restgeld_budget}
            {if $keydate_diff_to_pre!==false}
                <td class="floatval" style="{$footstyle}{if $value_project->w_areas[0]->restgeld_budget_pre<0}color:red;{/if}" >{isfloat value=$value_project->w_areas[0]->restgeld_budget_pre maxf=2}</td>
            {/if}
            <td class="floatval" style="{$footstyle}{if $value_project->w_areas[0]->restgeld_budget<0}color:red;{/if}" >{isfloat value=$value_project->w_areas[0]->restgeld_budget maxf=2}</td>
        {/if}
        {if $not_show_columns.portlet_psp_restgeld_budget_minus_gepl_honverm_kosten}
            <td class="floatval" style="{$footstyle}{if $value_project->w_areas[0]->restgeld_budgetbasis_minus_gepl_ext_kosten<0}color:red;{/if}" >{isfloat value=$value_project->w_areas[0]->restgeld_budgetbasis_minus_gepl_ext_kosten maxf=2}</td>
        {/if}


        {if $not_show_columns.portlet_psp_geplanter_beginn}
            <td style="{$footstyle}"></td>
        {/if}
        {if $not_show_columns.portlet_psp_geplantes_ende}
            <td style="{$footstyle}"></td>
        {/if}
        {if $colspan8 != 0}
            {if $keydate_diff_to_pre!==false}
                <td style="{$footstyle_pre}" class="floatval">{isfloat value=$value_project->w_areas[0]->invoiced_fee_wp_pre maxf=0}</td>
            {/if}
            <td style="{$footstyle}" class="floatval">{isfloat value=$value_project->w_areas[0]->invoiced_fee_wp maxf=0}</td>
            {if $keydate_diff_to_pre!==false}
                <td style="{$footstyle_pre}" class="floatval">{isfloat value=$value_project->w_areas[0]->remited_wkp_pre maxf=0}</td>
            {/if}
            <td style="{$footstyle}" class="floatval">{isfloat value=$value_project->w_areas[0]->remited_wkp maxf=0}</td>
            <td style="{$footstyle}" class="floatval">{isfloat value=$value_project->w_areas[0]->planned_fee_wp maxf=0}</td>
        {/if}

        {if $not_show_columns.portlet_psp_show_staffs}
            {foreach item=fields key=id from=$value_project->staffs_for_hours}
                {if $id <= $max_staff}
                    {$number=($id)}
                    {$hours = 'hours_'|cat:($number)}
                    {$hours_pre = 'hours_pre_'|cat:($number)}
                    {if $keydate_diff_to_pre!==false}
                        <td style="{$footstyle_pre}" class="floatval" title="{$field->full_name}">{isfloat value=$value_project->w_areas[0]->$hours_pre maxf=2}</td>
                    {/if}
                    <td style="{$footstyle}" class="floatval" title="{$field->full_name}">{isfloat value=$value_project->w_areas[0]->$hours maxf=2}</td>
                {/if}
            {/foreach}
        {/if}
    </tr>
</tfoot>
</table>