Openbravo Issue Tracking System - Modules
View Issue Details
0040248ModulesSAP Connector Mappingspublic2019-02-20 19:242019-03-08 12:43
umartirena 
markmm82 
urgentmajoralways
closedfixed 
5
 
 
Sandrahuguet
0040248: WPUTAB export process return NPE error while exporting Cancel and Replace documents
WPUTAB export process return NPE error while exporting Cancel and Replace documents
Install the following SAP Conector modules
 * org.openbravo.externaldata.integration
 * org.openbravo.service.external.integration
 * org.openbravo.service.integration.sapecc
 * org.openbravo.service.integration.sap.ecc.mappings

Log in as Openbravo/openbravo in OB backoffice. Select "The White Vally Group Admin" role.

Open "Initialize Entity Synchronization" window
 * External Type: SAP ECC
 * Start Integration From Time: Yesterday
 * Click Done

Open "Commnunication with SAP ECC Server" window and create a record:
 * Commnunication Protocol: Debug
 * Path to iDoc Folder: /home/openbravo/sapidocs

Open "EDL Configuration" window and create a new record:
 * EDL Process: BOB ID Based Export Process

Create Output record: Output type, debug

Add necessary SAP Codes:
 * Organization
 * Channel - Touchpoint
 * Payment Method
 * Tax Category
 * PriceList
 * Tax Rate

Go to Pos Terminal and search by vbs10001. Activate the terminal. Navigate to Pos Terminal Type and configure it like below:
Group orders in one invoice = Yes
Generate Invoices for Orders = Yes

Log in Web POS as Openbravo. Refresh if needed.

Create a new sale/ticket for VBS Customer. Select 3 units of item "Avalanche transceiver". Confirm the sale and pay it by cash. Write down ticket number VBS1001/0000002.

Go to backoffice, navigate to sales order window and verify that an order has been created there, same way check that an invoice has also been created for a quatity of 3 units. Check that the invoice is fully paid. Total Outstanding = 0.00

Go back to web POS. Select the option "Open Receipts". Select the receipt just created (VBS1001/0000002) and press Cancel and Replace. Add one unit of the product. Confirm the sale and pay it by cash. Write down ticket number VBS1001/0000002-1. Total amount paid is 602.00

Go to back office and verify that the corresponding orders have been created (VBS1001/0000002-1 for a quantity = 4, and VBS1001/0000002*R*" for a quantity = -3)

Go to sales invoice and verify that a new invoice (i.e. VBS1000009) has been created there for an amount of 602.00 and 3 and 1 units of the same product.

Go back to web POS.
Do the cashup.

Go to back office

Open "Process Request" window and create a record:
 * Process: SAP ECC Export Synchronization Process
 * Timing: Run Immediately
 * Click on Schedule

Go to EDL Request window and find for a record with Search Key "WPUTAB-SAPOBMP_CashUp".
Realize that the EDL Request record is in Error status with the following stacktrace error:

Entity is null: java.lang.Exception
    at org.openbravo.service.integration.sap.ecc.mappings.util.MappingUtils.getSAPCode(MappingUtils.java:162)
    at org.openbravo.service.integration.sap.ecc.mappings.javamapper.processor.AggregatedSalesByPaymentMethod.getPaymentMethodSapCode(AggregatedSalesByPaymentMethod.java:114)
    at org.openbravo.service.integration.sap.ecc.mappings.javamapper.processor.SalesByPaymentMethodProcessor.getSyncronizableBusinessObject(SalesByPaymentMethodProcessor.java:84)
    at org.openbravo.service.integration.sap.ecc.mappings.javamapper.processor.SalesByPaymentMethodProcessor.getSalesByPaymentMethod(SalesByPaymentMethodProcessor.java:67)
    at org.openbravo.service.integration.sap.ecc.mappings.javamapper.CashUpWPUTABJavaPropertyMppingHandler.getValueOfProperty(CashUpWPUTABJavaPropertyMppingHandler.java:60)
    at org.openbravo.service.integration.sap.ecc.mappings.javamapper.CashUpWPUTABJavaPropertyMppingHandler.getValueOfProperty(CashUpWPUTABJavaPropertyMppingHandler.java:1)
    at org.openbravo.service.integration.sap.ecc.mappings.javamapper.CashUpWPUTABJavaPropertyMppingHandler$Proxy$_$$_WeldClientProxy.getValueOfProperty(CashUpWPUTABJavaPropertyMppingHandler$Proxy$_$$_WeldClientProxy.java)
    at org.openbravo.service.external.integration.mapping.JavaPropertyMapping.getMappingValueForExport(JavaPropertyMapping.java:70)
    at org.openbravo.service.external.integration.mapping.PropertyMapping.addMappingValue(PropertyMapping.java:77)
    at org.openbravo.service.external.integration.mapping.PropertyMapper.createSynchronizableBusinessObject(PropertyMapper.java:121)
    at org.openbravo.service.external.integration.export.SynchronizableBusinessObjectExporter.exportToSynchronizableBusinessObject(SynchronizableBusinessObjectExporter.java:78)
    at org.openbravo.service.external.integration.edl.BaseExportItemProcessor.processItem(BaseExportItemProcessor.java:59)
    at org.openbravo.externaldata.integration.process.AsynchronousProcessor.processBatchWithInput(AsynchronousProcessor.


No tags attached.
xml PUBON_20190308104021_FC0AD90C54.xml (1,495) 2019-03-08 12:42
https://issues.openbravo.com/file_download.php?file_id=12725&type=bug
xml PUBON_20190308104021_3327ACB35F.xml (1,851) 2019-03-08 12:42
https://issues.openbravo.com/file_download.php?file_id=12726&type=bug
xml WPUTAB_20190308104023_CB757F915B.xml (733) 2019-03-08 12:43
https://issues.openbravo.com/file_download.php?file_id=12727&type=bug
xml WPUUMS_20190308104023_D6D2811F24.xml (823) 2019-03-08 12:43
https://issues.openbravo.com/file_download.php?file_id=12728&type=bug
Issue History
2019-02-20 19:24umartirenaNew Issue
2019-02-20 19:24umartirenaAssigned To => platform
2019-02-20 19:24umartirenaResolution time => 1552431600
2019-02-21 12:20AugustoMauchAssigned Toplatform => aferraz
2019-02-21 12:24aferrazAssigned Toaferraz => Triage Finance
2019-02-25 11:00SandrahuguetAssigned ToTriage Finance => markmm82
2019-02-25 15:11markmm82Statusnew => scheduled
2019-02-26 15:28umartirenaIssue Monitored: umartirena
2019-03-03 16:53markmm82Note Added: 0110166
2019-03-04 15:47psanjuanCategorySAP Connector => SAP Connector Mappings
2019-03-08 11:11psanjuanSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=18410#r18410
2019-03-08 12:22psanjuanNote Added: 0110315
2019-03-08 12:22psanjuanNote Edited: 0110315bug_revision_view_page.php?bugnote_id=0110315#r18412
2019-03-08 12:23psanjuanNote Added: 0110316
2019-03-08 12:34psanjuanNote Edited: 0110316bug_revision_view_page.php?bugnote_id=0110316#r18414
2019-03-08 12:35psanjuanNote Edited: 0110316bug_revision_view_page.php?bugnote_id=0110316#r18415
2019-03-08 12:37psanjuanNote Edited: 0110316bug_revision_view_page.php?bugnote_id=0110316#r18416
2019-03-08 12:39hgbotCheckin
2019-03-08 12:39hgbotNote Added: 0110317
2019-03-08 12:39hgbotStatusscheduled => resolved
2019-03-08 12:39hgbotResolutionopen => fixed
2019-03-08 12:39hgbotFixed in SCM revision => http://code.openbravo.com/erp/pmods/org.openbravo.service.integration.sap.ecc.mappings/rev/2f465d1cf3f5b828bfae8954bf11543d4adbf908 [^]
2019-03-08 12:40SandrahuguetReview Assigned To => Sandrahuguet
2019-03-08 12:40SandrahuguetNote Added: 0110318
2019-03-08 12:40SandrahuguetStatusresolved => closed
2019-03-08 12:42psanjuanFile Added: PUBON_20190308104021_FC0AD90C54.xml
2019-03-08 12:42psanjuanFile Added: PUBON_20190308104021_3327ACB35F.xml
2019-03-08 12:43psanjuanFile Added: WPUTAB_20190308104023_CB757F915B.xml
2019-03-08 12:43psanjuanFile Added: WPUUMS_20190308104023_D6D2811F24.xml

Notes
(0110166)
markmm82   
2019-03-03 16:53   
Test Plan:

Install the following SAP Conector modules
 * org.openbravo.externaldata.integration
 * org.openbravo.service.external.integration
 * org.openbravo.service.integration.sapecc
 * org.openbravo.service.integration.sap.ecc.mappings

Log in as Openbravo/openbravo in OB backoffice. Select "The White Vally Group Admin" role.

Open "Initialize Entity Synchronization" window
 * External Type: SAP ECC
 * Start Integration From Time: Yesterday
 * Click Done

Open "Commnunication with SAP ECC Server" window and create a record:
 * Commnunication Protocol: Debug
 * Path to iDoc Folder: /home/openbravo/sapidocs

Open "EDL Configuration" window and create a new record:
 * EDL Process: BOB ID Based Export Process

Create Output record: Output type, debug

Add necessary SAP Codes:
 * Organization
 * Channel - Touchpoint
 * Payment Method
 * Tax Category
 * PriceList
 * Tax Rate

Go to Pos Terminal and search by vbs10001. Activate the terminal. Navigate to Pos Terminal Type and configure it like below:
Group orders in one invoice = Yes
Generate Invoices for Orders = Yes

Log in Web POS as Openbravo. Refresh if needed.

Create a new sale/ticket for VBS Customer. Select 3 units of item "Avalanche transceiver". Confirm the sale and pay it by cash. Write down ticket number VBS1001/0000002.

Go to backoffice, navigate to sales order window and verify that an order has been created there, same way check that an invoice has also been created for a quatity of 3 units. Check that the invoice is fully paid. Total Outstanding = 0.00

Go back to web POS. Select the option receipt. Select the receipt just created (VBS1001/0000002) and press Cancel and Replace. Add one unit of the product. Confirm the sale and pay it by cash. Write down ticket number VBS1001/0000002-1. Total amount paid is 602.00

Go to back office and verify that the corresponding orders have been created (VBS1001/0000002-1 for a quantity = 4, and VBS1001/0000002*R*" for a quantity = -3)

Go to sales invoice and verify that a new invoice (i.e. VBS1000009) has been created there for an amount of 602.00 and 3 and 1 units of the same product.

Go back to web POS.
Do the cashup.

Go to back office

Open "Process Request" window and create a record:
 * Process: SAP ECC Export Synchronization Process
 * Timing: Run Immediately
 * Click on Schedule

Go to EDL Request window and find for a record with Search Key "WPUTAB-SAPOBMP_CashUp".
Realize that the EDL Request record is in Success status and no stacktrace error exists.
(0110315)
psanjuan   
2019-03-08 12:22   
Issue reproduced

(0110316)
psanjuan   
2019-03-08 12:23   
(edited on: 2019-03-08 12:37)
Test Plan below (once configuration above is done):

Create a new sale/ticket for VBS Customer. Select 3 units of item "Avalanche transceiver". Confirm the sale and pay it by cash. Write down ticket number 109.

Go to backoffice, navigate to sales order window and verify that an order has been created there, same way check that an invoice has also been created for a quatity of 3 units. Check that the invoice is fully paid. Total Outstanding = 0.00

Go back to web POS. Select the option "Open Receipts". Select the receipt just created (109) and press Cancel and Replace. Add one unit of the product. Confirm the sale and pay it by cash. Write down ticket number 109-1. Total amount paid is 150.50 (amount remaining to pay).

Total sales amount = 602.00 (451.50 + 150.50)

Go to back office and verify that the corresponding orders have been created (109-1 for a quantity = 4, and 109*R*" for a quantity = -3)

Go to sales invoice and verify that below listed invoice are shown:

invoice VBS1000011 for 3 unit, total sale 451.50 Paid and Delivered
invoice VBS1000012 for 1 unit + 3 units, total sale 602.00 - Received amount in cash 150.50


Go back to web POS.
Do the cashup.

Go to sales invoice and verify that below listed invoice are shown (one more)

invoice VBS1000011 for 3 unit, total sale 451.50 Paid and Delivered
invoice VBS1000012 for 1 unit + 3 units, total sale 602.00 - Received amount in cash 150.50
invoice VBS1000013 for -3 units, total sale -451.50


Go to back office

Open "Process Request" window and create a record:
 * Process: SAP ECC Export Synchronization Process
 * Timing: Run Immediately
 * Click on Schedule

Verify that below IDOCS have been created:

PUBON_20190308104021_FC0AD90C54.xml, including:
sales of 3 units and a payment of 451.50 EUR in cash

This one corresponds to invoice number VBS1000011 above POS order 109

PUBON_20190308104021_3327ACB35F.xml, including:
sales of 3 units and 1 units, and two payment 451.50 and 150.50 EUR in cash

This one corresponds to invoice number VBS1000012 above and POS order 109-1

WPUUMS_20190308104023_D6D2811F24.xml, created by cash-up process, including:
return of 3 units

and WPUTAB_20190308104023_CB757F915B.xml, created by cash-up process, including:
payment of -451.50

These two last ones correspond to invoice VBS1000013 and order 109*R*

Above test is correct.

(0110317)
hgbot   
2019-03-08 12:39   
Repository: erp/pmods/org.openbravo.service.integration.sap.ecc.mappings
Changeset: 2f465d1cf3f5b828bfae8954bf11543d4adbf908
Author: Mark Molina <mark.molina <at> doceleguas.com>
Date: Fri Mar 01 10:53:08 2019 -0300
URL: http://code.openbravo.com/erp/pmods/org.openbravo.service.integration.sap.ecc.mappings/rev/2f465d1cf3f5b828bfae8954bf11543d4adbf908 [^]

Fixes issue 40248: WPUTAB export process return NPE error while exporting Cancel
and Replace documents.

Issue is caused by asking for the Payment amount, it will return as the paymentMethod
and currency identifiers as '-1' when the document is cancelled and the payment amount be ZERO.
Return '-1' as ID causes the NPE because there isn't any payment method with that ID.

To fix that, avoid to ask for the Payment amount but by the related Payment Detail Amount
of this payment.

---
M src/org/openbravo/service/integration/sap/ecc/mappings/javamapper/processor/AggregatedSalesByPaymentMethod.java
---
(0110318)
Sandrahuguet   
2019-03-08 12:40   
Code review + testing OK