DROP TABLE IF EXISTS `bill`;
CREATE TABLE `bill` (
                        `id` int NOT NULL AUTO_INCREMENT,
                        `user_id` int NOT NULL,
                        `customer_id` int NOT NULL,
                        `bill_name` varchar(150) NOT NULL,
                        `safe_prefix` varchar(50) NOT NULL COMMENT 'cek,senet',
                        `bill_date` date DEFAULT NULL,
                        `insert_date` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
                        `price` decimal(15,6) NOT NULL,
                        `currency_id` int NOT NULL,
                        `serial_no` varchar(70) NOT NULL,
                        `bank_id` int NOT NULL,
                        `note` text NOT NULL,
                        `status` tinyint(1) NOT NULL DEFAULT '1',
                        `half_pay` tinyint(1) NOT NULL DEFAULT '0',
                        `pay_price` decimal(15,4) NOT NULL,
                        PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb3;