Openbravo Issue Tracking System - Openbravo ERP  | 
| View Issue Details | 
  | 
| ID | Project | Category | View Status | Date Submitted | Last Update | 
| 0034068 | Openbravo ERP | 04. Warehouse management | public | 2016-09-23 10:37 | 2016-10-13 11:31 | 
  | 
| Reporter | ngarcia |   | 
| Assigned To | markmm82 |   | 
| Priority | urgent | Severity | major | Reproducibility | always | 
| Status | closed | Resolution | fixed |   | 
| Platform |  | OS | 5 | OS Version |  | 
| Product Version |  |   | 
| Target Version |  | Fixed in Version | 3.0PR16Q4 |   | 
| Merge Request Status |  | 
| Review Assigned To | aferraz | 
| OBNetwork customer | OBPS | 
| Web browser |  | 
| Modules | Core | 
| Support ticket | 43689 | 
| Regression level |  | 
| Regression date |  | 
| Regression introduced in release |  | 
| Regression introduced by commit |  | 
| Triggers an Emergency Pack | No | 
  | 
| Summary | 0034068: Stock valuation is updated to 0 when the stock if 0 by the Reset Unit Cost process but not by Costing Background Process | 
| Description | Stock valuation is updated to 0 when the stock if 0 by the Reset Unit Cost process but not by Costing Background Process | 
| Steps To Reproduce | As system admin role: 
   Set Cost Precision of the currency to 6 
As group admin role: 
   Set the following two preferences as Y: 
      Allow to persist Unit Cost 
      Enable Negative Stock Corrections 
   Create a new product 
   Create a physical inventory and add the previously created product: 
      Quantity count: 19 
      Cost: 26.24069 
   Create two Goods Shipments: one of 10 units and one of 9 units 
   Launch the Costing Background Process 
   Check the Stock Valuation is -0.01 in Product - Unit Cost tab 
   Launch the Reset Unit Cost process and check the stock valuation is updated to 0 | 
| Proposed Solution |  | 
| Additional Information |  | 
| Tags | No tags attached. | 
| Relationships | | related to  | defect  | 0034056 |   | closed  | markmm82  | Wrong stock in Unit Cost tab of Product window  |  | blocks  | defect  | 0034055 |   | closed  | markmm82  | Wrong cost adjustment is made when stock reaches 0 but stock valuation is not 0 due to rounding issues  |  
  | 
| Attached Files |  | 
  | 
| Issue History | 
| Date Modified | Username | Field | Change | 
| 2016-09-23 10:37 | ngarcia | New Issue |  | 
| 2016-09-23 10:37 | ngarcia | Assigned To |  => Triage Finance | 
| 2016-09-23 10:37 | ngarcia | OBNetwork customer |  => Yes | 
| 2016-09-23 10:37 | ngarcia | Modules |  => Core | 
| 2016-09-23 10:37 | ngarcia | Support ticket |  => 43689 | 
| 2016-09-23 10:37 | ngarcia | Resolution time |  => 1476309600 | 
| 2016-09-23 10:37 | ngarcia | Triggers an Emergency Pack |  => No | 
| 2016-09-23 10:38 | ngarcia | Relationship added | related to 0034056 | 
| 2016-09-23 10:38 | ngarcia | Issue Monitored: networkb |  | 
| 2016-09-28 12:38 | aferraz | Assigned To | Triage Finance => markmm82 | 
| 2016-09-29 16:41 | markmm82 | Status | new => scheduled | 
| 2016-09-29 21:31 | markmm82 | Note Added: 0090392 |  | 
| 2016-09-30 12:43 | hgbot | Checkin |  | 
| 2016-09-30 12:43 | hgbot | Note Added: 0090423 |  | 
| 2016-09-30 12:43 | hgbot | Status | scheduled => resolved | 
| 2016-09-30 12:43 | hgbot | Resolution | open => fixed | 
| 2016-09-30 12:43 | hgbot | Fixed in SCM revision |  => http://code.openbravo.com/erp/devel/pi/rev/79f4c2e75d1f874ec5a411aec95586c139f995ef [^] | 
| 2016-09-30 12:46 | aferraz | Review Assigned To |  => aferraz | 
| 2016-09-30 12:46 | aferraz | Note Added: 0090425 |  | 
| 2016-09-30 12:46 | aferraz | Status | resolved => closed | 
| 2016-09-30 12:46 | aferraz | Fixed in Version |  => 3.0PR16Q4 | 
| 2016-09-30 14:08 | hgbot | Checkin |  | 
| 2016-09-30 14:08 | hgbot | Note Added: 0090427 |  | 
| 2016-09-30 14:08 | aferraz | Note Deleted: 0090425 |  | 
| 2016-09-30 14:08 | aferraz | Note Added: 0090429 |  | 
| 2016-09-30 19:07 | hudsonbot | Checkin |  | 
| 2016-09-30 19:07 | hudsonbot | Note Added: 0090448 |  | 
| 2016-09-30 19:07 | hudsonbot | Checkin |  | 
| 2016-09-30 19:07 | hudsonbot | Note Added: 0090449 |  | 
| 2016-10-10 18:54 | aferraz | Relationship added | blocks 0034055 | 
| 2016-10-11 15:16 | hgbot | Checkin |  | 
| 2016-10-11 15:16 | hgbot | Note Added: 0090534 |  | 
| 2016-10-13 11:31 | hudsonbot | Checkin |  | 
| 2016-10-13 11:31 | hudsonbot | Note Added: 0090552 |  | 
	| 
		Notes	 | 
	
		 
	 | 
	| 
		
	 | 
	
		
		
			
				Test Plan 
As system admin role: 
   Set Cost Precision of the currency (i.e EUR) to 6 
As group admin role: 
   Set the following two preferences as Y: 
      Allow to persist Unit Cost 
      Enable Negative Stock Corrections 
   Create a new product 
   Create a physical inventory and add the previously created product: 
      Quantity count: 19 
      Cost: 26.24069 
   Create two Goods Shipments: one of 10 units and one of 9 units 
   Launch the Costing Background Process 
   Check the Stock Valuation is 0.00 in Product - Unit Cost tab. It is correct 
   Launch the Reset Unit Cost process and check the stock valuation remains 0			 | 
		 
		 
	 | 
	
		 
	 | 
	
		
		
			| 
				(0090423)
			 | 
		 
		
			| 
				hgbot   
			 | 
		 
		
			| 
				2016-09-30 12:43   
							 | 
		 
		 
	 | 
	
		
		
			
				Repository: erp/devel/pi 
Changeset: 79f4c2e75d1f874ec5a411aec95586c139f995ef 
Author: Mark <markmm82 <at> gmail.com> 
Date: Thu Sep 29 14:59:52 2016 -0400 
URL: http://code.openbravo.com/erp/devel/pi/rev/79f4c2e75d1f874ec5a411aec95586c139f995ef [^] 
 
Fixes issue 34068: Stock valuation updated to 0 by cost processes if no stock 
 
Stock valuation is updated to 0 when the stock if 0 by the Reset Unit Cost process and the Costing Background Process 
 
--- 
M src-db/database/model/functions/M_UPDATE_STOCK_VALUATION.xml 
--- 
			 | 
		 
		 
	 | 
	
		 
	 | 
	
		
		
			| 
				(0090427)
			 | 
		 
		
			| 
				hgbot   
			 | 
		 
		
			| 
				2016-09-30 14:08   
							 | 
		 
		 
	 | 
	
		
	 | 
	
		 
	 | 
	| 
		
	 | 
	
		
	 | 
	
		 
	 | 
	| 
		
	 | 
	
		
	 | 
	
		 
	 | 
	| 
		
	 | 
	
		
	 | 
	
		 
	 | 
	
		
		
			| 
				(0090534)
			 | 
		 
		
			| 
				hgbot   
			 | 
		 
		
			| 
				2016-10-11 15:16   
							 | 
		 
		 
	 | 
	
		
		
			
				Repository: erp/devel/pi 
Changeset: bfe0fd55340fadedae20717cb8db6b52af86be01 
Author: Alvaro Ferraz <alvaro.ferraz <at> openbravo.com> 
Date: Tue Oct 11 14:42:30 2016 +0200 
URL: http://code.openbravo.com/erp/devel/pi/rev/bfe0fd55340fadedae20717cb8db6b52af86be01 [^] 
 
Related to issue 34068: Fix stock valuation 
 
Fix stock valuation in case we are updating valuation but stock was not updated yet. 
Only in case we are updating stock and it is updated to zero, valuation will be updated to zero too. 
 
--- 
M src-db/database/model/functions/M_UPDATE_STOCK_VALUATION.xml 
--- 
			 | 
		 
		 
	 | 
	
		 
	 | 
	| 
		
	 | 
	
		
	 |