Module Description

This module queries the data created by the Ledger module to create a set of standard accounting reports.

Project page

https://www.drupal.org/sandbox/beakerboy/2623020

Git clone command

git clone --branch 7.x-1.x http://git.drupal.org/sandbox/Beakerboy/2623020.git ledger_reports

Code Reviews

https://www.drupal.org/node/2614224#comment-10661206
https://www.drupal.org/node/2642526#comment-10729454
https://www.drupal.org/node/2664972#comment-10911736

Comments

Beakerboy created an issue. See original summary.

beakerboy’s picture

Issue summary: View changes
PA robot’s picture

Status: Needs review » Needs work

There are some errors reported by automated review tools, did you already check them? See http://pareview.sh/pareview/httpgitdrupalorgsandboxBeakerboy2623020git

We are currently quite busy with all the project applications and we prefer projects with a review bonus. Please help reviewing and put yourself on the high priority list, then we will take a look at your project right away :-)

Also, you should get your friends, colleagues or other community members involved to review this application. Let them go through the review checklist and post a comment that sets this issue to "needs work" (they found some problems with the project) or "reviewed & tested by the community" (they found no major flaws).

I'm a robot and this is an automated message from Project Applications Scraper.

ItangSanjana’s picture

Automated Review

http://pareview.sh/pareview/httpgitdrupalorgsandboxbeakerboy2623020git

Note that perfect adherence to Drupal Coding Standard is NOT a reason to block an application, except for total disregard of them. However, modules should follow them as closely as possible.

Manual Review

Individual user account
[Yes: Follows] the guidelines for individual user accounts.
No duplication
[Yes: Does not cause] module duplication and/or fragmentation.
Master Branch
[No: Does not follow] the guidelines for master branch.
Licensing
[Yes: Follows] the licensing requirements.
3rd party assets/code
[Yes: Follows] the guidelines for 3rd party assets/code.
README.txt/README.md
[No: Does not follow] the guidelines for in-project documentation and/or the README Template.
Code long/complex enough for review
[Yes: Follows] the guidelines for project length and complexity.
Secure code
[Yes: Meets the security requirements.]
Coding style & Drupal API usage
[List of identified issues in no particular order. Use (*) and (+) to indicate an issue importance. Replace the text below by the issues themselves:
  1. README.md or README.txt is missing

The starred items (*) are fairly big issues and warrant going back to Needs Work. Items marked with a plus sign (+) are important and should be addressed before a stable project release. The rest of the comments in the code walkthrough are recommendations.

If added, please don't remove the security tag, we keep that for statistics and to show examples of security problems.

This review uses the Project Application Review Template.

beakerboy’s picture

All pareview issues have been fixed.

beakerboy’s picture

Issue summary: View changes
beakerboy’s picture

Issue summary: View changes
beakerboy’s picture

Status: Needs work » Needs review
ItangSanjana’s picture

Status: Needs review » Reviewed & tested by the community

Hi, why don't you declare ledger as a dependency as well? I don't know if this is important or not, but my drush 5.10.0 stating "Module ledger_reports cannot be enabled because it depends on the following modules which could not be found: ledger_transaction [error]."

If you declare ledger, drush also can install fraction needed by ledger_transaction.

But RTBC to how the module works.

beakerboy’s picture

I didn't want to overspecify my dependencies. This depends on Ledger Transaction, which already depends on Ledger and Fraction. Do I NEED to specify it if one of my dependencies already specifies it? No big deal either way. Thanks for testing!

beakerboy’s picture

So if this has been reviewed and tested...What's next?

beakerboy’s picture

Issue summary: View changes
beakerboy’s picture

Issue tags: +PAreview: review bonus
klausi’s picture

Status: Reviewed & tested by the community » Needs work
Issue tags: -PAreview: review bonus +PAreview: security

manual review:

  1. project page is too short, what is the Ledger module? Can you add a screenshot? See also https://www.drupal.org/node/997024
  2. ledger_reports.info: why do you add your CSS to every single page in Drupal? Shouldn't you only add your CSS when the reports are displayed?
  3. ledger_reports.module: the module file is quite long already. Can you split out page callbacks to a dedicated include file?
  4. ledger_reports_page(): do not call theme() here, just return a render array. Drupal core will render it later for you.
  5. ledger_reports_page(): why do you need to set the page title here? That is already done in hook_menu(), right? Can you add a comment explaining it or remove it? Also elsewhere.
  6. "ledger_reports_print_account_total("Total Assets", $assets);": all user facing text such as "Total assets" here must run through t() for translation. Make sure to check all your strings.
  7. ledger_reports_create_sql(): never concatenate variables directly into SQL to avoid SQL injection. Use placeholders in SQL queries with Drupal's database API. This is currently a security blocker. And please don't remove the security tag, we keep that for statistics and to show examples of security problems.
  8. Warning: timezone_offset_get() expects exactly 2 parameters, 1 given in ledger_reports_create_sql() (line 502 of ledger_reports.module).
  9. ledger_reports_menu_local_tasks_alter(): I thin this violates Drupal local task design guidelines: a local task should be an action to add something for example. You are only showing reports, so I think that should be a regular tab instead.
  10. ledger_reports_income_statement(): looks a bit suspicious to XSS exploits. I could not reproduce because I was unable to setup/understand all the ledger module infrastructure to create a malicious account or transaction name that would show up here. Could you add a comment why $v->name does not have to be sanitized here? See also https://www.drupal.org/node/28984

Removing review bonus tag, you can add it again if you have done another 3 reviews of other projects.

PA robot’s picture

Status: Needs work » Closed (won't fix)

Closing due to lack of activity. If you are still working on this application, you should fix all known problems and then set the status to "Needs review". (See also the project application workflow).

I'm a robot and this is an automated message from Project Applications Scraper.

beakerboy’s picture

Status: Closed (won't fix) » Needs work

I've fixed some of it, but not all yet. (real life stuff). I'm planning on continuing to chug away at it. Geez, it takes y'all two months to review it, but I get only one month to fix the problems?

PA robot’s picture

Status: Needs work » Closed (won't fix)

Closing due to lack of activity. If you are still working on this application, you should fix all known problems and then set the status to "Needs review". (See also the project application workflow).

I'm a robot and this is an automated message from Project Applications Scraper.

beakerboy’s picture

@klausi,
Regarding the notes.
1: Added more details to the page.
2: Moved to use only as needed.
3: Moved each page to it's own .inc file.
4: done.
5: done.
6. Thanks for noticing those, done.
7: The $year variable was passed through intval() before it gets added to the SQL, so it's not a security issue, but not up to standards. Regardless, I changed it.
8: Strange...it seemed to be working the way it was, but it's fixed.
9. I'll have to read more into the this. The module that this piggybacks onto has a list of actions. You're correct in that they are all "add a new account" or "add a new transaction". I took this as a menu list and added a "view reports" to the list. I'll have to figure out the best way to make this link noticable, but still follow the guidelines.
10: I thought the 'table' type automatically called check_plain(), my mistake.

Most of the others have been fixed. I'll be double-checking everything and re-opening the issue soon.

m.stenta’s picture

Status: Closed (won't fix) » Needs work

Greetings all - I am the creator/maintainer of the Ledger module, which this project seeks to extend. I would love to see this module promoted to a full project - it provides a great set of reports on top of the Ledger module's double-entry bookkeeping data.

I spoke with @Beakerboy via email about point #9. I agree with @klausi that it is not the right way to go about it. For the time being I think it can just be removed. I will help @Beakerboy set up links to the reports in hook_menu() - but I don't think it needs to hold up further review - the module works as expected.

@Beakerboy: please remove the implementation of hook_menu_local_tasks_alter() and I will change to RTBC.

beakerboy’s picture

The function has been removed and all other issues have been addressed. Thanks for the suggestions everyone.

m.stenta’s picture

Status: Needs work » Reviewed & tested by the community

Thanks @Beakerboy! Looks good to me! I say this is ready for promotion.

misc’s picture

Status: Reviewed & tested by the community » Fixed
Issue tags: -PAreview: security

Thanks for your contribution, Beakerboy!

I updated your account so you can promote this to a full project and also create new projects as either a sandbox or a "full" project.

Here are some recommended readings to help with excellent maintainership:

You can find lots more contributors chatting on IRC in #drupal-contribute. So, come hang out and stay involved!

Thanks, also, for your patience with the review process. Anyone is welcome to participate in the review process. Please consider reviewing other projects that are pending review. I encourage you to learn more about that process and join the group of reviewers.

Thanks to the dedicated reviewer(s) as well.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.