<table class="editablepop" style="width: 100%;  margin-top:10px;">
    <thead>
        <tr>
            <th style="text-align:left;" colspan="11" class="ui-widget-header">{$i.masterdatamanagement_entries_extra}</th>
        </tr>
        {if $value_project->stdc_extras_detail}
            <tr>
                <th>{$i.masterdatamanagement_show_date}</th>
                <th>{$i.controlpanel_purpose}</th>
                <th>{$i.basic_staff}</th>
                <th>{$i.controlpanel_type}</th>
                <th>{$i.controlpanel_count}</th>
                <th>{$i.controlpanel_cost_per_unit}</th>
                <th>{$i.controlpanel_costs}</th>
                <th>{$i.controlpanel_anzahl_extern}</th>
                <th>{$i.controlpanel_externer_satz}</th>
                <th>{$i.controlpanel_nach_aufwand_verrechnet}</th>
                <th>{$i.controlpanel_zu_verrechnen}</th>
            </tr>
        {/if}
    </thead>
    {if $value_project->stdc_extras_detail}
        {$sum_extra=0}
        {$sum_ana=0}
        {$sum_ana_zuverr = 0}
        <tbody>
            {foreach item=field name="index" from=$value_project->stdc_extras_detail}
                <tr class="{if $smarty.foreach.index.iteration is even}even{/if}">
                    <td>{$field->date->us_date()}</td>
                    <td>{$field->purpose}</td>
                    <td>{$field->staff_name}</td>
                    <td>{$field->type_name}</td>
                    <td style="text-align:right;" class="floatval">{isfloat value=$field->number maxf=2}</td>
                    <td style="text-align:right;" class="floatval">{isfloat value=$field->cost_per_unit maxf=2}</td>
                    {$extra = $field->number * $field->cost_per_unit}
                    {$sum_extra = $sum_extra + $extra}
                    <td style="text-align:right;" class="floatval">{isfloat value=$extra maxf=2}
                        {if $field->calcexp_id}
                        <td style="text-align:right;" class="floatval">{isfloat value=$field->number_external maxf=2}</td>
                        <td style="text-align:right;" class="floatval">{isfloat value=$field->price_per_unit maxf=2}</td>
                        {if $field->number_external}
                            {$ana=$field->price_per_unit * $field->number_external}
                        {else}
                            {$ana=$field->price_per_unit * $field->number}
                        {/if}
                        <td style="text-align:right;" class="floatval">{isfloat value=$ana maxf=2}</td>
                        {$sum_ana = $sum_ana + $ana}
                    {else}
                        {if $field->number_external}
                            {$ana_zuverr=$field->price_per_unit * $field->number_external}
                        {else}
                            {$ana_zuverr=$field->price_per_unit * $field->number}
                        {/if}
                        <td></td>
                        <td></td>
                        <td></td>
                        <td style="text-align:right;" class="floatval">{isfloat value=$ana_zuverr maxf=2}</td>
                        {$sum_ana_zuverr = $sum_ana_zuverr + $ana_zuverr}
                    {/if}
                    </td>
                </tr>
            {/foreach}
        </tbody>
        <tfoot>
            <tr>
                <td colspan="6">{$i.basic_total}</td>
                <td style="text-align:right;" class="floatval">{isfloat value=$sum_extra maxf=2}</td>
                <td colspan="2"></td>
                <td style="text-align:right;" class="floatval">{isfloat value=$sum_ana maxf=2}</td>
                <td style="text-align:right;" class="floatval">{isfloat value=$sum_ana_zuverr maxf=2}</td>
            </tr>
        </tfoot>
    {/if}
</table>
