<?php
$tdatadaily_reports = array();
$tdatadaily_reports[".searchableFields"] = array();
$tdatadaily_reports[".ShortName"] = "daily_reports";
$tdatadaily_reports[".OwnerID"] = "";
$tdatadaily_reports[".OriginalTable"] = "daily_report";


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

//	field labels
$fieldLabelsdaily_reports = array();
$fieldToolTipsdaily_reports = array();
$pageTitlesdaily_reports = array();
$placeHoldersdaily_reports = array();

if(mlang_getcurrentlang()=="English")
{
	$fieldLabelsdaily_reports["English"] = array();
	$fieldToolTipsdaily_reports["English"] = array();
	$placeHoldersdaily_reports["English"] = array();
	$pageTitlesdaily_reports["English"] = array();
	$fieldLabelsdaily_reports["English"]["id"] = "Id";
	$fieldToolTipsdaily_reports["English"]["id"] = "";
	$placeHoldersdaily_reports["English"]["id"] = "";
	$fieldLabelsdaily_reports["English"]["Date"] = "Date";
	$fieldToolTipsdaily_reports["English"]["Date"] = "";
	$placeHoldersdaily_reports["English"]["Date"] = "";
	$fieldLabelsdaily_reports["English"]["purchasing_cash_payment"] = "purchasing cash payment";
	$fieldToolTipsdaily_reports["English"]["purchasing_cash_payment"] = "";
	$placeHoldersdaily_reports["English"]["purchasing_cash_payment"] = "";
	$fieldLabelsdaily_reports["English"]["purchasing_Cheque_payment"] = "purchasing Cheque payment";
	$fieldToolTipsdaily_reports["English"]["purchasing_Cheque_payment"] = "";
	$placeHoldersdaily_reports["English"]["purchasing_Cheque_payment"] = "";
	$fieldLabelsdaily_reports["English"]["purchasing_Cheque_payment_for_arrears"] = "purchasing Cheque payment for arrears";
	$fieldToolTipsdaily_reports["English"]["purchasing_Cheque_payment_for_arrears"] = "";
	$placeHoldersdaily_reports["English"]["purchasing_Cheque_payment_for_arrears"] = "";
	$fieldLabelsdaily_reports["English"]["Cash_payment_for_expenses"] = "Cash payment for expenses";
	$fieldToolTipsdaily_reports["English"]["Cash_payment_for_expenses"] = "";
	$placeHoldersdaily_reports["English"]["Cash_payment_for_expenses"] = "";
	$fieldLabelsdaily_reports["English"]["purchasing_cash_payment__for_arrears"] = "purchasing cash payment  for arrears";
	$fieldToolTipsdaily_reports["English"]["purchasing_cash_payment__for_arrears"] = "";
	$placeHoldersdaily_reports["English"]["purchasing_cash_payment__for_arrears"] = "";
	$fieldLabelsdaily_reports["English"]["Salary_advance"] = "Salary Advance";
	$fieldToolTipsdaily_reports["English"]["Salary_advance"] = "";
	$placeHoldersdaily_reports["English"]["Salary_advance"] = "";
	$fieldLabelsdaily_reports["English"]["salary"] = "Salary";
	$fieldToolTipsdaily_reports["English"]["salary"] = "";
	$placeHoldersdaily_reports["English"]["salary"] = "";
	$fieldLabelsdaily_reports["English"]["total_cash_out"] = "total cash out";
	$fieldToolTipsdaily_reports["English"]["total_cash_out"] = "";
	$placeHoldersdaily_reports["English"]["total_cash_out"] = "";
	$fieldLabelsdaily_reports["English"]["total_cheque_amount"] = "total cheque amount";
	$fieldToolTipsdaily_reports["English"]["total_cheque_amount"] = "";
	$placeHoldersdaily_reports["English"]["total_cheque_amount"] = "";
	$fieldLabelsdaily_reports["English"]["total_out"] = "Total Out";
	$fieldToolTipsdaily_reports["English"]["total_out"] = "";
	$placeHoldersdaily_reports["English"]["total_out"] = "";
	$fieldLabelsdaily_reports["English"]["sales_income_arrears_by_Cheque"] = "sales income arrears by Cheque";
	$fieldToolTipsdaily_reports["English"]["sales_income_arrears_by_Cheque"] = "";
	$placeHoldersdaily_reports["English"]["sales_income_arrears_by_Cheque"] = "";
	$fieldLabelsdaily_reports["English"]["sale_income_arrears_by_Cash"] = "sale income arrears by Cash";
	$fieldToolTipsdaily_reports["English"]["sale_income_arrears_by_Cash"] = "";
	$placeHoldersdaily_reports["English"]["sale_income_arrears_by_Cash"] = "";
	$fieldLabelsdaily_reports["English"]["sales_income_by_Cheque"] = "sales income by Cheque";
	$fieldToolTipsdaily_reports["English"]["sales_income_by_Cheque"] = "";
	$placeHoldersdaily_reports["English"]["sales_income_by_Cheque"] = "";
	$fieldLabelsdaily_reports["English"]["sale_income_by_Cash"] = "sale income by Cash";
	$fieldToolTipsdaily_reports["English"]["sale_income_by_Cash"] = "";
	$placeHoldersdaily_reports["English"]["sale_income_by_Cash"] = "";
	$fieldLabelsdaily_reports["English"]["Opaning_balance"] = "Opaning Balance";
	$fieldToolTipsdaily_reports["English"]["Opaning_balance"] = "";
	$placeHoldersdaily_reports["English"]["Opaning_balance"] = "";
	$fieldLabelsdaily_reports["English"]["total_Cash_in"] = "total Cash in";
	$fieldToolTipsdaily_reports["English"]["total_Cash_in"] = "";
	$placeHoldersdaily_reports["English"]["total_Cash_in"] = "";
	$fieldLabelsdaily_reports["English"]["total_Cheque_in"] = "total Cheque in";
	$fieldToolTipsdaily_reports["English"]["total_Cheque_in"] = "";
	$placeHoldersdaily_reports["English"]["total_Cheque_in"] = "";
	$fieldLabelsdaily_reports["English"]["total_in"] = "Total In";
	$fieldToolTipsdaily_reports["English"]["total_in"] = "";
	$placeHoldersdaily_reports["English"]["total_in"] = "";
	$fieldLabelsdaily_reports["English"]["cash_balance"] = "Cash Balance";
	$fieldToolTipsdaily_reports["English"]["cash_balance"] = "";
	$placeHoldersdaily_reports["English"]["cash_balance"] = "";
	$fieldLabelsdaily_reports["English"]["Bank_Diposit"] = "Bank Diposit";
	$fieldToolTipsdaily_reports["English"]["Bank_Diposit"] = "";
	$placeHoldersdaily_reports["English"]["Bank_Diposit"] = "";
	$fieldLabelsdaily_reports["English"]["Loan"] = "Loan";
	$fieldToolTipsdaily_reports["English"]["Loan"] = "";
	$placeHoldersdaily_reports["English"]["Loan"] = "";
	if (count($fieldToolTipsdaily_reports["English"]))
		$tdatadaily_reports[".isUseToolTips"] = true;
}


	$tdatadaily_reports[".NCSearch"] = true;



$tdatadaily_reports[".shortTableName"] = "daily_reports";
$tdatadaily_reports[".nSecOptions"] = 0;

$tdatadaily_reports[".mainTableOwnerID"] = "";
$tdatadaily_reports[".entityType"] = 1;
$tdatadaily_reports[".connId"] = "test2_at_localhost";


$tdatadaily_reports[".strOriginalTableName"] = "daily_report";

	



$tdatadaily_reports[".showAddInPopup"] = false;

$tdatadaily_reports[".showEditInPopup"] = false;

$tdatadaily_reports[".showViewInPopup"] = false;

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


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

	$tdatadaily_reports[".audit"] = true;

	$tdatadaily_reports[".locking"] = false;


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

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

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

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



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




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

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

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

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



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

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

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

$tdatadaily_reports[".isUseAjaxSuggest"] = true;

$tdatadaily_reports[".rowHighlite"] = true;



																																																			

$tdatadaily_reports[".ajaxCodeSnippetAdded"] = false;

$tdatadaily_reports[".buttonsAdded"] = false;

$tdatadaily_reports[".addPageEvents"] = false;

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


$tdatadaily_reports[".badgeColor"] = "1E90FF";


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

$tdatadaily_reports[".googleLikeFields"] = array();
$tdatadaily_reports[".googleLikeFields"][] = "id";
$tdatadaily_reports[".googleLikeFields"][] = "Date";
$tdatadaily_reports[".googleLikeFields"][] = "purchasing cash payment  for arrears";
$tdatadaily_reports[".googleLikeFields"][] = "purchasing cash payment";
$tdatadaily_reports[".googleLikeFields"][] = "purchasing Cheque payment";
$tdatadaily_reports[".googleLikeFields"][] = "purchasing Cheque payment for arrears";
$tdatadaily_reports[".googleLikeFields"][] = "Cash payment for expenses";
$tdatadaily_reports[".googleLikeFields"][] = "Salary advance";
$tdatadaily_reports[".googleLikeFields"][] = "salary";
$tdatadaily_reports[".googleLikeFields"][] = "Bank Diposit";
$tdatadaily_reports[".googleLikeFields"][] = "Loan";
$tdatadaily_reports[".googleLikeFields"][] = "total cash out";
$tdatadaily_reports[".googleLikeFields"][] = "total cheque amount";
$tdatadaily_reports[".googleLikeFields"][] = "total out";
$tdatadaily_reports[".googleLikeFields"][] = "sales income arrears by Cheque";
$tdatadaily_reports[".googleLikeFields"][] = "sale income arrears by Cash";
$tdatadaily_reports[".googleLikeFields"][] = "sales income by Cheque";
$tdatadaily_reports[".googleLikeFields"][] = "sale income by Cash";
$tdatadaily_reports[".googleLikeFields"][] = "Opaning balance";
$tdatadaily_reports[".googleLikeFields"][] = "total Cash in";
$tdatadaily_reports[".googleLikeFields"][] = "total Cheque in";
$tdatadaily_reports[".googleLikeFields"][] = "total in";
$tdatadaily_reports[".googleLikeFields"][] = "cash balance";



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

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

$tdatadaily_reports[".nPrinterSplitRecords"] = 40;

$tdatadaily_reports[".geocodingEnabled"] = false;










$tdatadaily_reports[".pageSize"] = 20;

$tdatadaily_reports[".warnLeavingPages"] = true;



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

$tdatadaily_reports[".orderindexes"] = array();
	$tdatadaily_reports[".orderindexes"][] = array(1, (0 ? "ASC" : "DESC"), "daily_report.id");



$tdatadaily_reports[".sqlHead"] = "SELECT id,DATE(`date`) AS \"Date\",  IFNULL(pur34.st34, 0) AS \"purchasing cash payment  for arrears\",  IFNULL(pur35.st35, 0) AS \"purchasing cash payment\",  IFNULL(pur36.st36, 0) AS \"purchasing Cheque payment\",  IFNULL(pur37.st37, 0) AS \"purchasing Cheque payment for arrears\",  IFNULL(pur40.st40, 0) AS \"Cash payment for expenses\" ,  IFNULL(pur38.st38, 0) AS \"Salary advance\",  IFNULL(pur39.st39, 0) AS \"salary\",  IFNULL(pur49.st49, 0) AS \"Bank Diposit\",  IFNULL(pur50.st50, 0) AS \"Loan\",  IFNULL(pur34.st34, 0) + IFNULL(pur35.st35, 0) + IFNULL(pur40.st40, 0) + IFNULL(pur38.st38, 0) + IFNULL(pur39.st39, 0)+IFNULL(pur49.st49, 0)+ IFNULL(pur50.st50, 0) as \"total cash out\",  IFNULL(pur36.st36, 0) + IFNULL(pur37.st37, 0) as \"total cheque amount\",  IFNULL(pur34.st34, 0) + IFNULL(pur35.st35, 0) + IFNULL(pur40.st40, 0) + IFNULL(pur38.st38, 0) + IFNULL(pur39.st39, 0) +  IFNULL(pur36.st36, 0) + IFNULL(pur37.st37, 0)+ IFNULL(pur49.st49, 0)+ IFNULL(pur50.st50, 0) as \"total out\",  IFNULL(pur41.st41, 0) AS \"sales income arrears by Cheque\",  IFNULL(pur42.st42, 0) AS \"sale income arrears by Cash\",  IFNULL(pur43.st43, 0) AS \"sales income by Cheque\",  IFNULL(pur44.st44, 0) AS \"sale income by Cash\",  IFNULL(pur45.st45, 0) AS \"Opaning balance\",  IFNULL(pur42.st42, 0) + IFNULL(pur44.st44, 0) + IFNULL(pur45.st45, 0) as \"total Cash in\",  IFNULL(pur41.st41, 0) + IFNULL(pur43.st43, 0) as \"total Cheque in\",  IFNULL(pur42.st42, 0) + IFNULL(pur44.st44, 0) + IFNULL(pur45.st45, 0) + IFNULL(pur41.st41, 0) + IFNULL(pur43.st43, 0) as \"total in\",  (IFNULL(pur42.st42, 0) + IFNULL(pur44.st44, 0) + IFNULL(pur45.st45, 0)) - (IFNULL(pur34.st34, 0) + IFNULL(pur35.st35, 0) + IFNULL(pur40.st40, 0) + IFNULL(pur38.st38, 0) + IFNULL(pur39.st39, 0) + IFNULL(pur49.st49, 0) + IFNULL(pur50.st50, 0)) as \"cash balance\"";
$tdatadaily_reports[".sqlFrom"] = "FROM daily_report  LEFT JOIN ( SELECT DATE(`date_time`) AS KKK , SUM(`amount`) AS st49 FROM `payment_for_pur` WHERE `payment_type` = \"Cash\" AND  ( `details` = \"Deposit\") GROUP BY DATE(`date_time`)) AS pur49 ON daily_report.DATE = pur49.KKK  LEFT JOIN ( SELECT DATE(`date_time`) AS KKK , SUM(`amount`) AS st50 FROM `payment_for_pur` WHERE `payment_type` = \"Cash\" AND  ( `details` = \"Loan\") GROUP BY DATE(`date_time`)) AS pur50 ON daily_report.DATE = pur50.KKK      LEFT JOIN ( SELECT DATE(`date_time`) AS KKK , SUM(`amount`) AS st34 FROM `payment_for_pur` WHERE `payment_type` = \"Cash\" AND  (`details` = \"purchasing arrears\" ) GROUP BY DATE(`date_time`)) AS pur34 ON daily_report.DATE = pur34.KKK  LEFT JOIN ( SELECT DATE(`date_time`) AS KKK , SUM(`amount`) AS st35 FROM `payment_for_pur` WHERE `payment_type` = \"Cash\" AND  ( `details` = \"purchasing\") GROUP BY DATE(`date_time`)) AS pur35 ON daily_report.DATE = pur35.KKK  LEFT JOIN ( SELECT DATE(`date_time`) AS KKK , SUM(`amount`) AS st36 FROM `payment_for_pur` WHERE `payment_type` = \"Cheque\" AND  ( `details` = \"purchasing\") GROUP BY DATE(`date_time`)) AS pur36 ON daily_report.DATE = pur36.KKK  LEFT JOIN ( SELECT DATE(`date_time`) AS KKK , SUM(`amount`) AS st37 FROM `payment_for_pur` WHERE `payment_type` = \"Cheque\" AND  (`details` = \"purchasing arrears\" ) GROUP BY DATE(`date_time`)) AS pur37 ON daily_report.DATE = pur37.KKK  LEFT JOIN ( SELECT DATE(`date_time`) AS KKK , SUM(`amount`) AS st40 FROM `payment_for_pur` WHERE `payment_type` = \"Cash\" AND  ( `details` = \"Expen\") GROUP BY DATE(`date_time`)) AS pur40 ON daily_report.DATE = pur40.KKK  LEFT JOIN ( SELECT DATE(`date_time`) AS KKK , SUM(`amount`) AS st38 FROM `payment_for_pur` WHERE `payment_type` = \"Cash\" AND  ( `details` = \"salary advance\") GROUP BY DATE(`date_time`)) AS pur38 ON daily_report.DATE = pur38.KKK  LEFT JOIN ( SELECT DATE(`date_time`) AS KKK , SUM(`amount`) AS st39 FROM `payment_for_pur` WHERE `payment_type` = \"Cash\" AND  ( `details` = \"salary\") GROUP BY DATE(`date_time`)) AS pur39 ON daily_report.DATE = pur39.KKK    LEFT JOIN ( SELECT DATE(`date_time`) AS KK2 , SUM(`amount`) AS st41 FROM `payments` WHERE `status`=\"sales arrears\" and type=\"Cheque\" GROUP BY DATE(`date_time`)) AS pur41 ON daily_report.DATE = pur41.KK2  LEFT JOIN ( SELECT DATE(`date_time`) AS KK2 , SUM(`amount`) AS st42 FROM `payments` WHERE `status`=\"sales arrears\"and type=\"Cash\" GROUP BY DATE(`date_time`)) AS pur42 ON daily_report.DATE = pur42.KK2  LEFT JOIN ( SELECT DATE(`date_time`) AS KK2 , SUM(`amount`) AS st43 FROM `payments` WHERE `status`=\"sales\" and type=\"Cheque\" GROUP BY DATE(`date_time`)) AS pur43 ON daily_report.DATE = pur43.KK2  LEFT JOIN ( SELECT DATE(`date_time`) AS KK2 , SUM(`amount`) AS st44 FROM `payments` WHERE `status`=\"sales\"and type=\"Cash\" GROUP BY DATE(`date_time`)) AS pur44 ON daily_report.DATE = pur44.KK2  LEFT JOIN ( SELECT DATE(`date_time`) AS KK2 , SUM(`amount`) AS st45 FROM `payments` WHERE `status`=\"opening balance\"and type=\"Cash\" GROUP BY DATE(`date_time`)) AS pur45 ON daily_report.DATE = pur45.KK2";
$tdatadaily_reports[".sqlWhereExpr"] = "";
$tdatadaily_reports[".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;
$tdatadaily_reports[".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;
$tdatadaily_reports[".arrGroupsPerPage"] = $arrGPP;

$tdatadaily_reports[".highlightSearchResults"] = true;

$tableKeysdaily_reports = array();
$tableKeysdaily_reports[] = "id";
$tdatadaily_reports[".Keys"] = $tableKeysdaily_reports;


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




//	id
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 1;
	$fdata["strName"] = "id";
	$fdata["GoodName"] = "id";
	$fdata["ownerTable"] = "daily_report";
	$fdata["Label"] = GetFieldLabel("daily_reportS","id");
	$fdata["FieldType"] = 3;

	
		$fdata["AutoInc"] = true;

	
			

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

	
		$fdata["isSQLExpression"] = true;
	$fdata["FullName"] = "id";

	
	
				$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


	$tdatadaily_reports["id"] = $fdata;
		$tdatadaily_reports[".searchableFields"][] = "id";
//	Date
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 2;
	$fdata["strName"] = "Date";
	$fdata["GoodName"] = "Date";
	$fdata["ownerTable"] = "";
	$fdata["Label"] = GetFieldLabel("daily_reportS","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"]["view"] = $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["IsRequired"] = true;

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

		$edata["maxNumberOfFiles"] = 1;

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

	
	
	
		$edata["controlWidth"] = 200;

//	Begin validation
	$edata["validateAs"] = array();
	$edata["validateAs"]["basicValidate"] = array();
	$edata["validateAs"]["customMessages"] = array();
						$edata["validateAs"]["basicValidate"][] = "IsRequired";
			$edata["validateAs"]["basicValidate"][] = "DenyDuplicated";
	$edata["validateAs"]["customMessages"]["DenyDuplicated"] = array("message" => "Value %value% already exists", "messageType" => "Text");

	
	//	End validation

	
			
	
		$edata["denyDuplicates"] = true;

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


	$fdata["isSeparate"] = false;




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

			// the default search options list
				$fdata["searchOptionsList"] = array("Equals", "More than", "Less than", "Between", EMPTY_SEARCH, 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


	$tdatadaily_reports["Date"] = $fdata;
		$tdatadaily_reports[".searchableFields"][] = "Date";
//	purchasing cash payment  for arrears
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 3;
	$fdata["strName"] = "purchasing cash payment  for arrears";
	$fdata["GoodName"] = "purchasing_cash_payment__for_arrears";
	$fdata["ownerTable"] = "";
	$fdata["Label"] = GetFieldLabel("daily_reportS","purchasing_cash_payment__for_arrears");
	$fdata["FieldType"] = 14;

	
	
	
			

		$fdata["strField"] = "purchasing cash payment  for arrears";

	
		$fdata["isSQLExpression"] = true;
	$fdata["FullName"] = "IFNULL(pur34.st34, 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


	$tdatadaily_reports["purchasing cash payment  for arrears"] = $fdata;
		$tdatadaily_reports[".searchableFields"][] = "purchasing cash payment  for arrears";
//	purchasing cash payment
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 4;
	$fdata["strName"] = "purchasing cash payment";
	$fdata["GoodName"] = "purchasing_cash_payment";
	$fdata["ownerTable"] = "";
	$fdata["Label"] = GetFieldLabel("daily_reportS","purchasing_cash_payment");
	$fdata["FieldType"] = 14;

	
	
	
			

		$fdata["strField"] = "purchasing cash payment";

	
		$fdata["isSQLExpression"] = true;
	$fdata["FullName"] = "IFNULL(pur35.st35, 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


	$tdatadaily_reports["purchasing cash payment"] = $fdata;
		$tdatadaily_reports[".searchableFields"][] = "purchasing cash payment";
//	purchasing Cheque payment
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 5;
	$fdata["strName"] = "purchasing Cheque payment";
	$fdata["GoodName"] = "purchasing_Cheque_payment";
	$fdata["ownerTable"] = "";
	$fdata["Label"] = GetFieldLabel("daily_reportS","purchasing_Cheque_payment");
	$fdata["FieldType"] = 14;

	
	
	
			

		$fdata["strField"] = "purchasing Cheque payment";

	
		$fdata["isSQLExpression"] = true;
	$fdata["FullName"] = "IFNULL(pur36.st36, 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


	$tdatadaily_reports["purchasing Cheque payment"] = $fdata;
		$tdatadaily_reports[".searchableFields"][] = "purchasing Cheque payment";
//	purchasing Cheque payment for arrears
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 6;
	$fdata["strName"] = "purchasing Cheque payment for arrears";
	$fdata["GoodName"] = "purchasing_Cheque_payment_for_arrears";
	$fdata["ownerTable"] = "";
	$fdata["Label"] = GetFieldLabel("daily_reportS","purchasing_Cheque_payment_for_arrears");
	$fdata["FieldType"] = 14;

	
	
	
			

		$fdata["strField"] = "purchasing Cheque payment for arrears";

	
		$fdata["isSQLExpression"] = true;
	$fdata["FullName"] = "IFNULL(pur37.st37, 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


	$tdatadaily_reports["purchasing Cheque payment for arrears"] = $fdata;
		$tdatadaily_reports[".searchableFields"][] = "purchasing Cheque payment for arrears";
//	Cash payment for expenses
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 7;
	$fdata["strName"] = "Cash payment for expenses";
	$fdata["GoodName"] = "Cash_payment_for_expenses";
	$fdata["ownerTable"] = "";
	$fdata["Label"] = GetFieldLabel("daily_reportS","Cash_payment_for_expenses");
	$fdata["FieldType"] = 14;

	
	
	
			

		$fdata["strField"] = "Cash payment for expenses";

	
		$fdata["isSQLExpression"] = true;
	$fdata["FullName"] = "IFNULL(pur40.st40, 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


	$tdatadaily_reports["Cash payment for expenses"] = $fdata;
		$tdatadaily_reports[".searchableFields"][] = "Cash payment for expenses";
//	Salary advance
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 8;
	$fdata["strName"] = "Salary advance";
	$fdata["GoodName"] = "Salary_advance";
	$fdata["ownerTable"] = "";
	$fdata["Label"] = GetFieldLabel("daily_reportS","Salary_advance");
	$fdata["FieldType"] = 14;

	
	
	
			

		$fdata["strField"] = "Salary advance";

	
		$fdata["isSQLExpression"] = true;
	$fdata["FullName"] = "IFNULL(pur38.st38, 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


	$tdatadaily_reports["Salary advance"] = $fdata;
		$tdatadaily_reports[".searchableFields"][] = "Salary advance";
//	salary
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 9;
	$fdata["strName"] = "salary";
	$fdata["GoodName"] = "salary";
	$fdata["ownerTable"] = "";
	$fdata["Label"] = GetFieldLabel("daily_reportS","salary");
	$fdata["FieldType"] = 14;

	
	
	
			

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

	
		$fdata["isSQLExpression"] = true;
	$fdata["FullName"] = "IFNULL(pur39.st39, 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


	$tdatadaily_reports["salary"] = $fdata;
		$tdatadaily_reports[".searchableFields"][] = "salary";
//	Bank Diposit
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 10;
	$fdata["strName"] = "Bank Diposit";
	$fdata["GoodName"] = "Bank_Diposit";
	$fdata["ownerTable"] = "";
	$fdata["Label"] = GetFieldLabel("daily_reportS","Bank_Diposit");
	$fdata["FieldType"] = 14;

	
	
	
			

		$fdata["strField"] = "Bank Diposit";

	
		$fdata["isSQLExpression"] = true;
	$fdata["FullName"] = "IFNULL(pur49.st49, 0)";

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


	$tdatadaily_reports["Bank Diposit"] = $fdata;
		$tdatadaily_reports[".searchableFields"][] = "Bank Diposit";
//	Loan
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 11;
	$fdata["strName"] = "Loan";
	$fdata["GoodName"] = "Loan";
	$fdata["ownerTable"] = "";
	$fdata["Label"] = GetFieldLabel("daily_reportS","Loan");
	$fdata["FieldType"] = 14;

	
	
	
			

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

	
		$fdata["isSQLExpression"] = true;
	$fdata["FullName"] = "IFNULL(pur50.st50, 0)";

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


	$tdatadaily_reports["Loan"] = $fdata;
		$tdatadaily_reports[".searchableFields"][] = "Loan";
//	total cash out
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 12;
	$fdata["strName"] = "total cash out";
	$fdata["GoodName"] = "total_cash_out";
	$fdata["ownerTable"] = "";
	$fdata["Label"] = GetFieldLabel("daily_reportS","total_cash_out");
	$fdata["FieldType"] = 14;

	
	
	
			

		$fdata["strField"] = "total cash out";

	
		$fdata["isSQLExpression"] = true;
	$fdata["FullName"] = "IFNULL(pur34.st34, 0) + IFNULL(pur35.st35, 0) + IFNULL(pur40.st40, 0) + IFNULL(pur38.st38, 0) + IFNULL(pur39.st39, 0)+IFNULL(pur49.st49, 0)+ IFNULL(pur50.st50, 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


	$tdatadaily_reports["total cash out"] = $fdata;
		$tdatadaily_reports[".searchableFields"][] = "total cash out";
//	total cheque amount
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 13;
	$fdata["strName"] = "total cheque amount";
	$fdata["GoodName"] = "total_cheque_amount";
	$fdata["ownerTable"] = "";
	$fdata["Label"] = GetFieldLabel("daily_reportS","total_cheque_amount");
	$fdata["FieldType"] = 14;

	
	
	
			

		$fdata["strField"] = "total cheque amount";

	
		$fdata["isSQLExpression"] = true;
	$fdata["FullName"] = "IFNULL(pur36.st36, 0) + IFNULL(pur37.st37, 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


	$tdatadaily_reports["total cheque amount"] = $fdata;
		$tdatadaily_reports[".searchableFields"][] = "total cheque amount";
//	total out
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 14;
	$fdata["strName"] = "total out";
	$fdata["GoodName"] = "total_out";
	$fdata["ownerTable"] = "";
	$fdata["Label"] = GetFieldLabel("daily_reportS","total_out");
	$fdata["FieldType"] = 14;

	
	
	
			

		$fdata["strField"] = "total out";

	
		$fdata["isSQLExpression"] = true;
	$fdata["FullName"] = "IFNULL(pur34.st34, 0) + IFNULL(pur35.st35, 0) + IFNULL(pur40.st40, 0) + IFNULL(pur38.st38, 0) + IFNULL(pur39.st39, 0) +  IFNULL(pur36.st36, 0) + IFNULL(pur37.st37, 0)+ IFNULL(pur49.st49, 0)+ IFNULL(pur50.st50, 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


	$tdatadaily_reports["total out"] = $fdata;
		$tdatadaily_reports[".searchableFields"][] = "total out";
//	sales income arrears by Cheque
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 15;
	$fdata["strName"] = "sales income arrears by Cheque";
	$fdata["GoodName"] = "sales_income_arrears_by_Cheque";
	$fdata["ownerTable"] = "";
	$fdata["Label"] = GetFieldLabel("daily_reportS","sales_income_arrears_by_Cheque");
	$fdata["FieldType"] = 14;

	
	
	
			

		$fdata["strField"] = "sales income arrears by Cheque";

	
		$fdata["isSQLExpression"] = true;
	$fdata["FullName"] = "IFNULL(pur41.st41, 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


	$tdatadaily_reports["sales income arrears by Cheque"] = $fdata;
		$tdatadaily_reports[".searchableFields"][] = "sales income arrears by Cheque";
//	sale income arrears by Cash
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 16;
	$fdata["strName"] = "sale income arrears by Cash";
	$fdata["GoodName"] = "sale_income_arrears_by_Cash";
	$fdata["ownerTable"] = "";
	$fdata["Label"] = GetFieldLabel("daily_reportS","sale_income_arrears_by_Cash");
	$fdata["FieldType"] = 14;

	
	
	
			

		$fdata["strField"] = "sale income arrears by Cash";

	
		$fdata["isSQLExpression"] = true;
	$fdata["FullName"] = "IFNULL(pur42.st42, 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


	$tdatadaily_reports["sale income arrears by Cash"] = $fdata;
		$tdatadaily_reports[".searchableFields"][] = "sale income arrears by Cash";
//	sales income by Cheque
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 17;
	$fdata["strName"] = "sales income by Cheque";
	$fdata["GoodName"] = "sales_income_by_Cheque";
	$fdata["ownerTable"] = "";
	$fdata["Label"] = GetFieldLabel("daily_reportS","sales_income_by_Cheque");
	$fdata["FieldType"] = 14;

	
	
	
			

		$fdata["strField"] = "sales income by Cheque";

	
		$fdata["isSQLExpression"] = true;
	$fdata["FullName"] = "IFNULL(pur43.st43, 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


	$tdatadaily_reports["sales income by Cheque"] = $fdata;
		$tdatadaily_reports[".searchableFields"][] = "sales income by Cheque";
//	sale income by Cash
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 18;
	$fdata["strName"] = "sale income by Cash";
	$fdata["GoodName"] = "sale_income_by_Cash";
	$fdata["ownerTable"] = "";
	$fdata["Label"] = GetFieldLabel("daily_reportS","sale_income_by_Cash");
	$fdata["FieldType"] = 14;

	
	
	
			

		$fdata["strField"] = "sale income by Cash";

	
		$fdata["isSQLExpression"] = true;
	$fdata["FullName"] = "IFNULL(pur44.st44, 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


	$tdatadaily_reports["sale income by Cash"] = $fdata;
		$tdatadaily_reports[".searchableFields"][] = "sale income by Cash";
//	Opaning balance
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 19;
	$fdata["strName"] = "Opaning balance";
	$fdata["GoodName"] = "Opaning_balance";
	$fdata["ownerTable"] = "";
	$fdata["Label"] = GetFieldLabel("daily_reportS","Opaning_balance");
	$fdata["FieldType"] = 14;

	
	
	
			

		$fdata["strField"] = "Opaning balance";

	
		$fdata["isSQLExpression"] = true;
	$fdata["FullName"] = "IFNULL(pur45.st45, 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


	$tdatadaily_reports["Opaning balance"] = $fdata;
		$tdatadaily_reports[".searchableFields"][] = "Opaning balance";
//	total Cash in
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 20;
	$fdata["strName"] = "total Cash in";
	$fdata["GoodName"] = "total_Cash_in";
	$fdata["ownerTable"] = "";
	$fdata["Label"] = GetFieldLabel("daily_reportS","total_Cash_in");
	$fdata["FieldType"] = 14;

	
	
	
			

		$fdata["strField"] = "total Cash in";

	
		$fdata["isSQLExpression"] = true;
	$fdata["FullName"] = "IFNULL(pur42.st42, 0) + IFNULL(pur44.st44, 0) + IFNULL(pur45.st45, 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


	$tdatadaily_reports["total Cash in"] = $fdata;
		$tdatadaily_reports[".searchableFields"][] = "total Cash in";
//	total Cheque in
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 21;
	$fdata["strName"] = "total Cheque in";
	$fdata["GoodName"] = "total_Cheque_in";
	$fdata["ownerTable"] = "";
	$fdata["Label"] = GetFieldLabel("daily_reportS","total_Cheque_in");
	$fdata["FieldType"] = 14;

	
	
	
			

		$fdata["strField"] = "total Cheque in";

	
		$fdata["isSQLExpression"] = true;
	$fdata["FullName"] = "IFNULL(pur41.st41, 0) + IFNULL(pur43.st43, 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


	$tdatadaily_reports["total Cheque in"] = $fdata;
		$tdatadaily_reports[".searchableFields"][] = "total Cheque in";
//	total in
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 22;
	$fdata["strName"] = "total in";
	$fdata["GoodName"] = "total_in";
	$fdata["ownerTable"] = "";
	$fdata["Label"] = GetFieldLabel("daily_reportS","total_in");
	$fdata["FieldType"] = 14;

	
	
	
			

		$fdata["strField"] = "total in";

	
		$fdata["isSQLExpression"] = true;
	$fdata["FullName"] = "IFNULL(pur42.st42, 0) + IFNULL(pur44.st44, 0) + IFNULL(pur45.st45, 0) + IFNULL(pur41.st41, 0) + IFNULL(pur43.st43, 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


	$tdatadaily_reports["total in"] = $fdata;
		$tdatadaily_reports[".searchableFields"][] = "total in";
//	cash balance
//	Custom field settings
	$fdata = array();
	$fdata["Index"] = 23;
	$fdata["strName"] = "cash balance";
	$fdata["GoodName"] = "cash_balance";
	$fdata["ownerTable"] = "";
	$fdata["Label"] = GetFieldLabel("daily_reportS","cash_balance");
	$fdata["FieldType"] = 14;

	
	
	
			

		$fdata["strField"] = "cash balance";

	
		$fdata["isSQLExpression"] = true;
	$fdata["FullName"] = "(IFNULL(pur42.st42, 0) + IFNULL(pur44.st44, 0) + IFNULL(pur45.st45, 0)) - (IFNULL(pur34.st34, 0) + IFNULL(pur35.st35, 0) + IFNULL(pur40.st40, 0) + IFNULL(pur38.st38, 0) + IFNULL(pur39.st39, 0) + IFNULL(pur49.st49, 0) + IFNULL(pur50.st50, 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


	$tdatadaily_reports["cash balance"] = $fdata;
		$tdatadaily_reports[".searchableFields"][] = "cash balance";


$tables_data["daily_reportS"]=&$tdatadaily_reports;
$field_labels["daily_reportS"] = &$fieldLabelsdaily_reports;
$fieldToolTips["daily_reportS"] = &$fieldToolTipsdaily_reports;
$placeHolders["daily_reportS"] = &$placeHoldersdaily_reports;
$page_titles["daily_reportS"] = &$pageTitlesdaily_reports;

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

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



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



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











function createSqlQuery_daily_reports()
{
$proto0=array();
$proto0["m_strHead"] = "SELECT";
$proto0["m_strFieldList"] = "id,DATE(`date`) AS \"Date\",  IFNULL(pur34.st34, 0) AS \"purchasing cash payment  for arrears\",  IFNULL(pur35.st35, 0) AS \"purchasing cash payment\",  IFNULL(pur36.st36, 0) AS \"purchasing Cheque payment\",  IFNULL(pur37.st37, 0) AS \"purchasing Cheque payment for arrears\",  IFNULL(pur40.st40, 0) AS \"Cash payment for expenses\" ,  IFNULL(pur38.st38, 0) AS \"Salary advance\",  IFNULL(pur39.st39, 0) AS \"salary\",  IFNULL(pur49.st49, 0) AS \"Bank Diposit\",  IFNULL(pur50.st50, 0) AS \"Loan\",  IFNULL(pur34.st34, 0) + IFNULL(pur35.st35, 0) + IFNULL(pur40.st40, 0) + IFNULL(pur38.st38, 0) + IFNULL(pur39.st39, 0)+IFNULL(pur49.st49, 0)+ IFNULL(pur50.st50, 0) as \"total cash out\",  IFNULL(pur36.st36, 0) + IFNULL(pur37.st37, 0) as \"total cheque amount\",  IFNULL(pur34.st34, 0) + IFNULL(pur35.st35, 0) + IFNULL(pur40.st40, 0) + IFNULL(pur38.st38, 0) + IFNULL(pur39.st39, 0) +  IFNULL(pur36.st36, 0) + IFNULL(pur37.st37, 0)+ IFNULL(pur49.st49, 0)+ IFNULL(pur50.st50, 0) as \"total out\",  IFNULL(pur41.st41, 0) AS \"sales income arrears by Cheque\",  IFNULL(pur42.st42, 0) AS \"sale income arrears by Cash\",  IFNULL(pur43.st43, 0) AS \"sales income by Cheque\",  IFNULL(pur44.st44, 0) AS \"sale income by Cash\",  IFNULL(pur45.st45, 0) AS \"Opaning balance\",  IFNULL(pur42.st42, 0) + IFNULL(pur44.st44, 0) + IFNULL(pur45.st45, 0) as \"total Cash in\",  IFNULL(pur41.st41, 0) + IFNULL(pur43.st43, 0) as \"total Cheque in\",  IFNULL(pur42.st42, 0) + IFNULL(pur44.st44, 0) + IFNULL(pur45.st45, 0) + IFNULL(pur41.st41, 0) + IFNULL(pur43.st43, 0) as \"total in\",  (IFNULL(pur42.st42, 0) + IFNULL(pur44.st44, 0) + IFNULL(pur45.st45, 0)) - (IFNULL(pur34.st34, 0) + IFNULL(pur35.st35, 0) + IFNULL(pur40.st40, 0) + IFNULL(pur38.st38, 0) + IFNULL(pur39.st39, 0) + IFNULL(pur49.st49, 0) + IFNULL(pur50.st50, 0)) as \"cash balance\"";
$proto0["m_strFrom"] = "FROM daily_report  LEFT JOIN ( SELECT DATE(`date_time`) AS KKK , SUM(`amount`) AS st49 FROM `payment_for_pur` WHERE `payment_type` = \"Cash\" AND  ( `details` = \"Deposit\") GROUP BY DATE(`date_time`)) AS pur49 ON daily_report.DATE = pur49.KKK  LEFT JOIN ( SELECT DATE(`date_time`) AS KKK , SUM(`amount`) AS st50 FROM `payment_for_pur` WHERE `payment_type` = \"Cash\" AND  ( `details` = \"Loan\") GROUP BY DATE(`date_time`)) AS pur50 ON daily_report.DATE = pur50.KKK      LEFT JOIN ( SELECT DATE(`date_time`) AS KKK , SUM(`amount`) AS st34 FROM `payment_for_pur` WHERE `payment_type` = \"Cash\" AND  (`details` = \"purchasing arrears\" ) GROUP BY DATE(`date_time`)) AS pur34 ON daily_report.DATE = pur34.KKK  LEFT JOIN ( SELECT DATE(`date_time`) AS KKK , SUM(`amount`) AS st35 FROM `payment_for_pur` WHERE `payment_type` = \"Cash\" AND  ( `details` = \"purchasing\") GROUP BY DATE(`date_time`)) AS pur35 ON daily_report.DATE = pur35.KKK  LEFT JOIN ( SELECT DATE(`date_time`) AS KKK , SUM(`amount`) AS st36 FROM `payment_for_pur` WHERE `payment_type` = \"Cheque\" AND  ( `details` = \"purchasing\") GROUP BY DATE(`date_time`)) AS pur36 ON daily_report.DATE = pur36.KKK  LEFT JOIN ( SELECT DATE(`date_time`) AS KKK , SUM(`amount`) AS st37 FROM `payment_for_pur` WHERE `payment_type` = \"Cheque\" AND  (`details` = \"purchasing arrears\" ) GROUP BY DATE(`date_time`)) AS pur37 ON daily_report.DATE = pur37.KKK  LEFT JOIN ( SELECT DATE(`date_time`) AS KKK , SUM(`amount`) AS st40 FROM `payment_for_pur` WHERE `payment_type` = \"Cash\" AND  ( `details` = \"Expen\") GROUP BY DATE(`date_time`)) AS pur40 ON daily_report.DATE = pur40.KKK  LEFT JOIN ( SELECT DATE(`date_time`) AS KKK , SUM(`amount`) AS st38 FROM `payment_for_pur` WHERE `payment_type` = \"Cash\" AND  ( `details` = \"salary advance\") GROUP BY DATE(`date_time`)) AS pur38 ON daily_report.DATE = pur38.KKK  LEFT JOIN ( SELECT DATE(`date_time`) AS KKK , SUM(`amount`) AS st39 FROM `payment_for_pur` WHERE `payment_type` = \"Cash\" AND  ( `details` = \"salary\") GROUP BY DATE(`date_time`)) AS pur39 ON daily_report.DATE = pur39.KKK    LEFT JOIN ( SELECT DATE(`date_time`) AS KK2 , SUM(`amount`) AS st41 FROM `payments` WHERE `status`=\"sales arrears\" and type=\"Cheque\" GROUP BY DATE(`date_time`)) AS pur41 ON daily_report.DATE = pur41.KK2  LEFT JOIN ( SELECT DATE(`date_time`) AS KK2 , SUM(`amount`) AS st42 FROM `payments` WHERE `status`=\"sales arrears\"and type=\"Cash\" GROUP BY DATE(`date_time`)) AS pur42 ON daily_report.DATE = pur42.KK2  LEFT JOIN ( SELECT DATE(`date_time`) AS KK2 , SUM(`amount`) AS st43 FROM `payments` WHERE `status`=\"sales\" and type=\"Cheque\" GROUP BY DATE(`date_time`)) AS pur43 ON daily_report.DATE = pur43.KK2  LEFT JOIN ( SELECT DATE(`date_time`) AS KK2 , SUM(`amount`) AS st44 FROM `payments` WHERE `status`=\"sales\"and type=\"Cash\" GROUP BY DATE(`date_time`)) AS pur44 ON daily_report.DATE = pur44.KK2  LEFT JOIN ( SELECT DATE(`date_time`) AS KK2 , SUM(`amount`) AS st45 FROM `payments` WHERE `status`=\"opening balance\"and type=\"Cash\" GROUP BY DATE(`date_time`)) AS pur45 ON daily_report.DATE = pur45.KK2";
$proto0["m_strWhere"] = "";
$proto0["m_strOrderBy"] = "ORDER BY  id DESC";
	
		;
			$proto0["cipherer"] = null;
$proto2=array();
$proto2["m_sql"] = "";
$proto2["m_uniontype"] = "SQLL_UNKNOWN";
	$obj = new SQLNonParsed(array(
	"m_sql" => ""
));

$proto2["m_column"]=$obj;
$proto2["m_contained"] = array();
$proto2["m_strCase"] = "";
$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" => "id",
	"m_strTable" => "daily_report",
	"m_srcTableName" => "daily_reportS"
));

$proto6["m_sql"] = "id";
$proto6["m_srcTableName"] = "daily_reportS";
$proto6["m_expr"]=$obj;
$proto6["m_alias"] = "";
$obj = new SQLFieldListItem($proto6);

$proto0["m_fieldlist"][]=$obj;
						$proto8=array();
			$proto9=array();
$proto9["m_functiontype"] = "SQLF_CUSTOM";
$proto9["m_arguments"] = array();
						$obj = new SQLNonParsed(array(
	"m_sql" => "`date`"
));

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

$proto8["m_sql"] = "DATE(`date`)";
$proto8["m_srcTableName"] = "daily_reportS";
$proto8["m_expr"]=$obj;
$proto8["m_alias"] = "Date";
$obj = new SQLFieldListItem($proto8);

$proto0["m_fieldlist"][]=$obj;
						$proto11=array();
			$proto12=array();
$proto12["m_functiontype"] = "SQLF_CUSTOM";
$proto12["m_arguments"] = array();
						$obj = new SQLNonParsed(array(
	"m_sql" => "pur34.st34"
));

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

$proto12["m_arguments"][]=$obj;
$proto12["m_strFunctionName"] = "IFNULL";
$obj = new SQLFunctionCall($proto12);

$proto11["m_sql"] = "IFNULL(pur34.st34, 0)";
$proto11["m_srcTableName"] = "daily_reportS";
$proto11["m_expr"]=$obj;
$proto11["m_alias"] = "purchasing cash payment  for arrears";
$obj = new SQLFieldListItem($proto11);

$proto0["m_fieldlist"][]=$obj;
						$proto15=array();
			$proto16=array();
$proto16["m_functiontype"] = "SQLF_CUSTOM";
$proto16["m_arguments"] = array();
						$obj = new SQLNonParsed(array(
	"m_sql" => "pur35.st35"
));

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

$proto16["m_arguments"][]=$obj;
$proto16["m_strFunctionName"] = "IFNULL";
$obj = new SQLFunctionCall($proto16);

$proto15["m_sql"] = "IFNULL(pur35.st35, 0)";
$proto15["m_srcTableName"] = "daily_reportS";
$proto15["m_expr"]=$obj;
$proto15["m_alias"] = "purchasing cash payment";
$obj = new SQLFieldListItem($proto15);

$proto0["m_fieldlist"][]=$obj;
						$proto19=array();
			$proto20=array();
$proto20["m_functiontype"] = "SQLF_CUSTOM";
$proto20["m_arguments"] = array();
						$obj = new SQLNonParsed(array(
	"m_sql" => "pur36.st36"
));

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

$proto20["m_arguments"][]=$obj;
$proto20["m_strFunctionName"] = "IFNULL";
$obj = new SQLFunctionCall($proto20);

$proto19["m_sql"] = "IFNULL(pur36.st36, 0)";
$proto19["m_srcTableName"] = "daily_reportS";
$proto19["m_expr"]=$obj;
$proto19["m_alias"] = "purchasing Cheque payment";
$obj = new SQLFieldListItem($proto19);

$proto0["m_fieldlist"][]=$obj;
						$proto23=array();
			$proto24=array();
$proto24["m_functiontype"] = "SQLF_CUSTOM";
$proto24["m_arguments"] = array();
						$obj = new SQLNonParsed(array(
	"m_sql" => "pur37.st37"
));

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

$proto24["m_arguments"][]=$obj;
$proto24["m_strFunctionName"] = "IFNULL";
$obj = new SQLFunctionCall($proto24);

$proto23["m_sql"] = "IFNULL(pur37.st37, 0)";
$proto23["m_srcTableName"] = "daily_reportS";
$proto23["m_expr"]=$obj;
$proto23["m_alias"] = "purchasing Cheque payment for arrears";
$obj = new SQLFieldListItem($proto23);

$proto0["m_fieldlist"][]=$obj;
						$proto27=array();
			$proto28=array();
$proto28["m_functiontype"] = "SQLF_CUSTOM";
$proto28["m_arguments"] = array();
						$obj = new SQLNonParsed(array(
	"m_sql" => "pur40.st40"
));

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

$proto28["m_arguments"][]=$obj;
$proto28["m_strFunctionName"] = "IFNULL";
$obj = new SQLFunctionCall($proto28);

$proto27["m_sql"] = "IFNULL(pur40.st40, 0)";
$proto27["m_srcTableName"] = "daily_reportS";
$proto27["m_expr"]=$obj;
$proto27["m_alias"] = "Cash payment for expenses";
$obj = new SQLFieldListItem($proto27);

$proto0["m_fieldlist"][]=$obj;
						$proto31=array();
			$proto32=array();
$proto32["m_functiontype"] = "SQLF_CUSTOM";
$proto32["m_arguments"] = array();
						$obj = new SQLNonParsed(array(
	"m_sql" => "pur38.st38"
));

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

$proto32["m_arguments"][]=$obj;
$proto32["m_strFunctionName"] = "IFNULL";
$obj = new SQLFunctionCall($proto32);

$proto31["m_sql"] = "IFNULL(pur38.st38, 0)";
$proto31["m_srcTableName"] = "daily_reportS";
$proto31["m_expr"]=$obj;
$proto31["m_alias"] = "Salary advance";
$obj = new SQLFieldListItem($proto31);

$proto0["m_fieldlist"][]=$obj;
						$proto35=array();
			$proto36=array();
$proto36["m_functiontype"] = "SQLF_CUSTOM";
$proto36["m_arguments"] = array();
						$obj = new SQLNonParsed(array(
	"m_sql" => "pur39.st39"
));

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

$proto36["m_arguments"][]=$obj;
$proto36["m_strFunctionName"] = "IFNULL";
$obj = new SQLFunctionCall($proto36);

$proto35["m_sql"] = "IFNULL(pur39.st39, 0)";
$proto35["m_srcTableName"] = "daily_reportS";
$proto35["m_expr"]=$obj;
$proto35["m_alias"] = "salary";
$obj = new SQLFieldListItem($proto35);

$proto0["m_fieldlist"][]=$obj;
						$proto39=array();
			$proto40=array();
$proto40["m_functiontype"] = "SQLF_CUSTOM";
$proto40["m_arguments"] = array();
						$obj = new SQLNonParsed(array(
	"m_sql" => "pur49.st49"
));

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

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

$proto39["m_sql"] = "IFNULL(pur49.st49, 0)";
$proto39["m_srcTableName"] = "daily_reportS";
$proto39["m_expr"]=$obj;
$proto39["m_alias"] = "Bank Diposit";
$obj = new SQLFieldListItem($proto39);

$proto0["m_fieldlist"][]=$obj;
						$proto43=array();
			$proto44=array();
$proto44["m_functiontype"] = "SQLF_CUSTOM";
$proto44["m_arguments"] = array();
						$obj = new SQLNonParsed(array(
	"m_sql" => "pur50.st50"
));

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

$proto44["m_arguments"][]=$obj;
$proto44["m_strFunctionName"] = "IFNULL";
$obj = new SQLFunctionCall($proto44);

$proto43["m_sql"] = "IFNULL(pur50.st50, 0)";
$proto43["m_srcTableName"] = "daily_reportS";
$proto43["m_expr"]=$obj;
$proto43["m_alias"] = "Loan";
$obj = new SQLFieldListItem($proto43);

$proto0["m_fieldlist"][]=$obj;
						$proto47=array();
			$obj = new SQLNonParsed(array(
	"m_sql" => "IFNULL(pur34.st34, 0) + IFNULL(pur35.st35, 0) + IFNULL(pur40.st40, 0) + IFNULL(pur38.st38, 0) + IFNULL(pur39.st39, 0)+IFNULL(pur49.st49, 0)+ IFNULL(pur50.st50, 0)"
));

$proto47["m_sql"] = "IFNULL(pur34.st34, 0) + IFNULL(pur35.st35, 0) + IFNULL(pur40.st40, 0) + IFNULL(pur38.st38, 0) + IFNULL(pur39.st39, 0)+IFNULL(pur49.st49, 0)+ IFNULL(pur50.st50, 0)";
$proto47["m_srcTableName"] = "daily_reportS";
$proto47["m_expr"]=$obj;
$proto47["m_alias"] = "total cash out";
$obj = new SQLFieldListItem($proto47);

$proto0["m_fieldlist"][]=$obj;
						$proto49=array();
			$obj = new SQLNonParsed(array(
	"m_sql" => "IFNULL(pur36.st36, 0) + IFNULL(pur37.st37, 0)"
));

$proto49["m_sql"] = "IFNULL(pur36.st36, 0) + IFNULL(pur37.st37, 0)";
$proto49["m_srcTableName"] = "daily_reportS";
$proto49["m_expr"]=$obj;
$proto49["m_alias"] = "total cheque amount";
$obj = new SQLFieldListItem($proto49);

$proto0["m_fieldlist"][]=$obj;
						$proto51=array();
			$obj = new SQLNonParsed(array(
	"m_sql" => "IFNULL(pur34.st34, 0) + IFNULL(pur35.st35, 0) + IFNULL(pur40.st40, 0) + IFNULL(pur38.st38, 0) + IFNULL(pur39.st39, 0) +  IFNULL(pur36.st36, 0) + IFNULL(pur37.st37, 0)+ IFNULL(pur49.st49, 0)+ IFNULL(pur50.st50, 0)"
));

$proto51["m_sql"] = "IFNULL(pur34.st34, 0) + IFNULL(pur35.st35, 0) + IFNULL(pur40.st40, 0) + IFNULL(pur38.st38, 0) + IFNULL(pur39.st39, 0) +  IFNULL(pur36.st36, 0) + IFNULL(pur37.st37, 0)+ IFNULL(pur49.st49, 0)+ IFNULL(pur50.st50, 0)";
$proto51["m_srcTableName"] = "daily_reportS";
$proto51["m_expr"]=$obj;
$proto51["m_alias"] = "total out";
$obj = new SQLFieldListItem($proto51);

$proto0["m_fieldlist"][]=$obj;
						$proto53=array();
			$proto54=array();
$proto54["m_functiontype"] = "SQLF_CUSTOM";
$proto54["m_arguments"] = array();
						$obj = new SQLNonParsed(array(
	"m_sql" => "pur41.st41"
));

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

$proto54["m_arguments"][]=$obj;
$proto54["m_strFunctionName"] = "IFNULL";
$obj = new SQLFunctionCall($proto54);

$proto53["m_sql"] = "IFNULL(pur41.st41, 0)";
$proto53["m_srcTableName"] = "daily_reportS";
$proto53["m_expr"]=$obj;
$proto53["m_alias"] = "sales income arrears by Cheque";
$obj = new SQLFieldListItem($proto53);

$proto0["m_fieldlist"][]=$obj;
						$proto57=array();
			$proto58=array();
$proto58["m_functiontype"] = "SQLF_CUSTOM";
$proto58["m_arguments"] = array();
						$obj = new SQLNonParsed(array(
	"m_sql" => "pur42.st42"
));

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

$proto58["m_arguments"][]=$obj;
$proto58["m_strFunctionName"] = "IFNULL";
$obj = new SQLFunctionCall($proto58);

$proto57["m_sql"] = "IFNULL(pur42.st42, 0)";
$proto57["m_srcTableName"] = "daily_reportS";
$proto57["m_expr"]=$obj;
$proto57["m_alias"] = "sale income arrears by Cash";
$obj = new SQLFieldListItem($proto57);

$proto0["m_fieldlist"][]=$obj;
						$proto61=array();
			$proto62=array();
$proto62["m_functiontype"] = "SQLF_CUSTOM";
$proto62["m_arguments"] = array();
						$obj = new SQLNonParsed(array(
	"m_sql" => "pur43.st43"
));

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

$proto62["m_arguments"][]=$obj;
$proto62["m_strFunctionName"] = "IFNULL";
$obj = new SQLFunctionCall($proto62);

$proto61["m_sql"] = "IFNULL(pur43.st43, 0)";
$proto61["m_srcTableName"] = "daily_reportS";
$proto61["m_expr"]=$obj;
$proto61["m_alias"] = "sales income by Cheque";
$obj = new SQLFieldListItem($proto61);

$proto0["m_fieldlist"][]=$obj;
						$proto65=array();
			$proto66=array();
$proto66["m_functiontype"] = "SQLF_CUSTOM";
$proto66["m_arguments"] = array();
						$obj = new SQLNonParsed(array(
	"m_sql" => "pur44.st44"
));

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

$proto66["m_arguments"][]=$obj;
$proto66["m_strFunctionName"] = "IFNULL";
$obj = new SQLFunctionCall($proto66);

$proto65["m_sql"] = "IFNULL(pur44.st44, 0)";
$proto65["m_srcTableName"] = "daily_reportS";
$proto65["m_expr"]=$obj;
$proto65["m_alias"] = "sale income by Cash";
$obj = new SQLFieldListItem($proto65);

$proto0["m_fieldlist"][]=$obj;
						$proto69=array();
			$proto70=array();
$proto70["m_functiontype"] = "SQLF_CUSTOM";
$proto70["m_arguments"] = array();
						$obj = new SQLNonParsed(array(
	"m_sql" => "pur45.st45"
));

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

$proto70["m_arguments"][]=$obj;
$proto70["m_strFunctionName"] = "IFNULL";
$obj = new SQLFunctionCall($proto70);

$proto69["m_sql"] = "IFNULL(pur45.st45, 0)";
$proto69["m_srcTableName"] = "daily_reportS";
$proto69["m_expr"]=$obj;
$proto69["m_alias"] = "Opaning balance";
$obj = new SQLFieldListItem($proto69);

$proto0["m_fieldlist"][]=$obj;
						$proto73=array();
			$obj = new SQLNonParsed(array(
	"m_sql" => "IFNULL(pur42.st42, 0) + IFNULL(pur44.st44, 0) + IFNULL(pur45.st45, 0)"
));

$proto73["m_sql"] = "IFNULL(pur42.st42, 0) + IFNULL(pur44.st44, 0) + IFNULL(pur45.st45, 0)";
$proto73["m_srcTableName"] = "daily_reportS";
$proto73["m_expr"]=$obj;
$proto73["m_alias"] = "total Cash in";
$obj = new SQLFieldListItem($proto73);

$proto0["m_fieldlist"][]=$obj;
						$proto75=array();
			$obj = new SQLNonParsed(array(
	"m_sql" => "IFNULL(pur41.st41, 0) + IFNULL(pur43.st43, 0)"
));

$proto75["m_sql"] = "IFNULL(pur41.st41, 0) + IFNULL(pur43.st43, 0)";
$proto75["m_srcTableName"] = "daily_reportS";
$proto75["m_expr"]=$obj;
$proto75["m_alias"] = "total Cheque in";
$obj = new SQLFieldListItem($proto75);

$proto0["m_fieldlist"][]=$obj;
						$proto77=array();
			$obj = new SQLNonParsed(array(
	"m_sql" => "IFNULL(pur42.st42, 0) + IFNULL(pur44.st44, 0) + IFNULL(pur45.st45, 0) + IFNULL(pur41.st41, 0) + IFNULL(pur43.st43, 0)"
));

$proto77["m_sql"] = "IFNULL(pur42.st42, 0) + IFNULL(pur44.st44, 0) + IFNULL(pur45.st45, 0) + IFNULL(pur41.st41, 0) + IFNULL(pur43.st43, 0)";
$proto77["m_srcTableName"] = "daily_reportS";
$proto77["m_expr"]=$obj;
$proto77["m_alias"] = "total in";
$obj = new SQLFieldListItem($proto77);

$proto0["m_fieldlist"][]=$obj;
						$proto79=array();
			$obj = new SQLNonParsed(array(
	"m_sql" => "(IFNULL(pur42.st42, 0) + IFNULL(pur44.st44, 0) + IFNULL(pur45.st45, 0)) - (IFNULL(pur34.st34, 0) + IFNULL(pur35.st35, 0) + IFNULL(pur40.st40, 0) + IFNULL(pur38.st38, 0) + IFNULL(pur39.st39, 0) + IFNULL(pur49.st49, 0) + IFNULL(pur50.st50, 0))"
));

$proto79["m_sql"] = "(IFNULL(pur42.st42, 0) + IFNULL(pur44.st44, 0) + IFNULL(pur45.st45, 0)) - (IFNULL(pur34.st34, 0) + IFNULL(pur35.st35, 0) + IFNULL(pur40.st40, 0) + IFNULL(pur38.st38, 0) + IFNULL(pur39.st39, 0) + IFNULL(pur49.st49, 0) + IFNULL(pur50.st50, 0))";
$proto79["m_srcTableName"] = "daily_reportS";
$proto79["m_expr"]=$obj;
$proto79["m_alias"] = "cash balance";
$obj = new SQLFieldListItem($proto79);

$proto0["m_fieldlist"][]=$obj;
$proto0["m_fromlist"] = array();
												$proto81=array();
$proto81["m_link"] = "SQLL_MAIN";
			$proto82=array();
$proto82["m_strName"] = "daily_report";
$proto82["m_srcTableName"] = "daily_reportS";
$proto82["m_columns"] = array();
$proto82["m_columns"][] = "id";
$proto82["m_columns"][] = "date";
$obj = new SQLTable($proto82);

$proto81["m_table"] = $obj;
$proto81["m_sql"] = "daily_report";
$proto81["m_alias"] = "";
$proto81["m_srcTableName"] = "daily_reportS";
$proto83=array();
$proto83["m_sql"] = "";
$proto83["m_uniontype"] = "SQLL_UNKNOWN";
	$obj = new SQLNonParsed(array(
	"m_sql" => ""
));

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

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

$proto0["m_fromlist"][]=$obj;
												$proto85=array();
$proto85["m_link"] = "SQLL_LEFTJOIN";
			$proto86=array();
$proto86["m_strHead"] = " SELECT";
$proto86["m_strFieldList"] = "DATE(`date_time`) AS KKK , SUM(`amount`) AS st49";
$proto86["m_strFrom"] = "FROM `payment_for_pur`";
$proto86["m_strWhere"] = "`payment_type` = \"Cash\" AND  ( `details` = \"Deposit\")";
$proto86["m_strOrderBy"] = "";
	
		;
			$proto86["cipherer"] = null;
$proto88=array();
$proto88["m_sql"] = "`payment_type` = \"Cash\" AND  ( `details` = \"Deposit\")";
$proto88["m_uniontype"] = "SQLL_AND";
	$obj = new SQLNonParsed(array(
	"m_sql" => "`payment_type` = \"Cash\" AND  ( `details` = \"Deposit\")"
));

$proto88["m_column"]=$obj;
$proto88["m_contained"] = array();
						$proto90=array();
$proto90["m_sql"] = "`payment_type` = \"Cash\"";
$proto90["m_uniontype"] = "SQLL_UNKNOWN";
						$obj = new SQLField(array(
	"m_strName" => "payment_type",
	"m_strTable" => "payment_for_pur",
	"m_srcTableName" => "daily_reportS"
));

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

			$proto88["m_contained"][]=$obj;
						$proto92=array();
$proto92["m_sql"] = " `details` = \"Deposit\"";
$proto92["m_uniontype"] = "SQLL_UNKNOWN";
						$obj = new SQLField(array(
	"m_strName" => "details",
	"m_strTable" => "payment_for_pur",
	"m_srcTableName" => "daily_reportS"
));

$proto92["m_column"]=$obj;
$proto92["m_contained"] = array();
$proto92["m_strCase"] = "= \"Deposit\"";
$proto92["m_havingmode"] = false;
$proto92["m_inBrackets"] = true;
$proto92["m_useAlias"] = false;
$obj = new SQLLogicalExpr($proto92);

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

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

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

$proto86["m_having"] = $obj;
$proto86["m_fieldlist"] = array();
						$proto96=array();
			$proto97=array();
$proto97["m_functiontype"] = "SQLF_CUSTOM";
$proto97["m_arguments"] = array();
						$obj = new SQLNonParsed(array(
	"m_sql" => "`date_time`"
));

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

$proto96["m_sql"] = "DATE(`date_time`)";
$proto96["m_srcTableName"] = "daily_reportS";
$proto96["m_expr"]=$obj;
$proto96["m_alias"] = "KKK";
$obj = new SQLFieldListItem($proto96);

$proto86["m_fieldlist"][]=$obj;
						$proto99=array();
			$proto100=array();
$proto100["m_functiontype"] = "SQLF_SUM";
$proto100["m_arguments"] = array();
						$obj = new SQLField(array(
	"m_strName" => "amount",
	"m_strTable" => "payment_for_pur",
	"m_srcTableName" => "daily_reportS"
));

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

$proto99["m_sql"] = "SUM(`amount`)";
$proto99["m_srcTableName"] = "daily_reportS";
$proto99["m_expr"]=$obj;
$proto99["m_alias"] = "st49";
$obj = new SQLFieldListItem($proto99);

$proto86["m_fieldlist"][]=$obj;
$proto86["m_fromlist"] = array();
												$proto102=array();
$proto102["m_link"] = "SQLL_MAIN";
			$proto103=array();
$proto103["m_strName"] = "payment_for_pur";
$proto103["m_srcTableName"] = "daily_reportS";
$proto103["m_columns"] = array();
$proto103["m_columns"][] = "id";
$proto103["m_columns"][] = "pur_id";
$proto103["m_columns"][] = "amount";
$proto103["m_columns"][] = "payment_type";
$proto103["m_columns"][] = "cheque_number";
$proto103["m_columns"][] = "cheque_date";
$proto103["m_columns"][] = "date_time";
$proto103["m_columns"][] = "outlet_code";
$proto103["m_columns"][] = "branch_code";
$proto103["m_columns"][] = "user";
$proto103["m_columns"][] = "details";
$proto103["m_columns"][] = "should_pay";
$proto103["m_columns"][] = "expen_code";
$proto103["m_columns"][] = "salary_advance";
$proto103["m_columns"][] = "salary";
$proto103["m_columns"][] = "acc_no";
$proto103["m_columns"][] = "loan_no";
$obj = new SQLTable($proto103);

$proto102["m_table"] = $obj;
$proto102["m_sql"] = "`payment_for_pur`";
$proto102["m_alias"] = "";
$proto102["m_srcTableName"] = "daily_reportS";
$proto104=array();
$proto104["m_sql"] = "";
$proto104["m_uniontype"] = "SQLL_UNKNOWN";
	$obj = new SQLNonParsed(array(
	"m_sql" => ""
));

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

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

$proto86["m_fromlist"][]=$obj;
$proto86["m_groupby"] = array();
												$proto106=array();
						$proto107=array();
$proto107["m_functiontype"] = "SQLF_CUSTOM";
$proto107["m_arguments"] = array();
						$obj = new SQLNonParsed(array(
	"m_sql" => "`date_time`"
));

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

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

$proto86["m_groupby"][]=$obj;
$proto86["m_orderby"] = array();
$proto86["m_srcTableName"]="daily_reportS";		
$obj = new SQLQuery($proto86);

$proto85["m_table"] = $obj;
$proto85["m_sql"] = "LEFT JOIN ( SELECT DATE(`date_time`) AS KKK , SUM(`amount`) AS st49 FROM `payment_for_pur` WHERE `payment_type` = \"Cash\" AND  ( `details` = \"Deposit\") GROUP BY DATE(`date_time`)) AS pur49 ON daily_report.DATE = pur49.KKK";
$proto85["m_alias"] = "pur49";
$proto85["m_srcTableName"] = "daily_reportS";
$proto109=array();
$proto109["m_sql"] = "daily_report.DATE = pur49.KKK";
$proto109["m_uniontype"] = "SQLL_UNKNOWN";
						$obj = new SQLField(array(
	"m_strName" => "date",
	"m_strTable" => "daily_report",
	"m_srcTableName" => "daily_reportS"
));

$proto109["m_column"]=$obj;
$proto109["m_contained"] = array();
$proto109["m_strCase"] = "= pur49.KKK";
$proto109["m_havingmode"] = false;
$proto109["m_inBrackets"] = false;
$proto109["m_useAlias"] = false;
$obj = new SQLLogicalExpr($proto109);

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

$proto0["m_fromlist"][]=$obj;
												$proto111=array();
$proto111["m_link"] = "SQLL_LEFTJOIN";
			$proto112=array();
$proto112["m_strHead"] = " SELECT";
$proto112["m_strFieldList"] = "DATE(`date_time`) AS KKK , SUM(`amount`) AS st50";
$proto112["m_strFrom"] = "FROM `payment_for_pur`";
$proto112["m_strWhere"] = "`payment_type` = \"Cash\" AND  ( `details` = \"Loan\")";
$proto112["m_strOrderBy"] = "";
	
		;
			$proto112["cipherer"] = null;
$proto114=array();
$proto114["m_sql"] = "`payment_type` = \"Cash\" AND  ( `details` = \"Loan\")";
$proto114["m_uniontype"] = "SQLL_AND";
	$obj = new SQLNonParsed(array(
	"m_sql" => "`payment_type` = \"Cash\" AND  ( `details` = \"Loan\")"
));

$proto114["m_column"]=$obj;
$proto114["m_contained"] = array();
						$proto116=array();
$proto116["m_sql"] = "`payment_type` = \"Cash\"";
$proto116["m_uniontype"] = "SQLL_UNKNOWN";
						$obj = new SQLField(array(
	"m_strName" => "payment_type",
	"m_strTable" => "payment_for_pur",
	"m_srcTableName" => "daily_reportS"
));

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

			$proto114["m_contained"][]=$obj;
						$proto118=array();
$proto118["m_sql"] = " `details` = \"Loan\"";
$proto118["m_uniontype"] = "SQLL_UNKNOWN";
						$obj = new SQLField(array(
	"m_strName" => "details",
	"m_strTable" => "payment_for_pur",
	"m_srcTableName" => "daily_reportS"
));

$proto118["m_column"]=$obj;
$proto118["m_contained"] = array();
$proto118["m_strCase"] = "= \"Loan\"";
$proto118["m_havingmode"] = false;
$proto118["m_inBrackets"] = true;
$proto118["m_useAlias"] = false;
$obj = new SQLLogicalExpr($proto118);

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

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

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

$proto112["m_having"] = $obj;
$proto112["m_fieldlist"] = array();
						$proto122=array();
			$proto123=array();
$proto123["m_functiontype"] = "SQLF_CUSTOM";
$proto123["m_arguments"] = array();
						$obj = new SQLNonParsed(array(
	"m_sql" => "`date_time`"
));

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

$proto122["m_sql"] = "DATE(`date_time`)";
$proto122["m_srcTableName"] = "daily_reportS";
$proto122["m_expr"]=$obj;
$proto122["m_alias"] = "KKK";
$obj = new SQLFieldListItem($proto122);

$proto112["m_fieldlist"][]=$obj;
						$proto125=array();
			$proto126=array();
$proto126["m_functiontype"] = "SQLF_SUM";
$proto126["m_arguments"] = array();
						$obj = new SQLField(array(
	"m_strName" => "amount",
	"m_strTable" => "payment_for_pur",
	"m_srcTableName" => "daily_reportS"
));

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

$proto125["m_sql"] = "SUM(`amount`)";
$proto125["m_srcTableName"] = "daily_reportS";
$proto125["m_expr"]=$obj;
$proto125["m_alias"] = "st50";
$obj = new SQLFieldListItem($proto125);

$proto112["m_fieldlist"][]=$obj;
$proto112["m_fromlist"] = array();
												$proto128=array();
$proto128["m_link"] = "SQLL_MAIN";
			$proto129=array();
$proto129["m_strName"] = "payment_for_pur";
$proto129["m_srcTableName"] = "daily_reportS";
$proto129["m_columns"] = array();
$proto129["m_columns"][] = "id";
$proto129["m_columns"][] = "pur_id";
$proto129["m_columns"][] = "amount";
$proto129["m_columns"][] = "payment_type";
$proto129["m_columns"][] = "cheque_number";
$proto129["m_columns"][] = "cheque_date";
$proto129["m_columns"][] = "date_time";
$proto129["m_columns"][] = "outlet_code";
$proto129["m_columns"][] = "branch_code";
$proto129["m_columns"][] = "user";
$proto129["m_columns"][] = "details";
$proto129["m_columns"][] = "should_pay";
$proto129["m_columns"][] = "expen_code";
$proto129["m_columns"][] = "salary_advance";
$proto129["m_columns"][] = "salary";
$proto129["m_columns"][] = "acc_no";
$proto129["m_columns"][] = "loan_no";
$obj = new SQLTable($proto129);

$proto128["m_table"] = $obj;
$proto128["m_sql"] = "`payment_for_pur`";
$proto128["m_alias"] = "";
$proto128["m_srcTableName"] = "daily_reportS";
$proto130=array();
$proto130["m_sql"] = "";
$proto130["m_uniontype"] = "SQLL_UNKNOWN";
	$obj = new SQLNonParsed(array(
	"m_sql" => ""
));

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

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

$proto112["m_fromlist"][]=$obj;
$proto112["m_groupby"] = array();
												$proto132=array();
						$proto133=array();
$proto133["m_functiontype"] = "SQLF_CUSTOM";
$proto133["m_arguments"] = array();
						$obj = new SQLNonParsed(array(
	"m_sql" => "`date_time`"
));

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

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

$proto112["m_groupby"][]=$obj;
$proto112["m_orderby"] = array();
$proto112["m_srcTableName"]="daily_reportS";		
$obj = new SQLQuery($proto112);

$proto111["m_table"] = $obj;
$proto111["m_sql"] = "LEFT JOIN ( SELECT DATE(`date_time`) AS KKK , SUM(`amount`) AS st50 FROM `payment_for_pur` WHERE `payment_type` = \"Cash\" AND  ( `details` = \"Loan\") GROUP BY DATE(`date_time`)) AS pur50 ON daily_report.DATE = pur50.KKK";
$proto111["m_alias"] = "pur50";
$proto111["m_srcTableName"] = "daily_reportS";
$proto135=array();
$proto135["m_sql"] = "daily_report.DATE = pur50.KKK";
$proto135["m_uniontype"] = "SQLL_UNKNOWN";
						$obj = new SQLField(array(
	"m_strName" => "date",
	"m_strTable" => "daily_report",
	"m_srcTableName" => "daily_reportS"
));

$proto135["m_column"]=$obj;
$proto135["m_contained"] = array();
$proto135["m_strCase"] = "= pur50.KKK";
$proto135["m_havingmode"] = false;
$proto135["m_inBrackets"] = false;
$proto135["m_useAlias"] = false;
$obj = new SQLLogicalExpr($proto135);

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

$proto0["m_fromlist"][]=$obj;
												$proto137=array();
$proto137["m_link"] = "SQLL_LEFTJOIN";
			$proto138=array();
$proto138["m_strHead"] = " SELECT";
$proto138["m_strFieldList"] = "DATE(`date_time`) AS KKK , SUM(`amount`) AS st34";
$proto138["m_strFrom"] = "FROM `payment_for_pur`";
$proto138["m_strWhere"] = "`payment_type` = \"Cash\" AND  (`details` = \"purchasing arrears\" )";
$proto138["m_strOrderBy"] = "";
	
		;
			$proto138["cipherer"] = null;
$proto140=array();
$proto140["m_sql"] = "`payment_type` = \"Cash\" AND  (`details` = \"purchasing arrears\" )";
$proto140["m_uniontype"] = "SQLL_AND";
	$obj = new SQLNonParsed(array(
	"m_sql" => "`payment_type` = \"Cash\" AND  (`details` = \"purchasing arrears\" )"
));

$proto140["m_column"]=$obj;
$proto140["m_contained"] = array();
						$proto142=array();
$proto142["m_sql"] = "`payment_type` = \"Cash\"";
$proto142["m_uniontype"] = "SQLL_UNKNOWN";
						$obj = new SQLField(array(
	"m_strName" => "payment_type",
	"m_strTable" => "payment_for_pur",
	"m_srcTableName" => "daily_reportS"
));

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

			$proto140["m_contained"][]=$obj;
						$proto144=array();
$proto144["m_sql"] = "`details` = \"purchasing arrears\" ";
$proto144["m_uniontype"] = "SQLL_UNKNOWN";
						$obj = new SQLField(array(
	"m_strName" => "details",
	"m_strTable" => "payment_for_pur",
	"m_srcTableName" => "daily_reportS"
));

$proto144["m_column"]=$obj;
$proto144["m_contained"] = array();
$proto144["m_strCase"] = "= \"purchasing arrears\"";
$proto144["m_havingmode"] = false;
$proto144["m_inBrackets"] = true;
$proto144["m_useAlias"] = false;
$obj = new SQLLogicalExpr($proto144);

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

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

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

$proto138["m_having"] = $obj;
$proto138["m_fieldlist"] = array();
						$proto148=array();
			$proto149=array();
$proto149["m_functiontype"] = "SQLF_CUSTOM";
$proto149["m_arguments"] = array();
						$obj = new SQLNonParsed(array(
	"m_sql" => "`date_time`"
));

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

$proto148["m_sql"] = "DATE(`date_time`)";
$proto148["m_srcTableName"] = "daily_reportS";
$proto148["m_expr"]=$obj;
$proto148["m_alias"] = "KKK";
$obj = new SQLFieldListItem($proto148);

$proto138["m_fieldlist"][]=$obj;
						$proto151=array();
			$proto152=array();
$proto152["m_functiontype"] = "SQLF_SUM";
$proto152["m_arguments"] = array();
						$obj = new SQLField(array(
	"m_strName" => "amount",
	"m_strTable" => "payment_for_pur",
	"m_srcTableName" => "daily_reportS"
));

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

$proto151["m_sql"] = "SUM(`amount`)";
$proto151["m_srcTableName"] = "daily_reportS";
$proto151["m_expr"]=$obj;
$proto151["m_alias"] = "st34";
$obj = new SQLFieldListItem($proto151);

$proto138["m_fieldlist"][]=$obj;
$proto138["m_fromlist"] = array();
												$proto154=array();
$proto154["m_link"] = "SQLL_MAIN";
			$proto155=array();
$proto155["m_strName"] = "payment_for_pur";
$proto155["m_srcTableName"] = "daily_reportS";
$proto155["m_columns"] = array();
$proto155["m_columns"][] = "id";
$proto155["m_columns"][] = "pur_id";
$proto155["m_columns"][] = "amount";
$proto155["m_columns"][] = "payment_type";
$proto155["m_columns"][] = "cheque_number";
$proto155["m_columns"][] = "cheque_date";
$proto155["m_columns"][] = "date_time";
$proto155["m_columns"][] = "outlet_code";
$proto155["m_columns"][] = "branch_code";
$proto155["m_columns"][] = "user";
$proto155["m_columns"][] = "details";
$proto155["m_columns"][] = "should_pay";
$proto155["m_columns"][] = "expen_code";
$proto155["m_columns"][] = "salary_advance";
$proto155["m_columns"][] = "salary";
$proto155["m_columns"][] = "acc_no";
$proto155["m_columns"][] = "loan_no";
$obj = new SQLTable($proto155);

$proto154["m_table"] = $obj;
$proto154["m_sql"] = "`payment_for_pur`";
$proto154["m_alias"] = "";
$proto154["m_srcTableName"] = "daily_reportS";
$proto156=array();
$proto156["m_sql"] = "";
$proto156["m_uniontype"] = "SQLL_UNKNOWN";
	$obj = new SQLNonParsed(array(
	"m_sql" => ""
));

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

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

$proto138["m_fromlist"][]=$obj;
$proto138["m_groupby"] = array();
												$proto158=array();
						$proto159=array();
$proto159["m_functiontype"] = "SQLF_CUSTOM";
$proto159["m_arguments"] = array();
						$obj = new SQLNonParsed(array(
	"m_sql" => "`date_time`"
));

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

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

$proto138["m_groupby"][]=$obj;
$proto138["m_orderby"] = array();
$proto138["m_srcTableName"]="daily_reportS";		
$obj = new SQLQuery($proto138);

$proto137["m_table"] = $obj;
$proto137["m_sql"] = "LEFT JOIN ( SELECT DATE(`date_time`) AS KKK , SUM(`amount`) AS st34 FROM `payment_for_pur` WHERE `payment_type` = \"Cash\" AND  (`details` = \"purchasing arrears\" ) GROUP BY DATE(`date_time`)) AS pur34 ON daily_report.DATE = pur34.KKK";
$proto137["m_alias"] = "pur34";
$proto137["m_srcTableName"] = "daily_reportS";
$proto161=array();
$proto161["m_sql"] = "daily_report.DATE = pur34.KKK";
$proto161["m_uniontype"] = "SQLL_UNKNOWN";
						$obj = new SQLField(array(
	"m_strName" => "date",
	"m_strTable" => "daily_report",
	"m_srcTableName" => "daily_reportS"
));

$proto161["m_column"]=$obj;
$proto161["m_contained"] = array();
$proto161["m_strCase"] = "= pur34.KKK";
$proto161["m_havingmode"] = false;
$proto161["m_inBrackets"] = false;
$proto161["m_useAlias"] = false;
$obj = new SQLLogicalExpr($proto161);

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

$proto0["m_fromlist"][]=$obj;
												$proto163=array();
$proto163["m_link"] = "SQLL_LEFTJOIN";
			$proto164=array();
$proto164["m_strHead"] = " SELECT";
$proto164["m_strFieldList"] = "DATE(`date_time`) AS KKK , SUM(`amount`) AS st35";
$proto164["m_strFrom"] = "FROM `payment_for_pur`";
$proto164["m_strWhere"] = "`payment_type` = \"Cash\" AND  ( `details` = \"purchasing\")";
$proto164["m_strOrderBy"] = "";
	
		;
			$proto164["cipherer"] = null;
$proto166=array();
$proto166["m_sql"] = "`payment_type` = \"Cash\" AND  ( `details` = \"purchasing\")";
$proto166["m_uniontype"] = "SQLL_AND";
	$obj = new SQLNonParsed(array(
	"m_sql" => "`payment_type` = \"Cash\" AND  ( `details` = \"purchasing\")"
));

$proto166["m_column"]=$obj;
$proto166["m_contained"] = array();
						$proto168=array();
$proto168["m_sql"] = "`payment_type` = \"Cash\"";
$proto168["m_uniontype"] = "SQLL_UNKNOWN";
						$obj = new SQLField(array(
	"m_strName" => "payment_type",
	"m_strTable" => "payment_for_pur",
	"m_srcTableName" => "daily_reportS"
));

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

			$proto166["m_contained"][]=$obj;
						$proto170=array();
$proto170["m_sql"] = " `details` = \"purchasing\"";
$proto170["m_uniontype"] = "SQLL_UNKNOWN";
						$obj = new SQLField(array(
	"m_strName" => "details",
	"m_strTable" => "payment_for_pur",
	"m_srcTableName" => "daily_reportS"
));

$proto170["m_column"]=$obj;
$proto170["m_contained"] = array();
$proto170["m_strCase"] = "= \"purchasing\"";
$proto170["m_havingmode"] = false;
$proto170["m_inBrackets"] = true;
$proto170["m_useAlias"] = false;
$obj = new SQLLogicalExpr($proto170);

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

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

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

$proto164["m_having"] = $obj;
$proto164["m_fieldlist"] = array();
						$proto174=array();
			$proto175=array();
$proto175["m_functiontype"] = "SQLF_CUSTOM";
$proto175["m_arguments"] = array();
						$obj = new SQLNonParsed(array(
	"m_sql" => "`date_time`"
));

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

$proto174["m_sql"] = "DATE(`date_time`)";
$proto174["m_srcTableName"] = "daily_reportS";
$proto174["m_expr"]=$obj;
$proto174["m_alias"] = "KKK";
$obj = new SQLFieldListItem($proto174);

$proto164["m_fieldlist"][]=$obj;
						$proto177=array();
			$proto178=array();
$proto178["m_functiontype"] = "SQLF_SUM";
$proto178["m_arguments"] = array();
						$obj = new SQLField(array(
	"m_strName" => "amount",
	"m_strTable" => "payment_for_pur",
	"m_srcTableName" => "daily_reportS"
));

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

$proto177["m_sql"] = "SUM(`amount`)";
$proto177["m_srcTableName"] = "daily_reportS";
$proto177["m_expr"]=$obj;
$proto177["m_alias"] = "st35";
$obj = new SQLFieldListItem($proto177);

$proto164["m_fieldlist"][]=$obj;
$proto164["m_fromlist"] = array();
												$proto180=array();
$proto180["m_link"] = "SQLL_MAIN";
			$proto181=array();
$proto181["m_strName"] = "payment_for_pur";
$proto181["m_srcTableName"] = "daily_reportS";
$proto181["m_columns"] = array();
$proto181["m_columns"][] = "id";
$proto181["m_columns"][] = "pur_id";
$proto181["m_columns"][] = "amount";
$proto181["m_columns"][] = "payment_type";
$proto181["m_columns"][] = "cheque_number";
$proto181["m_columns"][] = "cheque_date";
$proto181["m_columns"][] = "date_time";
$proto181["m_columns"][] = "outlet_code";
$proto181["m_columns"][] = "branch_code";
$proto181["m_columns"][] = "user";
$proto181["m_columns"][] = "details";
$proto181["m_columns"][] = "should_pay";
$proto181["m_columns"][] = "expen_code";
$proto181["m_columns"][] = "salary_advance";
$proto181["m_columns"][] = "salary";
$proto181["m_columns"][] = "acc_no";
$proto181["m_columns"][] = "loan_no";
$obj = new SQLTable($proto181);

$proto180["m_table"] = $obj;
$proto180["m_sql"] = "`payment_for_pur`";
$proto180["m_alias"] = "";
$proto180["m_srcTableName"] = "daily_reportS";
$proto182=array();
$proto182["m_sql"] = "";
$proto182["m_uniontype"] = "SQLL_UNKNOWN";
	$obj = new SQLNonParsed(array(
	"m_sql" => ""
));

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

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

$proto164["m_fromlist"][]=$obj;
$proto164["m_groupby"] = array();
												$proto184=array();
						$proto185=array();
$proto185["m_functiontype"] = "SQLF_CUSTOM";
$proto185["m_arguments"] = array();
						$obj = new SQLNonParsed(array(
	"m_sql" => "`date_time`"
));

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

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

$proto164["m_groupby"][]=$obj;
$proto164["m_orderby"] = array();
$proto164["m_srcTableName"]="daily_reportS";		
$obj = new SQLQuery($proto164);

$proto163["m_table"] = $obj;
$proto163["m_sql"] = "LEFT JOIN ( SELECT DATE(`date_time`) AS KKK , SUM(`amount`) AS st35 FROM `payment_for_pur` WHERE `payment_type` = \"Cash\" AND  ( `details` = \"purchasing\") GROUP BY DATE(`date_time`)) AS pur35 ON daily_report.DATE = pur35.KKK";
$proto163["m_alias"] = "pur35";
$proto163["m_srcTableName"] = "daily_reportS";
$proto187=array();
$proto187["m_sql"] = "daily_report.DATE = pur35.KKK";
$proto187["m_uniontype"] = "SQLL_UNKNOWN";
						$obj = new SQLField(array(
	"m_strName" => "date",
	"m_strTable" => "daily_report",
	"m_srcTableName" => "daily_reportS"
));

$proto187["m_column"]=$obj;
$proto187["m_contained"] = array();
$proto187["m_strCase"] = "= pur35.KKK";
$proto187["m_havingmode"] = false;
$proto187["m_inBrackets"] = false;
$proto187["m_useAlias"] = false;
$obj = new SQLLogicalExpr($proto187);

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

$proto0["m_fromlist"][]=$obj;
												$proto189=array();
$proto189["m_link"] = "SQLL_LEFTJOIN";
			$proto190=array();
$proto190["m_strHead"] = " SELECT";
$proto190["m_strFieldList"] = "DATE(`date_time`) AS KKK , SUM(`amount`) AS st36";
$proto190["m_strFrom"] = "FROM `payment_for_pur`";
$proto190["m_strWhere"] = "`payment_type` = \"Cheque\" AND  ( `details` = \"purchasing\")";
$proto190["m_strOrderBy"] = "";
	
		;
			$proto190["cipherer"] = null;
$proto192=array();
$proto192["m_sql"] = "`payment_type` = \"Cheque\" AND  ( `details` = \"purchasing\")";
$proto192["m_uniontype"] = "SQLL_AND";
	$obj = new SQLNonParsed(array(
	"m_sql" => "`payment_type` = \"Cheque\" AND  ( `details` = \"purchasing\")"
));

$proto192["m_column"]=$obj;
$proto192["m_contained"] = array();
						$proto194=array();
$proto194["m_sql"] = "`payment_type` = \"Cheque\"";
$proto194["m_uniontype"] = "SQLL_UNKNOWN";
						$obj = new SQLField(array(
	"m_strName" => "payment_type",
	"m_strTable" => "payment_for_pur",
	"m_srcTableName" => "daily_reportS"
));

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

			$proto192["m_contained"][]=$obj;
						$proto196=array();
$proto196["m_sql"] = " `details` = \"purchasing\"";
$proto196["m_uniontype"] = "SQLL_UNKNOWN";
						$obj = new SQLField(array(
	"m_strName" => "details",
	"m_strTable" => "payment_for_pur",
	"m_srcTableName" => "daily_reportS"
));

$proto196["m_column"]=$obj;
$proto196["m_contained"] = array();
$proto196["m_strCase"] = "= \"purchasing\"";
$proto196["m_havingmode"] = false;
$proto196["m_inBrackets"] = true;
$proto196["m_useAlias"] = false;
$obj = new SQLLogicalExpr($proto196);

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

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

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

$proto190["m_having"] = $obj;
$proto190["m_fieldlist"] = array();
						$proto200=array();
			$proto201=array();
$proto201["m_functiontype"] = "SQLF_CUSTOM";
$proto201["m_arguments"] = array();
						$obj = new SQLNonParsed(array(
	"m_sql" => "`date_time`"
));

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

$proto200["m_sql"] = "DATE(`date_time`)";
$proto200["m_srcTableName"] = "daily_reportS";
$proto200["m_expr"]=$obj;
$proto200["m_alias"] = "KKK";
$obj = new SQLFieldListItem($proto200);

$proto190["m_fieldlist"][]=$obj;
						$proto203=array();
			$proto204=array();
$proto204["m_functiontype"] = "SQLF_SUM";
$proto204["m_arguments"] = array();
						$obj = new SQLField(array(
	"m_strName" => "amount",
	"m_strTable" => "payment_for_pur",
	"m_srcTableName" => "daily_reportS"
));

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

$proto203["m_sql"] = "SUM(`amount`)";
$proto203["m_srcTableName"] = "daily_reportS";
$proto203["m_expr"]=$obj;
$proto203["m_alias"] = "st36";
$obj = new SQLFieldListItem($proto203);

$proto190["m_fieldlist"][]=$obj;
$proto190["m_fromlist"] = array();
												$proto206=array();
$proto206["m_link"] = "SQLL_MAIN";
			$proto207=array();
$proto207["m_strName"] = "payment_for_pur";
$proto207["m_srcTableName"] = "daily_reportS";
$proto207["m_columns"] = array();
$proto207["m_columns"][] = "id";
$proto207["m_columns"][] = "pur_id";
$proto207["m_columns"][] = "amount";
$proto207["m_columns"][] = "payment_type";
$proto207["m_columns"][] = "cheque_number";
$proto207["m_columns"][] = "cheque_date";
$proto207["m_columns"][] = "date_time";
$proto207["m_columns"][] = "outlet_code";
$proto207["m_columns"][] = "branch_code";
$proto207["m_columns"][] = "user";
$proto207["m_columns"][] = "details";
$proto207["m_columns"][] = "should_pay";
$proto207["m_columns"][] = "expen_code";
$proto207["m_columns"][] = "salary_advance";
$proto207["m_columns"][] = "salary";
$proto207["m_columns"][] = "acc_no";
$proto207["m_columns"][] = "loan_no";
$obj = new SQLTable($proto207);

$proto206["m_table"] = $obj;
$proto206["m_sql"] = "`payment_for_pur`";
$proto206["m_alias"] = "";
$proto206["m_srcTableName"] = "daily_reportS";
$proto208=array();
$proto208["m_sql"] = "";
$proto208["m_uniontype"] = "SQLL_UNKNOWN";
	$obj = new SQLNonParsed(array(
	"m_sql" => ""
));

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

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

$proto190["m_fromlist"][]=$obj;
$proto190["m_groupby"] = array();
												$proto210=array();
						$proto211=array();
$proto211["m_functiontype"] = "SQLF_CUSTOM";
$proto211["m_arguments"] = array();
						$obj = new SQLNonParsed(array(
	"m_sql" => "`date_time`"
));

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

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

$proto190["m_groupby"][]=$obj;
$proto190["m_orderby"] = array();
$proto190["m_srcTableName"]="daily_reportS";		
$obj = new SQLQuery($proto190);

$proto189["m_table"] = $obj;
$proto189["m_sql"] = "LEFT JOIN ( SELECT DATE(`date_time`) AS KKK , SUM(`amount`) AS st36 FROM `payment_for_pur` WHERE `payment_type` = \"Cheque\" AND  ( `details` = \"purchasing\") GROUP BY DATE(`date_time`)) AS pur36 ON daily_report.DATE = pur36.KKK";
$proto189["m_alias"] = "pur36";
$proto189["m_srcTableName"] = "daily_reportS";
$proto213=array();
$proto213["m_sql"] = "daily_report.DATE = pur36.KKK";
$proto213["m_uniontype"] = "SQLL_UNKNOWN";
						$obj = new SQLField(array(
	"m_strName" => "date",
	"m_strTable" => "daily_report",
	"m_srcTableName" => "daily_reportS"
));

$proto213["m_column"]=$obj;
$proto213["m_contained"] = array();
$proto213["m_strCase"] = "= pur36.KKK";
$proto213["m_havingmode"] = false;
$proto213["m_inBrackets"] = false;
$proto213["m_useAlias"] = false;
$obj = new SQLLogicalExpr($proto213);

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

$proto0["m_fromlist"][]=$obj;
												$proto215=array();
$proto215["m_link"] = "SQLL_LEFTJOIN";
			$proto216=array();
$proto216["m_strHead"] = " SELECT";
$proto216["m_strFieldList"] = "DATE(`date_time`) AS KKK , SUM(`amount`) AS st37";
$proto216["m_strFrom"] = "FROM `payment_for_pur`";
$proto216["m_strWhere"] = "`payment_type` = \"Cheque\" AND  (`details` = \"purchasing arrears\" )";
$proto216["m_strOrderBy"] = "";
	
		;
			$proto216["cipherer"] = null;
$proto218=array();
$proto218["m_sql"] = "`payment_type` = \"Cheque\" AND  (`details` = \"purchasing arrears\" )";
$proto218["m_uniontype"] = "SQLL_AND";
	$obj = new SQLNonParsed(array(
	"m_sql" => "`payment_type` = \"Cheque\" AND  (`details` = \"purchasing arrears\" )"
));

$proto218["m_column"]=$obj;
$proto218["m_contained"] = array();
						$proto220=array();
$proto220["m_sql"] = "`payment_type` = \"Cheque\"";
$proto220["m_uniontype"] = "SQLL_UNKNOWN";
						$obj = new SQLField(array(
	"m_strName" => "payment_type",
	"m_strTable" => "payment_for_pur",
	"m_srcTableName" => "daily_reportS"
));

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

			$proto218["m_contained"][]=$obj;
						$proto222=array();
$proto222["m_sql"] = "`details` = \"purchasing arrears\" ";
$proto222["m_uniontype"] = "SQLL_UNKNOWN";
						$obj = new SQLField(array(
	"m_strName" => "details",
	"m_strTable" => "payment_for_pur",
	"m_srcTableName" => "daily_reportS"
));

$proto222["m_column"]=$obj;
$proto222["m_contained"] = array();
$proto222["m_strCase"] = "= \"purchasing arrears\"";
$proto222["m_havingmode"] = false;
$proto222["m_inBrackets"] = true;
$proto222["m_useAlias"] = false;
$obj = new SQLLogicalExpr($proto222);

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

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

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

$proto216["m_having"] = $obj;
$proto216["m_fieldlist"] = array();
						$proto226=array();
			$proto227=array();
$proto227["m_functiontype"] = "SQLF_CUSTOM";
$proto227["m_arguments"] = array();
						$obj = new SQLNonParsed(array(
	"m_sql" => "`date_time`"
));

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

$proto226["m_sql"] = "DATE(`date_time`)";
$proto226["m_srcTableName"] = "daily_reportS";
$proto226["m_expr"]=$obj;
$proto226["m_alias"] = "KKK";
$obj = new SQLFieldListItem($proto226);

$proto216["m_fieldlist"][]=$obj;
						$proto229=array();
			$proto230=array();
$proto230["m_functiontype"] = "SQLF_SUM";
$proto230["m_arguments"] = array();
						$obj = new SQLField(array(
	"m_strName" => "amount",
	"m_strTable" => "payment_for_pur",
	"m_srcTableName" => "daily_reportS"
));

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

$proto229["m_sql"] = "SUM(`amount`)";
$proto229["m_srcTableName"] = "daily_reportS";
$proto229["m_expr"]=$obj;
$proto229["m_alias"] = "st37";
$obj = new SQLFieldListItem($proto229);

$proto216["m_fieldlist"][]=$obj;
$proto216["m_fromlist"] = array();
												$proto232=array();
$proto232["m_link"] = "SQLL_MAIN";
			$proto233=array();
$proto233["m_strName"] = "payment_for_pur";
$proto233["m_srcTableName"] = "daily_reportS";
$proto233["m_columns"] = array();
$proto233["m_columns"][] = "id";
$proto233["m_columns"][] = "pur_id";
$proto233["m_columns"][] = "amount";
$proto233["m_columns"][] = "payment_type";
$proto233["m_columns"][] = "cheque_number";
$proto233["m_columns"][] = "cheque_date";
$proto233["m_columns"][] = "date_time";
$proto233["m_columns"][] = "outlet_code";
$proto233["m_columns"][] = "branch_code";
$proto233["m_columns"][] = "user";
$proto233["m_columns"][] = "details";
$proto233["m_columns"][] = "should_pay";
$proto233["m_columns"][] = "expen_code";
$proto233["m_columns"][] = "salary_advance";
$proto233["m_columns"][] = "salary";
$proto233["m_columns"][] = "acc_no";
$proto233["m_columns"][] = "loan_no";
$obj = new SQLTable($proto233);

$proto232["m_table"] = $obj;
$proto232["m_sql"] = "`payment_for_pur`";
$proto232["m_alias"] = "";
$proto232["m_srcTableName"] = "daily_reportS";
$proto234=array();
$proto234["m_sql"] = "";
$proto234["m_uniontype"] = "SQLL_UNKNOWN";
	$obj = new SQLNonParsed(array(
	"m_sql" => ""
));

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

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

$proto216["m_fromlist"][]=$obj;
$proto216["m_groupby"] = array();
												$proto236=array();
						$proto237=array();
$proto237["m_functiontype"] = "SQLF_CUSTOM";
$proto237["m_arguments"] = array();
						$obj = new SQLNonParsed(array(
	"m_sql" => "`date_time`"
));

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

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

$proto216["m_groupby"][]=$obj;
$proto216["m_orderby"] = array();
$proto216["m_srcTableName"]="daily_reportS";		
$obj = new SQLQuery($proto216);

$proto215["m_table"] = $obj;
$proto215["m_sql"] = "LEFT JOIN ( SELECT DATE(`date_time`) AS KKK , SUM(`amount`) AS st37 FROM `payment_for_pur` WHERE `payment_type` = \"Cheque\" AND  (`details` = \"purchasing arrears\" ) GROUP BY DATE(`date_time`)) AS pur37 ON daily_report.DATE = pur37.KKK";
$proto215["m_alias"] = "pur37";
$proto215["m_srcTableName"] = "daily_reportS";
$proto239=array();
$proto239["m_sql"] = "daily_report.DATE = pur37.KKK";
$proto239["m_uniontype"] = "SQLL_UNKNOWN";
						$obj = new SQLField(array(
	"m_strName" => "date",
	"m_strTable" => "daily_report",
	"m_srcTableName" => "daily_reportS"
));

$proto239["m_column"]=$obj;
$proto239["m_contained"] = array();
$proto239["m_strCase"] = "= pur37.KKK";
$proto239["m_havingmode"] = false;
$proto239["m_inBrackets"] = false;
$proto239["m_useAlias"] = false;
$obj = new SQLLogicalExpr($proto239);

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

$proto0["m_fromlist"][]=$obj;
												$proto241=array();
$proto241["m_link"] = "SQLL_LEFTJOIN";
			$proto242=array();
$proto242["m_strHead"] = " SELECT";
$proto242["m_strFieldList"] = "DATE(`date_time`) AS KKK , SUM(`amount`) AS st40";
$proto242["m_strFrom"] = "FROM `payment_for_pur`";
$proto242["m_strWhere"] = "`payment_type` = \"Cash\" AND  ( `details` = \"Expen\")";
$proto242["m_strOrderBy"] = "";
	
		;
			$proto242["cipherer"] = null;
$proto244=array();
$proto244["m_sql"] = "`payment_type` = \"Cash\" AND  ( `details` = \"Expen\")";
$proto244["m_uniontype"] = "SQLL_AND";
	$obj = new SQLNonParsed(array(
	"m_sql" => "`payment_type` = \"Cash\" AND  ( `details` = \"Expen\")"
));

$proto244["m_column"]=$obj;
$proto244["m_contained"] = array();
						$proto246=array();
$proto246["m_sql"] = "`payment_type` = \"Cash\"";
$proto246["m_uniontype"] = "SQLL_UNKNOWN";
						$obj = new SQLField(array(
	"m_strName" => "payment_type",
	"m_strTable" => "payment_for_pur",
	"m_srcTableName" => "daily_reportS"
));

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

			$proto244["m_contained"][]=$obj;
						$proto248=array();
$proto248["m_sql"] = " `details` = \"Expen\"";
$proto248["m_uniontype"] = "SQLL_UNKNOWN";
						$obj = new SQLField(array(
	"m_strName" => "details",
	"m_strTable" => "payment_for_pur",
	"m_srcTableName" => "daily_reportS"
));

$proto248["m_column"]=$obj;
$proto248["m_contained"] = array();
$proto248["m_strCase"] = "= \"Expen\"";
$proto248["m_havingmode"] = false;
$proto248["m_inBrackets"] = true;
$proto248["m_useAlias"] = false;
$obj = new SQLLogicalExpr($proto248);

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

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

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

$proto242["m_having"] = $obj;
$proto242["m_fieldlist"] = array();
						$proto252=array();
			$proto253=array();
$proto253["m_functiontype"] = "SQLF_CUSTOM";
$proto253["m_arguments"] = array();
						$obj = new SQLNonParsed(array(
	"m_sql" => "`date_time`"
));

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

$proto252["m_sql"] = "DATE(`date_time`)";
$proto252["m_srcTableName"] = "daily_reportS";
$proto252["m_expr"]=$obj;
$proto252["m_alias"] = "KKK";
$obj = new SQLFieldListItem($proto252);

$proto242["m_fieldlist"][]=$obj;
						$proto255=array();
			$proto256=array();
$proto256["m_functiontype"] = "SQLF_SUM";
$proto256["m_arguments"] = array();
						$obj = new SQLField(array(
	"m_strName" => "amount",
	"m_strTable" => "payment_for_pur",
	"m_srcTableName" => "daily_reportS"
));

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

$proto255["m_sql"] = "SUM(`amount`)";
$proto255["m_srcTableName"] = "daily_reportS";
$proto255["m_expr"]=$obj;
$proto255["m_alias"] = "st40";
$obj = new SQLFieldListItem($proto255);

$proto242["m_fieldlist"][]=$obj;
$proto242["m_fromlist"] = array();
												$proto258=array();
$proto258["m_link"] = "SQLL_MAIN";
			$proto259=array();
$proto259["m_strName"] = "payment_for_pur";
$proto259["m_srcTableName"] = "daily_reportS";
$proto259["m_columns"] = array();
$proto259["m_columns"][] = "id";
$proto259["m_columns"][] = "pur_id";
$proto259["m_columns"][] = "amount";
$proto259["m_columns"][] = "payment_type";
$proto259["m_columns"][] = "cheque_number";
$proto259["m_columns"][] = "cheque_date";
$proto259["m_columns"][] = "date_time";
$proto259["m_columns"][] = "outlet_code";
$proto259["m_columns"][] = "branch_code";
$proto259["m_columns"][] = "user";
$proto259["m_columns"][] = "details";
$proto259["m_columns"][] = "should_pay";
$proto259["m_columns"][] = "expen_code";
$proto259["m_columns"][] = "salary_advance";
$proto259["m_columns"][] = "salary";
$proto259["m_columns"][] = "acc_no";
$proto259["m_columns"][] = "loan_no";
$obj = new SQLTable($proto259);

$proto258["m_table"] = $obj;
$proto258["m_sql"] = "`payment_for_pur`";
$proto258["m_alias"] = "";
$proto258["m_srcTableName"] = "daily_reportS";
$proto260=array();
$proto260["m_sql"] = "";
$proto260["m_uniontype"] = "SQLL_UNKNOWN";
	$obj = new SQLNonParsed(array(
	"m_sql" => ""
));

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

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

$proto242["m_fromlist"][]=$obj;
$proto242["m_groupby"] = array();
												$proto262=array();
						$proto263=array();
$proto263["m_functiontype"] = "SQLF_CUSTOM";
$proto263["m_arguments"] = array();
						$obj = new SQLNonParsed(array(
	"m_sql" => "`date_time`"
));

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

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

$proto242["m_groupby"][]=$obj;
$proto242["m_orderby"] = array();
$proto242["m_srcTableName"]="daily_reportS";		
$obj = new SQLQuery($proto242);

$proto241["m_table"] = $obj;
$proto241["m_sql"] = "LEFT JOIN ( SELECT DATE(`date_time`) AS KKK , SUM(`amount`) AS st40 FROM `payment_for_pur` WHERE `payment_type` = \"Cash\" AND  ( `details` = \"Expen\") GROUP BY DATE(`date_time`)) AS pur40 ON daily_report.DATE = pur40.KKK";
$proto241["m_alias"] = "pur40";
$proto241["m_srcTableName"] = "daily_reportS";
$proto265=array();
$proto265["m_sql"] = "daily_report.DATE = pur40.KKK";
$proto265["m_uniontype"] = "SQLL_UNKNOWN";
						$obj = new SQLField(array(
	"m_strName" => "date",
	"m_strTable" => "daily_report",
	"m_srcTableName" => "daily_reportS"
));

$proto265["m_column"]=$obj;
$proto265["m_contained"] = array();
$proto265["m_strCase"] = "= pur40.KKK";
$proto265["m_havingmode"] = false;
$proto265["m_inBrackets"] = false;
$proto265["m_useAlias"] = false;
$obj = new SQLLogicalExpr($proto265);

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

$proto0["m_fromlist"][]=$obj;
												$proto267=array();
$proto267["m_link"] = "SQLL_LEFTJOIN";
			$proto268=array();
$proto268["m_strHead"] = " SELECT";
$proto268["m_strFieldList"] = "DATE(`date_time`) AS KKK , SUM(`amount`) AS st38";
$proto268["m_strFrom"] = "FROM `payment_for_pur`";
$proto268["m_strWhere"] = "`payment_type` = \"Cash\" AND  ( `details` = \"salary advance\")";
$proto268["m_strOrderBy"] = "";
	
		;
			$proto268["cipherer"] = null;
$proto270=array();
$proto270["m_sql"] = "`payment_type` = \"Cash\" AND  ( `details` = \"salary advance\")";
$proto270["m_uniontype"] = "SQLL_AND";
	$obj = new SQLNonParsed(array(
	"m_sql" => "`payment_type` = \"Cash\" AND  ( `details` = \"salary advance\")"
));

$proto270["m_column"]=$obj;
$proto270["m_contained"] = array();
						$proto272=array();
$proto272["m_sql"] = "`payment_type` = \"Cash\"";
$proto272["m_uniontype"] = "SQLL_UNKNOWN";
						$obj = new SQLField(array(
	"m_strName" => "payment_type",
	"m_strTable" => "payment_for_pur",
	"m_srcTableName" => "daily_reportS"
));

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

			$proto270["m_contained"][]=$obj;
						$proto274=array();
$proto274["m_sql"] = " `details` = \"salary advance\"";
$proto274["m_uniontype"] = "SQLL_UNKNOWN";
						$obj = new SQLField(array(
	"m_strName" => "details",
	"m_strTable" => "payment_for_pur",
	"m_srcTableName" => "daily_reportS"
));

$proto274["m_column"]=$obj;
$proto274["m_contained"] = array();
$proto274["m_strCase"] = "= \"salary advance\"";
$proto274["m_havingmode"] = false;
$proto274["m_inBrackets"] = true;
$proto274["m_useAlias"] = false;
$obj = new SQLLogicalExpr($proto274);

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

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

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

$proto268["m_having"] = $obj;
$proto268["m_fieldlist"] = array();
						$proto278=array();
			$proto279=array();
$proto279["m_functiontype"] = "SQLF_CUSTOM";
$proto279["m_arguments"] = array();
						$obj = new SQLNonParsed(array(
	"m_sql" => "`date_time`"
));

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

$proto278["m_sql"] = "DATE(`date_time`)";
$proto278["m_srcTableName"] = "daily_reportS";
$proto278["m_expr"]=$obj;
$proto278["m_alias"] = "KKK";
$obj = new SQLFieldListItem($proto278);

$proto268["m_fieldlist"][]=$obj;
						$proto281=array();
			$proto282=array();
$proto282["m_functiontype"] = "SQLF_SUM";
$proto282["m_arguments"] = array();
						$obj = new SQLField(array(
	"m_strName" => "amount",
	"m_strTable" => "payment_for_pur",
	"m_srcTableName" => "daily_reportS"
));

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

$proto281["m_sql"] = "SUM(`amount`)";
$proto281["m_srcTableName"] = "daily_reportS";
$proto281["m_expr"]=$obj;
$proto281["m_alias"] = "st38";
$obj = new SQLFieldListItem($proto281);

$proto268["m_fieldlist"][]=$obj;
$proto268["m_fromlist"] = array();
												$proto284=array();
$proto284["m_link"] = "SQLL_MAIN";
			$proto285=array();
$proto285["m_strName"] = "payment_for_pur";
$proto285["m_srcTableName"] = "daily_reportS";
$proto285["m_columns"] = array();
$proto285["m_columns"][] = "id";
$proto285["m_columns"][] = "pur_id";
$proto285["m_columns"][] = "amount";
$proto285["m_columns"][] = "payment_type";
$proto285["m_columns"][] = "cheque_number";
$proto285["m_columns"][] = "cheque_date";
$proto285["m_columns"][] = "date_time";
$proto285["m_columns"][] = "outlet_code";
$proto285["m_columns"][] = "branch_code";
$proto285["m_columns"][] = "user";
$proto285["m_columns"][] = "details";
$proto285["m_columns"][] = "should_pay";
$proto285["m_columns"][] = "expen_code";
$proto285["m_columns"][] = "salary_advance";
$proto285["m_columns"][] = "salary";
$proto285["m_columns"][] = "acc_no";
$proto285["m_columns"][] = "loan_no";
$obj = new SQLTable($proto285);

$proto284["m_table"] = $obj;
$proto284["m_sql"] = "`payment_for_pur`";
$proto284["m_alias"] = "";
$proto284["m_srcTableName"] = "daily_reportS";
$proto286=array();
$proto286["m_sql"] = "";
$proto286["m_uniontype"] = "SQLL_UNKNOWN";
	$obj = new SQLNonParsed(array(
	"m_sql" => ""
));

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

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

$proto268["m_fromlist"][]=$obj;
$proto268["m_groupby"] = array();
												$proto288=array();
						$proto289=array();
$proto289["m_functiontype"] = "SQLF_CUSTOM";
$proto289["m_arguments"] = array();
						$obj = new SQLNonParsed(array(
	"m_sql" => "`date_time`"
));

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

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

$proto268["m_groupby"][]=$obj;
$proto268["m_orderby"] = array();
$proto268["m_srcTableName"]="daily_reportS";		
$obj = new SQLQuery($proto268);

$proto267["m_table"] = $obj;
$proto267["m_sql"] = "LEFT JOIN ( SELECT DATE(`date_time`) AS KKK , SUM(`amount`) AS st38 FROM `payment_for_pur` WHERE `payment_type` = \"Cash\" AND  ( `details` = \"salary advance\") GROUP BY DATE(`date_time`)) AS pur38 ON daily_report.DATE = pur38.KKK";
$proto267["m_alias"] = "pur38";
$proto267["m_srcTableName"] = "daily_reportS";
$proto291=array();
$proto291["m_sql"] = "daily_report.DATE = pur38.KKK";
$proto291["m_uniontype"] = "SQLL_UNKNOWN";
						$obj = new SQLField(array(
	"m_strName" => "date",
	"m_strTable" => "daily_report",
	"m_srcTableName" => "daily_reportS"
));

$proto291["m_column"]=$obj;
$proto291["m_contained"] = array();
$proto291["m_strCase"] = "= pur38.KKK";
$proto291["m_havingmode"] = false;
$proto291["m_inBrackets"] = false;
$proto291["m_useAlias"] = false;
$obj = new SQLLogicalExpr($proto291);

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

$proto0["m_fromlist"][]=$obj;
												$proto293=array();
$proto293["m_link"] = "SQLL_LEFTJOIN";
			$proto294=array();
$proto294["m_strHead"] = " SELECT";
$proto294["m_strFieldList"] = "DATE(`date_time`) AS KKK , SUM(`amount`) AS st39";
$proto294["m_strFrom"] = "FROM `payment_for_pur`";
$proto294["m_strWhere"] = "`payment_type` = \"Cash\" AND  ( `details` = \"salary\")";
$proto294["m_strOrderBy"] = "";
	
		;
			$proto294["cipherer"] = null;
$proto296=array();
$proto296["m_sql"] = "`payment_type` = \"Cash\" AND  ( `details` = \"salary\")";
$proto296["m_uniontype"] = "SQLL_AND";
	$obj = new SQLNonParsed(array(
	"m_sql" => "`payment_type` = \"Cash\" AND  ( `details` = \"salary\")"
));

$proto296["m_column"]=$obj;
$proto296["m_contained"] = array();
						$proto298=array();
$proto298["m_sql"] = "`payment_type` = \"Cash\"";
$proto298["m_uniontype"] = "SQLL_UNKNOWN";
						$obj = new SQLField(array(
	"m_strName" => "payment_type",
	"m_strTable" => "payment_for_pur",
	"m_srcTableName" => "daily_reportS"
));

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

			$proto296["m_contained"][]=$obj;
						$proto300=array();
$proto300["m_sql"] = " `details` = \"salary\"";
$proto300["m_uniontype"] = "SQLL_UNKNOWN";
						$obj = new SQLField(array(
	"m_strName" => "details",
	"m_strTable" => "payment_for_pur",
	"m_srcTableName" => "daily_reportS"
));

$proto300["m_column"]=$obj;
$proto300["m_contained"] = array();
$proto300["m_strCase"] = "= \"salary\"";
$proto300["m_havingmode"] = false;
$proto300["m_inBrackets"] = true;
$proto300["m_useAlias"] = false;
$obj = new SQLLogicalExpr($proto300);

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

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

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

$proto294["m_having"] = $obj;
$proto294["m_fieldlist"] = array();
						$proto304=array();
			$proto305=array();
$proto305["m_functiontype"] = "SQLF_CUSTOM";
$proto305["m_arguments"] = array();
						$obj = new SQLNonParsed(array(
	"m_sql" => "`date_time`"
));

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

$proto304["m_sql"] = "DATE(`date_time`)";
$proto304["m_srcTableName"] = "daily_reportS";
$proto304["m_expr"]=$obj;
$proto304["m_alias"] = "KKK";
$obj = new SQLFieldListItem($proto304);

$proto294["m_fieldlist"][]=$obj;
						$proto307=array();
			$proto308=array();
$proto308["m_functiontype"] = "SQLF_SUM";
$proto308["m_arguments"] = array();
						$obj = new SQLField(array(
	"m_strName" => "amount",
	"m_strTable" => "payment_for_pur",
	"m_srcTableName" => "daily_reportS"
));

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

$proto307["m_sql"] = "SUM(`amount`)";
$proto307["m_srcTableName"] = "daily_reportS";
$proto307["m_expr"]=$obj;
$proto307["m_alias"] = "st39";
$obj = new SQLFieldListItem($proto307);

$proto294["m_fieldlist"][]=$obj;
$proto294["m_fromlist"] = array();
												$proto310=array();
$proto310["m_link"] = "SQLL_MAIN";
			$proto311=array();
$proto311["m_strName"] = "payment_for_pur";
$proto311["m_srcTableName"] = "daily_reportS";
$proto311["m_columns"] = array();
$proto311["m_columns"][] = "id";
$proto311["m_columns"][] = "pur_id";
$proto311["m_columns"][] = "amount";
$proto311["m_columns"][] = "payment_type";
$proto311["m_columns"][] = "cheque_number";
$proto311["m_columns"][] = "cheque_date";
$proto311["m_columns"][] = "date_time";
$proto311["m_columns"][] = "outlet_code";
$proto311["m_columns"][] = "branch_code";
$proto311["m_columns"][] = "user";
$proto311["m_columns"][] = "details";
$proto311["m_columns"][] = "should_pay";
$proto311["m_columns"][] = "expen_code";
$proto311["m_columns"][] = "salary_advance";
$proto311["m_columns"][] = "salary";
$proto311["m_columns"][] = "acc_no";
$proto311["m_columns"][] = "loan_no";
$obj = new SQLTable($proto311);

$proto310["m_table"] = $obj;
$proto310["m_sql"] = "`payment_for_pur`";
$proto310["m_alias"] = "";
$proto310["m_srcTableName"] = "daily_reportS";
$proto312=array();
$proto312["m_sql"] = "";
$proto312["m_uniontype"] = "SQLL_UNKNOWN";
	$obj = new SQLNonParsed(array(
	"m_sql" => ""
));

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

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

$proto294["m_fromlist"][]=$obj;
$proto294["m_groupby"] = array();
												$proto314=array();
						$proto315=array();
$proto315["m_functiontype"] = "SQLF_CUSTOM";
$proto315["m_arguments"] = array();
						$obj = new SQLNonParsed(array(
	"m_sql" => "`date_time`"
));

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

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

$proto294["m_groupby"][]=$obj;
$proto294["m_orderby"] = array();
$proto294["m_srcTableName"]="daily_reportS";		
$obj = new SQLQuery($proto294);

$proto293["m_table"] = $obj;
$proto293["m_sql"] = "LEFT JOIN ( SELECT DATE(`date_time`) AS KKK , SUM(`amount`) AS st39 FROM `payment_for_pur` WHERE `payment_type` = \"Cash\" AND  ( `details` = \"salary\") GROUP BY DATE(`date_time`)) AS pur39 ON daily_report.DATE = pur39.KKK";
$proto293["m_alias"] = "pur39";
$proto293["m_srcTableName"] = "daily_reportS";
$proto317=array();
$proto317["m_sql"] = "daily_report.DATE = pur39.KKK";
$proto317["m_uniontype"] = "SQLL_UNKNOWN";
						$obj = new SQLField(array(
	"m_strName" => "date",
	"m_strTable" => "daily_report",
	"m_srcTableName" => "daily_reportS"
));

$proto317["m_column"]=$obj;
$proto317["m_contained"] = array();
$proto317["m_strCase"] = "= pur39.KKK";
$proto317["m_havingmode"] = false;
$proto317["m_inBrackets"] = false;
$proto317["m_useAlias"] = false;
$obj = new SQLLogicalExpr($proto317);

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

$proto0["m_fromlist"][]=$obj;
												$proto319=array();
$proto319["m_link"] = "SQLL_LEFTJOIN";
			$proto320=array();
$proto320["m_strHead"] = " SELECT";
$proto320["m_strFieldList"] = "DATE(`date_time`) AS KK2 , SUM(`amount`) AS st41";
$proto320["m_strFrom"] = "FROM `payments`";
$proto320["m_strWhere"] = "`status`=\"sales arrears\" and type=\"Cheque\"";
$proto320["m_strOrderBy"] = "";
	
		;
			$proto320["cipherer"] = null;
$proto322=array();
$proto322["m_sql"] = "`status`=\"sales arrears\" and type=\"Cheque\"";
$proto322["m_uniontype"] = "SQLL_AND";
	$obj = new SQLNonParsed(array(
	"m_sql" => "`status`=\"sales arrears\" and type=\"Cheque\""
));

$proto322["m_column"]=$obj;
$proto322["m_contained"] = array();
						$proto324=array();
$proto324["m_sql"] = "`status`=\"sales arrears\"";
$proto324["m_uniontype"] = "SQLL_UNKNOWN";
						$obj = new SQLField(array(
	"m_strName" => "status",
	"m_strTable" => "payments",
	"m_srcTableName" => "daily_reportS"
));

$proto324["m_column"]=$obj;
$proto324["m_contained"] = array();
$proto324["m_strCase"] = "=\"sales arrears\"";
$proto324["m_havingmode"] = false;
$proto324["m_inBrackets"] = false;
$proto324["m_useAlias"] = false;
$obj = new SQLLogicalExpr($proto324);

			$proto322["m_contained"][]=$obj;
						$proto326=array();
$proto326["m_sql"] = "type=\"Cheque\"";
$proto326["m_uniontype"] = "SQLL_UNKNOWN";
						$obj = new SQLField(array(
	"m_strName" => "type",
	"m_strTable" => "payments",
	"m_srcTableName" => "daily_reportS"
));

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

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

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

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

$proto320["m_having"] = $obj;
$proto320["m_fieldlist"] = array();
						$proto330=array();
			$proto331=array();
$proto331["m_functiontype"] = "SQLF_CUSTOM";
$proto331["m_arguments"] = array();
						$obj = new SQLNonParsed(array(
	"m_sql" => "`date_time`"
));

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

$proto330["m_sql"] = "DATE(`date_time`)";
$proto330["m_srcTableName"] = "daily_reportS";
$proto330["m_expr"]=$obj;
$proto330["m_alias"] = "KK2";
$obj = new SQLFieldListItem($proto330);

$proto320["m_fieldlist"][]=$obj;
						$proto333=array();
			$proto334=array();
$proto334["m_functiontype"] = "SQLF_SUM";
$proto334["m_arguments"] = array();
						$obj = new SQLField(array(
	"m_strName" => "amount",
	"m_strTable" => "payments",
	"m_srcTableName" => "daily_reportS"
));

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

$proto333["m_sql"] = "SUM(`amount`)";
$proto333["m_srcTableName"] = "daily_reportS";
$proto333["m_expr"]=$obj;
$proto333["m_alias"] = "st41";
$obj = new SQLFieldListItem($proto333);

$proto320["m_fieldlist"][]=$obj;
$proto320["m_fromlist"] = array();
												$proto336=array();
$proto336["m_link"] = "SQLL_MAIN";
			$proto337=array();
$proto337["m_strName"] = "payments";
$proto337["m_srcTableName"] = "daily_reportS";
$proto337["m_columns"] = array();
$proto337["m_columns"][] = "id";
$proto337["m_columns"][] = "sales_id";
$proto337["m_columns"][] = "type";
$proto337["m_columns"][] = "amount";
$proto337["m_columns"][] = "cheque_number";
$proto337["m_columns"][] = "cheque_date";
$proto337["m_columns"][] = "hide";
$proto337["m_columns"][] = "status";
$proto337["m_columns"][] = "opening_balance_id";
$proto337["m_columns"][] = "outlet";
$proto337["m_columns"][] = "date_time";
$proto337["m_columns"][] = "user";
$proto337["m_columns"][] = "status_2";
$obj = new SQLTable($proto337);

$proto336["m_table"] = $obj;
$proto336["m_sql"] = "`payments`";
$proto336["m_alias"] = "";
$proto336["m_srcTableName"] = "daily_reportS";
$proto338=array();
$proto338["m_sql"] = "";
$proto338["m_uniontype"] = "SQLL_UNKNOWN";
	$obj = new SQLNonParsed(array(
	"m_sql" => ""
));

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

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

$proto320["m_fromlist"][]=$obj;
$proto320["m_groupby"] = array();
												$proto340=array();
						$proto341=array();
$proto341["m_functiontype"] = "SQLF_CUSTOM";
$proto341["m_arguments"] = array();
						$obj = new SQLNonParsed(array(
	"m_sql" => "`date_time`"
));

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

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

$proto320["m_groupby"][]=$obj;
$proto320["m_orderby"] = array();
$proto320["m_srcTableName"]="daily_reportS";		
$obj = new SQLQuery($proto320);

$proto319["m_table"] = $obj;
$proto319["m_sql"] = "LEFT JOIN ( SELECT DATE(`date_time`) AS KK2 , SUM(`amount`) AS st41 FROM `payments` WHERE `status`=\"sales arrears\" and type=\"Cheque\" GROUP BY DATE(`date_time`)) AS pur41 ON daily_report.DATE = pur41.KK2";
$proto319["m_alias"] = "pur41";
$proto319["m_srcTableName"] = "daily_reportS";
$proto343=array();
$proto343["m_sql"] = "daily_report.DATE = pur41.KK2";
$proto343["m_uniontype"] = "SQLL_UNKNOWN";
						$obj = new SQLField(array(
	"m_strName" => "date",
	"m_strTable" => "daily_report",
	"m_srcTableName" => "daily_reportS"
));

$proto343["m_column"]=$obj;
$proto343["m_contained"] = array();
$proto343["m_strCase"] = "= pur41.KK2";
$proto343["m_havingmode"] = false;
$proto343["m_inBrackets"] = false;
$proto343["m_useAlias"] = false;
$obj = new SQLLogicalExpr($proto343);

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

$proto0["m_fromlist"][]=$obj;
												$proto345=array();
$proto345["m_link"] = "SQLL_LEFTJOIN";
			$proto346=array();
$proto346["m_strHead"] = " SELECT";
$proto346["m_strFieldList"] = "DATE(`date_time`) AS KK2 , SUM(`amount`) AS st42";
$proto346["m_strFrom"] = "FROM `payments`";
$proto346["m_strWhere"] = "`status`=\"sales arrears\"and type=\"Cash\"";
$proto346["m_strOrderBy"] = "";
	
		;
			$proto346["cipherer"] = null;
$proto348=array();
$proto348["m_sql"] = "`status`=\"sales arrears\"and type=\"Cash\"";
$proto348["m_uniontype"] = "SQLL_AND";
	$obj = new SQLNonParsed(array(
	"m_sql" => "`status`=\"sales arrears\"and type=\"Cash\""
));

$proto348["m_column"]=$obj;
$proto348["m_contained"] = array();
						$proto350=array();
$proto350["m_sql"] = "`status`=\"sales arrears\"";
$proto350["m_uniontype"] = "SQLL_UNKNOWN";
						$obj = new SQLField(array(
	"m_strName" => "status",
	"m_strTable" => "payments",
	"m_srcTableName" => "daily_reportS"
));

$proto350["m_column"]=$obj;
$proto350["m_contained"] = array();
$proto350["m_strCase"] = "=\"sales arrears\"";
$proto350["m_havingmode"] = false;
$proto350["m_inBrackets"] = false;
$proto350["m_useAlias"] = false;
$obj = new SQLLogicalExpr($proto350);

			$proto348["m_contained"][]=$obj;
						$proto352=array();
$proto352["m_sql"] = "type=\"Cash\"";
$proto352["m_uniontype"] = "SQLL_UNKNOWN";
						$obj = new SQLField(array(
	"m_strName" => "type",
	"m_strTable" => "payments",
	"m_srcTableName" => "daily_reportS"
));

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

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

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

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

$proto346["m_having"] = $obj;
$proto346["m_fieldlist"] = array();
						$proto356=array();
			$proto357=array();
$proto357["m_functiontype"] = "SQLF_CUSTOM";
$proto357["m_arguments"] = array();
						$obj = new SQLNonParsed(array(
	"m_sql" => "`date_time`"
));

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

$proto356["m_sql"] = "DATE(`date_time`)";
$proto356["m_srcTableName"] = "daily_reportS";
$proto356["m_expr"]=$obj;
$proto356["m_alias"] = "KK2";
$obj = new SQLFieldListItem($proto356);

$proto346["m_fieldlist"][]=$obj;
						$proto359=array();
			$proto360=array();
$proto360["m_functiontype"] = "SQLF_SUM";
$proto360["m_arguments"] = array();
						$obj = new SQLField(array(
	"m_strName" => "amount",
	"m_strTable" => "payments",
	"m_srcTableName" => "daily_reportS"
));

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

$proto359["m_sql"] = "SUM(`amount`)";
$proto359["m_srcTableName"] = "daily_reportS";
$proto359["m_expr"]=$obj;
$proto359["m_alias"] = "st42";
$obj = new SQLFieldListItem($proto359);

$proto346["m_fieldlist"][]=$obj;
$proto346["m_fromlist"] = array();
												$proto362=array();
$proto362["m_link"] = "SQLL_MAIN";
			$proto363=array();
$proto363["m_strName"] = "payments";
$proto363["m_srcTableName"] = "daily_reportS";
$proto363["m_columns"] = array();
$proto363["m_columns"][] = "id";
$proto363["m_columns"][] = "sales_id";
$proto363["m_columns"][] = "type";
$proto363["m_columns"][] = "amount";
$proto363["m_columns"][] = "cheque_number";
$proto363["m_columns"][] = "cheque_date";
$proto363["m_columns"][] = "hide";
$proto363["m_columns"][] = "status";
$proto363["m_columns"][] = "opening_balance_id";
$proto363["m_columns"][] = "outlet";
$proto363["m_columns"][] = "date_time";
$proto363["m_columns"][] = "user";
$proto363["m_columns"][] = "status_2";
$obj = new SQLTable($proto363);

$proto362["m_table"] = $obj;
$proto362["m_sql"] = "`payments`";
$proto362["m_alias"] = "";
$proto362["m_srcTableName"] = "daily_reportS";
$proto364=array();
$proto364["m_sql"] = "";
$proto364["m_uniontype"] = "SQLL_UNKNOWN";
	$obj = new SQLNonParsed(array(
	"m_sql" => ""
));

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

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

$proto346["m_fromlist"][]=$obj;
$proto346["m_groupby"] = array();
												$proto366=array();
						$proto367=array();
$proto367["m_functiontype"] = "SQLF_CUSTOM";
$proto367["m_arguments"] = array();
						$obj = new SQLNonParsed(array(
	"m_sql" => "`date_time`"
));

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

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

$proto346["m_groupby"][]=$obj;
$proto346["m_orderby"] = array();
$proto346["m_srcTableName"]="daily_reportS";		
$obj = new SQLQuery($proto346);

$proto345["m_table"] = $obj;
$proto345["m_sql"] = "LEFT JOIN ( SELECT DATE(`date_time`) AS KK2 , SUM(`amount`) AS st42 FROM `payments` WHERE `status`=\"sales arrears\"and type=\"Cash\" GROUP BY DATE(`date_time`)) AS pur42 ON daily_report.DATE = pur42.KK2";
$proto345["m_alias"] = "pur42";
$proto345["m_srcTableName"] = "daily_reportS";
$proto369=array();
$proto369["m_sql"] = "daily_report.DATE = pur42.KK2";
$proto369["m_uniontype"] = "SQLL_UNKNOWN";
						$obj = new SQLField(array(
	"m_strName" => "date",
	"m_strTable" => "daily_report",
	"m_srcTableName" => "daily_reportS"
));

$proto369["m_column"]=$obj;
$proto369["m_contained"] = array();
$proto369["m_strCase"] = "= pur42.KK2";
$proto369["m_havingmode"] = false;
$proto369["m_inBrackets"] = false;
$proto369["m_useAlias"] = false;
$obj = new SQLLogicalExpr($proto369);

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

$proto0["m_fromlist"][]=$obj;
												$proto371=array();
$proto371["m_link"] = "SQLL_LEFTJOIN";
			$proto372=array();
$proto372["m_strHead"] = " SELECT";
$proto372["m_strFieldList"] = "DATE(`date_time`) AS KK2 , SUM(`amount`) AS st43";
$proto372["m_strFrom"] = "FROM `payments`";
$proto372["m_strWhere"] = "`status`=\"sales\" and type=\"Cheque\"";
$proto372["m_strOrderBy"] = "";
	
		;
			$proto372["cipherer"] = null;
$proto374=array();
$proto374["m_sql"] = "`status`=\"sales\" and type=\"Cheque\"";
$proto374["m_uniontype"] = "SQLL_AND";
	$obj = new SQLNonParsed(array(
	"m_sql" => "`status`=\"sales\" and type=\"Cheque\""
));

$proto374["m_column"]=$obj;
$proto374["m_contained"] = array();
						$proto376=array();
$proto376["m_sql"] = "`status`=\"sales\"";
$proto376["m_uniontype"] = "SQLL_UNKNOWN";
						$obj = new SQLField(array(
	"m_strName" => "status",
	"m_strTable" => "payments",
	"m_srcTableName" => "daily_reportS"
));

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

			$proto374["m_contained"][]=$obj;
						$proto378=array();
$proto378["m_sql"] = "type=\"Cheque\"";
$proto378["m_uniontype"] = "SQLL_UNKNOWN";
						$obj = new SQLField(array(
	"m_strName" => "type",
	"m_strTable" => "payments",
	"m_srcTableName" => "daily_reportS"
));

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

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

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

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

$proto372["m_having"] = $obj;
$proto372["m_fieldlist"] = array();
						$proto382=array();
			$proto383=array();
$proto383["m_functiontype"] = "SQLF_CUSTOM";
$proto383["m_arguments"] = array();
						$obj = new SQLNonParsed(array(
	"m_sql" => "`date_time`"
));

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

$proto382["m_sql"] = "DATE(`date_time`)";
$proto382["m_srcTableName"] = "daily_reportS";
$proto382["m_expr"]=$obj;
$proto382["m_alias"] = "KK2";
$obj = new SQLFieldListItem($proto382);

$proto372["m_fieldlist"][]=$obj;
						$proto385=array();
			$proto386=array();
$proto386["m_functiontype"] = "SQLF_SUM";
$proto386["m_arguments"] = array();
						$obj = new SQLField(array(
	"m_strName" => "amount",
	"m_strTable" => "payments",
	"m_srcTableName" => "daily_reportS"
));

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

$proto385["m_sql"] = "SUM(`amount`)";
$proto385["m_srcTableName"] = "daily_reportS";
$proto385["m_expr"]=$obj;
$proto385["m_alias"] = "st43";
$obj = new SQLFieldListItem($proto385);

$proto372["m_fieldlist"][]=$obj;
$proto372["m_fromlist"] = array();
												$proto388=array();
$proto388["m_link"] = "SQLL_MAIN";
			$proto389=array();
$proto389["m_strName"] = "payments";
$proto389["m_srcTableName"] = "daily_reportS";
$proto389["m_columns"] = array();
$proto389["m_columns"][] = "id";
$proto389["m_columns"][] = "sales_id";
$proto389["m_columns"][] = "type";
$proto389["m_columns"][] = "amount";
$proto389["m_columns"][] = "cheque_number";
$proto389["m_columns"][] = "cheque_date";
$proto389["m_columns"][] = "hide";
$proto389["m_columns"][] = "status";
$proto389["m_columns"][] = "opening_balance_id";
$proto389["m_columns"][] = "outlet";
$proto389["m_columns"][] = "date_time";
$proto389["m_columns"][] = "user";
$proto389["m_columns"][] = "status_2";
$obj = new SQLTable($proto389);

$proto388["m_table"] = $obj;
$proto388["m_sql"] = "`payments`";
$proto388["m_alias"] = "";
$proto388["m_srcTableName"] = "daily_reportS";
$proto390=array();
$proto390["m_sql"] = "";
$proto390["m_uniontype"] = "SQLL_UNKNOWN";
	$obj = new SQLNonParsed(array(
	"m_sql" => ""
));

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

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

$proto372["m_fromlist"][]=$obj;
$proto372["m_groupby"] = array();
												$proto392=array();
						$proto393=array();
$proto393["m_functiontype"] = "SQLF_CUSTOM";
$proto393["m_arguments"] = array();
						$obj = new SQLNonParsed(array(
	"m_sql" => "`date_time`"
));

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

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

$proto372["m_groupby"][]=$obj;
$proto372["m_orderby"] = array();
$proto372["m_srcTableName"]="daily_reportS";		
$obj = new SQLQuery($proto372);

$proto371["m_table"] = $obj;
$proto371["m_sql"] = "LEFT JOIN ( SELECT DATE(`date_time`) AS KK2 , SUM(`amount`) AS st43 FROM `payments` WHERE `status`=\"sales\" and type=\"Cheque\" GROUP BY DATE(`date_time`)) AS pur43 ON daily_report.DATE = pur43.KK2";
$proto371["m_alias"] = "pur43";
$proto371["m_srcTableName"] = "daily_reportS";
$proto395=array();
$proto395["m_sql"] = "daily_report.DATE = pur43.KK2";
$proto395["m_uniontype"] = "SQLL_UNKNOWN";
						$obj = new SQLField(array(
	"m_strName" => "date",
	"m_strTable" => "daily_report",
	"m_srcTableName" => "daily_reportS"
));

$proto395["m_column"]=$obj;
$proto395["m_contained"] = array();
$proto395["m_strCase"] = "= pur43.KK2";
$proto395["m_havingmode"] = false;
$proto395["m_inBrackets"] = false;
$proto395["m_useAlias"] = false;
$obj = new SQLLogicalExpr($proto395);

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

$proto0["m_fromlist"][]=$obj;
												$proto397=array();
$proto397["m_link"] = "SQLL_LEFTJOIN";
			$proto398=array();
$proto398["m_strHead"] = " SELECT";
$proto398["m_strFieldList"] = "DATE(`date_time`) AS KK2 , SUM(`amount`) AS st44";
$proto398["m_strFrom"] = "FROM `payments`";
$proto398["m_strWhere"] = "`status`=\"sales\"and type=\"Cash\"";
$proto398["m_strOrderBy"] = "";
	
		;
			$proto398["cipherer"] = null;
$proto400=array();
$proto400["m_sql"] = "`status`=\"sales\"and type=\"Cash\"";
$proto400["m_uniontype"] = "SQLL_AND";
	$obj = new SQLNonParsed(array(
	"m_sql" => "`status`=\"sales\"and type=\"Cash\""
));

$proto400["m_column"]=$obj;
$proto400["m_contained"] = array();
						$proto402=array();
$proto402["m_sql"] = "`status`=\"sales\"";
$proto402["m_uniontype"] = "SQLL_UNKNOWN";
						$obj = new SQLField(array(
	"m_strName" => "status",
	"m_strTable" => "payments",
	"m_srcTableName" => "daily_reportS"
));

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

			$proto400["m_contained"][]=$obj;
						$proto404=array();
$proto404["m_sql"] = "type=\"Cash\"";
$proto404["m_uniontype"] = "SQLL_UNKNOWN";
						$obj = new SQLField(array(
	"m_strName" => "type",
	"m_strTable" => "payments",
	"m_srcTableName" => "daily_reportS"
));

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

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

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

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

$proto398["m_having"] = $obj;
$proto398["m_fieldlist"] = array();
						$proto408=array();
			$proto409=array();
$proto409["m_functiontype"] = "SQLF_CUSTOM";
$proto409["m_arguments"] = array();
						$obj = new SQLNonParsed(array(
	"m_sql" => "`date_time`"
));

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

$proto408["m_sql"] = "DATE(`date_time`)";
$proto408["m_srcTableName"] = "daily_reportS";
$proto408["m_expr"]=$obj;
$proto408["m_alias"] = "KK2";
$obj = new SQLFieldListItem($proto408);

$proto398["m_fieldlist"][]=$obj;
						$proto411=array();
			$proto412=array();
$proto412["m_functiontype"] = "SQLF_SUM";
$proto412["m_arguments"] = array();
						$obj = new SQLField(array(
	"m_strName" => "amount",
	"m_strTable" => "payments",
	"m_srcTableName" => "daily_reportS"
));

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

$proto411["m_sql"] = "SUM(`amount`)";
$proto411["m_srcTableName"] = "daily_reportS";
$proto411["m_expr"]=$obj;
$proto411["m_alias"] = "st44";
$obj = new SQLFieldListItem($proto411);

$proto398["m_fieldlist"][]=$obj;
$proto398["m_fromlist"] = array();
												$proto414=array();
$proto414["m_link"] = "SQLL_MAIN";
			$proto415=array();
$proto415["m_strName"] = "payments";
$proto415["m_srcTableName"] = "daily_reportS";
$proto415["m_columns"] = array();
$proto415["m_columns"][] = "id";
$proto415["m_columns"][] = "sales_id";
$proto415["m_columns"][] = "type";
$proto415["m_columns"][] = "amount";
$proto415["m_columns"][] = "cheque_number";
$proto415["m_columns"][] = "cheque_date";
$proto415["m_columns"][] = "hide";
$proto415["m_columns"][] = "status";
$proto415["m_columns"][] = "opening_balance_id";
$proto415["m_columns"][] = "outlet";
$proto415["m_columns"][] = "date_time";
$proto415["m_columns"][] = "user";
$proto415["m_columns"][] = "status_2";
$obj = new SQLTable($proto415);

$proto414["m_table"] = $obj;
$proto414["m_sql"] = "`payments`";
$proto414["m_alias"] = "";
$proto414["m_srcTableName"] = "daily_reportS";
$proto416=array();
$proto416["m_sql"] = "";
$proto416["m_uniontype"] = "SQLL_UNKNOWN";
	$obj = new SQLNonParsed(array(
	"m_sql" => ""
));

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

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

$proto398["m_fromlist"][]=$obj;
$proto398["m_groupby"] = array();
												$proto418=array();
						$proto419=array();
$proto419["m_functiontype"] = "SQLF_CUSTOM";
$proto419["m_arguments"] = array();
						$obj = new SQLNonParsed(array(
	"m_sql" => "`date_time`"
));

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

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

$proto398["m_groupby"][]=$obj;
$proto398["m_orderby"] = array();
$proto398["m_srcTableName"]="daily_reportS";		
$obj = new SQLQuery($proto398);

$proto397["m_table"] = $obj;
$proto397["m_sql"] = "LEFT JOIN ( SELECT DATE(`date_time`) AS KK2 , SUM(`amount`) AS st44 FROM `payments` WHERE `status`=\"sales\"and type=\"Cash\" GROUP BY DATE(`date_time`)) AS pur44 ON daily_report.DATE = pur44.KK2";
$proto397["m_alias"] = "pur44";
$proto397["m_srcTableName"] = "daily_reportS";
$proto421=array();
$proto421["m_sql"] = "daily_report.DATE = pur44.KK2";
$proto421["m_uniontype"] = "SQLL_UNKNOWN";
						$obj = new SQLField(array(
	"m_strName" => "date",
	"m_strTable" => "daily_report",
	"m_srcTableName" => "daily_reportS"
));

$proto421["m_column"]=$obj;
$proto421["m_contained"] = array();
$proto421["m_strCase"] = "= pur44.KK2";
$proto421["m_havingmode"] = false;
$proto421["m_inBrackets"] = false;
$proto421["m_useAlias"] = false;
$obj = new SQLLogicalExpr($proto421);

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

$proto0["m_fromlist"][]=$obj;
												$proto423=array();
$proto423["m_link"] = "SQLL_LEFTJOIN";
			$proto424=array();
$proto424["m_strHead"] = " SELECT";
$proto424["m_strFieldList"] = "DATE(`date_time`) AS KK2 , SUM(`amount`) AS st45";
$proto424["m_strFrom"] = "FROM `payments`";
$proto424["m_strWhere"] = "`status`=\"opening balance\"and type=\"Cash\"";
$proto424["m_strOrderBy"] = "";
	
		;
			$proto424["cipherer"] = null;
$proto426=array();
$proto426["m_sql"] = "`status`=\"opening balance\"and type=\"Cash\"";
$proto426["m_uniontype"] = "SQLL_AND";
	$obj = new SQLNonParsed(array(
	"m_sql" => "`status`=\"opening balance\"and type=\"Cash\""
));

$proto426["m_column"]=$obj;
$proto426["m_contained"] = array();
						$proto428=array();
$proto428["m_sql"] = "`status`=\"opening balance\"";
$proto428["m_uniontype"] = "SQLL_UNKNOWN";
						$obj = new SQLField(array(
	"m_strName" => "status",
	"m_strTable" => "payments",
	"m_srcTableName" => "daily_reportS"
));

$proto428["m_column"]=$obj;
$proto428["m_contained"] = array();
$proto428["m_strCase"] = "=\"opening balance\"";
$proto428["m_havingmode"] = false;
$proto428["m_inBrackets"] = false;
$proto428["m_useAlias"] = false;
$obj = new SQLLogicalExpr($proto428);

			$proto426["m_contained"][]=$obj;
						$proto430=array();
$proto430["m_sql"] = "type=\"Cash\"";
$proto430["m_uniontype"] = "SQLL_UNKNOWN";
						$obj = new SQLField(array(
	"m_strName" => "type",
	"m_strTable" => "payments",
	"m_srcTableName" => "daily_reportS"
));

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

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

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

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

$proto424["m_having"] = $obj;
$proto424["m_fieldlist"] = array();
						$proto434=array();
			$proto435=array();
$proto435["m_functiontype"] = "SQLF_CUSTOM";
$proto435["m_arguments"] = array();
						$obj = new SQLNonParsed(array(
	"m_sql" => "`date_time`"
));

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

$proto434["m_sql"] = "DATE(`date_time`)";
$proto434["m_srcTableName"] = "daily_reportS";
$proto434["m_expr"]=$obj;
$proto434["m_alias"] = "KK2";
$obj = new SQLFieldListItem($proto434);

$proto424["m_fieldlist"][]=$obj;
						$proto437=array();
			$proto438=array();
$proto438["m_functiontype"] = "SQLF_SUM";
$proto438["m_arguments"] = array();
						$obj = new SQLField(array(
	"m_strName" => "amount",
	"m_strTable" => "payments",
	"m_srcTableName" => "daily_reportS"
));

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

$proto437["m_sql"] = "SUM(`amount`)";
$proto437["m_srcTableName"] = "daily_reportS";
$proto437["m_expr"]=$obj;
$proto437["m_alias"] = "st45";
$obj = new SQLFieldListItem($proto437);

$proto424["m_fieldlist"][]=$obj;
$proto424["m_fromlist"] = array();
												$proto440=array();
$proto440["m_link"] = "SQLL_MAIN";
			$proto441=array();
$proto441["m_strName"] = "payments";
$proto441["m_srcTableName"] = "daily_reportS";
$proto441["m_columns"] = array();
$proto441["m_columns"][] = "id";
$proto441["m_columns"][] = "sales_id";
$proto441["m_columns"][] = "type";
$proto441["m_columns"][] = "amount";
$proto441["m_columns"][] = "cheque_number";
$proto441["m_columns"][] = "cheque_date";
$proto441["m_columns"][] = "hide";
$proto441["m_columns"][] = "status";
$proto441["m_columns"][] = "opening_balance_id";
$proto441["m_columns"][] = "outlet";
$proto441["m_columns"][] = "date_time";
$proto441["m_columns"][] = "user";
$proto441["m_columns"][] = "status_2";
$obj = new SQLTable($proto441);

$proto440["m_table"] = $obj;
$proto440["m_sql"] = "`payments`";
$proto440["m_alias"] = "";
$proto440["m_srcTableName"] = "daily_reportS";
$proto442=array();
$proto442["m_sql"] = "";
$proto442["m_uniontype"] = "SQLL_UNKNOWN";
	$obj = new SQLNonParsed(array(
	"m_sql" => ""
));

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

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

$proto424["m_fromlist"][]=$obj;
$proto424["m_groupby"] = array();
												$proto444=array();
						$proto445=array();
$proto445["m_functiontype"] = "SQLF_CUSTOM";
$proto445["m_arguments"] = array();
						$obj = new SQLNonParsed(array(
	"m_sql" => "`date_time`"
));

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

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

$proto424["m_groupby"][]=$obj;
$proto424["m_orderby"] = array();
$proto424["m_srcTableName"]="daily_reportS";		
$obj = new SQLQuery($proto424);

$proto423["m_table"] = $obj;
$proto423["m_sql"] = "LEFT JOIN ( SELECT DATE(`date_time`) AS KK2 , SUM(`amount`) AS st45 FROM `payments` WHERE `status`=\"opening balance\"and type=\"Cash\" GROUP BY DATE(`date_time`)) AS pur45 ON daily_report.DATE = pur45.KK2";
$proto423["m_alias"] = "pur45";
$proto423["m_srcTableName"] = "daily_reportS";
$proto447=array();
$proto447["m_sql"] = "daily_report.DATE = pur45.KK2";
$proto447["m_uniontype"] = "SQLL_UNKNOWN";
						$obj = new SQLField(array(
	"m_strName" => "date",
	"m_strTable" => "daily_report",
	"m_srcTableName" => "daily_reportS"
));

$proto447["m_column"]=$obj;
$proto447["m_contained"] = array();
$proto447["m_strCase"] = "= pur45.KK2";
$proto447["m_havingmode"] = false;
$proto447["m_inBrackets"] = false;
$proto447["m_useAlias"] = false;
$obj = new SQLLogicalExpr($proto447);

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

$proto0["m_fromlist"][]=$obj;
$proto0["m_groupby"] = array();
$proto0["m_orderby"] = array();
												$proto449=array();
						$obj = new SQLField(array(
	"m_strName" => "id",
	"m_strTable" => "daily_report",
	"m_srcTableName" => "daily_reportS"
));

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

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

	return $obj;
}
$queryData_daily_reports = createSqlQuery_daily_reports();


	
		;

																							

$tdatadaily_reports[".sqlquery"] = $queryData_daily_reports;



$tableEvents["daily_reportS"] = new eventsBase;
$tdatadaily_reports[".hasEvents"] = false;

?>