<?php



$tdatavinha_report_n_o_confirmados = array();
$tdatavinha_report_n_o_confirmados[".searchableFields"] = array();
$tdatavinha_report_n_o_confirmados[".ShortName"] = "vinha_report_n_o_confirmados";
$tdatavinha_report_n_o_confirmados[".OwnerID"] = "";
$tdatavinha_report_n_o_confirmados[".OriginalTable"] = "Vinha";


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

//	field labels
$fieldLabelsvinha_report_n_o_confirmados = array();
$fieldToolTipsvinha_report_n_o_confirmados = array();
$pageTitlesvinha_report_n_o_confirmados = array();
$placeHoldersvinha_report_n_o_confirmados = array();

if(mlang_getcurrentlang()=="Portuguese(Standard)")
{
	$fieldLabelsvinha_report_n_o_confirmados["Portuguese(Standard)"] = array();
	$fieldToolTipsvinha_report_n_o_confirmados["Portuguese(Standard)"] = array();
	$placeHoldersvinha_report_n_o_confirmados["Portuguese(Standard)"] = array();
	$pageTitlesvinha_report_n_o_confirmados["Portuguese(Standard)"] = array();
	$fieldLabelsvinha_report_n_o_confirmados["Portuguese(Standard)"]["Marza"] = "Marza";
	$fieldToolTipsvinha_report_n_o_confirmados["Portuguese(Standard)"]["Marza"] = "";
	$placeHoldersvinha_report_n_o_confirmados["Portuguese(Standard)"]["Marza"] = "";
	$fieldLabelsvinha_report_n_o_confirmados["Portuguese(Standard)"]["Quantidade_Vendida"] = "Quantidade Vendida";
	$fieldToolTipsvinha_report_n_o_confirmados["Portuguese(Standard)"]["Quantidade_Vendida"] = "";
	$placeHoldersvinha_report_n_o_confirmados["Portuguese(Standard)"]["Quantidade_Vendida"] = "";
	$fieldLabelsvinha_report_n_o_confirmados["Portuguese(Standard)"]["Stock"] = "Stock";
	$fieldToolTipsvinha_report_n_o_confirmados["Portuguese(Standard)"]["Stock"] = "";
	$placeHoldersvinha_report_n_o_confirmados["Portuguese(Standard)"]["Stock"] = "";
	$fieldLabelsvinha_report_n_o_confirmados["Portuguese(Standard)"]["SUM_Totale_"] = "SUM(Totale)";
	$fieldToolTipsvinha_report_n_o_confirmados["Portuguese(Standard)"]["SUM_Totale_"] = "";
	$placeHoldersvinha_report_n_o_confirmados["Portuguese(Standard)"]["SUM_Totale_"] = "";
	if (count($fieldToolTipsvinha_report_n_o_confirmados["Portuguese(Standard)"]))
		$tdatavinha_report_n_o_confirmados[".isUseToolTips"] = true;
}


	$tdatavinha_report_n_o_confirmados[".NCSearch"] = true;



$tdatavinha_report_n_o_confirmados[".shortTableName"] = "vinha_report_n_o_confirmados";
$tdatavinha_report_n_o_confirmados[".nSecOptions"] = 0;

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

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

	



$tdatavinha_report_n_o_confirmados[".showAddInPopup"] = false;

$tdatavinha_report_n_o_confirmados[".showEditInPopup"] = false;

$tdatavinha_report_n_o_confirmados[".showViewInPopup"] = false;

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


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

	$tdatavinha_report_n_o_confirmados[".audit"] = false;

	$tdatavinha_report_n_o_confirmados[".locking"] = false;


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

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

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

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



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




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

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

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

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



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

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

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

$tdatavinha_report_n_o_confirmados[".isUseAjaxSuggest"] = true;




			

$tdatavinha_report_n_o_confirmados[".ajaxCodeSnippetAdded"] = false;

$tdatavinha_report_n_o_confirmados[".buttonsAdded"] = false;

$tdatavinha_report_n_o_confirmados[".addPageEvents"] = false;

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


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


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

$tdatavinha_report_n_o_confirmados[".googleLikeFields"] = array();
$tdatavinha_report_n_o_confirmados[".googleLikeFields"][] = "SUM(Totale)";



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

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

$tdatavinha_report_n_o_confirmados[".nPrinterSplitRecords"] = 40;

$tdatavinha_report_n_o_confirmados[".geocodingEnabled"] = false;

//report settings
$tdatavinha_report_n_o_confirmados[".printReportLayout"] = 6;

$tdatavinha_report_n_o_confirmados[".reportPrintPartitionType"] = 1;
$tdatavinha_report_n_o_confirmados[".reportPrintGroupsPerPage"] = 40;
$tdatavinha_report_n_o_confirmados[".lowGroup"] = 0;



$tdatavinha_report_n_o_confirmados[".pageSize"] = 999;


$tdatavinha_report_n_o_confirmados[".isExistTotalFields"] = true;



$tdatavinha_report_n_o_confirmados[".reportGlobalSummary"] = true;

$tdatavinha_report_n_o_confirmados[".repShowDet"] = true;

$tdatavinha_report_n_o_confirmados[".reportLayout"] = 6;

//end of report settings










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

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

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

$tdatavinha_report_n_o_confirmados[".highlightSearchResults"] = true;

$tableKeysvinha_report_n_o_confirmados = array();
$tdatavinha_report_n_o_confirmados[".Keys"] = $tableKeysvinha_report_n_o_confirmados;


$tdatavinha_report_n_o_confirmados[".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_N_o_Confirmados","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_n_o_confirmados["Marza"] = $fdata;
		$tdatavinha_report_n_o_confirmados[".searchableFields"][] = "Marza";
//	Quantidade Vendida
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 2;
	$fdata["strName"] = "Quantidade Vendida";
	$fdata["GoodName"] = "Quantidade_Vendida";
	$fdata["ownerTable"] = "";
	$fdata["Label"] = GetFieldLabel("Vinha_Report_N_o_Confirmados","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_n_o_confirmados["Quantidade Vendida"] = $fdata;
		$tdatavinha_report_n_o_confirmados[".searchableFields"][] = "Quantidade Vendida";
//	Stock
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 3;
	$fdata["strName"] = "Stock";
	$fdata["GoodName"] = "Stock";
	$fdata["ownerTable"] = "";
	$fdata["Label"] = GetFieldLabel("Vinha_Report_N_o_Confirmados","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_n_o_confirmados["Stock"] = $fdata;
		$tdatavinha_report_n_o_confirmados[".searchableFields"][] = "Stock";
//	SUM(Totale)
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 4;
	$fdata["strName"] = "SUM(Totale)";
	$fdata["GoodName"] = "SUM_Totale_";
	$fdata["ownerTable"] = "";
	$fdata["Label"] = GetFieldLabel("Vinha_Report_N_o_Confirmados","SUM_Totale_");
	$fdata["FieldType"] = 14;

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

	
	
			

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

		$fdata["isSQLExpression"] = true;
	$fdata["FullName"] = "SUM(Assegnatos.Totale)";

	
	
				$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"]["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"] = "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"]["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_n_o_confirmados["SUM(Totale)"] = $fdata;
		$tdatavinha_report_n_o_confirmados[".searchableFields"][] = "SUM(Totale)";


$tables_data["Vinha Report Não Confirmados"]=&$tdatavinha_report_n_o_confirmados;
$field_labels["Vinha_Report_N_o_Confirmados"] = &$fieldLabelsvinha_report_n_o_confirmados;
$fieldToolTips["Vinha_Report_N_o_Confirmados"] = &$fieldToolTipsvinha_report_n_o_confirmados;
$placeHolders["Vinha_Report_N_o_Confirmados"] = &$placeHoldersvinha_report_n_o_confirmados;
$page_titles["Vinha_Report_N_o_Confirmados"] = &$pageTitlesvinha_report_n_o_confirmados;

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

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



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


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










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

$proto2["m_column"]=$obj;
$proto2["m_contained"] = array();
$proto2["m_strCase"] = "=0";
$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 Não Confirmados"
));

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

$proto0["m_fieldlist"][]=$obj;
						$proto8=array();
			$proto9=array();
$proto9["m_functiontype"] = "SQLF_SUM";
$proto9["m_arguments"] = array();
						$obj = new SQLField(array(
	"m_strName" => "Quantidade",
	"m_strTable" => "Vinha",
	"m_srcTableName" => "Vinha Report Não Confirmados"
));

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

$proto8["m_sql"] = "SUM(Vinha.Quantidade)";
$proto8["m_srcTableName"] = "Vinha Report Não Confirmados";
$proto8["m_expr"]=$obj;
$proto8["m_alias"] = "Quantidade Vendida";
$obj = new SQLFieldListItem($proto8);

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

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

$proto0["m_fieldlist"][]=$obj;
						$proto13=array();
			$proto14=array();
$proto14["m_functiontype"] = "SQLF_SUM";
$proto14["m_arguments"] = array();
						$obj = new SQLField(array(
	"m_strName" => "Totale",
	"m_strTable" => "Assegnatos",
	"m_srcTableName" => "Vinha Report Não Confirmados"
));

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

$proto13["m_sql"] = "SUM(Assegnatos.Totale)";
$proto13["m_srcTableName"] = "Vinha Report Não Confirmados";
$proto13["m_expr"]=$obj;
$proto13["m_alias"] = "SUM(Totale)";
$obj = new SQLFieldListItem($proto13);

$proto0["m_fieldlist"][]=$obj;
$proto0["m_fromlist"] = array();
												$proto16=array();
$proto16["m_link"] = "SQLL_MAIN";
			$proto17=array();
$proto17["m_strName"] = "Vinha";
$proto17["m_srcTableName"] = "Vinha Report Não Confirmados";
$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"] = "Vinha Report Não Confirmados";
$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);

$proto0["m_fromlist"][]=$obj;
												$proto20=array();
$proto20["m_link"] = "SQLL_RIGHTJOIN";
			$proto21=array();
$proto21["m_strName"] = "Assegnatos";
$proto21["m_srcTableName"] = "Vinha Report Não Confirmados";
$proto21["m_columns"] = array();
$proto21["m_columns"][] = "Data";
$proto21["m_columns"][] = "Marza";
$proto21["m_columns"][] = "Talea";
$proto21["m_columns"][] = "Varieta";
$proto21["m_columns"][] = "Totale";
$proto21["m_columns"][] = "Codice";
$proto21["m_columns"][] = "Clone";
$obj = new SQLTable($proto21);

$proto20["m_table"] = $obj;
$proto20["m_sql"] = "RIGHT OUTER JOIN Assegnatos ON Assegnatos.Codice = Vinha.CodPlanta";
$proto20["m_alias"] = "";
$proto20["m_srcTableName"] = "Vinha Report Não Confirmados";
$proto22=array();
$proto22["m_sql"] = "Assegnatos.Codice = Vinha.CodPlanta";
$proto22["m_uniontype"] = "SQLL_UNKNOWN";
						$obj = new SQLField(array(
	"m_strName" => "Codice",
	"m_strTable" => "Assegnatos",
	"m_srcTableName" => "Vinha Report Não Confirmados"
));

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

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

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

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

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

	return $obj;
}
$queryData_vinha_report_n_o_confirmados = createSqlQuery_vinha_report_n_o_confirmados();


	
		;

				

$tdatavinha_report_n_o_confirmados[".sqlquery"] = $queryData_vinha_report_n_o_confirmados;

$tableEvents["Vinha Report Não Confirmados"] = new eventsBase;
$tdatavinha_report_n_o_confirmados[".hasEvents"] = false;

?>