From 3f34353d4a78c3a00cace4796f78fb83505ff056 Mon Sep 17 00:00:00 2001 From: shanmugga Date: Fri, 6 Sep 2024 15:32:42 +0530 Subject: [PATCH 1/6] mobile upgrade tax number api --- app/views/wkcrmaccount/edit.api.rsb | 1 + 1 file changed, 1 insertion(+) 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, From ce3ffc2d8f0138c5f4827be0c56fb8dc6acd8aa7 Mon Sep 17 00:00:00 2001 From: shanmugga Date: Wed, 11 Sep 2024 15:47:25 +0530 Subject: [PATCH 2/6] transaction fix --- app/controllers/wkgltransaction_controller.rb | 33 ++++++++++++++----- app/helpers/wkgltransaction_helper.rb | 3 +- .../_summary_trans_list.html.erb | 6 ++-- assets/javascripts/invoice.js | 1 + 4 files changed, 30 insertions(+), 13 deletions(-) diff --git a/app/controllers/wkgltransaction_controller.rb b/app/controllers/wkgltransaction_controller.rb index d491c9a4..ff4b408a 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,11 @@ 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_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_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 +246,7 @@ def update end } end - end + end def validateTransaction ret = true @@ -298,8 +311,10 @@ 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_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 @@ -338,7 +353,7 @@ def validateTransaction $temptxnDetail = @tempwktxnDetail $tempTransaction = wkgltransaction end - + ret end diff --git a/app/helpers/wkgltransaction_helper.rb b/app/helpers/wkgltransaction_helper.rb index fbe3dfb4..5a4a9273 100644 --- a/app/helpers/wkgltransaction_helper.rb +++ b/app/helpers/wkgltransaction_helper.rb @@ -379,7 +379,8 @@ 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 == @summaryHash.keys.first + if key == @summaryHashFirstKey @closeBal = diff + openingBalance.to_f else @closeBal = diff + @closeBal 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 @@ - <%= l(:label_date_range) %> + <%= sort_header_tag('trans_date', :caption => l(:label_date_range), class: "lbl-txt-align", title: "") %> <%= l(:label_debit) %> <%= l(:label_credit) %> <%= l(:label_closing_balance) %> @@ -24,12 +24,12 @@ <% @summaryHash.each do |key, value| %> - <% getSummeryamount(key, value) %> + <% # getSummeryamount(key, value) %> <%=h key %> <%=h "%.2f" % value[:DT].to_f %> <%=h "%.2f" % value[:CT].to_f %> - <%=h "%.2f" % @closeBal.abs %> + <%=h "%.2f" % value[:CB].abs %> <%= 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) %> <% end %> diff --git a/assets/javascripts/invoice.js b/assets/javascripts/invoice.js index bf8c9798..741c8e95 100644 --- a/assets/javascripts/invoice.js +++ b/assets/javascripts/invoice.js @@ -507,6 +507,7 @@ function tallyAmount(fldId) var oldrowlength = oldtable.rows.length; if(addclm > 2 && addclm == oldrowlength ) { + alert("invoiceAddRow"); invoiceAddRow('txnTable', 'txntotalrow'); } updateAmount(); From 6fe7526235154ffee3a32b6070ef89dcc92c74f8 Mon Sep 17 00:00:00 2001 From: shanmugga Date: Thu, 12 Sep 2024 17:47:03 +0530 Subject: [PATCH 3/6] accounting fix and db migrate --- app/controllers/wkgltransaction_controller.rb | 6 ------ app/helpers/wkgltransaction_helper.rb | 1 - assets/javascripts/invoice.js | 1 - db/migrate/20240912130705_update_wk_survey_responses.rb | 5 +++++ 4 files changed, 5 insertions(+), 8 deletions(-) create mode 100644 db/migrate/20240912130705_update_wk_survey_responses.rb diff --git a/app/controllers/wkgltransaction_controller.rb b/app/controllers/wkgltransaction_controller.rb index ff4b408a..9f4f5a72 100644 --- a/app/controllers/wkgltransaction_controller.rb +++ b/app/controllers/wkgltransaction_controller.rb @@ -174,10 +174,8 @@ 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}"] @@ -311,8 +309,6 @@ 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 @@ -353,8 +349,6 @@ def validateTransaction $temptxnDetail = @tempwktxnDetail $tempTransaction = wkgltransaction end - - ret end def destroy diff --git a/app/helpers/wkgltransaction_helper.rb b/app/helpers/wkgltransaction_helper.rb index 5a4a9273..eaeaeeb5 100644 --- a/app/helpers/wkgltransaction_helper.rb +++ b/app/helpers/wkgltransaction_helper.rb @@ -379,7 +379,6 @@ 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 diff --git a/assets/javascripts/invoice.js b/assets/javascripts/invoice.js index 741c8e95..bf8c9798 100644 --- a/assets/javascripts/invoice.js +++ b/assets/javascripts/invoice.js @@ -507,7 +507,6 @@ function tallyAmount(fldId) var oldrowlength = oldtable.rows.length; if(addclm > 2 && addclm == oldrowlength ) { - alert("invoiceAddRow"); invoiceAddRow('txnTable', 'txntotalrow'); } updateAmount(); 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 From 6afad4bc1687041dcc8690902119a8cab6180b10 Mon Sep 17 00:00:00 2001 From: shanmugga Date: Fri, 13 Sep 2024 19:47:30 +0530 Subject: [PATCH 4/6] accounting update fix --- app/controllers/wkgltransaction_controller.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/controllers/wkgltransaction_controller.rb b/app/controllers/wkgltransaction_controller.rb index 9f4f5a72..c86b050e 100644 --- a/app/controllers/wkgltransaction_controller.rb +++ b/app/controllers/wkgltransaction_controller.rb @@ -349,6 +349,8 @@ def validateTransaction $temptxnDetail = @tempwktxnDetail $tempTransaction = wkgltransaction end + + ret end def destroy From c37de37a04e628e827b6985bc32b0c06da11a5fc Mon Sep 17 00:00:00 2001 From: Arunkumar Thangavel Date: Fri, 13 Sep 2024 22:59:25 +0530 Subject: [PATCH 5/6] Update README.rdoc --- README.rdoc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/README.rdoc b/README.rdoc index f69da2cf..18dd6792 100644 --- a/README.rdoc +++ b/README.rdoc @@ -110,9 +110,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 From 087cca024812ef3d0cd26191141e3e0f28369a22 Mon Sep 17 00:00:00 2001 From: shanmugga Date: Fri, 13 Sep 2024 23:02:21 +0530 Subject: [PATCH 6/6] update version --- init.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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/'