<?php
$tdatasales = array();
$tdatasales[".searchableFields"] = array();
$tdatasales[".ShortName"] = "sales";
$tdatasales[".OwnerID"] = "outlet_code";
$tdatasales[".OriginalTable"] = "sales";


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

//	field labels
$fieldLabelssales = array();
$fieldToolTipssales = array();
$pageTitlessales = array();
$placeHolderssales = array();

if(mlang_getcurrentlang()=="English")
{
	$fieldLabelssales["English"] = array();
	$fieldToolTipssales["English"] = array();
	$placeHolderssales["English"] = array();
	$pageTitlessales["English"] = array();
	$fieldLabelssales["English"]["id"] = "Id";
	$fieldToolTipssales["English"]["id"] = "";
	$placeHolderssales["English"]["id"] = "";
	$fieldLabelssales["English"]["customer_name"] = "Customer Name";
	$fieldToolTipssales["English"]["customer_name"] = "";
	$placeHolderssales["English"]["customer_name"] = "";
	$fieldLabelssales["English"]["cash"] = "Cash";
	$fieldToolTipssales["English"]["cash"] = "";
	$placeHolderssales["English"]["cash"] = "";
	$fieldLabelssales["English"]["tt"] = "Tt";
	$fieldToolTipssales["English"]["tt"] = "";
	$placeHolderssales["English"]["tt"] = "";
	$fieldLabelssales["English"]["date___time"] = "Date & Time";
	$fieldToolTipssales["English"]["date___time"] = "";
	$placeHolderssales["English"]["date___time"] = "";
	$fieldLabelssales["English"]["user"] = "User";
	$fieldToolTipssales["English"]["user"] = "";
	$placeHolderssales["English"]["user"] = "";
	$fieldLabelssales["English"]["company_name"] = "Company Name";
	$fieldToolTipssales["English"]["company_name"] = "";
	$placeHolderssales["English"]["company_name"] = "";
	$fieldLabelssales["English"]["address_line_1"] = "Address Line 1";
	$fieldToolTipssales["English"]["address_line_1"] = "";
	$placeHolderssales["English"]["address_line_1"] = "";
	$fieldLabelssales["English"]["address_line_2"] = "Address Line 2";
	$fieldToolTipssales["English"]["address_line_2"] = "";
	$placeHolderssales["English"]["address_line_2"] = "";
	$fieldLabelssales["English"]["hot_line"] = "Hot Line";
	$fieldToolTipssales["English"]["hot_line"] = "";
	$placeHolderssales["English"]["hot_line"] = "";
	$fieldLabelssales["English"]["Fax"] = "Fax";
	$fieldToolTipssales["English"]["Fax"] = "";
	$placeHolderssales["English"]["Fax"] = "";
	$fieldLabelssales["English"]["email"] = "Email";
	$fieldToolTipssales["English"]["email"] = "";
	$placeHolderssales["English"]["email"] = "";
	$fieldLabelssales["English"]["header"] = "Header";
	$fieldToolTipssales["English"]["header"] = "";
	$placeHolderssales["English"]["header"] = "";
	$fieldLabelssales["English"]["footer"] = "Footer";
	$fieldToolTipssales["English"]["footer"] = "";
	$placeHolderssales["English"]["footer"] = "";
	$fieldLabelssales["English"]["logo"] = "Logo";
	$fieldToolTipssales["English"]["logo"] = "";
	$placeHolderssales["English"]["logo"] = "";
	$fieldLabelssales["English"]["total_amount"] = "Total Amount";
	$fieldToolTipssales["English"]["total_amount"] = "";
	$placeHolderssales["English"]["total_amount"] = "";
	$fieldLabelssales["English"]["difect"] = "Difect";
	$fieldToolTipssales["English"]["difect"] = "";
	$placeHolderssales["English"]["difect"] = "";
	$fieldLabelssales["English"]["Balance"] = "Balance";
	$fieldToolTipssales["English"]["Balance"] = "";
	$placeHolderssales["English"]["Balance"] = "";
	$fieldLabelssales["English"]["branch_code"] = "Branch Code";
	$fieldToolTipssales["English"]["branch_code"] = "";
	$placeHolderssales["English"]["branch_code"] = "";
	$fieldLabelssales["English"]["outlet_code"] = "Outlet Code";
	$fieldToolTipssales["English"]["outlet_code"] = "";
	$placeHolderssales["English"]["outlet_code"] = "";
	$fieldLabelssales["English"]["h"] = "H";
	$fieldToolTipssales["English"]["h"] = "";
	$placeHolderssales["English"]["h"] = "";
	$fieldLabelssales["English"]["f"] = "F";
	$fieldToolTipssales["English"]["f"] = "";
	$placeHolderssales["English"]["f"] = "";
	$fieldLabelssales["English"]["paid"] = "Paid";
	$fieldToolTipssales["English"]["paid"] = "";
	$placeHolderssales["English"]["paid"] = "";
	$fieldLabelssales["English"]["status"] = "Status";
	$fieldToolTipssales["English"]["status"] = "";
	$placeHolderssales["English"]["status"] = "";
	$pageTitlessales["English"]["edit"] = "Sales, Add Product to- {%id}";
	if (count($fieldToolTipssales["English"]))
		$tdatasales[".isUseToolTips"] = true;
}


	$tdatasales[".NCSearch"] = true;



$tdatasales[".shortTableName"] = "sales";
$tdatasales[".nSecOptions"] = 1;

$tdatasales[".mainTableOwnerID"] = "outlet_code";
$tdatasales[".entityType"] = 0;
$tdatasales[".connId"] = "test2_at_localhost";


$tdatasales[".strOriginalTableName"] = "sales";

	



$tdatasales[".showAddInPopup"] = false;

$tdatasales[".showEditInPopup"] = false;

$tdatasales[".showViewInPopup"] = false;

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


	$tdatasales[".listAjax"] = true;
//	temporary
$tdatasales[".listAjax"] = false;

	$tdatasales[".audit"] = true;

	$tdatasales[".locking"] = false;


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

if( $pages[PAGE_EDIT] ) {
	$tdatasales[".edit"] = true;
	$tdatasales[".afterEditAction"] = 2;
	$tdatasales[".closePopupAfterEdit"] = 0;
	$tdatasales[".afterEditActionDetTable"] = "table5";
}

if( $pages[PAGE_ADD] ) {
$tdatasales[".add"] = true;
$tdatasales[".afterAddAction"] = 2;
$tdatasales[".closePopupAfterAdd"] = 0;
$tdatasales[".afterAddActionDetTable"] = "details";
}

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



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




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

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

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

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



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

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

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

$tdatasales[".isUseAjaxSuggest"] = true;

$tdatasales[".rowHighlite"] = true;



					
																																															

$tdatasales[".ajaxCodeSnippetAdded"] = false;

$tdatasales[".buttonsAdded"] = true;

$tdatasales[".addPageEvents"] = true;

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


$tdatasales[".badgeColor"] = "1E90FF";


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

$tdatasales[".googleLikeFields"] = array();
$tdatasales[".googleLikeFields"][] = "id";
$tdatasales[".googleLikeFields"][] = "customer_name";
$tdatasales[".googleLikeFields"][] = "cash";
$tdatasales[".googleLikeFields"][] = "tt";
$tdatasales[".googleLikeFields"][] = "date_&_time";
$tdatasales[".googleLikeFields"][] = "branch_code";
$tdatasales[".googleLikeFields"][] = "outlet_code";
$tdatasales[".googleLikeFields"][] = "user";
$tdatasales[".googleLikeFields"][] = "h";
$tdatasales[".googleLikeFields"][] = "f";
$tdatasales[".googleLikeFields"][] = "status";
$tdatasales[".googleLikeFields"][] = "company_name";
$tdatasales[".googleLikeFields"][] = "address_line_1";
$tdatasales[".googleLikeFields"][] = "address_line_2";
$tdatasales[".googleLikeFields"][] = "Fax";
$tdatasales[".googleLikeFields"][] = "email";
$tdatasales[".googleLikeFields"][] = "logo";
$tdatasales[".googleLikeFields"][] = "header";
$tdatasales[".googleLikeFields"][] = "footer";
$tdatasales[".googleLikeFields"][] = "hot_line";
$tdatasales[".googleLikeFields"][] = "total amount";
$tdatasales[".googleLikeFields"][] = "paid";
$tdatasales[".googleLikeFields"][] = "difect";
$tdatasales[".googleLikeFields"][] = "Balance";



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

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

$tdatasales[".nPrinterSplitRecords"] = 40;

$tdatasales[".geocodingEnabled"] = false;





$tdatasales[".isResizeColumns"] = true;





$tdatasales[".pageSize"] = 20;

$tdatasales[".warnLeavingPages"] = true;



$tstrOrderBy = "ORDER BY `sales`.`id`  DESC";
if(strlen($tstrOrderBy) && strtolower(substr($tstrOrderBy,0,8))!="order by")
	$tstrOrderBy = "order by ".$tstrOrderBy;
$tdatasales[".strOrderBy"] = $tstrOrderBy;

$tdatasales[".orderindexes"] = array();
	$tdatasales[".orderindexes"][] = array(1, (0 ? "ASC" : "DESC"), "sales.id");



$tdatasales[".sqlHead"] = "SELECT sales.id,  sales.customer_name,  sales.cash,  sales.tt,  sales.`date_&_time`,  sales.branch_code,  sales.outlet_code,  sales.`user`,  sales.h,  sales.f,sales.status,  company_profile.company_name,  company_profile.address_line_1,  company_profile.address_line_2,  company_profile.Fax,  company_profile.email,  company_profile.logo,  company_profile.header,  company_profile.footer,  company_profile.hot_line,  ifnull(sold.sol,0) AS \"total amount\",  ifnull(purch.pur,0)as \"paid\" ,  ifnull(case when (ifnull(sold.sol,0)> ifnull(purch.pur,0)) then  ((ifnull(sold.sol,0)) - (ifnull(purch.pur,0)))end,0) as \"difect\",  ifnull(case when (ifnull(sold.sol,0)<= sales.cash) then (sales.cash - (ifnull(sold.sol,0)))end,0) as \"Balance\"";
$tdatasales[".sqlFrom"] = "FROM sales    LEFT JOIN (select `m_id`, sum(`quntity`*`price`) as sol from sales_details  group by `m_id` ) as sold on sales.`id` = sold.`m_id`  left join (SELECT `sales_id`,SUM(`amount`) as pur from payments group by `sales_id`) as purch on sales.id = purch.sales_id  LEFT OUTER JOIN sys_manage ON sales.`user` = sys_manage.username  INNER JOIN company_profile ON sys_manage.outlet_code = company_profile.id";
$tdatasales[".sqlWhereExpr"] = "";
$tdatasales[".sqlTail"] = "";

//fill array of tabs for list page
$arrGridTabs = array();
$arrGridTabs[] = array(
	'tabId' => "",
	'name' => "All data",
	'nameType' => 'Text',
	'where' => "",
	'showRowCount' => 0,
	'hideEmpty' => 0,
);
$tdatasales[".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;
$tdatasales[".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;
$tdatasales[".arrGroupsPerPage"] = $arrGPP;

$tdatasales[".highlightSearchResults"] = true;

$tableKeyssales = array();
$tableKeyssales[] = "id";
$tdatasales[".Keys"] = $tableKeyssales;


$tdatasales[".hideMobileList"] = array();
		$tdatasales[".hideMobileList"][1] = array();
$tdatasales[".hideMobileList"][1]["cash"] = true;
		$tdatasales[".hideMobileList"][1]["Balance"] = true;
		$tdatasales[".hideMobileList"][5] = array();
$tdatasales[".hideMobileList"][5]["cash"] = true;
		$tdatasales[".hideMobileList"][5]["Balance"] = true;




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

	
		$fdata["AutoInc"] = true;

	
			

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

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


	$tdatasales["id"] = $fdata;
		$tdatasales[".searchableFields"][] = "id";
//	customer_name
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 2;
	$fdata["strName"] = "customer_name";
	$fdata["GoodName"] = "customer_name";
	$fdata["ownerTable"] = "sales";
	$fdata["Label"] = GetFieldLabel("sales","customer_name");
	$fdata["FieldType"] = 200;

	
	
	
			

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

	
		$fdata["isSQLExpression"] = true;
	$fdata["FullName"] = "sales.customer_name";

	
	
				$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;
	$vdata = array("ViewFormat" => "");

	
	
	
	
	
	
	
	
	
	
	
		
	
		$vdata["NeedEncode"] = true;

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

	$fdata["ViewFormats"]["list"] = $vdata;
	$vdata = array("ViewFormat" => "");

	
	
	
	
	
	
	
	
	
	
	
		
	
		$vdata["NeedEncode"] = true;

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

	$fdata["ViewFormats"]["print"] = $vdata;
	$vdata = array("ViewFormat" => "");

	
	
	
	
	
	
	
	
	
	
	
		
	
		$vdata["NeedEncode"] = true;

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

	$fdata["ViewFormats"]["export"] = $vdata;
	$vdata = array("ViewFormat" => "");

	
	
	
	
	
	
	
	
	
	
	
		
	
		$vdata["NeedEncode"] = true;

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

	$fdata["ViewFormats"]["masterlist"] = $vdata;
	$vdata = array("ViewFormat" => "");

	
	
	
	
	
	
	
	
	
	
	
		
	
		$vdata["NeedEncode"] = true;

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

	$fdata["ViewFormats"]["masterprint"] = $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"] = "buyers";
			$edata["freeInput"] = true;
	$edata["autoCompleteFieldsOnEdit"] = 0;
	$edata["autoCompleteFields"] = array();
		$edata["LCType"] = 1;

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

	

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

	
	
		$edata["AllowToAdd"] = true;
		
	

	
	
	
// 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;
	$edata = array("EditFormat" => "Lookup wizard");

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


	
	

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

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

	

	
	$edata["LookupOrderBy"] = "buyer_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"]["add"] = $edata;
	$edata = array("EditFormat" => "Lookup wizard");

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


	
	

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

	
		
	$edata["LinkField"] = "customer_name";
	$edata["LinkFieldType"] = 0;
	$edata["DisplayField"] = "CONCAT( customer_name,\", \", address,\", \",phone_number)";

	

		$edata["CustomDisplay"] = "true";

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

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

	

	
	
	
// End Lookup Settings


	
	
	
	
			$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"]["search"] = $edata;
//	End Edit Formats


	$fdata["isSeparate"] = true;




// 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


	$tdatasales["customer_name"] = $fdata;
		$tdatasales[".searchableFields"][] = "customer_name";
//	cash
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 3;
	$fdata["strName"] = "cash";
	$fdata["GoodName"] = "cash";
	$fdata["ownerTable"] = "sales";
	$fdata["Label"] = GetFieldLabel("sales","cash");
	$fdata["FieldType"] = 14;

	
	
	
			

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

	
		$fdata["isSQLExpression"] = true;
	$fdata["FullName"] = "sales.cash";

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


	
		$eventsData = array();
	$eventsData[] = array( "name" => "quntity_event", "type" => "editing" );
	$eventsData[] = array( "name" => "quntity_event", "type" => "mouseover" );
	$eventsData[] = array( "name" => "quntity_event", "type" => "click" );
	$edata["fieldEvents"] = $eventsData;




		$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


	$tdatasales["cash"] = $fdata;
		$tdatasales[".searchableFields"][] = "cash";
//	tt
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 4;
	$fdata["strName"] = "tt";
	$fdata["GoodName"] = "tt";
	$fdata["ownerTable"] = "sales";
	$fdata["Label"] = GetFieldLabel("sales","tt");
	$fdata["FieldType"] = 14;

	
	
	
			

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

	
		$fdata["isSQLExpression"] = true;
	$fdata["FullName"] = "sales.tt";

	
	
				$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["EditParams"].= " maxlength=50";

		$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


	$tdatasales["tt"] = $fdata;
		$tdatasales[".searchableFields"][] = "tt";
//	date_&_time
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 5;
	$fdata["strName"] = "date_&_time";
	$fdata["GoodName"] = "date___time";
	$fdata["ownerTable"] = "sales";
	$fdata["Label"] = GetFieldLabel("sales","date___time");
	$fdata["FieldType"] = 135;

	
	
	
			

		$fdata["strField"] = "date_&_time";

	
		$fdata["isSQLExpression"] = true;
	$fdata["FullName"] = "sales.`date_&_time`";

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

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

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

	
	
	
	
	
	
	
	
	
	
	
		
	
		$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" => "Invalid week day", "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"] = "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


	$tdatasales["date_&_time"] = $fdata;
		$tdatasales[".searchableFields"][] = "date_&_time";
//	branch_code
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 6;
	$fdata["strName"] = "branch_code";
	$fdata["GoodName"] = "branch_code";
	$fdata["ownerTable"] = "sales";
	$fdata["Label"] = GetFieldLabel("sales","branch_code");
	$fdata["FieldType"] = 200;

	
	
	
			

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

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


	$tdatasales["branch_code"] = $fdata;
		$tdatasales[".searchableFields"][] = "branch_code";
//	outlet_code
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 7;
	$fdata["strName"] = "outlet_code";
	$fdata["GoodName"] = "outlet_code";
	$fdata["ownerTable"] = "sales";
	$fdata["Label"] = GetFieldLabel("sales","outlet_code");
	$fdata["FieldType"] = 3;

	
	
	
			

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

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


	$tdatasales["outlet_code"] = $fdata;
		$tdatasales[".searchableFields"][] = "outlet_code";
//	user
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 8;
	$fdata["strName"] = "user";
	$fdata["GoodName"] = "user";
	$fdata["ownerTable"] = "sales";
	$fdata["Label"] = GetFieldLabel("sales","user");
	$fdata["FieldType"] = 200;

	
	
	
			

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

	
		$fdata["isSQLExpression"] = true;
	$fdata["FullName"] = "sales.`user`";

	
	
				$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();
	
		$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


	$tdatasales["user"] = $fdata;
		$tdatasales[".searchableFields"][] = "user";
//	h
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 9;
	$fdata["strName"] = "h";
	$fdata["GoodName"] = "h";
	$fdata["ownerTable"] = "sales";
	$fdata["Label"] = GetFieldLabel("sales","h");
	$fdata["FieldType"] = 3;

	
	
	
			

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

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

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

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

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

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

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

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

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

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


	$tdatasales["h"] = $fdata;
		$tdatasales[".searchableFields"][] = "h";
//	f
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 10;
	$fdata["strName"] = "f";
	$fdata["GoodName"] = "f";
	$fdata["ownerTable"] = "sales";
	$fdata["Label"] = GetFieldLabel("sales","f");
	$fdata["FieldType"] = 3;

	
	
	
			

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

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

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

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

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

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

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

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

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

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


	$tdatasales["f"] = $fdata;
		$tdatasales[".searchableFields"][] = "f";
//	status
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 11;
	$fdata["strName"] = "status";
	$fdata["GoodName"] = "status";
	$fdata["ownerTable"] = "sales";
	$fdata["Label"] = GetFieldLabel("sales","status");
	$fdata["FieldType"] = 200;

	
	
	
			

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

	
		$fdata["isSQLExpression"] = true;
	$fdata["FullName"] = "sales.status";

	
	
				$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


	$tdatasales["status"] = $fdata;
		$tdatasales[".searchableFields"][] = "status";
//	company_name
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 12;
	$fdata["strName"] = "company_name";
	$fdata["GoodName"] = "company_name";
	$fdata["ownerTable"] = "company_profile";
	$fdata["Label"] = GetFieldLabel("sales","company_name");
	$fdata["FieldType"] = 200;

	
	
	
			

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

	
		$fdata["isSQLExpression"] = true;
	$fdata["FullName"] = "company_profile.company_name";

	
	
				$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();
	
	
	//	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


	$tdatasales["company_name"] = $fdata;
		$tdatasales[".searchableFields"][] = "company_name";
//	address_line_1
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 13;
	$fdata["strName"] = "address_line_1";
	$fdata["GoodName"] = "address_line_1";
	$fdata["ownerTable"] = "company_profile";
	$fdata["Label"] = GetFieldLabel("sales","address_line_1");
	$fdata["FieldType"] = 200;

	
	
	
			

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

	
		$fdata["isSQLExpression"] = true;
	$fdata["FullName"] = "company_profile.address_line_1";

	
	
				$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();
	
	
	//	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


	$tdatasales["address_line_1"] = $fdata;
		$tdatasales[".searchableFields"][] = "address_line_1";
//	address_line_2
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 14;
	$fdata["strName"] = "address_line_2";
	$fdata["GoodName"] = "address_line_2";
	$fdata["ownerTable"] = "company_profile";
	$fdata["Label"] = GetFieldLabel("sales","address_line_2");
	$fdata["FieldType"] = 200;

	
	
	
			

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

	
		$fdata["isSQLExpression"] = true;
	$fdata["FullName"] = "company_profile.address_line_2";

	
	
				$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();
	
	
	//	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


	$tdatasales["address_line_2"] = $fdata;
		$tdatasales[".searchableFields"][] = "address_line_2";
//	Fax
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 15;
	$fdata["strName"] = "Fax";
	$fdata["GoodName"] = "Fax";
	$fdata["ownerTable"] = "company_profile";
	$fdata["Label"] = GetFieldLabel("sales","Fax");
	$fdata["FieldType"] = 200;

	
	
	
			

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

	
		$fdata["isSQLExpression"] = true;
	$fdata["FullName"] = "company_profile.Fax";

	
	
				$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();
	
	
	//	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


	$tdatasales["Fax"] = $fdata;
		$tdatasales[".searchableFields"][] = "Fax";
//	email
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 16;
	$fdata["strName"] = "email";
	$fdata["GoodName"] = "email";
	$fdata["ownerTable"] = "company_profile";
	$fdata["Label"] = GetFieldLabel("sales","email");
	$fdata["FieldType"] = 200;

	
	
	
			

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

	
		$fdata["isSQLExpression"] = true;
	$fdata["FullName"] = "company_profile.email";

	
	
				$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();
	
	
	//	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


	$tdatasales["email"] = $fdata;
		$tdatasales[".searchableFields"][] = "email";
//	logo
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 17;
	$fdata["strName"] = "logo";
	$fdata["GoodName"] = "logo";
	$fdata["ownerTable"] = "company_profile";
	$fdata["Label"] = GetFieldLabel("sales","logo");
	$fdata["FieldType"] = 200;

	
	
	
			

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

	
		$fdata["isSQLExpression"] = true;
	$fdata["FullName"] = "company_profile.logo";

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

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

	$vdata = array("ViewFormat" => "File-based Image");

	
	
				$vdata["ImageWidth"] = 150;
	$vdata["ImageHeight"] = 75;

			$vdata["multipleImgMode"] = 2;
	$vdata["maxImages"] = 1;

		
	$vdata["imageBorder"] = 0;
	$vdata["imageFullWidth"] = 0;


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

	$fdata["ViewFormats"]["view"] = $vdata;
	$vdata = array("ViewFormat" => "File-based Image");

	
	
				$vdata["ImageWidth"] = 600;
	$vdata["ImageHeight"] = 400;

			$vdata["multipleImgMode"] = 2;
	$vdata["maxImages"] = 1;

			$vdata["showGallery"] = true;
	$vdata["galleryMode"] = 2;
	$vdata["captionMode"] = 2;
	$vdata["captionField"] = "";

	$vdata["imageBorder"] = 1;
	$vdata["imageFullWidth"] = 1;


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

	$fdata["ViewFormats"]["list"] = $vdata;
	$vdata = array("ViewFormat" => "File-based Image");

	
	
				$vdata["ImageWidth"] = 600;
	$vdata["ImageHeight"] = 400;

			$vdata["multipleImgMode"] = 2;
	$vdata["maxImages"] = 1;

			$vdata["showGallery"] = true;
	$vdata["galleryMode"] = 2;
	$vdata["captionMode"] = 2;
	$vdata["captionField"] = "";

	$vdata["imageBorder"] = 1;
	$vdata["imageFullWidth"] = 1;


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

	$fdata["ViewFormats"]["export"] = $vdata;
	$vdata = array("ViewFormat" => "File-based Image");

	
	
				$vdata["ImageWidth"] = 600;
	$vdata["ImageHeight"] = 400;

			$vdata["multipleImgMode"] = 2;
	$vdata["maxImages"] = 1;

			$vdata["showGallery"] = true;
	$vdata["galleryMode"] = 2;
	$vdata["captionMode"] = 2;
	$vdata["captionField"] = "";

	$vdata["imageBorder"] = 1;
	$vdata["imageFullWidth"] = 1;


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

	$fdata["ViewFormats"]["masterlist"] = $vdata;
	$vdata = array("ViewFormat" => "File-based Image");

	
	
				$vdata["ImageWidth"] = 600;
	$vdata["ImageHeight"] = 400;

			$vdata["multipleImgMode"] = 2;
	$vdata["maxImages"] = 1;

			$vdata["showGallery"] = true;
	$vdata["galleryMode"] = 2;
	$vdata["captionMode"] = 2;
	$vdata["captionField"] = "";

	$vdata["imageBorder"] = 1;
	$vdata["imageFullWidth"] = 1;


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

	$fdata["ViewFormats"]["masterprint"] = $vdata;
	$vdata = array("ViewFormat" => "File-based Image");

	
	
				$vdata["ImageWidth"] = 150;
	$vdata["ImageHeight"] = 75;

			$vdata["multipleImgMode"] = 2;
	$vdata["maxImages"] = 1;

		
	$vdata["imageBorder"] = 0;
	$vdata["imageFullWidth"] = 0;


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

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

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

	$edata = array("EditFormat" => "Document upload");

	
		$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;
	$edata = array("EditFormat" => "Document upload");

	
		$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"]["add"] = $edata;
	$edata = array("EditFormat" => "Document upload");

	
		$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"]["search"] = $edata;
//	End Edit Formats


	$fdata["isSeparate"] = true;


	$fdata["Absolute"] = true;


// 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


	$tdatasales["logo"] = $fdata;
		$tdatasales[".searchableFields"][] = "logo";
//	header
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 18;
	$fdata["strName"] = "header";
	$fdata["GoodName"] = "header";
	$fdata["ownerTable"] = "company_profile";
	$fdata["Label"] = GetFieldLabel("sales","header");
	$fdata["FieldType"] = 200;

	
	
	
			

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

	
		$fdata["isSQLExpression"] = true;
	$fdata["FullName"] = "company_profile.header";

	
	
				$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();
	
	
	//	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


	$tdatasales["header"] = $fdata;
		$tdatasales[".searchableFields"][] = "header";
//	footer
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 19;
	$fdata["strName"] = "footer";
	$fdata["GoodName"] = "footer";
	$fdata["ownerTable"] = "company_profile";
	$fdata["Label"] = GetFieldLabel("sales","footer");
	$fdata["FieldType"] = 200;

	
	
	
			

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

	
		$fdata["isSQLExpression"] = true;
	$fdata["FullName"] = "company_profile.footer";

	
	
				$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();
	
	
	//	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


	$tdatasales["footer"] = $fdata;
		$tdatasales[".searchableFields"][] = "footer";
//	hot_line
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 20;
	$fdata["strName"] = "hot_line";
	$fdata["GoodName"] = "hot_line";
	$fdata["ownerTable"] = "company_profile";
	$fdata["Label"] = GetFieldLabel("sales","hot_line");
	$fdata["FieldType"] = 200;

	
	
	
			

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

	
		$fdata["isSQLExpression"] = true;
	$fdata["FullName"] = "company_profile.hot_line";

	
	
				$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();
	
	
	//	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


	$tdatasales["hot_line"] = $fdata;
		$tdatasales[".searchableFields"][] = "hot_line";
//	total amount
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 21;
	$fdata["strName"] = "total amount";
	$fdata["GoodName"] = "total_amount";
	$fdata["ownerTable"] = "";
	$fdata["Label"] = GetFieldLabel("sales","total_amount");
	$fdata["FieldType"] = 14;

	
	
	
			

		$fdata["strField"] = "total amount";

	
		$fdata["isSQLExpression"] = true;
	$fdata["FullName"] = "ifnull(sold.sol,0)";

	
	
				$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


	$tdatasales["total amount"] = $fdata;
		$tdatasales[".searchableFields"][] = "total amount";
//	paid
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 22;
	$fdata["strName"] = "paid";
	$fdata["GoodName"] = "paid";
	$fdata["ownerTable"] = "";
	$fdata["Label"] = GetFieldLabel("sales","paid");
	$fdata["FieldType"] = 14;

	
	
	
			

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

	
		$fdata["isSQLExpression"] = true;
	$fdata["FullName"] = "ifnull(purch.pur,0)";

	
	
				$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


	$tdatasales["paid"] = $fdata;
		$tdatasales[".searchableFields"][] = "paid";
//	difect
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 23;
	$fdata["strName"] = "difect";
	$fdata["GoodName"] = "difect";
	$fdata["ownerTable"] = "";
	$fdata["Label"] = GetFieldLabel("sales","difect");
	$fdata["FieldType"] = 14;

	
	
	
			

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

	
		$fdata["isSQLExpression"] = true;
	$fdata["FullName"] = "ifnull(case when (ifnull(sold.sol,0)> ifnull(purch.pur,0)) then  ((ifnull(sold.sol,0)) - (ifnull(purch.pur,0)))end,0)";

	
	
				$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


	$tdatasales["difect"] = $fdata;
		$tdatasales[".searchableFields"][] = "difect";
//	Balance
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 24;
	$fdata["strName"] = "Balance";
	$fdata["GoodName"] = "Balance";
	$fdata["ownerTable"] = "";
	$fdata["Label"] = GetFieldLabel("sales","Balance");
	$fdata["FieldType"] = 14;

	
	
	
			

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

	
		$fdata["isSQLExpression"] = true;
	$fdata["FullName"] = "ifnull(case when (ifnull(sold.sol,0)<= sales.cash) then (sales.cash - (ifnull(sold.sol,0)))end,0)";

	
	
				$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


	$tdatasales["Balance"] = $fdata;
		$tdatasales[".searchableFields"][] = "Balance";


$tables_data["sales"]=&$tdatasales;
$field_labels["sales"] = &$fieldLabelssales;
$fieldToolTips["sales"] = &$fieldToolTipssales;
$placeHolders["sales"] = &$placeHolderssales;
$page_titles["sales"] = &$pageTitlessales;

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

		$dIndex = 0;
	$detailsParam = array();
	$detailsParam["dDataSourceTable"]="sales_details";
		$detailsParam["dOriginalTable"] = "sales_details";



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


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

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

	$detailsTablesData["sales"][$dIndex]["masterKeys"][]="id";

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

	$detailsTablesData["sales"][$dIndex]["detailKeys"][]="m_id";
//	details
	
	

		$dIndex = 1;
	$detailsParam = array();
	$detailsParam["dDataSourceTable"]="details";
		$detailsParam["dOriginalTable"] = "sales_details";



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


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

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

	$detailsTablesData["sales"][$dIndex]["masterKeys"][]="id";

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

	$detailsTablesData["sales"][$dIndex]["detailKeys"][]="m_id";

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



// -----------------end  prepare master-details data arrays ------------------------------//



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











function createSqlQuery_sales()
{
$proto0=array();
$proto0["m_strHead"] = "SELECT";
$proto0["m_strFieldList"] = "sales.id,  sales.customer_name,  sales.cash,  sales.tt,  sales.`date_&_time`,  sales.branch_code,  sales.outlet_code,  sales.`user`,  sales.h,  sales.f,sales.status,  company_profile.company_name,  company_profile.address_line_1,  company_profile.address_line_2,  company_profile.Fax,  company_profile.email,  company_profile.logo,  company_profile.header,  company_profile.footer,  company_profile.hot_line,  ifnull(sold.sol,0) AS \"total amount\",  ifnull(purch.pur,0)as \"paid\" ,  ifnull(case when (ifnull(sold.sol,0)> ifnull(purch.pur,0)) then  ((ifnull(sold.sol,0)) - (ifnull(purch.pur,0)))end,0) as \"difect\",  ifnull(case when (ifnull(sold.sol,0)<= sales.cash) then (sales.cash - (ifnull(sold.sol,0)))end,0) as \"Balance\"";
$proto0["m_strFrom"] = "FROM sales    LEFT JOIN (select `m_id`, sum(`quntity`*`price`) as sol from sales_details  group by `m_id` ) as sold on sales.`id` = sold.`m_id`  left join (SELECT `sales_id`,SUM(`amount`) as pur from payments group by `sales_id`) as purch on sales.id = purch.sales_id  LEFT OUTER JOIN sys_manage ON sales.`user` = sys_manage.username  INNER JOIN company_profile ON sys_manage.outlet_code = company_profile.id";
$proto0["m_strWhere"] = "";
$proto0["m_strOrderBy"] = "ORDER BY `sales`.`id`  DESC";
	
		;
			$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" => "sales",
	"m_srcTableName" => "sales"
));

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

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

$proto8["m_sql"] = "sales.customer_name";
$proto8["m_srcTableName"] = "sales";
$proto8["m_expr"]=$obj;
$proto8["m_alias"] = "";
$obj = new SQLFieldListItem($proto8);

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

$proto10["m_sql"] = "sales.cash";
$proto10["m_srcTableName"] = "sales";
$proto10["m_expr"]=$obj;
$proto10["m_alias"] = "";
$obj = new SQLFieldListItem($proto10);

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

$proto12["m_sql"] = "sales.tt";
$proto12["m_srcTableName"] = "sales";
$proto12["m_expr"]=$obj;
$proto12["m_alias"] = "";
$obj = new SQLFieldListItem($proto12);

$proto0["m_fieldlist"][]=$obj;
						$proto14=array();
			$obj = new SQLField(array(
	"m_strName" => "date_&_time",
	"m_strTable" => "sales",
	"m_srcTableName" => "sales"
));

$proto14["m_sql"] = "sales.`date_&_time`";
$proto14["m_srcTableName"] = "sales";
$proto14["m_expr"]=$obj;
$proto14["m_alias"] = "";
$obj = new SQLFieldListItem($proto14);

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

$proto16["m_sql"] = "sales.branch_code";
$proto16["m_srcTableName"] = "sales";
$proto16["m_expr"]=$obj;
$proto16["m_alias"] = "";
$obj = new SQLFieldListItem($proto16);

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

$proto18["m_sql"] = "sales.outlet_code";
$proto18["m_srcTableName"] = "sales";
$proto18["m_expr"]=$obj;
$proto18["m_alias"] = "";
$obj = new SQLFieldListItem($proto18);

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

$proto20["m_sql"] = "sales.`user`";
$proto20["m_srcTableName"] = "sales";
$proto20["m_expr"]=$obj;
$proto20["m_alias"] = "";
$obj = new SQLFieldListItem($proto20);

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

$proto22["m_sql"] = "sales.h";
$proto22["m_srcTableName"] = "sales";
$proto22["m_expr"]=$obj;
$proto22["m_alias"] = "";
$obj = new SQLFieldListItem($proto22);

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

$proto24["m_sql"] = "sales.f";
$proto24["m_srcTableName"] = "sales";
$proto24["m_expr"]=$obj;
$proto24["m_alias"] = "";
$obj = new SQLFieldListItem($proto24);

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

$proto26["m_sql"] = "sales.status";
$proto26["m_srcTableName"] = "sales";
$proto26["m_expr"]=$obj;
$proto26["m_alias"] = "";
$obj = new SQLFieldListItem($proto26);

$proto0["m_fieldlist"][]=$obj;
						$proto28=array();
			$obj = new SQLField(array(
	"m_strName" => "company_name",
	"m_strTable" => "company_profile",
	"m_srcTableName" => "sales"
));

$proto28["m_sql"] = "company_profile.company_name";
$proto28["m_srcTableName"] = "sales";
$proto28["m_expr"]=$obj;
$proto28["m_alias"] = "";
$obj = new SQLFieldListItem($proto28);

$proto0["m_fieldlist"][]=$obj;
						$proto30=array();
			$obj = new SQLField(array(
	"m_strName" => "address_line_1",
	"m_strTable" => "company_profile",
	"m_srcTableName" => "sales"
));

$proto30["m_sql"] = "company_profile.address_line_1";
$proto30["m_srcTableName"] = "sales";
$proto30["m_expr"]=$obj;
$proto30["m_alias"] = "";
$obj = new SQLFieldListItem($proto30);

$proto0["m_fieldlist"][]=$obj;
						$proto32=array();
			$obj = new SQLField(array(
	"m_strName" => "address_line_2",
	"m_strTable" => "company_profile",
	"m_srcTableName" => "sales"
));

$proto32["m_sql"] = "company_profile.address_line_2";
$proto32["m_srcTableName"] = "sales";
$proto32["m_expr"]=$obj;
$proto32["m_alias"] = "";
$obj = new SQLFieldListItem($proto32);

$proto0["m_fieldlist"][]=$obj;
						$proto34=array();
			$obj = new SQLField(array(
	"m_strName" => "Fax",
	"m_strTable" => "company_profile",
	"m_srcTableName" => "sales"
));

$proto34["m_sql"] = "company_profile.Fax";
$proto34["m_srcTableName"] = "sales";
$proto34["m_expr"]=$obj;
$proto34["m_alias"] = "";
$obj = new SQLFieldListItem($proto34);

$proto0["m_fieldlist"][]=$obj;
						$proto36=array();
			$obj = new SQLField(array(
	"m_strName" => "email",
	"m_strTable" => "company_profile",
	"m_srcTableName" => "sales"
));

$proto36["m_sql"] = "company_profile.email";
$proto36["m_srcTableName"] = "sales";
$proto36["m_expr"]=$obj;
$proto36["m_alias"] = "";
$obj = new SQLFieldListItem($proto36);

$proto0["m_fieldlist"][]=$obj;
						$proto38=array();
			$obj = new SQLField(array(
	"m_strName" => "logo",
	"m_strTable" => "company_profile",
	"m_srcTableName" => "sales"
));

$proto38["m_sql"] = "company_profile.logo";
$proto38["m_srcTableName"] = "sales";
$proto38["m_expr"]=$obj;
$proto38["m_alias"] = "";
$obj = new SQLFieldListItem($proto38);

$proto0["m_fieldlist"][]=$obj;
						$proto40=array();
			$obj = new SQLField(array(
	"m_strName" => "header",
	"m_strTable" => "company_profile",
	"m_srcTableName" => "sales"
));

$proto40["m_sql"] = "company_profile.header";
$proto40["m_srcTableName"] = "sales";
$proto40["m_expr"]=$obj;
$proto40["m_alias"] = "";
$obj = new SQLFieldListItem($proto40);

$proto0["m_fieldlist"][]=$obj;
						$proto42=array();
			$obj = new SQLField(array(
	"m_strName" => "footer",
	"m_strTable" => "company_profile",
	"m_srcTableName" => "sales"
));

$proto42["m_sql"] = "company_profile.footer";
$proto42["m_srcTableName"] = "sales";
$proto42["m_expr"]=$obj;
$proto42["m_alias"] = "";
$obj = new SQLFieldListItem($proto42);

$proto0["m_fieldlist"][]=$obj;
						$proto44=array();
			$obj = new SQLField(array(
	"m_strName" => "hot_line",
	"m_strTable" => "company_profile",
	"m_srcTableName" => "sales"
));

$proto44["m_sql"] = "company_profile.hot_line";
$proto44["m_srcTableName"] = "sales";
$proto44["m_expr"]=$obj;
$proto44["m_alias"] = "";
$obj = new SQLFieldListItem($proto44);

$proto0["m_fieldlist"][]=$obj;
						$proto46=array();
			$proto47=array();
$proto47["m_functiontype"] = "SQLF_CUSTOM";
$proto47["m_arguments"] = array();
						$obj = new SQLNonParsed(array(
	"m_sql" => "sold.sol"
));

$proto47["m_arguments"][]=$obj;
						$obj = new SQLNonParsed(array(
	"m_sql" => "0"
));

$proto47["m_arguments"][]=$obj;
$proto47["m_strFunctionName"] = "ifnull";
$obj = new SQLFunctionCall($proto47);

$proto46["m_sql"] = "ifnull(sold.sol,0)";
$proto46["m_srcTableName"] = "sales";
$proto46["m_expr"]=$obj;
$proto46["m_alias"] = "total amount";
$obj = new SQLFieldListItem($proto46);

$proto0["m_fieldlist"][]=$obj;
						$proto50=array();
			$proto51=array();
$proto51["m_functiontype"] = "SQLF_CUSTOM";
$proto51["m_arguments"] = array();
						$obj = new SQLNonParsed(array(
	"m_sql" => "purch.pur"
));

$proto51["m_arguments"][]=$obj;
						$obj = new SQLNonParsed(array(
	"m_sql" => "0"
));

$proto51["m_arguments"][]=$obj;
$proto51["m_strFunctionName"] = "ifnull";
$obj = new SQLFunctionCall($proto51);

$proto50["m_sql"] = "ifnull(purch.pur,0)";
$proto50["m_srcTableName"] = "sales";
$proto50["m_expr"]=$obj;
$proto50["m_alias"] = "paid";
$obj = new SQLFieldListItem($proto50);

$proto0["m_fieldlist"][]=$obj;
						$proto54=array();
			$proto55=array();
$proto55["m_functiontype"] = "SQLF_CUSTOM";
$proto55["m_arguments"] = array();
						$obj = new SQLNonParsed(array(
	"m_sql" => "case when (ifnull(sold.sol,0)> ifnull(purch.pur,0)) then  ((ifnull(sold.sol,0)) - (ifnull(purch.pur,0)))end"
));

$proto55["m_arguments"][]=$obj;
						$obj = new SQLNonParsed(array(
	"m_sql" => "0"
));

$proto55["m_arguments"][]=$obj;
$proto55["m_strFunctionName"] = "ifnull";
$obj = new SQLFunctionCall($proto55);

$proto54["m_sql"] = "ifnull(case when (ifnull(sold.sol,0)> ifnull(purch.pur,0)) then  ((ifnull(sold.sol,0)) - (ifnull(purch.pur,0)))end,0)";
$proto54["m_srcTableName"] = "sales";
$proto54["m_expr"]=$obj;
$proto54["m_alias"] = "difect";
$obj = new SQLFieldListItem($proto54);

$proto0["m_fieldlist"][]=$obj;
						$proto58=array();
			$proto59=array();
$proto59["m_functiontype"] = "SQLF_CUSTOM";
$proto59["m_arguments"] = array();
						$obj = new SQLNonParsed(array(
	"m_sql" => "case when (ifnull(sold.sol,0)<= sales.cash) then (sales.cash - (ifnull(sold.sol,0)))end"
));

$proto59["m_arguments"][]=$obj;
						$obj = new SQLNonParsed(array(
	"m_sql" => "0"
));

$proto59["m_arguments"][]=$obj;
$proto59["m_strFunctionName"] = "ifnull";
$obj = new SQLFunctionCall($proto59);

$proto58["m_sql"] = "ifnull(case when (ifnull(sold.sol,0)<= sales.cash) then (sales.cash - (ifnull(sold.sol,0)))end,0)";
$proto58["m_srcTableName"] = "sales";
$proto58["m_expr"]=$obj;
$proto58["m_alias"] = "Balance";
$obj = new SQLFieldListItem($proto58);

$proto0["m_fieldlist"][]=$obj;
$proto0["m_fromlist"] = array();
												$proto62=array();
$proto62["m_link"] = "SQLL_MAIN";
			$proto63=array();
$proto63["m_strName"] = "sales";
$proto63["m_srcTableName"] = "sales";
$proto63["m_columns"] = array();
$proto63["m_columns"][] = "id";
$proto63["m_columns"][] = "customer_name";
$proto63["m_columns"][] = "cash";
$proto63["m_columns"][] = "tt";
$proto63["m_columns"][] = "date_&_time";
$proto63["m_columns"][] = "branch_code";
$proto63["m_columns"][] = "user";
$proto63["m_columns"][] = "outlet_code";
$proto63["m_columns"][] = "h";
$proto63["m_columns"][] = "f";
$proto63["m_columns"][] = "advance_id";
$proto63["m_columns"][] = "amount";
$proto63["m_columns"][] = "left_advance";
$proto63["m_columns"][] = "details";
$proto63["m_columns"][] = "status";
$proto63["m_columns"][] = "customer_id";
$obj = new SQLTable($proto63);

$proto62["m_table"] = $obj;
$proto62["m_sql"] = "sales";
$proto62["m_alias"] = "";
$proto62["m_srcTableName"] = "sales";
$proto64=array();
$proto64["m_sql"] = "";
$proto64["m_uniontype"] = "SQLL_UNKNOWN";
	$obj = new SQLNonParsed(array(
	"m_sql" => ""
));

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

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

$proto0["m_fromlist"][]=$obj;
												$proto66=array();
$proto66["m_link"] = "SQLL_LEFTJOIN";
			$proto67=array();
$proto67["m_strHead"] = "select";
$proto67["m_strFieldList"] = "`m_id`, sum(`quntity`*`price`) as sol";
$proto67["m_strFrom"] = "from sales_details";
$proto67["m_strWhere"] = "";
$proto67["m_strOrderBy"] = "";
	
		;
			$proto67["cipherer"] = null;
$proto69=array();
$proto69["m_sql"] = "";
$proto69["m_uniontype"] = "SQLL_UNKNOWN";
	$obj = new SQLNonParsed(array(
	"m_sql" => ""
));

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

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

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

$proto67["m_having"] = $obj;
$proto67["m_fieldlist"] = array();
						$proto73=array();
			$obj = new SQLField(array(
	"m_strName" => "m_id",
	"m_strTable" => "sales_details",
	"m_srcTableName" => "sales"
));

$proto73["m_sql"] = "`m_id`";
$proto73["m_srcTableName"] = "sales";
$proto73["m_expr"]=$obj;
$proto73["m_alias"] = "";
$obj = new SQLFieldListItem($proto73);

$proto67["m_fieldlist"][]=$obj;
						$proto75=array();
			$proto76=array();
$proto76["m_functiontype"] = "SQLF_SUM";
$proto76["m_arguments"] = array();
						$obj = new SQLNonParsed(array(
	"m_sql" => "`quntity`*`price`"
));

$proto76["m_arguments"][]=$obj;
$proto76["m_strFunctionName"] = "sum";
$obj = new SQLFunctionCall($proto76);

$proto75["m_sql"] = "sum(`quntity`*`price`)";
$proto75["m_srcTableName"] = "sales";
$proto75["m_expr"]=$obj;
$proto75["m_alias"] = "sol";
$obj = new SQLFieldListItem($proto75);

$proto67["m_fieldlist"][]=$obj;
$proto67["m_fromlist"] = array();
												$proto78=array();
$proto78["m_link"] = "SQLL_MAIN";
			$proto79=array();
$proto79["m_strName"] = "sales_details";
$proto79["m_srcTableName"] = "sales";
$proto79["m_columns"] = array();
$proto79["m_columns"][] = "id";
$proto79["m_columns"][] = "bar_code";
$proto79["m_columns"][] = "product";
$proto79["m_columns"][] = "quntity";
$proto79["m_columns"][] = "price";
$proto79["m_columns"][] = "m_id";
$proto79["m_columns"][] = "sub_total";
$proto79["m_columns"][] = "user";
$proto79["m_columns"][] = "discount";
$proto79["m_columns"][] = "tax";
$proto79["m_columns"][] = "newp";
$proto79["m_columns"][] = "stk_tra";
$proto79["m_columns"][] = "unit";
$proto79["m_columns"][] = "stk_tra_status";
$proto79["m_columns"][] = "package_details";
$proto79["m_columns"][] = "date_time";
$proto79["m_columns"][] = "outlet_code";
$obj = new SQLTable($proto79);

$proto78["m_table"] = $obj;
$proto78["m_sql"] = "sales_details";
$proto78["m_alias"] = "";
$proto78["m_srcTableName"] = "sales";
$proto80=array();
$proto80["m_sql"] = "";
$proto80["m_uniontype"] = "SQLL_UNKNOWN";
	$obj = new SQLNonParsed(array(
	"m_sql" => ""
));

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

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

$proto67["m_fromlist"][]=$obj;
$proto67["m_groupby"] = array();
												$proto82=array();
						$obj = new SQLField(array(
	"m_strName" => "m_id",
	"m_strTable" => "sales_details",
	"m_srcTableName" => "sales"
));

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

$proto67["m_groupby"][]=$obj;
$proto67["m_orderby"] = array();
$proto67["m_srcTableName"]="sales";		
$obj = new SQLQuery($proto67);

$proto66["m_table"] = $obj;
$proto66["m_sql"] = "LEFT JOIN (select `m_id`, sum(`quntity`*`price`) as sol from sales_details  group by `m_id` ) as sold on sales.`id` = sold.`m_id`";
$proto66["m_alias"] = "sold";
$proto66["m_srcTableName"] = "sales";
$proto84=array();
$proto84["m_sql"] = "sales.`id` = sold.`m_id`";
$proto84["m_uniontype"] = "SQLL_UNKNOWN";
						$obj = new SQLField(array(
	"m_strName" => "id",
	"m_strTable" => "sales",
	"m_srcTableName" => "sales"
));

$proto84["m_column"]=$obj;
$proto84["m_contained"] = array();
$proto84["m_strCase"] = "= sold.`m_id`";
$proto84["m_havingmode"] = false;
$proto84["m_inBrackets"] = false;
$proto84["m_useAlias"] = false;
$obj = new SQLLogicalExpr($proto84);

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

$proto0["m_fromlist"][]=$obj;
												$proto86=array();
$proto86["m_link"] = "SQLL_LEFTJOIN";
			$proto87=array();
$proto87["m_strHead"] = "SELECT";
$proto87["m_strFieldList"] = "`sales_id`,SUM(`amount`) as pur";
$proto87["m_strFrom"] = "from payments";
$proto87["m_strWhere"] = "";
$proto87["m_strOrderBy"] = "";
	
		;
			$proto87["cipherer"] = null;
$proto89=array();
$proto89["m_sql"] = "";
$proto89["m_uniontype"] = "SQLL_UNKNOWN";
	$obj = new SQLNonParsed(array(
	"m_sql" => ""
));

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

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

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

$proto87["m_having"] = $obj;
$proto87["m_fieldlist"] = array();
						$proto93=array();
			$obj = new SQLField(array(
	"m_strName" => "sales_id",
	"m_strTable" => "payments",
	"m_srcTableName" => "sales"
));

$proto93["m_sql"] = "`sales_id`";
$proto93["m_srcTableName"] = "sales";
$proto93["m_expr"]=$obj;
$proto93["m_alias"] = "";
$obj = new SQLFieldListItem($proto93);

$proto87["m_fieldlist"][]=$obj;
						$proto95=array();
			$proto96=array();
$proto96["m_functiontype"] = "SQLF_SUM";
$proto96["m_arguments"] = array();
						$obj = new SQLField(array(
	"m_strName" => "amount",
	"m_strTable" => "payments",
	"m_srcTableName" => "sales"
));

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

$proto95["m_sql"] = "SUM(`amount`)";
$proto95["m_srcTableName"] = "sales";
$proto95["m_expr"]=$obj;
$proto95["m_alias"] = "pur";
$obj = new SQLFieldListItem($proto95);

$proto87["m_fieldlist"][]=$obj;
$proto87["m_fromlist"] = array();
												$proto98=array();
$proto98["m_link"] = "SQLL_MAIN";
			$proto99=array();
$proto99["m_strName"] = "payments";
$proto99["m_srcTableName"] = "sales";
$proto99["m_columns"] = array();
$proto99["m_columns"][] = "id";
$proto99["m_columns"][] = "sales_id";
$proto99["m_columns"][] = "type";
$proto99["m_columns"][] = "amount";
$proto99["m_columns"][] = "cheque_number";
$proto99["m_columns"][] = "cheque_date";
$proto99["m_columns"][] = "hide";
$proto99["m_columns"][] = "status";
$proto99["m_columns"][] = "opening_balance_id";
$proto99["m_columns"][] = "outlet";
$proto99["m_columns"][] = "date_time";
$proto99["m_columns"][] = "user";
$proto99["m_columns"][] = "status_2";
$obj = new SQLTable($proto99);

$proto98["m_table"] = $obj;
$proto98["m_sql"] = "payments";
$proto98["m_alias"] = "";
$proto98["m_srcTableName"] = "sales";
$proto100=array();
$proto100["m_sql"] = "";
$proto100["m_uniontype"] = "SQLL_UNKNOWN";
	$obj = new SQLNonParsed(array(
	"m_sql" => ""
));

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

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

$proto87["m_fromlist"][]=$obj;
$proto87["m_groupby"] = array();
												$proto102=array();
						$obj = new SQLField(array(
	"m_strName" => "sales_id",
	"m_strTable" => "payments",
	"m_srcTableName" => "sales"
));

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

$proto87["m_groupby"][]=$obj;
$proto87["m_orderby"] = array();
$proto87["m_srcTableName"]="sales";		
$obj = new SQLQuery($proto87);

$proto86["m_table"] = $obj;
$proto86["m_sql"] = "left join (SELECT `sales_id`,SUM(`amount`) as pur from payments group by `sales_id`) as purch on sales.id = purch.sales_id";
$proto86["m_alias"] = "purch";
$proto86["m_srcTableName"] = "sales";
$proto104=array();
$proto104["m_sql"] = "sales.id = purch.sales_id";
$proto104["m_uniontype"] = "SQLL_UNKNOWN";
						$obj = new SQLField(array(
	"m_strName" => "id",
	"m_strTable" => "sales",
	"m_srcTableName" => "sales"
));

$proto104["m_column"]=$obj;
$proto104["m_contained"] = array();
$proto104["m_strCase"] = "= purch.sales_id";
$proto104["m_havingmode"] = false;
$proto104["m_inBrackets"] = false;
$proto104["m_useAlias"] = false;
$obj = new SQLLogicalExpr($proto104);

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

$proto0["m_fromlist"][]=$obj;
												$proto106=array();
$proto106["m_link"] = "SQLL_LEFTJOIN";
			$proto107=array();
$proto107["m_strName"] = "sys_manage";
$proto107["m_srcTableName"] = "sales";
$proto107["m_columns"] = array();
$proto107["m_columns"][] = "ID";
$proto107["m_columns"][] = "username";
$proto107["m_columns"][] = "password";
$proto107["m_columns"][] = "email";
$proto107["m_columns"][] = "fullname";
$proto107["m_columns"][] = "groupid";
$proto107["m_columns"][] = "active";
$proto107["m_columns"][] = "ext_security_id";
$proto107["m_columns"][] = "reset_token";
$proto107["m_columns"][] = "reset_date";
$proto107["m_columns"][] = "teliphone_number";
$proto107["m_columns"][] = "date";
$proto107["m_columns"][] = "branch_code";
$proto107["m_columns"][] = "outlet_code";
$proto107["m_columns"][] = "MyTheme";
$proto107["m_columns"][] = "MyThemeSize";
$proto107["m_columns"][] = "password2";
$obj = new SQLTable($proto107);

$proto106["m_table"] = $obj;
$proto106["m_sql"] = "LEFT OUTER JOIN sys_manage ON sales.`user` = sys_manage.username";
$proto106["m_alias"] = "";
$proto106["m_srcTableName"] = "sales";
$proto108=array();
$proto108["m_sql"] = "sales.`user` = sys_manage.username";
$proto108["m_uniontype"] = "SQLL_UNKNOWN";
						$obj = new SQLField(array(
	"m_strName" => "user",
	"m_strTable" => "sales",
	"m_srcTableName" => "sales"
));

$proto108["m_column"]=$obj;
$proto108["m_contained"] = array();
$proto108["m_strCase"] = "= sys_manage.username";
$proto108["m_havingmode"] = false;
$proto108["m_inBrackets"] = false;
$proto108["m_useAlias"] = false;
$obj = new SQLLogicalExpr($proto108);

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

$proto0["m_fromlist"][]=$obj;
												$proto110=array();
$proto110["m_link"] = "SQLL_INNERJOIN";
			$proto111=array();
$proto111["m_strName"] = "company_profile";
$proto111["m_srcTableName"] = "sales";
$proto111["m_columns"] = array();
$proto111["m_columns"][] = "id";
$proto111["m_columns"][] = "company_name";
$proto111["m_columns"][] = "address_line_1";
$proto111["m_columns"][] = "address_line_2";
$proto111["m_columns"][] = "country";
$proto111["m_columns"][] = "provinces";
$proto111["m_columns"][] = "districts";
$proto111["m_columns"][] = "postal_code";
$proto111["m_columns"][] = "hot_line";
$proto111["m_columns"][] = "Fax";
$proto111["m_columns"][] = "email";
$proto111["m_columns"][] = "logo";
$proto111["m_columns"][] = "branch_code";
$proto111["m_columns"][] = "header";
$proto111["m_columns"][] = "footer";
$proto111["m_columns"][] = "time_calibration";
$obj = new SQLTable($proto111);

$proto110["m_table"] = $obj;
$proto110["m_sql"] = "INNER JOIN company_profile ON sys_manage.outlet_code = company_profile.id";
$proto110["m_alias"] = "";
$proto110["m_srcTableName"] = "sales";
$proto112=array();
$proto112["m_sql"] = "sys_manage.outlet_code = company_profile.id";
$proto112["m_uniontype"] = "SQLL_UNKNOWN";
						$obj = new SQLField(array(
	"m_strName" => "outlet_code",
	"m_strTable" => "sys_manage",
	"m_srcTableName" => "sales"
));

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

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

$proto0["m_fromlist"][]=$obj;
$proto0["m_groupby"] = array();
$proto0["m_orderby"] = array();
												$proto114=array();
						$obj = new SQLField(array(
	"m_strName" => "id",
	"m_strTable" => "sales",
	"m_srcTableName" => "sales"
));

$proto114["m_column"]=$obj;
$proto114["m_bAsc"] = 0;
$proto114["m_nColumn"] = 0;
$obj = new SQLOrderByItem($proto114);

$proto0["m_orderby"][]=$obj;					
$proto0["m_srcTableName"]="sales";		
$obj = new SQLQuery($proto0);

	return $obj;
}
$queryData_sales = createSqlQuery_sales();


	
		;

																								

$tdatasales[".sqlquery"] = $queryData_sales;



include_once(getabspath("include/sales_events.php"));
$tableEvents["sales"] = new eventclass_sales;
$tdatasales[".hasEvents"] = true;

?>