InovacaoMediaBrasil/ProcessWorkflowsAndDatabaseScripts

View on GitHub
Src/Sankhya/Construtores de Componentes de BI/113.COMERCIAL_FRETES_TABELA_COMPARATIVO_COLUNAS.xml

Summary

Maintainability
Test Coverage
<gadget>
    <prompt-parameters>
        <parameter id="DATA_INI" description="1. Data Inicial" metadata="date" required="true" keep-last="true"/>
        <parameter id="DATA_FIM" description="2, Data Final" metadata="date" required="true" keep-last="true"/>
    </prompt-parameters>
    <level id="lvl_n5jld3" description="Principal">
        <container orientacao="V" tamanhoRelativo="100">
            <chart id="cht_ajb250t" type="column">
                <title>
                    <![CDATA[Comparativo Correios x Sistema]]>
                </title>
                <expression type="sql" data-source="MGEDS">
                    <![CDATA[SELECT SUM(CAB.VLRFRETE) AS ValorFreteSankhya,   SUM(C.VLRFRETE)  AS ValorFreteCorreios,   'Correios'   AS correios,   'Sankhya'   AS sankhya FROM sankhya.AD_PEDIDOVTEXSC C WITH (NOLOCK)   INNER JOIN sankhya.TGFCAB CAB WITH (NOLOCK) ON CAB.AD_PEDORIGINAL = c.PEDORIGINAL   INNER JOIN (SELECT NUNOTA,        SUM(PRO.PESOBRUTO) AS peso       FROM sankhya.TGFITE ITE WITH (NOLOCK)        INNER JOIN sankhya.TGFPRO PRO WITH (NOLOCK) ON ITE.CODPROD = pro.CODPROD       WHERE ITE.USOPROD = 'R'       GROUP BY NUNOTA) ITE ON ITE.NUNOTA = CAB.NUNOTA   INNER JOIN sankhya.AD_PEDIDOVTEXSCFLUXO F WITH (NOLOCK) ON F.OCORRENCIA = 'T' AND F.PEDORIGINAL = C.PEDORIGINAL WHERE C.VLRFRETE IS NOT NULL   AND CAB.CODTIPOPER IN (500,501,502,503,515)   AND F.DATA BETWEEN :DATA_INI AND :DATA_FIM]]>
                </expression>
                <metadata>
                    <field name="ValorFreteSankhya" label="ValorFreteSankhya" type="F" visible="true" useFooter="false" mask="R$ #.##0,00"/>
                    <field name="ValorFreteCorreios" label="ValorFreteCorreios" type="I" visible="true" useFooter="false" mask="R$ #.##0,00"/>
                    <field name="correios" label="correios" type="S" visible="true" useFooter="false"/>
                    <field name="sankhya" label="sankhya" type="S" visible="true" useFooter="false"/>
                </metadata>
                <horizontal-axis>
                    <category field="" rotation="0" dropLabel="false">
                        <title>Resultados</title>
                    </category>
                </horizontal-axis>
                <vertical-axis>
                    <linear>
                        <mask>R$ #.##0,00</mask>
                        <title>Valor (R$)</title>
                    </linear>
                </vertical-axis>
                <series>
                    <serie type="column">
                        <xField>$correios</xField>
                        <yField>$ValorFreteCorreios</yField>
                        <display>Resultado Correios</display>
                        <color>0x6666ff</color>
                    </serie>
                    <serie type="column">
                        <xField>$sankhya</xField>
                        <yField>$ValorFreteSankhya</yField>
                        <display>Resultado Sistema</display>
                        <color>0xff6600</color>
                    </serie>
                </series>
            </chart>
        </container>
    </level>
</gadget>