<fieldset class="noborder">
    {include file='r/hidden.tpl' name="fees_predecessor_id"}
    {include file='r/hidden.tpl' name="fees_successor_id"}
    {include file='r/hidden.tpl' name="fees_old_project_id"}
    {include file='r/hidden.tpl' name="fees_change_project_within_chain"}{* Flag *}
    {include file='r/hidden.tpl' name="fees_percentage"}
    {include file='r/hidden.tpl' name="fees_is_transfered"}
    {include file='r/hidden.tpl' name="fees_del_after_transfer" default='0'}
    {include file='r/hidden.tpl' name="fees_correspondence_id"}
    {include file='r/hidden.tpl' name="fees_is_calcexp"}
    {include file='r/hidden.tpl' name="fees_edit"}{* What entry do we edit - If empty = add *}
    {include file='r/radio.tpl' name="fees_is_invoiced" title="fees_is_invoiced" list=$is_invoiced_list id="id" text="name"}
    {include file='r/select-project.tpl' name="fees_project" title="fees_project" list=$projects_list id="id" text="project" 
        add_icons_file="project_resp_pm" filter_favourite_list=$projects_favourite_list 
        class="is_project required on_change_update ocu-p:feeadmin ocu-m:get_work_packages"}
</fieldset>
    
{if $project_use_currency}{* $$$$$$$$$$$$$ *}
    <fieldset class="borderbottom">
        {include file='r/select.tpl' name='fees_currency_id' title="fees_currency" class="" labelclass="label2" collapse='formcoll'
            list=$currencies_list id="id" text="name" mapdata="exchange_rate"}
        {include file='r/input.tpl' name="fees_exchange_rate" title="fees_exchange_rate" collapse='formcoll' 
            add_icons_file="currencies_online_update" online_update_currency="fees_currency_id" online_update_date="fees_fee_date"
            class="required numberi18n" labelclass="label2"}
    </fieldset>
{/if}

<fieldset class="borderbottom">
    {if empty($fee_categories)}
        <p class="formstyle formcoll"></p>
    {else}
        {include file='r/select.tpl' name="fees_fee_category_name" title="fees_fee_category_name" collapse='formcoll' class=""
            list=$fee_categories id="id" text="name"}
    {/if}

    {include file='r/date.tpl' name="fees_fee_date" title="fees_fee_date" collapse='formcoll' class="required dateUS"}
    {include file='r/input.tpl' name="fees_fee_no" title="fees_fee_no" add_icons_file="fee_number"
        collapse='formcoll' class="required t-mid" maxlength=30}
</fieldset>
    
<fieldset class="borderbottom">
    {if !$project_use_currency}{* ------------- *}
        {include file='r/input.tpl' name="fees_value" title="fees_value" collapse='formcoll' class="required numberi18n calculator"}
    {else}{* $$$$$$$$$$$$$ *}
        {include file='r/view.tpl' name="fees_value_internal" title="fees_value" collapse='formcoll' class="numberi18n" default='0'}
        {include file='r/input.tpl' name="fees_value" title="fees_value_otcurr" collapse='formcoll' class="required numberi18n calculator"}
    {/if}
    {include file='r/input.tpl' name="fees_turnover_rate" title="fees_turnover_rate" collapse='formcoll' class="numberi18n calculator"}
</fieldset>

<fieldset class="borderbottom">
    {include file='r/textarea.tpl' name="fees_purpose" title="fees_purpose" class="t-long" maxlength=240}
    {include file='r/date.tpl' name="fees_due_date" title="fees_due_date" collapse='formcoll' class="required dateUS"}

    {include file='r/ajaxselect.tpl' name='fees_address' title="fees_address_name"
        class="addressselect required fulltext_search t-mid" collapse='formcoll'
        add_icons_file="project_participants"
        filter_project_participants_project_field="fees_project"}

    {include file='r/select.tpl' name="fees_fee_account_name" title="fees_fee_account_name" list=$fee_accounts_list id="id" text="name" collapse='formcoll' class="required is_fee_account" noempty=TRUE}

    {include file='r/select.tpl' name="fees_cost_centre_name" title="fees_cost_centre_name" list=$cost_centres_list id="id" text="name" collapse='formcoll' class="is_cost_centre"}

    {include file='r/checkbox.tpl' name="fees_is_done" title="fees_is_done" collapse=''}
    {include file='r/checkbox.tpl' name="fees_finally_invoiced" title="fees_finally_invoiced" collapse=''}    
</fieldset>

<fieldset class="borderbottom">
    <legend>{$i.fees_fee_period}</legend>
    {include file='r/date.tpl' name="fees_from_date" title="filter_from_date"
        collapse='formcoll'}
    {include file='r/date.tpl' name="fees_to_date" title="filter_to_date"
        collapse='formcoll'}
</fieldset>

<fieldset class="noborder" id="fees_done_section">
    {include file='r/date.tpl' name="fees_done_date" title="fees_done_date" collapse='formcoll' class="dateUS"}
    {include file='r/input.tpl' name="fees_deduction" title="fees_deduction" collapse='formcoll' class="numberi18n"}
    {include file='r/textarea.tpl' name="fees_remit_purpose" title="fees_remit_purpose" class="t-long"}
</fieldset>

{if $use_work_packages}{* ------------- *}
    <fieldset id="fee_work_packages" class="bordertop"></fieldset>
{/if}

{include file='Basic/edit_popform_addi.tpl' edit_addi_list=$fees_addi_list  
    edit_addi_section='fees' edit_addi_target='fees' edit_addi_collapse='formcoll'}
