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

Support for General Reports in AMMEX #2138 #2222

Merged
merged 9 commits into from
Feb 9, 2025
Merged

Conversation

velmuruganc
Copy link
Contributor

General Reports to AMMEX #2138

Pull from Master as of 2025-02-07 06:10 AM IST
Added HTML View of General Reports
@velmuruganc
Copy link
Contributor Author

@wolfsolver , please review this pull. As of now, I have implemented the report view in HTML.

Also by mistake, I have checked in below files and it is same as what I have it in the PULL-2205. Plz ignore this file in this checkin and the correct one is in PULL/2205

app/src/main/java/com/money/manager/ex/notifications/SmsReceiverTransactions.java

Made few corrections as per Codacy Static Code Analysis
@guanlisheng
Copy link
Contributor

this is good. for the code itself, can you take a look at the static code analysis results?

added fix for issue found by Codacy Static Code Analysis
@velmuruganc velmuruganc changed the title General Reports to AMMEX #2138 Support for General Reports in AMMEX #2138 Feb 8, 2025
@velmuruganc
Copy link
Contributor Author

@wolfsolver , I fixed all static code analysis results except SMS related. For now, you can ignore this error. I have changed my method return from boolean to string and testing now. This will get corrected in my next pull request which will happen after covering all my SMS related testing (~75 cases to test).

@guanlisheng
Copy link
Contributor

hi @velmuruganc, can you further look at the conflicts after #2205 merged.

additionally, we may consider to impl a bi-sync between the user database.report_v1 and https://github.com/moneymanagerex/general-reports as the SUID is in place shortly.

@velmuruganc
Copy link
Contributor Author

hi @velmuruganc, can you further look at the conflicts after #2205 merged.

@guanlisheng , I resolved the conflict.

Copy link
Contributor

@guanlisheng guanlisheng left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm. @wolfsolver, thought?

@guanlisheng guanlisheng merged commit 059e52f into master Feb 9, 2025
4 checks passed
@wolfsolver
Copy link
Member

@velmuruganc seems that you reopen db from drawer instead reuse db connection

        MmxOpenHelper MmxHelper = new MmxOpenHelper(this, new AppSettings(this).getDatabaseSettings().getDatabasePath());
        SupportSQLiteDatabase db = MmxHelper.getReadableDatabase();

@guanlisheng what is the best practice for this? register new URI?

ArrayList<DrawerMenuItem> childReportGroup = new ArrayList<>();

// Db setup
MmxOpenHelper MmxHelper = new MmxOpenHelper(this, new AppSettings(this).getDatabaseSettings().getDatabasePath());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is not the best way to get dB data.

Create a content provider and register with Uri, so you can use mmx infrastructure to get data


// Db setup
MmxOpenHelper MmxHelper = new MmxOpenHelper(this, new AppSettings(this).getDatabaseSettings().getDatabasePath());
SupportSQLiteDatabase db = MmxHelper.getReadableDatabase();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above

Comment on lines +1488 to +1489
MmxOpenHelper MmxHelper = new MmxOpenHelper(this, new AppSettings(this).getDatabaseSettings().getDatabasePath());
SupportSQLiteDatabase db = MmxHelper.getReadableDatabase();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above . You reopen dB too many times

Comment on lines +64 to +65
MmxOpenHelper MmxHelper = new MmxOpenHelper(getActivity(), new AppSettings(getActivity()).getDatabaseSettings().getDatabasePath());
SupportSQLiteDatabase mDatabase = MmxHelper.getReadableDatabase();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above... Don't reopen db


if(sqlCursor.moveToFirst())
{
sqlQuery = sqlCursor.getString(sqlCursor.getColumnIndex("SQLCONTENT"));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that general report have also Lua content for elaborate data.
Did you plan do add also this feature?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I am going to explore next

Copy link
Member

@wolfsolver wolfsolver left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See my comment inline code @velmuruganc

@velmuruganc
Copy link
Contributor Author

Member

@wolfsolver , thankyou so much for the feedback. I will look into these comments and get back to you.

Lot to learn from you both.

@wolfsolver
Copy link
Member

a short way, without changing a lot is to include this as global variable. in this way to get the already instiated variable. not the best way, but quick for now. and remove new isntance declaration

    @Inject
    Lazy<MmxOpenHelper> openHelper;

@guanlisheng
Copy link
Contributor

one more tiny thing, would we keep original Reports unchanged?

@velmuruganc
Copy link
Contributor Author

one more tiny thing, would we keep original Reports unchanged?

You mean report name?

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

Successfully merging this pull request may close these issues.

3 participants