Skip to content

Invoice for products that use qty decimal rounds down to whole number #11941

Closed
@ralbin

Description

@ralbin

This is a new issue in Magento 2.2.0. This feature works as expected in all previous versions. Use check/money order for payment. When trying to invoice an order that has products with quantity decimals, the invoice rounds down to the nearest whole number. Example, ordered 6.5 of a product but the invoice uses 6. The ultimate reason this is not working is in the table sales_order_item column is_qty_decimal is not being set to 1.

Preconditions

  1. Magento ver. 2.2.0
  2. PHP 7.0.24
  3. MySQL 5.7

Steps to reproduce

  1. Create a virtual product
  2. In Advanced Inventory Qty Uses Decimals = Yes
  3. In Advanced Inventory Manage Stock = No
  4. In the admin create an order using the new product and pay with check/money order
  5. Purchase a quantity of 6.5 of the product and complete the order
  6. Start to create the invoice look at the QTY invoiced it will be rounded down to 6
  7. If you set the flag $_canCapturePartial you are able to edit the field, however it resets back to 6
  8. Look at the database table sales_order_item and notice that the column is_qty_decimal is set to 0.

Expected result

  1. Invoice should automatically use the QTY ordered such as 6.5
  2. Ability to edit of a quantity similar to 5.5
  3. Button to update the invoice to show the changes if modified from the original
  4. Review the database table sales_order_item and column is_qty_decimal = 1

Actual result

  1. Quantity is rounded down to the nearest whole number and unable to edit the qty to be invoiced
  2. Inspecting the database sales_order_item I noticed that is_qty_decimal was set to 0, changing that to 1 made the invoice show 6.5 for the quantity.
  3. Ability to edit a check/money order quantity should be available by default, rather than having to do a new module that sets the flag $_canCapturePartial = true;

Metadata

Metadata

Assignees

Labels

Fixed in 2.2.xThe issue has been fixed in 2.2 release lineFixed in 2.3.xThe issue has been fixed in 2.3 release lineIssue: Clear DescriptionGate 2 Passed. Manual verification of the issue description passedIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedIssue: Format is validGate 1 Passed. Automatic verification of issue format passedIssue: Ready for WorkGate 4. Acknowledged. Issue is added to backlog and ready for developmentReproduced on 2.2.xThe issue has been reproduced on latest 2.2 releaseReproduced on 2.3.xThe issue has been reproduced on latest 2.3 release

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions