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

START TRANSACTION;



--
-- Database: `sassolut_invoicing`
--

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

--
-- Table structure for table `tbl_customers`
--

CREATE TABLE `tbl_customers` (
  `id` int(11) NOT NULL,
  `first_name` varchar(250) NOT NULL,
  `last_name` varchar(250) DEFAULT NULL,
  `email` varchar(250) NOT NULL,
  `phone` varchar(250) NOT NULL,
  `street` varchar(250) NOT NULL,
  `street_2` varchar(250) NOT NULL,
  `city` varchar(250) NOT NULL,
  `state` varchar(250) NOT NULL,
  `zip_cope` varchar(250) NOT NULL,
  `country` varchar(250) NOT NULL,
  `status` tinyint(1) NOT NULL DEFAULT 1,
  `balance` double NOT NULL,
  `created_at` datetime NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- Dumping data for table `tbl_customers`
--

INSERT INTO `tbl_customers` (`id`, `first_name`, `last_name`, `email`, `phone`, `street`, `street_2`, `city`, `state`, `zip_cope`, `country`, `status`, `balance`, `created_at`) VALUES
(5, 'Hycube Technologies Gmbh', '', 'info@hycube.com', '017670182103', 'Julius-Hatry-Str', '1', 'Mannheim', 'Baden-Württemberg', '68163', 'Germany', 1, 0, '2023-07-20 10:50:39');

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

--
-- Table structure for table `tbl_expence`
--

CREATE TABLE `tbl_expence` (
  `id` int(11) NOT NULL,
  `amount` double NOT NULL,
  `vendor_id` int(11) NOT NULL DEFAULT 0,
  `expense_type_id` int(11) NOT NULL DEFAULT 0,
  `invoice_id` int(11) NOT NULL DEFAULT 0,
  `type` varchar(100) NOT NULL,
  `payment_method` varchar(50) NOT NULL,
  `attachment` varchar(300) NOT NULL DEFAULT 'None',
  `desription` varchar(500) NOT NULL,
  `transaction_id` varchar(250) NOT NULL DEFAULT '0',
  `created_at` datetime NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- Dumping data for table `tbl_expence`
--

INSERT INTO `tbl_expence` (`id`, `amount`, `vendor_id`, `expense_type_id`, `invoice_id`, `type`, `payment_method`, `attachment`, `desription`, `transaction_id`, `created_at`) VALUES
(54, 547.99, 0, 12, 0, 'debit', 'online', 'None', 'Strauss Kleid', 'None', '2023-07-21 20:53:08');

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

--
-- Table structure for table `tbl_invoice`
--

CREATE TABLE `tbl_invoice` (
  `id` int(11) NOT NULL,
  `qoutation_id` int(11) DEFAULT NULL,
  `customer_id` int(11) NOT NULL,
  `fname` varchar(200) NOT NULL,
  `lname` varchar(200) DEFAULT NULL,
  `email` varchar(200) NOT NULL,
  `phone` varchar(200) NOT NULL,
  `address` varchar(500) NOT NULL,
  `total_amount` double NOT NULL,
  `date_of_work` date NOT NULL,
  `date_of_invoice` date NOT NULL,
  `image1` varchar(250) NOT NULL DEFAULT 'None',
  `image2` varchar(250) NOT NULL DEFAULT 'None',
  `image3` varchar(250) NOT NULL DEFAULT 'None',
  `note` varchar(250) NOT NULL DEFAULT 'None',
  `discount_percent` double NOT NULL,
  `taxamount` double NOT NULL DEFAULT 0 COMMENT 'in percentage',
  `status` varchar(200) NOT NULL DEFAULT 'Pending' COMMENT 'Pending, Accepted, Rejected',
  `created_at` datetime NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- Dumping data for table `tbl_invoice`
--

INSERT INTO `tbl_invoice` (`id`, `qoutation_id`, `customer_id`, `fname`, `lname`, `email`, `phone`, `address`, `total_amount`, `date_of_work`, `date_of_invoice`, `image1`, `image2`, `image3`, `note`, `discount_percent`, `taxamount`, `status`, `created_at`) VALUES
(1, NULL, 5, 'Technologies Gmbh', 'Hycube ', 'info@hycube.com', '017670182103', 'Julius-Hatry-Str 1,68163 Mannheim, Baden-Württemberg , Germany', 5050, '2023-07-03', '2023-07-07', 'None', 'None', 'None', 'Stefan Schäfer Pielenhofener str 4 92355 velburg', 0, 19, 'Pending', '2023-07-20 11:00:19'),
(2, NULL, 5, ' Technologies Gmbh', 'Hycube', 'info@hycube.com', '017670182103', 'Julius-Hatry-Str, 1, Mannheim, Baden-Württemberg, 68163, Germany', 2368, '2023-07-13', '2023-07-15', 'None', 'None', 'None', 'Reinhard Lindemann ,65439 Flörsheim am Main', 0, 19, 'Pending', '2023-07-20 22:53:21'),
(3, NULL, 5, ' Technologies Gmbh', 'Hycube ', 'info@hycube.com', '017670182103', 'Julius-Hatry-Str, 1, Mannheim, Baden-Württemberg, 68163, Germany', 3331, '2023-07-18', '2023-07-20', 'None', 'None', 'None', 'Kunde: Nathalie Kröffges, 79289 Horben', 0, 19, 'Pending', '2023-07-20 23:10:06');

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

--
-- Table structure for table `tbl_invoice_details`
--

CREATE TABLE `tbl_invoice_details` (
  `id` int(11) NOT NULL,
  `invoice_id` int(11) NOT NULL,
  `tittle` varchar(250) NOT NULL,
  `description` varchar(500) NOT NULL,
  `qty` int(11) NOT NULL,
  `unit_price` double NOT NULL,
  `created_at` datetime NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- Dumping data for table `tbl_invoice_details`
--

INSERT INTO `tbl_invoice_details` (`id`, `invoice_id`, `tittle`, `description`, `qty`, `unit_price`, `created_at`) VALUES
(196, 1, 'Mudolemontage', '375 Mudole Kabel bis zum Strom speicher', 40, 75, '2023-07-20 11:00:19'),
(197, 1, 'Gerüst Anbau und Abbau', 'Eigenen gerüst Anbau und Abbau', 1, 600, '2023-07-20 11:00:19'),
(198, 1, 'Fahrtkosten', 'Fahrtkosten innerhalb 300 km (4 mal gefahren)', 1, 500, '2023-07-20 11:00:19'),
(199, 1, 'Kabelinkl und Montage', 'Kabelkanal/Rohr/Alurohr,Kleinmaterial(SDübel,Silikon,Schellen,etc.)', 1, 450, '2023-07-20 11:00:19'),
(200, 1, 'DC Überspannungsschutz', 'DC Überspannungsschutz inkl. Der PE- kabe', 1, 100, '2023-07-20 11:00:19'),
(201, 1, 'Materiallieferung', 'Speicher und batterie lieferung', 1, 150, '2023-07-20 11:00:19'),
(202, 2, 'Mudole Montage', '415W, Mudole ', 11, 83, '2023-07-20 22:53:21'),
(203, 2, 'Fahrkosten ', 'Fahrkosten', 1, 200, '2023-07-20 22:53:21'),
(204, 2, 'Kabel', 'Kabelkanal,Kleinmaterial,Dübel,Silikon,Schelle,etc', 1, 300, '2023-07-20 22:53:21'),
(205, 2, 'DC', 'DC Übersapannungsschutz inkl. Der PE-Kabel', 1, 55, '2023-07-20 22:53:21'),
(206, 2, 'Material ', 'Ganze Material von Standtort bis zu Arbeitsplatz getragt,Speicher  und Batteri geliefert', 1, 400, '2023-07-20 22:53:21'),
(207, 3, 'Mudole Montage', '380W, Mudole ', 26, 76, '2023-07-20 23:10:06'),
(208, 3, 'Gerüst', 'Anbau und Abbau ', 1, 300, '2023-07-20 23:10:06'),
(209, 3, 'Fahrkostet', 'Fahrkostet ', 1, 300, '2023-07-20 23:10:06'),
(210, 3, 'Kabel', 'Kabelkanal,Kleinmaterial,Dübel,Silikon,Schelle,etc', 1, 300, '2023-07-20 23:10:06'),
(211, 3, 'DC', 'DC Überspannungsschutz inkl. Der PE-Kabel', 1, 55, '2023-07-20 23:10:06'),
(212, 3, 'Material ', 'Material von Andre Standtort bis zum Arbeitsplatz getragt ', 1, 400, '2023-07-20 23:10:06'),
(213, 1, 'Satellit', 'Satellit abgemacht', 1, 250, '2023-07-21 20:40:32'),
(214, 2, 'Satellit ', 'Satellit versetzt ', 1, 500, '2023-07-21 20:41:59');

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

--
-- Table structure for table `tbl_notes`
--

CREATE TABLE `tbl_notes` (
  `id` int(11) NOT NULL,
  `user_id` int(11) NOT NULL,
  `qoutation_id` int(11) NOT NULL,
  `invoice_id` int(11) NOT NULL DEFAULT 0,
  `image` varchar(250) NOT NULL DEFAULT 'None',
  `note` varchar(500) NOT NULL,
  `created_at` datetime NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- Dumping data for table `tbl_notes`
--

INSERT INTO `tbl_notes` (`id`, `user_id`, `qoutation_id`, `invoice_id`, `image`, `note`, `created_at`) VALUES
(100, 1, 0, 1, 'None', 'Invoice has been created.', '2023-07-20 11:00:19'),
(101, 1, 1, 0, 'None', 'Invoice details were updated.', '2023-07-20 11:01:46'),
(102, 1, 1, 0, 'None', 'Invoice details were updated.', '2023-07-20 11:02:15'),
(103, 1, 1, 0, 'None', 'Invoice details were updated.', '2023-07-20 11:03:17'),
(104, 1, 1, 0, 'None', 'Invoice details were updated.', '2023-07-20 22:39:05'),
(105, 1, 0, 2, 'None', 'Invoice has been created.', '2023-07-20 22:53:21'),
(106, 1, 0, 3, 'None', 'Invoice has been created.', '2023-07-20 23:10:06'),
(107, 1, 1, 0, 'None', 'Invoice details were updated.', '2023-07-21 20:38:17'),
(108, 1, 2, 0, 'None', 'Invoice details were updated.', '2023-07-21 20:39:15'),
(109, 1, 1, 0, 'None', 'New item was added in this invoice.', '2023-07-21 20:40:32'),
(110, 1, 2, 0, 'None', 'Item was update from this invoice.', '2023-07-21 20:41:55'),
(111, 1, 2, 0, 'None', 'New item was added in this invoice.', '2023-07-21 20:41:59'),
(112, 1, 1, 0, 'None', 'Invoice details were updated.', '2023-07-23 17:51:16');

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

--
-- Table structure for table `tbl_qoutation`
--

CREATE TABLE `tbl_qoutation` (
  `id` int(11) NOT NULL,
  `customer_id` int(11) NOT NULL,
  `fname` varchar(200) NOT NULL,
  `lname` varchar(200) DEFAULT NULL,
  `email` varchar(200) NOT NULL,
  `phone` varchar(200) NOT NULL,
  `address` varchar(500) NOT NULL,
  `image1` varchar(250) NOT NULL DEFAULT 'None',
  `image2` varchar(250) NOT NULL DEFAULT 'None',
  `image3` varchar(250) NOT NULL DEFAULT 'None',
  `note` varchar(250) NOT NULL DEFAULT 'None',
  `total_amount` double NOT NULL,
  `discount_percent` double NOT NULL,
  `taxamount` double NOT NULL DEFAULT 0 COMMENT 'in percentage',
  `status` varchar(200) NOT NULL DEFAULT 'Pending' COMMENT 'Pending, Accepted, Rejected',
  `created_at` datetime NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

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

--
-- Table structure for table `tbl_qoutation_details`
--

CREATE TABLE `tbl_qoutation_details` (
  `id` int(11) NOT NULL,
  `qoutation_id` int(11) NOT NULL,
  `tittle` varchar(250) NOT NULL,
  `description` varchar(500) NOT NULL,
  `qty` int(11) NOT NULL,
  `unit_price` double NOT NULL,
  `created_at` datetime NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

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

--
-- Table structure for table `tbl_types_of_expences`
--

CREATE TABLE `tbl_types_of_expences` (
  `id` int(11) NOT NULL,
  `name` varchar(250) NOT NULL,
  `status` varchar(50) NOT NULL DEFAULT '1',
  `created_at` datetime NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- Dumping data for table `tbl_types_of_expences`
--

INSERT INTO `tbl_types_of_expences` (`id`, `name`, `status`, `created_at`) VALUES
(7, 'Purchasing of panels', '1', '2023-06-24 14:54:46'),
(8, 'Purchase of Chemical', '1', '2023-06-24 14:54:53'),
(12, 'Bauhaus', '1', '2023-07-21 20:47:12');

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

--
-- Table structure for table `tbl_vendors`
--

CREATE TABLE `tbl_vendors` (
  `id` int(11) NOT NULL,
  `first_name` varchar(250) NOT NULL,
  `last_name` varchar(250) NOT NULL,
  `business_name` varchar(250) NOT NULL,
  `email` varchar(250) NOT NULL,
  `phone` varchar(250) NOT NULL,
  `address` varchar(250) NOT NULL,
  `address_1` varchar(250) NOT NULL,
  `city` varchar(250) NOT NULL,
  `state` varchar(250) NOT NULL,
  `zip_code` varchar(250) NOT NULL,
  `country` varchar(250) NOT NULL,
  `status` int(11) NOT NULL DEFAULT 1,
  `created_at` datetime NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci;

--
-- Dumping data for table `tbl_vendors`
--

INSERT INTO `tbl_vendors` (`id`, `first_name`, `last_name`, `business_name`, `email`, `phone`, `address`, `address_1`, `city`, `state`, `zip_code`, `country`, `status`, `created_at`) VALUES
(3, 'Bauhaus', 'Bruchsal', 'Bauhaus', 'service.NL872@bauhaus-ag.de', '0725197680', 'Kammerforststraße ', '19 ', '76646 ', 'Bruchsal', 'Germany', 'GermanyGermany', 1, '2023-07-22 10:25:53');

--
-- Indexes for dumped tables
--

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

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

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

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

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

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

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

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

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

--
-- AUTO_INCREMENT for dumped tables
--

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

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

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

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

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

--
-- AUTO_INCREMENT for table `tbl_qoutation`
--
ALTER TABLE `tbl_qoutation`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;

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

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

--
-- AUTO_INCREMENT for table `tbl_vendors`
--
ALTER TABLE `tbl_vendors`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;
COMMIT;

