svn commit: r550411 - in /ofbiz/trunk/applications/accounting: webapp/accounting/WEB-INF/actions/billingaccount/FindBillingAccount.bsh webapp/accounting/billingaccount/FindBillingAccount.ftl widget/BillingAccountForms.xml widget/BillingAccountScreens.xml

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

svn commit: r550411 - in /ofbiz/trunk/applications/accounting: webapp/accounting/WEB-INF/actions/billingaccount/FindBillingAccount.bsh webapp/accounting/billingaccount/FindBillingAccount.ftl widget/BillingAccountForms.xml widget/BillingAccountScreens.xml

jacopoc
Author: jacopoc
Date: Mon Jun 25 01:27:25 2007
New Revision: 550411

URL: http://svn.apache.org/viewvc?view=rev&rev=550411
Log:
Refactored the 'find billing account' screen to use widgets insted of ftl. Based on an initila patch from Jeremy Wickersheimer OFBIZ-1097

Removed:
    ofbiz/trunk/applications/accounting/webapp/accounting/billingaccount/FindBillingAccount.ftl
Modified:
    ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/billingaccount/FindBillingAccount.bsh
    ofbiz/trunk/applications/accounting/widget/BillingAccountForms.xml
    ofbiz/trunk/applications/accounting/widget/BillingAccountScreens.xml

Modified: ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/billingaccount/FindBillingAccount.bsh
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/billingaccount/FindBillingAccount.bsh?view=diff&rev=550411&r1=550410&r2=550411
==============================================================================
--- ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/billingaccount/FindBillingAccount.bsh (original)
+++ ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/billingaccount/FindBillingAccount.bsh Mon Jun 25 01:27:25 2007
@@ -17,17 +17,12 @@
  * under the License.
  */
 
-import java.util.*;
-import org.ofbiz.entity.*;
-import org.ofbiz.base.util.*;
+import org.ofbiz.base.util.UtilMisc;
 
-requestParams = UtilHttp.getParameterMap(request);
-delegator = request.getAttribute("delegator");
-partyId = requestParams.get("partyId");
+partyId = parameters.get("partyId");
 if (partyId != null) {
-    accountsByParty = delegator.findByAnd("BillingAccountRole", UtilMisc.toMap("partyId", partyId));
-    context.put("billingAccountRolesByParty", accountsByParty);
+    accounts = delegator.findByAnd("BillingAccountAndRole", UtilMisc.toMap("partyId", partyId));
 } else {
-    allAccounts = delegator.findAll("BillingAccount");
-    context.put("billingAccounts", allAccounts);
-}
\ No newline at end of file
+    accounts = delegator.findAll("BillingAccount");
+}
+context.put("billingAccounts", accounts);

Modified: ofbiz/trunk/applications/accounting/widget/BillingAccountForms.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/widget/BillingAccountForms.xml?view=diff&rev=550411&r1=550410&r2=550411
==============================================================================
--- ofbiz/trunk/applications/accounting/widget/BillingAccountForms.xml (original)
+++ ofbiz/trunk/applications/accounting/widget/BillingAccountForms.xml Mon Jun 25 01:27:25 2007
@@ -20,7 +20,21 @@
 
 <forms xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/widget-form.xsd">
-    
+
+    <form name="ListBillingAccounts" type="list" list-name="billingAccounts" paginate-target="FindBillingAccount">
+        <field name="billingAccountId" widget-style="buttontext">
+            <hyperlink description="${billingAccountId}" target="EditBillingAccount?billingAccountId=${billingAccountId}"/>
+        </field>
+        <field name="accountLimit">
+            <display type="currency" currency="${billingAccount.accountCurrencyUomId}" />
+        </field>
+        <field name="description"><display/></field>
+        <field name="fromDate"><display/></field>
+        <field name="thruDate"><display/></field>
+        <field name="partyId"><display/></field>
+        <field name="roleTypeId"><display-entity entity-name="RoleType"/></field>
+    </form>
+
     <form name="EditBillingAccount" type="single" target="updateBillingAccount" title="" default-map-name="billingAccount">
         <alt-target use-when="billingAccount==null" target="createBillingAccount"/>
         <auto-fields-service service-name="updateBillingAccount" map-name="billingAccount"/>

Modified: ofbiz/trunk/applications/accounting/widget/BillingAccountScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/widget/BillingAccountScreens.xml?view=diff&rev=550411&r1=550410&r2=550411
==============================================================================
--- ofbiz/trunk/applications/accounting/widget/BillingAccountScreens.xml (original)
+++ ofbiz/trunk/applications/accounting/widget/BillingAccountScreens.xml Mon Jun 25 01:27:25 2007
@@ -60,9 +60,19 @@
             <widgets>
                 <decorator-screen name="main-decorator" location="${parameters.mainDecoratorLocation}">
                     <decorator-section name="body">
-                        <platform-specific>
-                            <html><html-template location="component://accounting/webapp/accounting/billingaccount/FindBillingAccount.ftl"/></html>
-                        </platform-specific>
+                        <container><label style="head1" text="${uiLabelMap.AccountingBillingAccounts}"/></container>
+                        <section>
+                            <condition>
+                                <if-empty field-name="parameters.partyId"/>
+                            </condition>
+                            <widgets>
+                                <container><link target="EditBillingAccount" text="${uiLabelMap.CommonNew}" style="buttontext"/></container>
+                            </widgets>
+                            <fail-widgets>
+                                <container><link target="EditBillingAccount?partyId=${parameters.partyId}&amp;roleTypeId=BILL_TO_CUSTOMER" text="${uiLabelMap.CommonNew} " style="buttontext"/></container>
+                            </fail-widgets>
+                        </section>
+                        <include-form name="ListBillingAccounts" location="component://accounting/widget/BillingAccountForms.xml"/>
                     </decorator-section>
                 </decorator-screen>
             </widgets>