Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0038238Openbravo ERP07. Sales managementpublic2018-03-27 17:542018-05-09 19:29
ngarcia 
collazoandy4 
urgentmajoralways
closedfixed 
5
 
3.0PR18Q3 
dmiguelez
Core
No
0038238: Error in Create Invoices From Orders for orders shipped in different organizations and business partner with invoice grouping
Error in Create Invoices From Orders for orders shipped in different organizations and business partner with invoice grouping

The goods shipment's organization is being used for the invoice
As system admin role:
   Set as displayed 'Invoice Grouping' field at 'Business Partner - Customer' tab

As group admin role:
   Create a new Invoice Schedule
      Invoice Frequency: Daily
   Create a new Business Partner and add a location to it
      Customer: Y
      Invoice Terms: Customer Schedule After Delivery
      Invoice Schedule: previously created one
      Invoice Grouping: By customer

   Create a sales order in F&B España Region Norte for that BP. Create a goods shipment in F&B España S.A.
   Create a sales order in F&B España Region Sur for that BP. Create a goods shipment in F&B España S.A.
   Go to Create Invoices From Orders window and select both orders
   Check you can invoice them

   Create a sales order and goods shipment in F&B España Region Norte for that BP
   Create a sales order and goods shipment in F&B España Region Sur for that BP
   Go to Create Invoices From Orders window and select both orders
   Check the following error message is shown:
      "The organization of the lines is different and does not depend on the organization associated with the header."
No tags attached.
related to defect 00327293.0PR16Q3 closed AtulOpenbravo Invoices not properly grouped by order in case shipment lines are not ordered by order in shipment document 
Issue History
2018-03-27 17:54ngarciaNew Issue
2018-03-27 17:54ngarciaAssigned To => Triage Finance
2018-03-27 17:54ngarciaModules => Core
2018-03-27 17:54ngarciaResolution time => 1523916000
2018-03-27 17:54ngarciaTriggers an Emergency Pack => No
2018-03-27 17:55ngarciaIssue Monitored: networkb
2018-03-27 18:02PracticsIssue Monitored: Practics
2018-04-03 16:08dmiguelezAssigned ToTriage Finance => collazoandy4
2018-04-05 19:33collazoandy4Note Added: 0103700
2018-04-05 22:46collazoandy4Statusnew => scheduled
2018-04-13 09:21aferrazRelationship addedrelated to 0032729
2018-04-16 21:21collazoandy4Note Edited: 0103700bug_revision_view_page.php?bugnote_id=0103700#r17009
2018-04-19 13:23dmiguelezNote Added: 0103994
2018-04-20 11:15hgbotCheckin
2018-04-20 11:15hgbotNote Added: 0104015
2018-04-20 11:15hgbotStatusscheduled => resolved
2018-04-20 11:15hgbotResolutionopen => fixed
2018-04-20 11:15hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/33a7fe93995e7bcd08b3974d3cb1afbee68e78fb [^]
2018-04-20 11:16dmiguelezReview Assigned To => dmiguelez
2018-04-20 11:16dmiguelezNote Added: 0104016
2018-04-20 11:16dmiguelezStatusresolved => closed
2018-04-20 11:16dmiguelezFixed in Version => 3.0PR18Q3
2018-05-09 19:29hudsonbotCheckin
2018-05-09 19:29hudsonbotNote Added: 0104391

Notes
(0103700)
collazoandy4   
2018-04-05 19:33   
(edited on: 2018-04-16 21:21)
Test Plan
  As system admin role:
   Set as displayed 'Invoice Grouping' field at 'Business Partner - Customer' tab

  As F&B International Group Admin Role
    Go to Invoice Schedule window and create a new record for * Organization and Invoice Frequency: Daily
    Go to Business Partner window and create a new record:
      Organization: *
      Customer: Y
      Invoice Terms: Customer Schedule After Delivery
      Invoice Schedule: previously created one
      Invoice Grouping: By customer
      Add Any location
   Create a sales order in F&B España Region Norte for that BP.
   Create a goods shipment in F&B España S.A. for the previous order created
   Create a sales order in F&B España Region Sur for that BP.
   Create a goods shipment in F&B España S.A. for the previous order created
   Go to Create Invoices From Orders window and select both orders, check the process ends successfull

Test Plan II
   Create two new sales order one for F&B España Region Norte and another for F&B España Region Sur with that BP.
   Create two new goods shipment for the previous order created one for F&B España Region Norte and another for F&B España Region Sur
   Go to Create Invoices From Orders window and select both orders, check the process ends successfull and two new invoices was created one for F&B España Region Norte and F&B España Region Sur

Test Plan III
   Create two new sales order one for F&B US West Coast and another for F&B España Region Norte with that BP.
   Create two new goods shipment for the previous order created one for F&B US West Coast and another for F&B España Region Norte
   Go to Create Invoices From Orders window and select both orders, check the process ends successfull and the two new invoices was created one for F&B US West Coast and F&B España Region Norte

Test Plan IV
   Create four new sales order for F&B España Region Norte, F&B US West Coast, F&B España Region Sur and F&B US East Coast organizations with that BP.
   Create four new goods shipment for the previous orders created for F&B España Region Norte, F&B US West Coast, F&B España Region Sur and F&B US East Coast organizations with that BP
   Go to Create Invoices From Orders window and select all orders created, check the process ends successfull and the four new invoices was created for &B España Region Norte, F&B US West Coast, F&B España Region Sur and F&B US East Coast

(0103994)
dmiguelez   
2018-04-19 13:23   
Test Plan V

Go to Business Partner window and create another one:
      Organization: *
      Customer: Y
      Invoice Terms: Customer Schedule After Delivery
      Invoice Schedule: previously created one
      Invoice Grouping: By customer
      Add Any location

Create 6 Sales Orders and a Goods Shipment for each one:
1. Organization: España Región Norte, Business Partner: First Business Partner
2. Organization: España Región Norte, Business Partner: First Business Partner
3. Organization: España Región Norte, Business Partner: Second Business Partner
4. Organization: España Región Sur, Business Partner: First Business Partner
5. Organization: España Región Sur, Business Partner: Second Business Partner
6. Organization: España Región Sur, Business Partner: Second Business Partner

Go to Create Invoices From Orders window and select all 6 orders and click ok
   Check that 4 Invoices have been created

Test Plan VI

Create 6 Sales Orders and a Goods Shipment for each one:
1. Organization: España Región Norte, Business Partner: First Business Partner
2. Organization: España Región Norte, Business Partner: First Business Partner
3. Organization: España Región Norte, Business Partner: Second Business Partner
4. Organization: España Región Sur, Business Partner: First Business Partner
5. Organization: España Región Sur, Business Partner: Second Business Partner
6. Organization: España Región Sur, Business Partner: Second Business Partner

Go to Generate Invoices process and select Organization: España and check Include Child Organizations option. Click ok
   Check that 2 Invoices have been created
(0104015)
hgbot   
2018-04-20 11:15   
Repository: erp/devel/pi
Changeset: 33a7fe93995e7bcd08b3974d3cb1afbee68e78fb
Author: David Miguelez <david.miguelez <at> openbravo.com>
Date: Thu Apr 19 12:31:46 2018 +0200
URL: http://code.openbravo.com/erp/devel/pi/rev/33a7fe93995e7bcd08b3974d3cb1afbee68e78fb [^]

Fixes Issue 38238. Do not group Invoices by Organization when not possible.

In case the orders belong to different Organizations and there has not
been an Organization selected manually for which to create the Invoice,
do not group by Organization since it is not possible from a functional
point of view.

* Order the results of the query by Organization
* Check group by Organization logic
* Use this logic to decide if the Invoice should be grouped by Organization
  or not

---
M src-db/database/model/functions/C_INVOICE_CREATE.xml
---
(0104016)
dmiguelez   
2018-04-20 11:16   
Code Review + Testing Ok
(0104391)
hudsonbot   
2018-05-09 19:29   
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/2be7d3efe606 [^]
Maturity status: Test