InovacaoMediaBrasil/ProcessWorkflowsAndDatabaseScripts

View on GitHub
Src/Sankhya/Construtores de Componentes de BI/127.COMERCIAL_CANCELADOS_PORITEM.xml

Summary

Maintainability
Test Coverage
    <gadget>
    <prompt-parameters>
        <parameter id="DTINI" description="1. Data Inicial" metadata="date" required="true" keep-last="true"/>
        <parameter id="DTFIM" description="2. Data Final" metadata="date" required="true" keep-last="true"/>
        <parameter id="OPERACAO" description="3. Código da Operação" metadata="integer" required="true" keep-last="true"/>
    </prompt-parameters>
    <level id="lvl_mm724z" description="Principal">
        <container orientacao="V" tamanhoRelativo="100">
            <grid id="grd_mm7240">
                <title>
                    <![CDATA[ITENS DOS PEDIDOS CANCELADOS]]>
                </title>
                <expression type="sql" data-source="MGEDS">
                    <![CDATA[SELECT PRO.CODPROD AS CODIGO, RTRIM(PRO.DESCRPROD)+ ' ' + ISNULL(RTRIM(PRO.COMPLDESC),'') AS PRODUTO,   SUM(QTDNEG) AS QUANTIDADE,   SUM(VLRTOT-VLRDESC) AS VALOR FROM  sankhya.TGFCAN CAN WITH (NOLOCK)   INNER JOIN sankhya.TGFCAB_EXC CAB WITH (NOLOCK) ON CAB.NUNOTA = CAN.NUNOTA   INNER JOIN sankhya.TGFITE_EXC ITE WITH (NOLOCK) ON ITE.NUNOTA = CAB.NUNOTA   INNER JOIN sankhya.TGFPRO PRO WITH (NOLOCK) ON PRO.CODPROD = ITE.CODPROD WHERE CAB.CODTIPOPER = :OPERACAO   AND CAN.MOTCANCEL LIKE '%Pedido%sem%pagamento%'   AND CAB.DTNEG >= :DTINI   AND CAB.DTNEG <=:DTFIM   AND ITE.USOPROD = 'R' GROUP BY PRO.CODPROD, PRO.DESCRPROD, PRO.COMPLDESC ORDER BY SUM(QTDNEG) DESC]]>
                </expression>
                <metadata>
                    <field name="CODIGO" label="CODIGO" type="I" visible="true" useFooter="false"/>
                    <field name="PRODUTO" label="PRODUTO" type="S" visible="true" useFooter="false"/>
                    <field name="QUANTIDADE" label="QUANTIDADE" type="I" visible="true" useFooter="false" mask="#.##0"/>
                    <field name="VALOR" label="VALOR" type="F" visible="true" useFooter="false" mask="R$ #.##0,00"/>
                </metadata>
            </grid>
        </container>
    </level>
</gadget>