Scan charges a processing fee to the vendors and possibly, the vendors are trying to avoid paying taxes on their sales. With cash only, there is no paper trail.
You should have asked first if he has the ability to scan before you ordered that coconut from the old man. Who is going to buy that coconut that the old man opened for you? Didn't even bother to go back there once you have the cash. You basically just cost him 30 bath. Just another thoughtless foreigner.