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

START TRANSACTION;



--
-- Database: `pharmace_app`
--

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

--
-- Table structure for table `bransh`
--

CREATE TABLE `bransh` (
  `ID` int(11) NOT NULL,
  `NAME` varchar(255) NOT NULL,
  `LOCATION` varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `bransh`
--

INSERT INTO `bransh` (`ID`, `NAME`, `LOCATION`) VALUES
(1, 'الفيحاء - الفرع الرئيسي', 'شرق النيل - الحاج يوسف - الفيحاء'),
(2, 'سوق ليبيا', 'أمدرمان - سوق ليبيا');

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

--
-- Table structure for table `company_paying`
--

CREATE TABLE `company_paying` (
  `ID` int(11) NOT NULL,
  `COMPANY_ID` int(11) NOT NULL,
  `AMOUNT` double NOT NULL,
  `PAY_TYPE` varchar(255) NOT NULL,
  `ATTACHMENT` varchar(255) NOT NULL,
  `CREATED_AT` date NOT NULL,
  `CREATED_BY` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `company_paying`
--

INSERT INTO `company_paying` (`ID`, `COMPANY_ID`, `AMOUNT`, `PAY_TYPE`, `ATTACHMENT`, `CREATED_AT`, `CREATED_BY`) VALUES
(1, 1, 381, '0', 'none.png', '0000-00-00', 1),
(2, 1, 70, '1', '2.png', '0000-00-00', 1),
(3, 1, 5, '0', 'none.png', '0000-00-00', 1),
(4, 1, 150, '0', 'none.png', '2020-04-29', 1);

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

--
-- Table structure for table `covert_items`
--

CREATE TABLE `covert_items` (
  `ID` int(11) NOT NULL,
  `COMPANY_ID` int(11) NOT NULL,
  `ITEM_ID` int(11) NOT NULL,
  `VALUE` int(2) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `covert_items`
--

INSERT INTO `covert_items` (`ID`, `COMPANY_ID`, `ITEM_ID`, `VALUE`) VALUES
(1, 1, 1, 50),
(2, 1, 5, 25);

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

--
-- Table structure for table `delay_company`
--

CREATE TABLE `delay_company` (
  `COMPANY_ID` int(11) NOT NULL,
  `INVO_ID` int(11) NOT NULL,
  `AMOUNT` int(11) NOT NULL,
  `CREATED_AT` date NOT NULL,
  `ITEM_ID` int(11) NOT NULL,
  `PAY_STATUS` tinyint(4) NOT NULL DEFAULT '0',
  `PAYED` double NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `delay_company`
--

INSERT INTO `delay_company` (`COMPANY_ID`, `INVO_ID`, `AMOUNT`, `CREATED_AT`, `ITEM_ID`, `PAY_STATUS`, `PAYED`) VALUES
(1, 1, 38, '2019-12-04', 1, 0, 38),
(1, 2, 75, '2019-12-13', 1, 0, 75),
(1, 3, 75, '2020-04-14', 1, 0, 75),
(1, 5, 75, '2020-04-29', 1, 0, 75);

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

--
-- Table structure for table `insurancecomm`
--

CREATE TABLE `insurancecomm` (
  `ID` int(11) NOT NULL,
  `NAME` varchar(255) NOT NULL,
  `PHONE` varchar(100) NOT NULL,
  `ADDRESS` text NOT NULL,
  `TOP_AMOUNT` int(11) NOT NULL,
  `CREATED_BY` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `insurancecomm`
--

INSERT INTO `insurancecomm` (`ID`, `NAME`, `PHONE`, `ADDRESS`, `TOP_AMOUNT`, `CREATED_BY`) VALUES
(1, 'شيكان للتامين', '988', 'السودان - الخرطوم - شارع ال60', 20000, 1);

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

--
-- Table structure for table `invoics`
--

CREATE TABLE `invoics` (
  `ID` int(11) NOT NULL,
  `BRANSH_ID` int(11) NOT NULL,
  `EMP_ID` int(11) NOT NULL,
  `TOTAL_AMOUNT` double NOT NULL,
  `CREATED_AT` date NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `invoics`
--

INSERT INTO `invoics` (`ID`, `BRANSH_ID`, `EMP_ID`, `TOTAL_AMOUNT`, `CREATED_AT`) VALUES
(1, 1, 1, 112.5, '2019-12-04'),
(2, 1, 1, 225, '2019-12-13'),
(3, 1, 1, 75, '2020-04-14'),
(4, 1, 1, 3150, '2020-04-22'),
(5, 1, 1, 75, '2020-04-29'),
(6, 1, 1, 27000, '2020-05-01'),
(7, 1, 1, 27000, '2020-05-11');

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

--
-- Table structure for table `invoic_detials`
--

CREATE TABLE `invoic_detials` (
  `INVO_ID` int(11) NOT NULL,
  `ITEM_ID` int(11) NOT NULL,
  `LAST_PRICE` double NOT NULL,
  `QTE` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `invoic_detials`
--

INSERT INTO `invoic_detials` (`INVO_ID`, `ITEM_ID`, `LAST_PRICE`, `QTE`) VALUES
(1, 1, 112.5, 1),
(2, 1, 112.5, 2),
(3, 1, 75, 1),
(4, 2, 150, 21),
(5, 1, 75, 1),
(6, 2, 150, 180),
(7, 2, 150, 180),
(8, 1, 150, 2);

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

--
-- Table structure for table `items`
--

CREATE TABLE `items` (
  `ID` int(11) NOT NULL,
  `SIEANCE_NAME` varchar(255) NOT NULL,
  `COMMERCAL_NAME` varchar(255) NOT NULL,
  `ORDER_POINT` int(11) NOT NULL,
  `UNIT` varchar(255) NOT NULL,
  `DESCR` text NOT NULL,
  `CREATED_BY` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `items`
--

INSERT INTO `items` (`ID`, `SIEANCE_NAME`, `COMMERCAL_NAME`, `ORDER_POINT`, `UNIT`, `DESCR`, `CREATED_BY`) VALUES
(1, 'BN_3900', 'بندول', 100, 'شريط', 'مزيل الالام الراس و الحراره', 1),
(2, 'T_12', 'TEST', 100, 'حقنة', 'Not matters', 1),
(4, 'BN_3900', 'بندول', 100, 'شريط', 'مزيل الالام الراس و الحراره', 1),
(5, 'T_12', 'TEST', 100, 'حقنة', 'Not matters', 1),
(7, 'BN_3900', 'بندول', 100, 'شريط', 'مزيل الالام الراس و الحراره', 1),
(8, 'T_12', 'TEST', 100, 'حقنة', 'Not matters', 1),
(9, 'BN_3900', 'بندول', 100, 'شريط', 'مزيل الالام الراس و الحراره', 1),
(10, 'BN_3900', 'بندول', 100, 'شريط', 'مزيل الالام الراس و الحراره', 1),
(11, 'T_12', 'TEST', 100, 'حقنة', 'Not matters', 1),
(12, 'BN_3900', 'بندول', 100, 'شريط', 'مزيل الالام الراس و الحراره', 1),
(13, 'BN_3900', 'بندول', 100, 'شريط', 'مزيل الالام الراس و الحراره', 1),
(14, 'T_12', 'TEST', 100, 'حقنة', 'Not matters', 1),
(15, 'BN_3900', 'بندول', 100, 'شريط', 'مزيل الالام الراس و الحراره', 1),
(16, 'BN_3900', 'بندول', 100, 'شريط', 'مزيل الالام الراس و الحراره', 1),
(17, 'T_12', 'TEST', 100, 'حقنة', 'Not matters', 1),
(18, 'BN_3900', 'بندول', 100, 'شريط', 'مزيل الالام الراس و الحراره', 1),
(19, 'BN_3900', 'بندول', 100, 'شريط', 'مزيل الالام الراس و الحراره', 1),
(20, 'T_12', 'TEST', 100, 'حقنة', 'Not matters', 1),
(21, 'BN_3900', 'بندول', 100, 'شريط', 'مزيل الالام الراس و الحراره', 1),
(22, 'BN_3900', 'بندول', 100, 'شريط', 'مزيل الالام الراس و الحراره', 1),
(23, 'T_12', 'TEST', 100, 'حقنة', 'Not matters', 1),
(24, 'BN_3900', 'بندول', 100, 'شريط', 'مزيل الالام الراس و الحراره', 1);

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

--
-- Table structure for table `stock`
--

CREATE TABLE `stock` (
  `ID` int(11) NOT NULL,
  `ITEM_ID` int(11) NOT NULL,
  `BRANSH_ID` int(11) NOT NULL,
  `PURECHES_PRICE` float NOT NULL,
  `SALE_PRICE` float NOT NULL,
  `QTE` int(11) NOT NULL,
  `EX_DATE` date NOT NULL,
  `CREATED_AT` date NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Dumping data for table `stock`
--

INSERT INTO `stock` (`ID`, `ITEM_ID`, `BRANSH_ID`, `PURECHES_PRICE`, `SALE_PRICE`, `QTE`, `EX_DATE`, `CREATED_AT`) VALUES
(1, 1, 1, 100, 150, 195, '2019-12-26', '2019-12-02'),
(5, 1, 1, 1000, 10, 100, '2020-01-25', '2020-01-22'),
(6, 2, 1, 100, 150, -1, '2021-01-06', '2020-04-14');

--
-- Indexes for dumped tables
--

--
-- Indexes for table `bransh`
--
ALTER TABLE `bransh`
  ADD PRIMARY KEY (`ID`);

--
-- Indexes for table `company_paying`
--
ALTER TABLE `company_paying`
  ADD PRIMARY KEY (`ID`);

--
-- Indexes for table `covert_items`
--
ALTER TABLE `covert_items`
  ADD PRIMARY KEY (`ID`);

--
-- Indexes for table `insurancecomm`
--
ALTER TABLE `insurancecomm`
  ADD PRIMARY KEY (`ID`);

--
-- Indexes for table `invoics`
--
ALTER TABLE `invoics`
  ADD PRIMARY KEY (`ID`);

--
-- Indexes for table `items`
--
ALTER TABLE `items`
  ADD PRIMARY KEY (`ID`);

--
-- Indexes for table `stock`
--
ALTER TABLE `stock`
  ADD PRIMARY KEY (`ID`);

--
-- AUTO_INCREMENT for dumped tables
--

--
-- AUTO_INCREMENT for table `bransh`
--
ALTER TABLE `bransh`
  MODIFY `ID` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;

--
-- AUTO_INCREMENT for table `items`
--
ALTER TABLE `items`
  MODIFY `ID` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=25;
COMMIT;

