Gerar DTW para Plano de Contas
Página 1 de 1
Gerar DTW para Plano de Contas
--====================================-
--Autor: Douglas Mussatto - [Apenas Administradores podem visualizar links] -
--Descrição: Gerar dados para DTW de Plano de Contas -
--====================================-
Select
AcctCode,
AcctName,
Case When Finanse = 'Y' then 'tYES'
else 'tNO' end as Finanse,
Case When Budget = 'Y' then 'tYES'
else 'tNO' end as Budget,
Case When Postable = 'Y' then 'tYES'
else 'tNO' end as Postable,
isnull(ExportCode, '') as ExportCode,
FatherNum,
isnull(AccntntCod, '') as AccntntCod,
Case When RateTrans = 'Y' then 'tYES'
else 'tNO' end as RateTrans,
Case When TaxIncome = 'Y' then 'tYES'
else 'tNO' end as TaxIncome,
Case When ExmIncome = 'Y' then 'tYES'
else 'tNO' end as ExmIncome,
Case when ActType = 'N' then 'at_Other'
when ActType = 'E' then 'at_Expenses'
when ActType = 'I' then 'at_Revenues'
else 'N-A' end as ActType,
Case When OverType = 'Y' then 'tYES'
else 'tNO' end as OverType,
isnull(OverCode, '') as OverCode,
isnull(ActCurr, '') as ActCurr,
Case When Protected = 'Y' then 'tYES'
else 'tNO' end as Protected,
Case When RealAcct = 'Y' then 'tYES'
else 'tNO' end as RealAcct,
Case When Advance = 'Y' then 'tYES'
else 'tNO' end as Advance,
isnull(FrgnName, '') as FrgnName,
isnull(Details, '') as Details,
isnull(Project, '') as Project,
Case When RevalMatch = 'Y' then 'tYES'
else 'tNO' end as RevalMatch,
Case When LocManTran = 'Y' then 'tYES'
else 'tNO' end as LocManTran,
FormatCode,
isnull(DfltVat, '') as DfltVat,
Case When VatChange = 'Y' then 'tYES'
else 'tNO' end as VatChange,
isnull(Category, '') as Category,
isnull(TransCode, '') as TransCode,
isnull(OverCode5, '') as OverCode5,
isnull(OverCode2, '') as OverCode2,
isnull(OverCode3, '') as OverCode3,
isnull(OverCode4, '') as OverCode4,
isnull(PlngLevel, '') as PlngLevel
from OACT
--Autor: Douglas Mussatto - [Apenas Administradores podem visualizar links] -
--Descrição: Gerar dados para DTW de Plano de Contas -
--====================================-
Select
AcctCode,
AcctName,
Case When Finanse = 'Y' then 'tYES'
else 'tNO' end as Finanse,
Case When Budget = 'Y' then 'tYES'
else 'tNO' end as Budget,
Case When Postable = 'Y' then 'tYES'
else 'tNO' end as Postable,
isnull(ExportCode, '') as ExportCode,
FatherNum,
isnull(AccntntCod, '') as AccntntCod,
Case When RateTrans = 'Y' then 'tYES'
else 'tNO' end as RateTrans,
Case When TaxIncome = 'Y' then 'tYES'
else 'tNO' end as TaxIncome,
Case When ExmIncome = 'Y' then 'tYES'
else 'tNO' end as ExmIncome,
Case when ActType = 'N' then 'at_Other'
when ActType = 'E' then 'at_Expenses'
when ActType = 'I' then 'at_Revenues'
else 'N-A' end as ActType,
Case When OverType = 'Y' then 'tYES'
else 'tNO' end as OverType,
isnull(OverCode, '') as OverCode,
isnull(ActCurr, '') as ActCurr,
Case When Protected = 'Y' then 'tYES'
else 'tNO' end as Protected,
Case When RealAcct = 'Y' then 'tYES'
else 'tNO' end as RealAcct,
Case When Advance = 'Y' then 'tYES'
else 'tNO' end as Advance,
isnull(FrgnName, '') as FrgnName,
isnull(Details, '') as Details,
isnull(Project, '') as Project,
Case When RevalMatch = 'Y' then 'tYES'
else 'tNO' end as RevalMatch,
Case When LocManTran = 'Y' then 'tYES'
else 'tNO' end as LocManTran,
FormatCode,
isnull(DfltVat, '') as DfltVat,
Case When VatChange = 'Y' then 'tYES'
else 'tNO' end as VatChange,
isnull(Category, '') as Category,
isnull(TransCode, '') as TransCode,
isnull(OverCode5, '') as OverCode5,
isnull(OverCode2, '') as OverCode2,
isnull(OverCode3, '') as OverCode3,
isnull(OverCode4, '') as OverCode4,
isnull(PlngLevel, '') as PlngLevel
from OACT
Página 1 de 1
Permissões neste sub-fórum
Não podes responder a tópicos
|
|