import xhiveframework


def execute():
	company = xhiveframework.get_all("Company", filters={"country": "India"})
	if not company:
		return

	xhiveframework.reload_doc("regional", "doctype", "lower_deduction_certificate")

	ldc = xhiveframework.qb.DocType("Lower Deduction Certificate").as_("ldc")
	supplier = xhiveframework.qb.DocType("Supplier")

	xhiveframework.qb.update(ldc).inner_join(supplier).on(ldc.supplier == supplier.name).set(
		ldc.tax_withholding_category, supplier.tax_withholding_category
	).where(ldc.tax_withholding_category.isnull()).run()
