<?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): __________________.                                                   |
// +---------------------------------------------------------------------------------------+

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

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

$html = "<tr>";
$html.= "<td>";
$html.= $lang['dear']." ".$this->user['client_title']." ".$this->user['client_surname'].",<br/><br/>";
$html.= $this->user['client_message']."<br/><br/>";
if($cfg['tender']['excess'] && $this->user['excess'] && $this->user['excess'] > 0.009) {
	$html.= $lang['pleasenote']." <b>".$cfg['local']['precurrency'].sprintf("%.2f",$this->user['excess']).$cfg['local']['postcurrency']."</b> ".$lang['payable'].".<br/><br/>";
}

if($this->user['client_cc']) {
	$html.= "<table width=\"100%\"  border=\"0\" cellpadding=\"2\" cellspacing=\"0\">";
	$html.= "<tr>";
	$html.= "<td class=\"h t1\">";
	$html.=  $lang['item'];
	$html.= "</td>";
	$html.= "<td class=\"ha t1\">";
	$html.=  $lang['brand'];
	$html.= "</td>";
	$html.= "<td class=\"ha t1\">";
	$html.=  $lang['model'];
	$html.= "</td>";
	$html.= "<td class=\"ha t1\">";
	$html.=  $lang['description'];
	$html.= "</td>";
	$html.= "<td class=\"ha t1\">";
	$html.=  $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.= $item['description'];
		$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.=  $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.=  "-".$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.=  $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/>";
}
$html.= "<table width=\"100%\"  border=\"0\" cellpadding=\"2\" cellspacing=\"0\">";
$html.= "<tr>";
$html.= "<td class=\"h1 t1\" colspan=\"4\" align=\"left\">";
$html.= $this->lang['subscriberinfo'];
$html.= "</td>";
$html.= "</tr>";
$html.= "<tr>";
$html.= "<td class=\"t1\">";
$html.= $this->lang['name'];
$html.= "</td>";
$html.= "<td class=\"t2\">";
$html.= $this->user['awardername']." ".$this->user['awardersurname'];
$html.= "</td>";
$html.= "<td class=\"t1\">";
$html.= $this->lang['phonework'];
$html.= "</td>";
$html.= "<td class=\"t2\">";
$html.= $this->user['awarderphone_work'];
$html.= "</td>";
$html.= "</tr>";
$html.= "<tr>";
$html.= "<td class=\"t1\">";
$html.= $this->lang['phonefax'];
$html.= "</td>";
$html.= "<td class=\"t2\">";
$html.= $this->user['awarderphone_fax'];
$html.= "</td>";
$html.= "<td class=\"t1\">";
$html.= $this->lang['email'];
$html.= "</td>";
$html.= "<td class=\"t2\">";
$html.= "<a href=\"mailto:".$this->user['awarderemail']."?subject=".$subject."\">";
$html.= $this->user['awarderemail'];
$html.= "</a>";
$html.= "</td>";
$html.= "</tr>";
$html.= "</table><br/>";
?>