import xhiveframework


def execute():
	PayrollEntry = xhiveframework.qb.DocType("Payroll Entry")

	status = (
		xhiveframework.qb.terms.Case()
		.when(PayrollEntry.docstatus == 0, "Draft")
		.when(PayrollEntry.docstatus == 1, "Submitted")
		.else_("Cancelled")
	)

	(xhiveframework.qb.update(PayrollEntry).set("status", status).where(PayrollEntry.status.isnull())).run()
