svn commit: r681711 - in /ofbiz/trunk: applications/accounting/data/ applications/accounting/entitydef/ applications/accounting/script/org/ofbiz/accounting/fixedasset/ applications/accounting/servicedef/ specialpurpose/assetmaint/data/ specialpurpose/a...

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r681711 - in /ofbiz/trunk: applications/accounting/data/ applications/accounting/entitydef/ applications/accounting/script/org/ofbiz/accounting/fixedasset/ applications/accounting/servicedef/ specialpurpose/assetmaint/data/ specialpurpose/a...

adrianc
Author: adrianc
Date: Fri Aug  1 08:03:31 2008
New Revision: 681711

URL: http://svn.apache.org/viewvc?rev=681711&view=rev
Log:
Moved the auto-assign fixed asset party to fixed asset maintenance feature from the Asset Maint component to the Accounting component.

Modified:
    ofbiz/trunk/applications/accounting/data/AccountingTypeData.xml
    ofbiz/trunk/applications/accounting/entitydef/entitymodel.xml
    ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/fixedasset/FixedAssetServices.xml
    ofbiz/trunk/applications/accounting/servicedef/secas.xml
    ofbiz/trunk/applications/accounting/servicedef/services_fixedasset.xml
    ofbiz/trunk/specialpurpose/assetmaint/data/AssetMaintSeedData.xml
    ofbiz/trunk/specialpurpose/assetmaint/entitydef/entitymodel.xml
    ofbiz/trunk/specialpurpose/assetmaint/script/org/ofbiz/assetmaint/FixedAssetMaintEvents.xml
    ofbiz/trunk/specialpurpose/assetmaint/servicedef/secas.xml
    ofbiz/trunk/specialpurpose/assetmaint/servicedef/services.xml

Modified: ofbiz/trunk/applications/accounting/data/AccountingTypeData.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/data/AccountingTypeData.xml?rev=681711&r1=681710&r2=681711&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/data/AccountingTypeData.xml (original)
+++ ofbiz/trunk/applications/accounting/data/AccountingTypeData.xml Fri Aug  1 08:03:31 2008
@@ -158,6 +158,12 @@
     <StatusItem description="Completed" sequenceId="10" statusCode="COMPLETED" statusId="FAM_COMPLETED" statusTypeId="FIXEDAST_MNT_STATUS"/>
     <StatusItem description="Cancelled" sequenceId="99" statusCode="CANCELLED" statusId="FAM_CANCELLED" statusTypeId="FIXEDAST_MNT_STATUS"/>
     
+    <!-- Fixed Asset Maintenance party roles -->
+    <RoleType description="Fixed Asset Maint Assignee" hasTable="N" roleTypeId="FAM_ASSIGNEE"/>
+    <RoleType description="Maintenance Supplier or Service" hasTable="N" parentTypeId="FAM_ASSIGNEE" roleTypeId="FAM_SUPPLIER"/>
+    <RoleType description="Maintenance Manager or Supervisor" hasTable="N" parentTypeId="FAM_ASSIGNEE" roleTypeId="FAM_MANAGER"/>
+    <RoleType description="Maintenance Worker" hasTable="N" parentTypeId="FAM_ASSIGNEE" roleTypeId="FAM_WORKER"/>
+
     <FixedAssetProductType description="Use of Asset" fixedAssetProductTypeId="FAPT_USE"/>
     <FixedAssetProductType description="Sale of Asset" fixedAssetProductTypeId="FAPT_SALE"/>
 

Modified: ofbiz/trunk/applications/accounting/entitydef/entitymodel.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/entitydef/entitymodel.xml?rev=681711&r1=681710&r2=681711&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/entitydef/entitymodel.xml (original)
+++ ofbiz/trunk/applications/accounting/entitydef/entitymodel.xml Fri Aug  1 08:03:31 2008
@@ -956,6 +956,17 @@
         <key-map field-name="statusId"/>
       </relation>
     </entity>
+
+    <view-entity entity-name="PartyFixedAssetAssignAndRole" package-name="org.ofbiz.accounting.fixedasset"
+        title="PartyFixedAssetAssignment and RoleType View Entity">
+        <member-entity entity-alias="PFA" entity-name="PartyFixedAssetAssignment"/>
+        <member-entity entity-alias="RT" entity-name="RoleType"/>
+        <alias-all entity-alias="PFA"/>
+        <alias-all entity-alias="RT"/>
+        <view-link entity-alias="PFA" rel-entity-alias="RT">
+            <key-map field-name="roleTypeId"/>
+        </view-link>
+    </view-entity>
     
     <entity entity-name="FixedAssetMaintOrder" package-name="org.ofbiz.accounting.fixedasset" title="Fixed Asset Maintance And Order Entity">
         <field name="fixedAssetId" type="id-ne"></field>

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?rev=681711&r1=681710&r2=681711&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/fixedasset/FixedAssetServices.xml (original)
+++ ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/fixedasset/FixedAssetServices.xml Fri Aug  1 08:03:31 2008
@@ -419,6 +419,32 @@
         <remove-value value-name="newEntity"/>
     </simple-method>
     
+    <simple-method method-name="autoAssignFixedAssetPartiesToMaintenance" login-required="true"
+        short-description="Auto-assign Fixed Asset Parties to a Fixed Asset Maintenance">
+        <if-empty field="maintHistSeqId">
+            <set field="maintHistSeqId" from-field="parameters.maintHistSeqId"/>
+        </if-empty>
+        <if-empty field="fixedAssetId">
+            <set field="fixedAssetId" from-field="parameters.fixedAssetId"/>
+        </if-empty>
+        <entity-one entity-name="FixedAssetMaint" value-name="maintValue"/>
+        <if-empty field="workEffortId">
+            <set field="workEffortId" from-field="maintValue.scheduleWorkEffortId"/>
+        </if-empty>
+        <entity-and list-name="assignedParties" entity-name="PartyFixedAssetAssignAndRole" filter-by-date="true">
+            <field-map field-name="fixedAssetId" env-name="fixedAssetId"/>
+            <field-map field-name="parentTypeId" value="FAM_ASSIGNEE"/>
+        </entity-and>
+        <iterate list-name="assignedParties" entry-name="assignedParty">
+            <set field="assignPartyCtx.partyId" from-field="assignedParty.partyId"/>
+            <set field="assignPartyCtx.roleTypeId" from-field="assignedParty.roleTypeId"/>
+            <set field="assignPartyCtx.workEffortId" from-field="workEffortId"/>
+            <set field="assignPartyCtx.statusId" value="PRTYASGN_ASSIGNED"/>
+            <call-service service-name="assignPartyToWorkEffort" in-map-name="assignPartyCtx"/>
+            <check-errors/>
+        </iterate>
+    </simple-method>
+
     <!-- ==============  Fixed Asset Depreciation methods  ============== -->  
     <simple-method method-name="straightLineDepreciation" short-description="Calculate straight line depreciation to Fixed Asset[ (PC-SV)/expLife ]">
         <set field="expEndOfLifeYear" from-field="parameters.expEndOfLifeYear" type="Integer"/>

Modified: ofbiz/trunk/applications/accounting/servicedef/secas.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/servicedef/secas.xml?rev=681711&r1=681710&r2=681711&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/servicedef/secas.xml (original)
+++ ofbiz/trunk/applications/accounting/servicedef/secas.xml Fri Aug  1 08:03:31 2008
@@ -161,5 +161,9 @@
         <condition field-name="invoiceId" operator="is-not-empty" />
         <action service="createAcctgTransAndEntriesForPaymentApplication" mode="sync"/>
     </eca>
-  
+
+    <eca service="createFixedAssetMaint" event="commit" run-on-failure="false">
+        <action service="autoAssignFixedAssetPartiesToMaintenance" mode="sync"/>
+    </eca>
+
 </service-eca>

Modified: ofbiz/trunk/applications/accounting/servicedef/services_fixedasset.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/servicedef/services_fixedasset.xml?rev=681711&r1=681710&r2=681711&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/servicedef/services_fixedasset.xml (original)
+++ ofbiz/trunk/applications/accounting/servicedef/services_fixedasset.xml Fri Aug  1 08:03:31 2008
@@ -233,6 +233,16 @@
         <description>Delete Party to Fixed Asset</description>
         <auto-attributes include="pk" mode="IN" optional="false"/>
     </service>
+
+    <service name="autoAssignFixedAssetPartiesToMaintenance" engine="simple"
+                location="component://accounting/script/org/ofbiz/accounting/fixedasset/FixedAssetServices.xml" invoke="autoAssignFixedAssetPartiesToMaintenance" auth="true">
+        <description>Auto-assign Fixed Asset Parties to a Fixed Asset Maintenance</description>
+        <permission-service service-name="fixedAssetPermissionCheck" main-action="UPDATE"/>
+        <attribute name="fixedAssetId" mode="IN" type="String" optional="false"/>
+        <attribute name="maintHistSeqId" mode="IN" type="String" optional="false"/>
+    </service>
+
+    <!-- Fixed Asset Permission Services -->
     <service name="fixedAssetPermissionCheck" engine="simple"
             location="component://accounting/script/org/ofbiz/accounting/permissions/PermissionServices.xml" invoke="basePermissionCheck">
         <description>Fixed Asset Permission Checking Logic</description>

Modified: ofbiz/trunk/specialpurpose/assetmaint/data/AssetMaintSeedData.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/assetmaint/data/AssetMaintSeedData.xml?rev=681711&r1=681710&r2=681711&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/assetmaint/data/AssetMaintSeedData.xml (original)
+++ ofbiz/trunk/specialpurpose/assetmaint/data/AssetMaintSeedData.xml Fri Aug  1 08:03:31 2008
@@ -18,9 +18,4 @@
 under the License.
 -->
 <entity-engine-xml>
-    <!-- Asset Maintenance seed data -->
-    <RoleType description="Fixed Asset Maint Assignee" hasTable="N" roleTypeId="FAM_ASSIGNEE"/>
-    <RoleType description="Outside Supplier/Service (Asset Maint)" hasTable="N" parentTypeId="FAM_ASSIGNEE" roleTypeId="FAM_SUPPLIER"/>
-    <RoleType description="Manager or Supervisor (Asset Maint)" hasTable="N" parentTypeId="FAM_ASSIGNEE" roleTypeId="FAM_MANAGER"/>
-    <RoleType description="Worker (Asset Maint)" hasTable="N" parentTypeId="FAM_ASSIGNEE" roleTypeId="FAM_WORKER"/>
 </entity-engine-xml>

Modified: ofbiz/trunk/specialpurpose/assetmaint/entitydef/entitymodel.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/assetmaint/entitydef/entitymodel.xml?rev=681711&r1=681710&r2=681711&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/assetmaint/entitydef/entitymodel.xml (original)
+++ ofbiz/trunk/specialpurpose/assetmaint/entitydef/entitymodel.xml Fri Aug  1 08:03:31 2008
@@ -38,16 +38,6 @@
             <key-map field-name="fixedAssetId"/>
         </view-link>
     </view-entity>
-    <view-entity entity-name="PartyFixedAssetAssignAndRole" package-name="org.ofbiz.assetmaint"
-        title="PartyFixedAssetAssignment and RoleType View Entity">
-        <member-entity entity-alias="PFA" entity-name="PartyFixedAssetAssignment"/>
-        <member-entity entity-alias="RT" entity-name="RoleType"/>
-        <alias-all entity-alias="PFA"/>
-        <alias-all entity-alias="RT"/>
-        <view-link entity-alias="PFA" rel-entity-alias="RT">
-            <key-map field-name="roleTypeId"/>
-        </view-link>
-    </view-entity>
     <view-entity entity-name="FixedAssetMaintWorkEffort" package-name="org.ofbiz.assetmaint"
         title="FixedAssetMaint and WorkEffort View Entity">
         <member-entity entity-alias="FA" entity-name="FixedAsset"/>

Modified: ofbiz/trunk/specialpurpose/assetmaint/script/org/ofbiz/assetmaint/FixedAssetMaintEvents.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/assetmaint/script/org/ofbiz/assetmaint/FixedAssetMaintEvents.xml?rev=681711&r1=681710&r2=681711&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/assetmaint/script/org/ofbiz/assetmaint/FixedAssetMaintEvents.xml (original)
+++ ofbiz/trunk/specialpurpose/assetmaint/script/org/ofbiz/assetmaint/FixedAssetMaintEvents.xml Fri Aug  1 08:03:31 2008
@@ -40,32 +40,6 @@
         <call-service service-name="updateWorkEffort" in-map-name="updateWorkEffortCtx"/>
     </simple-method>
 
-    <simple-method method-name="assignFixedAssetPartiesToMaintenance" login-required="true"
-        short-description="Assign Fixed Asset Parties to a Fixed Asset Maintenance">
-        <if-empty field="maintHistSeqId">
-            <set field="maintHistSeqId" from-field="parameters.maintHistSeqId"/>
-        </if-empty>
-        <if-empty field="fixedAssetId">
-            <set field="fixedAssetId" from-field="parameters.fixedAssetId"/>
-        </if-empty>
-        <entity-one entity-name="FixedAssetMaint" value-name="maintValue"/>
-        <if-empty field="workEffortId">
-            <set field="workEffortId" from-field="maintValue.scheduleWorkEffortId"/>
-        </if-empty>
-        <entity-and list-name="assignedParties" entity-name="PartyFixedAssetAssignAndRole" filter-by-date="true">
-            <field-map field-name="fixedAssetId" env-name="fixedAssetId"/>
-            <field-map field-name="parentTypeId" value="FAM_ASSIGNEE"/>
-        </entity-and>
-        <iterate list-name="assignedParties" entry-name="assignedParty">
-            <set field="assignPartyCtx.partyId" from-field="assignedParty.partyId"/>
-            <set field="assignPartyCtx.roleTypeId" from-field="assignedParty.roleTypeId"/>
-            <set field="assignPartyCtx.workEffortId" from-field="workEffortId"/>
-            <set field="assignPartyCtx.statusId" value="PRTYASGN_ASSIGNED"/>
-            <call-service service-name="assignPartyToWorkEffort" in-map-name="assignPartyCtx"/>
-            <check-errors/>
-        </iterate>
-    </simple-method>
-
     <simple-method method-name="updateFixedAssetMaintAndWorkEffort" login-required="true"
         short-description="Update FixedAssetMaint and Schedule information in WorkEffort">
         <check-errors/>

Modified: ofbiz/trunk/specialpurpose/assetmaint/servicedef/secas.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/assetmaint/servicedef/secas.xml?rev=681711&r1=681710&r2=681711&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/assetmaint/servicedef/secas.xml (original)
+++ ofbiz/trunk/specialpurpose/assetmaint/servicedef/secas.xml Fri Aug  1 08:03:31 2008
@@ -37,9 +37,4 @@
         <action service="assetMaintPermissionCheck" mode="sync" result-to-result="true"/>
     </eca>
 
-    <!-- ECAs used to extend fixed asset services -->
-    <eca service="createFixedAssetMaint" event="commit" run-on-failure="false">
-        <action service="assignFixedAssetPartiesToMaintenance" mode="sync"/>
-    </eca>
-
 </service-eca>

Modified: ofbiz/trunk/specialpurpose/assetmaint/servicedef/services.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/assetmaint/servicedef/services.xml?rev=681711&r1=681710&r2=681711&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/assetmaint/servicedef/services.xml (original)
+++ ofbiz/trunk/specialpurpose/assetmaint/servicedef/services.xml Fri Aug  1 08:03:31 2008
@@ -31,14 +31,6 @@
         <attribute type="String" mode="IN" name="facilityId" optional="false"/>
     </service>
     
-    <service name="assignFixedAssetPartiesToMaintenance" engine="simple"
-                location="component://assetmaint/script/org/ofbiz/assetmaint/FixedAssetMaintEvents.xml" invoke="assignFixedAssetPartiesToMaintenance" auth="true">
-        <description>Assign Fixed Asset Parties to a Fixed Asset Maintenance</description>
-        <permission-service service-name="fixedAssetPermissionCheck" main-action="UPDATE"/>
-        <attribute name="fixedAssetId" mode="IN" type="String" optional="false"/>
-        <attribute name="maintHistSeqId" mode="IN" type="String" optional="false"/>
-    </service>
-
     <service name="assetMaintPermissionCheck" engine="simple"
             location="component://assetmaint/script/org/ofbiz/assetmaint/FixedAssetMaintEvents.xml" invoke="assetMaintPermissionCheck">
         <description>Asset Maintentance Permission Checking Logic</description>