<?php defined('BASEPATH') OR exit('No direct script access allowed');

$rel_tNo_text =  (!empty($label) && !empty($label['OrderNo'])) ? $label['OrderNo'] : (!empty($rel_tNo_text) ? $rel_tNo_text : '') ;
$rel_tDate_text =  (!empty($label) && !empty($label['OrderDate'])) ? $label['OrderDate'] : (!empty($rel_tDate_text) ? $rel_tDate_text : '') ;
	$addressView = 'export/address/salretail1';
	$detailsView = 'export/details/salretail1';

	$custFieldsView = 'export/customfields';
	$exportDetailsView = 'export/exportdetails';

	$company["compNamePrefix"] = $this->config->item("compNamePrefix");
	
	$fontname = (!empty($fontname) && $fontname != 'null' )  ? $fontname : "";
	$this->view('export/css', array("fontname" => $fontname));

	//OB : This template is applicable for font size > 10 & retail template (Display the custom fields one by one)
	//print_R($company);exit;

	$isvertical = $isHorizontal = false;
/*
	$isHorizontal	= (!empty($isvertical) && $isvertical == 2) ? true : false;
	$isvertical		= (!empty($isvertical) && $isvertical == 1) ? true : false;
*/
?>
<page footer="page" pagegroup="new">
<?php 
	if (isset($download) && $download==-1){
		echo '<bookmark title="'.$tNo.'" level="0" ></bookmark>';
	}
?>
	<table cellspacing="0" cellpadding="0" class="vat noborder dashed">
		<col style="width:50%;">
		<col style="width:50%;">
		<tbody>
<?php
			$this->load->view((!empty($viewModule) ? $viewModule : "") . "export/salretail_font_header");
?>		</tbody>
	</table>
	<?php
		if(!empty($fields))
		{
			$this->view($custFieldsView, array("custFieldsCols" => 2, "isThermalPrint" => 1));
		}
		if(!empty($export_details) && ($isExport && $currencyCode != $expCurrencyCode))
		{ 
			$this->view($exportDetailsView);
		}

		$this->view($detailsView);
?></page>
<style>
	html, body {
		font-size: <?php echo !empty($fontsize) ? $fontsize : 10; ?>px;
	}
	html, body, page, pre {
		color: #000;
	}
	small {
		font-size: 9px;
	}
	table.dashed, table tr.dashed th {
		border-bottom: 1px dotted #000;
	}
	table tr.subtotal td {
		border-top: 1px dotted #000 !important;
	}
	table tr.totDiscount td {
		border-top: 1px dotted #000 !important;
	}
	table tr.dashed1 td {
		border-top: 1px solid #000 !important;
	}
	table tr.dashed2 td {
		border-bottom: 1px solid #000 !important;
	}

	.address big {
		font-size: 20px;
	}

	.totAmountCurr .amt {
		font-size: 18px;
	}
/*
	.address {
		line-height: 14px;
	}
*/
	table tr.small td {
		font-size: 10px;
	}
	table tr td.bt {
		border-top: 1px solid #000;
	}
	table tr td.bb {
		border-bottom: 1px solid #000;
	}
	<?php if (!$isPrint && is_numeric($paper)) { ?>
	page {
	    width: <?php echo $paper * 130; ?>px;
	    margin-left: calc(50% - 150px);
	    box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
	}
<?php
	}
?>
	table tr td {
		font-weight: 600;
	}
	table tr.row td {
		padding-bottom: 0px;
	}
	<?php if ($isHorizontal) { ?>
	table.noborder tr.item.row td, table tr.item.row td {
		border-bottom: 1px dotted #000;
	}
	<?php } ?>
	table tr.row2 td {
		padding-top: 0px;
	}
</style>
