From a2848fad09dc8d35f4ae1aa355cfe324b9cc6c8b Mon Sep 17 00:00:00 2001 From: "johnny@pittpc.com" Date: Fri, 15 Jan 2021 15:07:27 -0500 Subject: [PATCH] Added seperate tax section and added the ability add taxes to invoice this update requires a new table called taxes see the db.sql file for the structure More to come --- add_tax_modal.php | 28 ++++++++++++++ db.sql | 29 +++++++++++++-- edit_tax_modal.php | 30 +++++++++++++++ get_settings.php | 1 - invoice.php | 20 ++++++++-- post.php | 52 ++++++++++++++++++++++++++ side_nav.php | 6 +++ taxes.php | 92 ++++++++++++++++++++++++++++++++++++++++++++++ 8 files changed, 250 insertions(+), 8 deletions(-) create mode 100644 add_tax_modal.php create mode 100644 edit_tax_modal.php create mode 100644 taxes.php diff --git a/add_tax_modal.php b/add_tax_modal.php new file mode 100644 index 00000000..2939742b --- /dev/null +++ b/add_tax_modal.php @@ -0,0 +1,28 @@ + \ No newline at end of file diff --git a/db.sql b/db.sql index ad6714ff..d84df353 100644 --- a/db.sql +++ b/db.sql @@ -1,8 +1,8 @@ --- MariaDB dump 10.17 Distrib 10.4.12-MariaDB, for debian-linux-gnu (x86_64) +-- MariaDB dump 10.18 Distrib 10.5.8-MariaDB, for debian-linux-gnu (x86_64) -- -- Host: localhost Database: admin_crm -- ------------------------------------------------------ --- Server version 10.4.12-MariaDB-1:10.4.12+maria~bionic +-- Server version 10.5.8-MariaDB-1:10.5.8+maria~focal /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; @@ -134,11 +134,11 @@ CREATE TABLE `clients` ( `client_id` int(11) NOT NULL AUTO_INCREMENT, `client_name` varchar(200) NOT NULL, `client_type` varchar(200) DEFAULT NULL, - `client_country` varchar(200) DEFAULT NULL, `client_address` varchar(200) DEFAULT NULL, `client_city` varchar(200) DEFAULT NULL, `client_state` varchar(200) DEFAULT NULL, `client_zip` varchar(200) DEFAULT NULL, + `client_country` varchar(200) DEFAULT NULL, `client_contact` varchar(200) DEFAULT NULL, `client_phone` varchar(200) DEFAULT NULL, `client_extension` varchar(200) DEFAULT NULL, @@ -191,6 +191,7 @@ CREATE TABLE `contacts` ( `contact_billing` tinyint(1) DEFAULT NULL, `contact_photo` varchar(200) DEFAULT NULL, `contact_notes` text DEFAULT NULL, + `contact_inactive` tinyint(1) NOT NULL DEFAULT 0, `contact_created_at` datetime NOT NULL, `contact_updated_at` datetime DEFAULT NULL, `location_id` int(11) DEFAULT NULL, @@ -261,6 +262,8 @@ CREATE TABLE `expenses` ( `expense_created_at` datetime NOT NULL, `expense_updated_at` datetime DEFAULT NULL, `vendor_id` int(11) DEFAULT NULL, + `client_id` int(11) DEFAULT NULL, + `asset_id` int(11) DEFAULT NULL, `category_id` int(11) DEFAULT NULL, `account_id` int(11) DEFAULT NULL, `company_id` int(11) NOT NULL, @@ -698,6 +701,24 @@ CREATE TABLE `software` ( ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; /*!40101 SET character_set_client = @saved_cs_client */; +-- +-- Table structure for table `taxes` +-- + +DROP TABLE IF EXISTS `taxes`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `taxes` ( + `tax_id` int(11) NOT NULL AUTO_INCREMENT, + `tax_name` varchar(200) NOT NULL, + `tax_percent` float NOT NULL, + `tax_created_at` datetime NOT NULL, + `tax_updated_at` datetime DEFAULT NULL, + `company_id` int(11) NOT NULL, + PRIMARY KEY (`tax_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; + -- -- Table structure for table `ticket_updates` -- @@ -861,4 +882,4 @@ CREATE TABLE `vendors` ( /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; --- Dump completed on 2020-03-30 20:01:15 +-- Dump completed on 2021-01-15 15:05:00 diff --git a/edit_tax_modal.php b/edit_tax_modal.php new file mode 100644 index 00000000..151d47a3 --- /dev/null +++ b/edit_tax_modal.php @@ -0,0 +1,30 @@ + \ No newline at end of file diff --git a/get_settings.php b/get_settings.php index 855c86af..34a00d47 100644 --- a/get_settings.php +++ b/get_settings.php @@ -161,7 +161,6 @@ $timezones_array = array( $category_types_array = array( 'Expense', 'Income', - 'Tax', 'Payment Method' ); diff --git a/invoice.php b/invoice.php index db58d27c..0076b6d3 100644 --- a/invoice.php +++ b/invoice.php @@ -260,10 +260,24 @@ if(isset($_GET['invoice_id'])){ - + + + + + + + +
+
+ + "> + + + + + + + + + + + + + + + + +

No Records Here

"; + } + ?> + + +
NamePercentAction
+ + +
+ +
+
+ + + + +