<?php



$tdataVinha_Report = array();
$tdataVinha_Report[".searchableFields"] = array();
$tdataVinha_Report[".ShortName"] = "Vinha_Report";
$tdataVinha_Report[".OwnerID"] = "";
$tdataVinha_Report[".OriginalTable"] = "Vinha";


$tdataVinha_Report[".pagesByType"] = my_json_decode( "{\"report\":[\"report\"],\"rprint\":[\"rprint\"],\"search\":[\"search\",\"search1\"]}" );
$tdataVinha_Report[".originalPagesByType"] = $tdataVinha_Report[".pagesByType"];
$tdataVinha_Report[".pages"] = types2pages( my_json_decode( "{\"report\":[\"report\"],\"rprint\":[\"rprint\"],\"search\":[\"search\",\"search1\"]}" ) );
$tdataVinha_Report[".originalPages"] = $tdataVinha_Report[".pages"];
$tdataVinha_Report[".defaultPages"] = my_json_decode( "{\"report\":\"report\",\"rprint\":\"rprint\",\"search\":\"search\"}" );
$tdataVinha_Report[".originalDefaultPages"] = $tdataVinha_Report[".defaultPages"];

//	field labels
$fieldLabelsVinha_Report = array();
$fieldToolTipsVinha_Report = array();
$pageTitlesVinha_Report = array();
$placeHoldersVinha_Report = array();

if(mlang_getcurrentlang()=="Portuguese(Standard)")
{
	$fieldLabelsVinha_Report["Portuguese(Standard)"] = array();
	$fieldToolTipsVinha_Report["Portuguese(Standard)"] = array();
	$placeHoldersVinha_Report["Portuguese(Standard)"] = array();
	$pageTitlesVinha_Report["Portuguese(Standard)"] = array();
	$fieldLabelsVinha_Report["Portuguese(Standard)"]["Marza"] = "Marza";
	$fieldToolTipsVinha_Report["Portuguese(Standard)"]["Marza"] = "";
	$placeHoldersVinha_Report["Portuguese(Standard)"]["Marza"] = "";
	$fieldLabelsVinha_Report["Portuguese(Standard)"]["Varieta"] = "Varieta";
	$fieldToolTipsVinha_Report["Portuguese(Standard)"]["Varieta"] = "";
	$placeHoldersVinha_Report["Portuguese(Standard)"]["Varieta"] = "";
	$fieldLabelsVinha_Report["Portuguese(Standard)"]["Totale"] = "Totale";
	$fieldToolTipsVinha_Report["Portuguese(Standard)"]["Totale"] = "";
	$placeHoldersVinha_Report["Portuguese(Standard)"]["Totale"] = "";
	$fieldLabelsVinha_Report["Portuguese(Standard)"]["Quantidade_Vendida"] = "Quantidade Vendida";
	$fieldToolTipsVinha_Report["Portuguese(Standard)"]["Quantidade_Vendida"] = "";
	$placeHoldersVinha_Report["Portuguese(Standard)"]["Quantidade_Vendida"] = "";
	$fieldLabelsVinha_Report["Portuguese(Standard)"]["Stock"] = "Stock";
	$fieldToolTipsVinha_Report["Portuguese(Standard)"]["Stock"] = "";
	$placeHoldersVinha_Report["Portuguese(Standard)"]["Stock"] = "";
	if (count($fieldToolTipsVinha_Report["Portuguese(Standard)"]))
		$tdataVinha_Report[".isUseToolTips"] = true;
}


	$tdataVinha_Report[".NCSearch"] = true;



$tdataVinha_Report[".shortTableName"] = "Vinha_Report";
$tdataVinha_Report[".nSecOptions"] = 0;

$tdataVinha_Report[".mainTableOwnerID"] = "";
$tdataVinha_Report[".entityType"] = 2;

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

	



$tdataVinha_Report[".showAddInPopup"] = false;

$tdataVinha_Report[".showEditInPopup"] = false;

$tdataVinha_Report[".showViewInPopup"] = false;

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


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

	$tdataVinha_Report[".audit"] = false;

	$tdataVinha_Report[".locking"] = false;


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

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

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

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



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




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

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

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

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



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

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

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

$tdataVinha_Report[".isUseAjaxSuggest"] = true;




			

$tdataVinha_Report[".ajaxCodeSnippetAdded"] = false;

$tdataVinha_Report[".buttonsAdded"] = false;

$tdataVinha_Report[".addPageEvents"] = false;

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




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

$tdataVinha_Report[".googleLikeFields"] = array();
$tdataVinha_Report[".googleLikeFields"][] = "Marza";
$tdataVinha_Report[".googleLikeFields"][] = "Varieta";
$tdataVinha_Report[".googleLikeFields"][] = "Totale";
$tdataVinha_Report[".googleLikeFields"][] = "Quantidade Vendida";
$tdataVinha_Report[".googleLikeFields"][] = "Stock";



$tdataVinha_Report[".tableType"] = "report";

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

$tdataVinha_Report[".nPrinterSplitRecords"] = 40;

$tdataVinha_Report[".geocodingEnabled"] = false;

//report settings
$tdataVinha_Report[".printReportLayout"] = 3;

$tdataVinha_Report[".reportPrintPartitionType"] = 1;
$tdataVinha_Report[".reportPrintGroupsPerPage"] = 3;
$tdataVinha_Report[".lowGroup"] = 1;



$tdataVinha_Report[".reportGroupFields"] = true;
$tdataVinha_Report[".pageSize"] = 999;
$tdataVinha_Report[".showGroupSummaryCount"] = true;
$reportGroupFieldsList = array();
$reportGroupFields = array();
	$reportGroupFieldsList []= "Marza";

	$rgroupField = array();
	$rgroupField['strGroupField'] = "Marza";
	$rgroupField['groupInterval'] = 0;
	$rgroupField['groupOrder'] = 1;
	$rgroupField['showGroupSummary'] = "1";
	$rgroupField['crossTabAxis'] = "0";
	$reportGroupFields[] = $rgroupField;
$tdataVinha_Report[".reportGroupFieldsData"] = $reportGroupFields;
$tdataVinha_Report[".reportGroupFieldsList"] = $reportGroupFieldsList;


$tdataVinha_Report[".isExistTotalFields"] = true;


$tdataVinha_Report[".reportPageSummary"] = true;

$tdataVinha_Report[".reportGlobalSummary"] = true;

$tdataVinha_Report[".repShowDet"] = true;

$tdataVinha_Report[".reportLayout"] = 3;

//end of report settings










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

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

$tdataVinha_Report[".sqlHead"] = "SELECT `Assegnatos`.`Marza`,  `Assegnatos`.`Varieta`,  `Assegnatos`.`Totale`,  SUM(`Vinha`.`Quantidade`) AS `Quantidade Vendida`,  COALESCE(Assegnatos.Totale,0)-SUM(COALESCE(Vinha.Quantidade,0)) AS `Stock`";
$tdataVinha_Report[".sqlFrom"] = "FROM `Vinha`  LEFT OUTER JOIN `Assegnatos` ON `Vinha`.`CodPlanta` = `Assegnatos`.`Codice`";
$tdataVinha_Report[".sqlWhereExpr"] = "(`Vinha`.`Confirmado` =1)";
$tdataVinha_Report[".sqlTail"] = "";

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

$tdataVinha_Report[".highlightSearchResults"] = true;

$tableKeysVinha_Report = array();
$tdataVinha_Report[".Keys"] = $tableKeysVinha_Report;


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




//	Marza
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 1;
	$fdata["strName"] = "Marza";
	$fdata["GoodName"] = "Marza";
	$fdata["ownerTable"] = "Assegnatos";
	$fdata["Label"] = GetFieldLabel("Vinha_Report","Marza");
	$fdata["FieldType"] = 200;

		// report field settings
					// end of report field settings

	
	
			

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

		$fdata["isSQLExpression"] = true;
	$fdata["FullName"] = "`Assegnatos`.`Marza`";

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

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

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

	
	
	
	
	
	
	
	
	
	
	
	
		$vdata["NeedEncode"] = true;

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

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


	$fdata["isSeparate"] = false;




// the field's search options settings
	
			// 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


	$tdataVinha_Report["Marza"] = $fdata;
		$tdataVinha_Report[".searchableFields"][] = "Marza";
//	Varieta
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 2;
	$fdata["strName"] = "Varieta";
	$fdata["GoodName"] = "Varieta";
	$fdata["ownerTable"] = "Assegnatos";
	$fdata["Label"] = GetFieldLabel("Vinha_Report","Varieta");
	$fdata["FieldType"] = 200;

		// report field settings
					// end of report field settings

	
	
			

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

		$fdata["isSQLExpression"] = true;
	$fdata["FullName"] = "`Assegnatos`.`Varieta`";

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

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

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

	
	
	
	
	
	
	
	
	
	
	
	
		$vdata["NeedEncode"] = true;

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

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


	$fdata["isSeparate"] = false;




// the field's search options settings
	
			// 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


	$tdataVinha_Report["Varieta"] = $fdata;
		$tdataVinha_Report[".searchableFields"][] = "Varieta";
//	Totale
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 3;
	$fdata["strName"] = "Totale";
	$fdata["GoodName"] = "Totale";
	$fdata["ownerTable"] = "Assegnatos";
	$fdata["Label"] = GetFieldLabel("Vinha_Report","Totale");
	$fdata["FieldType"] = 14;

		// report field settings
					$fdata["isTotalSum"] = true;
	// end of report field settings

	
	
			

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

		$fdata["isSQLExpression"] = true;
	$fdata["FullName"] = "`Assegnatos`.`Totale`";

	
	
				$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"]["report"] = $vdata;
//  End View Formats

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

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

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


	
	



		$edata["IsRequired"] = true;

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

		$edata["maxNumberOfFiles"] = 1;

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

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

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

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


	$fdata["isSeparate"] = false;




// the field's search options settings
	
			// 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


	$tdataVinha_Report["Totale"] = $fdata;
		$tdataVinha_Report[".searchableFields"][] = "Totale";
//	Quantidade Vendida
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 4;
	$fdata["strName"] = "Quantidade Vendida";
	$fdata["GoodName"] = "Quantidade_Vendida";
	$fdata["ownerTable"] = "";
	$fdata["Label"] = GetFieldLabel("Vinha_Report","Quantidade_Vendida");
	$fdata["FieldType"] = 14;

		// report field settings
					$fdata["isTotalSum"] = true;
	// end of report field settings

	
	
			

		$fdata["strField"] = "Quantidade Vendida";

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

	
	
				$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"]["report"] = $vdata;
//  End View Formats

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

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

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


	
	



		$edata["IsRequired"] = true;

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

		$edata["maxNumberOfFiles"] = 1;

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

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

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

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


	$fdata["isSeparate"] = false;




// the field's search options settings
	
			// 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


	$tdataVinha_Report["Quantidade Vendida"] = $fdata;
		$tdataVinha_Report[".searchableFields"][] = "Quantidade Vendida";
//	Stock
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 5;
	$fdata["strName"] = "Stock";
	$fdata["GoodName"] = "Stock";
	$fdata["ownerTable"] = "";
	$fdata["Label"] = GetFieldLabel("Vinha_Report","Stock");
	$fdata["FieldType"] = 14;

		// report field settings
					$fdata["isTotalSum"] = true;
	// end of report field settings

	
	
			

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

		$fdata["isSQLExpression"] = true;
	$fdata["FullName"] = "COALESCE(Assegnatos.Totale,0)-SUM(COALESCE(Vinha.Quantidade,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"]["report"] = $vdata;
//  End View Formats

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

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

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


	
	



		$edata["IsRequired"] = true;

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

		$edata["maxNumberOfFiles"] = 1;

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

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

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

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


	$fdata["isSeparate"] = false;




// the field's search options settings
	
			// 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


	$tdataVinha_Report["Stock"] = $fdata;
		$tdataVinha_Report[".searchableFields"][] = "Stock";


$tables_data["Vinha Report"]=&$tdataVinha_Report;
$field_labels["Vinha_Report"] = &$fieldLabelsVinha_Report;
$fieldToolTips["Vinha_Report"] = &$fieldToolTipsVinha_Report;
$placeHolders["Vinha_Report"] = &$placeHoldersVinha_Report;
$page_titles["Vinha_Report"] = &$pageTitlesVinha_Report;

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

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



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


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










function createSqlQuery_Vinha_Report()
{
$proto0=array();
$proto0["m_strHead"] = "SELECT";
$proto0["m_strFieldList"] = "`Assegnatos`.`Marza`,  `Assegnatos`.`Varieta`,  `Assegnatos`.`Totale`,  SUM(`Vinha`.`Quantidade`) AS `Quantidade Vendida`,  COALESCE(Assegnatos.Totale,0)-SUM(COALESCE(Vinha.Quantidade,0)) AS `Stock`";
$proto0["m_strFrom"] = "FROM `Vinha`  LEFT OUTER JOIN `Assegnatos` ON `Vinha`.`CodPlanta` = `Assegnatos`.`Codice`";
$proto0["m_strWhere"] = "(`Vinha`.`Confirmado` =1)";
$proto0["m_strOrderBy"] = "";
	
		;
			$proto0["cipherer"] = null;
$proto2=array();
$proto2["m_sql"] = "`Vinha`.`Confirmado` =1";
$proto2["m_uniontype"] = "SQLL_UNKNOWN";
						$obj = new SQLField(array(
	"m_strName" => "Confirmado",
	"m_strTable" => "Vinha",
	"m_srcTableName" => "Vinha Report"
));

$proto2["m_column"]=$obj;
$proto2["m_contained"] = array();
$proto2["m_strCase"] = "=1";
$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" => "Marza",
	"m_strTable" => "Assegnatos",
	"m_srcTableName" => "Vinha Report"
));

$proto6["m_sql"] = "`Assegnatos`.`Marza`";
$proto6["m_srcTableName"] = "Vinha Report";
$proto6["m_expr"]=$obj;
$proto6["m_alias"] = "";
$obj = new SQLFieldListItem($proto6);

$proto0["m_fieldlist"][]=$obj;
						$proto8=array();
			$obj = new SQLField(array(
	"m_strName" => "Varieta",
	"m_strTable" => "Assegnatos",
	"m_srcTableName" => "Vinha Report"
));

$proto8["m_sql"] = "`Assegnatos`.`Varieta`";
$proto8["m_srcTableName"] = "Vinha Report";
$proto8["m_expr"]=$obj;
$proto8["m_alias"] = "";
$obj = new SQLFieldListItem($proto8);

$proto0["m_fieldlist"][]=$obj;
						$proto10=array();
			$obj = new SQLField(array(
	"m_strName" => "Totale",
	"m_strTable" => "Assegnatos",
	"m_srcTableName" => "Vinha Report"
));

$proto10["m_sql"] = "`Assegnatos`.`Totale`";
$proto10["m_srcTableName"] = "Vinha Report";
$proto10["m_expr"]=$obj;
$proto10["m_alias"] = "";
$obj = new SQLFieldListItem($proto10);

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

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

$proto12["m_sql"] = "SUM(`Vinha`.`Quantidade`)";
$proto12["m_srcTableName"] = "Vinha Report";
$proto12["m_expr"]=$obj;
$proto12["m_alias"] = "Quantidade Vendida";
$obj = new SQLFieldListItem($proto12);

$proto0["m_fieldlist"][]=$obj;
						$proto15=array();
			$obj = new SQLNonParsed(array(
	"m_sql" => "COALESCE(Assegnatos.Totale,0)-SUM(COALESCE(Vinha.Quantidade,0))"
));

$proto15["m_sql"] = "COALESCE(Assegnatos.Totale,0)-SUM(COALESCE(Vinha.Quantidade,0))";
$proto15["m_srcTableName"] = "Vinha Report";
$proto15["m_expr"]=$obj;
$proto15["m_alias"] = "Stock";
$obj = new SQLFieldListItem($proto15);

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

$proto17["m_table"] = $obj;
$proto17["m_sql"] = "`Vinha`";
$proto17["m_alias"] = "";
$proto17["m_srcTableName"] = "Vinha Report";
$proto19=array();
$proto19["m_sql"] = "";
$proto19["m_uniontype"] = "SQLL_UNKNOWN";
	$obj = new SQLNonParsed(array(
	"m_sql" => ""
));

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

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

$proto0["m_fromlist"][]=$obj;
												$proto21=array();
$proto21["m_link"] = "SQLL_LEFTJOIN";
			$proto22=array();
$proto22["m_strName"] = "Assegnatos";
$proto22["m_srcTableName"] = "Vinha Report";
$proto22["m_columns"] = array();
$proto22["m_columns"][] = "Data";
$proto22["m_columns"][] = "Marza";
$proto22["m_columns"][] = "Talea";
$proto22["m_columns"][] = "Varieta";
$proto22["m_columns"][] = "Totale";
$proto22["m_columns"][] = "Codice";
$proto22["m_columns"][] = "Clone";
$obj = new SQLTable($proto22);

$proto21["m_table"] = $obj;
$proto21["m_sql"] = "LEFT OUTER JOIN `Assegnatos` ON `Vinha`.`CodPlanta` = `Assegnatos`.`Codice`";
$proto21["m_alias"] = "";
$proto21["m_srcTableName"] = "Vinha Report";
$proto23=array();
$proto23["m_sql"] = "`Vinha`.`CodPlanta` = `Assegnatos`.`Codice`";
$proto23["m_uniontype"] = "SQLL_UNKNOWN";
						$obj = new SQLField(array(
	"m_strName" => "CodPlanta",
	"m_strTable" => "Vinha",
	"m_srcTableName" => "Vinha Report"
));

$proto23["m_column"]=$obj;
$proto23["m_contained"] = array();
$proto23["m_strCase"] = "= `Assegnatos`.`Codice`";
$proto23["m_havingmode"] = false;
$proto23["m_inBrackets"] = false;
$proto23["m_useAlias"] = false;
$obj = new SQLLogicalExpr($proto23);

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

$proto0["m_fromlist"][]=$obj;
$proto0["m_groupby"] = array();
												$proto25=array();
						$obj = new SQLField(array(
	"m_strName" => "Marza",
	"m_strTable" => "Assegnatos",
	"m_srcTableName" => "Vinha Report"
));

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

$proto0["m_groupby"][]=$obj;
												$proto27=array();
						$obj = new SQLField(array(
	"m_strName" => "Varieta",
	"m_strTable" => "Assegnatos",
	"m_srcTableName" => "Vinha Report"
));

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

$proto0["m_groupby"][]=$obj;
												$proto29=array();
						$obj = new SQLField(array(
	"m_strName" => "Totale",
	"m_strTable" => "Assegnatos",
	"m_srcTableName" => "Vinha Report"
));

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

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

	return $obj;
}
$queryData_Vinha_Report = createSqlQuery_Vinha_Report();


	
		;

					

$tdataVinha_Report[".sqlquery"] = $queryData_Vinha_Report;

$tableEvents["Vinha Report"] = new eventsBase;
$tdataVinha_Report[".hasEvents"] = false;

?>