# Copyright (c) 2022, InfluxFramework LLC and contributors
# For license information, please see license.txt

import influxframework


def execute():
	for doctype in ["Purchase Order", "Purchase Receipt", "Purchase Invoice"]:
		tab = influxframework.qb.DocType(doctype).as_("tab")
		influxframework.qb.update(tab).set(tab.is_old_subcontracting_flow, 1).where(
			tab.is_subcontracted == 1
		).run()
