Openbravo Issue Tracking System - Openbravo ERP |
View Issue Details |
|
ID | Project | Category | View Status | Date Submitted | Last Update |
0035428 | Openbravo ERP | 09. Financial management | public | 2017-03-03 13:05 | 2017-03-20 15:11 |
|
Reporter | aferraz | |
Assigned To | aferraz | |
Priority | normal | Severity | minor | Reproducibility | always |
Status | closed | Resolution | fixed | |
Platform | | OS | 5 | OS Version | |
Product Version | | |
Target Version | | Fixed in Version | 3.0PR17Q2 | |
Merge Request Status | |
Review Assigned To | vmromanos |
OBNetwork customer | |
Web browser | |
Modules | Core |
Support ticket | |
Regression level | |
Regression date | |
Regression introduced in release | |
Regression introduced by commit | |
Triggers an Emergency Pack | No |
|
Summary | 0035428: Do not calculate Net Price and Net Amount outside triggers when creating new Order/Invoice with Price Including Taxes |
Description | When creating new C_Order or C_Invoice records using Price Including Taxes from any PL/SQL or Java code, PriceStd, PriceList, PriceLimit, PriceActual, TaxBaseAmt and LineNetAmt should not be calculated for lines, as they will be calculated in C_OrderLine_Trg or C_InvoiceLine_Before_Trg triggers.
In case we need to calculate them, instead of using C_Get_Net_Price_From_Gross function to calculate net price from gross price, we need to use C_Get_Net_Amount_From_Gross function to calculate net amount from gross amount and then net price from net amount. |
Steps To Reproduce | * |
Proposed Solution | |
Additional Information | |
Tags | No tags attached. |
Relationships | related to | defect | 0021031 | 3.0MP13 | closed | mirurita | Openbravo ERP | Discounts are not applied properly for Price Including Taxes price lists | related to | defect | 0032134 | 3.0PR16Q2 | closed | AtulOpenbravo | Openbravo ERP | Price Including taxes is not supported by the Purchasing Plan (Create Purchase Orders process) | related to | defect | 0025932 | 3.0PR14Q3 | closed | AtulOpenbravo | Openbravo ERP | The Total Gross Amount of the Sales Order is wrong for non stockable BOM products udner some circumstancies | related to | defect | 0021195 | | closed | mirurita | Openbravo ERP | "create invoice from receipt" in goods receipt window when prices include taxes | related to | defect | 0031788 | | closed | AtulOpenbravo | Openbravo ERP | In a Purchase Order window the Price turns to 0 using a price list including taxes under some circumstancies | related to | defect | 0023560 | 3.0MP24 | closed | pramakrishnan | Openbravo ERP | Insert Orphan Line when using Price List including taxes is not calculating Net Price properly | related to | design defect | 0032265 | | closed | aferraz | Openbravo ERP | [SER QA 1434] Taxes at document level are not properly calculated in some cases | related to | defect | 0035453 | | closed | marvintm | Retail Modules | Method FinancialUtils.calculateNetFromGross has been deprecated and is currently used in the "Add Pack" process | related to | defect | 0035475 | | new | Retail | Retail Modules | Do not calculate Net Price and Net Amount outside triggers when creating new Order/Invoice with Price Including Taxes | related to | feature request | 0035773 | | new | Triage Omni OMS | Openbravo ERP | Several improvements in FinancialUtils class |
|
Attached Files | |
|
Issue History |
Date Modified | Username | Field | Change |
2017-03-03 13:05 | aferraz | New Issue | |
2017-03-03 13:05 | aferraz | Assigned To | => Triage Finance |
2017-03-03 13:05 | aferraz | Modules | => Core |
2017-03-03 13:05 | aferraz | Triggers an Emergency Pack | => No |
2017-03-03 13:06 | aferraz | Proposed Solution updated | |
2017-03-03 13:06 | aferraz | Relationship added | related to 0032265 |
2017-03-03 13:08 | aferraz | File Added: 35428.diff | |
2017-03-06 18:33 | aferraz | Note Added: 0094773 | |
2017-03-06 18:34 | aferraz | Note Edited: 0094773 | bug_revision_view_page.php?bugnote_id=0094773#r14730 |
2017-03-06 18:41 | aferraz | Relationship added | related to 0021031 |
2017-03-06 18:45 | aferraz | Relationship added | related to 0032134 |
2017-03-06 18:47 | aferraz | Relationship added | related to 0025932 |
2017-03-06 18:51 | aferraz | Relationship added | related to 0021195 |
2017-03-06 19:11 | aferraz | Note Edited: 0094773 | bug_revision_view_page.php?bugnote_id=0094773#r14731 |
2017-03-06 19:25 | aferraz | Note Edited: 0094773 | bug_revision_view_page.php?bugnote_id=0094773#r14732 |
2017-03-07 10:51 | aferraz | Relationship added | related to 0031788 |
2017-03-07 11:01 | aferraz | Note Edited: 0094773 | bug_revision_view_page.php?bugnote_id=0094773#r14733 |
2017-03-07 12:35 | aferraz | Note Edited: 0094773 | bug_revision_view_page.php?bugnote_id=0094773#r14734 |
2017-03-07 12:40 | aferraz | Relationship added | related to 0023560 |
2017-03-07 12:49 | aferraz | Note Edited: 0094773 | bug_revision_view_page.php?bugnote_id=0094773#r14735 |
2017-03-07 16:27 | aferraz | Note Edited: 0094773 | bug_revision_view_page.php?bugnote_id=0094773#r14740 |
2017-03-07 17:14 | aferraz | Note Edited: 0094773 | bug_revision_view_page.php?bugnote_id=0094773#r14743 |
2017-03-08 13:34 | hgbot | Checkin | |
2017-03-08 13:34 | hgbot | Note Added: 0094832 | |
2017-03-08 13:34 | hgbot | Status | new => resolved |
2017-03-08 13:34 | hgbot | Resolution | open => fixed |
2017-03-08 13:34 | hgbot | Fixed in SCM revision | => http://code.openbravo.com/erp/devel/pi/rev/2d002737ee99169df4fb03ea8f76aee2a2d7869b [^] |
2017-03-08 13:35 | aferraz | Assigned To | Triage Finance => aferraz |
2017-03-08 13:35 | aferraz | File Deleted: 35428.diff | |
2017-03-08 13:36 | aferraz | Proposed Solution updated | |
2017-03-08 16:43 | aferraz | Relationship added | related to 0035453 |
2017-03-09 18:25 | hgbot | Checkin | |
2017-03-09 18:25 | hgbot | Note Added: 0094886 | |
2017-03-09 18:48 | hgbot | Checkin | |
2017-03-09 18:48 | hgbot | Note Added: 0094887 | |
2017-03-09 18:59 | hgbot | Checkin | |
2017-03-09 18:59 | hgbot | Note Added: 0094888 | |
2017-03-09 19:33 | hgbot | Checkin | |
2017-03-09 19:33 | hgbot | Note Added: 0094889 | |
2017-03-10 08:53 | aferraz | Note Added: 0094892 | |
2017-03-10 09:10 | aferraz | Type | design defect => defect |
2017-03-10 09:16 | aferraz | Relationship added | related to 0035475 |
2017-03-15 20:21 | hudsonbot | Checkin | |
2017-03-15 20:21 | hudsonbot | Note Added: 0095279 | |
2017-03-20 15:11 | vmromanos | Review Assigned To | => vmromanos |
2017-03-20 15:11 | vmromanos | Note Added: 0095426 | |
2017-03-20 15:11 | vmromanos | Status | resolved => closed |
2017-03-20 15:11 | vmromanos | Fixed in Version | => 3.0PR17Q2 |
2017-04-12 14:07 | vmromanos | Relationship added | related to 0035773 |
Notes |
|
(0094773)
|
aferraz
|
2017-03-06 18:33
(edited on: 2017-03-07 17:14) |
|
Test plan 1:
- Login as F&B Admin:
- Set Tarifa de ventas price list as Price Includes Tax
- Create a Sales Order for Alimentos y Supermercados, S.A
- Add a line with Agua sin Gas 1L product, quantity: 1, gross price: 1.53, tax: IVA 18%.
- Book the order.
- Check following data:
Total Gross Amount: 1.38 (1.53 - 0.15)
Total Net Amount: 1.17 (1.30 - 0.17)
Line 1 Gross Amount: 1.53
Line 1 Net Amount: 1.30 (1.53 / 1.18)
Line 2 Gross Amount: -0.15 (1.53 * 0.10)
Line 2 Net Amount: -0.13 (1.30 * 0.10)
Test plan 2:
- Login as F&B Admin:
- Set Tarifa de ventas price list as Price Includes Tax
- Create a Sales Invoice for Alimentos y Supermercados, S.A
- Add a line with Agua sin Gas 1L product, quantity: 1, gross price: 1.53, tax: IVA 18%.
- Book the invoice.
- Check following data:
Total Gross Amount: 1.38 (1.53 - 0.15)
Total Net Amount: 1.17 (1.30 - 0.17)
Line 1 Gross Amount: 1.53
Line 1 Net Amount: 1.30 (1.53 / 1.18)
Line 2 Gross Amount: -0.15 (1.53 * 0.10)
Line 2 Net Amount: -0.13 (1.30 * 0.10)
Test plan 3:
- Login as F&B Admin:
- Set Tarifa de ventas price list as Price Includes Tax
- Create a product with Stocked = No and Bill of Materials = Yes.
- Add a record in Price tab for Tarifa de ventas price list and price = 0.
- Add a record in Bill of Materials tab for Agua sin Gas product.
- Click on Verify BOM button.
- Create a Sales Order for Alimentos y Supermercados, S.A
- Add a line with created product, quantity = 1 and tax = IVA 21%.
- Click on Explode button
- Check following data:
Total Gross Amount: 1.53
Total Net Amount: 1.26
Test plan 4:
- Login as F&B Admin:
- Set Tarifa Bebidas Alegres price list as Price Includes Tax
- Create a Purchase Order for Bebidas Alegres, S.L.
- Add a line with Cerveza Ale product, quantity: 3, gross price: 9.99, tax: IVA 21%.
- Book the order.
- Create a Goods Receipt for Bebidas Alegres, S.L.
- Click on Create Lines From and select created order
- Click on Complete
- Click on Generate Invoice from Receipt
- Check following data in created invoice:
Total Gross Amount: 29.97
Total Net Amount: 24.77
Test plan 5:
- Login as F&B Admin:
- Set Tarifa Bebidas Alegres price list as Price Includes Tax
- Create a record in Discounts and Promotions window for Price Adjustment type, from 01-01-2017 to 31-12-2017, Included Products = Only those defined, Fixed Unit Price = 73 and Min Quantity = 10
- Add a record in Products tab for Agua sin Gas.
- Create a Purchase Order for Bebidas Alegres, S.L.
- Click on Create Lines and select Agua sin Gas with Standard Price = 19 and Quantity = 20.
- Book the order.
- Check following data in created order:
Total Gross Amount: 1460.00
Total Net Amount: 1206.61
Line Gross Price: 73.00
Line Net Price: 60.33
Test plan 6:
- Login as F&B Admin:
- Set Tarifa Bebidas Alegres price list as Price Includes Tax
- Create a record in Discounts and Promotions window for Price Adjustment type, from 01-01-2017 to 31-12-2017, Included Products = Only those defined, Fixed Unit Price = 73 and Min Quantity = 10
- Add a record in Products tab for Agua sin Gas.
- Create a Purchase Order for Bebidas Alegres, S.L.
- Click on Create Lines and select Agua sin Gas with Standard Price = 19 and Quantity = 20.
- Book the order.
- Check following data in created order:
Total Gross Amount: 1460.00
Total Net Amount: 1206.61
Line Gross Price: 73.00
Line Net Price: 60.33
Test plan 7:
- Login as F&B Admin:
- Set Tarifa de ventas price list as Price Includes Tax
- Create RM Allow Orphan Line preference with "Y" value.
- Logout and login again.
- Create Return From Customer for Alimentos y Supermercados.
- Click on Insert Orphan Line and select product Agua sin Gas, Returned = 5, Price = 330 and Tax = IVA 21%.
- Check following data in created line:
Line Gross Amount: 1650.00
Line Net Amount: 1363.64 (1650.00 / 1.21)
Line Gross Price: 330.00 (1650.00 / 5)
Line Net Price: 272.73 (1363.64 / 5)
Test plan 8:
- Login as F&B Admin:
- Set Tarifa de ventas price list as Price Includes Tax.
- Create Sales Quotation for Alimentos y Supermercados.
- Add a line with Agua sin Gas 1L product, quantity: 9, gross price: 9.99, tax: IVA 21%.
- Book the order.
- Click on Create Order.
- Check following data in created Sales Order:
Total Gross Amount: 80.92 ((9*9.99) - (9*9.99*0.10))
Total Net Amount: 66.88 (80.92 / 1.21)
Test plan 9:
- Login as F&B Admin:
- Set Tarifa Bebidas Alegres price list as Price Includes Tax
- Create a record in Discounts and Promotions window for Price Adjustment type, from 01-01-2017 to 31-12-2017, Included Products = Only those defined, Discount = 50.00%
- Add a record in Products tab for Agua sin Gas.
- Create a Purchase Order for Bebidas Alegres, S.L.
- Add a line for Agua sin Gas product and quantity = 99.
- Book the order.
- Check following data in created order:
Total Gross Amount: 87.12 (1.76 * 0.5 * 99)
Total Net Amount: 72.00 (87.12 / 1.21)
|
|
|
(0094832)
|
hgbot
|
2017-03-08 13:34
|
|
Repository: erp/devel/pi
Changeset: 2d002737ee99169df4fb03ea8f76aee2a2d7869b
Author: Alvaro Ferraz <alvaro.ferraz <at> openbravo.com>
Date: Wed Mar 08 10:08:26 2017 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/2d002737ee99169df4fb03ea8f76aee2a2d7869b [^]
Fixes issue 35428: Do not use C_GET_NET_PRICE_FROM_GROSS function
We avoid Net Price and Net Amount calculation outside triggers when creating new Order/Invoice lines with Price Including Taxes.
Also, we change use of C_GET_NET_PRICE_FROM_GROSS function with C_GET_NET_AMOUNT_FROM_GROSS in Order and Invoice callouts. Now, we get line net amount from line gross amount instead of getting line net price from line gross amount and then line net amount from line net price. Thus, we avoid precision loss.
---
M src-db/database/model/functions/C_INVOICE_POST.xml
M src-db/database/model/functions/C_ORDER_POST1.xml
M src-db/database/model/functions/MRP_PURCHASEORDER.xml
M src-db/database/model/functions/M_EXPLODEBOMNOTSTOCK.xml
M src-db/database/model/functions/M_INOUT_CREATEINVOICE.xml
M src-db/database/model/functions/M_PROMOTION_ADJUSTMENT.xml
M src-db/database/model/functions/M_REQUISITION_CREATEPO.xml
M src/org/openbravo/common/actionhandler/OrderCreatePOLines.java
M src/org/openbravo/common/actionhandler/SRMOPickEditLines.java
M src/org/openbravo/erpCommon/ad_actionButton/CopyFromInvoice.java
M src/org/openbravo/erpCommon/ad_actionButton/CopyFromOrder.java
M src/org/openbravo/erpCommon/ad_actionButton/CopyFromPOOrder.java
M src/org/openbravo/erpCommon/ad_actionButton/CreateFrom.java
M src/org/openbravo/erpCommon/ad_actionButton/RMInsertOrphanLine.java
M src/org/openbravo/erpCommon/ad_callouts/SL_Invoice_Amt.java
M src/org/openbravo/erpCommon/ad_callouts/SL_Order_Amt.java
M src/org/openbravo/erpCommon/ad_forms/RequisitionToOrder.java
M src/org/openbravo/erpCommon/ad_forms/RequisitionToOrder_data.xsql
M src/org/openbravo/erpCommon/ad_process/ConvertQuotationIntoOrder.java
M src/org/openbravo/financial/FinancialUtils.java
---
|
|
|
(0094886)
|
hgbot
|
2017-03-09 18:25
|
|
|
|
(0094887)
|
hgbot
|
2017-03-09 18:48
|
|
|
|
(0094888)
|
hgbot
|
2017-03-09 18:59
|
|
|
|
(0094889)
|
hgbot
|
2017-03-09 19:33
|
|
|
|
|
Pending to update dependency of org.openbravo.materialmgmt.freightmgmt and org.openbravo.contract.services (spm2 branch) modules to core 17Q2. |
|
|
|
|
|
|
|