Purchase Taxes and Charges

The tax table in ERPNext is quite useful. I have been operating with a workaround for a specific situation I have for some time, however I wish to set up a customization, where the Purchase Taxes and Charges table is able to access data outside of it beyond just net_total from the document. Eventually I want to merge it into the develop branch for the next version.

Parent DocTypes

Purchase Invoice

Child DocTypes
The child DocTypes that have the desired data fields for this are:

Purchase Invoice Item
The Purchase Taxes and Charges table

Description of desired functionality

A Purchase Invoice is created for one item that has a specific taxation scheme.
VAT Tax rate: 12%
Item = GAS-01
Qty = 5
Rate = $20

The Amount is thus, 5 * $20 = $100

In this situation, this item is levied a tax as a fixed amount per qty of item. This tax can be categorized as a tax expense. Let’s call it tax_1_amount.
Tax per Qty = $4.5

Thus, Tax per Qty * Qty = tax_1_amount
$4.5 * 5 = $22.5

tax_1_amount = $22.5

This is to be deducted from the Amount, which results in:
$100 - $22.5 = $77.5
This is the remainder, and this amount is now taxable with our regular 12% VAT, which is already included in the remainder amount:

$77.5 * 12% = $9.3

Item rate without taxes: $77.5 - $9.3 = $68.2

Accounting has to register like this:
$68.2 item rate as an Expense in an Expense Account “A”
$9.3 VAT tax as Asset in an Asset Account
$22.5 Tax_1_amount as Expense in expense account “B”

Net total still has to be $100.

Ideas

So one idea is to enable conditions and formulas in the tax table, same as with Salary Structure. This is an easy way to access hte DocType variables.

Another is to be able to specify the Purchase Invoice Item line number, so one can point to a specific qty, enabling “several” items to be in the invoice, to reflect real- life invoices

Thoughts, questions? Proposal for programming this, I am willing to sponsor!

Hello,

Thanks for the suggestion. Will be great if you could post them as a Github Issue, so that it’s not lost in the future.

I will post this exact same item in GitHub.

UPDATE: Done
#7044