Skip to content

Commit

Permalink
Merge branch 'master' into feature/add-payslip-payment
Browse files Browse the repository at this point in the history
Conflicts:
	db/structure.sql
  • Loading branch information
Brice TEXIER committed May 16, 2017
2 parents f7f3ba5 + 3da1da1 commit fdb3139
Show file tree
Hide file tree
Showing 24 changed files with 292 additions and 47 deletions.
3 changes: 3 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ ruby '2.2.3'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.2.8'

# Security fix for mail
gem 'mail', '~> 2.6.6.rc1'

# Database adapters
gem 'activerecord-postgis-adapter', '>= 3.0.0'
gem 'pg' # Needed for some tasks
Expand Down
45 changes: 23 additions & 22 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ GEM
erubis (~> 2.7.0)
rails-dom-testing (~> 1.0, >= 1.0.5)
rails-html-sanitizer (~> 1.0, >= 1.0.3)
active_list (6.8.2)
active_list (6.9.1)
arel (>= 5.0.0)
code_string (>= 0.0.0)
i18n-complements
Expand Down Expand Up @@ -73,10 +73,10 @@ GEM
sidekiq (>= 2.11)
arel (6.0.4)
ast (2.3.0)
autoprefixer-rails (6.7.7.2)
autoprefixer-rails (7.0.1)
execjs
awesome_nested_set (3.1.2)
activerecord (>= 4.0.0, < 5.1)
awesome_nested_set (3.1.3)
activerecord (>= 4.0.0, < 5.2)
bcrypt (3.1.11)
beardley (1.3.0)
rjb (>= 1.4.8)
Expand All @@ -98,7 +98,7 @@ GEM
sass (>= 3.3.4)
bootstrap3-datetimepicker-rails (4.17.47)
momentjs-rails (>= 2.8.1)
browser (2.3.0)
browser (2.4.0)
builder (3.2.3)
bullet (5.5.1)
activesupport (>= 3.0.0)
Expand All @@ -116,12 +116,12 @@ GEM
capybara (>= 2.3.0, < 2.14.0)
json
charlock_holmes (0.7.3)
childprocess (0.6.3)
childprocess (0.7.0)
ffi (~> 1.0, >= 1.0.11)
climate_control (0.1.0)
climate_control (0.2.0)
cocaine (0.5.8)
climate_control (>= 0.0.3, < 1.0)
cocoon (1.2.9)
cocoon (1.2.10)
codacy-coverage (1.1.6)
simplecov
code_analyzer (0.4.7)
Expand All @@ -145,9 +145,9 @@ GEM
thor (~> 0.19.4)
tins (~> 1.6)
daemons (1.2.4)
database_cleaner (1.5.3)
database_cleaner (1.6.1)
dbf (3.1.0)
debug_inspector (0.0.2)
debug_inspector (0.0.3)
deep_cloneable (2.2.2)
activerecord (>= 3.1.0, < 5.2.0)
devise (4.2.1)
Expand All @@ -166,7 +166,7 @@ GEM
enumerize (2.1.1)
activesupport (>= 3.2)
erubis (2.7.0)
et-orbi (1.0.3)
et-orbi (1.0.4)
tzinfo
eventmachine (1.2.3)
exception_notification (4.2.1)
Expand Down Expand Up @@ -198,7 +198,7 @@ GEM
activesupport (>= 4.2.0)
gyoku (1.3.1)
builder (>= 2.1.2)
haml (5.0.0)
haml (5.0.1)
temple (>= 0.8.0)
tilt
hashie (3.5.5)
Expand All @@ -216,9 +216,9 @@ GEM
i18n-js (3.0.0)
i18n (~> 0.6, >= 0.6.6)
iban-tools (1.1.0)
jbuilder (2.6.3)
activesupport (>= 3.0.0, < 5.2)
multi_json (~> 1.2)
jbuilder (2.6.4)
activesupport (>= 3.0.0)
multi_json (>= 1.2)
jc-validates_timeliness (3.1.1)
timeliness (~> 0.3.7)
jquery-rails (4.3.1)
Expand Down Expand Up @@ -255,7 +255,7 @@ GEM
loofah (2.0.3)
nokogiri (>= 1.5.9)
luhn (1.0.2)
mail (2.6.5)
mail (2.6.6.rc1)
mime-types (>= 1.16, < 4)
mechanize (2.7.5)
domain_name (~> 0.5, >= 0.5.1)
Expand All @@ -272,7 +272,7 @@ GEM
mime-types-data (3.2016.0521)
mimemagic (0.3.2)
mini_portile2 (2.1.0)
minitest (5.10.1)
minitest (5.10.2)
minitest-reporters (1.1.14)
ansi
builder
Expand All @@ -286,7 +286,7 @@ GEM
net-http-digest_auth (1.4.1)
net-http-persistent (2.9.4)
netrc (0.11.0)
nokogiri (1.7.1)
nokogiri (1.7.2)
mini_portile2 (~> 2.1.0)
nori (2.6.0)
ntlm-http (0.1.1)
Expand Down Expand Up @@ -333,10 +333,10 @@ GEM
public_suffix (2.0.5)
quiet_assets (1.1.0)
railties (>= 3.1, < 5.0)
rack (1.6.5)
rack (1.6.6)
rack-accept (0.4.5)
rack (>= 0.4)
rack-protection (1.5.3)
rack-protection (2.0.0)
rack
rack-test (0.6.3)
rack (>= 1.0)
Expand All @@ -359,7 +359,7 @@ GEM
rails-deprecated_sanitizer (>= 1.0.1)
rails-html-sanitizer (1.0.3)
loofah (~> 2.0)
rails_best_practices (1.18.0)
rails_best_practices (1.18.1)
activesupport
code_analyzer (>= 0.4.3)
erubis
Expand Down Expand Up @@ -500,7 +500,7 @@ GEM
tilt (2.0.7)
timecop (0.8.1)
timeliness (0.3.8)
tins (1.13.2)
tins (1.13.3)
treetop (1.6.8)
polyglot (~> 0.3)
turbolinks (2.5.3)
Expand Down Expand Up @@ -601,6 +601,7 @@ DEPENDENCIES
kaminari
letter_opener
luhn
mail (~> 2.6.6.rc1)
mechanize
minitest-reporters
momentjs-rails (>= 2.9.0)
Expand Down
13 changes: 7 additions & 6 deletions app/assets/javascripts/backend/accounts.js.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,22 @@

$(document).ready ->
$('input[data-mask-lettered-items]').each ->
console.log "Yeah"
E.accounts.toggleLetteredItemsVisibility.call($(this))

$('input[data-mask-lettered-items]').on 'change', (e) ->
E.accounts.toggleLetteredItemsVisibility.call($(this))

E.accounts =
toggleLetteredItemsVisibility: ->
input = $(this)
list = $(input.data('mask-lettered-items'))
list.toggleClass('mask-lettered-items', input.is(':checked'))
$input = $(this)
$list = $($input.data('mask-lettered-items'))
$letteredItems = $list.find('.lettered-item')
$letteredItems.toggle !$input.is(':checked')

$.ajax
url: input.data('preference-url')
url: $input.data('preference-url')
type: 'PATCH'
data:
masked: input.is(':checked') ? 'true' : 'false'
masked: $input.is(':checked') ? 'true' : 'false'

) ekylibre, jQuery
2 changes: 1 addition & 1 deletion app/controllers/backend/accounts_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def self.account_moves_conditions(_options = {})
code.c
end

list(:journal_entry_items, joins: :entry, conditions: account_moves_conditions, line_class: "(RECORD.lettered? ? 'lettered-item' : '')".c, order: "entry_id DESC, #{JournalEntryItem.table_name}.position") do |t|
list(:journal_entry_items, joins: :entry, conditions: account_moves_conditions, line_class: "(RECORD.completely_lettered? ? 'lettered-item' : '')".c, order: "entry_id DESC, #{JournalEntryItem.table_name}.position") do |t|
t.column :journal, url: true
t.column :entry_number, url: true
t.column :printed_on, datatype: :date, label: :column
Expand Down
4 changes: 2 additions & 2 deletions app/controllers/backend/entities_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ def self.entities_moves_client_conditions(params)
eval code
end

list(:client_journal_entry_items, model: :journal_entry_items, conditions: { account_id: 'Entity.find(params[:id]).client_account_id'.c }, line_class: "(RECORD.lettered? ? 'lettered-item' : '')".c, joins: :entry, order: "entry_id DESC, #{JournalEntryItem.table_name}.position") do |t|
list(:client_journal_entry_items, model: :journal_entry_items, conditions: { account_id: 'Entity.find(params[:id]).client_account_id'.c }, line_class: "(RECORD.completely_lettered? ? 'lettered-item' : '')".c, joins: :entry, order: "entry_id DESC, #{JournalEntryItem.table_name}.position") do |t|
t.column :journal, url: true
t.column :entry_number, url: true
t.column :printed_on, datatype: :date, label: :column
Expand All @@ -324,7 +324,7 @@ def self.entities_moves_supplier_conditions(params)
eval code
end

list(:supplier_journal_entry_items, model: :journal_entry_items, conditions: { account_id: 'Entity.find(params[:id]).supplier_account_id'.c }, line_class: "(RECORD.lettered? ? 'lettered-item' : '')".c, joins: :entry, order: "entry_id DESC, #{JournalEntryItem.table_name}.position") do |t|
list(:supplier_journal_entry_items, model: :journal_entry_items, conditions: { account_id: 'Entity.find(params[:id]).supplier_account_id'.c }, line_class: "(RECORD.completely_lettered? ? 'lettered-item' : '')".c, joins: :entry, order: "entry_id DESC, #{JournalEntryItem.table_name}.position") do |t|
t.column :journal, url: true
t.column :entry_number, url: true
t.column :printed_on, datatype: :date, label: :column
Expand Down
3 changes: 2 additions & 1 deletion app/models/financial_year.rb
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,8 @@ def close(to_close_on = nil, options = {})
ActiveRecord::Base.transaction do
# Compute balance of closed year
compute_balances!
if closure_journal

if result_journal
# Create result entry of the current year
generate_result_entry!(result_journal, to_close_on)
end
Expand Down
2 changes: 2 additions & 0 deletions app/models/journal_entry.rb
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,8 @@ def self.states
end

after_save do
# Item caching process also handled via a trigger in DB.
# See migration AddEntryDataSynchro if needed.
JournalEntryItem.where(entry_id: id).update_all(
state: self.state,
journal_id: journal_id,
Expand Down
6 changes: 5 additions & 1 deletion app/models/journal_entry_item.rb
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,11 @@ class JournalEntryItem < Ekylibre::Record::Base
end

def partially_lettered?
letter && letter.include?('*')
lettered? && letter.include?('*')
end

def completely_lettered?
lettered? && !partially_lettered?
end

def letter_radix
Expand Down
6 changes: 0 additions & 6 deletions app/themes/tekyla/stylesheets/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2773,9 +2773,3 @@ a[data-annotate] {
height: 100%;
}


.active-list.mask-lettered-items {
.lettered-item {
display: none;
}
}
4 changes: 2 additions & 2 deletions app/views/backend/accounts/mark.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@
- items.each do |item|
- checked = (item.letter.blank? && (params[:journal_entry_item]||{}).keys.include?(item.id.to_s))
- trid, conf = "e#{item.id}", {}
%tr{id: trid, class: (item.closed? ? "disabled " : checked ? "selected " : "test") + cycle("even", "odd") + ((item.lettered? && !item.partially_lettered?) ? ' lettered-item' : '')}
%tr{id: trid, class: (item.closed? ? "disabled " : checked ? "selected " : "test") + cycle("even", "odd") + (item.completely_lettered? ? ' lettered-item' : '')}
%td.chk
- if (item.letter.blank? || item.partially_lettered?) && !item.closed?
- unless item.completely_lettered? || item.closed?
= check_box_tag("journal_entry_item[#{item.id}][to_mark]", "1", checked, id: "journal_entry_item_#{item.id}_to_mark", data: {add_class: "selected", add_class_to: "##{trid}"})
- conf = {data: {click: "#journal_entry_item_#{item.id}_to_mark"}}
%td.ltr
Expand Down
2 changes: 2 additions & 0 deletions config/locales/arb/models.yml
Original file line number Diff line number Diff line change
Expand Up @@ -882,6 +882,7 @@ arb:
event_nature: "نوع الحدث" #?
event_participation: "مشاركة الحدث"
financial_year: "السنة المالية"
financial_year_exchange: "تبادل السنة المالية"
fixed_asset: "الأصول الثابتة"
fixed_asset_depreciation: "انخفاض قيمة الأصول الثابتة"
fungus: "فطر"
Expand Down Expand Up @@ -1031,6 +1032,7 @@ arb:
tax: "الضريبة"
tax_declaration: "تصريح الضرائب"
tax_declaration_item: "الضرائب البند إعلان"
tax_declaration_item_part: "الجزء المتعلق بالإعلان الضريبي"
team: "الخجمة"
token: "رمز"
tool: "الاداة" #?
Expand Down
2 changes: 2 additions & 0 deletions config/locales/cmn/models.yml
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,7 @@ cmn:
event: "事件"
event_participation: "活动参与"
financial_year: "财政年度"
financial_year_exchange: "财政年度交换"
fixed_asset: "固定资产"
fixed_asset_depreciation: "固定资产折旧"
fungus: ""
Expand Down Expand Up @@ -387,6 +388,7 @@ cmn:
tax: ""
tax_declaration: "纳税申报"
tax_declaration_item: "纳税申报项目"
tax_declaration_item_part: "税务申报部分"
team: "球队"
token: "象征"
tracking: "跟踪"
Expand Down
2 changes: 2 additions & 0 deletions config/locales/deu/models.yml
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,7 @@ deu:
event: "Ereignis"
event_participation: "Messe-Teilnahme"
financial_year: "Geschäftsjahr"
financial_year_exchange: "Geschäftsjahresumsatz"
fixed_asset: "Anlagevermögen"
fixed_asset_depreciation: "Abschreibungen auf Sachanlagen"
fungus: "Pilz"
Expand Down Expand Up @@ -387,6 +388,7 @@ deu:
tax: "Besteuern"
tax_declaration: "Steuererklärung"
tax_declaration_item: "Steuererklärung Artikel"
tax_declaration_item_part: "Steuererklärung Artikelteil"
team: "Mannschaft"
token: "Zeichen"
tracking: "Verfolgung"
Expand Down
4 changes: 2 additions & 2 deletions config/locales/eng/models.yml
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ eng:
event: "Event"
event_participation: "Event participation"
financial_year: "Financial year"
# financial_year_exchange: "Financial year exchange"
financial_year_exchange: "Financial year exchange"
fixed_asset: "Fixed asset"
fixed_asset_depreciation: "Fixed asset depreciation"
fungus: "Fungus"
Expand Down Expand Up @@ -381,7 +381,7 @@ eng:
tax: "Tax"
tax_declaration: "Tax declaration"
tax_declaration_item: "Tax declaration item"
# tax_declaration_item_part: "Tax declaration item part"
tax_declaration_item_part: "Tax declaration item part"
team: "Team"
token: "Token"
tracking: "Tracking"
Expand Down
2 changes: 2 additions & 0 deletions config/locales/fra/models.yml
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,7 @@ fra:
event: "Évènement"
event_participation: "Participation à un évènement"
financial_year: "Exercice"
financial_year_exchange: "Échange de l’exercice"
fixed_asset: "Immobilisation"
fixed_asset_depreciation: "Amortissement d’immobilisation"
fungus: "Champignon"
Expand Down Expand Up @@ -521,6 +522,7 @@ fra:
tax: "Taxe"
tax_declaration: "Déclaration d’impôts"
tax_declaration_item: "Tax élément de déclaration"
tax_declaration_item_part: "Partie d’élément de déclaration fiscale"
team: "Service"
token: "Jeton"
tracking: "Lot traçable"
Expand Down
2 changes: 2 additions & 0 deletions config/locales/ita/models.yml
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,7 @@ ita:
event: "Evento"
event_participation: "partecipazione Event"
financial_year: "Anno finanziario"
financial_year_exchange: "Scambio anno finanziario"
fixed_asset: "Assetto stabile"
fixed_asset_depreciation: "deprezzamento capitale fisso"
fungus: "Fungo"
Expand Down Expand Up @@ -418,6 +419,7 @@ ita:
tax: "Imposta"
tax_declaration: "Dichiarazione dei redditi"
tax_declaration_item: "Voce dichiarazione dei redditi"
tax_declaration_item_part: "Parte dell’articolo dichiarazione fiscale"
team: "Squadra"
token: "Gettone"
tracking: "puntamento"
Expand Down
2 changes: 2 additions & 0 deletions config/locales/jpn/models.yml
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,7 @@ jpn:
event: "イベント"
event_participation: "イベント参加"
financial_year: "会計年度"
financial_year_exchange: "会計年度の交換"
fixed_asset: "固定資産"
fixed_asset_depreciation: "固定資産の減価償却"
fungus: ""
Expand Down Expand Up @@ -387,6 +388,7 @@ jpn:
tax: "税金"
tax_declaration: "税金申告"
tax_declaration_item: "税務申告項目"
tax_declaration_item_part: "納税申告項目部"
team: "チーム"
token: "トークン"
tracking: "追跡"
Expand Down

0 comments on commit fdb3139

Please sign in to comment.