<?php




		$this->row = $this->pageHeight - $this->topMargin;

		$upper = $this->row - 2 * $this->lineHeight;
		$lower = $this->bottomMargin + 8 * $this->lineHeight;
		$iline1 = $upper - 7.5 * $this->lineHeight;
		$iline2 = $iline1 - 8 * $this->lineHeight;
		$iline3 = $iline2 - 1.5 * $this->lineHeight;
		$iline4 = $iline3 - 1.5 * $this->lineHeight;
		$iline5 = $iline4 - 3 * $this->lineHeight+180;
		$iline6 = $iline5 - 1.5 * $this->lineHeight;
		$iline7 = $lower-20;
		$right = $this->pageWidth - $this->rightMargin;
		$width = ($right - $this->leftMargin) / 5;
		$icol = $this->pageWidth / 2;
		$ccol = $this->cols[0] + 4;
		$c2col = $ccol + 60;
		$ccol2 = $icol / 2;
		$mcol = $icol + 8;
		$mcol2 = $this->pageWidth - $ccol2;
		$cols = count($this->cols);
		// $this->SetDrawColor(205, 205, 205);
		// $this->Line($iline1-20, 3);
		// $this->SetDrawColor(128, 128, 128);
		// $this->Line($iline1-20);
		/*$this->rectangle($this->leftMargin, $iline2, $right - $this->leftMargin, $iline2 - $iline3, "F", null, array(222, 231, 236));   
		$this->Line($iline2);
		$this->Line($iline3);
		$this->Line($iline4);*/
		// $this->rectangle($this->leftMargin, $iline5, $right - $this->leftMargin, $iline5 - $iline6, "F", null, array(222, 231, 236));   
		// $this->Line($iline5);
		// $this->Line($iline6);
		// $this->Line($iline7);
		// // $this->LineTo($this->leftMargin, $iline2 ,$this->leftMargin, $iline4);
		// $col = $this->leftMargin;
		// for ($i = 0; $i < 5; $i++)
		// {
		// 	// $this->LineTo($col += $width, $iline2,$col, $iline4);
		// }
		// $this->LineTo($this->leftMargin, $iline5 ,$this->leftMargin, $iline7);
		// // if ($this->l['a_meta_dir'] == 'rtl') // avoid line overwrite in rtl language
		// // 	$this->LineTo($this->cols[$cols - 2], $iline5 ,$this->cols[$cols - 2], $iline7);
		// // else	
		// // 	$this->LineTo($this->cols[$cols - 2] + 4, $iline5 ,$this->cols[$cols - 2] + 4, $iline7);
		// $this->LineTo($right, $iline5 ,$right, $iline7);

		// Company Logo
		// $this->NewLine();

$this->selectFont('times');

	$this->SetLineStyle(array('width' => 0.5, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0)));
	$this->RoundedRect(200, 40, 200, 35, 5, '1111', 'DF',null, array(245, 245, 245));
			$this->fontSize += 4;
			$this->Font('bold');
			// ($c, $txt, $n=0, $corr=0, $r=0, $align='left', $
			$this->Text($ccol+120, $this->company['coy_name'], $icol+150 ,0,0,'center');
			$this->Font();
			$this->fontSize -= 4;
		
		// Document title
				$this->NewLine(2.5);
		// $this->SetTextColor(190, 190, 190);
		$this->fontSize += 5;
		$this->Font('bold');
		$this->TextWrap($ccol+135, $this->row, $this->pageWidth - $this->rightMargin - $mcol - 20, $this->title, 'center');
		$this->Font();
		$this->fontSize -= 5;

			$this->Text($mcol + 230, _("Page") . ' ' . $this->pageNumber);
		$this->NewLine(2);
		// $this->SetTextColor(0, 0, 0);
		$adrline = $this->row;

		
			$this->Text($ccol, _("Voucher No :"), $c2col);
			$this->Text($c2col, $this->formData['ref'], $mcol);
			// $this->NewLine();

			$this->Text($mcol + 150, _("Voucher Date :"));
			$this->Text($mcol + 210, ': '.sql2date($this->formData['trans_date']));
  
			$this->NewLine();

			if($this->formData['post_date']!='')
			{
				$this->Text($mcol + 150, _("Post Date :"));
				$this->Text($mcol + 210, ': '.sql2date($this->formData['post_date']));
				$this->NewLine();
			}

             if($this->formData['person_id']!='')
             {

				$this->Text($ccol, _("Payee :"), $c2col);
				$this->Text($c2col, $this->formData['person_id'], $mcol);
             }	
             
            if($this->formData['cheque_no'])
           {

				$this->Text($mcol + 150, _("Cheque No :"));
				$this->Text($mcol + 210,  $this->formData['cheque_no']);
		
           }   




		$this->NewLine(2);
	
	
// address2
	
		$this->Font();

		// Line headers
		$this->row = $iline5 - $this->lineHeight - 5;

		$this->SetLineStyle(array('width' => 1, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(0, 0, 0)));
		$this->RoundedRect(30, 120, 560, 37, 5, '1001', 'DF',null, array(245, 245, 245));
		$this->Font('bold');
		$count = count($this->headers);
		$this->cols[$count] = $right - 3;
		for ($i = 0; $i < $count; $i++)
			$this->TextCol($i, $i + 1, $this->headers[$i], -2);
		$this->Font();

	

		$this->Font();
		$temp = $iline6 - $this->lineHeight - 5;

	
