
CREATE TABLE `pedidos_compra` (
  `id_pedido_compra` int(11) NOT NULL AUTO_INCREMENT COMMENT 'Codigo do Pedido de Compra',
  `nro_pc` varchar(50) DEFAULT NULL,
  `data_pc` datetime DEFAULT NULL COMMENT 'Data que foi Gerado',
  `data_rec` datetime DEFAULT NULL,
  `data_limite` datetime DEFAULT NULL,
  `objeto_pc` varchar(250) DEFAULT NULL,
  `id_empresa` int(11) NOT NULL COMMENT 'Código da Empresa',
  `obs_pc` varchar(250) DEFAULT NULL,
  `valor_bruto_pc` decimal(11,5) NOT NULL DEFAULT 0.00000,
  `proposta` varchar(50) DEFAULT NULL,
  `data_proposta` datetime DEFAULT NULL,
  `data_cadastro` datetime DEFAULT NULL COMMENT 'Data do Cadastro',
  `id_funcionario_cadastro` int(11) DEFAULT NULL COMMENT 'id_usuario',
  `id_status_pc` int(20) DEFAULT NULL,
  `id_funcionario_aprovacao` int(11) DEFAULT NULL COMMENT 'id_usuario',
  `obs_faturamento` varchar(255) DEFAULT NULL,
  `abatimento` decimal(11,5) NOT NULL DEFAULT 0.00000,
  `id_orcamento` int(11) DEFAULT NULL COMMENT 'id_orcamento',
  `operacao_orcamento` int(11) NOT NULL DEFAULT 1 COMMENT '0 - Sob Demanda / 1 - Fixo',
  `vigencia_inicial` date DEFAULT NULL COMMENT 'Data de início da Vigencia do Orçamento',
  `vigencia_final` date DEFAULT NULL COMMENT 'Data de término da Vigencia do Orçamento',
  `frequencia_faturamento` int(11) DEFAULT NULL COMMENT '0 - Padrao / 1 - Mensal /2 - Bimestral /3 - Trimestral / 4 - Quadrimestral / 5 - Semestral',
  `dia_para_faturamento` int(11) DEFAULT NULL,
  `parcelas` int(11) DEFAULT NULL,
  PRIMARY KEY (`id_pedido_compra`)
) ENGINE=MyISAM AUTO_INCREMENT=70 DEFAULT CHARSET=latin1;

INSERT INTO pedidos_compra VALUES("1","5047-Email","2020-01-07 00:00:00","2020-01-07 14:18:22","","<p>Calibração RBC em 2 Estufas</p>","2699","","2114.48000","OR 2019-05047-06","2020-01-07 00:00:00","2020-01-07 00:00:00","999","2","999","","0.00000","10048","0","","","0","5","1");
INSERT INTO pedidos_compra VALUES("2","","2020-01-15 00:00:00","2020-01-15 17:10:07","","<p>Calibração Rastreável em Decibelímetro</p>","5051","","99.00000","OR 2020-04044-15","2020-01-15 00:00:00","2020-01-15 00:00:00","999","2","999","","0.00000","10068","0","","","0","5","1");
INSERT INTO pedidos_compra VALUES("4","","2020-01-15 17:17:04","2020-01-15 17:17:04","","<p>Venda de Peças e Serviço para Phmetro Tag 257063</p>","176","","1070.00000","OR 2019-05050-06","2020-01-15 00:00:00","2020-01-15 17:17:04","999","1","","","0.00000","10066","0","","","0","5","1");
INSERT INTO pedidos_compra VALUES("5","4046","2020-01-16 00:00:00","2020-01-16 13:28:14","","<p>Venda de peças para equipamentos</p>","176","","568.89000","OR 2020-04046-15","2020-01-15 00:00:00","2020-01-16 00:00:00","134","1","0","","0.00000","10070","0","","","0","5","1");
INSERT INTO pedidos_compra VALUES("6","4045","2020-01-16 00:00:00","2020-01-16 13:30:10","","<p>Venda de Peças para Refrigerador (TAG 246753 IC 676)</p>","176","","221.40000","OR 2020-04045-15","2020-01-15 00:00:00","2020-01-16 00:00:00","134","1","0","","0.00000","10069","0","","","0","5","1");
INSERT INTO pedidos_compra VALUES("14","4072-22","2020-01-22 00:00:00","2020-01-22 16:44:19","","<p>Despesas 2020</p>","4081","","0.00000","OR 2020-04072-22","2020-01-22 00:00:00","2020-01-22 00:00:00","134","2","134","","0.00000","10097","0","","","","","");
INSERT INTO pedidos_compra VALUES("15","4019-06","2020-01-22 00:00:00","2020-01-22 16:45:47","","<p>Despesas 2020</p>","5037","","0.00000","OR 2020-04019-06","2020-01-06 00:00:00","2020-01-22 00:00:00","134","2","134","","0.00000","10042","0","","","","","");
INSERT INTO pedidos_compra VALUES("16","4009-06","2020-01-22 00:00:00","2020-01-22 16:46:48","","<p>Despesas 2020</p>","5038","","0.00000","OR 2020-04009-06","2020-01-06 00:00:00","2020-01-22 00:00:00","134","2","134","","0.00000","10032","0","","","","","");
INSERT INTO pedidos_compra VALUES("17","4068-22","2020-01-22 00:00:00","2020-01-22 16:48:03","","<p>Calibração Rastreável em Luxímetro</p>","5051","","99.00000","OR 2020-04068-22","2020-01-22 00:00:00","2020-01-22 00:00:00","134","2","999","","0.00000","10092","0","","","1","5","12");
INSERT INTO pedidos_compra VALUES("10","4030-09","2020-01-20 00:00:00","2020-01-20 17:00:52","","<p>Calibração RBC em Termohigrômetros</p>","506","","284.00000","OR 2020-04030-09","2020-01-09 00:00:00","2020-01-20 00:00:00","134","2","999","","0.00000","10053","0","","","0","5","1");
INSERT INTO pedidos_compra VALUES("11","384607OS","2020-01-21 00:00:00","2020-01-21 14:54:06","","<p>Calibração RBC em Peso Padrão</p>","2457","","90.00000","OR 2020-04026-07","2020-01-07 00:00:00","2020-01-21 00:00:00","134","1","999","","0.00000","10049","0","","","0","5","1");
INSERT INTO pedidos_compra VALUES("13","380482OS","2020-01-21 00:00:00","2020-01-21 15:28:50","","<p>Calibração RBC em Peso Padrão</p>","2457","","135.00000","OR 2020-04029-08","2020-01-08 00:00:00","2020-01-21 00:00:00","134","1","0","","0.00000","10052","0","","","0","5","1");
INSERT INTO pedidos_compra VALUES("19","","2020-01-22 17:44:22","2020-01-22 17:44:22","","<p>Contrato de Calibração Rastreável de Equipamentos e Instrumentação de Laboratórios</p>","291","","41994.00000","OR 2018-04131-A1","2020-01-02 00:00:00","2020-01-22 17:44:22","7","1","","","0.00000","5336","0","2019-05-21","2020-05-21","1","5","12");
INSERT INTO pedidos_compra VALUES("20","e-mail OR 2020-04064-20","2020-01-23 00:00:00","2020-01-23 10:12:33","","<p>Qualificação</p>","1500","","4140.34000","OR 2020-04064-20","2020-01-20 00:00:00","2020-01-23 00:00:00","74","2","999","","0.00000","10088","0","","","0","5","1");
INSERT INTO pedidos_compra VALUES("36","4087-29","2020-01-31 00:00:00","2020-01-31 15:57:35","","<p>Calibração RBC em Câmara Climática</p>","24","","7000.00000","OR 2020-04087-29","2020-01-29 00:00:00","2020-01-31 00:00:00","134","2","999","","0.00000","10115","0","","","0","5","1");
INSERT INTO pedidos_compra VALUES("35","4076-23","2020-01-29 00:00:00","2020-01-29 15:31:07","","<p>Calibração RBC em Medidor de Stress Térmico</p>","3277","","335.00000","OR 2020-04076-23","2020-01-23 00:00:00","2020-01-29 00:00:00","134","2","999","","0.00000","10102","0","","","0","5","1");
INSERT INTO pedidos_compra VALUES("34","4071-22","2020-01-29 00:00:00","2020-01-29 15:24:49","","<p>Calibração Acreditada de Ultrafreezer</p>","223","","3701.84000","OR 2020-04071-22","2020-01-22 00:00:00","2020-01-29 00:00:00","134","1","134","","0.00000","10095","0","","","0","5","1");
INSERT INTO pedidos_compra VALUES("33","4074-R1","2020-01-29 00:00:00","2020-01-29 10:46:12","","<p>Calibração RBC em Termohigrômetro</p>","5058","","282.00000","OR 2020-04074-R1","2020-01-29 00:00:00","2020-01-29 00:00:00","134","1","134","","0.00000","10114","0","","","0","5","1");
INSERT INTO pedidos_compra VALUES("32","Email Catena 4073-23","2020-01-28 00:00:00","2020-01-28 10:45:25","","<p>Calibração RBC em Peso Padrão</p>","2399","","611.10000","OR 2020-04073-23","2020-01-23 00:00:00","2020-01-28 00:00:00","134","2","999","","0.00000","10099","0","","","0","5","1");
INSERT INTO pedidos_compra VALUES("31","4074-23","2020-01-28 00:00:00","2020-01-28 10:20:02","","<p>Calibração RBC em Termo-higrômetro</p>","5058","","252.00000","OR 2020-04074-23","2020-01-23 00:00:00","2020-01-28 00:00:00","134","2","999","","0.00000","10100","0","","","0","5","1");
INSERT INTO pedidos_compra VALUES("30","4080-24","2020-01-24 00:00:00","2020-01-24 15:04:39","","<p>Calibração Rastreável de Manômetro</p>","5060","","33.00000","OR 2020-04080-24","2020-01-24 00:00:00","2020-01-24 00:00:00","134","2","999","","0.00000","10106","0","","","0","5","1");
INSERT INTO pedidos_compra VALUES("37","4082-27","2020-01-31 00:00:00","2020-01-31 16:01:26","","<p>Calibração Rastreável em Radiômetro e Luxímetro</p>","1800","","1158.82000","OR 2020-04082-27","2020-01-27 00:00:00","2020-01-31 00:00:00","134","1","0","","0.00000","10108","0","","","0","5","1");
INSERT INTO pedidos_compra VALUES("38","OC 8480","2020-02-03 00:00:00","2020-02-03 10:36:24","","<p>Calibração RBC em Câmara Climática</p>","1505","","1662.96000","OR 2020-04048-16","2020-01-16 00:00:00","2020-02-03 00:00:00","134","2","134","","0.00000","10072","0","","","0","5","1");
INSERT INTO pedidos_compra VALUES("39","Termo de Aditamento - Contrato N° 66/2018","2020-02-06 00:00:00","2020-02-06 09:12:32","","<p>(Contrato SERTIM ) Calibração Rastreável em Termopares Tipo T, Termômetros e Sensores de Umidade Relativa</p>","291","","37950.00000","OR 2018-04400-A1","2020-01-02 00:00:00","2020-02-06 00:00:00","7","1","0","","0.00000","5560","0","2019-10-15","2020-10-15","1","5","12");
INSERT INTO pedidos_compra VALUES("40","4098-03","2020-02-06 00:00:00","2020-02-06 10:29:19","","<p>Calibração Rastreável de Termômetro Infravermelho</p>","4114","","99.00000","OR 2020-04098-03","2020-02-03 00:00:00","2020-02-06 00:00:00","134","2","999","","0.00000","10126","0","","","0","5","1");
INSERT INTO pedidos_compra VALUES("41","Contrato  27/2018 - Processo 41/2018","2020-02-06 00:00:00","2020-02-06 11:43:18","","<p>Qualificação Térmica e Calibração de Equipamentos da Cadeia do Frio de Laboratórios</p>","291","","145199.98000","OR 2018-04140-A1","2020-01-02 00:00:00","2020-02-06 00:00:00","7","1","0","","0.00000","5337","0","2019-05-28","2020-05-27","0","5","1");
INSERT INTO pedidos_compra VALUES("42","4061-20 Email","2020-02-10 00:00:00","2020-02-10 11:47:46","","<p>Venda de Peças</p>","204","","568.00000","OR 2020-04061-20","2020-01-20 00:00:00","2020-02-10 00:00:00","134","1","0","","0.00000","10085","0","","","0","5","1");
INSERT INTO pedidos_compra VALUES("43","4060-20 Email","2020-02-10 00:00:00","2020-02-10 12:17:49","","<p>Venda de Peças</p>","982","","2596.94000","OR 2020-04060-20","2020-01-20 00:00:00","2020-02-10 00:00:00","134","1","0","","0.00000","10084","0","","","0","5","1");
INSERT INTO pedidos_compra VALUES("44","4884-31","2020-02-11 00:00:00","2020-02-11 10:59:06","","<p>Calibração RBC em Peso Padrão</p>","1598","","125.00000","OR 2019-04884-31","2020-02-11 00:00:00","2020-02-11 00:00:00","134","2","999","","0.00000","10132","0","","","0","5","1");
INSERT INTO pedidos_compra VALUES("45","386983OS","2020-02-11 00:00:00","2020-02-11 11:29:53","","<p>Calibração RBC em Peso Padrão</p>","2457","","45.00000","OR 2020-04078-24","2020-01-24 00:00:00","2020-02-11 00:00:00","134","2","134","","0.00000","10104","0","","","0","5","1");
INSERT INTO pedidos_compra VALUES("46","344572 28ddl s/c.financ NF emitir até 20 cd mês.","2020-02-12 00:00:00","2020-02-12 14:24:02","","<p>Calibração e Ensaio em Autoclave</p>","517","","2850.30000","OR 2020-04105-R1","2020-02-11 00:00:00","2020-02-12 00:00:00","74","2","999","","0.00000","10133","1","","","0","5","1");
INSERT INTO pedidos_compra VALUES("47","1207298 NF emitir até 25 de cd mês ","2020-02-13 00:00:00","2020-02-13 10:24:42","","<p>Calibração e Qualificação RBC em Equipamentos</p>","2322","","6143.96000","OR 2020-04079-24","2020-01-24 00:00:00","2020-02-13 00:00:00","74","1","0","","0.00000","10105","0","","","0","5","1");
INSERT INTO pedidos_compra VALUES("48","Contrato n° 12.19.528.00 / PE (SRP) N° 020/2019","2020-02-13 00:00:00","2020-02-13 14:26:49","","<p>Manutenção preventiva, corretiva, calibração e qualificação de equipamentos do NUPLAM</p>","3970","","110223.00000","OR 2020-04113-13","2020-02-13 00:00:00","2020-02-13 00:00:00","7","1","0","","0.00000","10141","1","2019-12-03","2020-12-03","1","5","12");
INSERT INTO pedidos_compra VALUES("49","1º TERMO ADITIVO AO CONTRATO Nº 16/2018","2020-02-14 00:00:00","2020-02-14 11:14:28","","<p>Serviço de calibração de 56 (cinquenta e seis) balanças</p>","2490","","9499.84000","OR 2018-04374-A1","2020-02-13 00:00:00","2020-02-14 00:00:00","7","2","999","","0.00000","10142","0","2019-07-02","2020-07-02","0","10","1");
INSERT INTO pedidos_compra VALUES("50","ODF Nr. 31-2019 / PE 16-2019","2020-02-14 00:00:00","2020-02-14 11:37:03","","<p>Contrato de Manutenção Preventiva em Equipamentos</p>","4390","","13555.69000","OR 2020-04023-07","2020-01-07 00:00:00","2020-02-14 00:00:00","134","1","0","","0.00000","10046","0","","","1","5","12");
INSERT INTO pedidos_compra VALUES("51","4067-21","2020-02-17 00:00:00","2020-02-17 16:28:42","","<p>Venda de Peças</p>","3088","","284.00000","OR 2020-04067-21","2020-01-21 00:00:00","2020-02-17 00:00:00","134","1","0","","0.00000","10091","0","","","1","10","12");
INSERT INTO pedidos_compra VALUES("52","4062-R1","2020-02-17 00:00:00","2020-02-17 16:29:44","","<p>Venda de Peças</p>","3088","","2108.55000","OR 2020-04062-R1","2020-01-20 00:00:00","2020-02-17 00:00:00","134","1","0","","0.00000","10086","0","","","1","10","12");
INSERT INTO pedidos_compra VALUES("53","Contrato n° 080/2020. Pregão Eletrônico 020/2019","2020-02-19 00:00:00","2020-02-19 16:08:57","","<p>Serviços de qualificação de desempenho de equipamentos térmicos do Tecpar</p>","250","","79999.98000","OR 2020-04125-19","2020-02-19 00:00:00","2020-02-19 00:00:00","7","1","0","","0.00000","10153","0","2020-02-07","2021-08-07","1","10","12");
INSERT INTO pedidos_compra VALUES("54","31552 (1 Parcela 28ddl)","2020-02-27 00:00:00","2020-02-27 10:32:35","","<p>Calibração Rastreável de Equipamentos</p>","333","","1320.17000","OR 2020-04094-R2","2020-01-30 00:00:00","2020-02-27 00:00:00","134","1","0","","0.00000","10122","0","","","0","16","1");
INSERT INTO pedidos_compra VALUES("55","4136-27 Email (Faturar como APOR)","2020-02-27 00:00:00","2020-02-27 17:35:46","","<p>Calibração Rastreável em Decibelimetro</p>","5102","","99.00000","OR 2020-04136-27","2020-02-27 00:00:00","2020-02-27 00:00:00","134","1","134","","0.00000","10164","0","","","0","30","1");
INSERT INTO pedidos_compra VALUES("56","4137-27 Email ","2020-02-28 00:00:00","2020-02-28 09:07:36","","<p>Calibração Rastreável em Condutivímetro</p>","5103","","99.00000","OR 2020-04137-27","2020-02-27 00:00:00","2020-02-28 00:00:00","134","2","134","","0.00000","10165","0","","","0","30","1");
INSERT INTO pedidos_compra VALUES("57","5026-13 Email","2020-02-28 00:00:00","2020-02-28 10:07:37","","<p>Venda de Motor para Freezer Indrel 262669</p>","176","","44.00000","OR 2019-05026-13","2020-02-04 00:00:00","2020-02-28 00:00:00","134","2","134","","0.00000","10129","0","","","0","30","1");
INSERT INTO pedidos_compra VALUES("58","5025-13","2020-02-28 00:00:00","2020-02-28 10:09:17","","<p>Venda de Peças para Estufas</p>","176","","851.08000","OR 2019-05025-13","2020-02-04 00:00:00","2020-02-28 00:00:00","134","2","134","","0.00000","10128","0","","","0","30","1");
INSERT INTO pedidos_compra VALUES("59","452969 (28ddl, informar o nr. do pedido da NF)","2020-03-04 00:00:00","2020-03-04 09:26:58","","<p>Calibração Rastreável em Paquímetro</p>","3403","","114.00000","OR 2020-04133-R1","2020-02-21 00:00:00","2020-03-04 00:00:00","134","2","134","","0.00000","10161","0","","","0","30","1");
INSERT INTO pedidos_compra VALUES("60","4115-13","2020-03-04 00:00:00","2020-03-04 13:36:02","","<p>Venda de Peças</p>","176","","178.15000","OR 2020-04115-13","2020-02-13 00:00:00","2020-03-04 00:00:00","134","2","134","","0.00000","10143","0","","","0","30","1");
INSERT INTO pedidos_compra VALUES("61","4118-14","2020-03-04 00:00:00","2020-03-04 13:39:38","","<p>Venda de Peças</p>","176","","700.00000","OR 2020-04118-14","2020-02-14 00:00:00","2020-03-04 00:00:00","134","2","134","","0.00000","10146","0","","","0","30","1");
INSERT INTO pedidos_compra VALUES("62","4111-12","2020-03-04 00:00:00","2020-03-04 13:57:56","","<p>Calibração e Manutenção em Turbidímetro</p>","176","","405.88000","OR 2020-04111-12","2020-02-12 00:00:00","2020-03-04 00:00:00","134","2","134","","0.00000","10139","0","","","0","30","1");
INSERT INTO pedidos_compra VALUES("63","4032-13","2020-03-06 00:00:00","2020-03-06 10:03:35","","<p>Calibração RBC em Tacômetro</p>","5046","","60.00000","OR 2020-04032-13","2020-01-13 00:00:00","2020-03-06 00:00:00","134","2","134","","0.00000","10055","0","","","0","30","1");
INSERT INTO pedidos_compra VALUES("64","E-mail 04121-19","2020-03-06 00:00:00","2020-03-06 11:30:08","","<p>Calibração e Qualificação RBC em Câmara de Fotoestabilidade</p>","5094","","3043.90000","OR 2020-04121-19","2020-02-19 00:00:00","2020-03-06 00:00:00","74","2","74","","0.00000","10149","1","","","0","20","1");
INSERT INTO pedidos_compra VALUES("65","4126-19","2020-03-06 00:00:00","2020-03-06 11:33:24","","<p>Venda de Rolamento</p>","176","","30.00000","OR 2020-04126-19","2020-02-19 00:00:00","2020-03-06 00:00:00","134","2","134","","0.00000","10154","0","","","0","30","1");
INSERT INTO pedidos_compra VALUES("66","4132-R3","2020-03-06 00:00:00","2020-03-06 15:26:02","","<p>Calibração RBC em Manômetros</p>","974","","574.00000","OR 2020-04132-R3","2020-02-21 00:00:00","2020-03-06 00:00:00","134","2","134","","0.00000","10160","0","","","0","30","1");
INSERT INTO pedidos_compra VALUES("67","4147-10 PEP","2020-03-10 00:00:00","2020-03-10 11:30:51","","<p>PEP</p>","2410","","492.00000","OR 2020-04147-10","2020-03-10 00:00:00","2020-03-10 00:00:00","134","2","134","","0.00000","10175","0","","","0","30","1");
INSERT INTO pedidos_compra VALUES("68","PRIMEIRO TERMO ADITIVO Nº 318/2019-PROAD/IFRN","2020-03-11 00:00:00","2020-03-11 10:37:30","","<p>Contrato de Manutenção Preventiva, Corretiva e Calibração (Adesão SRP nº 07/2018)</p>","982","","79030.09000","OR 2018-04544-A1","2019-12-19 00:00:00","2020-03-11 00:00:00","7","1","0","","0.00000","5051","0","2019-12-18","2020-12-17","1","10","0");
INSERT INTO pedidos_compra VALUES("69","Ordem de Compra n.º 0320-000014 (CORRIGIR VALOR)","2020-03-11 00:00:00","2020-03-11 11:54:11","","<p>Calibração RBC em 1 Reator de DQO</p>","5095","","1523.48000","OR 2020-04128-20","2020-02-20 00:00:00","2020-03-11 00:00:00","7","1","0","","0.00000","10156","0","","","1","10","12");


