From commitsderrickle@example.net Fri May 01 00:36:55 2009 Return-Path: <commitsderrickle@example.net> Delivered-To: derrickle@example.net Received: (qmail 69769 invoked from network); 1 May 2009 00:36:55 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 1 May 2009 00:36:55 -0000 Received: (qmail 4544 invoked by uid 500); 1 May 2009 00:36:54 -0000 Delivered-To: derrickle@example.net Received: (qmail 4486 invoked by uid 500); 1 May 2009 00:36:54 -0000 Mailing-List: contact derrickle@example.net; run by ezmlm Precedence: bulk List-Help: <mailto:derrickle@example.net> List-Unsubscribe: <mailto:derrickle@example.net> List-Post: <mailto:derrickle@example.net> List-Id: <commits.ofbiz.apache.org> Reply-To: derrickle@example.net Delivered-To: mailing list derrickle@example.net Received: (qmail 4477 invoked by uid 99); 1 May 2009 00:36:54 -0000 Received: from athena.apache.org (HELO athena.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 01 May 2009 00:36:54 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [83.161.120.155] (HELO eris.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 01 May 2009 00:36:53 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 770B023888AF; Fri, 1 May 2009 00:36:33 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r770501 - /ofbiz/trunk/framework/widget/templates/htmlScreenMacroLibrary.ftl Date: Fri, 01 May 2009 00:36:33 -0000 To: derrickle@example.net From: derrickle@example.net X-Mailer: svnmailer-1.0.8 Message-Id: <derrickle@example.net> X-Virus-Checked: Checked by ClamAV on apache.org Author: lektran Date: Fri May 1 00:36:32 2009 New Revision: 770501 URL: http://svn.apache.org/viewvc?rev=770501&view=rev Log: Fixed issue reported by Sascha Rodekamp on the user mailing list enableEditValue was being treated like a boolean but was actually a String Modified: ofbiz/trunk/framework/widget/templates/htmlScreenMacroLibrary.ftl Modified: ofbiz/trunk/framework/widget/templates/htmlScreenMacroLibrary.ftl URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/widget/templates/htmlScreenMacroLibrary.ftl?rev=770501&r1=770500&r2=770501&view=diff ============================================================================== --- ofbiz/trunk/framework/widget/templates/htmlScreenMacroLibrary.ftl (original) +++ ofbiz/trunk/framework/widget/templates/htmlScreenMacroLibrary.ftl Fri May 1 00:36:32 2009 @@ -43,18 +43,18 @@ <div<#if id?has_content> id="${id}"</#if><#if style?has_content> class="${style}"</#if>> </#macro> <#macro renderContainerEnd></div></#macro> -<#macro renderContentBegin editRequest enableEditValue editContainerStyle><#if editRequest?has_content && enableEditValue><div class=${editContainerStyle}></#if></#macro> +<#macro renderContentBegin editRequest enableEditValue editContainerStyle><#if editRequest?has_content && enableEditValue == "true"><div class=${editContainerStyle}></#if></#macro> <#macro renderContentBody></#macro> <#macro renderContentEnd urlString editMode editContainerStyle editRequest enableEditValue> -<#if editRequest?exists && enableEditValue> +<#if editRequest?exists && enableEditValue == "true"> <#if urlString?exists><a href="${urlString}">${editMode}</a><#rt/></#if> <#if editContainerStyle?exists></div><#rt/></#if> </#if> </#macro> -<#macro renderSubContentBegin editContainerStyle editRequest enableEditValue><#if editRequest?exists && enableEditValue><div class="${editContainerStyle}"></#if></#macro> +<#macro renderSubContentBegin editContainerStyle editRequest enableEditValue><#if editRequest?exists && enableEditValue == "true"><div class="${editContainerStyle}"></#if></#macro> <#macro renderSubContentBody></#macro> <#macro renderSubContentEnd> -<#if editRequest?exists && enableEditValue> +<#if editRequest?exists && enableEditValue == "true"> <#if urlString?exists><a href="${urlString}">${editMode}</a><#rt/></#if> <#if editContainerStyle?exists></div><#rt/></#if> </#if> From commitsderrickle@example.net Fri May 01 00:46:16 2009 Return-Path: <commitsderrickle@example.net> Delivered-To: derrickle@example.net Received: (qmail 71697 invoked from network); 1 May 2009 00:46:16 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 1 May 2009 00:46:16 -0000 Received: (qmail 12302 invoked by uid 500); 1 May 2009 00:46:15 -0000 Delivered-To: derrickle@example.net Received: (qmail 12264 invoked by uid 500); 1 May 2009 00:46:15 -0000 Mailing-List: contact derrickle@example.net; run by ezmlm Precedence: bulk List-Help: <mailto:derrickle@example.net> List-Unsubscribe: <mailto:derrickle@example.net> List-Post: <mailto:derrickle@example.net> List-Id: <commits.ofbiz.apache.org> Reply-To: derrickle@example.net Delivered-To: mailing list derrickle@example.net Received: (qmail 12251 invoked by uid 99); 1 May 2009 00:46:15 -0000 Received: from nike.apache.org (HELO nike.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 01 May 2009 00:46:15 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [83.161.120.155] (HELO eris.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 01 May 2009 00:46:13 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id EAB4323888AF; Fri, 1 May 2009 00:45:52 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r770503 - /ofbiz/branches/release09.04/framework/widget/templates/htmlScreenMacroLibrary.ftl Date: Fri, 01 May 2009 00:45:52 -0000 To: derrickle@example.net From: derrickle@example.net X-Mailer: svnmailer-1.0.8 Message-Id: <derrickle@example.net> X-Virus-Checked: Checked by ClamAV on apache.org Author: lektran Date: Fri May 1 00:45:52 2009 New Revision: 770503 URL: http://svn.apache.org/viewvc?rev=770503&view=rev Log: Merged from trunk r770501: Fixed issue reported by Sascha Rodekamp on the user mailing list enableEditValue was being treated like a boolean but was actually a String Modified: ofbiz/branches/release09.04/framework/widget/templates/htmlScreenMacroLibrary.ftl Modified: ofbiz/branches/release09.04/framework/widget/templates/htmlScreenMacroLibrary.ftl URL: http://svn.apache.org/viewvc/ofbiz/branches/release09.04/framework/widget/templates/htmlScreenMacroLibrary.ftl?rev=770503&r1=770502&r2=770503&view=diff ============================================================================== --- ofbiz/branches/release09.04/framework/widget/templates/htmlScreenMacroLibrary.ftl (original) +++ ofbiz/branches/release09.04/framework/widget/templates/htmlScreenMacroLibrary.ftl Fri May 1 00:45:52 2009 @@ -27,18 +27,18 @@ <div<#if id?has_content> id="${id}"</#if><#if style?has_content> class="${style}"</#if>> </#macro> <#macro renderContainerEnd></div></#macro> -<#macro renderContentBegin editRequest enableEditValue editContainerStyle><#if editRequest?has_content && enableEditValue><div class=${editContainerStyle}></#if></#macro> +<#macro renderContentBegin editRequest enableEditValue editContainerStyle><#if editRequest?has_content && enableEditValue == "true"><div class=${editContainerStyle}></#if></#macro> <#macro renderContentBody></#macro> <#macro renderContentEnd urlString editMode editContainerStyle editRequest enableEditValue> -<#if editRequest?exists && enableEditValue> +<#if editRequest?exists && enableEditValue == "true"> <#if urlString?exists><a href="${urlString}">${editMode}</a><#rt/></#if> <#if editContainerStyle?exists></div><#rt/></#if> </#if> </#macro> -<#macro renderSubContentBegin editContainerStyle editRequest enableEditValue><#if editRequest?exists && enableEditValue><div class="${editContainerStyle}"></#if></#macro> +<#macro renderSubContentBegin editContainerStyle editRequest enableEditValue><#if editRequest?exists && enableEditValue == "true"><div class="${editContainerStyle}"></#if></#macro> <#macro renderSubContentBody></#macro> <#macro renderSubContentEnd> -<#if editRequest?exists && enableEditValue> +<#if editRequest?exists && enableEditValue == "true"> <#if urlString?exists><a href="${urlString}">${editMode}</a><#rt/></#if> <#if editContainerStyle?exists></div><#rt/></#if> </#if> From commitsderrickle@example.net Fri May 01 04:08:50 2009 Return-Path: <commitsderrickle@example.net> Delivered-To: derrickle@example.net Received: (qmail 48223 invoked from network); 1 May 2009 04:08:50 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 1 May 2009 04:08:50 -0000 Received: (qmail 50081 invoked by uid 500); 1 May 2009 04:08:50 -0000 Delivered-To: derrickle@example.net Received: (qmail 50041 invoked by uid 500); 1 May 2009 04:08:50 -0000 Mailing-List: contact derrickle@example.net; run by ezmlm Precedence: bulk List-Help: <mailto:derrickle@example.net> List-Unsubscribe: <mailto:derrickle@example.net> List-Post: <mailto:derrickle@example.net> List-Id: <commits.ofbiz.apache.org> Reply-To: derrickle@example.net Delivered-To: mailing list derrickle@example.net Received: (qmail 50032 invoked by uid 99); 1 May 2009 04:08:49 -0000 Received: from nike.apache.org (HELO nike.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 01 May 2009 04:08:49 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [83.161.120.155] (HELO eris.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 01 May 2009 04:08:47 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id EF4B22388964; Fri, 1 May 2009 04:08:25 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r770530 - /ofbiz/trunk/applications/party/src/org/ofbiz/party/communication/CommunicationEventServices.java Date: Fri, 01 May 2009 04:08:25 -0000 To: derrickle@example.net From: derrickle@example.net X-Mailer: svnmailer-1.0.8 Message-Id: <derrickle@example.net> X-Virus-Checked: Checked by ClamAV on apache.org Author: doogie Date: Fri May 1 04:08:25 2009 New Revision: 770530 URL: http://svn.apache.org/viewvc?rev=770530&view=rev Log: Generics markup, use of StringBuilder in one place, plus enhanced-for. Modified: ofbiz/trunk/applications/party/src/org/ofbiz/party/communication/CommunicationEventServices.java Modified: ofbiz/trunk/applications/party/src/org/ofbiz/party/communication/CommunicationEventServices.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/party/src/org/ofbiz/party/communication/CommunicationEventServices.java?rev=770530&r1=770529&r2=770530&view=diff ============================================================================== --- ofbiz/trunk/applications/party/src/org/ofbiz/party/communication/CommunicationEventServices.java (original) +++ ofbiz/trunk/applications/party/src/org/ofbiz/party/communication/CommunicationEventServices.java Fri May 1 04:08:25 2009 @@ -474,7 +474,7 @@ String contactMechIdFrom = null; String contactMechIdTo = null; - Map result = null; + Map<String, Object> result = null; try { String contentTypeRaw = message.getContentType(); int idx = contentTypeRaw.indexOf(";"); @@ -512,7 +512,7 @@ } // make sure this isn't a duplicate - List commEvents; + List<GenericValue> commEvents; try { commEvents = delegator.findByAnd("CommunicationEvent", UtilMisc.toMap("messageId", messageId)); } catch (GenericEntityException e) { @@ -528,14 +528,14 @@ // get the related partId's - List toParties = buildListOfPartyInfoFromEmailAddresses(addressesTo, userLogin, dispatcher); - List ccParties = buildListOfPartyInfoFromEmailAddresses(addressesCC, userLogin, dispatcher); - List bccParties = buildListOfPartyInfoFromEmailAddresses(addressesBCC, userLogin, dispatcher); + List<Map<String, Object>> toParties = buildListOfPartyInfoFromEmailAddresses(addressesTo, userLogin, dispatcher); + List<Map<String, Object>> ccParties = buildListOfPartyInfoFromEmailAddresses(addressesCC, userLogin, dispatcher); + List<Map<String, Object>> bccParties = buildListOfPartyInfoFromEmailAddresses(addressesBCC, userLogin, dispatcher); //Get the first address from the list - this is the partyIdTo field of the CommunicationEvent if (!toParties.isEmpty()) { - Iterator itr = toParties.iterator(); - Map firstAddressTo = (Map) itr.next(); + Iterator<Map<String, Object>> itr = toParties.iterator(); + Map<String, Object> firstAddressTo = itr.next(); partyIdTo = (String)firstAddressTo.get("partyId"); contactMechIdTo = (String)firstAddressTo.get("contactMechId"); } @@ -569,7 +569,7 @@ partyIdFrom = (String)result.get("partyId"); contactMechIdFrom = (String)result.get("contactMechId"); - Map commEventMap = FastMap.newInstance(); + Map<String, Object> commEventMap = FastMap.newInstance(); commEventMap.put("communicationEventTypeId", "AUTO_EMAIL_COMM"); commEventMap.put("contactMechTypeId", "EMAIL_ADDRESS"); commEventMap.put("messageId", messageId); @@ -601,7 +601,7 @@ if (inReplyTo != null && inReplyTo[0] != null) { GenericValue parentCommEvent = null; try { - List events = delegator.findByAnd("CommunicationEvent", UtilMisc.toMap("messageId", inReplyTo[0])); + List<GenericValue> events = delegator.findByAnd("CommunicationEvent", UtilMisc.toMap("messageId", inReplyTo[0])); parentCommEvent = EntityUtil.getFirst(events); } catch (GenericEntityException e) { Debug.logError(e, module); @@ -616,10 +616,10 @@ } // Retrieve all the addresses from the email - Set emailAddressesFrom = new TreeSet(); - Set emailAddressesTo = new TreeSet(); - Set emailAddressesCC = new TreeSet(); - Set emailAddressesBCC = new TreeSet(); + Set<String> emailAddressesFrom = new TreeSet<String>(); + Set<String> emailAddressesTo = new TreeSet<String>(); + Set<String> emailAddressesCC = new TreeSet<String>(); + Set<String> emailAddressesBCC = new TreeSet<String>(); for (int x = 0 ; x < addressesFrom.length ; x++) { emailAddressesFrom.add(((InternetAddress) addressesFrom[x]).getAddress()); } @@ -683,13 +683,13 @@ commEventMap.put("userLogin", userLogin); // Populate the CommunicationEvent.headerString field with the email headers - String headerString = ""; + StringBuilder headerString = new StringBuilder(); Enumeration headerLines = message.getAllHeaderLines(); while (headerLines.hasMoreElements()) { - headerString += System.getProperty("line.separator"); - headerString += headerLines.nextElement(); + headerString.append(System.getProperty("line.separator")); + headerString.append(headerLines.nextElement()); } - commEventMap.put("headerString", headerString); + commEventMap.put("headerString", headerString.toString()); result = dispatcher.runSync("createCommunicationEvent", commEventMap); communicationEventId = (String)result.get("communicationEventId"); @@ -705,7 +705,7 @@ createCommEventRoles(userLogin, delegator, dispatcher, communicationEventId, ccParties, "CC"); createCommEventRoles(userLogin, delegator, dispatcher, communicationEventId, bccParties, "BCC"); - Map results = ServiceUtil.returnSuccess(); + Map<String, Object> results = ServiceUtil.returnSuccess(); results.put("communicationEventId", communicationEventId); results.put("statusId", commEventMap.get("statusId")); return results; @@ -724,18 +724,18 @@ } } - private static void createCommEventRoles(GenericValue userLogin, GenericDelegator delegator, LocalDispatcher dispatcher, String communicationEventId, List parties, String roleTypeId) { + private static void createCommEventRoles(GenericValue userLogin, GenericDelegator delegator, LocalDispatcher dispatcher, String communicationEventId, List<Map<String, Object>> parties, String roleTypeId) { // It's not clear what the "role" of this communication event should be, so we'll just put _NA_ // check and see if this role was already created and ignore if true try { - Iterator it = parties.iterator(); + Iterator<Map<String, Object>> it = parties.iterator(); while (it.hasNext()) { - Map result = (Map) it.next(); + Map<String, Object> result = it.next(); String partyId = (String) result.get("partyId"); GenericValue commEventRole = delegator.findByPrimaryKey("CommunicationEventRole", UtilMisc.toMap("communicationEventId", communicationEventId, "partyId", partyId, "roleTypeId", roleTypeId)); if (commEventRole == null) { - Map input = UtilMisc.toMap("communicationEventId", communicationEventId, + Map<String, Object> input = UtilMisc.toMap("communicationEventId", communicationEventId, "partyId", partyId, "roleTypeId", roleTypeId, "userLogin", userLogin, "contactMechId", (String) result.get("contactMechId"), "statusId", "COM_ROLE_CREATED"); @@ -752,10 +752,10 @@ /* * Helper method to retrieve the party information from the first email address of the Address[] specified. */ - private static Map getParyInfoFromEmailAddress(Address [] addresses, GenericValue userLogin, LocalDispatcher dispatcher) throws GenericServiceException { + private static Map<String, Object> getParyInfoFromEmailAddress(Address [] addresses, GenericValue userLogin, LocalDispatcher dispatcher) throws GenericServiceException { InternetAddress emailAddress = null; - Map map = null; - Map result = null; + Map<String, Object> map = null; + Map<String, Object> result = null; if (addresses == null) { return null; @@ -781,22 +781,20 @@ /* * Calls findPartyFromEmailAddress service and returns a List of the results for the array of addresses */ - private static List buildListOfPartyInfoFromEmailAddresses(Address [] addresses, GenericValue userLogin, LocalDispatcher dispatcher) throws GenericServiceException { + private static List<Map<String, Object>> buildListOfPartyInfoFromEmailAddresses(Address [] addresses, GenericValue userLogin, LocalDispatcher dispatcher) throws GenericServiceException { InternetAddress emailAddress = null; - Address addr = null; Map map = null; - Map result = null; - List tempResults = FastList.newInstance(); + Map<String, Object> result = null; + List<Map<String, Object>> tempResults = FastList.newInstance(); if (addresses != null) { - for (int i = 0; i < addresses.length; i++) { - addr = addresses[i]; + for (Address addr: addresses) { if (addr instanceof InternetAddress) { emailAddress = (InternetAddress)addr; if (!UtilValidate.isEmpty(emailAddress)) { result = dispatcher.runSync("findPartyFromEmailAddress", - UtilMisc.<String, Object>toMap("address", emailAddress.getAddress(), "userLogin", userLogin)); + UtilMisc.toMap("address", emailAddress.getAddress(), "userLogin", userLogin)); if (result.get("partyId") != null) { tempResults.add(result); } @@ -808,7 +806,7 @@ } public static String contentIndex = ""; - private static Map addMessageBody( Map commEventMap, Multipart multipart) throws MessagingException, IOException { + private static Map<String, Object> addMessageBody( Map<String, Object> commEventMap, Multipart multipart) throws MessagingException, IOException { try { int multipartCount = multipart.getCount(); for (int i=0; i < multipartCount && i < 10; i++) { @@ -863,7 +861,7 @@ public static int addAttachmentsToCommEvent(Multipart messageContent, String subject, String communicationEventId, LocalDispatcher dispatcher, GenericValue userLogin) throws MessagingException, IOException, GenericServiceException { - Map commEventMap = FastMap.newInstance(); + Map<String, Object> commEventMap = FastMap.newInstance(); commEventMap.put("communicationEventId", communicationEventId); commEventMap.put("contentTypeId", "DOCUMENT"); commEventMap.put("mimeTypeId", "text/html"); @@ -877,7 +875,7 @@ } private static String currentIndex = ""; private static int attachmentCount = 0; - private static int addMultipartAttachementToComm(Multipart multipart, Map commEventMap, String subject, LocalDispatcher dispatcher, GenericValue userLogin) + private static int addMultipartAttachementToComm(Multipart multipart, Map<String, Object> commEventMap, String subject, LocalDispatcher dispatcher, GenericValue userLogin) throws MessagingException, IOException, GenericServiceException { try { int multipartCount = multipart.getCount(); From commitsderrickle@example.net Fri May 01 06:08:44 2009 Return-Path: <commitsderrickle@example.net> Delivered-To: derrickle@example.net Received: (qmail 86145 invoked from network); 1 May 2009 06:08:43 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 1 May 2009 06:08:43 -0000 Received: (qmail 623 invoked by uid 500); 1 May 2009 06:08:43 -0000 Delivered-To: derrickle@example.net Received: (qmail 553 invoked by uid 500); 1 May 2009 06:08:43 -0000 Mailing-List: contact derrickle@example.net; run by ezmlm Precedence: bulk List-Help: <mailto:derrickle@example.net> List-Unsubscribe: <mailto:derrickle@example.net> List-Post: <mailto:derrickle@example.net> List-Id: <commits.ofbiz.apache.org> Reply-To: derrickle@example.net Delivered-To: mailing list derrickle@example.net Received: (qmail 542 invoked by uid 99); 1 May 2009 06:08:43 -0000 Received: from nike.apache.org (HELO nike.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 01 May 2009 06:08:43 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [83.161.120.155] (HELO eris.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 01 May 2009 06:08:41 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 67FC623888A3; Fri, 1 May 2009 06:08:20 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r770544 - /ofbiz/trunk/applications/product/src/org/ofbiz/shipment/thirdparty/usps/UspsServices.java Date: Fri, 01 May 2009 06:08:20 -0000 To: derrickle@example.net From: derrickle@example.net X-Mailer: svnmailer-1.0.8 Message-Id: <derrickle@example.net> X-Virus-Checked: Checked by ClamAV on apache.org Author: lektran Date: Fri May 1 06:08:19 2009 New Revision: 770544 URL: http://svn.apache.org/viewvc?rev=770544&view=rev Log: Fix an index out of bounds exception I stumbled across Modified: ofbiz/trunk/applications/product/src/org/ofbiz/shipment/thirdparty/usps/UspsServices.java Modified: ofbiz/trunk/applications/product/src/org/ofbiz/shipment/thirdparty/usps/UspsServices.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/src/org/ofbiz/shipment/thirdparty/usps/UspsServices.java?rev=770544&r1=770543&r2=770544&view=diff ============================================================================== --- ofbiz/trunk/applications/product/src/org/ofbiz/shipment/thirdparty/usps/UspsServices.java (original) +++ ofbiz/trunk/applications/product/src/org/ofbiz/shipment/thirdparty/usps/UspsServices.java Fri May 1 06:08:19 2009 @@ -37,6 +37,7 @@ import javolution.util.FastList; import javolution.util.FastMap; +import org.apache.commons.lang.StringUtils; import org.apache.xml.serialize.OutputFormat; import org.apache.xml.serialize.XMLSerializer; import org.ofbiz.base.util.Base64; @@ -168,8 +169,8 @@ packageElement.setAttribute("ID", String.valueOf(li.nextIndex() - 1)); // use zero-based index (see examples) UtilXml.addChildElementValue(packageElement, "Service", serviceCode, requestDocument); - UtilXml.addChildElementValue(packageElement, "ZipOrigination", originationZip.substring(0,5), requestDocument); - UtilXml.addChildElementValue(packageElement, "ZipDestination", destinationZip.substring(0,5), requestDocument); + UtilXml.addChildElementValue(packageElement, "ZipOrigination", StringUtils.substring(originationZip, 0, 5), requestDocument); + UtilXml.addChildElementValue(packageElement, "ZipDestination", StringUtils.substring(destinationZip, 0, 5), requestDocument); BigDecimal weightPounds = packageWeight.setScale(0, BigDecimal.ROUND_FLOOR); // for Parcel post, the weight must be at least 1 lb From commitsderrickle@example.net Fri May 01 06:12:04 2009 Return-Path: <commitsderrickle@example.net> Delivered-To: derrickle@example.net Received: (qmail 87731 invoked from network); 1 May 2009 06:12:04 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 1 May 2009 06:12:04 -0000 Received: (qmail 1343 invoked by uid 500); 1 May 2009 06:12:03 -0000 Delivered-To: derrickle@example.net Received: (qmail 1281 invoked by uid 500); 1 May 2009 06:12:03 -0000 Mailing-List: contact derrickle@example.net; run by ezmlm Precedence: bulk List-Help: <mailto:derrickle@example.net> List-Unsubscribe: <mailto:derrickle@example.net> List-Post: <mailto:derrickle@example.net> List-Id: <commits.ofbiz.apache.org> Reply-To: derrickle@example.net Delivered-To: mailing list derrickle@example.net Received: (qmail 1272 invoked by uid 99); 1 May 2009 06:12:03 -0000 Received: from nike.apache.org (HELO nike.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 01 May 2009 06:12:03 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [83.161.120.155] (HELO eris.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 01 May 2009 06:12:01 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id AFEDE23888E7; Fri, 1 May 2009 06:11:40 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r770545 - /ofbiz/branches/release09.04/applications/product/src/org/ofbiz/shipment/thirdparty/usps/UspsServices.java Date: Fri, 01 May 2009 06:11:40 -0000 To: derrickle@example.net From: derrickle@example.net X-Mailer: svnmailer-1.0.8 Message-Id: <derrickle@example.net> X-Virus-Checked: Checked by ClamAV on apache.org Author: lektran Date: Fri May 1 06:11:40 2009 New Revision: 770545 URL: http://svn.apache.org/viewvc?rev=770545&view=rev Log: Merged from trunk r770544 Fix an index out of bounds exception I stumbled across Modified: ofbiz/branches/release09.04/applications/product/src/org/ofbiz/shipment/thirdparty/usps/UspsServices.java Modified: ofbiz/branches/release09.04/applications/product/src/org/ofbiz/shipment/thirdparty/usps/UspsServices.java URL: http://svn.apache.org/viewvc/ofbiz/branches/release09.04/applications/product/src/org/ofbiz/shipment/thirdparty/usps/UspsServices.java?rev=770545&r1=770544&r2=770545&view=diff ============================================================================== --- ofbiz/branches/release09.04/applications/product/src/org/ofbiz/shipment/thirdparty/usps/UspsServices.java (original) +++ ofbiz/branches/release09.04/applications/product/src/org/ofbiz/shipment/thirdparty/usps/UspsServices.java Fri May 1 06:11:40 2009 @@ -37,6 +37,7 @@ import javolution.util.FastList; import javolution.util.FastMap; +import org.apache.commons.lang.StringUtils; import org.apache.xml.serialize.OutputFormat; import org.apache.xml.serialize.XMLSerializer; import org.ofbiz.base.util.Base64; @@ -168,8 +169,8 @@ packageElement.setAttribute("ID", String.valueOf(li.nextIndex() - 1)); // use zero-based index (see examples) UtilXml.addChildElementValue(packageElement, "Service", serviceCode, requestDocument); - UtilXml.addChildElementValue(packageElement, "ZipOrigination", originationZip.substring(0,5), requestDocument); - UtilXml.addChildElementValue(packageElement, "ZipDestination", destinationZip.substring(0,5), requestDocument); + UtilXml.addChildElementValue(packageElement, "ZipOrigination", StringUtils.substring(originationZip, 0, 5), requestDocument); + UtilXml.addChildElementValue(packageElement, "ZipDestination", StringUtils.substring(destinationZip, 0, 5), requestDocument); BigDecimal weightPounds = packageWeight.setScale(0, BigDecimal.ROUND_FLOOR); // for Parcel post, the weight must be at least 1 lb From commitsderrickle@example.net Fri May 01 08:08:27 2009 Return-Path: <commitsderrickle@example.net> Delivered-To: derrickle@example.net Received: (qmail 19903 invoked from network); 1 May 2009 08:08:27 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 1 May 2009 08:08:27 -0000 Received: (qmail 62181 invoked by uid 500); 1 May 2009 08:08:26 -0000 Delivered-To: derrickle@example.net Received: (qmail 62095 invoked by uid 500); 1 May 2009 08:08:26 -0000 Mailing-List: contact derrickle@example.net; run by ezmlm Precedence: bulk List-Help: <mailto:derrickle@example.net> List-Unsubscribe: <mailto:derrickle@example.net> List-Post: <mailto:derrickle@example.net> List-Id: <commits.ofbiz.apache.org> Reply-To: derrickle@example.net Delivered-To: mailing list derrickle@example.net Received: (qmail 62086 invoked by uid 99); 1 May 2009 08:08:26 -0000 Received: from athena.apache.org (HELO athena.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 01 May 2009 08:08:26 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [83.161.120.155] (HELO eris.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 01 May 2009 08:08:25 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id A57C42388961; Fri, 1 May 2009 08:08:05 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r770571 - /ofbiz/trunk/applications/product/script/org/ofbiz/shipment/picklist/PicklistServices.xml Date: Fri, 01 May 2009 08:08:05 -0000 To: derrickle@example.net From: derrickle@example.net X-Mailer: svnmailer-1.0.8 Message-Id: <derrickle@example.net> X-Virus-Checked: Checked by ClamAV on apache.org Author: lektran Date: Fri May 1 08:08:04 2009 New Revision: 770571 URL: http://svn.apache.org/viewvc?rev=770571&view=rev Log: Fix bug where a list was inadvertently being appended to rather than replaced. Reported in OFBIZ-2396 by Brian Sanders Modified: ofbiz/trunk/applications/product/script/org/ofbiz/shipment/picklist/PicklistServices.xml Modified: ofbiz/trunk/applications/product/script/org/ofbiz/shipment/picklist/PicklistServices.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/script/org/ofbiz/shipment/picklist/PicklistServices.xml?rev=770571&r1=770570&r2=770571&view=diff ============================================================================== --- ofbiz/trunk/applications/product/script/org/ofbiz/shipment/picklist/PicklistServices.xml (original) +++ ofbiz/trunk/applications/product/script/org/ofbiz/shipment/picklist/PicklistServices.xml Fri May 1 08:08:04 2009 @@ -1221,7 +1221,7 @@ <set from-field="picklistRoleInfoList" field="picklistInfo.picklistRoleInfoList"/> <set from-field="picklistStatusHistoryInfoList" field="picklistInfo.picklistStatusHistoryInfoList"/> <set from-field="picklistBinInfoList" field="picklistInfo.picklistBinInfoList"/> - <string-to-list string="sequenceId" list="orderBy"/> + <set value="sequenceId" field="orderBy" type="List"/> <get-related-one value-field="picklist" relation-name="StatusItem" to-value-field="picklistInfo.statusItem" use-cache="true"/> <get-related-one value-field="picklist" relation-name="Facility" to-value-field="picklistInfo.facility" use-cache="true"/> <get-related-one value-field="picklist" relation-name="ShipmentMethodType" to-value-field="picklistInfo.shipmentMethodType" use-cache="true"/> From commitsderrickle@example.net Fri May 01 08:12:17 2009 Return-Path: <commitsderrickle@example.net> Delivered-To: derrickle@example.net Received: (qmail 21170 invoked from network); 1 May 2009 08:12:17 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 1 May 2009 08:12:17 -0000 Received: (qmail 67615 invoked by uid 500); 1 May 2009 08:12:17 -0000 Delivered-To: derrickle@example.net Received: (qmail 67563 invoked by uid 500); 1 May 2009 08:12:17 -0000 Mailing-List: contact derrickle@example.net; run by ezmlm Precedence: bulk List-Help: <mailto:derrickle@example.net> List-Unsubscribe: <mailto:derrickle@example.net> List-Post: <mailto:derrickle@example.net> List-Id: <commits.ofbiz.apache.org> Reply-To: derrickle@example.net Delivered-To: mailing list derrickle@example.net Received: (qmail 67554 invoked by uid 99); 1 May 2009 08:12:16 -0000 Received: from nike.apache.org (HELO nike.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 01 May 2009 08:12:16 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [83.161.120.155] (HELO eris.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 01 May 2009 08:12:14 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id D33FD2388961; Fri, 1 May 2009 08:11:53 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r770574 - /ofbiz/branches/release09.04/applications/product/script/org/ofbiz/shipment/picklist/PicklistServices.xml Date: Fri, 01 May 2009 08:11:53 -0000 To: derrickle@example.net From: derrickle@example.net X-Mailer: svnmailer-1.0.8 Message-Id: <derrickle@example.net> X-Virus-Checked: Checked by ClamAV on apache.org Author: lektran Date: Fri May 1 08:11:53 2009 New Revision: 770574 URL: http://svn.apache.org/viewvc?rev=770574&view=rev Log: Merged from trunk r770571 Fix bug where a list was inadvertently being appended to rather than replaced. Reported in OFBIZ-2396 by Brian Sanders Modified: ofbiz/branches/release09.04/applications/product/script/org/ofbiz/shipment/picklist/PicklistServices.xml Modified: ofbiz/branches/release09.04/applications/product/script/org/ofbiz/shipment/picklist/PicklistServices.xml URL: http://svn.apache.org/viewvc/ofbiz/branches/release09.04/applications/product/script/org/ofbiz/shipment/picklist/PicklistServices.xml?rev=770574&r1=770573&r2=770574&view=diff ============================================================================== --- ofbiz/branches/release09.04/applications/product/script/org/ofbiz/shipment/picklist/PicklistServices.xml (original) +++ ofbiz/branches/release09.04/applications/product/script/org/ofbiz/shipment/picklist/PicklistServices.xml Fri May 1 08:11:53 2009 @@ -1178,7 +1178,7 @@ <set from-field="picklistRoleInfoList" field="picklistInfo.picklistRoleInfoList"/> <set from-field="picklistStatusHistoryInfoList" field="picklistInfo.picklistStatusHistoryInfoList"/> <set from-field="picklistBinInfoList" field="picklistInfo.picklistBinInfoList"/> - <string-to-list string="sequenceId" list="orderBy"/> + <set value="sequenceId" field="orderBy" type="List"/> <get-related-one value-field="picklist" relation-name="StatusItem" to-value-field="picklistInfo.statusItem" use-cache="true"/> <get-related-one value-field="picklist" relation-name="Facility" to-value-field="picklistInfo.facility" use-cache="true"/> <get-related-one value-field="picklist" relation-name="ShipmentMethodType" to-value-field="picklistInfo.shipmentMethodType" use-cache="true"/> From commitsderrickle@example.net Fri May 01 08:16:03 2009 Return-Path: <commitsderrickle@example.net> Delivered-To: derrickle@example.net Received: (qmail 21830 invoked from network); 1 May 2009 08:16:02 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 1 May 2009 08:16:02 -0000 Received: (qmail 70265 invoked by uid 500); 1 May 2009 08:16:02 -0000 Delivered-To: derrickle@example.net Received: (qmail 70180 invoked by uid 500); 1 May 2009 08:16:02 -0000 Mailing-List: contact derrickle@example.net; run by ezmlm Precedence: bulk List-Help: <mailto:derrickle@example.net> List-Unsubscribe: <mailto:derrickle@example.net> List-Post: <mailto:derrickle@example.net> List-Id: <commits.ofbiz.apache.org> Reply-To: derrickle@example.net Delivered-To: mailing list derrickle@example.net Received: (qmail 70171 invoked by uid 99); 1 May 2009 08:16:02 -0000 Received: from athena.apache.org (HELO athena.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 01 May 2009 08:16:02 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [83.161.120.155] (HELO eris.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 01 May 2009 08:16:01 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 7716A2388961; Fri, 1 May 2009 08:15:41 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r770575 - /ofbiz/branches/release4.0/applications/product/script/org/ofbiz/shipment/picklist/PicklistServices.xml Date: Fri, 01 May 2009 08:15:41 -0000 To: derrickle@example.net From: derrickle@example.net X-Mailer: svnmailer-1.0.8 Message-Id: <derrickle@example.net> X-Virus-Checked: Checked by ClamAV on apache.org Author: lektran Date: Fri May 1 08:15:41 2009 New Revision: 770575 URL: http://svn.apache.org/viewvc?rev=770575&view=rev Log: Merged from trunk r770571 Fix bug where a list was inadvertently being appended to rather than replaced. Reported in OFBIZ-2396 by Brian Sanders Modified: ofbiz/branches/release4.0/applications/product/script/org/ofbiz/shipment/picklist/PicklistServices.xml Modified: ofbiz/branches/release4.0/applications/product/script/org/ofbiz/shipment/picklist/PicklistServices.xml URL: http://svn.apache.org/viewvc/ofbiz/branches/release4.0/applications/product/script/org/ofbiz/shipment/picklist/PicklistServices.xml?rev=770575&r1=770574&r2=770575&view=diff ============================================================================== --- ofbiz/branches/release4.0/applications/product/script/org/ofbiz/shipment/picklist/PicklistServices.xml (original) +++ ofbiz/branches/release4.0/applications/product/script/org/ofbiz/shipment/picklist/PicklistServices.xml Fri May 1 08:15:41 2009 @@ -1074,7 +1074,7 @@ <set from-field="picklistRoleInfoList" field="picklistInfo.picklistRoleInfoList"/> <set from-field="picklistStatusHistoryInfoList" field="picklistInfo.picklistStatusHistoryInfoList"/> <set from-field="picklistBinInfoList" field="picklistInfo.picklistBinInfoList"/> - <string-to-list string="sequenceId" list-name="orderBy"/> + <set value="sequenceId" field="orderBy" type="List"/> <get-related-one value-name="picklist" relation-name="StatusItem" to-value-name="picklistInfo.statusItem" use-cache="true"/> <get-related-one value-name="picklist" relation-name="Facility" to-value-name="picklistInfo.facility" use-cache="true"/> <get-related-one value-name="picklist" relation-name="ShipmentMethodType" to-value-name="picklistInfo.shipmentMethodType" use-cache="true"/> From commitsderrickle@example.net Fri May 01 09:20:08 2009 Return-Path: <commitsderrickle@example.net> Delivered-To: derrickle@example.net Received: (qmail 36594 invoked from network); 1 May 2009 09:20:06 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 1 May 2009 09:20:06 -0000 Received: (qmail 14584 invoked by uid 500); 1 May 2009 09:20:05 -0000 Delivered-To: derrickle@example.net Received: (qmail 14511 invoked by uid 500); 1 May 2009 09:20:05 -0000 Mailing-List: contact derrickle@example.net; run by ezmlm Precedence: bulk List-Help: <mailto:derrickle@example.net> List-Unsubscribe: <mailto:derrickle@example.net> List-Post: <mailto:derrickle@example.net> List-Id: <commits.ofbiz.apache.org> Reply-To: derrickle@example.net Delivered-To: mailing list derrickle@example.net Received: (qmail 14502 invoked by uid 99); 1 May 2009 09:20:05 -0000 Received: from athena.apache.org (HELO athena.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 01 May 2009 09:20:05 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [83.161.120.155] (HELO eris.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 01 May 2009 09:20:04 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 8C57123888CA; Fri, 1 May 2009 09:19:43 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r770596 - /ofbiz/trunk/applications/securityext/src/org/ofbiz/securityext/test/AuthorizationTests.java Date: Fri, 01 May 2009 09:19:43 -0000 To: derrickle@example.net From: derrickle@example.net X-Mailer: svnmailer-1.0.8 Message-Id: <derrickle@example.net> X-Virus-Checked: Checked by ClamAV on apache.org Author: lektran Date: Fri May 1 09:19:43 2009 New Revision: 770596 URL: http://svn.apache.org/viewvc?rev=770596&view=rev Log: Removed unnecessary delegator since a test delegator is provided by the parent class. I need to make it final so this doesn't happen but JUnit instantiates the object so I can't do it without extending their class. It's on my todo list. Modified: ofbiz/trunk/applications/securityext/src/org/ofbiz/securityext/test/AuthorizationTests.java Modified: ofbiz/trunk/applications/securityext/src/org/ofbiz/securityext/test/AuthorizationTests.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/securityext/src/org/ofbiz/securityext/test/AuthorizationTests.java?rev=770596&r1=770595&r2=770596&view=diff ============================================================================== --- ofbiz/trunk/applications/securityext/src/org/ofbiz/securityext/test/AuthorizationTests.java (original) +++ ofbiz/trunk/applications/securityext/src/org/ofbiz/securityext/test/AuthorizationTests.java Fri May 1 09:19:43 2009 @@ -3,7 +3,6 @@ import java.util.Map; import org.ofbiz.base.util.Debug; -import org.ofbiz.entity.GenericDelegator; import org.ofbiz.security.SecurityConfigurationException; import org.ofbiz.security.authz.Authorization; import org.ofbiz.security.authz.AuthorizationFactory; @@ -12,12 +11,10 @@ public class AuthorizationTests extends OFBizTestCase { private static final String module = AuthorizationTests.class.getName(); - protected GenericDelegator delegator; protected Authorization security; public AuthorizationTests(String name) throws SecurityConfigurationException { super(name); - delegator = GenericDelegator.getGenericDelegator("default"); security = AuthorizationFactory.getInstance(delegator); } From commitsderrickle@example.net Fri May 01 10:28:58 2009 Return-Path: <commitsderrickle@example.net> Delivered-To: derrickle@example.net Received: (qmail 81327 invoked from network); 1 May 2009 10:28:58 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 1 May 2009 10:28:58 -0000 Received: (qmail 71306 invoked by uid 500); 1 May 2009 10:28:58 -0000 Delivered-To: derrickle@example.net Received: (qmail 71226 invoked by uid 500); 1 May 2009 10:28:58 -0000 Mailing-List: contact derrickle@example.net; run by ezmlm Precedence: bulk List-Help: <mailto:derrickle@example.net> List-Unsubscribe: <mailto:derrickle@example.net> List-Post: <mailto:derrickle@example.net> List-Id: <commits.ofbiz.apache.org> Reply-To: derrickle@example.net Delivered-To: mailing list derrickle@example.net Received: (qmail 71216 invoked by uid 99); 1 May 2009 10:28:58 -0000 Received: from athena.apache.org (HELO athena.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 01 May 2009 10:28:58 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [83.161.120.155] (HELO eris.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 01 May 2009 10:28:56 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id CCDD123889F6; Fri, 1 May 2009 10:28:35 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r770618 - in /ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting: ./ agreement/ finaccount/ invoice/ thirdparty/authorizedotnet/ Date: Fri, 01 May 2009 10:28:35 -0000 To: derrickle@example.net From: derrickle@example.net X-Mailer: svnmailer-1.0.8 Message-Id: <derrickle@example.net> X-Virus-Checked: Checked by ClamAV on apache.org Author: lektran Date: Fri May 1 10:28:34 2009 New Revision: 770618 URL: http://svn.apache.org/viewvc?rev=770618&view=rev Log: Code cleanups, generics etc. Modified: ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/GlEvents.java ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/agreement/AgreementServices.java ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/finaccount/FinAccountPaymentServices.java ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/finaccount/FinAccountProductServices.java ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/finaccount/FinAccountServices.java ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/invoice/InvoiceServices.java ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/invoice/InvoiceWorker.java ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/authorizedotnet/AuthorizeResponse.java Modified: ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/GlEvents.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/GlEvents.java?rev=770618&r1=770617&r2=770618&view=diff ============================================================================== --- ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/GlEvents.java (original) +++ ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/GlEvents.java Fri May 1 10:28:34 2009 @@ -18,35 +18,32 @@ *******************************************************************************/ package org.ofbiz.accounting; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - import java.math.BigDecimal; -import java.util.Map; import java.util.List; -import java.util.Iterator; +import java.util.Map; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; import org.ofbiz.base.util.Debug; +import org.ofbiz.base.util.UtilDateTime; import org.ofbiz.base.util.UtilHttp; import org.ofbiz.base.util.UtilMisc; -import org.ofbiz.base.util.UtilDateTime; -import org.ofbiz.base.util.UtilValidate; import org.ofbiz.entity.GenericDelegator; import org.ofbiz.entity.GenericEntityException; import org.ofbiz.entity.GenericValue; +import org.ofbiz.service.GenericServiceException; import org.ofbiz.service.LocalDispatcher; import org.ofbiz.service.ServiceUtil; -import org.ofbiz.service.GenericServiceException; -import org.ofbiz.webapp.event.EventHandlerException; public class GlEvents { public static final String module = GlEvents.class.getName(); -public static String createReconcileAccount(HttpServletRequest request,HttpServletResponse response) { +public static String createReconcileAccount(HttpServletRequest request, HttpServletResponse response) { LocalDispatcher dispatcher = (LocalDispatcher) request.getAttribute("dispatcher"); final GenericDelegator delegator = (GenericDelegator)request.getAttribute("delegator"); GenericValue userLogin = (GenericValue) request.getSession().getAttribute("userLogin"); - Map ctx = UtilHttp.getParameterMap(request); + Map<String, Object> ctx = UtilHttp.getParameterMap(request); String acctgTransId; String acctgTransEntrySeqId; String glAccountId = null; @@ -67,21 +64,16 @@ acctgTransEntrySeqId = (String) ctx.get("acctgTransEntrySeqId" + suffix); organizationPartyId = (String) ctx.get("organizationPartyId" + suffix); glAccountId = (String) ctx.get("glAccountId" + suffix); - GenericValue acctgTransEntry; try { - List acctgTransEntries = delegator.findByAnd("AcctgTransEntry", UtilMisc.toMap("acctgTransId", acctgTransId, "acctgTransEntrySeqId", acctgTransEntrySeqId)); - if (acctgTransEntries.size() > 0) { - Iterator acctgTransEntryItr = acctgTransEntries.iterator(); - while (acctgTransEntryItr.hasNext()) { //calculate amount for each AcctgTransEntry according to glAccountId based on debit and credit - acctgTransEntry = (GenericValue) acctgTransEntryItr.next(); - debitCreditFlag = (String) acctgTransEntry.getString("debitCreditFlag"); + List<GenericValue> acctgTransEntries = delegator.findByAnd("AcctgTransEntry", UtilMisc.toMap("acctgTransId", acctgTransId, "acctgTransEntrySeqId", acctgTransEntrySeqId)); + for (GenericValue acctgTransEntry : acctgTransEntries) { //calculate amount for each AcctgTransEntry according to glAccountId based on debit and credit + debitCreditFlag = acctgTransEntry.getString("debitCreditFlag"); if ("D".equalsIgnoreCase(debitCreditFlag)) { amount = amount.add(acctgTransEntry.getBigDecimal("amount")); //for debit } else { - amount = amount.subtract(acctgTransEntry.getBigDecimal("amount")); //for credit + amount = amount.subtract(acctgTransEntry.getBigDecimal("amount")); //for credit } } - } reconciledBalance = reconciledBalance.add(amount); //total balance per glAccountId } catch (GenericEntityException e) { Debug.logError(e, module); @@ -89,8 +81,8 @@ } } - Map fieldMap = UtilMisc.toMap("glReconciliationName", "Reconciliation at date " + UtilDateTime.nowTimestamp(), "glAccountId", glAccountId, "organizationPartyId", organizationPartyId, "reconciledDate", UtilDateTime.nowTimestamp(), "reconciledBalance", reconciledBalance, "userLogin", userLogin); - Map glReconResult = null; + Map<String, Object> fieldMap = UtilMisc.toMap("glReconciliationName", "Reconciliation at date " + UtilDateTime.nowTimestamp(), "glAccountId", glAccountId, "organizationPartyId", organizationPartyId, "reconciledDate", UtilDateTime.nowTimestamp(), "reconciledBalance", reconciledBalance, "userLogin", userLogin); + Map<String, Object> glReconResult = null; try { glReconResult = dispatcher.runSync("createGlReconciliation", fieldMap); //create GlReconciliation for the glAccountId if (ServiceUtil.isError(glReconResult)) { @@ -110,27 +102,22 @@ } acctgTransId = (String) ctx.get("acctgTransId" + suffix); acctgTransEntrySeqId = (String) ctx.get("acctgTransEntrySeqId" + suffix); - GenericValue acctgTransEntry; try { - List acctgTransEntries = delegator.findByAnd("AcctgTransEntry", UtilMisc.toMap("acctgTransId", acctgTransId, "acctgTransEntrySeqId", acctgTransEntrySeqId)); - if (acctgTransEntries.size() > 0) { - Iterator acctgTransEntryItr = acctgTransEntries.iterator(); - while (acctgTransEntryItr.hasNext()) { - acctgTransEntry = (GenericValue) acctgTransEntryItr.next(); - reconciledAmount = acctgTransEntry.getString("amount"); - acctgTransId = acctgTransEntry.getString("acctgTransId"); - acctgTransEntrySeqId = acctgTransEntry.getString("acctgTransEntrySeqId"); - Map glReconEntryMap = UtilMisc.toMap("glReconciliationId", glReconciliationId, "acctgTransId", acctgTransId, "acctgTransEntrySeqId", acctgTransEntrySeqId, "reconciledAmount", reconciledAmount, "userLogin", userLogin); - Map glReconEntryResult = null; - try { - glReconEntryResult = dispatcher.runSync("createGlReconciliationEntry", glReconEntryMap); - if (ServiceUtil.isError(glReconEntryResult)) { - return "error"; - } - } catch (GenericServiceException e) { - Debug.logError(e, module); + List<GenericValue> acctgTransEntries = delegator.findByAnd("AcctgTransEntry", UtilMisc.toMap("acctgTransId", acctgTransId, "acctgTransEntrySeqId", acctgTransEntrySeqId)); + for (GenericValue acctgTransEntry : acctgTransEntries) { + reconciledAmount = acctgTransEntry.getString("amount"); + acctgTransId = acctgTransEntry.getString("acctgTransId"); + acctgTransEntrySeqId = acctgTransEntry.getString("acctgTransEntrySeqId"); + Map<String, Object> glReconEntryMap = UtilMisc.toMap("glReconciliationId", glReconciliationId, "acctgTransId", acctgTransId, "acctgTransEntrySeqId", acctgTransEntrySeqId, "reconciledAmount", reconciledAmount, "userLogin", userLogin); + Map<String, Object> glReconEntryResult = null; + try { + glReconEntryResult = dispatcher.runSync("createGlReconciliationEntry", glReconEntryMap); + if (ServiceUtil.isError(glReconEntryResult)) { return "error"; } + } catch (GenericServiceException e) { + Debug.logError(e, module); + return "error"; } } } catch (GenericEntityException e) { Modified: ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/agreement/AgreementServices.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/agreement/AgreementServices.java?rev=770618&r1=770617&r2=770618&view=diff ============================================================================== --- ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/agreement/AgreementServices.java (original) +++ ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/agreement/AgreementServices.java Fri May 1 10:28:34 2009 @@ -20,11 +20,12 @@ package org.ofbiz.accounting.agreement; import java.math.BigDecimal; -import java.util.Iterator; import java.util.List; import java.util.Locale; import java.util.Map; + import javolution.util.FastList; + import org.ofbiz.base.util.Debug; import org.ofbiz.base.util.UtilMisc; import org.ofbiz.base.util.UtilNumber; @@ -75,11 +76,11 @@ * currencyUomId String Currency * productId String Product Id */ - public static Map getCommissionForProduct(DispatchContext ctx, Map context) { + public static Map<String, Object> getCommissionForProduct(DispatchContext ctx, Map<String, Object> context) { GenericDelegator delegator = ctx.getDelegator(); Locale locale = (Locale) context.get("locale"); String errMsg = null; - List commissions = FastList.newInstance(); + List<Map<String, Object>> commissions = FastList.newInstance(); try { BigDecimal amount = ((BigDecimal)context.get("amount")); @@ -94,12 +95,12 @@ // Collect agreementItems applicable to this orderItem/returnItem // TODO: partyIds should be part of this query! - List agreementItems = delegator.findByAndCache("AgreementItemAndProductAppl", UtilMisc.toMap( + List<GenericValue> agreementItems = delegator.findByAndCache("AgreementItemAndProductAppl", UtilMisc.toMap( "productId", productId, "agreementItemTypeId", "AGREEMENT_COMMISSION")); // Try the first available virtual product if this is a variant product if (agreementItems.size() == 0) { - List productAssocs = delegator.findByAndCache("ProductAssoc", UtilMisc.toMap( + List<GenericValue> productAssocs = delegator.findByAndCache("ProductAssoc", UtilMisc.toMap( "productIdTo", productId, "productAssocTypeId", "PRODUCT_VARIANT")); productAssocs = EntityUtil.filterByDate(productAssocs); @@ -113,10 +114,8 @@ // this is not very efficient if there were many agreementItems = EntityUtil.filterByDate(agreementItems); - Iterator it = agreementItems.iterator(); - while (it.hasNext()) { - GenericValue agreementItem = (GenericValue) it.next(); - List terms = delegator.findByAndCache("AgreementTerm", UtilMisc.toMap( + for (GenericValue agreementItem : agreementItems) { + List<GenericValue> terms = delegator.findByAndCache("AgreementTerm", UtilMisc.toMap( "agreementId", agreementItem.getString("agreementId"), "agreementItemSeqId", agreementItem.getString("agreementItemSeqId"), "invoiceItemTypeId", invoiceItemTypeId)); @@ -127,11 +126,9 @@ // number of days due for commission, which will be the lowest termDays of all the AgreementTerms long days = -1; - Iterator itt = terms.iterator(); - while (itt.hasNext()) { - GenericValue elem = (GenericValue) itt.next(); - String termTypeId = elem.getString("termTypeId"); - BigDecimal termValue = elem.getBigDecimal("termValue"); + for (GenericValue term : terms) { + String termTypeId = term.getString("termTypeId"); + BigDecimal termValue = term.getBigDecimal("termValue"); if (termValue != null) { if (termTypeId.equals("FIN_COMM_FIXED")) { commission = commission.add(termValue.multiply(quantity)); @@ -147,7 +144,7 @@ } // see if we need to update the number of days for paying commission - Long termDays = elem.getLong("termDays"); + Long termDays = term.getLong("termDays"); if (termDays != null) { // if days is greater than zero, then it has been set with another value, so we use the lowest term days // if days is less than zero, then it has not been set yet. @@ -165,7 +162,7 @@ commission = negative ? commission.negate() : commission; commission = commission.setScale(decimals, rounding); - Map partyCommissionResult = UtilMisc.toMap( + Map<String, Object> partyCommissionResult = UtilMisc.toMap( "partyIdFrom", agreementItem.getString("partyIdFrom"), "partyIdTo", agreementItem.getString("partyIdTo"), "commission", commission, @@ -179,7 +176,7 @@ } } catch (GenericEntityException e) { Debug.logWarning(e, module); - Map messageMap = UtilMisc.toMap("errMessage", e.getMessage()); + Map<String, String> messageMap = UtilMisc.toMap("errMessage", e.getMessage()); errMsg = UtilProperties.getMessage("CommonUiLabels", "CommonDatabaseProblem", messageMap, locale); return ServiceUtil.returnError(errMsg); } Modified: ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/finaccount/FinAccountPaymentServices.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/finaccount/FinAccountPaymentServices.java?rev=770618&r1=770617&r2=770618&view=diff ============================================================================== --- ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/finaccount/FinAccountPaymentServices.java (original) +++ ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/finaccount/FinAccountPaymentServices.java Fri May 1 10:28:34 2009 @@ -19,33 +19,36 @@ package org.ofbiz.accounting.finaccount; -import org.ofbiz.service.DispatchContext; -import org.ofbiz.service.LocalDispatcher; -import org.ofbiz.service.ServiceUtil; -import org.ofbiz.service.GenericServiceException; +import java.math.BigDecimal; +import java.sql.Timestamp; +import java.util.List; +import java.util.Map; + +import javolution.util.FastList; +import javolution.util.FastMap; + +import org.ofbiz.accounting.payment.PaymentGatewayServices; +import org.ofbiz.base.util.Debug; +import org.ofbiz.base.util.GeneralException; +import org.ofbiz.base.util.UtilDateTime; +import org.ofbiz.base.util.UtilMisc; +import org.ofbiz.base.util.UtilProperties; +import org.ofbiz.base.util.UtilValidate; import org.ofbiz.entity.GenericDelegator; -import org.ofbiz.entity.GenericValue; import org.ofbiz.entity.GenericEntityException; +import org.ofbiz.entity.GenericValue; import org.ofbiz.entity.condition.EntityCondition; import org.ofbiz.entity.condition.EntityExpr; import org.ofbiz.entity.condition.EntityOperator; -import org.ofbiz.entity.condition.EntityConditionList; import org.ofbiz.entity.util.EntityFindOptions; import org.ofbiz.entity.util.EntityUtil; -import org.ofbiz.base.util.*; -import org.ofbiz.order.order.OrderReadHelper; import org.ofbiz.order.finaccount.FinAccountHelper; -import org.ofbiz.accounting.payment.PaymentGatewayServices; +import org.ofbiz.order.order.OrderReadHelper; import org.ofbiz.product.store.ProductStoreWorker; - -import java.util.Map; -import java.util.List; -import java.util.Set; -import java.math.BigDecimal; -import java.sql.Timestamp; - -import javolution.util.FastMap; -import javolution.util.FastList; +import org.ofbiz.service.DispatchContext; +import org.ofbiz.service.GenericServiceException; +import org.ofbiz.service.LocalDispatcher; +import org.ofbiz.service.ServiceUtil; /** * FinAccountPaymentServices - Financial account used as payment method @@ -54,8 +57,8 @@ public static final String module = FinAccountPaymentServices.class.getName(); - // base payment intergration services - public static Map finAccountPreAuth(DispatchContext dctx, Map context) { + // base payment integration services + public static Map<String, Object> finAccountPreAuth(DispatchContext dctx, Map<String, Object> context) { LocalDispatcher dispatcher = dctx.getDispatcher(); GenericDelegator delegator = dctx.getDelegator(); GenericValue userLogin = (GenericValue) context.get("userLogin"); @@ -70,7 +73,7 @@ // check for an existing auth trans and cancel it GenericValue authTrans = PaymentGatewayServices.getAuthTransaction(paymentPref); if (authTrans != null) { - Map input = UtilMisc.toMap("userLogin", userLogin, "finAccountAuthId", authTrans.get("referenceNum")); + Map<String, Object> input = UtilMisc.toMap("userLogin", userLogin, "finAccountAuthId", authTrans.get("referenceNum")); try { dispatcher.runSync("expireFinAccountAuth", input); } catch (GenericServiceException e) { @@ -123,7 +126,7 @@ try { // fin the store requires a pin number; validate the PIN with the code - Map findProductStoreFinActSettingMap = UtilMisc.toMap("productStoreId", productStoreId, "finAccountTypeId", finAccountTypeId); + Map<String, Object> findProductStoreFinActSettingMap = UtilMisc.toMap("productStoreId", productStoreId, "finAccountTypeId", finAccountTypeId); GenericValue finAccountSettings = delegator.findByPrimaryKeyCache("ProductStoreFinActSetting", findProductStoreFinActSettingMap); if (finAccountSettings == null) { @@ -144,7 +147,7 @@ // validate the PIN if the store requires it if ("Y".equals(finAccountSettings.getString("requirePinCode"))) { if (!FinAccountHelper.validatePin(delegator, finAccountCode, finAccountPin)) { - Map result = ServiceUtil.returnSuccess(); + Map<String, Object> result = ServiceUtil.returnSuccess(); result.put("authMessage", "Financial account PIN/CODE combination not found"); result.put("authResult", Boolean.FALSE); result.put("processAmount", amount); @@ -159,7 +162,7 @@ // check for expiration date if ((finAccount.getTimestamp("thruDate") != null) && (finAccount.getTimestamp("thruDate").before(UtilDateTime.nowTimestamp()))) { - Map result = ServiceUtil.returnSuccess(); + Map<String, Object> result = ServiceUtil.returnSuccess(); result.put("authMessage", "Account has expired as of " + finAccount.getTimestamp("thruDate")); result.put("authResult", Boolean.FALSE); result.put("processAmount", amount); @@ -177,7 +180,7 @@ statusId = finAccount.getString("statusId"); if ("FNACT_NEGPENDREPL".equals(statusId) || "FNACT_MANFROZEN".equals(statusId) || "FNACT_CANCELLED".equals(statusId)) { - Map result = ServiceUtil.returnSuccess(); + Map<String, Object> result = ServiceUtil.returnSuccess(); if ("FNACT_NEGPENDREPL".equals(statusId)) { result.put("authMessage", "Account is currently negative and pending replenishment"); } else if ("FNACT_MANFROZEN".equals(statusId)) { @@ -208,7 +211,7 @@ } - Map result = ServiceUtil.returnSuccess(); + Map<String, Object> result = ServiceUtil.returnSuccess(); String authMessage = null; Boolean processResult; String refNum; @@ -228,15 +231,14 @@ thruDate = UtilDateTime.getDayEnd(UtilDateTime.nowTimestamp(), new Long(30)); // default 30 days for an auth } - Map tmpResult = dispatcher.runSync("createFinAccountAuth", UtilMisc.<String, Object>toMap("finAccountId", finAccountId, + Map<String, Object> tmpResult = dispatcher.runSync("createFinAccountAuth", UtilMisc.<String, Object>toMap("finAccountId", finAccountId, "amount", amount, "thruDate", thruDate, "userLogin", userLogin)); if (ServiceUtil.isError(tmpResult)) { return tmpResult; - } else { - refNum = (String) tmpResult.get("finAccountAuthId"); - processResult = Boolean.TRUE; } + refNum = (String) tmpResult.get("finAccountAuthId"); + processResult = Boolean.TRUE; // refresh the account finAccount.refresh(); @@ -266,7 +268,7 @@ } } - public static Map finAccountReleaseAuth(DispatchContext dctx, Map context) { + public static Map<String, Object> finAccountReleaseAuth(DispatchContext dctx, Map<String, Object> context) { LocalDispatcher dispatcher = dctx.getDispatcher(); GenericValue userLogin = (GenericValue) context.get("userLogin"); @@ -281,10 +283,10 @@ return ServiceUtil.returnError(err + " Could not find authorization transaction."); } - Map input = UtilMisc.toMap("userLogin", userLogin, "finAccountAuthId", authTransaction.get("referenceNum")); - Map serviceResults = dispatcher.runSync("expireFinAccountAuth", input); + Map<String, Object> input = UtilMisc.toMap("userLogin", userLogin, "finAccountAuthId", authTransaction.get("referenceNum")); + Map<String, Object> serviceResults = dispatcher.runSync("expireFinAccountAuth", input); - Map result = ServiceUtil.returnSuccess(); + Map<String, Object> result = ServiceUtil.returnSuccess(); result.put("releaseRefNum", authTransaction.getString("referenceNum")); result.put("releaseAmount", authTransaction.getBigDecimal("amount")); result.put("releaseResult", Boolean.TRUE); @@ -301,7 +303,7 @@ } } - public static Map finAccountCapture(DispatchContext dctx, Map context) { + public static Map<String, Object> finAccountCapture(DispatchContext dctx, Map<String, Object> context) { LocalDispatcher dispatcher = dctx.getDispatcher(); GenericDelegator delegator = dctx.getDelegator(); @@ -367,10 +369,10 @@ } // BIG NOTE: make sure the expireFinAccountAuth and finAccountWithdraw services are done in the SAME TRANSACTION - //(ie no require-new-transaction in either of them AND no running async) + //(i.e. no require-new-transaction in either of them AND no running async) // cancel the authorization before doing the withdraw to avoid problems with way negative available amount on account; should happen in same transaction to avoid conflict problems - Map releaseResult; + Map<String, Object> releaseResult; try { releaseResult = dispatcher.runSync("expireFinAccountAuth", UtilMisc.<String, Object>toMap("userLogin", userLogin, "finAccountAuthId", finAccountAuthId)); } catch (GenericServiceException e) { @@ -382,7 +384,7 @@ } // build the withdraw context - Map withdrawCtx = FastMap.newInstance(); + Map<String, Object> withdrawCtx = FastMap.newInstance(); withdrawCtx.put("finAccountId", finAccountId); withdrawCtx.put("productStoreId", productStoreId); withdrawCtx.put("currency", currency); @@ -394,7 +396,7 @@ withdrawCtx.put("userLogin", userLogin); // call the withdraw service - Map withdrawResp; + Map<String, Object> withdrawResp; try { withdrawResp = dispatcher.runSync("finAccountWithdraw", withdrawCtx); } catch (GenericServiceException e) { @@ -406,7 +408,7 @@ } // create the capture response - Map result = ServiceUtil.returnSuccess(); + Map<String, Object> result = ServiceUtil.returnSuccess(); Boolean processResult = (Boolean) withdrawResp.get("processResult"); BigDecimal withdrawAmount = (BigDecimal) withdrawResp.get("amount"); String referenceNum = (String) withdrawResp.get("referenceNum"); @@ -419,7 +421,7 @@ return result; } - public static Map finAccountRefund(DispatchContext dctx, Map context) { + public static Map<String, Object> finAccountRefund(DispatchContext dctx, Map<String, Object> context) { LocalDispatcher dispatcher = dctx.getDispatcher(); GenericDelegator delegator = dctx.getDelegator(); @@ -454,7 +456,7 @@ } // call the deposit service - Map depositCtx = FastMap.newInstance(); + Map<String, Object> depositCtx = FastMap.newInstance(); depositCtx.put("finAccountId", finAccountId); depositCtx.put("productStoreId", productStoreId); depositCtx.put("isRefund", Boolean.TRUE); @@ -465,7 +467,7 @@ depositCtx.put("reasonEnumId", "FATR_REFUND"); depositCtx.put("userLogin", userLogin); - Map depositResp; + Map<String, Object> depositResp; try { depositResp = dispatcher.runSync("finAccountDeposit", depositCtx); } catch (GenericServiceException e) { @@ -477,7 +479,7 @@ } // create the refund response - Map result = ServiceUtil.returnSuccess(); + Map<String, Object> result = ServiceUtil.returnSuccess(); Boolean processResult = (Boolean) depositResp.get("processResult"); BigDecimal depositAmount = (BigDecimal) depositResp.get("amount"); String referenceNum = (String) depositResp.get("referenceNum"); @@ -491,7 +493,7 @@ } // base account transaction services - public static Map finAccountWithdraw(DispatchContext dctx, Map context) { + public static Map<String, Object> finAccountWithdraw(DispatchContext dctx, Map<String, Object> context) { LocalDispatcher dispatcher = dctx.getDispatcher(); GenericDelegator delegator = dctx.getDelegator(); @@ -570,7 +572,7 @@ balance = FinAccountHelper.ZERO; } - Map result = ServiceUtil.returnSuccess(); + Map<String, Object> result = ServiceUtil.returnSuccess(); result.put("previousBalance", previousBalance); result.put("balance", balance); result.put("amount", amount); @@ -580,7 +582,7 @@ } // base deposit service - public static Map finAccountDeposit(DispatchContext dctx, Map context) { + public static Map<String, Object> finAccountDeposit(DispatchContext dctx, Map<String, Object> context) { LocalDispatcher dispatcher = dctx.getDispatcher(); GenericDelegator delegator = dctx.getDelegator(); @@ -649,7 +651,7 @@ if (actualBalance.compareTo(BigDecimal.ZERO) < 0) { // balance went below zero, set negative pending replenishment status so that no more auths or captures will go through until it is replenished try { - Map rollbackCtx = UtilMisc.toMap("userLogin", userLogin, "finAccountId", finAccountId, "statusId", "FNACT_NEGPENDREPL"); + Map<String, Object> rollbackCtx = UtilMisc.toMap("userLogin", userLogin, "finAccountId", finAccountId, "statusId", "FNACT_NEGPENDREPL"); dispatcher.addRollbackService("updateFinAccount", rollbackCtx, true); } catch (GenericServiceException e) { Debug.logError(e, module); @@ -658,7 +660,7 @@ } } - Map result = ServiceUtil.returnSuccess(); + Map<String, Object> result = ServiceUtil.returnSuccess(); result.put("previousBalance", previousBalance); result.put("balance", actualBalance); result.put("amount", amount); @@ -668,7 +670,7 @@ } // auto-replenish service (deposit) - public static Map finAccountReplenish(DispatchContext dctx, Map context) { + public static Map<String, Object> finAccountReplenish(DispatchContext dctx, Map<String, Object> context) { LocalDispatcher dispatcher = dctx.getDispatcher(); GenericDelegator delegator = dctx.getDelegator(); @@ -714,7 +716,7 @@ // get the product store settings GenericValue finAccountSettings; - Map psfasFindMap = UtilMisc.toMap("productStoreId", productStoreId, "finAccountTypeId", finAccount.getString("finAccountTypeId")); + Map<String, Object> psfasFindMap = UtilMisc.toMap("productStoreId", productStoreId, "finAccountTypeId", finAccount.getString("finAccountTypeId")); try { finAccountSettings = delegator.findByPrimaryKeyCache("ProductStoreFinActSetting", psfasFindMap); } catch (GenericEntityException e) { @@ -753,7 +755,7 @@ // configure rollback service to set status to Negative Pending Replenishment if ("FNACT_NEGPENDREPL".equals(statusId)) { try { - Map rollbackCtx = UtilMisc.toMap("userLogin", userLogin, "finAccountId", finAccountId, "statusId", "FNACT_NEGPENDREPL"); + Map<String, Object> rollbackCtx = UtilMisc.toMap("userLogin", userLogin, "finAccountId", finAccountId, "statusId", "FNACT_NEGPENDREPL"); dispatcher.addRollbackService("updateFinAccount", rollbackCtx, true); } catch (GenericServiceException e) { Debug.logError(e, module); @@ -802,15 +804,15 @@ } // hit the payment method for the amount to replenish - Map orderItemMap = UtilMisc.toMap("Auto-Replenishment FA #" + finAccountId, depositAmount); - Map replOrderCtx = FastMap.newInstance(); + Map<String, Object> orderItemMap = UtilMisc.toMap("Auto-Replenishment FA #" + finAccountId, depositAmount); + Map<String, Object> replOrderCtx = FastMap.newInstance(); replOrderCtx.put("productStoreId", productStoreId); replOrderCtx.put("paymentMethodId", paymentMethod.getString("paymentMethodId")); replOrderCtx.put("currency", currency); replOrderCtx.put("partyId", ownerPartyId); replOrderCtx.put("itemMap", orderItemMap); replOrderCtx.put("userLogin", userLogin); - Map replResp; + Map<String, Object> replResp; try { replResp = dispatcher.runSync("createSimpleNonProductSalesOrder", replOrderCtx); } catch (GenericServiceException e) { @@ -823,7 +825,7 @@ String orderId = (String) replResp.get("orderId"); // create the deposit - Map depositCtx = FastMap.newInstance(); + Map<String, Object> depositCtx = FastMap.newInstance(); depositCtx.put("productStoreId", productStoreId); depositCtx.put("finAccountId", finAccountId); depositCtx.put("currency", currency); @@ -834,7 +836,7 @@ depositCtx.put("reasonEnumId", "FATR_REPLENISH"); depositCtx.put("userLogin", userLogin); try { - Map depositResp = dispatcher.runSync("finAccountDeposit", depositCtx); + Map<String, Object> depositResp = dispatcher.runSync("finAccountDeposit", depositCtx); if (ServiceUtil.isError(depositResp)) { return depositResp; } @@ -846,7 +848,7 @@ // say we are in good standing again if ("FNACT_NEGPENDREPL".equals(statusId)) { try { - Map ufaResp = dispatcher.runSync("updateFinAccount", UtilMisc.<String, Object>toMap("finAccountId", finAccountId, "statusId", "FNACT_ACTIVE", "userLogin", userLogin)); + Map<String, Object> ufaResp = dispatcher.runSync("updateFinAccount", UtilMisc.<String, Object>toMap("finAccountId", finAccountId, "statusId", "FNACT_ACTIVE", "userLogin", userLogin)); if (ServiceUtil.isError(ufaResp)) { return ufaResp; } @@ -864,13 +866,13 @@ opts.setMaxRows(1); opts.setFetchSize(1); - List exprs = FastList.newInstance(); + List<EntityExpr> exprs = FastList.newInstance(); exprs.add(EntityCondition.makeCondition("finAccountTransTypeId", EntityOperator.EQUALS, "DEPOSIT")); exprs.add(EntityCondition.makeCondition("finAccountId", EntityOperator.EQUALS, finAccountId)); exprs.add(EntityCondition.makeCondition("orderId", EntityOperator.NOT_EQUAL, null)); - List orderBy = UtilMisc.toList("-transactionDate"); + List<String> orderBy = UtilMisc.toList("-transactionDate"); - List transList = null; + List<GenericValue> transList = null; try { transList = delegator.findList("FinAccountTrans", EntityCondition.makeCondition(exprs, EntityOperator.AND), null, orderBy, opts, false); } catch (GenericEntityException e) { @@ -940,7 +942,7 @@ // payment amount should always be positive; adjustments may // create the payment for the transaction - Map paymentCtx = UtilMisc.toMap("paymentTypeId", paymentType); + Map<String, Object> paymentCtx = UtilMisc.toMap("paymentTypeId", paymentType); paymentCtx.put("paymentMethodTypeId", paymentMethodType); paymentCtx.put("partyIdTo", partyIdTo); paymentCtx.put("partyIdFrom", partyIdFrom); @@ -951,7 +953,7 @@ paymentCtx.put("paymentRefNum", Long.toString(UtilDateTime.nowTimestamp().getTime())); String paymentId; - Map payResult; + Map<String, Object> payResult; try { payResult = dispatcher.runSync("createPayment", paymentCtx); } catch (GenericServiceException e) { @@ -962,12 +964,11 @@ } if (ServiceUtil.isError(payResult)) { throw new GeneralException(ServiceUtil.getErrorMessage(payResult)); - } else { - paymentId = (String) payResult.get("paymentId"); } + paymentId = (String) payResult.get("paymentId"); // create the initial transaction - Map transCtx = UtilMisc.toMap("finAccountTransTypeId", txType); + Map<String, Object> transCtx = UtilMisc.toMap("finAccountTransTypeId", txType); transCtx.put("finAccountId", finAccountId); transCtx.put("partyId", partyId); transCtx.put("orderId", orderId); @@ -977,8 +978,7 @@ transCtx.put("userLogin", userLogin); transCtx.put("paymentId", paymentId); - Map transResult; - String txId; + Map<String, Object> transResult; try { transResult = dispatcher.runSync("createFinAccountTrans", transCtx); } catch (GenericServiceException e) { @@ -989,10 +989,8 @@ } if (ServiceUtil.isError(transResult)) { throw new GeneralException(ServiceUtil.getErrorMessage(transResult)); - } else { - txId = (String) transResult.get("finAccountTransId"); } - return txId; + return (String) transResult.get("finAccountTransId"); } } Modified: ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/finaccount/FinAccountProductServices.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/finaccount/FinAccountProductServices.java?rev=770618&r1=770617&r2=770618&view=diff ============================================================================== --- ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/finaccount/FinAccountProductServices.java (original) +++ ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/finaccount/FinAccountProductServices.java Fri May 1 10:28:34 2009 @@ -44,7 +44,7 @@ public static final String module = FinAccountProductServices.class.getName(); - public static Map createPartyFinAccountFromPurchase(DispatchContext dctx, Map context) { + public static Map<String, Object> createPartyFinAccountFromPurchase(DispatchContext dctx, Map<String, Object> context) { // this service should always be called via FULFILLMENT_EXTASYNC LocalDispatcher dispatcher = dctx.getDispatcher(); GenericDelegator delegator = dctx.getDelegator(); @@ -68,7 +68,7 @@ String productId = orderItem.getString("productId"); GenericValue featureAndAppl; try { - List featureAndAppls = delegator.findByAnd("ProductFeatureAndAppl", UtilMisc.toMap("productId", productId, + List<GenericValue> featureAndAppls = delegator.findByAnd("ProductFeatureAndAppl", UtilMisc.toMap("productId", productId, "productFeatureTypeId", "TYPE", "productFeatureApplTypeId", "STANDARD_FEATURE")); featureAndAppls = EntityUtil.filterByDate(featureAndAppls); featureAndAppl = EntityUtil.getFirst(featureAndAppls); @@ -129,13 +129,11 @@ } // payment method info - List payPrefs = orh.getPaymentPreferences(); + List<GenericValue> payPrefs = orh.getPaymentPreferences(); String paymentMethodId = null; if (payPrefs != null) { - Iterator i = payPrefs.iterator(); - while (i.hasNext()) { + for (GenericValue pref : payPrefs) { // needs to be a CC or EFT account - GenericValue pref = (GenericValue) i.next(); String type = pref.getString("paymentMethodTypeId"); if ("CREDIT_CARD".equals(type) || "EFT_ACCOUNT".equals(type)) { paymentMethodId = pref.getString("paymentMethodId"); @@ -164,14 +162,14 @@ } // create the context for FSE - Map expContext = FastMap.newInstance(); + Map<String, Object> expContext = FastMap.newInstance(); expContext.put("orderHeader", orderHeader); expContext.put("orderItem", orderItem); expContext.put("party", party); expContext.put("person", person); expContext.put("partyGroup", partyGroup); - // expand the name field to dynamicly add information + // expand the name field to dynamically add information FlexibleStringExpander exp = FlexibleStringExpander.getInstance(finAccountName); finAccountName = exp.expandString(expContext); @@ -181,7 +179,7 @@ BigDecimal deposit = price.multiply(quantity).setScale(FinAccountHelper.decimals, FinAccountHelper.rounding); // create the financial account - Map createCtx = FastMap.newInstance(); + Map<String, Object> createCtx = FastMap.newInstance(); String finAccountId; createCtx.put("finAccountTypeId", finAccountTypeId); @@ -198,7 +196,7 @@ createCtx.put("replenishPaymentId", paymentMethodId); } - Map createResp; + Map<String, Object> createResp; try { createResp = dispatcher.runSync("createFinAccountForStore", createCtx); } catch (GenericServiceException e) { @@ -208,18 +206,18 @@ if (ServiceUtil.isError(createResp)) { Debug.logFatal(ServiceUtil.getErrorMessage(createResp), module); return createResp; - } else { - finAccountId = (String) createResp.get("finAccountId"); } + + finAccountId = (String) createResp.get("finAccountId"); // create the owner role - Map roleCtx = FastMap.newInstance(); + Map<String, Object> 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; + Map<String, Object> roleResp; try { roleResp = dispatcher.runSync("createFinAccountRole", roleCtx); } catch (GenericServiceException e) { @@ -232,7 +230,7 @@ } // create the initial deposit - Map depositCtx = FastMap.newInstance(); + Map<String, Object> depositCtx = FastMap.newInstance(); depositCtx.put("finAccountId", finAccountId); depositCtx.put("productStoreId", productStoreId); depositCtx.put("currency", currency); @@ -243,7 +241,7 @@ depositCtx.put("reasonEnumId", "FATR_IDEPOSIT"); depositCtx.put("userLogin", userLogin); - Map depositResp; + Map<String, Object> depositResp; try { depositResp = dispatcher.runSync("finAccountDeposit", depositCtx); } catch (GenericServiceException e) { @@ -255,7 +253,7 @@ return depositResp; } - Map result = ServiceUtil.returnSuccess(); + Map<String, Object> result = ServiceUtil.returnSuccess(); result.put("finAccountId", finAccountId); return result; } 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?rev=770618&r1=770617&r2=770618&view=diff ============================================================================== --- ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/finaccount/FinAccountServices.java (original) +++ ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/finaccount/FinAccountServices.java Fri May 1 10:28:34 2009 @@ -24,27 +24,34 @@ import java.util.List; import java.util.Map; -import org.ofbiz.base.util.*; +import javolution.util.FastMap; + +import org.ofbiz.base.util.Debug; +import org.ofbiz.base.util.GeneralException; +import org.ofbiz.base.util.UtilDateTime; +import org.ofbiz.base.util.UtilMisc; +import org.ofbiz.base.util.UtilValidate; import org.ofbiz.entity.GenericDelegator; import org.ofbiz.entity.GenericEntityException; import org.ofbiz.entity.GenericValue; import org.ofbiz.entity.condition.EntityCondition; -import org.ofbiz.entity.condition.EntityConditionList; import org.ofbiz.entity.condition.EntityExpr; import org.ofbiz.entity.condition.EntityOperator; import org.ofbiz.entity.util.EntityListIterator; import org.ofbiz.entity.util.EntityUtil; import org.ofbiz.order.finaccount.FinAccountHelper; import org.ofbiz.product.store.ProductStoreWorker; -import org.ofbiz.service.*; - -import javolution.util.FastMap; +import org.ofbiz.service.DispatchContext; +import org.ofbiz.service.GenericServiceException; +import org.ofbiz.service.LocalDispatcher; +import org.ofbiz.service.ModelService; +import org.ofbiz.service.ServiceUtil; public class FinAccountServices { public static final String module = FinAccountServices.class.getName(); - public static Map createAccountAndCredit(DispatchContext dctx, Map context) { + public static Map<String, Object> createAccountAndCredit(DispatchContext dctx, Map<String, Object> context) { GenericDelegator delegator = dctx.getDelegator(); LocalDispatcher dispatcher = dctx.getDispatcher(); String finAccountTypeId = (String) context.get("finAccountTypeId"); @@ -67,7 +74,7 @@ try { // find the most recent (active) service credit account for the specified party String partyId = (String) context.get("partyId"); - Map lookupMap = UtilMisc.toMap("finAccountTypeId", finAccountTypeId, "ownerPartyId", partyId); + Map<String, Object> lookupMap = UtilMisc.toMap("finAccountTypeId", finAccountTypeId, "ownerPartyId", partyId); // if a productStoreId is present, restrict the accounts returned using the store's payToPartyId String productStoreId = (String) context.get("productStoreId"); @@ -89,7 +96,7 @@ if (finAccountId != null) { creditAccount = delegator.findByPrimaryKey("FinAccount", UtilMisc.toMap("finAccountId", finAccountId)); } else { - List creditAccounts = delegator.findByAnd("FinAccount", lookupMap, UtilMisc.toList("-fromDate")); + List<GenericValue> creditAccounts = delegator.findByAnd("FinAccount", lookupMap, UtilMisc.toList("-fromDate")); creditAccount = EntityUtil.getFirst(EntityUtil.filterByDate(creditAccounts)); } @@ -101,13 +108,13 @@ } // automatically set the parameters ModelService createAccountService = dctx.getModelService(createAccountServiceName); - Map createAccountContext = createAccountService.makeValid(context, ModelService.IN_PARAM); + Map<String, Object> createAccountContext = createAccountService.makeValid(context, ModelService.IN_PARAM); createAccountContext.put("finAccountTypeId", finAccountTypeId); createAccountContext.put("finAccountName", accountName); createAccountContext.put("ownerPartyId", partyId); createAccountContext.put("userLogin", userLogin); - Map createAccountResult = dispatcher.runSync(createAccountServiceName, createAccountContext); + Map<String, Object> createAccountResult = dispatcher.runSync(createAccountServiceName, createAccountContext); if (ServiceUtil.isError(createAccountResult) || ServiceUtil.isFailure(createAccountResult)) { return createAccountResult; } @@ -118,13 +125,13 @@ creditAccount = delegator.findByPrimaryKey("FinAccount", UtilMisc.toMap("finAccountId", creditAccountId)); // create the owner role - Map roleCtx = FastMap.newInstance(); + Map<String, Object> roleCtx = FastMap.newInstance(); roleCtx.put("partyId", partyId); roleCtx.put("roleTypeId", "OWNER"); roleCtx.put("finAccountId", creditAccountId); roleCtx.put("userLogin", userLogin); roleCtx.put("fromDate", UtilDateTime.nowTimestamp()); - Map roleResp; + Map<String, Object> roleResp; try { roleResp = dispatcher.runSync("createFinAccountRole", roleCtx); } catch (GenericServiceException e) { @@ -142,7 +149,7 @@ } // create the credit transaction - Map transactionMap = FastMap.newInstance(); + Map<String, Object> transactionMap = FastMap.newInstance(); transactionMap.put("finAccountTransTypeId", "ADJUSTMENT"); transactionMap.put("finAccountId", creditAccount.getString("finAccountId")); transactionMap.put("partyId", partyId); @@ -151,7 +158,7 @@ transactionMap.put("comments", context.get("comments")); transactionMap.put("userLogin", userLogin); - Map creditTransResult = dispatcher.runSync("createFinAccountTrans", transactionMap); + Map<String, Object> creditTransResult = dispatcher.runSync("createFinAccountTrans", transactionMap); if (ServiceUtil.isError(creditTransResult) || ServiceUtil.isFailure(creditTransResult)) { return creditTransResult; } @@ -161,12 +168,12 @@ return ServiceUtil.returnError(gse.getMessage()); } - Map result = ServiceUtil.returnSuccess(); + Map<String, Object> result = ServiceUtil.returnSuccess(); result.put("finAccountId", finAccountId); return result; } - public static Map createFinAccountForStore(DispatchContext dctx, Map context) { + public static Map<String, Object> createFinAccountForStore(DispatchContext dctx, Map<String, Object> context) { GenericDelegator delegator = dctx.getDelegator(); LocalDispatcher dispatcher = dctx.getDispatcher(); GenericValue userLogin = (GenericValue) context.get("userLogin"); @@ -187,7 +194,7 @@ // automatically set the parameters for the create fin account service ModelService createService = dctx.getModelService("createFinAccount"); - Map inContext = createService.makeValid(context, ModelService.IN_PARAM); + Map<String, Object> inContext = createService.makeValid(context, ModelService.IN_PARAM); Timestamp now = UtilDateTime.nowTimestamp(); // now use our values @@ -209,16 +216,15 @@ String payToPartyId = ProductStoreWorker.getProductStorePayToPartyId(productStoreId, delegator); inContext.put("organizationPartyId", payToPartyId); - Map createResult = dispatcher.runSync("createFinAccount", inContext); + Map<String, Object> createResult = dispatcher.runSync("createFinAccount", inContext); if (ServiceUtil.isError(createResult)) { return createResult; - } else { - Map result = ServiceUtil.returnSuccess(); - result.put("finAccountId", createResult.get("finAccountId")); - result.put("finAccountCode", finAccountCode); - return result; } + Map<String, Object> result = ServiceUtil.returnSuccess(); + result.put("finAccountId", createResult.get("finAccountId")); + result.put("finAccountCode", finAccountCode); + return result; } catch (GenericEntityException ex) { return ServiceUtil.returnError(ex.getMessage()); } catch (GenericServiceException ex) { @@ -226,7 +232,7 @@ } } - public static Map checkFinAccountBalance(DispatchContext dctx, Map context) { + public static Map<String, Object> checkFinAccountBalance(DispatchContext dctx, Map<String, Object> context) { GenericDelegator delegator = dctx.getDelegator(); String finAccountId = (String) context.get("finAccountId"); String finAccountCode = (String) context.get("finAccountCode"); @@ -264,14 +270,14 @@ String statusId = finAccount.getString("statusId"); Debug.log("FinAccount Balance [" + balance + "] Available [" + availableBalance + "] - Status: " + statusId, module); - Map result = ServiceUtil.returnSuccess(); + Map<String, Object> result = ServiceUtil.returnSuccess(); result.put("availableBalance", availableBalance); result.put("balance", balance); result.put("statusId", statusId); return result; } - public static Map checkFinAccountStatus(DispatchContext dctx, Map context) { + public static Map<String, Object> checkFinAccountStatus(DispatchContext dctx, Map<String, Object> context) { GenericDelegator delegator = dctx.getDelegator(); String finAccountId = (String) context.get("finAccountId"); @@ -314,13 +320,13 @@ return ServiceUtil.returnSuccess(); } - public static Map refundFinAccount(DispatchContext dctx, Map context) { + public static Map<String, Object> refundFinAccount(DispatchContext dctx, Map<String, Object> context) { LocalDispatcher dispatcher = dctx.getDispatcher(); GenericDelegator delegator = dctx.getDelegator(); GenericValue userLogin = (GenericValue) context.get("userLogin"); String finAccountId = (String) context.get("finAccountId"); - Map result = null; + Map<String, Object> result = null; GenericValue finAccount; try { @@ -349,7 +355,7 @@ BigDecimal remainingBalance = new BigDecimal(actualBalance.toString()); BigDecimal refundAmount = BigDecimal.ZERO; - List exprs = UtilMisc.toList(EntityCondition.makeCondition("finAccountTransTypeId", EntityOperator.EQUALS, "DEPOSIT"), + List<EntityExpr> exprs = UtilMisc.toList(EntityCondition.makeCondition("finAccountTransTypeId", EntityOperator.EQUALS, "DEPOSIT"), EntityCondition.makeCondition("finAccountId", EntityOperator.EQUALS, finAccountId)); EntityCondition condition = EntityCondition.makeCondition(exprs, EntityOperator.AND); @@ -358,7 +364,7 @@ eli = delegator.find("FinAccountTrans", condition, null, null, UtilMisc.toList("-transactionDate"), null); GenericValue trans; - while (remainingBalance.compareTo(FinAccountHelper.ZERO) == 1 && (trans = (GenericValue) eli.next()) != null) { + while (remainingBalance.compareTo(FinAccountHelper.ZERO) < 0 && (trans = eli.next()) != null) { String orderId = trans.getString("orderId"); String orderItemSeqId = trans.getString("orderItemSeqId"); @@ -370,7 +376,7 @@ if (!"ITEM_CANCELLED".equals(orderItem.getString("statusId"))) { // make sure the item hasn't already been returned - List returnItems = orderItem.getRelated("ReturnItem"); + List<GenericValue> returnItems = orderItem.getRelated("ReturnItem"); if (returnItems == null || returnItems.size() == 0) { BigDecimal txAmt = trans.getBigDecimal("amount"); BigDecimal refAmt = txAmt; @@ -381,15 +387,15 @@ refundAmount = refundAmount.add(refAmt); // create the return header - Map rhCtx = UtilMisc.toMap("returnHeaderTypeId", "CUSTOMER_RETURN", "fromPartyId", finAccount.getString("ownerPartyId"), "toPartyId", productStore.getString("payToPartyId"), "userLogin", userLogin); - Map rhResp = dispatcher.runSync("createReturnHeader", rhCtx); + Map<String, Object> rhCtx = UtilMisc.toMap("returnHeaderTypeId", "CUSTOMER_RETURN", "fromPartyId", finAccount.getString("ownerPartyId"), "toPartyId", productStore.getString("payToPartyId"), "userLogin", userLogin); + Map<String, Object> rhResp = dispatcher.runSync("createReturnHeader", rhCtx); if (ServiceUtil.isError(rhResp)) { throw new GeneralException(ServiceUtil.getErrorMessage(rhResp)); } String returnId = (String) rhResp.get("returnId"); // create the return item - Map returnItemCtx = FastMap.newInstance(); + Map<String, Object> returnItemCtx = FastMap.newInstance(); returnItemCtx.put("returnId", returnId); returnItemCtx.put("orderId", orderId); returnItemCtx.put("description", orderItem.getString("itemDescription")); @@ -402,22 +408,22 @@ returnItemCtx.put("returnItemTypeId", "RET_NPROD_ITEM"); returnItemCtx.put("userLogin", userLogin); - Map retItResp = dispatcher.runSync("createReturnItem", returnItemCtx); + Map<String, Object> retItResp = dispatcher.runSync("createReturnItem", returnItemCtx); if (ServiceUtil.isError(retItResp)) { throw new GeneralException(ServiceUtil.getErrorMessage(retItResp)); } String returnItemSeqId = (String) retItResp.get("returnItemSeqId"); // approve the return - Map appRet = UtilMisc.toMap("statusId", "RETURN_ACCEPTED", "returnId", returnId, "userLogin", userLogin); - Map appResp = dispatcher.runSync("updateReturnHeader", appRet); + Map<String, Object> appRet = UtilMisc.toMap("statusId", "RETURN_ACCEPTED", "returnId", returnId, "userLogin", userLogin); + Map<String, Object> appResp = dispatcher.runSync("updateReturnHeader", appRet); if (ServiceUtil.isError(appResp)) { throw new GeneralException(ServiceUtil.getErrorMessage(appResp)); } // "receive" the return - should trigger the refund - Map recRet = UtilMisc.toMap("statusId", "RETURN_RECEIVED", "returnId", returnId, "userLogin", userLogin); - Map recResp = dispatcher.runSync("updateReturnHeader", recRet); + Map<String, Object> recRet = UtilMisc.toMap("statusId", "RETURN_RECEIVED", "returnId", returnId, "userLogin", userLogin); + Map<String, Object> recResp = dispatcher.runSync("updateReturnHeader", recRet); if (ServiceUtil.isError(recResp)) { throw new GeneralException(ServiceUtil.getErrorMessage(recResp)); } @@ -432,7 +438,7 @@ String paymentId = response.getString("paymentId"); // create the adjustment transaction - Map txCtx = FastMap.newInstance(); + Map<String, Object> txCtx = FastMap.newInstance(); txCtx.put("finAccountTransTypeId", "ADJUSTMENT"); txCtx.put("finAccountId", finAccountId); txCtx.put("orderId", orderId); @@ -442,7 +448,7 @@ txCtx.put("partyId", finAccount.getString("ownerPartyId")); txCtx.put("userLogin", userLogin); - Map txResp = dispatcher.runSync("createFinAccountTrans", txCtx); + Map<String, Object> txResp = dispatcher.runSync("createFinAccountTrans", txCtx); if (ServiceUtil.isError(txResp)) { throw new GeneralException(ServiceUtil.getErrorMessage(txResp)); } Modified: ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/invoice/InvoiceServices.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/invoice/InvoiceServices.java?rev=770618&r1=770617&r2=770618&view=diff ============================================================================== --- ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/invoice/InvoiceServices.java (original) +++ ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/invoice/InvoiceServices.java Fri May 1 10:28:34 2009 @@ -435,7 +435,7 @@ Map createInvoiceItemContext = FastMap.newInstance(); createInvoiceItemContext.put("invoiceId", invoiceId); createInvoiceItemContext.put("invoiceItemSeqId", invoiceItemSeqId); - createInvoiceItemContext.put("invoiceItemTypeId", getInvoiceItemType(delegator, (orderItem == null ? null : orderItem.getString("orderItemTypeId")), (product == null ? null : product.getString("productTypeId")), invoiceType, "INV_FPROD_ITEM")); + createInvoiceItemContext.put("invoiceItemTypeId", getInvoiceItemType(delegator, (orderItem.getString("orderItemTypeId")), (product == null ? null : product.getString("productTypeId")), invoiceType, "INV_FPROD_ITEM")); createInvoiceItemContext.put("description", orderItem.get("itemDescription")); createInvoiceItemContext.put("quantity", billingQuantity); createInvoiceItemContext.put("amount", billingAmount); Modified: ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/invoice/InvoiceWorker.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/invoice/InvoiceWorker.java?rev=770618&r1=770617&r2=770618&view=diff ============================================================================== --- ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/invoice/InvoiceWorker.java (original) +++ ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/invoice/InvoiceWorker.java Fri May 1 10:28:34 2009 @@ -287,7 +287,7 @@ public static GenericValue getInvoiceAddressByType(GenericValue invoice, String contactMechPurposeTypeId) { GenericDelegator delegator = invoice.getDelegator(); - List locations = null; + List<GenericValue> locations = null; // first try InvoiceContactMech to see if we can find the address needed try { locations = invoice.getRelated("InvoiceContactMech", UtilMisc.toMap("contactMechPurposeTypeId", contactMechPurposeTypeId), null); @@ -324,12 +324,12 @@ GenericValue contactMech = null; if (UtilValidate.isNotEmpty(locations)) { try { - contactMech = ((GenericValue) locations.get(0)).getRelatedOne("ContactMech"); + contactMech = locations.get(0).getRelatedOne("ContactMech"); }
{'source': 'Apache Software Foundation Public Mail Archives'}