He revisado el código y ejecutado cada una de las consultas con la factura que da error DocEntry=663 DocType=13 y todas las consultas salen correctas, sin duplicidades.
Os paso el codigo, sacado del informe en el menú Bases de datos/ Mostrar Consulta SQL. Ha cambiado los datos de la base de datos por nombres genéricos. SERVER o EMPRESA. Como veis hay un procedimiento almacenado [“GRAVESA”.“dbo”.“TmSp_DocLineTypeLayout”;1 663, 13], que sirve para mostrar o no secciones… En todo caso quita, no pone cosas. La primera consulta es la cabecera y la tercera son las líneas y no duplica en la consulta, en el informe si.
SERVER\SQLEMPRESA
SELECT "OINV"."DocEntry", "OINV"."DocDueDate", "OCTG"."PymntGroup", "OINV"."Address", "OINV"."CardCode", "OINV"."LicTradNum", "OINV"."CurSource", "OINV"."VatSum", "OINV"."VatSumSy", "OINV"."VatSumFC", "OINV"."DocTotal", "OINV"."DocTotalSy", "OINV"."DocTotalFC", "OINV"."DiscSum", "OINV"."DiscSumSy", "OINV"."DiscSumFC", "OINV"."RoundDif", "OINV"."RoundDifSy", "OINV"."RoundDifFC", "OINV"."WTSum", "OINV"."WTSumSC", "OINV"."WTSumFC", "OINV"."DpmAmnt", "OINV"."DpmAmntSC", "OINV"."DpmAmntFC", "OINV"."TotalExpns", "OINV"."TotalExpSC", "OINV"."TotalExpFC", "OINV"."DocCur", "OINV"."CardName", "OCRD"."SenderID", "OINV"."DocNum", "OINV"."TaxDate", "OINV"."U_NWSP_PESO_BRUTO", "OINV"."U_NWSP_PESO_NETO", "OINV"."U_NWSP_VOLUMEN", "OINV"."U_NWSP_PALTES", "OCRD"."Series", "OINV"."PeyMethod", "OINV"."Address2", "OCRD"."HousBnkAct", "OINV"."U_NWSP_PlasticoTotal", "OINV"."U_NWSP_PlasticoNoReci", "OINV"."TrnspCode", "OCRD"."CardCode", "OINV"."Footer"
FROM ("EMPRESA"."dbo"."OINV" "OINV" LEFT OUTER JOIN "EMPRESA"."dbo"."OCRD" "OCRD" ON "OINV"."CardCode"="OCRD"."CardCode") LEFT OUTER JOIN "EMPRESA"."dbo"."OCTG" "OCTG" ON "OINV"."GroupNum"="OCTG"."GroupNum"
WHERE "OINV"."DocEntry"=663
SERVER\SQLEMPRESA
"EMPRESA"."dbo"."TmSp_DocLineTypeLayout";1 663, 13
SERVER\SQLEMPRESA
SELECT "INV1"."Quantity", "INV1"."LineTotal", "INV1"."TotalSumSy", "INV1"."TotalFrgn", "INV1"."Price", "INV1"."Currency", "INV1"."TaxOnly", "INV1"."SubCatNum", "INV1"."Dscription", "INV1"."ItemCode", "INV1"."U_NwspIntrastatCod", "INV1"."DocEntry", "INV1"."LineNum", "INV1"."VisOrder", "INV1"."Text"
FROM "EMPRESA"."dbo"."INV1" "INV1"
SERVER\SQLEMPRESA
SELECT T0.[DocEntry] AS INV1__DocEntry
, T0.[LineNum] AS INV1__LineNum
, T2.[DocNum] AS ODLN__DocNum
, T4.[NumAtCard] AS ORDR__NumAtCard
FROM INV1 T0
LEFT JOIN DLN1 T1
ON T0.[BaseType] = T1.[ObjType]
AND T0.[BaseLine] = T1.[LineNum]
AND T0.[BaseEntry] = T1.[DocEntry]
LEFT JOIN ODLN T2
ON T1.[DocEntry] = T2.[DocEntry]
LEFT JOIN RDR1 T3
ON T1.[BaseType] = T3.[ObjType]
AND T1.[BaseLine] = T3.[LineNum]
AND T1.[BaseEntry] = T3.[DocEntry]
LEFT JOIN ORDR T4
ON T3.[DocEntry] = T4.[DocEntry];
SERVER\SQLEMPRESA
SELECT "OSCN"."U_NWSP_SUDENOMINA", "OSCN"."CardCode", "OSCN"."Substitute", "OSCN"."ItemCode"
FROM "EMPRESA"."dbo"."OSCN" "OSCN"
SERVER\SQLEMPRESA
SELECT "OITM"."QryGroup1", "OITM"."ItemCode"
FROM "EMPRESA"."dbo"."OITM" "OITM"
SERVER\SQLEMPRESA
SELECT "INV12"."StreetB", "INV12"."BlockB", "INV12"."ZipCodeB", "INV12"."StateB", "INV12"."CountryB", "INV12"."DocEntry"
FROM "EMPRESA"."dbo"."INV12" "INV12"
SERVER\SQLEMPRESA
SELECT "OCST"."Name", "OCST"."Code"
FROM "EMPRESA"."dbo"."OCST" "OCST"
SERVER\SQLEMPRESA
SELECT "OCRY"."Name", "OCRY"."Code"
FROM "EMPRESA"."dbo"."OCRY" "OCRY"
SERVER\SQLEMPRESA
SELECT "OSHP"."TrnspName", "OSHP"."TrnspCode"
FROM "EMPRESA"."dbo"."OSHP" "OSHP"
SERVER\SQLEMPRESA
SELECT "ODCI"."Code", "CRD9"."CardCode"
FROM "EMPRESA"."dbo"."CRD9" "CRD9" LEFT OUTER JOIN "EMPRESA"."dbo"."ODCI" "ODCI" ON "CRD9"."ISIncoterm"="ODCI"."AbsEntry"
SERVER\SQLEMPRESA
SELECT "OADM"."CompnyName", "OADM"."MainCurncy", "OADM"."SysCurrncy", "OADM"."QtyDec", "OADM"."DecSep", "OADM"."ThousSep", "OADM"."PriceDec", "OADM"."CurOnRight", "OADM"."SumDec", "OADM"."PrintHdrF", "OADM"."DflBnkCode", "OADM"."DflBnkAcct"
FROM "EMPRESA"."dbo"."OADM" "OADM"
SERVER\SQLEMPRESA
SELECT "OADP"."LogoImage"
FROM "EMPRESA"."dbo"."OADP" "OADP"
SERVER\SQLEMPRESA
SELECT "ADM1"."Street", "ADM1"."City", "ADM1"."StreetNo"
FROM "EMPRESA"."dbo"."ADM1" "ADM1"