Okay,
I don’t have any invoices in my database to work with, but I think the following query should do the trick.
It lists (left table) ONLY Shipment Invoices that have an associated Advance Billing invoice. This relationship is made via the InvcHead.OrderNum field since both the shipment and the advance bill invoice would reference the sales order.
select
i.InvoiceNum,
i.InvoiceType,
i.InvoiceDate,
i.OrderNum,
i2.InvoiceNum,
i2.InvoiceType,
g.JournalNum,
g.Description,
g.GLAccount,
g.SegValue1,
i.DocInvoiceAmt,
i.ApplyDate
from invchead i inner join invchead i2 on i.company = i2.company and i.OrderNum = i2.OrderNum
left outer join gljrndtl g on i.invoicenum = g.arinvoicenum
where i.FiscalYear = '2018' and i.InvoiceType = 'SHP' and i2.InvoiceType = 'ADV'
order by i.invoicenum desc