ALTER TABLE `tributacao` ADD `trib_tx_cfopDevolucaoVenda` VARCHAR( 10 ) NULL AFTER `trib_tx_cfopInterestadual`;
ALTER TABLE `tributacao` ADD `trib_tx_cfopDevolucaoCompra` VARCHAR( 10 ) NULL AFTER `trib_tx_cfopDevolucaoVenda`;


UPDATE `tributacao` SET trib_tx_uf ='RN',trib_tx_status = 'ativo',trib_nb_cstOrigem=890,trib_nb_cstCsosn=911,trib_nb_cstPis=833,trib_nb_cstCofins=866,
trib_tx_cfopInterno = '5102', trib_tx_aliquotaPis = '0.65', trib_tx_aliquotaCofins = '3', trib_tx_aliquotaIcms = '18' WHERE trib_tx_status = 'aguardando';

UPDATE `tributacao` SET trib_tx_uf ='RN',trib_tx_status = 'ativo',trib_nb_cstOrigem=890,trib_nb_cstCsosn=911,trib_nb_cstPis=833,trib_nb_cstCofins=866,
trib_tx_cfopInterno = '5102', trib_tx_aliquotaPis = '0.65', trib_tx_aliquotaCofins = '3', trib_tx_aliquotaIcms = '18' WHERE trib_tx_cfopInterno = '5102';

UPDATE `tributacao` SET trib_tx_uf ='RN',trib_tx_status = 'ativo',trib_nb_cstOrigem=890,trib_nb_cstCsosn=918,trib_nb_cstPis=833,trib_nb_cstCofins=866,
 trib_tx_aliquotaPis = '0', trib_tx_aliquotaCofins = '0', trib_tx_aliquotaIcms = '0' WHERE trib_tx_cfopInterno = '5405';

# UPDATE produto SET prod_nb_tributacao='28677',prod_tx_ncm='30049099' WHERE prod_tx_status = 'ativo' AND (prod_nb_imposto IS NULL OR prod_nb_imposto = 0 OR prod_nb_imposto = '');
UPDATE produto SET prod_nb_tributacao='26252',prod_tx_ncm='19053100' WHERE prod_tx_status = 'ativo' AND (prod_nb_imposto IS NULL OR prod_nb_imposto = 0 OR prod_nb_imposto = '');

UPDATE produto,imposto SET prod_tx_ncm = impo_tx_codigo WHERE prod_nb_imposto = impo_nb_id AND (prod_tx_ncm = '' OR prod_tx_ncm IS NULL);