Fixed finance module to work with bootstrap design.
This commit is contained in:
parent
16de9124fe
commit
0236fb5a60
55 changed files with 440 additions and 486 deletions
|
@ -50,10 +50,10 @@ footer {
|
|||
|
||||
table {
|
||||
|
||||
th.sortdown a:after {
|
||||
a.sortdown:after {
|
||||
content: ' \25BC';
|
||||
}
|
||||
th.sortup a:after {
|
||||
a.sortup:after {
|
||||
content: ' \25B2';
|
||||
}
|
||||
|
||||
|
|
|
@ -4,23 +4,23 @@ class ArticlesController < ApplicationController
|
|||
|
||||
def index
|
||||
if params['sort']
|
||||
sort = case params['sort']
|
||||
when "name" then "articles.name"
|
||||
when "unit" then "articles.unit"
|
||||
when "category" then "article_categories.name"
|
||||
when "note" then "articles.note"
|
||||
when "availability" then "articles.availability"
|
||||
when "name_reverse" then "articles.name DESC"
|
||||
when "unit_reverse" then "articles.unit DESC"
|
||||
when "category_reverse" then "article_categories.name DESC"
|
||||
when "note_reverse" then "articles.note DESC"
|
||||
when "availability_reverse" then "articles.availability DESC"
|
||||
end
|
||||
sort = case params['sort']
|
||||
when "name" then "articles.name"
|
||||
when "unit" then "articles.unit"
|
||||
when "category" then "article_categories.name"
|
||||
when "note" then "articles.note"
|
||||
when "availability" then "articles.availability"
|
||||
when "name_reverse" then "articles.name DESC"
|
||||
when "unit_reverse" then "articles.unit DESC"
|
||||
when "category_reverse" then "article_categories.name DESC"
|
||||
when "note_reverse" then "articles.note DESC"
|
||||
when "availability_reverse" then "articles.availability DESC"
|
||||
end
|
||||
else
|
||||
sort = "article_categories.name, articles.name"
|
||||
end
|
||||
|
||||
@articles = @supplier.articles.includes(:article_category).order(sort)
|
||||
@articles = Article.where(supplier_id: @supplier).includes(:article_category).order(sort)
|
||||
@articles = @articles.where('articles.name LIKE ?', "%#{params[:query]}%") unless params[:query].nil?
|
||||
|
||||
@articles = @articles.page(params[:page]).per(@per_page)
|
||||
|
|
|
@ -1,15 +1,8 @@
|
|||
# encoding: utf-8
|
||||
class Finance::BalancingController < ApplicationController
|
||||
before_filter :authenticate_finance
|
||||
class Finance::BalancingController < Finance::BaseController
|
||||
|
||||
def index
|
||||
@financial_transactions = FinancialTransaction.order('created_on DESC').limit(8)
|
||||
@orders = Order.finished_not_closed
|
||||
@unpaid_invoices = Invoice.unpaid
|
||||
end
|
||||
|
||||
def list
|
||||
@orders = Order.finished.paginate :page => params[:page], :per_page => 10, :order => 'ends DESC'
|
||||
@orders = Order.finished.page(params[:page]).per(@per_page).order('ends DESC')
|
||||
end
|
||||
|
||||
def new
|
||||
|
@ -62,10 +55,10 @@ class Finance::BalancingController < ApplicationController
|
|||
def close
|
||||
@order = Order.find(params[:id])
|
||||
@order.close!(@current_user)
|
||||
redirect_to finance_balancing_url, notice: "Bestellung wurde erfolgreich abgerechnet, die Kontostände aktualisiert."
|
||||
redirect_to finance_root_url, notice: "Bestellung wurde erfolgreich abgerechnet, die Kontostände aktualisiert."
|
||||
|
||||
rescue => error
|
||||
redirect_to finance_balancing_url, alert: "Ein Fehler ist beim Abrechnen aufgetreten: #{error.message}"
|
||||
redirect_to new_finance_order_url(order_id: @order.id), alert: "Ein Fehler ist beim Abrechnen aufgetreten: #{error.message}"
|
||||
end
|
||||
|
||||
# Close the order directly, without automaticly updating ordergroups account balances
|
||||
|
|
11
app/controllers/finance/base_controller.rb
Normal file
11
app/controllers/finance/base_controller.rb
Normal file
|
@ -0,0 +1,11 @@
|
|||
class Finance::BaseController < ApplicationController
|
||||
before_filter :authenticate_finance
|
||||
|
||||
def index
|
||||
@financial_transactions = FinancialTransaction.order('created_on DESC').limit(8)
|
||||
@orders = Order.finished_not_closed
|
||||
@unpaid_invoices = Invoice.unpaid
|
||||
|
||||
render template: 'finance/index'
|
||||
end
|
||||
end
|
|
@ -19,15 +19,10 @@ class Finance::FinancialTransactionsController < ApplicationController
|
|||
sort = "created_on DESC"
|
||||
end
|
||||
|
||||
@financial_transactions = @ordergroup.financial_transactions.order(sort)
|
||||
@financial_transactions = @ordergroup.financial_transactions.unscoped.order(sort)
|
||||
@financial_transactions = @financial_transactions.where('note LIKE ?', "%#{params[:query]}%") unless params[:query].nil?
|
||||
|
||||
@financial_transactions = @financial_transactions.paginate :page => params[:page], :per_page => 10
|
||||
|
||||
respond_to do |format|
|
||||
format.html
|
||||
format.js { render :layout => false }
|
||||
end
|
||||
@financial_transactions = @financial_transactions.page(params[:page]).per(@per_page)
|
||||
end
|
||||
|
||||
def new
|
||||
|
@ -55,9 +50,9 @@ class Finance::FinancialTransactionsController < ApplicationController
|
|||
Ordergroup.find(trans[:ordergroup_id]).add_financial_transaction!(trans[:amount], params[:note], @current_user)
|
||||
end
|
||||
end
|
||||
redirect_to finance_ordergroups_url, :notice => "Alle Transaktionen wurden gespeichert."
|
||||
redirect_to finance_ordergroups_url, notice: "Alle Transaktionen wurden gespeichert."
|
||||
rescue => error
|
||||
redirect_to :action => 'new_collection', :alert => "Ein Fehler ist aufgetreten: " + error.to_s
|
||||
redirect_to finance_new_transaction_collection_url, alert: "Ein Fehler ist aufgetreten: " + error.to_s
|
||||
end
|
||||
|
||||
protected
|
||||
|
|
|
@ -1,39 +1,23 @@
|
|||
class Finance::InvoicesController < ApplicationController
|
||||
|
||||
def index
|
||||
@invoices = Invoice.includes(:supplier, :delivery, :order).order('date DESC').paginate(page: params[:page])
|
||||
|
||||
respond_to do |format|
|
||||
format.html # index.html.erb
|
||||
format.xml { render :xml => @invoices }
|
||||
end
|
||||
@invoices = Invoice.includes(:supplier, :delivery, :order).order('date DESC').page(params[:page]).per(@per_page)
|
||||
end
|
||||
|
||||
def show
|
||||
@invoice = Invoice.find(params[:id])
|
||||
|
||||
respond_to do |format|
|
||||
format.html # show.html.erb
|
||||
format.xml { render :xml => @invoice }
|
||||
end
|
||||
end
|
||||
|
||||
def new
|
||||
@invoice = Invoice.new :supplier_id => params[:supplier_id],
|
||||
:delivery_id => params[:delivery_id], :order_id => params[:order_id]
|
||||
|
||||
respond_to do |format|
|
||||
format.html # new.html.erb
|
||||
format.xml { render :xml => @invoice }
|
||||
end
|
||||
:delivery_id => params[:delivery_id],
|
||||
:order_id => params[:order_id]
|
||||
end
|
||||
|
||||
def edit
|
||||
@invoice = Invoice.find(params[:id])
|
||||
end
|
||||
|
||||
# POST /invoices
|
||||
# POST /invoices.xml
|
||||
def create
|
||||
@invoice = Invoice.new(params[:invoice])
|
||||
|
||||
|
@ -41,7 +25,7 @@ class Finance::InvoicesController < ApplicationController
|
|||
flash[:notice] = "Rechnung wurde erstellt."
|
||||
if @invoice.order
|
||||
# Redirect to balancing page
|
||||
redirect_to :controller => 'balancing', :action => 'new', :id => @invoice.order
|
||||
redirect_to new_finance_order_url(order_id: @invoice.order.id)
|
||||
else
|
||||
redirect_to [:finance, @invoice]
|
||||
end
|
||||
|
@ -50,32 +34,20 @@ class Finance::InvoicesController < ApplicationController
|
|||
end
|
||||
end
|
||||
|
||||
# PUT /invoices/1
|
||||
# PUT /invoices/1.xml
|
||||
def update
|
||||
@invoice = Invoice.find(params[:id])
|
||||
|
||||
respond_to do |format|
|
||||
if @invoice.update_attributes(params[:invoice])
|
||||
flash[:notice] = 'Invoice was successfully updated.'
|
||||
format.html { redirect_to([:finance, @invoice]) }
|
||||
format.xml { head :ok }
|
||||
else
|
||||
format.html { render :action => "edit" }
|
||||
format.xml { render :xml => @invoice.errors, :status => :unprocessable_entity }
|
||||
end
|
||||
if @invoice.update_attributes(params[:invoice])
|
||||
redirect_to [:finance, @invoice], notice: "Rechnung wurde aktualisiert."
|
||||
else
|
||||
render :edit
|
||||
end
|
||||
end
|
||||
|
||||
# DELETE /invoices/1
|
||||
# DELETE /invoices/1.xml
|
||||
def destroy
|
||||
@invoice = Invoice.find(params[:id])
|
||||
@invoice.destroy
|
||||
|
||||
respond_to do |format|
|
||||
format.html { redirect_to(finance_invoices_path) }
|
||||
format.xml { head :ok }
|
||||
end
|
||||
redirect_to finance_invoices_url
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
class Finance::OrdergroupsController < ApplicationController
|
||||
before_filter :authenticate_finance
|
||||
|
||||
class Finance::OrdergroupsController < Finance::BaseController
|
||||
|
||||
def index
|
||||
if params["sort"]
|
||||
sort = case params["sort"]
|
||||
|
@ -16,11 +15,6 @@ class Finance::OrdergroupsController < ApplicationController
|
|||
@ordergroups = Ordergroup.order(sort)
|
||||
@ordergroups = @ordergroups.where('name LIKE ?', "%#{params[:query]}%") unless params[:query].nil?
|
||||
|
||||
@ordergroups = @ordergroups.paginate :page => params[:page], :per_page => @per_page
|
||||
|
||||
respond_to do |format|
|
||||
format.html
|
||||
format.js { render :layout => false }
|
||||
end
|
||||
@ordergroups = @ordergroups.page(params[:page]).per(@per_page)
|
||||
end
|
||||
end
|
||||
|
|
|
@ -45,25 +45,33 @@ module ApplicationHelper
|
|||
end
|
||||
|
||||
end
|
||||
|
||||
def sort_td_class_helper(param)
|
||||
result = 'sortup' if params[:sort] == param.to_s
|
||||
result = 'sortdown' if params[:sort] == param.to_s + "_reverse"
|
||||
result
|
||||
end
|
||||
|
||||
def sort_link_helper(text, key, options = {})
|
||||
per_page = options[:per_page] || @per_page
|
||||
# Hmtl options
|
||||
remote = options[:remote].nil? ? true : options[:remote]
|
||||
key += "_reverse" if params[:sort] == key
|
||||
url = url_for(:sort => key, :page => nil, :per_page => per_page)
|
||||
|
||||
class_name = case params[:sort]
|
||||
when key then
|
||||
'sortup'
|
||||
when key + '_reverse' then
|
||||
'sortdown'
|
||||
else
|
||||
nil
|
||||
end
|
||||
html_options = {
|
||||
:title => "Nach #{text} sortieren",
|
||||
:remote => remote
|
||||
:remote => remote,
|
||||
:class => class_name
|
||||
}
|
||||
|
||||
link_to(text, url, html_options)
|
||||
|
||||
# Url options
|
||||
key += "_reverse" if params[:sort] == key
|
||||
per_page = options[:per_page] || @per_page
|
||||
url_options = params.merge(per_page: per_page, sort: key)
|
||||
url_options.merge!({page: params[:page]}) if params[:page]
|
||||
url_options.merge!({query: params[:query]}) if params[:query]
|
||||
|
||||
link_to(text, url_for(url_options), html_options)
|
||||
end
|
||||
|
||||
# Generates a link to the top of the website
|
||||
|
|
|
@ -2,9 +2,9 @@ module Finance::OrderArticlesHelper
|
|||
|
||||
def new_order_articles_collection
|
||||
if @order.stockit?
|
||||
StockArticle.order(:name)
|
||||
StockArticle.order('articles.name')
|
||||
else
|
||||
@order.supplier.articles.order(:name)
|
||||
@order.supplier.articles.order('articles.name')
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -8,7 +8,7 @@ class GroupOrderArticle < ActiveRecord::Base
|
|||
belongs_to :order_article
|
||||
has_many :group_order_article_quantities, :dependent => :destroy
|
||||
|
||||
validates_presence_of :group_order_id, :order_article_id
|
||||
validates_presence_of :group_order, :order_article
|
||||
validates_inclusion_of :quantity, :in => 0..99
|
||||
validates_inclusion_of :result, :in => 0..99, :allow_nil => true
|
||||
validates_inclusion_of :tolerance, :in => 0..99
|
||||
|
|
|
@ -2,19 +2,15 @@
|
|||
= items_per_page
|
||||
= pagination_links_remote @articles
|
||||
|
||||
%table#articles_table.table.table-striped
|
||||
%table#articles_table.table.table-hover
|
||||
%thead
|
||||
%tr
|
||||
%th
|
||||
%th{class: sort_td_class_helper(:name)}
|
||||
= sort_link_helper "Name", "name"
|
||||
%th= sort_link_helper "Name", "name"
|
||||
%th
|
||||
%th{class: sort_td_class_helper(:category)}
|
||||
= sort_link_helper "Kategorie", "category"
|
||||
%th{class: sort_td_class_helper(:unit)}
|
||||
= sort_link_helper "Einheit", "unit"
|
||||
%th{class: sort_td_class_helper(:note)}
|
||||
= sort_link_helper "Notiz", "note"
|
||||
%th= sort_link_helper "Kategorie", "category"
|
||||
%th= sort_link_helper "Einheit", "unit"
|
||||
%th= sort_link_helper "Notiz", "note"
|
||||
%th{:style => "width: 4em;"} Gebgr.
|
||||
%th{:style => "width: 5em;"} Preis
|
||||
%th{:style => "width: 3.5em;"} MwSt
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
$('#modalContainer').html('#{escape_javascript(render("form"))}');
|
||||
$('#modalContainer').html('#{j(render("form"))}');
|
||||
$('#modalContainer').modal();
|
||||
|
|
|
@ -1,4 +1,9 @@
|
|||
%h2 Notiz bearbeiten
|
||||
= simple_form_for @order, url: update_note_finance_order_path(@order), remote: true, method: :put do |f|
|
||||
= f.input :note, inner_html: {size: "60x20"}
|
||||
= f.submit
|
||||
.modal-header
|
||||
= button_tag "x", class: 'close', data: {dismiss: 'modal'}
|
||||
%h3 Notiz bearbeiten
|
||||
.modal-body
|
||||
= f.input :note, input_html: {class: 'input-xlarge'}
|
||||
.modal-footer
|
||||
= button_tag "Schließen", class: 'btn', data: {dismiss: 'modal'}
|
||||
= f.submit "Speichern", class: 'btn btn-primary'
|
|
@ -1,15 +1,10 @@
|
|||
%p{:style => "float:left"}
|
||||
%b Lieferung bearbeiten
|
||||
%p{:style => "float:right"}
|
||||
= link_to "Artikel hinzufügen", new_finance_order_order_article_path(@order), remote: true
|
||||
%h3 Bestellung bearbeiten
|
||||
|
||||
%table{:class => "ordered_articles", :style => "clear:both"}
|
||||
%table.ordered-articles.table.table-striped
|
||||
%thead
|
||||
%tr
|
||||
%th{colspan: "1", class: sort_td_class_helper("name")}
|
||||
= sort_link_helper "Artikel", "name"
|
||||
%th{class: sort_td_class_helper("order_number")}
|
||||
= sort_link_helper "Nr.", "order_number"
|
||||
%th= sort_link_helper "Artikel", "name"
|
||||
%th= sort_link_helper "Nr.", "order_number"
|
||||
%th Menge
|
||||
%th GebGr * Einheit
|
||||
%th Netto
|
||||
|
@ -17,6 +12,8 @@
|
|||
%th MwSt
|
||||
%th Pfand
|
||||
%th{:colspan => "2"}
|
||||
= link_to "Artikel hinzufügen", new_finance_order_order_article_path(@order), remote: true,
|
||||
class: 'btn btn-small'
|
||||
%tbody#result_table
|
||||
- for order_article in @articles
|
||||
= render :partial => "order_article_result", :locals => {:order_article => order_article}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
%td{:colspan => "7"}
|
||||
%table
|
||||
%table.table.table-striped
|
||||
%thead
|
||||
%tr
|
||||
%td
|
||||
|
@ -7,35 +7,35 @@
|
|||
%td Einheiten
|
||||
%td Gesamtpreis
|
||||
%td{:colspan => "3",:style => "width:14em"}
|
||||
= link_to '[Gruppe hinzufügen]', new_finance_group_order_article_path(order_article_id: order_article.id),
|
||||
remote: true
|
||||
= link_to 'Gruppe hinzufügen', new_finance_group_order_article_path(order_article_id: order_article.id),
|
||||
remote: true, class: 'btn btn-mini'
|
||||
%tbody
|
||||
- for group_order_article in order_article.group_order_articles.ordered.all(:include => [:group_order])
|
||||
%tr{:class => cycle('even', 'odd', :name => 'results')}[group_order_article]
|
||||
%tr[group_order_article]
|
||||
%td
|
||||
%td{:style=>"width:50%"}
|
||||
= group_order_article.group_order.ordergroup.name
|
||||
%td{:id => "group_order_article_#{group_order_article.id}_quantity", :style => "white-space:nowrap"}
|
||||
= group_order_article.result
|
||||
= button_to "+", update_result_finance_group_order_article_path(group_order_article, modifier: '+'),
|
||||
method: :put, remote: true, style: 'float:left'
|
||||
= button_to "-", update_result_finance_group_order_article_path(group_order_article, modifier: '-'),
|
||||
method: :put, remote: true
|
||||
%td.currency
|
||||
= link_to "+", update_result_finance_group_order_article_path(group_order_article, modifier: '+'),
|
||||
method: :put, remote: true, class: 'btn btn-mini'
|
||||
= link_to "-", update_result_finance_group_order_article_path(group_order_article, modifier: '-'),
|
||||
method: :put, remote: true, class: 'btn btn-mini'
|
||||
%td.numeric
|
||||
= number_to_currency(group_order_article.order_article.price.fc_price * group_order_article.result, :unit => "")
|
||||
%td.actions{:style=>"width:1em"}
|
||||
= link_to icon(:edit), edit_finance_group_order_article_path(group_order_article), remote: true
|
||||
= link_to "Bearbeiten", edit_finance_group_order_article_path(group_order_article), remote: true,
|
||||
class: 'btn btn-mini'
|
||||
%td.actions{:style=>"width:1em"}
|
||||
= link_to icon(:delete), finance_group_order_article_path(group_order_article), method: :delete,
|
||||
remote: true
|
||||
= link_to "Löschen", finance_group_order_article_path(group_order_article), method: :delete,
|
||||
remote: true, class: 'btn btn-mini btn-danger'
|
||||
%td
|
||||
%tfoot
|
||||
%tr{:class => cycle('even', 'odd', :name => 'results')}
|
||||
%tr
|
||||
%td
|
||||
%td{:style => "width:8em"} Summe (FC-Preis)
|
||||
%td{:id => "group_orders_sum_quantity_#{order_article.id}"}
|
||||
= order_article.group_orders_sum[:quantity]
|
||||
%td{:id => "group_orders_sum_price_#{order_article.id}", :class => "currency"}
|
||||
%td.numeric{:id => "group_orders_sum_price_#{order_article.id}"}
|
||||
= number_to_currency(order_article.group_orders_sum[:price], :unit => "")
|
||||
%td{:colspan => "3"}
|
||||
- reset_cycle('results')
|
||||
%td{:colspan => "3"}
|
|
@ -19,7 +19,8 @@
|
|||
%td= order_article.price.tax
|
||||
%td= order_article.price.deposit
|
||||
%td
|
||||
= link_to icon(:edit), edit_finance_order_order_article_path(order_article.order, order_article), remote: true
|
||||
= link_to "Bearbeiten", edit_finance_order_order_article_path(order_article.order, order_article), remote: true,
|
||||
class: 'btn btn-mini'
|
||||
%td
|
||||
= link_to icon(:delete), finance_order_order_article_path(order_article.order, order_article), method: :delete,
|
||||
remote: true, confirm: 'Bist du sicher?'
|
||||
= link_to "Löschen", finance_order_order_article_path(order_article.order, order_article), method: :delete,
|
||||
remote: true, confirm: 'Bist du sicher?', class: 'btn btn-danger btn-mini'
|
|
@ -1,4 +1,4 @@
|
|||
%tr{:class => cycle('even', 'odd', :name => 'articles')}[order_article]
|
||||
%tr[order_article]
|
||||
= render :partial => 'finance/balancing/order_article', :locals => {:order_article => order_article}
|
||||
|
||||
%tr{:id => "group_order_articles_#{order_article.id}", :class => "results", :style => "display:none"}
|
||||
|
|
26
app/views/finance/balancing/_orders.html.haml
Normal file
26
app/views/finance/balancing/_orders.html.haml
Normal file
|
@ -0,0 +1,26 @@
|
|||
- unless @orders.empty?
|
||||
- if Order.finished.count > 20
|
||||
= items_per_page
|
||||
= pagination_links_remote @orders
|
||||
%table.table.table-striped
|
||||
%thead
|
||||
%tr
|
||||
%th Name
|
||||
%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), new_finance_order_path(order_id: order.id)
|
||||
%td=h format_time(order.ends) unless order.ends.nil?
|
||||
%td= order.closed? ? "abgerechnet (#{number_to_currency order.foodcoop_result})" : "beendet"
|
||||
%td= order.updated_by.nil? ? '??' : order.updated_by.nick
|
||||
%td
|
||||
- unless order.closed?
|
||||
= link_to "abrechnen", new_finance_order_path(order_id: order.id), class: 'btn btn-mini btn-primary'
|
||||
= link_to 'direkt schließen', close_direct_finance_order_path(order),
|
||||
:confirm => 'Wirklich die Bestellung schließen setzen?', :method => :put, class: 'btn btn-mini'
|
||||
- else
|
||||
%i derzeit gibt es keine beendeten Bestellungen
|
|
@ -5,19 +5,23 @@
|
|||
%table
|
||||
%tr
|
||||
%td Nettobetrag:
|
||||
%td= number_to_currency(order.sum(:net))
|
||||
%td.numeric= number_to_currency(order.sum(:net))
|
||||
%tr
|
||||
%td Bruttobetrag:
|
||||
%td= number_to_currency(order.sum(:gross))
|
||||
%td.numeric= number_to_currency(order.sum(:gross))
|
||||
%tr
|
||||
%td FC-Betrag:
|
||||
%td= number_to_currency(order.sum(:fc))
|
||||
%td.numeric= number_to_currency(order.sum(:fc))
|
||||
%tr
|
||||
%td Summe der Gruppenbeträge:
|
||||
%td= number_to_currency(order.sum(:groups))
|
||||
%td Gruppenbeträge:
|
||||
%td.numeric= number_to_currency(order.sum(:groups))
|
||||
%tr
|
||||
%td FC Gewinn ohne Aufschlag:
|
||||
%td= number_to_currency(order.profit(:without_markup => true))
|
||||
%td
|
||||
FC Gewinn
|
||||
%small ohne Aufschlag:
|
||||
%td.numeric= number_to_currency(order.profit(:without_markup => true))
|
||||
%tr
|
||||
%td FC Gewinn mit Aufschlag:
|
||||
%td#order_profit= number_to_currency(order.profit)
|
||||
%td
|
||||
FC Gewinn
|
||||
%small mit Aufschlag:
|
||||
%td#order_profit.numeric= number_to_currency(order.profit)
|
|
@ -1,16 +1,13 @@
|
|||
-title "Bestellung abschließen"
|
||||
%div{:style => "width: 40em"}
|
||||
%p
|
||||
Wenn die Bestellung abgeschlossen wird, werden ebenfalls alle Gruppenkonten aktualisiert.
|
||||
%br/
|
||||
Die Konten werden wie folgt belastet:
|
||||
%table.list{:style => "width:35em"}
|
||||
- for group_order in @order.group_orders
|
||||
%tr{:class => cycle('even', 'odd')}
|
||||
%td= group_order.ordergroup.name
|
||||
%td= number_to_currency(group_order.price)
|
||||
%p
|
||||
%div{:style => "float:left"}
|
||||
= button_to "Abschließen", close_finance_order_path(@order), method: :put
|
||||
%div{:style => "float:right"}
|
||||
= link_to 'Zurück zur Abrechnung', new_finance_order_path(order_id: @order.id)
|
||||
%p
|
||||
Wenn die Bestellung abgeschlossen wird, werden ebenfalls alle Gruppenkonten aktualisiert.
|
||||
%br/
|
||||
Die Konten werden wie folgt belastet:
|
||||
%table.table.table-striped{:style => "width:35em"}
|
||||
- for group_order in @order.group_orders
|
||||
%tr{:class => cycle('even', 'odd')}
|
||||
%td= group_order.ordergroup.name
|
||||
%td.numeric= number_to_currency(group_order.price)
|
||||
.form-actions
|
||||
= link_to "Abschließen", close_finance_order_path(@order), method: :put, class: 'btn btn-primary'
|
||||
= link_to 'oder zurück zur Abrechnung', new_finance_order_path(order_id: @order.id)
|
|
@ -1 +1,2 @@
|
|||
$.fancybox('#{escape_javascript(render("edit_note"))}');
|
||||
$('#modalContainer').html('#{j(render("edit_note"))}');
|
||||
$('#modalContainer').modal();
|
|
@ -1,63 +1,3 @@
|
|||
%h1 Finanzbereich
|
||||
.left_column{:style => 'width: 50%'}
|
||||
.box_title
|
||||
%h2 Unbezahlte Rechnungen
|
||||
.column_content
|
||||
%p= link_to "Zeige alle Rechnungen", finance_invoices_path
|
||||
%table.list
|
||||
%thead
|
||||
%tr
|
||||
%th Datum
|
||||
%th Betrag
|
||||
%th Lieferantin
|
||||
%th
|
||||
%tbody
|
||||
- for invoice in @unpaid_invoices
|
||||
%tr{:class => cycle("even","odd", :name => "invoices")}
|
||||
%td= format_date(invoice.date)
|
||||
%td= number_to_currency(invoice.amount)
|
||||
%td=h invoice.supplier.name
|
||||
%td= link_to "Bearbeiten", edit_finance_invoice_path(invoice)
|
||||
- title "beendete Bestellungen"
|
||||
|
||||
.box_title
|
||||
%h2 letzte Überweisungen
|
||||
.column_content
|
||||
%p
|
||||
= link_to "Bestellgruppen", :controller => 'financial_transactions'
|
||||
%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.ordergroup.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", finance_balancing_path
|
||||
- unless @orders.empty?
|
||||
%table.list
|
||||
%thead
|
||||
%tr
|
||||
%th Lieferantin
|
||||
%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.sum(:fc))
|
||||
%td= link_to "abrechnen", new_finance_order_path(order_id: order.id)
|
||||
- else
|
||||
Super, alles schon abgerechnet...
|
||||
#ordersTable= render 'orders'
|
1
app/views/finance/balancing/index.js.haml
Normal file
1
app/views/finance/balancing/index.js.haml
Normal file
|
@ -0,0 +1 @@
|
|||
$('#ordersTable').html('#{j(render('orders'))}');
|
|
@ -1,29 +0,0 @@
|
|||
- title "beendete Bestellungen"
|
||||
.left_column{:style => "width:70em"}
|
||||
.box_title
|
||||
.column_content
|
||||
- unless @orders.empty?
|
||||
= will_paginate @orders
|
||||
%table.list
|
||||
%thead
|
||||
%tr
|
||||
%th Name
|
||||
%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), new_finance_order_path(order_id: order.id)
|
||||
%td=h format_time(order.ends) unless order.ends.nil?
|
||||
%td= order.closed? ? "abgerechnet (#{number_to_currency order.foodcoop_result})" : "beendet"
|
||||
%td= order.updated_by.nil? ? '??' : order.updated_by.nick
|
||||
%td
|
||||
- unless order.closed?
|
||||
= link_to "abrechnen", new_finance_order_path(order_id: order.id)
|
||||
|
|
||||
= link_to 'direkt schließen', close_direct_finance_order_path(order),
|
||||
:confirm => 'Wirklich die Bestellung schließen setzen?', :method => :put
|
||||
- else
|
||||
%i derzeit gibt es keine beendeten Bestellungen
|
|
@ -1,53 +1,49 @@
|
|||
- title "#{@order.name} abrechnen"
|
||||
|
||||
.left_column{:style => 'width: 24em'}
|
||||
.box_title
|
||||
%h2 Zusammenfassung
|
||||
.column_content#summary
|
||||
= render :partial => "summary", :locals => {:order => @order}
|
||||
- content_for :sidebar do
|
||||
.well.well-small
|
||||
%h3 Zusammenfassung
|
||||
#summary= render 'summary', order: @order
|
||||
|
||||
- unless @order.stockit?
|
||||
.middle_column{:style => 'width: 24em'}
|
||||
.box_title
|
||||
%h2 Rechnung
|
||||
.column_content#invoice
|
||||
= render :partial => "invoice", :locals => {:invoice => @order.invoice}
|
||||
.well.well-small
|
||||
%h3 Rechnung
|
||||
#invoice= render 'invoice', invoice: @order.invoice
|
||||
|
||||
.right_column{:style => 'width: 20em'}
|
||||
.box_title
|
||||
%h2 Aktionen
|
||||
.column_content
|
||||
%ul
|
||||
- unless @order.invoice or @order.stockit?
|
||||
%li= link_to "Rechnung anlegen", new_finance_invoice_path(:order_id => @order, :supplier_id => @order.supplier)
|
||||
- unless @order.closed?
|
||||
%li= link_to "Bestellung abschließen", :action => "confirm", :id => @order
|
||||
|
||||
.right_column{:style => 'clear:both;width: 28%'}
|
||||
.box_title
|
||||
%h2 Notizen/Protokoll
|
||||
.column_content
|
||||
.well.well-small
|
||||
%h3 Notizen/Protokoll
|
||||
#note
|
||||
- unless @order.note.empty?
|
||||
= simple_format @order.note
|
||||
- else
|
||||
%p Hier kannst Du deine Abrechnung kommentieren
|
||||
= link_to "Notiz bearbeiten", edit_note_finance_order_path(@order), remote: true
|
||||
.box_title
|
||||
%h2 Kommentare
|
||||
.column_content
|
||||
#comments
|
||||
= render :partial => 'shared/comments', locals: {comments: @order.comments}
|
||||
|
||||
.left_column{:style => 'width: 69%'}
|
||||
.box_title
|
||||
#editOrderNav
|
||||
%ul
|
||||
%li= link_to 'Bestellung bearbeiten', new_finance_order_path(order_id: @order.id, view: 'edit_results'), remote: true
|
||||
%li= link_to 'Gruppenübersicht', new_finance_order_path(order_id: @order.id, view: 'groups_overview'), remote: true
|
||||
%li= link_to 'Artikelübersicht', new_finance_order_path(order_id: @order.id, view: 'articles_overview'), remote: true
|
||||
.column_content
|
||||
#results
|
||||
= render partial: 'edit_results_by_articles'
|
||||
%p= link_to_top
|
||||
|
||||
.well.well-small
|
||||
%h3 Kommentare
|
||||
#comments= render :partial => 'shared/comments', locals: {comments: @order.comments}
|
||||
|
||||
.well.well-small
|
||||
.btn-toolbar
|
||||
.btn-group
|
||||
- unless @order.invoice or @order.stockit?
|
||||
= link_to "Rechnung anlegen", new_finance_invoice_path(:order_id => @order, :supplier_id => @order.supplier),
|
||||
class: 'btn'
|
||||
- unless @order.closed?
|
||||
= link_to "Bestellung abschließen", confirm_finance_order_path(@order), class: 'btn btn-primary'
|
||||
|
||||
#editOrderNav.btn-group.pull-right
|
||||
= link_to '#', data: {toggle: 'dropdown'}, class: 'btn dropdown-toggle' do
|
||||
Ansichtsoptionen
|
||||
%span.caret
|
||||
%ul.dropdown-menu
|
||||
%li= link_to 'Bestellung bearbeiten', new_finance_order_path(order_id: @order.id, view: 'edit_results'),
|
||||
remote: true
|
||||
%li= link_to 'Gruppenübersicht', new_finance_order_path(order_id: @order.id, view: 'groups_overview'),
|
||||
remote: true
|
||||
%li= link_to 'Artikelübersicht', new_finance_order_path(order_id: @order.id, view: 'articles_overview'),
|
||||
remote: true
|
||||
|
||||
%section#results
|
||||
= render 'edit_results_by_articles'
|
||||
%p= link_to_top
|
||||
#edit_box{:style => 'display:none'}
|
|
@ -1 +1 @@
|
|||
$('#results').html('#{escape_javascript(render(partial: balancing_view_partial, locals: {order: @order}))}');
|
||||
$('#results').html('#{j(render(balancing_view_partial, order: @order))}');
|
||||
|
|
|
@ -1,2 +1,2 @@
|
|||
$.fancybox.close();
|
||||
$('#note').html('#{escape_javascript(simple_format(@order.note))}');
|
||||
$('#modalContainer').modal('hide');
|
||||
$('#note').html('#{j(simple_format(@order.note))}');
|
||||
|
|
|
@ -2,5 +2,6 @@
|
|||
%td
|
||||
= select_tag 'financial_transactions[][ordergroup_id]',
|
||||
options_for_select(Ordergroup.order(:name).all.map { |g| [ g.name, g.id ] })
|
||||
%td= text_field_tag 'financial_transactions[][amount]'
|
||||
%td= link_to icon(:delete), "#", :title => "Gruppe enfernen", 'data-remove-transaction' => true
|
||||
%td= text_field_tag 'financial_transactions[][amount]', nil, class: 'input-small'
|
||||
%td= link_to "Entfernen", "#", :title => "Gruppe enfernen", 'data-remove-transaction' => true,
|
||||
class: 'btn btn-small'
|
|
@ -1,26 +1,17 @@
|
|||
- if @total == 0
|
||||
%p Keine gefunden
|
||||
- else
|
||||
%p
|
||||
Anzahl gefundener Transaktionen:
|
||||
%b= @total
|
||||
%p
|
||||
= pagination_links_remote @financial_transactions, :update => 'transactions', |
|
||||
:params => {:sort => params[:sort], :query => params['query']} |
|
||||
%table
|
||||
%thead
|
||||
- if @ordergroup.financial_transactions.count > 20
|
||||
= items_per_page
|
||||
= pagination_links_remote @financial_transactions
|
||||
%table.table.table-striped
|
||||
%thead
|
||||
%tr
|
||||
%td= sort_link_helper "Datum", "date"
|
||||
%td Wer
|
||||
%td= sort_link_helper "Notiz", "note"
|
||||
%td= sort_link_helper "Betrag", "amount"
|
||||
%tbody
|
||||
- @financial_transactions.each do |t|
|
||||
%tr
|
||||
<td #{sort_td_class_helper("date")}>
|
||||
\#{sort_link_helper "Datum", "date"}
|
||||
%td Wer
|
||||
<td #{sort_td_class_helper("note")}>
|
||||
\#{sort_link_helper "Notiz", "note"}
|
||||
<td #{sort_td_class_helper("amount")}>
|
||||
\#{sort_link_helper "Betrag", "amount"}
|
||||
%tbody
|
||||
- @financial_transactions.each do |t|
|
||||
%tr{:class => cycle("even","odd")}
|
||||
%td= format_time(t.created_on)
|
||||
%td= h t.user.nil? ? '??' : t.user.nick
|
||||
%td= h t.note
|
||||
%td.currency{:style => "color:#{t.amount < 0 ? 'red' : 'black'}; width:5em"}= number_to_currency(t.amount)
|
||||
%td= format_time(t.created_on)
|
||||
%td= h t.user.nil? ? '??' : t.user.nick
|
||||
%td= h t.note
|
||||
%td.currency{:style => "color:#{t.amount < 0 ? 'red' : 'black'}; width:5em"}= number_to_currency(t.amount)
|
||||
|
|
|
@ -1,18 +1,16 @@
|
|||
- title "Kontoauszug für #{@ordergroup.name}"
|
||||
%p
|
||||
%b
|
||||
Kontostand: #{number_to_currency(@ordergroup.account_balance)}
|
||||
%span{:style => "color:grey"}
|
||||
(zuletzt aktualisiert vor #{distance_of_time_in_words(Time.now, @ordergroup.account_updated)})
|
||||
.left_column{:style => "width:100%"}
|
||||
.box_title
|
||||
%h2 Überweisungen
|
||||
.column_content
|
||||
= form_tag finance_ordergroup_transactions_path(@ordergroup), :method => :get, :style=>"display:inline;", :id => 'ordergroup_search',
|
||||
:remote => true, 'data-submit-onchange' => true do
|
||||
%label{:for => 'article_name'} Suche in Notiz:
|
||||
= text_field_tag :query, params[:query], :size => 10
|
||||
#transactions
|
||||
= render :partial => "transactions"
|
||||
%p= link_to 'Neue Transaktion', new_finance_ordergroup_transaction_path(@ordergroup)
|
||||
= link_to 'Gruppenübersicht', finance_ordergroups_path
|
||||
|
||||
- content_for :sidebar do
|
||||
%p= link_to 'Neue Transaktion anlegen', new_finance_ordergroup_transaction_path(@ordergroup), class: 'btn btn-primary'
|
||||
.well.well-small
|
||||
%strong Kontostand: #{number_to_currency(@ordergroup.account_balance)}
|
||||
%br/
|
||||
%small (zuletzt aktualisiert vor #{distance_of_time_in_words(Time.now, @ordergroup.account_updated)})
|
||||
.well.well-small
|
||||
= form_tag finance_ordergroup_transactions_path(@ordergroup), :method => :get, :remote => true,
|
||||
'data-submit-onchange' => true, class: 'form-search' do
|
||||
= text_field_tag :query, params[:query], class: 'input-medium search-query',
|
||||
placeholder: 'Suchen ...'
|
||||
|
||||
|
||||
#transactions= render 'transactions'
|
|
@ -1,6 +1,6 @@
|
|||
- title "Mehrer Konten aktualisieren"
|
||||
- title "Mehrere Konten aktualisieren"
|
||||
|
||||
- content_for :head do
|
||||
- content_for :javascript do
|
||||
:javascript
|
||||
var ordergroup = "#{escape_javascript(render('ordergroup'))}"
|
||||
|
||||
|
@ -16,19 +16,23 @@
|
|||
});
|
||||
});
|
||||
|
||||
- form_tag finance_create_transaction_collection_path do
|
||||
- content_for :sidebar do
|
||||
.well.well-small
|
||||
Hier kannst Du mehrere Konten gleichzeitig aktualsieren.
|
||||
Z.B. alle Überweisungen der Bestellgruppen aus einem Kontoauszug.
|
||||
|
||||
= form_tag finance_create_transaction_collection_path do
|
||||
%p
|
||||
%b Notiz
|
||||
= text_field_tag :note
|
||||
= text_field_tag :note, params[:note], class: 'input-xlarge', required: 'required'
|
||||
%p
|
||||
%table#ordergroups{:style => "width:20em"}
|
||||
%tr
|
||||
%th Bestellgruppe
|
||||
%th Betrag
|
||||
= render :partial => 'ordergroup', :collection => [1, 2, 3]
|
||||
|
||||
%p
|
||||
= link_to "Neue Bestellgruppe hinzufügen", '#', 'data-add-transaction' => true
|
||||
%p
|
||||
= submit_tag "Transaktionen speichern"
|
||||
= link_to "Weitere Bestellgruppe hinzufügen", '#', 'data-add-transaction' => true, class: 'btn'
|
||||
.form-actions
|
||||
= submit_tag "Transaktionen speichern", class: 'btn btn-primary'
|
||||
= link_to "oder abbrechen", finance_ordergroups_path
|
|
@ -1,9 +1,11 @@
|
|||
%h2 Mengenänderung
|
||||
%p
|
||||
%b Artikel: #{@order_article.article.name}
|
||||
|
||||
- simple_form_for [:finance, @group_order_article], remote: true do |form|
|
||||
= simple_form_for [:finance, @group_order_article], remote: true do |form|
|
||||
= form.hidden_field :order_article_id
|
||||
= form.input :ordergroup_id, as: :select, collection: Ordergroup.all.map { |g| [g.name, g.id] }
|
||||
= form.input :result, hint: "Einheit: #{@order_article.article.unit}"
|
||||
= form.submit 'Speichern'
|
||||
.modal-header
|
||||
= button_tag "x", class: 'close', data: {dismiss: 'modal'}
|
||||
%h3 Mengenänderung für #{@order_article.article.name}
|
||||
.modal-body
|
||||
= form.input :ordergroup_id, as: :select, collection: Ordergroup.all.map { |g| [g.name, g.id] }
|
||||
= form.input :result, hint: "Einheit: #{@order_article.article.unit}"
|
||||
.modal-footer
|
||||
= button_tag "Schließen", class: 'btn', data: {dismiss: 'modal'}
|
||||
= form.submit "Speichern", class: 'btn btn-primary'
|
|
@ -1 +1,2 @@
|
|||
$.fancybox('#{escape_javascript(render('form'))}');
|
||||
$('#modalContainer').html('#{j(render("form"))}');
|
||||
$('#modalContainer').modal();
|
|
@ -1 +1,2 @@
|
|||
$.fancybox('#{escape_javascript(render("form"))}');
|
||||
$('#modalContainer').html('#{j(render("form"))}');
|
||||
$('#modalContainer').modal();
|
|
@ -1,5 +1,3 @@
|
|||
$.fancybox.close();
|
||||
$('#order_article_#{@order_article.id}').
|
||||
html('#{escape_javascript(render(partial: 'finance/balancing/order_article', locals: {order_article: @order_article}))}');
|
||||
$('#group_order_articles_#{@order_article.id}').
|
||||
html('#{escape_javascript(render(partial: 'finance/balancing/group_order_articles', locals: {order_article: @order_article}))}');
|
||||
$('#modalContainer').modal('hide');
|
||||
$('#order_article_#{@order_article.id}').html('#{j(render('finance/balancing/order_article', order_article: @order_article))}');
|
||||
$('#group_order_articles_#{@order_article.id}').html('#{j(render('finance/balancing/group_order_articles', order_article: @order_article))}');
|
||||
|
|
60
app/views/finance/index.html.haml
Normal file
60
app/views/finance/index.html.haml
Normal file
|
@ -0,0 +1,60 @@
|
|||
- title "Finanzbereich"
|
||||
|
||||
.row-fluid
|
||||
.span6
|
||||
%h2
|
||||
Unbezahlte Rechnungen
|
||||
%small= link_to "alle anzeigen", finance_invoices_path
|
||||
%table.table.table-striped
|
||||
%thead
|
||||
%tr
|
||||
%th Datum
|
||||
%th.numeric Betrag
|
||||
%th Lieferantin
|
||||
%th
|
||||
%tbody
|
||||
- for invoice in @unpaid_invoices
|
||||
%tr
|
||||
%td= format_date(invoice.date)
|
||||
%td.numeric= number_to_currency(invoice.amount)
|
||||
%td= invoice.supplier.name
|
||||
%td= link_to "Bearbeiten", edit_finance_invoice_path(invoice), class: 'btn btn-mini'
|
||||
|
||||
%h2
|
||||
letzte Überweisungen
|
||||
%small= link_to "alle anzeigen", finance_ordergroups_path
|
||||
%table.table.table-striped
|
||||
%thead
|
||||
%tr
|
||||
%th Datum
|
||||
%th Gruppe
|
||||
%th Notiz
|
||||
%th.numeric Betrag
|
||||
%tbody
|
||||
- @financial_transactions.each do |ft|
|
||||
%tr
|
||||
%td= format_date(ft.created_on)
|
||||
%td= ft.ordergroup.name
|
||||
%td= ft.note
|
||||
%td.numeric{:style => "color:#{ft.amount < 0 ? 'red' : 'black'}"}= number_to_currency(ft.amount)
|
||||
.span6
|
||||
%h2
|
||||
noch nicht abgerechnet
|
||||
%small= link_to "alle anzeigen", finance_order_index_path
|
||||
- unless @orders.empty?
|
||||
%table.table.table-striped
|
||||
%thead
|
||||
%tr
|
||||
%th Lieferantin
|
||||
%th Ende
|
||||
%th.numeric Betrag(FC)
|
||||
%th
|
||||
%tbody
|
||||
- @orders.each do |order|
|
||||
%tr
|
||||
%td= order.name
|
||||
%td= format_date(order.ends)
|
||||
%td.numeric= number_to_currency(order.sum(:fc))
|
||||
%td= link_to "Abrechnen", new_finance_order_path(order_id: order.id), class: 'btn btn-mini'
|
||||
- else
|
||||
Super, alles schon abgerechnet...
|
|
@ -9,10 +9,12 @@
|
|||
|
||||
= f.association :supplier, hint: false
|
||||
= f.input :number
|
||||
= f.input :date
|
||||
= f.input :paid_on
|
||||
= f.input :date, as: :date_picker
|
||||
= f.input :paid_on, as: :date_picker
|
||||
= f.input :amount, as: :string
|
||||
= f.input :deposit, as: :string
|
||||
= f.input :deposit_credit, as: :string
|
||||
= f.input :note
|
||||
= f.submit
|
||||
.form-actions
|
||||
= f.submit class: 'btn'
|
||||
= link_to "oder abbrechen", :back
|
||||
|
|
31
app/views/finance/invoices/_invoices.html.haml
Normal file
31
app/views/finance/invoices/_invoices.html.haml
Normal file
|
@ -0,0 +1,31 @@
|
|||
- if Invoice.count > 20
|
||||
= items_per_page
|
||||
= pagination_links_remote @invoices
|
||||
|
||||
%table.table.table-striped
|
||||
%thead
|
||||
%tr
|
||||
%th Nummer
|
||||
%th Lieferantin
|
||||
%th Datum
|
||||
%th Bezahlt am
|
||||
%th Betrag
|
||||
%th Lieferung
|
||||
%th Bestellung
|
||||
%th Note
|
||||
%th
|
||||
%th
|
||||
%tbody
|
||||
- for invoice in @invoices
|
||||
%tr
|
||||
%td= link_to h(invoice.number), finance_invoice_path(invoice)
|
||||
%td= invoice.supplier.name
|
||||
%td= format_date invoice.date
|
||||
%td= format_date invoice.paid_on
|
||||
%td= number_to_currency invoice.amount
|
||||
%td= link_to "Lieferung", [invoice.supplier,invoice.delivery] if invoice.delivery
|
||||
%td= link_to format_date(invoice.order.ends), new_finance_order_path(order_id: invoice.order_id) if invoice.order
|
||||
%td= truncate(invoice.note)
|
||||
%td= link_to "Bearbeiten", edit_finance_invoice_path(invoice), class: 'btn btn-mini'
|
||||
%td= link_to "Löschen", finance_invoice_path(invoice), :confirm => 'Are you sure?', :method => :delete,
|
||||
class: 'btn btn-danger btn-mini'
|
|
@ -1,5 +1,2 @@
|
|||
- title "Rechnung bearbeiten"
|
||||
= render :partial => 'form'
|
||||
= link_to "Anzeigen", [:finance, @invoice]
|
||||
|
|
||||
\#{link_to 'Zurück', finance_invoices_path}
|
||||
= render :partial => 'form'
|
|
@ -1,30 +1,5 @@
|
|||
- title "Rechnungen"
|
||||
%p= will_paginate @invoices
|
||||
%table.list{:style => "width:70em"}
|
||||
%thead
|
||||
%tr
|
||||
%th Nummer
|
||||
%th Lieferantin
|
||||
%th Datum
|
||||
%th Bezahlt am
|
||||
%th Betrag
|
||||
%th Lieferung
|
||||
%th Bestellung
|
||||
%th Note
|
||||
%th
|
||||
%th
|
||||
%tbody
|
||||
- for invoice in @invoices
|
||||
%tr
|
||||
%td= link_to h(invoice.number), finance_invoice_path(invoice)
|
||||
%td= invoice.supplier.name
|
||||
%td= format_date invoice.date
|
||||
%td= format_date invoice.paid_on
|
||||
%td= number_to_currency invoice.amount
|
||||
%td= link_to "Lieferung", [invoice.supplier,invoice.delivery] if invoice.delivery
|
||||
%td= link_to format_date(invoice.order.ends), new_finance_order_path(order_id: invoice.order_id) if invoice.order
|
||||
%td= truncate(invoice.note)
|
||||
%td= link_to icon(:edit), edit_finance_invoice_path(invoice)
|
||||
%td= link_to icon(:delete), finance_invoice_path(invoice), :confirm => 'Are you sure?', :method => :delete
|
||||
%br/
|
||||
= link_to 'Neue Rechnung anlegen', new_finance_invoice_path
|
||||
|
||||
= link_to 'Neue Rechnung anlegen', new_finance_invoice_path, class: 'btn btn-primary'
|
||||
|
||||
#invoicesTable= render 'invoices'
|
||||
|
|
1
app/views/finance/invoices/index.js.haml
Normal file
1
app/views/finance/invoices/index.js.haml
Normal file
|
@ -0,0 +1 @@
|
|||
$('#invoicesTable').html('#{j(render('invoices'))}');
|
|
@ -1,25 +1,19 @@
|
|||
%h2 Artikel aktualisieren
|
||||
= simple_form_for [:finance, @order, @order_article], remote: true do |form|
|
||||
.modal-header
|
||||
= button_tag "x", class: 'close', data: {dismiss: 'modal'}
|
||||
%h3 Artikel aktualisieren
|
||||
.modal-body
|
||||
= form.input :units_to_order
|
||||
|
||||
= form_for [:finance, @order, @order_article], remote: true do |form|
|
||||
%table
|
||||
%tr
|
||||
%th Name
|
||||
%th Nr.
|
||||
%th
|
||||
%abbr{:title=>"Anzahl gelieferter Gebinde"} Menge
|
||||
%th Einheit
|
||||
%th GebGr
|
||||
%th Netto
|
||||
%th MwSt.
|
||||
%th Pfand
|
||||
%tr
|
||||
%td= text_field_tag 'article[name]', @order_article.article.name, :size => 20
|
||||
%td= text_field_tag 'article[order_number]', @order_article.article.order_number, :size => 3
|
||||
%td= text_field_tag 'order_article[units_to_order]', @order_article.units_to_order, :size => 5
|
||||
%td= text_field_tag 'article[unit]', @order_article.article.unit, :size => 5
|
||||
%td= text_field_tag 'price[unit_quantity]', @order_article.price.unit_quantity, :size => 3
|
||||
%td= text_field_tag 'price[price]', @order_article.price.price, :size => 3
|
||||
%td= text_field_tag 'price[tax]', @order_article.price.tax, :size => 3
|
||||
%td= text_field_tag 'price[deposit]', @order_article.price.deposit, :size => 3
|
||||
%br/
|
||||
= submit_tag "Speichern"
|
||||
= simple_fields_for @order_article.article do |f|
|
||||
= f.input :name
|
||||
= f.input :order_number
|
||||
= f.input :unit
|
||||
= f.input :unit_quantity
|
||||
= f.input :price
|
||||
= f.input :tax
|
||||
= f.input :deposit
|
||||
|
||||
.modal-footer
|
||||
= button_tag "Schließen", class: 'btn', data: {dismiss: 'modal'}
|
||||
= form.submit class: 'btn btn-primary'
|
|
@ -1,6 +1,9 @@
|
|||
%h2
|
||||
Neuer gelieferter Artikel die Bestellung
|
||||
|
||||
= simple_form_for [:finance, @order, @order_article], remote: true do |form|
|
||||
= form.input :article_id, as: :select, collection: new_order_articles_collection
|
||||
= form.submit
|
||||
.modal-header
|
||||
= button_tag "x", class: 'close', data: {dismiss: 'modal'}
|
||||
%h3 Neuer gelieferter Artikel die Bestellung
|
||||
.modal-body
|
||||
= form.input :article_id, as: :select, collection: new_order_articles_collection
|
||||
.modal-footer
|
||||
= button_tag "Schließen", class: 'btn', data: {dismiss: 'modal'}
|
||||
= form.submit class: 'btn btn-primary'
|
|
@ -1,3 +1,2 @@
|
|||
$.fancybox.close();
|
||||
$('#result_table').
|
||||
prepend('#{escape_javascript(render(partial: 'finance/balancing/order_article_result', locals: {order_article: @order_article}))}');
|
||||
$('#modalContainer').modal('hide');
|
||||
$('#result_table').prepend('#{j(render('finance/balancing/order_article_result', order_article: @order_article))}');
|
||||
|
|
|
@ -1 +1,2 @@
|
|||
$.fancybox('#{escape_javascript(render("edit"))}');
|
||||
$('#modalContainer').html('#{j(render("edit"))}');
|
||||
$('#modalContainer').modal();
|
|
@ -1 +1,2 @@
|
|||
$.fancybox('#{escape_javascript(render("new"))}');
|
||||
$('#modalContainer').html('#{j(render("new"))}');
|
||||
$('#modalContainer').modal();
|
|
@ -1,3 +1,2 @@
|
|||
$.fancybox.close();
|
||||
$('#order_article_#{@order_article.id}').
|
||||
html('#{escape_javascript(render(partial: 'finance/balancing/order_article', locals: {order_article: @order_article}))}');
|
||||
$('#modalContainer').modal('hide');
|
||||
$('#order_article_#{@order_article.id}').html('#{j(render('finance/balancing/order_article', order_article: @order_article))}');
|
||||
|
|
|
@ -1,30 +1,20 @@
|
|||
%p
|
||||
Gefunden:
|
||||
= @ordergroups.size
|
||||
%p
|
||||
%table{:style => "width:100%"}
|
||||
%tr
|
||||
%td
|
||||
= pagination_links_remote @ordergroups, :update => :ordergroups, :params => {:sort => params[:sort]}
|
||||
%td{:style => "text-align:right"}
|
||||
- if @ordergroups.size > 20
|
||||
= items_per_page
|
||||
%table.list
|
||||
- if Ordergroup.count > 20
|
||||
= items_per_page
|
||||
= pagination_links_remote @ordergroups
|
||||
%table.table.table-striped
|
||||
%thead
|
||||
%tr
|
||||
%th= sort_link_helper "Name", "name", :per_page => @per_page
|
||||
%th Kontakt
|
||||
%th= sort_link_helper "Kontostand", "account_balance", :per_page => @per_page
|
||||
%th.numeric= sort_link_helper "Kontostand", "account_balance", :per_page => @per_page
|
||||
%th
|
||||
%tbody
|
||||
- for ordergroup in @ordergroups
|
||||
%tr{:class => cycle('even','odd', :name => 'ordergroups')}
|
||||
%tr
|
||||
%td= ordergroup.name
|
||||
%td= ordergroup.contact
|
||||
%td{:class => "currency", :style => "width:5em"}= number_to_currency(ordergroup.account_balance)
|
||||
%td{:class => "actions"}
|
||||
= link_to image_tag("euro_new.png", :size => "16x16", :alt => "Neue Transaktion", :border => "0"),
|
||||
new_finance_ordergroup_transaction_path(ordergroup), :title => "Neue Transaktion"
|
||||
= link_to image_tag("b_browse.png", :size => "16x16", :border => "0", :alt => 'Kontoauszug'),
|
||||
finance_ordergroup_transactions_path(ordergroup), :title => "Kontoauszug"
|
||||
%td.numeric= number_to_currency(ordergroup.account_balance)
|
||||
%td
|
||||
= link_to "Neue Transaktion", new_finance_ordergroup_transaction_path(ordergroup), class: 'btn btn-mini'
|
||||
= link_to "Kontoauszug", finance_ordergroup_transactions_path(ordergroup), class: 'btn btn-mini'
|
||||
|
|
@ -1,20 +1,15 @@
|
|||
- title "Konten verwalten"
|
||||
%p
|
||||
%i
|
||||
Um mehrer Transaktionen auf einmal anzulegen folge bitte diesem
|
||||
= link_to "Link", finance_new_transaction_collection_path
|
||||
|
||||
.left_column{:style=>"width:50em"}
|
||||
.box_title
|
||||
%h2 Bestellgruppen
|
||||
.column_content
|
||||
#group_filter
|
||||
= form_tag finance_ordergroups_path, :method => :get, :style=>"display:inline;", :id => 'ordergroup_search',
|
||||
:remote => true, 'data-submit-onchange' => true do
|
||||
%label{:for => 'article_name'} Suche nach Name:
|
||||
= text_field_tag :query, params[:query], :size => 10
|
||||
#ordergroups
|
||||
= render :partial => "ordergroups"
|
||||
%br/
|
||||
- if @current_user.role_admin?
|
||||
= link_to "Neue Bestellgruppe anlegen", new_admin_ordergroup_path
|
||||
- content_for :sidebar do
|
||||
.well.well-small
|
||||
Hier kannst du mehrere Transaktionen gleichzeitig anlegen:
|
||||
= link_to "Neue Überweisungen eingeben", finance_new_transaction_collection_path, class: 'btn btn-primary'
|
||||
|
||||
.well.well-small
|
||||
= form_tag finance_ordergroups_path, :method => :get, :remote => true,
|
||||
'data-submit-onchange' => true, class: 'form-search' do
|
||||
= text_field_tag :query, params[:query], class: 'input-medium search-query',
|
||||
placeholder: 'Suchen ...'
|
||||
|
||||
#ordergroupsTable
|
||||
= render :partial => "ordergroups"
|
|
@ -1 +1 @@
|
|||
$('#ordergroups').html('#{escape_javascript(render("ordergroups"))}');
|
||||
$('#ordergroupsTable').html('#{escape_javascript(render("ordergroups"))}');
|
||||
|
|
|
@ -33,4 +33,4 @@
|
|||
%footer
|
||||
%p
|
||||
Foodsoft, open source software to manage a non-profit food coop.
|
||||
#modalContainer.modal(tabindex="-1" role="dialog" style="display:none")
|
||||
#modalContainer.modal.hide.fade(tabindex="-1" role="dialog")
|
||||
|
|
|
@ -2,11 +2,9 @@
|
|||
%table.table.table-striped
|
||||
%thead
|
||||
%tr
|
||||
%th{class: sort_td_class_helper(:supplier)}
|
||||
= sort_link_helper "Lieferantin", "supplier"
|
||||
%th= sort_link_helper "Lieferantin", "supplier"
|
||||
%th Start
|
||||
%th{class: sort_td_class_helper(:ends)}
|
||||
= sort_link_helper "Ende", "ends"
|
||||
%th= sort_link_helper "Ende", "ends"
|
||||
%th Status
|
||||
%th{:colspan => "2"}
|
||||
%tbody
|
||||
|
|
|
@ -371,6 +371,8 @@ de:
|
|||
paid_on: Bezahlt am
|
||||
deposit: Pfand berechnet
|
||||
deposit_credit: Pfand gutgeschrieben
|
||||
order_article:
|
||||
units_to_order: Menge
|
||||
|
||||
|
||||
hints:
|
||||
|
@ -386,3 +388,5 @@ de:
|
|||
supplier: ''
|
||||
message:
|
||||
private: Nachricht erscheint nicht im Foodsoft Posteingang
|
||||
order_article:
|
||||
units_to_order: Anzahl gelieferter Gebinde
|
||||
|
|
|
@ -32,8 +32,9 @@ SimpleNavigation::Configuration.run do |navigation|
|
|||
end
|
||||
|
||||
primary.item :finance, 'Finanzen', '#', if: Proc.new { current_user.role_finance? } do |subnav|
|
||||
subnav.item :finance_home, 'Übersicht', finance_root_path
|
||||
subnav.item :accounts, 'Konten verwalten', finance_ordergroups_path, id: nil
|
||||
subnav.item :balancing, 'Bestellungen abrechnen', finance_balancing_path, id: nil
|
||||
subnav.item :balancing, 'Bestellungen abrechnen', finance_order_index_path, id: nil
|
||||
subnav.item :invoices, 'Rechnungen', finance_invoices_path, id: nil
|
||||
end
|
||||
|
||||
|
|
|
@ -125,8 +125,7 @@ Foodsoft::Application.routes.draw do
|
|||
########### Finance
|
||||
|
||||
namespace :finance do
|
||||
root :to => 'balancing#index'
|
||||
match 'balancing/list' => 'balancing#list', :as => 'balancing'
|
||||
root :to => 'base#index'
|
||||
|
||||
resources :order, controller: 'balancing', path: 'balancing' do
|
||||
member do
|
||||
|
|
Loading…
Reference in a new issue