Permalink
Browse files

Clean code

  • Loading branch information...
burisu committed Aug 21, 2018
1 parent 366331c commit 9e56fc6e7481d8119699bf59b6bb6991953b868d
View
@@ -541,11 +541,9 @@ def human_total_cost
def total_cost_per_area(area_unit = :hectare)
zone_area = working_zone_area(area_unit).to_f.round(2)
if zone_area > 0.0
(total_cost / zone_area) * area_cost_coefficient
end
(total_cost / zone_area) * area_cost_coefficient if zone_area > 0.0
end
def area_cost_coefficient
zone_area = working_zone_area(:hectare).to_f.round(2)
global_area = activity_production_zone_area(:hectare).to_f.round(2)
@@ -554,7 +552,7 @@ def area_cost_coefficient
if zone_area && global_area && global_area > 0.0
coef = zone_area / global_area
end
return coef
coef
end
def currency
@@ -566,7 +564,7 @@ def earn(role = :output)
return params.map(&:earn).compact.sum if params.any?
nil
end
# return all working zone area of targets
def working_zone_area(*args)
options = args.extract_options!
@@ -577,7 +575,7 @@ def working_zone_area(*args)
area ||= 0.0.in(unit)
area
end
# return all initial area of supports of targets
def activity_production_zone_area(*args)
options = args.extract_options!
@@ -20,11 +20,6 @@ arb:
doer_cost: "تكلفة الفاعل"
doer_name: "اسم الفاعل"
doers_name: "اسم الظالمين"
tools_name: "اسم الأدوات"
targets_name: "اسم الهدف"
support_irrigated: "دعم المروية"
support_nitrate_fixing: "دعم نترات تحديد"
total_cost_per_area: "التكلفة الإجمالية لكل منطقة"
duration_in_hour: "مدة في ساعة"
ede_cattling_number: "إيدي عدد cattling"
ede_owner_number: "عدد مالك إيدي"
@@ -99,7 +94,12 @@ arb:
stock_production: "إنتاج الأوراق المالية" #?
stocks_variation: "الأسهم الاختلاف" #?
subsidies: "الدعم" #?
support_irrigated: "دعم المروية" #?
support_nitrate_fixing: "دعم نترات تحديد" #?
target_name: "اسم الهدف" #?
targets_name: "اسم الهدف"
tools_name: "اسم الأدوات"
total_cost_per_area: "التكلفة الإجمالية لكل منطقة" #?
variable_name: "اسم المتغير" #?
variant_name: "اسم البديل"
variant_variety: "متنوعة متفاوتة" #?
@@ -1702,7 +1702,7 @@ arb:
inventories: "عمليات الجرد" #?
inventory: "عملية الجرد"
inventory_id: "عملية جرد" #?
inventory_items: "طرق الجرد" #?
inventory_items: "طرق الجرد"
invitation_accepted_at: "دعوة مقبولة في"
invitation_created_at: "دعوة التي تم إنشاؤها في"
invitation_limit: "حد دعوة"
@@ -20,11 +20,6 @@ cmn:
doer_cost: "杜尔成本"
doer_name: "杜尔名"
doers_name: "实干家名"
tools_name: "工具名稱"
targets_name: "目標名稱"
support_irrigated: "支持灌溉"
support_nitrate_fixing: "支持硝酸鹽固定"
total_cost_per_area: "總面積成本"
duration_in_hour: "持续时间小时"
ede_cattling_number: "义德cattling号"
ede_owner_number: "义德业主号"
@@ -99,7 +94,12 @@ cmn:
stock_production: "按库存生产" #?
stocks_variation: "库存变化" #?
subsidies: "补贴" #?
support_irrigated: "支持灌溉" #?
support_nitrate_fixing: "支持硝酸鹽固定" #?
target_name: "指标名称" #?
targets_name: "目標名稱"
tools_name: "工具名稱"
total_cost_per_area: "總面積成本" #?
variable_name: "变量名" #?
variant_name: "版本名称"
variant_variety: "变异品种" #?
@@ -909,6 +909,7 @@ cmn:
intracommunity_payable_account: "社区内应付账款"
introduction: "介绍"
inventory: "库存"
# inventory_items: "Inventory items"
invitation_accepted_at: "已接受邀请在"
invitation_created_at: "在邀请函创建"
invitation_limit: "邀请极限"
@@ -20,11 +20,6 @@ deu:
doer_cost: "Macher Kosten"
doer_name: "Macher Name"
doers_name: "Macher Name"
tools_name: "Werkzeugname"
targets_name: "Zielname"
support_irrigated: "Unterstützung bewässert"
support_nitrate_fixing: "Support Nitratfixierung"
total_cost_per_area: "Gesamtkosten pro Fläche"
duration_in_hour: "Laufzeit in Stunden"
ede_cattling_number: "Ede cattling Nummer"
ede_owner_number: "Ede Inhaber Zahl"
@@ -98,6 +93,11 @@ deu:
stock_production: "Auf Produktions" #?
stocks_variation: "Aktien Variation" #?
subsidies: "Subventionen" #?
support_irrigated: "Unterstützung bewässert" #?
support_nitrate_fixing: "Support Nitratfixierung" #?
targets_name: "Zielname"
tools_name: "Werkzeugname"
total_cost_per_area: "Gesamtkosten pro Fläche" #?
variant_name: "Name der Variante"
vine_yield: "Vine Ausbeute"
wages: "Lohn" #?
@@ -909,6 +909,7 @@ deu:
intracommunity_payable_account: "Inner zahlbar Konto"
introduction: "Einführung"
inventory: "Inventar"
# inventory_items: "Inventory items"
invitation_accepted_at: "Einladung akzeptiert bei"
invitation_created_at: "Einladung erstellt am"
invitation_limit: "Einladung Grenze"
@@ -7239,4 +7239,4 @@ deu:
wine_transformers: "Wein Transformatoren"
name: "Arbeitssätze"
property_natures:
expression: "Ausdruck"
expression: "Ausdruck"
@@ -1969,6 +1969,8 @@ eng:
uninvoiced: "Uninvoiced"
unit: "Unit"
unit_and_indicator: "%{unit} (%{indicator})"
# unit_price_amount: "Unit price amount"
# unit_price_amount_with_taxes: "Unit price amount with taxes"
unknown: "Unknown"
unknown_condition: "Unknown condition"
unknown_user: "Unknown user"
@@ -2340,7 +2342,7 @@ eng:
sales_conditions: "Sales conditions"
supplier_account_radix: "Supplier account radix"
unbilled_payables: "Unbilled payables"
use_contextual_help: "Use contextual help"
use_contextual_help: "Use contextual help" #?
use_entity_codes_for_account_numbers: "Use code for creating account numbers"
use_global_search: "Use global search"
rest:
@@ -53,8 +53,6 @@ eng:
doer_cost: "Doer cost"
doer_name: "Doer name"
doers_name: "Doers name"
tools_name: "Tools name"
targets_name: "Targets name"
duration_in_hour: "Duration in hour"
ede_cattling_number: "EDE cattling number"
ede_owner_number: "EDE owner number"
@@ -139,12 +137,12 @@ eng:
#~ support_nature: "Support type"
# support_nitrate_fixing: "Support nitrate fixing"
#~ support_variety: "Support variety"
# targets_name: "Targets name"
targets_name: "Targets name"
# tax_short_label: "Tax short label"
# taxes_amount: "Taxes amount"
#~ title: "Title"
#~ tool_cost: "Tool cost"
# tools_name: "Tools name"
tools_name: "Tools name"
# total_balance: "Total balance"
#~ total_cost: "Total cost"
# total_cost_per_area: "Total cost per area"
@@ -928,6 +928,7 @@ eng:
introduction: "Introduction"
# inventories: "Inventories"
inventory: "Inventory"
inventory_items: "Inventory items"
invitation_accepted_at: "Invitation accepted at"
invitation_created_at: "Invitation created at"
invitation_limit: "Invitation limit"
@@ -2853,4 +2853,4 @@ fra:
backend/products: "%{work_number} %{name} (%{number}) - %{container_name}"
backend/purchase_payments: "%{number}. %{mode_name} pour %{payee_full_name} de %{amount} %{currency}"
backend/trackings: "%{serial} ‒ %{name} ‒ %{producer_full_name}"
backend/users: "%{first_name} %{last_name}"
backend/users: "%{first_name} %{last_name}"
@@ -27,11 +27,6 @@ fra:
doer_cost: "Cout de main d'oeuvre"
doer_name: "Acteur"
doers_name: "Nom des acteurs"
tools_name: "nom de l'outil"
targets_name: "Nom de la cible"
support_irrigated: "Soutien irrigué"
support_nitrate_fixing: "Soutenir la fixation de nitrate"
total_cost_per_area: "coût total par zone"
duration_in_hour: "Durée (heures)"
ede_cattling_number: "Numéro d'élevage EDE"
ede_owner_number: "Numéro de propriétaire EDE"
@@ -122,7 +117,12 @@ fra:
stock_production: "Production de stock" #?
stocks_variation: "Variation de stocks" #?
subsidies: "Subventions" #?
support_irrigated: "Soutien irrigué" #?
support_nitrate_fixing: "Soutenir la fixation de nitrate" #?
target_name: "Cible" #?
targets_name: "Nom de la cible"
tools_name: "nom de l'outil"
total_cost_per_area: "coût total par zone" #?
variable_name: "Variable" #?
variant_name: "Variante"
variant_variety: "Variété de la variante" #?
@@ -1124,6 +1124,7 @@ fra:
intracommunity_payable_account: "Compte de taxe intracommunautaire due"
introduction: "Introduction"
inventory: "Inventaire"
# inventory_items: "Inventory items"
invitation_accepted_at: "Invitation acceptée à"
invitation_created_at: "Invitation créé"
invitation_limit: "Limite d'invitation"
@@ -20,11 +20,6 @@ ita:
doer_cost: "costo doer"
doer_name: "nome doer"
doers_name: "nome doers"
tools_name: "nome degli strumenti"
targets_name: "Nome destinazione"
support_irrigated: "Supporto irrigato"
support_nitrate_fixing: "Supporto di fissaggio di nitrati"
total_cost_per_area: "costo totale per area"
duration_in_hour: "Periodo in un'ora"
ede_cattling_number: "Ede numero cattling"
ede_owner_number: "Ede numero proprietario"
@@ -98,6 +93,11 @@ ita:
stock_production: "produzione della" #?
stocks_variation: "Azioni variazione" #?
subsidies: "sussidi" #?
support_irrigated: "Supporto irrigato" #?
support_nitrate_fixing: "Supporto di fissaggio di nitrati" #?
targets_name: "Nome destinazione"
tools_name: "nome degli strumenti"
total_cost_per_area: "costo totale per area" #?
variant_name: "nome variante"
vine_yield: "Produzione in vigna"
wages: "Salari" #?
@@ -940,6 +940,7 @@ ita:
intracommunity_payable_account: "Intracomunitario conto da pagare"
introduction: "Introduzione"
inventory: "Inventario"
# inventory_items: "Inventory items"
invitation_accepted_at: "Invito accettato a"
invitation_created_at: "Invito creato il"
invitation_limit: "Invito limite"
@@ -20,11 +20,6 @@ jpn:
doer_cost: "行為者のコスト"
doer_name: "行為者名"
doers_name: "徒名"
tools_name: "ツール名"
targets_name: "ターゲット名"
support_irrigated: "潅漑サポート"
support_nitrate_fixing: "サポート硝酸塩固定"
total_cost_per_area: "面積あたりの合計費用"
duration_in_hour: "時間内の期間"
ede_cattling_number: "エーデcattling番号"
ede_owner_number: "エーデの所有者の数"
@@ -99,7 +94,12 @@ jpn:
stock_production: "在庫生産" #?
stocks_variation: "株式の変動" #?
subsidies: "補助金" #?
support_irrigated: "潅漑サポート" #?
support_nitrate_fixing: "サポート硝酸塩固定" #?
target_name: "ターゲット名" #?
targets_name: "ターゲット名"
tools_name: "ツール名"
total_cost_per_area: "面積あたりの合計費用" #?
variable_name: "変数名" #?
variant_name: "バリアント名"
variant_variety: "バリアント多様" #?
@@ -909,6 +909,7 @@ jpn:
intracommunity_payable_account: "Intracommunity買掛金勘定"
introduction: "導入"
inventory: "インベントリ"
# inventory_items: "Inventory items"
invitation_accepted_at: "招待で受け付け"
invitation_created_at: "で作成された招待状"
invitation_limit: "招待制限"
@@ -26,11 +26,6 @@ por:
doer_cost: "Custo doer"
doer_name: "Nome executor"
doers_name: "Nome fazedores"
tools_name: "nome das ferramentas"
targets_name: "Nome do alvo"
support_irrigated: "Apoio irrigado"
support_nitrate_fixing: "Apoio à fixação de nitratos"
total_cost_per_area: "custo total por área"
duration_in_hour: "Duração em horas"
ede_cattling_number: "Número cattling Ede"
ede_owner_number: "Número proprietário Ede"
@@ -125,7 +120,12 @@ por:
stock_production: "Produção em estoque" #?
stocks_variation: "Variação de estoque" #?
subsidies: "Subsidios" #?
support_irrigated: "Apoio irrigado" #?
support_nitrate_fixing: "Apoio à fixação de nitratos" #?
target_name: "Nome alvo" #?
targets_name: "Nome do alvo"
tools_name: "nome das ferramentas"
total_cost_per_area: "custo total por área" #?
unitary_quantity: "Quantidade unitária" #?
variable_name: "Nome variável" #?
variant_name: "Nome da variante"
@@ -909,6 +909,7 @@ por:
intracommunity_payable_account: "Conta a pagar intracomunitário"
introduction: "Introdução"
inventory: "Inventário"
# inventory_items: "Inventory items"
invitation_accepted_at: "Convite aceito em"
invitation_created_at: "Convite criado dia"
invitation_limit: "Limite de convite"
@@ -20,11 +20,6 @@ spa:
doer_cost: "Costo hacedor"
doer_name: "Nombre del hacedor"
doers_name: "Nombre hacedores"
tools_name: "nombre de herramientas"
targets_name: "Nombre de destino"
support_irrigated: "Apoyo irrigado"
support_nitrate_fixing: "Soporte fijación de Nitrato"
total_cost_per_area: "costo total por área"
duration_in_hour: "Duración en horas"
ede_cattling_number: "Número cattling Ede"
ede_owner_number: "Número propietario Ede"
@@ -99,7 +94,12 @@ spa:
stock_production: "De la producción" #?
stocks_variation: "Variación de las existencias" #?
subsidies: "Subsidios" #?
support_irrigated: "Apoyo irrigado" #?
support_nitrate_fixing: "Soporte fijación de Nitrato" #?
target_name: "Nombre del Destinatario" #?
targets_name: "Nombre de destino"
tools_name: "nombre de herramientas"
total_cost_per_area: "costo total por área" #?
variable_name: "Nombre de la variable" #?
variant_name: "Nombre variante"
variant_variety: "Variedad variante" #?
@@ -913,6 +913,7 @@ spa:
intracommunity_payable_account: "Cuenta por pagar intracomunitario"
introduction: "Introducción"
inventory: "Inventario"
# inventory_items: "Inventory items"
invitation_accepted_at: "Invitación aceptada en"
invitation_created_at: "Invitación creado el"
invitation_limit: "Límite de la invitación"

0 comments on commit 9e56fc6

Please sign in to comment.