Commit Graph

282 Commits

Author SHA1 Message Date
Joshua T Flowers c6a6e737c4 Add refund filtering to order reports (https://github.com/woocommerce/woocommerce-admin/pull/2179)
* Add customer functions to order and refund classes

* Extract shared order and refund methods to trait

* Add refund filter to advanced filters in orders report

* Filter refund types in orders data store

* Extract refunds subquery to parent report data store method

* Add refund subquery filtering to order stats data store

* Add tests around refund type filtering

* Change the default option for the refunds filter
2019-05-10 14:56:57 +08:00
Joshua T Flowers 3382fb7011 Record refunds separate from order entries (https://github.com/woocommerce/woocommerce-admin/pull/2083)
* Sync refunds on order sync

* Separate order and refund class extensions

* Add customer functions to order and refund classes

* Change products store to work with refund amounts

* Return early for refunds in coupon data store

* Allow refund processing in tax data store

* Remove unused refund amounts from tables and data stores

* Change order counts to parse out refund entries

* Include refunded orders in default queried statuses

* Only process order number filter on shop order post types

* Extract shared order and refund methods to trait

* Fix renamed schedule_single_order_import method

* Bump PHP and WP version requirements
2019-05-10 14:39:25 +08:00
Ron Rennick 0f2788ed1c fix customer name logic on populating customer lookup data 2019-05-08 10:01:12 -03:00
Jeff Stieler a36e3cd024 Merge pull request woocommerce/woocommerce-admin#2034 from woocommerce/add/1850-import-endpoint
Add import endpoint and controller
2019-05-01 13:29:00 -06:00
Joshua Flowers a4d1256292 Add customer deletion method to customers data store 2019-04-30 17:37:20 -06:00
Jeff Stieler e350cfc898 Remove strict comparison from “is valid customer” logic.
Needed for the function to work in scheduled actions.
2019-04-30 09:09:35 -06:00
Joshua T Flowers 8bc3d8622e Add order date filter to customers data store (https://github.com/woocommerce/woocommerce-admin/pull/2094)
* Add before and after params to customers controller

* Map before and after order params to order creation date filter

* Hook up customer date filter params in leaderboards controller
2019-04-23 10:01:36 +08:00
Albert Juhé Lluveras dab7cf7dff Respect manual offsets in default before/after params (https://github.com/woocommerce/woocommerce-admin/pull/2042) 2019-04-15 19:28:19 +02:00
Joshua Flowers f213f5cb66 Make customer name empty string by default instead of null 2019-04-12 16:50:43 +08:00
Joshua T Flowers e31be343e2 Make customer name extendable (https://github.com/woocommerce/woocommerce-admin/pull/1976)
* Make customer name extendable

* Update get_customer_name to favor user profile information

* Update customer name on profile update

* Add tests around customer name getting and setting

* Prefix customer name filter with woocommerce_reports_
2019-04-09 11:39:39 +08:00
Joshua T Flowers 753780bf7b Onboarding: Add levels REST API (https://github.com/woocommerce/woocommerce-admin/pull/1938)
* Add levels rest controller

* Add default levels

* Add onboarding level API tests

* Drop all since tags

* Make pre-response levels array associative for easier formatting

* Fix level tests for associative array
2019-04-05 10:35:30 +08:00
Ron Rennick 14d0d24762 phpcs lint fixes for /data-stores/ folder 2019-04-03 16:19:43 -03:00
Joshua T Flowers 0c5c1c3db4 Remove coupon_total from order stats table (https://github.com/woocommerce/woocommerce-admin/pull/1975)
* Remove coupons_total from order stats table

* Replace discount amount with coupon objects in stat tests
2019-04-03 09:37:17 +08:00
Ron Rennick c061bfd925 Merge pull request woocommerce/woocommerce-admin#1977 from woocommerce/fix/1783
lookup product title in order meta if product has been deleted
2019-04-02 16:13:47 -03:00
Ron Rennick 1d0e78e626 code alignment for linter 2019-04-02 15:20:23 -03:00
Ron Rennick 3a8ddbe3aa lookup product title in order meta if product has been deleted 2019-04-02 09:24:52 -03:00
Joshua T Flowers b03362da68 Cast order totals as floats when calculating net total (https://github.com/woocommerce/woocommerce-admin/pull/1945) 2019-04-02 13:43:12 +08:00
Albert Juhé Lluveras 458f3ed065 Fix SKU sorting in the Variations report when a comparison is active (https://github.com/woocommerce/woocommerce-admin/pull/1952)
* make is sortable true.

* Variations endpoint: Fix sorting by SKU when there is an active comparison

* Cleanup

* Extract FROM parameter logic to 'get_from_sql_params'

* Remove unnecessary 'get_order_by_sql_params' from Products and Variations data stores
2019-04-01 10:09:45 +02:00
Joshua T Flowers 9c3faea12f Refactor notes controller and add ordering params (https://github.com/woocommerce/woocommerce-admin/pull/1878)
* Separate notes controller request args and add collection params

* Fix page param var

* Fix collection params sanitization

* Allow array of note types to be queried

* Add order and orderby collection params to notes controller

* Allow sorting by order and orderby params in notes data store

* Make sure notes are ordered by date and unread matches inbox note types

* Allow status or type params to use an array of items

* Add tests for notes ordering

* Remove unnecessary query arg assignment in the notes data store

* Update get_notes_count to use array for status and type
2019-04-01 10:53:34 +08:00
Joshua T Flowers 42ddfc0108 Add coupons count to data store and hook up to summary numbers in orders report (https://github.com/woocommerce/woocommerce-admin/pull/1912)
* Change coupons sum to distinct coupon count in REST API

* Hook up unique coupon count to orders summary numbers

* Add coupons count to order segmenting

* Add coupons count to expected stats in order test and revenue tests
2019-04-01 10:16:57 +08:00
ronakganatra9 3cddc714c6 issue fix woocommerce/woocommerce-admin#1801 SKU filter issue fixed. (https://github.com/woocommerce/woocommerce-admin/pull/1837)
* issue fix woocommerce/woocommerce-admin#1801 SKU filter issue fixed.

* make is sortable true.

* phpcs error fix.

* Fix PHPCS errors and warnings.

* Fix PHPCS errors and warnings.

* Update client/analytics/report/products/table-variations.js

Co-Authored-By: ronakganatra9 <ronakganatra9@gmail.com>

* Update includes/data-stores/class-wc-admin-reports-variations-data-store.php

Co-Authored-By: ronakganatra9 <ronakganatra9@gmail.com>

* changed postmeta.meta_value to meta_value
2019-03-31 20:53:48 +02:00
Paul Sealock 3dd99108fa Customers API: fix exact match params 2019-03-29 11:40:37 +13:00
Paul Sealock 0c4e4717d9 Merge pull request woocommerce/woocommerce-admin#1936 from woocommerce/fix/rebuild-inifinite-loop
Sync: Avoid infinite loop when REPLACE-ing SQL rows
2019-03-29 09:36:39 +13:00
Paul Sealock f9ab21e745 Sync: Avoid infinite loop when REPLACE-ing SQL rows 2019-03-28 16:19:11 +13:00
Joshua T Flowers 929ad8bf63 Remove unused categories in orders data store (https://github.com/woocommerce/woocommerce-admin/pull/1928) 2019-03-28 10:25:00 +08:00
Joshua T Flowers 896a790d8f Check if customer creation date is not null before formatting (https://github.com/woocommerce/woocommerce-admin/pull/1926) 2019-03-27 11:46:47 +08:00
Joshua T Flowers ebac101b51 Don't query products all products for empty categories (https://github.com/woocommerce/woocommerce-admin/pull/1911) 2019-03-26 13:21:46 +08:00
Jeff Stieler 2d8f8f9137 Merge pull request woocommerce/woocommerce-admin#1848 from woocommerce/add/1756-snooze-admin-notes
Add "remind me later" functionality to StoreAlert component.
2019-03-21 08:41:44 -06:00
Albert Juhé Lluveras 1cf134d1fa Fix PHP notices on orders data store (https://github.com/woocommerce/woocommerce-admin/pull/1870) 2019-03-21 15:35:25 +01:00
Jeff Stieler 2eecb6c375 Add “is snoozable” flag to WC_Admin_Note. 2019-03-20 08:52:22 -06:00
Albert Juhé Lluveras 58154d1d39 Activity Panel: set orders unread indicator based on real data (https://github.com/woocommerce/woocommerce-admin/pull/1824) 2019-03-19 11:57:11 +01:00
Albert Juhé Lluveras e6cf40e3f0 Allow sorting by tax_code in Taxes report (https://github.com/woocommerce/woocommerce-admin/pull/1812) 2019-03-15 21:44:03 +01:00
Joshua T Flowers 9d58f8ca58 Fix deleted coupon data sync (https://github.com/woocommerce/woocommerce-admin/pull/1753)
* Delete coupon from lookup table when permanently deleted

* Don't sync null ID coupons on order sync
2019-03-14 12:12:35 +08:00
Jeff Stieler bfe5a75e98 Update text domain. (https://github.com/woocommerce/woocommerce-admin/pull/1795)
* Translation call text domain change from “wc-admin” to “woocommerce-admin”.

* Fix .pot file generation.

* Fix errantly closed array item in /revenue/stats controller.

* Rename plugin zip, main file, and repo name to "woocommerce-admin".
2019-03-13 11:14:02 -06:00
Paul Sealock 00eb04255f Merge pull request woocommerce/woocommerce-admin#1750 from woocommerce/fix/deleted-product-error
Fix deleted product error
2019-03-13 12:06:22 +13:00
Justin Shreve 1348245406 Add store notice around processing historical data. (https://github.com/woocommerce/woocommerce-admin/pull/1763)
* Add store notice around processing historical data.

* Cleanup

* Handle PR feedback.

* Clean up `add` logic and add empty content_data. Also add logic to get_notes_count so that we can hide unactioned statuses.

* Add the ability to update a note, and to also mark a status when an alert is clicked.

* Remove mark_actioned call on sync

* add missing todo
2019-03-12 09:13:20 -04:00
Albert Juhé Lluveras 6c9b96f49a Make variations and coupons endpoints return zero-value items (https://github.com/woocommerce/woocommerce-admin/pull/1765)
* Make categories endpoint return zero-value items

* Rename PHP variable to make it more specific

* Remove uneeded lines

* Make variations and coupons endpoints return zero-value items

* Remove second parameter from get_ids_table
2019-03-12 11:11:28 +01:00
Albert Juhé Lluveras d3230d8dae Make categories endpoint return zero-value items (https://github.com/woocommerce/woocommerce-admin/pull/1755)
* Make categories endpoint return zero-value items

* Rename PHP variable to make it more specific

* Remove uneeded lines

* Remove second parameter from get_ids_table
2019-03-12 10:50:53 +01:00
Albert Juhé Lluveras cf162dda7f Taxes report: sort tax rates numerically instead of alphabetically (https://github.com/woocommerce/woocommerce-admin/pull/1766)
* Taxes report: sort tax rates numerically instead of alphabetically

* Use DECIMAL(7,4) for tax_rate sorting
2019-03-12 10:31:19 +01:00
Tiago Noronha 965a4a6cb5 Merge pull request woocommerce/woocommerce-admin#1758 from woocommerce/fix/1736
Add StoreAlerts placeholder
2019-03-08 19:52:57 +00:00
Tiago Noronha 2e2fb90cde Add support for notes count by note type 2019-03-08 15:17:24 +00:00
Albert Juhé Lluveras d2c0dd5555 Make products and rates endpoints return zero-value items (https://github.com/woocommerce/woocommerce-admin/pull/1722)
* Make products endpoint return zero-value items

* Make rates endpoint return zero-value items

* Several fixes

* Add tests

* Simplify code

* Merge both queries into one to simplify code

* Rename 'get_outer_from_sql_params' to 'get_from_sql_params'
2019-03-06 12:36:43 +01:00
Joshua Flowers b1890190c7 Get product ID for line item from meta table instead of deleting 2019-03-06 16:03:54 +08:00
Joshua Flowers c6c71b0238 Delete product IDs from lookup table on delete 2019-03-06 15:09:38 +08:00
Joshua Flowers 1715e98b98 Don't fetch extended attributes if product doesn't exist 2019-03-06 14:25:59 +08:00
Peter Fabian 99e88706ad Merge pull request woocommerce/woocommerce-admin#1681 from woocommerce/fix/1476-2
Updated is_returning_customer definition to use refactored function.
2019-03-05 13:00:07 +01:00
Peter Fabian 1b90296bba Updated timezone handling to be in line with other WC code. 2019-02-25 20:05:25 +01:00
Peter Fabian 3f9a43fdd0 Added timezone to datetime to correctly identify first order(s).
If default PHP timezone is UTC, then any order between first order and positive UTC offset is identified as 'first', which is incorrect.
2019-02-23 18:38:45 +01:00
Peter Fabian 3ce686e6cd Updated is_returning_customer definition to use refactored function. 2019-02-22 22:06:21 +01:00
Paul Sealock 62a6b619d9 Taxes Report: allow segmentation by tax 2019-02-22 11:37:15 +13:00