<?php

/* $Id: SelectCustomer.php 7133 2015-02-07 03:23:51Z daintree $*/

include('includes/session.inc');
$Title = _('Retail Shop All Transactions Reports');
include('includes/header.inc');
include('includes/SQL_CommonFunctions.inc');
echo '<link href="' . $RootPath . '/css/evergreen2'.'/default.css" rel="stylesheet" type="text/css" media="screen"/>';

 
	echo '<div class="col-sm-9">';
		//echo '<div class="aflpanel" style="margin-bottom:10px">';
		
    include('xcrud/xcrud.php');
    $xcrud = Xcrud::get_instance();
    $xcrud->table('sales_retailshops');
    
	$xcrud->table_name('Nausori Retail Shop  Counter transactions');
	
	$xcrud->order_by('sale_id','desc');
$xcrud->unset_add();
$xcrud->unset_remove();
$xcrud->unset_edit();
$xcrud->show_primary_ai_column(true);
    $shoptrans = $xcrud->nested_table('shopdetails','sale_id','salesitems_retailshops','sale_id'); // 2nd level
	
	//$projectcosting->unset_numbers();
	$shoptrans->table_name('Line items');
	$shoptrans->unset_add();
$shoptrans->unset_remove();
$shoptrans->unset_edit();


$xcrud->column_pattern('sale_id', '<a href="#" class="xcrud-action" data-task="view" data-primary="{sale_id}">{value}</a>');
$xcrud->relation('loccode','locations','loccode',array('loccode','locationname'));
$shoptrans->relation('item_id','stockmaster','stockid',array('stockid','description'));
$shoptrans->fields('description,loccode,counter',true);
$shoptrans->columns('description,loccode,counter',true);
    echo $xcrud->render();
	
	

echo '</div>';
echo '</div>';

include('includes/footer.inc'); 

?>