Importing inventory movements can lead to a document for every movementline

Description

when importing inventory movements from the i_movement table having a time component in the movementdate field leads to a separate movement document for every movementline (instead of one document with multiple movementlines)

The reason is the movementdate is truncated when inserting into the m_movement table and then comparison i_movement.movementdate = m_movement.movementdate fails.

The attached patch solves the issue for us.

Environment

importing records to i_movement directly with time component in movementdate field

Activity

Show:
Никита Полковников
May 9, 2020, 3:14 PM

I can not run UPDATE query in test server. But i can change reference from Date to Date +Time for filed MovementDate.

Step to reproduce:

  1. Login as Client GardenWorld

  2. Open window Import Inventory Move

  3. Create first record with values:

    1. Organization: HQ

    2. DocumentNo: 1000123

    3. Movement Date: 09 May 2020 12:00:00 AM

    4. Document Type: Material Movement

    5. Business Partner: C&W Construction

    6. Shipper: Fertilizer Internal Shipper

    7. Product: Oak

    8. Locator: Fertilizer

    9. Locator To: Fertilizer Transit

    10. Movement Quantity: 4

  4. Run process Import Inventory Movement

  5. Login as Client System

  6. Open window Table and Column

  7. Open record “I_Movement“

  8. Open record “MovementDate” in tab Column

  9. Change value to “Date + Time“ in field Reference and Save

  10. Login as Client GardenWorld

  11. Open window Import Inventory Move

  12. Create second record with values:

    1. Organization: HQ

    2. DocumentNo: 1000123

    3. Movement Date: 09 May 2020 04:02:00 PM

    4. Document Type: Material Movement

    5. Business Partner: C&W Construction

    6. Shipper: Fertilizer Internal Shipper

    7. Product: Elm

    8. Locator: Fertilizer

    9. Locator To: Fertilizer Transit

    10. Movement Quantity: 2

  13. Login as Client System

  14. Open record “I_Movement” in window “Table and Column”

  15. Set value “Date” in field “Reference” for record “MovementDate” and save

  16. Login as Client GardenWorld

  17. Open window Import Inventory Move

  18. Run process Import Inventory Movement

  19. Open window Inventory Move and see two documents with DocumentNo = 1000123 and equals MovementDate (9 May 2020)

reproduced by

Assignee

Unassigned

Reporter

Daniel Haag

Labels

Tested By

None

Components

Affects versions

Priority

Minor
Configure