New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[feature] Shipping Rule Tax calculated based on Total Net Weight #11672
Conversation
"bold": 0, | ||
"collapsible": 0, | ||
"columns": 0, | ||
"fieldname": "weight", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
weight_per_unit
will be more clearer
5e53339
to
54a8341
Compare
6dc4d9f
to
b48411e
Compare
@@ -343,6 +343,9 @@ cur_frm.cscript.select_print_heading = function(doc,cdt,cdn){ | |||
cur_frm.pformat.print_heading = __("Purchase Invoice"); | |||
} | |||
|
|||
cur_frm.add_fetch('item_code','weight_per_unit','weight_per_unit'); | |||
cur_frm.add_fetch('item_code','weight_uom','weight_uom'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wrote same code in every file. Add this code into transaction.js and check child table(eg. sales order item) has field weight_per_unit
@@ -70,6 +70,7 @@ def calculate_item_values(self): | |||
item.net_rate = item.rate | |||
item.amount = flt(item.rate * item.qty, item.precision("amount")) | |||
item.net_amount = item.amount | |||
item.total_weight = flt(item.weight_per_unit * item.qty) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Total weight will calculate only if there is taxes? I think this has to be done on qty change trigger?
@@ -92,6 +92,7 @@ erpnext.taxes_and_totals = erpnext.payments.extend({ | |||
item.amount = flt(item.rate * item.qty, precision("amount", item)); | |||
item.net_amount = item.amount; | |||
item.item_tax_amount = 0.0; | |||
item.total_weight = flt(item.weight_per_unit * item.qty) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Total weight calculation must be on qty trigger?
Duplicate #11770 |
In Shipping Rule select calculate_based_on: Net Weight and Select condition from value to value.
In Sales Invoice Item Weight, total_weight and weight_uom field are added.
based on qty weight are calculated for eg. weight=20 and qty = 5, total_weight = 100
In Sales invoice on select shipping rule, it will calculate tax based on total_net_weight.