Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JdbcSupport added utility function for getting localDateTime after considering timezone of tenant #563

Merged
merged 3 commits into from
Jul 7, 2019

Conversation

mohitsinha
Copy link
Member

@mohitsinha mohitsinha commented Apr 23, 2019

JdbcSupport added utility function for getting localDateTime after considering timezone of tenant
This utility function will be useful in many cases where someone needs to retrieve @TeMPOraL(TemporalType.TIMESTAMP) for eg: created_date

Description

Describe the changes made and why they were made. Ignore if these details are present on the associated Jira ticket

Checklist

Please make sure these boxes are checked before submitting your pull request - thanks!

Our guidelines for code reviews is at https://cwiki.apache.org/confluence/display/FINERACT/Code+Review+Guide

@ippezshelby
Copy link
Contributor

@mohitsinha , Is it possible to implement this too?
Background
Currently the today variable in getLocalDateOfTenant() method takes the current date of the server. However, we would like to have a custom current date by creating a new column in m_office called current_working_date and this value queried from the database and set as today. It is then changed or set to the next working date when closing day (Accounting Closure)

So if as of today the current_working_date is say '18-04-2019' though the date today is 23-04-2019, we want all system posted transactions and manual transactions to have '18-04-2019' as transaction date. At the end of the day, during Accounting Closure, the next working date (19-04-2019' is set.

How do i modify DateUtils.getLocalDateOfTenant() to achieve this?

@mohitsinha
Copy link
Member Author

@Ippezrobert
I think it's possible, is this a new feature that is desired. I don't think it has anything to do with my commit.

You may want to look at the class FineractPlatformTenant and read values from database and store it there if you want to store current working day for a tenant, rather than for each offices.

@ippezshelby
Copy link
Contributor

@mohitsinha , i was hoping you can help to extend that. Its should be for each office not at tenant level because there may be a day which is not a working day in one office but a working day in another office. Am hoping this value to be stored in m_table. Its just a new enhancement that is custom to us and may also apply to other users in the community.

Something like this
image

@mohitsinha
Copy link
Member Author

@Ippezrobert I don't know if I understood the requirement correctly.
You need to post transactions on 23-04 as transactions done on 18-04 because the last working day of the office was 18-04.
Fineract supports back date transactions very well which you can use directly. Hence you can pass the transaction date/ loan creation date/ client creation date to 18-04 even on 23-04 if you are able to keep track of the last working date of the office.

Currently, if the functionality to set the last working date has to be added on Mifos, it will be a big feature as a lot of things may be needed like Crons to update date, test cases etc.

@ippezshelby
Copy link
Contributor

The manually triggered trasactions are okay as the user selects the date from the datepicker and can slect the current working date (2019-04-08) as in the above example but now the dilema is in automatice system postings like interest posting, standing order processing and all system triggered transactions in which it selects the date from

I guess the returned variable today is the one the system uses as transaction date for system triggered transactions, now if so i would like the system to assign the value of this to be 2019-04-08 to the returned variable today as queried from database

@awasum
Copy link
Contributor

awasum commented Jul 7, 2019

@Ippezrobert and @mohitsinha , What is the status of this?

Should the additional feature request go into another issue? Maybe create a new issue to track this feature.
@Ippezrobert will you be able to review and merge this?

@mohitsinha
Copy link
Member Author

@awasum @Ippezrobert I think the new feature requested is outside the scope of this fix. It will be a bigger code fix and should be handled separately.

@awasum
Copy link
Contributor

awasum commented Jul 7, 2019

@Ippezrobert Will u be willing to create a new Issue on JIRA to address the new request you made?

@awasum awasum closed this Jul 7, 2019
@awasum awasum reopened this Jul 7, 2019
@awasum
Copy link
Contributor

awasum commented Jul 7, 2019

@mohitsinha Have u subscribed to the fineract dev list?

@mohitsinha
Copy link
Member Author

Yes

@awasum
Copy link
Contributor

awasum commented Jul 7, 2019

@mohitsinha Make sure you have an account on Fineract JIRA: https://issues.apache.org/jira/projects/FINERACT/summary

So you create issues, assign them to yourself and discuss ideas on the mailing list before sending in PRs...

@awasum awasum merged commit 5c9028f into apache:develop Jul 7, 2019
@mohitsinha
Copy link
Member Author

I have an account. I can create issues, but I can't assign myself to it (maybe it's because I am not part of the Apache Software Foundation).

I thought that, small changes like this don't need a JIRA id. Whenever, I make a big change, I create a ticket and commit my code with the message starting with the JIRA id.

@awasum
Copy link
Contributor

awasum commented Jul 7, 2019

Great, You are right. I was just making sure.

@ippezshelby
Copy link
Contributor

ippezshelby commented Jul 7, 2019 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants