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 05:47:28 UTC

svn commit: r532597 - /ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/finaccount/FinAccountServices.java

Author: jaz
Date: Wed Apr 25 20:47:27 2007
New Revision: 532597

URL: http://svn.apache.org/viewvc?view=rev&rev=532597
Log:
now creates owner role w/ financial account

Modified:
    ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/finaccount/FinAccountServices.java

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=532597&r1=532596&r2=532597
==============================================================================
--- ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/finaccount/FinAccountServices.java (original)
+++ ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/finaccount/FinAccountServices.java Wed Apr 25 20:47:27 2007
@@ -106,6 +106,22 @@
                     if (UtilValidate.isNotEmpty(creditAccountId)) {
                         creditAccount = delegator.findByPrimaryKey("FinAccount", UtilMisc.toMap("finAccountId", creditAccountId));
 
+                        // create the owner role
+                        Map roleCtx = FastMap.newInstance();
+                        roleCtx.put("partyId", partyId);
+                        roleCtx.put("roleTypeId", "OWNER");
+                        roleCtx.put("finAccountId", finAccountId);
+                        roleCtx.put("userLogin", userLogin);
+                        roleCtx.put("fromDate", UtilDateTime.nowTimestamp());
+                        Map roleResp;
+                        try {
+                            roleResp = dispatcher.runSync("createFinAccountRole", roleCtx);
+                        } catch (GenericServiceException e) {                            
+                            return ServiceUtil.returnError(e.getMessage());
+                        }
+                        if (ServiceUtil.isError(roleResp)) {
+                            return roleResp;
+                        }
                     }
                 }
                 if (creditAccount == null) {