Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0035341Openbravo ERP07. Sales managementpublic2017-02-22 15:522017-03-15 20:22
JONHM 
mcobas 
immediatemajoralways
closedfixed 
5
 
3.0PR17Q2 
markmm82
Core
Packaging and release
2016-12-02
main
http://code.openbravo.com/erp/devel/pi/rev/daca5e5e260e [^]
No
0035341: Wrong orders shown in "Create Invoices From Orders" window
Wrong orders shown in "Create Invoices From Orders" window when an order is of type 'POS Order'. Those orders are invoiced by the cashup and must not be returned by this process. Before the update on the view c_invoice_candidate_v those orders were not shown.
1) Create a new Sales Order:
  - Transaction Document: POS Order
  - Business Partner: Alimentos y Supermercados
  - Invoice Terms: Immediate
1.1) Create a new line for the Sales Order (Cerveza ale 0'5L)
1.2) Book the Sales Order

2) Open it's Inovice (Open the 'cerveza ale' record in form mode and select Linked items/Sales Invoice - Lines and open the invoice)
2.1) Reactivate the invoice and delete a line.
2.3) Then complete the invoice (Complete button)

3) Open the window [Create Invoices From Orders]

--> You can see the POS Order there
The part of the c_invoice_candidate_v query
...
AND dt.docbasetype = 'SOO'
       AND ( dt.docsubtypeso <> 'ON'
              OR dt.docsubtypeso <> 'OB'
              OR dt.docsubtypeso <> 'WR' )
...
must be replaced for
...
AND dt.docbasetype = 'SOO'
       AND ( dt.docsubtypeso <> 'ON'
              AND dt.docsubtypeso <> 'OB'
              AND dt.docsubtypeso <> 'WR' )
...
to behave the same as before
No tags attached.
related to defect 0035393 closed platform IN clause in view not properly exported using postgresql 
depends on backport 00353713.0PR17Q1 closed collazoandy4 Wrong orders shown in "Create Invoices From Orders" window 
depends on design defect 0029492 closed alostale Wrong export of a view 
caused by defect 0034205 closed AtulOpenbravo View c_invoice_candidate_v has performance problem when having lots of unpaid invoices 
related to backport 00354673.0PR17Q1 closed alostale Wrong export of a view 
causes defect 0035772 closed markmm82 Orders with Invoice Terms different from Customer Schedule After Delivery cannot be invoiced if the bp has an invoice schedule 
Issue History
2017-02-22 15:52JONHMNew Issue
2017-02-22 15:52JONHMAssigned To => Triage Finance
2017-02-22 15:52JONHMModules => Core
2017-02-22 15:52JONHMRegression date => 2017-03-12
2017-02-22 15:52JONHMTriggers an Emergency Pack => No
2017-02-22 16:02JONHMRegression level => QA functional test
2017-02-22 16:08JONHMReproducibilityhave not tried => always
2017-02-22 16:37PracticsIssue Monitored: Practics
2017-02-22 16:39heccamIssue Monitored: heccam
2017-02-22 17:18markmm82Assigned ToTriage Finance => collazoandy4
2017-02-23 10:25aferrazRelationship addedrelated to 0034205
2017-02-27 12:44maiteResolution time => 1489273200
2017-02-27 12:44maiteRegression levelQA functional test =>
2017-02-27 12:44maiteRegression date2017-03-12 =>
2017-02-27 13:38vmromanosNote Added: 0094638
2017-02-27 13:45vmromanosNote Edited: 0094638bug_revision_view_page.php?bugnote_id=0094638#r14683
2017-02-27 17:18markmm82Relationship deletedrelated to 0034205
2017-02-27 17:18markmm82Relationship addedcaused by 0034205
2017-02-27 17:24markmm82Regression date => 2016-12-02
2017-02-27 17:24markmm82Regression introduced by commit => http://code.openbravo.com/erp/devel/pi/rev/daca5e5e260e [^]
2017-02-27 19:14markmm82Regression level => Pre packaging ( pi )
2017-02-27 19:14markmm82Regression introduced in release => pi
2017-02-27 19:15markmm82Statusnew => scheduled
2017-02-28 20:27markmm82Note Added: 0094667
2017-03-01 10:28aferrazRelationship addedrelated to 0035393
2017-03-09 11:29aferrazRegression levelPre packaging ( pi ) => Packaging and release
2017-03-09 11:29aferrazRegression introduced in releasepi => main
2017-03-09 12:34vmromanosRelationship addeddepends on 0029492
2017-03-09 12:53alostaleRelationship addedrelated to 0035467
2017-03-12 16:39markmm82Assigned Tocollazoandy4 => mcobas
2017-03-12 16:58hgbotCheckin
2017-03-12 16:58hgbotNote Added: 0094961
2017-03-12 16:58hgbotStatusscheduled => resolved
2017-03-12 16:58hgbotResolutionopen => fixed
2017-03-12 16:58hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/9df1ba7871bb6ef8d170452f94134d77edc06ba8 [^]
2017-03-12 16:59markmm82Review Assigned To => markmm82
2017-03-12 16:59markmm82Note Added: 0094963
2017-03-12 16:59markmm82Statusresolved => closed
2017-03-12 16:59markmm82Fixed in Version => 3.0PR17Q2
2017-03-15 20:22hudsonbotCheckin
2017-03-15 20:22hudsonbotNote Added: 0095291
2017-04-12 14:04ngarciaRelationship addedcauses 0035772

Notes
(0094638)
vmromanos   
2017-02-27 13:38   
(edited on: 2017-02-27 13:45)
This seems to be a regression. Please create backport for 17Q1 and fill the required fields.

Proposed solution should be:
WHERE o.docstatus IN ('CO','CL','IP') // This should be fixed too
AND dt.docbasetype = 'SOO'
AND dt.docsubtypeso NOT IN ('ON', 'OB', 'WR')

(0094667)
markmm82   
2017-02-28 20:27   
Test plan 1:
- Create a new Sales Order:
  - Transaction Document: POS Order
  - Business Partner: Alimentos y Supermercados
  - Invoice Terms: Immediate
- Create a new line for the Sales Order (Cerveza ale 0'5L).
- Book the Sales Order.
- Open the new invoice created from the previously created Order.
  - Reactivate the invoice and delete a line.
  - Then complete the invoice.
- Go to the window [Create Invoices From Orders].
  - Notice that the POS Order is not show there.

Test cases related to issue 34205:
Test Plan A
- Go to F&B International Group Admin.
- Create a Invoice Schedule with name Daily and frequancy as Daily.
- For business partner "Hoteles Buenas Noches, S.A.", in Customer Tab using invoice term as "Customer Schedule After Delivery" set Invoice Schedule as Daily.
- Keeping Invoice Schedule as Daily set invoice term as blank.
- Create a Order for business partner "Hoteles Buenas Noches, S.A." with Immediate Invoice Term. Add Line/s to it. Complete it.
- Create a Sales Invoice Header. Using Create Lines From, try to select above order.
- Above order appears in the drop down list.

Test Plan B
- Create a Order with invoice term 'Do Not Invoice'. Add line and Complete it.
- Create a Shipment for above order.
- Create a Sales Invoice Header and using Create Lines From, check Shipment Combo.
- Above shipment does not appear in drop down list.

Test Plan C
- Create Sales Order with Invoice Term as "Do Not Invoice". Add line/s to it. Book it.
- Create a Sales invoice Header, using Create Lines From button process check Order combo.
- Above order does not appear in the list.
- Go to Create Invoices From Order process.
- Try to search above order, it wont appear in the grid.
- Create a Shipment for above Order.
- Go to Create Invoices From Order process.
- Try to search above order, it wont appear in the grid.
- Go to Sales Invoice created above, using Create Lines From button process check Order combo.
- Above order does not appear in the list.
- Check Shipment combo, above created shipment does not appear in the list.

Test Plan D
- Create Sales Order's with Invoice Term as "Immediate".
- Go to Create Invoice From Order process.
- Try to search above order, it appears in the grid.
- Create Sales Invoice and Using Create Lines From button process, Check Order Combo.
- Above order appears in the list.

Test Plan E
- Create Sales Order's with Invoice Term as "Customer Schedule After Delivery" or "After Delivery" or "After Order Delivered"
- Create Sales Invoice and Using Create Lines From button process, Check Order Combo.
- Above order does not appears in the list.
- Go to Create Invoices From Orders process.
- Check above order does not appears in the grid.
- Create Shipment for above order.
- Go back to Sales Invoice created and Using Create Lines From button process, Check Order Combo.
- Above order appears in the list.
- Go to Create Invoices From Orders process.
- Check above order appears in the grid.

Test Plan F
- Create a Shipment for any business partner. Add line and process it.
- Create a Invoice Header for same business partner.
- Using Create Lines From button, check Shipment Combo.
- Above Shipment should appear in the list.
(0094961)
hgbot   
2017-03-12 16:58   
Repository: erp/devel/pi
Changeset: 9df1ba7871bb6ef8d170452f94134d77edc06ba8
Author: Miguel <martencobasmiguel <at> gmail.com>
Date: Thu Mar 09 14:22:29 2017 -0500
URL: http://code.openbravo.com/erp/devel/pi/rev/9df1ba7871bb6ef8d170452f94134d77edc06ba8 [^]

Fixes issue 35341: Wrong orders shown in "Create Invoices From Orders" window

Fixed the C_INVOICE_CANDIDATE_V view, changing the condition to not take into account
the sales orders different than 'ON' AND 'OB' AND 'WR' instead of using an incorrect
OR condition as suggested in the proposed solution.

Also were included some performances in the view replacing OR and AND conditions with they
respectively translations to IN and NOT IN clauses.

---
M src-db/database/model/views/C_INVOICE_CANDIDATE_V.xml
---
(0094963)
markmm82   
2017-03-12 16:59   
Code review + Testing OK
(0095291)
hudsonbot   
2017-03-15 20:22   
A changeset related to this issue has been promoted main and to the
Central Repository, after passing a series of tests.

Promotion changeset: https://code.openbravo.com/erp/devel/main/rev/54e102bef53e [^]
Maturity status: Test