<?php
global $runnerTableSettings;
$runnerTableSettings['memcalc_Pdto view'] = array(
	'name' => 'memcalc_Pdto view',
	'type' => 1,
	'shortName' => 'tb_mcalculo1',
	'pagesByType' => array(
		'add' => array( 
			'add' 
		),
		'edit' => array( 
			'edit' 
		),
		'view' => array( 
			'view' 
		),
		'list' => array( 
			'list' 
		),
		'print' => array( 
			'print' 
		),
		'search' => array( 
			'search' 
		) 
	),
	'pageTypes' => array(
		'add' => 'add',
		'edit' => 'edit',
		'view' => 'view',
		'list' => 'list',
		'print' => 'print',
		'search' => 'search' 
	),
	'defaultPages' => array(
		'add' => 'add',
		'edit' => 'edit',
		'view' => 'view',
		'list' => 'list',
		'print' => 'print',
		'search' => 'search' 
	),
	'afterEditAction' => 0,
	'afterEditDetails' => 'memcalc_Pdto view',
	'afterAddAction' => 0,
	'afterAddDetail' => 'memcalc_Pdto view',
	'detailsBadgeColor' => '6b8e23',
	'sql' => 'SELECT
	tb_mcalculo.mcalcID,
	tb_mcalculo.pdtoID as MCPdtoId,
	tb_produtos.referencia,
	tb_mcalculo.`data`,
	tb_mcalculo.versao,
	tb_mcalculo.componente,
	tb_mcalculo.material,
	tb_mcalculo.consumo,
	tb_mcalculo.quebra,
	tb_mcalculo.tempo,
	tb_mcalculo.txo,
	tb_mcalculo.divisao,
	tb_mcalculo.Rat_modelagem,
	tb_mcalculo.vigente AS atual,
	(tb_mcalculo.tempo * tb_mcalculo.txo)*
	((tb_custominuto.salari_base*tb_custominuto.encargos)*tb_custominuto.funcionarios)/(tb_custominuto.hrs_trab*60) AS CMO,
	(tb_cotacao_material.cotacao*(tb_mcalculo.consumo*tb_mcalculo.quebra)) AS CMat,
	tb_cotacao_material.vigente AS cmatvig,
	((sum(tb_varggf.projecao)/tb_custominuto.hrs_trab)/60)*(tb_mcalculo.tempo * tb_mcalculo.txo) AS GGF,
	tb_cotacao_material.vigente AS cotavig,
	tb_varggf.vigente AS ggf_vig,
	tb_mcalculo.markup,
	tb_markups.mkpID,
	(((tb_markups.Mlucro+tb_markups.ofiscal+tb_markups.desp_financ+tb_markups.comissoes)/(100-
	(tb_markups.Mlucro+tb_markups.ofiscal+tb_markups.desp_financ+tb_markups.comissoes)))+1) AS MKP,
	(((tb_mcalculo.tempo * tb_mcalculo.txo)*
	((tb_custominuto.salari_base*tb_custominuto.encargos)*tb_custominuto.funcionarios)/(tb_custominuto.hrs_trab*60)) +
	(tb_cotacao_material.cotacao*(tb_mcalculo.consumo*tb_mcalculo.quebra)) +
	(((sum(tb_varggf.projecao)/tb_custominuto.hrs_trab)/60)*(tb_mcalculo.tempo * tb_mcalculo.txo))) AS CBruto,
	(((tb_mcalculo.tempo * tb_mcalculo.txo)*
	((tb_custominuto.salari_base*tb_custominuto.encargos)*tb_custominuto.funcionarios)/(tb_custominuto.hrs_trab*60)) +
	(tb_cotacao_material.cotacao*(tb_mcalculo.consumo*tb_mcalculo.quebra)) +
	(((sum(tb_varggf.projecao)/tb_custominuto.hrs_trab)/60)*(tb_mcalculo.tempo * tb_mcalculo.txo))) *
	(((tb_markups.Mlucro+tb_markups.ofiscal+tb_markups.desp_financ+tb_markups.comissoes)/(100-
	(tb_markups.Mlucro+tb_markups.ofiscal+tb_markups.desp_financ+tb_markups.comissoes)))+1) AS PVenda,
	tb_produtos.pdtoiD
FROM
	tb_mcalculo
	INNER JOIN tb_custominuto ON tb_custominuto.custominID = tb_mcalculo.divisao
	INNER JOIN tb_cotacao_material ON tb_cotacao_material.cotamatiD = tb_mcalculo.material,
	tb_varggf,
	tb_markups,
	tb_produtos
WHERE
tb_cotacao_material.vigente =1 AND tb_varggf.vigente =1 AND tb_mcalculo.markup =tb_markups.mkpID and tb_produtos.pdtoiD=tb_mcalculo.pdtoID
GROUP BY
	tb_mcalculo.mcalcID
',
	'keyFields' => array( 
		'mcalcID' 
	),
	'deviceHideFields' => array(
		'1' => array( 
			 
		),
		'5' => array( 
			 
		) 
	),
	'fields' => array(
		'mcalcID' => array(
			'name' => 'mcalcID',
			'goodName' => 'mcalcID',
			'strField' => 'mcalcID',
			'index' => 1,
			'type' => 3,
			'autoinc' => true,
			'sqlExpression' => 'tb_mcalculo.mcalcID',
			'viewFormats' => array(
				'view' => array(
					 
				) 
			),
			'editFormats' => array(
				'edit' => array(
					 
				) 
			),
			'tableName' => 'tb_mcalculo' 
		),
		'data' => array(
			'name' => 'data',
			'goodName' => 'data',
			'strField' => 'data',
			'index' => 4,
			'type' => 7,
			'sqlExpression' => 'tb_mcalculo.`data`',
			'viewFormats' => array(
				'view' => array(
					'format' => 'Short Date' 
				) 
			),
			'editFormats' => array(
				'edit' => array(
					'format' => 'Date',
					'dateEditType' => 11 
				) 
			),
			'tableName' => 'tb_mcalculo' 
		),
		'versao' => array(
			'name' => 'versao',
			'goodName' => 'versao',
			'strField' => 'versao',
			'index' => 5,
			'sqlExpression' => 'tb_mcalculo.versao',
			'viewFormats' => array(
				'view' => array(
					 
				) 
			),
			'editFormats' => array(
				'edit' => array(
					 
				) 
			),
			'tableName' => 'tb_mcalculo' 
		),
		'componente' => array(
			'name' => 'componente',
			'goodName' => 'componente',
			'strField' => 'componente',
			'index' => 6,
			'sqlExpression' => 'tb_mcalculo.componente',
			'viewFormats' => array(
				'view' => array(
					 
				) 
			),
			'editFormats' => array(
				'edit' => array(
					'format' => 'Lookup wizard',
					'required' => true,
					'lookupType' => 2,
					'lookupTable' => 'tb_componentes',
					'lookupTableConnection' => 'conn',
					'lookupLinkField' => 'componente',
					'lookupDisplayField' => 'componente',
					'lookupOrderBy' => 'componente' 
				) 
			),
			'tableName' => 'tb_mcalculo',
			'viewLinkTable' => 'tb_componentes',
			'viewLinkLookup' => true 
		),
		'material' => array(
			'name' => 'material',
			'goodName' => 'material',
			'strField' => 'material',
			'index' => 7,
			'type' => 3,
			'sqlExpression' => 'tb_mcalculo.material',
			'viewFormats' => array(
				'view' => array(
					 
				) 
			),
			'editFormats' => array(
				'edit' => array(
					'format' => 'Lookup wizard',
					'required' => true,
					'lookupType' => 2,
					'lookupTable' => 'tb_materiais',
					'lookupTableConnection' => 'conn',
					'lookupLinkField' => 'materialID',
					'lookupDisplayField' => 'material',
					'lookupOrderBy' => 'material',
					'lookupDependentFields' => array( 
						array(
							'masterField' => 'componente',
							'lookupField' => '' 
						) 
					) 
				) 
			),
			'tableName' => 'tb_mcalculo',
			'viewLinkTable' => 'tb_materiais',
			'viewLinkLookup' => true 
		),
		'consumo' => array(
			'name' => 'consumo',
			'goodName' => 'consumo',
			'strField' => 'consumo',
			'index' => 8,
			'type' => 14,
			'sqlExpression' => 'tb_mcalculo.consumo',
			'viewFormats' => array(
				'view' => array(
					'format' => 'Number',
					'numberFractionalDigits' => 6 
				) 
			),
			'editFormats' => array(
				'edit' => array(
					 
				) 
			),
			'tableName' => 'tb_mcalculo' 
		),
		'quebra' => array(
			'name' => 'quebra',
			'goodName' => 'quebra',
			'strField' => 'quebra',
			'index' => 9,
			'type' => 14,
			'sqlExpression' => 'tb_mcalculo.quebra',
			'viewFormats' => array(
				'view' => array(
					'format' => 'Number' 
				) 
			),
			'editFormats' => array(
				'edit' => array(
					'format' => 'Lookup wizard',
					'required' => true,
					'lookupType' => 0,
					'lookupValues' => array( 
						'1,05',
						'1,06',
						'1,07',
						'1,08',
						'1,09',
						'1,10',
						'1,11',
						'1,12',
						'1,13',
						'1,14',
						'1,15',
						'1,20',
						'1,25',
						'1,30' 
					) 
				) 
			),
			'tableName' => 'tb_mcalculo' 
		),
		'tempo' => array(
			'name' => 'tempo',
			'goodName' => 'tempo',
			'strField' => 'tempo',
			'index' => 10,
			'type' => 14,
			'sqlExpression' => 'tb_mcalculo.tempo',
			'viewFormats' => array(
				'view' => array(
					'format' => 'Number',
					'numberFractionalDigits' => 3 
				) 
			),
			'editFormats' => array(
				'edit' => array(
					 
				) 
			),
			'tableName' => 'tb_mcalculo' 
		),
		'txo' => array(
			'name' => 'txo',
			'goodName' => 'txo',
			'strField' => 'txo',
			'index' => 11,
			'type' => 14,
			'sqlExpression' => 'tb_mcalculo.txo',
			'viewFormats' => array(
				'view' => array(
					'format' => 'Number' 
				) 
			),
			'editFormats' => array(
				'edit' => array(
					'format' => 'Lookup wizard',
					'required' => true,
					'lookupType' => 0,
					'lookupValues' => array( 
						'1,05',
						'1,08',
						'1,10',
						'1,15',
						'1,20',
						'1,25',
						'1,30',
						'1,35',
						'1,40',
						'1,15',
						'1,50' 
					) 
				) 
			),
			'tableName' => 'tb_mcalculo' 
		),
		'divisao' => array(
			'name' => 'divisao',
			'goodName' => 'divisao',
			'strField' => 'divisao',
			'index' => 12,
			'type' => 3,
			'sqlExpression' => 'tb_mcalculo.divisao',
			'viewFormats' => array(
				'view' => array(
					 
				) 
			),
			'editFormats' => array(
				'edit' => array(
					'format' => 'Lookup wizard',
					'required' => true,
					'lookupType' => 2,
					'lookupTable' => 'tb_custominuto',
					'lookupTableConnection' => 'conn',
					'lookupLinkField' => 'custominID',
					'lookupDisplayField' => 'divisao',
					'lookupOrderBy' => 'divisao' 
				) 
			),
			'tableName' => 'tb_mcalculo',
			'viewLinkTable' => 'tb_custominuto',
			'viewLinkLookup' => true 
		),
		'markup' => array(
			'name' => 'markup',
			'goodName' => 'markup',
			'strField' => 'markup',
			'index' => 21,
			'type' => 3,
			'sqlExpression' => 'tb_mcalculo.markup',
			'viewFormats' => array(
				'view' => array(
					'format' => 'Number' 
				) 
			),
			'editFormats' => array(
				'edit' => array(
					'format' => 'Lookup wizard',
					'required' => true,
					'lookupType' => 2,
					'lookupTable' => 'dbw_mkps',
					'lookupTableConnection' => 'conn',
					'lookupLinkField' => 'mkpID',
					'lookupDisplayField' => 'Mlucro',
					'lookupOrderBy' => 'Mlucro' 
				) 
			),
			'tableName' => 'tb_mcalculo' 
		),
		'Rat_modelagem' => array(
			'name' => 'Rat_modelagem',
			'goodName' => 'Rat_modelagem',
			'strField' => 'Rat_modelagem',
			'index' => 13,
			'type' => 14,
			'sqlExpression' => 'tb_mcalculo.Rat_modelagem',
			'viewFormats' => array(
				'view' => array(
					'format' => 'Currency' 
				) 
			),
			'editFormats' => array(
				'edit' => array(
					 
				) 
			),
			'tableName' => 'tb_mcalculo' 
		),
		'CMO' => array(
			'name' => 'CMO',
			'goodName' => 'CMO',
			'strField' => 'CMO',
			'index' => 15,
			'type' => 14,
			'sqlExpression' => '(tb_mcalculo.tempo * tb_mcalculo.txo)*
	((tb_custominuto.salari_base*tb_custominuto.encargos)*tb_custominuto.funcionarios)/(tb_custominuto.hrs_trab*60)',
			'viewFormats' => array(
				'view' => array(
					'format' => 'Currency' 
				) 
			),
			'editFormats' => array(
				'edit' => array(
					 
				) 
			),
			'tableName' => '' 
		),
		'CMat' => array(
			'name' => 'CMat',
			'goodName' => 'CMat',
			'strField' => 'CMat',
			'index' => 16,
			'type' => 14,
			'sqlExpression' => '(tb_cotacao_material.cotacao*(tb_mcalculo.consumo*tb_mcalculo.quebra))',
			'viewFormats' => array(
				'view' => array(
					'format' => 'Currency' 
				) 
			),
			'editFormats' => array(
				'edit' => array(
					 
				) 
			),
			'tableName' => '' 
		),
		'GGF' => array(
			'name' => 'GGF',
			'goodName' => 'GGF',
			'strField' => 'GGF',
			'index' => 18,
			'type' => 14,
			'sqlExpression' => '((sum(tb_varggf.projecao)/tb_custominuto.hrs_trab)/60)*(tb_mcalculo.tempo * tb_mcalculo.txo)',
			'viewFormats' => array(
				'view' => array(
					'format' => 'Currency' 
				) 
			),
			'editFormats' => array(
				'edit' => array(
					 
				) 
			),
			'tableName' => '' 
		),
		'mkpID' => array(
			'name' => 'mkpID',
			'goodName' => 'mkpID',
			'strField' => 'mkpID',
			'index' => 22,
			'type' => 3,
			'sqlExpression' => 'tb_markups.mkpID',
			'viewFormats' => array(
				'view' => array(
					 
				) 
			),
			'editFormats' => array(
				'edit' => array(
					 
				) 
			),
			'tableName' => 'tb_markups' 
		),
		'MKP' => array(
			'name' => 'MKP',
			'goodName' => 'MKP',
			'strField' => 'MKP',
			'index' => 23,
			'type' => 14,
			'sqlExpression' => '(((tb_markups.Mlucro+tb_markups.ofiscal+tb_markups.desp_financ+tb_markups.comissoes)/(100-
	(tb_markups.Mlucro+tb_markups.ofiscal+tb_markups.desp_financ+tb_markups.comissoes)))+1)',
			'viewFormats' => array(
				'view' => array(
					'format' => 'Number' 
				) 
			),
			'editFormats' => array(
				'edit' => array(
					 
				) 
			),
			'tableName' => '' 
		),
		'CBruto' => array(
			'name' => 'CBruto',
			'goodName' => 'CBruto',
			'strField' => 'CBruto',
			'index' => 24,
			'type' => 14,
			'sqlExpression' => '(((tb_mcalculo.tempo * tb_mcalculo.txo)*
	((tb_custominuto.salari_base*tb_custominuto.encargos)*tb_custominuto.funcionarios)/(tb_custominuto.hrs_trab*60)) +
	(tb_cotacao_material.cotacao*(tb_mcalculo.consumo*tb_mcalculo.quebra)) +
	(((sum(tb_varggf.projecao)/tb_custominuto.hrs_trab)/60)*(tb_mcalculo.tempo * tb_mcalculo.txo)))',
			'viewFormats' => array(
				'view' => array(
					'format' => 'Currency' 
				) 
			),
			'editFormats' => array(
				'edit' => array(
					 
				) 
			),
			'tableName' => '' 
		),
		'PVenda' => array(
			'name' => 'PVenda',
			'goodName' => 'PVenda',
			'strField' => 'PVenda',
			'index' => 25,
			'type' => 14,
			'sqlExpression' => '(((tb_mcalculo.tempo * tb_mcalculo.txo)*
	((tb_custominuto.salari_base*tb_custominuto.encargos)*tb_custominuto.funcionarios)/(tb_custominuto.hrs_trab*60)) +
	(tb_cotacao_material.cotacao*(tb_mcalculo.consumo*tb_mcalculo.quebra)) +
	(((sum(tb_varggf.projecao)/tb_custominuto.hrs_trab)/60)*(tb_mcalculo.tempo * tb_mcalculo.txo))) *
	(((tb_markups.Mlucro+tb_markups.ofiscal+tb_markups.desp_financ+tb_markups.comissoes)/(100-
	(tb_markups.Mlucro+tb_markups.ofiscal+tb_markups.desp_financ+tb_markups.comissoes)))+1)',
			'viewFormats' => array(
				'view' => array(
					'format' => 'Currency' 
				) 
			),
			'editFormats' => array(
				'edit' => array(
					 
				) 
			),
			'tableName' => '' 
		),
		'atual' => array(
			'name' => 'atual',
			'goodName' => 'atual',
			'strField' => 'vigente',
			'index' => 14,
			'type' => 3,
			'sqlExpression' => 'tb_mcalculo.vigente',
			'viewFormats' => array(
				'view' => array(
					 
				) 
			),
			'editFormats' => array(
				'edit' => array(
					'format' => 'Checkbox' 
				) 
			),
			'tableName' => 'tb_mcalculo' 
		),
		'cotavig' => array(
			'name' => 'cotavig',
			'goodName' => 'cotavig',
			'strField' => 'vigente',
			'index' => 19,
			'type' => 3,
			'sqlExpression' => 'tb_cotacao_material.vigente',
			'viewFormats' => array(
				'view' => array(
					 
				) 
			),
			'editFormats' => array(
				'edit' => array(
					 
				) 
			),
			'tableName' => 'tb_cotacao_material' 
		),
		'ggf_vig' => array(
			'name' => 'ggf_vig',
			'goodName' => 'ggf_vig',
			'strField' => 'vigente',
			'index' => 20,
			'type' => 3,
			'sqlExpression' => 'tb_varggf.vigente',
			'viewFormats' => array(
				'view' => array(
					 
				) 
			),
			'editFormats' => array(
				'edit' => array(
					 
				) 
			),
			'tableName' => 'tb_varggf' 
		),
		'cmatvig' => array(
			'name' => 'cmatvig',
			'goodName' => 'cmatvig',
			'strField' => 'vigente',
			'index' => 17,
			'type' => 3,
			'sqlExpression' => 'tb_cotacao_material.vigente',
			'viewFormats' => array(
				'view' => array(
					 
				) 
			),
			'editFormats' => array(
				'edit' => array(
					 
				) 
			),
			'tableName' => 'tb_cotacao_material' 
		),
		'referencia' => array(
			'name' => 'referencia',
			'goodName' => 'referencia',
			'strField' => 'referencia',
			'index' => 3,
			'sqlExpression' => 'tb_produtos.referencia',
			'viewFormats' => array(
				'view' => array(
					 
				) 
			),
			'editFormats' => array(
				'edit' => array(
					 
				) 
			),
			'tableName' => 'tb_produtos' 
		),
		'pdtoiD' => array(
			'name' => 'pdtoiD',
			'goodName' => 'pdtoiD',
			'strField' => 'pdtoiD',
			'index' => 26,
			'type' => 3,
			'sqlExpression' => 'tb_produtos.pdtoiD',
			'viewFormats' => array(
				'view' => array(
					 
				) 
			),
			'editFormats' => array(
				'edit' => array(
					 
				) 
			),
			'tableName' => 'tb_produtos' 
		),
		'MCPdtoId' => array(
			'name' => 'MCPdtoId',
			'goodName' => 'MCPdtoId',
			'strField' => 'pdtoID',
			'index' => 2,
			'type' => 3,
			'sqlExpression' => 'tb_mcalculo.pdtoID',
			'viewFormats' => array(
				'view' => array(
					 
				) 
			),
			'editFormats' => array(
				'edit' => array(
					 
				) 
			),
			'tableName' => 'tb_mcalculo' 
		) 
	),
	'query' => array(
		'sql' => 'SELECT
	tb_mcalculo.mcalcID,
	tb_mcalculo.pdtoID as MCPdtoId,
	tb_produtos.referencia,
	tb_mcalculo.`data`,
	tb_mcalculo.versao,
	tb_mcalculo.componente,
	tb_mcalculo.material,
	tb_mcalculo.consumo,
	tb_mcalculo.quebra,
	tb_mcalculo.tempo,
	tb_mcalculo.txo,
	tb_mcalculo.divisao,
	tb_mcalculo.Rat_modelagem,
	tb_mcalculo.vigente AS atual,
	(tb_mcalculo.tempo * tb_mcalculo.txo)*
	((tb_custominuto.salari_base*tb_custominuto.encargos)*tb_custominuto.funcionarios)/(tb_custominuto.hrs_trab*60) AS CMO,
	(tb_cotacao_material.cotacao*(tb_mcalculo.consumo*tb_mcalculo.quebra)) AS CMat,
	tb_cotacao_material.vigente AS cmatvig,
	((sum(tb_varggf.projecao)/tb_custominuto.hrs_trab)/60)*(tb_mcalculo.tempo * tb_mcalculo.txo) AS GGF,
	tb_cotacao_material.vigente AS cotavig,
	tb_varggf.vigente AS ggf_vig,
	tb_mcalculo.markup,
	tb_markups.mkpID,
	(((tb_markups.Mlucro+tb_markups.ofiscal+tb_markups.desp_financ+tb_markups.comissoes)/(100-
	(tb_markups.Mlucro+tb_markups.ofiscal+tb_markups.desp_financ+tb_markups.comissoes)))+1) AS MKP,
	(((tb_mcalculo.tempo * tb_mcalculo.txo)*
	((tb_custominuto.salari_base*tb_custominuto.encargos)*tb_custominuto.funcionarios)/(tb_custominuto.hrs_trab*60)) +
	(tb_cotacao_material.cotacao*(tb_mcalculo.consumo*tb_mcalculo.quebra)) +
	(((sum(tb_varggf.projecao)/tb_custominuto.hrs_trab)/60)*(tb_mcalculo.tempo * tb_mcalculo.txo))) AS CBruto,
	(((tb_mcalculo.tempo * tb_mcalculo.txo)*
	((tb_custominuto.salari_base*tb_custominuto.encargos)*tb_custominuto.funcionarios)/(tb_custominuto.hrs_trab*60)) +
	(tb_cotacao_material.cotacao*(tb_mcalculo.consumo*tb_mcalculo.quebra)) +
	(((sum(tb_varggf.projecao)/tb_custominuto.hrs_trab)/60)*(tb_mcalculo.tempo * tb_mcalculo.txo))) *
	(((tb_markups.Mlucro+tb_markups.ofiscal+tb_markups.desp_financ+tb_markups.comissoes)/(100-
	(tb_markups.Mlucro+tb_markups.ofiscal+tb_markups.desp_financ+tb_markups.comissoes)))+1) AS PVenda,
	tb_produtos.pdtoiD
FROM
	tb_mcalculo
	INNER JOIN tb_custominuto ON tb_custominuto.custominID = tb_mcalculo.divisao
	INNER JOIN tb_cotacao_material ON tb_cotacao_material.cotamatiD = tb_mcalculo.material,
	tb_varggf,
	tb_markups,
	tb_produtos
WHERE
tb_cotacao_material.vigente =1 AND tb_varggf.vigente =1 AND tb_mcalculo.markup =tb_markups.mkpID and tb_produtos.pdtoiD=tb_mcalculo.pdtoID
GROUP BY
	tb_mcalculo.mcalcID
',
		'parsed' => true,
		'type' => 'SQLQuery',
		'fieldList' => array( 
			array(
				'sql' => 'tb_mcalculo.mcalcID',
				'parsed' => true,
				'type' => 'FieldListItem',
				'alias' => '',
				'expression' => array(
					'sql' => '',
					'parsed' => true,
					'type' => 'SQLField',
					'table' => 'tb_mcalculo',
					'name' => 'mcalcID' 
				),
				'encrypted' => false,
				'columnName' => 'mcalcID' 
			),
			array(
				'sql' => 'tb_mcalculo.pdtoID',
				'parsed' => true,
				'type' => 'FieldListItem',
				'alias' => 'MCPdtoId',
				'expression' => array(
					'sql' => '',
					'parsed' => true,
					'type' => 'SQLField',
					'table' => 'tb_mcalculo',
					'name' => 'pdtoID' 
				),
				'encrypted' => false,
				'columnName' => 'MCPdtoId' 
			),
			array(
				'sql' => 'tb_produtos.referencia',
				'parsed' => true,
				'type' => 'FieldListItem',
				'alias' => '',
				'expression' => array(
					'sql' => '',
					'parsed' => true,
					'type' => 'SQLField',
					'table' => 'tb_produtos',
					'name' => 'referencia' 
				),
				'encrypted' => false,
				'columnName' => 'referencia' 
			),
			array(
				'sql' => 'tb_mcalculo.`data`',
				'parsed' => true,
				'type' => 'FieldListItem',
				'alias' => '',
				'expression' => array(
					'sql' => '',
					'parsed' => true,
					'type' => 'SQLField',
					'table' => 'tb_mcalculo',
					'name' => 'data' 
				),
				'encrypted' => false,
				'columnName' => 'data' 
			),
			array(
				'sql' => 'tb_mcalculo.versao',
				'parsed' => true,
				'type' => 'FieldListItem',
				'alias' => '',
				'expression' => array(
					'sql' => '',
					'parsed' => true,
					'type' => 'SQLField',
					'table' => 'tb_mcalculo',
					'name' => 'versao' 
				),
				'encrypted' => false,
				'columnName' => 'versao' 
			),
			array(
				'sql' => 'tb_mcalculo.componente',
				'parsed' => true,
				'type' => 'FieldListItem',
				'alias' => '',
				'expression' => array(
					'sql' => '',
					'parsed' => true,
					'type' => 'SQLField',
					'table' => 'tb_mcalculo',
					'name' => 'componente' 
				),
				'encrypted' => false,
				'columnName' => 'componente' 
			),
			array(
				'sql' => 'tb_mcalculo.material',
				'parsed' => true,
				'type' => 'FieldListItem',
				'alias' => '',
				'expression' => array(
					'sql' => '',
					'parsed' => true,
					'type' => 'SQLField',
					'table' => 'tb_mcalculo',
					'name' => 'material' 
				),
				'encrypted' => false,
				'columnName' => 'material' 
			),
			array(
				'sql' => 'tb_mcalculo.consumo',
				'parsed' => true,
				'type' => 'FieldListItem',
				'alias' => '',
				'expression' => array(
					'sql' => '',
					'parsed' => true,
					'type' => 'SQLField',
					'table' => 'tb_mcalculo',
					'name' => 'consumo' 
				),
				'encrypted' => false,
				'columnName' => 'consumo' 
			),
			array(
				'sql' => 'tb_mcalculo.quebra',
				'parsed' => true,
				'type' => 'FieldListItem',
				'alias' => '',
				'expression' => array(
					'sql' => '',
					'parsed' => true,
					'type' => 'SQLField',
					'table' => 'tb_mcalculo',
					'name' => 'quebra' 
				),
				'encrypted' => false,
				'columnName' => 'quebra' 
			),
			array(
				'sql' => 'tb_mcalculo.tempo',
				'parsed' => true,
				'type' => 'FieldListItem',
				'alias' => '',
				'expression' => array(
					'sql' => '',
					'parsed' => true,
					'type' => 'SQLField',
					'table' => 'tb_mcalculo',
					'name' => 'tempo' 
				),
				'encrypted' => false,
				'columnName' => 'tempo' 
			),
			array(
				'sql' => 'tb_mcalculo.txo',
				'parsed' => true,
				'type' => 'FieldListItem',
				'alias' => '',
				'expression' => array(
					'sql' => '',
					'parsed' => true,
					'type' => 'SQLField',
					'table' => 'tb_mcalculo',
					'name' => 'txo' 
				),
				'encrypted' => false,
				'columnName' => 'txo' 
			),
			array(
				'sql' => 'tb_mcalculo.divisao',
				'parsed' => true,
				'type' => 'FieldListItem',
				'alias' => '',
				'expression' => array(
					'sql' => '',
					'parsed' => true,
					'type' => 'SQLField',
					'table' => 'tb_mcalculo',
					'name' => 'divisao' 
				),
				'encrypted' => false,
				'columnName' => 'divisao' 
			),
			array(
				'sql' => 'tb_mcalculo.Rat_modelagem',
				'parsed' => true,
				'type' => 'FieldListItem',
				'alias' => '',
				'expression' => array(
					'sql' => '',
					'parsed' => true,
					'type' => 'SQLField',
					'table' => 'tb_mcalculo',
					'name' => 'Rat_modelagem' 
				),
				'encrypted' => false,
				'columnName' => 'Rat_modelagem' 
			),
			array(
				'sql' => 'tb_mcalculo.vigente',
				'parsed' => true,
				'type' => 'FieldListItem',
				'alias' => 'atual',
				'expression' => array(
					'sql' => '',
					'parsed' => true,
					'type' => 'SQLField',
					'table' => 'tb_mcalculo',
					'name' => 'vigente' 
				),
				'encrypted' => false,
				'columnName' => 'atual' 
			),
			array(
				'sql' => '(tb_mcalculo.tempo * tb_mcalculo.txo)*
	((tb_custominuto.salari_base*tb_custominuto.encargos)*tb_custominuto.funcionarios)/(tb_custominuto.hrs_trab*60)',
				'parsed' => true,
				'type' => 'FieldListItem',
				'alias' => 'CMO',
				'expression' => array(
					'sql' => '(tb_mcalculo.tempo * tb_mcalculo.txo)*
	((tb_custominuto.salari_base*tb_custominuto.encargos)*tb_custominuto.funcionarios)/(tb_custominuto.hrs_trab*60)',
					'parsed' => true,
					'type' => 'NonParsedEntity' 
				),
				'encrypted' => false,
				'columnName' => 'CMO' 
			),
			array(
				'sql' => '(tb_cotacao_material.cotacao*(tb_mcalculo.consumo*tb_mcalculo.quebra))',
				'parsed' => true,
				'type' => 'FieldListItem',
				'alias' => 'CMat',
				'expression' => array(
					'sql' => '(tb_cotacao_material.cotacao*(tb_mcalculo.consumo*tb_mcalculo.quebra))',
					'parsed' => true,
					'type' => 'NonParsedEntity' 
				),
				'encrypted' => false,
				'columnName' => 'CMat' 
			),
			array(
				'sql' => 'tb_cotacao_material.vigente',
				'parsed' => true,
				'type' => 'FieldListItem',
				'alias' => 'cmatvig',
				'expression' => array(
					'sql' => '',
					'parsed' => true,
					'type' => 'SQLField',
					'table' => 'tb_cotacao_material',
					'name' => 'vigente' 
				),
				'encrypted' => false,
				'columnName' => 'cmatvig' 
			),
			array(
				'sql' => '((sum(tb_varggf.projecao)/tb_custominuto.hrs_trab)/60)*(tb_mcalculo.tempo * tb_mcalculo.txo)',
				'parsed' => true,
				'type' => 'FieldListItem',
				'alias' => 'GGF',
				'expression' => array(
					'sql' => '((sum(tb_varggf.projecao)/tb_custominuto.hrs_trab)/60)*(tb_mcalculo.tempo * tb_mcalculo.txo)',
					'parsed' => true,
					'type' => 'NonParsedEntity' 
				),
				'encrypted' => false,
				'columnName' => 'GGF' 
			),
			array(
				'sql' => 'tb_cotacao_material.vigente',
				'parsed' => true,
				'type' => 'FieldListItem',
				'alias' => 'cotavig',
				'expression' => array(
					'sql' => '',
					'parsed' => true,
					'type' => 'SQLField',
					'table' => 'tb_cotacao_material',
					'name' => 'vigente' 
				),
				'encrypted' => false,
				'columnName' => 'cotavig' 
			),
			array(
				'sql' => 'tb_varggf.vigente',
				'parsed' => true,
				'type' => 'FieldListItem',
				'alias' => 'ggf_vig',
				'expression' => array(
					'sql' => '',
					'parsed' => true,
					'type' => 'SQLField',
					'table' => 'tb_varggf',
					'name' => 'vigente' 
				),
				'encrypted' => false,
				'columnName' => 'ggf_vig' 
			),
			array(
				'sql' => 'tb_mcalculo.markup',
				'parsed' => true,
				'type' => 'FieldListItem',
				'alias' => '',
				'expression' => array(
					'sql' => '',
					'parsed' => true,
					'type' => 'SQLField',
					'table' => 'tb_mcalculo',
					'name' => 'markup' 
				),
				'encrypted' => false,
				'columnName' => 'markup' 
			),
			array(
				'sql' => 'tb_markups.mkpID',
				'parsed' => true,
				'type' => 'FieldListItem',
				'alias' => '',
				'expression' => array(
					'sql' => '',
					'parsed' => true,
					'type' => 'SQLField',
					'table' => 'tb_markups',
					'name' => 'mkpID' 
				),
				'encrypted' => false,
				'columnName' => 'mkpID' 
			),
			array(
				'sql' => '(((tb_markups.Mlucro+tb_markups.ofiscal+tb_markups.desp_financ+tb_markups.comissoes)/(100-
	(tb_markups.Mlucro+tb_markups.ofiscal+tb_markups.desp_financ+tb_markups.comissoes)))+1)',
				'parsed' => true,
				'type' => 'FieldListItem',
				'alias' => 'MKP',
				'expression' => array(
					'sql' => '(((tb_markups.Mlucro+tb_markups.ofiscal+tb_markups.desp_financ+tb_markups.comissoes)/(100-
	(tb_markups.Mlucro+tb_markups.ofiscal+tb_markups.desp_financ+tb_markups.comissoes)))+1)',
					'parsed' => true,
					'type' => 'NonParsedEntity' 
				),
				'encrypted' => false,
				'columnName' => 'MKP' 
			),
			array(
				'sql' => '(((tb_mcalculo.tempo * tb_mcalculo.txo)*
	((tb_custominuto.salari_base*tb_custominuto.encargos)*tb_custominuto.funcionarios)/(tb_custominuto.hrs_trab*60)) +
	(tb_cotacao_material.cotacao*(tb_mcalculo.consumo*tb_mcalculo.quebra)) +
	(((sum(tb_varggf.projecao)/tb_custominuto.hrs_trab)/60)*(tb_mcalculo.tempo * tb_mcalculo.txo)))',
				'parsed' => true,
				'type' => 'FieldListItem',
				'alias' => 'CBruto',
				'expression' => array(
					'sql' => '(((tb_mcalculo.tempo * tb_mcalculo.txo)*
	((tb_custominuto.salari_base*tb_custominuto.encargos)*tb_custominuto.funcionarios)/(tb_custominuto.hrs_trab*60)) +
	(tb_cotacao_material.cotacao*(tb_mcalculo.consumo*tb_mcalculo.quebra)) +
	(((sum(tb_varggf.projecao)/tb_custominuto.hrs_trab)/60)*(tb_mcalculo.tempo * tb_mcalculo.txo)))',
					'parsed' => true,
					'type' => 'NonParsedEntity' 
				),
				'encrypted' => false,
				'columnName' => 'CBruto' 
			),
			array(
				'sql' => '(((tb_mcalculo.tempo * tb_mcalculo.txo)*
	((tb_custominuto.salari_base*tb_custominuto.encargos)*tb_custominuto.funcionarios)/(tb_custominuto.hrs_trab*60)) +
	(tb_cotacao_material.cotacao*(tb_mcalculo.consumo*tb_mcalculo.quebra)) +
	(((sum(tb_varggf.projecao)/tb_custominuto.hrs_trab)/60)*(tb_mcalculo.tempo * tb_mcalculo.txo))) *
	(((tb_markups.Mlucro+tb_markups.ofiscal+tb_markups.desp_financ+tb_markups.comissoes)/(100-
	(tb_markups.Mlucro+tb_markups.ofiscal+tb_markups.desp_financ+tb_markups.comissoes)))+1)',
				'parsed' => true,
				'type' => 'FieldListItem',
				'alias' => 'PVenda',
				'expression' => array(
					'sql' => '(((tb_mcalculo.tempo * tb_mcalculo.txo)*
	((tb_custominuto.salari_base*tb_custominuto.encargos)*tb_custominuto.funcionarios)/(tb_custominuto.hrs_trab*60)) +
	(tb_cotacao_material.cotacao*(tb_mcalculo.consumo*tb_mcalculo.quebra)) +
	(((sum(tb_varggf.projecao)/tb_custominuto.hrs_trab)/60)*(tb_mcalculo.tempo * tb_mcalculo.txo))) *
	(((tb_markups.Mlucro+tb_markups.ofiscal+tb_markups.desp_financ+tb_markups.comissoes)/(100-
	(tb_markups.Mlucro+tb_markups.ofiscal+tb_markups.desp_financ+tb_markups.comissoes)))+1)',
					'parsed' => true,
					'type' => 'NonParsedEntity' 
				),
				'encrypted' => false,
				'columnName' => 'PVenda' 
			),
			array(
				'sql' => 'tb_produtos.pdtoiD',
				'parsed' => true,
				'type' => 'FieldListItem',
				'alias' => '',
				'expression' => array(
					'sql' => '',
					'parsed' => true,
					'type' => 'SQLField',
					'table' => 'tb_produtos',
					'name' => 'pdtoiD' 
				),
				'encrypted' => false,
				'columnName' => 'pdtoiD' 
			) 
		),
		'fromList' => array( 
			array(
				'sql' => 'tb_mcalculo',
				'parsed' => true,
				'type' => 'FromListItem',
				'table' => array(
					'sql' => 'tb_mcalculo',
					'parsed' => true,
					'type' => 'SQLTable',
					'columns' => array( 
						'mcalcID',
						'pdtoID',
						'data',
						'versao',
						'componente',
						'material',
						'consumo',
						'quebra',
						'tempo',
						'txo',
						'divisao',
						'markup',
						'Rat_modelagem',
						'vigente' 
					),
					'name' => 'tb_mcalculo' 
				),
				'joinOn' => array(
					'sql' => '',
					'parsed' => false,
					'type' => 'LogicalExpression',
					'contained' => array( 
						 
					),
					'unionType' => 0,
					'column' => null 
				),
				'joinList' => array(
					'sql' => '',
					'parsed' => true,
					'type' => 'JoinOn',
					'field1' => array( 
						 
					),
					'field2' => array( 
						 
					) 
				),
				'link' => 0 
			),
			array(
				'sql' => 'INNER JOIN tb_custominuto ON tb_custominuto.custominID = tb_mcalculo.divisao',
				'parsed' => true,
				'type' => 'FromListItem',
				'table' => array(
					'sql' => 'tb_custominuto',
					'parsed' => true,
					'type' => 'SQLTable',
					'columns' => array( 
						'custominID',
						'divisao',
						'salari_base',
						'custo_folha',
						'encargos',
						'hrs_trab',
						'funcionarios',
						'atualizado',
						'vigente' 
					),
					'name' => 'tb_custominuto' 
				),
				'joinOn' => array(
					'sql' => 'tb_custominuto.custominID = tb_mcalculo.divisao',
					'parsed' => true,
					'type' => 'LogicalExpression',
					'contained' => array( 
						 
					),
					'unionType' => 0,
					'column' => array(
						'sql' => '',
						'parsed' => true,
						'type' => 'SQLField',
						'table' => 'tb_custominuto',
						'name' => 'custominID' 
					),
					'case' => '= tb_mcalculo.divisao',
					'useAlias' => false 
				),
				'joinList' => array(
					'sql' => 'tb_custominuto.custominID = tb_mcalculo.divisao',
					'parsed' => true,
					'type' => 'JoinOn',
					'field1' => array( 
						array(
							'sql' => '',
							'parsed' => true,
							'type' => 'SQLField',
							'table' => 'tb_custominuto',
							'name' => 'custominID' 
						) 
					),
					'field2' => array( 
						array(
							'sql' => '',
							'parsed' => true,
							'type' => 'SQLField',
							'table' => 'tb_mcalculo',
							'name' => 'divisao' 
						) 
					) 
				),
				'link' => 1 
			),
			array(
				'sql' => 'INNER JOIN tb_cotacao_material ON tb_cotacao_material.cotamatiD = tb_mcalculo.material',
				'parsed' => true,
				'type' => 'FromListItem',
				'table' => array(
					'sql' => 'tb_cotacao_material',
					'parsed' => true,
					'type' => 'SQLTable',
					'columns' => array( 
						'cotamatiD',
						'materialID',
						'data',
						'cotacao',
						'vigente' 
					),
					'name' => 'tb_cotacao_material' 
				),
				'joinOn' => array(
					'sql' => 'tb_cotacao_material.cotamatiD = tb_mcalculo.material',
					'parsed' => true,
					'type' => 'LogicalExpression',
					'contained' => array( 
						 
					),
					'unionType' => 0,
					'column' => array(
						'sql' => '',
						'parsed' => true,
						'type' => 'SQLField',
						'table' => 'tb_cotacao_material',
						'name' => 'cotamatiD' 
					),
					'case' => '= tb_mcalculo.material',
					'useAlias' => false 
				),
				'joinList' => array(
					'sql' => 'tb_cotacao_material.cotamatiD = tb_mcalculo.material',
					'parsed' => true,
					'type' => 'JoinOn',
					'field1' => array( 
						array(
							'sql' => '',
							'parsed' => true,
							'type' => 'SQLField',
							'table' => 'tb_cotacao_material',
							'name' => 'cotamatiD' 
						) 
					),
					'field2' => array( 
						array(
							'sql' => '',
							'parsed' => true,
							'type' => 'SQLField',
							'table' => 'tb_mcalculo',
							'name' => 'material' 
						) 
					) 
				),
				'link' => 1 
			),
			array(
				'sql' => ',
	tb_varggf',
				'parsed' => true,
				'type' => 'FromListItem',
				'table' => array(
					'sql' => 'tb_varggf',
					'parsed' => true,
					'type' => 'SQLTable',
					'columns' => array( 
						'varggfID',
						'variavel',
						'projecao',
						'data',
						'vigente' 
					),
					'name' => 'tb_varggf' 
				),
				'joinOn' => array(
					'sql' => '',
					'parsed' => false,
					'type' => 'LogicalExpression',
					'contained' => array( 
						 
					),
					'unionType' => 0,
					'column' => null 
				),
				'joinList' => array(
					'sql' => '',
					'parsed' => true,
					'type' => 'JoinOn',
					'field1' => array( 
						 
					),
					'field2' => array( 
						 
					) 
				),
				'link' => 6 
			),
			array(
				'sql' => ',
	tb_markups',
				'parsed' => true,
				'type' => 'FromListItem',
				'table' => array(
					'sql' => 'tb_markups',
					'parsed' => true,
					'type' => 'SQLTable',
					'columns' => array( 
						'mkpID',
						'Mlucro',
						'ofiscal',
						'desp_financ',
						'comissoes' 
					),
					'name' => 'tb_markups' 
				),
				'joinOn' => array(
					'sql' => '',
					'parsed' => false,
					'type' => 'LogicalExpression',
					'contained' => array( 
						 
					),
					'unionType' => 0,
					'column' => null 
				),
				'joinList' => array(
					'sql' => '',
					'parsed' => true,
					'type' => 'JoinOn',
					'field1' => array( 
						 
					),
					'field2' => array( 
						 
					) 
				),
				'link' => 6 
			),
			array(
				'sql' => ',
	tb_produtos',
				'parsed' => true,
				'type' => 'FromListItem',
				'table' => array(
					'sql' => 'tb_produtos',
					'parsed' => true,
					'type' => 'SQLTable',
					'columns' => array( 
						'pdtoiD',
						'clienteID',
						'referencia',
						'nome_aux',
						'categoria',
						'status',
						'foto',
						'ficha_tec' 
					),
					'name' => 'tb_produtos' 
				),
				'joinOn' => array(
					'sql' => '',
					'parsed' => false,
					'type' => 'LogicalExpression',
					'contained' => array( 
						 
					),
					'unionType' => 0,
					'column' => null 
				),
				'joinList' => array(
					'sql' => '',
					'parsed' => true,
					'type' => 'JoinOn',
					'field1' => array( 
						 
					),
					'field2' => array( 
						 
					) 
				),
				'link' => 6 
			) 
		),
		'where' => array(
			'sql' => 'tb_cotacao_material.vigente =1 AND tb_varggf.vigente =1 AND tb_mcalculo.markup =tb_markups.mkpID and tb_produtos.pdtoiD=tb_mcalculo.pdtoID',
			'parsed' => true,
			'type' => 'LogicalExpression',
			'contained' => array( 
				array(
					'sql' => 'tb_cotacao_material.vigente =1',
					'parsed' => true,
					'type' => 'LogicalExpression',
					'contained' => array( 
						 
					),
					'unionType' => 0,
					'column' => array(
						'sql' => '',
						'parsed' => true,
						'type' => 'SQLField',
						'table' => 'tb_cotacao_material',
						'name' => 'vigente' 
					),
					'case' => '=1',
					'useAlias' => false 
				),
				array(
					'sql' => 'tb_varggf.vigente =1',
					'parsed' => true,
					'type' => 'LogicalExpression',
					'contained' => array( 
						 
					),
					'unionType' => 0,
					'column' => array(
						'sql' => '',
						'parsed' => true,
						'type' => 'SQLField',
						'table' => 'tb_varggf',
						'name' => 'vigente' 
					),
					'case' => '=1',
					'useAlias' => false 
				),
				array(
					'sql' => 'tb_mcalculo.markup =tb_markups.mkpID',
					'parsed' => true,
					'type' => 'LogicalExpression',
					'contained' => array( 
						 
					),
					'unionType' => 0,
					'column' => array(
						'sql' => '',
						'parsed' => true,
						'type' => 'SQLField',
						'table' => 'tb_mcalculo',
						'name' => 'markup' 
					),
					'case' => '=tb_markups.mkpID',
					'useAlias' => false 
				),
				array(
					'sql' => 'tb_produtos.pdtoiD=tb_mcalculo.pdtoID',
					'parsed' => true,
					'type' => 'LogicalExpression',
					'contained' => array( 
						 
					),
					'unionType' => 0,
					'column' => array(
						'sql' => '',
						'parsed' => true,
						'type' => 'SQLField',
						'table' => 'tb_produtos',
						'name' => 'pdtoiD' 
					),
					'case' => '=tb_mcalculo.pdtoID',
					'useAlias' => false 
				) 
			),
			'unionType' => 1,
			'column' => null 
		),
		'groupBy' => array( 
			array(
				'sql' => 'tb_mcalculo.mcalcID',
				'parsed' => true,
				'type' => 'GroupByListItem',
				'column' => array(
					'sql' => '',
					'parsed' => true,
					'type' => 'SQLField',
					'table' => 'tb_mcalculo',
					'name' => 'mcalcID' 
				) 
			) 
		),
		'having' => array(
			'sql' => '',
			'parsed' => false,
			'type' => 'LogicalExpression',
			'contained' => array( 
				 
			),
			'unionType' => 0,
			'column' => null 
		),
		'orderBy' => array( 
			 
		),
		'colsIndex' => array( 
			array(
				'fieldIndex' => 0,
				'orderByIndex' => -1,
				'groupByIndex' => 0,
				'whereIndex' => -1,
				'havingIndex' => -1 
			),
			array(
				'fieldIndex' => 1,
				'orderByIndex' => -1,
				'groupByIndex' => -1,
				'whereIndex' => -1,
				'havingIndex' => -1 
			),
			array(
				'fieldIndex' => 2,
				'orderByIndex' => -1,
				'groupByIndex' => -1,
				'whereIndex' => -1,
				'havingIndex' => -1 
			),
			array(
				'fieldIndex' => 3,
				'orderByIndex' => -1,
				'groupByIndex' => -1,
				'whereIndex' => -1,
				'havingIndex' => -1 
			),
			array(
				'fieldIndex' => 4,
				'orderByIndex' => -1,
				'groupByIndex' => -1,
				'whereIndex' => -1,
				'havingIndex' => -1 
			),
			array(
				'fieldIndex' => 5,
				'orderByIndex' => -1,
				'groupByIndex' => -1,
				'whereIndex' => -1,
				'havingIndex' => -1 
			),
			array(
				'fieldIndex' => 6,
				'orderByIndex' => -1,
				'groupByIndex' => -1,
				'whereIndex' => -1,
				'havingIndex' => -1 
			),
			array(
				'fieldIndex' => 7,
				'orderByIndex' => -1,
				'groupByIndex' => -1,
				'whereIndex' => -1,
				'havingIndex' => -1 
			),
			array(
				'fieldIndex' => 8,
				'orderByIndex' => -1,
				'groupByIndex' => -1,
				'whereIndex' => -1,
				'havingIndex' => -1 
			),
			array(
				'fieldIndex' => 9,
				'orderByIndex' => -1,
				'groupByIndex' => -1,
				'whereIndex' => -1,
				'havingIndex' => -1 
			),
			array(
				'fieldIndex' => 10,
				'orderByIndex' => -1,
				'groupByIndex' => -1,
				'whereIndex' => -1,
				'havingIndex' => -1 
			),
			array(
				'fieldIndex' => 11,
				'orderByIndex' => -1,
				'groupByIndex' => -1,
				'whereIndex' => -1,
				'havingIndex' => -1 
			),
			array(
				'fieldIndex' => 12,
				'orderByIndex' => -1,
				'groupByIndex' => -1,
				'whereIndex' => -1,
				'havingIndex' => -1 
			),
			array(
				'fieldIndex' => 13,
				'orderByIndex' => -1,
				'groupByIndex' => -1,
				'whereIndex' => -1,
				'havingIndex' => -1 
			),
			array(
				'fieldIndex' => 14,
				'orderByIndex' => -1,
				'groupByIndex' => -1,
				'whereIndex' => -1,
				'havingIndex' => -1 
			),
			array(
				'fieldIndex' => 15,
				'orderByIndex' => -1,
				'groupByIndex' => -1,
				'whereIndex' => -1,
				'havingIndex' => -1 
			),
			array(
				'fieldIndex' => 16,
				'orderByIndex' => -1,
				'groupByIndex' => -1,
				'whereIndex' => 0,
				'havingIndex' => -1 
			),
			array(
				'fieldIndex' => 17,
				'orderByIndex' => -1,
				'groupByIndex' => -1,
				'whereIndex' => -1,
				'havingIndex' => -1 
			),
			array(
				'fieldIndex' => 18,
				'orderByIndex' => -1,
				'groupByIndex' => -1,
				'whereIndex' => -1,
				'havingIndex' => -1 
			),
			array(
				'fieldIndex' => 19,
				'orderByIndex' => -1,
				'groupByIndex' => -1,
				'whereIndex' => 1,
				'havingIndex' => -1 
			),
			array(
				'fieldIndex' => 20,
				'orderByIndex' => -1,
				'groupByIndex' => -1,
				'whereIndex' => 2,
				'havingIndex' => -1 
			),
			array(
				'fieldIndex' => 21,
				'orderByIndex' => -1,
				'groupByIndex' => -1,
				'whereIndex' => -1,
				'havingIndex' => -1 
			),
			array(
				'fieldIndex' => 22,
				'orderByIndex' => -1,
				'groupByIndex' => -1,
				'whereIndex' => -1,
				'havingIndex' => -1 
			),
			array(
				'fieldIndex' => 23,
				'orderByIndex' => -1,
				'groupByIndex' => -1,
				'whereIndex' => -1,
				'havingIndex' => -1 
			),
			array(
				'fieldIndex' => 24,
				'orderByIndex' => -1,
				'groupByIndex' => -1,
				'whereIndex' => -1,
				'havingIndex' => -1 
			),
			array(
				'fieldIndex' => 25,
				'orderByIndex' => -1,
				'groupByIndex' => -1,
				'whereIndex' => 3,
				'havingIndex' => -1 
			) 
		),
		'headSql' => 'SELECT',
		'fieldListSql' => 'tb_mcalculo.mcalcID,
	tb_mcalculo.pdtoID as MCPdtoId,
	tb_produtos.referencia,
	tb_mcalculo.`data`,
	tb_mcalculo.versao,
	tb_mcalculo.componente,
	tb_mcalculo.material,
	tb_mcalculo.consumo,
	tb_mcalculo.quebra,
	tb_mcalculo.tempo,
	tb_mcalculo.txo,
	tb_mcalculo.divisao,
	tb_mcalculo.Rat_modelagem,
	tb_mcalculo.vigente AS atual,
	(tb_mcalculo.tempo * tb_mcalculo.txo)*
	((tb_custominuto.salari_base*tb_custominuto.encargos)*tb_custominuto.funcionarios)/(tb_custominuto.hrs_trab*60) AS CMO,
	(tb_cotacao_material.cotacao*(tb_mcalculo.consumo*tb_mcalculo.quebra)) AS CMat,
	tb_cotacao_material.vigente AS cmatvig,
	((sum(tb_varggf.projecao)/tb_custominuto.hrs_trab)/60)*(tb_mcalculo.tempo * tb_mcalculo.txo) AS GGF,
	tb_cotacao_material.vigente AS cotavig,
	tb_varggf.vigente AS ggf_vig,
	tb_mcalculo.markup,
	tb_markups.mkpID,
	(((tb_markups.Mlucro+tb_markups.ofiscal+tb_markups.desp_financ+tb_markups.comissoes)/(100-
	(tb_markups.Mlucro+tb_markups.ofiscal+tb_markups.desp_financ+tb_markups.comissoes)))+1) AS MKP,
	(((tb_mcalculo.tempo * tb_mcalculo.txo)*
	((tb_custominuto.salari_base*tb_custominuto.encargos)*tb_custominuto.funcionarios)/(tb_custominuto.hrs_trab*60)) +
	(tb_cotacao_material.cotacao*(tb_mcalculo.consumo*tb_mcalculo.quebra)) +
	(((sum(tb_varggf.projecao)/tb_custominuto.hrs_trab)/60)*(tb_mcalculo.tempo * tb_mcalculo.txo))) AS CBruto,
	(((tb_mcalculo.tempo * tb_mcalculo.txo)*
	((tb_custominuto.salari_base*tb_custominuto.encargos)*tb_custominuto.funcionarios)/(tb_custominuto.hrs_trab*60)) +
	(tb_cotacao_material.cotacao*(tb_mcalculo.consumo*tb_mcalculo.quebra)) +
	(((sum(tb_varggf.projecao)/tb_custominuto.hrs_trab)/60)*(tb_mcalculo.tempo * tb_mcalculo.txo))) *
	(((tb_markups.Mlucro+tb_markups.ofiscal+tb_markups.desp_financ+tb_markups.comissoes)/(100-
	(tb_markups.Mlucro+tb_markups.ofiscal+tb_markups.desp_financ+tb_markups.comissoes)))+1) AS PVenda,
	tb_produtos.pdtoiD',
		'fromListSql' => 'FROM
	tb_mcalculo
	INNER JOIN tb_custominuto ON tb_custominuto.custominID = tb_mcalculo.divisao
	INNER JOIN tb_cotacao_material ON tb_cotacao_material.cotamatiD = tb_mcalculo.material,
	tb_varggf,
	tb_markups,
	tb_produtos',
		'whereSql' => 'tb_cotacao_material.vigente =1 AND tb_varggf.vigente =1 AND tb_mcalculo.markup =tb_markups.mkpID and tb_produtos.pdtoiD=tb_mcalculo.pdtoID',
		'orderBySql' => '',
		'tailSql' => '' 
	),
	'originalTable' => 'tb_mcalculo',
	'originalPagesByType' => array(
		'add' => array( 
			'add' 
		),
		'edit' => array( 
			'edit' 
		),
		'view' => array( 
			'view' 
		),
		'list' => array( 
			'list' 
		),
		'print' => array( 
			'print' 
		),
		'search' => array( 
			'search' 
		) 
	),
	'originalPageTypes' => array(
		'add' => 'add',
		'edit' => 'edit',
		'view' => 'view',
		'list' => 'list',
		'print' => 'print',
		'search' => 'search' 
	),
	'originalDefaultPages' => array(
		'add' => 'add',
		'edit' => 'edit',
		'view' => 'view',
		'list' => 'list',
		'print' => 'print',
		'search' => 'search' 
	),
	'searchSettings' => array(
		'caseSensitiveSearch' => false,
		'searchableFields' => array( 
			'mcalcID',
			'data',
			'versao',
			'componente',
			'material',
			'consumo',
			'quebra',
			'tempo',
			'txo',
			'divisao',
			'markup',
			'Rat_modelagem',
			'CMO',
			'CMat',
			'GGF',
			'mkpID',
			'MKP',
			'CBruto',
			'PVenda',
			'atual',
			'cotavig',
			'ggf_vig',
			'cmatvig',
			'referencia',
			'pdtoiD',
			'MCPdtoId' 
		),
		'searchSuggest' => true,
		'highlightSearchResults' => true,
		'hideDataUntilSearch' => false,
		'hideFilterUntilSearch' => false,
		'googleLikeSearchFields' => array( 
			'mcalcID',
			'data',
			'versao',
			'componente',
			'material',
			'consumo',
			'quebra',
			'tempo',
			'txo',
			'divisao',
			'markup',
			'Rat_modelagem',
			'CMO',
			'CMat',
			'GGF',
			'mkpID',
			'MKP',
			'CBruto',
			'PVenda',
			'atual',
			'cotavig',
			'ggf_vig',
			'cmatvig',
			'referencia',
			'pdtoiD',
			'MCPdtoId' 
		) 
	),
	'connId' => 'conn',
	'clickActions' => array(
		'row' => array(
			'action' => 'noaction',
			'openData' => array(
				'how' => 'popup',
				'page' => 'view' 
			) 
		),
		'fields' => array(
			 
		) 
	),
	'geoCoding' => array(
		'enabled' => false,
		'latField' => '',
		'lonField' => '',
		'addressFields' => array( 
			 
		) 
	),
	'whereTabs' => array( 
		 
	),
	'labels' => array(
		 
	),
	'chartSettings' => array(
		 
	),
	'dataSourceOperations' => array(
		 
	),
	'calendarSettings' => array(
		'categoryColors' => array( 
			 
		) 
	),
	'ganttSettings' => array(
		'categoryColors' => array( 
			 
		) 
	) 
);

global $runnerTableLabels;
if( mlang_getcurrentlang() === 'English' ) {
	$runnerTableLabels['memcalc_Pdto view'] = array(
	'tableCaption' => 'Memcalc Pdto View',
	'fieldLabels' => array(
		'mcalcID' => 'Mcalc ID',
		'data' => 'Data',
		'versao' => 'Versao',
		'componente' => 'Componente',
		'material' => 'Material',
		'consumo' => 'Consumo',
		'quebra' => 'Quebra',
		'tempo' => 'Tempo',
		'txo' => 'Txo',
		'divisao' => 'Divisao',
		'markup' => 'Lucro (%)',
		'Rat_modelagem' => 'Rat Model',
		'CMO' => 'CMO',
		'CMat' => 'C Mat',
		'GGF' => 'GGF',
		'mkpID' => 'Mkp ID',
		'MKP' => 'MKP',
		'CBruto' => 'Custo Bruto',
		'PVenda' => 'Preço de Venda',
		'atual' => 'Atual',
		'cotavig' => 'Cotavig',
		'ggf_vig' => 'Ggf Vig',
		'cmatvig' => 'Cmatvig',
		'referencia' => 'Referencia',
		'pdtoiD' => 'Pdtoi D',
		'MCPdtoId' => 'Pdto Id' 
	),
	'fieldTooltips' => array(
		'mcalcID' => '',
		'data' => '',
		'versao' => '',
		'componente' => '',
		'material' => '',
		'consumo' => '',
		'quebra' => '',
		'tempo' => '',
		'txo' => '',
		'divisao' => '',
		'markup' => '',
		'Rat_modelagem' => '',
		'CMO' => '',
		'CMat' => '',
		'GGF' => '',
		'mkpID' => '',
		'MKP' => '',
		'CBruto' => '',
		'PVenda' => '',
		'atual' => '',
		'cotavig' => '',
		'ggf_vig' => '',
		'cmatvig' => '',
		'referencia' => '',
		'pdtoiD' => '',
		'MCPdtoId' => '' 
	),
	'fieldPlaceholders' => array(
		'mcalcID' => '',
		'data' => '',
		'versao' => '',
		'componente' => '',
		'material' => '',
		'consumo' => '',
		'quebra' => '',
		'tempo' => '',
		'txo' => '',
		'divisao' => '',
		'markup' => '',
		'Rat_modelagem' => '',
		'CMO' => '',
		'CMat' => '',
		'GGF' => '',
		'mkpID' => '',
		'MKP' => '',
		'CBruto' => '',
		'PVenda' => '',
		'atual' => '',
		'cotavig' => '',
		'ggf_vig' => '',
		'cmatvig' => '',
		'referencia' => '',
		'pdtoiD' => '',
		'MCPdtoId' => '' 
	),
	'pageTitles' => array(
		 
	) 
);
}
?>