on 08-12-2008 10:02 PM
Estou montando um relatório de centro de custo e não estou conseguindo buscar o rateio manual que eventualmente podemos fazer que cria um código automático (M000002, por exemplo).
Alguém já passou por isso e tem uma query com essa busca?
Abs,
Antonio Melo
Quintec Brasil
Se não me engano, as regras de distribuições são cadastradas na tabela OOCR e as linhas das regras na OCR1. Não tenho uma base com dados manuais aqui mas acredito que esteja lá também.
Estando lá, é só montar a query.
Att,
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Bom dia,
Que transação uso para ver tudo o que foi lançado num único centro de custo?
Tentei pela YBALCM mas não sei onde preencher o CC.
Alguém ajude - me sff.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Oi Antônio e Vileimar,
Eu tenho uma query para listar todas as notas de entrada com os centros de custo.
Veja se ajuda vocês.
SELECT
T3.[DocDate] AS 'Data de lançamento',
T3.[DocNum] AS 'Nº do documento',
T2.[Quantity] AS 'Quantidade',
T2.[ItemCode] AS 'Item',
T2.[Dscription] AS 'Descrição',
'-' AS 'Regra distribuição',
T2.[OcrCode] AS 'Centro de Custo',
T2.[LineTotal] AS 'Valor Total',
T2.[LineTotal] AS 'Total no centro'
FROM
[dbo].[OPCH] T3
INNER JOIN [dbo].[pch1] T2 ON T2.[DocEntry] = T3.[DocEntry]
INNER JOIN [dbo].[OCR1] T0 ON T0.[OcrCode] = T2.[OcrCode]
INNER JOIN [dbo].[OOCR] T1 ON T0.[OcrCode] = T1.[OcrCode]
WHERE
T3.[CANCELED] = 'N' AND T3.[DocDate] Between [%0] And [%1]
UNION ALL
SELECT
T1.[DocDate] AS 'Data de lançamento',
T1.[DocNum] AS 'Nº do documento',
T0.[Quantity] AS 'Quantidade',
T0.[ItemCode] AS 'Item',
T0.[Dscription] AS 'Descrição',
T2.[OcrCode] AS 'Regra distribuição',
T3.[PrcCode] AS 'Centro de Custo',
T0.[LineTotal] AS 'Valor Total',
T3.[PrcAmount] AS 'Total no centro'
FROM
[dbo].[pch1] T0
INNER JOIN [dbo].[opch] T1 ON T1.[DocEntry] = T0.[DocEntry] ,
[dbo].[OMDR] T2 INNER JOIN [dbo].[MDR1] T3 ON T3.[OcrCode] = T2.[OcrCode]
WHERE
T1.[CANCELED] = 'N' AND T1.[DocDate] Between [%0] And [%1]
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
108 | |
12 | |
11 | |
6 | |
5 | |
4 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.