【发布时间】:2012-03-09 11:30:40
【问题描述】:
我正在开发一个学校管理软件,其中包括学生计费模块,即向学生收取费用。
费用按月收取(一年 12 次),总月费是各种费用的组合,按班级和月份固定。其中一些费用包括学费、巴士费、印刷费或其他费用。从该日期开始,每月还会收取固定金额的滞纳金,该金额可能因月而异。巴士费用根据特定学生的巴士类别收取。 也有部分付款的规定。
我目前的做法是这样的:
存储费用设置的主表,其中包括月份和班级以及费用设置。
feeMaster
fid -> Primary key
month_year -> Stores Month Year
stu_class -> Class of Student
tuition_fee -> Tuition fee for that class
tuition_fee_percent -> Percentage of Tuition fee to take, defaults to 100%
bus_fee_percent -> Percentage of bus fee
late_fee_start -> Day of month from which to charge late fee
late_fee -> fixed late fee on per month basis
printing_charge -> Printing charge if any
other_fee -> Other fee if any
other_fee_reference -> Other fee reference
每次学生来支付他/她的费用时,都会进行计算并在系统中进行交易。事务的详细信息存储在两个表中。
事务主表用于存储事务
transMaster
tid -> Primary key
purpose -> purpose of transaction, monthly fee
amount -> amount of transaction
type -> transaction mode / cash / cheque / dd
created -> date
这个事务的详细信息存储在另一个表中
studentFeeDetails
sfid -> unique id
tid -> transaction id from transMaster table
fid -> fee id from fee settings table feeMaster
tuition_fee -> calculated tuition_fee
bus_fee -> calculated bus_fee
printing_charge -> calculated printing_charge
other_fee -> calculated other_fee
late_fee -> calculated late_fee
total_fee -> total fee calculated
discount -> discount if given any
amount_payable -> net amount payable
amount_paid -> paid amount
balance -> balance - if paid amount is greater or lesser than the original one,
it is stored here
status -> status - true if partial fee else false
created -> date of creation
这是模块的当前架构。没有涉及会计实践,因此给我们的会计部门带来了很多问题。
- 为了报告一个月的总应付费用,系统每次对所有学生运行计算算法并得出数字。
- 要查找某个类别的待处理费用,系统首先会再次检查该类别的应收费用,并删除在
studentFeeDetails表中找到的条目以生成待处理报告。 - 在这个系统下没有适当的费用头分离。
现在需要将当前系统转换为可以跟踪预付款和余额的适当会计系统。
我正在考虑一个系统,其中每个月都有一个过帐流程从每个学生的帐户中扣除该月到期的费用,并且在每个滞纳金开始日期,另一个流程将滞纳金从学生的帐户中扣除,如果该费用仍未处理。
这种方法可以检查应收、待处理和已收费用。
请帮助,如果方法是正确的,以及如何使用它。我被数据库架构部分及其实现所困扰。
【问题讨论】:
-
复杂的话题,我觉得这对 SO 来说太宽泛了。尽管如此,有一件事对我来说似乎很明显,我会规范化
feeMaster表。您的列otherFee已经表明了这一点,我会创建一个类似line_item的表,引用某个fee_type。 -
我曾经处理过这类问题。我愿意再次与您共享数据库。
标签: database-design architecture database-schema billing accounting