Error while doing POS Closing Entry

Based on POS CLOSING ENTRY: Can refer row only if the charge type is 'On Previous Row Amount' or 'Previous Row Total' · Issue #35857 · frappe/erpnext · GitHub , seems there is an error if i’m using sales charges and tax templates with ‘On Previous Row Amount’ or ‘Previous Row Total’ in the Charge Types.

Is there anyone here can help how to solve this bug?