<?php



$tdatavinha_report_clone = array();
$tdatavinha_report_clone[".searchableFields"] = array();
$tdatavinha_report_clone[".ShortName"] = "vinha_report_clone";
$tdatavinha_report_clone[".OwnerID"] = "";
$tdatavinha_report_clone[".OriginalTable"] = "Vinha";


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

//	field labels
$fieldLabelsvinha_report_clone = array();
$fieldToolTipsvinha_report_clone = array();
$pageTitlesvinha_report_clone = array();
$placeHoldersvinha_report_clone = array();

if(mlang_getcurrentlang()=="Portuguese(Standard)")
{
	$fieldLabelsvinha_report_clone["Portuguese(Standard)"] = array();
	$fieldToolTipsvinha_report_clone["Portuguese(Standard)"] = array();
	$placeHoldersvinha_report_clone["Portuguese(Standard)"] = array();
	$pageTitlesvinha_report_clone["Portuguese(Standard)"] = array();
	$fieldLabelsvinha_report_clone["Portuguese(Standard)"]["Marza"] = "Marza";
	$fieldToolTipsvinha_report_clone["Portuguese(Standard)"]["Marza"] = "";
	$placeHoldersvinha_report_clone["Portuguese(Standard)"]["Marza"] = "";
	$fieldLabelsvinha_report_clone["Portuguese(Standard)"]["Varieta"] = "Varieta";
	$fieldToolTipsvinha_report_clone["Portuguese(Standard)"]["Varieta"] = "";
	$placeHoldersvinha_report_clone["Portuguese(Standard)"]["Varieta"] = "";
	$fieldLabelsvinha_report_clone["Portuguese(Standard)"]["Totale"] = "Totale";
	$fieldToolTipsvinha_report_clone["Portuguese(Standard)"]["Totale"] = "";
	$placeHoldersvinha_report_clone["Portuguese(Standard)"]["Totale"] = "";
	$fieldLabelsvinha_report_clone["Portuguese(Standard)"]["Quantidade_Vendida"] = "Quantidade Vendida";
	$fieldToolTipsvinha_report_clone["Portuguese(Standard)"]["Quantidade_Vendida"] = "";
	$placeHoldersvinha_report_clone["Portuguese(Standard)"]["Quantidade_Vendida"] = "";
	$fieldLabelsvinha_report_clone["Portuguese(Standard)"]["Stock"] = "Stock";
	$fieldToolTipsvinha_report_clone["Portuguese(Standard)"]["Stock"] = "";
	$placeHoldersvinha_report_clone["Portuguese(Standard)"]["Stock"] = "";
	$fieldLabelsvinha_report_clone["Portuguese(Standard)"]["Talea"] = "Talea";
	$fieldToolTipsvinha_report_clone["Portuguese(Standard)"]["Talea"] = "";
	$placeHoldersvinha_report_clone["Portuguese(Standard)"]["Talea"] = "";
	$fieldLabelsvinha_report_clone["Portuguese(Standard)"]["Clone"] = "Clone";
	$fieldToolTipsvinha_report_clone["Portuguese(Standard)"]["Clone"] = "";
	$placeHoldersvinha_report_clone["Portuguese(Standard)"]["Clone"] = "";
	if (count($fieldToolTipsvinha_report_clone["Portuguese(Standard)"]))
		$tdatavinha_report_clone[".isUseToolTips"] = true;
}


	$tdatavinha_report_clone[".NCSearch"] = true;



$tdatavinha_report_clone[".shortTableName"] = "vinha_report_clone";
$tdatavinha_report_clone[".nSecOptions"] = 0;

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

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

	



$tdatavinha_report_clone[".showAddInPopup"] = false;

$tdatavinha_report_clone[".showEditInPopup"] = false;

$tdatavinha_report_clone[".showViewInPopup"] = false;

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


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

	$tdatavinha_report_clone[".audit"] = false;

	$tdatavinha_report_clone[".locking"] = false;


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

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

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

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



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




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

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

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

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



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

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

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

$tdatavinha_report_clone[".isUseAjaxSuggest"] = true;




									

$tdatavinha_report_clone[".ajaxCodeSnippetAdded"] = false;

$tdatavinha_report_clone[".buttonsAdded"] = false;

$tdatavinha_report_clone[".addPageEvents"] = false;

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


$tdatavinha_report_clone[".badgeColor"] = "d2af80";


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




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

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

$tdatavinha_report_clone[".nPrinterSplitRecords"] = 40;

$tdatavinha_report_clone[".geocodingEnabled"] = false;

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

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



$tdatavinha_report_clone[".reportGroupFields"] = true;
$tdatavinha_report_clone[".pageSize"] = 999;
$tdatavinha_report_clone[".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;
	$reportGroupFieldsList []= "Talea";

	$rgroupField = array();
	$rgroupField['strGroupField'] = "Talea";
	$rgroupField['groupInterval'] = 0;
	$rgroupField['groupOrder'] = 2;
	$rgroupField['showGroupSummary'] = "1";
	$rgroupField['crossTabAxis'] = "0";
	$reportGroupFields[] = $rgroupField;
	$reportGroupFieldsList []= "Clone";

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


$tdatavinha_report_clone[".isExistTotalFields"] = true;



$tdatavinha_report_clone[".reportGlobalSummary"] = true;

$tdatavinha_report_clone[".repShowDet"] = true;

$tdatavinha_report_clone[".reportLayout"] = 3;

//end of report settings










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

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

$tdatavinha_report_clone[".sqlHead"] = "SELECT Assegnatos.Marza,  Assegnatos.Varieta,  Assegnatos.Talea,  Assegnatos.Clone,  Assegnatos.Totale,  SUM(Vinha.Quantidade) AS `Quantidade Vendida`,  COALESCE(Assegnatos.Totale,0)-SUM(COALESCE(Vinha.Quantidade,0)) AS Stock";
$tdatavinha_report_clone[".sqlFrom"] = "FROM Vinha  LEFT OUTER JOIN Assegnatos ON Vinha.CodPlanta = Assegnatos.Codice";
$tdatavinha_report_clone[".sqlWhereExpr"] = "(Vinha.Confirmado =1)";
$tdatavinha_report_clone[".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_clone[".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_clone[".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_clone[".arrGroupsPerPage"] = $arrGPP;

$tdatavinha_report_clone[".highlightSearchResults"] = true;

$tableKeysvinha_report_clone = array();
$tdatavinha_report_clone[".Keys"] = $tableKeysvinha_report_clone;


$tdatavinha_report_clone[".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_Clone","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" => "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"]["search"] = $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


	$tdatavinha_report_clone["Marza"] = $fdata;
		$tdatavinha_report_clone[".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_Clone","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
		$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


	$tdatavinha_report_clone["Varieta"] = $fdata;
		$tdatavinha_report_clone[".searchableFields"][] = "Varieta";
//	Talea
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 3;
	$fdata["strName"] = "Talea";
	$fdata["GoodName"] = "Talea";
	$fdata["ownerTable"] = "Assegnatos";
	$fdata["Label"] = GetFieldLabel("Vinha_Report_Clone","Talea");
	$fdata["FieldType"] = 200;

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

	
	
			

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

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

	
	
				$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" => "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"] = "Talea";
	$edata["LinkFieldType"] = 0;
	$edata["DisplayField"] = "Talea";

	

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


	$tdatavinha_report_clone["Talea"] = $fdata;
		$tdatavinha_report_clone[".searchableFields"][] = "Talea";
//	Clone
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 4;
	$fdata["strName"] = "Clone";
	$fdata["GoodName"] = "Clone";
	$fdata["ownerTable"] = "Assegnatos";
	$fdata["Label"] = GetFieldLabel("Vinha_Report_Clone","Clone");
	$fdata["FieldType"] = 200;

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

	
	
			

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

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

	
	
				$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" => "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"] = "Clone";
	$edata["LinkFieldType"] = 0;
	$edata["DisplayField"] = "Clone";

	

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


	$tdatavinha_report_clone["Clone"] = $fdata;
		$tdatavinha_report_clone[".searchableFields"][] = "Clone";
//	Totale
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 5;
	$fdata["strName"] = "Totale";
	$fdata["GoodName"] = "Totale";
	$fdata["ownerTable"] = "Assegnatos";
	$fdata["Label"] = GetFieldLabel("Vinha_Report_Clone","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
		$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


	$tdatavinha_report_clone["Totale"] = $fdata;
		$tdatavinha_report_clone[".searchableFields"][] = "Totale";
//	Quantidade Vendida
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 6;
	$fdata["strName"] = "Quantidade Vendida";
	$fdata["GoodName"] = "Quantidade_Vendida";
	$fdata["ownerTable"] = "";
	$fdata["Label"] = GetFieldLabel("Vinha_Report_Clone","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
		$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


	$tdatavinha_report_clone["Quantidade Vendida"] = $fdata;
		$tdatavinha_report_clone[".searchableFields"][] = "Quantidade Vendida";
//	Stock
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 7;
	$fdata["strName"] = "Stock";
	$fdata["GoodName"] = "Stock";
	$fdata["ownerTable"] = "";
	$fdata["Label"] = GetFieldLabel("Vinha_Report_Clone","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
		$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


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


$tables_data["Vinha Report Clone"]=&$tdatavinha_report_clone;
$field_labels["Vinha_Report_Clone"] = &$fieldLabelsvinha_report_clone;
$fieldToolTips["Vinha_Report_Clone"] = &$fieldToolTipsvinha_report_clone;
$placeHolders["Vinha_Report_Clone"] = &$placeHoldersvinha_report_clone;
$page_titles["Vinha_Report_Clone"] = &$pageTitlesvinha_report_clone;

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

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



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

	$masterParams["type"] = PAGE_LIST;
					$masterTablesData["Vinha Report Clone"][0] = $masterParams;
				$masterTablesData["Vinha Report Clone"][0]["masterKeys"] = array();
	$masterTablesData["Vinha Report Clone"][0]["masterKeys"][]="CodClone";
				$masterTablesData["Vinha Report Clone"][0]["detailKeys"] = array();
	$masterTablesData["Vinha Report Clone"][0]["detailKeys"][]="Clone";
		
	
				$strOriginalDetailsTable="Marza";
	$masterParams = array();
	$masterParams["mDataSourceTable"]="Marza";
	$masterParams["mOriginalTable"]= $strOriginalDetailsTable;
	$masterParams["mShortTable"]= "marza";
	$masterParams["masterKeys"]= array();
	$masterParams["detailKeys"]= array();

	$masterParams["type"] = PAGE_LIST;
					$masterTablesData["Vinha Report Clone"][1] = $masterParams;
				$masterTablesData["Vinha Report Clone"][1]["masterKeys"] = array();
	$masterTablesData["Vinha Report Clone"][1]["masterKeys"][]="CodMarza";
				$masterTablesData["Vinha Report Clone"][1]["detailKeys"] = array();
	$masterTablesData["Vinha Report Clone"][1]["detailKeys"][]="Marza";
		
// -----------------end  prepare master-details data arrays ------------------------------//


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










function createSqlQuery_vinha_report_clone()
{
$proto0=array();
$proto0["m_strHead"] = "SELECT";
$proto0["m_strFieldList"] = "Assegnatos.Marza,  Assegnatos.Varieta,  Assegnatos.Talea,  Assegnatos.Clone,  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 Clone"
));

$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 Clone"
));

$proto6["m_sql"] = "Assegnatos.Marza";
$proto6["m_srcTableName"] = "Vinha Report Clone";
$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 Clone"
));

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

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

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

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

$proto12["m_sql"] = "Assegnatos.Clone";
$proto12["m_srcTableName"] = "Vinha Report Clone";
$proto12["m_expr"]=$obj;
$proto12["m_alias"] = "";
$obj = new SQLFieldListItem($proto12);

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

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

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

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

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

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

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

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

$proto21["m_table"] = $obj;
$proto21["m_sql"] = "Vinha";
$proto21["m_alias"] = "";
$proto21["m_srcTableName"] = "Vinha Report Clone";
$proto23=array();
$proto23["m_sql"] = "";
$proto23["m_uniontype"] = "SQLL_UNKNOWN";
	$obj = new SQLNonParsed(array(
	"m_sql" => ""
));

$proto23["m_column"]=$obj;
$proto23["m_contained"] = array();
$proto23["m_strCase"] = "";
$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;
												$proto25=array();
$proto25["m_link"] = "SQLL_LEFTJOIN";
			$proto26=array();
$proto26["m_strName"] = "Assegnatos";
$proto26["m_srcTableName"] = "Vinha Report Clone";
$proto26["m_columns"] = array();
$proto26["m_columns"][] = "Data";
$proto26["m_columns"][] = "Marza";
$proto26["m_columns"][] = "Talea";
$proto26["m_columns"][] = "Varieta";
$proto26["m_columns"][] = "Totale";
$proto26["m_columns"][] = "Codice";
$proto26["m_columns"][] = "Clone";
$obj = new SQLTable($proto26);

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

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

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

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

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

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

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

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

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

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

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

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

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

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

	return $obj;
}
$queryData_vinha_report_clone = createSqlQuery_vinha_report_clone();


	
		;

							

$tdatavinha_report_clone[".sqlquery"] = $queryData_vinha_report_clone;

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

?>