

<?php $this->load->view("common/header"); ?>

<div style="top:5px;" class="panel-tools open">

<button data-toggle="dropdown" class="btn btn-blue dropdown-toggle" onClick="window.print()">

<i class="fa fa-print"></i>

</button>

</div>



<style type="text/css">

h3

{

	margin-top:10px;

}

th{

	text-align:center !important;

}

.report_view_th{

	color:#000 !important;

	text-align:center !important;	

}

body{

	background-color:#fff !important;

	font-size:13px;

	

}

p{

	margin:0;

}

.modal-body {

  padding: 2px 15px 15px;

  position: relative;

}

body .modal {

/* new custom width */

width: 750px;

/* must be half of the width, minus scrollbar on the left (30px) */

margin-left: -375px;

}

.print-table td, th{

	padding:3px;

	vertical-align:top !important;

}

thead { display: table-header-group; }

tfoot { display: table-footer-group; }

</style>





<style type="text/css" media="print">



.print-table {

	/*page-break-before:avoid;

	page-break-after: avoid;*/

	/*page-break-inside: avoid;*/

	/*page-break-inside:avoid;*/

	width:100%;

	

}

.td_border_bottom_1{

	border-bottom:1px solid #666 !important;	

}

.td_border_bottom_2{

	border-bottom:4px double #666 !important;	

}

.td_border_top_1{

	border-top:1px double #666 !important;	

}

</style>

<!--https://css-tricks.com/almanac/properties/p/page-break/-->



<!--onLoad="window.print()-->





<?php 

$ref_usr=new User_Model;



$user_details=$ref_usr->get_user_info($sale_rtn_details['user_id']);

$inv_name='';

$inv_name=$user_details['invoice_name'];

$inv_user_name=$user_details['user_first_name'];

$discount_enable=false;

if($inv_name=='AKAKI TRADING'){

	$discount_enable=false;

}

if($inv_name=='AKAKI HOMES'){

	$discount_enable=true;

}

//echo 'dis_enable:'.$discount_enable;

$cr_limit_name='';

if($sale_rtn_details['cr_interest']){

//get unit cr limit name

$ref_cr_lmt=new Common_Model(); 

$cr_limit_des=$ref_cr_lmt->get_cr_limit_name_by_val($sale_rtn_details['cr_interest']);

//print_r($cr_limit_des);

$cr_limit_name=$cr_limit_des[0]['cr_limit_name'];

}

?>



<body onLoad="window.print()">



     <?php $this->load->view("common/report_header.php"); ?>

  <div class="row">

  <p class="text-center" style="font-size:14px; margin-top:10px;"><strong>SALES RETURN</strong> </p>

  <div class="col-xs-12">

<div class="col-xs-6">



<p><strong>Customer Code: <?php echo $customer_details['cus_code']; ?></strong></p>

<p><strong>Name : <?php echo $customer_details['cus_name']; ?> </strong><?php //echo $customer_details['cus_address']; ?>  <?php //echo $customer_details['cus_phone']; ?></p>



</div>

<div class="col-xs-6 pull-right">

<p>Reg No.: WF 13085 </p>

<p>Sales Terms: <?php echo $sale_rtn_details['in_type']; ?> <?php if($cr_limit_name) echo "($cr_limit_name)" ?></p>

<p>Date: <?php echo display_date_time_format($sale_rtn_details['sl_rtn_datetime']); ?></p>

<p>Invoice No: <?php echo $sale_rtn_details['sl_rtn_reference_no']; ?> &nbsp;&nbsp;&nbsp; (<?php echo $inv_user_name;?>)</p>



</div>

</div>

</div>



<div class="print-start">





  



<table class="print-table" width="100%" style="border:1px solid #000">

<thead>

<tr class="report_view_th text-center">

<th class="col-xs-1" width="20px" style="border:1px solid #000">No</th>

<th class="col-xs-7" style="border:1px solid #000">Description</th>

<th class="7" style="border:1px solid #000">Quantity</th>

<th class="col-xs-1" style="border:1px solid #000">Price</th>

<?php if($discount_enable){ ?><th class="col-xs-1" style="border:1px solid #000">Discount</th> <?php }?>

<th class="col-xs-2" align="center" style="border:1px solid #000">Subtotal</th>

</tr>

</thead>

<tbody>

 <?php 

 $tmpcount=0;

 $tot_qty=0;

  foreach ($sale_rtn_item_list as $row)

 {

	 $tmpcount++;

	 $tot_qty=$row['quantity'];

 ?>  

<tr>

<td style="text-align:center; width:40px; vertical-align:middle; border:1px solid #000"><?php echo $tmpcount ?></td>

<td style="vertical-align:middle; border:1px solid #000">

  <?php echo $row['product_name']; ?> </td>

<td style="width: 80px; text-align:center; vertical-align:middle; border:1px solid #000"><?php echo number_format($row['quantity'], 0, '.', ','); ?>



</td>

<td style="text-align:right; width:100px; border:1px solid #000"><?php echo number_format($row['unit_price'], 2, '.', ','); ?></td>

<?php if($discount_enable){ ?>

<td style="width: 100px; text-align:right; vertical-align:middle; border:1px solid #000"> (<?php echo $row['discount'] ?>) <?php echo number_format($row['discount_val'], 2, '.', ',') ?></td> <?php }?><td style="text-align:right; width:120px; border:1px solid #000"><?php echo $row['gross_total']; ?></td>

</tr>

<?php }?>



<!--<?php if ($sale_rtn_details['sl_rtn_inv_discount']){ ?>

<tr>

  <td style="text-align:right; padding-right:10px; border:1px solid #000" colspan="6">Order Discount</td>

  <td style="text-align:right; padding-right:10px;  border:1px solid #000"><?php echo number_format($sale_rtn_details['sl_rtn_inv_discount'], 2, '.', ',') ?></td>

</tr>

<?php }?>-->







</tbody>

</table>

</div>



 <div class="row">

 <br>

 &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;No. Items (<?php echo $tmpcount ?>), 

 Total Qty (<?php echo rtrim(str_replace('.00', '', number_format($tot_qty, 2)), '0'); ?>)

<div class="col-xs-12">

 <div class="col-xs-5 pull-right" id="border_print" style="border:1px solid #000;">

 <table width="100%" border="0">

 

   <tr>

    <td><strong style="font-size:14px;">Sub Total RS</strong></td>

    <td style="text-align:right"><strong style="font-size:14px;"><?php echo number_format($sale_rtn_details['sl_rtn_total']-$sale_rtn_details['cr_interest_amt']+$sale_rtn_details['sl_rtn_inv_discount_amount'], 2, '.', ',') ?></strong></td>

  </tr>

   <?php if ($sale_rtn_details['sl_rtn_inv_discount']){ ?>

<tr>

  <td>Order Discount(<?php echo $sale_rtn_details['sl_rtn_inv_discount'] ?>)</td>

  <td style="text-align:right;"><?php echo number_format($sale_rtn_details['sl_rtn_inv_discount_amount'], 2, '.', ',') ?></td>

</tr>

<tr>

  <td>After Discount Sub Total RS</td>

  <td style="text-align:right;"><?php echo number_format($sale_rtn_details['sl_rtn_total']-$sale_rtn_details['cr_interest_amt'], 2, '.', ',') ?></td>

</tr>



<?php }?>

<tr>

    <td>Credit Sur Charge RS(<?php echo $sale_rtn_details['cr_interest'] ?>%)</td>

    <td style="text-align:right"><?php echo number_format($sale_rtn_details['cr_interest_amt'], 2, '.', ',') ?></td>

  </tr>

  <tr>

    <td><strong style="font-size:14px;">Grand Total</strong></td>

    <td style="text-align:right"><strong style="font-size:14px;"><?php echo number_format($sale_rtn_details['sl_rtn_total'], 2, '.', ',') ?></strong></td>

  </tr>



</table>

</div>



    <div class="col-xs-6" id="border_print" style="border:1px solid #000;">

 <p class="text-center"><strong>1</strong> Year Warranty for Electrical & Electronic Items <strong>6</strong> month warranty for Lantern/torch No Warrant for physical Damage.

   <strong>3</strong> Years Warranty for TV. </p>

 </div>



</div><!--col-xs-12-->









<div class="col-xs-12">

 <p class="text-center" style="font-size:17px;"><br>



<strong>Thank You! Come Again!</strong></p>

 </div>

</div>









</body>







