How do we do a sales invoice with a GL item

Each time i post an invoice for a cash customer it automatically posts the payment to the selected account even if the customer hasnt paid