Lines 2621-2626
CREATE TABLE `cash_registers` (
Link Here
|
2621 |
CONSTRAINT cash_registers_branch FOREIGN KEY (branch) REFERENCES branches (branchcode) ON UPDATE CASCADE ON DELETE CASCADE |
2621 |
CONSTRAINT cash_registers_branch FOREIGN KEY (branch) REFERENCES branches (branchcode) ON UPDATE CASCADE ON DELETE CASCADE |
2622 |
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_unicode_ci; |
2622 |
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_unicode_ci; |
2623 |
|
2623 |
|
|
|
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(64) NOT NULL, |
2631 |
`description` varchar(200) DEFAULT NULL, |
2632 |
`can_be_added_manually` tinyint(4) NOT NULL DEFAULT 1, |
2633 |
`default_amount` decimal(28,6) DEFAULT NULL, |
2634 |
`is_system` tinyint(1) NOT NULL DEFAULT 0, |
2635 |
PRIMARY KEY (`code`) |
2636 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; |
2637 |
|
2638 |
-- |
2639 |
-- Table structure for table `ac_debit_types_branches` |
2640 |
-- |
2641 |
|
2642 |
DROP TABLE IF EXISTS `ac_debit_types_branches`; |
2643 |
CREATE TABLE `ac_debit_types_branches` ( |
2644 |
`debit_type_code` VARCHAR(64), |
2645 |
`branchcode` VARCHAR(10), |
2646 |
FOREIGN KEY (`debit_type_code`) REFERENCES `account_debit_types` (`code`) ON DELETE CASCADE, |
2647 |
FOREIGN KEY (`branchcode`) REFERENCES `branches` (`branchcode`) ON DELETE CASCADE |
2648 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; |
2649 |
|
2624 |
-- |
2650 |
-- |
2625 |
-- Table structure for table `accountlines` |
2651 |
-- Table structure for table `accountlines` |
2626 |
-- |
2652 |
-- |
Lines 2635-2640
CREATE TABLE `accountlines` (
Link Here
|
2635 |
`amount` decimal(28,6) default NULL, |
2661 |
`amount` decimal(28,6) default NULL, |
2636 |
`description` LONGTEXT, |
2662 |
`description` LONGTEXT, |
2637 |
`accounttype` varchar(80) default NULL, |
2663 |
`accounttype` varchar(80) default NULL, |
|
|
2664 |
`debit_type` varchar(64) default NULL, |
2638 |
`status` varchar(16) default NULL, |
2665 |
`status` varchar(16) default NULL, |
2639 |
`payment_type` varchar(80) default NULL, -- optional authorised value PAYMENT_TYPE |
2666 |
`payment_type` varchar(80) default NULL, -- optional authorised value PAYMENT_TYPE |
2640 |
`amountoutstanding` decimal(28,6) default NULL, |
2667 |
`amountoutstanding` decimal(28,6) default NULL, |
Lines 2647-2652
CREATE TABLE `accountlines` (
Link Here
|
2647 |
PRIMARY KEY (`accountlines_id`), |
2674 |
PRIMARY KEY (`accountlines_id`), |
2648 |
KEY `acctsborridx` (`borrowernumber`), |
2675 |
KEY `acctsborridx` (`borrowernumber`), |
2649 |
KEY `timeidx` (`timestamp`), |
2676 |
KEY `timeidx` (`timestamp`), |
|
|
2677 |
KEY `debit_type` (`debit_type`), |
2650 |
KEY `itemnumber` (`itemnumber`), |
2678 |
KEY `itemnumber` (`itemnumber`), |
2651 |
KEY `branchcode` (`branchcode`), |
2679 |
KEY `branchcode` (`branchcode`), |
2652 |
KEY `manager_id` (`manager_id`), |
2680 |
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, |
2682 |
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, |
2683 |
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, |
2684 |
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 |
2685 |
CONSTRAINT `accountlines_ibfk_registers` FOREIGN KEY (`register_id`) REFERENCES `cash_registers` (`id`) ON DELETE SET NULL ON UPDATE CASCADE, |
|
|
2686 |
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; |
2687 |
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; |
2659 |
|
2688 |
|
2660 |
-- |
2689 |
-- |