You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by ja...@apache.org on 2007/04/26 23:31:23 UTC

svn commit: r532872 - in /ofbiz/trunk/applications: accounting/config/ accounting/src/org/ofbiz/accounting/finaccount/ party/webapp/partymgr/WEB-INF/ party/webapp/partymgr/party/ party/widget/partymgr/

Author: jaz
Date: Thu Apr 26 14:31:22 2007
New Revision: 532872

URL: http://svn.apache.org/viewvc?view=rev&rev=532872
Log:
applied patch from Joe Eckard for JIRA issue OFBIZ-928

Modified:
    ofbiz/trunk/applications/accounting/config/AccountingUiLabels.properties
    ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/finaccount/FinAccountServices.java
    ofbiz/trunk/applications/party/webapp/partymgr/WEB-INF/controller.xml
    ofbiz/trunk/applications/party/webapp/partymgr/party/FinAccountDetail.ftl
    ofbiz/trunk/applications/party/webapp/partymgr/party/PartyForms.xml
    ofbiz/trunk/applications/party/widget/partymgr/PartyScreens.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=532872&r1=532871&r2=532872
==============================================================================
--- ofbiz/trunk/applications/accounting/config/AccountingUiLabels.properties (original)
+++ ofbiz/trunk/applications/accounting/config/AccountingUiLabels.properties Thu Apr 26 14:31:22 2007
@@ -788,3 +788,7 @@
 PageTitleEditFinAccountRole=Edit Financial Account Role
 PageTitleEditFinAccountTrans=Edit Financial Account Transaction
 PageTitleEditFinAccountAuths=Edit Financial Account Authority
+
+AccountingServiceCredit=Service Credit
+AccountingServiceCredits=Service Credits
+AccountingApplyServiceCredit=Apply Service Credit

Modified: ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/finaccount/FinAccountServices.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/finaccount/FinAccountServices.java?view=diff&rev=532872&r1=532871&r2=532872
==============================================================================
--- ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/finaccount/FinAccountServices.java (original)
+++ ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/finaccount/FinAccountServices.java Thu Apr 26 14:31:22 2007
@@ -76,7 +76,7 @@
             // check for an existing account
             GenericValue creditAccount;
             if (finAccountId != null) {
-                creditAccount = delegator.findByPrimaryKey("FinAccount", UtilMisc.toMap("finAccoutId", finAccountId));
+                creditAccount = delegator.findByPrimaryKey("FinAccount", UtilMisc.toMap("finAccountId", finAccountId));
             } else {
                 List creditAccounts = delegator.findByAnd("FinAccount", lookupMap, UtilMisc.toList("-fromDate"));
                 creditAccount = EntityUtil.getFirst(EntityUtil.filterByDate(creditAccounts));
@@ -110,13 +110,13 @@
                         Map roleCtx = FastMap.newInstance();
                         roleCtx.put("partyId", partyId);
                         roleCtx.put("roleTypeId", "OWNER");
-                        roleCtx.put("finAccountId", finAccountId);
+                        roleCtx.put("finAccountId", creditAccountId);
                         roleCtx.put("userLogin", userLogin);
                         roleCtx.put("fromDate", UtilDateTime.nowTimestamp());
                         Map roleResp;
                         try {
                             roleResp = dispatcher.runSync("createFinAccountRole", roleCtx);
-                        } catch (GenericServiceException e) {                            
+                        } catch (GenericServiceException e) {
                             return ServiceUtil.returnError(e.getMessage());
                         }
                         if (ServiceUtil.isError(roleResp)) {

Modified: ofbiz/trunk/applications/party/webapp/partymgr/WEB-INF/controller.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/party/webapp/partymgr/WEB-INF/controller.xml?view=diff&rev=532872&r1=532871&r2=532872
==============================================================================
--- ofbiz/trunk/applications/party/webapp/partymgr/WEB-INF/controller.xml (original)
+++ ofbiz/trunk/applications/party/webapp/partymgr/WEB-INF/controller.xml Thu Apr 26 14:31:22 2007
@@ -92,6 +92,13 @@
         <response name="success" type="view" value="viewprofile"/>
     </request-map>
 
+    <request-map uri="applyServiceCredit">
+        <security https="true" auth="true"/>
+        <event type="service" invoke="createServiceCredit"/>
+        <response name="success" type="view" value="viewprofile"/>
+        <response name="error" type="view" value="viewprofile"/>
+    </request-map>
+
     <request-map uri="editcontactmech"><security https="true" auth="true"/><response name="success" type="view" value="editcontactmech"/></request-map>
     <request-map uri="createContactMech">
         <security https="true" auth="true"/>

Modified: ofbiz/trunk/applications/party/webapp/partymgr/party/FinAccountDetail.ftl
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/party/webapp/partymgr/party/FinAccountDetail.ftl?view=diff&rev=532872&r1=532871&r2=532872
==============================================================================
--- ofbiz/trunk/applications/party/webapp/partymgr/party/FinAccountDetail.ftl (original)
+++ ofbiz/trunk/applications/party/webapp/partymgr/party/FinAccountDetail.ftl Thu Apr 26 14:31:22 2007
@@ -17,90 +17,93 @@
 under the License.
 -->
 
-<p>
-    <b>Account Number:</b> <a href="/accounting/control/EditFinAccount?finAccountId=${ownedFinAccount.finAccountId}${externalKeyParam}"
-         class="smallSubmit">${ownedFinAccount.finAccountId}</a>
-    <b>Type:</b> ${(ownedFinAccountType.description)?default('N/A')}
-    <b>Name:</b> ${ownedFinAccount.finAccountName?if_exists}
-</p>
-<p>
-    <b>Currency:</b> ${(accountCurrencyUom.description)?if_exists} [${ownedFinAccount.currencyUomId?if_exists}]
-    <b>Date Opened:</b> ${ownedFinAccount.fromDate?if_exists}
-    <b>Is Frozen:</b> ${ownedFinAccount.isFrozen?default('N')}
-    <#if ownedFinAccount.replenishLevel?exists>
-        <b>Replenish Level:</b> <@ofbizCurrency amount=ownedFinAccount.replenishLevel isoCode=ownedFinAccount.currencyUomId/>
-    </#if>
-</p>
-<br />
-<table id="fa-transactions" class="basic-table" cellspacing="0" cellpadding="2">
-    <thead>
-        <tr class="header-row">
-            <td>Transaction ${uiLabelMap.CommonDate}</td>
-            <td>ID</td>
-            <td>Order Item</td>
-            <td>Payment</td>
-            <td>Type</td>
-            <td>Amount</td>
-        </tr>
-    </thead>
-    <tbody>
-        <#list ownedFinAccountTransList as ownedFinAccountTrans>
-            <#assign finAccountTransType = ownedFinAccountTrans.getRelatedOne('FinAccountTransType')>
-            <#assign displayAmount = ownedFinAccountTrans.amount>
-            <#if ownedFinAccountTrans.finAccountTransTypeId == 'WITHDRAWAL'>
-                <#assign displayAmount = -displayAmount>
-            </#if>
-            <tr>
-                <td>${ownedFinAccountTrans.transactionDate?if_exists}</td>
-                <td>${ownedFinAccountTrans.finAccountTransId}</td>
-                <td>${ownedFinAccountTrans.orderId?if_exists}:${ownedFinAccountTrans.orderItemSeqId?if_exists}</td>
-                <td>${ownedFinAccountTrans.paymentId?if_exists}</td>
-                <td>${finAccountTransType.description?default(ownedFinAccountTrans.finAccountTransTypeId)?if_exists}</td>
-                <td><@ofbizCurrency amount=displayAmount isoCode=ownedFinAccount.currencyUomId/></td>
-            </tr>
-        </#list>
-    </tbody>
-    <tfoot>
-        <tr><td colspan="6"><hr /></td></tr>
-        <tr>
-            <td colspan="5"><b>Actual Balance</b></td>
-            <td><b><@ofbizCurrency amount=ownedFinAccount.actualBalance isoCode=ownedFinAccount.currencyUomId/></b></td>
-        </tr>
-    </tfoot>
-</table>
-
-<#if ownedFinAccountAuthList?has_content>
+<div style="border-bottom: 1px solid #ccc; margin-bottom: 20px">
+    <p>
+        <b>Account Number:</b> <a href="/accounting/control/EditFinAccount?finAccountId=${ownedFinAccount.finAccountId}${externalKeyParam}"
+             class="smallSubmit">${ownedFinAccount.finAccountId}</a>
+        <b>Type:</b> ${(ownedFinAccountType.description)?default('N/A')}
+        <b>Name:</b> ${ownedFinAccount.finAccountName?if_exists}
+    </p>
+    <p>
+        <b>Currency:</b> ${(accountCurrencyUom.description)?if_exists} [${ownedFinAccount.currencyUomId?if_exists}]
+        <b>Date Opened:</b> ${ownedFinAccount.fromDate?if_exists}
+        <b>Is Frozen:</b> ${ownedFinAccount.isFrozen?default('N')}
+        <#if ownedFinAccount.replenishLevel?exists>
+            <b>Replenish Level:</b> <@ofbizCurrency amount=ownedFinAccount.replenishLevel isoCode=ownedFinAccount.currencyUomId/>
+        </#if>
+    </p>
     <br />
-    <table id="fa-authorizations" class="basic-table" cellspacing="0" cellpadding="2">
+    <table id="fa-transactions" class="basic-table" cellspacing="0" cellpadding="2">
         <thead>
             <tr class="header-row">
-                <td>Authorization ${uiLabelMap.CommonDate}</td>
+                <td>Transaction ${uiLabelMap.CommonDate}</td>
                 <td>ID</td>
-                <td>Expires</td>
+                <td>Order Item</td>
+                <td>Payment</td>
+                <td>Type</td>
                 <td>Amount</td>
             </tr>
         </thead>
         <tbody>
-            <#list ownedFinAccountAuthList as ownedFinAccountAuth>
+            <#list ownedFinAccountTransList as ownedFinAccountTrans>
+                <#assign finAccountTransType = ownedFinAccountTrans.getRelatedOne('FinAccountTransType')>
+                <#assign displayAmount = ownedFinAccountTrans.amount>
+                <#if ownedFinAccountTrans.finAccountTransTypeId == 'WITHDRAWAL'>
+                    <#assign displayAmount = -displayAmount>
+                </#if>
                 <tr>
-                    <td>${ownedFinAccountAuth.authorizationDate?if_exists}</td>
-                    <td>${ownedFinAccountAuth.finAccountAuthId}</td>
-                    <td>${ownedFinAccountAuth.thruDate?if_exists}</td>
-                    <td><@ofbizCurrency amount=-ownedFinAccountAuth.amount isoCode=ownedFinAccount.currencyUomId/></td>
+                    <td>${ownedFinAccountTrans.transactionDate?if_exists}</td>
+                    <td>${ownedFinAccountTrans.finAccountTransId}</td>
+                    <td>${ownedFinAccountTrans.orderId?if_exists}:${ownedFinAccountTrans.orderItemSeqId?if_exists}</td>
+                    <td>${ownedFinAccountTrans.paymentId?if_exists}</td>
+                    <td>${finAccountTransType.description?default(ownedFinAccountTrans.finAccountTransTypeId)?if_exists}</td>
+                    <td><@ofbizCurrency amount=displayAmount isoCode=ownedFinAccount.currencyUomId/></td>
                 </tr>
             </#list>
         </tbody>
         <tfoot>
-            <tr><td colspan="4"><hr /></td></tr>
+            <tr><td colspan="6"><hr /></td></tr>
             <tr>
-                <td colspan="3"><b>Actual Balance</b></td>
+                <td colspan="5"><b>Actual Balance</b></td>
                 <td><b><@ofbizCurrency amount=ownedFinAccount.actualBalance isoCode=ownedFinAccount.currencyUomId/></b></td>
             </tr>
-            <tr>
-                <td colspan="3"><b>Available Balance</b></td>
-                <td><b><@ofbizCurrency amount=ownedFinAccount.availableBalance isoCode=ownedFinAccount.currencyUomId/></b></td>
-            </tr>
         </tfoot>
     </table>
+</div>
+
+<#if ownedFinAccountAuthList?has_content>
+    <div style="border-bottom: 1px solid #ccc; margin-bottom: 20px">
+        <table id="fa-authorizations" class="basic-table" cellspacing="0" cellpadding="2">
+            <thead>
+                <tr class="header-row">
+                    <td>Authorization ${uiLabelMap.CommonDate}</td>
+                    <td>ID</td>
+                    <td>Expires</td>
+                    <td>Amount</td>
+                </tr>
+            </thead>
+            <tbody>
+                <#list ownedFinAccountAuthList as ownedFinAccountAuth>
+                    <tr>
+                        <td>${ownedFinAccountAuth.authorizationDate?if_exists}</td>
+                        <td>${ownedFinAccountAuth.finAccountAuthId}</td>
+                        <td>${ownedFinAccountAuth.thruDate?if_exists}</td>
+                        <td><@ofbizCurrency amount=-ownedFinAccountAuth.amount isoCode=ownedFinAccount.currencyUomId/></td>
+                    </tr>
+                </#list>
+            </tbody>
+            <tfoot>
+                <tr><td colspan="4"><hr /></td></tr>
+                <tr>
+                    <td colspan="3"><b>Actual Balance</b></td>
+                    <td><b><@ofbizCurrency amount=ownedFinAccount.actualBalance isoCode=ownedFinAccount.currencyUomId/></b></td>
+                </tr>
+                <tr>
+                    <td colspan="3"><b>Available Balance</b></td>
+                    <td><b><@ofbizCurrency amount=ownedFinAccount.availableBalance isoCode=ownedFinAccount.currencyUomId/></b></td>
+                </tr>
+            </tfoot>
+        </table>
+    </div>
 </#if>
 

Modified: ofbiz/trunk/applications/party/webapp/partymgr/party/PartyForms.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/party/webapp/partymgr/party/PartyForms.xml?view=diff&rev=532872&r1=532871&r2=532872
==============================================================================
--- ofbiz/trunk/applications/party/webapp/partymgr/party/PartyForms.xml (original)
+++ ofbiz/trunk/applications/party/webapp/partymgr/party/PartyForms.xml Thu Apr 26 14:31:22 2007
@@ -441,4 +441,34 @@
         </field>
     </form>    
 
+    <form name="ApplyServiceCredit" type="single" target="applyServiceCredit" default-map-name="serviceCredit" focus-field-name="amount">
+        <auto-fields-service service-name="createServiceCredit" map-name="serviceCredit"/>
+        <field name="finAccountId">
+            <drop-down allow-empty="true">
+                <entity-options entity-name="FinAccount" description="${finAccountName} [${finAccountId}]" key-field-name="finAccountId" filter-by-date="true">
+                    <entity-constraint name="ownerPartyId" value="${partyId}"/>
+                    <entity-constraint name="finAccountTypeId" value="SVCCRED_ACCOUNT"/>
+                    <entity-order-by field-name="-fromDate"/>
+                </entity-options>
+            </drop-down>
+        </field>
+        <field name="currencyUomId">
+            <drop-down allow-empty="false" no-current-selected-key="USD">
+                <entity-options entity-name="Uom" description="[${abbreviation}] ${description}" key-field-name="uomId">
+                    <entity-constraint name="uomTypeId" value="CURRENCY_MEASURE"/>
+                    <entity-order-by field-name="abbreviation"/>
+                </entity-options>
+            </drop-down>
+        </field>
+        <field name="productStoreId">
+            <drop-down allow-empty="true">
+                <entity-options entity-name="ProductStore" description="${storeName} [${productStoreId}]" key-field-name="productStoreId">
+                    <entity-order-by field-name="productStoreId"/>
+                </entity-options>
+            </drop-down>
+        </field>
+        <field name="partyId"><hidden value="${partyId}"/></field>
+        <field name="submitButton" title="${uiLabelMap.CommonAdd}"><submit button-type="button"/></field>
+    </form>
+
 </forms>

Modified: ofbiz/trunk/applications/party/widget/partymgr/PartyScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/party/widget/partymgr/PartyScreens.xml?view=diff&rev=532872&r1=532871&r2=532872
==============================================================================
--- ofbiz/trunk/applications/party/widget/partymgr/PartyScreens.xml (original)
+++ ofbiz/trunk/applications/party/widget/partymgr/PartyScreens.xml Thu Apr 26 14:31:22 2007
@@ -758,6 +758,10 @@
                                         </widgets>
                                     </section>
                                 </iterate-section>
+                                <container id="apply-service-credit">
+                                    <label style="head2" text="${uiLabelMap.AccountingApplyServiceCredit}"/>
+                                    <include-form name="ApplyServiceCredit" location="component://party/webapp/partymgr/party/PartyForms.xml"/>
+                                </container>
                             </container>
                         </container>
                     </widgets>