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

Hi.
Maybe you already solve it but if not, since version 13 a tax withhold can be made on Payment Entry.
It is a manual process but works.
As soon as you have the values from the SRI (retención) you can add on the tax table for a Payment Entry linked to a sales invoice.
With some cutomization and few scripts (I am still dealing with that) it is posible automate it and collect data for the Anexos Transaccionales if necessary too.
I hope it helps

Saludos.