Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0007705Openbravo ERP02. Master data managementpublic2008-10-23 12:362009-03-26 18:40
jtarbal 
rafaroda 
urgentmajoralways
closedfixed 
5
2.40 
2.50 
Core
No
0007705: POS order synchronization error creates as many payments as order lines
When importing the sales orders registered in a OB POS (v2.20) into OB ERP (v2.40), if the sales order has more than one line, the sales order created in Openbravo ERP has as many payments as lines in the sales order. The amount of each of these payments is the total sales order amount. That means that, the payments are duplicated and thus it is wrong.

In order to reproduce the error, follow the next steps:
1.- Configure the OB POS integration with OB ERP
2.- In the POS, synchronize the products catalog. The products from the ERP will be created into the POS.
3.- In the POS, register a new sales of more than one line.
4.- In the POS, synchronize the sales orders.
5.- In the ERP, go to Master Data Management > Import Data > Import Orders. Check that this window contains the sales order lines created before in the POS.
6.- Double click on any of the lines and import the sales orders.
7.- Go to Sales Management > Transactions > Sales Order. Search the sales order imported and go to Payment tab. Realize that there is as many payments as lines in the sales order.
8.- Complete the sales order. See the error when completing this document.
To reproduce this issue both in trunk and branch 2.40 without using Openbravo POS do the following via Openbravo ERP:

0) Only for 2.40: go to 'Application Dictionary || Tables and Columns || Table', select I_Order and click on 'Create Columns' (this will add from the database Paymentrule1 and Paymentamount1 which will be needed for the import process)

1) Go to 'Master Data Management || Import Data || Import Loader Format'

2) Follow the steps of http://wiki.openbravo.com/wiki/QA_test_plan_2.50/Test_cases [^]
* Do not include Currency column
* Include Paymentrule1 column with data type String
* Include Paymentamount1 column with data type Number

3) Create an OrdersPOS.txt that will simulate 1 incoming order from Openbravo POS with 2 lines (hence, 1 payment that will be payed in Cash):
AA8758758,Standard Order,bellphone,beer,100,10.5,B,6410
AA8758758,Standard Order,bellphone,shirts,400,13.4,B,6410

4) Go to 'Master Data Management || Import Data || Import File Loader' and import OrderPOS.txt with Format File = Orders

5) Go to 'Master Data Management || Import Data || Import Orders || Import Order' and see that there are to lines (that correspond to one single order imported from POS)

6) For each of the lines set an Order Date

7) Click on 'Import Orders'

Success message display saying: Orders not imported: 0; Orders inserted: 1; Orders line inserted: 2;

8) Navigate to the Sales Order created.

9) Check that the Summed Line Amount = 6410

10) Go to Lines and see that the two lines have been inserted correctly.

11) Go to Payment and you will see two payments with Cash payment rule and Amount 6410 each: WRONG

12) However, go to the Header and complete this order. The order is completed successfully.
Only one Payment line per Order header should be created.
comsup_sprint7
blocks defect 00056282.50 closed rafaroda POS order synchronization error creates as many payments as order lines 
Issue History
2009-02-20 09:17rafarodaTypedefect => backport
2009-02-20 09:17rafarodafix_in_branch => 2.40
2009-02-23 12:06svnbotCheckin
2009-02-23 12:06svnbotNote Added: 0013912
2009-02-23 12:06svnbotStatusscheduled => resolved
2009-02-23 12:06svnbotResolutionopen => fixed
2009-02-23 12:06svnbotsvn_revision => 13512
2009-02-23 18:39rafarodaTag Attached: comsup_sprint7
2009-03-03 17:31psarobeFixed in Version => 2.40MP3
2009-03-24 11:01psarobeFixed in Version2.40MP3 => 2.40MP4
2009-03-26 18:40psarobeRegression testing => No
2009-03-26 18:40psarobeStatusresolved => closed
2009-03-26 18:40psarobeNote Added: 0015021

Notes
(0013912)
svnbot   
2009-02-23 12:06   
Repository: openbravo
Revision: 13512
Author: rafaroda
Date: 2009-02-23 12:06:11 +0100 (Mon, 23 Feb 2009)

Fixes bug 0007705 Import of orders now only creates a payment per order.

---
U branches/r2.40/src/org/openbravo/erpCommon/ad_process/ImportOrder.java
U branches/r2.40/src/org/openbravo/erpCommon/ad_process/ImportOrder_data.xsql
---

https://dev.openbravo.com/websvn/openbravo/?rev=13512&sc=1 [^]
(0015021)
psarobe   
2009-03-26 18:40   
I close the bug but what it does it's wrong. A payment shouldn't be created when importing sales order. I will log another bug