mirror of
https://github.com/frappe/erpnext.git
synced 2026-03-23 05:04:52 +01:00
@@ -652,7 +652,7 @@ frappe.ui.form.on("Purchase Invoice", {
|
|||||||
if (frm.doc.supplier) {
|
if (frm.doc.supplier) {
|
||||||
frm.doc.apply_tds = frm.doc.__onload.supplier_tds ? 1 : 0;
|
frm.doc.apply_tds = frm.doc.__onload.supplier_tds ? 1 : 0;
|
||||||
}
|
}
|
||||||
if (!frm.doc.__onload.enable_apply_tds) {
|
if (!frm.doc.__onload.supplier_tds) {
|
||||||
frm.set_df_property("apply_tds", "read_only", 1);
|
frm.set_df_property("apply_tds", "read_only", 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -346,22 +346,6 @@ class PurchaseInvoice(BuyingController):
|
|||||||
self.tax_withholding_category = tds_category
|
self.tax_withholding_category = tds_category
|
||||||
self.set_onload("supplier_tds", tds_category)
|
self.set_onload("supplier_tds", tds_category)
|
||||||
|
|
||||||
# If Linked Purchase Order has TDS applied, enable 'apply_tds' checkbox
|
|
||||||
if purchase_orders := [x.purchase_order for x in self.items if x.purchase_order]:
|
|
||||||
po = qb.DocType("Purchase Order")
|
|
||||||
po_with_tds = (
|
|
||||||
qb.from_(po)
|
|
||||||
.select(po.name)
|
|
||||||
.where(
|
|
||||||
po.docstatus.eq(1)
|
|
||||||
& (po.name.isin(purchase_orders))
|
|
||||||
& (po.apply_tds.eq(1))
|
|
||||||
& (po.tax_withholding_category.notnull())
|
|
||||||
)
|
|
||||||
.run()
|
|
||||||
)
|
|
||||||
self.set_onload("enable_apply_tds", True if po_with_tds else False)
|
|
||||||
|
|
||||||
super().set_missing_values(for_validate)
|
super().set_missing_values(for_validate)
|
||||||
|
|
||||||
def validate_credit_to_acc(self):
|
def validate_credit_to_acc(self):
|
||||||
|
|||||||
Reference in New Issue
Block a user