woocommerce / woocommerce-android

WooCommerce Android app
https://www.woocommerce.com/mobile
GNU General Public License v2.0
276 stars 134 forks source link

[Order Creation/Editing] We do not support big quantitative #10328

Open kidinov opened 9 months ago

kidinov commented 9 months ago

Describe the bug It looks like as we operate in floats for quantities, it gets sent in exponential form, but as "string" and presumable the backend handles it wrongly.

The client also behaves very weird

To Reproduce Steps to reproduce the behavior:

{"path":"/wc/v3/orders/2723/\u0026_method\u003dput","json":"true","body":"{\"status\":\"pending\",\"line_items\":[{\"id\":2048,\"name\":\"Aaaa\",\"product_id\":1256,\"variation_id\":0,\"quantity\":\"1.2321312E9\",\"subtotal\":\"1.2321312E+11\",\"total\":\"123213120000.00\"}],\"fee_lines\":[],\"shipping_lines\":[],\"customer_note\":\"\",\"coupon_lines\":[]}"}
{"data":{"id":2723,"parent_id":0,"status":"pending","currency":"USD","version":"8.2.0.40","prices_include_tax":false,"date_created":"2023-12-05T11:42:38","date_modified":"2023-12-05T11:45:42","discount_total":"-123213119998.77","discount_tax":"0.00","shipping_total":"0.00","shipping_tax":"0.00","cart_tax":"24642624000.00","total":"147855744000.00","total_tax":"24642624000.00","customer_id":0,"order_key":"wc_order_FnonQQbUOD4U6","billing":{"first_name":"","last_name":"","company":"","address_1":"","address_2":"","city":"","state":"","postcode":"","country":"","email":"","phone":""},"shipping":{"first_name":"","last_name":"","company":"","address_1":"","address_2":"","city":"","state":"","postcode":"","country":"","phone":""},"payment_method":"","payment_method_title":"","transaction_id":"","customer_ip_address":"","customer_user_agent":"","created_via":"rest-api","customer_note":"","date_completed":null,"date_paid":null,"cart_hash":"","number":"2723","meta_data":[],"line_items":[{"id":2048,"name":"Aaaa","product_id":1256,"variation_id":0,"quantity":1232131200,"tax_class":"","subtotal":"123213120000.00","subtotal_tax":"24642624000.00","total":"123213120000.00","total_tax":"24642624000.00","taxes":[{"id":2,"total":"12321312000","subtotal":"12321312000"},{"id":3,"total":"12321312000","subtotal":"12321312000"}],"meta_data":[],"sku":"044670012826","price":100,"image":{"id":"","src":""},"parent_name":null}],"tax_lines":[{"id":2049,"rate_code":"US-CA-TAX-1","rate_id":2,"label":"Tax","compound":false,"tax_total":"12321312000.00","shipping_tax_total":"0.00","rate_percent":10,"meta_data":[]},{"id":2050,"rate_code":"TAX-2","rate_id":3,"label":"Tax","compound":false,"tax_total":"12321312000.00","shipping_tax_total":"0.00","rate_percent":10,"meta_data":[]}],"shipping_lines":[],"fee_lines":[],"coupon_lines":[],"refunds":[],"payment_url":"https:\/\/site-for-woocommerce12a3fasdf45dfs6789.mystagingwebsite.com\/checkout\/order-pay\/2723\/?pay_for_order=true&key=wc_order_FnonQQbUOD4U6","is_editable":true,"needs_payment":true,"needs_processing":true,"date_created_gmt":"2023-12-05T11:42:38","date_modified_gmt":"2023-12-05T11:45:42","date_completed_gmt":null,"date_paid_gmt":null,"currency_symbol":"$","_links":{"self":[{"href":"https:\/\/site-for-woocommerce12a3fasdf45dfs6789.mystagingwebsite.com\/wp-json\/wc\/v3\/orders\/2723"}],"collection":[{"href":"https:\/\/site-for-woocommerce12a3fasdf45dfs6789.mystagingwebsite.com\/wp-json\/wc\/v3\/orders"}]}}}

Screenshots If applicable, add screenshots to help explain your problem.

image
peril-woocommerce[bot] commented 9 months ago
Fails
:no_entry_sign: Please add a feature label to this issue. e.g. 'feature: stats'

Generated by :no_entry_sign: dangerJS