9.38 AP Bad debt relief calculation for IM tax code

Lets said I have the following Purchase Invoice detail for tax code using IM and TX together. How the system get the bad debt relief for the outstanding purchase (IM) document?

Purchase Invoice (PI-0001) Detail:

Description Subtotal Tax Code Tax Amt Subtotal(Tax)

GST Import 0.00 IM 6.00 6.00

Handling charges 100.00 TX 6.00 106.00

-------------------------------------------------------------------

100.00 12.00 (C) 112.00 (B)

=================================================

Payment PV-0999 (Knock-off to PI-0001) = Rm6.00

Outstanding for PI-0001 (A) = Rm112.00 - 6.00

= Rm 106.00

Our Calculation:

AP Bad Debt Relief = (A/B) x C

= (106.00/112.00) x 12.00

= 11.36

Outstanding Local Amount (Before Tax) = Rm106.00 - 11.36

= Rm 94.64