Skip to content

Commit

Permalink
Add journal entries sheet.
Browse files Browse the repository at this point in the history
  • Loading branch information
ionosphere committed Mar 20, 2017
1 parent 220ca7d commit 722c910
Show file tree
Hide file tree
Showing 9 changed files with 924 additions and 18 deletions.
9 changes: 9 additions & 0 deletions app/controllers/backend/journal_entries_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,15 @@ class JournalEntriesController < Backend::BaseController
def index
redirect_to controller: :journals, action: :index
end

def show
return unless @journal_entry = find_and_check
respond_with(@journal_entry, methods: [],
include: [])
format.html do
t3e @journal_entry.attributes
end
end

def new
if params[:duplicate_of]
Expand Down
8 changes: 4 additions & 4 deletions app/helpers/backend/base_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -269,19 +269,19 @@ def period_selector(*intervals)

render 'backend/shared/period_selector', current_period: current_period, intervals: intervals, period_interval: current_interval
end

def main_financial_year_selector(financial_year)
content_for(:heading_toolbar) do
financial_year_selector(financial_year)
end
end

def financial_year_selector(financial_year_id = nil, options = {})
unless FinancialYear.any?
@current_financial_year = FinancialYear.on(Date.current)
end
current_user.current_financial_year = @current_financial_year || FinancialYear.find_by(id: financial_year_id)
render 'backend/shared/financial_year_selector', financial_year: current_user.current_financial_year , param_name: options[:param_name] || :current_financial_year
current_user.current_financial_year = @current_financial_year || FinancialYear.find_by(id: financial_year_id)
render 'backend/shared/financial_year_selector', financial_year: current_user.current_financial_year, param_name: options[:param_name] || :current_financial_year
end

def lights(status, html_options = {})
Expand Down
2 changes: 1 addition & 1 deletion app/models/user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ def current_campaign
def current_campaign=(campaign)
prefer!('current_campaign.id', campaign.id, :integer)
end

def current_financial_year
return nil unless default_financial_year = FinancialYear.on(Date.current)
preference = self.preference('current_financial_year', default_financial_year, :record)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
:ruby
# get accoutancy ratio in financial_year.sum_entry_items_with_mandatory_line(:ratio, :products)
# operating_margin_on_turnover = ( operating_margin / turnover_value) * 100


production_sales = @financial_year.sum_entry_items_with_mandatory_line(:ratio, :production_sales)
production_purchases = @financial_year.sum_entry_items_with_mandatory_line(:ratio, :production_purchases)
added_value = @financial_year.sum_entry_items_with_mandatory_line(:ratio, :added_value)
operating_margin = @financial_year.sum_entry_items_with_mandatory_line(:ratio, :operating_margin)

= infos do
- if production_sales
.big-info
Expand Down
11 changes: 6 additions & 5 deletions config/locales/eng/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -968,6 +968,7 @@ eng:
add_website: "Add website"
add_working_period: "Add working period"
add_x: "Add “%{x}”"
# added_value: "Added value"
advance_charges: "Advance charges" #?!
advance_giveables: "Advance giveables" #?!
advance_products: "Advance products" #?!
Expand Down Expand Up @@ -1151,8 +1152,8 @@ eng:
days: "Days"
deals: "Deals"
debit: "Debit" #?
debts: "Debts" #?
debts_on_assets: "Debts on assets %{financial_year}"
debts: "Debts" #?!
debts_on_assets: "Debts on assets %{financial_year}" #?!
decision_making: "Decision-making"
default_letter_conclusion: "Please accept, Dear Madam, Dear Sir, the assurances of my highest consideration."
default_letter_function_title: "Dear madam, dear sir"
Expand Down Expand Up @@ -1403,7 +1404,7 @@ eng:
line_number: "Line #%{number}"
linear_options: "Linear options"
link: "Link"
liquid_assets_on_turnover: "Liquid assets on turnover %{financial_year}"
liquid_assets_on_turnover: "Liquid assets on turnover %{financial_year}" #?!
list: "List" #?
load: "Load"
loans_debts: "Loans debts" #?!
Expand Down Expand Up @@ -1520,8 +1521,8 @@ eng:
open_a_production: "Open a production"
open_an_activity: "Open an activity"
operating_margin: "Operating margin %{financial_year}"
operating_margin_on_turnover: "Operating margin on turnover %{financial_year}"
operating_profit: "Operating profit %{financial_year}"
operating_margin_on_turnover: "Operating margin on turnover %{financial_year}" #?
operating_profit: "Operating profit %{financial_year}" #?!
operations: "Operations" #?
options: "Options"
or: "Or"
Expand Down
1 change: 1 addition & 0 deletions config/locales/eng/nomenclatures.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1922,6 +1922,7 @@ eng:
intervention_sheet: "Intervention sheet"
inventory_sheet: "Inventory sheet"
journal: "Journal"
# journal_entry_sheet: "Journal entry sheet"
land_parcel_register: "Land parcel register"
manure_management_plan: "Manure management plan"
manure_management_plan_sheet: "Manure management plan (detail)"
Expand Down
Loading

0 comments on commit 722c910

Please sign in to comment.