{include file="delete_company.tpl.js"} {literal} {/literal}

{t}Company{/t}: {$cpnInfo.cpn_name|wash}

{if ($perm_companies) || ($cpnInfo.pe_id == $smarty.session.auth_user.pe_id)}
{/if}
{$cpnInfo.cpn_name|wash}
{t}Address{/t}: {$cpnInfo.cpn_address|wash|default:" "}
{t}Address 2{/t}: {$cpnInfo.cpn_address2|wash|default:" "}
{t}Location{/t}: {$cpnInfo.full_location|wash|default:" "}
{t}Country{/t}: {$cpnInfo.ctr_name|wash|default: {$cpnInfo.ctr_name|wash|default:" "}
{t}Category{/t}: {$cpnInfo.ccat_title|wash|default:" "}
{t}Tax number{/t}: {$cpnInfo.cpn_taxnr|wash|default:" "}
{t}Default term of payment{/t}: {$cpnInfo.cpn_defaultpayterm|wash|default:" "}
{t}Phone{/t}: {$cpnInfo.cpn_phone|wash|default:" "}
{t}Fax{/t}: {$cpnInfo.cpn_fax|wash|default:" "}
{t}Url{/t}: {if strlen($cpnInfo.cpn_url)}{$cpnInfo.cpn_url|wash|phpaga_urlmodifier}{else} {/if}
{t}Email{/t}: {if strlen($cpnInfo.cpn_email)}{$cpnInfo.cpn_email|wash}{else} {/if}
{t}Record owner{/t}: {$cpnInfo.owner_pe_person|wash|default:" "}
{if (isset($opcats) && (count($opcats) > 0))}
{t}Task categories{/t} 
{foreach item=prj from=$opcats.projects} {/foreach} {foreach key=opckey item=opc from=$opcats.opcats} {foreach item=row from=$opcats.rows[$opckey]} {/foreach} {/foreach} {foreach item=prj from=$opcats.projects} {/foreach}
{t}Per project{/t}
  {$prj.prj_title|wash}{t}Total{/t}
{$opc.opcat_title|wash} {if strlen($row.opcat_duration)}{$row.opcat_duration|phpaga_minutes2duration}{else} {/if} {$opc.duration|phpaga_minutes2duration}
 {$prj.duration|phpaga_minutes2duration}{$TOTAL_DURATION_PRJ|phpaga_minutes2duration}
{/if} {if (isset($cpnInfo.projects) && is_array($cpnInfo.projects) && (count($cpnInfo.projects) > 0))}
{section name=prjs loop=$cpnInfo.projects} {/section}
{t}Projects{/t}
{t}Title{/t} {t}Status{/t} {t}Start date{/t} {t}Projected end{/t} {t}End date{/t} {t}Category{/t} {t}Hours{/t} {t}Actions{/t}
{$cpnInfo.projects[prjs].prj_title|wash} {$cpnInfo.projects[prjs].prjstat_title|wash} {$cpnInfo.projects[prjs].prj_startdate|wash|date_format:$smarty.const.PHPAGA_DATEFORMAT_SHORT} {if strlen($cpnInfo.projects[prjs].prj_estimatedend)} {$cpnInfo.projects[prjs].prj_estimatedend|wash|date_format:$smarty.const.PHPAGA_DATEFORMAT_SHORT}{else} {/if} {if strlen($cpnInfo.projects[prjs].prj_enddate)}{$cpnInfo.projects[prjs].prj_enddate|wash|date_format:$smarty.const.PHPAGA_DATEFORMAT_SHORT}{else} {/if} {$cpnInfo.projects[prjs].prjcat_title|wash} {$cpnInfo.projects[prjs].prj_duration|phpaga_minutes2duration} {strip} {t}View{/t} {t}Edit{/t} {t}Add task{/t} {/strip}
{/if} {if ($perm_financial)}
{if (isset($cpnInfo.billing_summary.issued) && is_array($cpnInfo.billing_summary.issued) && count($cpnInfo.billing_summary.issued)) || (isset($cpnInfo.billing_summary.outstanding) && is_array($cpnInfo.billing_summary.outstanding) && count($cpnInfo.billing_summary.outstanding))} {section name=isum loop=$cpnInfo.billing_summary.issued} {/section} {section name=isum loop=$cpnInfo.billing_summary.outstanding} {/section}
{t}Overall{/t}
{t}Status{/t} {t}Nr. of invoices{/t} {t}Time frame{/t} {t}Total amount{/t} {t}Currency{/t}
{t}issued{/t} {$cpnInfo.billing_summary.issued[isum].count|default:" "} {$cpnInfo.billing_summary.issued[isum].min_date|wash|default:" "} - {$cpnInfo.billing_summary.issued[isum].max_date|default:" "} {$cpnInfo.billing_summary.issued[isum].amount|phpaga_formatamount|default:" "} {$cpnInfo.billing_summary.issued[isum].curr_name|wash|default:" "}
{t}outstanding{/t} {$cpnInfo.billing_summary.outstanding[isum].count|default:" "} {$cpnInfo.billing_summary.outstanding[isum].min_date|wash|default:" "} - {$cpnInfo.billing_summary.outstanding[isum].max_date|default:" "} {$cpnInfo.billing_summary.outstanding[isum].amount|phpaga_formatamount|default:" "} {$cpnInfo.billing_summary.outstanding[isum].curr_name|wash|default:" "}
{/if} {if ($perm_financial && isset($cpnInfo.bills) && is_array($cpnInfo.bills) && (count($cpnInfo.bills) > 0))} {section name=inv loop=$cpnInfo.bills} {/section}
{t}Invoices{/t}
{t}Invoice nr.{/t} {t}Invoice date{/t} {t}Amount{/t} {t}Currency{/t} {t}Date paid{/t}
{$cpnInfo.bills[inv].bill_number|wash} {$cpnInfo.bills[inv].bill_date|wash|date_format:$smarty.const.PHPAGA_DATEFORMAT_SHORT} {$cpnInfo.bills[inv].bill_endsum|phpaga_formatamount|default:" "} {$cpnInfo.bills[inv].curr_name|wash|default:" "} {$cpnInfo.bills[inv].bill_paydate|wash|date_format:$smarty.const.PHPAGA_DATEFORMAT_SHORT}
{/if} {/if}
{if ($perm_financial && isset($cpnInfo.quotations) && is_array($cpnInfo.quotations) && (count($cpnInfo.quotations) > 0))}
{section name=quot loop=$cpnInfo.quotations} {/section}
{t}Quotations{/t}
{t}Quotation nr.{/t} {t}Quotation date{/t} {t}Amount{/t} {t}Currency{/t}
{$cpnInfo.quotations[quot].quot_number|wash} {$cpnInfo.quotations[quot].quot_date|wash|date_format:$smarty.const.PHPAGA_DATEFORMAT_SHORT} {$cpnInfo.quotations[quot].quot_endsum|phpaga_formatamount|default:" "} {$cpnInfo.quotations[quot].curr_name|wash|default:" "}
{/if} {if (isset($persons) && is_array($persons) && (count($persons) > 0))}
{section name=idx loop=$persons} {/section}
{t}Employees{/t}
{t}Name{/t} {t}Address{/t} {t}City{/t} {t}Country{/t} {t}Work phone{/t}: {t}Email{/t}
{$persons[idx].pe_person|wash} {$persons[idx].pe_address|wash|default:" "} {$persons[idx].pe_location|wash|default:" "} {$persons[idx].ctr_name|wash|default:" "} {$persons[idx].pe_phonework|wash|default:" "} {if (isset($persons[idx].pe_email) && strlen($persons[idx].pe_email))}{$persons[idx].pe_email|wash}{else} {/if}
{/if}