svn commit: r1413810 - in /ofbiz/trunk/applications: accounting/config/ accounting/script/org/ofbiz/accounting/agreement/ accounting/servicedef/ accounting/webapp/accounting/WEB-INF/ accounting/webapp/accounting/agreement/ accounting/widget/ party/enti...

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

svn commit: r1413810 - in /ofbiz/trunk/applications: accounting/config/ accounting/script/org/ofbiz/accounting/agreement/ accounting/servicedef/ accounting/webapp/accounting/WEB-INF/ accounting/webapp/accounting/agreement/ accounting/widget/ party/enti...

doogie-3
Author: doogie
Date: Mon Nov 26 20:09:17 2012
New Revision: 1413810

URL: http://svn.apache.org/viewvc?rev=1413810&view=rev
Log:
Add AgreementFacilityAppl entity and screens.  There is no code that
deals with the data yet, however.  This is modeled after
AgreementProductAppl minus the price.

Modified:
    ofbiz/trunk/applications/accounting/config/AccountingUiLabels.xml
    ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/agreement/AgreementServices.xml
    ofbiz/trunk/applications/accounting/servicedef/services_agreement.xml
    ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/controller.xml
    ofbiz/trunk/applications/accounting/webapp/accounting/agreement/CopyAgreement.ftl
    ofbiz/trunk/applications/accounting/widget/AccountingMenus.xml
    ofbiz/trunk/applications/accounting/widget/AgreementForms.xml
    ofbiz/trunk/applications/accounting/widget/AgreementScreens.xml
    ofbiz/trunk/applications/party/entitydef/entitymodel.xml
    ofbiz/trunk/applications/product/config/ProductUiLabels.xml
    ofbiz/trunk/applications/product/webapp/facility/WEB-INF/controller.xml
    ofbiz/trunk/applications/product/widget/facility/FacilityForms.xml
    ofbiz/trunk/applications/product/widget/facility/FacilityMenus.xml
    ofbiz/trunk/applications/product/widget/facility/FacilityScreens.xml

Modified: ofbiz/trunk/applications/accounting/config/AccountingUiLabels.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/config/AccountingUiLabels.xml?rev=1413810&r1=1413809&r2=1413810&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/config/AccountingUiLabels.xml (original)
+++ ofbiz/trunk/applications/accounting/config/AccountingUiLabels.xml Mon Nov 26 20:09:17 2012
@@ -755,6 +755,9 @@
         <value xml:lang="zh">用于报表的合同条款产品</value>
         <value xml:lang="zh_TW">用于報表的合同條款產品</value>
     </property>
+    <property key="AccountingAgreementItemFacilitiesForReport">
+        <value xml:lang="en">Agreement Item Facilities For Report</value>
+    </property>
     <property key="AccountingAgreementItemSeqId">
         <value xml:lang="ar">رمز التسلسلي لبند إتفاق</value>
         <value xml:lang="de">Vereinbarungs-Positions-Nr.</value>
@@ -19989,6 +19992,9 @@
         <value xml:lang="zh">编辑合同条款条件</value>
         <value xml:lang="zh_TW">修改合同條款條件</value>
     </property>
+    <property key="PageTitleEditAgreementItemFacility">
+        <value xml:lang="en">Edit Agreement Item Facility</value>
+    </property>
     <property key="PageTitleEditAgreementPromoAppl">
         <value xml:lang="en">Edit Agreement Promo Appl</value>
         <value xml:lang="fr">Modifier l'application de la promotion d'accord commercial</value>
@@ -20901,6 +20907,9 @@
         <value xml:lang="zh">列出合同条款条件</value>
         <value xml:lang="zh_TW">列出合同條款條件</value>
     </property>
+    <property key="PageTitleListAgreementItemFacilities">
+        <value xml:lang="en">List Agreement Item Facilities</value>
+    </property>
     <property key="PageTitleListAgreementItems">
         <value xml:lang="en">List Agreement Items</value>
         <value xml:lang="es">Lista Elementos de Acuerdo</value>

Modified: ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/agreement/AgreementServices.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/agreement/AgreementServices.xml?rev=1413810&r1=1413809&r2=1413810&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/agreement/AgreementServices.xml (original)
+++ ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/agreement/AgreementServices.xml Mon Nov 26 20:09:17 2012
@@ -99,6 +99,15 @@ under the License.
                 <call-service service-name="createAgreementProductAppl" in-map-name="createAgreementProductApplInMap"/>
             </iterate>
         </if-compare>
+        <if-compare field="parameters.copyAgreementFacilities" value="Y" operator="equals">
+            <get-related value-field="agreement" relation-name="AgreementFaclityAppl" list="agreementFaclityAppls"/>
+            <iterate list="agreementFaclityAppls" entry="agreementFaclityAppl">
+                <clear-field field="createAgreementFaclityApplInMap"/>
+                <set-service-fields service-name="createAgreementFaclityAppl" to-map="createAgreementFaclityApplInMap" map="agreementFaclityAppl"/>
+                <set from-field="agreementIdTo" field="createAgreementFaclityApplInMap.agreementId"/>
+                <call-service service-name="createAgreementFaclityAppl" in-map-name="createAgreementFaclityApplInMap"/>
+            </iterate>
+        </if-compare>
         <if-compare field="parameters.copyAgreementParties" value="Y" operator="equals">
             <get-related value-field="agreement" relation-name="AgreementPartyApplic" list="agreementPartyApplic"/>
             <iterate list="agreementPartyApplics" entry="agreementPartyApplic">

Modified: ofbiz/trunk/applications/accounting/servicedef/services_agreement.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/servicedef/services_agreement.xml?rev=1413810&r1=1413809&r2=1413810&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/servicedef/services_agreement.xml (original)
+++ ofbiz/trunk/applications/accounting/servicedef/services_agreement.xml Mon Nov 26 20:09:17 2012
@@ -53,6 +53,7 @@ under the License.
         <attribute name="copyAgreementTerms" type="String" mode="IN" optional="true"/>
         <attribute name="copyAgreementProducts" type="String" mode="IN" optional="true"/>
         <attribute name="copyAgreementParties" type="String" mode="IN" optional="true"/>
+        <attribute name="copyAgreementFacilities" type="String" mode="IN" optional="true"/>
     </service>
 
     <!-- AgreementItem  -->
@@ -147,6 +148,26 @@ under the License.
         <auto-attributes include="nonpk" mode="IN" optional="true"/>
     </service>
 
+    <!-- AgreementFacilityAppl  -->
+    <service name="createAgreementFacilityAppl" default-entity-name="AgreementFacilityAppl" engine="entity-auto" invoke="create" auth="true">
+        <description>Create an AgreementFacilityAppl</description>
+        <permission-service service-name="acctgAgreementPermissionCheck" main-action="CREATE"/>
+        <auto-attributes include="pk" mode="IN" optional="false"/>
+        <auto-attributes include="nonpk" mode="IN" optional="true"/>
+    </service>
+    <service name="updateAgreementFacilityAppl" default-entity-name="AgreementFacilityAppl" engine="entity-auto" invoke="update" auth="true">
+        <description>Update an AgreementFacilityAppl</description>
+        <permission-service service-name="acctgAgreementPermissionCheck" main-action="UPDATE"/>
+        <auto-attributes include="pk" mode="IN" optional="false"/>
+        <auto-attributes include="nonpk" mode="IN" optional="true"/>
+    </service>
+    <service name="removeAgreementFacilityAppl" default-entity-name="AgreementFacilityAppl" engine="entity-auto" invoke="delete" auth="true">
+        <description>Remove an AgreementFacilityAppl</description>
+        <permission-service service-name="acctgAgreementPermissionCheck" main-action="UPDATE"/>
+        <auto-attributes include="pk" mode="IN" optional="false"/>
+        <auto-attributes include="nonpk" mode="IN" optional="true"/>
+    </service>
+
     <!-- AgreementPartyApplic  -->
     <service name="createAgreementPartyApplic" default-entity-name="AgreementPartyApplic" engine="simple"
                 location="component://accounting/script/org/ofbiz/accounting/agreement/AgreementServices.xml" invoke="createAgreementPartyApplic" auth="true">

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?rev=1413810&r1=1413809&r2=1413810&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/controller.xml (original)
+++ ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/controller.xml Mon Nov 26 20:09:17 2012
@@ -1264,6 +1264,29 @@ under the License.
         <response name="error" type="view" value="EditAgreementItemProduct"/>
     </request-map>
 
+    <request-map uri="ListAgreementItemFacilities"><security https="true" auth="true"/><response name="success" type="view" value="ListAgreementItemFacilities"/></request-map>
+    <request-map uri="ListAgreementItemFacilitiesReport"><security https="true" auth="true"/><response name="success" type="view" value="ListAgreementItemFacilitiesReport"/></request-map>
+    <request-map uri="removeAgreementItemFacility">
+        <security https="true" auth="true"/>
+        <event type="service" invoke="removeAgreementFacilityAppl"/>
+        <response name="success" type="view" value="ListAgreementItemFacilities"/>
+        <response name="error" type="view" value="ListAgreementItemFacilities"/>
+    </request-map>
+
+    <request-map uri="EditAgreementItemFacility"><security https="true" auth="true"/><response name="success" type="view" value="EditAgreementItemFacility"/></request-map>
+    <request-map uri="createAgreementItemFacility">
+        <security https="true" auth="true"/>
+        <event type="service" invoke="createAgreementFacilityAppl"/>
+        <response name="success" type="view" value="ListAgreementItemFacilities"/>
+        <response name="error" type="view" value="EditAgreementItemFacility"/>
+    </request-map>
+    <request-map uri="updateAgreementItemFacility">
+        <security https="true" auth="true"/>
+        <event type="service" invoke="updateAgreementFacilityAppl"/>
+        <response name="success" type="view" value="ListAgreementItemFacilities"/>
+        <response name="error" type="view" value="EditAgreementItemFacility"/>
+    </request-map>
+
     <request-map uri="ListAgreementItemSupplierProducts"><security https="true" auth="true"/><response name="success" type="view" value="ListAgreementItemSupplierProducts"/></request-map>
     <request-map uri="ListAgreementItemSupplierProductsReport"><security https="true" auth="true"/><response name="success" type="view" value="ListAgreementItemSupplierProductsReport"/></request-map>
     <request-map uri="removeAgreementItemSupplierProduct">
@@ -2704,6 +2727,9 @@ under the License.
     <view-map name="ListAgreementGeographicalApplic" type="screen" page="component://accounting/widget/AgreementScreens.xml#ListAgreementGeographicalApplic"/>
     <view-map name="EditAgreementGeographicalApplic" type="screen" page="component://accounting/widget/AgreementScreens.xml#EditAgreementGeographicalApplic"/>
     <view-map name="EditAgreementWorkEffortApplics" type="screen" page="component://accounting/widget/AgreementScreens.xml#EditAgreementWorkEffortApplics"/>
+    <view-map name="ListAgreementItemFacilities" type="screen" page="component://accounting/widget/AgreementScreens.xml#ListAgreementItemFacilities"/>
+    <view-map name="EditAgreementItemFacility" type="screen" page="component://accounting/widget/AgreementScreens.xml#EditAgreementItemFacility"/>
+    <view-map name="ListAgreementItemFacilitiesReport" type="screenfop" page="component://accounting/widget/AgreementScreens.xml#ListAgreementItemFacilitiesReport" content-type="application/pdf" encoding="none"/>
 
     <!-- TaxAuthority -->
     <view-map name="FindTaxAuthority" type="screen" page="component://accounting/widget/TaxAuthorityScreens.xml#FindTaxAuthority"/>

Modified: ofbiz/trunk/applications/accounting/webapp/accounting/agreement/CopyAgreement.ftl
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/webapp/accounting/agreement/CopyAgreement.ftl?rev=1413810&r1=1413809&r2=1413810&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/webapp/accounting/agreement/CopyAgreement.ftl (original)
+++ ofbiz/trunk/applications/accounting/webapp/accounting/agreement/CopyAgreement.ftl Mon Nov 26 20:09:17 2012
@@ -32,6 +32,7 @@ under the License.
             ${uiLabelMap.AccountingAgreementTerms}&nbsp;<input type="checkbox" name="copyAgreementTerms" value="Y" checked="checked" />
             ${uiLabelMap.ProductProducts}&nbsp;<input type="checkbox" name="copyAgreementProducts" value="Y" checked="checked" />
             ${uiLabelMap.Party}&nbsp;<input type="checkbox" name="copyAgreementParties" value="Y" checked="checked" />
+            ${uiLabelMap.ProductFacilities}&nbsp;<input type="checkbox" name="copyAgreementFacilities" value="Y" checked="checked" />
         </div>
         <div class="button-bar">
             <input type="submit" value="${uiLabelMap.CommonCopy}"/>

Modified: ofbiz/trunk/applications/accounting/widget/AccountingMenus.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/widget/AccountingMenus.xml?rev=1413810&r1=1413809&r2=1413810&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/widget/AccountingMenus.xml (original)
+++ ofbiz/trunk/applications/accounting/widget/AccountingMenus.xml Mon Nov 26 20:09:17 2012
@@ -1102,6 +1102,16 @@ under the License.
                 <parameter param-name="agreementItemSeqId" from-field="agreementItem.agreementItemSeqId"/>
             </link>
         </menu-item>
+
+        <menu-item name="ListAgreementItemFacility" title="${uiLabelMap.ProductFacilities}">
+            <condition>
+                <if-compare field="agreement.agreementTypeId" operator="not-equals" value="PURCHASE_AGREEMENT"/>
+            </condition>
+            <link target="ListAgreementItemFacilities">
+                <parameter param-name="agreementId" from-field="agreementItem.agreementId"/>
+                <parameter param-name="agreementItemSeqId" from-field="agreementItem.agreementItemSeqId"/>
+            </link>
+        </menu-item>
     </menu>
 
     <menu name="BillingAccountTabBar" extends="CommonTabBarMenu" extends-resource="component://common/widget/CommonMenus.xml">

Modified: ofbiz/trunk/applications/accounting/widget/AgreementForms.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/widget/AgreementForms.xml?rev=1413810&r1=1413809&r2=1413810&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/widget/AgreementForms.xml (original)
+++ ofbiz/trunk/applications/accounting/widget/AgreementForms.xml Mon Nov 26 20:09:17 2012
@@ -307,6 +307,29 @@ under the License.
             </hyperlink>
         </field>
     </form>
+    <form name="ListAgreementItemFacilities" list-name="agreementFacilities" target="" title="" type="list" paginate-target="ListAgreementItemFacilities"
+        odd-row-style="alternate-row" default-table-style="basic-table hover-bar">
+        <auto-fields-entity entity-name="AgreementFacilityAppl" default-field-type="display"/>
+        <field name="agreementId" title="${uiLabelMap.AccountingAgreementId}"><hidden/></field>
+        <field name="agreementItemSeqId" title="${uiLabelMap.AccountingAgreementItemSeqId}"><hidden/></field>
+        <field name="facilityId" title="${uiLabelMap.CommonEdit}" widget-style="buttontext">
+           <hyperlink also-hidden="false" description="${facilityId}" target="EditAgreementItemFacility">
+                <parameter param-name="facilityId"/>
+                <parameter param-name="agreementId"/>
+                <parameter param-name="agreementItemSeqId"/>
+            </hyperlink>
+        </field>
+        <field name="internalName" entry-name="facilityId">
+            <display-entity entity-name="Facility" key-field-name="facilityId" description="${internalName}"/>
+        </field>
+        <field name="deleteLink" title=" " widget-style="buttontext">
+            <hyperlink target="removeAgreementItemFacility" description="${uiLabelMap.CommonRemove}" also-hidden="false">
+                <parameter param-name="facilityId"/>
+                <parameter param-name="agreementId"/>
+                <parameter param-name="agreementItemSeqId"/>
+            </hyperlink>
+        </field>
+    </form>
     <form name="ListAgreementItemSupplierProducts" list-name="agreementProducts" target="" title="" type="list" paginate-target="ListAgreementItemSupplierProducts"
         odd-row-style="alternate-row" default-table-style="basic-table hover-bar">
         <auto-fields-entity entity-name="SupplierProduct" default-field-type="display"/>
@@ -389,6 +412,20 @@ under the License.
             <submit button-type="button"/>
         </field>
     </form>
+    <form name="EditAgreementItemFacility" type="single" target="updateAgreementItemFacility" title="" default-map-name="agreementFacilityAppl"
+        header-row-style="header-row" default-table-style="basic-table">
+        <alt-target use-when="agreementFacilityAppl==null" target="createAgreementItemFacility"/>
+        <auto-fields-entity entity-name="AgreementFacilityAppl" default-field-type="edit"/>
+        <field name="agreementId"><hidden/></field>
+        <field name="agreementItemSeqId"><hidden/></field>
+        <field name="facilityId" use-when="agreementFacilityAppl==null">
+            <lookup target-form-name="LookupFacility"/>
+        </field>
+        <field name="facilityId" use-when="agreementFacilityAppl!=null"><display/></field>
+        <field name="submitButton" title="${uiLabelMap.CommonSubmit}" widget-style="smallSubmit">
+            <submit button-type="button"/>
+        </field>
+    </form>
     <form name="EditAgreementItemSupplierProduct" type="single" target="updateAgreementItemSupplierProduct" title="" default-map-name="agreementProductAppl"
         header-row-style="header-row" default-table-style="basic-table">
         <alt-target use-when="agreementProductAppl==null" target="createAgreementItemSupplierProduct"/>

Modified: ofbiz/trunk/applications/accounting/widget/AgreementScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/widget/AgreementScreens.xml?rev=1413810&r1=1413809&r2=1413810&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/widget/AgreementScreens.xml (original)
+++ ofbiz/trunk/applications/accounting/widget/AgreementScreens.xml Mon Nov 26 20:09:17 2012
@@ -392,6 +392,42 @@ under the License.
         </section>
     </screen>
 
+    <screen name="ListAgreementItemFacilities">
+        <section>
+            <actions>
+                <set field="titleProperty" value="PageTitleListAgreementItemFacilities"/>
+                <set field="tabButtonItem" value="AgreementItems"/>
+                <set field="buttonBarItem" value="ListAgreementItemFacilities"/>
+                <entity-one entity-name="Agreement" value-field="agreement" auto-field-map="true"/>
+                <entity-one entity-name="AgreementItem" value-field="agreementItem"/>
+                <entity-and entity-name="AgreementFacilityAppl" list="agreementFacilities">
+                    <field-map from-field="agreement.agreementId" field-name="agreementId"/>
+                    <field-map from-field="agreementItem.agreementItemSeqId" field-name="agreementItemSeqId"/>
+                    <order-by field-name="facilityId"/>
+                </entity-and>
+            </actions>
+            <widgets>
+                <decorator-screen name="CommonAgreementDecorator" location="${parameters.agreementDecoratorLocation}">
+                    <decorator-section name="body">
+                        <container>
+                            <link target="EditAgreementItemFacility" text="${uiLabelMap.ProductNewFacility}" style="buttontext">
+                                <parameter param-name="agreementId" from-field="agreement.agreementId"/>
+                                <parameter param-name="agreementItemSeqId" from-field="agreementItem.agreementItemSeqId"/>
+                            </link>
+                            <link target="ListAgreementItemFacilitiesReport" text="${uiLabelMap.CommonPrint}" style="buttontext">
+                                <parameter param-name="agreementId" from-field="agreement.agreementId"/>
+                                <parameter param-name="agreementItemSeqId" from-field="agreementItem.agreementItemSeqId"/>
+                            </link>
+                        </container>
+                        <screenlet title="${uiLabelMap.PageTitleListAgreementItemFacilities}">
+                            <include-form name="ListAgreementItemFacilities" location="component://accounting/widget/AgreementForms.xml"/>
+                        </screenlet>
+                    </decorator-section>
+                </decorator-screen>
+            </widgets>
+        </section>
+    </screen>
+
     <screen name="ListAgreementItemProductsReport">
         <section>
             <actions>
@@ -425,6 +461,39 @@ under the License.
         </section>
     </screen>
 
+    <screen name="ListAgreementItemFacilitiesReport">
+        <section>
+            <actions>
+                <set field="titleProperty" value="AccountingPageTitleAgreementPriceList"/>
+                <property-map resource="AccountingUiLabels" map-name="uiLabelMap" global="true"/>
+                <property-map resource="ProductUiLabels" map-name="uiLabelMap" global="true"/>
+
+                <entity-one entity-name="Agreement" value-field="agreement" auto-field-map="true"/>
+                <entity-one entity-name="AgreementItem" value-field="agreementItem"/>
+                <entity-and entity-name="AgreementFacilityAppl" list="agreementFacilities">
+                    <field-map from-field="agreement.agreementId" field-name="agreementId"/>
+                    <field-map from-field="agreementItem.agreementItemSeqId" field-name="agreementItemSeqId"/>
+                    <order-by field-name="facilityId"/>
+                </entity-and>
+            </actions>
+            <widgets>
+                <decorator-screen name="SimpleDecorator" location="component://common/widget/CommonScreens.xml">
+                    <decorator-section name="body">
+                        <screenlet title="${uiLabelMap.AccountingAgreement}">
+                            <include-form name="ViewAgreementInfoForReport" location="component://accounting/widget/AgreementForms.xml"/>
+                        </screenlet>
+                        <screenlet title="${uiLabelMap.AccountingAgreementItem}">
+                            <include-form name="ViewAgreementItemInfoForReport" location="component://accounting/widget/AgreementForms.xml"/>
+                        </screenlet>
+                        <screenlet title="${uiLabelMap.AccountingAgreementItemFacilitiesForReport}">
+                            <include-form name="ListAgreementItemFacilitiesForReport" location="component://accounting/widget/AgreementForms.xml"/>
+                        </screenlet>
+                    </decorator-section>
+                </decorator-screen>
+            </widgets>
+        </section>
+    </screen>
+
     <screen name="EditAgreementItemProduct">
         <section>
             <actions>
@@ -457,6 +526,38 @@ under the License.
         </section>
     </screen>
 
+    <screen name="EditAgreementItemFacility">
+        <section>
+            <actions>
+                <set field="titleProperty" value="PageTitleEditAgreementItemFacility"/>
+                <set field="tabButtonItem" value="AgreementItems"/>
+
+                <set field="agreementId" from-field="parameters.agreementId"/>
+                <set field="agreementItemSeqId" from-field="parameters.agreementItemSeqId"/>
+                <set field="facilityId" from-field="parameters.facilityId"/>
+
+                <entity-one entity-name="Agreement" value-field="agreement" auto-field-map="true"/>
+                <entity-one entity-name="AgreementItem" value-field="agreementItem"/>
+                <entity-one entity-name="AgreementFacilityAppl" value-field="agreementFacilityAppl" auto-field-map="true"/>
+            </actions>
+            <widgets>
+                <decorator-screen name="CommonAgreementDecorator" location="${parameters.agreementDecoratorLocation}">
+                    <decorator-section name="body">
+                        <container>
+                            <link target="EditAgreementItemFacility" text="${uiLabelMap.ProductNewFacility}" style="buttontext">
+                                <parameter param-name="agreementId" from-field="agreement.agreementId"/>
+                                <parameter param-name="agreementItemSeqId" from-field="agreementItem.agreementItemSeqId"/>
+                            </link>
+                        </container>
+                        <screenlet title="${uiLabelMap.PageTitleEditAgreementItemFacility}">
+                            <include-form name="EditAgreementItemFacility" location="component://accounting/widget/AgreementForms.xml"/>
+                        </screenlet>
+                    </decorator-section>
+                </decorator-screen>
+            </widgets>
+        </section>
+    </screen>
+
     <screen name="ListAgreementItemSupplierProducts">
         <section>
             <actions>

Modified: ofbiz/trunk/applications/party/entitydef/entitymodel.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/party/entitydef/entitymodel.xml?rev=1413810&r1=1413809&r2=1413810&view=diff
==============================================================================
--- ofbiz/trunk/applications/party/entitydef/entitymodel.xml (original)
+++ ofbiz/trunk/applications/party/entitydef/entitymodel.xml Mon Nov 26 20:09:17 2012
@@ -281,6 +281,26 @@ under the License.
         <key-map field-name="agreementItemSeqId"/>
       </relation>
     </entity>
+    <entity entity-name="AgreementFacilityAppl"
+            package-name="org.ofbiz.party.agreement"
+            title="Agreement Facility Application Entity">
+      <field name="agreementId" type="id-ne"></field>
+      <field name="agreementItemSeqId" type="id-ne"></field>
+      <field name="facilityId" type="id-ne"></field>
+      <prim-key field="agreementId"/>
+      <prim-key field="agreementItemSeqId"/>
+      <prim-key field="faciliyId"/>
+      <relation type="one-nofk" rel-entity-name="Agreement">
+        <key-map field-name="agreementId"/>
+      </relation>
+      <relation type="one" fk-name="AGRMNT_FACLT_AITM" rel-entity-name="AgreementItem">
+        <key-map field-name="agreementId"/>
+        <key-map field-name="agreementItemSeqId"/>
+      </relation>
+      <relation type="one" fk-name="AGRMNT_FACLT_PRD" rel-entity-name="Facility">
+        <key-map field-name="faciliyId"/>
+      </relation>
+    </entity>
     <entity entity-name="AgreementRole"
             package-name="org.ofbiz.party.agreement"
             title="Agreement Role Entity">
@@ -501,6 +521,26 @@ under the License.
             <key-map field-name="agreementId"/>
         </relation>
     </view-entity>
+    <view-entity entity-name="AgreementItemAndFacilityAppl"
+        package-name="org.ofbiz.party.agreement"
+        title="Agreement Item and Agreement Facility Applicability View Entity">
+        <member-entity entity-alias="AGI" entity-name="AgreementItem"/>
+        <member-entity entity-alias="AGFA" entity-name="AgreementFacilityAppl"/>
+        <member-entity entity-alias="AG" entity-name="Agreement"/>
+        <alias-all entity-alias="AGI"/>
+        <alias-all entity-alias="AGFA"/>
+        <alias-all entity-alias="AG"/>
+        <view-link entity-alias="AGI" rel-entity-alias="AGFA">
+            <key-map field-name="agreementId"/>
+            <key-map field-name="agreementItemSeqId"/>
+        </view-link>
+        <view-link entity-alias="AGI" rel-entity-alias="AG">
+            <key-map field-name="agreementId"/>
+        </view-link>
+        <relation type="one-nofk" rel-entity-name="Agreement">
+            <key-map field-name="agreementId"/>
+        </relation>
+    </view-entity>
     <view-entity entity-name="AgreementItemAndPartyAppl"
         package-name="org.ofbiz.party.agreement"
         title="Agreement Item and Agreement Party Applicability View Entity">

Modified: ofbiz/trunk/applications/product/config/ProductUiLabels.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/config/ProductUiLabels.xml?rev=1413810&r1=1413809&r2=1413810&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/config/ProductUiLabels.xml (original)
+++ ofbiz/trunk/applications/product/config/ProductUiLabels.xml Mon Nov 26 20:09:17 2012
@@ -10287,6 +10287,9 @@
         <value xml:lang="zh">浏览产品合同</value>
         <value xml:lang="zh_TW">檢示產品合約</value>
     </property>
+    <property key="PageTitleViewFacilityAgreements">
+        <value xml:lang="en">View Facility Agreements</value>
+    </property>
     <property key="PageTitleViewProductManufacturing">
         <value xml:lang="de">Produkt Fertigung anzeigen</value>
         <value xml:lang="en">View Product Manufacturing</value>
@@ -11502,6 +11505,9 @@
         <value xml:lang="zh">产品综合价格</value>
         <value xml:lang="zh_TW">產品綜合價格</value>
     </property>
+    <property key="FacilityAgreements">
+        <value xml:lang="en">Agreements</value>
+    </property>
     <property key="ProductAgreements">
         <value xml:lang="de">Vereinbarungen</value>
         <value xml:lang="en">Agreements</value>

Modified: ofbiz/trunk/applications/product/webapp/facility/WEB-INF/controller.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/webapp/facility/WEB-INF/controller.xml?rev=1413810&r1=1413809&r2=1413810&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/webapp/facility/WEB-INF/controller.xml (original)
+++ ofbiz/trunk/applications/product/webapp/facility/WEB-INF/controller.xml Mon Nov 26 20:09:17 2012
@@ -1324,6 +1324,11 @@ under the License.
         <response name="error" type="request" value="json"/>
     </request-map>
 
+    <request-map uri="EditFacilityAgreements">
+        <security https="true" auth="true"/>
+        <response name="success" type="view" value="EditFacilityAgreements"/>
+    </request-map>
+
     <!-- ================ Lookup Requests ================= -->
     <request-map uri="LookupOrderHeaderAndShipInfo"><security https="true" auth="true"/><response name="success" type="view" value="LookupOrderHeaderAndShipInfo"/></request-map>
     <request-map uri="LookupPurchaseOrderHeaderAndShipInfo"><security https="true" auth="true"/><response name="success" type="view" value="LookupPurchaseOrderHeaderAndShipInfo"/></request-map>
@@ -1445,5 +1450,6 @@ under the License.
     <view-map name="FindShipmentGatewayConfigTypes" page="component://product//widget/facility/ShipmentGatewayConfigScreens.xml#FindShipmentGatewayConfigTypes" type="screen"/>
     <view-map name="EditShipmentGatewayConfigType" page="component://product//widget/facility/ShipmentGatewayConfigScreens.xml#EditShipmentGatewayConfigType" type="screen"/>
 
+    <view-map name="EditFacilityAgreements" type="screen" page="component://product/widget/facility/FacilityScreens.xml#EditFacilityAgreements"/>
     <!-- end of view mappings -->
 </site-conf>

Modified: ofbiz/trunk/applications/product/widget/facility/FacilityForms.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/widget/facility/FacilityForms.xml?rev=1413810&r1=1413809&r2=1413810&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/widget/facility/FacilityForms.xml (original)
+++ ofbiz/trunk/applications/product/widget/facility/FacilityForms.xml Mon Nov 26 20:09:17 2012
@@ -928,4 +928,19 @@ under the License.
         <field name="information"><text size="50" maxlength="60"/></field>
         <field name="selectButton" title="${uiLabelMap.CommonSubmit}"><submit button-type="button"/></field>
     </form>
+
+    <form name="ListFacilityAgreements" type="list" list-name="facilityAgreements"
+        odd-row-style="alternate-row" default-table-style="basic-table">
+        <field name="agreementId" widget-style="buttontext">
+            <hyperlink target="/accounting/control/EditAgreementItemFacility" target-type="inter-app" description="${agreementId}/${agreementItemSeqId}" also-hidden="false">
+                <parameter param-name="agreementId"/>
+                <parameter param-name="agreementItemSeqId"/>
+                <parameter param-name="faclityId"/>
+            </hyperlink>
+        </field>
+        <field name="agreementText"><display/></field>
+        <field name="description"><display/></field>
+        <field name="fromDate"><display/></field>
+        <field name="thruDate"><display/></field>
+    </form>
 </forms>

Modified: ofbiz/trunk/applications/product/widget/facility/FacilityMenus.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/widget/facility/FacilityMenus.xml?rev=1413810&r1=1413809&r2=1413810&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/widget/facility/FacilityMenus.xml (original)
+++ ofbiz/trunk/applications/product/widget/facility/FacilityMenus.xml Mon Nov 26 20:09:17 2012
@@ -161,6 +161,11 @@ under the License.
                 <parameter param-name="facilityId"/>
             </link>
         </menu-item>
+        <menu-item name="EditFacilityAgreements" title="${uiLabelMap.PageTitleEditAgreement}">
+            <link target="EditFacilityAgreements">
+                <parameter param-name="facilityId"/>
+            </link>
+        </menu-item>
     </menu>
     <menu name="InventoryItemLabelsTabBar" extends="CommonTabBarMenu" extends-resource="component://common/widget/CommonMenus.xml"
           default-menu-item-name="FindInventoryItemLabels">

Modified: ofbiz/trunk/applications/product/widget/facility/FacilityScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/widget/facility/FacilityScreens.xml?rev=1413810&r1=1413809&r2=1413810&view=diff
==============================================================================
--- ofbiz/trunk/applications/product/widget/facility/FacilityScreens.xml (original)
+++ ofbiz/trunk/applications/product/widget/facility/FacilityScreens.xml Mon Nov 26 20:09:17 2012
@@ -1534,4 +1534,36 @@ under the License.
             </widgets>
         </section>
     </screen>    
+
+    <screen name="EditFacilityAgreements">
+        <section>
+            <actions>
+                <property-map resource="AccountingUiLabels" map-name="uiLabelMap"/>
+                <set field="titleProperty" value="PageTitleViewFacilityAgreements"/>
+                <set field="tabButtonItem" value="EditFacilityAgreements"/>
+                <set field="labelTitleProperty" value="FacilityAgreements"/>
+
+                <set field="facilityId" from-field="parameters.facilityId"/>
+                <entity-and entity-name="AgreementItemAndFacilityAppl" list="facilityAgreements">
+                    <field-map field-name="facilityId"/>
+                    <field-map field-name="agreementTypeId" value="FACILITY_AGREEMENT"/>
+                    <order-by field-name="fromDate"/>
+                </entity-and>
+            </actions>
+            <widgets>
+                <decorator-screen name="CommonFacilityDecorator" location="${parameters.commonFacilityDecoratorLocation}">
+                    <decorator-section name="body">
+                        <container>
+                            <link target="/accounting/control/EditAgreement" url-mode="inter-app" text="${uiLabelMap.PageTitleEditAgreement}" style="buttontext">
+                                <parameter param-name="facilityId"/>
+                            </link>
+                        </container>
+                        <screenlet title="${uiLabelMap.FacilityAgreements}">
+                            <include-form name="ListFacilityAgreements" location="component://product/widget/facility/FacilityForms.xml"/>
+                        </screenlet>
+                    </decorator-section>
+                </decorator-screen>
+            </widgets>
+        </section>
+    </screen>
 </screens>