<?php
$tdataacc_6_chart = array();
$tdataacc_6_chart[".searchableFields"] = array();
$tdataacc_6_chart[".ShortName"] = "acc_6_chart";
$tdataacc_6_chart[".OwnerID"] = "";
$tdataacc_6_chart[".OriginalTable"] = "bank_activity";


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

//	field labels
$fieldLabelsacc_6_chart = array();
$fieldToolTipsacc_6_chart = array();
$pageTitlesacc_6_chart = array();
$placeHoldersacc_6_chart = array();

if(mlang_getcurrentlang()=="English")
{
	$fieldLabelsacc_6_chart["English"] = array();
	$fieldToolTipsacc_6_chart["English"] = array();
	$placeHoldersacc_6_chart["English"] = array();
	$pageTitlesacc_6_chart["English"] = array();
	$fieldLabelsacc_6_chart["English"]["date"] = "Range";
	$fieldToolTipsacc_6_chart["English"]["date"] = "";
	$placeHoldersacc_6_chart["English"]["date"] = "";
	$fieldLabelsacc_6_chart["English"]["DEPOSIT"] = "DEPOSIT";
	$fieldToolTipsacc_6_chart["English"]["DEPOSIT"] = "";
	$placeHoldersacc_6_chart["English"]["DEPOSIT"] = "";
	$fieldLabelsacc_6_chart["English"]["BALANCE"] = "BALANCE";
	$fieldToolTipsacc_6_chart["English"]["BALANCE"] = "";
	$placeHoldersacc_6_chart["English"]["BALANCE"] = "";
	$fieldLabelsacc_6_chart["English"]["WITHDRAWAL"] = "WITHDRAWAL";
	$fieldToolTipsacc_6_chart["English"]["WITHDRAWAL"] = "";
	$placeHoldersacc_6_chart["English"]["WITHDRAWAL"] = "";
	if (count($fieldToolTipsacc_6_chart["English"]))
		$tdataacc_6_chart[".isUseToolTips"] = true;
}


	$tdataacc_6_chart[".NCSearch"] = true;

	$tdataacc_6_chart[".ChartRefreshTime"] = 0;


$tdataacc_6_chart[".shortTableName"] = "acc_6_chart";
$tdataacc_6_chart[".nSecOptions"] = 0;

$tdataacc_6_chart[".mainTableOwnerID"] = "";
$tdataacc_6_chart[".entityType"] = 3;
$tdataacc_6_chart[".connId"] = "test2_at_localhost";


$tdataacc_6_chart[".strOriginalTableName"] = "bank_activity";

	



$tdataacc_6_chart[".showAddInPopup"] = false;

$tdataacc_6_chart[".showEditInPopup"] = false;

$tdataacc_6_chart[".showViewInPopup"] = false;

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


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

	$tdataacc_6_chart[".audit"] = false;

	$tdataacc_6_chart[".locking"] = false;


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

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

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

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



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




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

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

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

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



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

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

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

$tdataacc_6_chart[".isUseAjaxSuggest"] = true;




																																																			

$tdataacc_6_chart[".ajaxCodeSnippetAdded"] = false;

$tdataacc_6_chart[".buttonsAdded"] = false;

$tdataacc_6_chart[".addPageEvents"] = false;

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


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


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

$tdataacc_6_chart[".googleLikeFields"] = array();
$tdataacc_6_chart[".googleLikeFields"][] = "WITHDRAWAL";



$tdataacc_6_chart[".tableType"] = "chart";

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

$tdataacc_6_chart[".nPrinterSplitRecords"] = 40;

$tdataacc_6_chart[".geocodingEnabled"] = false;



// chart settings
$tdataacc_6_chart[".chartType"] = "Combined";
// end of chart settings








$tstrOrderBy = "order by DATE(`date`) ASC";
if(strlen($tstrOrderBy) && strtolower(substr($tstrOrderBy,0,8))!="order by")
	$tstrOrderBy = "order by ".$tstrOrderBy;
$tdataacc_6_chart[".strOrderBy"] = $tstrOrderBy;

$tdataacc_6_chart[".orderindexes"] = array();
	$tdataacc_6_chart[".orderindexes"][] = array(1, (1 ? "ASC" : "DESC"), "DATE(`date`)");



$tdataacc_6_chart[".sqlHead"] = "SELECT DATE(`date`) AS \"date\",   case when `amount` > 0 then SUM(`amount`) end as \"DEPOSIT\",   case when `amount` < 0 then SUM(amount) end as \"WITHDRAWAL\",  (select SUM(`amount`) from bank_activity where (DATE(bank_activity.`date`)<= DATE(kkk.`date`) and `account_number` = 6)) AS BALANCE";
$tdataacc_6_chart[".sqlFrom"] = "from bank_activity as kkk";
$tdataacc_6_chart[".sqlWhereExpr"] = "`account_number` = 6";
$tdataacc_6_chart[".sqlTail"] = "";

//fill array of tabs for list page
$arrGridTabs = array();
$arrGridTabs[] = array(
	'tabId' => "",
	'name' => "All data",
	'nameType' => 'Text',
	'where' => "",
	'showRowCount' => 0,
	'hideEmpty' => 0,
);
$tdataacc_6_chart[".arrGridTabs"] = $arrGridTabs;









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

$tdataacc_6_chart[".highlightSearchResults"] = true;

$tableKeysacc_6_chart = array();
$tdataacc_6_chart[".Keys"] = $tableKeysacc_6_chart;


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




//	date
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 1;
	$fdata["strName"] = "date";
	$fdata["GoodName"] = "date";
	$fdata["ownerTable"] = "";
	$fdata["Label"] = GetFieldLabel("Acc_6_Chart","date");
	$fdata["FieldType"] = 135;

	
	
	
			

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

	
		$fdata["isSQLExpression"] = true;
	$fdata["FullName"] = "DATE(`date`)";

	
	
				$fdata["UploadFolder"] = "files";

//  Begin View Formats
	$fdata["ViewFormats"] = array();

	$vdata = array("ViewFormat" => "Short Date");

	
	
	
	
	
	
	
	
	
	
	
		
	
		$vdata["NeedEncode"] = true;

	
		$vdata["truncateText"] = true;
	$vdata["NumberOfChars"] = 80;

	$fdata["ViewFormats"]["chart"] = $vdata;
//  End View Formats

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

	$edata = array("EditFormat" => "Date");

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


	
	



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

		$edata["maxNumberOfFiles"] = 1;

	
	
		$edata["DateEditType"] = 5;
	$edata["InitialYearFactor"] = 100;
	$edata["LastYearFactor"] = 10;

	
	
	
		$edata["controlWidth"] = 200;

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

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


	$fdata["isSeparate"] = false;




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

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


//Filters settings
	$fdata["filterTotals"] = 0;
			$fdata["filterTotalFields"] = "Deposit";
		$fdata["filterFormat"] = "Interval slider";
		$fdata["showCollapsed"] = true;

	
	
	
	

	$fdata["filterKnobsType"] = 0;
		$fdata["filterSliderStepType"] = 3;
	$fdata["filterSliderStepValue"] = 1;
//end of Filters settings


	$tdataacc_6_chart["date"] = $fdata;
		$tdataacc_6_chart[".searchableFields"][] = "date";
//	DEPOSIT
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 2;
	$fdata["strName"] = "DEPOSIT";
	$fdata["GoodName"] = "DEPOSIT";
	$fdata["ownerTable"] = "";
	$fdata["Label"] = GetFieldLabel("Acc_6_Chart","DEPOSIT");
	$fdata["FieldType"] = 14;

	
	
	
			

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

	
		$fdata["isSQLExpression"] = true;
	$fdata["FullName"] = "case when `amount` > 0 then SUM(`amount`) end";

	
	
				$fdata["UploadFolder"] = "files";

//  Begin View Formats
	$fdata["ViewFormats"] = array();

	$vdata = array("ViewFormat" => "Number");

	
	
	
	
	
	
		$vdata["DecimalDigits"] = 0;

	
	
	
	
		
	
		$vdata["NeedEncode"] = true;

	
		$vdata["truncateText"] = true;
	$vdata["NumberOfChars"] = 80;

	$fdata["ViewFormats"]["chart"] = $vdata;
//  End View Formats

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

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

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


	
	



		$edata["IsRequired"] = true;

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

		$edata["maxNumberOfFiles"] = 1;

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

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

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

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


	$fdata["isSeparate"] = false;




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

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


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

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

		$fdata["filterBy"] = 0;

	

	
	
//end of Filters settings


	$tdataacc_6_chart["DEPOSIT"] = $fdata;
		$tdataacc_6_chart[".searchableFields"][] = "DEPOSIT";
//	WITHDRAWAL
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 3;
	$fdata["strName"] = "WITHDRAWAL";
	$fdata["GoodName"] = "WITHDRAWAL";
	$fdata["ownerTable"] = "";
	$fdata["Label"] = GetFieldLabel("Acc_6_Chart","WITHDRAWAL");
	$fdata["FieldType"] = 14;

	
	
	
			

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

	
		$fdata["isSQLExpression"] = true;
	$fdata["FullName"] = "case when `amount` < 0 then SUM(amount) end";

	
	
				$fdata["UploadFolder"] = "files";

//  Begin View Formats
	$fdata["ViewFormats"] = array();

	$vdata = array("ViewFormat" => "Number");

	
	
	
	
	
	
		$vdata["DecimalDigits"] = 0;

	
	
	
	
		
	
		$vdata["NeedEncode"] = true;

	
		$vdata["truncateText"] = true;
	$vdata["NumberOfChars"] = 80;

	$fdata["ViewFormats"]["chart"] = $vdata;
//  End View Formats

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

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

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


	
	



		$edata["IsRequired"] = true;

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

		$edata["maxNumberOfFiles"] = 1;

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

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

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

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


	$fdata["isSeparate"] = false;




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

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


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

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

		$fdata["filterBy"] = 0;

	

	
	
//end of Filters settings


	$tdataacc_6_chart["WITHDRAWAL"] = $fdata;
		$tdataacc_6_chart[".searchableFields"][] = "WITHDRAWAL";
//	BALANCE
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 4;
	$fdata["strName"] = "BALANCE";
	$fdata["GoodName"] = "BALANCE";
	$fdata["ownerTable"] = "";
	$fdata["Label"] = GetFieldLabel("Acc_6_Chart","BALANCE");
	$fdata["FieldType"] = 14;

	
	
	
			

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

	
		$fdata["isSQLExpression"] = true;
	$fdata["FullName"] = "(select SUM(`amount`) from bank_activity where (DATE(bank_activity.`date`)<= DATE(kkk.`date`) and `account_number` = 6))";

	
	
				$fdata["UploadFolder"] = "files";

//  Begin View Formats
	$fdata["ViewFormats"] = array();

	$vdata = array("ViewFormat" => "Number");

	
	
	
	
	
	
		$vdata["DecimalDigits"] = 0;

	
	
	
	
		
	
		$vdata["NeedEncode"] = true;

	
		$vdata["truncateText"] = true;
	$vdata["NumberOfChars"] = 80;

	$fdata["ViewFormats"]["chart"] = $vdata;
//  End View Formats

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

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

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


	
	



		$edata["IsRequired"] = true;

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

		$edata["maxNumberOfFiles"] = 1;

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

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

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

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


	$fdata["isSeparate"] = false;




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

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


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

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

		$fdata["filterBy"] = 0;

	

	
	
//end of Filters settings


	$tdataacc_6_chart["BALANCE"] = $fdata;
		$tdataacc_6_chart[".searchableFields"][] = "BALANCE";

$tdataacc_6_chart[".chartLabelField"] = "date";
$tdataacc_6_chart[".chartSeries"] = array();
$tdataacc_6_chart[".chartSeries"][] = array( 
	"field" => "WITHDRAWAL",
	"total" => ""
);
$tdataacc_6_chart[".chartSeries"][] = array( 
	"field" => "DEPOSIT",
	"total" => ""
);
$tdataacc_6_chart[".chartSeries"][] = array( 
	"field" => "BALANCE",
	"total" => ""
);
	$tdataacc_6_chart[".chartXml"] = '<chart>
		<attr value="tables">
			<attr value="0">Acc 6 Chart</attr>
		</attr>
		<attr value="chart_type">
			<attr value="type">combined</attr>
		</attr>

		<attr value="parameters">';
	$tdataacc_6_chart[".chartXml"] .= '<attr value="0">
			<attr value="name">WITHDRAWAL</attr>';
	$tdataacc_6_chart[".chartXml"] .= '</attr>';
	$tdataacc_6_chart[".chartXml"] .= '<attr value="1">
			<attr value="name">DEPOSIT</attr>';
	$tdataacc_6_chart[".chartXml"] .= '</attr>';
	$tdataacc_6_chart[".chartXml"] .= '<attr value="2">
			<attr value="name">BALANCE</attr>';
	$tdataacc_6_chart[".chartXml"] .= '</attr>';
	$tdataacc_6_chart[".chartXml"] .= '<attr value="3">
		<attr value="name">date</attr>
	</attr>';
	$tdataacc_6_chart[".chartXml"] .= '</attr>
			<attr value="appearance">';


	$tdataacc_6_chart[".chartXml"] .= '<attr value="head">'.xmlencode("ACCOUNT - 6").'</attr>
<attr value="foot">'.xmlencode("Date ").'</attr>
<attr value="y_axis_label">'.xmlencode("Amount").'</attr>


<attr value="slegend">true</attr>
<attr value="sgrid">true</attr>
<attr value="sname">true</attr>
<attr value="sval">true</attr>
<attr value="sanim">true</attr>
<attr value="sstacked">false</attr>
<attr value="slog">false</attr>
<attr value="aqua">0</attr>
<attr value="cview">0</attr>
<attr value="is3d">0</attr>
<attr value="isstacked">0</attr>
<attr value="linestyle">0</attr>
<attr value="autoupdate">0</attr>
<attr value="autoupmin">60</attr>';
$tdataacc_6_chart[".chartXml"] .= '</attr>

<attr value="fields">';
	$tdataacc_6_chart[".chartXml"] .= '<attr value="0">
		<attr value="name">date</attr>
		<attr value="label">'.xmlencode(GetFieldLabel("Acc_6_Chart","date")).'</attr>
		<attr value="search"></attr>
	</attr>';
	$tdataacc_6_chart[".chartXml"] .= '<attr value="1">
		<attr value="name">DEPOSIT</attr>
		<attr value="label">'.xmlencode(GetFieldLabel("Acc_6_Chart","DEPOSIT")).'</attr>
		<attr value="search"></attr>
	</attr>';
	$tdataacc_6_chart[".chartXml"] .= '<attr value="2">
		<attr value="name">WITHDRAWAL</attr>
		<attr value="label">'.xmlencode(GetFieldLabel("Acc_6_Chart","WITHDRAWAL")).'</attr>
		<attr value="search"></attr>
	</attr>';
	$tdataacc_6_chart[".chartXml"] .= '<attr value="3">
		<attr value="name">BALANCE</attr>
		<attr value="label">'.xmlencode(GetFieldLabel("Acc_6_Chart","BALANCE")).'</attr>
		<attr value="search"></attr>
	</attr>';
$tdataacc_6_chart[".chartXml"] .= '</attr>


<attr value="settings">
<attr value="name">Acc 6 Chart</attr>
<attr value="short_table_name">acc_6_chart</attr>
</attr>

</chart>';

$tables_data["Acc 6 Chart"]=&$tdataacc_6_chart;
$field_labels["Acc_6_Chart"] = &$fieldLabelsacc_6_chart;
$fieldToolTips["Acc_6_Chart"] = &$fieldToolTipsacc_6_chart;
$placeHolders["Acc_6_Chart"] = &$placeHoldersacc_6_chart;
$page_titles["Acc_6_Chart"] = &$pageTitlesacc_6_chart;

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

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



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



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











function createSqlQuery_acc_6_chart()
{
$proto0=array();
$proto0["m_strHead"] = "SELECT";
$proto0["m_strFieldList"] = "DATE(`date`) AS \"date\",   case when `amount` > 0 then SUM(`amount`) end as \"DEPOSIT\",   case when `amount` < 0 then SUM(amount) end as \"WITHDRAWAL\",  (select SUM(`amount`) from bank_activity where (DATE(bank_activity.`date`)<= DATE(kkk.`date`) and `account_number` = 6)) AS BALANCE";
$proto0["m_strFrom"] = "from bank_activity as kkk";
$proto0["m_strWhere"] = "`account_number` = 6";
$proto0["m_strOrderBy"] = "order by DATE(`date`) ASC";
	
		;
			$proto0["cipherer"] = null;
$proto2=array();
$proto2["m_sql"] = "`account_number` = 6";
$proto2["m_uniontype"] = "SQLL_UNKNOWN";
						$obj = new SQLField(array(
	"m_strName" => "account_number",
	"m_strTable" => "kkk",
	"m_srcTableName" => "Acc 6 Chart"
));

$proto2["m_column"]=$obj;
$proto2["m_contained"] = array();
$proto2["m_strCase"] = "= 6";
$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();
			$proto7=array();
$proto7["m_functiontype"] = "SQLF_CUSTOM";
$proto7["m_arguments"] = array();
						$obj = new SQLNonParsed(array(
	"m_sql" => "`date`"
));

$proto7["m_arguments"][]=$obj;
$proto7["m_strFunctionName"] = "DATE";
$obj = new SQLFunctionCall($proto7);

$proto6["m_sql"] = "DATE(`date`)";
$proto6["m_srcTableName"] = "Acc 6 Chart";
$proto6["m_expr"]=$obj;
$proto6["m_alias"] = "date";
$obj = new SQLFieldListItem($proto6);

$proto0["m_fieldlist"][]=$obj;
						$proto9=array();
			$obj = new SQLNonParsed(array(
	"m_sql" => "case when `amount` > 0 then SUM(`amount`) end"
));

$proto9["m_sql"] = "case when `amount` > 0 then SUM(`amount`) end";
$proto9["m_srcTableName"] = "Acc 6 Chart";
$proto9["m_expr"]=$obj;
$proto9["m_alias"] = "DEPOSIT";
$obj = new SQLFieldListItem($proto9);

$proto0["m_fieldlist"][]=$obj;
						$proto11=array();
			$obj = new SQLNonParsed(array(
	"m_sql" => "case when `amount` < 0 then SUM(amount) end"
));

$proto11["m_sql"] = "case when `amount` < 0 then SUM(amount) end";
$proto11["m_srcTableName"] = "Acc 6 Chart";
$proto11["m_expr"]=$obj;
$proto11["m_alias"] = "WITHDRAWAL";
$obj = new SQLFieldListItem($proto11);

$proto0["m_fieldlist"][]=$obj;
						$proto13=array();
			$proto14=array();
$proto14["m_strHead"] = "select";
$proto14["m_strFieldList"] = "SUM(`amount`)";
$proto14["m_strFrom"] = "from bank_activity";
$proto14["m_strWhere"] = "(DATE(bank_activity.`date`)<= DATE(kkk.`date`) and `account_number` = 6)";
$proto14["m_strOrderBy"] = "";
	
		;
			$proto14["cipherer"] = null;
$proto16=array();
$proto16["m_sql"] = "DATE(bank_activity.`date`)<= DATE(kkk.`date`) and `account_number` = 6";
$proto16["m_uniontype"] = "SQLL_AND";
	$obj = new SQLNonParsed(array(
	"m_sql" => "DATE(bank_activity.`date`)<= DATE(kkk.`date`) and `account_number` = 6"
));

$proto16["m_column"]=$obj;
$proto16["m_contained"] = array();
						$proto18=array();
$proto18["m_sql"] = "DATE(bank_activity.`date`)<= DATE(kkk.`date`)";
$proto18["m_uniontype"] = "SQLL_UNKNOWN";
						$proto19=array();
$proto19["m_functiontype"] = "SQLF_CUSTOM";
$proto19["m_arguments"] = array();
						$obj = new SQLNonParsed(array(
	"m_sql" => "bank_activity.`date`"
));

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

$proto18["m_column"]=$obj;
$proto18["m_contained"] = array();
$proto18["m_strCase"] = "<= DATE(kkk.`date`)";
$proto18["m_havingmode"] = false;
$proto18["m_inBrackets"] = false;
$proto18["m_useAlias"] = false;
$obj = new SQLLogicalExpr($proto18);

			$proto16["m_contained"][]=$obj;
						$proto21=array();
$proto21["m_sql"] = "`account_number` = 6";
$proto21["m_uniontype"] = "SQLL_UNKNOWN";
						$obj = new SQLField(array(
	"m_strName" => "account_number",
	"m_strTable" => "bank_activity",
	"m_srcTableName" => "Acc 6 Chart"
));

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

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

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

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

$proto14["m_having"] = $obj;
$proto14["m_fieldlist"] = array();
						$proto25=array();
			$proto26=array();
$proto26["m_functiontype"] = "SQLF_SUM";
$proto26["m_arguments"] = array();
						$obj = new SQLField(array(
	"m_strName" => "amount",
	"m_strTable" => "bank_activity",
	"m_srcTableName" => "Acc 6 Chart"
));

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

$proto25["m_sql"] = "SUM(`amount`)";
$proto25["m_srcTableName"] = "Acc 6 Chart";
$proto25["m_expr"]=$obj;
$proto25["m_alias"] = "";
$obj = new SQLFieldListItem($proto25);

$proto14["m_fieldlist"][]=$obj;
$proto14["m_fromlist"] = array();
												$proto28=array();
$proto28["m_link"] = "SQLL_MAIN";
			$proto29=array();
$proto29["m_strName"] = "bank_activity";
$proto29["m_srcTableName"] = "Acc 6 Chart";
$proto29["m_columns"] = array();
$proto29["m_columns"][] = "id";
$proto29["m_columns"][] = "account_number";
$proto29["m_columns"][] = "activity";
$proto29["m_columns"][] = "amount";
$proto29["m_columns"][] = "officer";
$proto29["m_columns"][] = "type";
$proto29["m_columns"][] = "date";
$proto29["m_columns"][] = "image";
$proto29["m_columns"][] = "particular";
$proto29["m_columns"][] = "outlet_code";
$obj = new SQLTable($proto29);

$proto28["m_table"] = $obj;
$proto28["m_sql"] = "bank_activity";
$proto28["m_alias"] = "";
$proto28["m_srcTableName"] = "Acc 6 Chart";
$proto30=array();
$proto30["m_sql"] = "";
$proto30["m_uniontype"] = "SQLL_UNKNOWN";
	$obj = new SQLNonParsed(array(
	"m_sql" => ""
));

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

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

$proto14["m_fromlist"][]=$obj;
$proto14["m_groupby"] = array();
$proto14["m_orderby"] = array();
$proto14["m_srcTableName"]="Acc 6 Chart";		
$obj = new SQLQuery($proto14);

$proto13["m_sql"] = "(select SUM(`amount`) from bank_activity where (DATE(bank_activity.`date`)<= DATE(kkk.`date`) and `account_number` = 6))";
$proto13["m_srcTableName"] = "Acc 6 Chart";
$proto13["m_expr"]=$obj;
$proto13["m_alias"] = "BALANCE";
$obj = new SQLFieldListItem($proto13);

$proto0["m_fieldlist"][]=$obj;
$proto0["m_fromlist"] = array();
												$proto32=array();
$proto32["m_link"] = "SQLL_MAIN";
			$proto33=array();
$proto33["m_strName"] = "bank_activity";
$proto33["m_srcTableName"] = "Acc 6 Chart";
$proto33["m_columns"] = array();
$proto33["m_columns"][] = "id";
$proto33["m_columns"][] = "account_number";
$proto33["m_columns"][] = "activity";
$proto33["m_columns"][] = "amount";
$proto33["m_columns"][] = "officer";
$proto33["m_columns"][] = "type";
$proto33["m_columns"][] = "date";
$proto33["m_columns"][] = "image";
$proto33["m_columns"][] = "particular";
$proto33["m_columns"][] = "outlet_code";
$obj = new SQLTable($proto33);

$proto32["m_table"] = $obj;
$proto32["m_sql"] = "bank_activity as kkk";
$proto32["m_alias"] = "kkk";
$proto32["m_srcTableName"] = "Acc 6 Chart";
$proto34=array();
$proto34["m_sql"] = "";
$proto34["m_uniontype"] = "SQLL_UNKNOWN";
	$obj = new SQLNonParsed(array(
	"m_sql" => ""
));

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

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

$proto0["m_fromlist"][]=$obj;
$proto0["m_groupby"] = array();
												$proto36=array();
						$proto37=array();
$proto37["m_functiontype"] = "SQLF_CUSTOM";
$proto37["m_arguments"] = array();
						$obj = new SQLNonParsed(array(
	"m_sql" => "`date`"
));

$proto37["m_arguments"][]=$obj;
$proto37["m_strFunctionName"] = "DATE";
$obj = new SQLFunctionCall($proto37);

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

$proto0["m_groupby"][]=$obj;
$proto0["m_orderby"] = array();
												$proto39=array();
						$proto40=array();
$proto40["m_functiontype"] = "SQLF_CUSTOM";
$proto40["m_arguments"] = array();
						$obj = new SQLNonParsed(array(
	"m_sql" => "`date`"
));

$proto40["m_arguments"][]=$obj;
$proto40["m_strFunctionName"] = "DATE";
$obj = new SQLFunctionCall($proto40);

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

$proto0["m_orderby"][]=$obj;					
$proto0["m_srcTableName"]="Acc 6 Chart";		
$obj = new SQLQuery($proto0);

	return $obj;
}
$queryData_acc_6_chart = createSqlQuery_acc_6_chart();


	
		;

				

$tdataacc_6_chart[".sqlquery"] = $queryData_acc_6_chart;



$tableEvents["Acc 6 Chart"] = new eventsBase;
$tdataacc_6_chart[".hasEvents"] = false;

?>