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


$tdatasale_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\"]}" );
$tdatasale_details[".originalPagesByType"] = $tdatasale_details[".pagesByType"];
$tdatasale_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\"]}" ) );
$tdatasale_details[".originalPages"] = $tdatasale_details[".pages"];
$tdatasale_details[".defaultPages"] = my_json_decode( "{\"add\":\"add\",\"edit\":\"edit\",\"export\":\"export\",\"import\":\"import\",\"list\":\"list\",\"print\":\"print\",\"search\":\"search\",\"view\":\"view\"}" );
$tdatasale_details[".originalDefaultPages"] = $tdatasale_details[".defaultPages"];

//	field labels
$fieldLabelssale_details = array();
$fieldToolTipssale_details = array();
$pageTitlessale_details = array();
$placeHolderssale_details = array();

if(mlang_getcurrentlang()=="English")
{
	$fieldLabelssale_details["English"] = array();
	$fieldToolTipssale_details["English"] = array();
	$placeHolderssale_details["English"] = array();
	$pageTitlessale_details["English"] = array();
	$fieldLabelssale_details["English"]["id"] = "Id";
	$fieldToolTipssale_details["English"]["id"] = "";
	$placeHolderssale_details["English"]["id"] = "";
	$fieldLabelssale_details["English"]["mid"] = "Mid";
	$fieldToolTipssale_details["English"]["mid"] = "";
	$placeHolderssale_details["English"]["mid"] = "";
	$fieldLabelssale_details["English"]["product_code"] = "Product Code";
	$fieldToolTipssale_details["English"]["product_code"] = "";
	$placeHolderssale_details["English"]["product_code"] = "";
	$fieldLabelssale_details["English"]["quantity"] = "Quantity";
	$fieldToolTipssale_details["English"]["quantity"] = "";
	$placeHolderssale_details["English"]["quantity"] = "";
	$fieldLabelssale_details["English"]["selling_price"] = "Selling Price";
	$fieldToolTipssale_details["English"]["selling_price"] = "";
	$placeHolderssale_details["English"]["selling_price"] = "";
	$fieldLabelssale_details["English"]["Sub_Total"] = "Sub Total";
	$fieldToolTipssale_details["English"]["Sub_Total"] = "";
	$placeHolderssale_details["English"]["Sub_Total"] = "";
	$fieldLabelssale_details["English"]["discount"] = "Discount %";
	$fieldToolTipssale_details["English"]["discount"] = "";
	$placeHolderssale_details["English"]["discount"] = "";
	$fieldLabelssale_details["English"]["tax"] = "Tax %";
	$fieldToolTipssale_details["English"]["tax"] = "";
	$placeHolderssale_details["English"]["tax"] = "";
	$fieldLabelssale_details["English"]["cost_price"] = "B code";
	$fieldToolTipssale_details["English"]["cost_price"] = "";
	$placeHolderssale_details["English"]["cost_price"] = "";
	if (count($fieldToolTipssale_details["English"]))
		$tdatasale_details[".isUseToolTips"] = true;
}


	$tdatasale_details[".NCSearch"] = true;



$tdatasale_details[".shortTableName"] = "sale_details";
$tdatasale_details[".nSecOptions"] = 0;

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


$tdatasale_details[".strOriginalTableName"] = "sale_details";

	



$tdatasale_details[".showAddInPopup"] = false;

$tdatasale_details[".showEditInPopup"] = false;

$tdatasale_details[".showViewInPopup"] = false;

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


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

	$tdatasale_details[".audit"] = false;

	$tdatasale_details[".locking"] = false;


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

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

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

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



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




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

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

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

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



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

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

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

$tdatasale_details[".isUseAjaxSuggest"] = true;

$tdatasale_details[".rowHighlite"] = true;



						

$tdatasale_details[".ajaxCodeSnippetAdded"] = false;

$tdatasale_details[".buttonsAdded"] = false;

$tdatasale_details[".addPageEvents"] = false;

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


$tdatasale_details[".badgeColor"] = "2f4f4f";


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

$tdatasale_details[".googleLikeFields"] = array();
$tdatasale_details[".googleLikeFields"][] = "id";
$tdatasale_details[".googleLikeFields"][] = "mid";
$tdatasale_details[".googleLikeFields"][] = "product_code";
$tdatasale_details[".googleLikeFields"][] = "quantity";
$tdatasale_details[".googleLikeFields"][] = "cost_price";
$tdatasale_details[".googleLikeFields"][] = "selling_price";
$tdatasale_details[".googleLikeFields"][] = "discount";
$tdatasale_details[".googleLikeFields"][] = "tax";
$tdatasale_details[".googleLikeFields"][] = "Sub Total";



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

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

$tdatasale_details[".nPrinterSplitRecords"] = 40;

$tdatasale_details[".geocodingEnabled"] = false;










$tdatasale_details[".pageSize"] = 20;

$tdatasale_details[".warnLeavingPages"] = true;



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

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


$tdatasale_details[".sqlHead"] = "SELECT id,      mid,      product_code,      quantity,      cost_price,      selling_price,discount,tax,      ((quantity * selling_price) * (100 - discount) / 100) * (tax + 100) / 100 AS \"Sub Total\"";
$tdatasale_details[".sqlFrom"] = "FROM sale_details";
$tdatasale_details[".sqlWhereExpr"] = "";
$tdatasale_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;
$tdatasale_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;
$tdatasale_details[".arrGroupsPerPage"] = $arrGPP;

$tdatasale_details[".highlightSearchResults"] = true;

$tableKeyssale_details = array();
$tableKeyssale_details[] = "id";
$tdatasale_details[".Keys"] = $tableKeyssale_details;


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




//	id
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 1;
	$fdata["strName"] = "id";
	$fdata["GoodName"] = "id";
	$fdata["ownerTable"] = "sale_details";
	$fdata["Label"] = GetFieldLabel("sale_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


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

	
	
	
			

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

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

	
	
				$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"] = "sale_master";
			$edata["autoCompleteFieldsOnEdit"] = 0;
	$edata["autoCompleteFields"] = array();
		$edata["LCType"] = 0;

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

	

	
	$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


	$tdatasale_details["mid"] = $fdata;
		$tdatasale_details[".searchableFields"][] = "mid";
//	product_code
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 3;
	$fdata["strName"] = "product_code";
	$fdata["GoodName"] = "product_code";
	$fdata["ownerTable"] = "sale_details";
	$fdata["Label"] = GetFieldLabel("sale_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'=>"Bcode", 'lookupF'=>"final_cost");
	$edata["autoCompleteFields"][] = array('masterF'=>"selling_price", 'lookupF'=>"last_selling_price");
	$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


	$tdatasale_details["product_code"] = $fdata;
		$tdatasale_details[".searchableFields"][] = "product_code";
//	quantity
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 4;
	$fdata["strName"] = "quantity";
	$fdata["GoodName"] = "quantity";
	$fdata["ownerTable"] = "sale_details";
	$fdata["Label"] = GetFieldLabel("sale_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


	$tdatasale_details["quantity"] = $fdata;
		$tdatasale_details[".searchableFields"][] = "quantity";
//	cost_price
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 5;
	$fdata["strName"] = "cost_price";
	$fdata["GoodName"] = "cost_price";
	$fdata["ownerTable"] = "sale_details";
	$fdata["Label"] = GetFieldLabel("sale_details","cost_price");
	$fdata["FieldType"] = 14;

	
	
	
			

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

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


	$tdatasale_details["cost_price"] = $fdata;
		$tdatasale_details[".searchableFields"][] = "cost_price";
//	selling_price
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 6;
	$fdata["strName"] = "selling_price";
	$fdata["GoodName"] = "selling_price";
	$fdata["ownerTable"] = "sale_details";
	$fdata["Label"] = GetFieldLabel("sale_details","selling_price");
	$fdata["FieldType"] = 14;

	
	
	
			

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

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


	$tdatasale_details["selling_price"] = $fdata;
		$tdatasale_details[".searchableFields"][] = "selling_price";
//	discount
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 7;
	$fdata["strName"] = "discount";
	$fdata["GoodName"] = "discount";
	$fdata["ownerTable"] = "sale_details";
	$fdata["Label"] = GetFieldLabel("sale_details","discount");
	$fdata["FieldType"] = 14;

	
	
	
			

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

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

	
	
				$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


	$tdatasale_details["discount"] = $fdata;
		$tdatasale_details[".searchableFields"][] = "discount";
//	tax
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 8;
	$fdata["strName"] = "tax";
	$fdata["GoodName"] = "tax";
	$fdata["ownerTable"] = "sale_details";
	$fdata["Label"] = GetFieldLabel("sale_details","tax");
	$fdata["FieldType"] = 14;

	
	
	
			

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

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

	
	
				$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


	$tdatasale_details["tax"] = $fdata;
		$tdatasale_details[".searchableFields"][] = "tax";
//	Sub Total
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 9;
	$fdata["strName"] = "Sub Total";
	$fdata["GoodName"] = "Sub_Total";
	$fdata["ownerTable"] = "";
	$fdata["Label"] = GetFieldLabel("sale_details","Sub_Total");
	$fdata["FieldType"] = 14;

	
	
	
			

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

	
		$fdata["isSQLExpression"] = true;
	$fdata["FullName"] = "((quantity * selling_price) * (100 - discount) / 100) * (tax + 100) / 100";

	
	
				$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


	$tdatasale_details["Sub Total"] = $fdata;
		$tdatasale_details[".searchableFields"][] = "Sub Total";


$tables_data["sale_details"]=&$tdatasale_details;
$field_labels["sale_details"] = &$fieldLabelssale_details;
$fieldToolTips["sale_details"] = &$fieldToolTipssale_details;
$placeHolders["sale_details"] = &$placeHolderssale_details;
$page_titles["sale_details"] = &$pageTitlessale_details;

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

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



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

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



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











function createSqlQuery_sale_details()
{
$proto0=array();
$proto0["m_strHead"] = "SELECT";
$proto0["m_strFieldList"] = "id,      mid,      product_code,      quantity,      cost_price,      selling_price,discount,tax,      ((quantity * selling_price) * (100 - discount) / 100) * (tax + 100) / 100 AS \"Sub Total\"";
$proto0["m_strFrom"] = "FROM sale_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" => "sale_details",
	"m_srcTableName" => "sale_details"
));

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

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

$proto8["m_sql"] = "mid";
$proto8["m_srcTableName"] = "sale_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" => "sale_details",
	"m_srcTableName" => "sale_details"
));

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

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

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

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

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

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

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

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

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

$proto0["m_fieldlist"][]=$obj;
						$proto20=array();
			$obj = new SQLField(array(
	"m_strName" => "tax",
	"m_strTable" => "sale_details",
	"m_srcTableName" => "sale_details"
));

$proto20["m_sql"] = "tax";
$proto20["m_srcTableName"] = "sale_details";
$proto20["m_expr"]=$obj;
$proto20["m_alias"] = "";
$obj = new SQLFieldListItem($proto20);

$proto0["m_fieldlist"][]=$obj;
						$proto22=array();
			$obj = new SQLNonParsed(array(
	"m_sql" => "((quantity * selling_price) * (100 - discount) / 100) * (tax + 100) / 100"
));

$proto22["m_sql"] = "((quantity * selling_price) * (100 - discount) / 100) * (tax + 100) / 100";
$proto22["m_srcTableName"] = "sale_details";
$proto22["m_expr"]=$obj;
$proto22["m_alias"] = "Sub Total";
$obj = new SQLFieldListItem($proto22);

$proto0["m_fieldlist"][]=$obj;
$proto0["m_fromlist"] = array();
												$proto24=array();
$proto24["m_link"] = "SQLL_MAIN";
			$proto25=array();
$proto25["m_strName"] = "sale_details";
$proto25["m_srcTableName"] = "sale_details";
$proto25["m_columns"] = array();
$proto25["m_columns"][] = "id";
$proto25["m_columns"][] = "mid";
$proto25["m_columns"][] = "product_code";
$proto25["m_columns"][] = "quantity";
$proto25["m_columns"][] = "cost_price";
$proto25["m_columns"][] = "selling_price";
$proto25["m_columns"][] = "discount";
$proto25["m_columns"][] = "tax";
$proto25["m_columns"][] = "tbid";
$obj = new SQLTable($proto25);

$proto24["m_table"] = $obj;
$proto24["m_sql"] = "sale_details";
$proto24["m_alias"] = "";
$proto24["m_srcTableName"] = "sale_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"]="sale_details";		
$obj = new SQLQuery($proto0);

	return $obj;
}
$queryData_sale_details = createSqlQuery_sale_details();


	
		;

									

$tdatasale_details[".sqlquery"] = $queryData_sale_details;



$tableEvents["sale_details"] = new eventsBase;
$tdatasale_details[".hasEvents"] = false;

?>