svn commit: r498756 - in /ofbiz/trunk/applications/accounting: config/ entitydef/ script/org/ofbiz/accounting/fixedasset/ servicedef/ webapp/accounting/WEB-INF/ webapp/accounting/fixedasset/ widget/

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

svn commit: r498756 - in /ofbiz/trunk/applications/accounting: config/ entitydef/ script/org/ofbiz/accounting/fixedasset/ servicedef/ webapp/accounting/WEB-INF/ webapp/accounting/fixedasset/ widget/

jonesde
Author: jonesde
Date: Mon Jan 22 11:24:43 2007
New Revision: 498756

URL: http://svn.apache.org/viewvc?view=rev&rev=498756
Log:
Applied patch from Anil Patel with a new FixedAssetMaintOrder entity and related artifacts; Jira #OFBIZ-598

Modified:
    ofbiz/trunk/applications/accounting/config/AccountingUiLabels.properties
    ofbiz/trunk/applications/accounting/entitydef/entitygroup.xml
    ofbiz/trunk/applications/accounting/entitydef/entitymodel.xml
    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/WEB-INF/controller.xml
    ofbiz/trunk/applications/accounting/webapp/accounting/fixedasset/FixedAssetForms.xml
    ofbiz/trunk/applications/accounting/widget/FixedAssetScreens.xml
    ofbiz/trunk/applications/accounting/widget/Menus.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=498756&r1=498755&r2=498756
==============================================================================
--- ofbiz/trunk/applications/accounting/config/AccountingUiLabels.properties (original)
+++ ofbiz/trunk/applications/accounting/config/AccountingUiLabels.properties Mon Jan 22 11:24:43 2007
@@ -119,6 +119,7 @@
 AccountingCreateBillingAccountRolePermissionError=Security Error : to run createBillingAccountRole you must have the ACCOUNTING_CREATE or ACCOUNTING_ADMIN permission
 AccountingCreateBillingAccountTerm=Create Billing Account Term
 AccountingCreateBillingAccountTermPermissionError=Security Error : to run createBillingAccountTerm you must have the ACCOUNTING_CREATE or ACCOUNTING_ADMIN permission
+AccountingCreateFixedAssetMaintOrderPermissionError = Security Error: to run createFixedAssetMaintOrder you must have the ACCOUNTING_CREATEUPDATE or ACCOUNTING_ADMIN permission, or the limited ACCOUNTING_ROLE_CREATE permission
 AccountingCreateNewCreditCard=Create New Credit Card
 AccountingCreateNewEftAccount=Create New EFT Account
 AccountingCreateNewInvoice=New Invoice
@@ -131,6 +132,7 @@
 AccountingDataExchange=DataExchange
 AccountingDebitCreditMustEqual=Debit and Credit Totals must be equal to post to GL.
 AccountingDeleteBillingAccountTermPermissionError=Security Error : to run removeBillingAccountTerm you must have the ACCOUNTING_DELETE or ACCOUNTING_ADMIN permission
+AccountingDeleteFixedAssetMaintOrderPermissionError = Security Error: to run deleteFixedAssetMaintOrder you must have the ACCOUNTING_DELETE or ACCOUNTING_ADMIN permission, or the limited ACCOUNTING_ROLE_UPDATE permission
 AccountingDescription=Description
 AccountingDescr=Descr
 AccountingDueDate=Due Date
@@ -185,6 +187,7 @@
 AccountingFixedAssetMaintMeters=Meters Readings
 AccountingFixedAssetMaintMeterValue=Meter Value
 AccountingFixedAssetMessage1=*) empty, but maximum from fixed Asset capacity shown
+AccountingFixedAssetMaintOrders=Purchase Orders
 AccountingFromParty=From Party
 AccountingFromPartyId=From Party ID
 AccountingFX=Foreign Exchange Rates
@@ -586,6 +589,8 @@
 AccountingPaymentNotEnough=Payment [${paymentId}] has an amount (${paymentApplyAvailable?currency(${isoCode})} to apply and the  ${amountApplied?currency(${isoCode})} requested is too much\n
 AccountingInvoiceNotEnough=Requested Amount is ${tooMuch?currency(${isoCode})} to much for this Invoice [${invoiceId}]\n
 AccountingInvoiceItemNotEnough=Requested Amount is ${tooMuch?currency(${isoCode})} to much for this Invoice [${invoiceId}] Item [${invoiceItemSeqId}]\n
+AccountingOrderWithIdNotFound=Order with id ${orderId} not found.
+AccountingOrderItemWithIdNotFound=Order Item with id ${orderItemSeqId} not found.
 AccountingBillingAccountNotEnough=Billing Account [${billingAccountId}] has only  ${newBillingAccountApplyAvailable?currency(${isoCode})} available so ${amountApplied?currency(${isoCode})} is too much\n
 AccountingNoAmount=Amount requested to apply is zero or not provided: no amount applied/n
 AccountingApplicationSuccess=Applying ${amountApplied?currency(${isoCode})} from payment [${paymentId}] to ${toMessage}

Modified: ofbiz/trunk/applications/accounting/entitydef/entitygroup.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/entitydef/entitygroup.xml?view=diff&rev=498756&r1=498755&r2=498756
==============================================================================
--- ofbiz/trunk/applications/accounting/entitydef/entitygroup.xml (original)
+++ ofbiz/trunk/applications/accounting/entitydef/entitygroup.xml Mon Jan 22 11:24:43 2007
@@ -51,6 +51,7 @@
     <entity-group group="org.ofbiz" entity="FixedAssetIdentType" />
     <entity-group group="org.ofbiz" entity="FixedAssetMaint" />
     <entity-group group="org.ofbiz" entity="FixedAssetMaintMeter" />
+    <entity-group group="org.ofbiz" entity="FixedAssetMaintOrder" />    
     <entity-group group="org.ofbiz" entity="FixedAssetProduct" />
     <entity-group group="org.ofbiz" entity="FixedAssetProductType" />
     <entity-group group="org.ofbiz" entity="FixedAssetRegistration" />

Modified: ofbiz/trunk/applications/accounting/entitydef/entitymodel.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/entitydef/entitymodel.xml?view=diff&rev=498756&r1=498755&r2=498756
==============================================================================
--- ofbiz/trunk/applications/accounting/entitydef/entitymodel.xml (original)
+++ ofbiz/trunk/applications/accounting/entitydef/entitymodel.xml Mon Jan 22 11:24:43 2007
@@ -644,6 +644,27 @@
         <key-map field-name="statusId"/>
       </relation>
     </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>
+        <field name="maintHistSeqId" type="id-ne"></field>
+        <field name="orderId" type="id"></field>
+        <field name="orderItemSeqId" type="id"></field>
+        <prim-key field="fixedAssetId"/>
+        <prim-key field="maintHistSeqId"/>
+        <prim-key field="orderId"/>
+        <prim-key field="orderItemSeqId"/>
+        <relation type="one" fk-name="FXDASTMNT_ORD_FXAST" rel-entity-name="FixedAsset">
+            <key-map field-name="fixedAssetId"/>
+        </relation>
+        <relation type="one" fk-name="FXDASTMNT_ORD" title="Purchase" rel-entity-name="OrderHeader">
+            <key-map field-name="orderId"/>
+        </relation>
+        <relation type="one-nofk" title="Purchase" rel-entity-name="OrderItem">
+            <key-map field-name="orderId" />
+            <key-map field-name="orderItemSeqId"/>
+        </relation>
+    </entity>
 
   <!-- ========================================================= -->
   <!-- org.ofbiz.accounting.invoice -->

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=498756&r1=498755&r2=498756
==============================================================================
--- ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/fixedasset/FixedAssetServices.xml (original)
+++ ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/fixedasset/FixedAssetServices.xml Mon Jan 22 11:24:43 2007
@@ -598,4 +598,45 @@
         <entity-one entity-name="FixedAssetMaintMeter" value-name="lookedUpValue"/>
         <remove-value value-name="lookedUpValue"/>
     </simple-method>
+    
+    <!--  create/update/delete FixedAssetMaintOrder -->
+    <simple-method method-name="createFixedAssetMaintOrder" short-description="Create a FixedAsset Maintenance Order">
+        <check-permission permission="ACCOUNTING" action="_CREATE">
+            <alt-permission permission="ACCOUNTING_ROLE" action="_CREATE"/>
+            <fail-property resource="AccountingUiLabels" property="AccountingCreateFixedAssetMaintOrderPermissionError"/>            
+        </check-permission>        
+        <check-errors/>
+           <!-- Check, should exist orderId and orderItemId -->
+        <entity-one entity-name="OrderHeader" value-name="lookedUpValue"/>
+        <if-empty field-name="lookedUpValue">
+            <set field="orderId" from-field="parameters.orderId"/>
+            <add-error><fail-property resource="AccountingUiLabels" property="AccountingOrderWithIdNotFound"/></add-error>
+        </if-empty>
+        <check-errors/>        
+        
+        <if-not-empty field-name="orderItemSeqId" map-name="parameters">
+           <!-- Check, should exist orderId and orderItemId -->
+           <entity-one entity-name="OrderItem" value-name="lookedUpValue"/>
+           <if-empty field-name="lookedUpValue">
+              <set field="orderItemSeqId" from-field="parameters.orderItemSeqId"/>
+              <add-error><fail-property resource="AccountingUiLabels" property="AccountingOrderItemWithIdNotFound"/></add-error>
+           </if-empty>
+        <check-errors/>
+        </if-not-empty>
+        
+        <make-value entity-name="FixedAssetMaintOrder" value-name="newEntity"/>
+        <set-pk-fields map-name="parameters" value-name="newEntity"/>
+        <set-nonpk-fields map-name="parameters" value-name="newEntity"/>
+        <create-value value-name="newEntity"/>  
+    </simple-method>  
+    <simple-method method-name="deleteFixedAssetMaintOrder" short-description="Delete FixedAsset Maintenance Order">
+        <check-permission permission="ACCOUNTING" action="_DELETE">
+            <alt-permission permission="ACCOUNTING_ROLE" action="_DELETE"/>
+            <fail-property resource="AccountingUiLabels" property="AccountingDeleteFixedAssetMaintOrderPermissionError"/>            
+        </check-permission>        
+        <check-errors/>
+        <entity-one entity-name="FixedAssetMaintOrder" value-name="lookedUpValue"/>
+        <remove-value value-name="lookedUpValue"/>
+    </simple-method>
+    
 </simple-methods>

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=498756&r1=498755&r2=498756
==============================================================================
--- ofbiz/trunk/applications/accounting/servicedef/services_fixedasset.xml (original)
+++ ofbiz/trunk/applications/accounting/servicedef/services_fixedasset.xml Mon Jan 22 11:24:43 2007
@@ -234,5 +234,16 @@
         <description>Remove a FixedAsset Maintenance Meter</description>
         <auto-attributes include="pk" mode="IN" optional="false"/>
     </service>
-    
+    <!-- FixedAsset Maintenance Order Create/Update/Delete-->
+    <service name="createFixedAssetMaintOrder" default-entity-name="FixedAssetMaintOrder" engine="simple"
+                location="org/ofbiz/accounting/fixedasset/FixedAssetServices.xml" invoke="createFixedAssetMaintOrder" auth="true">
+        <description>Create a FixedAsset Maintenance Order</description>
+        <auto-attributes include="pk" mode="IN" optional="false"/>
+        <auto-attributes include="nonpk" mode="IN" optional="true"/>
+    </service>
+    <service name="deleteFixedAssetMaintOrder" default-entity-name="FixedAssetMaintOrder" engine="simple"
+                location="org/ofbiz/accounting/fixedasset/FixedAssetServices.xml" invoke="deleteFixedAssetMaintOrder" auth="true">
+        <description>Remove a FixedAsset Maintenance Order</description>
+        <auto-attributes include="pk" mode="IN" optional="false"/>
+    </service>
 </services>

Modified: ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/controller.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/controller.xml?view=diff&rev=498756&r1=498755&r2=498756
==============================================================================
--- ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/controller.xml (original)
+++ ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/controller.xml Mon Jan 22 11:24:43 2007
@@ -1190,6 +1190,25 @@
         <security https="true" auth="true" />
         <response name="success" type="view" value="LookupOrderHeader" />
     </request-map>
+    <!-- FixedAssetMaintenance Order -->
+    <request-map uri="EditFixedAssetMaintOrders">
+        <security https="true" auth="true"/>
+        <response name="success" type="view" value="EditFixedAssetMaintOrders"/>
+        <response name="error" type="view" value="EditFixedAssetMaintOrders"/>
+    </request-map>
+    <request-map uri="createFixedAssetMaintOrder">
+        <security https="true" auth="true"/>
+        <event type="service" path="" invoke="createFixedAssetMaintOrder"/>
+        <response name="success" type="view" value="EditFixedAssetMaintOrders"/>
+        <response name="error" type="view" value="EditFixedAssetMaintOrders"/>
+    </request-map>
+    <request-map uri="deleteFixedAssetMaintOrder">
+        <security https="true" auth="true"/>
+        <event type="service" path="" invoke="deleteFixedAssetMaintOrder"/>
+        <response name="success" type="view" value="EditFixedAssetMaintOrders"/>
+        <response name="error" type="view" value="EditFixedAssetMaintOrders"/>
+    </request-map>
+    
     <!-- end of request mappings -->
 
     <!-- View Mappings -->
@@ -1335,6 +1354,8 @@
     <view-map name="LookupOrderHeader" type="screen" page="component://order/widget/ordermgr/LookupScreens.xml#LookupOrderHeader" />
     <view-map name="LookupFacility" type="screen" page="component://product/widget/facility/LookupScreens.xml#LookupFacility"/>
     <view-map name="LookupFacilityLocation" type="screen" page="component://product/widget/facility/LookupScreens.xml#LookupFacilityLocation"/>
-    
+    <!-- Fixed Asset Maintenance Order -->
+    <view-map name="EditFixedAssetMaintOrders" type="screen" page="component://accounting/widget/FixedAssetScreens.xml#EditFixedAssetMaintOrders"/>
+        
     <!-- end of view mappings -->
 </site-conf>

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=498756&r1=498755&r2=498756
==============================================================================
--- ofbiz/trunk/applications/accounting/webapp/accounting/fixedasset/FixedAssetForms.xml (original)
+++ ofbiz/trunk/applications/accounting/webapp/accounting/fixedasset/FixedAssetForms.xml Mon Jan 22 11:24:43 2007
@@ -423,5 +423,39 @@
         <field name="meterValue" title="${uiLabelMap.AccountingFixedAssetMaintMeterValue}"><text size="20" /></field>
         <field name="submitButton" title="${uiLabelMap.CommonAdd}" widget-style="smallSubmit"><submit button-type="button"/></field>
     </form>
-    
+    <!-- List all fixed asset Maintenance Order  -->
+    <form name="ListFixedAssetMaintOrders" type="list"  list-name="fixedAssetMaintOrders" target="updateFixedAssetMaintOrder"
+         default-title-style="tableheadtext" default-widget-style="inputBox" default-tooltip-style="tabletext">
+        <actions>
+            <entity-condition entity-name="FixedAssetMaintOrder" list-name="fixedAssetMaintOrders">
+                <condition-list combine="and">
+                    <condition-expr field-name="fixedAssetId" env-name="fixedAssetId"/>
+                    <condition-expr field-name="maintHistSeqId" env-name="maintHistSeqId"/>
+                </condition-list>
+            </entity-condition>
+        </actions>
+        <auto-fields-entity entity-name="FixedAssetMaintOrder"/>
+        <field name="fixedAssetId"><hidden/></field>
+        <field name="maintHistSeqId"><hidden/></field>
+        <field name="orderId" widget-style="buttontext">
+            <hyperlink target="/ordermgr/control/orderview?orderId=${orderId}" also-hidden="false" description="${orderId}" target-type="inter-app"/>            
+        </field>
+        <field name="orderItemSeqId"><display/></field>
+        <field name="deleteLink" title="" widget-style="buttontext">
+            <hyperlink target="deleteFixedAssetMaintOrder?fixedAssetId=${fixedAssetId}&amp;maintHistSeqId=${maintHistSeqId}&amp;orderId=${orderId}&amp;orderItemSeqId=${orderItemSeqId}"
+                description="${uiLabelMap.CommonRemove}" also-hidden="false"/>
+        </field>
+    </form>
+    <!-- create and update a Order on a fixed asset -->
+    <form name="AddFixedAssetMaintOrder" type="single"
+            target="createFixedAssetMaintOrder" title="" default-map-name="fixedAssetMaintOrder"
+            default-title-style="tableheadtext" default-widget-style="inputBox" default-tooltip-style="tabletext">        
+        <auto-fields-service service-name="createFixedAssetMaintOrder" map-name="fixedAssetMaintOrder"/>
+        <field name="fixedAssetId"><hidden/></field>
+        <field name="maintHistSeqId"><hidden/></field>
+        <field name="orderId"><lookup target-form-name="LookupOrderHeader"/></field>
+        <field name="orderItemSeqId"><text size="20" /></field>
+        <field name="submitButton" title="${uiLabelMap.CommonAdd}" widget-style="smallSubmit"><submit button-type="button"/></field>
+    </form>
+        
 </forms>

Modified: ofbiz/trunk/applications/accounting/widget/FixedAssetScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/widget/FixedAssetScreens.xml?view=diff&rev=498756&r1=498755&r2=498756
==============================================================================
--- ofbiz/trunk/applications/accounting/widget/FixedAssetScreens.xml (original)
+++ ofbiz/trunk/applications/accounting/widget/FixedAssetScreens.xml Mon Jan 22 11:24:43 2007
@@ -284,4 +284,29 @@
             </widgets>
         </section>
     </screen>
+    <!-- Fixed Asset Maint Order -->
+    <screen name="EditFixedAssetMaintOrders">
+        <section>
+            <actions>
+                <set field="titleProperty" value="PageTitleEditFixedAssetMaintenance"/>
+                <set field="tabButtonItem" value="ListFixedAssetMaints"/>                
+                <set field="labelTitleProperty" value="PageTitleEditFixedAssetMaintenance"/>
+                <set field="fixedAssetId" from-field="parameters.fixedAssetId"/>
+                <set field="maintHistSeqId" from-field="parameters.maintHistSeqId"/>
+                <set field="orderId" from-field="parameters.orderId"/>
+                <set field="orderItemSeqId" from-field="parameters.orderItemSeqId"/>
+                <entity-one entity-name="FixedAsset" value-name="fixedAsset"/>
+                <entity-one entity-name="FixedAssetMaint" value-name="fixedAssetMaint"/>
+                <entity-one entity-name="FixedAssetMaintOrder" value-name="fixedAssetMaintOrder"/>
+            </actions>
+            <widgets>
+                <decorator-screen name="CommonFixedAssetMaintDecorator" location="${parameters.mainDecoratorLocation}">
+                    <decorator-section name="body">
+                        <include-form name="ListFixedAssetMaintOrders" location="component://accounting/webapp/accounting/fixedasset/FixedAssetForms.xml"/>
+                        <include-form name="AddFixedAssetMaintOrder" location="component://accounting/webapp/accounting/fixedasset/FixedAssetForms.xml"/>
+                    </decorator-section>
+                </decorator-screen>
+            </widgets>
+        </section>
+    </screen>
 </screens>

Modified: ofbiz/trunk/applications/accounting/widget/Menus.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/widget/Menus.xml?view=diff&rev=498756&r1=498755&r2=498756
==============================================================================
--- ofbiz/trunk/applications/accounting/widget/Menus.xml (original)
+++ ofbiz/trunk/applications/accounting/widget/Menus.xml Mon Jan 22 11:24:43 2007
@@ -337,6 +337,9 @@
         <menu-item name="editFixedAssetMeter" title="${uiLabelMap.AccountingFixedAssetMaintMeters}">
             <link target="EditFixedAssetMaintMeters?fixedAssetId=${fixedAssetMaint.fixedAssetId}&amp;maintHistSeqId=${fixedAssetMaint.maintHistSeqId}"/>
         </menu-item>
+        <menu-item name="EditFixedAssetMaintOrders" title="${uiLabelMap.AccountingFixedAssetMaintOrders}">
+            <link target="EditFixedAssetMaintOrders?fixedAssetId=${fixedAssetMaint.fixedAssetId}&amp;maintHistSeqId=${fixedAssetMaint.maintHistSeqId}"/>
+        </menu-item>
     </menu>  
     <menu name="FixedAssetTabBar" default-menu-item-name="EditFixedAsset" default-selected-style="tabButtonSelected"
         default-title-style="tabButton" default-tooltip-style="tabletext" default-widget-style="tabButton"