Author: jacopoc
Date: Fri Feb 12 09:30:13 2010
New Revision: 909308
URL: http://svn.apache.org/viewvc?rev=909308&view=rev
Log:
Fix for a couple of production run related bugs discovered playing with new
automated tests:
* wrong date field tipy was set for Lot records
* the finished product id was not set in accounting transactions related to
production run header costs
Modified:
ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/ledger/GeneralLedgerServices.xml
ofbiz/trunk/applications/manufacturing/script/org/ofbiz/manufacturing/test/ProductionRunTests.xml
ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/jobshopmgt/ProductionRunServices.java
Modified:
ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/ledger/GeneralLedgerServices.xml
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/ledger/GeneralLedgerServices.xml?rev=909308&r1=909307&r2=909308&view=diff
==============================================================================
---
ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/ledger/GeneralLedgerServices.xml
(original)
+++
ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/ledger/GeneralLedgerServices.xml
Fri Feb 12 09:30:13 2010
@@ -1385,6 +1385,14 @@
<first-from-list list="workEffortGoodStandards"
entry="workEffortGoodStandard"/>
</if-not-empty>
</if-compare>
+ <if-compare field="workEffort.workEffortTypeId" operator="equals"
value="PROD_ORDER_HEADER">
+ <entity-and entity-name="WorkEffortGoodStandard"
list="workEffortGoodStandards">
+ <field-map field-name="workEffortId"
from-field="workEffort.workEffortId"/>
+ <field-map field-name="workEffortGoodStdTypeId"
value="PRUN_PROD_DELIV"/>
+ <order-by field-name="-fromDate"/>
+ </entity-and>
+ <first-from-list list="workEffortGoodStandards"
entry="workEffortGoodStandard"/>
+ </if-compare>
<!-- Credit -->
<make-value entity-name="AcctgTransEntry" value-field="creditEntry"/>
<set field="creditEntry.debitCreditFlag" value="C"/>
Modified:
ofbiz/trunk/applications/manufacturing/script/org/ofbiz/manufacturing/test/ProductionRunTests.xml
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/manufacturing/script/org/ofbiz/manufacturing/test/ProductionRunTests.xml?rev=909308&r1=909307&r2=909308&view=diff
==============================================================================
---
ofbiz/trunk/applications/manufacturing/script/org/ofbiz/manufacturing/test/ProductionRunTests.xml
(original)
+++
ofbiz/trunk/applications/manufacturing/script/org/ofbiz/manufacturing/test/ProductionRunTests.xml
Fri Feb 12 09:30:13 2010
@@ -610,6 +610,7 @@
<if-compare field="acctgTransEntry.glAccountTypeId"
operator="equals" value="WIP_INVENTORY"/>
<if-compare field="acctgTransEntry.glAccountId"
operator="equals" value="142000"/>
<if-compare field="acctgTransEntry.amount"
operator="equals" value="6.78" type="BigDecimal"/>
+ <if-compare-field field="acctgTransEntry.productId"
operator="equals" to-field="productId"/>
</assert>
</else>
</if-compare>
Modified:
ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/jobshopmgt/ProductionRunServices.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/jobshopmgt/ProductionRunServices.java?rev=909308&r1=909307&r2=909308&view=diff
==============================================================================
---
ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/jobshopmgt/ProductionRunServices.java
(original)
+++
ofbiz/trunk/applications/manufacturing/src/org/ofbiz/manufacturing/jobshopmgt/ProductionRunServices.java
Fri Feb 12 09:30:13 2010
@@ -1590,7 +1590,7 @@
GenericValue lot = delegator.findByPrimaryKey("Lot",
UtilMisc.toMap("lotId", lotId));
if (lot == null) {
if (createLotIfNeeded.booleanValue()) {
- lot = delegator.makeValue("Lot",
UtilMisc.toMap("lotId", lotId, "creationDate", UtilDateTime.nowDate()));
+ lot = delegator.makeValue("Lot",
UtilMisc.toMap("lotId", lotId, "creationDate", UtilDateTime.nowTimestamp()));
lot.create();
} else {
return
ServiceUtil.returnError(UtilProperties.getMessage(resource,
"ManufacturingLotNotExists", locale));