Retention amount in sales invoice

Customer invoicing has a retention amount as we are a contracting company.

I want this modification in the invoice to be optional as follow:
Amount before tax = 1000
Tax=150
Total after tax= 1150
retention percentage= 10%
retention amount=115
Due amount=1035

The retention amount remains in the customer’s account until the end of the warranty period for the day of payment.

For this retention amount, Use Write Off section of sales invoice
put the write off amount and write account

Then amount will go to write off account and will not remains in customer’s account

Dear Usama
Appreciate your reply, but I could not find section named Write Off in sales incoive doc.

Write Off section will be shown if Is POS is checked in the invoice

Otherwise you will pass a Journal Entry for write off

Debit the retention amount from customer account head and
Credit into write off account head

But this will not show the invoice like this picture as per client requirment
retention
ment?

Update the Print format add “Retention” Value link with write off amount field