MMCT TEAM
Server IP : 217.21.85.138  /  Your IP : 216.73.216.103
Web Server : LiteSpeed
System : Linux in-mum-web906.main-hosting.eu 4.18.0-553.37.1.lve.el8.x86_64 #1 SMP Mon Feb 10 22:45:17 UTC 2025 x86_64
User : u915722082 ( 915722082)
PHP Version : 7.4.33
Disable Function : system, exec, shell_exec, passthru, mysql_list_dbs, ini_alter, dl, symlink, link, chgrp, leak, popen, apache_child_terminate, virtual, mb_send_mail
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : OFF  |  Python : OFF
Directory (0755) :  /home/u915722082/.nvm/../public_html/at/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : /home/u915722082/.nvm/../public_html/at/year-end-closing-query.sql

insert into `2025_2026_tbl_stock`  select * from `2024_2025_tbl_stock`

insert into 2025_2024_tbl_transactions(`tid`, `tdate`, `pid`, `dr`, `cr`, `rate`, `total`, `ttype`, `ref_id`, `stock_id`) select tid,'2025-04-01',pid,dr,cr,rate,((dr-cr)*rate),'PURCHASE',0,0 from 2024_2025_tbl_stock;


/*Create Following tables */

CREATE TABLE `2024_2025_tbl_logs` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `uid` int(11) NOT NULL,
  `log_date` datetime NOT NULL, 
  `log_type` varchar(150) COLLATE utf8mb4_unicode_ci NOT NULL,
  `log_mode` varchar(150) COLLATE utf8mb4_unicode_ci NOT NULL,
  `log_text` varchar(150) COLLATE utf8mb4_unicode_ci NOT NULL,
  `dr` varchar(150) COLLATE utf8mb4_unicode_ci NOT NULL,
  `cr` varchar(150) COLLATE utf8mb4_unicode_ci NOT NULL,
  `rate` varchar(150) COLLATE utf8mb4_unicode_ci NOT NULL,
  PRIMARY KEY (`id`)
);


CREATE TABLE `2024_2025_tbl_sales` (
  `sid` int(11) NOT NULL AUTO_INCREMENT,
  `sdate` date NOT NULL,
  `sno` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
  PRIMARY KEY (`sid`)
);


CREATE TABLE  `2024_2025_tbl_stock` (
  `sid` int(11) NOT NULL AUTO_INCREMENT,
  `pid` int(11) NOT NULL,
  `rate` double(10,2) NOT NULL,
  `dr` float NOT NULL,
  `cr` double NOT NULL,
  `tid` int(11) NOT NULL,
  PRIMARY KEY (`sid`)
);


CREATE TABLE  `2024_2025_tbl_transactions` (
  `tid` int(11) NOT NULL AUTO_INCREMENT,
  `tdate` date NOT NULL,
  `pid` int(11) NOT NULL,
  `dr` double(10,2) NOT NULL,
  `cr` double(10,2) NOT NULL,
  `rate` double(10,2) NOT NULL,
  `total` double(10,2) NOT NULL,
  `ttype` varchar(150) COLLATE utf8mb4_unicode_ci NOT NULL,
  `ref_id` int(11) NOT NULL,
  `stock_id` int(11) NOT NULL DEFAULT 0,
  PRIMARY KEY (`tid`)
);

MMCT - 2023