INSERT INTO versao_sistema (Dominio, Seq , Versao, DH_Atualizacao) SELECT 0, (SELECT (IFNULL(MAX(Seq), 0) + 1) FROM versao_sistema WHERE Dominio = 0 LIMIT 1),  "16.02.00", now() FROM dominio LIMIT 1;

INSERT INTO versao_sistema (Dominio, Seq , Versao, DH_Atualizacao) SELECT Dominio AS T_Dominio, (SELECT (IFNULL(MAX(Seq), 0)+1) FROM versao_sistema WHERE Dominio = T_Dominio LIMIT 1), "16.02.00",  now() FROM dominio WHERE Dominio > 0;


ALTER TABLE produto_classe_tributo_formula
	ADD COLUMN ICMS_BenefR VARCHAR(10) NOT NULL DEFAULT '',
	ADD COLUMN CredPresumido VARCHAR(10) NOT NULL DEFAULT '' ,
	ADD COLUMN CredPresumidoTP VARCHAR(1) NOT NULL DEFAULT 'P',
	ADD COLUMN CredPresumidoAliq DECIMAL(15,4) NOT NULL DEFAULT 0;

ALTER TABLE nota_fiscal_item
	ADD COLUMN ICMS_BenefR VARCHAR(10) NOT NULL DEFAULT '',
	ADD COLUMN CredPresumido VARCHAR(10) NOT NULL DEFAULT '' ,
	ADD COLUMN CredPresumidoTP VARCHAR(1) NOT NULL DEFAULT 'P',
	ADD COLUMN CredPresumidoAliq DECIMAL(15,4) NOT NULL DEFAULT 0,
	ADD COLUMN CredPresumidoValor DECIMAL(15,4) NOT NULL DEFAULT 0;

