Sales Invoice with negative grand total

Hi there,
we need the grand total in sales invoices to be negative.
As far as I can tell there have been several issues created about this topic:

Our usecase:
We are a club in germany and sell drinks in bottles and cups. Per bottle or cup the customer pays a 1 € deposit. Due to this our POS ( is able to create invoices with negative grand totals. I need to transfer the invoices from the the POS to ERPNext, but I can’t. I tried splitting out the deposits to separate return invoices, but then I run into trouble with additional discounts per invoice. I can’t do regular returns here. People are encouraged to collect empty bottles and get returns back. This is common practice here in germany.

What I need:
I need invoices with regular payments AND deposit returns in a way that supports negative grand totals. I am able to add sales invoice items with negative prices, as long as the grand total is above 0. But I explicitly need the cases where the deposit returns are bigger then the sales. Our POS supports negative grand totals and the selection of threads above show clearly there is demand for this.

If this change is to invasive, is it maybe possible to add a system flag that enables us to opt-in to this feature?
Or can I change the behavior in code without forking ERPNext? I don’t want to disrupt our update routine. Is it possible to do this in a custom script or similar?

Any hints about this would really help me out.