Author: jonesde
Date: Sat Feb  3 12:14:53 2007
New Revision: 503298

URL: http://svn.apache.org/viewvc?view=rev&rev=503298
Log:
Applied patch from Anil Patel to add feature to create product maint plan based 
on template workeffort, in Jira #OFBIZ-679

Modified:
    ofbiz/trunk/applications/accounting/config/AccountingUiLabels.properties
    
ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/fixedasset/FixedAssetServices.xml
    ofbiz/trunk/applications/accounting/servicedef/services_fixedasset.xml
    
ofbiz/trunk/applications/accounting/webapp/accounting/fixedasset/FixedAssetForms.xml

Modified: 
ofbiz/trunk/applications/accounting/config/AccountingUiLabels.properties
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/config/AccountingUiLabels.properties?view=diff&rev=503298&r1=503297&r2=503298
==============================================================================
--- ofbiz/trunk/applications/accounting/config/AccountingUiLabels.properties 
(original)
+++ ofbiz/trunk/applications/accounting/config/AccountingUiLabels.properties 
Sat Feb  3 12:14:53 2007
@@ -399,6 +399,7 @@
 AccountingNewFixedAssetIdentsType=Create Fixed Asset Identification Type
 AccountingFixedAssetIdentType=Identification Type
 AccountingFixedAssetIdentIdValue=Value
+AccountingFixedAssetMaintenanceTemplate=Maintenance Template
 
 AccountingFixedAssetRegNumber=Registration Number
 AccountingFixedAssetLicenseNumber=License Number
@@ -410,6 +411,7 @@
 AccountingFixedAssetMaintIntervalQuantity=Interval Quantity
 AccountingFixedAssetMaintMessage1=If the Product Maintenance is specified, 
this will be set/reset automatically
 AccountingFixedAssetMaintMessage2=Only use if applicable, can use Maintenance 
Type instead
+AccountingFixedAssetMaintMessage3=If Maintenance Template is specified with 
Product Maintenance, this will be set/reset automatically
 
 PageTitleEditAgreement=Edit Agreement
 PageTitleEditAgreementItem=Edit Agreement Item

Modified: 
ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/fixedasset/FixedAssetServices.xml
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/fixedasset/FixedAssetServices.xml?view=diff&rev=503298&r1=503297&r2=503298
==============================================================================
--- 
ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/fixedasset/FixedAssetServices.xml
 (original)
+++ 
ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/fixedasset/FixedAssetServices.xml
 Sat Feb  3 12:14:53 2007
@@ -529,17 +529,38 @@
                 <field-map field-name="productMaintSeqId" 
env-name="parameters.productMaintSeqId"/>
             </entity-one>
             <set field="newEntity.productMaintTypeId" 
from-field="productMaint.productMaintTypeId"/>
+        </if-not-empty >
+        <if-not-empty field-name="productMaint.maintTemplateWorkEffortId">
+            <set field="maintTemplateWorkEffortId" 
from-field="productMaint.maintTemplateWorkEffortId"/>
+            <else>
+                <!-- User can still pick a Template workEffort -->
+                <set field="maintTemplateWorkEffortId" 
from-field="parameters.maintTemplateWorkEffortId"/>
+            </else>
+        </if-not-empty>
+        <if-not-empty field-name="maintTemplateWorkEffortId">
+            
+            <set field="duplicateTemplateWorkEffortMap.oldWorkEffortId" 
from-field="maintTemplateWorkEffortId"/>
+            <sequenced-id-to-env sequence-name="WorkEffort" 
env-name="duplicateTemplateWorkEffortMap.workEffortId"/>
+            <set 
field="duplicateTemplateWorkEffortMap.duplicateWorkEffortAssocs" value="Y"/>
+            <set 
field="duplicateTemplateWorkEffortMap.duplicateWorkEffortNotes" value="Y"/>
+            <set 
field="duplicateTemplateWorkEffortMap.duplicateWorkEffortContents" value="Y"/>
+            <set 
field="duplicateTemplateWorkEffortMap.duplicateWorkEffortAssignmentRates" 
value="Y"/>
+            <call-service service-name="duplicateWorkEffort" 
in-map-name="duplicateTemplateWorkEffortMap"/>
+            <set field="newEntity.scheduleWorkEffortId" 
from-field="duplicateTemplateWorkEffortMap.workEffortId"/>
+            
+            <else>
+                <!-- Create the WorkEfforts, dates not specified -->
+                <!-- Maintenance WorkEffort entity -->
+                <set value="Maintenance of Fixed Asset 
#${newEntity.fixedAssetId} " field="maintWorkEffortMap.workEffortName"/>
+                <set value="TASK" field="maintWorkEffortMap.workEffortTypeId"/>
+                <set value="WEPT_MAINTENANCE" 
field="maintWorkEffortMap.workEffortPurposeTypeId"/>
+                <set value="CAL_TENTATIVE" 
field="maintWorkEffortMap.currentStatusId"/>
+                <set from-field="userLogin.partyId" 
field="maintWorkEffortMap.quickAssignPartyId"/>
+                <call-service service-name="createWorkEffort" 
in-map-name="maintWorkEffortMap">
+                    <result-to-field result-name="workEffortId" 
field-name="newEntity.scheduleWorkEffortId"/>
+                </call-service>
+            </else>
         </if-not-empty>
-        <!-- Create the WorkEfforts, dates not specified -->
-        <!-- Maintenance WorkEffort entity -->
-        <set value="Maintenance of Fixed Asset #${newEntity.fixedAssetId} " 
field="maintWorkEffortMap.workEffortName"/>
-        <set value="TASK" field="maintWorkEffortMap.workEffortTypeId"/>
-        <set value="WEPT_MAINTENANCE" 
field="maintWorkEffortMap.workEffortPurposeTypeId"/>
-        <set value="CAL_TENTATIVE" field="maintWorkEffortMap.currentStatusId"/>
-        <set from-field="userLogin.partyId" 
field="maintWorkEffortMap.quickAssignPartyId"/>
-        <call-service service-name="createWorkEffort" 
in-map-name="maintWorkEffortMap">
-            <result-to-field result-name="workEffortId" 
field-name="newEntity.scheduleWorkEffortId"/>
-        </call-service>
         <create-value value-name="newEntity"/>  
     </simple-method>   
     <simple-method method-name="updateFixedAssetMaint" 
short-description="Update an existing FixedAsset Maintenance">

Modified: ofbiz/trunk/applications/accounting/servicedef/services_fixedasset.xml
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/servicedef/services_fixedasset.xml?view=diff&rev=503298&r1=503297&r2=503298
==============================================================================
--- ofbiz/trunk/applications/accounting/servicedef/services_fixedasset.xml 
(original)
+++ ofbiz/trunk/applications/accounting/servicedef/services_fixedasset.xml Sat 
Feb  3 12:14:53 2007
@@ -206,6 +206,7 @@
         <description>Create a FixedAsset Maintenance</description>
         <auto-attributes include="pk" mode="IN" optional="false"/>
         <auto-attributes include="nonpk" mode="IN" optional="true"/>
+        <attribute name="maintTemplateWorkEffortId" mode="IN" type="String" 
optional="true"/>
         <override name="maintHistSeqId" mode="OUT"/> <!-- make this OUT rather 
than IN, we will automatically generate the next sub-sequence ID -->        
     </service>
     <service name="updateFixedAssetMaint" 
default-entity-name="FixedAssetMaint" engine="simple"

Modified: 
ofbiz/trunk/applications/accounting/webapp/accounting/fixedasset/FixedAssetForms.xml
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/webapp/accounting/fixedasset/FixedAssetForms.xml?view=diff&rev=503298&r1=503297&r2=503298
==============================================================================
--- 
ofbiz/trunk/applications/accounting/webapp/accounting/fixedasset/FixedAssetForms.xml
 (original)
+++ 
ofbiz/trunk/applications/accounting/webapp/accounting/fixedasset/FixedAssetForms.xml
 Sat Feb  3 12:14:53 2007
@@ -357,6 +357,9 @@
                 </entity-options>
             </drop-down>
         </field>
+        <field name="maintTemplateWorkEffortId" 
use-when="fixedAssetMaint==null"  
title="${uiLabelMap.AccountingFixedAssetMaintenanceTemplate}" 
tooltip="${uiLabelMap.AccountingFixedAssetMaintMessage3}">
+            <lookup target-form-name="LookupWorkEffort"/>
+        </field>
         <field name="intervalQuantity" 
title="${uiLabelMap.AccountingFixedAssetMaintIntervalQuantity}"><text 
size="10"/></field>        
         <field name="intervalUomId" 
title="${uiLabelMap.AccountingFixedAssetMaintIntervalUom}">
             <drop-down allow-empty="true">


Reply via email to