Module adds Cost field to products and line items to calculate order profits and use it in different reports.
It also replaces default commerce line item manager to let editing of line item cost in admin area and see margins and order total changing in realtime.
Two fields are added to order instances to collect expenses and recalculate total order profit on order entity save.

Project Page:
https://www.drupal.org/sandbox/potop/2319043

Git Clone:
git clone --branch 7.x-1.x http://git.drupal.org/sandbox/potop/2319043.git

Reviews of other projects:

https://www.drupal.org/node/2322009#comment-9068127
https://www.drupal.org/node/2316793#comment-9070651
https://www.drupal.org/node/2187531#comment-9070903

Comments

potop’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/httpgitdrupalorgsandboxpotop2319043git

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.

potop’s picture

Issue summary: View changes
potop’s picture

Title: Commerce Costs Profits » [D7] Commerce Costs Profits

Cleaned up code regarding pareview results with exception for view related files naming and standard hooks parameters comments

potop’s picture

Status: Needs work » Needs review
pushpinderchauhan’s picture

Issue summary: View changes

Corrected Git Clone URL.

pushpinderchauhan’s picture

Status: Needs review » Needs work
Issue tags: -commerce
StatusFileSize
new5.44 KB

@potop, thanks to you for contributing.

I tried to install this module on my machine and got following issue.



Module Installation Issue


FieldException: Attempt to create a field of unknown type <em class="placeholder">commerce_price</em>. in field_create_field() (line 110

Fix this issue to get it review further.

potop’s picture

Status: Needs work » Needs review

@er.pushpinderrana, thank you for your cooperation!

I implemented simple testcase for base calculation function of my module. Now it passes and ensures that module installation process should have no issues.

PA robot’s picture

Status: Needs review » Closed (duplicate)
Multiple Applications
It appears that there have been multiple project applications opened under your username:

Project 1: https://www.drupal.org/node/2322511

Project 2: https://www.drupal.org/node/2319065

As successful completion of the project application process results in the applicant being granted the 'Create Full Projects' permission, there is no need to take multiple applications through the process. Once the first application has been successfully approved, then the applicant can promote other projects without review. Because of this, posting multiple applications is not necessary, and results in additional workload for reviewers ... which in turn results in longer wait times for everyone in the queue. With this in mind, your secondary applications have been marked as 'closed(duplicate)', with only one application left open (chosen at random).

If you prefer that we proceed through this review process with a different application than the one which was left open, then feel free to close the 'open' application as a duplicate, and re-open one of the project applications which had been closed.

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

potop’s picture

Status: Closed (duplicate) » Needs review

I prefer this module to go through review process, not the other one.

potop’s picture

Issue summary: View changes
potop’s picture

Issue summary: View changes

one more project review added

potop’s picture

Issue summary: View changes
Issue tags: +PAreview: review bonus

one more project review

mpdonadio’s picture

Assigned: Unassigned » mpdonadio

Assigning to myself for next review.

mpdonadio’s picture

Assigned: mpdonadio » Unassigned
Status: Needs review » Needs work
Issue tags: +PAreview: security

Automated Review

Review of the 7.x-1.x branch (commit 8b307fa):

  • Coder Sniffer has found some issues with your code (please check the Drupal coding standards).
    
    FILE: ...ew_temp/commerce_costs_profits_handler_area_line_item_costs_summary.inc
    --------------------------------------------------------------------------------
    FOUND 2 ERRORS AFFECTING 1 LINE
    --------------------------------------------------------------------------------
     11 | ERROR | Class name must begin with a capital letter
     11 | ERROR | Class name must use UpperCamel naming without underscores
    --------------------------------------------------------------------------------
    
    Time: 600ms; Memory: 9.75Mb
    

This automated report was generated with PAReview.sh, your friendly project application review script. You can also use the online version to check your project. You have to get a review bonus to get a review from me.

These are false positives b/c Views naming conventions. You can safely ignore them.

Manual Review

Individual user account
Yes: Follows the guidelines for individual user accounts.
No duplication
Yes: Does not cause module duplication and fragmentation.
Master Branch
Yes: Follows the guidelines for master branch.
Licensing
Yes: Follows the licensing requirements
3rd party code
Yes: Follows the guidelines for 3rd party code.
README.txt/README.md
Yes: Follows the guidelines for in-project documentation and the README Template.

Could be expanded some.

Code long/complex enough for review
Yes: Follows the guidelines for project length and complexity.
Secure code
No. If "no", list security issues identified.
(*) In commerce_costs_profits_field_widget_form_alter(), lines 91-92, you are outputting the currency symbol unsanitized. This should all be using commerce_currency_format().

(*) You are using .html() to add to the page, but it looks like everything is plain text, so you can use .text(). Using .html() also makes these XSS prone.

Coding style & Drupal API usage
JS dosen't follow code indentation standards for Drupal.

(+) JS should use the context and settings objets that are passed in.

Not really sure if restrict=TRUE is needed in your permissions. This is more for security / dangerous admin functions, not sensitive data. A site may want non-admins (eg, accountants) to be able to see this.

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.

potop’s picture

Status: Needs work » Needs review

@mpdonadio, Thank you for your review.

I fixed both (*) and (+) issues you've found.

mpdonadio’s picture

Status: Needs review » Reviewed & tested by the community

I read `git diff 8b307fa..HEAD`, and my blocking issues have beed addressed.

(+) commerce_costs_profits_field_widget_form_alter uses the [] syntax for making arrays. This was introduced in PHP 5.4. Either add this dependency to the .info, or use the array() syntax.

Not seeing anything to prevent RTBC here, but it will need another set of eyes from an admin in case I missed anything.

potop’s picture

@mpdonadio, Thank you again.
5.4 array syntax's been removed.

mpdonadio’s picture

Manual review of 7.x-1.x (30d9e3e)

You still have a few places where you aren't using the behavior context in the JS (looks like it may just be in calculateOrderTotal).

This has been RTBC for a while w/o objection, and I didn't see any blocking issues when I read through again.

mpdonadio’s picture

Status: Reviewed & tested by the community » Fixed

Thanks for your contribution, potop!

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.

potop’s picture

@mpdonadio Thank you again for what you do for the community!

Status: Fixed » Closed (fixed)

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