Openbravo Issue Tracking System - Openbravo ERP
View Issue Details
0011336Openbravo ERP08. Project and service managementpublic2009-11-12 13:572010-01-20 23:26
gorkaion 
rafaroda 
urgentmajoralways
closedfixed 
20Gentoo
2.50MP1 
2.50MP112.50MP11 
Core
No
0011336: 'Create Sales Orders from Expenses' process assumes that it will always find a price
The process 'Create Sales Orders from Expenses' in 'Project & Service Management || Transactions' assumes that it will always find a price.

This process generates sales orders to re-invoice employee expenses to customers. To set the price on each line it uses first the invoice price that can be set in the expense line. If this is null it searches for the price in the price list used in the order (the price list assigned to the customer).

If the customer's price list doesn't include the product the process continues using the price of the previous processed line.
Go to 'Project & Service Management || Transactions || Expense Sheet'

Create a new Expense Sheet.
Create a new line:
-line no 10.
-reinvoicing checked
-time sheet unchecked
-qty 10
-invoice price: 10
-product anyone
-project anyone
-Business partner anyone (but not null)

Create a second line with the same values than the previous one, but this time left the invoice price null and a different product.

Ensure that the selected partner's sales prices list doesn't include the product used in the second line.

Process the Expense Sheet.

Go to 'Create Sales Orders from Expenses' and generate the sale order for the used business partner.

Go to the generated sales order and notice that the line corresponding to the second expense sheet line has the price of the previous line.

The process should have stopped on error asking to set a price for the product in the expense sheet line or on the customers price list.
Add a validation in the org.openbravo.erpCommon.ad_actionButton.ExpenseSOrder java class when the prices are calculated. If the selectPrice method doesn't return any price raise an error which message should ask to set a price in the corresponding Expense Sheet line or in the corresponding customers price list.
No tags attached.
related to defect 0010431 closed rafaroda UOM is not properly updated in expense sheet lines. 
related to defect 00112422.50MP11 closed rafaroda in time sheet, can not select business partner if project don't have associated it 
related to defect 0011980 closed rafaroda Avoid inconsistent data in expense sheet lines. 
Issue History
2009-11-12 13:57gorkaionNew Issue
2009-11-12 13:57gorkaionAssigned To => rafaroda
2009-11-13 10:25rafarodaPriorityimmediate => urgent
2009-11-13 10:25rafarodaStatusnew => scheduled
2009-11-13 10:25rafarodaversion => 2.50MP1
2009-12-16 10:12rafarodaRelationship addedrelated to 0010431
2009-12-16 10:13rafarodaRelationship addedrelated to 0011242
2009-12-16 18:52hgbotCheckin
2009-12-16 18:52hgbotNote Added: 0022881
2009-12-16 18:52hgbotStatusscheduled => resolved
2009-12-16 18:52hgbotResolutionopen => fixed
2009-12-16 18:52hgbotFixed in SCM revision => http://code.openbravo.com/erp/devel/pi/rev/c1bfea42963bd856be7d16ff9c194dfe77188bd9 [^]
2009-12-16 19:17rafarodaNote Added: 0022883
2009-12-16 19:18rafarodaNote Edited: 0022883
2009-12-17 10:50sureshbabuNote Added: 0022909
2009-12-17 10:50sureshbabuStatusresolved => closed
2009-12-17 10:50sureshbabuFixed in Version => 2.50MP10
2009-12-18 00:00anonymoussf_bug_id0 => 2916567
2009-12-18 12:06hgbotCheckin
2009-12-18 12:06hgbotNote Added: 0022933
2009-12-18 12:06hgbotFixed in SCM revisionhttp://code.openbravo.com/erp/devel/pi/rev/c1bfea42963bd856be7d16ff9c194dfe77188bd9 [^] => http://code.openbravo.com/erp/devel/pi/rev/31009eb3311533dbe8998bbea79ba90800f30939 [^]
2009-12-18 12:20rafarodaNote Added: 0022934
2009-12-18 12:20rafarodaStatusclosed => new
2009-12-18 12:20rafarodaResolutionfixed => open
2009-12-18 12:20rafarodaFixed in Version2.50MP10 =>
2009-12-19 00:36hudsonbotCheckin
2009-12-19 00:36hudsonbotNote Added: 0022949
2009-12-19 00:36hudsonbotCheckin
2009-12-19 00:36hudsonbotNote Added: 0022961
2009-12-30 18:49psarobeStatusnew => acknowledged
2010-01-13 11:23rafarodaStatusacknowledged => scheduled
2010-01-13 11:23rafarodafix_in_branch => pi
2010-01-14 19:46hgbotCheckin
2010-01-14 19:46hgbotNote Added: 0023455
2010-01-14 19:46hgbotStatusscheduled => resolved
2010-01-14 19:46hgbotResolutionopen => fixed
2010-01-14 19:46hgbotFixed in SCM revisionhttp://code.openbravo.com/erp/devel/pi/rev/31009eb3311533dbe8998bbea79ba90800f30939 [^] => http://code.openbravo.com/erp/devel/pi/rev/27eafa5b97c2bbf44a3e3c9ed9f0db809901844d [^]
2010-01-14 19:48rafarodaNote Added: 0023456
2010-01-15 16:53rafarodaRelationship addedrelated to 0011980
2010-01-15 20:19rafarodaNote Deleted: 0022883
2010-01-18 08:58arunkumarNote Added: 0023485
2010-01-20 12:49arunkumarNote Added: 0023609
2010-01-20 12:49arunkumarStatusresolved => closed
2010-01-20 12:49arunkumarFixed in Version => 2.50MP11
2010-01-20 23:26hudsonbotCheckin
2010-01-20 23:26hudsonbotNote Added: 0023652

Notes
(0022881)
hgbot   
2009-12-16 18:52   
Repository: erp/devel/pi
Changeset: c1bfea42963bd856be7d16ff9c194dfe77188bd9
Author: Rafa Roda Palacios <rafael.roda <at> openbravo.com>
Date: Wed Dec 16 18:34:02 2009 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/c1bfea42963bd856be7d16ff9c194dfe77188bd9 [^]

Fixes issue 11336 Message displayed when no price found in Create Sales Orders From Expenses process.

---
M src/org/openbravo/erpCommon/ad_actionButton/ExpenseSOrder.java
M src/org/openbravo/erpCommon/ad_actionButton/ExpenseSOrder_data.xsql
---
(0022909)
sureshbabu   
2009-12-17 10:50   
Tested working fine
(0022933)
hgbot   
2009-12-18 12:06   
Repository: erp/devel/pi
Changeset: 31009eb3311533dbe8998bbea79ba90800f30939
Author: Juan Pablo Aroztegi <juanpablo.aroztegi <at> openbravo.com>
Date: Fri Dec 18 12:04:05 2009 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/31009eb3311533dbe8998bbea79ba90800f30939 [^]

Backed out changeset c1bfea42963b. Issue 11336.

---
M src/org/openbravo/erpCommon/ad_actionButton/ExpenseSOrder.java
M src/org/openbravo/erpCommon/ad_actionButton/ExpenseSOrder_data.xsql
---
(0022934)
rafaroda   
2009-12-18 12:20   
Re-opened issue due to smoke test fail. Pending to be discussed with QA.
(0022949)
hudsonbot   
2009-12-19 00:36   
---
A changeset related to this issue has been promoted to main after passing a series of tests and an OBX has been generated:

Changeset: http://code.openbravo.com/erp/devel/main/rev/c1bfea42963b [^]
Merge Changeset: http://code.openbravo.com/erp/devel/main/rev/867059305a34 [^]
Tests: http://builds.openbravo.com/view/devel-int/ [^]
OBX: http://builds.openbravo.com/erp/obx/core/OpenbravoERP-2.50CI.15773.obx [^]
---
(0022961)
hudsonbot   
2009-12-19 00:36   
---
A changeset related to this issue has been promoted to main after passing a series of tests and an OBX has been generated:

Changeset: http://code.openbravo.com/erp/devel/main/rev/31009eb33115 [^]
Merge Changeset: http://code.openbravo.com/erp/devel/main/rev/867059305a34 [^]
Tests: http://builds.openbravo.com/view/devel-int/ [^]
OBX: http://builds.openbravo.com/erp/obx/core/OpenbravoERP-2.50CI.15773.obx [^]
---
(0023455)
hgbot   
2010-01-14 19:46   
Repository: erp/devel/pi
Changeset: 27eafa5b97c2bbf44a3e3c9ed9f0db809901844d
Author: Rafa Roda Palacios <rafael.roda <at> openbravo.com>
Date: Thu Jan 14 04:49:31 2010 +0100
URL: http://code.openbravo.com/erp/devel/pi/rev/27eafa5b97c2bbf44a3e3c9ed9f0db809901844d [^]

Fixes issue 11336 Refactored 'Create Sales Orders from Expenses' process.

* Fixed the price calculation.
* Created methods for sales order header and lines creation.
* Refactored message handling to get more meaningful messages.

---
M src-db/database/sourcedata/AD_MESSAGE.xml
M src/org/openbravo/erpCommon/ad_actionButton/ExpenseSOrder.java
M src/org/openbravo/erpCommon/ad_actionButton/ExpenseSOrder_data.xsql
---
(0023456)
rafaroda   
2010-01-14 19:48   
Steps to test the fix:
1) Create a new Product in Master Data Management || Product
* Name = My Expense
* Product Type = Expense Type
* UOM = Minutes
2) Create a new expense sheet for Employee John Moneymaker in Project & Service Management || Transactions || Expense Sheet || Header
3) Navigate to Lines and create a new record:
* Reinvoicing = Yes
* Product = MyExpense
* UOM = Minutes
* Invoice Price = null (notice that MyExpense is not in a price list)
* Business Partner = Millman
* Project = Consulting Project
4) Create a new record:
* Reinvoicing = Yes
* Product = Electricity
* UOM = KWh
* Invoice Price = 18 (notice that Electricity is not in a price list)
* Business Partner = Millman
* Project = Millman Project
5) Navigate back to the expense sheet header and process it.
6) Create a new expense sheet for Employee John Moneymaker in Project & Service Management || Transactions || Expense Sheet || Header
7) Navigate to Lines and create a new record:
* Reinvoicing = Yes
* Product = Food
* UOM = Unit
* Invoice Price = null (notice that Food is in the business partner sales price list)
* Business Partner = Millman
* Project = Consulting Project
8) Create a new record:
* Reinvoicing = Yes
* Product = MyExpense
* UOM = Minutes
* Invoice Price = null (notice that MyExpense is not in a price list)
* Business Partner = Millman
* Project = Millman Project
9) Navigate back to the expense sheet header and process it.
10) Navigate to Project & Service Management || Transactions || Create Sales Orders from Expenses:
* Customer = Millman
* Date Ordered = 01-01-2010
11) Click on Process and you will get the error message:
"Expense Sheet No. xxx, Line yyy: Price not found for current partner and product."
12) Navigate to the expense Sheet of the error message and unprocess it.
13) Navigate to Lines and add an Invoice Price = 8 to the line stated in the error message (should correspond to product My Expense).
14) Navigate back to the header and process it.
15) Navigate to Project & Service Management || Transactions || Create Sales Orders from Expenses:
* Customer = Millman
* Date Ordered = 01-01-2010
16) Click on Process and you will get the error message (only one sales order has been created):
"Created: 1
Sales Order No. eeeeee has been created -> Shipment No. ddddddd has been created
Expense Sheet No. zzz, Line aaa: Price not found for current partner and product."
17) Navigate to Product MyExpense.
18) Navigate to tab Price and create a new record:
* Price List version = Sales 2006
* List Price = 7
* Standard Price = 6
* Price Limit = 5
19) Navigate back to to Project & Service Management || Transactions || Create Sales Orders from Expenses:
* Customer = Millman
* Date Ordered = 01-01-2010
* Untick "Complete and Process Sales Orders automatically" check-box (do not select it).
20) Click on Process and you will get the success message:
"Created: 1
Sales Order No. iiiiiiiii has been created".
21) Navigate to the 2 sales order created and in its lines check that:
* Sales Order 1 completed and 2 products.
* Sales Order 2 NOT completed and 2 products.
(0023485)
arunkumar   
2010-01-18 08:58   
Rafa I followed the steps you have given to test the fix.

I was doing the steps:

10) Navigate to Project & Service Management || Transactions || Create Sales Orders from Expenses:
* Customer = Millman
* Date Ordered = 18-01-2010
11) Click on Process and you will get the error message:

I have got the error message
Error:
Created: 0
Expense Sheet No. 10000014, line 20: Could not find taxes.

This Expense sheet refers to the product Electricity which I have added in the lines of the first expense sheet.

Can you please tell me what is the issue here?
(0023609)
arunkumar   
2010-01-20 12:49   
Tested & Working fine.
(0023652)
hudsonbot   
2010-01-20 23:26   
A changeset related to this issue has been promoted to main after passing a series of tests and an OBX has been generated:

Changeset: http://code.openbravo.com/erp/devel/main/rev/27eafa5b97c2 [^]
Merge Changeset: http://code.openbravo.com/erp/devel/main/rev/fa6621f85351 [^]
Tests: http://builds.openbravo.com/view/devel-int/ [^]
OBX: http://builds.openbravo.com/erp/obx/core/OpenbravoERP-2.50CI.15942.obx [^]