Query to check if an invoice have a prepayment included or not
I want a query that can provide me with a flag whether an invoice has an applied prepayment or not. I checked if a flag is available in the invoice tables, but I didn't get such a one.
If an invoice has a prepayment applied for it => flag: Y
If an invoice has no prepayment applied for it => flag: N