¡Caminando hacia el éxito!

Aprende en Comunidad

Avalados por :

Como incluir CRD1.address (Endereço de Faturação) e INV1.Taxcode em relatório do Crystal Reports - Guia passo a passo

  • Creado 01/03/2024
  • Modificado 01/03/2024
  • 2 Vistas
0
Cargando...
Aqui está o HTML melhorado:

Olá, como incluir CRD1.address (Endereço de Faturamento) e INV1.Taxcode neste código de relatório do Crystal Reports?

DECLARE @sVAT NVARCHAR(max) DECLARE @sCess NVARCHAR(max) DECLARE @sCST NVARCHAR(max) DECLARE @nDocentry INT SET @sVAT='1' SET @sCess='7' SET @sCST='4' SELECT DocEntry, DocDate, VehicleNo, Driver, NumAtCard, Building, Block, Street, City, District, State, Country, Series, DocNum, BTinNo, BCstNo, BCeRegNo, BPanNo, BCeRange, BCeComRate, BCeDivision, BEccNo, Type, CardName, [Delivery Addr], ECCNo, CERange, CERegNo, CEDivis, CEComRate, PAN, CST, STN, [Deliver At], LineNum, Dscription, HSNumber, Quantity, Rate, LineTotal, Discount, Vat [VAT], Cess [Cess], Total, GTotal, TotalExpns, MfgName, MFGAddress, MFGBuilding, MFGBlock, MFGStreet, MFGDistrict, MFGCity, MCERegNo, MCERange, MCEDivis, MCEComRate, MPAN, MCST, MSTN, SupName, SUPBuilding, SUPBlock, SUPStreet, SUPDistrict, SUPCity, SCERegNo, SCERange, SCEDivis, SCEComRate, SPAN, SCST, SSTN, (select substring((select upper(name)+',' from OUBR where isnull(U_SeriesGrp,'')<>'' order by Code FOR XML PATH('')),1,LEN((select upper(name)+',' from OUBR order by Code FOR XML PATH('')))-1))[Branches] FROM (SELECT /*OBTN.DistNumber*/ INV1.DocEntry, OINV.DocDate, OINV.U_VehicleNo VehicleNo, OINV.U_Driver Driver, OINV.U_SupRefNo NumAtCard, CAST(OLCT.Building AS VARCHAR(255)) Building, OLCT.Block, OLCT.Street, OLCT.City, OLCT.County+' - '+OLCT.ZipCode [District], OCST.Name State, OCRY.Name Country, NNM1.SeriesName [Series], OINV.DocNum, OLCT.TinNo [BTinNo], OLCT.CstNo [BCstNo], OLCT.CeRegNo [BCeRegNo], OLCT.PanNo [BPanNo], OLCT.CeRange [BCeRange], OLCT.CeComRate [BCeComRate], OLCT.CeDivision [BCeDivision], OLCT.EccNo [BEccNo], OBTN.U_InvType Type, OINV.CardName, OINV.Address2 [Delivery Addr], CE_CRD7.ECCNo, CE_CRD7.CERegNo, CE_CRD7.CERange, CE_CRD7.CEDivis, CE_CRD7.CEComRate, CRD7.TaxId0 [PAN], CRD7.TaxId1 [CST], CRD7.TaxId11 [STN], OINV.U_Address [Deliver At], INV1.LineNum, INV1.ItemCode, INV1.Dscription, OITM.SWW [HSNumber], INV1.Quantity, INV1.PriceBefDi Price, INV1.LineTotal, INV1.Price Rate, (INV1.PriceBefDi-INV1.Price)*INV1.Quantity Discount, INV4.Vat, INV4.Cess, INV1.LineTotal+INV1.VatSum Total, OINV.DocTotal GTotal, OINV.TotalExpns, OBTN.U_MfgName MfgName, convert(nvarchar(250), MFG_CRD1.Building) MFGBuilding, MFG_CRD1.Address MFGAddress, MFG_CRD1.Block MFGBlock, MFG_CRD1.Street MFGStreet, MFG_CRD1.City MFGCity, MFG_CRD1.ZipCode [MFGDistrict], OBTN.U_MCERegNo MCERegNo, OBTN.U_MCERange MCERange, OBTN.U_MCEDivis MCEDivis, OBTN.U_MCEComRate MCEComRate, OBTN.U_MPAN MPAN, OBTN.U_MCST MCST, OBTN.U_MSTN MSTN, OBTN.U_SupName SupName, convert(nvarchar(250), SUP_CRD1.Building) SUPBuilding, SUP_CRD1.Block SUPBlock, SUP_CRD1.Street SUPStreet, SUP_CRD1.City SUPCity, SUP_CRD1.ZipCode [SUPDistrict], OBTN.U_SCERegNo SCERegNo, OBTN.U_SCERange SCERange, OBTN.U_SCEDivis SCEDivis, OBTN.U_SCEComRate SCEComRate, OBTN.U_SPAN SPAN, OBTN.U_SCST SCST, OBTN.U_SSTN SSTN FROM OINV INNER JOIN INV1 ON OINV.DocEntry=INV1.DocEntry INNER JOIN OITM ON INV1.ItemCode=OITM.ItemCode INNER JOIN (select INV4.DocEntry, INV4.LineNum, CASE WHEN INV4.staType IN (@sVAT, @sCST) THEN sum(INV4.TaxSum) ELSE 0 END Vat, CASE WHEN INV4.staType=@sCess THEN sum(INV4.TaxSum) ELSE 0 END Cess from INV4 where INV4.DocEntry={?DocKey@} and INV4.RelateType=1 group by INV4.DocEntry, INV4.LineNum, INV4.staType) INV4 ON INV1.DocEntry=INV4.DocEntry AND INV1.LineNum=INV4.LineNum INNER JOIN OLCT ON INV1.LocCode=OLCT.Code INNER JOIN OCST ON OLCT.State=OCST.Code INNER JOIN OCRY ON OLCT.Country=OCRY.Code and OCST.Country=OCRY.Code INNER JOIN INV12 ON OINV.DocEntry=INV12.DocEntry INNER JOIN OITL ON INV1.BaseType=OITL.ApplyType AND INV1.BaseEntry=OITL.ApplyEntry AND INV1.BaseLine=OITL.ApplyLine INNER JOIN ITL1 ON OITL.LogEntry=ITL1.LogEntry INNER JOIN OBTN ON ITL1.MdAbsEntry=OBTN.AbsEntry and ITL1.SysNumber=OBTN.SysNumber and ITL1.ItemCode=OBTN.ItemCode LEFT JOIN OCRD MFG_OCRD ON MFG_OCRD.CardCode=OBTN.U_MfgCode LEFT JOIN CRD

Pedro Pascal
Se unió el 07/03/2018
Pinterest
Telegram
Linkedin
Whatsapp

2 Respuestas

0
Cargando...

Kuldeep, você tentou adicionar a coluna à consulta, mas ela não está sendo exibida no relatório do Crystal? Você poderia me fornecer o código modificado, por favor?

Respondido el 15/04/2024
LUCIANO RIOJA GHIOTTO
Se unió el 13/07/2019
0
Cargando...

Olá Nabil,

Referia-me à consulta anterior onde vejo que já incluíste as tabelas INV1 e CRD1 na consulta. Apenas precisas de incluir a coluna que estás a procurar no teu relatório.

Cumprimentos,

Kuldeep

Respondido el 15/04/2024
LUCIANO RIOJA GHIOTTO
Se unió el 13/07/2019

contacto@primeinstitute.com

(+51) 1641 9379
(+57) 1489 6964

© 2024 Copyright. Todos los derechos reservados.

Desarrollado por Prime Institute

¡Hola! Soy Diana, asesora académica de Prime Institute, indícame en que curso estas interesado, saludos!
Hola ¿Puedo ayudarte?