Are the numbers based on when the product was first sold? When it was first created? It's not very clear from looking at the table.

Comments

mglaman’s picture

Marking this under the beta2 release plan #2425267: [META] 4.0 Beta2 Release Plan

mglaman’s picture

There should be a hook_help() or README for this, but quick breakdown:

      // Compute the number of weeks since start.
      $now = new DateTime();

      // Check if that product is more recent than the history period.
      if ($start < $product_wrapper->created->value()) {
        $start_datetime = new DateTime();
        $start_datetime->setTimestamp($product_wrapper->created->value());
      }
      else {
        $start_datetime = new DateTime(variable_get('commerce_reports_stock_historyperiod', '3 months ago'));
      }

The date is from the product's creation, or the defined history period, which defaults to -3 months.

mglaman’s picture

Status: Active » Fixed

Added a README to the module, also put that content here: https://www.drupal.org/node/2334035

  • mglaman committed 87d3db7 on 7.x-4.x
    Issue #2395583: Explanation of stock reports dates
    

Status: Fixed » Closed (fixed)

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