e7657b987f
This change introduces two new data types to group the financial transactions. Now every transaction has a "type", which itself belongs to a "class". Types should be used add structured information to an transaction, instead of writing it into the notice textfield. E.g. this could be used to have different types depending on the source of money (cash vs. bank transfer). Classes are shown as different columns in the tables and will be uses to group transactions of specific types. They should be used if not the whole amount of ordergroup should be used to order food. E.g. if there is a deposit or membership fee, which is independent of the normal credit. This will allow us to implement additional features based on classes in the future. E.g. the sum of transactions in the "membership fee" class must be positive to allow food orders or show a big warning if it is bellow a certain value.
29 lines
931 B
Ruby
29 lines
931 B
Ruby
# Create nessecary data to start with a fresh installation
|
|
|
|
# Create working group with full rights
|
|
administrators = Workgroup.create(
|
|
:name => "Administrators",
|
|
:description => "System administrators.",
|
|
:role_admin => true,
|
|
:role_finance => true,
|
|
:role_article_meta => true,
|
|
:role_suppliers => true,
|
|
:role_orders => true
|
|
)
|
|
|
|
# Create admin user
|
|
User.create(
|
|
:nick => "admin",
|
|
:first_name => "Anton",
|
|
:last_name => "Administrator",
|
|
:email => "admin@foo.test",
|
|
:password => "secret",
|
|
:groups => [administrators]
|
|
)
|
|
|
|
# First entry for financial transaction types
|
|
financial_transaction_class = FinancialTransactionClass.create(:name => "Other")
|
|
FinancialTransactionType.create(:name => "Foodcoop", :financial_transaction_class_id => financial_transaction_class.id)
|
|
|
|
# First entry for article categories
|
|
ArticleCategory.create(:name => "Other", :description => "other, misc, unknown")
|