SELECT 'Fornecedores' as tipo, count(*) as qtdd, '18' as expected
FROM fornecedores_empresas
WHERE codigo IN (12, 32, 59, 118, 119, 204, 207, 209, 215, 219, 233, 237, 238, 239, 243, 244, 245, 246);

SELECT 'Despesas' as tipo, count(*) as qtdd, '10' as expected
FROM cadastro_plano_de_contas_itens
WHERE conta_reduzida IN (543, 554, 555, 579, 618, 663, 697, 699, 767, 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 = 59 LIMIT 1), '', '2020-01-21', 4875, 'Renovação Assinatura Anual', (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 = 237 LIMIT 1), '285209', '2020-03-02', 4999, 'Compra bateria parcela 05/10', (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 = 238 LIMIT 1), '', '2020-03-26', 10000, 'Curso Maris 04/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 = 12 LIMIT 1), '7438791', '2020-06-15', 5826, 'Compra Tonner 02/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 = 219 LIMIT 1), '', '2020-06-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 = 219 LIMIT 1), '', '2020-06-27', 2290, '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), '', '2020-06-27', 2290, '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 = 12 LIMIT 1), '164238', '2020-06-29', 4990, 'Compra Tonner', (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 = 245 LIMIT 1), '4974369', '2020-06-30', 1.27499, 'Parc 001/012', (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 = 215 LIMIT 1), '', '2020-07-01', 11774, '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), '', '2020-07-03', 44835, '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), '', '2020-07-03', 31832, '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), '', '2020-07-03', 13002, '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 = 118 LIMIT 1), '', '2020-07-07', 7500, 'Anúncio TPO', (SELECT id FROM cadastro_plano_de_contas_itens WHERE conta_reduzida= 767 LIMIT 1), 1, 3, NOW(), NOW() ),
  ( (SELECT id FROM fornecedores_empresas WHERE codigo = 118 LIMIT 1), '', '2020-07-07', 7500, 'Anúncio TPO', (SELECT id FROM cadastro_plano_de_contas_itens WHERE conta_reduzida= 767 LIMIT 1), 1, 3, NOW(), NOW() ),
  ( (SELECT id FROM fornecedores_empresas WHERE codigo = 119 LIMIT 1), '', '2020-07-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 = 209 LIMIT 1), '', '2020-07-08', 12860, 'Compra de imagem', (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 = 118 LIMIT 1), '', '2020-07-08', 7500, 'Anúncio TPO', (SELECT id FROM cadastro_plano_de_contas_itens WHERE conta_reduzida= 767 LIMIT 1), 1, 3, NOW(), NOW() ),
  ( (SELECT id FROM fornecedores_empresas WHERE codigo = 118 LIMIT 1), '', '2020-07-09', 10000, 'Anúncio TPO', (SELECT id FROM cadastro_plano_de_contas_itens WHERE conta_reduzida= 767 LIMIT 1), 1, 3, NOW(), NOW() ),
  ( (SELECT id FROM fornecedores_empresas WHERE codigo = 118 LIMIT 1), '', '2020-07-10', 15000, 'Anúncio TPO', (SELECT id FROM cadastro_plano_de_contas_itens WHERE conta_reduzida= 767 LIMIT 1), 1, 3, NOW(), NOW() ),
  ( (SELECT id FROM fornecedores_empresas WHERE codigo = 239 LIMIT 1), '', '2020-07-11', 14075, 'Usar o mesmo CD do mês passado', (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 = 118 LIMIT 1), '', '2020-07-12', 15000, 'Anúncio TPO', (SELECT id FROM cadastro_plano_de_contas_itens WHERE conta_reduzida= 767 LIMIT 1), 1, 3, NOW(), NOW() ),
  ( (SELECT id FROM fornecedores_empresas WHERE codigo = 118 LIMIT 1), '', '2020-07-13', 9174, 'Anúncio TPO', (SELECT id FROM cadastro_plano_de_contas_itens WHERE conta_reduzida= 767 LIMIT 1), 1, 3, NOW(), NOW() ),
  ( (SELECT id FROM fornecedores_empresas WHERE codigo = 118 LIMIT 1), '', '2020-07-14', 25000, 'Anúncio TPO', (SELECT id FROM cadastro_plano_de_contas_itens WHERE conta_reduzida= 767 LIMIT 1), 1, 3, NOW(), NOW() ),
  ( (SELECT id FROM fornecedores_empresas WHERE codigo = 118 LIMIT 1), '', '2020-07-14', 40000, 'Anúncio TPO', (SELECT id FROM cadastro_plano_de_contas_itens WHERE conta_reduzida= 767 LIMIT 1), 1, 3, NOW(), NOW() ),
  ( (SELECT id FROM fornecedores_empresas WHERE codigo = 239 LIMIT 1), '', '2020-07-11', 14075, 'Usar o mesmo CD do mês passado', (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 = 239 LIMIT 1), '', '2020-07-11', 14075, 'Usar o mesmo CD do mês passado', (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 = 244 LIMIT 1), '', '2020-07-15', 8439, 'Usar o mesmo CD do Streamyard', (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 = 243 LIMIT 1), '', '2020-07-15', 7990, '', (SELECT id FROM cadastro_plano_de_contas_itens WHERE conta_reduzida= 554 LIMIT 1), 1, 3, NOW(), NOW() ),
  ( (SELECT id FROM fornecedores_empresas WHERE codigo = 118 LIMIT 1), '', '2020-07-15', 60000, 'Anúncio TPO', (SELECT id FROM cadastro_plano_de_contas_itens WHERE conta_reduzida= 767 LIMIT 1), 1, 3, NOW(), NOW() ),
  ( (SELECT id FROM fornecedores_empresas WHERE codigo = 246 LIMIT 1), '', '2020-07-16', 39900, '', (SELECT id FROM cadastro_plano_de_contas_itens WHERE conta_reduzida= 555 LIMIT 1), 1, 3, NOW(), NOW() ),
  ( (SELECT id FROM fornecedores_empresas WHERE codigo = 118 LIMIT 1), '', '2020-07-17', 80000, 'Anúncio TPO', (SELECT id FROM cadastro_plano_de_contas_itens WHERE conta_reduzida= 767 LIMIT 1), 1, 3, NOW(), NOW() ),
  ( (SELECT id FROM fornecedores_empresas WHERE codigo = 219 LIMIT 1), '', '2020-07-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 = 207 LIMIT 1), '', '2019-08-08', 9006, 'Curso Maris 12/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 = 209 LIMIT 1), '', '2020-08-27', 46241, 'Getty Images - 11/12', (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 = 204 LIMIT 1), '1409333', '2019-09-25', 57980, 'Notebook\'s e PC\'s 10/10', NULL, 1, 3, NOW(), NOW() ),
  ( (SELECT id FROM fornecedores_empresas WHERE codigo = 233 LIMIT 1), '', '2019-10-31', 31115, 'Compra Rack 08/10', NULL, 1, 3, NOW(), NOW() );
