<?php
$tdatapurchase_details = array();
$tdatapurchase_details[".searchableFields"] = array();
$tdatapurchase_details[".ShortName"] = "purchase_details";
$tdatapurchase_details[".OwnerID"] = "";
$tdatapurchase_details[".OriginalTable"] = "purchase_details";


$tdatapurchase_details[".pagesByType"] = my_json_decode( "{\"add\":[\"add\"],\"edit\":[\"edit\"],\"export\":[\"export\"],\"import\":[\"import\"],\"list\":[\"list\",\"list_add\",\"list_edit\",\"list_list\"],\"print\":[\"print\"],\"search\":[\"search\"],\"view\":[\"view\"]}" );
$tdatapurchase_details[".originalPagesByType"] = $tdatapurchase_details[".pagesByType"];
$tdatapurchase_details[".pages"] = types2pages( my_json_decode( "{\"add\":[\"add\"],\"edit\":[\"edit\"],\"export\":[\"export\"],\"import\":[\"import\"],\"list\":[\"list\",\"list_add\",\"list_edit\",\"list_list\"],\"print\":[\"print\"],\"search\":[\"search\"],\"view\":[\"view\"]}" ) );
$tdatapurchase_details[".originalPages"] = $tdatapurchase_details[".pages"];
$tdatapurchase_details[".defaultPages"] = my_json_decode( "{\"add\":\"add\",\"edit\":\"edit\",\"export\":\"export\",\"import\":\"import\",\"list\":\"list\",\"print\":\"print\",\"search\":\"search\",\"view\":\"view\"}" );
$tdatapurchase_details[".originalDefaultPages"] = $tdatapurchase_details[".defaultPages"];

//	field labels
$fieldLabelspurchase_details = array();
$fieldToolTipspurchase_details = array();
$pageTitlespurchase_details = array();
$placeHolderspurchase_details = array();

if(mlang_getcurrentlang()=="English")
{
	$fieldLabelspurchase_details["English"] = array();
	$fieldToolTipspurchase_details["English"] = array();
	$placeHolderspurchase_details["English"] = array();
	$pageTitlespurchase_details["English"] = array();
	$fieldLabelspurchase_details["English"]["id"] = "Id";
	$fieldToolTipspurchase_details["English"]["id"] = "";
	$placeHolderspurchase_details["English"]["id"] = "";
	$fieldLabelspurchase_details["English"]["purchase_id"] = "Purchase Id";
	$fieldToolTipspurchase_details["English"]["purchase_id"] = "";
	$placeHolderspurchase_details["English"]["purchase_id"] = "";
	$fieldLabelspurchase_details["English"]["product_code"] = "Product Code";
	$fieldToolTipspurchase_details["English"]["product_code"] = "";
	$placeHolderspurchase_details["English"]["product_code"] = "";
	$fieldLabelspurchase_details["English"]["purchase_date"] = "Purchase Date";
	$fieldToolTipspurchase_details["English"]["purchase_date"] = "";
	$placeHolderspurchase_details["English"]["purchase_date"] = "";
	$fieldLabelspurchase_details["English"]["product_type"] = "Product Type";
	$fieldToolTipspurchase_details["English"]["product_type"] = "";
	$placeHolderspurchase_details["English"]["product_type"] = "";
	$fieldLabelspurchase_details["English"]["quantity"] = "Quantity";
	$fieldToolTipspurchase_details["English"]["quantity"] = "";
	$placeHolderspurchase_details["English"]["quantity"] = "";
	$fieldLabelspurchase_details["English"]["unit_price"] = "Unit Price";
	$fieldToolTipspurchase_details["English"]["unit_price"] = "";
	$placeHolderspurchase_details["English"]["unit_price"] = "";
	$fieldLabelspurchase_details["English"]["tbid"] = "Tbid";
	$fieldToolTipspurchase_details["English"]["tbid"] = "";
	$placeHolderspurchase_details["English"]["tbid"] = "";
	$fieldLabelspurchase_details["English"]["Sub_Total"] = "Sub Total";
	$fieldToolTipspurchase_details["English"]["Sub_Total"] = "";
	$placeHolderspurchase_details["English"]["Sub_Total"] = "";
	if (count($fieldToolTipspurchase_details["English"]))
		$tdatapurchase_details[".isUseToolTips"] = true;
}


	$tdatapurchase_details[".NCSearch"] = true;



$tdatapurchase_details[".shortTableName"] = "purchase_details";
$tdatapurchase_details[".nSecOptions"] = 0;

$tdatapurchase_details[".mainTableOwnerID"] = "";
$tdatapurchase_details[".entityType"] = 0;
$tdatapurchase_details[".connId"] = "new_lakmini_at_localhost";


$tdatapurchase_details[".strOriginalTableName"] = "purchase_details";

	



$tdatapurchase_details[".showAddInPopup"] = false;

$tdatapurchase_details[".showEditInPopup"] = false;

$tdatapurchase_details[".showViewInPopup"] = false;

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


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

	$tdatapurchase_details[".audit"] = false;

	$tdatapurchase_details[".locking"] = false;


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

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

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

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



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




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

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

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

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



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

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

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

$tdatapurchase_details[".isUseAjaxSuggest"] = true;

$tdatapurchase_details[".rowHighlite"] = true;



						

$tdatapurchase_details[".ajaxCodeSnippetAdded"] = false;

$tdatapurchase_details[".buttonsAdded"] = false;

$tdatapurchase_details[".addPageEvents"] = false;

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


$tdatapurchase_details[".badgeColor"] = "9acd32";


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

$tdatapurchase_details[".googleLikeFields"] = array();
$tdatapurchase_details[".googleLikeFields"][] = "id";
$tdatapurchase_details[".googleLikeFields"][] = "purchase_id";
$tdatapurchase_details[".googleLikeFields"][] = "product_code";
$tdatapurchase_details[".googleLikeFields"][] = "purchase_date";
$tdatapurchase_details[".googleLikeFields"][] = "product_type";
$tdatapurchase_details[".googleLikeFields"][] = "quantity";
$tdatapurchase_details[".googleLikeFields"][] = "unit_price";
$tdatapurchase_details[".googleLikeFields"][] = "Sub Total";
$tdatapurchase_details[".googleLikeFields"][] = "tbid";



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

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

$tdatapurchase_details[".nPrinterSplitRecords"] = 40;

$tdatapurchase_details[".geocodingEnabled"] = false;










$tdatapurchase_details[".pageSize"] = 20;

$tdatapurchase_details[".warnLeavingPages"] = true;



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

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


$tdatapurchase_details[".sqlHead"] = "SELECT id,  	purchase_id,  	product_code,  	purchase_date,  	product_type,  	quantity,  	unit_price,	quantity * unit_price AS \"Sub Total\",  	tbid";
$tdatapurchase_details[".sqlFrom"] = "FROM purchase_details";
$tdatapurchase_details[".sqlWhereExpr"] = "";
$tdatapurchase_details[".sqlTail"] = "";










//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;
$tdatapurchase_details[".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;
$tdatapurchase_details[".arrGroupsPerPage"] = $arrGPP;

$tdatapurchase_details[".highlightSearchResults"] = true;

$tableKeyspurchase_details = array();
$tableKeyspurchase_details[] = "id";
$tdatapurchase_details[".Keys"] = $tableKeyspurchase_details;


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




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

	
		$fdata["AutoInc"] = true;

	
			

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

	
		$fdata["isSQLExpression"] = true;
	$fdata["FullName"] = "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


	$tdatapurchase_details["id"] = $fdata;
		$tdatapurchase_details[".searchableFields"][] = "id";
//	purchase_id
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 2;
	$fdata["strName"] = "purchase_id";
	$fdata["GoodName"] = "purchase_id";
	$fdata["ownerTable"] = "purchase_details";
	$fdata["Label"] = GetFieldLabel("purchase_details","purchase_id");
	$fdata["FieldType"] = 3;

	
	
	
			

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

	
		$fdata["isSQLExpression"] = true;
	$fdata["FullName"] = "purchase_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" => "Lookup wizard");

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


	
	

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

	
		
	$edata["LinkField"] = "id";
	$edata["LinkFieldType"] = 3;
	$edata["DisplayField"] = "seller";

	

	
	$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"] = "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


	$tdatapurchase_details["purchase_id"] = $fdata;
		$tdatapurchase_details[".searchableFields"][] = "purchase_id";
//	product_code
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 3;
	$fdata["strName"] = "product_code";
	$fdata["GoodName"] = "product_code";
	$fdata["ownerTable"] = "purchase_details";
	$fdata["Label"] = GetFieldLabel("purchase_details","product_code");
	$fdata["FieldType"] = 200;

	
	
	
			

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

	
		$fdata["isSQLExpression"] = true;
	$fdata["FullName"] = "product_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"] = "products";
			$edata["autoCompleteFieldsOnEdit"] = 1;
	$edata["autoCompleteFields"] = array();
		$edata["autoCompleteFields"][] = array('masterF'=>"product_type", 'lookupF'=>"product_type");
	$edata["LCType"] = 1;

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

	

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

	
	
		$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


	$tdatapurchase_details["product_code"] = $fdata;
		$tdatapurchase_details[".searchableFields"][] = "product_code";
//	purchase_date
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 4;
	$fdata["strName"] = "purchase_date";
	$fdata["GoodName"] = "purchase_date";
	$fdata["ownerTable"] = "purchase_details";
	$fdata["Label"] = GetFieldLabel("purchase_details","purchase_date");
	$fdata["FieldType"] = 135;

	
	
	
			

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

	
		$fdata["isSQLExpression"] = true;
	$fdata["FullName"] = "purchase_date";

	
	
				$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


	$tdatapurchase_details["purchase_date"] = $fdata;
		$tdatapurchase_details[".searchableFields"][] = "purchase_date";
//	product_type
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 5;
	$fdata["strName"] = "product_type";
	$fdata["GoodName"] = "product_type";
	$fdata["ownerTable"] = "purchase_details";
	$fdata["Label"] = GetFieldLabel("purchase_details","product_type");
	$fdata["FieldType"] = 200;

	
	
	
			

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

	
		$fdata["isSQLExpression"] = true;
	$fdata["FullName"] = "product_type";

	
	
				$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


	$tdatapurchase_details["product_type"] = $fdata;
		$tdatapurchase_details[".searchableFields"][] = "product_type";
//	quantity
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 6;
	$fdata["strName"] = "quantity";
	$fdata["GoodName"] = "quantity";
	$fdata["ownerTable"] = "purchase_details";
	$fdata["Label"] = GetFieldLabel("purchase_details","quantity");
	$fdata["FieldType"] = 3;

	
	
	
			

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

	
		$fdata["isSQLExpression"] = true;
	$fdata["FullName"] = "quantity";

	
	
				$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"] = "number";

		$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


	$tdatapurchase_details["quantity"] = $fdata;
		$tdatapurchase_details[".searchableFields"][] = "quantity";
//	unit_price
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 7;
	$fdata["strName"] = "unit_price";
	$fdata["GoodName"] = "unit_price";
	$fdata["ownerTable"] = "purchase_details";
	$fdata["Label"] = GetFieldLabel("purchase_details","unit_price");
	$fdata["FieldType"] = 14;

	
	
	
			

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

	
		$fdata["isSQLExpression"] = true;
	$fdata["FullName"] = "unit_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["IsRequired"] = true;

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

		$edata["maxNumberOfFiles"] = 1;

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

		$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


	$tdatapurchase_details["unit_price"] = $fdata;
		$tdatapurchase_details[".searchableFields"][] = "unit_price";
//	Sub Total
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 8;
	$fdata["strName"] = "Sub Total";
	$fdata["GoodName"] = "Sub_Total";
	$fdata["ownerTable"] = "";
	$fdata["Label"] = GetFieldLabel("purchase_details","Sub_Total");
	$fdata["FieldType"] = 14;

	
	
	
			

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

	
		$fdata["isSQLExpression"] = true;
	$fdata["FullName"] = "quantity * unit_price";

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

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

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

	
	
	
	
	
	
		$vdata["DecimalDigits"] = 0;

	
	
	
	
		
	
		$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


	$tdatapurchase_details["Sub Total"] = $fdata;
		$tdatapurchase_details[".searchableFields"][] = "Sub Total";
//	tbid
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 9;
	$fdata["strName"] = "tbid";
	$fdata["GoodName"] = "tbid";
	$fdata["ownerTable"] = "purchase_details";
	$fdata["Label"] = GetFieldLabel("purchase_details","tbid");
	$fdata["FieldType"] = 3;

	
	
	
			

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

	
		$fdata["isSQLExpression"] = true;
	$fdata["FullName"] = "tbid";

	
	
				$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["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


	$tdatapurchase_details["tbid"] = $fdata;
		$tdatapurchase_details[".searchableFields"][] = "tbid";


$tables_data["purchase_details"]=&$tdatapurchase_details;
$field_labels["purchase_details"] = &$fieldLabelspurchase_details;
$fieldToolTips["purchase_details"] = &$fieldToolTipspurchase_details;
$placeHolders["purchase_details"] = &$placeHolderspurchase_details;
$page_titles["purchase_details"] = &$pageTitlespurchase_details;

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

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



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

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



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











function createSqlQuery_purchase_details()
{
$proto0=array();
$proto0["m_strHead"] = "SELECT";
$proto0["m_strFieldList"] = "id,  	purchase_id,  	product_code,  	purchase_date,  	product_type,  	quantity,  	unit_price,	quantity * unit_price AS \"Sub Total\",  	tbid";
$proto0["m_strFrom"] = "FROM purchase_details";
$proto0["m_strWhere"] = "";
$proto0["m_strOrderBy"] = "";
	
		;
			$proto0["cipherer"] = null;
$proto2=array();
$proto2["m_sql"] = "";
$proto2["m_uniontype"] = "SQLL_UNKNOWN";
	$obj = new SQLNonParsed(array(
	"m_sql" => ""
));

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

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

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

$proto0["m_having"] = $obj;
$proto0["m_fieldlist"] = array();
						$proto6=array();
			$obj = new SQLField(array(
	"m_strName" => "id",
	"m_strTable" => "purchase_details",
	"m_srcTableName" => "purchase_details"
));

$proto6["m_sql"] = "id";
$proto6["m_srcTableName"] = "purchase_details";
$proto6["m_expr"]=$obj;
$proto6["m_alias"] = "";
$obj = new SQLFieldListItem($proto6);

$proto0["m_fieldlist"][]=$obj;
						$proto8=array();
			$obj = new SQLField(array(
	"m_strName" => "purchase_id",
	"m_strTable" => "purchase_details",
	"m_srcTableName" => "purchase_details"
));

$proto8["m_sql"] = "purchase_id";
$proto8["m_srcTableName"] = "purchase_details";
$proto8["m_expr"]=$obj;
$proto8["m_alias"] = "";
$obj = new SQLFieldListItem($proto8);

$proto0["m_fieldlist"][]=$obj;
						$proto10=array();
			$obj = new SQLField(array(
	"m_strName" => "product_code",
	"m_strTable" => "purchase_details",
	"m_srcTableName" => "purchase_details"
));

$proto10["m_sql"] = "product_code";
$proto10["m_srcTableName"] = "purchase_details";
$proto10["m_expr"]=$obj;
$proto10["m_alias"] = "";
$obj = new SQLFieldListItem($proto10);

$proto0["m_fieldlist"][]=$obj;
						$proto12=array();
			$obj = new SQLField(array(
	"m_strName" => "purchase_date",
	"m_strTable" => "purchase_details",
	"m_srcTableName" => "purchase_details"
));

$proto12["m_sql"] = "purchase_date";
$proto12["m_srcTableName"] = "purchase_details";
$proto12["m_expr"]=$obj;
$proto12["m_alias"] = "";
$obj = new SQLFieldListItem($proto12);

$proto0["m_fieldlist"][]=$obj;
						$proto14=array();
			$obj = new SQLField(array(
	"m_strName" => "product_type",
	"m_strTable" => "purchase_details",
	"m_srcTableName" => "purchase_details"
));

$proto14["m_sql"] = "product_type";
$proto14["m_srcTableName"] = "purchase_details";
$proto14["m_expr"]=$obj;
$proto14["m_alias"] = "";
$obj = new SQLFieldListItem($proto14);

$proto0["m_fieldlist"][]=$obj;
						$proto16=array();
			$obj = new SQLField(array(
	"m_strName" => "quantity",
	"m_strTable" => "purchase_details",
	"m_srcTableName" => "purchase_details"
));

$proto16["m_sql"] = "quantity";
$proto16["m_srcTableName"] = "purchase_details";
$proto16["m_expr"]=$obj;
$proto16["m_alias"] = "";
$obj = new SQLFieldListItem($proto16);

$proto0["m_fieldlist"][]=$obj;
						$proto18=array();
			$obj = new SQLField(array(
	"m_strName" => "unit_price",
	"m_strTable" => "purchase_details",
	"m_srcTableName" => "purchase_details"
));

$proto18["m_sql"] = "unit_price";
$proto18["m_srcTableName"] = "purchase_details";
$proto18["m_expr"]=$obj;
$proto18["m_alias"] = "";
$obj = new SQLFieldListItem($proto18);

$proto0["m_fieldlist"][]=$obj;
						$proto20=array();
			$obj = new SQLNonParsed(array(
	"m_sql" => "quantity * unit_price"
));

$proto20["m_sql"] = "quantity * unit_price";
$proto20["m_srcTableName"] = "purchase_details";
$proto20["m_expr"]=$obj;
$proto20["m_alias"] = "Sub Total";
$obj = new SQLFieldListItem($proto20);

$proto0["m_fieldlist"][]=$obj;
						$proto22=array();
			$obj = new SQLField(array(
	"m_strName" => "tbid",
	"m_strTable" => "purchase_details",
	"m_srcTableName" => "purchase_details"
));

$proto22["m_sql"] = "tbid";
$proto22["m_srcTableName"] = "purchase_details";
$proto22["m_expr"]=$obj;
$proto22["m_alias"] = "";
$obj = new SQLFieldListItem($proto22);

$proto0["m_fieldlist"][]=$obj;
$proto0["m_fromlist"] = array();
												$proto24=array();
$proto24["m_link"] = "SQLL_MAIN";
			$proto25=array();
$proto25["m_strName"] = "purchase_details";
$proto25["m_srcTableName"] = "purchase_details";
$proto25["m_columns"] = array();
$proto25["m_columns"][] = "id";
$proto25["m_columns"][] = "purchase_id";
$proto25["m_columns"][] = "product_code";
$proto25["m_columns"][] = "purchase_date";
$proto25["m_columns"][] = "product_type";
$proto25["m_columns"][] = "quantity";
$proto25["m_columns"][] = "unit_price";
$proto25["m_columns"][] = "tbid";
$obj = new SQLTable($proto25);

$proto24["m_table"] = $obj;
$proto24["m_sql"] = "purchase_details";
$proto24["m_alias"] = "";
$proto24["m_srcTableName"] = "purchase_details";
$proto26=array();
$proto26["m_sql"] = "";
$proto26["m_uniontype"] = "SQLL_UNKNOWN";
	$obj = new SQLNonParsed(array(
	"m_sql" => ""
));

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

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

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

	return $obj;
}
$queryData_purchase_details = createSqlQuery_purchase_details();


	
		;

									

$tdatapurchase_details[".sqlquery"] = $queryData_purchase_details;



$tableEvents["purchase_details"] = new eventsBase;
$tdatapurchase_details[".hasEvents"] = false;

?>