Purchase Invoice Deduct

How to affect a purchase invoice with the deduct option from a custom doctype ???

I need to subtract a value from the total of a certain purchase invoice using Purchase Taxes and Charges with the deduct option…

Any ideas ?

Thank you so much

Your question is not clear. Please explain with example and name of accounts

Did you try this?

Sure, I have tried it, however I need to do it in a different doctype to be able to have the detail of the taxes that are being withheld and to break down the value that is generated.

The use case is as follows:
I have generated a purchase invoice and I need to make a tax withholding. Then create a doctype to perform calculations and include information according to the taxes that apply in Ecuador

I have already calculated the total that I need to deduct on a purchase invoice, so I would like to know how I can use Purchase Taxes and Charges or the option to Deduct a value on the invoice.

Tax Withholding in PI could be done this way.

https://docs.erpnext.com/docs/user/manual/en/accounts/tax-withholding-category#31-use-in-purchase-invoice