Hi Franncis
Please try below query. Make changes in hard coded area mentioned below and save updated query in query manager and assign in AR Invoice Document numbering series field.
Declare @CardCode varchar (20)
Select @CardCode = $[$4.0.0]
Select
Case @CardCode
When 'C20000' then '-1'
else 67
end [DocSeries]
1)Please give your Cash sale customer code instead of C20000
2) Instead of -1 please give series code for Cash sale
3) Instead of 67 please give series for normal Invoice
Note: You may need to change series codes if you create another document numbering series for next financial year
All the best
Unnikrishnan