<?php
// +---------------------------------------------------------------------------------------+
// | TenderSystem                                                                          |
// +---------------------------------------------------------------------------------------+
// | The contents of this file are subject to the TenderSystem Public License Version 1.1  |
// | ("License"); you may not use this file except in compliance with the License. You may |
// | obtain a copy of the License at http://www.tendersystem.com/tpl/                      |
// |                                                                                       |
// | Software distributed under the License is distributed on an "AS IS" basis, WITHOUT    |
// | WARRANTY OF ANY KIND, either express or implied. See the License for the specific     |
// | language governing rights and limitations under the License.                          |
// |                                                                                       |
// | All copies of the Covered Code must include the "Powered by TenderSystem" logo and    |
// | ValueCard copyright notice on every user interface screen and in every outgoing       |
// | email in the same form as they appear in the distribution.                            |
// |                                                                                       |
// | The Original Code is: TenderSystem                                                    |
// | The Initial Developer of the Original Code is ValueCard (Pty) Limited.                |
// | Portions created by ValueCard are Copyright (C) 2002 ValueCard (Pty) Limited.         |
// | All Rights Reserved.                                                                  |
// | Contributor(s): __________________.                                                   |
// +---------------------------------------------------------------------------------------+

/**
* Mandate exceeded template 
* @package TenderSystem
* @subpackage procure
* @copyright Copyright &copy; 2002, ValueCard (Pty) Ltd
* @license http://www.tendersystem.com/tpl/ TenderSystem Public License
* @version 
*/

$subject = $this->lang['mandate_exceeded']." ".$this->user['rfqnumber']." (".$this->user['rfqreference'].")";

// authentication string
$html.= "<tr>";
$html.= "<td>";
$html.= $this->lang['dear']." ".$this->user['adminname'].",<br/><br/>";
$html.= $this->lang['emailbecause']."<a href=\"mailto:".$this->user['awarderemail']."?subject=".$subject."\"> ".$this->user['awardername']." ".$this->user['awardersurname']."</a> ".$this->lang['preapprovedmandate']." ".$cfg['local']['precurrency'].sprintf("%.2f",$this->user['mandatevalue']).$cfg['local']['postcurrency'].".<br/><br/>";
$redirect = "profile&id=".$this->user['awarder']['id'];
$link = $cfg['url']."index.php?next_module=user&next_function=".rawurlencode($redirect)."&next_call_id=".time();
$html.= $this->lang['onlyanotifcation']."<br/><br/>";
$html.= "<a href=\"".$link."\">".$this->lang['amountonline']."</a><br/><br/>";
$html.= $this->lang['pobelow'].".<br/><br/>";
$link = $cfg['url']."main.php?module=procure&function=authenticate_purchase_order&language=".$this->user['language']."&tenderid=".$this->user['tenderid']."&auth_string=".$this->user['authentication'];
$html.= "<a class=\"e\" href=\"".$link."\">".$this->lang['nbclickhere'].".</a><br/><br/>";
$html.= $this->lang['adminitemsawarded']." ".$this->user['organisationname']." : ".$this->user['name']." ".$this->user['surname']."<br/><br/>";

$html.= "<table width=\"100%\"  border=\"0\" cellpadding=\"2\" cellspacing=\"0\">";
$html.= "<tr>";
$html.= "<td class=\"h t1\">";
$html.=  $this->lang['item'];
$html.= "</td>";
$html.= "<td class=\"ha t1\">";
$html.=  $this->lang['brand'];
$html.= "</td>";
$html.= "<td class=\"ha t1\">";
$html.=  $this->lang['model'];
$html.= "</td>";
$html.= "<td class=\"ha t1\">";
$html.=  $this->lang['description'];
$html.= "</td>";
$html.= "<td class=\"ha t1\">";
$html.=  $this->lang['price'];
$html.= "</td>";
$html.= "<td>";
$html.= "</td>";
$html.= "</tr>";
foreach($this->user['tender_item'] as $item) {
	$html.= "<tr>";
	$html.= "<td class=\"h2b t2\">";
	$html.= $item['tender_item'];
	$html.= "</td>";
	$html.= "<td class=\"h2c t2\">";
	$html.= $item['brand'];
	$html.= "</td>";
	$html.= "<td class=\"h2c t2\">";
	$html.= $item['model'];
	$html.= "</td>";
	$html.= "<td class=\"h2c t2\">";
	$html.= "<pre class=\"t2\">".wordwrap($item['description'],25)."</pre>";
	$html.= "</td>";
	$html.= "<td class=\"h2c t2\">";
	$html.= $cfg['local']['precurrency'].sprintf("%.2f",$item['price']).$cfg['local']['postcurrency'];
	$html.= "</td>";
	$html.= "<td>";
	$html.= "</td>";
	$html.= "</tr>";
}
$html.= "<tr>";
$html.= "<td class=\"hb t1\" colspan=\"4\" align=\"right\">";
$html.=  $this->lang['total'];
$html.= "</td>";
$html.= "<td class=\"hc t2\">";
$html.= $cfg['local']['precurrency'].sprintf("%.2f",$this->user['total']).$cfg['local']['postcurrency'];
$html.= "</td>";
$html.= "<td>";
$html.= "</td>";
$html.= "</tr>";
if($cfg['tender']['excess']) {
	$html.= "<tr>";
	$html.= "<td class=\"hb t1\" colspan=\"4\" align=\"right\">";
	$html.=  "-".$this->lang['lessexcess'];
	$html.= "</td>";
	$html.= "<td class=\"hc t2\">";
	$html.= $cfg['local']['precurrency'].sprintf("%.2f",$this->user['excess']).$cfg['local']['postcurrency'];
	$html.= "</td>";
	$html.= "<td>";
	$html.= "</td>";
	$html.= "</tr>";
	$html.= "<td class=\"hb t1\" colspan=\"4\" align=\"right\">";
	$html.=  $this->lang['invoicetotal'];
	$html.= "</td>";
	$html.= "<td class=\"hc t2\">";
	$final = $this->user['total'] - $this->user['excess'];
	$html.= $cfg['local']['precurrency'].sprintf("%.2f",$final).$cfg['local']['postcurrency'];
	$html.= "</td>";
	$html.= "<td>";
	$html.= "</td>";
	$html.= "</tr>";
}
// Close the table
$html.= "</table><br/>";
?>