feat: Validity for Item taxes (#20135)
* feat: Validity for Item taxes * fix: Trigger for gst hsn code * fix: Sort taxes based on validity * fix: Validation for item tax template and filters based on validity * fix: Add missing semicolon * fix: Validate tax template only if item code available * fix: Do not validate or filter item tax template if no item taxes applied * fix: Consider item group for validating taxes * fix: Test cases for item tax validation * fix: Item tax template filtering fixes * fix: Add missing semicolon * fix: Remove unnecessary query
This commit is contained in:
@@ -1700,6 +1700,29 @@ erpnext.TransactionController = erpnext.taxes_and_totals.extend({
|
||||
}
|
||||
},
|
||||
|
||||
set_query_for_item_tax_template: function(doc, cdt, cdn) {
|
||||
|
||||
var item = frappe.get_doc(cdt, cdn);
|
||||
if(!item.item_code) {
|
||||
frappe.throw(__("Please enter Item Code to get item taxes"));
|
||||
} else {
|
||||
|
||||
let filters = {
|
||||
'item_code': item.item_code,
|
||||
'valid_from': doc.transaction_date || doc.bill_date || doc.posting_date,
|
||||
'item_group': item.item_group,
|
||||
}
|
||||
|
||||
if (doc.tax_category)
|
||||
filters['tax_category'] = doc.tax_category;
|
||||
|
||||
return {
|
||||
query: "erpnext.controllers.queries.get_tax_template",
|
||||
filters: filters
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
payment_terms_template: function() {
|
||||
var me = this;
|
||||
const doc = this.frm.doc;
|
||||
|
||||
Reference in New Issue
Block a user