-- phpMyAdmin SQL Dump
-- version 4.5.1
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: Jan 23, 2024 at 10:12 AM
-- Server version: 10.1.13-MariaDB
-- PHP Version: 5.6.20

SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";


/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;

--
-- Database: `pedaco`
--

-- --------------------------------------------------------

--
-- Table structure for table `artigos_devolvidos`
--

CREATE TABLE `artigos_devolvidos` (
  `id` int(11) NOT NULL,
  `produto` varchar(500) NOT NULL,
  `qtd` int(11) NOT NULL,
  `preco` decimal(10,2) NOT NULL,
  `total` decimal(10,2) NOT NULL,
  `cliente` int(11) NOT NULL,
  `usuario` int(11) NOT NULL,
  `devolucao` int(11) NOT NULL,
  `data` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- --------------------------------------------------------

--
-- Table structure for table `artigos_devolvidos_temp`
--

CREATE TABLE `artigos_devolvidos_temp` (
  `id` int(11) NOT NULL,
  `artigo` varchar(255) NOT NULL,
  `qtd` int(11) NOT NULL,
  `preco` decimal(10,2) NOT NULL,
  `total` decimal(10,2) NOT NULL,
  `user` int(11) NOT NULL,
  `data` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- --------------------------------------------------------

--
-- Table structure for table `categoria_produtos`
--

CREATE TABLE `categoria_produtos` (
  `id` int(11) NOT NULL,
  `categoria` varchar(200) NOT NULL,
  `data` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `categoria_produtos`
--

INSERT INTO `categoria_produtos` (`id`, `categoria`, `data`) VALUES
(1, 'Bebidas', '2023-02-24 18:24:00'),
(2, 'Refrigerantes', '2023-02-24 18:24:00'),
(3, 'Comidas', '2023-02-24 18:24:00');

-- --------------------------------------------------------

--
-- Table structure for table `clientes`
--

CREATE TABLE `clientes` (
  `id` int(11) NOT NULL,
  `nome` varchar(255) NOT NULL,
  `nuit` int(11) NOT NULL,
  `apelido` varchar(255) NOT NULL,
  `contacto` int(11) NOT NULL,
  `endereco` varchar(255) NOT NULL,
  `iva` int(11) NOT NULL,
  `qtd_factura` int(11) NOT NULL DEFAULT '0',
  `qtd_notas_credito` int(11) NOT NULL DEFAULT '0',
  `qtd_cotacao` int(11) NOT NULL DEFAULT '0',
  `qtd_vds` int(11) NOT NULL DEFAULT '0',
  `qtd_recibo` int(11) NOT NULL DEFAULT '0',
  `qtd_devolucao` int(11) NOT NULL DEFAULT '0',
  `data` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `clientes`
--

INSERT INTO `clientes` (`id`, `nome`, `nuit`, `apelido`, `contacto`, `endereco`, `iva`, `qtd_factura`, `qtd_notas_credito`, `qtd_cotacao`, `qtd_vds`, `qtd_recibo`, `qtd_devolucao`, `data`) VALUES
(2, 'Consumidor', 832736463, 'Final', 842354324, 'Cidade de Tete', 0, 0, 0, 0, 0, 0, 0, '2023-05-18 10:10:22');

-- --------------------------------------------------------

--
-- Table structure for table `compras`
--

CREATE TABLE `compras` (
  `id` int(11) NOT NULL,
  `descricao` varchar(255) NOT NULL,
  `valor` decimal(10,2) NOT NULL,
  `data` date NOT NULL,
  `hora` time NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `compras`
--

INSERT INTO `compras` (`id`, `descricao`, `valor`, `data`, `hora`) VALUES
(1, 'Compra - 2024-01-19 22:01:27', '1000.00', '2024-01-19', '23:14:00');

-- --------------------------------------------------------

--
-- Table structure for table `cotacao`
--

CREATE TABLE `cotacao` (
  `id` int(11) NOT NULL,
  `descricao` text NOT NULL,
  `valor` decimal(10,2) NOT NULL,
  `iva` decimal(10,2) NOT NULL,
  `disconto` decimal(10,2) NOT NULL,
  `prazo` varchar(255) NOT NULL,
  `serie` int(11) NOT NULL,
  `cliente` int(11) NOT NULL,
  `usuario` int(11) NOT NULL,
  `data` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- --------------------------------------------------------

--
-- Table structure for table `ct_artigos_cotados`
--

CREATE TABLE `ct_artigos_cotados` (
  `id` int(11) NOT NULL,
  `artigo` int(11) NOT NULL,
  `qtd` int(11) NOT NULL,
  `preco` decimal(10,2) NOT NULL,
  `total` decimal(10,2) NOT NULL,
  `cotacao` int(11) NOT NULL,
  `usuario` int(11) NOT NULL,
  `data` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- --------------------------------------------------------

--
-- Table structure for table `ct_artigos_temp`
--

CREATE TABLE `ct_artigos_temp` (
  `id` int(11) NOT NULL,
  `artigo` int(11) NOT NULL,
  `qtd` int(11) NOT NULL,
  `preco` decimal(10,2) NOT NULL,
  `total` decimal(10,2) NOT NULL,
  `user` int(11) NOT NULL,
  `data` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- --------------------------------------------------------

--
-- Table structure for table `devolucao`
--

CREATE TABLE `devolucao` (
  `id` int(11) NOT NULL,
  `descricao` text NOT NULL,
  `valor` decimal(10,2) NOT NULL,
  `motivo` text NOT NULL,
  `idpedido` int(11) NOT NULL,
  `serie` varchar(5) NOT NULL,
  `idcliente` int(11) NOT NULL,
  `iduser` int(11) NOT NULL,
  `idperiodo` int(11) NOT NULL,
  `data` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- --------------------------------------------------------

--
-- Table structure for table `disconto`
--

CREATE TABLE `disconto` (
  `id` int(11) NOT NULL,
  `percentagem` double NOT NULL,
  `motivo` text NOT NULL,
  `data` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- --------------------------------------------------------

--
-- Table structure for table `documento`
--

CREATE TABLE `documento` (
  `id` int(11) NOT NULL,
  `documento` varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `documento`
--

INSERT INTO `documento` (`id`, `documento`) VALUES
(1, 'VD - Venda a Dinheiro'),
(2, 'Factura'),
(3, 'Cotação'),
(4, 'Recibo'),
(5, 'Nota de Crédito'),
(6, 'Nota de Débito'),
(7, 'Nota de Devolução'),
(8, 'Guia de Remessa');

-- --------------------------------------------------------

--
-- Table structure for table `empresa`
--

CREATE TABLE `empresa` (
  `id` int(11) NOT NULL,
  `nome` varchar(255) NOT NULL,
  `nuit` int(11) NOT NULL,
  `endereco` text NOT NULL,
  `provincia` varchar(255) NOT NULL,
  `pais` varchar(255) NOT NULL,
  `contacto` varchar(255) NOT NULL,
  `capital_social` varchar(50) NOT NULL,
  `email` varchar(255) NOT NULL,
  `banco` varchar(255) NOT NULL,
  `conta` varchar(255) NOT NULL,
  `nib` varchar(255) NOT NULL,
  `data` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `empresa`
--

INSERT INTO `empresa` (`id`, `nome`, `nuit`, `endereco`, `provincia`, `pais`, `contacto`, `capital_social`, `email`, `banco`, `conta`, `nib`, `data`) VALUES
(1, 'iProjects Sociedade Unipessoal Limitada', 401403159, 'Matema, Rua Martires do Colonialismo', 'Tete', 'Mocambique', '878884862/879207381', 'Metical', 'iprojectscompany@gmail.com', 'Moza Banco', '011123437823', '0002938880000228376736', '2023-05-10 16:26:10');

-- --------------------------------------------------------

--
-- Table structure for table `entrega`
--

CREATE TABLE `entrega` (
  `identrega` int(11) NOT NULL,
  `produtoentrega` varchar(255) NOT NULL,
  `qtdentrega` double NOT NULL,
  `precoentrega` decimal(10,2) NOT NULL,
  `totalentrega` decimal(10,2) NOT NULL,
  `clienteentrega` int(11) NOT NULL,
  `usuarioentrega` int(11) NOT NULL,
  `pedidoentrega` int(11) NOT NULL,
  `datavenda` datetime NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- --------------------------------------------------------

--
-- Table structure for table `factura`
--

CREATE TABLE `factura` (
  `id` int(11) NOT NULL,
  `descricao` text NOT NULL,
  `valor` decimal(10,2) NOT NULL,
  `iva` decimal(10,2) NOT NULL,
  `motivo_iva` text NOT NULL,
  `disconto` decimal(10,2) NOT NULL DEFAULT '0.00',
  `serie` int(11) NOT NULL,
  `prazo` varchar(255) NOT NULL,
  `metodo` varchar(255) NOT NULL,
  `nota_credito` int(11) NOT NULL DEFAULT '0',
  `recibo` int(11) NOT NULL DEFAULT '0',
  `nota_debito` int(11) NOT NULL DEFAULT '0',
  `cotacao` int(11) NOT NULL DEFAULT '0',
  `cliente` int(11) NOT NULL,
  `usuario` int(11) NOT NULL,
  `data` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- --------------------------------------------------------

--
-- Table structure for table `fa_artigos_fact`
--

CREATE TABLE `fa_artigos_fact` (
  `id` int(11) NOT NULL,
  `artigo` int(11) NOT NULL,
  `qtd` int(11) NOT NULL,
  `preco` decimal(10,2) NOT NULL,
  `total` decimal(10,2) NOT NULL,
  `user` int(11) NOT NULL,
  `factura` int(11) NOT NULL,
  `data` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- --------------------------------------------------------

--
-- Table structure for table `fa_artigos_temp`
--

CREATE TABLE `fa_artigos_temp` (
  `id` int(11) NOT NULL,
  `artigo` int(11) NOT NULL,
  `qtd` int(11) NOT NULL,
  `preco` decimal(10,2) NOT NULL,
  `total` decimal(10,2) NOT NULL,
  `user` int(11) NOT NULL,
  `data` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- --------------------------------------------------------

--
-- Table structure for table `filadeespera`
--

CREATE TABLE `filadeespera` (
  `idfiladeespera` int(11) NOT NULL,
  `produtofiladeespera` varchar(255) NOT NULL,
  `qtdfiladeespera` double NOT NULL,
  `precofiladeespera` double NOT NULL,
  `totalfiladeespera` double NOT NULL,
  `usuariofiladeespera` int(11) NOT NULL,
  `data` datetime NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- --------------------------------------------------------

--
-- Table structure for table `fornecedor`
--

CREATE TABLE `fornecedor` (
  `id` int(11) NOT NULL,
  `nome` varchar(500) NOT NULL,
  `nuit` int(11) NOT NULL,
  `contacto` varchar(50) NOT NULL,
  `endereco` text NOT NULL,
  `ordem_compra` int(11) NOT NULL DEFAULT '0',
  `data` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `fornecedor`
--

INSERT INTO `fornecedor` (`id`, `nome`, `nuit`, `contacto`, `endereco`, `ordem_compra`, `data`) VALUES
(1, 'Builder Warehouse', 13487256, '846727272', 'Cidade de Tete', 3, '2023-05-18 14:01:57'),
(2, 'Shoprite', 22435536, '873323234', 'Moatize', 0, '2023-05-18 15:25:59');

-- --------------------------------------------------------

--
-- Table structure for table `funcionario`
--

CREATE TABLE `funcionario` (
  `idfuncionario` int(11) NOT NULL,
  `nomefuncionario` varchar(255) NOT NULL,
  `apelidofuncionario` varchar(255) NOT NULL,
  `sexofuncionario` varchar(10) NOT NULL,
  `bi` varchar(17) NOT NULL,
  `enderecofuncionario` varchar(255) NOT NULL,
  `contactofuncionario` varchar(20) NOT NULL,
  `nuit` int(20) NOT NULL,
  `emailfuncionario` varchar(50) NOT NULL,
  `empresafuncionario` int(11) NOT NULL,
  `data` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `funcionario`
--

INSERT INTO `funcionario` (`idfuncionario`, `nomefuncionario`, `apelidofuncionario`, `sexofuncionario`, `bi`, `enderecofuncionario`, `contactofuncionario`, `nuit`, `emailfuncionario`, `empresafuncionario`, `data`) VALUES
(1, 'consumidor', 'final', 'qualquer', '0', 'cidade de tete', '878884862', 0, 'milagrelazaro1@gmail.com', 1, '2021-07-13 00:41:08'),
(2, 'Nelo ', 'sgfd', 'f', '45', 'fbg', '46', 1, 'gh', 1, '2023-03-20 15:55:55');

-- --------------------------------------------------------

--
-- Table structure for table `inventario`
--

CREATE TABLE `inventario` (
  `id` int(11) NOT NULL,
  `artigo` varchar(500) NOT NULL,
  `1` int(11) NOT NULL,
  `2` int(11) NOT NULL,
  `3` int(11) NOT NULL,
  `4` int(11) NOT NULL,
  `5` int(11) NOT NULL,
  `6` int(11) NOT NULL,
  `7` int(11) NOT NULL,
  `8` int(11) NOT NULL,
  `9` int(11) NOT NULL,
  `10` int(11) NOT NULL,
  `11` int(11) NOT NULL,
  `12` int(11) NOT NULL,
  `13` int(11) NOT NULL,
  `14` int(11) NOT NULL,
  `15` int(11) NOT NULL,
  `16` int(11) NOT NULL,
  `17` int(11) NOT NULL,
  `18` int(11) NOT NULL,
  `19` int(11) NOT NULL,
  `20` int(11) NOT NULL,
  `21` int(11) NOT NULL,
  `22` int(11) NOT NULL,
  `23` int(11) NOT NULL,
  `24` int(11) NOT NULL,
  `25` int(11) NOT NULL,
  `26` int(11) NOT NULL,
  `27` int(11) NOT NULL,
  `28` int(11) NOT NULL,
  `29` int(11) NOT NULL,
  `30` int(11) NOT NULL,
  `31` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `inventario`
--

INSERT INTO `inventario` (`id`, `artigo`, `1`, `2`, `3`, `4`, `5`, `6`, `7`, `8`, `9`, `10`, `11`, `12`, `13`, `14`, `15`, `16`, `17`, `18`, `19`, `20`, `21`, `22`, `23`, `24`, `25`, `26`, `27`, `28`, `29`, `30`, `31`) VALUES
(1, '2M A GARRAFA', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0),
(2, 'IMPALA', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0),
(3, '2M A LATA', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 60, 0, 0, 0, 0, 0, 0, 57, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0),
(4, 'PRETA TXOTI', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0),
(5, 'LITE PEQUENO', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0),
(6, '2M FLO A GARRAFA', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 0, 0, 0, 0, 0, 0, 21, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0),
(7, 'HEINEKEN A LATA', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 54, 0, 0, 0, 0, 0, 0, 54, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0),
(8, 'HEINEKEN CURTA', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 106, 0, 0, 0, 0, 0, 0, 106, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0),
(9, 'HEINEKEN RETORNAVEL',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 0, 0, 0, 0, 0, 0, 0, 0),
(37, 'FANTA LARANJA GARRAFA', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 55, 0, 0, 0, 0, 0, 0, 55, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0),
(38, 'FANTA LARANJA 2LITRO', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0),
(39, 'FANTA ANANAS LATA', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 22, 0, 0, 0, 0, 0, 0, 22, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0),
(40, 'FANTA ANANAS GARRAFA', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 49, 0, 0, 0, 0, 0, 0, 49, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0),
(41, 'FANTA ANANAS 2LITRO', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0),
(42, 'SPARLETTA CREME SODA 2LITRO', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);

-- --------------------------------------------------------

--
-- Table structure for table `itens_comprados`
--

CREATE TABLE `itens_comprados` (
  `id` int(11) NOT NULL,
  `id_artigo` int(11) NOT NULL,
  `qtd` int(11) NOT NULL,
  `id_compra` int(11) NOT NULL,
  `data` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `itens_comprados`
--

INSERT INTO `itens_comprados` (`id`, `id_artigo`, `qtd`, `id_compra`, `data`) VALUES
(1, 180, 123, 1, '2024-01-19 21:14:55'),
(2, 181, 0, 1, '2024-01-19 21:14:40'),
(3, 166, 0, 1, '2024-01-19 21:14:40'),
(4, 186, 0, 1, '2024-01-19 21:14:40'),
(5, 3, 0, 1, '2024-01-19 21:14:40'),
(6, 5, 0, 1, '2024-01-19 21:14:40'),
(7, 9, 0, 1, '2024-01-19 21:14:40'),
(8, 217, 0, 1, '2024-01-19 21:14:40'),
(9, 128, 0, 1, '2024-01-19 21:14:41'),
(10, 134, 0, 1, '2024-01-19 21:14:41'),
(11, 135, 0, 1, '2024-01-19 21:14:41'),
(12, 228, 0, 1, '2024-01-19 21:14:41'),
(13, 227, 0, 1, '2024-01-19 21:14:41'),
(14, 226, 0, 1, '2024-01-19 21:14:41'),
(15, 225, 0, 1, '2024-01-19 21:14:41'),
(16, 224, 0, 1, '2024-01-19 21:14:41'),
(17, 223, 0, 1, '2024-01-19 21:14:41'),
(18, 10, 0, 1, '2024-01-19 21:14:41'),
(19, 11, 0, 1, '2024-01-19 21:14:41'),
(20, 12, 0, 1, '2024-01-19 21:14:41'),
(21, 18, 0, 1, '2024-01-19 21:14:41'),
(22, 4, 0, 1, '2024-01-19 21:14:41'),
(23, 218, 0, 1, '2024-01-19 21:14:41'),
(24, 8, 0, 1, '2024-01-19 21:14:41'),
(25, 221, 0, 1, '2024-01-19 21:14:41'),
(26, 19, 0, 1, '2024-01-19 21:14:41'),
(27, 151, 0, 1, '2024-01-19 21:14:41'),
(28, 150, 0, 1, '2024-01-19 21:14:41'),
(29, 152, 0, 1, '2024-01-19 21:14:41'),
(30, 132, 0, 1, '2024-01-19 21:14:42'),
(31, 133, 0, 1, '2024-01-19 21:14:42'),
(32, 7, 0, 1, '2024-01-19 21:14:42'),
(33, 16, 0, 1, '2024-01-19 21:14:42'),
(34, 14, 0, 1, '2024-01-19 21:14:42'),
(35, 129, 0, 1, '2024-01-19 21:14:42'),
(36, 130, 0, 1, '2024-01-19 21:14:42'),
(37, 17, 0, 1, '2024-01-19 21:14:42'),
(38, 222, 0, 1, '2024-01-19 21:14:42'),
(39, 137, 0, 1, '2024-01-19 21:14:42'),
(40, 229, 0, 1, '2024-01-19 21:14:42'),
(41, 219, 0, 1, '2024-01-19 21:14:42'),
(42, 138, 0, 1, '2024-01-19 21:14:42');

-- --------------------------------------------------------

--
-- Table structure for table `iva`
--

CREATE TABLE `iva` (
  `id` int(11) NOT NULL,
  `percentagem` int(11) NOT NULL,
  `motivo` text NOT NULL,
  `data` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `iva`
--

INSERT INTO `iva` (`id`, `percentagem`, `motivo`, `data`) VALUES
(1, 16, 'Taxa de Iva Normal', '2023-04-30 16:56:44');

-- --------------------------------------------------------

--
-- Table structure for table `mesas`
--

CREATE TABLE `mesas` (
  `id` int(11) NOT NULL,
  `numero` int(11) NOT NULL,
  `status` int(11) NOT NULL DEFAULT '0'
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `mesas`
--

INSERT INTO `mesas` (`id`, `numero`, `status`) VALUES
(1, 1, 0),
(2, 2, 1),
(3, 3, 0),
(4, 4, 0),
(5, 5, 0),
(6, 6, 0),
(7, 7, 0),
(8, 8, 0),
(9, 9, 0),
(10, 10, 0),
(11, 11, 0),
(12, 12, 0),
(13, 13, 0),
(14, 14, 1),
(15, 15, 0),
(16, 16, 0),
(17, 17, 0),
(18, 18, 0),
(19, 19, 0),
(20, 20, 0);

-- --------------------------------------------------------

--
-- Table structure for table `nc_artigos`
--

CREATE TABLE `nc_artigos` (
  `id` int(11) NOT NULL,
  `artigo` int(11) NOT NULL,
  `qtd` int(11) NOT NULL,
  `preco` decimal(10,2) NOT NULL,
  `total` decimal(10,2) NOT NULL,
  `id_nota` int(11) NOT NULL,
  `user` int(11) NOT NULL,
  `data` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- --------------------------------------------------------

--
-- Table structure for table `nc_artigos_temp`
--

CREATE TABLE `nc_artigos_temp` (
  `id` int(11) NOT NULL,
  `artigo` int(11) NOT NULL,
  `qtd` int(11) NOT NULL,
  `preco` decimal(10,2) NOT NULL,
  `total` decimal(10,2) NOT NULL,
  `user` int(11) NOT NULL,
  `data` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- --------------------------------------------------------

--
-- Table structure for table `nota_de_credito`
--

CREATE TABLE `nota_de_credito` (
  `id` int(11) NOT NULL,
  `descricao` varchar(255) NOT NULL,
  `valor` int(11) NOT NULL,
  `iva` decimal(10,2) NOT NULL,
  `motivo` text NOT NULL,
  `cliente` int(11) NOT NULL,
  `serie` int(11) NOT NULL,
  `id_factura` int(11) NOT NULL,
  `user` int(11) NOT NULL,
  `data` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- --------------------------------------------------------

--
-- Table structure for table `ordem_compra`
--

CREATE TABLE `ordem_compra` (
  `id` int(11) NOT NULL,
  `descricao` varchar(255) NOT NULL,
  `valor` decimal(10,2) NOT NULL,
  `fornecedor` int(11) NOT NULL,
  `prazo` varchar(255) NOT NULL,
  `modo` varchar(255) NOT NULL,
  `serie` varchar(5) NOT NULL,
  `user` int(11) NOT NULL,
  `data` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- --------------------------------------------------------

--
-- Table structure for table `ordem_compra_artigos`
--

CREATE TABLE `ordem_compra_artigos` (
  `id` int(11) NOT NULL,
  `artigo` varchar(500) NOT NULL,
  `qtd` int(11) NOT NULL,
  `preco` decimal(10,2) NOT NULL,
  `total` decimal(10,2) NOT NULL,
  `ordem_compra` int(11) NOT NULL,
  `user` int(11) NOT NULL,
  `data` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- --------------------------------------------------------

--
-- Table structure for table `ordem_compra_artigos_temp`
--

CREATE TABLE `ordem_compra_artigos_temp` (
  `id` int(11) NOT NULL,
  `artigo` varchar(500) NOT NULL,
  `qtd` int(11) NOT NULL,
  `preco` decimal(10,2) NOT NULL,
  `total` decimal(10,2) NOT NULL,
  `user` int(11) NOT NULL,
  `data` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- --------------------------------------------------------

--
-- Table structure for table `pedido`
--

CREATE TABLE `pedido` (
  `idpedido` int(11) NOT NULL,
  `descpedido` datetime NOT NULL,
  `pagamentopedido` decimal(10,2) NOT NULL,
  `modo` varchar(255) NOT NULL,
  `trocopedido` decimal(10,2) NOT NULL,
  `disconto` decimal(10,2) NOT NULL,
  `clientepedido` int(11) NOT NULL,
  `userpedido` int(11) NOT NULL,
  `periodo` int(11) NOT NULL,
  `devolucao` int(11) NOT NULL,
  `data` datetime NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- --------------------------------------------------------

--
-- Table structure for table `periodicidade`
--

CREATE TABLE `periodicidade` (
  `id` int(11) NOT NULL,
  `prazo` varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `periodicidade`
--

INSERT INTO `periodicidade` (`id`, `prazo`) VALUES
(1, 'Pronto Pagamento'),
(2, '30 dias'),
(3, '5 dias');

-- --------------------------------------------------------

--
-- Table structure for table `periodo`
--

CREATE TABLE `periodo` (
  `idperiodo` int(11) NOT NULL,
  `diaperiodo` varchar(7) NOT NULL DEFAULT 'fechado',
  `aberturaperiodo` decimal(10,0) DEFAULT NULL,
  `fechoperiodo` decimal(10,0) DEFAULT NULL,
  `dataaberturaperiodo` datetime NOT NULL,
  `datafechoperiodo` datetime NOT NULL,
  `usuario` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `periodo`
--

INSERT INTO `periodo` (`idperiodo`, `diaperiodo`, `aberturaperiodo`, `fechoperiodo`, `dataaberturaperiodo`, `datafechoperiodo`, `usuario`) VALUES
(1, 'Fechado', '100', '1650', '2024-01-12 22:22:58', '2024-01-12 22:42:30', 1),
(2, 'Aberto', '100', '2360', '2024-01-12 22:42:37', '2024-01-12 22:42:37', 6);

-- --------------------------------------------------------

--
-- Table structure for table `pos_mesas`
--

CREATE TABLE `pos_mesas` (
  `id` int(11) NOT NULL,
  `descricao` varchar(255) NOT NULL,
  `pagamento` decimal(10,2) NOT NULL,
  `modo` varchar(255) NOT NULL,
  `troco` decimal(10,2) NOT NULL,
  `cliente` int(11) NOT NULL,
  `user` int(11) NOT NULL,
  `periodo` int(11) NOT NULL,
  `mesa` int(11) NOT NULL,
  `data` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `pos_mesas`
--

INSERT INTO `pos_mesas` (`id`, `descricao`, `pagamento`, `modo`, `troco`, `cliente`, `user`, `periodo`, `mesa`, `data`) VALUES
(1, '2024-01-12 22:23:49', '1450.00', 'Numerario', '50.00', 2, 1, 1, 1, '2024-01-12 20:23:49'),
(2, '2024-01-12 22:24:32', '100.00', 'Numerario', '0.00', 2, 1, 1, 1, '2024-01-12 20:24:32'),
(3, '2024-01-12 22:47:43', '460.00', 'Numerario', '40.00', 2, 6, 2, 3, '2024-01-12 20:47:43'),
(4, '2024-01-12 23:31:37', '910.00', 'Numerario', '90.00', 2, 6, 2, 1, '2024-01-12 21:31:37'),
(5, '2024-01-13 04:29:40', '320.00', 'Numerario', '180.00', 2, 6, 2, 0, '2024-01-13 02:29:40'),
(6, '2024-01-19 23:13:48', '450.00', 'Numerario', '50.00', 2, 6, 2, 1, '2024-01-19 21:13:48'),
(7, '2024-01-23 11:10:55', '120.00', 'Numerario', '80.00', 2, 6, 2, 1, '2024-01-23 09:10:55');

--
-- Triggers `pos_mesas`
--
DELIMITER $$
CREATE TRIGGER `setCaixa` AFTER INSERT ON `pos_mesas` FOR EACH ROW UPDATE periodo SET fechoperiodo = fechoperiodo + new.pagamento WHERE diaperiodo = 'Aberto'
$$
DELIMITER ;

-- --------------------------------------------------------

--
-- Table structure for table `pos_mesas_artigos`
--

CREATE TABLE `pos_mesas_artigos` (
  `id` int(11) NOT NULL,
  `artigo` varchar(255) NOT NULL,
  `qtd` double NOT NULL,
  `preco` decimal(10,2) NOT NULL,
  `total` decimal(10,2) NOT NULL,
  `cliente` int(11) NOT NULL,
  `user` int(11) NOT NULL,
  `pos` int(11) NOT NULL,
  `mesa` int(11) NOT NULL,
  `data` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `pos_mesas_artigos`
--

INSERT INTO `pos_mesas_artigos` (`id`, `artigo`, `qtd`, `preco`, `total`, `cliente`, `user`, `pos`, `mesa`, `data`) VALUES
(1, 'HEINEKEN A LATA', 1, '70.00', '70.00', 2, 1, 1, 1, '2024-01-12 20:23:49'),
(2, 'HEINEKEN CURTA', 2, '100.00', '200.00', 2, 1, 1, 1, '2024-01-12 20:23:49'),
(3, 'HEINEKEN RETORNAVEL', 3, '100.00', '300.00', 2, 1, 1, 1, '2024-01-12 20:23:49'),
(4, 'SAVANA DRAY', 2, '100.00', '200.00', 2, 1, 1, 1, '2024-01-12 20:23:49'),
(5, 'MINUTE A LATA', 2, '60.00', '120.00', 2, 1, 1, 1, '2024-01-12 20:23:49'),
(6, 'PREGO NO PRATO', 2, '280.00', '560.00', 2, 1, 1, 1, '2024-01-12 20:23:49'),
(7, 'REFRESCO 2L', 1, '100.00', '100.00', 2, 1, 2, 1, '2024-01-12 20:24:32'),
(8, 'HEINEKEN A LATA', 2, '70.00', '140.00', 2, 6, 3, 3, '2024-01-12 20:47:43'),
(9, '2M A LATA', 1, '70.00', '70.00', 2, 6, 3, 3, '2024-01-12 20:47:43'),
(10, 'HEINEKEN RETORNAVEL', 2, '100.00', '200.00', 2, 6, 3, 3, '2024-01-12 20:47:43'),
(11, 'SANDES DE QUEIO', 1, '50.00', '50.00', 2, 6, 3, 3, '2024-01-12 20:47:43'),
(12, '2M A LATA', 3, '70.00', '210.00', 2, 6, 4, 1, '2024-01-12 21:31:37'),
(13, 'HEINEKEN RETORNAVEL', 2, '100.00', '200.00', 2, 6, 4, 1, '2024-01-12 21:31:37'),
(14, 'SAVANA DRAY', 1, '100.00', '100.00', 2, 6, 4, 1, '2024-01-12 21:31:37'),
(15, 'PREGO NO PAO', 2, '200.00', '400.00', 2, 6, 4, 1, '2024-01-12 21:31:37'),
(16, 'SOPA DE LEGUMES', 1, '100.00', '100.00', 2, 6, 5, 0, '2024-01-13 02:29:41'),
(17, 'MINUTE A LATA', 2, '60.00', '120.00', 2, 6, 5, 0, '2024-01-13 02:29:41'),
(18, 'PRETA TXOTI', 2, '50.00', '100.00', 2, 6, 5, 0, '2024-01-13 02:29:41'),
(19, 'TXILAR TXOTI', 1, '50.00', '50.00', 2, 6, 6, 1, '2024-01-19 21:13:48'),
(20, 'PRETA TXOTI', 1, '50.00', '50.00', 2, 6, 6, 1, '2024-01-19 21:13:49'),
(21, 'BIFE', 1, '350.00', '350.00', 2, 6, 6, 1, '2024-01-19 21:13:49'),
(22, '2M A GARRAFA', 1, '70.00', '70.00', 2, 6, 7, 1, '2024-01-23 09:10:56'),
(23, 'SANDES DE OVO', 1, '50.00', '50.00', 2, 6, 7, 1, '2024-01-23 09:10:56');

-- --------------------------------------------------------

--
-- Table structure for table `pos_mesas_temp_artigos`
--

CREATE TABLE `pos_mesas_temp_artigos` (
  `id` int(11) NOT NULL,
  `artigo` varchar(255) NOT NULL,
  `qtd` double NOT NULL,
  `preco` decimal(10,2) NOT NULL,
  `total` decimal(10,2) NOT NULL,
  `user` int(11) NOT NULL,
  `mesa` int(11) NOT NULL,
  `cat_prod` int(11) NOT NULL,
  `data` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `pos_mesas_temp_artigos`
--

INSERT INTO `pos_mesas_temp_artigos` (`id`, `artigo`, `qtd`, `preco`, `total`, `user`, `mesa`, `cat_prod`, `data`) VALUES
(403, 'MOLHO DE TOMATE', 1, '50.00', '50.00', 7, 10, 3, '2023-06-02 20:20:45'),
(404, 'XIMA', 2, '50.00', '100.00', 7, 10, 3, '2023-06-02 20:24:21'),
(408, '1/4 DE FRANGO C/XIMA E COUVE', 2, '200.00', '400.00', 7, 8, 3, '2023-06-02 21:32:59'),
(412, '2M A LATA', 1, '70.00', '70.00', 6, 2, 1, '2024-01-13 02:30:25'),
(413, 'HEINEKEN CURTA', 5, '100.00', '500.00', 6, 14, 1, '2024-01-13 02:31:56');

-- --------------------------------------------------------

--
-- Table structure for table `produto`
--

CREATE TABLE `produto` (
  `idproduto` int(11) NOT NULL,
  `nomeproduto` varchar(255) NOT NULL,
  `stock` double NOT NULL,
  `stock_min` double NOT NULL,
  `preco_compra` decimal(10,2) NOT NULL,
  `preco` decimal(10,2) NOT NULL,
  `iva` float NOT NULL DEFAULT '0',
  `img` text NOT NULL,
  `codbar` text NOT NULL,
  `id_catgeoria` int(11) NOT NULL,
  `data` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `produto`
--

INSERT INTO `produto` (`idproduto`, `nomeproduto`, `stock`, `stock_min`, `preco_compra`, `preco`, `iva`, `img`, `codbar`, `id_catgeoria`, `data`) VALUES
(3, '2M A GARRAFA', 5, 5, '52.00', '70.00', 0.17, '_DSF0684.png', '6007497004584', 1, '2024-01-23 09:10:56'),
(4, 'IMPALA', 0, 3, '34.00', '50.00', 0, '_DSF0685.png', '', 1, '2023-06-03 22:35:48'),
(5, '2M A LATA', 57, 0, '47.00', '70.00', 0, '2M-lata-removebg.png', '', 1, '2024-01-12 21:31:37'),
(7, 'PRETA TXOTI', 6, 0, '42.00', '50.00', 0, 'laurentina-preta-curta-removebg-preview.png', '', 1, '2024-01-19 21:13:49'),
(8, 'LITE PEQUENO', 1, 0, '54.00', '75.00', 0, 'Castle-Lite-Mini-removebg-preview.png', '', 1, '2023-06-03 23:01:40'),
(9, '2M FLO A GARRAFA', 21, 0, '41.00', '50.00', 0, 'download-removebg-preview (1).png', '', 1, '2023-06-03 10:48:43'),
(10, 'HEINEKEN A LATA', 54, 0, '58.00', '70.00', 0, '625f0bfe35cab39ed2b91b9c.png', '', 1, '2024-01-12 20:47:43'),
(11, 'HEINEKEN CURTA', 106, 0, '63.00', '100.00', 0, '10173654-removebg-preview.png', '', 1, '2024-01-12 20:23:49'),
(12, 'HEINEKEN RETORNAVEL', 36, 0, '0.00', '100.00', 0, 'heineken-330ml1-a36429b45a64798cb116274154782757-480-0-removebg-preview.png', '', 1, '2024-01-12 21:31:37'),
(14, 'REFRESCO A LATA', 13, 0, '33.00', '50.00', 0, 'coca-600x540-600x540.png', '', 2, '2023-06-03 19:25:45'),
(16, 'REFRESCO 2L', 7, 0, '80.00', '100.00', 0, 'coc_grnde-removebg-preview.png', '', 2, '2024-01-12 20:24:32'),
(17, 'SAVANA DRAY', 14, 0, '69.00', '100.00', 0, 'savana-removebg-preview.png', '', 1, '2024-01-12 21:31:37'),
(18, 'HUNTERS GOLD', 3, 0, '63.00', '100.00', 0, 'Hunters-gold-removebg-preview.png', '', 1, '2023-06-03 23:08:08'),
(19, 'MINUTE A LATA', 12, 0, '46.00', '60.00', 0, 'dasxczzxcczxc-removebg-preview.png', '', 2, '2024-01-13 02:29:41'),
(128, 'BIFE', 995, 0, '250.00', '350.00', 0, 'BF.png', '', 3, '2024-01-19 21:13:49'),
(129, 'SANDES DE OVO', 99, 0, '35.00', '50.00', 0, 'png-transparent-cheeseburger-whopper-hamburger-big-n-tasty-breakfast-sandwich-bacon-ham-removebg-preview.png', '', 3, '2024-01-23 09:10:56'),
(130, 'SANDES DE QUEIO', 9, 0, '35.00', '50.00', 0, '9a7d44e49fb8206dc7c0ae879be413c8-754x394-removebg-preview.png', '', 3, '2024-01-12 20:47:43'),
(132, 'PREGO NO PAO', 47, 0, '150.00', '200.00', 0, 'prego_ovo-removebg-preview.png', '', 3, '2024-01-12 21:31:37'),
(133, 'PREGO NO PRATO', 47, 0, '200.00', '280.00', 0, 'prego-no-prato-removebg-preview.png', '', 3, '2024-01-12 20:23:50'),
(134, 'CHA SIMPLES', 1000, 0, '30.00', '50.00', 0, 'png-transparent-assam-tea-green-tea-tea-leaf-grading-white-tea-tea-food-tea-teacup-removebg-preview.png', '', 3, '2023-05-29 11:06:43'),
(135, 'DOSE DE BATATA', 994, 0, '75.00', '100.00', 0, 'Dose-Batata-removebg-preview.png', '', 3, '2023-06-03 18:15:17'),
(137, 'SOPA DE LEGUMES', 19, 0, '75.00', '100.00', 0, 'png-transparent-corn-chowder-broth-potage-vegetarian-cuisine-vegetable-soup-food-recipe-removebg-preview.png', '', 3, '2024-01-13 02:29:41'),
(138, 'UM QUARTO DE FRANGO/ BATATA/SALADA', 10, 0, '150.00', '200.00', 0, 'frangofritas-removebg-preview.png', '', 3, '2023-06-02 23:13:28'),
(150, 'PIZZA MEXICANA GRANDE', 100, 0, '600.00', '700.00', 0, 'png-clipart-pizza-pizza-removebg-preview.png', '', 3, '2023-05-29 11:15:44'),
(151, 'PIZZA  MEXICANA MEDIO', 100, 0, '330.00', '400.00', 0, 'png-clipart-pizza-pizza-removebg-preview.png', '', 3, '2023-05-29 11:19:05'),
(152, 'PIZZA REGINA GRANDE', 100, 0, '600.00', '700.00', 0, 'png-clipart-pizza-pizza-removebg-preview.png', '', 3, '2023-05-29 11:16:53'),
(166, '1 DOSE DE AZINHAS', 30, 0, '180.00', '250.00', 0, 'png-transparent-buffalo-wing-barbecue-chicken-fried-chicken-church-s-chicken-fried-chicken-buffalo-wing-barbecue-chicken-chicken-fried-chicken-removebg-preview.png', '', 3, '2023-05-29 11:28:44'),
(180, ' DOSE DE ARROZ', 223, 0, '60.00', '70.00', 0, 'png-transparent-rice-cooked-rice-white-rice-delicious-rice-removebg-preview.png', '', 3, '2024-01-19 21:14:55'),
(181, ' DOSE DE SALADA', 58, 0, '50.00', '60.00', 0, 'png-transparent-caesar-salad-mesclun-salad-dressing-leaf-vegetable-salad-removebg-preview.png', '', 3, '2023-06-02 17:29:23'),
(186, '1/2 FRANGO SIMPLES', 12, 0, '190.00', '250.00', 0, 'FRANGO_-removebg-preview (1).png', '', 3, '2023-05-29 11:45:06'),
(217, '2M TXOTI', 5, 0, '42.00', '50.00', 0, '2M_TXOTI-removebg-preview.png', '', 1, '2023-06-03 22:58:12'),
(218, 'LAURENTINA PRETA GRANDE', 22, 0, '52.00', '70.00', 0, 'LAURENTINA.png', '', 1, '2023-06-03 03:24:29'),
(219, 'TXILAR TXOTI', 23, 0, '42.00', '50.00', 0, 'Txilar-P-removebg-preview.png', '', 1, '2024-01-19 21:13:49'),
(221, 'MAY FAIR', 0, 0, '84.00', '100.00', 0, 'MAY_FAIR-removebg-preview.png', '', 1, '2023-05-29 12:13:56'),
(222, 'SAVANA LEMON', 1, 0, '69.00', '100.00', 0, 'Savanna-Angry-Lemon-500ml-removebg-preview.png', '', 1, '2023-06-03 19:28:06'),
(223, 'FANTA LARANJA LATA', 14, 0, '33.00', '50.00', 0, 'FANTA-removebg-preview.png', '', 1, '2023-06-03 17:34:42'),
(224, 'FANTA LARANJA GARRAFA', 55, 0, '17.00', '25.00', 0, 'fanta-ananas-GARRAFA-removebg-preview.png', '', 2, '2023-06-03 23:05:24'),
(225, 'FANTA LARANJA 2LITRO', 4, 0, '80.00', '100.00', 0, 'FANTA_2LT-removebg-preview.png', '', 2, '2023-05-29 12:17:35'),
(226, 'FANTA ANANAS LATA', 22, 0, '33.00', '50.00', 0, 'FANTA-removebg-preview.png', '', 2, '2023-06-01 16:50:21'),
(227, 'FANTA ANANAS GARRAFA', 49, 0, '17.00', '25.00', 0, 'fanta-ananas-GARRAFA-removebg-preview.png', '', 2, '2023-06-03 15:42:30'),
(228, 'FANTA ANANAS 2LITRO', 0, 0, '80.00', '100.00', 0, 'FANTA_2LT-removebg-preview.png', '', 2, '2023-06-03 13:03:45'),
(229, 'SPARLETTA CREME SODA 2LITRO', 1, 0, '80.00', '100.00', 0, 'CREME_SODA_2LT-removebg-preview.png', '', 2, '2023-06-01 18:07:30');

-- --------------------------------------------------------

--
-- Table structure for table `recibo`
--

CREATE TABLE `recibo` (
  `id` int(11) NOT NULL,
  `descricao` text NOT NULL,
  `valor` decimal(10,2) NOT NULL,
  `modo` varchar(255) NOT NULL,
  `factura` int(11) NOT NULL,
  `serie` varchar(5) NOT NULL,
  `cliente` int(11) NOT NULL,
  `user` int(11) NOT NULL,
  `data` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- --------------------------------------------------------

--
-- Table structure for table `serie_factura`
--

CREATE TABLE `serie_factura` (
  `id` int(11) NOT NULL,
  `ano_fiscal` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `serie_factura`
--

INSERT INTO `serie_factura` (`id`, `ano_fiscal`) VALUES
(1, 2023);

-- --------------------------------------------------------

--
-- Table structure for table `users`
--

CREATE TABLE `users` (
  `id` int(11) NOT NULL,
  `nome` varchar(255) NOT NULL,
  `user` varchar(255) NOT NULL,
  `pass` varchar(255) NOT NULL,
  `categoria` varchar(255) NOT NULL,
  `data` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `users`
--

INSERT INTO `users` (`id`, `nome`, `user`, `pass`, `categoria`, `data`) VALUES
(1, 'milagre nicodemos', 'admin', '12', 'admin', '2023-03-20 15:47:00'),
(6, 'Luisa', 'luisa', '12345', 'user', '2023-05-26 04:45:44'),
(7, 'Francisco', 'francisco', '12345', 'user', '2023-05-26 04:46:14'),
(8, 'Massalo', 'massalo', '1378', 'admin', '2023-05-26 10:37:14');

--
-- Indexes for dumped tables
--

--
-- Indexes for table `artigos_devolvidos`
--
ALTER TABLE `artigos_devolvidos`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `artigos_devolvidos_temp`
--
ALTER TABLE `artigos_devolvidos_temp`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `categoria_produtos`
--
ALTER TABLE `categoria_produtos`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `clientes`
--
ALTER TABLE `clientes`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `compras`
--
ALTER TABLE `compras`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `cotacao`
--
ALTER TABLE `cotacao`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `ct_artigos_cotados`
--
ALTER TABLE `ct_artigos_cotados`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `ct_artigos_temp`
--
ALTER TABLE `ct_artigos_temp`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `devolucao`
--
ALTER TABLE `devolucao`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `disconto`
--
ALTER TABLE `disconto`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `documento`
--
ALTER TABLE `documento`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `empresa`
--
ALTER TABLE `empresa`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `entrega`
--
ALTER TABLE `entrega`
  ADD PRIMARY KEY (`identrega`);

--
-- Indexes for table `factura`
--
ALTER TABLE `factura`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `fa_artigos_fact`
--
ALTER TABLE `fa_artigos_fact`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `fa_artigos_temp`
--
ALTER TABLE `fa_artigos_temp`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `filadeespera`
--
ALTER TABLE `filadeespera`
  ADD PRIMARY KEY (`idfiladeespera`);

--
-- Indexes for table `fornecedor`
--
ALTER TABLE `fornecedor`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `funcionario`
--
ALTER TABLE `funcionario`
  ADD PRIMARY KEY (`idfuncionario`);

--
-- Indexes for table `inventario`
--
ALTER TABLE `inventario`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `itens_comprados`
--
ALTER TABLE `itens_comprados`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `iva`
--
ALTER TABLE `iva`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `mesas`
--
ALTER TABLE `mesas`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `nc_artigos`
--
ALTER TABLE `nc_artigos`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `nc_artigos_temp`
--
ALTER TABLE `nc_artigos_temp`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `nota_de_credito`
--
ALTER TABLE `nota_de_credito`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `ordem_compra`
--
ALTER TABLE `ordem_compra`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `ordem_compra_artigos`
--
ALTER TABLE `ordem_compra_artigos`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `ordem_compra_artigos_temp`
--
ALTER TABLE `ordem_compra_artigos_temp`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `pedido`
--
ALTER TABLE `pedido`
  ADD PRIMARY KEY (`idpedido`);

--
-- Indexes for table `periodicidade`
--
ALTER TABLE `periodicidade`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `periodo`
--
ALTER TABLE `periodo`
  ADD PRIMARY KEY (`idperiodo`);

--
-- Indexes for table `pos_mesas`
--
ALTER TABLE `pos_mesas`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `pos_mesas_artigos`
--
ALTER TABLE `pos_mesas_artigos`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `pos_mesas_temp_artigos`
--
ALTER TABLE `pos_mesas_temp_artigos`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `produto`
--
ALTER TABLE `produto`
  ADD PRIMARY KEY (`idproduto`),
  ADD UNIQUE KEY `nomeproduto` (`nomeproduto`);

--
-- Indexes for table `recibo`
--
ALTER TABLE `recibo`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `serie_factura`
--
ALTER TABLE `serie_factura`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `users`
--
ALTER TABLE `users`
  ADD PRIMARY KEY (`id`);

--
-- AUTO_INCREMENT for dumped tables
--

--
-- AUTO_INCREMENT for table `artigos_devolvidos`
--
ALTER TABLE `artigos_devolvidos`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `artigos_devolvidos_temp`
--
ALTER TABLE `artigos_devolvidos_temp`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `categoria_produtos`
--
ALTER TABLE `categoria_produtos`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;
--
-- AUTO_INCREMENT for table `clientes`
--
ALTER TABLE `clientes`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;
--
-- AUTO_INCREMENT for table `compras`
--
ALTER TABLE `compras`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
--
-- AUTO_INCREMENT for table `cotacao`
--
ALTER TABLE `cotacao`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `ct_artigos_cotados`
--
ALTER TABLE `ct_artigos_cotados`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `ct_artigos_temp`
--
ALTER TABLE `ct_artigos_temp`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `devolucao`
--
ALTER TABLE `devolucao`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `disconto`
--
ALTER TABLE `disconto`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `documento`
--
ALTER TABLE `documento`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=9;
--
-- AUTO_INCREMENT for table `empresa`
--
ALTER TABLE `empresa`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
--
-- AUTO_INCREMENT for table `entrega`
--
ALTER TABLE `entrega`
  MODIFY `identrega` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `factura`
--
ALTER TABLE `factura`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `fa_artigos_fact`
--
ALTER TABLE `fa_artigos_fact`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `fa_artigos_temp`
--
ALTER TABLE `fa_artigos_temp`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `filadeespera`
--
ALTER TABLE `filadeespera`
  MODIFY `idfiladeespera` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `fornecedor`
--
ALTER TABLE `fornecedor`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;
--
-- AUTO_INCREMENT for table `funcionario`
--
ALTER TABLE `funcionario`
  MODIFY `idfuncionario` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;
--
-- AUTO_INCREMENT for table `inventario`
--
ALTER TABLE `inventario`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=43;
--
-- AUTO_INCREMENT for table `itens_comprados`
--
ALTER TABLE `itens_comprados`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=43;
--
-- AUTO_INCREMENT for table `iva`
--
ALTER TABLE `iva`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
--
-- AUTO_INCREMENT for table `mesas`
--
ALTER TABLE `mesas`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=21;
--
-- AUTO_INCREMENT for table `nc_artigos`
--
ALTER TABLE `nc_artigos`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `nc_artigos_temp`
--
ALTER TABLE `nc_artigos_temp`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `nota_de_credito`
--
ALTER TABLE `nota_de_credito`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `ordem_compra`
--
ALTER TABLE `ordem_compra`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `ordem_compra_artigos`
--
ALTER TABLE `ordem_compra_artigos`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `ordem_compra_artigos_temp`
--
ALTER TABLE `ordem_compra_artigos_temp`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `pedido`
--
ALTER TABLE `pedido`
  MODIFY `idpedido` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `periodicidade`
--
ALTER TABLE `periodicidade`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;
--
-- AUTO_INCREMENT for table `periodo`
--
ALTER TABLE `periodo`
  MODIFY `idperiodo` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;
--
-- AUTO_INCREMENT for table `pos_mesas`
--
ALTER TABLE `pos_mesas`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=8;
--
-- AUTO_INCREMENT for table `pos_mesas_artigos`
--
ALTER TABLE `pos_mesas_artigos`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=24;
--
-- AUTO_INCREMENT for table `pos_mesas_temp_artigos`
--
ALTER TABLE `pos_mesas_temp_artigos`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=416;
--
-- AUTO_INCREMENT for table `produto`
--
ALTER TABLE `produto`
  MODIFY `idproduto` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=230;
--
-- AUTO_INCREMENT for table `recibo`
--
ALTER TABLE `recibo`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT for table `serie_factura`
--
ALTER TABLE `serie_factura`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
--
-- AUTO_INCREMENT for table `users`
--
ALTER TABLE `users`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=9;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
