Initial commit of foodsoft 2
This commit is contained in:
commit
5b9a7e05df
657 changed files with 70444 additions and 0 deletions
21
app/views/finance/_articleResult.haml
Normal file
21
app/views/finance/_articleResult.haml
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
%td= @article.name
|
||||
%td= link_to_function image_tag("arrow_down_red.png", :size => "16x16", :border => 0), "Element.toggle('group_order_article_results_#{@article.id}')"
|
||||
%td= @article.order_number
|
||||
%td= @article.units_to_order
|
||||
%td= @article.unit_quantity.to_s + ' * ' + @article.unit.to_s
|
||||
%td= number_to_currency(@article.net_price)
|
||||
%td= number_to_currency(@article.gross_price)
|
||||
%td= @article.tax
|
||||
%td= @article.deposit
|
||||
%td
|
||||
= link_to_remote image_tag('b_edit.png', :size => "16x16", :border => 0, :alt => 'Artikel ändern'), |
|
||||
:url => {:action => 'editArticleResult', :id => @article}, |
|
||||
:before => "Element.show('loader')", |
|
||||
:success => "Element.hide('loader')" |
|
||||
%td
|
||||
= link_to_remote image_tag('b_drop.png', :size => "16x16", :border => 0, :alt => 'Artikel löschen'), |
|
||||
:url => {:action => 'destroyArticleResult', :id => @article}, |
|
||||
:confirm => 'Bist du sicher?', |
|
||||
:method => 'post', |
|
||||
:before => "Element.show('loader')", |
|
||||
:success => "Element.hide('loader')" |
|
||||
29
app/views/finance/_articleResultForm.haml
Normal file
29
app/views/finance/_articleResultForm.haml
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
= error_messages_for 'article'
|
||||
%p
|
||||
%b Notiz:
|
||||
= @form.text_field 'note', :size => 30
|
||||
%table
|
||||
%tr
|
||||
%th Name
|
||||
%th Nr.
|
||||
%th
|
||||
%abbr{:title=>"Anzahl gelieferter Gebinde"} Menge
|
||||
%th GebGr
|
||||
%th Einheit
|
||||
%th netto
|
||||
%th MwSt.
|
||||
%th Pfand
|
||||
%tr
|
||||
%td= @form.text_field 'name', :size => 20
|
||||
%td= @form.text_field 'order_number', :size => 3
|
||||
%td= @form.text_field 'units_to_order', :size => 5
|
||||
%td= @form.text_field 'unit_quantity', :size => 3
|
||||
%td= @form.text_field 'unit', :size => 5
|
||||
%td= @form.text_field 'net_price', :size => 3
|
||||
%td= @form.text_field 'tax', :size => 3
|
||||
%td= @form.text_field 'deposit', :size => 3
|
||||
= @form.hidden_field "order_id"
|
||||
%br/
|
||||
= submit_tag "Speichern"
|
||||
|
|
||||
= link_to_function 'Abbrechen', "Element.hide('edit_box')"
|
||||
5
app/views/finance/_articleResults.haml
Normal file
5
app/views/finance/_articleResults.haml
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
%tr{:class => cycle('even', 'odd', :name => 'articles')}[@article]
|
||||
= render :partial => 'articleResult'
|
||||
|
||||
%tr{:id => "group_order_article_results_#{@article.id}", :class => "results", :style => "display:none"}
|
||||
= render :partial => 'groupOrderArticleResults'
|
||||
17
app/views/finance/_articlesOverview.haml
Normal file
17
app/views/finance/_articlesOverview.haml
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
%p
|
||||
%b
|
||||
Gelieferte Artikel:
|
||||
= @order.order_article_results.size
|
||||
- for article in @order.order_article_results
|
||||
%table{:style=> "margin-bottom:1em; width:40em;"}[article]
|
||||
%thead
|
||||
%tr
|
||||
%th{:colspan => "3"}= article.name + " (" + article.unit + " | " + article.unit_quantity.to_s + " | " + article.gross_price.to_s + ")"
|
||||
%tbody
|
||||
- for result in article.group_order_article_results
|
||||
%tr{ :class => cycle('even', 'odd', :name => 'group')}
|
||||
%td{:style=>"width:70%"}= result.group_order_result.group_name
|
||||
%td= result.quantity
|
||||
%td= article.gross_price * result.quantity
|
||||
- reset_cycle("group")
|
||||
|
||||
8
app/views/finance/_editArticleResult.haml
Normal file
8
app/views/finance/_editArticleResult.haml
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
%h2
|
||||
Bearbeiten von
|
||||
= @article.name
|
||||
|
||||
- remote_form_for 'order_article_result', @article, :url => {:action => 'updateArticleResult', :id => @article }, |
|
||||
:before => "Element.show('loader')", :success => "Element.hide('loader')" do |@form| |
|
||||
|
||||
= render :partial => "articleResultForm"
|
||||
20
app/views/finance/_editGroupResult.haml
Normal file
20
app/views/finance/_editGroupResult.haml
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
%h2 Mengenänderung
|
||||
%p
|
||||
= @result.group_order_result.group_name
|
||||
hat von
|
||||
= @result.order_article_result.name
|
||||
bekommen:
|
||||
|
||||
- remote_form_for 'group_order_article_result', @result, :url => {:action => 'updateGroupResult', :id => @result }, |
|
||||
:before => "Element.show('loader')", :success => "Element.hide('loader')" do |form| |
|
||||
|
||||
= error_messages_for 'group_order_article_result'
|
||||
%p
|
||||
%b Menge:
|
||||
(Einheit:
|
||||
= @result.order_article_result.unit
|
||||
)
|
||||
= form.text_field "quantity", :size => "6"
|
||||
= submit_tag "Speichern"
|
||||
|
|
||||
= link_to_function 'Abbrechen', "Element.hide('edit_box')"
|
||||
10
app/views/finance/_editNote.haml
Normal file
10
app/views/finance/_editNote.haml
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
%h2 Notiz bearbeiten
|
||||
- remote_form_for 'order', @order, :url => {:action => 'updateOrderNote', :id => @order}, |
|
||||
:before => "Element.show('loader')", :success => "Element.hide('loader')" do |form| |
|
||||
|
||||
%br/
|
||||
= form.text_area "note", :size => "60x20"
|
||||
%p
|
||||
= submit_tag "Speichern"
|
||||
|
|
||||
= link_to_remote 'Abbrechen', :update => 'results', :url => { :action => 'editOrder', :id => @order, :view => 'groupsOverview' }, :before => "Element.show('loader')", :success => "Element.hide('loader')"
|
||||
20
app/views/finance/_editResults.haml
Normal file
20
app/views/finance/_editResults.haml
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
%p{:style => "float:left"}
|
||||
%b Lieferung bearbeiten
|
||||
%p{:style => "float:right"}
|
||||
= link_to_remote "Artikel hinzufügen", :url => {:action => "newArticleResult", :id => @order}
|
||||
|
||||
%table{:class => "ordered_articles", :style => "clear:both"}
|
||||
%thead
|
||||
%tr
|
||||
%th{:colspan => "2"} Artikel
|
||||
%th Nr.
|
||||
%th Menge
|
||||
%th GebGr * Einheit
|
||||
%th netto
|
||||
%th brutto
|
||||
%th MwSt
|
||||
%th Pfand
|
||||
%th{:colspan => "2"}
|
||||
%tbody#result_table
|
||||
- for @article in @order.order_article_results
|
||||
= render :partial => "articleResults"
|
||||
27
app/views/finance/_editSummary.haml
Normal file
27
app/views/finance/_editSummary.haml
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
%h2 Bestelldaten ändern
|
||||
- remote_form_for 'order', @order, :url => {:action => 'updateOrderSummary', :id => @order}, |
|
||||
:before => "Element.show('loader')", :success => "Element.hide('loader')" do |form| |
|
||||
|
||||
= error_messages_for 'order'
|
||||
%table{:style => "width:10em"}
|
||||
%tr
|
||||
%td Rechnungsnummer:
|
||||
%td= form.text_field "invoice_number", :size => 10
|
||||
%tr
|
||||
%td Rechnungsdatum:
|
||||
%td= form.text_field "invoice_date", :size => 10
|
||||
%tr
|
||||
%td
|
||||
%abbr{:title => "(incl. Pfand/Gutschriften)"} Rechnungsbeitrag
|
||||
%td= form.text_field 'invoice_amount', :size => 10
|
||||
%tr
|
||||
%td
|
||||
%abbr{:title => "z.B Kistepfand"} extra Pfand
|
||||
%td= form.text_field 'deposit', :size => 10
|
||||
%tr
|
||||
%td Pfandgutschrift
|
||||
%td= form.text_field 'deposit_credit', :size => 10
|
||||
%p
|
||||
= submit_tag "Speichern"
|
||||
|
|
||||
= link_to_function 'Abbrechen', "Element.hide('edit_box')"
|
||||
25
app/views/finance/_groupOrderArticleResults.haml
Normal file
25
app/views/finance/_groupOrderArticleResults.haml
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
%td{:colspan => "7"}
|
||||
%p
|
||||
Notiz:
|
||||
= @article.note
|
||||
%table
|
||||
%thead
|
||||
%tr
|
||||
%td
|
||||
%td{:style => "width:8em"} Gruppe
|
||||
%td Einheiten
|
||||
%td Gesamtpreis
|
||||
%td{:colspan => "3",:style => "width:14em"}
|
||||
= link_to_remote '[Gruppe hinzufügen]', :url => {:action => "newGroupResult", :id => @article}, :before => "Element.show('loader')", :success => "Element.hide('loader')"
|
||||
%tbody{:id => "groups_results_#{@article.id}"}
|
||||
- for @result in @article.group_order_article_results
|
||||
= render :partial => "groupResults"
|
||||
%tfoot
|
||||
%tr{:class => cycle('even', 'odd', :name => 'results'), :id => "sum_of_article_#{@article.id}"}
|
||||
%td
|
||||
%td{:style => "width:8em"} Summe
|
||||
%td{:id => "totalArticleQuantity_#{@article.id}"}= @article.total[:quantity]
|
||||
%td{:id => "totalArticlePrice_#{@article.id}", :class => "currency"}
|
||||
= number_to_currency(@article.total[:price])
|
||||
%td{:colspan => "3"}
|
||||
- reset_cycle('results')
|
||||
17
app/views/finance/_groupResult.haml
Normal file
17
app/views/finance/_groupResult.haml
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
%td
|
||||
%td{:style=>"width:50%"}= @result.group_order_result.group_name
|
||||
%td{:id => "group_order_article_result_#{@result.id}_quantity"}= @result.quantity
|
||||
%td{:class => "currency"}= number_to_currency(@result.order_article_result.gross_price * @result.quantity)
|
||||
%td{:style=>"width:1em", :class => "actions"}
|
||||
= link_to_remote image_tag('b_edit.png', :size => "16x16", :border => 0, :alt => 'Menge ändern'), |
|
||||
:url => {:action => 'updateGroupResult', :id => @result}, |
|
||||
:before => "Element.show('loader')", |
|
||||
:success => "Element.hide('loader')" |
|
||||
%td{:style=>"width:1em", :class => "actions"}
|
||||
= link_to_remote image_tag('b_drop.png', :size => "16x16", :border => 0, :alt => 'Gruppenergebnis löschen'), |
|
||||
:url => {:action => 'destroyGroupResult', :id => @result}, |
|
||||
:confirm => 'Bist du sicher?', |
|
||||
:method => 'post', |
|
||||
:before => "Element.show('loader')", |
|
||||
:success => "Element.hide('loader')" |
|
||||
%td
|
||||
2
app/views/finance/_groupResults.haml
Normal file
2
app/views/finance/_groupResults.haml
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
%tr{:class => cycle('even', 'odd', :name => 'results')}[@result]
|
||||
= render :partial => "groupResult"
|
||||
30
app/views/finance/_groupsOverview.haml
Normal file
30
app/views/finance/_groupsOverview.haml
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
%p
|
||||
%b
|
||||
Gruppenbestellungen:
|
||||
= @order.group_order_results.size
|
||||
- for groupOrderResult in @order.group_order_results
|
||||
%p
|
||||
%table{:style => "width:40em"}[groupOrderResult]
|
||||
%thead
|
||||
%tr
|
||||
%th{:colspan => "6"}= groupOrderResult.group_name
|
||||
%tbody
|
||||
- total = 0
|
||||
- for result in groupOrderResult.group_order_article_results
|
||||
- price = result.order_article_result.gross_price
|
||||
- quantity = result.quantity
|
||||
- subTotal = price * quantity
|
||||
- total += subTotal
|
||||
%tr{:class => cycle('even', 'odd', :name => 'article')}
|
||||
%td= result.order_article_result.name
|
||||
%td= quantity
|
||||
%td{:class => "currency"}= number_to_currency(price)
|
||||
%td= result.order_article_result.unit_quantity
|
||||
%td= result.order_article_result.unit
|
||||
%td= number_to_currency(subTotal)
|
||||
%tfoot
|
||||
%tr{:class => cycle('even', 'odd', :name => 'article')}
|
||||
%td{:colspan => "5"} Summe
|
||||
%td
|
||||
%b= number_to_currency(total)
|
||||
- reset_cycle("article")
|
||||
28
app/views/finance/_listOrdergroups.haml
Normal file
28
app/views/finance/_listOrdergroups.haml
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
%p
|
||||
= _("Found") + ":"
|
||||
= @total
|
||||
%p
|
||||
%table{:style => "width:100%"}
|
||||
%tr
|
||||
%td
|
||||
= pagination_links_remote @groups, @per_page, {:sort => params[:sort]}
|
||||
%td{:style => "text-align:right"}
|
||||
- if @total > 20
|
||||
= items_per_page
|
||||
%table.list
|
||||
%thead
|
||||
%tr
|
||||
%th= sort_link_helper _("Name"), "name", @per_page
|
||||
%th= sort_link_helper _("Size of group"), "size", @per_page
|
||||
%th= sort_link_helper _("Account balance"), "account_balance", @per_page
|
||||
%th
|
||||
%tbody
|
||||
- for group in @groups
|
||||
%tr{:class => cycle('even','odd', :name => 'groups')}
|
||||
%td= @current_user.role_admin? ? link_to(group.name, {:controller => 'admin', :action => 'showGroup', :id => group}, {:title => _("Show ordergroup")}) : group.name
|
||||
%td= group.actual_size
|
||||
%td{:class => "currency", :style => "width:5em"}= number_to_currency(group.account_balance)
|
||||
%td{:class => "actions"}
|
||||
= link_to image_tag("euro_new.png", :size => "16x16", :alt => _("New transaction"), :border => "0"), {:action => 'newTransaction', :id => group}, {:title => _("New transaction")}
|
||||
= link_to image_tag("b_browse.png", :size => "16x16", :border => "0", :alt => 'Kontoauszug'), {:action => 'listTransactions', :id => group}, {:title => _("List transactions")}
|
||||
|
||||
7
app/views/finance/_newArticleResult.haml
Normal file
7
app/views/finance/_newArticleResult.haml
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
%h2
|
||||
Neuer gelieferter Artikel die Bestellung
|
||||
|
||||
- remote_form_for 'order_article_result', @article, :url => {:action => 'createArticleResult' }, |
|
||||
:before => "Element.show('loader')", :success => "Element.hide('loader')" do |@form| |
|
||||
|
||||
= render :partial => "articleResultForm"
|
||||
17
app/views/finance/_newGroupResult.haml
Normal file
17
app/views/finance/_newGroupResult.haml
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
%h2
|
||||
Neue Gruppenmenge für
|
||||
= @result.order_article_result.name
|
||||
- remote_form_for 'group_order_article_result', @result, :url => {:action => 'createGroupResult'}, |
|
||||
:before => "Element.show('loader')", :success => "Element.hide('loader')" do |@form| |
|
||||
= error_messages_for 'result'
|
||||
%p
|
||||
Gruppe:
|
||||
= @form.select "group_order_result_id", OrderGroup.find(:all, :order => "name").collect {|og| [og.name, og.id] }
|
||||
%p
|
||||
Menge:
|
||||
= @form.text_field "quantity", :size => 5
|
||||
= @form.hidden_field "order_article_result_id"
|
||||
%p
|
||||
= submit_tag "Speichern"
|
||||
|
|
||||
= link_to_function 'Abbrechen', "Element.hide('edit_box')"
|
||||
6
app/views/finance/_order_group.haml
Normal file
6
app/views/finance/_order_group.haml
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
%tr.transaction
|
||||
%td
|
||||
%select{:name => 'financial_transactions[][order_group_id]'}
|
||||
= options_for_select OrderGroup.find(:all, :order => 'name').collect { |g| [ g.name, g.id ] }
|
||||
%td= text_field_tag 'financial_transactions[][amount]'
|
||||
%td= link_to_function image_tag("b_drop.png", :size => "16x16", :alt => _("Remove"), :border => "0"), "$(this).up('.transaction').remove()", {:title => _("Remove ordergroup")}
|
||||
60
app/views/finance/_summary.haml
Normal file
60
app/views/finance/_summary.haml
Normal file
|
|
@ -0,0 +1,60 @@
|
|||
%p
|
||||
%b=h @order.supplier ? @order.supplier.name : _('nonexistent')
|
||||
| Rechnungsnummer:
|
||||
= @order.invoice_number
|
||||
| Rechnungsdatum:
|
||||
= @order.invoice_date
|
||||
|
|
||||
= link_to_remote image_tag('b_edit.png', :size => "16x16", :border => 0, :alt => 'Rechnungsbetrag ändern'), |
|
||||
:url => {:action => "editOrderSummary", :id => @order}, |
|
||||
:before => "Element.show('loader')", |
|
||||
:success => "Element.hide('loader')" |
|
||||
%table
|
||||
%tr
|
||||
%td{:colspan => "2"}
|
||||
%b Foodcoop
|
||||
%td{:colspan => "2"}
|
||||
%b Lieferant
|
||||
%tr
|
||||
%td
|
||||
%abbr{:title => "gelieferten Artikel x Nettopreis"} Nettobetrag:
|
||||
%td= number_to_currency(@order.sumPrice("clear"))
|
||||
%td
|
||||
Rechnungsbetrag
|
||||
%small (incl. Pfand/Gutschriften)
|
||||
%td#invoice_amount= number_to_currency(@order.invoice_amount)
|
||||
%tr
|
||||
%td
|
||||
%abbr{:title => "Nettobetrag mit Pfand und MwSt."} Bruttobetrag:
|
||||
%td= number_to_currency(@order.sumPrice("gross"))
|
||||
%td
|
||||
%span - extra Pfand
|
||||
%small (Kistenpfand etc.)
|
||||
%td#deposit= number_to_currency(@order.deposit)
|
||||
%tr
|
||||
%td
|
||||
%abbr{:title => "Bruttobetrag mit Foodcoop Aufschlag"} FC Summe:
|
||||
%td= number_to_currency(@order.sumPrice("fc"))
|
||||
%td{:style => "border-bottom: 1px solid grey"}
|
||||
+ Pfandgutschriften
|
||||
%td{:style => "border-bottom: 1px solid grey"}
|
||||
#deposit_credit= number_to_currency(@order.deposit_credit)
|
||||
%tr
|
||||
%td
|
||||
%abbr{:title => "Zugeteilte Mengen x Bruttopreise (inkl. Aufschlag)"} Gruppenbeträge:
|
||||
%td#groups_amount= number_to_currency(@order.sumPrice("groups"))
|
||||
%td
|
||||
Summe
|
||||
%small (Rechungsbetrag ohne Pfand)
|
||||
%td#clear_invoice= number_to_currency(@order.invoice_amount - @order.deposit + @order.deposit_credit)
|
||||
%tr
|
||||
%td{:colspan => "4"}
|
||||
%abbr{:title => "Gruppenbeträge ohne Aufschlag minus Rechnung ohne Pfand. |
|
||||
Im Idealfall sollte hier 0.00 stehen."} Differenz ohne Aufschlag: |
|
||||
%span#fcProfit= number_to_currency(@order.fcProfit(false))
|
||||
%tr
|
||||
%td{:colspan => "4"}
|
||||
%b
|
||||
%abbr{:title => "= Gruppenbeträge - Rechnung ohne Pfand"} Differenz mit Aufschlag
|
||||
= "(#{number_to_percentage(FoodSoft.getPriceMarkup)}):"
|
||||
%span#fcProfit= number_to_currency(@order.fcProfit)
|
||||
16
app/views/finance/confirmOrder.haml
Normal file
16
app/views/finance/confirmOrder.haml
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
%h1 Bestellung abschließen
|
||||
.single_column#confirm{:style => "width:35em"}
|
||||
%p
|
||||
Wenn die Bestellung abgeschlossen wird, werden ebenfalls alle Gruppenkonten aktualisiert.
|
||||
%br/
|
||||
Die Konten werden wie folgt belastet:
|
||||
%table.list{:style => "width:35em"}
|
||||
- for groupResult in @order.group_order_results
|
||||
%tr{:class => cycle('even', 'odd')}
|
||||
%td= groupResult.group_name
|
||||
%td= number_to_currency(groupResult.price)
|
||||
%p
|
||||
%div{:style => "float:left"}
|
||||
= button_to "Abschließen", :action => "balanceOrder", :id => @order
|
||||
%div{:style => "float:right"}
|
||||
= link_to 'Zurück zur Abrechnung', :action => "editOrder", :id => @order
|
||||
48
app/views/finance/editOrder.haml
Normal file
48
app/views/finance/editOrder.haml
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
%h1 Bestellung abrechnen
|
||||
- if @order.booked
|
||||
%p
|
||||
%b Achtung, Bestellung wurde schon abgerechnet!
|
||||
.left_column{:style => 'width: 50em'}
|
||||
.box_title
|
||||
%h2
|
||||
= @order.name + " | " + format_date(@order.starts) + ' --> ' + format_date(@order.ends)
|
||||
.column_content#summary
|
||||
#order_summary
|
||||
= render :partial => "summary"
|
||||
.right_column{:style => 'width: 20em'}
|
||||
.box_title
|
||||
%h2 Aktionen
|
||||
.column_content
|
||||
%ul
|
||||
- unless @order.booked
|
||||
%li= link_to "Bestellung abschließen", :action => "confirmOrder", :id => @order
|
||||
|
||||
.right_column{:style => 'clear:both;width: 28%'}
|
||||
.box_title
|
||||
%h2 Protokoll
|
||||
.column_content
|
||||
#note
|
||||
- unless @order.note.empty?
|
||||
= simple_format @order.note
|
||||
- else
|
||||
%p Hier kannst Du deine Abrechnung kommentieren
|
||||
%small Protokoll bearbeiten:
|
||||
= link_to_remote image_tag("b_edit.png", :size => "16x16", :border => "0"), |
|
||||
:update => 'results', :url => { :action => 'editOrder', :id => @order, :view => 'editNote' }, |
|
||||
:before => "Element.show('loader')", :success => "Element.hide('loader')" |
|
||||
%hr/
|
||||
#comments
|
||||
= render :partial => 'shared/comments'
|
||||
|
||||
.left_column{:style => 'width: 69%'}
|
||||
.box_title
|
||||
#editOrderNav
|
||||
%ul
|
||||
%li= link_to_remote 'Gruppenübersicht', :update => 'results', :url => { :action => 'editOrder', :id => @order, :view => 'groupsOverview' }, :before => "Element.show('loader')", :success => "Element.hide('loader')"
|
||||
%li= link_to_remote 'Artikelübersicht', :update => 'results', :url => { :action => 'editOrder', :id => @order, :view => 'articlesOverview' }, :before => "Element.show('loader')", :success => "Element.hide('loader')"
|
||||
%li= link_to_remote 'Bestellung bearbeiten', :update => 'results', :url => { :action => 'editOrder', :id => @order, :view => 'editResults' }, :before => "Element.show('loader')", :success => "Element.hide('loader')"
|
||||
.column_content
|
||||
#results
|
||||
= render :partial => 'groupsOverview'
|
||||
%p= link_to_top
|
||||
#edit_box{:style => 'display:none'}
|
||||
44
app/views/finance/index.haml
Normal file
44
app/views/finance/index.haml
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
%h1 Finanzbereich
|
||||
.left_column{:style => 'width: 50%'}
|
||||
.box_title
|
||||
%h2 letzte Überweisungen
|
||||
.column_content
|
||||
%p
|
||||
= link_to "Bestellgruppen", :action => "listOrdergroups"
|
||||
%table.list
|
||||
%thead
|
||||
%tr
|
||||
%th Datum
|
||||
%th Gruppe
|
||||
%th Notiz
|
||||
%th Betrag
|
||||
%tbody
|
||||
- @financial_transactions.each do |ft|
|
||||
%tr{:class => cycle("even","odd", :name => "financial_transaction")}
|
||||
%td= format_date(ft.created_on)
|
||||
%td= ft.order_group.name
|
||||
%td{:style => "width:50%"}=h ft.note
|
||||
%td{:style => "color:#{ft.amount < 0 ? 'red' : 'black'}", :class => "currency"}= number_to_currency(ft.amount)
|
||||
|
||||
.right_column{:style => 'width: 46%'}
|
||||
.box_title
|
||||
%h2 noch nicht abgerechnet
|
||||
.column_content
|
||||
%p= link_to "Bestellungsübersicht", :action => "listOrders"
|
||||
- unless @orders.empty?
|
||||
%table.list
|
||||
%thead
|
||||
%tr
|
||||
%th Name
|
||||
%th Ende
|
||||
%th Betrag(FC)
|
||||
%th
|
||||
%tbody
|
||||
- @orders.each do |order|
|
||||
%tr{:class => cycle("even","odd", :name => "order")}
|
||||
%td= order.name
|
||||
%td= format_date(order.ends)
|
||||
%td{:class => "currency"}= number_to_currency(order.sumPrice("fc"))
|
||||
%td= link_to "abrechnen", :action => "editOrder", :id => order
|
||||
- else
|
||||
Super, alles schon abgerechnet...
|
||||
24
app/views/finance/listOrdergroups.haml
Normal file
24
app/views/finance/listOrdergroups.haml
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
- title _("Manage accounts")
|
||||
%p
|
||||
%i
|
||||
=_ "To create multiple transactions at once please follow this "
|
||||
= link_to _("link"), :action => 'new_transactions'
|
||||
.left_column{:style=>"width:50em"}
|
||||
.box_title
|
||||
%h2=_ "Ordergroups"
|
||||
.column_content
|
||||
#group_filter
|
||||
%form{:name=>"sform", :action=>"", :style=>"display:inline;"}
|
||||
%label{:for => 'article_name'}= _("Search in name") + ":"
|
||||
= text_field_tag("query", params['query'], :size => 10 )
|
||||
|
||||
= observe_field 'query', :frequency => 2, |
|
||||
:before => "Element.show('loader')", |
|
||||
:success => "Element.hide('loader')", |
|
||||
:url => {:action => 'listOrdergroups'}, |
|
||||
:with => 'query' |
|
||||
#table
|
||||
= render :partial => "listOrdergroups"
|
||||
%br/
|
||||
- if @current_user.role_admin?
|
||||
= link_to _("New ordergroup"), :controller => 'admin', :action => 'newOrderGroup'
|
||||
37
app/views/finance/listOrders.haml
Normal file
37
app/views/finance/listOrders.haml
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
%h1 beendete Bestellungen
|
||||
%p
|
||||
%i
|
||||
Aktuell gibt es die Möglichkeit eine Bestellung mittels dem "abrechnen"-link zu verbuchen, d.h.
|
||||
nach Bearbeitung der Liefermengen die Gruppenbeträge automatisiert zu verbuchen,
|
||||
%br/
|
||||
oder die Bestellung manuell abzurechnen (Kontostände selbst zu aktualisieren) und mittels "auf gebucht setzen"
|
||||
die Bestellung als abgeschlossen zu deklarieren.
|
||||
.left_column{:style => "width:70em"}
|
||||
.box_title
|
||||
.column_content
|
||||
- unless @orders.empty?
|
||||
= will_paginate @orders
|
||||
%table.list
|
||||
%thead
|
||||
%tr
|
||||
%th Name
|
||||
%th Anbieter
|
||||
%th Ende
|
||||
%th Status
|
||||
%th zuletzt bearbeitet von
|
||||
%th
|
||||
%tbody
|
||||
- @orders.each do |order|
|
||||
%tr{:class => cycle("even","odd", :name => "order")}
|
||||
%td= link_to truncate(order.name), :action => "editOrder", :id => order
|
||||
%td=h order.supplier ? order.supplier.name : _('nonexistent')
|
||||
%td=h format_time(order.ends) unless order.ends.nil?
|
||||
%td= order.booked ? "abgerechnet (#{number_to_currency order.fcProfit})" : "beendet"
|
||||
%td= order.updated_by.nil? ? '??' : order.updated_by.nick
|
||||
%td
|
||||
- unless order.booked
|
||||
= link_to "abrechnen", :action => "editOrder", :id => order
|
||||
|
|
||||
= link_to 'auf "gebucht" setzen', {:action => 'setAllBooked', :id => order}, :confirm => 'Wirklich alle Gruppenbestellungen für diese Bestellung auf "gebucht" setzen?', :method => "post"
|
||||
- else
|
||||
%i derzeit gibt es keine beendeten Bestellungen
|
||||
20
app/views/finance/new_transactions.haml
Normal file
20
app/views/finance/new_transactions.haml
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
- title _("Update multiple accounts")
|
||||
|
||||
- form_tag :action => "create_transactions" do
|
||||
%p
|
||||
%b= _("Note") + ":"
|
||||
= text_field_tag "note"
|
||||
%p
|
||||
%table#OrderGroups{:style => "width:20em"}
|
||||
%tr
|
||||
%th=_ "Ordergroup"
|
||||
%th=_ "Amount"
|
||||
= render :partial => 'order_group', :collection => [1, 2, 3]
|
||||
|
||||
%p
|
||||
= link_to_function _("Add another ordergroup") do |page|
|
||||
- page.insert_html :bottom, :OrderGroups, :partial => 'order_group'
|
||||
%p
|
||||
= submit_tag _("Save")
|
||||
|
|
||||
= link_to _("Cancel"), :action => 'listOrdergroups'
|
||||
Loading…
Add table
Add a link
Reference in a new issue