diff --git a/README.rdoc b/README.rdoc index 0fa8b8c6..ba4e790f 100644 --- a/README.rdoc +++ b/README.rdoc @@ -111,9 +111,12 @@ For more information on features, please refer to the user guide rake redmine:plugins:migrate NAME=redmine_wktime VERSION=0 RAILS_ENV=production -=== Release Notes for v4.7.4 +=== Release Notes for v4.7.5 - - Minor changes. +* *Bug* *fixes* + - Fixed month wise date sorting issue in Accounting module + - Fixed monthly closing balance total issue in Accounting module + - Fixed unable to save amount of less then 1 in Accounting module === Customization diff --git a/app/controllers/wkgltransaction_controller.rb b/app/controllers/wkgltransaction_controller.rb index d491c9a4..c86b050e 100644 --- a/app/controllers/wkgltransaction_controller.rb +++ b/app/controllers/wkgltransaction_controller.rb @@ -67,9 +67,12 @@ def index summary_by = getDatePart('trans_date','year') alice_name = getDatePart('trans_date','year', 'tyear') end + trans_date = transaction.minimum(:trans_date) - 1 unless transaction.minimum(:trans_date).blank? @transDate = @from.blank? ? trans_date : @from -1 - order_val = alice_name.split(',').map{|item| (item.split('as').last).strip().to_s + " DESC"} + sort_direction = params[:sort].present? ? (params[:sort].split(':')[1] || "asc") : "desc" + + order_val = alice_name.split(',').map{|item| (item.split('as').last).strip().to_s + " #{sort_direction}"} transaction = transaction.group(" #{summary_by}, detail_type, ledger_id") .select(" #{alice_name}, detail_type, ledger_id, sum(amount) as amount").order("#{order_val.join(',')}") @summaryHash = Hash.new @@ -102,6 +105,14 @@ def index @summaryHash[key][:ledger_id] = entry.ledger_id end end + + dup_summary = sort_direction == "desc" ? @summaryHash.to_a.reverse.to_h : @summaryHash + dup_summary.each do |key, value| + getSummeryamount(key, value) + @summaryHash[key][:CB] = @closeBal + end + @summaryHashFirstKey = dup_summary.keys.first + else formPagination(transaction.reorder(sort_clause)) isSubCr = isSubtractCr(@selectedLedger.ledger_type) @@ -118,8 +129,8 @@ def index formPagination(transaction.reorder(sort_clause)) end transaction - end - + end + def edit @transEntry = nil @transDetails = nil @@ -163,9 +174,9 @@ def update end wktxnDetail.ledger_id = params["txn_particular_#{i}"] - if (params["txn_debit_#{i}"].blank? || params["txn_debit_#{i}"].to_i == 0) && (params["txn_credit_#{i}"].blank? || params["txn_credit_#{i}"].to_i == 0) + if (params["txn_debit_#{i}"].blank? || params["txn_debit_#{i}"].to_f == 0) && (params["txn_credit_#{i}"].blank? || params["txn_credit_#{i}"].to_f == 0) next - elsif params["txn_debit_#{i}"].blank? || params["txn_debit_#{i}"].to_i == 0 + elsif params["txn_debit_#{i}"].blank? || params["txn_debit_#{i}"].to_f == 0 wktxnDetail.detail_type = 'c' wktxnDetail.amount = params["txn_credit_#{i}"] else @@ -233,7 +244,7 @@ def update end } end - end + end def validateTransaction ret = true @@ -298,8 +309,8 @@ def validateTransaction end for i in 1..params[:txntotalrow].to_i - txnDebitTotal = txnDebitTotal + params["txn_debit_#{i}"].to_i if !params["txn_debit_#{i}"].blank? - txnCreditTotal = txnCreditTotal + params["txn_debit_#{i}"].to_i if !params["txn_debit_#{i}"].blank? + txnDebitTotal = txnDebitTotal + params["txn_debit_#{i}"].to_f if !params["txn_debit_#{i}"].blank? + txnCreditTotal = txnCreditTotal + params["txn_debit_#{i}"].to_f if !params["txn_debit_#{i}"].blank? end if ret diff --git a/app/helpers/wkgltransaction_helper.rb b/app/helpers/wkgltransaction_helper.rb index fbe3dfb4..eaeaeeb5 100644 --- a/app/helpers/wkgltransaction_helper.rb +++ b/app/helpers/wkgltransaction_helper.rb @@ -379,7 +379,7 @@ def getSummeryamount(key, value) @debitTotal += value[:DT].to_f @creditTotal += value[:CT].to_f diff = isSubCr ? (value[:DT].to_f - value[:CT].to_f) : (value[:CT].to_f - value[:DT].to_f) - if key == @summaryHash.keys.first + if key == @summaryHashFirstKey @closeBal = diff + openingBalance.to_f else @closeBal = diff + @closeBal diff --git a/app/views/wkcrmaccount/edit.api.rsb b/app/views/wkcrmaccount/edit.api.rsb index 5ca904ee..53324a14 100644 --- a/app/views/wkcrmaccount/edit.api.rsb +++ b/app/views/wkcrmaccount/edit.api.rsb @@ -6,6 +6,7 @@ api.wk_account do api.account_billing @accountEntry.account_billing api.account_category @accountEntry.account_category api.location_id @accountEntry.location_id + api.tax_number @accountEntry.tax_number api.description @accountEntry.description api.address( id: @accountEntry.address.id, address1: @accountEntry.address.address1, address2: @accountEntry.address.address2, diff --git a/app/views/wkgltransaction/_summary_trans_list.html.erb b/app/views/wkgltransaction/_summary_trans_list.html.erb index 741c8d7a..3beb7f11 100644 --- a/app/views/wkgltransaction/_summary_trans_list.html.erb +++ b/app/views/wkgltransaction/_summary_trans_list.html.erb @@ -15,7 +15,7 @@ <thead> </tr> <tr> - <th class="lbl-txt-align"><%= l(:label_date_range) %></th> + <%= sort_header_tag('trans_date', :caption => l(:label_date_range), class: "lbl-txt-align", title: "") %> <th class="lbl-txt-align"><%= l(:label_debit) %></th> <th class="lbl-txt-align"><%= l(:label_credit) %></th> <th class="lbl-txt-align"><%= l(:label_closing_balance) %></th> @@ -24,12 +24,12 @@ </thead> <tbody> <% @summaryHash.each do |key, value| %> - <% getSummeryamount(key, value) %> + <% # getSummeryamount(key, value) %> <tr> <td class="lbl-txt-align"><%=h key %></td> <td class="lbl-txt-align"><%=h "%.2f" % value[:DT].to_f %></td> <td class="lbl-txt-align"><%=h "%.2f" % value[:CT].to_f %></td> - <td class="lbl-txt-align"><%=h "%.2f" % @closeBal.abs %></td> + <td class="lbl-txt-align"><%=h "%.2f" % value[:CB].abs %></td> <td class="lbl-txt-align"><%= link_to image_tag('edit.png'), {:controller => controller.controller_name, :action => 'index', :summary_by => 'days', :from => value[:beginning_date], :to => value[:end_date], :is_summary_edit => true, :summary_period => 2, :txn_ledger => value[:ledger_id], :tab => controller.controller_name}, :title => l(:button_edit) %> </td> </tr> <% end %> diff --git a/db/migrate/20240912130705_update_wk_survey_responses.rb b/db/migrate/20240912130705_update_wk_survey_responses.rb new file mode 100644 index 00000000..ebdc51ce --- /dev/null +++ b/db/migrate/20240912130705_update_wk_survey_responses.rb @@ -0,0 +1,5 @@ +class UpdateWkSurveyResponses < ActiveRecord::Migration[6.1] + def up + change_column :wk_survey_responses, :ip_address, :string, limit: 60 + end +end \ No newline at end of file diff --git a/init.rb b/init.rb index b3d887b9..41eced9d 100644 --- a/init.rb +++ b/init.rb @@ -588,7 +588,7 @@ def getSupervisorCondStr name 'ERPmine' author 'Adhi Software Pvt Ltd' description 'ERPmine is an ERP for Service Industries. It has the following modules: Time & Expense, Attendance, Payroll, CRM, Billing, Accounting, Purchasing, Inventory, Asset , Reports, Dashboards and Survey' - version '4.7.4' + version '4.7.5' url 'https://www.redmine.org/plugins/wk-time' author_url 'http://www.adhisoftware.co.in/'