Lines 2622-2627
CREATE TABLE `cash_registers` (
Link Here
|
2622 |
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_unicode_ci; |
2622 |
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_unicode_ci; |
2623 |
|
2623 |
|
2624 |
-- |
2624 |
-- |
|
|
2625 |
-- Table structure for table `account_debit_types` |
2626 |
-- |
2627 |
|
2628 |
DROP TABLE IF EXISTS `account_debit_types`; |
2629 |
CREATE TABLE `account_debit_types` ( |
2630 |
`code` varchar(16) NOT NULL, |
2631 |
`default_amount` decimal(28,6) DEFAULT NULL, |
2632 |
`description` varchar(200) DEFAULT NULL, |
2633 |
`can_be_added_manually` tinyint(4) NOT NULL DEFAULT '1', |
2634 |
PRIMARY KEY (`code`) |
2635 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; |
2636 |
|
2637 |
-- |
2625 |
-- Table structure for table `accountlines` |
2638 |
-- Table structure for table `accountlines` |
2626 |
-- |
2639 |
-- |
2627 |
|
2640 |
|
Lines 2635-2640
CREATE TABLE `accountlines` (
Link Here
|
2635 |
`amount` decimal(28,6) default NULL, |
2648 |
`amount` decimal(28,6) default NULL, |
2636 |
`description` LONGTEXT, |
2649 |
`description` LONGTEXT, |
2637 |
`accounttype` varchar(80) default NULL, |
2650 |
`accounttype` varchar(80) default NULL, |
|
|
2651 |
`debit_type` varchar(16) default NULL, |
2638 |
`status` varchar(16) default NULL, |
2652 |
`status` varchar(16) default NULL, |
2639 |
`payment_type` varchar(80) default NULL, -- optional authorised value PAYMENT_TYPE |
2653 |
`payment_type` varchar(80) default NULL, -- optional authorised value PAYMENT_TYPE |
2640 |
`amountoutstanding` decimal(28,6) default NULL, |
2654 |
`amountoutstanding` decimal(28,6) default NULL, |
Lines 2647-2652
CREATE TABLE `accountlines` (
Link Here
|
2647 |
PRIMARY KEY (`accountlines_id`), |
2661 |
PRIMARY KEY (`accountlines_id`), |
2648 |
KEY `acctsborridx` (`borrowernumber`), |
2662 |
KEY `acctsborridx` (`borrowernumber`), |
2649 |
KEY `timeidx` (`timestamp`), |
2663 |
KEY `timeidx` (`timestamp`), |
|
|
2664 |
KEY `debit_type` (`debit_type`), |
2650 |
KEY `itemnumber` (`itemnumber`), |
2665 |
KEY `itemnumber` (`itemnumber`), |
2651 |
KEY `branchcode` (`branchcode`), |
2666 |
KEY `branchcode` (`branchcode`), |
2652 |
KEY `manager_id` (`manager_id`), |
2667 |
KEY `manager_id` (`manager_id`), |
Lines 2654-2660
CREATE TABLE `accountlines` (
Link Here
|
2654 |
CONSTRAINT `accountlines_ibfk_items` FOREIGN KEY (`itemnumber`) REFERENCES `items` (`itemnumber`) ON DELETE SET NULL ON UPDATE CASCADE, |
2669 |
CONSTRAINT `accountlines_ibfk_items` FOREIGN KEY (`itemnumber`) REFERENCES `items` (`itemnumber`) ON DELETE SET NULL ON UPDATE CASCADE, |
2655 |
CONSTRAINT `accountlines_ibfk_borrowers_2` FOREIGN KEY (`manager_id`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE SET NULL ON UPDATE CASCADE, |
2670 |
CONSTRAINT `accountlines_ibfk_borrowers_2` FOREIGN KEY (`manager_id`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE SET NULL ON UPDATE CASCADE, |
2656 |
CONSTRAINT `accountlines_ibfk_branches` FOREIGN KEY (`branchcode`) REFERENCES `branches` (`branchcode`) ON DELETE SET NULL ON UPDATE CASCADE, |
2671 |
CONSTRAINT `accountlines_ibfk_branches` FOREIGN KEY (`branchcode`) REFERENCES `branches` (`branchcode`) ON DELETE SET NULL ON UPDATE CASCADE, |
2657 |
CONSTRAINT `accountlines_ibfk_registers` FOREIGN KEY (`register_id`) REFERENCES `cash_registers` (`id`) ON DELETE SET NULL ON UPDATE CASCADE |
2672 |
CONSTRAINT `accountlines_ibfk_registers` FOREIGN KEY (`register_id`) REFERENCES `cash_registers` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, |
|
|
2673 |
CONSTRAINT `accountlines_ibfk_debit_type` FOREIGN KEY (`debit_type`) REFERENCES `account_debit_types` (`code`) ON DELETE SET NULL ON UPDATE CASCADE |
2658 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; |
2674 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; |
2659 |
|
2675 |
|
2660 |
-- |
2676 |
-- |