<fieldset class="borderbottom">
    {include file='r/hidden.tpl' name="project_offers_edit"}{* What entry do we edit - If empty = add *}
    {include file='r/hidden.tpl' name="project_offers_old_id"}{* On duplicate, it's the ID of the source offer *}
    {include file='r/select-project.tpl' name="project_offers_project" title="projectadmin_project" class="is_project required"
        list=$projects_list id="id" text="project"
        add_icons_file="project" filter_favourite_list=$projects_favourite_list
        filter_extra="onchange='offers_management.fee_allocation.load();'"}
    {include file='r/hidden.tpl' name="project_offers_portlet_desc"}
    {include file='r/hidden.tpl' name="project_offers_portlet_data"}

    {include file='r/radio.tpl' name="project_offers_offer_type" title="offers_management_offer_type"
        list=$offer_type_list id="id" text="name" collapse='formcoll'
        filter_extra="onchange='offers_management._onchange_offer_type();'"}
</fieldset>

{if $project_use_currency}
    <fieldset class="borderbottom">
        {include file='r/select.tpl' name='project_offers_currency_id' title="offers_management_currency" class="" labelclass="label2" collapse='formcoll'
            list=$currencies_list id="id" text="name" mapdata="exchange_rate"}
        {include file='r/input.tpl' name="project_offers_exchange_rate" title="projectadmin_exchange_rate" collapse='formcoll' 
            add_icons_file="currencies_online_update" online_update_currency="project_offers_currency_id" online_update_date="project_offers_date"
            class="required numberi18n" labelclass="label2"}
    </fieldset>
{/if}

{include file="Projectadmin/_edit_popform_offers_management_offer_only_fields.tpl"
    prefix="project_offers"}

<div id="project_offers_budget_auto_calc" class="warningsmall ui-corner-all">{$i.offers_management_no_auto_calc}</div>

<fieldset id="project_offers_calc_type_warning" style="display: none;" class="borderbottom">
    <p style="margin: 4px 10px;">
        <span class="warningsmall warningsmaller ui-corner-all">{$i.offers_management_no_quantity_warning}</span>
    </p>
</fieldset>
<fieldset id="project_offers_rates_warning" style="display: none;" class="borderbottom">
    <p style="margin: 4px 10px;">
        <span class="warningsmall warningsmaller ui-corner-all">{$i.offers_management_no_calc_warning}</span>
    </p>
</fieldset>
<fieldset id="project_offers_calc_type" class="borderbottom">
    {include file='r/radio.tpl' name="project_offers_calc_type" title="offers_management_calc_type_title" 
        list=$calc_type_list id="id" text="name" 
        filter_extra="onchange='offers_management.fee_allocation._onchange_amount_percentage(\"calc_type\");'"}
</fieldset>

<fieldset id="project_offers_rates" class="borderbottom">
    <fieldset id="project_offers_skill_grp_warning" style="display: none;" class="noborder">
        <p>
            <span class="warningsmall warningsmaller ui-corner-all">{$i.offers_management_no_skill_grp_warning}</span>
        </p>
    </fieldset>
    {include file='r/select.tpl' name="project_offers_times_rate" title="projectadmin_times_rate" 
        list=$times_rate_list id="id" text="name" noempty=true
        filter_extra="onchange='offers_management.fee_allocation.get_rates_histories(\"{$type_times}\");'" collapse='formcoll'}
    {include file='r/select.tpl' name="project_offers_times_rate_history" title="offers_management_times_rate_history_title" 
        list=$times_rate_history_list id="id" text="fullname" noempty=true
        filter_extra="onchange='offers_management.fee_allocation.update_skill_grp_by_rates_history();'" collapse='formcoll'}
        
{*    {include file='r/select.tpl' name="project_offers_work_areas_rate" title="projectadmin_areas_rate" 
        list=$work_areas_rate_list id="id" text="name" noempty=true
        filter_extra="onchange='offers_management.fee_allocation.get_rates_histories(\"{$type_work_areas}\");'" collapse='formcoll'}
    {include file='r/select.tpl' name="project_offers_work_areas_rate_history" title="offers_management_work_areas_rate_history_title" 
        list=$work_areas_rate_history_list id="id" text="fullname" noempty=true
        filter_extra="onchange='offers_management.fee_allocation.update_price_by_rates_history();'" collapse='formcoll'}*}
    {include file='r/hidden.tpl' name="project_offers_work_areas_rate" default="0"}
    {include file='r/hidden.tpl' name="project_offers_work_areas_rate_history" default="0"}
        
    {include file='r/select.tpl' name="project_offers_travel_rate" title="projectadmin_travels_rate" 
        list=$travel_rate_list id="id" text="name" noempty=true
        filter_extra="onchange='offers_management.fee_allocation.get_rates_histories(\"{$type_travel}\");'" collapse='formcoll'}
    {include file='r/select.tpl' name="project_offers_travel_rate_history" title="offers_management_travel_rate_history_title" 
        list=$travel_rate_history_list id="id" text="fullname" noempty=true
        filter_extra="onchange='offers_management.fee_allocation.update_extras_by_rates_history();'" collapse='formcoll'}
    {include file='r/select.tpl' name="project_offers_extras_rate" title="projectadmin_extras_rate" 
        list=$extras_rate_list id="id" text="name" noempty=true
        filter_extra="onchange='offers_management.fee_allocation.get_rates_histories(\"{$type_extras}\");'" collapse='formcoll'}
    {include file='r/select.tpl' name="project_offers_extras_rate_history" title="offers_management_extras_rate_history_title" 
        list=$extras_rate_history_list id="id" text="fullname" noempty=true
        filter_extra="onchange='offers_management.fee_allocation.update_extras_by_rates_history();'" collapse='formcoll'}
</fieldset>

<fieldset class="noborder">
    {include file='r/radio.tpl' name="project_offers_extras_type" title="offers_management_extras_title" 
        list=$extras_type_list id="id" text="name" collapse='formcoll'
        pstyle='background: rgba(255, 255, 200, 0.4);'
        filter_extra="onchange='offers_management.fee_allocation._onchange_amount_percentage(\"extras\");'"}

    {include file='r/radio.tpl' name="project_offers_rebate_type" title="offers_management_rebate_title" 
        list=$rebate_type_list id="id" text="name" collapse='formcoll'
        pstyle='background: rgba(255, 200, 200, 0.4);'
        filter_extra="onchange='offers_management.fee_allocation._onchange_amount_percentage(\"rebate\");'"}

    {include file='r/select.tpl' name="project_offers_calc_rebate_first" title="offers_management_calc_rebate_extras_title" 
        list=$calc_rebate_first_list id="id" text="name" noempty='true'
        class='t-mid' pstyle='text-align:center;'
        filter_extra="onchange='offers_management.fee_allocation._update_table_fields();'"}
</fieldset>

{include file='r/hidden.tpl' name="project_offers_disabled" default="0"}
{include file='r/hidden.tpl' name="project_offers_fee_allocation_change" default="0"}
<fieldset id="project_offers_fee_allocation" class="noborder" style="margin-top: 0; padding-top: 1px;">
</fieldset>
