Commit Graph

198 Commits

Author SHA1 Message Date
Peter Fabian 1e39bc0756 Merge branch 'master' into fix/1035
# Conflicts:
#	includes/wc-admin-order-functions.php
2019-01-02 14:08:23 +01:00
Peter Fabian 4eaa5d911f WIP on segmenting for orders/stats. 2019-01-02 13:35:40 +01:00
Peter Fabian 1931f3bf48 Added table name to time limit clauses. 2019-01-02 11:31:48 +01:00
Joshua T Flowers 7bbdd78bde Add missing intervals to product reports (https://github.com/woocommerce/woocommerce-admin/pull/1200)
* Add missing intervals to product reports

* Fix failing tests for product stats API

Before and after query should be within today's date since missing intervals for other days will be filled in with remaining dates.
2018-12-31 13:20:22 +08:00
Joshua T Flowers 3f388028ac Sort default category response by category ID (https://github.com/woocommerce/woocommerce-admin/pull/1201) 2018-12-28 09:50:58 -08:00
Joshua T Flowers b3979ff984 Fix order status product sync (https://github.com/woocommerce/woocommerce-admin/pull/1151)
* Move order product sync to product data store

* Move order taxes sync to taxes data store

* Move order coupons sync to coupons data store

* Use table_name constant in data syncs

* Remove order data for incomplete order statuses

* Fix report rebuild tool

* Update comments to describe create/update entry reference

* Fix data_store_init function name change
2018-12-27 11:49:00 +08:00
Joshua T Flowers 987929da83 Filter by categories query param in categories data store (https://github.com/woocommerce/woocommerce-admin/pull/1179) 2018-12-27 11:31:08 +08:00
Joshua T Flowers 017db0b339 Sync order status on refund delete (https://github.com/woocommerce/woocommerce-admin/pull/1074) 2018-12-27 11:11:33 +08:00
Peter Fabian 48dfb54a48 Switched average order value from gross to net revenue (https://github.com/woocommerce/woocommerce-admin/pull/1158)
* Switched Average order value calculation from gross to net revenue.

* Updated tests to reflect switch of average order value from gross to net revenue.
2018-12-26 15:49:46 -08:00
Joshua T Flowers dcaa35c7bf Add product SKU to products report (https://github.com/woocommerce/woocommerce-admin/pull/1161)
* Add product SKU to products report

* Add tests for SKU data
2018-12-25 11:02:06 +08:00
Justin Shreve 49a0f0f6d2 Add `reports/downloads` REST API endpoint. (https://github.com/woocommerce/woocommerce-admin/pull/1122)
* First pass at downloads REST API

* Handle PR feedback
2018-12-21 14:57:46 -08:00
Joshua T Flowers f83b0e0615 Add product categories wc-api and breadcrumbs (https://github.com/woocommerce/woocommerce-admin/pull/1131)
* Add support for product cats in wp rest api

* Add categories to WC API

* Add category breadcrumbs component

* Increase per_page limit size for product cat API

* Use wc/v3 API to pull product categories

* Return category IDs in API

* Add categories to product reports

* Add category IDs test for REST API

* Switch to getResource instead of require for total count selector
2018-12-21 10:44:27 +08:00
Paul Sealock 46c313cdc7 REST API: Categories: optimize query by removing get_the_terms 2018-12-21 11:08:08 +13:00
Peter Fabian dff8b63271 Merge pull request woocommerce/woocommerce-admin#1010 from woocommerce/fix/845
Added /reports/coupons and /reports/coupons/stats endpoints
2018-12-19 13:55:28 +01:00
Peter Fabian 4802736a0e Switched from using coupon code filter to coupon id filter by query parameter. 2018-12-19 13:37:54 +01:00
Joshua T Flowers 08d3e2c38d Change product_gross_revenue to product_net_revenue (https://github.com/woocommerce/woocommerce-admin/pull/1105)
* Change product_gross_revenue to product_net_revenue

* Change product_gross_revenue to product_net_revenue in category data store

* Change to net_revenue in frontend category report
2018-12-19 08:56:27 +08:00
Paul Sealock 15bbbe739d Hook up Categories table to endpoint 2018-12-19 08:36:42 +13:00
Peter Fabian 85e6e8df8d Added correct cache handling. 2018-12-18 12:01:42 +08:00
Peter Fabian 6c456657e8 Changed coupon_gross_discount to amount. 2018-12-18 12:01:42 +08:00
Peter Fabian 21ac75d21e Made extended_info always appear in coupons endpoint. 2018-12-18 12:01:40 +08:00
Peter Fabian 3e45c6a82c Fixed invalid sort criterion for coupons endpoint. 2018-12-18 12:01:39 +08:00
Peter Fabian a346f13beb Added extended info. 2018-12-18 12:01:38 +08:00
Peter Fabian 5eee869a74 Added small fixes to set up coupon endpoints. 2018-12-18 12:01:38 +08:00
Peter Fabian 357b8f914a Added query classes and data stores for coupons and coupons/stats. 2018-12-18 12:01:17 +08:00
Peter Fabian e273d055ef Moved functions from orders data store to allow code reuse. 2018-12-18 12:00:33 +08:00
Joshua T Flowers 9486ab7896 Update/taxes endpoint hookup/941 (https://github.com/woocommerce/woocommerce-admin/pull/1008)
* Hook up taxes to endpoint

* Hook up tax stats endpoint

* Add default tax stat totals for empty results

* Create subtotals from intervals in API

* Change orders to orders_count to keep consistent naming
2018-12-18 10:26:46 +08:00
Allen Snook de105648be Activity Panel: Inbox: Filter update and error notes out of the inbox (https://github.com/woocommerce/woocommerce-admin/pull/893)
* Filter update and error notes out of the inbox

* Remove redundant trim().

* Fix test for admin notes API type parameter.
2018-12-11 09:00:57 +08:00
Joshua T Flowers 04d3ce6eb1 Add taxes endpoint and data store (https://github.com/woocommerce/woocommerce-admin/pull/1000)
* Add taxes endpoint and data store

* Add sorting options and normalize orderby param

* Add report taxes unit tests

* Add tax rate to response

* Add country, state, priority, and name to response

* Fix tax codes query param

* Add class comment

* Add missing  to record query

* Add comment about ambiguous column
2018-12-11 08:58:05 +08:00
Joshua T Flowers 557cec57cb Add tax stats endpoint (https://github.com/woocommerce/woocommerce-admin/pull/1019) 2018-12-11 08:55:05 +08:00
Paul Sealock 93a7472e54 REST API: Add stock info to products and variations 2018-12-11 07:19:46 +13:00
Joshua T Flowers 5d3c771d45 Trigger sync_order on order stats table when refunding (https://github.com/woocommerce/woocommerce-admin/pull/990) 2018-12-05 10:10:22 +08:00
Joshua T Flowers 755b9c94f7 Reduce order table net revenue by refund total (https://github.com/woocommerce/woocommerce-admin/pull/988)
* Reduce order table net revenue by refund total

* Use order utils to get refund total
2018-12-05 10:06:00 +08:00
Peter Fabian 1c8459244a Merge branch 'master' into fix/749
# Conflicts:
#	includes/data-stores/class-wc-admin-reports-products-data-store.php
2018-12-04 12:07:43 +01:00
Peter Fabian 670801cee8 Merge pull request woocommerce/woocommerce-admin#978 from woocommerce/fix/PHP52-compat
Fixed PHP 5.2 compatibility
2018-12-04 12:00:37 +01:00
Paul Sealock bf0e025b05 REST API: isolate extened info in /reports/products 2018-12-04 13:01:36 +13:00
Peter Fabian 15b4681d30 Updated refactored function call from variations data store. 2018-12-03 20:14:05 +01:00
Peter Fabian ef0f11182a Added missing function parameter. 2018-12-03 20:07:44 +01:00
Peter Fabian e297e5ba7f Fixed TABLE_NAME references.
To be compatible with PHP 5.2.
2018-12-03 18:01:50 +01:00
Peter Fabian 1acb9827e7 Merge branch 'master' into fix/749
# Conflicts:
#	includes/data-stores/class-wc-admin-reports-products-data-store.php
2018-12-03 16:21:04 +01:00
Peter Fabian b8dff97e00 Fixed PHP 5.2 compatibility. 2018-12-03 14:44:43 +01:00
Peter Fabian 6e68247701 Merge pull request woocommerce/woocommerce-admin#953 from woocommerce/fix/740
Added support for ordering by product name in products endpoint.
2018-12-03 11:56:28 +01:00
Paul Sealock 516062975b try/variations-endpoint 2018-12-03 12:02:58 +13:00
Paul Sealock 164a67144b try/variations-endpoint 2018-12-03 11:49:37 +13:00
Peter Fabian 8b80de9bc2 Added support for ordering by product name in products endpoint. 2018-11-28 15:14:34 +01:00
Peter Fabian e6cca3c083 Replaced code_includes/_excludes with coupon_* as agreed. 2018-11-28 10:53:11 +01:00
Peter Fabian eff3a97573 Added time clause to WHERE subquery and fixed product selection. 2018-11-27 21:41:52 +01:00
Peter Fabian bc29615454 Removed unnecessary SQL conditions. 2018-11-27 21:40:13 +01:00
Peter Fabian c1af1da752 Updated structure of SQL queries for coupons and products.
As there can be multiple couopns and products assigned to one order, it requires different handling to what was initially implemented.
2018-11-27 16:34:12 +01:00
Peter Fabian 8e5709ce26 Updated get_unique_products to be more versatile and support running in other contexts.
In some cases of advanced filters, it produced incorrect SQL code.
Additionally, split of where clause to time clause and rest needed to be reflected here, too.
2018-11-27 16:32:42 +01:00
Peter Fabian 32e30ac274 Made sync of order stats table run also on clean_post_cache.
Otherwise, some changes in master data for orders would not be reflected, as save_post action is skipped if order is updated while the save_post action is running.
2018-11-27 16:29:21 +01:00
Peter Fabian 216b7c94ca Updated structure for includes/excludes coupons and products subqueries.
As there can be multiple coupons and products assigned to one order, it needs to ba handled differently when constructing SQL query.
2018-11-27 16:26:50 +01:00
Peter Fabian 7dd611f4d4 Added table name to time period sql params.
Without this, the subquery could not be used in some contexts, as the column name was ambiguous.
2018-11-27 16:23:40 +01:00
Peter Fabian db9d6e03e7 Added spaces around operator. 2018-11-16 18:22:40 +01:00
Peter Fabian c1cf221773 Fixed typos. 2018-11-16 18:02:19 +01:00
Peter Fabian 26debd77c3 WIP on advanced filters.
Plus fixing bugs:
- fixed tests
- fixed schema definition to reflect response data
- split WHERE SQL clause into time constraints and rest
2018-11-16 17:51:33 +01:00
Peter Fabian 46923de3d2 Removed superfluous unsets. 2018-11-16 12:37:15 +01:00
Peter Fabian 7c6d0dc314 Handled case where match parameter is missing. 2018-11-16 12:32:13 +01:00
Peter Fabian ea766b83ca Renamed method to better reflect its purpose.
Plus added conversion of count as string to integer.
2018-11-16 12:30:00 +01:00
Peter Fabian 16d5265aed Merge branch 'master' into fix/749 2018-11-16 12:16:50 +01:00
Peter Fabian ba09fea35d Updated filters subqueries to correctly handle no filter case. 2018-11-16 12:12:47 +01:00
Peter Fabian 723ac1e506 Added defaults for new params to Data Store. 2018-11-15 19:01:52 +01:00
Peter Fabian d009deb3e1 Added initial implementation of advanced filters. 2018-11-15 15:27:19 +01:00
Allen Snook 9246ab6ef4 Correct merge of class-wc-admin-reports-data-store 2018-11-07 07:25:17 -05:00
Allen Snook 962bb73288 Remove temporary comments on reports data store 2018-11-07 07:22:53 -05:00
Allen Snook 24c80427fc Fix a bug in the notes updater; better handle test case where
note expiration/expired date changes at woocommerce.com causing
an expired note to become an expiring note (corner case)
2018-11-07 07:21:23 -05:00
Joshua T Flowers 0f45a08f20 Update order summary in Orders report (https://github.com/woocommerce/woocommerce-admin/pull/613)
* Move TableSummary below pagination

* Add summary to order table

* Add new and returning customers

* Add product to totals in API

* Use get_var instead of get_results for unique products

* Change table summary styling

Remove slashes and increase padding between items based on discussion with @LevinMedia

Change margin to padding to overlap table shadow when pagination is not present.

* Fix wp_posts prefix and move to separate fxn

* Change new/returning customer column types to intval

* Add new/returning customer data to tests and fix formatting
2018-10-31 14:09:38 -05:00
Kelly Dwan f62537fc17 Try: Add Lerna to split out utility packages (https://github.com/woocommerce/woocommerce-admin/pull/678)
* Add lerna & GB package-building script

* Move currency library to lerna module

* Update lerna config

* Add publish commands

* Add currency as an faux-external module

* Add separate command to build just core files

* Update dependency path

* Update build script to build all packages into `dist`

* Add packages to the jest test setup

* Move date library to packages

* Update imports to use @woocommerce/date

* Output wcSettings definition before any scripts are output

Fixes issues where wc-dates lib relies on settings object

* Add the build step into travis

* Update jest config to dynamically get package paths

* Update package postcss config to match wc-admin’s main config

* Add combined watch scripts for package+app, add a `clean` command to clean up old build files

* Ignore PHPCS error (leave todo message to fix)

* Concat files with a space, fix issue where all files join in one continuous string and fail the check
2018-10-30 14:57:48 -04:00
Peter Fabian bfb6f246f0 Return correct object for REST products controller. (https://github.com/woocommerce/woocommerce-admin/pull/710) 2018-10-30 11:06:23 -07:00
Peter Fabian 3d71ec9208 Simplified compound expression to fix code for older PHP versions. 2018-10-26 14:02:53 +02:00
Jonathan Belcher 46c369afb1 Fixes lints in class-wc-admin-reports-data-store (https://github.com/woocommerce/woocommerce-admin/pull/643)
* Fixes lints in class-wc-admin-reports-data-store

* Fix documentation
2018-10-23 13:55:03 -04:00
Allen Snook bf898e642b Merge pull request woocommerce/woocommerce-admin#566 from woocommerce/add/admin-notices-new-sales-record
Activity Panel: Inbox: New Sales Record Note
2018-10-22 09:26:13 -07:00
Jonathan Belcher ecb3013fd3 Uses PHPBCF to autofix warnings and errors (https://github.com/woocommerce/woocommerce-admin/pull/611) 2018-10-22 12:20:14 -04:00
Allen Snook a46d83aea3 Rewrite the queries a bit to leverage prepare when possible 2018-10-19 15:48:38 -07:00
Allen Snook bb14dcd995 One argument per line in multi argument calls 2018-10-19 15:05:40 -07:00
Allen Snook 04b33f9e6b Hook up the remainder of the sales record message. There can only be one. 2018-10-19 14:45:03 -07:00
Allen Snook 3155d5ec24 Merge pull request woocommerce/woocommerce-admin#507 from woocommerce/add/admin-notices-rest-api
Activity Panel: Inbox: Add REST API (GETters only)
2018-10-19 08:04:46 -07:00
Jonathan Belcher f6d90821af Fix phpcs errors 2018-10-17 12:51:48 -04:00
Jonathan Belcher d800054c1e Merge branch 'master' into fix/474 2018-10-17 12:42:03 -04:00
Allen Snook 2a94177f71 Fix per_page default handling, json encoding options, schema help 2018-10-16 12:49:01 -07:00
Allen Snook 054fbb4ee3 Accept page and per page params in REST query, return total count of notes in header 2018-10-16 12:49:01 -07:00
Claudio Sanches c7ba8bd2c3 Fixed textdomain 2018-09-28 12:34:33 -03:00
Allen Snook e5e175cfab Fix static visibility, textdomain and use of JSON_FORCE_OBJECT 2018-09-27 10:48:25 -07:00
Allen Snook cb7a5b3607 PHPCS all the things 2018-09-27 09:28:15 -07:00
Allen Snook 677c205ad2 Remove interface for this PR (actions will be hooked up later);
persist actions given during creation through to the db
2018-09-27 09:28:15 -07:00
Allen Snook a930293c43 Improve prop validation, especially date handling 2018-09-27 09:28:15 -07:00
Allen Snook 4d8dfea84c Break out separate note and notes classes for clarity 2018-09-27 09:28:14 -07:00
Allen Snook 45eeb57b62 Add CRUD and Data Stores for Admin Notes 2018-09-27 09:28:14 -07:00
Claudio Sanches d8503ef720 Merge pull request woocommerce/woocommerce-admin#462 from woocommerce/fix/440
Added PHP tests
2018-09-27 12:31:36 -03:00
Claudio Sanches d672a65e1f Merge pull request woocommerce/woocommerce-admin#461 from woocommerce/fix/453
Casted numeric values to floats before performing arithmetic operations.
2018-09-27 12:29:29 -03:00
Peter Fabian c368e44ff3 Updated language domain. 2018-09-24 17:56:43 +02:00
Peter Fabian 670436ac13 PHPCS fixes. 2018-09-24 17:24:08 +02:00
Peter Fabian aa8a09adbe Merge branch 'master' into fix/440 2018-09-21 10:59:47 +02:00
Peter Fabian 880d99986f Fixed interval boundary function arguments in case no intervals are being added. 2018-09-20 16:23:19 +02:00
Peter Fabian e28f8255c3 Casted numeric values to floats before performing arithmetic operations. 2018-09-20 16:03:27 +02:00
Claudio Sanches 76d5417e2b Use WooCommerce's database prefi
Fixes woocommerce/woocommerce-admin#437
2018-09-18 17:03:42 -03:00
Peter Fabian b556d55ca6 - Removed duplicate class.
- Overridden REST API endpoints via filters.
- Updated data store class prefixes.
- Removed debugging echo.
2018-09-18 12:24:43 +02:00
Peter Fabian 1b71184f23 Updated path to background process class. 2018-09-17 20:36:29 +02:00
Peter Fabian d2ac6cdbe1 Added reporting REST API extensions to wc-admin. 2018-09-17 16:32:03 +02:00