-- phpMyAdmin SQL Dump
-- version 4.8.5
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: 15 окт 2025 в 00:49
-- Версия на сървъра: 10.1.34-MariaDB
-- PHP Version: 7.3.2

SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
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: `protocols`
--

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

--
-- Структура на таблица `offer_items`
--

CREATE TABLE `offer_items` (
  `id` int(11) NOT NULL,
  `offer_id` int(11) NOT NULL,
  `article_id` int(11) NOT NULL,
  `quantity` decimal(10,2) NOT NULL,
  `unit` varchar(50) NOT NULL,
  `price_per_unit` decimal(10,2) NOT NULL,
  `total_price` decimal(10,2) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Схема на данните от таблица `offer_items`
--

INSERT INTO `offer_items` (`id`, `offer_id`, `article_id`, `quantity`, `unit`, `price_per_unit`, `total_price`) VALUES
(13, 2, 4, '2.00', 'бр.', '28.11', '56.22'),
(14, 2, 2, '30.00', 'л.м.', '0.50', '15.00'),
(15, 2, 3, '1.00', 'бр.', '89.00', '89.00'),
(16, 2, 6, '1.00', 'бр.', '45.22', '45.22'),
(17, 2, 8, '1.00', 'бр.', '21.02', '21.02'),
(18, 2, 7, '1.00', 'бр.', '28.34', '28.34'),
(19, 2, 1, '3.00', 'бр.', '23.21', '69.63'),
(20, 2, 5, '1.00', 'бр.', '18.00', '18.00'),
(21, 3, 4, '2.00', 'бр.', '28.11', '56.22'),
(22, 3, 2, '40.00', 'л.м.', '0.50', '20.00'),
(23, 3, 3, '1.00', 'бр.', '89.00', '89.00'),
(24, 3, 6, '1.00', 'бр.', '45.22', '45.22'),
(25, 3, 8, '1.00', 'бр.', '21.02', '21.02'),
(26, 3, 7, '1.00', 'бр.', '28.34', '28.34'),
(27, 3, 1, '3.00', 'бр.', '23.21', '69.63'),
(28, 3, 5, '1.00', 'бр.', '18.00', '18.00'),
(37, 4, 4, '2.00', 'бр.', '28.11', '56.22'),
(38, 4, 2, '45.00', 'л.м.', '0.50', '22.50'),
(39, 4, 3, '1.00', 'бр.', '89.00', '89.00'),
(40, 4, 6, '1.00', 'бр.', '45.22', '45.22'),
(41, 4, 8, '1.00', 'бр.', '21.02', '21.02'),
(42, 4, 7, '1.00', 'бр.', '28.34', '28.34'),
(43, 4, 1, '5.00', 'бр.', '23.21', '116.05'),
(44, 4, 5, '1.00', 'бр.', '18.00', '18.00'),
(45, 5, 4, '2.00', 'бр.', '28.11', '56.22'),
(46, 5, 7, '1.00', 'бр.', '28.34', '28.34'),
(51, 7, 4, '2.00', 'бр.', '28.11', '56.22'),
(52, 7, 2, '50.00', 'л.м.', '0.50', '25.00'),
(53, 7, 3, '1.00', 'бр.', '89.00', '89.00'),
(54, 7, 6, '1.00', 'бр.', '45.22', '45.22'),
(55, 7, 8, '1.00', 'бр.', '21.02', '21.02'),
(56, 7, 7, '1.00', 'бр.', '28.34', '28.34'),
(57, 7, 1, '5.00', 'бр.', '23.21', '116.05'),
(58, 7, 5, '1.00', 'бр.', '18.00', '18.00'),
(59, 8, 1, '2.00', 'бр.', '23.21', '46.42'),
(60, 9, 4, '2.00', 'бр.', '28.11', '56.22'),
(61, 9, 2, '65.00', 'л.м.', '0.50', '32.50'),
(62, 9, 3, '1.00', 'бр.', '89.00', '89.00'),
(63, 9, 6, '1.00', 'бр.', '45.22', '45.22'),
(64, 9, 8, '1.00', 'бр.', '21.02', '21.02'),
(65, 9, 7, '1.00', 'бр.', '28.34', '28.34'),
(66, 9, 1, '6.00', 'бр.', '23.21', '139.26'),
(67, 9, 5, '1.00', 'бр.', '18.00', '18.00'),
(78, 1, 4, '1.00', 'бр.', '34.00', '34.00'),
(79, 1, 2, '180.00', 'л.м.', '0.50', '90.00'),
(80, 1, 3, '1.00', 'бр.', '89.00', '89.00'),
(81, 1, 6, '1.00', 'бр.', '45.00', '45.00'),
(84, 11, 4, '2.00', 'бр.', '28.12', '56.24'),
(85, 11, 7, '2.00', 'бр.', '28.34', '56.68'),
(86, 11, 5, '1.00', 'бр.', '18.00', '18.00'),
(87, 6, 2, '50.00', 'л.м.', '0.50', '25.00'),
(88, 6, 3, '1.00', 'бр.', '89.00', '89.00'),
(89, 6, 7, '1.00', 'бр.', '28.34', '28.34'),
(90, 6, 5, '1.00', 'бр.', '18.00', '18.00');

--
-- Indexes for dumped tables
--

--
-- Indexes for table `offer_items`
--
ALTER TABLE `offer_items`
  ADD PRIMARY KEY (`id`),
  ADD KEY `offer_id` (`offer_id`),
  ADD KEY `article_id` (`article_id`);

--
-- AUTO_INCREMENT for dumped tables
--

--
-- AUTO_INCREMENT for table `offer_items`
--
ALTER TABLE `offer_items`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=91;

--
-- Ограничения за дъмпнати таблици
--

--
-- Ограничения за таблица `offer_items`
--
ALTER TABLE `offer_items`
  ADD CONSTRAINT `offer_items_ibfk_1` FOREIGN KEY (`offer_id`) REFERENCES `offers` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `offer_items_ibfk_2` FOREIGN KEY (`article_id`) REFERENCES `articles` (`id`) ON DELETE CASCADE;
COMMIT;

/*!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 */;
