<?php



$tdataassegnatovinha = array();
$tdataassegnatovinha[".searchableFields"] = array();
$tdataassegnatovinha[".ShortName"] = "assegnatovinha";
$tdataassegnatovinha[".OwnerID"] = "";
$tdataassegnatovinha[".OriginalTable"] = "Vinha";


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

//	field labels
$fieldLabelsassegnatovinha = array();
$fieldToolTipsassegnatovinha = array();
$pageTitlesassegnatovinha = array();
$placeHoldersassegnatovinha = array();

if(mlang_getcurrentlang()=="Portuguese(Standard)")
{
	$fieldLabelsassegnatovinha["Portuguese(Standard)"] = array();
	$fieldToolTipsassegnatovinha["Portuguese(Standard)"] = array();
	$placeHoldersassegnatovinha["Portuguese(Standard)"] = array();
	$pageTitlesassegnatovinha["Portuguese(Standard)"] = array();
	$fieldLabelsassegnatovinha["Portuguese(Standard)"]["Varieta"] = "Varieta";
	$fieldToolTipsassegnatovinha["Portuguese(Standard)"]["Varieta"] = "";
	$placeHoldersassegnatovinha["Portuguese(Standard)"]["Varieta"] = "";
	$fieldLabelsassegnatovinha["Portuguese(Standard)"]["Totale"] = "Totale";
	$fieldToolTipsassegnatovinha["Portuguese(Standard)"]["Totale"] = "";
	$placeHoldersassegnatovinha["Portuguese(Standard)"]["Totale"] = "";
	$fieldLabelsassegnatovinha["Portuguese(Standard)"]["Quantidade_Vendida"] = "Quantidade Vendida";
	$fieldToolTipsassegnatovinha["Portuguese(Standard)"]["Quantidade_Vendida"] = "";
	$placeHoldersassegnatovinha["Portuguese(Standard)"]["Quantidade_Vendida"] = "";
	$fieldLabelsassegnatovinha["Portuguese(Standard)"]["Stock"] = "Stock";
	$fieldToolTipsassegnatovinha["Portuguese(Standard)"]["Stock"] = "";
	$placeHoldersassegnatovinha["Portuguese(Standard)"]["Stock"] = "";
	$fieldLabelsassegnatovinha["Portuguese(Standard)"]["Marza"] = "Marza";
	$fieldToolTipsassegnatovinha["Portuguese(Standard)"]["Marza"] = "";
	$placeHoldersassegnatovinha["Portuguese(Standard)"]["Marza"] = "";
	$fieldLabelsassegnatovinha["Portuguese(Standard)"]["Talea"] = "Talea";
	$fieldToolTipsassegnatovinha["Portuguese(Standard)"]["Talea"] = "";
	$placeHoldersassegnatovinha["Portuguese(Standard)"]["Talea"] = "";
	$fieldLabelsassegnatovinha["Portuguese(Standard)"]["Clone"] = "Clone";
	$fieldToolTipsassegnatovinha["Portuguese(Standard)"]["Clone"] = "";
	$placeHoldersassegnatovinha["Portuguese(Standard)"]["Clone"] = "";
	if (count($fieldToolTipsassegnatovinha["Portuguese(Standard)"]))
		$tdataassegnatovinha[".isUseToolTips"] = true;
}


	$tdataassegnatovinha[".NCSearch"] = true;


	$tdataassegnatovinha[".scrollGridBody"] = true;

$tdataassegnatovinha[".shortTableName"] = "assegnatovinha";
$tdataassegnatovinha[".nSecOptions"] = 0;

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

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

	



$tdataassegnatovinha[".showAddInPopup"] = true;

$tdataassegnatovinha[".showEditInPopup"] = false;

$tdataassegnatovinha[".showViewInPopup"] = false;

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


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

	$tdataassegnatovinha[".audit"] = true;

	$tdataassegnatovinha[".locking"] = true;


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

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

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

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



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




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

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

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

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



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

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

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

$tdataassegnatovinha[".isUseAjaxSuggest"] = true;

$tdataassegnatovinha[".rowHighlite"] = true;



			

$tdataassegnatovinha[".ajaxCodeSnippetAdded"] = false;

$tdataassegnatovinha[".buttonsAdded"] = false;

$tdataassegnatovinha[".addPageEvents"] = false;

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


$tdataassegnatovinha[".badgeColor"] = "3CB371";


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




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

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

$tdataassegnatovinha[".nPrinterSplitRecords"] = 40;

$tdataassegnatovinha[".geocodingEnabled"] = false;










$tdataassegnatovinha[".pageSize"] = 999;

$tdataassegnatovinha[".warnLeavingPages"] = true;



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

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

$tdataassegnatovinha[".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,  Assegnatos.Talea,  Assegnatos.Clone";
$tdataassegnatovinha[".sqlFrom"] = "FROM Vinha  LEFT OUTER JOIN Assegnatos ON Vinha.CodPlanta = Assegnatos.Codice";
$tdataassegnatovinha[".sqlWhereExpr"] = "";
$tdataassegnatovinha[".sqlTail"] = "";










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

$tdataassegnatovinha[".highlightSearchResults"] = true;

$tableKeysassegnatovinha = array();
$tdataassegnatovinha[".Keys"] = $tableKeysassegnatovinha;


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




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

	
	
	
			

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

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

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

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


	
	

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

	
			$edata["LookupUnique"] = true;

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

	

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

	
	
	
	

	
	
		$edata["SelectSize"] = 1;

// End Lookup Settings


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

		$edata["maxNumberOfFiles"] = 1;

	
	
	
	
	
	
		$edata["controlWidth"] = 200;

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

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


	$fdata["isSeparate"] = false;




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

			// the default search options list
				$fdata["searchOptionsList"] = array("Contains", "Equals", "Starts with", "More than", "Less than", "Between", "Empty", NOT_EMPTY);
// the end of search options settings


//Filters settings
	$fdata["filterTotals"] = 0;
		$fdata["filterMultiSelect"] = 0;
			$fdata["filterFormat"] = "Values list";
		$fdata["showCollapsed"] = false;

		$fdata["sortValueType"] = 0;
		$fdata["numberOfVisibleItems"] = 10;

		$fdata["filterBy"] = 0;

	

	
	
//end of Filters settings


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

	
	
	
			

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

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

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

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


	
	



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

		$edata["maxNumberOfFiles"] = 1;

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

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

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

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


	$fdata["isSeparate"] = false;




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

			// the user's search options list
		$fdata["searchOptionsList"] = array();
		$fdata["searchOptionsList"][] = "Equals";
// the end of search options settings


//Filters settings
	$fdata["filterTotals"] = 0;
		$fdata["filterMultiSelect"] = 0;
			$fdata["filterFormat"] = "Values list";
		$fdata["showCollapsed"] = false;

		$fdata["sortValueType"] = 0;
		$fdata["numberOfVisibleItems"] = 10;

		$fdata["filterBy"] = 0;

	

	
	
//end of Filters settings


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

	
	
	
			

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

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

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

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


	
	



		$edata["IsRequired"] = true;

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

		$edata["maxNumberOfFiles"] = 1;

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

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

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

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


	$fdata["isSeparate"] = false;




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

			// the default search options list
				$fdata["searchOptionsList"] = array("Contains", "Equals", "Starts with", "More than", "Less than", "Between", "Empty", NOT_EMPTY);
// the end of search options settings


//Filters settings
	$fdata["filterTotals"] = 0;
		$fdata["filterMultiSelect"] = 0;
			$fdata["filterFormat"] = "Values list";
		$fdata["showCollapsed"] = false;

		$fdata["sortValueType"] = 0;
		$fdata["numberOfVisibleItems"] = 10;

		$fdata["filterBy"] = 0;

	

	
	
//end of Filters settings


	$tdataassegnatovinha["Totale"] = $fdata;
		$tdataassegnatovinha[".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("AssegnatoVinha","Quantidade_Vendida");
	$fdata["FieldType"] = 14;

	
	
	
			

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

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

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

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


	
	



		$edata["IsRequired"] = true;

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

		$edata["maxNumberOfFiles"] = 1;

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

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

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

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


	$fdata["isSeparate"] = false;




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

			// the default search options list
				$fdata["searchOptionsList"] = array("Contains", "Equals", "Starts with", "More than", "Less than", "Between", "Empty", NOT_EMPTY);
// the end of search options settings


//Filters settings
	$fdata["filterTotals"] = 0;
		$fdata["filterMultiSelect"] = 0;
			$fdata["filterFormat"] = "Values list";
		$fdata["showCollapsed"] = false;

		$fdata["sortValueType"] = 0;
		$fdata["numberOfVisibleItems"] = 10;

		$fdata["filterBy"] = 0;

	

	
	
//end of Filters settings


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

	
	
	
			

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

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

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

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


	
	



		$edata["IsRequired"] = true;

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

		$edata["maxNumberOfFiles"] = 1;

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

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

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

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


	$fdata["isSeparate"] = false;




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

			// the default search options list
				$fdata["searchOptionsList"] = array("Contains", "Equals", "Starts with", "More than", "Less than", "Between", "Empty", NOT_EMPTY);
// the end of search options settings


//Filters settings
	$fdata["filterTotals"] = 0;
		$fdata["filterMultiSelect"] = 0;
			$fdata["filterFormat"] = "Values list";
		$fdata["showCollapsed"] = false;

		$fdata["sortValueType"] = 0;
		$fdata["numberOfVisibleItems"] = 10;

		$fdata["filterBy"] = 0;

	

	
	
//end of Filters settings


	$tdataassegnatovinha["Stock"] = $fdata;
		$tdataassegnatovinha[".searchableFields"][] = "Stock";
//	Talea
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 6;
	$fdata["strName"] = "Talea";
	$fdata["GoodName"] = "Talea";
	$fdata["ownerTable"] = "Assegnatos";
	$fdata["Label"] = GetFieldLabel("AssegnatoVinha","Talea");
	$fdata["FieldType"] = 200;

	
	
	
			

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

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

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

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


	
	

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

	
			$edata["LookupUnique"] = true;

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


	$fdata["isSeparate"] = false;




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

			// the default search options list
				$fdata["searchOptionsList"] = array("Contains", "Equals", "Starts with", "More than", "Less than", "Between", "Empty", NOT_EMPTY);
// the end of search options settings


//Filters settings
	$fdata["filterTotals"] = 0;
		$fdata["filterMultiSelect"] = 0;
			$fdata["filterFormat"] = "Values list";
		$fdata["showCollapsed"] = false;

		$fdata["sortValueType"] = 0;
		$fdata["numberOfVisibleItems"] = 10;

		$fdata["filterBy"] = 0;

	

	
	
//end of Filters settings


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

	
	
	
			

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

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

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

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


	
	

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

	
			$edata["LookupUnique"] = true;

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


	$fdata["isSeparate"] = false;




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

			// the default search options list
				$fdata["searchOptionsList"] = array("Contains", "Equals", "Starts with", "More than", "Less than", "Between", "Empty", NOT_EMPTY);
// the end of search options settings


//Filters settings
	$fdata["filterTotals"] = 0;
		$fdata["filterMultiSelect"] = 0;
			$fdata["filterFormat"] = "Values list";
		$fdata["showCollapsed"] = false;

		$fdata["sortValueType"] = 0;
		$fdata["numberOfVisibleItems"] = 10;

		$fdata["filterBy"] = 0;

	

	
	
//end of Filters settings


	$tdataassegnatovinha["Clone"] = $fdata;
		$tdataassegnatovinha[".searchableFields"][] = "Clone";


$tables_data["AssegnatoVinha"]=&$tdataassegnatovinha;
$field_labels["AssegnatoVinha"] = &$fieldLabelsassegnatovinha;
$fieldToolTips["AssegnatoVinha"] = &$fieldToolTipsassegnatovinha;
$placeHolders["AssegnatoVinha"] = &$placeHoldersassegnatovinha;
$page_titles["AssegnatoVinha"] = &$pageTitlesassegnatovinha;

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

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



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


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










function createSqlQuery_assegnatovinha()
{
$proto1=array();
$proto1["m_strHead"] = "SELECT";
$proto1["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,  Assegnatos.Talea,  Assegnatos.Clone";
$proto1["m_strFrom"] = "FROM Vinha  LEFT OUTER JOIN Assegnatos ON Vinha.CodPlanta = Assegnatos.Codice";
$proto1["m_strWhere"] = "";
$proto1["m_strOrderBy"] = "";
	
		;
			$proto1["cipherer"] = null;
$proto3=array();
$proto3["m_sql"] = "";
$proto3["m_uniontype"] = "SQLL_UNKNOWN";
	$obj = new SQLNonParsed(array(
	"m_sql" => ""
));

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

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

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

$proto1["m_having"] = $obj;
$proto1["m_fieldlist"] = array();
						$proto7=array();
			$obj = new SQLField(array(
	"m_strName" => "Marza",
	"m_strTable" => "Assegnatos",
	"m_srcTableName" => "AssegnatoVinha"
));

$proto7["m_sql"] = "Assegnatos.Marza";
$proto7["m_srcTableName"] = "AssegnatoVinha";
$proto7["m_expr"]=$obj;
$proto7["m_alias"] = "";
$obj = new SQLFieldListItem($proto7);

$proto1["m_fieldlist"][]=$obj;
						$proto9=array();
			$obj = new SQLField(array(
	"m_strName" => "Varieta",
	"m_strTable" => "Assegnatos",
	"m_srcTableName" => "AssegnatoVinha"
));

$proto9["m_sql"] = "Assegnatos.Varieta";
$proto9["m_srcTableName"] = "AssegnatoVinha";
$proto9["m_expr"]=$obj;
$proto9["m_alias"] = "";
$obj = new SQLFieldListItem($proto9);

$proto1["m_fieldlist"][]=$obj;
						$proto11=array();
			$obj = new SQLField(array(
	"m_strName" => "Totale",
	"m_strTable" => "Assegnatos",
	"m_srcTableName" => "AssegnatoVinha"
));

$proto11["m_sql"] = "Assegnatos.Totale";
$proto11["m_srcTableName"] = "AssegnatoVinha";
$proto11["m_expr"]=$obj;
$proto11["m_alias"] = "";
$obj = new SQLFieldListItem($proto11);

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

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

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

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

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

$proto1["m_fieldlist"][]=$obj;
						$proto18=array();
			$obj = new SQLField(array(
	"m_strName" => "Talea",
	"m_strTable" => "Assegnatos",
	"m_srcTableName" => "AssegnatoVinha"
));

$proto18["m_sql"] = "Assegnatos.Talea";
$proto18["m_srcTableName"] = "AssegnatoVinha";
$proto18["m_expr"]=$obj;
$proto18["m_alias"] = "";
$obj = new SQLFieldListItem($proto18);

$proto1["m_fieldlist"][]=$obj;
						$proto20=array();
			$obj = new SQLField(array(
	"m_strName" => "Clone",
	"m_strTable" => "Assegnatos",
	"m_srcTableName" => "AssegnatoVinha"
));

$proto20["m_sql"] = "Assegnatos.Clone";
$proto20["m_srcTableName"] = "AssegnatoVinha";
$proto20["m_expr"]=$obj;
$proto20["m_alias"] = "";
$obj = new SQLFieldListItem($proto20);

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

$proto22["m_table"] = $obj;
$proto22["m_sql"] = "Vinha";
$proto22["m_alias"] = "";
$proto22["m_srcTableName"] = "AssegnatoVinha";
$proto24=array();
$proto24["m_sql"] = "";
$proto24["m_uniontype"] = "SQLL_UNKNOWN";
	$obj = new SQLNonParsed(array(
	"m_sql" => ""
));

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

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

$proto1["m_fromlist"][]=$obj;
												$proto26=array();
$proto26["m_link"] = "SQLL_LEFTJOIN";
			$proto27=array();
$proto27["m_strName"] = "Assegnatos";
$proto27["m_srcTableName"] = "AssegnatoVinha";
$proto27["m_columns"] = array();
$proto27["m_columns"][] = "Data";
$proto27["m_columns"][] = "Marza";
$proto27["m_columns"][] = "Talea";
$proto27["m_columns"][] = "Varieta";
$proto27["m_columns"][] = "Totale";
$proto27["m_columns"][] = "Codice";
$proto27["m_columns"][] = "Clone";
$obj = new SQLTable($proto27);

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

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

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

$proto1["m_fromlist"][]=$obj;
$proto1["m_groupby"] = array();
												$proto30=array();
						$obj = new SQLField(array(
	"m_strName" => "Marza",
	"m_strTable" => "Assegnatos",
	"m_srcTableName" => "AssegnatoVinha"
));

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

$proto1["m_groupby"][]=$obj;
												$proto32=array();
						$obj = new SQLField(array(
	"m_strName" => "Varieta",
	"m_strTable" => "Assegnatos",
	"m_srcTableName" => "AssegnatoVinha"
));

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

$proto1["m_groupby"][]=$obj;
												$proto34=array();
						$obj = new SQLField(array(
	"m_strName" => "Totale",
	"m_strTable" => "Assegnatos",
	"m_srcTableName" => "AssegnatoVinha"
));

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

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

	return $obj;
}
$queryData_assegnatovinha = createSqlQuery_assegnatovinha();


	
		;

							

$tdataassegnatovinha[".sqlquery"] = $queryData_assegnatovinha;

include_once(getabspath("include/assegnatovinha_events.php"));
$tableEvents["AssegnatoVinha"] = new eventclass_assegnatovinha;
$tdataassegnatovinha[".hasEvents"] = true;

?>