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 `invoices`
--

DROP TABLE IF EXISTS `invoices`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `invoices` (
  `id` int NOT NULL AUTO_INCREMENT,
  `creatorId` int NOT NULL,
  `template_id` int NOT NULL,
  `biller_id` int NOT NULL,
  `createdAt` datetime NOT NULL,
  `updatedAt` datetime NOT NULL,
  `user_id` int NOT NULL,
  `name` varchar(255) NOT NULL,
  `type` varchar(255) NOT NULL,
  `status` int NOT NULL,
  `recurrence` varchar(255) NOT NULL,
  `note` text,
  `biller_name` varchar(255) NOT NULL,
  `biller_email` varchar(255) DEFAULT NULL,
  `biller_contact_no` varchar(255) DEFAULT NULL,
  `biller_address` varchar(255) DEFAULT NULL,
  `biller_gst` varchar(255) DEFAULT NULL,
  `biller_pan` varchar(255) DEFAULT NULL,
  `biller_tax_details` json DEFAULT NULL,
  `payee_id` int NOT NULL,
  `payee_name` varchar(255) NOT NULL,
  `payee_email` varchar(255) DEFAULT NULL,
  `payee_contact_no` varchar(255) DEFAULT NULL,
  `payee_address` varchar(255) DEFAULT NULL,
  `payee_gst` varchar(255) DEFAULT NULL,
  `payee_pan` varchar(255) DEFAULT NULL,
  `payee_tax_details` json DEFAULT NULL,
  `acc_id` int NOT NULL,
  `bank_id` int NOT NULL,
  `bank_name` varchar(255) NOT NULL,
  `bank_branch_id` int NOT NULL,
  `bank_branch_name` varchar(255) NOT NULL,
  `bank_account_id` int NOT NULL,
  `bank_account_name` varchar(255) NOT NULL,
  `bank_account_no` varchar(255) NOT NULL,
  `tax_id` json DEFAULT NULL,
  `billables` json DEFAULT NULL,
  `terms` json DEFAULT NULL,
  `invoice_no` varchar(25) DEFAULT NULL,
  `change_id` int DEFAULT NULL,
  `bank_branch_ifsc` varchar(255) DEFAULT NULL,
  PRIMARY KEY (`id`),
  KEY `template_id` (`template_id`),
  KEY `biller_id` (`biller_id`),
  KEY `change_id` (`change_id`),
  CONSTRAINT `invoices_ibfk_43` FOREIGN KEY (`template_id`) REFERENCES `invoice_template` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `invoices_ibfk_44` FOREIGN KEY (`biller_id`) REFERENCES `entity` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `invoices_ibfk_45` FOREIGN KEY (`change_id`) REFERENCES `change_logs` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=28 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

--
-- Dumping data for table `invoices`
--

LOCK TABLES `invoices` WRITE;
/*!40000 ALTER TABLE `invoices` DISABLE KEYS */;
INSERT INTO `invoices` VALUES (27,1,3,3,'2025-03-27 12:56:02','2025-05-11 15:38:19',1,'Web Dev + 27k Mock audit','One-Off',1,'None',NULL,'Tech Solutions Ltd.','info@techsol.com','+1-555-123-4567','123 Business Park, Silicon Valley, CA, USA','27ABCDE1234F1Z5','ABCDE1234F','\"No other tax details\"',1,'Provik Industries','sdf@sdf.com','98678966789','Ghatkopar','2778967sdfsd1ZE','78967sdfsd','\"none\"',2,10,'HDFC Bank',3,'Panchpakhadi, Thane(w)',2,'Aaradhya Chaudhari','3213232198421','[{\"id\": 1, \"name\": \"SGST\", \"perc\": \"9\"}, {\"id\": 2, \"name\": \"CGST\", \"perc\": \"9\"}]','[{\"id\": 6, \"hsn\": null, \"qty\": 1, \"cost\": \"25000\", \"name\": \"ISO 27001 Mock Audit\", \"taxes\": [{\"id\": 1, \"name\": \"SGST\", \"perc\": \"9\"}, {\"id\": 2, \"name\": \"CGST\", \"perc\": \"9\"}], \"currency\": \"INR\", \"subTotal\": 25000}, {\"id\": 4, \"hsn\": \"9566\", \"qty\": 1, \"cost\": \"10000\", \"name\": \"Web Development\", \"taxes\": [{\"id\": 2, \"name\": \"CGST\", \"perc\": \"9\"}, {\"id\": 1, \"name\": \"SGST\", \"perc\": \"9\"}], \"currency\": \"INR\", \"subTotal\": 10000}]','{\"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.\"]}','CDS-INV-13',NULL,'H908766');
/*!40000 ALTER TABLE `invoices` 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:22
