<?php
$tdatachecking_system = array();
$tdatachecking_system[".searchableFields"] = array();
$tdatachecking_system[".ShortName"] = "checking_system";
$tdatachecking_system[".OwnerID"] = "ud";
$tdatachecking_system[".OriginalTable"] = "expenditure_statement";


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

//	field labels
$fieldLabelschecking_system = array();
$fieldToolTipschecking_system = array();
$pageTitleschecking_system = array();
$placeHolderschecking_system = array();

if(mlang_getcurrentlang()=="English")
{
	$fieldLabelschecking_system["English"] = array();
	$fieldToolTipschecking_system["English"] = array();
	$placeHolderschecking_system["English"] = array();
	$pageTitleschecking_system["English"] = array();
	$fieldLabelschecking_system["English"]["expenditure_up_to"] = "Expenditure Up To";
	$fieldToolTipschecking_system["English"]["expenditure_up_to"] = "";
	$placeHolderschecking_system["English"]["expenditure_up_to"] = "";
	$fieldLabelschecking_system["English"]["ud"] = "Ud";
	$fieldToolTipschecking_system["English"]["ud"] = "";
	$placeHolderschecking_system["English"]["ud"] = "";
	$fieldLabelschecking_system["English"]["status"] = "Status";
	$fieldToolTipschecking_system["English"]["status"] = "";
	$placeHolderschecking_system["English"]["status"] = "";
	$fieldLabelschecking_system["English"]["accounting_code"] = "Accounting Code";
	$fieldToolTipschecking_system["English"]["accounting_code"] = "";
	$placeHolderschecking_system["English"]["accounting_code"] = "";
	$fieldLabelschecking_system["English"]["Allocation_according_to_CIGAS"] = "Allocation according to CIGAS";
	$fieldToolTipschecking_system["English"]["Allocation_according_to_CIGAS"] = "";
	$placeHolderschecking_system["English"]["Allocation_according_to_CIGAS"] = "";
	$fieldLabelschecking_system["English"]["Allocation_according_to_head_office"] = "Allocation according to head office";
	$fieldToolTipschecking_system["English"]["Allocation_according_to_head_office"] = "";
	$placeHolderschecking_system["English"]["Allocation_according_to_head_office"] = "";
	$fieldLabelschecking_system["English"]["Result"] = "Result";
	$fieldToolTipschecking_system["English"]["Result"] = "";
	$placeHolderschecking_system["English"]["Result"] = "";
	$fieldLabelschecking_system["English"]["Month"] = "Month";
	$fieldToolTipschecking_system["English"]["Month"] = "";
	$placeHolderschecking_system["English"]["Month"] = "";
	if (count($fieldToolTipschecking_system["English"]))
		$tdatachecking_system[".isUseToolTips"] = true;
}
if(mlang_getcurrentlang()=="sinhala")
{
	$fieldLabelschecking_system["sinhala"] = array();
	$fieldToolTipschecking_system["sinhala"] = array();
	$placeHolderschecking_system["sinhala"] = array();
	$pageTitleschecking_system["sinhala"] = array();
	$fieldLabelschecking_system["sinhala"]["expenditure_up_to"] = "Expenditure Up To";
	$fieldToolTipschecking_system["sinhala"]["expenditure_up_to"] = "";
	$placeHolderschecking_system["sinhala"]["expenditure_up_to"] = "";
	$fieldLabelschecking_system["sinhala"]["ud"] = "Ud";
	$fieldToolTipschecking_system["sinhala"]["ud"] = "";
	$placeHolderschecking_system["sinhala"]["ud"] = "";
	$fieldLabelschecking_system["sinhala"]["status"] = "Status";
	$fieldToolTipschecking_system["sinhala"]["status"] = "";
	$placeHolderschecking_system["sinhala"]["status"] = "";
	$fieldLabelschecking_system["sinhala"]["accounting_code"] = "Accounting Code";
	$fieldToolTipschecking_system["sinhala"]["accounting_code"] = "";
	$placeHolderschecking_system["sinhala"]["accounting_code"] = "";
	$fieldLabelschecking_system["sinhala"]["Allocation_according_to_CIGAS"] = "Allocation according to CIGAS";
	$fieldToolTipschecking_system["sinhala"]["Allocation_according_to_CIGAS"] = "";
	$placeHolderschecking_system["sinhala"]["Allocation_according_to_CIGAS"] = "";
	$fieldLabelschecking_system["sinhala"]["Allocation_according_to_head_office"] = "Allocation according to head office";
	$fieldToolTipschecking_system["sinhala"]["Allocation_according_to_head_office"] = "";
	$placeHolderschecking_system["sinhala"]["Allocation_according_to_head_office"] = "";
	$fieldLabelschecking_system["sinhala"]["Result"] = "Result";
	$fieldToolTipschecking_system["sinhala"]["Result"] = "";
	$placeHolderschecking_system["sinhala"]["Result"] = "";
	$fieldLabelschecking_system["sinhala"]["Month"] = "Month";
	$fieldToolTipschecking_system["sinhala"]["Month"] = "";
	$placeHolderschecking_system["sinhala"]["Month"] = "";
	if (count($fieldToolTipschecking_system["sinhala"]))
		$tdatachecking_system[".isUseToolTips"] = true;
}


	$tdatachecking_system[".NCSearch"] = true;



$tdatachecking_system[".shortTableName"] = "checking_system";
$tdatachecking_system[".nSecOptions"] = 1;

$tdatachecking_system[".mainTableOwnerID"] = "ud";
$tdatachecking_system[".entityType"] = 1;
$tdatachecking_system[".connId"] = "allo_at_localhost";


$tdatachecking_system[".strOriginalTableName"] = "expenditure_statement";

	



$tdatachecking_system[".showAddInPopup"] = false;

$tdatachecking_system[".showEditInPopup"] = false;

$tdatachecking_system[".showViewInPopup"] = false;

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


	$tdatachecking_system[".listAjax"] = true;
//	temporary
$tdatachecking_system[".listAjax"] = false;

	$tdatachecking_system[".audit"] = false;

	$tdatachecking_system[".locking"] = false;


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

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

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

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



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




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

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

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

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



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

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

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

$tdatachecking_system[".isUseAjaxSuggest"] = true;

$tdatachecking_system[".rowHighlite"] = true;



																								

$tdatachecking_system[".ajaxCodeSnippetAdded"] = false;

$tdatachecking_system[".buttonsAdded"] = false;

$tdatachecking_system[".addPageEvents"] = false;

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


$tdatachecking_system[".badgeColor"] = "CD853F";


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

$tdatachecking_system[".googleLikeFields"] = array();
$tdatachecking_system[".googleLikeFields"][] = "Month";
$tdatachecking_system[".googleLikeFields"][] = "accounting_code";
$tdatachecking_system[".googleLikeFields"][] = "Allocation according to CIGAS";
$tdatachecking_system[".googleLikeFields"][] = "expenditure_up_to";
$tdatachecking_system[".googleLikeFields"][] = "status";
$tdatachecking_system[".googleLikeFields"][] = "Allocation according to head office";
$tdatachecking_system[".googleLikeFields"][] = "Result";



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

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

$tdatachecking_system[".nPrinterSplitRecords"] = 40;

$tdatachecking_system[".geocodingEnabled"] = false;










$tdatachecking_system[".pageSize"] = 20;

$tdatachecking_system[".warnLeavingPages"] = true;



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

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


$tdatachecking_system[".sqlHead"] = "SELECT expenditure_statement.month as \"Month\",  expenditure_statement.accounting_code as \"accounting_code\",  expenditure_statement.allocation as \"Allocation according to CIGAS\",  expenditure_statement.expenditure_up_to,  expenditure_statement.ud, expenditure_statement.status,  ifnull(pur.st1,0) as \"Allocation according to head office\",  CASE      WHEN  ifnull(pur.st1,0) > expenditure_statement.allocation  THEN \"ප්‍රතිපාදන අඩුවෙන් ඇතුලත් කර ඇත\"       WHEN  ifnull(pur.st1,0) < expenditure_statement.allocation THEN \"ප්‍රතිපාදන වැඩිපුර ඇතුලත් කර ඇත\"      WHEN  ifnull(pur.st1,0) = expenditure_statement.allocation THEN \"OK\"       END as \"Result\"";
$tdatachecking_system[".sqlFrom"] = "FROM `expenditure_statement`  LEFT JOIN (select accounting_code, sum(amount) as st1 from allocation_detail where c_acc=2 group by accounting_code ) as pur on expenditure_statement.`accounting_code` = pur.accounting_code";
$tdatachecking_system[".sqlWhereExpr"] = "expenditure_statement.status=\"Checking\"";
$tdatachecking_system[".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;
$tdatachecking_system[".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;
$tdatachecking_system[".arrGroupsPerPage"] = $arrGPP;

$tdatachecking_system[".highlightSearchResults"] = true;

$tableKeyschecking_system = array();
$tdatachecking_system[".Keys"] = $tableKeyschecking_system;


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




//	Month
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 1;
	$fdata["strName"] = "Month";
	$fdata["GoodName"] = "Month";
	$fdata["ownerTable"] = "expenditure_statement";
	$fdata["Label"] = GetFieldLabel("checking_system","Month");
	$fdata["FieldType"] = 14;

	
	
	
			

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

	
		$fdata["isSQLExpression"] = true;
	$fdata["FullName"] = "expenditure_statement.month";

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


	$tdatachecking_system["Month"] = $fdata;
		$tdatachecking_system[".searchableFields"][] = "Month";
//	accounting_code
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 2;
	$fdata["strName"] = "accounting_code";
	$fdata["GoodName"] = "accounting_code";
	$fdata["ownerTable"] = "expenditure_statement";
	$fdata["Label"] = GetFieldLabel("checking_system","accounting_code");
	$fdata["FieldType"] = 200;

	
	
	
			

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

	
		$fdata["isSQLExpression"] = true;
	$fdata["FullName"] = "expenditure_statement.accounting_code";

	
	
				$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["EditParams"].= " maxlength=250";

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


	$tdatachecking_system["accounting_code"] = $fdata;
		$tdatachecking_system[".searchableFields"][] = "accounting_code";
//	Allocation according to CIGAS
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 3;
	$fdata["strName"] = "Allocation according to CIGAS";
	$fdata["GoodName"] = "Allocation_according_to_CIGAS";
	$fdata["ownerTable"] = "expenditure_statement";
	$fdata["Label"] = GetFieldLabel("checking_system","Allocation_according_to_CIGAS");
	$fdata["FieldType"] = 14;

	
	
	
			

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

	
		$fdata["isSQLExpression"] = true;
	$fdata["FullName"] = "expenditure_statement.allocation";

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


	$tdatachecking_system["Allocation according to CIGAS"] = $fdata;
		$tdatachecking_system[".searchableFields"][] = "Allocation according to CIGAS";
//	expenditure_up_to
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 4;
	$fdata["strName"] = "expenditure_up_to";
	$fdata["GoodName"] = "expenditure_up_to";
	$fdata["ownerTable"] = "expenditure_statement";
	$fdata["Label"] = GetFieldLabel("checking_system","expenditure_up_to");
	$fdata["FieldType"] = 14;

	
	
	
			

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

	
		$fdata["isSQLExpression"] = true;
	$fdata["FullName"] = "expenditure_statement.expenditure_up_to";

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


	$tdatachecking_system["expenditure_up_to"] = $fdata;
		$tdatachecking_system[".searchableFields"][] = "expenditure_up_to";
//	ud
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 5;
	$fdata["strName"] = "ud";
	$fdata["GoodName"] = "ud";
	$fdata["ownerTable"] = "expenditure_statement";
	$fdata["Label"] = GetFieldLabel("checking_system","ud");
	$fdata["FieldType"] = 200;

	
	
	
			

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

	
		$fdata["isSQLExpression"] = true;
	$fdata["FullName"] = "expenditure_statement.ud";

	
	
				$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["EditParams"].= " maxlength=11";

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


	$tdatachecking_system["ud"] = $fdata;
		$tdatachecking_system[".searchableFields"][] = "ud";
//	status
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 6;
	$fdata["strName"] = "status";
	$fdata["GoodName"] = "status";
	$fdata["ownerTable"] = "expenditure_statement";
	$fdata["Label"] = GetFieldLabel("checking_system","status");
	$fdata["FieldType"] = 200;

	
	
	
			

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

	
		$fdata["isSQLExpression"] = true;
	$fdata["FullName"] = "expenditure_statement.status";

	
	
				$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["EditParams"].= " maxlength=100";

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


	$tdatachecking_system["status"] = $fdata;
		$tdatachecking_system[".searchableFields"][] = "status";
//	Allocation according to head office
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 7;
	$fdata["strName"] = "Allocation according to head office";
	$fdata["GoodName"] = "Allocation_according_to_head_office";
	$fdata["ownerTable"] = "";
	$fdata["Label"] = GetFieldLabel("checking_system","Allocation_according_to_head_office");
	$fdata["FieldType"] = 14;

	
	
	
			

		$fdata["strField"] = "Allocation according to head office";

	
		$fdata["isSQLExpression"] = true;
	$fdata["FullName"] = "ifnull(pur.st1,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"] = "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"]["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


	$tdatachecking_system["Allocation according to head office"] = $fdata;
		$tdatachecking_system[".searchableFields"][] = "Allocation according to head office";
//	Result
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 8;
	$fdata["strName"] = "Result";
	$fdata["GoodName"] = "Result";
	$fdata["ownerTable"] = "";
	$fdata["Label"] = GetFieldLabel("checking_system","Result");
	$fdata["FieldType"] = 200;

	
	
	
			

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

	
		$fdata["isSQLExpression"] = true;
	$fdata["FullName"] = "CASE      WHEN  ifnull(pur.st1,0) > expenditure_statement.allocation  THEN \"ප්‍රතිපාදන අඩුවෙන් ඇතුලත් කර ඇත\"       WHEN  ifnull(pur.st1,0) < expenditure_statement.allocation THEN \"ප්‍රතිපාදන වැඩිපුර ඇතුලත් කර ඇත\"      WHEN  ifnull(pur.st1,0) = expenditure_statement.allocation THEN \"OK\"       END";

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


	$tdatachecking_system["Result"] = $fdata;
		$tdatachecking_system[".searchableFields"][] = "Result";


$tables_data["checking system"]=&$tdatachecking_system;
$field_labels["checking_system"] = &$fieldLabelschecking_system;
$fieldToolTips["checking_system"] = &$fieldToolTipschecking_system;
$placeHolders["checking_system"] = &$placeHolderschecking_system;
$page_titles["checking_system"] = &$pageTitleschecking_system;

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

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



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



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











function createSqlQuery_checking_system()
{
$proto0=array();
$proto0["m_strHead"] = "SELECT";
$proto0["m_strFieldList"] = "expenditure_statement.month as \"Month\",  expenditure_statement.accounting_code as \"accounting_code\",  expenditure_statement.allocation as \"Allocation according to CIGAS\",  expenditure_statement.expenditure_up_to,  expenditure_statement.ud, expenditure_statement.status,  ifnull(pur.st1,0) as \"Allocation according to head office\",  CASE      WHEN  ifnull(pur.st1,0) > expenditure_statement.allocation  THEN \"ප්‍රතිපාදන අඩුවෙන් ඇතුලත් කර ඇත\"       WHEN  ifnull(pur.st1,0) < expenditure_statement.allocation THEN \"ප්‍රතිපාදන වැඩිපුර ඇතුලත් කර ඇත\"      WHEN  ifnull(pur.st1,0) = expenditure_statement.allocation THEN \"OK\"       END as \"Result\"";
$proto0["m_strFrom"] = "FROM `expenditure_statement`  LEFT JOIN (select accounting_code, sum(amount) as st1 from allocation_detail where c_acc=2 group by accounting_code ) as pur on expenditure_statement.`accounting_code` = pur.accounting_code";
$proto0["m_strWhere"] = "expenditure_statement.status=\"Checking\"";
$proto0["m_strOrderBy"] = "";
	
		;
			$proto0["cipherer"] = null;
$proto2=array();
$proto2["m_sql"] = "expenditure_statement.status=\"Checking\"";
$proto2["m_uniontype"] = "SQLL_UNKNOWN";
						$obj = new SQLField(array(
	"m_strName" => "status",
	"m_strTable" => "expenditure_statement",
	"m_srcTableName" => "checking system"
));

$proto2["m_column"]=$obj;
$proto2["m_contained"] = array();
$proto2["m_strCase"] = "=\"Checking\"";
$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" => "month",
	"m_strTable" => "expenditure_statement",
	"m_srcTableName" => "checking system"
));

$proto6["m_sql"] = "expenditure_statement.month";
$proto6["m_srcTableName"] = "checking system";
$proto6["m_expr"]=$obj;
$proto6["m_alias"] = "Month";
$obj = new SQLFieldListItem($proto6);

$proto0["m_fieldlist"][]=$obj;
						$proto8=array();
			$obj = new SQLField(array(
	"m_strName" => "accounting_code",
	"m_strTable" => "expenditure_statement",
	"m_srcTableName" => "checking system"
));

$proto8["m_sql"] = "expenditure_statement.accounting_code";
$proto8["m_srcTableName"] = "checking system";
$proto8["m_expr"]=$obj;
$proto8["m_alias"] = "accounting_code";
$obj = new SQLFieldListItem($proto8);

$proto0["m_fieldlist"][]=$obj;
						$proto10=array();
			$obj = new SQLField(array(
	"m_strName" => "allocation",
	"m_strTable" => "expenditure_statement",
	"m_srcTableName" => "checking system"
));

$proto10["m_sql"] = "expenditure_statement.allocation";
$proto10["m_srcTableName"] = "checking system";
$proto10["m_expr"]=$obj;
$proto10["m_alias"] = "Allocation according to CIGAS";
$obj = new SQLFieldListItem($proto10);

$proto0["m_fieldlist"][]=$obj;
						$proto12=array();
			$obj = new SQLField(array(
	"m_strName" => "expenditure_up_to",
	"m_strTable" => "expenditure_statement",
	"m_srcTableName" => "checking system"
));

$proto12["m_sql"] = "expenditure_statement.expenditure_up_to";
$proto12["m_srcTableName"] = "checking system";
$proto12["m_expr"]=$obj;
$proto12["m_alias"] = "";
$obj = new SQLFieldListItem($proto12);

$proto0["m_fieldlist"][]=$obj;
						$proto14=array();
			$obj = new SQLField(array(
	"m_strName" => "ud",
	"m_strTable" => "expenditure_statement",
	"m_srcTableName" => "checking system"
));

$proto14["m_sql"] = "expenditure_statement.ud";
$proto14["m_srcTableName"] = "checking system";
$proto14["m_expr"]=$obj;
$proto14["m_alias"] = "";
$obj = new SQLFieldListItem($proto14);

$proto0["m_fieldlist"][]=$obj;
						$proto16=array();
			$obj = new SQLField(array(
	"m_strName" => "status",
	"m_strTable" => "expenditure_statement",
	"m_srcTableName" => "checking system"
));

$proto16["m_sql"] = "expenditure_statement.status";
$proto16["m_srcTableName"] = "checking system";
$proto16["m_expr"]=$obj;
$proto16["m_alias"] = "";
$obj = new SQLFieldListItem($proto16);

$proto0["m_fieldlist"][]=$obj;
						$proto18=array();
			$proto19=array();
$proto19["m_functiontype"] = "SQLF_CUSTOM";
$proto19["m_arguments"] = array();
						$obj = new SQLNonParsed(array(
	"m_sql" => "pur.st1"
));

$proto19["m_arguments"][]=$obj;
						$obj = new SQLNonParsed(array(
	"m_sql" => "0"
));

$proto19["m_arguments"][]=$obj;
$proto19["m_strFunctionName"] = "ifnull";
$obj = new SQLFunctionCall($proto19);

$proto18["m_sql"] = "ifnull(pur.st1,0)";
$proto18["m_srcTableName"] = "checking system";
$proto18["m_expr"]=$obj;
$proto18["m_alias"] = "Allocation according to head office";
$obj = new SQLFieldListItem($proto18);

$proto0["m_fieldlist"][]=$obj;
						$proto22=array();
			$obj = new SQLNonParsed(array(
	"m_sql" => "CASE      WHEN  ifnull(pur.st1,0) > expenditure_statement.allocation  THEN \"ප්‍රතිපාදන අඩුවෙන් ඇතුලත් කර ඇත\"       WHEN  ifnull(pur.st1,0) < expenditure_statement.allocation THEN \"ප්‍රතිපාදන වැඩිපුර ඇතුලත් කර ඇත\"      WHEN  ifnull(pur.st1,0) = expenditure_statement.allocation THEN \"OK\"       END"
));

$proto22["m_sql"] = "CASE      WHEN  ifnull(pur.st1,0) > expenditure_statement.allocation  THEN \"ප්‍රතිපාදන අඩුවෙන් ඇතුලත් කර ඇත\"       WHEN  ifnull(pur.st1,0) < expenditure_statement.allocation THEN \"ප්‍රතිපාදන වැඩිපුර ඇතුලත් කර ඇත\"      WHEN  ifnull(pur.st1,0) = expenditure_statement.allocation THEN \"OK\"       END";
$proto22["m_srcTableName"] = "checking system";
$proto22["m_expr"]=$obj;
$proto22["m_alias"] = "Result";
$obj = new SQLFieldListItem($proto22);

$proto0["m_fieldlist"][]=$obj;
$proto0["m_fromlist"] = array();
												$proto24=array();
$proto24["m_link"] = "SQLL_MAIN";
			$proto25=array();
$proto25["m_strName"] = "expenditure_statement";
$proto25["m_srcTableName"] = "checking system";
$proto25["m_columns"] = array();
$proto25["m_columns"][] = "id";
$proto25["m_columns"][] = "code";
$proto25["m_columns"][] = "allocation";
$proto25["m_columns"][] = "expenditure_up_to";
$proto25["m_columns"][] = "expenditure_for_month";
$proto25["m_columns"][] = "surcharge_for_month";
$proto25["m_columns"][] = "net_expenditure";
$proto25["m_columns"][] = "balance";
$proto25["m_columns"][] = "ud";
$proto25["m_columns"][] = "user";
$proto25["m_columns"][] = "month";
$proto25["m_columns"][] = "status";
$proto25["m_columns"][] = "accounting_code";
$obj = new SQLTable($proto25);

$proto24["m_table"] = $obj;
$proto24["m_sql"] = "`expenditure_statement`";
$proto24["m_alias"] = "";
$proto24["m_srcTableName"] = "checking system";
$proto26=array();
$proto26["m_sql"] = "";
$proto26["m_uniontype"] = "SQLL_UNKNOWN";
	$obj = new SQLNonParsed(array(
	"m_sql" => ""
));

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

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

$proto0["m_fromlist"][]=$obj;
												$proto28=array();
$proto28["m_link"] = "SQLL_LEFTJOIN";
			$proto29=array();
$proto29["m_strHead"] = "select";
$proto29["m_strFieldList"] = "accounting_code, sum(amount) as st1";
$proto29["m_strFrom"] = "from allocation_detail";
$proto29["m_strWhere"] = "c_acc=2";
$proto29["m_strOrderBy"] = "";
	
		;
			$proto29["cipherer"] = null;
$proto31=array();
$proto31["m_sql"] = "c_acc=2";
$proto31["m_uniontype"] = "SQLL_UNKNOWN";
						$obj = new SQLField(array(
	"m_strName" => "c_acc",
	"m_strTable" => "allocation_detail",
	"m_srcTableName" => "checking system"
));

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

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

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

$proto29["m_having"] = $obj;
$proto29["m_fieldlist"] = array();
						$proto35=array();
			$obj = new SQLField(array(
	"m_strName" => "accounting_code",
	"m_strTable" => "allocation_detail",
	"m_srcTableName" => "checking system"
));

$proto35["m_sql"] = "accounting_code";
$proto35["m_srcTableName"] = "checking system";
$proto35["m_expr"]=$obj;
$proto35["m_alias"] = "";
$obj = new SQLFieldListItem($proto35);

$proto29["m_fieldlist"][]=$obj;
						$proto37=array();
			$proto38=array();
$proto38["m_functiontype"] = "SQLF_SUM";
$proto38["m_arguments"] = array();
						$obj = new SQLField(array(
	"m_strName" => "amount",
	"m_strTable" => "allocation_detail",
	"m_srcTableName" => "checking system"
));

$proto38["m_arguments"][]=$obj;
$proto38["m_strFunctionName"] = "sum";
$obj = new SQLFunctionCall($proto38);

$proto37["m_sql"] = "sum(amount)";
$proto37["m_srcTableName"] = "checking system";
$proto37["m_expr"]=$obj;
$proto37["m_alias"] = "st1";
$obj = new SQLFieldListItem($proto37);

$proto29["m_fieldlist"][]=$obj;
$proto29["m_fromlist"] = array();
												$proto40=array();
$proto40["m_link"] = "SQLL_MAIN";
			$proto41=array();
$proto41["m_strName"] = "allocation_detail";
$proto41["m_srcTableName"] = "checking system";
$proto41["m_columns"] = array();
$proto41["m_columns"][] = "id";
$proto41["m_columns"][] = "sub_office_code";
$proto41["m_columns"][] = "sub_office";
$proto41["m_columns"][] = "expenditure_code";
$proto41["m_columns"][] = "department";
$proto41["m_columns"][] = "amount";
$proto41["m_columns"][] = "date";
$proto41["m_columns"][] = "user";
$proto41["m_columns"][] = "on_time";
$proto41["m_columns"][] = "fk";
$proto41["m_columns"][] = "action";
$proto41["m_columns"][] = "ud";
$proto41["m_columns"][] = "md";
$proto41["m_columns"][] = "comment";
$proto41["m_columns"][] = "description";
$proto41["m_columns"][] = "c_acc";
$proto41["m_columns"][] = "delete";
$proto41["m_columns"][] = "accounting_code";
$obj = new SQLTable($proto41);

$proto40["m_table"] = $obj;
$proto40["m_sql"] = "allocation_detail";
$proto40["m_alias"] = "";
$proto40["m_srcTableName"] = "checking system";
$proto42=array();
$proto42["m_sql"] = "";
$proto42["m_uniontype"] = "SQLL_UNKNOWN";
	$obj = new SQLNonParsed(array(
	"m_sql" => ""
));

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

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

$proto29["m_fromlist"][]=$obj;
$proto29["m_groupby"] = array();
												$proto44=array();
						$obj = new SQLField(array(
	"m_strName" => "accounting_code",
	"m_strTable" => "allocation_detail",
	"m_srcTableName" => "checking system"
));

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

$proto29["m_groupby"][]=$obj;
$proto29["m_orderby"] = array();
$proto29["m_srcTableName"]="checking system";		
$obj = new SQLQuery($proto29);

$proto28["m_table"] = $obj;
$proto28["m_sql"] = "LEFT JOIN (select accounting_code, sum(amount) as st1 from allocation_detail where c_acc=2 group by accounting_code ) as pur on expenditure_statement.`accounting_code` = pur.accounting_code";
$proto28["m_alias"] = "pur";
$proto28["m_srcTableName"] = "checking system";
$proto46=array();
$proto46["m_sql"] = "expenditure_statement.`accounting_code` = pur.accounting_code";
$proto46["m_uniontype"] = "SQLL_UNKNOWN";
						$obj = new SQLField(array(
	"m_strName" => "accounting_code",
	"m_strTable" => "expenditure_statement",
	"m_srcTableName" => "checking system"
));

$proto46["m_column"]=$obj;
$proto46["m_contained"] = array();
$proto46["m_strCase"] = "= pur.accounting_code";
$proto46["m_havingmode"] = false;
$proto46["m_inBrackets"] = false;
$proto46["m_useAlias"] = false;
$obj = new SQLLogicalExpr($proto46);

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

$proto0["m_fromlist"][]=$obj;
$proto0["m_groupby"] = array();
$proto0["m_orderby"] = array();
$proto0["m_srcTableName"]="checking system";		
$obj = new SQLQuery($proto0);

	return $obj;
}
$queryData_checking_system = createSqlQuery_checking_system();


	
		;

								

$tdatachecking_system[".sqlquery"] = $queryData_checking_system;



$tableEvents["checking system"] = new eventsBase;
$tdatachecking_system[".hasEvents"] = false;

?>