{if $offer->offer_type_name neq ''}
    <tr>
        <td>{$i.offers_management_offer_type}</td>
        <td>{$offer->offer_type_name}</td>
    </tr>
{/if}
{if $offer->offer_no neq ''}
    <tr>
        <td>{$i.offers_management_offer_no}</td>
        <td>{$offer->offer_no}</td>
    </tr>
{/if}
{if $offer->title neq ''}
    <tr>
        <td>{$i.offers_management_title}</td>
        <td>{$offer->title}</td>
    </tr>
{/if}
{if $offer->name neq ''}
    <tr>
        <td>{$i.offers_management_name}</td>
        <td>{$offer->name|truncate:120:"..."}</td>
    </tr>        
{/if}
<tr>
    <td>{$i.offers_management_date}</td>
    <td>{$offer->date->us_date()}</td>
</tr>  
{if $offer->time->us_stime() neq ''}
    <tr>
        <td>{$i.offers_management_time}</td>
        <td>{$offer->time->us_stime()}</td>
    </tr>  
{/if}
{if $offer->status > 0}
    <tr>
        <td>{$i.offers_management_status}</td>
        <td>{$offer->status_name}</td>
    </tr>
{/if}
{if $offer->address_name neq ''}
    <tr>
        <td>{$i.offers_management_address_name}</td>
        <td>
            <a href="{site_url url="start/open/addressesandcontacts/index/$xjxcookie/view/{$offer->address_id}/"}"
                onclick="window.open(this.href); return false;"
                class="dialog_make_btn16 addresses smallbtns ui-corner-all frstbtn" title="{$i.basic_addressesandcontacts}"></a>
            {$offer->address_name}
        </td>
    </tr>
{/if}
{if $offer->costs_sum_rep > 0}
    <tr>
        <td>{$i.offers_management_costs_sum}</td>
        <td>{float_to_usnumber($offer->costs_sum_with_rep)} {$project_global_currency}</td>
    </tr>
    <tr>
        <td>{$i.offers_management_costs_sum_no_rep}</td>
        <td>{float_to_usnumber($offer->costs_sum)} {$project_global_currency}</td>
    </tr>
{else}
    <tr>
        <td>{$i.offers_management_costs_sum}</td>
        <td>{float_to_usnumber($offer->costs_sum)} {$project_global_currency}</td>
    </tr>
{/if}
<tr>
    <td>{$i.offers_management_costs_view}</td>
    <td>{float_to_usnumber($offer->costs_view_sum)} {$project_global_currency}</td>
</tr>    
{if $project_use_currency && $offer->costs_sum_otcurr!=null}
    <tr>
        <td style="background:rgba(210, 220, 255, 0.3);">{if is_null($offer->currency_name)}{$i.offers_management_currency}{else}{$offer->currency_name}{/if} {$i.offers_management_costs_sum}</td>
        <td>{float_to_usnumber($offer->costs_sum_otcurr)} {$offer->currency_abbreviation}</td>
    </tr>
    <tr>
        <td style="background:rgba(210, 220, 255, 0.3);">{$i.projectadmin_exchange_rate}</td>
        <td title="value/value_otcurr">{if $offer->costs_sum_otcurr > 0}{isfloat value=$offer->costs_view_sum/$offer->costs_sum_otcurr maxf=4} {else} {isfloat value=0 maxf=4} {/if}</td>
    </tr> 
{/if}
{if !empty($portlet_data)}
    {if !empty($portlet_data->repetition)}
        <tr>
            <td>{$i.offers_management_repetition}</td>
            <td>{$portlet_data->repetition}</td>
        </tr>
    {/if}
{/if}
{if $offer->retention>0}
    <tr>
        <td title="{$i.offers_management_retention_info}">{$i.offers_management_retention1}</td>
        <td>
            {float_to_usnumber($offer->retention)} 
            {if $offer->retention_type eq 1}
                %
            {else}
                {if $project_use_currency && $offer->costs_sum_otcurr!=null}
                    {$offer->currency_abbreviation}
                {else}
                    {$project_global_currency}
                {/if}
            {/if}
            {if $offer->retention_years>0}
                {$i.offers_management_retention_in}
                {intval($offer->retention_years)} {$i.basic_years1}
            {/if}
        </td>
    </tr>    
{/if}
{if $offer->staff_id>0}
    <tr>
        <td>{$i.offers_management_staff_name}</td>
        <td>{$offer->staff_name}</td>
    </tr>
{/if}
{if !$offer->valid_to_date->is_null()}
    <tr>
        <td>{$i.offers_management_valid_to_date}</td>
        <td>{$offer->valid_to_date->us_date()}</td>
    </tr>          
{/if}
{if $offer->order_no neq ''}
    <tr>
        <td>{$i.offers_management_order_no}</td>
        <td>{$offer->order_no}</td>
    </tr>   
{/if}
{if !$offer->order_date->is_null()}
    <tr>
        <td>{$i.offers_management_order_date}</td>
        <td>{$offer->order_date->us_date()}</td>
    </tr>         
{/if}
{if intval($offer->offer_type) != 1}
    <tr>
        <td>{$i.offers_management_order_probability}</td>
        <td>{$offer->order_probability}%</td>
    </tr>
{/if}
{if $offer->is_calcexp}
    <tr>
        <td>{$i.offers_management_is_calcexp}</td>
        <td>{boolview value=$offer->is_calcexp}</td>
    </tr>
{/if}
{if $offer->payments_count>0}
    <tr>
        <td>{$i.offers_management_payments_count}</td>
        <td>{$offer->payments_count}</td>
    </tr>
{/if}
{if $offer->portlet_desc neq ''}
    <tr>
        <td colspan="2" style="word-wrap: break-word;">{$offer->portlet_desc|prep_pre_like}</td>
    </tr>         
{/if}
{if intval($offer->offer_type) != 1}
    <tr>
        <td style="border-bottom-style: solid;">{$i.offers_management_estimation}</td>
        <td style="border-bottom-style: solid;">{boolview value=$offer->is_estimation}</td>
    </tr>
{/if} 
{if isset($offer->correspondences) && count($offer->correspondences) > 0}
    <tr>
    <td style="border-bottom-style: solid;">{$i.basic_correspondence}</td>
        <td style="border-bottom-style: solid;">
        {foreach from=$offer->correspondences item=corr_item}
            <p>
            <a href="{site_url url="start/open/correspondence/index/$xjxcookie/view/{$corr_item->id}/"}"
               onclick="window.open(this.href); return false;"
               class="dialog_make_btn16 correspondence smallbtns ui-corner-all frstbtn" title="{$i.basic_correspondence}"></a>

                {$corr_item->subject|truncate:50:"..."}
            </p>
        {foreachelse}
            &nbsp;
        {/foreach}
        </td>
    </tr>  
{/if}    
{if $offer->collective_ids}
    <tr>
        <td>{$i.offers_management_collective_offer_type}</td>
        <td>
            <div class="many" id="inforight_collective_bills">
                {foreach from=$offer->collective_offer_correspondences item=collective_offer}
                    <p>
                        {if empty($collective_offer)}
                            x
                        {else}
                            <a href="{site_url url="start/open/correspondence/index/$xjxcookie/view/{$collective_offer->id}/"}"
                               onclick="window.open(this.href); return false;"
                               class="dialog_make_btn16 correspondence smallbtns ui-corner-all frstbtn" title="{$i.basic_correspondence}"></a>

                            {filelink_html($collective_offer->file_path, 'correspondence', $collective_offer->id, true, $collective_offer)}
                            {$collective_offer->subject|truncate:50:"..."}
                        {/if}
                    </p>
                {foreachelse}
                    &nbsp;
                {/foreach}
            </div>
        </td>
    </tr>
{/if}
