@junius1
"We have uncollectible invoices and I have written off these invoices by discounting the invoices charging it to bad debt. When I generate the P/L Statement under cash basis, these invoices appeared in the Sales line item."
Since cash basis accounting does not have bad debt, when you write off an invoice to bad debt, the invoice is getting paid and that books the income and the corresponding bad debt expense as of the date you apply the credit memo on cash basis. So, you can either zero out the invoice (take a screenshot if you want and attach it to the zeroed out invoice in case the customers pays at a later date) or create a credit memo that zeros out the invoice by mapping the items on the credit memo to the same accounts as the invoice. Be careful not to put any inventory items on the credit memo as that will put them back into inventory. Or, if you want to preserve the invoice, you can continue doing it the way you're doing it and make an adjusting journal entry at period-end to reduce income and the corresponding bad debt expense.