You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by do...@apache.org on 2012/05/29 06:17:33 UTC

svn commit: r1343510 - in /ofbiz/trunk/applications/accounting: src/org/ofbiz/accounting/finaccount/ src/org/ofbiz/accounting/invoice/ src/org/ofbiz/accounting/payment/ src/org/ofbiz/accounting/thirdparty/orbital/ src/org/ofbiz/accounting/thirdparty/va...

Author: doogie
Date: Tue May 29 04:17:32 2012
New Revision: 1343510

URL: http://svn.apache.org/viewvc?rev=1343510&view=rev
Log:
DEPRECATION: applications/accounting: GenericValue.getRelated/getRelatedCache variants replaced with a single getRelated variant that takes a boolean useCache parameter.

Modified:
    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/payment/GiftCertificateServices.java
    ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/payment/PaymentGatewayServices.java
    ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/orbital/OrbitalPaymentServices.java
    ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/valuelink/ValueLinkServices.java
    ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/util/UtilAccounting.java
    ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/admin/ListInvoiceItemTypesGlAccount.groovy
    ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/invoice/CreateApplicationList.groovy
    ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/invoice/EditInvoice.groovy
    ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/invoice/GetInvoiceItemTypes.groovy
    ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/invoice/PrintInvoices.groovy
    ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/transaction/CaptureTransaction.groovy
    ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/transaction/ViewGatewayResponse.groovy
    ofbiz/trunk/applications/accounting/webapp/accounting/finaccounttrans/FinAccountTrans.ftl
    ofbiz/trunk/applications/accounting/webapp/accounting/invoice/PrintInvoices.fo.ftl
    ofbiz/trunk/applications/accounting/webapp/accounting/invoice/invoiceReportItems.fo.ftl
    ofbiz/trunk/applications/accounting/webapp/accounting/payment/PrintChecks.fo.ftl

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=1343510&r1=1343509&r2=1343510&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 Tue May 29 04:17:32 2012
@@ -394,7 +394,7 @@ public class FinAccountServices {
                             if (!"ITEM_CANCELLED".equals(orderItem.getString("statusId"))) {
 
                                 // make sure the item hasn't already been returned
-                                List<GenericValue> returnItems = orderItem.getRelated("ReturnItem");
+                                List<GenericValue> returnItems = orderItem.getRelated("ReturnItem", null, null, false);
                                 if (UtilValidate.isEmpty(returnItems)) {
                                     BigDecimal txAmt = trans.getBigDecimal("amount");
                                     BigDecimal refAmt = txAmt;

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=1343510&r1=1343509&r2=1343510&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 Tue May 29 04:17:32 2012
@@ -251,7 +251,7 @@ public class InvoiceServices {
             }
 
             // order roles to invoice roles
-            List<GenericValue> orderRoles = orderHeader.getRelated("OrderRole");
+            List<GenericValue> orderRoles = orderHeader.getRelated("OrderRole", null, null, false);
             Map<String, Object> createInvoiceRoleContext = FastMap.newInstance();
             createInvoiceRoleContext.put("invoiceId", invoiceId);
             createInvoiceRoleContext.put("userLogin", userLogin);
@@ -278,13 +278,13 @@ public class InvoiceServices {
                  * jacopoc: billing account terms were already copied as order terms
                  *          when the order was created.
                 // get the billing account terms
-                billingAccountTerms = billingAccount.getRelated("BillingAccountTerm");
+                billingAccountTerms = billingAccount.getRelated("BillingAccountTerm", null, null, false);
 
                 // set the invoice terms as defined for the billing account
                 createInvoiceTerms(delegator, dispatcher, invoiceId, billingAccountTerms, userLogin, locale);
                 */
                 // set the invoice bill_to_customer from the billing account
-                List<GenericValue> billToRoles = billingAccount.getRelated("BillingAccountRole", UtilMisc.toMap("roleTypeId", "BILL_TO_CUSTOMER"), null);
+                List<GenericValue> billToRoles = billingAccount.getRelated("BillingAccountRole", UtilMisc.toMap("roleTypeId", "BILL_TO_CUSTOMER"), null, false);
                 for (GenericValue billToRole : billToRoles) {
                     if (!(billToRole.getString("partyId").equals(billToCustomerPartyId))) {
                         createInvoiceRoleContext = UtilMisc.toMap("invoiceId", invoiceId, "partyId", billToRole.get("partyId"),
@@ -325,7 +325,7 @@ public class InvoiceServices {
             }
 
             // get a list of the payment method types
-            //DEJ20050705 doesn't appear to be used: List paymentPreferences = orderHeader.getRelated("OrderPaymentPreference");
+            //DEJ20050705 doesn't appear to be used: List paymentPreferences = orderHeader.getRelated("OrderPaymentPreference", null, null, false);
 
             // create the bill-from (or pay-to) contact mech as the primary PAYMENT_LOCATION of the party from the store
             GenericValue payToAddress = null;
@@ -756,7 +756,7 @@ public class InvoiceServices {
             List<GenericValue> orderPaymentPrefs = delegator.findList("OrderPaymentPreference", EntityCondition.makeCondition(paymentPrefConds, EntityOperator.AND), null, null, null, false);
             List<GenericValue> currentPayments = FastList.newInstance();
             for (GenericValue paymentPref : orderPaymentPrefs) {
-                List<GenericValue> payments = paymentPref.getRelated("Payment");
+                List<GenericValue> payments = paymentPref.getRelated("Payment", null, null, false);
                 currentPayments.addAll(payments);
             }
             // apply these payments to the invoice if they have any remaining amount to apply
@@ -1773,9 +1773,9 @@ public class InvoiceServices {
             // get the items of the shipment. They can come from ItemIssuance if the shipment were from a purchase return, ShipmentReceipt if it were from a sales return
             List<GenericValue> shippedItems = null;
             if (salesReturnFound) {
-                shippedItems = shipment.getRelated("ShipmentReceipt");
+                shippedItems = shipment.getRelated("ShipmentReceipt", null, null, false);
             } else if (purchaseReturnFound) {
-                shippedItems = shipment.getRelated("ItemIssuance");
+                shippedItems = shipment.getRelated("ItemIssuance", null, null, false);
             }
             if (shippedItems == null) {
                 Debug.logInfo("No items issued for shipments", module);
@@ -1914,7 +1914,7 @@ public class InvoiceServices {
                     returnItem = item.getRelatedOne("ReturnItem", true);
                 } else if (itemIssuanceFound) {
                     GenericValue shipmentItem = item.getRelatedOne("ShipmentItem", true);
-                    GenericValue returnItemShipment = EntityUtil.getFirst(shipmentItem.getRelated("ReturnItemShipment"));
+                    GenericValue returnItemShipment = EntityUtil.getFirst(shipmentItem.getRelated("ReturnItemShipment", null, null, false));
                     returnItem = returnItemShipment.getRelatedOne("ReturnItem", true);
                 }
                 if (returnItem == null) continue; // Just to prevent NPE
@@ -1989,7 +1989,7 @@ public class InvoiceServices {
                 promisedTotal = promisedTotal.add(promisedAmount).setScale(DECIMALS, ROUNDING);
 
                 // for each adjustment related to this ReturnItem, create a separate invoice item
-                List<GenericValue> adjustments = returnItem.getRelatedCache("ReturnAdjustment");
+                List<GenericValue> adjustments = returnItem.getRelated("ReturnAdjustment", null, null, true);
                 for (GenericValue adjustment : adjustments) {
 
                     if (adjustment.get("amount") == null) {
@@ -3076,7 +3076,7 @@ public class InvoiceServices {
                         // item, if available
                         List<GenericValue> paymentApplications = null;
                         try {
-                            paymentApplications = currentInvoiceItem.getRelated("PaymentApplication");
+                            paymentApplications = currentInvoiceItem.getRelated("PaymentApplication", null, null, false);
                         } catch (GenericEntityException e) {
                             return ServiceUtil.returnError(e.getMessage());
                         }
@@ -3314,7 +3314,7 @@ public class InvoiceServices {
             GenericValue payment = delegator.findOne("Payment", UtilMisc.toMap("paymentId", paymentId), false);
             if (payment == null) throw new GenericServiceException("Payment with ID [" + paymentId  + "] not found!");
 
-            List<GenericValue> paymentApplications = payment.getRelated("PaymentApplication");
+            List<GenericValue> paymentApplications = payment.getRelated("PaymentApplication", null, null, false);
             if (UtilValidate.isEmpty(paymentApplications)) return ServiceUtil.returnSuccess();
 
             // TODO: this is inefficient -- instead use HashSet to construct a distinct Set of invoiceIds, then iterate over it and call checkInvoicePaymentAppls

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=1343510&r1=1343509&r2=1343510&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 Tue May 29 04:17:32 2012
@@ -163,7 +163,7 @@ public class InvoiceWorker {
 
         List<GenericValue> invoiceItems = null;
         try {
-            invoiceItems = invoice.getRelated("InvoiceItem");
+            invoiceItems = invoice.getRelated("InvoiceItem", null, null, false);
             invoiceItems = EntityUtil.filterByAnd(
                     invoiceItems, UtilMisc.toList(
                             EntityCondition.makeCondition("invoiceItemTypeId", EntityOperator.NOT_IN, getTaxableInvoiceItemTypeIds(invoice.getDelegator()))
@@ -201,7 +201,7 @@ public class InvoiceWorker {
         // remaining code is the old method, which we leave here for compatibility purposes
         List<GenericValue> billToRoles = null;
         try {
-            billToRoles = invoice.getRelated("InvoiceRole", UtilMisc.toMap("roleTypeId", "BILL_TO_CUSTOMER"), UtilMisc.toList("-datetimePerformed"));
+            billToRoles = invoice.getRelated("InvoiceRole", UtilMisc.toMap("roleTypeId", "BILL_TO_CUSTOMER"), UtilMisc.toList("-datetimePerformed"), false);
         } catch (GenericEntityException e) {
             Debug.logError(e, "Trouble getting InvoiceRole list", module);
         }
@@ -244,7 +244,7 @@ public class InvoiceWorker {
         // remaining code is the old method, which we leave here for compatibility purposes
         List<GenericValue> sendFromRoles = null;
         try {
-            sendFromRoles = invoice.getRelated("InvoiceRole", UtilMisc.toMap("roleTypeId", "BILL_FROM_VENDOR"), UtilMisc.toList("-datetimePerformed"));
+            sendFromRoles = invoice.getRelated("InvoiceRole", UtilMisc.toMap("roleTypeId", "BILL_FROM_VENDOR"), UtilMisc.toList("-datetimePerformed"), false);
         } catch (GenericEntityException e) {
             Debug.logError(e, "Trouble getting InvoiceRole list", module);
         }
@@ -286,7 +286,7 @@ public class InvoiceWorker {
         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);
+            locations = invoice.getRelated("InvoiceContactMech", UtilMisc.toMap("contactMechPurposeTypeId", contactMechPurposeTypeId), null, false);
         } catch (GenericEntityException e) {
             Debug.logError("Touble getting InvoiceContactMech entity list", module);
         }
@@ -474,7 +474,7 @@ public class InvoiceWorker {
         BigDecimal invoiceItemApplied = ZERO;
         List<GenericValue> paymentApplications = null;
         try {
-            paymentApplications = invoiceItem.getRelated("PaymentApplication");
+            paymentApplications = invoiceItem.getRelated("PaymentApplication", null, null, false);
         } catch (GenericEntityException e) {
             Debug.logError(e, "Trouble getting paymentApplicationlist", module);
         }
@@ -512,14 +512,14 @@ public class InvoiceWorker {
 
         try {
             // check if the invoice is posted and get the conversion from there
-            List<GenericValue> acctgTransEntries = invoice.getRelated("AcctgTrans");
+            List<GenericValue> acctgTransEntries = invoice.getRelated("AcctgTrans", null, null, false);
             if (UtilValidate.isNotEmpty(acctgTransEntries)) {
-                GenericValue acctgTransEntry = (acctgTransEntries.get(0)).getRelated("AcctgTransEntry").get(0);
+                GenericValue acctgTransEntry = (acctgTransEntries.get(0)).getRelated("AcctgTransEntry", null, null, false).get(0);
                 conversionRate = acctgTransEntry.getBigDecimal("amount").divide(acctgTransEntry.getBigDecimal("origAmount"), new MathContext(100)).setScale(decimals,rounding);
             }
             // check if a payment is applied and use the currency conversion from there
             if (UtilValidate.isEmpty(conversionRate)) {
-                List<GenericValue> paymentAppls = invoice.getRelated("PaymentApplication");
+                List<GenericValue> paymentAppls = invoice.getRelated("PaymentApplication", null, null, false);
                 for (GenericValue paymentAppl : paymentAppls) {
                     GenericValue payment = paymentAppl.getRelatedOne("Payment", false);
                     if (UtilValidate.isNotEmpty(payment.getBigDecimal("actualCurrencyAmount"))) {
@@ -579,7 +579,7 @@ public class InvoiceWorker {
         List<GenericValue> invoiceItems = null;
         if (UtilValidate.isNotEmpty(invoice)) {
             try {
-                invoiceItems = invoice.getRelated("InvoiceItem");
+                invoiceItems = invoice.getRelated("InvoiceItem", null, null, false);
             } catch (GenericEntityException e) {
                 Debug.logError(e, "Trouble getting InvoiceItem list", module);
             }

Modified: ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/payment/GiftCertificateServices.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/payment/GiftCertificateServices.java?rev=1343510&r1=1343509&r2=1343510&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/payment/GiftCertificateServices.java (original)
+++ ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/payment/GiftCertificateServices.java Tue May 29 04:17:32 2012
@@ -789,7 +789,7 @@ public class GiftCertificateServices {
         // get the response answers
         List<GenericValue> responseAnswers = null;
         try {
-            responseAnswers = surveyResponse.getRelated("SurveyResponseAnswer");
+            responseAnswers = surveyResponse.getRelated("SurveyResponseAnswer", null, null, false);
         } catch (GenericEntityException e) {
             Debug.logError(e, module);
             return ServiceUtil.returnError(UtilProperties.getMessage(resourceError, 
@@ -1025,7 +1025,7 @@ public class GiftCertificateServices {
         // get the response answers
         List<GenericValue> responseAnswers = null;
         try {
-            responseAnswers = surveyResponse.getRelated("SurveyResponseAnswer");
+            responseAnswers = surveyResponse.getRelated("SurveyResponseAnswer", null, null, false);
         } catch (GenericEntityException e) {
             Debug.logError(e, module);
             return ServiceUtil.returnError(UtilProperties.getMessage(resourceOrderError, 

Modified: ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/payment/PaymentGatewayServices.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/payment/PaymentGatewayServices.java?rev=1343510&r1=1343509&r2=1343510&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/payment/PaymentGatewayServices.java (original)
+++ ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/payment/PaymentGatewayServices.java Tue May 29 04:17:32 2012
@@ -668,7 +668,7 @@ public class PaymentGatewayServices {
             GenericValue giftCard = paymentMethod.getRelatedOne("GiftCard", false);
             toContext.put("giftCard", giftCard);
             GenericValue orderHeader = paymentPreference.getRelatedOne("OrderHeader", false);
-            List<GenericValue> orderItems = orderHeader.getRelated("OrderItem");
+            List<GenericValue> orderItems = orderHeader.getRelated("OrderItem", null, null, false);
             toContext.put("orderId", orderHeader.getString("orderId"));
             toContext.put("orderItems", orderItems);
         } else if ("FIN_ACCOUNT".equals(paymentMethodTypeId)) {
@@ -843,7 +843,7 @@ public class PaymentGatewayServices {
             // cancel any payment records
             List<GenericValue> paymentList = null;
             try {
-                paymentList = paymentPref.getRelated("Payment");
+                paymentList = paymentPref.getRelated("Payment", null, null, false);
             } catch (GenericEntityException e) {
                 Debug.logError(e, "Unable to get Payment records from OrderPaymentPreference : " + paymentPref, module);
             }
@@ -1048,7 +1048,7 @@ public class PaymentGatewayServices {
             // cancel any payment records
             List<GenericValue> paymentList = null;
             try {
-                paymentList = paymentPref.getRelated("Payment");
+                paymentList = paymentPref.getRelated("Payment", null, null, false);
             } catch (GenericEntityException e) {
                 Debug.logError(e, "Unable to get Payment records from OrderPaymentPreference : " + paymentPref, module);
             }
@@ -1105,7 +1105,7 @@ public class PaymentGatewayServices {
         // get the OrderItemBilling records for this invoice
         List<GenericValue> orderItemBillings = null;
         try {
-            orderItemBillings = invoice.getRelated("OrderItemBilling");
+            orderItemBillings = invoice.getRelated("OrderItemBilling", null, null, false);
         } catch (GenericEntityException e) {
             Debug.logError("Trouble getting OrderItemBilling(s) from Invoice #" + invoiceId, module);
             return ServiceUtil.returnError(UtilProperties.getMessage(resource, 
@@ -2792,7 +2792,7 @@ public class PaymentGatewayServices {
         GenericValue capTrans = null;
         try {
             List<String> order = UtilMisc.toList("-transactionDate");
-            List<GenericValue> transactions = orderPaymentPreference.getRelated("PaymentGatewayResponse", null, order);
+            List<GenericValue> transactions = orderPaymentPreference.getRelated("PaymentGatewayResponse", null, order, false);
             List<EntityExpr> exprs = UtilMisc.toList(EntityCondition.makeCondition("paymentServiceTypeEnumId", EntityOperator.EQUALS, CAPTURE_SERVICE_TYPE));
             List<GenericValue> capTransactions = EntityUtil.filterByAnd(transactions, exprs);
             capTrans = EntityUtil.getFirst(capTransactions);
@@ -2822,7 +2822,7 @@ public class PaymentGatewayServices {
         List<GenericValue> authTransactions = null;
         try {
             List<String> order = UtilMisc.toList("-transactionDate");
-            List<GenericValue> transactions = orderPaymentPreference.getRelated("PaymentGatewayResponse", null, order);
+            List<GenericValue> transactions = orderPaymentPreference.getRelated("PaymentGatewayResponse", null, order, false);
             List<EntityExpr> exprs = UtilMisc.toList(EntityCondition.makeCondition("paymentServiceTypeEnumId", EntityOperator.EQUALS, AUTH_SERVICE_TYPE),
                     EntityCondition.makeCondition("paymentServiceTypeEnumId", EntityOperator.EQUALS, REAUTH_SERVICE_TYPE));
             authTransactions = EntityUtil.filterByOr(transactions, exprs);
@@ -3748,7 +3748,7 @@ public class PaymentGatewayServices {
 
         List<GenericValue> returnItemResponses = FastList.newInstance();
         try {
-            returnItemResponses = orderHeader.getRelated("ReplacementReturnItemResponse");
+            returnItemResponses = orderHeader.getRelated("ReplacementReturnItemResponse", null, null, false);
         } catch (GenericEntityException e) {
             Debug.logError(e, module);
             return replacementOrderFlag;

Modified: ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/orbital/OrbitalPaymentServices.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/orbital/OrbitalPaymentServices.java?rev=1343510&r1=1343509&r2=1343510&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/orbital/OrbitalPaymentServices.java (original)
+++ ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/orbital/OrbitalPaymentServices.java Tue May 29 04:17:32 2012
@@ -631,7 +631,7 @@ public class OrbitalPaymentServices {
         String shippingRef = "";
         try {
             GenericValue orderHeader = delegator.findOne("OrderHeader", false, UtilMisc.toMap("orderId", orderId));
-            GenericValue trackingCodeOrder = EntityUtil.getFirst(orderHeader.getRelated("TrackingCodeOrder"));
+            GenericValue trackingCodeOrder = EntityUtil.getFirst(orderHeader.getRelated("TrackingCodeOrder", null, null, false));
             GenericValue trackingCode = null;
             if (UtilValidate.isNotEmpty(trackingCodeOrder)) {
                 trackingCode = trackingCodeOrder.getRelatedOne("TrackingCode", false);

Modified: ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/valuelink/ValueLinkServices.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/valuelink/ValueLinkServices.java?rev=1343510&r1=1343509&r2=1343510&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/valuelink/ValueLinkServices.java (original)
+++ ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/thirdparty/valuelink/ValueLinkServices.java Tue May 29 04:17:32 2012
@@ -1149,7 +1149,7 @@ public class ValueLinkServices {
         // get the response answers
         List<GenericValue> responseAnswers = null;
         try {
-            responseAnswers = surveyResponse.getRelated("SurveyResponseAnswer");
+            responseAnswers = surveyResponse.getRelated("SurveyResponseAnswer", null, null, false);
         } catch (GenericEntityException e) {
             Debug.logError(e, module);
             return ServiceUtil.returnError(UtilProperties.getMessage(resourceError,
@@ -1404,7 +1404,7 @@ public class ValueLinkServices {
         // get the response answers
         List<GenericValue> responseAnswers = null;
         try {
-            responseAnswers = surveyResponse.getRelated("SurveyResponseAnswer");
+            responseAnswers = surveyResponse.getRelated("SurveyResponseAnswer", null, null, false);
         } catch (GenericEntityException e) {
             Debug.logError(e, module);
             return ServiceUtil.returnError(UtilProperties.getMessage(resourceError,

Modified: ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/util/UtilAccounting.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/util/UtilAccounting.java?rev=1343510&r1=1343509&r2=1343510&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/util/UtilAccounting.java (original)
+++ ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/util/UtilAccounting.java Tue May 29 04:17:32 2012
@@ -124,7 +124,7 @@ public class UtilAccounting {
     }
     private static void getGlAccountClassChildren(GenericValue glAccountClass, List<String> glAccountClassIds) throws GenericEntityException {
         glAccountClassIds.add(glAccountClass.getString("glAccountClassId"));
-        List<GenericValue> glAccountClassChildren = glAccountClass.getRelatedCache("ChildGlAccountClass");
+        List<GenericValue> glAccountClassChildren = glAccountClass.getRelated("ChildGlAccountClass", null, null, true);
         for(GenericValue glAccountClassChild : glAccountClassChildren) {
             getGlAccountClassChildren(glAccountClassChild, glAccountClassIds);
         }

Modified: ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/admin/ListInvoiceItemTypesGlAccount.groovy
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/admin/ListInvoiceItemTypesGlAccount.groovy?rev=1343510&r1=1343509&r2=1343510&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/admin/ListInvoiceItemTypesGlAccount.groovy (original)
+++ ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/admin/ListInvoiceItemTypesGlAccount.groovy Tue May 29 04:17:32 2012
@@ -43,7 +43,7 @@ invoiceItemTypes.each { invoiceItemType 
         invoiceItemTypeOrg = invoiceItemTypeOrgs[0];
         overrideGlAccountId = invoiceItemTypeOrg.glAccountId;
 
-        glAccounts = invoiceItemTypeOrg.getRelated("GlAccount");
+        glAccounts = invoiceItemTypeOrg.getRelated("GlAccount", null, null, false);
         if (glAccounts) {
             glAccount = glAccounts[0];
         }

Modified: ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/invoice/CreateApplicationList.groovy
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/invoice/CreateApplicationList.groovy?rev=1343510&r1=1343509&r2=1343510&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/invoice/CreateApplicationList.groovy (original)
+++ ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/invoice/CreateApplicationList.groovy Tue May 29 04:17:32 2012
@@ -33,7 +33,7 @@ if (!invoice) return;
 
 invoiceApplications = [];  // to pass back to the screen with payment applications added
 // retrieve related applications with null itemnumber
-invoiceAppls = invoice.getRelated("PaymentApplication", [invoiceItemSeqId : null], null);
+invoiceAppls = invoice.getRelated("PaymentApplication", [invoiceItemSeqId : null], null, false);
 invoiceAppls.each { invoiceAppl ->
     itemmap = [:];
     itemmap.invoiceId = invoiceAppl.invoiceId;
@@ -50,7 +50,7 @@ invoiceAppls.each { invoiceAppl ->
 
 
 // retrieve related applications with an existing itemnumber
-invoice.getRelated("InvoiceItem").each { item ->
+invoice.getRelated("InvoiceItem", null, null, false).each { item ->
     BigDecimal itemTotal = null;
     if (item.amount != null) {
           if (!item.quantity) {
@@ -60,7 +60,7 @@ invoice.getRelated("InvoiceItem").each {
           }
     }
     // get relation payment applications for every item(can be more than 1 per item number)
-    item.getRelated("PaymentApplication").each { paymentApplication ->
+    item.getRelated("PaymentApplication", null, null, false).each { paymentApplication ->
         itemmap = [:];
         itemmap.putAll(item);
         itemmap.total = NumberFormat.getInstance(locale).format(itemTotal);

Modified: ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/invoice/EditInvoice.groovy
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/invoice/EditInvoice.groovy?rev=1343510&r1=1343509&r2=1343510&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/invoice/EditInvoice.groovy (original)
+++ ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/invoice/EditInvoice.groovy Tue May 29 04:17:32 2012
@@ -101,8 +101,8 @@ if (invoice) {
 
                 //*________________this snippet was added for adding Tax ID in invoice header if needed _________________
 
-               sendingTaxInfos = sendingParty.getRelated("PartyTaxAuthInfo");
-               billingTaxInfos = billingParty.getRelated("PartyTaxAuthInfo");
+               sendingTaxInfos = sendingParty.getRelated("PartyTaxAuthInfo", null, null, false);
+               billingTaxInfos = billingParty.getRelated("PartyTaxAuthInfo", null, null, false);
                sendingPartyTaxId = null;
                billingPartyTaxId = null;
 
@@ -127,7 +127,7 @@ if (invoice) {
                //________________this snippet was added for adding Tax ID in invoice header if needed _________________*/
 
 
-    terms = invoice.getRelated("InvoiceTerm");
+    terms = invoice.getRelated("InvoiceTerm", null, null, false);
     context.terms = terms;
 
     paymentAppls = delegator.findByAnd("PaymentApplication", [invoiceId : invoiceId], null, false);

Modified: ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/invoice/GetInvoiceItemTypes.groovy
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/invoice/GetInvoiceItemTypes.groovy?rev=1343510&r1=1343509&r2=1343510&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/invoice/GetInvoiceItemTypes.groovy (original)
+++ ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/invoice/GetInvoiceItemTypes.groovy Tue May 29 04:17:32 2012
@@ -75,7 +75,7 @@ if ("SALES_INVOICE".equals(invoice.invoi
     glAccountOrganizationAndClassList = delegator.findByAnd("GlAccountOrganizationAndClass", [organizationPartyId : invoice.partyId], null, false);
 } else {
     map = delegator.findByAnd("InvoiceItemTypeMap", [invoiceTypeId : invoice.invoiceTypeId], null, true);
-    invoiceItemTypes = EntityUtil.getRelated("InvoiceItemType", map);
+    invoiceItemTypes = EntityUtil.getRelated("InvoiceItemType", map, null, false);
 }
 context.invoiceItemTypes = invoiceItemTypes;
 

Modified: ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/invoice/PrintInvoices.groovy
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/invoice/PrintInvoices.groovy?rev=1343510&r1=1343509&r2=1343510&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/invoice/PrintInvoices.groovy (original)
+++ ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/invoice/PrintInvoices.groovy Tue May 29 04:17:32 2012
@@ -71,8 +71,8 @@ invoiceIds.each { invoiceId ->
         invoicesMap.sendingParty = sendingParty;
 
         // This snippet was added for adding Tax ID in invoice header if needed 
-        sendingTaxInfos = sendingParty.getRelated("PartyTaxAuthInfo");
-        billingTaxInfos = billingParty.getRelated("PartyTaxAuthInfo");
+        sendingTaxInfos = sendingParty.getRelated("PartyTaxAuthInfo", null, null, false);
+        billingTaxInfos = billingParty.getRelated("PartyTaxAuthInfo", null, null, false);
         sendingPartyTaxId = null;
         billingPartyTaxId = null;
 
@@ -95,7 +95,7 @@ invoiceIds.each { invoiceId ->
             invoicesMap.billingPartyTaxId = billingPartyTaxId;
         }
     
-        terms = invoice.getRelated("InvoiceTerm");
+        terms = invoice.getRelated("InvoiceTerm", null, null, false);
         invoicesMap.terms = terms;
     
         paymentAppls = delegator.findList("PaymentApplication", EntityCondition.makeCondition([invoiceId : invoiceId]), null, null, null, false);

Modified: ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/transaction/CaptureTransaction.groovy
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/transaction/CaptureTransaction.groovy?rev=1343510&r1=1343509&r2=1343510&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/transaction/CaptureTransaction.groovy (original)
+++ ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/transaction/CaptureTransaction.groovy Tue May 29 04:17:32 2012
@@ -49,7 +49,7 @@ if (orderPaymentPreference) {
 
 if (orderPaymentPreference) {
     // we retrieve the captureAmount by looking at the latest authorized gateway response for this orderPaymentPreference
-    gatewayResponses = orderPaymentPreference.getRelated("PaymentGatewayResponse", ["transactionDate DESC"]);
+    gatewayResponses = orderPaymentPreference.getRelated("PaymentGatewayResponse", null, ["transactionDate DESC"], false);
     EntityUtil.filterByCondition(gatewayResponses, EntityCondition.makeCondition("transCodeEnumId", EntityOperator.EQUALS, "PGT_AUTHORIZE"));
 
     if (gatewayResponses) {

Modified: ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/transaction/ViewGatewayResponse.groovy
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/transaction/ViewGatewayResponse.groovy?rev=1343510&r1=1343509&r2=1343510&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/transaction/ViewGatewayResponse.groovy (original)
+++ ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/actions/transaction/ViewGatewayResponse.groovy Tue May 29 04:17:32 2012
@@ -43,7 +43,7 @@ if (!orderPaymentPreferenceId) {
 } else {
     // second purpose: grab the latest gateway response of the orderpaymentpreferenceId
     orderPaymentPreference = delegator.findOne("OrderPaymentPreference", [orderPaymentPreferenceId : orderPaymentPreferenceId], false);
-    gatewayResponses = orderPaymentPreference.getRelated("PaymentGatewayResponse", ["transactionDate DESC"]);
+    gatewayResponses = orderPaymentPreference.getRelated("PaymentGatewayResponse", null, ["transactionDate DESC"], false);
     EntityUtil.filterByCondition(gatewayResponses, EntityCondition.makeCondition("transCodeEnumId", EntityOperator.EQUALS, "PGT_AUTHORIZE"));
     
     if (gatewayResponses) {
@@ -57,5 +57,5 @@ if (!orderPaymentPreferenceId) {
 }
 // get the list of payments associated to gateway response
 if (context.paymentGatewayResponse) {
-    context.payments = context.paymentGatewayResponse.getRelated("Payment");
+    context.payments = context.paymentGatewayResponse.getRelated("Payment", null, null, false);
 }

Modified: ofbiz/trunk/applications/accounting/webapp/accounting/finaccounttrans/FinAccountTrans.ftl
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/webapp/accounting/finaccounttrans/FinAccountTrans.ftl?rev=1343510&r1=1343509&r2=1343510&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/webapp/accounting/finaccounttrans/FinAccountTrans.ftl (original)
+++ ofbiz/trunk/applications/accounting/webapp/accounting/finaccounttrans/FinAccountTrans.ftl Tue May 29 04:17:32 2012
@@ -197,7 +197,7 @@ function getFinAccountTransRunningTotalA
                         <#assign paymentMethodType = delegator.findOne("PaymentMethodType", {"paymentMethodTypeId" : payment.paymentMethodTypeId}, true)>
                       </#if>
                       <#if payment?has_content>
-                        <#assign paymentGroupMembers = Static["org.ofbiz.entity.util.EntityUtil"].filterByDate(payment.getRelated("PaymentGroupMember")?if_exists) />
+                        <#assign paymentGroupMembers = Static["org.ofbiz.entity.util.EntityUtil"].filterByDate(payment.getRelated("PaymentGroupMember", null, null, false)?if_exists) />
                         <#assign fromParty = payment.getRelatedOne("FromParty", false)?if_exists />
                         <#assign fromPartyName = delegator.findOne("PartyNameView", {"partyId" : fromParty.partyId}, true) />
                         <#assign toParty = payment.getRelatedOne("ToParty", false)?if_exists />

Modified: ofbiz/trunk/applications/accounting/webapp/accounting/invoice/PrintInvoices.fo.ftl
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/webapp/accounting/invoice/PrintInvoices.fo.ftl?rev=1343510&r1=1343509&r2=1343510&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/webapp/accounting/invoice/PrintInvoices.fo.ftl (original)
+++ ofbiz/trunk/applications/accounting/webapp/accounting/invoice/PrintInvoices.fo.ftl Tue May 29 04:17:32 2012
@@ -186,7 +186,7 @@ under the License.
                     <#list invoiceItems as invoiceItem>
                       <#assign itemType = invoiceItem.getRelatedOne("InvoiceItemType", false)>
                       <#assign taxRate = invoiceItem.getRelatedOne("TaxAuthorityRateProduct", false)?if_exists>
-                      <#assign itemBillings = invoiceItem.getRelated("OrderItemBilling")?if_exists>
+                      <#assign itemBillings = invoiceItem.getRelated("OrderItemBilling", null, null, false)?if_exists>
                       <#if itemBillings?has_content>
                         <#assign itemBilling = Static["org.ofbiz.entity.util.EntityUtil"].getFirst(itemBillings)>
                         <#if itemBilling?has_content>

Modified: ofbiz/trunk/applications/accounting/webapp/accounting/invoice/invoiceReportItems.fo.ftl
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/webapp/accounting/invoice/invoiceReportItems.fo.ftl?rev=1343510&r1=1343509&r2=1343510&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/webapp/accounting/invoice/invoiceReportItems.fo.ftl (original)
+++ ofbiz/trunk/applications/accounting/webapp/accounting/invoice/invoiceReportItems.fo.ftl Tue May 29 04:17:32 2012
@@ -99,7 +99,7 @@ under the License.
             <#assign isItemAdjustment = Static["org.ofbiz.entity.util.EntityTypeUtil"].hasParentType(delegator, "InvoiceItemType", "invoiceItemTypeId", itemType.getString("invoiceItemTypeId"), "parentTypeId", "INVOICE_ADJ")/>
 
             <#assign taxRate = invoiceItem.getRelatedOne("TaxAuthorityRateProduct", false)?if_exists>
-            <#assign itemBillings = invoiceItem.getRelated("OrderItemBilling")?if_exists>
+            <#assign itemBillings = invoiceItem.getRelated("OrderItemBilling", null, null, false)?if_exists>
             <#if itemBillings?has_content>
                 <#assign itemBilling = Static["org.ofbiz.entity.util.EntityUtil"].getFirst(itemBillings)>
                 <#if itemBilling?has_content>

Modified: ofbiz/trunk/applications/accounting/webapp/accounting/payment/PrintChecks.fo.ftl
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/webapp/accounting/payment/PrintChecks.fo.ftl?rev=1343510&r1=1343509&r2=1343510&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/webapp/accounting/payment/PrintChecks.fo.ftl (original)
+++ ofbiz/trunk/applications/accounting/webapp/accounting/payment/PrintChecks.fo.ftl Tue May 29 04:17:32 2012
@@ -46,7 +46,7 @@ by hand from a real template using a rul
       </#if>
 
       <#list payments as payment>
-      <#assign paymentApplications = payment.getRelated("PaymentApplication")>
+      <#assign paymentApplications = payment.getRelated("PaymentApplication", null, null, false)>
       <fo:block font-size="10pt" break-before="page"> <#-- this produces a page break if this block cannot fit on the current page -->
 
         <#-- the check: note that the format is fairly precise -->
@@ -171,7 +171,7 @@ by hand from a real template using a rul
               </fo:table-cell>
             </fo:table-row>
             <#if invoice.invoiceTypeId?if_exists == "PAYROL_INVOICE">
-              <#assign InvoiceItems = invoice.getRelated("InvoiceItem")?if_exists>
+              <#assign InvoiceItems = invoice.getRelated("InvoiceItem", null, null, false)?if_exists>
               <#assign PayrolGroups = PayrolGroup?if_exists>
               <#list PayrolGroups as payrolGroup>
                   <#assign fontSize = "75%">
@@ -367,7 +367,7 @@ by hand from a real template using a rul
               </fo:table-cell>
             </fo:table-row>
             <#if invoice.invoiceTypeId?if_exists == "PAYROL_INVOICE">
-              <#assign InvoiceItems = invoice.getRelated("InvoiceItem")?if_exists>
+              <#assign InvoiceItems = invoice.getRelated("InvoiceItem", null, null, false)?if_exists>
               <#assign PayrolGroups = PayrolGroup?if_exists>
               <#list PayrolGroups as payrolGroup>
                   <#assign fontSize = "75%">