ODT - Remain to Pay - Adding instead of Subtracting

Hello All
I am creating an ODT useing version 13.0.2
and {Object_remain_to_pay} is adding the Total amount of invoice + Already payed instead of subtracting them example:
total TTC = 10,000
Already Payed = 5,000
Remain to pay = 15000 ( Should be 5000 )

Please help.
Regards
Rami.

@eldy Hello any ideas to help with this.

Is your invoice a customer or vendor invoice ?
What is type of invoice (standard, credit note, down payment…) ?

Hello Laurent

It is standard invoice, customer.

Regards
Rami

You should create a ticket on github.com/dolibarr/dolibarr/issues