Removed gettext and simplified_localization-plugin. L18n is now the appropriate module.
Upgraded to rails 2.2.2 and replaced complex foodsoft.rb-loader with simple initializers/load_app_config.rb. Multiple foodcoops option is temporarly deactivated.
This commit is contained in:
parent
5b9a7e05df
commit
9f8d0d28ac
121 changed files with 1197 additions and 15237 deletions
|
|
@ -1,12 +1,7 @@
|
|||
require 'user'
|
||||
|
||||
class ApplicationController < ActionController::Base
|
||||
# Gettext For i18n
|
||||
# locale is chosen through browser http request
|
||||
init_gettext "foodsoft"
|
||||
|
||||
before_filter :select_foodcoop, :authenticate, :store_controller
|
||||
# before_filter :ensureUTF8
|
||||
|
||||
#before_filter :select_foodcoop
|
||||
before_filter :authenticate, :store_controller
|
||||
after_filter :send_email_messages, :remove_controller
|
||||
|
||||
# sends a mail, when an error occurs
|
||||
|
|
@ -56,12 +51,12 @@ class ApplicationController < ActionController::Base
|
|||
private
|
||||
|
||||
# selects the foodcoop depending on the subdomain
|
||||
def select_foodcoop
|
||||
# get subdomain and set FoodSoft-class-variable (for later config-requests)
|
||||
FoodSoft.subdomain = request.subdomains.first
|
||||
# set database-connection
|
||||
ActiveRecord::Base.establish_connection(FoodSoft.get_database)
|
||||
end
|
||||
# def select_foodcoop
|
||||
# # get subdomain and set FoodSoft-class-variable (for later config-requests)
|
||||
# FoodSoft.subdomain = request.subdomains.first
|
||||
# # set database-connection
|
||||
# ActiveRecord::Base.establish_connection(FoodSoft.get_database)
|
||||
# end
|
||||
|
||||
# Ensures the HTTP content-type encoding is set to "UTF-8" for "text/html" contents.
|
||||
def ensureUTF8
|
||||
|
|
|
|||
|
|
@ -163,7 +163,7 @@ class FinanceController < ApplicationController
|
|||
def createArticleResult
|
||||
render :update do |page|
|
||||
@article = OrderArticleResult.new(params[:order_article_result])
|
||||
@article.fc_markup = FoodSoft::getPriceMarkup
|
||||
@article.fc_markup = APP_CONFIG[:price_markup]
|
||||
@article.make_gross if @article.tax && @article.deposit && @article.net_price
|
||||
if @article.valid?
|
||||
@article.save
|
||||
|
|
|
|||
|
|
@ -118,7 +118,7 @@ class MessagesController < ApplicationController
|
|||
@message = Message.new(
|
||||
:recipient => message.sender,
|
||||
:subject => "Re: #{message.subject}",
|
||||
:body => "#{message.sender.nick} schrieb am #{FoodSoft::format_date(message.created_on)} um #{FoodSoft::format_time(message.created_on)}:\n"
|
||||
:body => "#{message.sender.nick} schrieb am #{I18n.l(message.created_on.to_date)} um #{I18n.l(message.created_on, :format => :time)}:\n"
|
||||
)
|
||||
if (message.body)
|
||||
message.body.each_line{|l| @message.body += "> #{l}"}
|
||||
|
|
|
|||
|
|
@ -133,13 +133,13 @@ class OrdersController < ApplicationController
|
|||
def text_fax_template
|
||||
order = Order.find(params[:id])
|
||||
supplier = order.supplier
|
||||
contact = FoodSoft.getFoodcoopContact
|
||||
text = _("Order for") + " #{FoodSoft.getFoodcoopName}"
|
||||
contact = APP_CONFIG[:contact].symbolize_keys
|
||||
text = _("Order for") + " #{APP_CONFIG[:name]}"
|
||||
text += "\n" + _("Customer number") + ": #{supplier.customer_number}" unless supplier.customer_number.blank?
|
||||
text += "\n" + _("Delivery date") + ": "
|
||||
text += "\n\n#{supplier.name}\n#{supplier.address}\nFAX: #{supplier.fax}\n\n"
|
||||
text += "****** " + _("Shipping address") + "\n\n"
|
||||
text += "#{FoodSoft.getFoodcoopName}\n#{contact[:street]}\n#{contact[:zip_code]} #{contact[:city]}\n\n"
|
||||
text += "#{APP_CONFIG[:name]}\n#{contact[:street]}\n#{contact[:zip_code]} #{contact[:city]}\n\n"
|
||||
text += "****** " + _("Articles") + "\n\n"
|
||||
text += _("Number") + " " + _("Quantity") + " " + _("Name") + "\n"
|
||||
# now display all ordered articles
|
||||
|
|
|
|||
|
|
@ -2,11 +2,15 @@
|
|||
module ApplicationHelper
|
||||
|
||||
def format_time(time = Time.now)
|
||||
FoodSoft::format_date_time(time) unless time.nil?
|
||||
I18n.l time, :format => "%d.%m.%Y %H:%M"
|
||||
end
|
||||
|
||||
def format_date(time = Time.now)
|
||||
FoodSoft::format_date(time) unless time.nil?
|
||||
I18n.l time.to_date
|
||||
end
|
||||
|
||||
def format_datetime(time = Time.now)
|
||||
I18n.l time
|
||||
end
|
||||
|
||||
# Creates ajax-controlled-links for pagination
|
||||
|
|
|
|||
|
|
@ -31,22 +31,22 @@ class Article < ActiveRecord::Base
|
|||
|
||||
# Custom attribute setter that accepts decimal numbers using localized decimal separator.
|
||||
def net_price=(net_price)
|
||||
self[:net_price] = FoodSoft::delocalizeDecimalString(net_price)
|
||||
self[:net_price] = String.delocalized_decimal(net_price)
|
||||
end
|
||||
|
||||
# Custom attribute setter that accepts decimal numbers using localized decimal separator.
|
||||
def tax=(tax)
|
||||
self[:tax] = FoodSoft::delocalizeDecimalString(tax)
|
||||
self[:tax] = String.delocalized_decimal(tax)
|
||||
end
|
||||
|
||||
# Custom attribute setter that accepts decimal numbers using localized decimal separator.
|
||||
def deposit=(deposit)
|
||||
self[:deposit] = FoodSoft::delocalizeDecimalString(deposit)
|
||||
self[:deposit] = String.delocalized_decimal(deposit)
|
||||
end
|
||||
|
||||
# calculate the fc price and sets the attribute
|
||||
def calc_gross_price
|
||||
self.gross_price = ((net_price + deposit) * (tax / 100 + 1)) * (FoodSoft::getPriceMarkup / 100 + 1)
|
||||
self.gross_price = ((net_price + deposit) * (tax / 100 + 1)) * (APP_CONFIG[:price_markup] / 100 + 1)
|
||||
end
|
||||
|
||||
# Returns true if article has been updated at least 2 days ago
|
||||
|
|
@ -150,7 +150,7 @@ class Article < ActiveRecord::Base
|
|||
end
|
||||
|
||||
# convert units in foodcoop-size
|
||||
# uses FoodSoft.get_units_factors to calc the price/unit_quantity
|
||||
# uses unit factors in app_config.yml to calc the price/unit_quantity
|
||||
# returns new price and unit_quantity in array, when calc is possible => [price, unit_quanity]
|
||||
# returns false if units aren't foodsoft-compatible
|
||||
# returns nil if units are eqal
|
||||
|
|
@ -166,7 +166,8 @@ class Article < ActiveRecord::Base
|
|||
false
|
||||
end
|
||||
else # get factors for fc and supplier
|
||||
fc_unit_factor, supplier_unit_factor = FoodSoft.get_units_factors[self.unit], FoodSoft.get_units_factors[self.shared_article.unit]
|
||||
fc_unit_factor = APP_CONFIG[:units][self.unit]
|
||||
supplier_unit_factor = APP_CONFIG[:units][self.shared_article.unit]
|
||||
if fc_unit_factor and supplier_unit_factor
|
||||
convertion_factor = fc_unit_factor / supplier_unit_factor
|
||||
new_price = BigDecimal((convertion_factor * shared_article.price).to_s).round(2)
|
||||
|
|
|
|||
|
|
@ -1,6 +1,4 @@
|
|||
class Assignment < ActiveRecord::Base
|
||||
# gettext-option
|
||||
untranslate_all
|
||||
|
||||
belongs_to :user
|
||||
belongs_to :task
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ class FinancialTransaction < ActiveRecord::Base
|
|||
|
||||
# Custom attribute setter that accepts decimal numbers using localized decimal separator.
|
||||
def amount=(amount)
|
||||
self[:amount] = FoodSoft::delocalizeDecimalString(amount)
|
||||
self[:amount] = String.delocalized_decimal(amount)
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
|||
|
|
@ -10,8 +10,6 @@
|
|||
# * updated_by (User): the user who last updated this order
|
||||
#
|
||||
class GroupOrder < ActiveRecord::Base
|
||||
# gettext-option
|
||||
untranslate_all
|
||||
|
||||
belongs_to :order
|
||||
belongs_to :order_group
|
||||
|
|
|
|||
|
|
@ -9,8 +9,6 @@
|
|||
# * updated_on (timestamp): updated automatically by ActiveRecord
|
||||
#
|
||||
class GroupOrderArticle < ActiveRecord::Base
|
||||
# gettext-option
|
||||
untranslate_all
|
||||
|
||||
belongs_to :group_order
|
||||
belongs_to :order_article
|
||||
|
|
|
|||
|
|
@ -8,8 +8,6 @@
|
|||
# * created_on (timestamp)
|
||||
|
||||
class GroupOrderArticleQuantity < ActiveRecord::Base
|
||||
# gettext-option
|
||||
untranslate_all
|
||||
|
||||
belongs_to :group_order_article
|
||||
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ class GroupOrderArticleResult < ActiveRecord::Base
|
|||
|
||||
# Custom attribute setter that accepts decimal numbers using localized decimal separator.
|
||||
def quantity=(quantity)
|
||||
self[:quantity] = FoodSoft::delocalizeDecimalString(quantity)
|
||||
self[:quantity] = String.delocalized_decimal(quantity)
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
|||
|
|
@ -6,8 +6,6 @@
|
|||
# * group_order_article_results: collection of associated GroupOrderArticleResults
|
||||
#
|
||||
class GroupOrderResult < ActiveRecord::Base
|
||||
# gettext-option
|
||||
untranslate_all
|
||||
|
||||
belongs_to :order
|
||||
has_many :group_order_article_results, :dependent => :destroy
|
||||
|
|
|
|||
|
|
@ -5,37 +5,37 @@ class Mailer < ActionMailer::Base
|
|||
# Assumes user.setResetPasswordToken has been successfully called already.
|
||||
def password(user)
|
||||
request = ApplicationController.current.request
|
||||
subject "[#{FoodSoft::getFoodcoopName}] Neues Passwort für/ New password for " + user.nick
|
||||
subject "[#{APP_CONFIG[:name]}] Neues Passwort für/ New password for " + user.nick
|
||||
recipients user.email
|
||||
from "FoodSoft <#{FoodSoft::getEmailSender}>"
|
||||
from "FoodSoft <#{APP_CONFIG[:email_sender]}>"
|
||||
body :user => user,
|
||||
:link => url_for(:host => FoodSoft::getHost || request.host, :controller => "login", :action => "password", :id => user.id, :token => user.reset_password_token),
|
||||
:foodsoftUrl => url_for(:host => FoodSoft::getHost || request.host, :controller => "index")
|
||||
:link => url_for(:host => request.host, :controller => "login", :action => "password", :id => user.id, :token => user.reset_password_token),
|
||||
:foodsoftUrl => url_for(:host => request.host, :controller => "index")
|
||||
end
|
||||
|
||||
# Sends an email copy of the given internal foodsoft message.
|
||||
def message(message)
|
||||
request = ApplicationController.current.request
|
||||
subject "[#{FoodSoft::getFoodcoopName}] " + message.subject
|
||||
subject "[#{APP_CONFIG[:name]}] " + message.subject
|
||||
recipients message.recipient.email
|
||||
from (message.system_message? ? "FoodSoft <#{FoodSoft::getEmailSender}>" : "#{message.sender.nick} <#{message.sender.email}>")
|
||||
from (message.system_message? ? "FoodSoft <#{APP_CONFIG[:email_sender]}>" : "#{message.sender.nick} <#{message.sender.email}>")
|
||||
body :body => message.body, :sender => (message.system_message? ? 'Foodsoft' : message.sender.nick),
|
||||
:recipients => message.recipients,
|
||||
:reply => url_for(:host => FoodSoft::getHost || request.host, :controller => "messages", :action => "reply", :id => message),
|
||||
:profile => url_for(:host => FoodSoft::getHost || request.host, :controller => "index", :action => "myProfile", :id => message.recipient),
|
||||
:link => url_for(:host => FoodSoft::getHost || request.host, :controller => "messages", :action => "show", :id => message),
|
||||
:foodsoftUrl => url_for(:host => FoodSoft::getHost || request.host, :controller => "index")
|
||||
:reply => url_for(:host => request.host, :controller => "messages", :action => "reply", :id => message),
|
||||
:profile => url_for(:host => request.host, :controller => "index", :action => "myProfile", :id => message.recipient),
|
||||
:link => url_for(:host => request.host, :controller => "messages", :action => "show", :id => message),
|
||||
:foodsoftUrl => url_for(:host => request.host, :controller => "index")
|
||||
end
|
||||
|
||||
# Sends an invite email.
|
||||
def invite(invite)
|
||||
request = ApplicationController.current.request
|
||||
subject "Einladung in die Foodcoop #{FoodSoft::getFoodcoopName} - Invitation to the Foodcoop"
|
||||
subject "Einladung in die Foodcoop #{APP_CONFIG[:name]} - Invitation to the Foodcoop"
|
||||
recipients invite.email
|
||||
from "FoodSoft <#{FoodSoft::getEmailSender}>"
|
||||
from "FoodSoft <#{APP_CONFIG[:email_sender]}>"
|
||||
body :invite => invite,
|
||||
:link => url_for(:host => FoodSoft::getHost || request.host, :controller => "login", :action => "invite", :id => invite.token),
|
||||
:foodsoftUrl => url_for(:host => FoodSoft::getHost || request.host, :controller => "index")
|
||||
:link => url_for(:host => request.host, :controller => "login", :action => "invite", :id => invite.token),
|
||||
:foodsoftUrl => url_for(:host => request.host, :controller => "index")
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,8 +1,5 @@
|
|||
class Membership < ActiveRecord::Base
|
||||
|
||||
# gettext-option
|
||||
untranslate_all
|
||||
|
||||
belongs_to :user
|
||||
belongs_to :group
|
||||
|
||||
|
|
|
|||
|
|
@ -14,8 +14,6 @@ class Message < ActiveRecord::Base
|
|||
|
||||
attr_accessible :recipient_id, :recipient, :subject, :body, :recipients
|
||||
|
||||
# needed for method 'from_template'
|
||||
include GetText::Rails
|
||||
|
||||
# Values for the email_state attribute: :none, :pending, :sent, :failed
|
||||
EMAIL_STATE = {
|
||||
|
|
|
|||
|
|
@ -26,17 +26,17 @@ class Order < ActiveRecord::Base
|
|||
|
||||
# Custom attribute setter that accepts decimal numbers using localized decimal separator.
|
||||
def invoice_amount=(amount)
|
||||
self[:invoice_amount] = FoodSoft::delocalizeDecimalString(amount)
|
||||
self[:invoice_amount] = String.delocalized_decimal(amount)
|
||||
end
|
||||
|
||||
# Custom attribute setter that accepts decimal numbers using localized decimal separator.
|
||||
def deposit=(deposit)
|
||||
self[:deposit] = FoodSoft::delocalizeDecimalString(deposit)
|
||||
self[:deposit] = String.delocalized_decimal(deposit)
|
||||
end
|
||||
|
||||
# Custom attribute setter that accepts decimal numbers using localized decimal separator.
|
||||
def deposit_credit=(deposit)
|
||||
self[:deposit_credit] = FoodSoft::delocalizeDecimalString(deposit)
|
||||
self[:deposit_credit] = String.delocalized_decimal(deposit)
|
||||
end
|
||||
|
||||
# Create or destroy OrderArticle associations on create/update
|
||||
|
|
@ -169,7 +169,7 @@ class Order < ActiveRecord::Base
|
|||
:gross_price => oa.article.gross_price,
|
||||
:tax => oa.article.tax,
|
||||
:deposit => oa.article.deposit,
|
||||
:fc_markup => FoodSoft::getPriceMarkup,
|
||||
:fc_markup => APP_CONFIG[:price_markup],
|
||||
:order_number => oa.article.order_number,
|
||||
:unit_quantity => oa.article.unit_quantity,
|
||||
:units_to_order => oa.units_to_order)
|
||||
|
|
|
|||
|
|
@ -8,10 +8,7 @@
|
|||
# * units_to_order (int): number of packaging units to be ordered according to the order quantity/tolerance
|
||||
#
|
||||
class OrderArticle < ActiveRecord::Base
|
||||
|
||||
# gettext-option
|
||||
untranslate_all
|
||||
|
||||
|
||||
belongs_to :order
|
||||
belongs_to :article
|
||||
has_many :group_order_articles, :dependent => :destroy
|
||||
|
|
|
|||
|
|
@ -28,22 +28,22 @@ class OrderArticleResult < ActiveRecord::Base
|
|||
|
||||
# Custom attribute setter that accepts decimal numbers using localized decimal separator.
|
||||
def net_price=(net_price)
|
||||
self[:net_price] = FoodSoft::delocalizeDecimalString(net_price)
|
||||
self[:net_price] = String.delocalized_decimal(net_price)
|
||||
end
|
||||
|
||||
# Custom attribute setter that accepts decimal numbers using localized decimal separator.
|
||||
def tax=(tax)
|
||||
self[:tax] = FoodSoft::delocalizeDecimalString(tax)
|
||||
self[:tax] = String.delocalized_decimal(tax)
|
||||
end
|
||||
|
||||
# Custom attribute setter that accepts decimal numbers using localized decimal separator.
|
||||
def deposit=(deposit)
|
||||
self[:deposit] = FoodSoft::delocalizeDecimalString(deposit)
|
||||
self[:deposit] = String.delocalized_decimal(deposit)
|
||||
end
|
||||
|
||||
# Custom attribute setter that accepts decimal numbers using localized decimal separator.
|
||||
def units_to_order=(units_to_order)
|
||||
self[:units_to_order] = FoodSoft::delocalizeDecimalString(units_to_order)
|
||||
self[:units_to_order] = String.delocalized_decimal(units_to_order)
|
||||
end
|
||||
|
||||
# counts from every GroupOrderArticleResult for this ArticleResult
|
||||
|
|
|
|||
|
|
@ -1,10 +1,7 @@
|
|||
class SharedArticle < ActiveRecord::Base
|
||||
|
||||
# gettext-option
|
||||
untranslate_all
|
||||
|
||||
# connect to database from sharedLists-Application
|
||||
SharedArticle.establish_connection(FoodSoft::get_shared_lists_config)
|
||||
SharedArticle.establish_connection(APP_CONFIG[:shared_lists])
|
||||
# set correct table_name in external DB
|
||||
set_table_name :articles
|
||||
|
||||
|
|
|
|||
|
|
@ -1,9 +1,7 @@
|
|||
class SharedSupplier < ActiveRecord::Base
|
||||
# used for gettext
|
||||
untranslate_all
|
||||
|
||||
# connect to database from sharedLists-Application
|
||||
SharedSupplier.establish_connection(FoodSoft::get_shared_lists_config)
|
||||
SharedSupplier.establish_connection(APP_CONFIG[:shared_lists])
|
||||
# set correct table_name in external DB
|
||||
set_table_name :suppliers
|
||||
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ require 'digest/sha1'
|
|||
class User < ActiveRecord::Base
|
||||
has_many :memberships, :dependent => :destroy
|
||||
has_many :groups, :through => :memberships
|
||||
has_many :order_groups, :through => :memberships, :source => :group
|
||||
has_many :assignments, :dependent => :destroy
|
||||
has_many :tasks, :through => :assignments
|
||||
|
||||
|
|
@ -119,8 +120,9 @@ class User < ActiveRecord::Base
|
|||
end
|
||||
|
||||
# Returns the user's OrderGroup or nil if none found.
|
||||
def find_ordergroup
|
||||
groups.find(:first, :conditions => "type = 'OrderGroup'")
|
||||
def find_ordergroup
|
||||
order_groups.first
|
||||
#groups.find(:first, :conditions => "type = 'OrderGroup'")
|
||||
end
|
||||
|
||||
# Find all tasks, for which the current user should be responsible
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@
|
|||
%td=h user.last_name
|
||||
%td=h user.email
|
||||
%td=h roles.join(', ')
|
||||
%td=h FoodSoft::format_date_time(user.last_login)
|
||||
%td=h format_date_time(user.last_login)
|
||||
%td
|
||||
= link_to(image_tag('b_edit.png', :size => "16x16", :border => "0", :alt => 'Benutzer_in bearbeiten', :title => 'Benutzer_in bearbeiten'), :action => 'editUser', :id => user)
|
||||
= link_to(image_tag('b_drop.png', :size => "16x16", :border => "0", :alt => 'Benutzer_in löschen', :title => 'Benutzer_in löschen'), |
|
||||
|
|
|
|||
|
|
@ -56,5 +56,5 @@
|
|||
%td{:colspan => "4"}
|
||||
%b
|
||||
%abbr{:title => "= Gruppenbeträge - Rechnung ohne Pfand"} Differenz mit Aufschlag
|
||||
= "(#{number_to_percentage(FoodSoft.getPriceMarkup)}):"
|
||||
= "(#{number_to_percentage(APP_CONFIG[:price_markup])}):"
|
||||
%span#fcProfit= number_to_currency(@order.fcProfit)
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
#logo
|
||||
%a{:href => "/"}
|
||||
<span>food</span>soft
|
||||
%span{:style => "color:white; font-size:45%; letter-spacing: -1px;"}= FoodSoft::getFoodcoopName
|
||||
%span{:style => "color:white; font-size:45%; letter-spacing: -1px;"}= APP_CONFIG[:name]
|
||||
#nav= render :partial => 'shared/nav'
|
||||
|
||||
#main
|
||||
|
|
|
|||
|
|
@ -12,4 +12,4 @@
|
|||
= yield
|
||||
#meta
|
||||
Foodcoop
|
||||
= link_to_if FoodSoft::getFoodcoopUrl, FoodSoft::getFoodcoopName, FoodSoft::getFoodcoopUrl
|
||||
= link_to_if APP_CONFIG[:base_url], APP_CONFIG[:name], APP_CONFIG[:base_url]
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
Hallo <%= user.nick %>!
|
||||
|
||||
Der Kontostand deiner Bestellgruppe <%= group.name %> ist durch eine Buchung am <%= transaction.created_on.strftime('%d.%m.%Y um %H:%M') %> ins Minus gerutscht: <%= FoodSoft::format_currency(group.account_balance) %>
|
||||
Der Kontostand deiner Bestellgruppe <%= group.name %> ist durch eine Buchung am <%= transaction.created_on.strftime('%d.%m.%Y um %H:%M') %> ins Minus gerutscht: <%= group.account_balance %>
|
||||
|
||||
Es wurden <%= FoodSoft::format_currency(transaction.amount) %> für "<%= transaction.note %>" abgebucht, die Buchung wurde von <%= transaction.user.nick %> erstellt.
|
||||
Es wurden <%= transaction.amount %> für "<%= transaction.note %>" abgebucht, die Buchung wurde von <%= transaction.user.nick %> erstellt.
|
||||
|
||||
Bitte zahlt so bald wie möglich wieder Geld ein, um das Gruppenkonto auszugleichen.
|
||||
|
||||
Viele Grüße von <%= FoodSoft::getFoodcoopName %>
|
||||
Viele Grüße von <%= APP_CONFIG[:name] %>
|
||||
|
|
@ -5,10 +5,10 @@ Die Bestellung "<%= order.name %>" wurde am <%= order.ends.strftime('%d.%m.%Y um
|
|||
Für deine Bestellgruppe <%= group.name %> wurden die folgenden Artikel bestellt:
|
||||
<% for result in results
|
||||
article = result.order_article_result -%>
|
||||
<%= article.name %>: <%= result.quantity %> x <%= article.unit %> = <%= FoodSoft::format_currency(result.quantity * article.gross_price) %>
|
||||
<%= article.name %>: <%= result.quantity %> x <%= article.unit %> = <%= result.quantity * article.gross_price %>
|
||||
<% end -%>
|
||||
Gesamtpreis: <%= FoodSoft::format_currency(total) %>
|
||||
Gesamtpreis: <%= total %>
|
||||
|
||||
Bestellung online einsehen: <%= ApplicationController.current.url_for(:controller => 'ordering', :action => 'my_order_result', :id => order.id) %>
|
||||
|
||||
Viele Grüße von <%= FoodSoft::getFoodcoopName %>
|
||||
Viele Grüße von <%= APP_CONFIG[:name] %>
|
||||
|
|
@ -125,7 +125,7 @@
|
|||
<%= button_to_function('-', "decreaseTolerance(#{i})") %>
|
||||
<% end -%>
|
||||
</td>
|
||||
<td id="td_price_<%= i %>" style="text-align:right; padding-right:10px; width:4em"><span id="price_<%= i %>_display"><%= number_to_currency(article_total, :unit => "") %></span> <%= FoodSoft::getCurrencyUnit %></td>
|
||||
<td id="td_price_<%= i %>" style="text-align:right; padding-right:10px; width:4em"><span id="price_<%= i %>_display"><%= number_to_currency(article_total, :unit => "") %></span> <%= l18n.number.currency.format.unit %></td>
|
||||
</tr>
|
||||
<% unless order_article.article.note.empty? -%>
|
||||
<tr id="note_<%= i %>" class="note" style="display:none">
|
||||
|
|
@ -139,7 +139,7 @@
|
|||
<tfoot>
|
||||
<tr>
|
||||
<td colspan="6"></td>
|
||||
<td colspan="3" class="currency"><%=_ "Total amount" %>: <span id="total_price"><%= total %></span> <%= FoodSoft::getCurrencyUnit %></td>
|
||||
<td colspan="3" class="currency"><%=_ "Total amount" %>: <span id="total_price"><%= total %></span> <%= l18n.number.currency.format.unit %></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="6"></td>
|
||||
|
|
@ -147,7 +147,7 @@
|
|||
</tr>
|
||||
<tr>
|
||||
<td colspan="6"></td>
|
||||
<td colspan="3" class="currency"><%=_ "New account balance"%>: <strong><span id="new_balance"><%= @order_group.account_balance - total %></span> <%= FoodSoft::getCurrencyUnit %></strong></td>
|
||||
<td colspan="3" class="currency"><%=_ "New account balance"%>: <strong><span id="new_balance"><%= @order_group.account_balance - total %></span> <%= l18n.number.currency.format.unit %></strong></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="text-align:left;"><%= link_to_top %></td>
|
||||
|
|
@ -171,7 +171,7 @@
|
|||
setGroupBalance(<%= @availableFunds %>);
|
||||
|
||||
// localization
|
||||
setDecimalSeparator("<%= FoodSoft::getDecimalSeparator %>");
|
||||
setDecimalSeparator("<%= l18n.number.currency.format.separator %>");
|
||||
|
||||
// initialize javascript
|
||||
updateBalance();
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@
|
|||
@ends = @order.ends.strftime('%d.%m.%Y').to_s
|
||||
@title = replace_UTF8(@order.name.to_s) + " | beendet am " + @ends
|
||||
|
||||
pdf.SetAuthor(FoodSoft.getFoodcoopName)
|
||||
pdf.SetAuthor(APP_CONFIG[:name])
|
||||
pdf.SetTitle(replace_UTF8("Artikelsortierung für #{@order.name}, #{format_date(@order.ends)}"))
|
||||
pdf.AliasNbPages()
|
||||
pdf.AddPage()
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
|
||||
@order_articles = @order.order_article_results
|
||||
|
||||
pdf.SetAuthor(replace_UTF8(FoodSoft.getFoodcoopName))
|
||||
pdf.SetAuthor(replace_UTF8(APP_CONFIG[:name]))
|
||||
pdf.SetTitle(replace_UTF8("BestellFAX für #{@order.supplier.name}"))
|
||||
pdf.AliasNbPages()
|
||||
pdf.AddPage()
|
||||
|
|
@ -19,15 +19,15 @@
|
|||
#the main informations
|
||||
pdf.SetY(15)
|
||||
pdf.SetFont('Arial','',10)
|
||||
pdf.Cell(0,5,replace_UTF8(FoodSoft.getFoodcoopName),0,0,'R')
|
||||
pdf.Cell(0,5,replace_UTF8(APP_CONFIG[:name]),0,0,'R')
|
||||
pdf.Ln()
|
||||
pdf.Cell(0,5,replace_UTF8(FoodSoft.getFoodcoopContact[:street]),0,0,'R')
|
||||
pdf.Cell(0,5,replace_UTF8(APP_CONFIG[:contact].symbolize_keys[:street]),0,0,'R')
|
||||
pdf.Ln()
|
||||
pdf.Cell(0,5,FoodSoft.getFoodcoopContact[:zip_code] + " " + replace_UTF8(FoodSoft.getFoodcoopContact[:city]),0,0,'R')
|
||||
pdf.Cell(0,5,APP_CONFIG[:contact].symbolize_keys[:zip_code] + " " + replace_UTF8(APP_CONFIG[:contact].symbolize_keys[:city]),0,0,'R')
|
||||
pdf.Ln()
|
||||
pdf.Cell(0,5,replace_UTF8(FoodSoft.getFoodcoopName[:phone]),0,0,'R')
|
||||
pdf.Cell(0,5,replace_UTF8(APP_CONFIG[:name][:phone]),0,0,'R')
|
||||
pdf.Ln()
|
||||
pdf.Cell(0,5,replace_UTF8(FoodSoft.getFoodcoopName[:email]),0,0,'R')
|
||||
pdf.Cell(0,5,replace_UTF8(APP_CONFIG[:name][:email]),0,0,'R')
|
||||
pdf.Ln()
|
||||
pdf.Cell(0,5,Date.today.strftime('%d.%m.%Y').to_s,0,0,'R')
|
||||
pdf.Ln()
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@
|
|||
@ends = @order.ends.strftime('%d.%m.%Y').to_s
|
||||
@title = replace_UTF8(@order.name.to_s) + " | beendet am " + @ends
|
||||
|
||||
pdf.SetAuthor(FoodSoft.getFoodcoopName)
|
||||
pdf.SetAuthor(APP_CONFIG[:name])
|
||||
pdf.SetTitle(replace_UTF8("GruppenSortierung für #{@order.name}, #{format_date(@order.ends)}"))
|
||||
pdf.SetFillColor(235)
|
||||
pdf.AliasNbPages()
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@
|
|||
MAX_ARTICLES_PER_PAGE = 15 #how many articles shoud written on a page
|
||||
|
||||
pdf=PDF.new
|
||||
pdf.SetAuthor(FoodSoft.getFoodcoopName)
|
||||
pdf.SetAuthor(APP_CONFIG[:name])
|
||||
@starts = @order.starts.strftime('%d.%m.%Y').to_s
|
||||
@ends = @order.ends.strftime('%d.%m.%Y').to_s
|
||||
@title = replace_UTF8(@order.name.to_s) + " | beendet am " + @ends
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
%li
|
||||
= image_tag 'b_user.png' , :size => '7x10', :border => 0, :alt => _("User")
|
||||
= link_to h(@current_user.nick), { :controller => 'index', :action => 'myProfile' }, { :title => _("User Settings") }
|
||||
- if FoodSoft::getFoodcoopUrl
|
||||
%li= link_to FoodSoft::getFoodcoopName, FoodSoft::getFoodcoopUrl, { :title => _("Go to your FoodCoop-Hompage") }
|
||||
- if APP_CONFIG[:base_url]
|
||||
%li= link_to APP_CONFIG[:name], APP_CONFIG[:base_url], { :title => _("Go to your FoodCoop-Hompage") }
|
||||
%li= link_to _("Help"), 'http://dev.foodcoops.net/wiki/FoodsoftDoku'
|
||||
%li= link_to _("Logout"), :controller => '/login', :action => 'logout'
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
--
|
||||
FoodSoft: <%= @foodsoftUrl %>
|
||||
Foodcoop-Homepage: <%= FoodSoft::getFoodcoopUrl %>
|
||||
Hilfe/Help: <%= FoodSoft::getHelp %>
|
||||
Foodcoop-Homepage: <%= APP_CONFIG[:base_url] %>
|
||||
Hilfe/Help: <%= APP_CONFIG[:help_url] %>
|
||||
Loading…
Add table
Add a link
Reference in a new issue