Scripts Tax Witholding

Hi everyone!!

I am trying to replicate withholding tax to a purchase invoice from a custom doctype.
Could someone help me where I can find the scripts or functions involved in this withholding tax process.

I appreciate your help …