Openbravo Issue Tracking System - Modules
View Issue Details
0037789ModulesIntercompany Documentspublic2018-01-31 11:072018-02-06 12:00
ngarcia 
markmm82 
immediatemajoralways
closedfixed 
5
 
 
2017-03-10
https://code.openbravo.com/erp/devel/pi/rev/86dcf5d294d9e10e95f8f9f7b69416dc787607ca [^]
Production - Confirmed Stable
dmiguelez
0037789: Cannot book an Inter-company Order if the price includes taxes
Cannot book an Inter-company Order if the price includes taxes
As group admin role:
   Create two price lists and versions, one for sales and one for purchase. Set both of them as Price Includes Tax = 'Y'

   Create a Tax Category and a tax rate for it:
      Rate: 16
   
   Create a new product, set the previously created tax category
   Set a price of 11 in both price lists

   Create two business partners: one as vendor and one as a customer and assign the previously created price lists

   Configure Inter-company: document types, organization's business partners... (you can follow the documentation)

   Create an Inter-company Sales Order for the customer and price list already created
   Add 20 units of the already created product and try to Book it

   The following error message is raised:

"Counter document cannot be created. The tax amounts of the original document and the counter document do not match."
No tags attached.
related to defect 0027729 closed AtulOpenbravo Modules Intercompany documents is not compatible with "Price including taxes" functionality 
caused by design defect 0032265 closed aferraz Openbravo ERP [SER QA 1434] Taxes at document level are not properly calculated in some cases 
Issue History
2018-01-31 11:07ngarciaNew Issue
2018-01-31 11:07ngarciaAssigned To => Triage Finance
2018-01-31 11:07ngarciaResolution time => 1519167600
2018-01-31 11:07ngarciaRelationship addedrelated to 0027729
2018-01-31 11:08ngarciaRelationship addedrelated to 0032265
2018-01-31 11:08ngarciaIssue Monitored: networkb
2018-01-31 21:46achavesIssue Monitored: achaves
2018-02-01 11:26dmiguelezAssigned ToTriage Finance => markmm82
2018-02-01 13:47ngarciaPriorityurgent => immediate
2018-02-01 16:03markmm82Statusnew => acknowledged
2018-02-01 19:19dmiguelezRegression date => 2017-03-10
2018-02-01 19:19dmiguelezRegression introduced by commit => https://code.openbravo.com/erp/devel/pi/rev/af56683ab963 [^]
2018-02-01 19:19dmiguelezRegression level => Production - Confirmed Stable
2018-02-05 16:01markmm82Statusacknowledged => scheduled
2018-02-05 21:34markmm82Note Added: 0102200
2018-02-06 11:13hgbotCheckin
2018-02-06 11:13hgbotNote Added: 0102211
2018-02-06 11:13hgbotStatusscheduled => resolved
2018-02-06 11:13hgbotResolutionopen => fixed
2018-02-06 11:13hgbotFixed in SCM revision => http://code.openbravo.com/erp/pmods/org.openbravo.interco/rev/38f71821c7a50fb932653fd5815ab4ba472aec7b [^]
2018-02-06 11:13hgbotCheckin
2018-02-06 11:13hgbotNote Added: 0102212
2018-02-06 11:13hgbotCheckin
2018-02-06 11:13hgbotNote Added: 0102213
2018-02-06 11:15dmiguelezReview Assigned To => dmiguelez
2018-02-06 11:15dmiguelezNote Added: 0102214
2018-02-06 11:15dmiguelezStatusresolved => closed
2018-02-06 11:33dmiguelezRelationship addedcaused by 0035471
2018-02-06 11:59dmiguelezRelationship deletedcaused by 0035471
2018-02-06 11:59dmiguelezRelationship replacedcaused by 0032265
2018-02-06 12:00dmiguelezRegression introduced by commithttps://code.openbravo.com/erp/devel/pi/rev/af56683ab963 [^] => https://code.openbravo.com/erp/devel/pi/rev/af56683ab963https://code.openbravo.com/erp/devel/pi/rev/86dcf5d294d9e10e95f8f9f7b69416dc787607ca [^]
2018-02-06 12:00dmiguelezRegression introduced by commithttps://code.openbravo.com/erp/devel/pi/rev/af56683ab963https://code.openbravo.com/erp/devel/pi/rev/86dcf5d294d9e10e95f8f9f7b69416dc787607ca [^] => https://code.openbravo.com/erp/devel/pi/rev/86dcf5d294d9e10e95f8f9f7b69416dc787607ca [^]

Notes
(0102200)
markmm82   
2018-02-05 21:34   
Test Plan:
  Create a new Price List:
    Organization = F&B España, S.A
    Name = PLSales
    Sales Price List = 'Y'
    Price Includes Tax = 'Y'
    Currency = EUR
  Create a new Price List Version to it
    Name = PLSalesVersion
    Valid From Date = Today
    Price List Schema = Esquema de Tarificación
  
  Create a new Price List:
    Organization = F&B España, S.A
    Name = PLPurchase
    Sales Price List = 'N'
    Price Includes Tax = 'Y'
    Currency = EUR
  Create a new Price List Version to it
    Name = PLPurchaseVersion
    Valid From Date = Today
    Price List Schema = Esquema de Tarificación

  Create a Tax Category
    Organization = F&B España, S.A
    Name = TaxCategory16
  Creat a tax rate for it:
    Organization = F&B España, S.A
    Name = TaxRate16
    Valid From Date = Today
    Tax Category = TaxCategory16
    Rate = 16
    Sale/Purchase Type = Both
   
   Create a new product, set the previously created tax category
    Organization = F&B España, S.A
    Name = TestProduct
    Tax Category = TaxCategory16
   Add a price for it:
    Price List Version = PLSalesVersion
    Unit Price = List Price = 11.00
   Add a price for it:
    Price List Version = PLPurchaseVersion
    Unit Price = List Price = 11.00

   Create new business partners: one as vendor (vendor) and one as a customer (customer) and assign the previously created price lists
   Vendor
    Organization = F&B España, S.A
    Name = vendorA
    Business Partner Category = Supplier
   Go to Vendor/Creditor tab and define as:
    Purchase Price List = PLPurchase
    
   Vendor
    Organization = F&B España, S.A
    Name = customerB
    Business Partner Category = Customer - Tier 1
   Go to Customer tab and define as:
    Purchase Price List = PLSales

   Configure Inter-company:
     Business Partners mapping
        Mapping vendor vendorA to organization F&B España, S.A
         Go to Organization and select F&B España, S.A org.
         Go to Information tab and set vendorA as Business Partner of the organization.
        Mapping customer customerB to organization F&B España - Región Norte
         Go to Organization and select F&B España - Región Norte org.
         Go to Information tab and set customerB as Business Partner of the organization.

     Definition of Inter-company Document Types
        Go to Document Types window and create a new one:
         Organization = *
         Name = Inter-company Sales Order
         Print text = Inter-company Sales Order
         G/L Category = Standard
         Sales transaction = Checked
         Document Category = Sales Order
         SO Sub Type = Standard Order
         Document Sequence = Standard Order
         Table = C_Order
         Inter-company = Checked

        Go to Document Types window and create a new one:
         Organization = *
         Name = Inter-company Purchase Order
         Print text = Inter-company Purchase Order
         G/L Category = Standard
         Sales transaction = Not Checked
         Document Category = Purchase Order
         Document Sequence = Purchase Order
         Table = C_Order
         Inter-company = Checked

        Go to Document Types window and create a new one:
         Organization = *
         Name = Inter-company Sales Invoice
         Print text = Inter-company Sales Invoice
         G/L Category = Standard
         Sales transaction = Checked
         Document Category = AR Invoice
         Document Sequence = AR Invoice
         Table = C_Invoice
         Inter-company = Checked

        Go to Document Types window and create a new one:
         Organization = *
         Name = Inter-company Purchase Invoice
         Print text = Inter-company Purchase Invoice
         G/L Category = Standard
         Sales transaction = Checked
         Document Category = AP Invoice
         Document Sequence = AP Invoice
         Table = C_Invoice
         Inter-company = Checked

      Mapping document types
        Go to Document Types window and select Document Definition 'Inter-company Sales Order'
        Create a new record in 'Inter-company Relations' tab
          Source organization = F&B España - Región Norte
          Target organization = F&B España, S.A
          Target Document type = Inter-company Purchase Order

        Go to Document Types window and select Document Definition 'Inter-company Sales Invoice'
        Create a new record in 'Inter-company Relations' tab
          Source organization = F&B España - Región Norte
          Target organization = F&B España, S.A
          Target Document type = Inter-company Purchase Invoice
document types, organization's business partners... (you can follow the documentation)

   Go to Sales Order window and create a new Inter-company Sales Order for the customer and price list already created
     Organizatio = F&B España - Región Norte
     Transaction Document = Inter-company Sales Order
     Business Partner = customerB
   Create a new line and add 20 units of the already created product
     Product = Test Product
     Ordered Quantity = 20
     Tax = TaxRate16 (Should be automatically populated)

    Try to Book it. Notice the process ends successfully and a new Purchase Order is created.
(0102211)
hgbot   
2018-02-06 11:13   
Repository: erp/pmods/org.openbravo.interco
Changeset: 38f71821c7a50fb932653fd5815ab4ba472aec7b
Author: Mark <markmm82 <at> gmail.com>
Date: Mon Feb 05 15:33:36 2018 -0500
URL: http://code.openbravo.com/erp/pmods/org.openbravo.interco/rev/38f71821c7a50fb932653fd5815ab4ba472aec7b [^]

Fixes issue 37789:Cannot book an Inter-company Order if the price includes taxes

Moved validation at the end of the function to be applied after the documents are
processed by the C_Order_Post/C_Invoice_Post functions and problems with rounding
have been handled.

---
M src-db/database/model/functions/INTERCO_CREATE_INVOICE.xml
M src-db/database/model/functions/INTERCO_CREATE_ORDER.xml
---
(0102212)
hgbot   
2018-02-06 11:13   
Repository: erp/pmods/org.openbravo.interco
Changeset: 88ee2c4f65050c733018a1008ddad4a1d5f2dc36
Author: David Miguelez <david.miguelez <at> openbravo.com>
Date: Tue Feb 06 11:08:05 2018 +0100
URL: http://code.openbravo.com/erp/pmods/org.openbravo.interco/rev/88ee2c4f65050c733018a1008ddad4a1d5f2dc36 [^]

Related to Issue 37789. Code review changes.
Added comment to explain why the code has been moved

---
M src-db/database/model/functions/INTERCO_CREATE_INVOICE.xml
M src-db/database/model/functions/INTERCO_CREATE_ORDER.xml
---
(0102213)
hgbot   
2018-02-06 11:13   
Repository: erp/pmods/org.openbravo.interco
Changeset: 359643a4a20896ca481d8bee422caf20fccf951b
Author: Mark <markmm82 <at> gmail.com>
Date: Mon Feb 05 15:59:52 2018 -0500
URL: http://code.openbravo.com/erp/pmods/org.openbravo.interco/rev/359643a4a20896ca481d8bee422caf20fccf951b [^]

Related to issue 37789: Update module version

---
M src-db/database/sourcedata/AD_MODULE.xml
---
(0102214)
dmiguelez   
2018-02-06 11:15   
Code Review + Testing Ok