Author: jaz
Date: Wed Apr 25 20:47:27 2007
New Revision: 532597
URL:
http://svn.apache.org/viewvc?view=rev&rev=532597Log:
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) {