I need help in calculating fees and support and how to bring the item automatically to sales invoice

gues to help me solve this problem: I will give you a table of the required segments
Method of calculating the relative judicial fees according to the slides + the relative documentation fees
Execution Method Script Custom is created and programmed with 3 procedures for each different calculation procedure.
The following categories: -
 Opening a new item named (Judicial Support Fees — for example, a number 01-A), which is linked to the Judicial Support Account.
Link it to the tax
 Open a new item called (fees of commercial, civil and administrative litigation disputes.
(A-02
 Adding a new item named (net assets distributed among creditors by a legal custodian outside
The court) relates the item to the proceeds of judicial fees and a number, for example 03-A
 Adding a new class named (Editor’s Notarized Value Documentation), number 04-A, which is linked to the documentation revenue.
Class 02-A is linked to a group of items added to (judicial fees).
Calculate the required revenue (refer to the accounts department to provide us with the account number in the directory)
2 - ERPNext in Script Custom is programmed to calculate revenue (fees + elimination support) according to
The table above
3.In the sales invoice a TextBox field is added at the top of the sales invoice called (Value).
(ComboBox) - and add another field is very important ComboBox is installed only three types in it to recognize
It has the required procedure to calculate the combo required to install 3 types in it
(1) segments of the lawsuit; (ii) distribution of assets by an out-of-court custodian; (iii) documentation of the

The measure will be programmed according to the COMBO index number as follows:



I added a field of type of selection to choose a type of (1 - segments of the lawsuit - 2 - the distribution of assets by the Secretary outside the court) 3 - document the editor with
Financial Value)
And a currency-type field to enter the value

If 1 is done
When the Enter button is clicked in the value bar the action is performed and adds
Items are automatically added to the table of items
The system performs the calculation and calculation
Fees in the price box for the item and adjust the total by item —
Also, the procedure automatically adds the second class support number 01-A and makes the quantity 1
The required calculation of the full fee has been carried out
If the combo number is 2
Script recognizes item number A-03 in the sales invoice and calculates
In the way above and add the first two classes No. 03-A and the category support elimination 01-A automatically
But not in the slide table but in the following way
(Fee Calculation) = Amount of Claim * (% 1) in Category 03-A
(Judicial Support Account) = Amount of Claim * (% 1%) * (30) in Category No. 01-A
If the combo number is 3
Script recognizes item number 04-A in the sales invoice and calculates
In the way above and add the first two classes No. 04-A and support category elimination 01-A automatically
But not in the slide table but in the following way
(Fee Calculation) = Amount of Claim * (20.0%) in Category No. 04-A
(Judicial Support Account) = (Amount of Claim * (% 20.0%) * (25.0)) in Category No.
A-01
With these three procedures, revenues will be carried over to the accounts in their correct place automatically when the sales invoices are posted.