Author: jacopoc
Date: Mon Jul 9 08:19:51 2007 New Revision: 554680 URL: http://svn.apache.org/viewvc?view=rev&rev=554680 Log: Added two new (non pk) fields to the SupplierProduct entity to associate supplier products to agreement items; created a new screen to manage them in the agreement item subscreens. Modified: ofbiz/trunk/applications/accounting/config/AccountingUiLabels.properties ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/controller.xml ofbiz/trunk/applications/accounting/webapp/accounting/agreement/AgreementForms.xml ofbiz/trunk/applications/accounting/webapp/accounting/agreement/AgreementTabBar.ftl ofbiz/trunk/applications/accounting/widget/AgreementScreens.xml ofbiz/trunk/applications/product/entitydef/entitymodel.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=554680&r1=554679&r2=554680 ============================================================================== --- ofbiz/trunk/applications/accounting/config/AccountingUiLabels.properties (original) +++ ofbiz/trunk/applications/accounting/config/AccountingUiLabels.properties Mon Jul 9 08:19:51 2007 @@ -53,6 +53,7 @@ AccountingAgreement=Agreement AccountingAgreementDate=Agreement Date AccountingAgreementId=Agreement Id +AccountingAgreementIsNotSetForSupplierProducts=Please set a supplier in Agreement.partyIdTo and a currency in the AgreementItem before editing the price list AccountingAgreementItemSeqId=Agreement Item Seq Id AccountingAgreementItem=Agreement Item AccountingAgreementItems=Agreement Items 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=554680&r1=554679&r2=554680 ============================================================================== --- ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/controller.xml (original) +++ ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/controller.xml Mon Jul 9 08:19:51 2007 @@ -901,6 +901,29 @@ <response name="error" type="view" value="EditAgreementItemProduct"/> </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"> + <security https="true" auth="true"/> + <event type="service" path="" invoke="removeSupplierProduct"/> + <response name="success" type="view" value="ListAgreementItemSupplierProducts"/> + <response name="error" type="view" value="ListAgreementItemSupplierProducts"/> + </request-map> + + <request-map uri="EditAgreementItemSupplierProduct"><security https="true" auth="true"/><response name="success" type="view" value="EditAgreementItemSupplierProduct"/></request-map> + <request-map uri="createAgreementItemSupplierProduct"> + <security https="true" auth="true"/> + <event type="service" path="" invoke="createSupplierProduct"/> + <response name="success" type="view" value="ListAgreementItemSupplierProducts"/> + <response name="error" type="view" value="EditAgreementItemSupplierProduct"/> + </request-map> + <request-map uri="updateAgreementItemSupplierProduct"> + <security https="true" auth="true"/> + <event type="service" path="" invoke="updateSupplierProduct"/> + <response name="success" type="view" value="ListAgreementItemSupplierProducts"/> + <response name="error" type="view" value="EditAgreementItemSupplierProduct"/> + </request-map> + <request-map uri="ListAgreementItemParties"><security https="true" auth="true"/><response name="success" type="view" value="ListAgreementItemParties"/></request-map> <request-map uri="removeAgreementItemParty"> <security https="true" auth="true"/> @@ -1460,6 +1483,9 @@ <view-map name="ListAgreementItemProducts" type="screen" page="component://accounting/widget/AgreementScreens.xml#ListAgreementItemProducts"/> <view-map name="ListAgreementItemProductsReport" type="screenfop" page="component://accounting/widget/AgreementScreens.xml#ListAgreementItemProductsReport" content-type="application/pdf" encoding="none"/> <view-map name="EditAgreementItemProduct" type="screen" page="component://accounting/widget/AgreementScreens.xml#EditAgreementItemProduct"/> + <view-map name="ListAgreementItemSupplierProducts" type="screen" page="component://accounting/widget/AgreementScreens.xml#ListAgreementItemSupplierProducts"/> + <view-map name="ListAgreementItemSupplierProductsReport" type="screenfop" page="component://accounting/widget/AgreementScreens.xml#ListAgreementItemSupplierProductsReport" content-type="application/pdf" encoding="none"/> + <view-map name="EditAgreementItemSupplierProduct" type="screen" page="component://accounting/widget/AgreementScreens.xml#EditAgreementItemSupplierProduct"/> <view-map name="ListAgreementItemParties" type="screen" page="component://accounting/widget/AgreementScreens.xml#ListAgreementItemParties"/> <view-map name="EditAgreementItemParty" type="screen" page="component://accounting/widget/AgreementScreens.xml#EditAgreementItemParty"/> <view-map name="ListAgreementGeographicalApplic" type="screen" page="component://accounting/widget/AgreementScreens.xml#ListAgreementGeographicalApplic"/> Modified: ofbiz/trunk/applications/accounting/webapp/accounting/agreement/AgreementForms.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/webapp/accounting/agreement/AgreementForms.xml?view=diff&rev=554680&r1=554679&r2=554680 ============================================================================== --- ofbiz/trunk/applications/accounting/webapp/accounting/agreement/AgreementForms.xml (original) +++ ofbiz/trunk/applications/accounting/webapp/accounting/agreement/AgreementForms.xml Mon Jul 9 08:19:51 2007 @@ -247,6 +247,24 @@ <hyperlink target="removeAgreementItemProduct?productId=${productId}&agreementId=${agreementId}&agreementItemSeqId=${agreementItemSeqId}" description="${uiLabelMap.CommonRemove}" also-hidden="false"/> </field> </form> + <form name="ListAgreementItemSupplierProducts" list-name="agreementProducts" target="" title="" type="list" paginate-target="ListAgreementItemSupplierProducts"> + <auto-fields-entity entity-name="SupplierProduct" default-field-type="display"/> + <field name="agreementId"><hidden/></field> + <field name="agreementItemSeqId"><hidden/></field> + <field name="partyId"><hidden/></field> + <field name="currencyUomId"><hidden/></field> + <field name="productId" title="${uiLabelMap.CommonEdit}" widget-style="buttontext"> + <hyperlink also-hidden="false" description="${productId}" target="EditAgreementItemSupplierProduct?minimumOrderQuantity=${minimumOrderQuantity}&currencyUomId=${currencyUomId}&availableFromDate=${availableFromDate}&partyId=${partyId}&productId=${productId}&agreementId=${agreementId}&agreementItemSeqId=${agreementItemSeqId}"/> + </field> + <field name="internalName" entry-name="productId"> + <display-entity entity-name="Product" key-field-name="productId" description="${internalName}"/> + </field> + <field name="lastPrice" widget-area-style="align-text"><display/></field> + <field name="deleteLink" title="${uiLabelMap.CommonEmptyHeader}" widget-style="buttontext"> + <hyperlink target="removeAgreementItemSupplierProduct?minimumOrderQuantity=${minimumOrderQuantity}&currencyUomId=${currencyUomId}&availableFromDate=${availableFromDate}&partyId=${partyId}&productId=${productId}&agreementId=${agreementId}&agreementItemSeqId=${agreementItemSeqId}" description="${uiLabelMap.CommonRemove}" also-hidden="false"/> + </field> + </form> + <form name="ViewAgreementInfoForReport" type="single" title="" default-map-name="agreement"> <field name="agreementId"><text/></field> <field name="partyIdFrom"><text/></field> @@ -268,6 +286,14 @@ </field> <field name="price" title-area-style="tableheadmedium" widget-area-style="tabletextright"><display/></field> </form> + <form name="ListAgreementItemSupplierProductsForReport" list-name="agreementProducts" target="" title="" type="list"> + <field name="productId" title-area-style="tableheadmedium"><display/></field> + <field name="supplierProductId" title-area-style="tableheadmedium"><display/></field> + <field name="internalName" entry-name="productId"> + <display-entity entity-name="Product" key-field-name="productId" description="${internalName}"/> + </field> + <field name="lastPrice" title-area-style="tableheadmedium" widget-area-style="tabletextright"><display/></field> + </form> <form name="EditAgreementItemProduct" type="single" target="updateAgreementItemProduct" title="" default-map-name="agreementProductAppl"> <alt-target use-when="agreementProductAppl==null" target="createAgreementItemProduct"/> <auto-fields-entity entity-name="AgreementProductAppl" default-field-type="edit"/> @@ -278,6 +304,57 @@ </field> <field name="productId" use-when="agreementProductAppl!=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"> + <alt-target use-when="agreementProductAppl==null" target="createAgreementItemSupplierProduct"/> + <auto-fields-entity entity-name="SupplierProduct" default-field-type="edit"/> + <field name="agreementId"><hidden/></field> + <field name="agreementItemSeqId"><hidden/></field> + <field name="partyId"><hidden value="${agreement.partyIdTo}"/></field> + <field name="currencyUomId"><hidden value="${agreementItem.currencyUomId}"/></field> + <field name="availableFromDate" use-when="agreementProductAppl==null"> + <!--<date-time default-value="${bsh: org.ofbiz.base.util.UtilDateTime.nowTimestamp()}"/>--> + <date-time default-value="${agreement.fromDate}"/> + </field> + <field name="availableFromDate" use-when="agreementProductAppl!=null"> + <display/> + </field> + <field name="minimumOrderQuantity" use-when="agreementProductAppl==null"> + <text default-value="0" size="5"/> + </field> + <field name="minimumOrderQuantity" use-when="agreementProductAppl!=null"> + <display/> + </field> + <field name="productId" use-when="agreementProductAppl==null"> + <lookup target-form-name="LookupProduct"/> + </field> + <field name="productId" use-when="agreementProductAppl!=null"><display/></field> + <field name="supplierPrefOrderId"> + <drop-down allow-empty="true"> + <entity-options entity-name="SupplierPrefOrder" key-field-name="supplierPrefOrderId" description="${description}"> + <entity-order-by field-name="supplierPrefOrderId"/> + </entity-options> + </drop-down> + </field> + <field name="supplierRatingTypeId"> + <drop-down allow-empty="true"> + <entity-options entity-name="SupplierRatingType" key-field-name="supplierRatingTypeId" description="${description}"> + <entity-order-by field-name="description"/> + </entity-options> + </drop-down> + </field> + <field name="quantityUomId" title="${uiLabelMap.ProductQuantityUomId}"> + <drop-down allow-empty="true"> + <entity-options entity-name="UomAndType" key-field-name="uomId" description="${typeDescription}: ${description} (${abbreviation})"> + <entity-constraint name="uomTypeId" operator="not-equals" value="CURRENCY_MEASURE"/> + <entity-order-by field-name="typeDescription"/> + <entity-order-by field-name="uomId"/> + </entity-options> + </drop-down> + </field> + <field name="submitButton" title="${uiLabelMap.CommonSubmit}"> <submit button-type="button"/> </field> </form> Modified: ofbiz/trunk/applications/accounting/webapp/accounting/agreement/AgreementTabBar.ftl URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/webapp/accounting/agreement/AgreementTabBar.ftl?view=diff&rev=554680&r1=554679&r2=554680 ============================================================================== --- ofbiz/trunk/applications/accounting/webapp/accounting/agreement/AgreementTabBar.ftl (original) +++ ofbiz/trunk/applications/accounting/webapp/accounting/agreement/AgreementTabBar.ftl Mon Jul 9 08:19:51 2007 @@ -34,7 +34,11 @@ <li<#if selected == "EditAgreementItem"> class="selected"</#if>><a href="<@ofbizUrl>EditAgreementItem?agreementId=${agreementItem.agreementId}&agreementItemSeqId=${agreementItem.agreementItemSeqId}</@ofbizUrl>">${uiLabelMap.AccountingAgreementItem}</a></li> <li<#if selected == "ListAgreementPromoAppls"> class="selected"</#if>><a href="<@ofbizUrl>ListAgreementPromoAppls?agreementId=${agreementItem.agreementId}&agreementItemSeqId=${agreementItem.agreementItemSeqId}</@ofbizUrl>">${uiLabelMap.AccountingAgreementPromoAppls}</a></li> <li<#if selected == "ListAgreementItemTerms"> class="selected"</#if>><a href="<@ofbizUrl>ListAgreementItemTerms?agreementId=${agreementItem.agreementId}&agreementItemSeqId=${agreementItem.agreementItemSeqId}</@ofbizUrl>">${uiLabelMap.AccountingAgreementItemTerms}</a></li> + <#if agreement.agreementTypeId == "PURCHASE_AGREEMENT"> + <li<#if selected == "ListAgreementItemSupplierProducts"> class="selected"</#if>><a href="<@ofbizUrl>ListAgreementItemSupplierProducts?agreementId=${agreementItem.agreementId}&agreementItemSeqId=${agreementItem.agreementItemSeqId}</@ofbizUrl>">${uiLabelMap.ProductProducts}</a></li> + <#else> <li<#if selected == "ListAgreementItemProducts"> class="selected"</#if>><a href="<@ofbizUrl>ListAgreementItemProducts?agreementId=${agreementItem.agreementId}&agreementItemSeqId=${agreementItem.agreementItemSeqId}</@ofbizUrl>">${uiLabelMap.ProductProducts}</a></li> + </#if> <li<#if selected == "ListAgreementItemParties"> class="selected"</#if>><a href="<@ofbizUrl>ListAgreementItemParties?agreementId=${agreementItem.agreementId}&agreementItemSeqId=${agreementItem.agreementItemSeqId}</@ofbizUrl>">${uiLabelMap.Party}</a></li> <li<#if selected == "ListAgreementGeographicalApplic"> class="selected"</#if>><a href="<@ofbizUrl>ListAgreementGeographicalApplic?agreementId=${agreementItem.agreementId}&agreementItemSeqId=${agreementItem.agreementItemSeqId}</@ofbizUrl>">${uiLabelMap.CommonGeo}</a></li> </ul> Modified: ofbiz/trunk/applications/accounting/widget/AgreementScreens.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/widget/AgreementScreens.xml?view=diff&rev=554680&r1=554679&r2=554680 ============================================================================== --- ofbiz/trunk/applications/accounting/widget/AgreementScreens.xml (original) +++ ofbiz/trunk/applications/accounting/widget/AgreementScreens.xml Mon Jul 9 08:19:51 2007 @@ -379,6 +379,114 @@ </widgets> </section> </screen> + + <screen name="ListAgreementItemSupplierProducts"> + <section> + <actions> + <set field="title" value="List Agreement Item Products"/> + <set field="titleProperty" value="PageTitleListAgreementItemProducts"/> + <set field="headerItem" value="agreement"/> + <set field="tabButtonItem" value="ListAgreementItemSupplierProducts"/> + + <entity-one entity-name="Agreement" value-name="agreement" auto-field-map="true"/> + <entity-one entity-name="AgreementItem" value-name="agreementItem"/> + <entity-and entity-name="SupplierProduct" list-name="agreementProducts"> + <field-map env-name="agreement.agreementId" field-name="agreementId"/> + <field-map env-name="agreementItem.agreementItemSeqId" field-name="agreementItemSeqId"/> + </entity-and> + </actions> + <widgets> + <decorator-screen name="CommonAgreementDecorator"> + <decorator-section name="body"> + <container> + <link target="EditAgreementItemSupplierProduct?agreementId=${agreement.agreementId}&agreementItemSeqId=${agreementItem.agreementItemSeqId}" text="${uiLabelMap.ProductNewProduct}" style="buttontext"/> + <link target="ListAgreementItemSupplierProductsReport?agreementId=${agreement.agreementId}&agreementItemSeqId=${agreementItem.agreementItemSeqId}" text="${uiLabelMap.CommonPrint}" style="buttontext"/> + </container> + <include-form name="ListAgreementItemSupplierProducts" location="component://accounting/webapp/accounting/agreement/AgreementForms.xml"/> + </decorator-section> + </decorator-screen> + </widgets> + </section> + </screen> + <screen name="ListAgreementItemSupplierProductsReport"> + <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-name="agreement" auto-field-map="true"/> + <entity-one entity-name="AgreementItem" value-name="agreementItem"/> + <entity-and entity-name="SupplierProduct" list-name="agreementProducts"> + <field-map env-name="agreement.agreementId" field-name="agreementId"/> + <field-map env-name="agreementItem.agreementItemSeqId" field-name="agreementItemSeqId"/> + </entity-and> + </actions> + <widgets> + <decorator-screen name="FoDecorator" location="component://common/widget/CommonScreens.xml"> + <decorator-section name="body"> + <container> + <label style="head1">${uiLabelMap.AccountingAgreement}</label> + </container> + <include-form name="ViewAgreementInfoForReport" location="component://accounting/webapp/accounting/agreement/AgreementForms.xml"/> + <container> + <label style="head2">${uiLabelMap.AccountingAgreementItem}</label> + </container> + <include-form name="ViewAgreementItemInfoForReport" location="component://accounting/webapp/accounting/agreement/AgreementForms.xml"/> + <include-form name="ListAgreementItemSupplierProductsForReport" location="component://accounting/webapp/accounting/agreement/AgreementForms.xml"/> + </decorator-section> + </decorator-screen> + </widgets> + </section> + </screen> + <screen name="EditAgreementItemSupplierProduct"> + <section> + <actions> + <set field="title" value="Edit Agreement Item Product"/> + <set field="titleProperty" value="PageTitleEditAgreementItemProduct"/> + <set field="headerItem" value="agreement"/> + <set field="tabButtonItem" value="ListAgreementItemSupplierProducts"/> + + <set field="agreementId" from-field="parameters.agreementId"/> + <set field="agreementItemSeqId" from-field="parameters.agreementItemSeqId"/> + <set field="productId" from-field="parameters.productId"/> + + <entity-one entity-name="Agreement" value-name="agreement" auto-field-map="true"/> + <entity-one entity-name="AgreementItem" value-name="agreementItem"/> + <entity-one entity-name="SupplierProduct" value-name="agreementProductAppl" auto-field-map="true"/> + </actions> + <widgets> + <section> + <condition> + <and> + <not><if-empty field-name="agreement.partyIdTo"/></not> + <not><if-empty field-name="agreementItem.currencyUomId"/></not> + </and> + </condition> + <widgets> + <decorator-screen name="CommonAgreementDecorator"> + <decorator-section name="body"> + <container> + <link target="EditAgreementItemSupplierProduct?agreementId=${agreement.agreementId}&agreementItemSeqId=${agreementItem.agreementItemSeqId}" text="${uiLabelMap.ProductNewProduct}" style="buttontext"/> + </container> + <include-form name="EditAgreementItemSupplierProduct" location="component://accounting/webapp/accounting/agreement/AgreementForms.xml"/> + </decorator-section> + </decorator-screen> + </widgets> + <fail-widgets> + <decorator-screen name="CommonAgreementDecorator"> + <decorator-section name="body"> + <container> + <label style="head2">${uiLabelMap.AccountingAgreementIsNotSetForSupplierProducts}</label> + </container> + </decorator-section> + </decorator-screen> + </fail-widgets> + </section> + </widgets> + </section> + </screen> + <screen name="ListAgreementItemParties"> <section> <actions> Modified: ofbiz/trunk/applications/product/entitydef/entitymodel.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/entitydef/entitymodel.xml?view=diff&rev=554680&r1=554679&r2=554680 ============================================================================== --- ofbiz/trunk/applications/product/entitydef/entitymodel.xml (original) +++ ofbiz/trunk/applications/product/entitydef/entitymodel.xml Mon Jul 9 08:19:51 2007 @@ -4089,6 +4089,8 @@ <field name="orderQtyIncrements" type="floating-point"></field> <field name="unitsIncluded" type="floating-point"></field> <field name="quantityUomId" type="id"></field> + <field name="agreementId" type="id"></field> + <field name="agreementItemSeqId" type="id"></field> <field name="lastPrice" type="currency-precise"></field> <field name="currencyUomId" type="id"></field> <field name="supplierProductName" type="name"></field> @@ -4118,6 +4120,10 @@ </relation> <relation type="one" fk-name="SUPPL_PROD_QUOM" title="Quantity" rel-entity-name="Uom"> <key-map field-name="quantityUomId" rel-field-name="uomId"/> + </relation> + <relation type="one" fk-name="SUPPL_PROD_AGRIT" rel-entity-name="AgreementItem"> + <key-map field-name="agreementId"/> + <key-map field-name="agreementItemSeqId"/> </relation> </entity> <entity entity-name="SupplierProductFeature" |
Free forum by Nabble | Edit this page |