Since we have order types and cashiers now, that should be enough to actual make port the Sales Report from 7.x, since most of the data is just regular order stuff.

http://drupalvm7.test/admin/commerce/pos/reports/sales-report

Comments

smccabe created an issue. See original summary.

sorabh.v6’s picture

Assigned: Unassigned » sorabh.v6
sorabh.v6’s picture

Assigned: sorabh.v6 » Unassigned
Status: Active » Needs review
StatusFileSize
new32.37 KB

This patch includes code for -

1. Sales report menu link.
2. Sales report form (Need to work more on it)
3. Libraries yml file for attaching CSS and js in the module.
4. CSS files from 7.x-2.x version(I thought they can be reused).
5. JS files from 7.x-2.x version(I thought they can be reused).

Need feedbacks.

swickham’s picture

Status: Needs review » Needs work

Looks like a lot of stuff here is just trying to quickly move over the existing CSS and JS files as well as building a filtering form from scratch. The better route to go here is first plan out with Rakesh or McCabe how this part of the port will be done. Once a game plan is in place start attacking smaller pieces from there now knowing what we're going for.

sorabh.v6’s picture

Assigned: Unassigned » sorabh.v6
smccabe’s picture

Mostly a straight port is ok, but the one big thing is to use the new commerce_reports module https://www.drupal.org/project/commerce_reports which has a nice extendable framework so we shouldn't have to build as much scaffolding and UI custom.

sorabh.v6’s picture

Ok, I'll use commerce reports. Would features be similar to d7 module?

smccabe’s picture

Yup, the features of the report should be the same, no functionality changes, just new architecture

sorabh.v6’s picture

@smccabe

In D7 sales report has columns -
Cashier Id
Cashier
Net Sales
Transactions
Items sold
Unit per transaction
$ per transaction

But in D8 commerce_report module provide us -
Order report title
amount
tax amount
shipping amount

Which is different from what we need in the sales report. So, I need to why are we using commerce reports as dependency.

Also, there are bugs #2910129: Order report not getting order number in label() method, #2910190: PriceTwigExtension::formatPrice() should accept empty values and #2910199: Table header order and row data order not matching in sales report for which I have created issues on the project page.

sorabh.v6’s picture

StatusFileSize
new2.33 KB

I am uploading patch. This patch is incomplete, I will need guidance to move forward.

sorabh.v6’s picture

Assigned: sorabh.v6 » Unassigned
smccabe’s picture

Status: Needs work » Postponed

Commerce reports needs to get a bit farther along before we can continue work on this.