<?php
require_once(getabspath("classes/cipherer.php"));
$tdataajuste = array();
	$tdataajuste[".NumberOfChars"] = 80; 
	$tdataajuste[".ShortName"] = "ajuste";
	$tdataajuste[".OwnerID"] = "";
	$tdataajuste[".OriginalTable"] = "ajuste";

//	field labels
$fieldLabelsajuste = array();
if(mlang_getcurrentlang()=="Spanish")
{
	$fieldLabelsajuste["Spanish"] = array();
	$fieldToolTipsajuste["Spanish"] = array();
	$fieldLabelsajuste["Spanish"]["idajuste"] = "ID Ajuste";
	$fieldToolTipsajuste["Spanish"]["idajuste"] = "";
	$fieldLabelsajuste["Spanish"]["fecha"] = "Fecha";
	$fieldToolTipsajuste["Spanish"]["fecha"] = "";
	$fieldLabelsajuste["Spanish"]["idmotivo_ajuste"] = "Motivo Ajuste";
	$fieldToolTipsajuste["Spanish"]["idmotivo_ajuste"] = "";
	$fieldLabelsajuste["Spanish"]["idarticulo"] = "Artículo";
	$fieldToolTipsajuste["Spanish"]["idarticulo"] = "";
	$fieldLabelsajuste["Spanish"]["cant_antes"] = "Cant Antes";
	$fieldToolTipsajuste["Spanish"]["cant_antes"] = "";
	$fieldLabelsajuste["Spanish"]["cant_ajustada"] = "Cant Ajustada";
	$fieldToolTipsajuste["Spanish"]["cant_ajustada"] = "";
	$fieldLabelsajuste["Spanish"]["cant_despues"] = "Cant Después";
	$fieldToolTipsajuste["Spanish"]["cant_despues"] = "";
	if (count($fieldToolTipsajuste["Spanish"]))
		$tdataajuste[".isUseToolTips"] = true;
}
	
	
	$tdataajuste[".NCSearch"] = true;



$tdataajuste[".shortTableName"] = "ajuste";
$tdataajuste[".nSecOptions"] = 0;
$tdataajuste[".recsPerRowList"] = 1;
$tdataajuste[".mainTableOwnerID"] = "";
$tdataajuste[".moveNext"] = 1;
$tdataajuste[".nType"] = 0;

$tdataajuste[".strOriginalTableName"] = "ajuste";




$tdataajuste[".showAddInPopup"] = true;

$tdataajuste[".showEditInPopup"] = true;

$tdataajuste[".showViewInPopup"] = false;

$tdataajuste[".fieldsForRegister"] = array();
	
if (!isMobile())
	$tdataajuste[".listAjax"] = true;
else 
	$tdataajuste[".listAjax"] = false;

	$tdataajuste[".audit"] = false;

	$tdataajuste[".locking"] = false;


$tdataajuste[".exportTo"] = true;

$tdataajuste[".printFriendly"] = true;


$tdataajuste[".showSimpleSearchOptions"] = false;

$tdataajuste[".showSearchPanel"] = true;

if (isMobile())
	$tdataajuste[".isUseAjaxSuggest"] = false;
else 
	$tdataajuste[".isUseAjaxSuggest"] = true;

$tdataajuste[".rowHighlite"] = true;

// button handlers file names

$tdataajuste[".addPageEvents"] = false;

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




$tdataajuste[".allSearchFields"] = array();

$tdataajuste[".allSearchFields"][] = "idajuste";
$tdataajuste[".allSearchFields"][] = "fecha";
$tdataajuste[".allSearchFields"][] = "idmotivo_ajuste";
$tdataajuste[".allSearchFields"][] = "idarticulo";
$tdataajuste[".allSearchFields"][] = "cant_antes";
$tdataajuste[".allSearchFields"][] = "cant_ajustada";
$tdataajuste[".allSearchFields"][] = "cant_despues";

$tdataajuste[".googleLikeFields"][] = "idajuste";
$tdataajuste[".googleLikeFields"][] = "fecha";
$tdataajuste[".googleLikeFields"][] = "idmotivo_ajuste";
$tdataajuste[".googleLikeFields"][] = "idarticulo";
$tdataajuste[".googleLikeFields"][] = "cant_antes";
$tdataajuste[".googleLikeFields"][] = "cant_ajustada";
$tdataajuste[".googleLikeFields"][] = "cant_despues";


$tdataajuste[".advSearchFields"][] = "idajuste";
$tdataajuste[".advSearchFields"][] = "fecha";
$tdataajuste[".advSearchFields"][] = "idmotivo_ajuste";
$tdataajuste[".advSearchFields"][] = "idarticulo";
$tdataajuste[".advSearchFields"][] = "cant_antes";
$tdataajuste[".advSearchFields"][] = "cant_ajustada";
$tdataajuste[".advSearchFields"][] = "cant_despues";

$tdataajuste[".isTableType"] = "list";

	



// Access doesn't support subqueries from the same table as main



$tdataajuste[".pageSize"] = 20;

$tstrOrderBy = "ORDER BY idajuste DESC";
if(strlen($tstrOrderBy) && strtolower(substr($tstrOrderBy,0,8))!="order by")
	$tstrOrderBy = "order by ".$tstrOrderBy;
$tdataajuste[".strOrderBy"] = $tstrOrderBy;

$tdataajuste[".orderindexes"] = array();
$tdataajuste[".orderindexes"][] = array(1, (0 ? "ASC" : "DESC"), "idajuste");

$tdataajuste[".sqlHead"] = "SELECT idajuste,  fecha,  idmotivo_ajuste,  idarticulo,  cant_antes,  cant_ajustada,  cant_despues";
$tdataajuste[".sqlFrom"] = "FROM ajuste";
$tdataajuste[".sqlWhereExpr"] = "";
$tdataajuste[".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;
$tdataajuste[".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;
$tdataajuste[".arrGroupsPerPage"] = $arrGPP;

$tableKeysajuste = array();
$tableKeysajuste[] = "idajuste";
$tdataajuste[".Keys"] = $tableKeysajuste;

$tdataajuste[".listFields"] = array();
$tdataajuste[".listFields"][] = "idajuste";
$tdataajuste[".listFields"][] = "fecha";
$tdataajuste[".listFields"][] = "idarticulo";
$tdataajuste[".listFields"][] = "idmotivo_ajuste";
$tdataajuste[".listFields"][] = "cant_antes";
$tdataajuste[".listFields"][] = "cant_ajustada";
$tdataajuste[".listFields"][] = "cant_despues";

$tdataajuste[".viewFields"] = array();

$tdataajuste[".addFields"] = array();
$tdataajuste[".addFields"][] = "idmotivo_ajuste";
$tdataajuste[".addFields"][] = "idarticulo";
$tdataajuste[".addFields"][] = "cant_despues";

$tdataajuste[".inlineAddFields"] = array();

$tdataajuste[".editFields"] = array();

$tdataajuste[".inlineEditFields"] = array();

$tdataajuste[".exportFields"] = array();
$tdataajuste[".exportFields"][] = "idajuste";
$tdataajuste[".exportFields"][] = "fecha";
$tdataajuste[".exportFields"][] = "idmotivo_ajuste";
$tdataajuste[".exportFields"][] = "idarticulo";
$tdataajuste[".exportFields"][] = "cant_antes";
$tdataajuste[".exportFields"][] = "cant_ajustada";
$tdataajuste[".exportFields"][] = "cant_despues";

$tdataajuste[".printFields"] = array();
$tdataajuste[".printFields"][] = "idajuste";
$tdataajuste[".printFields"][] = "fecha";
$tdataajuste[".printFields"][] = "idmotivo_ajuste";
$tdataajuste[".printFields"][] = "idarticulo";
$tdataajuste[".printFields"][] = "cant_antes";
$tdataajuste[".printFields"][] = "cant_ajustada";
$tdataajuste[".printFields"][] = "cant_despues";

//	idajuste
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 1;
	$fdata["strName"] = "idajuste";
	$fdata["GoodName"] = "idajuste";
	$fdata["ownerTable"] = "ajuste";
	$fdata["Label"] = "ID Ajuste"; 
	$fdata["FieldType"] = 3;
	
		$fdata["AutoInc"] = true;
	
		
		$fdata["bListPage"] = true; 
	
		
		
		
		
		
		$fdata["bAdvancedSearch"] = true; 
	
		$fdata["bPrinterPage"] = true; 
	
		$fdata["bExportPage"] = true; 
	
		$fdata["strField"] = "idajuste"; 
		$fdata["FullName"] = "idajuste";
	
		
		
				$fdata["FieldPermissions"] = true;
	
				$fdata["UploadFolder"] = "files";
		
//  Begin View Formats
	$fdata["ViewFormats"] = array();
	
	$vdata = array("ViewFormat" => "");
	
		
		
		
			
		
		
		
		
		
		
		$vdata["NeedEncode"] = true;
	
	$fdata["ViewFormats"]["view"] = $vdata;
//  End View Formats

//	Begin Edit Formats 	
	$fdata["EditFormats"] = array();
	
	$edata = array("EditFormat" => "Text field");
	
		
		
	
//	Begin Lookup settings
	//	End Lookup Settings

		$edata["IsRequired"] = true; 
	
		
		
		
			$edata["acceptFileTypes"] = ".+$";
	
		$edata["maxNumberOfFiles"] = 1;
	
		
		
		
		
		$edata["EditParams"] = "";
			
		
//	Begin validation
	$edata["validateAs"] = array();
				$edata["validateAs"]["basicValidate"][] = getJsValidatorName("Number");	
						$edata["validateAs"]["basicValidate"][] = "IsRequired";
	
			//	End validation
	
		
				
		$fdata["EditFormats"]["edit"] = $edata;
//	End Edit Formats
	
		$fdata["isSeparate"] = false;
	
		
		
	$tdataajuste["idajuste"] = $fdata;
//	fecha
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 2;
	$fdata["strName"] = "fecha";
	$fdata["GoodName"] = "fecha";
	$fdata["ownerTable"] = "ajuste";
	$fdata["Label"] = "Fecha"; 
	$fdata["FieldType"] = 135;
	
		
		
		$fdata["bListPage"] = true; 
	
		
		
		
		
		
		$fdata["bAdvancedSearch"] = true; 
	
		$fdata["bPrinterPage"] = true; 
	
		$fdata["bExportPage"] = true; 
	
		$fdata["strField"] = "fecha"; 
		$fdata["FullName"] = "fecha";
	
		
		
				$fdata["FieldPermissions"] = true;
	
				$fdata["UploadFolder"] = "files";
		
//  Begin View Formats
	$fdata["ViewFormats"] = array();
	
	$vdata = array("ViewFormat" => "Short Date");
	
		
		
		
			
		
		
		
		
		
		
		$vdata["NeedEncode"] = true;
	
	$fdata["ViewFormats"]["view"] = $vdata;
//  End View Formats

//	Begin Edit Formats 	
	$fdata["EditFormats"] = array();
	
	$edata = array("EditFormat" => "Date");
	
		
		
	
//	Begin Lookup settings
	//	End Lookup Settings

		$edata["IsRequired"] = true; 
	
		
		
		
			$edata["acceptFileTypes"] = ".+$";
	
		$edata["maxNumberOfFiles"] = 1;
	
		
		
		$edata["DateEditType"] = 13; 
	$edata["InitialYearFactor"] = 100; 
	$edata["LastYearFactor"] = 10; 
	
		
		
		
//	Begin validation
	$edata["validateAs"] = array();
						$edata["validateAs"]["basicValidate"][] = "IsRequired";
	
			//	End validation
	
		
				
		$fdata["EditFormats"]["edit"] = $edata;
//	End Edit Formats
	
		$fdata["isSeparate"] = false;
	
		
		
	$tdataajuste["fecha"] = $fdata;
//	idmotivo_ajuste
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 3;
	$fdata["strName"] = "idmotivo_ajuste";
	$fdata["GoodName"] = "idmotivo_ajuste";
	$fdata["ownerTable"] = "ajuste";
	$fdata["Label"] = "Motivo Ajuste"; 
	$fdata["FieldType"] = 3;
	
		
		
		$fdata["bListPage"] = true; 
	
		$fdata["bAddPage"] = true; 
	
		
		
		
		
		$fdata["bAdvancedSearch"] = true; 
	
		$fdata["bPrinterPage"] = true; 
	
		$fdata["bExportPage"] = true; 
	
		$fdata["strField"] = "idmotivo_ajuste"; 
		$fdata["FullName"] = "idmotivo_ajuste";
	
		
		
				$fdata["FieldPermissions"] = true;
	
				$fdata["UploadFolder"] = "files";
		
//  Begin View Formats
	$fdata["ViewFormats"] = array();
	
	$vdata = array("ViewFormat" => "");
	
		
		
		
			
		
		
		
		
		
		
		$vdata["NeedEncode"] = true;
	
	$fdata["ViewFormats"]["view"] = $vdata;
//  End View Formats

//	Begin Edit Formats 	
	$fdata["EditFormats"] = array();
	
	$edata = array("EditFormat" => "Lookup wizard");
	
		
		
	
//	Begin Lookup settings
								$edata["LookupType"] = 2;
	$edata["freeInput"] = 0;
	$edata["autoCompleteFieldsOnEdit"] = 0;
	$edata["autoCompleteFields"] = array();
				
		
			
	$edata["LinkField"] = "idmotivo_ajuste";
	$edata["LinkFieldType"] = 3;
	$edata["DisplayField"] = "nombre";
	
		
	$edata["LookupTable"] = "motivo_ajuste";
	$edata["LookupOrderBy"] = "";
	
		
		
		
		
		$edata["AllowToAdd"] = true; 
	
				
	
	
	//	End Lookup Settings

		$edata["IsRequired"] = true; 
	
		
		
		
			$edata["acceptFileTypes"] = ".+$";
	
		$edata["maxNumberOfFiles"] = 1;
	
		
		
		
		
		
		
//	Begin validation
	$edata["validateAs"] = array();
						$edata["validateAs"]["basicValidate"][] = "IsRequired";
	
			//	End validation
	
		
				
		$fdata["EditFormats"]["edit"] = $edata;
//	End Edit Formats
	
		$fdata["isSeparate"] = false;
	
		
		
	$tdataajuste["idmotivo_ajuste"] = $fdata;
//	idarticulo
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 4;
	$fdata["strName"] = "idarticulo";
	$fdata["GoodName"] = "idarticulo";
	$fdata["ownerTable"] = "ajuste";
	$fdata["Label"] = "Artículo"; 
	$fdata["FieldType"] = 3;
	
		
		
		$fdata["bListPage"] = true; 
	
		$fdata["bAddPage"] = true; 
	
		
		
		
		
		$fdata["bAdvancedSearch"] = true; 
	
		$fdata["bPrinterPage"] = true; 
	
		$fdata["bExportPage"] = true; 
	
		$fdata["strField"] = "idarticulo"; 
		$fdata["FullName"] = "idarticulo";
	
		
		
				$fdata["FieldPermissions"] = true;
	
				$fdata["UploadFolder"] = "files";
		
//  Begin View Formats
	$fdata["ViewFormats"] = array();
	
	$vdata = array("ViewFormat" => "");
	
		
		
		
			
		
		
		
		
		
		
		$vdata["NeedEncode"] = true;
	
	$fdata["ViewFormats"]["view"] = $vdata;
//  End View Formats

//	Begin Edit Formats 	
	$fdata["EditFormats"] = array();
	
	$edata = array("EditFormat" => "Lookup wizard");
	
		
		
	
//	Begin Lookup settings
								$edata["LookupType"] = 2;
	$edata["freeInput"] = 0;
	$edata["autoCompleteFieldsOnEdit"] = 0;
	$edata["autoCompleteFields"] = array();
				if(strpos(GetUserPermissions("ajuste"), 'S') !== false)
		$edata["LCType"] = 2;
	else 
		$edata["LCType"] = 0;
			
		
			
	$edata["LinkField"] = "idarticulo";
	$edata["LinkFieldType"] = 3;
	$edata["DisplayField"] = "nombre";
	
		
	$edata["LookupTable"] = "v_articulo";
	$edata["LookupOrderBy"] = "";
	
		
		
		
		
		$edata["AllowToAdd"] = true; 
	
				
	
	
	//	End Lookup Settings

		$edata["IsRequired"] = true; 
	
		
		
		
			$edata["acceptFileTypes"] = ".+$";
	
		$edata["maxNumberOfFiles"] = 1;
	
		
		
		
		
		
		$edata["inputStyle"] = " width:350px;";
	$edata["controlWidth"] = 350;
	
//	Begin validation
	$edata["validateAs"] = array();
						$edata["validateAs"]["basicValidate"][] = "IsRequired";
	
			//	End validation
	
		
				
		$fdata["EditFormats"]["edit"] = $edata;
//	End Edit Formats
	
		$fdata["isSeparate"] = false;
	
		
		
	$tdataajuste["idarticulo"] = $fdata;
//	cant_antes
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 5;
	$fdata["strName"] = "cant_antes";
	$fdata["GoodName"] = "cant_antes";
	$fdata["ownerTable"] = "ajuste";
	$fdata["Label"] = "Cant Antes"; 
	$fdata["FieldType"] = 3;
	
		
		
		$fdata["bListPage"] = true; 
	
		
		
		
		
		
		$fdata["bAdvancedSearch"] = true; 
	
		$fdata["bPrinterPage"] = true; 
	
		$fdata["bExportPage"] = true; 
	
		$fdata["strField"] = "cant_antes"; 
		$fdata["FullName"] = "cant_antes";
	
		
		
				$fdata["FieldPermissions"] = true;
	
				$fdata["UploadFolder"] = "files";
		
//  Begin View Formats
	$fdata["ViewFormats"] = array();
	
	$vdata = array("ViewFormat" => "");
	
		
		
		
			
		
		
		
		
		
		
		$vdata["NeedEncode"] = true;
	
	$fdata["ViewFormats"]["view"] = $vdata;
//  End View Formats

//	Begin Edit Formats 	
	$fdata["EditFormats"] = array();
	
	$edata = array("EditFormat" => "Text field");
	
		
		
	
//	Begin Lookup settings
	//	End Lookup Settings

		
		
		
		
			$edata["acceptFileTypes"] = ".+$";
	
		$edata["maxNumberOfFiles"] = 1;
	
		
		
		
		
		$edata["EditParams"] = "";
			
		
//	Begin validation
	$edata["validateAs"] = array();
				$edata["validateAs"]["basicValidate"][] = getJsValidatorName("Number");	
						
			//	End validation
	
		
				
		$fdata["EditFormats"]["edit"] = $edata;
//	End Edit Formats
	
		$fdata["isSeparate"] = false;
	
		
		
	$tdataajuste["cant_antes"] = $fdata;
//	cant_ajustada
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 6;
	$fdata["strName"] = "cant_ajustada";
	$fdata["GoodName"] = "cant_ajustada";
	$fdata["ownerTable"] = "ajuste";
	$fdata["Label"] = "Cant Ajustada"; 
	$fdata["FieldType"] = 3;
	
		
		
		$fdata["bListPage"] = true; 
	
		
		
		
		
		
		$fdata["bAdvancedSearch"] = true; 
	
		$fdata["bPrinterPage"] = true; 
	
		$fdata["bExportPage"] = true; 
	
		$fdata["strField"] = "cant_ajustada"; 
		$fdata["FullName"] = "cant_ajustada";
	
		
		
				$fdata["FieldPermissions"] = true;
	
				$fdata["UploadFolder"] = "files";
		
//  Begin View Formats
	$fdata["ViewFormats"] = array();
	
	$vdata = array("ViewFormat" => "");
	
		
		
		
			
		
		
		
		
		
		
		$vdata["NeedEncode"] = true;
	
	$fdata["ViewFormats"]["view"] = $vdata;
//  End View Formats

//	Begin Edit Formats 	
	$fdata["EditFormats"] = array();
	
	$edata = array("EditFormat" => "Text field");
	
		
		
	
//	Begin Lookup settings
	//	End Lookup Settings

		
		
		
		
			$edata["acceptFileTypes"] = ".+$";
	
		$edata["maxNumberOfFiles"] = 1;
	
		
		
		
		
		$edata["EditParams"] = "";
			
		
//	Begin validation
	$edata["validateAs"] = array();
				$edata["validateAs"]["basicValidate"][] = getJsValidatorName("Number");	
						
			//	End validation
	
		
				
		$fdata["EditFormats"]["edit"] = $edata;
//	End Edit Formats
	
		$fdata["isSeparate"] = false;
	
		
		
	$tdataajuste["cant_ajustada"] = $fdata;
//	cant_despues
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 7;
	$fdata["strName"] = "cant_despues";
	$fdata["GoodName"] = "cant_despues";
	$fdata["ownerTable"] = "ajuste";
	$fdata["Label"] = "Cant Después"; 
	$fdata["FieldType"] = 3;
	
		
		
		$fdata["bListPage"] = true; 
	
		$fdata["bAddPage"] = true; 
	
		
		
		
		
		$fdata["bAdvancedSearch"] = true; 
	
		$fdata["bPrinterPage"] = true; 
	
		$fdata["bExportPage"] = true; 
	
		$fdata["strField"] = "cant_despues"; 
		$fdata["FullName"] = "cant_despues";
	
		
		
				$fdata["FieldPermissions"] = true;
	
				$fdata["UploadFolder"] = "files";
		
//  Begin View Formats
	$fdata["ViewFormats"] = array();
	
	$vdata = array("ViewFormat" => "");
	
		
		
		
			
		
		
		
		
		
		
		$vdata["NeedEncode"] = true;
	
	$fdata["ViewFormats"]["view"] = $vdata;
//  End View Formats

//	Begin Edit Formats 	
	$fdata["EditFormats"] = array();
	
	$edata = array("EditFormat" => "Text field");
	
		
		
	
//	Begin Lookup settings
	//	End Lookup Settings

		$edata["IsRequired"] = true; 
	
		
		
		
			$edata["acceptFileTypes"] = ".+$";
	
		$edata["maxNumberOfFiles"] = 1;
	
		
		
		
		
		$edata["EditParams"] = "";
			
		$edata["inputStyle"] = " width:80px;";
	$edata["controlWidth"] = 80;
	
//	Begin validation
	$edata["validateAs"] = array();
				$edata["validateAs"]["basicValidate"][] = getJsValidatorName("Number");	
						$edata["validateAs"]["basicValidate"][] = "IsRequired";
	
			//	End validation
	
		
				
		$fdata["EditFormats"]["edit"] = $edata;
//	End Edit Formats
	
		$fdata["isSeparate"] = false;
	
		
		
	$tdataajuste["cant_despues"] = $fdata;

	
$tables_data["ajuste"]=&$tdataajuste;
$field_labels["ajuste"] = &$fieldLabelsajuste;
$fieldToolTips["ajuste"] = &$fieldToolTipsajuste;

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

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

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










function createSqlQuery_ajuste()
{
$proto0=array();
$proto0["m_strHead"] = "SELECT";
$proto0["m_strFieldList"] = "idajuste,  fecha,  idmotivo_ajuste,  idarticulo,  cant_antes,  cant_ajustada,  cant_despues";
$proto0["m_strFrom"] = "FROM ajuste";
$proto0["m_strWhere"] = "";
$proto0["m_strOrderBy"] = "ORDER BY idajuste DESC";
$proto0["m_strTail"] = "";
$proto0["cipherer"] = null;
$proto1=array();
$proto1["m_sql"] = "";
$proto1["m_uniontype"] = "SQLL_UNKNOWN";
	$obj = new SQLNonParsed(array(
	"m_sql" => ""
));

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

$proto0["m_where"] = $obj;
$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"] = "0";
$proto3["m_inBrackets"] = "0";
$proto3["m_useAlias"] = "0";
$obj = new SQLLogicalExpr($proto3);

$proto0["m_having"] = $obj;
$proto0["m_fieldlist"] = array();
						$proto5=array();
			$obj = new SQLField(array(
	"m_strName" => "idajuste",
	"m_strTable" => "ajuste"
));

$proto5["m_expr"]=$obj;
$proto5["m_alias"] = "";
$obj = new SQLFieldListItem($proto5);

$proto0["m_fieldlist"][]=$obj;
						$proto7=array();
			$obj = new SQLField(array(
	"m_strName" => "fecha",
	"m_strTable" => "ajuste"
));

$proto7["m_expr"]=$obj;
$proto7["m_alias"] = "";
$obj = new SQLFieldListItem($proto7);

$proto0["m_fieldlist"][]=$obj;
						$proto9=array();
			$obj = new SQLField(array(
	"m_strName" => "idmotivo_ajuste",
	"m_strTable" => "ajuste"
));

$proto9["m_expr"]=$obj;
$proto9["m_alias"] = "";
$obj = new SQLFieldListItem($proto9);

$proto0["m_fieldlist"][]=$obj;
						$proto11=array();
			$obj = new SQLField(array(
	"m_strName" => "idarticulo",
	"m_strTable" => "ajuste"
));

$proto11["m_expr"]=$obj;
$proto11["m_alias"] = "";
$obj = new SQLFieldListItem($proto11);

$proto0["m_fieldlist"][]=$obj;
						$proto13=array();
			$obj = new SQLField(array(
	"m_strName" => "cant_antes",
	"m_strTable" => "ajuste"
));

$proto13["m_expr"]=$obj;
$proto13["m_alias"] = "";
$obj = new SQLFieldListItem($proto13);

$proto0["m_fieldlist"][]=$obj;
						$proto15=array();
			$obj = new SQLField(array(
	"m_strName" => "cant_ajustada",
	"m_strTable" => "ajuste"
));

$proto15["m_expr"]=$obj;
$proto15["m_alias"] = "";
$obj = new SQLFieldListItem($proto15);

$proto0["m_fieldlist"][]=$obj;
						$proto17=array();
			$obj = new SQLField(array(
	"m_strName" => "cant_despues",
	"m_strTable" => "ajuste"
));

$proto17["m_expr"]=$obj;
$proto17["m_alias"] = "";
$obj = new SQLFieldListItem($proto17);

$proto0["m_fieldlist"][]=$obj;
$proto0["m_fromlist"] = array();
												$proto19=array();
$proto19["m_link"] = "SQLL_MAIN";
			$proto20=array();
$proto20["m_strName"] = "ajuste";
$proto20["m_columns"] = array();
$proto20["m_columns"][] = "idajuste";
$proto20["m_columns"][] = "fecha";
$proto20["m_columns"][] = "idmotivo_ajuste";
$proto20["m_columns"][] = "idarticulo";
$proto20["m_columns"][] = "cant_antes";
$proto20["m_columns"][] = "cant_ajustada";
$proto20["m_columns"][] = "cant_despues";
$obj = new SQLTable($proto20);

$proto19["m_table"] = $obj;
$proto19["m_alias"] = "";
$proto21=array();
$proto21["m_sql"] = "";
$proto21["m_uniontype"] = "SQLL_UNKNOWN";
	$obj = new SQLNonParsed(array(
	"m_sql" => ""
));

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

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

$proto0["m_fromlist"][]=$obj;
$proto0["m_groupby"] = array();
$proto0["m_orderby"] = array();
												$proto23=array();
						$obj = new SQLField(array(
	"m_strName" => "idajuste",
	"m_strTable" => "ajuste"
));

$proto23["m_column"]=$obj;
$proto23["m_bAsc"] = 0;
$proto23["m_nColumn"] = 0;
$obj = new SQLOrderByItem($proto23);

$proto0["m_orderby"][]=$obj;					
$obj = new SQLQuery($proto0);

	return $obj;
}
$queryData_ajuste = createSqlQuery_ajuste();
							$tdataajuste[".sqlquery"] = $queryData_ajuste;
	
if(isset($tdataajuste["field2"])){
	$tdataajuste["field2"]["LookupTable"] = "carscars_view";
	$tdataajuste["field2"]["LookupOrderBy"] = "name";
	$tdataajuste["field2"]["LookupType"] = 4;
	$tdataajuste["field2"]["LinkField"] = "email";
	$tdataajuste["field2"]["DisplayField"] = "name";
	$tdataajuste[".hasCustomViewField"] = true;
}

include_once(getabspath("include/ajuste_events.php"));
$tableEvents["ajuste"] = new eventclass_ajuste;
$tdataajuste[".hasEvents"] = true;

$cipherer = new RunnerCipherer("ajuste");

?>