SELECT 'Fornecedores' as tipo, count(*) as qtdd, '29' as expected
FROM fornecedores_empresas
WHERE codigo IN (10, 32, 67, 119, 186, 203, 204, 205, 206, 207, 208, 209, 210, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 225, 226, 227, 228, 229, 230);

SELECT 'Despesas' as tipo, count(*) as qtdd, '18' as expected
FROM cadastro_plano_de_contas_itens
WHERE conta_reduzida IN (74, 543, 548, 549, 574, 579, 580, 616, 618, 621, 623, 638, 663, 664, 697, 699, 765, 799);

INSERT INTO financeiro_contas_fornecedores ( --
    fornecedor_id,
    nota_fiscal,
    data,
    valor,
    nome,
    plano_de_contas_id,
--
#     centros_de_custo_cadaris_id,
#     forma_pagamento,
#     boleto,
    pago, -- =1
#     comprovante,
    conta_id, -- =3
    created_at, -- =NOW()
    updated_at -- =NOW()
)
    VALUES --
  ( (SELECT id FROM fornecedores_empresas WHERE codigo = 204 LIMIT 1), '', '2019-02-25', 5989, 'Compra garantia note', (SELECT id FROM cadastro_plano_de_contas_itens WHERE conta_reduzida= 765 LIMIT 1), 1, 3, NOW(), NOW() ),
  ( (SELECT id FROM fornecedores_empresas WHERE codigo = 205 LIMIT 1), '583882', '2019-06-19', 21428, 'Curso Fred - 07/07', (SELECT id FROM cadastro_plano_de_contas_itens WHERE conta_reduzida= 799 LIMIT 1), 1, 3, NOW(), NOW() ),
  ( (SELECT id FROM fornecedores_empresas WHERE codigo = 205 LIMIT 1), '584098', '2019-06-26', 23125, 'Curso Guilherme - 06/08', (SELECT id FROM cadastro_plano_de_contas_itens WHERE conta_reduzida= 74 LIMIT 1), 1, 3, NOW(), NOW() ),
  ( (SELECT id FROM fornecedores_empresas WHERE codigo = 206 LIMIT 1), '', '2019-08-02', 44968, 'Compra de vidros 05/05', (SELECT id FROM cadastro_plano_de_contas_itens WHERE conta_reduzida= 74 LIMIT 1), 1, 3, NOW(), NOW() ),
  ( (SELECT id FROM fornecedores_empresas WHERE codigo = 207 LIMIT 1), '', '2019-08-08', 9006, 'Curso Maris 05/12', (SELECT id FROM cadastro_plano_de_contas_itens WHERE conta_reduzida= 799 LIMIT 1), 1, 3, NOW(), NOW() ),
  ( (SELECT id FROM fornecedores_empresas WHERE codigo = 208 LIMIT 1), '250180', '2019-08-09', 20541, 'Curso Maris 05/06', (SELECT id FROM cadastro_plano_de_contas_itens WHERE conta_reduzida= 799 LIMIT 1), 1, 3, NOW(), NOW() ),
  ( (SELECT id FROM fornecedores_empresas WHERE codigo = 209 LIMIT 1), '116258', '2018-07-25', 46241, 'parcela 04/12', (SELECT id FROM cadastro_plano_de_contas_itens WHERE conta_reduzida= 697 LIMIT 1), 1, 3, NOW(), NOW() ),
  ( (SELECT id FROM fornecedores_empresas WHERE codigo = 204 LIMIT 1), '1409333', '2019-09-25', 57980, 'Notebook\'s e PC\'s 03/10', (SELECT id FROM cadastro_plano_de_contas_itens WHERE conta_reduzida= 623 LIMIT 1), 1, 3, NOW(), NOW() ),
  ( (SELECT id FROM fornecedores_empresas WHERE codigo = 210 LIMIT 1), '196698', '2019-09-25', 57833, 'Compra tintas 03/06', NULL, 1, 3, NOW(), NOW() ),
  ( (SELECT id FROM fornecedores_empresas WHERE codigo = 203 LIMIT 1), '5667110', '2019-09-27', 16035, 'Compra produtos informática 03/03', (SELECT id FROM cadastro_plano_de_contas_itens WHERE conta_reduzida= 579 LIMIT 1), 1, 3, NOW(), NOW() ),
  ( (SELECT id FROM fornecedores_empresas WHERE codigo = 203 LIMIT 1), '5667110', '2019-09-27', 692, 'Frete 03/03', (SELECT id FROM cadastro_plano_de_contas_itens WHERE conta_reduzida= 549 LIMIT 1), 1, 3, NOW(), NOW() ),
  ( (SELECT id FROM fornecedores_empresas WHERE codigo = 214 LIMIT 1), '', '2019-09-30', 4300, 'Estúdio fotográfico 03/03', (SELECT id FROM cadastro_plano_de_contas_itens WHERE conta_reduzida= 664 LIMIT 1), 1, 3, NOW(), NOW() ),
  ( (SELECT id FROM fornecedores_empresas WHERE codigo = 214 LIMIT 1), '', '2019-09-30', 349, 'Frete 03/03', (SELECT id FROM cadastro_plano_de_contas_itens WHERE conta_reduzida= 549 LIMIT 1), 1, 3, NOW(), NOW() ),
  ( (SELECT id FROM fornecedores_empresas WHERE codigo = 215 LIMIT 1), '', '2019-10-01', 1.91250, 'Compra cadeiras 03/04', (SELECT id FROM cadastro_plano_de_contas_itens WHERE conta_reduzida= 623 LIMIT 1), 1, 3, NOW(), NOW() ),
  ( (SELECT id FROM fornecedores_empresas WHERE codigo = 186 LIMIT 1), '', '2019-10-04', 48502, 'Compras reforma 03/06', NULL, 1, 3, NOW(), NOW() ),
  ( (SELECT id FROM fornecedores_empresas WHERE codigo = 216 LIMIT 1), '2658332', '2019-10-08', 36729, 'Compra Reforma 03/05', NULL, 1, 3, NOW(), NOW() ),
  ( (SELECT id FROM fornecedores_empresas WHERE codigo = 217 LIMIT 1), '267', '2019-10-11', 43750, 'Conserto tubulação 03/04', NULL, 1, 3, NOW(), NOW() ),
  ( (SELECT id FROM fornecedores_empresas WHERE codigo = 218 LIMIT 1), '745440', '2019-10-16', 8952, 'Compra bateria 03/04', (SELECT id FROM cadastro_plano_de_contas_itens WHERE conta_reduzida= 579 LIMIT 1), 1, 3, NOW(), NOW() ),
  ( (SELECT id FROM fornecedores_empresas WHERE codigo = 218 LIMIT 1), '745440', '2019-10-16', 1823, 'Frete bateria 03/04', (SELECT id FROM cadastro_plano_de_contas_itens WHERE conta_reduzida= 549 LIMIT 1), 1, 3, NOW(), NOW() ),
  ( (SELECT id FROM fornecedores_empresas WHERE codigo = 228 LIMIT 1), '42896', '2019-10-18', 23250, 'Compra e instalação tapete 03/04', (SELECT id FROM cadastro_plano_de_contas_itens WHERE conta_reduzida= 580 LIMIT 1), 1, 3, NOW(), NOW() ),
  ( (SELECT id FROM fornecedores_empresas WHERE codigo = 229 LIMIT 1), '', '2020-10-29', 29017, 'Microfone 02/03', (SELECT id FROM cadastro_plano_de_contas_itens WHERE conta_reduzida= 580 LIMIT 1), 1, 3, NOW(), NOW() ),
  ( (SELECT id FROM fornecedores_empresas WHERE codigo = 186 LIMIT 1), '12208', '2019-11-17', 22617, 'Parcela 02/06', (SELECT id FROM cadastro_plano_de_contas_itens WHERE conta_reduzida= 548 LIMIT 1), 1, 3, NOW(), NOW() ),
  ( (SELECT id FROM fornecedores_empresas WHERE codigo = 203 LIMIT 1), '5667110', '2019-11-25', 31663, 'Compra Switch - parcela 01/03', (SELECT id FROM cadastro_plano_de_contas_itens WHERE conta_reduzida= 579 LIMIT 1), 1, 3, NOW(), NOW() ),
  ( (SELECT id FROM fornecedores_empresas WHERE codigo = 203 LIMIT 1), '5667110', '2019-11-25', 970, 'Frete Switch', (SELECT id FROM cadastro_plano_de_contas_itens WHERE conta_reduzida= 549 LIMIT 1), 1, 3, NOW(), NOW() ),
  ( (SELECT id FROM fornecedores_empresas WHERE codigo = 219 LIMIT 1), '127074', '2019-11-25', 2840, 'Contratação de ferramenta', (SELECT id FROM cadastro_plano_de_contas_itens WHERE conta_reduzida= 663 LIMIT 1), 1, 3, NOW(), NOW() ),
  ( (SELECT id FROM fornecedores_empresas WHERE codigo = 220 LIMIT 1), '', '2019-11-25', 22500, 'Curso Maris', (SELECT id FROM cadastro_plano_de_contas_itens WHERE conta_reduzida= 799 LIMIT 1), 1, 3, NOW(), NOW() ),
  ( (SELECT id FROM fornecedores_empresas WHERE codigo = 220 LIMIT 1), '', '2019-11-25', 22500, 'Curso Olivia', (SELECT id FROM cadastro_plano_de_contas_itens WHERE conta_reduzida= 74 LIMIT 1), 1, 3, NOW(), NOW() ),
  ( (SELECT id FROM fornecedores_empresas WHERE codigo = 221 LIMIT 1), '4056027', '2019-11-28', 12900, 'Compra brindes funcionários - 01/03', (SELECT id FROM cadastro_plano_de_contas_itens WHERE conta_reduzida= 663 LIMIT 1), 1, 3, NOW(), NOW() ),
  ( (SELECT id FROM fornecedores_empresas WHERE codigo = 32 LIMIT 1), '', '2019-11-29', 2766, 'Compra livro', (SELECT id FROM cadastro_plano_de_contas_itens WHERE conta_reduzida= 618 LIMIT 1), 1, 3, NOW(), NOW() ),
  ( (SELECT id FROM fornecedores_empresas WHERE codigo = 222 LIMIT 1), '1190436', '2019-11-29', 31768, 'Compra cerveja confraternização', (SELECT id FROM cadastro_plano_de_contas_itens WHERE conta_reduzida= 621 LIMIT 1), 1, 3, NOW(), NOW() ),
  ( (SELECT id FROM fornecedores_empresas WHERE codigo = 222 LIMIT 1), '1190436', '2019-11-29', 1590, 'Frete', (SELECT id FROM cadastro_plano_de_contas_itens WHERE conta_reduzida= 549 LIMIT 1), 1, 3, NOW(), NOW() ),
  ( (SELECT id FROM fornecedores_empresas WHERE codigo = 223 LIMIT 1), '', '2019-11-30', 14293, 'Analise de SEO', (SELECT id FROM cadastro_plano_de_contas_itens WHERE conta_reduzida= 663 LIMIT 1), 1, 3, NOW(), NOW() ),
  ( (SELECT id FROM fornecedores_empresas WHERE codigo = 223 LIMIT 1), '', '2019-11-30', 14293, 'Analise de SEO', (SELECT id FROM cadastro_plano_de_contas_itens WHERE conta_reduzida= 663 LIMIT 1), 1, 3, NOW(), NOW() ),
  ( (SELECT id FROM fornecedores_empresas WHERE codigo = 223 LIMIT 1), '', '2019-11-30', 14293, 'Analise de SEO', (SELECT id FROM cadastro_plano_de_contas_itens WHERE conta_reduzida= 663 LIMIT 1), 1, 3, NOW(), NOW() ),
  ( (SELECT id FROM fornecedores_empresas WHERE codigo = 10 LIMIT 1), '', '2019-10-01', 11602, 'Hospedagem', (SELECT id FROM cadastro_plano_de_contas_itens WHERE conta_reduzida= 699 LIMIT 1), 1, 3, NOW(), NOW() ),
  ( (SELECT id FROM fornecedores_empresas WHERE codigo = 218 LIMIT 1), '7025', '2019-12-02', 89940, 'Compra de banqueta', (SELECT id FROM cadastro_plano_de_contas_itens WHERE conta_reduzida= 623 LIMIT 1), 1, 3, NOW(), NOW() ),
  ( (SELECT id FROM fornecedores_empresas WHERE codigo = 32 LIMIT 1), '', '2019-12-03', 32233, 'Hospedagem', (SELECT id FROM cadastro_plano_de_contas_itens WHERE conta_reduzida= 699 LIMIT 1), 1, 3, NOW(), NOW() ),
  ( (SELECT id FROM fornecedores_empresas WHERE codigo = 32 LIMIT 1), '', '2019-12-03', 22885, 'Hospedagem', (SELECT id FROM cadastro_plano_de_contas_itens WHERE conta_reduzida= 699 LIMIT 1), 1, 3, NOW(), NOW() ),
  ( (SELECT id FROM fornecedores_empresas WHERE codigo = 32 LIMIT 1), '', '2019-12-03', 9348, 'Hospedagem', (SELECT id FROM cadastro_plano_de_contas_itens WHERE conta_reduzida= 699 LIMIT 1), 1, 3, NOW(), NOW() ),
  ( (SELECT id FROM fornecedores_empresas WHERE codigo = 225 LIMIT 1), '582938', '2019-12-06', 2563, 'telefone sem fio - 01/03', (SELECT id FROM cadastro_plano_de_contas_itens WHERE conta_reduzida= 623 LIMIT 1), 1, 3, NOW(), NOW() ),
  ( (SELECT id FROM fornecedores_empresas WHERE codigo = 225 LIMIT 1), '493629', '2019-12-06', 7727, 'telefone sem fio - 01/03', (SELECT id FROM cadastro_plano_de_contas_itens WHERE conta_reduzida= 574 LIMIT 1), 1, 3, NOW(), NOW() ),
  ( (SELECT id FROM fornecedores_empresas WHERE codigo = 225 LIMIT 1), '582938', '2019-12-06', 198, 'frete', (SELECT id FROM cadastro_plano_de_contas_itens WHERE conta_reduzida= 549 LIMIT 1), 1, 3, NOW(), NOW() ),
  ( (SELECT id FROM fornecedores_empresas WHERE codigo = 226 LIMIT 1), '', '2019-12-05', 1950, 'Caixas Sorrir Muda tudo', (SELECT id FROM cadastro_plano_de_contas_itens WHERE conta_reduzida= 638 LIMIT 1), 1, 3, NOW(), NOW() ),
  ( (SELECT id FROM fornecedores_empresas WHERE codigo = 226 LIMIT 1), '', '2019-12-05', 18999, 'Caixas Sorrir Muda tudo - 01/04', (SELECT id FROM cadastro_plano_de_contas_itens WHERE conta_reduzida= 638 LIMIT 1), 1, 3, NOW(), NOW() ),
  ( (SELECT id FROM fornecedores_empresas WHERE codigo = 227 LIMIT 1), '', '2019-12-06', 43350, 'Brindes funcionários - 01/02', (SELECT id FROM cadastro_plano_de_contas_itens WHERE conta_reduzida= 663 LIMIT 1), 1, 3, NOW(), NOW() ),
  ( (SELECT id FROM fornecedores_empresas WHERE codigo = 119 LIMIT 1), '', '2019-11-08', 699, '', (SELECT id FROM cadastro_plano_de_contas_itens WHERE conta_reduzida= 543 LIMIT 1), 1, 3, NOW(), NOW() ),
  ( (SELECT id FROM fornecedores_empresas WHERE codigo = 67 LIMIT 1), '', '2019-12-13', 4710, 'Reunião', (SELECT id FROM cadastro_plano_de_contas_itens WHERE conta_reduzida= 616 LIMIT 1), 1, 3, NOW(), NOW() ),
  ( (SELECT id FROM fornecedores_empresas WHERE codigo = 230 LIMIT 1), '', '2019-12-17', 2100, 'Motoboy - Leadcomm', (SELECT id FROM cadastro_plano_de_contas_itens WHERE conta_reduzida= 549 LIMIT 1), 1, 3, NOW(), NOW() ),
  ( (SELECT id FROM fornecedores_empresas WHERE codigo = 219 LIMIT 1), '', '2019-12-21', 2840, 'Contratação de ferramenta', (SELECT id FROM cadastro_plano_de_contas_itens WHERE conta_reduzida= 663 LIMIT 1), 1, 3, NOW(), NOW() ),
  ( (SELECT id FROM fornecedores_empresas WHERE codigo = 219 LIMIT 1), '127074', '2019-12-22', 2840, 'Contratação de ferramenta', (SELECT id FROM cadastro_plano_de_contas_itens WHERE conta_reduzida= 663 LIMIT 1), 1, 3, NOW(), NOW() ),
  ( (SELECT id FROM fornecedores_empresas WHERE codigo = 219 LIMIT 1), '127074', '2019-12-22', 2840, 'Contratação de ferramenta', (SELECT id FROM cadastro_plano_de_contas_itens WHERE conta_reduzida= 663 LIMIT 1), 1, 3, NOW(), NOW() ),
  ( (SELECT id FROM fornecedores_empresas WHERE codigo = 219 LIMIT 1), '127074', '2019-12-22', 2840, 'Contratação de ferramenta', (SELECT id FROM cadastro_plano_de_contas_itens WHERE conta_reduzida= 663 LIMIT 1), 1, 3, NOW(), NOW() ),
  ( (SELECT id FROM fornecedores_empresas WHERE codigo = 219 LIMIT 1), '127074', '2019-12-22', 2840, 'Contratação de ferramenta', (SELECT id FROM cadastro_plano_de_contas_itens WHERE conta_reduzida= 663 LIMIT 1), 1, 3, NOW(), NOW() ),
  ( (SELECT id FROM fornecedores_empresas WHERE codigo = 219 LIMIT 1), '127074', '2019-12-22', 2840, 'Contratação de ferramenta', (SELECT id FROM cadastro_plano_de_contas_itens WHERE conta_reduzida= 663 LIMIT 1), 1, 3, NOW(), NOW() );
