CREATE DATABASE  IF NOT EXISTS `test_db` /*!40100 DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci */ /*!80016 DEFAULT ENCRYPTION='N' */;
USE `test_db`;
-- MySQL dump 10.13  Distrib 8.0.33, for Win64 (x86_64)
--
-- Host: localhost    Database: test_db
-- ------------------------------------------------------
-- Server version	8.0.33

/*!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 */;
/*!50503 SET NAMES utf8 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;

--
-- Table structure for table `invoice_template`
--

DROP TABLE IF EXISTS `invoice_template`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `invoice_template` (
  `id` int NOT NULL AUTO_INCREMENT,
  `name` varchar(50) NOT NULL,
  `type` varchar(50) NOT NULL,
  `user_id` int NOT NULL,
  `tax_id` json NOT NULL,
  `billables` json NOT NULL,
  `status` varchar(25) NOT NULL,
  `recurrence` varchar(25) NOT NULL,
  `createdAt` datetime NOT NULL,
  `updatedAt` datetime NOT NULL,
  `creatorId` int NOT NULL,
  `payee_id` int NOT NULL,
  `biller_id` int NOT NULL,
  `acc_id` int NOT NULL,
  `note` text,
  `terms` json DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `user_id` (`user_id`),
  KEY `payee_id` (`payee_id`),
  KEY `biller_id` (`biller_id`),
  KEY `acc_id` (`acc_id`),
  CONSTRAINT `invoice_template_ibfk_521` FOREIGN KEY (`user_id`) REFERENCES `users` (`id`),
  CONSTRAINT `invoice_template_ibfk_522` FOREIGN KEY (`payee_id`) REFERENCES `p_entity` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `invoice_template_ibfk_523` FOREIGN KEY (`biller_id`) REFERENCES `entity` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `invoice_template_ibfk_524` FOREIGN KEY (`acc_id`) REFERENCES `bank_accounts` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `invoice_template`
--

LOCK TABLES `invoice_template` WRITE;
/*!40000 ALTER TABLE `invoice_template` DISABLE KEYS */;
INSERT INTO `invoice_template` VALUES (3,'Web Dev + 27k Mock audit','One-Off',1,'[{\"id\": 1, \"name\": \"SGST\", \"perc\": \"9\"}, {\"id\": 2, \"name\": \"CGST\", \"perc\": \"9\"}]','[{\"id\": 6, \"hsn\": null, \"cost\": \"25000\", \"name\": \"ISO 27001 Mock Audit\", \"taxes\": [{\"id\": 1, \"name\": \"SGST\", \"perc\": \"9\"}, {\"id\": 2, \"name\": \"CGST\", \"perc\": \"9\"}], \"currency\": \"INR\"}, {\"id\": 4, \"hsn\": \"9566\", \"cost\": \"10000\", \"name\": \"Web Development\", \"taxes\": [{\"id\": 2, \"name\": \"CGST\", \"perc\": \"9\"}, {\"id\": 1, \"name\": \"SGST\", \"perc\": \"9\"}], \"currency\": \"INR\"}]','1','None','2025-03-27 12:56:02','2025-05-03 10:53:48',1,1,3,2,NULL,'{\"payment\": [\"50% advance.\"], \"delivery\": [\"Website delivery will be 45 Days after provisioning of complete and accurate data from client.\", \"Every time a detail is changed, 7 business days will be added to delivery time.\"]}'),(4,'Annual WebPortal Maintenance Contract','Recurring',1,'[{\"id\": 2, \"name\": \"CGST\", \"perc\": \"9\"}, {\"id\": 1, \"name\": \"SGST\", \"perc\": \"9\"}]','[{\"id\": 7, \"hsn\": \"3455\", \"cost\": \"50000\", \"name\": \"Web Application\", \"taxes\": [{\"id\": 1, \"name\": \"SGST\", \"perc\": \"9\"}, {\"id\": 2, \"name\": \"CGST\", \"perc\": \"9\"}], \"currency\": \"INR\"}]','1','Yearly','2025-04-05 11:28:30','2025-05-03 10:53:32',1,1,3,1,'This is specially for Provik Industries, the terms may vary for other clients.','{\"payment\": [\"100% in advance\", \"Downtime or SLA breaches to be negated from next contract renewal.\"], \"delivery\": [\"The maintenance shall be as per schedule\", \"Special maintenance shall be notified at least 3 hours prior to performance\", \"Major changes requiring code is chargeable as per effort load.\"]}'),(5,'sdfsdf','One-Off',1,'[{\"id\": 4, \"name\": \"VAT\", \"perc\": \"5\"}, {\"id\": 3, \"name\": \"Universal Credit Transaction Tax\", \"perc\": \"2\"}]','[{\"id\": 5, \"hsn\": \"4563456\", \"cost\": \"500\", \"name\": \"Graphic Design\", \"taxes\": [{\"id\": 2, \"name\": \"CGST\", \"perc\": \"9\"}, {\"id\": 1, \"name\": \"SGST\", \"perc\": \"9\"}], \"currency\": \"GBP\"}]','1','None','2025-04-17 07:50:09','2025-05-03 10:53:24',1,1,3,1,'sdfgsdfg','{\"payment\": [\"34terfg\"], \"delivery\": [\"adsfg asdfg \"]}'),(6,'Test Template','One-Off',1,'[{\"id\": 1, \"name\": \"SGST\", \"perc\": \"9\"}, {\"id\": 2, \"name\": \"CGST\", \"perc\": \"9\"}]','[{\"id\": 4, \"hsn\": \"9566\", \"cost\": \"10000\", \"name\": \"Web Development\", \"taxes\": [{\"id\": 2, \"name\": \"CGST\", \"perc\": \"9\"}, {\"id\": 1, \"name\": \"SGST\", \"perc\": \"9\"}], \"currency\": \"INR\"}, {\"id\": 7, \"hsn\": \"3455\", \"cost\": \"50000\", \"name\": \"Web Application\", \"taxes\": [{\"id\": 1, \"name\": \"SGST\", \"perc\": \"9\"}, {\"id\": 2, \"name\": \"CGST\", \"perc\": \"9\"}], \"currency\": \"INR\"}]','1','None','2025-04-26 06:00:19','2025-05-03 10:53:17',1,1,3,2,'Test note','{\"payment\": [\"Test payment\"], \"delivery\": [\"Test terms\"]}');
/*!40000 ALTER TABLE `invoice_template` ENABLE KEYS */;
UNLOCK TABLES;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;

/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!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 */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;

-- Dump completed on 2025-05-12 13:20:20
