<table class="editablepop" style="width: 100%;  margin-top:10px;">
    <thead>
        <tr>
            <th style="text-align:left;" colspan="8" class="ui-widget-header">
                <a class="dialog_make_btn16 externalexpenses ui-corner-all"
                   onclick="usComm.windowOpen(this.href);
                           return false;"
                   title="{$i.controlpanel_start_kost_modul}"
                   href="{site_url url="start/open/externalexpenses/index/`$xjxcookie`/index_filter_project/p_`$value_project[0]->project_id`"}">
                </a> {$i.controlpanel_costs_credit}
            </th>
        </tr>
        {if $stdc_externalexpenses}
            <tr>
                <th>{$i.masterdatamanagement_show_date}</th>
                <th>{$i.controlpanel_purpose}</th>
                <th>{$i.masterdatamanagement_description}</th>
                <th>{$i.masterdatamanagement_address}</th>
                <th>{$i.masterdatamanagement_work_area}</th>
                <th>Verrechnet am</th>
                <th>Verrechnet (netto)</th>
                <th>{$i.controlpanel_costs}</th>
            </tr>
        {/if}
    </thead>
    {if $stdc_externalexpenses}
        {$sum_costs_charged =0}
        {$sum_costs =0}
        <tbody>
            {foreach item=field name="index" from=$stdc_externalexpenses}
                <tr class="{if $smarty.foreach.index.iteration is even}even{/if}">
                    <td>{$field->date->us_date()}</td>
                    <td>{$field->purpose}</td>
                    <td>{$field->description}</td>
                    <td>{$field->address}</td>
                    <td>{$field->work_package_name}</td>
                    <td>{$field->charge_date->us_date()}</td> 
                    <td style="text-align:right;" class="floatval">{$sum_costs_charged = $sum_costs_charged + $field->charged}{isfloat value=$field->charged maxf=2}</td>
                    {$sum_costs = $sum_costs + $field->value}
                    <td style="text-align:right;" class="floatval">{isfloat value=$field->value maxf=2}</td>
                </tr>
            {/foreach}
        </tbody>
        <tfoot>
            <tr>
                <td colspan="6">{$i.basic_total}</td>
                <td style="text-align:right;" class="floatval">{isfloat value=$sum_costs_charged maxf=2}</td>
                <td style="text-align:right;" class="floatval">{isfloat value=$sum_costs maxf=2}</td>
            </tr>
        </tfoot>
    {/if}
</table>