Update model to support financial transactions #367
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.
This commit is contained in:
parent
dc94e98138
commit
e7657b987f
21 changed files with 156 additions and 34 deletions
|
|
@ -5,6 +5,8 @@
|
|||
= simple_form_for @financial_transaction, :url => finance_ordergroup_transactions_path(@ordergroup),
|
||||
:validate => true do |f|
|
||||
= f.hidden_field :ordergroup_id
|
||||
- if FinancialTransactionType.has_multiple_types
|
||||
= f.association :financial_transaction_type, :as => :radio_buttons
|
||||
= f.input :amount
|
||||
= f.input :note, :as => :text
|
||||
.form-actions
|
||||
|
|
|
|||
|
|
@ -34,6 +34,10 @@
|
|||
.well.well-small= t('.sidebar')
|
||||
|
||||
= form_tag finance_create_transaction_collection_path do
|
||||
- if FinancialTransactionType.has_multiple_types
|
||||
%p
|
||||
%b= heading_helper FinancialTransaction, :financial_transaction_type
|
||||
= select_tag :type, options_for_select(FinancialTransactionType.order(:name).map { |t| [ t.name, t.id ] })
|
||||
%p
|
||||
%b= heading_helper FinancialTransaction, :note
|
||||
= text_field_tag :note, params[:note], class: 'input-xlarge', required: 'required'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue