-- https://www.phpmyadmin.net/
--

START TRANSACTION;



--
-- Database: `msbox_msbox`
--

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

--
-- Table structure for table `account_bank`
--

CREATE TABLE `account_bank` (
  `account_bank_id` int(11) NOT NULL,
  `bank_id` int(11) DEFAULT NULL COMMENT '0 = Caja',
  `name_account` varchar(255) DEFAULT NULL,
  `no_account` varchar(200) DEFAULT NULL,
  `type` varchar(255) DEFAULT NULL,
  `currency` varchar(100) DEFAULT NULL,
  `current_balance` decimal(10,2) DEFAULT NULL,
  `branch_id` int(11) DEFAULT NULL,
  `status` int(11) DEFAULT 1
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `admin`
--

CREATE TABLE `admin` (
  `admin_id` int(11) NOT NULL,
  `name` longtext DEFAULT NULL,
  `last_name` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `email` longtext DEFAULT NULL,
  `password` longtext DEFAULT NULL,
  `status` int(11) DEFAULT 1,
  `username` varchar(100) DEFAULT NULL,
  `type` int(11) DEFAULT 0 COMMENT '1=admin 2 =empleados  ',
  `phone` varchar(200) DEFAULT NULL,
  `productos` int(11) DEFAULT 0,
  `reportes` int(11) DEFAULT 0,
  `usuarios` int(11) DEFAULT 0,
  `ajustes` int(11) DEFAULT 0,
  `herramientas` int(11) DEFAULT 0,
  `contabilidad` int(11) DEFAULT 0,
  `sucursales` int(11) DEFAULT 0,
  `sucursal` varchar(250) DEFAULT NULL,
  `cui` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `birthday` varchar(250) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `salary` varchar(250) DEFAULT NULL,
  `address` longtext DEFAULT NULL,
  `hiring` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `job` varchar(250) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `img` longtext DEFAULT NULL,
  `gm_id` longtext DEFAULT NULL,
  `gm_email` longtext DEFAULT NULL,
  `gm_img` longtext DEFAULT NULL,
  `expire` longtext DEFAULT NULL,
  `auth_key` longtext DEFAULT NULL,
  `last_info` varchar(250) DEFAULT NULL,
  `current_info` varchar(250) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `bank`
--

CREATE TABLE `bank` (
  `bank_id` int(11) NOT NULL,
  `name` varchar(255) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `binnacle`
--

CREATE TABLE `binnacle` (
  `binnacle_id` int(11) NOT NULL,
  `message` longtext DEFAULT NULL,
  `date` datetime DEFAULT NULL,
  `branch_id` int(11) DEFAULT NULL,
  `user_id` int(11) DEFAULT NULL,
  `user_type` varchar(200) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `branch`
--

CREATE TABLE `branch` (
  `branch_id` int(11) NOT NULL,
  `name` longtext DEFAULT NULL,
  `manager` longtext DEFAULT NULL,
  `phone` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `tel` longtext DEFAULT NULL,
  `address` longtext DEFAULT NULL,
  `email` varchar(150) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `status` int(11) NOT NULL DEFAULT 1
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `cash_history`
--

CREATE TABLE `cash_history` (
  `id` bigint(20) NOT NULL,
  `cash_id` int(11) DEFAULT NULL,
  `user_id` int(11) DEFAULT NULL,
  `branch_id` int(11) DEFAULT NULL,
  `date_opening` date DEFAULT NULL,
  `time_opening` text DEFAULT NULL,
  `date_close` date DEFAULT NULL,
  `time_close` text DEFAULT NULL,
  `amount_initial` float DEFAULT 0,
  `amount_final` float DEFAULT 0,
  `difference_cash` float DEFAULT 0,
  `difference_day` float DEFAULT 0,
  `notes` longtext DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `categories`
--

CREATE TABLE `categories` (
  `category_id` int(11) NOT NULL,
  `name` varchar(200) DEFAULT NULL,
  `description` varchar(255) DEFAULT NULL,
  `status` int(11) DEFAULT 1,
  `branch_id` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `ci_sessions`
--

CREATE TABLE `ci_sessions` (
  `id` varchar(40) NOT NULL,
  `ip_address` varchar(45) NOT NULL,
  `timestamp` int(10) UNSIGNED NOT NULL DEFAULT 0,
  `data` blob NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

--
-- Dumping data for table `ci_sessions`
--

INSERT INTO `ci_sessions` (`id`, `ip_address`, `timestamp`, `data`) VALUES
('da76cf42a80e1683f479641e18a6539030240534', '186.151.141.90', 1643038854, 0x5f5f63695f6c6173745f726567656e65726174657c693a313634333033383835343b);

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

--
-- Table structure for table `client`
--

CREATE TABLE `client` (
  `client_id` int(11) NOT NULL,
  `name` varchar(250) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `last_name` varchar(250) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `phone` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `type` int(11) NOT NULL COMMENT '1 = mayorista 2 = minorista',
  `limite` decimal(10,2) NOT NULL,
  `nit` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `email` varchar(250) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `address` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `branch_id` int(11) NOT NULL,
  `status` int(11) NOT NULL DEFAULT 1
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `credit_details`
--

CREATE TABLE `credit_details` (
  `credit_details_id` int(11) NOT NULL,
  `date` varchar(250) DEFAULT NULL,
  `sales_id` int(11) NOT NULL,
  `method` varchar(250) NOT NULL,
  `amount` decimal(10,2) NOT NULL,
  `status` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `delivery`
--

CREATE TABLE `delivery` (
  `delivery_id` int(11) NOT NULL,
  `code` varchar(250) DEFAULT NULL,
  `sale_code` varchar(250) DEFAULT NULL,
  `responsable_id` int(11) DEFAULT NULL,
  `branch_id` int(11) DEFAULT NULL,
  `fecha_asignada` date DEFAULT NULL,
  `fecha_entrega` datetime DEFAULT NULL,
  `cost` decimal(10,2) DEFAULT 0.00,
  `cost_extra` decimal(10,2) DEFAULT 0.00,
  `total` decimal(10,2) DEFAULT 0.00,
  `address` longtext DEFAULT NULL,
  `notes` longtext DEFAULT NULL,
  `status` int(11) DEFAULT 1,
  `reason` longtext DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `events`
--

CREATE TABLE `events` (
  `events_id` int(11) NOT NULL,
  `date_start` date NOT NULL,
  `date_end` date NOT NULL,
  `time_start` time NOT NULL,
  `time_end` time NOT NULL,
  `title` varchar(250) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `description` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_nopad_ci DEFAULT NULL,
  `color` varchar(250) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_nopad_ci NOT NULL,
  `branch_id` int(11) NOT NULL,
  `status` int(11) NOT NULL DEFAULT 1,
  `view_all` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `expense`
--

CREATE TABLE `expense` (
  `expense_id` int(11) NOT NULL,
  `date` date DEFAULT NULL,
  `week` int(11) NOT NULL,
  `month` int(11) NOT NULL,
  `year` int(11) NOT NULL,
  `amount` decimal(10,2) DEFAULT NULL,
  `saldo_inicial` decimal(10,2) DEFAULT 0.00,
  `nuevo_saldo` decimal(10,2) DEFAULT NULL,
  `responsable` varchar(255) DEFAULT NULL,
  `factura_img` longtext DEFAULT NULL,
  `provider` varchar(255) DEFAULT NULL,
  `origin` int(11) DEFAULT NULL COMMENT '0 = Efectivo, mayor a cero id Banco',
  `details` longtext DEFAULT NULL,
  `datetime` datetime DEFAULT NULL,
  `admin_id` int(11) DEFAULT NULL,
  `branch_id` int(11) DEFAULT NULL,
  `reference_id` varchar(250) DEFAULT NULL,
  `table_reference` text DEFAULT NULL,
  `status` int(11) DEFAULT 1,
  `reason` longtext DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `income`
--

CREATE TABLE `income` (
  `income_id` int(11) NOT NULL,
  `date` date NOT NULL,
  `week` int(11) NOT NULL,
  `month` int(11) NOT NULL,
  `year` int(11) NOT NULL,
  `amount` decimal(10,2) DEFAULT NULL,
  `responsable` varchar(255) DEFAULT NULL,
  `factura_img` longtext DEFAULT NULL,
  `sale_ref` varchar(255) DEFAULT NULL,
  `origin` int(11) DEFAULT NULL COMMENT '0 = Efectivo, mayor a cero id Banco',
  `details` longtext DEFAULT NULL,
  `datetime` datetime DEFAULT current_timestamp(),
  `admin_id` int(11) DEFAULT NULL,
  `branch_id` int(11) DEFAULT NULL,
  `status` int(11) DEFAULT 1
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `job`
--

CREATE TABLE `job` (
  `job_id` int(11) NOT NULL,
  `name` text DEFAULT NULL,
  `description` longtext DEFAULT NULL,
  `permissions` varchar(250) DEFAULT NULL,
  `status` int(11) DEFAULT 1
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `language`
--

CREATE TABLE `language` (
  `phrase_id` int(11) NOT NULL,
  `phrase` longtext DEFAULT NULL,
  `english` longtext DEFAULT NULL,
  `spanish` longtext DEFAULT NULL,
  `portuguese` longtext DEFAULT NULL,
  `french` longtext DEFAULT NULL,
  `serbian` longtext DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `mark`
--

CREATE TABLE `mark` (
  `mark_id` int(11) NOT NULL,
  `name` varchar(250) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `description` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `branch_id` int(11) NOT NULL,
  `status` int(11) NOT NULL DEFAULT 1
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `notificacion`
--

CREATE TABLE `notificacion` (
  `notificacion_id` bigint(20) NOT NULL,
  `notify` longtext DEFAULT NULL,
  `branch_id` int(11) DEFAULT NULL,
  `user_id` int(11) DEFAULT NULL,
  `user_type` text DEFAULT NULL,
  `original_id` int(11) DEFAULT NULL,
  `original_type` text DEFAULT NULL,
  `original_branch` int(11) DEFAULT NULL,
  `type` text DEFAULT NULL,
  `categoria` text DEFAULT NULL,
  `url` longtext DEFAULT NULL,
  `date` text DEFAULT NULL,
  `readed` tinyint(4) DEFAULT 0
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `payroll`
--

CREATE TABLE `payroll` (
  `payroll_id` int(11) NOT NULL,
  `date_start` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `date_end` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `num_employee` int(11) NOT NULL DEFAULT 0,
  `employee` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `responsable` varchar(250) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `bank` int(11) NOT NULL,
  `branch_id` int(11) NOT NULL,
  `total` decimal(10,2) NOT NULL,
  `status` int(11) NOT NULL DEFAULT 1,
  `reason` longtext DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `products`
--

CREATE TABLE `products` (
  `products_id` int(11) NOT NULL,
  `name` varchar(250) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `code` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `mark` varchar(250) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_nopad_ci NOT NULL,
  `provider` int(11) NOT NULL,
  `category` int(11) NOT NULL,
  `price` decimal(10,2) DEFAULT NULL,
  `stock_inventory` int(11) DEFAULT NULL,
  `stock_bodega` int(11) NOT NULL,
  `alert` int(11) NOT NULL,
  `description` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_nopad_ci DEFAULT NULL,
  `img` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_520_nopad_ci NOT NULL,
  `presentation` varchar(250) NOT NULL,
  `weight` varchar(250) NOT NULL,
  `unit` varchar(250) NOT NULL,
  `branch_id` int(11) NOT NULL,
  `status` int(11) NOT NULL DEFAULT 1
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `product_details`
--

CREATE TABLE `product_details` (
  `product_details_id` int(11) NOT NULL,
  `date` date DEFAULT NULL,
  `products_id` int(11) NOT NULL,
  `user_id` int(11) NOT NULL,
  `type` int(11) NOT NULL,
  `branch_id` int(11) NOT NULL COMMENT '1 inventario 2 bodega',
  `branch_id2` int(11) DEFAULT NULL,
  `activity_ref` varchar(250) DEFAULT NULL,
  `amount` int(250) NOT NULL,
  `provider` int(11) NOT NULL,
  `price` decimal(10,2) DEFAULT NULL,
  `description` longtext DEFAULT NULL,
  `expiration` date NOT NULL,
  `status` int(11) NOT NULL DEFAULT 1,
  `estado` int(11) DEFAULT 1 COMMENT '1 = Activo 2 = Cambio 3 = Anulado'
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `provider`
--

CREATE TABLE `provider` (
  `provider_id` int(11) NOT NULL,
  `name` varchar(250) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `manager` varchar(250) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `phone` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `whatsapp` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `email` varchar(250) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `address` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `nit` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `detail` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `branch_id` int(11) NOT NULL,
  `status` int(11) NOT NULL DEFAULT 1
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `quotes`
--

CREATE TABLE `quotes` (
  `quotes_id` int(11) NOT NULL,
  `code` varchar(250) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `client_id` int(11) NOT NULL,
  `num_products` int(11) NOT NULL,
  `products` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `date_start` timestamp NOT NULL DEFAULT current_timestamp(),
  `date_end` date DEFAULT NULL,
  `discount` decimal(10,2) DEFAULT 0.00,
  `total` decimal(10,2) NOT NULL,
  `responsable` int(11) NOT NULL,
  `branch_id` int(11) NOT NULL,
  `status` int(11) NOT NULL DEFAULT 1
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `request`
--

CREATE TABLE `request` (
  `request_id` int(11) NOT NULL,
  `code` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `responsable` int(11) NOT NULL,
  `provider` int(11) NOT NULL,
  `date_request` date NOT NULL,
  `date` date NOT NULL,
  `num_products` int(11) NOT NULL,
  `products` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `address` varchar(250) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `details` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `note` varchar(250) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `total` decimal(10,2) NOT NULL,
  `location` int(11) NOT NULL,
  `destiny` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `sales`
--

CREATE TABLE `sales` (
  `sales_id` int(11) NOT NULL,
  `code` varchar(250) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `client_id` int(11) DEFAULT 0,
  `responsable` int(11) NOT NULL,
  `shipping` int(11) DEFAULT 0,
  `shipping_cost` decimal(10,2) DEFAULT NULL,
  `shipping_date` date DEFAULT NULL,
  `date` date NOT NULL DEFAULT current_timestamp(),
  `day` int(11) NOT NULL,
  `week` int(11) NOT NULL,
  `month` int(11) NOT NULL,
  `year` int(11) NOT NULL,
  `time` time DEFAULT current_timestamp(),
  `num_products` int(11) DEFAULT 0,
  `products` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT '[\'\']',
  `total` decimal(10,2) DEFAULT 0.00,
  `total_pagado` decimal(10,2) NOT NULL DEFAULT 0.00,
  `metodo` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `type` int(11) NOT NULL DEFAULT 0,
  `credito` int(11) NOT NULL DEFAULT 0,
  `factura` int(11) DEFAULT 0,
  `name` varchar(250) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `nit` varchar(100) DEFAULT NULL,
  `phone` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `address` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `delivery` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `details` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `estado` int(11) NOT NULL DEFAULT 1 COMMENT '1 = activo 2= completado 3=anulado 4=cambio ',
  `branch_id` int(11) NOT NULL,
  `my` int(11) DEFAULT NULL,
  `name_res` varchar(250) NOT NULL,
  `status` int(11) NOT NULL DEFAULT 1,
  `FEL` int(11) NOT NULL,
  `codigo_fel` varchar(250) DEFAULT NULL,
  `date_fel` varchar(250) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `service_transport`
--

CREATE TABLE `service_transport` (
  `service_transport_id` int(11) NOT NULL,
  `transport_id` int(11) DEFAULT NULL,
  `next_service` date DEFAULT NULL,
  `date` date DEFAULT NULL,
  `payment_method` int(11) DEFAULT NULL COMMENT '0 = Efectivo, 1 = Cheque, 2 = Tarjeta Débito, 3= Transferencia',
  `account_bank_id` int(11) DEFAULT NULL,
  `price` decimal(10,2) DEFAULT NULL,
  `place_service` varchar(255) DEFAULT NULL,
  `responsable` varchar(255) DEFAULT NULL,
  `details` longtext DEFAULT NULL,
  `status` int(11) DEFAULT 1,
  `reason` longtext DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `settings`
--

CREATE TABLE `settings` (
  `settings_id` int(11) NOT NULL,
  `type` longtext NOT NULL,
  `description` longtext DEFAULT NULL,
  `title` longtext DEFAULT NULL,
  `subtitle` varchar(200) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `shopping`
--

CREATE TABLE `shopping` (
  `shopping_id` int(11) NOT NULL,
  `type` int(11) NOT NULL DEFAULT 3 COMMENT '1= completado 2 =  orden  3= solicitud',
  `code` varchar(150) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `provider` int(11) NOT NULL,
  `num_products` int(11) NOT NULL DEFAULT 0,
  `products` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '[\'\']',
  `credito` int(11) DEFAULT 0,
  `abono` decimal(10,2) DEFAULT NULL,
  `responsable` int(11) NOT NULL,
  `date_request` date NOT NULL DEFAULT current_timestamp(),
  `date` date NOT NULL,
  `location` int(11) NOT NULL,
  `destiny` int(11) NOT NULL,
  `details` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  `total` decimal(10,2) NOT NULL,
  `branch_id` int(11) NOT NULL DEFAULT 0,
  `status` int(11) NOT NULL DEFAULT 1
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `transaction_accounts`
--

CREATE TABLE `transaction_accounts` (
  `transaction_account_id` int(11) NOT NULL,
  `date_time` datetime DEFAULT NULL,
  `account_origin` int(11) DEFAULT NULL,
  `account_destiny` int(11) DEFAULT NULL COMMENT '0 = Caja',
  `amount` decimal(10,2) DEFAULT NULL,
  `responsable` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

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

--
-- Table structure for table `transport`
--

CREATE TABLE `transport` (
  `transport_id` int(11) NOT NULL,
  `name` varchar(255) DEFAULT NULL,
  `license_plate` varchar(25) DEFAULT NULL,
  `km` int(11) DEFAULT NULL,
  `responsable` int(11) DEFAULT NULL,
  `next_service` date DEFAULT NULL,
  `notes` longtext DEFAULT NULL,
  `status` int(11) DEFAULT 1 COMMENT '0 = Inactivo, 1 = Disponible, 2 = En ruta',
  `branch_id` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Indexes for dumped tables
--

--
-- Indexes for table `account_bank`
--
ALTER TABLE `account_bank`
  ADD PRIMARY KEY (`account_bank_id`);

--
-- Indexes for table `admin`
--
ALTER TABLE `admin`
  ADD PRIMARY KEY (`admin_id`);

--
-- Indexes for table `bank`
--
ALTER TABLE `bank`
  ADD PRIMARY KEY (`bank_id`);

--
-- Indexes for table `binnacle`
--
ALTER TABLE `binnacle`
  ADD PRIMARY KEY (`binnacle_id`);

--
-- Indexes for table `branch`
--
ALTER TABLE `branch`
  ADD PRIMARY KEY (`branch_id`);

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

--
-- Indexes for table `categories`
--
ALTER TABLE `categories`
  ADD PRIMARY KEY (`category_id`);

--
-- Indexes for table `ci_sessions`
--
ALTER TABLE `ci_sessions`
  ADD PRIMARY KEY (`id`),
  ADD KEY `ci_sessions_timestamp` (`timestamp`);

--
-- Indexes for table `client`
--
ALTER TABLE `client`
  ADD PRIMARY KEY (`client_id`);

--
-- Indexes for table `credit_details`
--
ALTER TABLE `credit_details`
  ADD PRIMARY KEY (`credit_details_id`);

--
-- Indexes for table `delivery`
--
ALTER TABLE `delivery`
  ADD PRIMARY KEY (`delivery_id`);

--
-- Indexes for table `events`
--
ALTER TABLE `events`
  ADD PRIMARY KEY (`events_id`);

--
-- Indexes for table `expense`
--
ALTER TABLE `expense`
  ADD PRIMARY KEY (`expense_id`);

--
-- Indexes for table `income`
--
ALTER TABLE `income`
  ADD PRIMARY KEY (`income_id`);

--
-- Indexes for table `job`
--
ALTER TABLE `job`
  ADD PRIMARY KEY (`job_id`);

--
-- Indexes for table `language`
--
ALTER TABLE `language`
  ADD PRIMARY KEY (`phrase_id`);

--
-- Indexes for table `mark`
--
ALTER TABLE `mark`
  ADD PRIMARY KEY (`mark_id`);

--
-- Indexes for table `notificacion`
--
ALTER TABLE `notificacion`
  ADD PRIMARY KEY (`notificacion_id`);

--
-- Indexes for table `payroll`
--
ALTER TABLE `payroll`
  ADD PRIMARY KEY (`payroll_id`);

--
-- Indexes for table `products`
--
ALTER TABLE `products`
  ADD PRIMARY KEY (`products_id`);

--
-- Indexes for table `product_details`
--
ALTER TABLE `product_details`
  ADD PRIMARY KEY (`product_details_id`);

--
-- Indexes for table `provider`
--
ALTER TABLE `provider`
  ADD PRIMARY KEY (`provider_id`);

--
-- Indexes for table `quotes`
--
ALTER TABLE `quotes`
  ADD PRIMARY KEY (`quotes_id`);

--
-- Indexes for table `request`
--
ALTER TABLE `request`
  ADD PRIMARY KEY (`request_id`);

--
-- Indexes for table `sales`
--
ALTER TABLE `sales`
  ADD PRIMARY KEY (`sales_id`);

--
-- Indexes for table `service_transport`
--
ALTER TABLE `service_transport`
  ADD PRIMARY KEY (`service_transport_id`);

--
-- Indexes for table `settings`
--
ALTER TABLE `settings`
  ADD PRIMARY KEY (`settings_id`);

--
-- Indexes for table `shopping`
--
ALTER TABLE `shopping`
  ADD PRIMARY KEY (`shopping_id`);

--
-- Indexes for table `transaction_accounts`
--
ALTER TABLE `transaction_accounts`
  ADD PRIMARY KEY (`transaction_account_id`);

--
-- Indexes for table `transport`
--
ALTER TABLE `transport`
  ADD PRIMARY KEY (`transport_id`);

--
-- AUTO_INCREMENT for dumped tables
--

--
-- AUTO_INCREMENT for table `account_bank`
--
ALTER TABLE `account_bank`
  MODIFY `account_bank_id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `admin`
--
ALTER TABLE `admin`
  MODIFY `admin_id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `bank`
--
ALTER TABLE `bank`
  MODIFY `bank_id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `binnacle`
--
ALTER TABLE `binnacle`
  MODIFY `binnacle_id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `branch`
--
ALTER TABLE `branch`
  MODIFY `branch_id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `cash_history`
--
ALTER TABLE `cash_history`
  MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `categories`
--
ALTER TABLE `categories`
  MODIFY `category_id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `client`
--
ALTER TABLE `client`
  MODIFY `client_id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `credit_details`
--
ALTER TABLE `credit_details`
  MODIFY `credit_details_id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `delivery`
--
ALTER TABLE `delivery`
  MODIFY `delivery_id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `events`
--
ALTER TABLE `events`
  MODIFY `events_id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `expense`
--
ALTER TABLE `expense`
  MODIFY `expense_id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `income`
--
ALTER TABLE `income`
  MODIFY `income_id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `job`
--
ALTER TABLE `job`
  MODIFY `job_id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `language`
--
ALTER TABLE `language`
  MODIFY `phrase_id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `mark`
--
ALTER TABLE `mark`
  MODIFY `mark_id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `notificacion`
--
ALTER TABLE `notificacion`
  MODIFY `notificacion_id` bigint(20) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `payroll`
--
ALTER TABLE `payroll`
  MODIFY `payroll_id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `products`
--
ALTER TABLE `products`
  MODIFY `products_id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `product_details`
--
ALTER TABLE `product_details`
  MODIFY `product_details_id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `provider`
--
ALTER TABLE `provider`
  MODIFY `provider_id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `quotes`
--
ALTER TABLE `quotes`
  MODIFY `quotes_id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `request`
--
ALTER TABLE `request`
  MODIFY `request_id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `sales`
--
ALTER TABLE `sales`
  MODIFY `sales_id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `service_transport`
--
ALTER TABLE `service_transport`
  MODIFY `service_transport_id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `settings`
--
ALTER TABLE `settings`
  MODIFY `settings_id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `shopping`
--
ALTER TABLE `shopping`
  MODIFY `shopping_id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `transaction_accounts`
--
ALTER TABLE `transaction_accounts`
  MODIFY `transaction_account_id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `transport`
--
ALTER TABLE `transport`
  MODIFY `transport_id` int(11) NOT NULL AUTO_INCREMENT;
COMMIT;

INSERT INTO `settings` (`settings_id`, `type`, `description`, `title`, `subtitle`) VALUES
(1, 'logo', 'elearning.png', NULL, NULL),
(2, 'theme', NULL, NULL, NULL),
(3, 'name', '', NULL, NULL),
(4, 'slogan', 'Gestion de inventario', NULL, NULL),
(5, 'phone', '', NULL, NULL),
(6, 'regimen', '12', NULL, NULL),
(7, 'email', 'msbox@mayansource.dev', NULL, NULL),
(8, 'cierre', 'horarios', NULL, NULL),
(9, 'corte', '17:30', NULL, NULL),
(10, 'monto_limite', '1500', NULL, NULL),
(11, 'moneda', 'Q', NULL, NULL),
(12, 'horario_limite', '19:00', NULL, NULL),
(13, 'address', '', NULL, NULL),
(14, 'planilla', 'mensual', NULL, NULL),
(15, 'meta_mensual', '5000', NULL, NULL),
(16, 'noti_email', '1', NULL, NULL),
(17, 'whatsapp', NULL, NULL, NULL),
(18, 'code', '', NULL, NULL),
(19, 'favico', 'Isologo.png', NULL, NULL),
(20, 'install', '1', NULL, NULL),
(21, 'ganancia', '75', NULL, NULL),
(22, 'mayorista', '15', NULL, NULL),
(23, 'FEL', '1', NULL, NULL);