<?php
$tdatapurchasing_summary = array();
$tdatapurchasing_summary[".searchableFields"] = array();
$tdatapurchasing_summary[".ShortName"] = "purchasing_summary";
$tdatapurchasing_summary[".OwnerID"] = "outlet_code";
$tdatapurchasing_summary[".OriginalTable"] = "purchasing_details";


$tdatapurchasing_summary[".pagesByType"] = my_json_decode( "{\"export\":[\"export\"],\"list\":[\"list\",\"list_add\",\"list_add2\",\"list_list\",\"list_view\"],\"print\":[\"print\"],\"search\":[\"search\"],\"view\":[\"view\"]}" );
$tdatapurchasing_summary[".originalPagesByType"] = $tdatapurchasing_summary[".pagesByType"];
$tdatapurchasing_summary[".pages"] = types2pages( my_json_decode( "{\"export\":[\"export\"],\"list\":[\"list\",\"list_add\",\"list_add2\",\"list_list\",\"list_view\"],\"print\":[\"print\"],\"search\":[\"search\"],\"view\":[\"view\"]}" ) );
$tdatapurchasing_summary[".originalPages"] = $tdatapurchasing_summary[".pages"];
$tdatapurchasing_summary[".defaultPages"] = my_json_decode( "{\"export\":\"export\",\"list\":\"list\",\"print\":\"print\",\"search\":\"search\",\"view\":\"view\"}" );
$tdatapurchasing_summary[".originalDefaultPages"] = $tdatapurchasing_summary[".defaultPages"];

//	field labels
$fieldLabelspurchasing_summary = array();
$fieldToolTipspurchasing_summary = array();
$pageTitlespurchasing_summary = array();
$placeHolderspurchasing_summary = array();

if(mlang_getcurrentlang()=="English")
{
	$fieldLabelspurchasing_summary["English"] = array();
	$fieldToolTipspurchasing_summary["English"] = array();
	$placeHolderspurchasing_summary["English"] = array();
	$pageTitlespurchasing_summary["English"] = array();
	$fieldLabelspurchasing_summary["English"]["bar_code"] = "Bar Code";
	$fieldToolTipspurchasing_summary["English"]["bar_code"] = "";
	$placeHolderspurchasing_summary["English"]["bar_code"] = "";
	$fieldLabelspurchasing_summary["English"]["unit"] = "Unit";
	$fieldToolTipspurchasing_summary["English"]["unit"] = "";
	$placeHolderspurchasing_summary["English"]["unit"] = "";
	$fieldLabelspurchasing_summary["English"]["gross"] = "Gross";
	$fieldToolTipspurchasing_summary["English"]["gross"] = "";
	$placeHolderspurchasing_summary["English"]["gross"] = "";
	$fieldLabelspurchasing_summary["English"]["price"] = "Price";
	$fieldToolTipspurchasing_summary["English"]["price"] = "";
	$placeHolderspurchasing_summary["English"]["price"] = "";
	$fieldLabelspurchasing_summary["English"]["net"] = "Net";
	$fieldToolTipspurchasing_summary["English"]["net"] = "";
	$placeHolderspurchasing_summary["English"]["net"] = "";
	$fieldLabelspurchasing_summary["English"]["product"] = "Product";
	$fieldToolTipspurchasing_summary["English"]["product"] = "";
	$placeHolderspurchasing_summary["English"]["product"] = "";
	$fieldLabelspurchasing_summary["English"]["count"] = "Count";
	$fieldToolTipspurchasing_summary["English"]["count"] = "";
	$placeHolderspurchasing_summary["English"]["count"] = "";
	$fieldLabelspurchasing_summary["English"]["Total"] = "Total";
	$fieldToolTipspurchasing_summary["English"]["Total"] = "";
	$placeHolderspurchasing_summary["English"]["Total"] = "";
	$fieldLabelspurchasing_summary["English"]["outlet_code"] = "Outlet Code";
	$fieldToolTipspurchasing_summary["English"]["outlet_code"] = "";
	$placeHolderspurchasing_summary["English"]["outlet_code"] = "";
	$fieldLabelspurchasing_summary["English"]["h"] = "H";
	$fieldToolTipspurchasing_summary["English"]["h"] = "";
	$placeHolderspurchasing_summary["English"]["h"] = "";
	$fieldLabelspurchasing_summary["English"]["f"] = "F";
	$fieldToolTipspurchasing_summary["English"]["f"] = "";
	$placeHolderspurchasing_summary["English"]["f"] = "";
	$fieldLabelspurchasing_summary["English"]["date"] = "Date";
	$fieldToolTipspurchasing_summary["English"]["date"] = "";
	$placeHolderspurchasing_summary["English"]["date"] = "";
	if (count($fieldToolTipspurchasing_summary["English"]))
		$tdatapurchasing_summary[".isUseToolTips"] = true;
}


	$tdatapurchasing_summary[".NCSearch"] = true;



$tdatapurchasing_summary[".shortTableName"] = "purchasing_summary";
$tdatapurchasing_summary[".nSecOptions"] = 1;

$tdatapurchasing_summary[".mainTableOwnerID"] = "outlet_code";
$tdatapurchasing_summary[".entityType"] = 1;
$tdatapurchasing_summary[".connId"] = "test2_at_localhost";


$tdatapurchasing_summary[".strOriginalTableName"] = "purchasing_details";

	



$tdatapurchasing_summary[".showAddInPopup"] = false;

$tdatapurchasing_summary[".showEditInPopup"] = false;

$tdatapurchasing_summary[".showViewInPopup"] = false;

//page's base css files names
$popupPagesLayoutNames = array();
$tdatapurchasing_summary[".popupPagesLayoutNames"] = $popupPagesLayoutNames;


$tdatapurchasing_summary[".listAjax"] = false;
//	temporary
$tdatapurchasing_summary[".listAjax"] = false;

	$tdatapurchasing_summary[".audit"] = true;

	$tdatapurchasing_summary[".locking"] = false;


$pages = $tdatapurchasing_summary[".defaultPages"];

if( $pages[PAGE_EDIT] ) {
	$tdatapurchasing_summary[".edit"] = true;
	$tdatapurchasing_summary[".afterEditAction"] = 1;
	$tdatapurchasing_summary[".closePopupAfterEdit"] = 1;
	$tdatapurchasing_summary[".afterEditActionDetTable"] = "";
}

if( $pages[PAGE_ADD] ) {
$tdatapurchasing_summary[".add"] = true;
$tdatapurchasing_summary[".afterAddAction"] = 1;
$tdatapurchasing_summary[".closePopupAfterAdd"] = 1;
$tdatapurchasing_summary[".afterAddActionDetTable"] = "";
}

if( $pages[PAGE_LIST] ) {
	$tdatapurchasing_summary[".list"] = true;
}



$tdatapurchasing_summary[".strSortControlSettingsJSON"] = "";




if( $pages[PAGE_VIEW] ) {
$tdatapurchasing_summary[".view"] = true;
}

if( $pages[PAGE_IMPORT] ) {
$tdatapurchasing_summary[".import"] = true;
}

if( $pages[PAGE_EXPORT] ) {
$tdatapurchasing_summary[".exportTo"] = true;
}

if( $pages[PAGE_PRINT] ) {
$tdatapurchasing_summary[".printFriendly"] = true;
}



$tdatapurchasing_summary[".showSimpleSearchOptions"] = true; // temp fix #13449

// Allow Show/Hide Fields in GRID
$tdatapurchasing_summary[".allowShowHideFields"] = true; // temp fix #13449
//

// Allow Fields Reordering in GRID
$tdatapurchasing_summary[".allowFieldsReordering"] = true; // temp fix #13449
//

$tdatapurchasing_summary[".isUseAjaxSuggest"] = true;

$tdatapurchasing_summary[".rowHighlite"] = true;



																																																																																																						

$tdatapurchasing_summary[".ajaxCodeSnippetAdded"] = false;

$tdatapurchasing_summary[".buttonsAdded"] = false;

$tdatapurchasing_summary[".addPageEvents"] = false;

// use timepicker for search panel
$tdatapurchasing_summary[".isUseTimeForSearch"] = false;


$tdatapurchasing_summary[".badgeColor"] = "8fbc8b";


$tdatapurchasing_summary[".allSearchFields"] = array();
$tdatapurchasing_summary[".filterFields"] = array();
$tdatapurchasing_summary[".requiredSearchFields"] = array();

$tdatapurchasing_summary[".googleLikeFields"] = array();
$tdatapurchasing_summary[".googleLikeFields"][] = "count";
$tdatapurchasing_summary[".googleLikeFields"][] = "bar_code";
$tdatapurchasing_summary[".googleLikeFields"][] = "unit";
$tdatapurchasing_summary[".googleLikeFields"][] = "price";
$tdatapurchasing_summary[".googleLikeFields"][] = "net";
$tdatapurchasing_summary[".googleLikeFields"][] = "Total";
$tdatapurchasing_summary[".googleLikeFields"][] = "product";
$tdatapurchasing_summary[".googleLikeFields"][] = "date";
$tdatapurchasing_summary[".googleLikeFields"][] = "outlet_code";
$tdatapurchasing_summary[".googleLikeFields"][] = "h";
$tdatapurchasing_summary[".googleLikeFields"][] = "f";
$tdatapurchasing_summary[".googleLikeFields"][] = "gross";



$tdatapurchasing_summary[".tableType"] = "list";

$tdatapurchasing_summary[".printerPageOrientation"] = 0;
$tdatapurchasing_summary[".nPrinterPageScale"] = 100;

$tdatapurchasing_summary[".nPrinterSplitRecords"] = 40;

$tdatapurchasing_summary[".geocodingEnabled"] = false;










$tdatapurchasing_summary[".pageSize"] = 20;

$tdatapurchasing_summary[".warnLeavingPages"] = true;



$tstrOrderBy = "";
if(strlen($tstrOrderBy) && strtolower(substr($tstrOrderBy,0,8))!="order by")
	$tstrOrderBy = "order by ".$tstrOrderBy;
$tdatapurchasing_summary[".strOrderBy"] = $tstrOrderBy;

$tdatapurchasing_summary[".orderindexes"] = array();


$tdatapurchasing_summary[".sqlHead"] = "SELECT COUNT(purchasing_details.id) as count,    purchasing_details.bar_code,    purchasing_details.unit,    AVG(purchasing_details.price) as price,    SUM(purchasing_details.net) as net,    SUM(purchasing_details.sub_total) as Total,    purchasing_details.product,    DATE(purchasing.date_and_time) as \"date\",    purchasing.outlet_code,    purchasing.h,    purchasing.f,    SUM(purchasing_details.gross) as gross";
$tdatapurchasing_summary[".sqlFrom"] = "FROM purchasing_details  INNER JOIN purchasing ON purchasing_details.pur_id = purchasing.id";
$tdatapurchasing_summary[".sqlWhereExpr"] = "purchasing_details.details = \"Purchasing\" and purchasing.f = 0";
$tdatapurchasing_summary[".sqlTail"] = "";

//fill array of tabs for list page
$arrGridTabs = array();
$arrGridTabs[] = array(
	'tabId' => "Pitabeddara",
	'name' => "All data",
	'nameType' => 'Text',
	'where' => "",
	'showRowCount' => 1,
	'hideEmpty' => 1,
);
$arrGridTabs[] = array(
	'tabId' => "Pitabeddara1",
	'name' => "Pitabeddara",
	'nameType' => 'Text',
	'where' => "purchasing.outlet_code = 1",
	'showRowCount' => 1,
	'hideEmpty' => 1,
);
$arrGridTabs[] = array(
	'tabId' => "Neluwa",
	'name' => "Neluwa",
	'nameType' => 'Text',
	'where' => "purchasing.outlet_code = 2",
	'showRowCount' => 1,
	'hideEmpty' => 1,
);
$arrGridTabs[] = array(
	'tabId' => "Opatha",
	'name' => "Opatha",
	'nameType' => 'Text',
	'where' => "purchasing.outlet_code = 3",
	'showRowCount' => 1,
	'hideEmpty' => 1,
);
$arrGridTabs[] = array(
	'tabId' => "1111al",
	'name' => "4",
	'nameType' => 'Text',
	'where' => "purchasing.outlet_code = 4",
	'showRowCount' => 1,
	'hideEmpty' => 1,
);
$arrGridTabs[] = array(
	'tabId' => "1111c4",
	'name' => "5",
	'nameType' => 'Text',
	'where' => "purchasing.outlet_code =5",
	'showRowCount' => 1,
	'hideEmpty' => 1,
);
$arrGridTabs[] = array(
	'tabId' => "1111k2",
	'name' => "6",
	'nameType' => 'Text',
	'where' => "purchasing.outlet_code = 6",
	'showRowCount' => 1,
	'hideEmpty' => 1,
);
$arrGridTabs[] = array(
	'tabId' => "1111pu2",
	'name' => "7",
	'nameType' => 'Text',
	'where' => "purchasing.outlet_code = 7",
	'showRowCount' => 1,
	'hideEmpty' => 1,
);
$tdatapurchasing_summary[".arrGridTabs"] = $arrGridTabs;









//fill array of records per page for list and report without group fields
$arrRPP = array();
$arrRPP[] = 10;
$arrRPP[] = 20;
$arrRPP[] = 30;
$arrRPP[] = 50;
$arrRPP[] = 100;
$arrRPP[] = 500;
$arrRPP[] = -1;
$tdatapurchasing_summary[".arrRecsPerPage"] = $arrRPP;

//fill array of groups per page for report with group fields
$arrGPP = array();
$arrGPP[] = 1;
$arrGPP[] = 3;
$arrGPP[] = 5;
$arrGPP[] = 10;
$arrGPP[] = 50;
$arrGPP[] = 100;
$arrGPP[] = -1;
$tdatapurchasing_summary[".arrGroupsPerPage"] = $arrGPP;

$tdatapurchasing_summary[".highlightSearchResults"] = true;

$tableKeyspurchasing_summary = array();
$tableKeyspurchasing_summary[] = "bar_code";
$tdatapurchasing_summary[".Keys"] = $tableKeyspurchasing_summary;


$tdatapurchasing_summary[".hideMobileList"] = array();




//	count
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 1;
	$fdata["strName"] = "count";
	$fdata["GoodName"] = "count";
	$fdata["ownerTable"] = "";
	$fdata["Label"] = GetFieldLabel("purchasing_summary","count");
	$fdata["FieldType"] = 3;

	
	
	
			

		$fdata["strField"] = "count";

	
		$fdata["isSQLExpression"] = true;
	$fdata["FullName"] = "COUNT(purchasing_details.id)";

	
	
				$fdata["UploadFolder"] = "files";

//  Begin View Formats
	$fdata["ViewFormats"] = array();

	$vdata = array("ViewFormat" => "");

	
	
	
	
	
	
	
	
	
	
	
		
	
		$vdata["NeedEncode"] = true;

	
		$vdata["truncateText"] = true;
	$vdata["NumberOfChars"] = 80;

	$fdata["ViewFormats"]["view"] = $vdata;
//  End View Formats

//	Begin Edit Formats
	$fdata["EditFormats"] = array();

	$edata = array("EditFormat" => "Text field");

	
		$edata["weekdayMessage"] = array("message" => "", "messageType" => "Text");
	$edata["weekdays"] = "[]";


	
	



		$edata["IsRequired"] = true;

	
	
	
			$edata["acceptFileTypes"] = ".+$";
		$edata["acceptFileTypesHtml"] = "";

		$edata["maxNumberOfFiles"] = 1;

	
	
	
	
			$edata["HTML5InuptType"] = "text";

		$edata["EditParams"] = "";
		
		$edata["controlWidth"] = 200;

//	Begin validation
	$edata["validateAs"] = array();
	$edata["validateAs"]["basicValidate"] = array();
	$edata["validateAs"]["customMessages"] = array();
				$edata["validateAs"]["basicValidate"][] = getJsValidatorName("Number");
						$edata["validateAs"]["basicValidate"][] = "IsRequired";
		
	
	//	End validation

	
			
	
	
	
	$fdata["EditFormats"]["edit"] = $edata;
//	End Edit Formats


	$fdata["isSeparate"] = false;




// the field's search options settings
		$fdata["defaultSearchOption"] = "Contains";

			// the default search options list
				$fdata["searchOptionsList"] = array("Contains", "Equals", "Starts with", "More than", "Less than", "Between", "Empty", NOT_EMPTY);
// the end of search options settings


//Filters settings
	$fdata["filterTotals"] = 0;
		$fdata["filterMultiSelect"] = 0;
			$fdata["filterFormat"] = "Values list";
		$fdata["showCollapsed"] = false;

		$fdata["sortValueType"] = 0;
		$fdata["numberOfVisibleItems"] = 10;

		$fdata["filterBy"] = 0;

	

	
	
//end of Filters settings


	$tdatapurchasing_summary["count"] = $fdata;
		$tdatapurchasing_summary[".searchableFields"][] = "count";
//	bar_code
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 2;
	$fdata["strName"] = "bar_code";
	$fdata["GoodName"] = "bar_code";
	$fdata["ownerTable"] = "purchasing_details";
	$fdata["Label"] = GetFieldLabel("purchasing_summary","bar_code");
	$fdata["FieldType"] = 200;

	
	
	
			

		$fdata["strField"] = "bar_code";

	
		$fdata["isSQLExpression"] = true;
	$fdata["FullName"] = "purchasing_details.bar_code";

	
	
				$fdata["UploadFolder"] = "files";

//  Begin View Formats
	$fdata["ViewFormats"] = array();

	$vdata = array("ViewFormat" => "");

	
	
	
	
	
	
	
	
	
	
	
		
	
		$vdata["NeedEncode"] = true;

	
		$vdata["truncateText"] = true;
	$vdata["NumberOfChars"] = 80;

	$fdata["ViewFormats"]["view"] = $vdata;
//  End View Formats

//	Begin Edit Formats
	$fdata["EditFormats"] = array();

	$edata = array("EditFormat" => "Lookup wizard");

	
		$edata["weekdayMessage"] = array("message" => "", "messageType" => "Text");
	$edata["weekdays"] = "[]";


	
	

// Begin Lookup settings
				$edata["LookupType"] = 2;
	$edata["LookupTable"] = "product";
			$edata["autoCompleteFieldsOnEdit"] = 1;
	$edata["autoCompleteFields"] = array();
		$edata["autoCompleteFields"][] = array('masterF'=>"unit", 'lookupF'=>"unit");
	$edata["autoCompleteFields"][] = array('masterF'=>"product", 'lookupF'=>"product_name");
	$edata["LCType"] = 1;

	
		
	$edata["LinkField"] = "bar_code";
	$edata["LinkFieldType"] = 0;
	$edata["DisplayField"] = "bar_code";

	

	
	$edata["LookupOrderBy"] = "bar_code";

	
	
		$edata["AllowToAdd"] = true;
			$edata["addPageId"] = "add";

	

	
	
	
// End Lookup Settings


		$edata["IsRequired"] = true;

	
	
	
			$edata["acceptFileTypes"] = ".+$";
		$edata["acceptFileTypesHtml"] = "";

		$edata["maxNumberOfFiles"] = 1;

	
	
	
	
	
	
		$edata["controlWidth"] = 200;

//	Begin validation
	$edata["validateAs"] = array();
	$edata["validateAs"]["basicValidate"] = array();
	$edata["validateAs"]["customMessages"] = array();
						$edata["validateAs"]["basicValidate"][] = "IsRequired";
		
	
	//	End validation

	
			
	
	
	
	$fdata["EditFormats"]["edit"] = $edata;
//	End Edit Formats


	$fdata["isSeparate"] = false;




// the field's search options settings
		$fdata["defaultSearchOption"] = "Equals";

			// the default search options list
				$fdata["searchOptionsList"] = array("Contains", "Equals", "Starts with", "More than", "Less than", "Between", "Empty", NOT_EMPTY);
// the end of search options settings


//Filters settings
	$fdata["filterTotals"] = 0;
		$fdata["filterMultiSelect"] = 0;
			$fdata["filterFormat"] = "Values list";
		$fdata["showCollapsed"] = false;

		$fdata["sortValueType"] = 0;
		$fdata["numberOfVisibleItems"] = 10;

		$fdata["filterBy"] = 0;

	

	
	
//end of Filters settings


	$tdatapurchasing_summary["bar_code"] = $fdata;
		$tdatapurchasing_summary[".searchableFields"][] = "bar_code";
//	unit
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 3;
	$fdata["strName"] = "unit";
	$fdata["GoodName"] = "unit";
	$fdata["ownerTable"] = "purchasing_details";
	$fdata["Label"] = GetFieldLabel("purchasing_summary","unit");
	$fdata["FieldType"] = 200;

	
	
	
			

		$fdata["strField"] = "unit";

	
		$fdata["isSQLExpression"] = true;
	$fdata["FullName"] = "purchasing_details.unit";

	
	
				$fdata["UploadFolder"] = "files";

//  Begin View Formats
	$fdata["ViewFormats"] = array();

	$vdata = array("ViewFormat" => "");

	
	
	
	
	
	
	
	
	
	
	
		
	
		$vdata["NeedEncode"] = true;

	
		$vdata["truncateText"] = true;
	$vdata["NumberOfChars"] = 80;

	$fdata["ViewFormats"]["view"] = $vdata;
//  End View Formats

//	Begin Edit Formats
	$fdata["EditFormats"] = array();

	$edata = array("EditFormat" => "Readonly");

	
		$edata["weekdayMessage"] = array("message" => "", "messageType" => "Text");
	$edata["weekdays"] = "[]";


	
	



	
	
	
	
			$edata["acceptFileTypes"] = ".+$";
		$edata["acceptFileTypesHtml"] = "";

		$edata["maxNumberOfFiles"] = 1;

	
	
	
	
	
	
		$edata["controlWidth"] = 200;

//	Begin validation
	$edata["validateAs"] = array();
	$edata["validateAs"]["basicValidate"] = array();
	$edata["validateAs"]["customMessages"] = array();
	
	
	//	End validation

	
			
	
	
	
	$fdata["EditFormats"]["edit"] = $edata;
//	End Edit Formats


	$fdata["isSeparate"] = false;




// the field's search options settings
		$fdata["defaultSearchOption"] = "Contains";

			// the default search options list
				$fdata["searchOptionsList"] = array("Contains", "Equals", "Starts with", "More than", "Less than", "Between", "Empty", NOT_EMPTY);
// the end of search options settings


//Filters settings
	$fdata["filterTotals"] = 0;
		$fdata["filterMultiSelect"] = 0;
			$fdata["filterFormat"] = "Values list";
		$fdata["showCollapsed"] = false;

		$fdata["sortValueType"] = 0;
		$fdata["numberOfVisibleItems"] = 10;

		$fdata["filterBy"] = 0;

	

	
	
//end of Filters settings


	$tdatapurchasing_summary["unit"] = $fdata;
		$tdatapurchasing_summary[".searchableFields"][] = "unit";
//	price
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 4;
	$fdata["strName"] = "price";
	$fdata["GoodName"] = "price";
	$fdata["ownerTable"] = "";
	$fdata["Label"] = GetFieldLabel("purchasing_summary","price");
	$fdata["FieldType"] = 14;

	
	
	
			

		$fdata["strField"] = "price";

	
		$fdata["isSQLExpression"] = true;
	$fdata["FullName"] = "AVG(purchasing_details.price)";

	
	
				$fdata["UploadFolder"] = "files";

//  Begin View Formats
	$fdata["ViewFormats"] = array();

	$vdata = array("ViewFormat" => "Number");

	
	
	
	
	
	
		$vdata["DecimalDigits"] = 2;

	
	
	
	
		
	
		$vdata["NeedEncode"] = true;

	
		$vdata["truncateText"] = true;
	$vdata["NumberOfChars"] = 80;

	$fdata["ViewFormats"]["view"] = $vdata;
//  End View Formats

//	Begin Edit Formats
	$fdata["EditFormats"] = array();

	$edata = array("EditFormat" => "Text field");

	
		$edata["weekdayMessage"] = array("message" => "", "messageType" => "Text");
	$edata["weekdays"] = "[]";


	
	



	
	
	
	
			$edata["acceptFileTypes"] = ".+$";
		$edata["acceptFileTypesHtml"] = "";

		$edata["maxNumberOfFiles"] = 1;

	
	
	
	
			$edata["HTML5InuptType"] = "text";

		$edata["EditParams"] = "";
		
		$edata["controlWidth"] = 200;

//	Begin validation
	$edata["validateAs"] = array();
	$edata["validateAs"]["basicValidate"] = array();
	$edata["validateAs"]["customMessages"] = array();
				$edata["validateAs"]["basicValidate"][] = getJsValidatorName("Number");
							
	
	//	End validation

	
			
	
	
	
	$fdata["EditFormats"]["edit"] = $edata;
//	End Edit Formats


	$fdata["isSeparate"] = false;




// the field's search options settings
		$fdata["defaultSearchOption"] = "Contains";

			// the default search options list
				$fdata["searchOptionsList"] = array("Contains", "Equals", "Starts with", "More than", "Less than", "Between", "Empty", NOT_EMPTY);
// the end of search options settings


//Filters settings
	$fdata["filterTotals"] = 0;
		$fdata["filterMultiSelect"] = 0;
			$fdata["filterFormat"] = "Values list";
		$fdata["showCollapsed"] = false;

		$fdata["sortValueType"] = 0;
		$fdata["numberOfVisibleItems"] = 10;

		$fdata["filterBy"] = 0;

	

	
	
//end of Filters settings


	$tdatapurchasing_summary["price"] = $fdata;
		$tdatapurchasing_summary[".searchableFields"][] = "price";
//	net
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 5;
	$fdata["strName"] = "net";
	$fdata["GoodName"] = "net";
	$fdata["ownerTable"] = "";
	$fdata["Label"] = GetFieldLabel("purchasing_summary","net");
	$fdata["FieldType"] = 14;

	
	
	
			

		$fdata["strField"] = "net";

	
		$fdata["isSQLExpression"] = true;
	$fdata["FullName"] = "SUM(purchasing_details.net)";

	
	
				$fdata["UploadFolder"] = "files";

//  Begin View Formats
	$fdata["ViewFormats"] = array();

	$vdata = array("ViewFormat" => "Number");

	
	
	
	
	
	
		$vdata["DecimalDigits"] = 2;

	
	
	
	
		
	
		$vdata["NeedEncode"] = true;

	
		$vdata["truncateText"] = true;
	$vdata["NumberOfChars"] = 80;

	$fdata["ViewFormats"]["view"] = $vdata;
//  End View Formats

//	Begin Edit Formats
	$fdata["EditFormats"] = array();

	$edata = array("EditFormat" => "Readonly");

	
		$edata["weekdayMessage"] = array("message" => "", "messageType" => "Text");
	$edata["weekdays"] = "[]";


	
	



	
	
	
	
			$edata["acceptFileTypes"] = ".+$";
		$edata["acceptFileTypesHtml"] = "";

		$edata["maxNumberOfFiles"] = 1;

	
	
	
	
	
	
		$edata["controlWidth"] = 200;

//	Begin validation
	$edata["validateAs"] = array();
	$edata["validateAs"]["basicValidate"] = array();
	$edata["validateAs"]["customMessages"] = array();
							
		$edata["autoUpdatable"] = true;

	//	End validation

	
			
	
	
	
	$fdata["EditFormats"]["edit"] = $edata;
//	End Edit Formats


	$fdata["isSeparate"] = false;




// the field's search options settings
		$fdata["defaultSearchOption"] = "Contains";

			// the default search options list
				$fdata["searchOptionsList"] = array("Contains", "Equals", "Starts with", "More than", "Less than", "Between", "Empty", NOT_EMPTY);
// the end of search options settings


//Filters settings
	$fdata["filterTotals"] = 0;
		$fdata["filterMultiSelect"] = 0;
			$fdata["filterFormat"] = "Values list";
		$fdata["showCollapsed"] = false;

		$fdata["sortValueType"] = 0;
		$fdata["numberOfVisibleItems"] = 10;

		$fdata["filterBy"] = 0;

	

	
	
//end of Filters settings


	$tdatapurchasing_summary["net"] = $fdata;
		$tdatapurchasing_summary[".searchableFields"][] = "net";
//	Total
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 6;
	$fdata["strName"] = "Total";
	$fdata["GoodName"] = "Total";
	$fdata["ownerTable"] = "";
	$fdata["Label"] = GetFieldLabel("purchasing_summary","Total");
	$fdata["FieldType"] = 14;

	
	
	
			

		$fdata["strField"] = "Total";

	
		$fdata["isSQLExpression"] = true;
	$fdata["FullName"] = "SUM(purchasing_details.sub_total)";

	
	
				$fdata["UploadFolder"] = "files";

//  Begin View Formats
	$fdata["ViewFormats"] = array();

	$vdata = array("ViewFormat" => "Number");

	
	
	
	
	
	
		$vdata["DecimalDigits"] = 2;

	
	
	
	
		
	
		$vdata["NeedEncode"] = true;

	
		$vdata["truncateText"] = true;
	$vdata["NumberOfChars"] = 80;

	$fdata["ViewFormats"]["view"] = $vdata;
//  End View Formats

//	Begin Edit Formats
	$fdata["EditFormats"] = array();

	$edata = array("EditFormat" => "Text field");

	
		$edata["weekdayMessage"] = array("message" => "", "messageType" => "Text");
	$edata["weekdays"] = "[]";


	
	



		$edata["IsRequired"] = true;

	
	
	
			$edata["acceptFileTypes"] = ".+$";
		$edata["acceptFileTypesHtml"] = "";

		$edata["maxNumberOfFiles"] = 1;

	
	
	
	
			$edata["HTML5InuptType"] = "text";

		$edata["EditParams"] = "";
		
		$edata["controlWidth"] = 200;

//	Begin validation
	$edata["validateAs"] = array();
	$edata["validateAs"]["basicValidate"] = array();
	$edata["validateAs"]["customMessages"] = array();
				$edata["validateAs"]["basicValidate"][] = getJsValidatorName("Number");
						$edata["validateAs"]["basicValidate"][] = "IsRequired";
		
	
	//	End validation

	
			
	
	
	
	$fdata["EditFormats"]["edit"] = $edata;
//	End Edit Formats


	$fdata["isSeparate"] = false;




// the field's search options settings
		$fdata["defaultSearchOption"] = "Contains";

			// the default search options list
				$fdata["searchOptionsList"] = array("Contains", "Equals", "Starts with", "More than", "Less than", "Between", "Empty", NOT_EMPTY);
// the end of search options settings


//Filters settings
	$fdata["filterTotals"] = 0;
		$fdata["filterMultiSelect"] = 0;
			$fdata["filterFormat"] = "Values list";
		$fdata["showCollapsed"] = false;

		$fdata["sortValueType"] = 0;
		$fdata["numberOfVisibleItems"] = 10;

		$fdata["filterBy"] = 0;

	

	
	
//end of Filters settings


	$tdatapurchasing_summary["Total"] = $fdata;
		$tdatapurchasing_summary[".searchableFields"][] = "Total";
//	product
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 7;
	$fdata["strName"] = "product";
	$fdata["GoodName"] = "product";
	$fdata["ownerTable"] = "purchasing_details";
	$fdata["Label"] = GetFieldLabel("purchasing_summary","product");
	$fdata["FieldType"] = 200;

	
	
	
			

		$fdata["strField"] = "product";

	
		$fdata["isSQLExpression"] = true;
	$fdata["FullName"] = "purchasing_details.product";

	
	
				$fdata["UploadFolder"] = "files";

//  Begin View Formats
	$fdata["ViewFormats"] = array();

	$vdata = array("ViewFormat" => "");

	
	
	
	
	
	
	
	
	
	
	
		
	
		$vdata["NeedEncode"] = true;

	
		$vdata["truncateText"] = true;
	$vdata["NumberOfChars"] = 80;

	$fdata["ViewFormats"]["view"] = $vdata;
//  End View Formats

//	Begin Edit Formats
	$fdata["EditFormats"] = array();

	$edata = array("EditFormat" => "Lookup wizard");

	
		$edata["weekdayMessage"] = array("message" => "", "messageType" => "Text");
	$edata["weekdays"] = "[]";


	
	

// Begin Lookup settings
				$edata["LookupType"] = 2;
	$edata["LookupTable"] = "product";
			$edata["autoCompleteFieldsOnEdit"] = 1;
	$edata["autoCompleteFields"] = array();
		$edata["autoCompleteFields"][] = array('masterF'=>"bar_code", 'lookupF'=>"bar_code");
	$edata["autoCompleteFields"][] = array('masterF'=>"unit", 'lookupF'=>"unit");
	$edata["LCType"] = 0;

	
		
	$edata["LinkField"] = "product_name";
	$edata["LinkFieldType"] = 0;
	$edata["DisplayField"] = "product_name";

	

	
	$edata["LookupOrderBy"] = "id";

	
	
	
	

	
	
		$edata["SelectSize"] = 1;

// End Lookup Settings


		$edata["IsRequired"] = true;

	
	
	
			$edata["acceptFileTypes"] = ".+$";
		$edata["acceptFileTypesHtml"] = "";

		$edata["maxNumberOfFiles"] = 1;

	
	
	
	
	
	
		$edata["controlWidth"] = 200;

//	Begin validation
	$edata["validateAs"] = array();
	$edata["validateAs"]["basicValidate"] = array();
	$edata["validateAs"]["customMessages"] = array();
						$edata["validateAs"]["basicValidate"][] = "IsRequired";
		
	
	//	End validation

	
			
	
	
	
	$fdata["EditFormats"]["edit"] = $edata;
//	End Edit Formats


	$fdata["isSeparate"] = false;




// the field's search options settings
		$fdata["defaultSearchOption"] = "Equals";

			// the default search options list
				$fdata["searchOptionsList"] = array("Contains", "Equals", "Starts with", "More than", "Less than", "Between", "Empty", NOT_EMPTY);
// the end of search options settings


//Filters settings
	$fdata["filterTotals"] = 0;
		$fdata["filterMultiSelect"] = 0;
			$fdata["filterFormat"] = "Values list";
		$fdata["showCollapsed"] = false;

		$fdata["sortValueType"] = 0;
		$fdata["numberOfVisibleItems"] = 10;

		$fdata["filterBy"] = 0;

	

	
	
//end of Filters settings


	$tdatapurchasing_summary["product"] = $fdata;
		$tdatapurchasing_summary[".searchableFields"][] = "product";
//	date
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 8;
	$fdata["strName"] = "date";
	$fdata["GoodName"] = "date";
	$fdata["ownerTable"] = "";
	$fdata["Label"] = GetFieldLabel("purchasing_summary","date");
	$fdata["FieldType"] = 7;

	
	
	
			

		$fdata["strField"] = "date";

	
		$fdata["isSQLExpression"] = true;
	$fdata["FullName"] = "DATE(purchasing.date_and_time)";

	
	
				$fdata["UploadFolder"] = "files";

//  Begin View Formats
	$fdata["ViewFormats"] = array();

	$vdata = array("ViewFormat" => "Short Date");

	
	
	
	
	
	
	
	
	
	
	
		
	
		$vdata["NeedEncode"] = true;

	
		$vdata["truncateText"] = true;
	$vdata["NumberOfChars"] = 80;

	$fdata["ViewFormats"]["view"] = $vdata;
//  End View Formats

//	Begin Edit Formats
	$fdata["EditFormats"] = array();

	$edata = array("EditFormat" => "Date");

	
		$edata["weekdayMessage"] = array("message" => "", "messageType" => "Text");
	$edata["weekdays"] = "[]";


	
	



		$edata["IsRequired"] = true;

	
	
	
			$edata["acceptFileTypes"] = ".+$";
		$edata["acceptFileTypesHtml"] = "";

		$edata["maxNumberOfFiles"] = 1;

	
	
		$edata["DateEditType"] = 13;
	$edata["InitialYearFactor"] = 100;
	$edata["LastYearFactor"] = 10;

	
	
	
		$edata["controlWidth"] = 200;

//	Begin validation
	$edata["validateAs"] = array();
	$edata["validateAs"]["basicValidate"] = array();
	$edata["validateAs"]["customMessages"] = array();
						$edata["validateAs"]["basicValidate"][] = "IsRequired";
		
	
	//	End validation

	
			
	
	
	
	$fdata["EditFormats"]["edit"] = $edata;
//	End Edit Formats


	$fdata["isSeparate"] = false;




// the field's search options settings
		$fdata["defaultSearchOption"] = "Equals";

			// the default search options list
				$fdata["searchOptionsList"] = array("Equals", "More than", "Less than", "Between", EMPTY_SEARCH, NOT_EMPTY );
// the end of search options settings


//Filters settings
	$fdata["filterTotals"] = 0;
		$fdata["filterMultiSelect"] = 0;
			$fdata["filterFormat"] = "Values list";
		$fdata["showCollapsed"] = false;

		$fdata["sortValueType"] = 0;
		$fdata["numberOfVisibleItems"] = 10;

		$fdata["filterBy"] = 0;

	

	
	
//end of Filters settings


	$tdatapurchasing_summary["date"] = $fdata;
		$tdatapurchasing_summary[".searchableFields"][] = "date";
//	outlet_code
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 9;
	$fdata["strName"] = "outlet_code";
	$fdata["GoodName"] = "outlet_code";
	$fdata["ownerTable"] = "purchasing";
	$fdata["Label"] = GetFieldLabel("purchasing_summary","outlet_code");
	$fdata["FieldType"] = 3;

	
	
	
			

		$fdata["strField"] = "outlet_code";

	
		$fdata["isSQLExpression"] = true;
	$fdata["FullName"] = "purchasing.outlet_code";

	
	
				$fdata["UploadFolder"] = "files";

//  Begin View Formats
	$fdata["ViewFormats"] = array();

	$vdata = array("ViewFormat" => "");

	
	
	
	
	
	
	
	
	
	
	
		
	
		$vdata["NeedEncode"] = true;

	
		$vdata["truncateText"] = true;
	$vdata["NumberOfChars"] = 80;

	$fdata["ViewFormats"]["view"] = $vdata;
//  End View Formats

//	Begin Edit Formats
	$fdata["EditFormats"] = array();

	$edata = array("EditFormat" => "Lookup wizard");

	
		$edata["weekdayMessage"] = array("message" => "", "messageType" => "Text");
	$edata["weekdays"] = "[]";


	
	

// Begin Lookup settings
				$edata["LookupType"] = 2;
	$edata["LookupTable"] = "company_profile";
			$edata["autoCompleteFieldsOnEdit"] = 0;
	$edata["autoCompleteFields"] = array();
		$edata["LCType"] = 0;

	
		
	$edata["LinkField"] = "id";
	$edata["LinkFieldType"] = 0;
	$edata["DisplayField"] = "country";

	

	
	$edata["LookupOrderBy"] = "";

	
	
	
	

	
	
		$edata["SelectSize"] = 1;

// End Lookup Settings


		$edata["IsRequired"] = true;

	
	
	
			$edata["acceptFileTypes"] = ".+$";
		$edata["acceptFileTypesHtml"] = "";

		$edata["maxNumberOfFiles"] = 1;

	
	
	
	
	
	
		$edata["controlWidth"] = 200;

//	Begin validation
	$edata["validateAs"] = array();
	$edata["validateAs"]["basicValidate"] = array();
	$edata["validateAs"]["customMessages"] = array();
						$edata["validateAs"]["basicValidate"][] = "IsRequired";
		
	
	//	End validation

	
			
	
	
	
	$fdata["EditFormats"]["edit"] = $edata;
//	End Edit Formats


	$fdata["isSeparate"] = false;




// the field's search options settings
		$fdata["defaultSearchOption"] = "Equals";

			// the default search options list
				$fdata["searchOptionsList"] = array("Contains", "Equals", "Starts with", "More than", "Less than", "Between", "Empty", NOT_EMPTY);
// the end of search options settings


//Filters settings
	$fdata["filterTotals"] = 0;
		$fdata["filterMultiSelect"] = 0;
			$fdata["filterFormat"] = "Values list";
		$fdata["showCollapsed"] = false;

		$fdata["sortValueType"] = 0;
		$fdata["numberOfVisibleItems"] = 10;

		$fdata["filterBy"] = 0;

	

	
	
//end of Filters settings


	$tdatapurchasing_summary["outlet_code"] = $fdata;
		$tdatapurchasing_summary[".searchableFields"][] = "outlet_code";
//	h
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 10;
	$fdata["strName"] = "h";
	$fdata["GoodName"] = "h";
	$fdata["ownerTable"] = "purchasing";
	$fdata["Label"] = GetFieldLabel("purchasing_summary","h");
	$fdata["FieldType"] = 3;

	
	
	
			

		$fdata["strField"] = "h";

	
		$fdata["isSQLExpression"] = true;
	$fdata["FullName"] = "purchasing.h";

	
	
				$fdata["UploadFolder"] = "files";

//  Begin View Formats
	$fdata["ViewFormats"] = array();

	$vdata = array("ViewFormat" => "");

	
	
	
	
	
	
	
	
	
	
	
		
	
		$vdata["NeedEncode"] = true;

	
		$vdata["truncateText"] = true;
	$vdata["NumberOfChars"] = 80;

	$fdata["ViewFormats"]["view"] = $vdata;
//  End View Formats

//	Begin Edit Formats
	$fdata["EditFormats"] = array();

	$edata = array("EditFormat" => "Text field");

	
		$edata["weekdayMessage"] = array("message" => "", "messageType" => "Text");
	$edata["weekdays"] = "[]";


	
	



		$edata["IsRequired"] = true;

	
	
	
			$edata["acceptFileTypes"] = ".+$";
		$edata["acceptFileTypesHtml"] = "";

		$edata["maxNumberOfFiles"] = 1;

	
	
	
	
			$edata["HTML5InuptType"] = "text";

		$edata["EditParams"] = "";
		
		$edata["controlWidth"] = 200;

//	Begin validation
	$edata["validateAs"] = array();
	$edata["validateAs"]["basicValidate"] = array();
	$edata["validateAs"]["customMessages"] = array();
				$edata["validateAs"]["basicValidate"][] = getJsValidatorName("Number");
						$edata["validateAs"]["basicValidate"][] = "IsRequired";
		
	
	//	End validation

	
			
	
	
	
	$fdata["EditFormats"]["edit"] = $edata;
//	End Edit Formats


	$fdata["isSeparate"] = false;




// the field's search options settings
		$fdata["defaultSearchOption"] = "Contains";

			// the default search options list
				$fdata["searchOptionsList"] = array("Contains", "Equals", "Starts with", "More than", "Less than", "Between", "Empty", NOT_EMPTY);
// the end of search options settings


//Filters settings
	$fdata["filterTotals"] = 0;
		$fdata["filterMultiSelect"] = 0;
			$fdata["filterFormat"] = "Values list";
		$fdata["showCollapsed"] = false;

		$fdata["sortValueType"] = 0;
		$fdata["numberOfVisibleItems"] = 10;

		$fdata["filterBy"] = 0;

	

	
	
//end of Filters settings


	$tdatapurchasing_summary["h"] = $fdata;
		$tdatapurchasing_summary[".searchableFields"][] = "h";
//	f
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 11;
	$fdata["strName"] = "f";
	$fdata["GoodName"] = "f";
	$fdata["ownerTable"] = "purchasing";
	$fdata["Label"] = GetFieldLabel("purchasing_summary","f");
	$fdata["FieldType"] = 3;

	
	
	
			

		$fdata["strField"] = "f";

	
		$fdata["isSQLExpression"] = true;
	$fdata["FullName"] = "purchasing.f";

	
	
				$fdata["UploadFolder"] = "files";

//  Begin View Formats
	$fdata["ViewFormats"] = array();

	$vdata = array("ViewFormat" => "");

	
	
	
	
	
	
	
	
	
	
	
		
	
		$vdata["NeedEncode"] = true;

	
		$vdata["truncateText"] = true;
	$vdata["NumberOfChars"] = 80;

	$fdata["ViewFormats"]["view"] = $vdata;
//  End View Formats

//	Begin Edit Formats
	$fdata["EditFormats"] = array();

	$edata = array("EditFormat" => "Text field");

	
		$edata["weekdayMessage"] = array("message" => "", "messageType" => "Text");
	$edata["weekdays"] = "[]";


	
	



		$edata["IsRequired"] = true;

	
	
	
			$edata["acceptFileTypes"] = ".+$";
		$edata["acceptFileTypesHtml"] = "";

		$edata["maxNumberOfFiles"] = 1;

	
	
	
	
			$edata["HTML5InuptType"] = "text";

		$edata["EditParams"] = "";
		
		$edata["controlWidth"] = 200;

//	Begin validation
	$edata["validateAs"] = array();
	$edata["validateAs"]["basicValidate"] = array();
	$edata["validateAs"]["customMessages"] = array();
				$edata["validateAs"]["basicValidate"][] = getJsValidatorName("Number");
						$edata["validateAs"]["basicValidate"][] = "IsRequired";
		
	
	//	End validation

	
			
	
	
	
	$fdata["EditFormats"]["edit"] = $edata;
//	End Edit Formats


	$fdata["isSeparate"] = false;




// the field's search options settings
		$fdata["defaultSearchOption"] = "Contains";

			// the default search options list
				$fdata["searchOptionsList"] = array("Contains", "Equals", "Starts with", "More than", "Less than", "Between", "Empty", NOT_EMPTY);
// the end of search options settings


//Filters settings
	$fdata["filterTotals"] = 0;
		$fdata["filterMultiSelect"] = 0;
			$fdata["filterFormat"] = "Values list";
		$fdata["showCollapsed"] = false;

		$fdata["sortValueType"] = 0;
		$fdata["numberOfVisibleItems"] = 10;

		$fdata["filterBy"] = 0;

	

	
	
//end of Filters settings


	$tdatapurchasing_summary["f"] = $fdata;
		$tdatapurchasing_summary[".searchableFields"][] = "f";
//	gross
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 12;
	$fdata["strName"] = "gross";
	$fdata["GoodName"] = "gross";
	$fdata["ownerTable"] = "";
	$fdata["Label"] = GetFieldLabel("purchasing_summary","gross");
	$fdata["FieldType"] = 14;

	
	
	
			

		$fdata["strField"] = "gross";

	
		$fdata["isSQLExpression"] = true;
	$fdata["FullName"] = "SUM(purchasing_details.gross)";

	
	
				$fdata["UploadFolder"] = "files";

//  Begin View Formats
	$fdata["ViewFormats"] = array();

	$vdata = array("ViewFormat" => "Number");

	
	
	
	
	
	
		$vdata["DecimalDigits"] = 2;

	
	
	
	
		
	
		$vdata["NeedEncode"] = true;

	
		$vdata["truncateText"] = true;
	$vdata["NumberOfChars"] = 80;

	$fdata["ViewFormats"]["view"] = $vdata;
//  End View Formats

//	Begin Edit Formats
	$fdata["EditFormats"] = array();

	$edata = array("EditFormat" => "Text field");

	
		$edata["weekdayMessage"] = array("message" => "", "messageType" => "Text");
	$edata["weekdays"] = "[]";


	
	



		$edata["IsRequired"] = true;

	
	
	
			$edata["acceptFileTypes"] = ".+$";
		$edata["acceptFileTypesHtml"] = "";

		$edata["maxNumberOfFiles"] = 1;

	
	
	
	
			$edata["HTML5InuptType"] = "text";

		$edata["EditParams"] = "";
		
		$edata["controlWidth"] = 200;

//	Begin validation
	$edata["validateAs"] = array();
	$edata["validateAs"]["basicValidate"] = array();
	$edata["validateAs"]["customMessages"] = array();
				$edata["validateAs"]["basicValidate"][] = getJsValidatorName("Number");
						$edata["validateAs"]["basicValidate"][] = "IsRequired";
		
	
	//	End validation

	
			
	
	
	
	$fdata["EditFormats"]["edit"] = $edata;
//	End Edit Formats


	$fdata["isSeparate"] = false;




// the field's search options settings
		$fdata["defaultSearchOption"] = "Contains";

			// the default search options list
				$fdata["searchOptionsList"] = array("Contains", "Equals", "Starts with", "More than", "Less than", "Between", "Empty", NOT_EMPTY);
// the end of search options settings


//Filters settings
	$fdata["filterTotals"] = 0;
		$fdata["filterMultiSelect"] = 0;
			$fdata["filterFormat"] = "Values list";
		$fdata["showCollapsed"] = false;

		$fdata["sortValueType"] = 0;
		$fdata["numberOfVisibleItems"] = 10;

		$fdata["filterBy"] = 0;

	

	
	
//end of Filters settings


	$tdatapurchasing_summary["gross"] = $fdata;
		$tdatapurchasing_summary[".searchableFields"][] = "gross";


$tables_data["purchasing_summary"]=&$tdatapurchasing_summary;
$field_labels["purchasing_summary"] = &$fieldLabelspurchasing_summary;
$fieldToolTips["purchasing_summary"] = &$fieldToolTipspurchasing_summary;
$placeHolders["purchasing_summary"] = &$placeHolderspurchasing_summary;
$page_titles["purchasing_summary"] = &$pageTitlespurchasing_summary;

// -----------------start  prepare master-details data arrays ------------------------------//
// tables which are detail tables for current table (master)
$detailsTablesData["purchasing_summary"] = array();
//	purchasing data
	
	

		$dIndex = 0;
	$detailsParam = array();
	$detailsParam["dDataSourceTable"]="purchasing data";
		$detailsParam["dOriginalTable"] = "purchasing_details";



		
		$detailsParam["dType"]=PAGE_LIST;
	$detailsParam["dShortTable"] = "purchasing_data";
	$detailsParam["dCaptionTable"] = GetTableCaption("purchasing_data");
	$detailsParam["masterKeys"] =array();
	$detailsParam["detailKeys"] =array();


		
	$detailsTablesData["purchasing_summary"][$dIndex] = $detailsParam;

	
		$detailsTablesData["purchasing_summary"][$dIndex]["masterKeys"] = array();

	$detailsTablesData["purchasing_summary"][$dIndex]["masterKeys"][]="bar_code";

	$detailsTablesData["purchasing_summary"][$dIndex]["masterKeys"][]="date";

				$detailsTablesData["purchasing_summary"][$dIndex]["detailKeys"] = array();

	$detailsTablesData["purchasing_summary"][$dIndex]["detailKeys"][]="bar_code";

		
	$detailsTablesData["purchasing_summary"][$dIndex]["detailKeys"][]="date";

// tables which are master tables for current table (detail)
$masterTablesData["purchasing_summary"] = array();



	
				$strOriginalDetailsTable="daily_report";
	$masterParams = array();
	$masterParams["mDataSourceTable"]="daily_report";
	$masterParams["mOriginalTable"]= $strOriginalDetailsTable;
	$masterParams["mShortTable"]= "daily_report";
	$masterParams["masterKeys"]= array();
	$masterParams["detailKeys"]= array();

	$masterParams["type"] = PAGE_LIST;
					$masterTablesData["purchasing_summary"][0] = $masterParams;
				$masterTablesData["purchasing_summary"][0]["masterKeys"] = array();
	$masterTablesData["purchasing_summary"][0]["masterKeys"][]="date";
				$masterTablesData["purchasing_summary"][0]["detailKeys"] = array();
	$masterTablesData["purchasing_summary"][0]["detailKeys"][]="date";
		
// -----------------end  prepare master-details data arrays ------------------------------//



require_once(getabspath("classes/sql.php"));











function createSqlQuery_purchasing_summary()
{
$proto0=array();
$proto0["m_strHead"] = "SELECT";
$proto0["m_strFieldList"] = "COUNT(purchasing_details.id) as count,    purchasing_details.bar_code,    purchasing_details.unit,    AVG(purchasing_details.price) as price,    SUM(purchasing_details.net) as net,    SUM(purchasing_details.sub_total) as Total,    purchasing_details.product,    DATE(purchasing.date_and_time) as \"date\",    purchasing.outlet_code,    purchasing.h,    purchasing.f,    SUM(purchasing_details.gross) as gross";
$proto0["m_strFrom"] = "FROM purchasing_details  INNER JOIN purchasing ON purchasing_details.pur_id = purchasing.id";
$proto0["m_strWhere"] = "purchasing_details.details = \"Purchasing\" and purchasing.f = 0";
$proto0["m_strOrderBy"] = "";
	
		;
			$proto0["cipherer"] = null;
$proto2=array();
$proto2["m_sql"] = "purchasing_details.details = \"Purchasing\" and purchasing.f = 0";
$proto2["m_uniontype"] = "SQLL_AND";
	$obj = new SQLNonParsed(array(
	"m_sql" => "purchasing_details.details = \"Purchasing\" and purchasing.f = 0"
));

$proto2["m_column"]=$obj;
$proto2["m_contained"] = array();
						$proto4=array();
$proto4["m_sql"] = "purchasing_details.details = \"Purchasing\"";
$proto4["m_uniontype"] = "SQLL_UNKNOWN";
						$obj = new SQLField(array(
	"m_strName" => "details",
	"m_strTable" => "purchasing_details",
	"m_srcTableName" => "purchasing_summary"
));

$proto4["m_column"]=$obj;
$proto4["m_contained"] = array();
$proto4["m_strCase"] = "= \"Purchasing\"";
$proto4["m_havingmode"] = false;
$proto4["m_inBrackets"] = false;
$proto4["m_useAlias"] = false;
$obj = new SQLLogicalExpr($proto4);

			$proto2["m_contained"][]=$obj;
						$proto6=array();
$proto6["m_sql"] = "purchasing.f = 0";
$proto6["m_uniontype"] = "SQLL_UNKNOWN";
						$obj = new SQLField(array(
	"m_strName" => "f",
	"m_strTable" => "purchasing",
	"m_srcTableName" => "purchasing_summary"
));

$proto6["m_column"]=$obj;
$proto6["m_contained"] = array();
$proto6["m_strCase"] = "= 0";
$proto6["m_havingmode"] = false;
$proto6["m_inBrackets"] = false;
$proto6["m_useAlias"] = false;
$obj = new SQLLogicalExpr($proto6);

			$proto2["m_contained"][]=$obj;
$proto2["m_strCase"] = "";
$proto2["m_havingmode"] = false;
$proto2["m_inBrackets"] = false;
$proto2["m_useAlias"] = false;
$obj = new SQLLogicalExpr($proto2);

$proto0["m_where"] = $obj;
$proto8=array();
$proto8["m_sql"] = "";
$proto8["m_uniontype"] = "SQLL_UNKNOWN";
	$obj = new SQLNonParsed(array(
	"m_sql" => ""
));

$proto8["m_column"]=$obj;
$proto8["m_contained"] = array();
$proto8["m_strCase"] = "";
$proto8["m_havingmode"] = false;
$proto8["m_inBrackets"] = false;
$proto8["m_useAlias"] = false;
$obj = new SQLLogicalExpr($proto8);

$proto0["m_having"] = $obj;
$proto0["m_fieldlist"] = array();
						$proto10=array();
			$proto11=array();
$proto11["m_functiontype"] = "SQLF_COUNT";
$proto11["m_arguments"] = array();
						$obj = new SQLField(array(
	"m_strName" => "id",
	"m_strTable" => "purchasing_details",
	"m_srcTableName" => "purchasing_summary"
));

$proto11["m_arguments"][]=$obj;
$proto11["m_strFunctionName"] = "COUNT";
$obj = new SQLFunctionCall($proto11);

$proto10["m_sql"] = "COUNT(purchasing_details.id)";
$proto10["m_srcTableName"] = "purchasing_summary";
$proto10["m_expr"]=$obj;
$proto10["m_alias"] = "count";
$obj = new SQLFieldListItem($proto10);

$proto0["m_fieldlist"][]=$obj;
						$proto13=array();
			$obj = new SQLField(array(
	"m_strName" => "bar_code",
	"m_strTable" => "purchasing_details",
	"m_srcTableName" => "purchasing_summary"
));

$proto13["m_sql"] = "purchasing_details.bar_code";
$proto13["m_srcTableName"] = "purchasing_summary";
$proto13["m_expr"]=$obj;
$proto13["m_alias"] = "";
$obj = new SQLFieldListItem($proto13);

$proto0["m_fieldlist"][]=$obj;
						$proto15=array();
			$obj = new SQLField(array(
	"m_strName" => "unit",
	"m_strTable" => "purchasing_details",
	"m_srcTableName" => "purchasing_summary"
));

$proto15["m_sql"] = "purchasing_details.unit";
$proto15["m_srcTableName"] = "purchasing_summary";
$proto15["m_expr"]=$obj;
$proto15["m_alias"] = "";
$obj = new SQLFieldListItem($proto15);

$proto0["m_fieldlist"][]=$obj;
						$proto17=array();
			$proto18=array();
$proto18["m_functiontype"] = "SQLF_AVG";
$proto18["m_arguments"] = array();
						$obj = new SQLField(array(
	"m_strName" => "price",
	"m_strTable" => "purchasing_details",
	"m_srcTableName" => "purchasing_summary"
));

$proto18["m_arguments"][]=$obj;
$proto18["m_strFunctionName"] = "AVG";
$obj = new SQLFunctionCall($proto18);

$proto17["m_sql"] = "AVG(purchasing_details.price)";
$proto17["m_srcTableName"] = "purchasing_summary";
$proto17["m_expr"]=$obj;
$proto17["m_alias"] = "price";
$obj = new SQLFieldListItem($proto17);

$proto0["m_fieldlist"][]=$obj;
						$proto20=array();
			$proto21=array();
$proto21["m_functiontype"] = "SQLF_SUM";
$proto21["m_arguments"] = array();
						$obj = new SQLField(array(
	"m_strName" => "net",
	"m_strTable" => "purchasing_details",
	"m_srcTableName" => "purchasing_summary"
));

$proto21["m_arguments"][]=$obj;
$proto21["m_strFunctionName"] = "SUM";
$obj = new SQLFunctionCall($proto21);

$proto20["m_sql"] = "SUM(purchasing_details.net)";
$proto20["m_srcTableName"] = "purchasing_summary";
$proto20["m_expr"]=$obj;
$proto20["m_alias"] = "net";
$obj = new SQLFieldListItem($proto20);

$proto0["m_fieldlist"][]=$obj;
						$proto23=array();
			$proto24=array();
$proto24["m_functiontype"] = "SQLF_SUM";
$proto24["m_arguments"] = array();
						$obj = new SQLField(array(
	"m_strName" => "sub_total",
	"m_strTable" => "purchasing_details",
	"m_srcTableName" => "purchasing_summary"
));

$proto24["m_arguments"][]=$obj;
$proto24["m_strFunctionName"] = "SUM";
$obj = new SQLFunctionCall($proto24);

$proto23["m_sql"] = "SUM(purchasing_details.sub_total)";
$proto23["m_srcTableName"] = "purchasing_summary";
$proto23["m_expr"]=$obj;
$proto23["m_alias"] = "Total";
$obj = new SQLFieldListItem($proto23);

$proto0["m_fieldlist"][]=$obj;
						$proto26=array();
			$obj = new SQLField(array(
	"m_strName" => "product",
	"m_strTable" => "purchasing_details",
	"m_srcTableName" => "purchasing_summary"
));

$proto26["m_sql"] = "purchasing_details.product";
$proto26["m_srcTableName"] = "purchasing_summary";
$proto26["m_expr"]=$obj;
$proto26["m_alias"] = "";
$obj = new SQLFieldListItem($proto26);

$proto0["m_fieldlist"][]=$obj;
						$proto28=array();
			$proto29=array();
$proto29["m_functiontype"] = "SQLF_CUSTOM";
$proto29["m_arguments"] = array();
						$obj = new SQLNonParsed(array(
	"m_sql" => "purchasing.date_and_time"
));

$proto29["m_arguments"][]=$obj;
$proto29["m_strFunctionName"] = "DATE";
$obj = new SQLFunctionCall($proto29);

$proto28["m_sql"] = "DATE(purchasing.date_and_time)";
$proto28["m_srcTableName"] = "purchasing_summary";
$proto28["m_expr"]=$obj;
$proto28["m_alias"] = "date";
$obj = new SQLFieldListItem($proto28);

$proto0["m_fieldlist"][]=$obj;
						$proto31=array();
			$obj = new SQLField(array(
	"m_strName" => "outlet_code",
	"m_strTable" => "purchasing",
	"m_srcTableName" => "purchasing_summary"
));

$proto31["m_sql"] = "purchasing.outlet_code";
$proto31["m_srcTableName"] = "purchasing_summary";
$proto31["m_expr"]=$obj;
$proto31["m_alias"] = "";
$obj = new SQLFieldListItem($proto31);

$proto0["m_fieldlist"][]=$obj;
						$proto33=array();
			$obj = new SQLField(array(
	"m_strName" => "h",
	"m_strTable" => "purchasing",
	"m_srcTableName" => "purchasing_summary"
));

$proto33["m_sql"] = "purchasing.h";
$proto33["m_srcTableName"] = "purchasing_summary";
$proto33["m_expr"]=$obj;
$proto33["m_alias"] = "";
$obj = new SQLFieldListItem($proto33);

$proto0["m_fieldlist"][]=$obj;
						$proto35=array();
			$obj = new SQLField(array(
	"m_strName" => "f",
	"m_strTable" => "purchasing",
	"m_srcTableName" => "purchasing_summary"
));

$proto35["m_sql"] = "purchasing.f";
$proto35["m_srcTableName"] = "purchasing_summary";
$proto35["m_expr"]=$obj;
$proto35["m_alias"] = "";
$obj = new SQLFieldListItem($proto35);

$proto0["m_fieldlist"][]=$obj;
						$proto37=array();
			$proto38=array();
$proto38["m_functiontype"] = "SQLF_SUM";
$proto38["m_arguments"] = array();
						$obj = new SQLField(array(
	"m_strName" => "gross",
	"m_strTable" => "purchasing_details",
	"m_srcTableName" => "purchasing_summary"
));

$proto38["m_arguments"][]=$obj;
$proto38["m_strFunctionName"] = "SUM";
$obj = new SQLFunctionCall($proto38);

$proto37["m_sql"] = "SUM(purchasing_details.gross)";
$proto37["m_srcTableName"] = "purchasing_summary";
$proto37["m_expr"]=$obj;
$proto37["m_alias"] = "gross";
$obj = new SQLFieldListItem($proto37);

$proto0["m_fieldlist"][]=$obj;
$proto0["m_fromlist"] = array();
												$proto40=array();
$proto40["m_link"] = "SQLL_MAIN";
			$proto41=array();
$proto41["m_strName"] = "purchasing_details";
$proto41["m_srcTableName"] = "purchasing_summary";
$proto41["m_columns"] = array();
$proto41["m_columns"][] = "id";
$proto41["m_columns"][] = "pur_id";
$proto41["m_columns"][] = "bar_code";
$proto41["m_columns"][] = "unit";
$proto41["m_columns"][] = "gross";
$proto41["m_columns"][] = "price";
$proto41["m_columns"][] = "tar";
$proto41["m_columns"][] = "net";
$proto41["m_columns"][] = "sub_total";
$proto41["m_columns"][] = "stock_rece_code";
$proto41["m_columns"][] = "stock_send_code";
$proto41["m_columns"][] = "product";
$proto41["m_columns"][] = "details";
$proto41["m_columns"][] = "package_details";
$proto41["m_columns"][] = "cstatus";
$proto41["m_columns"][] = "outlet_code";
$proto41["m_columns"][] = "user";
$obj = new SQLTable($proto41);

$proto40["m_table"] = $obj;
$proto40["m_sql"] = "purchasing_details";
$proto40["m_alias"] = "";
$proto40["m_srcTableName"] = "purchasing_summary";
$proto42=array();
$proto42["m_sql"] = "";
$proto42["m_uniontype"] = "SQLL_UNKNOWN";
	$obj = new SQLNonParsed(array(
	"m_sql" => ""
));

$proto42["m_column"]=$obj;
$proto42["m_contained"] = array();
$proto42["m_strCase"] = "";
$proto42["m_havingmode"] = false;
$proto42["m_inBrackets"] = false;
$proto42["m_useAlias"] = false;
$obj = new SQLLogicalExpr($proto42);

$proto40["m_joinon"] = $obj;
$obj = new SQLFromListItem($proto40);

$proto0["m_fromlist"][]=$obj;
												$proto44=array();
$proto44["m_link"] = "SQLL_INNERJOIN";
			$proto45=array();
$proto45["m_strName"] = "purchasing";
$proto45["m_srcTableName"] = "purchasing_summary";
$proto45["m_columns"] = array();
$proto45["m_columns"][] = "id";
$proto45["m_columns"][] = "date_and_time";
$proto45["m_columns"][] = "supplier";
$proto45["m_columns"][] = "tt";
$proto45["m_columns"][] = "branch_code";
$proto45["m_columns"][] = "user";
$proto45["m_columns"][] = "outlet_code";
$proto45["m_columns"][] = "payment";
$proto45["m_columns"][] = "h";
$proto45["m_columns"][] = "f";
$proto45["m_columns"][] = "advance_id";
$proto45["m_columns"][] = "status";
$proto45["m_columns"][] = "left_advance";
$proto45["m_columns"][] = "details";
$proto45["m_columns"][] = "supplier_id";
$proto45["m_columns"][] = "paid";
$proto45["m_columns"][] = "total_amount";
$proto45["m_columns"][] = "left";
$proto45["m_columns"][] = "user2";
$obj = new SQLTable($proto45);

$proto44["m_table"] = $obj;
$proto44["m_sql"] = "INNER JOIN purchasing ON purchasing_details.pur_id = purchasing.id";
$proto44["m_alias"] = "";
$proto44["m_srcTableName"] = "purchasing_summary";
$proto46=array();
$proto46["m_sql"] = "purchasing_details.pur_id = purchasing.id";
$proto46["m_uniontype"] = "SQLL_UNKNOWN";
						$obj = new SQLField(array(
	"m_strName" => "pur_id",
	"m_strTable" => "purchasing_details",
	"m_srcTableName" => "purchasing_summary"
));

$proto46["m_column"]=$obj;
$proto46["m_contained"] = array();
$proto46["m_strCase"] = "= purchasing.id";
$proto46["m_havingmode"] = false;
$proto46["m_inBrackets"] = false;
$proto46["m_useAlias"] = false;
$obj = new SQLLogicalExpr($proto46);

$proto44["m_joinon"] = $obj;
$obj = new SQLFromListItem($proto44);

$proto0["m_fromlist"][]=$obj;
$proto0["m_groupby"] = array();
												$proto48=array();
						$obj = new SQLField(array(
	"m_strName" => "bar_code",
	"m_strTable" => "purchasing_details",
	"m_srcTableName" => "purchasing_summary"
));

$proto48["m_column"]=$obj;
$obj = new SQLGroupByItem($proto48);

$proto0["m_groupby"][]=$obj;
$proto0["m_orderby"] = array();
$proto0["m_srcTableName"]="purchasing_summary";		
$obj = new SQLQuery($proto0);

	return $obj;
}
$queryData_purchasing_summary = createSqlQuery_purchasing_summary();


	
		;

												

$tdatapurchasing_summary[".sqlquery"] = $queryData_purchasing_summary;



$tableEvents["purchasing_summary"] = new eventsBase;
$tdatapurchasing_summary[".hasEvents"] = false;

?>