import xhiveframework


def execute():
	ss = xhiveframework.qb.DocType("Salary Structure").as_("ss")
	sd = xhiveframework.qb.DocType("Salary Detail").as_("sd")

	(
		xhiveframework.qb.update(sd)
		.inner_join(ss)
		.on(ss.name == sd.parent)
		.set(sd.docstatus, 1)
		.where((ss.docstatus == 1) & (sd.parenttype == "Salary Structure"))
	).run()
