
UPDATE `vn`.`client` c
	JOIN `vn`.`country` co ON co.id=c.countryFk
SET c.hasDailyInvoice = co.hasDailyInvoice
WHERE co.hasDailyInvoice IS NOT NULL
	AND c.hasDailyInvoice = FALSE;

UPDATE `vn`.`client` c
	JOIN `vn`.`province` p ON p.id=c.provinceFk
	JOIN `vn`.`autonomy` a ON a.id = p.autonomyFk
SET c.hasDailyInvoice = a.hasDailyInvoice
WHERE a.hasDailyInvoice IS NOT NULL
	AND c.hasDailyInvoice = FALSE;
