<?php



$tdatavinha1 = array();
$tdatavinha1[".searchableFields"] = array();
$tdatavinha1[".ShortName"] = "vinha1";
$tdatavinha1[".OwnerID"] = "";
$tdatavinha1[".OriginalTable"] = "Vinha";


$tdatavinha1[".pagesByType"] = my_json_decode( "{\"add\":[\"add\"],\"export\":[\"export\"],\"import\":[\"import\"],\"list\":[\"list\"],\"search\":[\"search\"]}" );
$tdatavinha1[".originalPagesByType"] = $tdatavinha1[".pagesByType"];
$tdatavinha1[".pages"] = types2pages( my_json_decode( "{\"add\":[\"add\"],\"export\":[\"export\"],\"import\":[\"import\"],\"list\":[\"list\"],\"search\":[\"search\"]}" ) );
$tdatavinha1[".originalPages"] = $tdatavinha1[".pages"];
$tdatavinha1[".defaultPages"] = my_json_decode( "{\"add\":\"add\",\"export\":\"export\",\"import\":\"import\",\"list\":\"list\",\"search\":\"search\"}" );
$tdatavinha1[".originalDefaultPages"] = $tdatavinha1[".defaultPages"];

//	field labels
$fieldLabelsvinha1 = array();
$fieldToolTipsvinha1 = array();
$pageTitlesvinha1 = array();
$placeHoldersvinha1 = array();

if(mlang_getcurrentlang()=="Portuguese(Standard)")
{
	$fieldLabelsvinha1["Portuguese(Standard)"] = array();
	$fieldToolTipsvinha1["Portuguese(Standard)"] = array();
	$placeHoldersvinha1["Portuguese(Standard)"] = array();
	$pageTitlesvinha1["Portuguese(Standard)"] = array();
	$fieldLabelsvinha1["Portuguese(Standard)"]["CodCliente"] = "Cod Cliente";
	$fieldToolTipsvinha1["Portuguese(Standard)"]["CodCliente"] = "";
	$placeHoldersvinha1["Portuguese(Standard)"]["CodCliente"] = "";
	$fieldLabelsvinha1["Portuguese(Standard)"]["CodMarza"] = "Cod Marza";
	$fieldToolTipsvinha1["Portuguese(Standard)"]["CodMarza"] = "";
	$placeHoldersvinha1["Portuguese(Standard)"]["CodMarza"] = "";
	$fieldLabelsvinha1["Portuguese(Standard)"]["SUM_Quantidade_"] = "SUM(Quantidade)";
	$fieldToolTipsvinha1["Portuguese(Standard)"]["SUM_Quantidade_"] = "";
	$placeHoldersvinha1["Portuguese(Standard)"]["SUM_Quantidade_"] = "";
	$fieldLabelsvinha1["Portuguese(Standard)"]["Nome"] = "Nome";
	$fieldToolTipsvinha1["Portuguese(Standard)"]["Nome"] = "";
	$placeHoldersvinha1["Portuguese(Standard)"]["Nome"] = "";
	if (count($fieldToolTipsvinha1["Portuguese(Standard)"]))
		$tdatavinha1[".isUseToolTips"] = true;
}


	$tdatavinha1[".NCSearch"] = true;


	$tdatavinha1[".scrollGridBody"] = true;

$tdatavinha1[".shortTableName"] = "vinha1";
$tdatavinha1[".nSecOptions"] = 0;

$tdatavinha1[".mainTableOwnerID"] = "";
$tdatavinha1[".entityType"] = 1;

$tdatavinha1[".strOriginalTableName"] = "Vinha";

	



$tdatavinha1[".showAddInPopup"] = true;

$tdatavinha1[".showEditInPopup"] = false;

$tdatavinha1[".showViewInPopup"] = false;

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


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

	$tdatavinha1[".audit"] = true;

	$tdatavinha1[".locking"] = true;


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

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

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

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



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




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

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

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

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



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

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

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

$tdatavinha1[".isUseAjaxSuggest"] = true;

$tdatavinha1[".rowHighlite"] = true;



			

$tdatavinha1[".ajaxCodeSnippetAdded"] = false;

$tdatavinha1[".buttonsAdded"] = false;

$tdatavinha1[".addPageEvents"] = false;

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


$tdatavinha1[".badgeColor"] = "4169E1";


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

$tdatavinha1[".googleLikeFields"] = array();
$tdatavinha1[".googleLikeFields"][] = "CodCliente";
$tdatavinha1[".googleLikeFields"][] = "CodMarza";
$tdatavinha1[".googleLikeFields"][] = "SUM(Quantidade)";
$tdatavinha1[".googleLikeFields"][] = "Nome";



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

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

$tdatavinha1[".nPrinterSplitRecords"] = 40;

$tdatavinha1[".geocodingEnabled"] = false;










$tdatavinha1[".pageSize"] = 999;

$tdatavinha1[".warnLeavingPages"] = true;



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

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

$tdatavinha1[".sqlHead"] = "SELECT Vinha.CodCliente,  Vinha.CodMarza,  SUM(Vinha.Quantidade) AS `SUM(Quantidade)`,  Clientes.Nome";
$tdatavinha1[".sqlFrom"] = "FROM Vinha  INNER JOIN Clientes ON Vinha.CodCliente = Clientes.CodCliente";
$tdatavinha1[".sqlWhereExpr"] = "";
$tdatavinha1[".sqlTail"] = "";










//fill array of records per page for list and report without group fields
$arrRPP = array();
$arrRPP[] = 10;
$arrRPP[] = 20;
$arrRPP[] = 30;
$arrRPP[] = 50;
$arrRPP[] = 100;
$arrRPP[] = 500;
$arrRPP[] = -1;
$tdatavinha1[".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;
$tdatavinha1[".arrGroupsPerPage"] = $arrGPP;

$tdatavinha1[".highlightSearchResults"] = true;

$tableKeysvinha1 = array();
$tdatavinha1[".Keys"] = $tableKeysvinha1;


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




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

	
	
	
			

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

		$fdata["isSQLExpression"] = true;
	$fdata["FullName"] = "Vinha.CodCliente";

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

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

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

	
	
	
	
	
	
	
	
	
	
	
	
		$vdata["NeedEncode"] = true;

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

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

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

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

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


	
	

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

	
		
	$edata["LinkField"] = "CodCliente";
	$edata["LinkFieldType"] = 0;
	$edata["DisplayField"] = "Nome";

	

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

	
	
	
	

	
	
		$edata["SelectSize"] = 1;

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


	$fdata["isSeparate"] = false;




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

			// the user's search options list
		$fdata["searchOptionsList"] = array();
		$fdata["searchOptionsList"][] = "Equals";
// 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


	$tdatavinha1["CodCliente"] = $fdata;
		$tdatavinha1[".searchableFields"][] = "CodCliente";
//	CodMarza
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 2;
	$fdata["strName"] = "CodMarza";
	$fdata["GoodName"] = "CodMarza";
	$fdata["ownerTable"] = "Vinha";
	$fdata["Label"] = GetFieldLabel("Vinha1","CodMarza");
	$fdata["FieldType"] = 200;

	
	
	
			

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

		$fdata["isSQLExpression"] = true;
	$fdata["FullName"] = "Vinha.CodMarza";

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

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

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

	
	
	
	
	
	
	
	
	
	
	
	
		$vdata["NeedEncode"] = true;

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

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

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

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

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


	
	

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

	
			$edata["LookupUnique"] = true;

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

	

	
	$edata["LookupOrderBy"] = "";

	
	
	
	

	
	
		$edata["SelectSize"] = 1;

// 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"]["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


	$tdatavinha1["CodMarza"] = $fdata;
		$tdatavinha1[".searchableFields"][] = "CodMarza";
//	SUM(Quantidade)
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 3;
	$fdata["strName"] = "SUM(Quantidade)";
	$fdata["GoodName"] = "SUM_Quantidade_";
	$fdata["ownerTable"] = "";
	$fdata["Label"] = GetFieldLabel("Vinha1","SUM_Quantidade_");
	$fdata["FieldType"] = 14;

	
	
	
			

		$fdata["strField"] = "SUM(Quantidade)";

		$fdata["isSQLExpression"] = true;
	$fdata["FullName"] = "SUM(Vinha.Quantidade)";

	
	
				$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


	$tdatavinha1["SUM(Quantidade)"] = $fdata;
		$tdatavinha1[".searchableFields"][] = "SUM(Quantidade)";
//	Nome
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 4;
	$fdata["strName"] = "Nome";
	$fdata["GoodName"] = "Nome";
	$fdata["ownerTable"] = "Clientes";
	$fdata["Label"] = GetFieldLabel("Vinha1","Nome");
	$fdata["FieldType"] = 200;

	
	
	
			

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

		$fdata["isSQLExpression"] = true;
	$fdata["FullName"] = "Clientes.Nome";

	
	
				$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


	$tdatavinha1["Nome"] = $fdata;
		$tdatavinha1[".searchableFields"][] = "Nome";


$tables_data["Vinha1"]=&$tdatavinha1;
$field_labels["Vinha1"] = &$fieldLabelsvinha1;
$fieldToolTips["Vinha1"] = &$fieldToolTipsvinha1;
$placeHolders["Vinha1"] = &$placeHoldersvinha1;
$page_titles["Vinha1"] = &$pageTitlesvinha1;

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

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



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


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










function createSqlQuery_vinha1()
{
$proto1=array();
$proto1["m_strHead"] = "SELECT";
$proto1["m_strFieldList"] = "Vinha.CodCliente,  Vinha.CodMarza,  SUM(Vinha.Quantidade) AS `SUM(Quantidade)`,  Clientes.Nome";
$proto1["m_strFrom"] = "FROM Vinha  INNER JOIN Clientes ON Vinha.CodCliente = Clientes.CodCliente";
$proto1["m_strWhere"] = "";
$proto1["m_strOrderBy"] = "";
	
		;
			$proto1["cipherer"] = null;
$proto3=array();
$proto3["m_sql"] = "";
$proto3["m_uniontype"] = "SQLL_UNKNOWN";
	$obj = new SQLNonParsed(array(
	"m_sql" => ""
));

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

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

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

$proto1["m_having"] = $obj;
$proto1["m_fieldlist"] = array();
						$proto7=array();
			$obj = new SQLField(array(
	"m_strName" => "CodCliente",
	"m_strTable" => "Vinha",
	"m_srcTableName" => "Vinha1"
));

$proto7["m_sql"] = "Vinha.CodCliente";
$proto7["m_srcTableName"] = "Vinha1";
$proto7["m_expr"]=$obj;
$proto7["m_alias"] = "";
$obj = new SQLFieldListItem($proto7);

$proto1["m_fieldlist"][]=$obj;
						$proto9=array();
			$obj = new SQLField(array(
	"m_strName" => "CodMarza",
	"m_strTable" => "Vinha",
	"m_srcTableName" => "Vinha1"
));

$proto9["m_sql"] = "Vinha.CodMarza";
$proto9["m_srcTableName"] = "Vinha1";
$proto9["m_expr"]=$obj;
$proto9["m_alias"] = "";
$obj = new SQLFieldListItem($proto9);

$proto1["m_fieldlist"][]=$obj;
						$proto11=array();
			$proto12=array();
$proto12["m_functiontype"] = "SQLF_SUM";
$proto12["m_arguments"] = array();
						$obj = new SQLField(array(
	"m_strName" => "Quantidade",
	"m_strTable" => "Vinha",
	"m_srcTableName" => "Vinha1"
));

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

$proto11["m_sql"] = "SUM(Vinha.Quantidade)";
$proto11["m_srcTableName"] = "Vinha1";
$proto11["m_expr"]=$obj;
$proto11["m_alias"] = "SUM(Quantidade)";
$obj = new SQLFieldListItem($proto11);

$proto1["m_fieldlist"][]=$obj;
						$proto14=array();
			$obj = new SQLField(array(
	"m_strName" => "Nome",
	"m_strTable" => "Clientes",
	"m_srcTableName" => "Vinha1"
));

$proto14["m_sql"] = "Clientes.Nome";
$proto14["m_srcTableName"] = "Vinha1";
$proto14["m_expr"]=$obj;
$proto14["m_alias"] = "";
$obj = new SQLFieldListItem($proto14);

$proto1["m_fieldlist"][]=$obj;
$proto1["m_fromlist"] = array();
												$proto16=array();
$proto16["m_link"] = "SQLL_MAIN";
			$proto17=array();
$proto17["m_strName"] = "Vinha";
$proto17["m_srcTableName"] = "Vinha1";
$proto17["m_columns"] = array();
$proto17["m_columns"][] = "CodVenda";
$proto17["m_columns"][] = "CodUser";
$proto17["m_columns"][] = "Data";
$proto17["m_columns"][] = "CodPlanta";
$proto17["m_columns"][] = "CodCliente";
$proto17["m_columns"][] = "Quantidade";
$proto17["m_columns"][] = "Confirmado";
$proto17["m_columns"][] = "Pago20%";
$proto17["m_columns"][] = "Encomendado";
$proto17["m_columns"][] = "PagoTotal";
$proto17["m_columns"][] = "Fornecido";
$proto17["m_columns"][] = "NEntrega";
$proto17["m_columns"][] = "PE";
$proto17["m_columns"][] = "Clone";
$proto17["m_columns"][] = "NE";
$proto17["m_columns"][] = "Saldo";
$proto17["m_columns"][] = "CodMarza";
$proto17["m_columns"][] = "Saldo1";
$proto17["m_columns"][] = "Escolha";
$obj = new SQLTable($proto17);

$proto16["m_table"] = $obj;
$proto16["m_sql"] = "Vinha";
$proto16["m_alias"] = "";
$proto16["m_srcTableName"] = "Vinha1";
$proto18=array();
$proto18["m_sql"] = "";
$proto18["m_uniontype"] = "SQLL_UNKNOWN";
	$obj = new SQLNonParsed(array(
	"m_sql" => ""
));

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

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

$proto1["m_fromlist"][]=$obj;
												$proto20=array();
$proto20["m_link"] = "SQLL_INNERJOIN";
			$proto21=array();
$proto21["m_strName"] = "Clientes";
$proto21["m_srcTableName"] = "Vinha1";
$proto21["m_columns"] = array();
$proto21["m_columns"][] = "CodCliente";
$proto21["m_columns"][] = "Nome";
$proto21["m_columns"][] = "Dados";
$proto21["m_columns"][] = "CodRegiao";
$proto21["m_columns"][] = "CodPHC";
$proto21["m_columns"][] = "Escolha";
$obj = new SQLTable($proto21);

$proto20["m_table"] = $obj;
$proto20["m_sql"] = "INNER JOIN Clientes ON Vinha.CodCliente = Clientes.CodCliente";
$proto20["m_alias"] = "";
$proto20["m_srcTableName"] = "Vinha1";
$proto22=array();
$proto22["m_sql"] = "Vinha.CodCliente = Clientes.CodCliente";
$proto22["m_uniontype"] = "SQLL_UNKNOWN";
						$obj = new SQLField(array(
	"m_strName" => "CodCliente",
	"m_strTable" => "Vinha",
	"m_srcTableName" => "Vinha1"
));

$proto22["m_column"]=$obj;
$proto22["m_contained"] = array();
$proto22["m_strCase"] = "= Clientes.CodCliente";
$proto22["m_havingmode"] = false;
$proto22["m_inBrackets"] = false;
$proto22["m_useAlias"] = false;
$obj = new SQLLogicalExpr($proto22);

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

$proto1["m_fromlist"][]=$obj;
$proto1["m_groupby"] = array();
												$proto24=array();
						$obj = new SQLField(array(
	"m_strName" => "CodCliente",
	"m_strTable" => "Vinha",
	"m_srcTableName" => "Vinha1"
));

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

$proto1["m_groupby"][]=$obj;
												$proto26=array();
						$obj = new SQLField(array(
	"m_strName" => "CodMarza",
	"m_strTable" => "Vinha",
	"m_srcTableName" => "Vinha1"
));

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

$proto1["m_groupby"][]=$obj;
												$proto28=array();
						$obj = new SQLField(array(
	"m_strName" => "Nome",
	"m_strTable" => "Clientes",
	"m_srcTableName" => "Vinha1"
));

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

$proto1["m_groupby"][]=$obj;
$proto1["m_orderby"] = array();
$proto1["m_srcTableName"]="Vinha1";		
$obj = new SQLQuery($proto1);

	return $obj;
}
$queryData_vinha1 = createSqlQuery_vinha1();


	
		;

				

$tdatavinha1[".sqlquery"] = $queryData_vinha1;

$tableEvents["Vinha1"] = new eventsBase;
$tdatavinha1[".hasEvents"] = false;

?>