Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0039566Openbravo ERP07. Sales managementpublic2018-10-30 10:422018-10-31 17:28
ngarcia 
Triage Omni OMS 
urgentmajoralways
acknowledgedopen 
5
 
 
Core
No
0039566: Create Credit button for Return From Customer is only shown if there exists a line related with an invoiced order line
Create Credit button for Return From Customer is only shown if there exists a line related with an invoiced order line. Then, the lines without any original order related are also invoices, so the button should be always shown
As group admin role:
   Set 'RM Allow Orphan Line' preference to Y
   Log out and log in

   Create a Sales Order, Goods Shipment and Sales Invoice
   Create a Goods Shipment (without sales order) and sales invoice
   Create a Return From Customer header
   Click on Pick/Edit and select the previously created two shipments (do not return the whole quantity)
   Click in Insert Orphan line and add a product to it
   Book the RFC
   Create a Return Material Receipt from the RFC
   Return to the RFC and launch Create Credit process
   Check the 3 lines are included in the Sales Invoice created

   Create a new Return From Customer
   Insert Orphan line
   Book it
   Create Return Material Receipt
   Return to RFC and check the Create Credit button is not shown. It should be shown

   Create a new Return From Customer
   Click on Pick/edit Lines and select the 2nd goods shipment created (the one without sales order)
   Book it
   Create Return Material Receipt
   Return to RFC and check the Create Credit button is not shown. It should be shown
No tags attached.
diff 39566.diff (1,498) 2018-10-31 16:52
https://issues.openbravo.com/file_download.php?file_id=12348&type=bug
Issue History
2018-10-30 10:42ngarciaNew Issue
2018-10-30 10:42ngarciaAssigned To => Triage Finance
2018-10-30 10:42ngarciaModules => Core
2018-10-30 10:42ngarciaTriggers an Emergency Pack => No
2018-10-30 10:43ngarciaIssue Monitored: networkb
2018-10-30 10:55ngarciaResolution time => 1542668400
2018-10-30 16:37vmromanosAssigned ToTriage Finance => markmm82
2018-10-30 18:45markmm82Statusnew => scheduled
2018-10-31 03:25markmm82Note Added: 0107680
2018-10-31 16:52vmromanosResolution time1542668400 =>
2018-10-31 16:52vmromanosNote Added: 0107702
2018-10-31 16:52vmromanosTypedefect => design defect
2018-10-31 16:52vmromanosFile Added: 39566.diff
2018-10-31 17:28vmromanosAssigned Tomarkmm82 => Triage Finance
2018-10-31 17:28vmromanosStatusscheduled => acknowledged

Notes
(0107680)
markmm82   
2018-10-31 03:25   
Test Plan:
As group admin role:
   Set 'RM Allow Orphan Line' preference to Y
   Log out and log in

   Create a Sales Order, Goods Shipment and Sales Invoice
   Create a Goods Shipment (without sales order) and sales invoice
   Create a Return From Customer header
   Click on Pick/Edit and select the previously created two shipments (do not return the whole quantity)
   Click in Insert Orphan line and add a product to it
   Book the RFC
   Create a Return Material Receipt from the RFC
   Return to the RFC and launch Create Credit process
   Check the 3 lines are included in the Sales Invoice created

   Create a new Return From Customer
   Insert Orphan line
   Book it
   Create Return Material Receipt
   Return to RFC and check the Create Credit button is shown. Execute it and check the line is included in the Sales Invoice created

   Create a new Return From Customer
   Click on Pick/edit Lines and select the 2nd goods shipment created (the one without sales order)
   Book it
   Create Return Material Receipt
   Return to RFC and check the Create Credit button is shown.
   Execute it and check the line is included in the Sales Invoice created
(0107702)
vmromanos   
2018-10-31 16:52   
Moved to Design Defect.

The proposed solution (to relax the display logic to always show the button) implies an API functional change, which in fact could be perceived as a regression by the existing users.

See documentation: http://wiki.openbravo.com/wiki/Return_from_Customer [^]
"A new button Create credit might appear or not based on the original sales order. If the order is already invoiced then it will be present if not it won't."

As a general rule, from a functional perspective it makes all the sense to show the button only for the orders that have been previously invoiced.
Both the documentation and the code are indeed developed this way.


The concrete problem in this issue is that, when any order line was originally invoiced, the system wrongly allows to invoice every line included in the order (previously invoiced or not).
The way to properly fix this bug is by making sure you can only invoice the lines that were invoiced in the past.

However implementing this fix is very difficult, and it would require an important effort. Right now the code wrongly assumes all the lines in the order should be invoiced and calls the C_Invoice_Create process for the whole order. Instead only the previously invoiced order lines should be invoiced.
That's why we move this design defect.

Finally, as a workaround only for the customers that really want to always show this button, we have attached a patch which can be easily exported to a custom template.