From 7d2b0d9865720e89bcfd0ff3e2ad4f998cea9db3 Mon Sep 17 00:00:00 2001 From: Adam Heath Date: Tue, 29 May 2012 04:11:43 +0000 Subject: [PATCH] DEPRECATION: applications/accounting: getRelatedOne variants replaced with a getRelatedOne variant that takes a boolean useCache parameter. git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1343479 13f79535-47bb-0310-9956-ffa450edef68 --- .../finaccount/FinAccountPaymentServices.java | 4 +- .../finaccount/FinAccountProductServices.java | 4 +- .../finaccount/FinAccountServices.java | 4 +- .../accounting/invoice/InvoiceServices.java | 30 ++++++------ .../accounting/invoice/InvoiceWorker.java | 14 +++--- .../payment/BillingAccountWorker.java | 4 +- .../payment/GiftCertificateServices.java | 14 +++--- .../payment/PaymentGatewayServices.java | 46 +++++++++---------- .../accounting/payment/PaymentWorker.java | 12 ++--- .../authorizedotnet/AIMPaymentServices.java | 8 ++-- .../clearcommerce/CCPaymentServices.java | 2 +- .../cybersource/IcsPaymentServices.java | 2 +- .../thirdparty/eway/EwayServices.java | 4 +- .../thirdparty/gosoftware/RitaServices.java | 2 +- .../orbital/OrbitalPaymentServices.java | 14 +++--- .../thirdparty/paypal/PayPalServices.java | 4 +- .../sagepay/SagePayPaymentServices.java | 4 +- .../valuelink/ValueLinkServices.java | 14 +++--- .../thirdparty/verisign/PayflowPro.java | 8 ++-- .../thirdparty/worldpay/WorldPayEvents.java | 2 +- .../ofbiz/accounting/util/UtilAccounting.java | 14 +++--- .../ListInvoiceItemTypesGlAccount.groovy | 2 +- .../actions/invoice/EditInvoice.groovy | 4 +- .../actions/invoice/PrintInvoices.groovy | 2 +- .../WEB-INF/actions/payment/ManualTx.groovy | 12 ++--- .../actions/payment/PrintChecks.groovy | 2 +- .../period/EditCustomTimePeriod.groovy | 2 +- .../actions/reports/BalanceSheet.groovy | 2 +- ...alesInvoiceByProductCategorySummary.groovy | 4 +- .../transaction/AuthorizeTransaction.groovy | 2 +- .../transaction/CaptureTransaction.groovy | 2 +- .../transaction/ViewGatewayResponse.groovy | 2 +- .../finaccounttrans/FinAccountTrans.ftl | 4 +- .../GlReconciledFinAccountTrans.ftl | 4 +- .../accounting/invoice/PrintInvoices.fo.ftl | 8 ++-- .../invoice/invoiceReportHeaderInfo.fo.ftl | 2 +- .../invoice/invoiceReportItems.fo.ftl | 8 ++-- .../accounting/payment/PrintChecks.fo.ftl | 16 +++---- .../period/EditCustomTimePeriod.ftl | 8 ++-- .../AcctgTransEntriesSearchResult.fo.ftl | 2 +- ...esSearchResultsInvoiceAndPayment.rptdesign | 2 +- .../reports/AcctgTransSearchResult.fo.ftl | 2 +- .../accounting/reports/BalanceSheet.rptdesign | 2 +- .../reports/IncomeStatement.rptdesign | 2 +- .../reports/InvoiceAcctgTransEntry.rptdesign | 8 ++-- .../reports/PaymentAcctgTransEntry.rptdesign | 8 ++-- .../accounting/reports/TrialBalance.rptdesign | 2 +- .../webapp/ap/invoices/PurchaseInvoices.ftl | 2 +- 48 files changed, 163 insertions(+), 163 deletions(-) diff --git a/applications/accounting/src/org/ofbiz/accounting/finaccount/FinAccountPaymentServices.java b/applications/accounting/src/org/ofbiz/accounting/finaccount/FinAccountPaymentServices.java index 236d809ee7..3abd18032c 100644 --- a/applications/accounting/src/org/ofbiz/accounting/finaccount/FinAccountPaymentServices.java +++ b/applications/accounting/src/org/ofbiz/accounting/finaccount/FinAccountPaymentServices.java @@ -355,7 +355,7 @@ public class FinAccountPaymentServices { // get the financial account GenericValue finAccount; try { - finAccount = finAccountAuth.getRelatedOne("FinAccount"); + finAccount = finAccountAuth.getRelatedOne("FinAccount", false); } catch (GenericEntityException e) { Debug.logError(e, module); return ServiceUtil.returnError(e.getMessage()); @@ -733,7 +733,7 @@ public class FinAccountPaymentServices { // look up the type -- determine auto-replenish is active GenericValue finAccountType; try { - finAccountType = finAccount.getRelatedOne("FinAccountType"); + finAccountType = finAccount.getRelatedOne("FinAccountType", false); } catch (GenericEntityException e) { Debug.logError(e, module); return ServiceUtil.returnError(e.getMessage()); diff --git a/applications/accounting/src/org/ofbiz/accounting/finaccount/FinAccountProductServices.java b/applications/accounting/src/org/ofbiz/accounting/finaccount/FinAccountProductServices.java index f3fe962879..b93a8f701a 100644 --- a/applications/accounting/src/org/ofbiz/accounting/finaccount/FinAccountProductServices.java +++ b/applications/accounting/src/org/ofbiz/accounting/finaccount/FinAccountProductServices.java @@ -62,7 +62,7 @@ public class FinAccountProductServices { // the order header for store info GenericValue orderHeader; try { - orderHeader = orderItem.getRelatedOne("OrderHeader"); + orderHeader = orderItem.getRelatedOne("OrderHeader", false); } catch (GenericEntityException e) { Debug.logError(e, "Unable to get OrderHeader from OrderItem", module); return ServiceUtil.returnError(UtilProperties.getMessage(resourceOrderError, @@ -152,7 +152,7 @@ public class FinAccountProductServices { if (billToParty != null) { try { - party = billToParty.getRelatedOne("Party"); + party = billToParty.getRelatedOne("Party", false); } catch (GenericEntityException e) { Debug.logError(e, module); } diff --git a/applications/accounting/src/org/ofbiz/accounting/finaccount/FinAccountServices.java b/applications/accounting/src/org/ofbiz/accounting/finaccount/FinAccountServices.java index e0259222ef..45f56d692f 100644 --- a/applications/accounting/src/org/ofbiz/accounting/finaccount/FinAccountServices.java +++ b/applications/accounting/src/org/ofbiz/accounting/finaccount/FinAccountServices.java @@ -389,7 +389,7 @@ public class FinAccountServices { // make sure there is an order available to refund if (orderId != null && orderItemSeqId != null) { GenericValue orderHeader = delegator.findOne("OrderHeader", UtilMisc.toMap("orderId",orderId), false); - GenericValue productStore = orderHeader.getRelatedOne("ProductStore"); + GenericValue productStore = orderHeader.getRelatedOne("ProductStore", false); GenericValue orderItem = delegator.findOne("OrderItem", UtilMisc.toMap("orderId", orderId, "orderItemSeqId", orderItemSeqId), false); if (!"ITEM_CANCELLED".equals(orderItem.getString("statusId"))) { @@ -449,7 +449,7 @@ public class FinAccountServices { // get the return item GenericValue returnItem = delegator.findOne("ReturnItem", UtilMisc.toMap("returnId", returnId, "returnItemSeqId", returnItemSeqId), false); - GenericValue response = returnItem.getRelatedOne("ReturnItemResponse"); + GenericValue response = returnItem.getRelatedOne("ReturnItemResponse", false); if (response == null) { throw new GeneralException("No return response found for: " + returnItem.getPrimaryKey()); } diff --git a/applications/accounting/src/org/ofbiz/accounting/invoice/InvoiceServices.java b/applications/accounting/src/org/ofbiz/accounting/invoice/InvoiceServices.java index b86c3855d4..f7b4abfc57 100644 --- a/applications/accounting/src/org/ofbiz/accounting/invoice/InvoiceServices.java +++ b/applications/accounting/src/org/ofbiz/accounting/invoice/InvoiceServices.java @@ -210,7 +210,7 @@ public class InvoiceServices { BigDecimal invoiceSubTotal = ZERO; BigDecimal invoiceQuantity = ZERO; - GenericValue billingAccount = orderHeader.getRelatedOne("BillingAccount"); + GenericValue billingAccount = orderHeader.getRelatedOne("BillingAccount", false); String billingAccountId = billingAccount != null ? billingAccount.getString("billingAccountId") : null; Timestamp invoiceDate = (Timestamp)context.get("eventDate"); @@ -333,7 +333,7 @@ public class InvoiceServices { // for purchase orders, the pay to address is the BILLING_LOCATION of the vendor GenericValue billFromVendor = orh.getPartyFromRole("BILL_FROM_VENDOR"); if (billFromVendor != null) { - List billingContactMechs = billFromVendor.getRelatedOne("Party").getRelatedByAnd("PartyContactMechPurpose", UtilMisc.toMap("contactMechPurposeTypeId", "BILLING_LOCATION")); + List billingContactMechs = billFromVendor.getRelatedOne("Party", false).getRelatedByAnd("PartyContactMechPurpose", UtilMisc.toMap("contactMechPurposeTypeId", "BILLING_LOCATION")); if (UtilValidate.isNotEmpty(billingContactMechs)) { payToAddress = EntityUtil.getFirst(billingContactMechs); } @@ -372,9 +372,9 @@ public class InvoiceServices { } if (orderItem == null && itemIssuance != null) { - orderItem = itemIssuance.getRelatedOne("OrderItem"); + orderItem = itemIssuance.getRelatedOne("OrderItem", false); } else if ((orderItem == null) && (shipmentReceipt != null)) { - orderItem = shipmentReceipt.getRelatedOne("OrderItem"); + orderItem = shipmentReceipt.getRelatedOne("OrderItem", false); } else if ((orderItem == null) && (itemIssuance == null) && (shipmentReceipt == null)) { Debug.logError("Cannot create invoice when orderItem, itemIssuance, and shipmentReceipt are all null", module); return ServiceUtil.returnError(UtilProperties.getMessage(resource, @@ -382,7 +382,7 @@ public class InvoiceServices { } GenericValue product = null; if (orderItem.get("productId") != null) { - product = orderItem.getRelatedOne("Product"); + product = orderItem.getRelatedOne("Product", false); } // get some quantities @@ -580,7 +580,7 @@ public class InvoiceServices { // represent an organization override for the payToPartyId if (UtilValidate.isNotEmpty(adj.getString("productPromoId"))) { try { - GenericValue productPromo = adj.getRelatedOne("ProductPromo"); + GenericValue productPromo = adj.getRelatedOne("ProductPromo", false); if (UtilValidate.isNotEmpty(productPromo.getString("overrideOrgPartyId"))) { createInvoiceItemAdjContext.put("overrideOrgPartyId", productPromo.getString("overrideOrgPartyId")); } @@ -1170,7 +1170,7 @@ public class InvoiceServices { GenericValue orderItemBilling = EntityUtil.getFirst(orderItemBillings); GenericValue invoice = null; try { - invoice = orderItemBilling.getRelatedOne("Invoice"); + invoice = orderItemBilling.getRelatedOne("Invoice", false); } catch (GenericEntityException e) { Debug.logError(e, module); return ServiceUtil.returnError(e.getMessage()); @@ -1273,7 +1273,7 @@ public class InvoiceServices { Iterator itemsIter = items.iterator(); while (itemsIter.hasNext()) { GenericValue item = itemsIter.next(); - GenericValue inventoryItem = item.getRelatedOne("InventoryItem"); + GenericValue inventoryItem = item.getRelatedOne("InventoryItem", false); GenericValue ownerPartyRole = delegator.findOne("PartyRole", UtilMisc.toMap("partyId", inventoryItem.getString("ownerPartyId"), "roleTypeId", "INTERNAL_ORGANIZATIO"), true); if (UtilValidate.isEmpty(ownerPartyRole)) { itemsIter.remove(); @@ -1391,7 +1391,7 @@ public class InvoiceServices { List billed = null; BigDecimal orderedQty = null; try { - orderItem = issue.getEntityName().equals("OrderItem") ? issue : issue.getRelatedOne("OrderItem"); + orderItem = issue.getEntityName().equals("OrderItem") ? issue : issue.getRelatedOne("OrderItem", false); // total ordered orderedQty = orderItem.getBigDecimal("quantity"); @@ -1400,7 +1400,7 @@ public class InvoiceServices { // Override the issueQty with the quantity from the purchase order item GenericValue orderItemAssoc = EntityUtil.getFirst(EntityUtil.filterByAnd(orderItemAssocs, UtilMisc.toMap("orderId", issue.getString("orderId"), "orderItemSeqId", issue.getString("orderItemSeqId")))); - GenericValue purchaseOrderItem = orderItemAssoc.getRelatedOne("ToOrderItem"); + GenericValue purchaseOrderItem = orderItemAssoc.getRelatedOne("ToOrderItem", false); orderItem.set("quantity", purchaseOrderItem.getBigDecimal("quantity")); issueQty = purchaseOrderItem.getBigDecimal("quantity"); } @@ -1550,7 +1550,7 @@ public class InvoiceServices { GenericValue payToParty = orh.getBillFromParty(); GenericValue destinationContactMech = null; try { - destinationContactMech = shipment.getRelatedOne("DestinationPostalAddress"); + destinationContactMech = shipment.getRelatedOne("DestinationPostalAddress", false); } catch (GenericEntityException e) { Debug.logError(e, "Trouble calling createInvoicesFromShipment service; invoice not created for shipment " + shipmentId, module); return ServiceUtil.returnError(UtilProperties.getMessage(resource, @@ -1911,14 +1911,14 @@ public class InvoiceServices { // we need the related return item and product GenericValue returnItem = null; if (shipmentReceiptFound) { - returnItem = item.getRelatedOneCache("ReturnItem"); + returnItem = item.getRelatedOne("ReturnItem", true); } else if (itemIssuanceFound) { - GenericValue shipmentItem = item.getRelatedOneCache("ShipmentItem"); + GenericValue shipmentItem = item.getRelatedOne("ShipmentItem", true); GenericValue returnItemShipment = EntityUtil.getFirst(shipmentItem.getRelated("ReturnItemShipment")); - returnItem = returnItemShipment.getRelatedOneCache("ReturnItem"); + returnItem = returnItemShipment.getRelatedOne("ReturnItem", true); } if (returnItem == null) continue; // Just to prevent NPE - GenericValue product = returnItem.getRelatedOneCache("Product"); + GenericValue product = returnItem.getRelatedOne("Product", true); // extract the return price as a big decimal for convenience BigDecimal returnPrice = returnItem.getBigDecimal("returnPrice"); diff --git a/applications/accounting/src/org/ofbiz/accounting/invoice/InvoiceWorker.java b/applications/accounting/src/org/ofbiz/accounting/invoice/InvoiceWorker.java index 235fa50644..d95a1cbddc 100644 --- a/applications/accounting/src/org/ofbiz/accounting/invoice/InvoiceWorker.java +++ b/applications/accounting/src/org/ofbiz/accounting/invoice/InvoiceWorker.java @@ -190,7 +190,7 @@ public class InvoiceWorker { */ public static GenericValue getBillToParty(GenericValue invoice) { try { - GenericValue billToParty = invoice.getRelatedOne("Party"); + GenericValue billToParty = invoice.getRelatedOne("Party", false); if (billToParty != null) { return billToParty; } @@ -210,7 +210,7 @@ public class InvoiceWorker { GenericValue role = EntityUtil.getFirst(billToRoles); GenericValue party = null; try { - party = role.getRelatedOne("Party"); + party = role.getRelatedOne("Party", false); } catch (GenericEntityException e) { Debug.logError(e, "Trouble getting Party from InvoiceRole", module); } @@ -223,7 +223,7 @@ public class InvoiceWorker { /** Convenience method to obtain the bill from party for an invoice. Note that invoice.partyIdFrom is the bill from party. */ public static GenericValue getBillFromParty(GenericValue invoice) { try { - return invoice.getRelatedOne("FromParty"); + return invoice.getRelatedOne("FromParty", false); } catch (GenericEntityException e) { Debug.logError(e, "Trouble getting FromParty from Invoice", module); } @@ -253,7 +253,7 @@ public class InvoiceWorker { GenericValue role = EntityUtil.getFirst(sendFromRoles); GenericValue party = null; try { - party = role.getRelatedOne("Party"); + party = role.getRelatedOne("Party", false); } catch (GenericEntityException e) { Debug.logError(e, "Trouble getting Party from InvoiceRole", module); } @@ -320,14 +320,14 @@ public class InvoiceWorker { GenericValue contactMech = null; if (UtilValidate.isNotEmpty(locations)) { try { - contactMech = locations.get(0).getRelatedOne("ContactMech"); + contactMech = locations.get(0).getRelatedOne("ContactMech", false); } catch (GenericEntityException e) { Debug.logError(e, "Trouble getting Contact for contactMechId: " + locations.get(0).getString("contactMechId"), module); } if (contactMech != null && contactMech.getString("contactMechTypeId").equals("POSTAL_ADDRESS")) { try { - postalAddress = contactMech.getRelatedOne("PostalAddress"); + postalAddress = contactMech.getRelatedOne("PostalAddress", false); return postalAddress; } catch (GenericEntityException e) { Debug.logError(e, "Trouble getting PostalAddress for contactMechId: " + contactMech.getString("contactMechId"), module); @@ -521,7 +521,7 @@ public class InvoiceWorker { if (UtilValidate.isEmpty(conversionRate)) { List paymentAppls = invoice.getRelated("PaymentApplication"); for (GenericValue paymentAppl : paymentAppls) { - GenericValue payment = paymentAppl.getRelatedOne("Payment"); + GenericValue payment = paymentAppl.getRelatedOne("Payment", false); if (UtilValidate.isNotEmpty(payment.getBigDecimal("actualCurrencyAmount"))) { if (UtilValidate.isEmpty(conversionRate)) { conversionRate = payment.getBigDecimal("amount").divide(payment.getBigDecimal("actualCurrencyAmount"),new MathContext(100)).setScale(decimals,rounding); diff --git a/applications/accounting/src/org/ofbiz/accounting/payment/BillingAccountWorker.java b/applications/accounting/src/org/ofbiz/accounting/payment/BillingAccountWorker.java index d955106ad6..290a0236d3 100644 --- a/applications/accounting/src/org/ofbiz/accounting/payment/BillingAccountWorker.java +++ b/applications/accounting/src/org/ofbiz/accounting/payment/BillingAccountWorker.java @@ -85,7 +85,7 @@ public class BillingAccountWorker { if (billingAccountRoleList.size() > 0) { BigDecimal totalAvailable = BigDecimal.ZERO; for(GenericValue billingAccountRole : billingAccountRoleList) { - GenericValue billingAccountVO = billingAccountRole.getRelatedOne("BillingAccount"); + GenericValue billingAccountVO = billingAccountRole.getRelatedOne("BillingAccount", false); // skip accounts that have thruDate < nowTimestamp java.sql.Timestamp thruDate = billingAccountVO.getTimestamp("thruDate"); @@ -255,7 +255,7 @@ public class BillingAccountWorker { for (Iterator pAi = paymentAppls.iterator(); pAi.hasNext();) { GenericValue paymentAppl = pAi.next(); BigDecimal amountApplied = paymentAppl.getBigDecimal("amountApplied"); - GenericValue invoice = paymentAppl.getRelatedOne("Invoice"); + GenericValue invoice = paymentAppl.getRelatedOne("Invoice", false); if (invoice != null) { // make sure the invoice has not been canceled and it is not a "Customer return invoice" if (!"CUST_RTN_INVOICE".equals(invoice.getString("invoiceTypeId")) && !"INVOICE_CANCELLED".equals(invoice.getString("statusId"))) { diff --git a/applications/accounting/src/org/ofbiz/accounting/payment/GiftCertificateServices.java b/applications/accounting/src/org/ofbiz/accounting/payment/GiftCertificateServices.java index fd76437e2b..e9c327a648 100644 --- a/applications/accounting/src/org/ofbiz/accounting/payment/GiftCertificateServices.java +++ b/applications/accounting/src/org/ofbiz/accounting/payment/GiftCertificateServices.java @@ -389,7 +389,7 @@ public class GiftCertificateServices { String finAccountAuthId = authTransaction.getString("referenceNum"); try { GenericValue finAccountAuth = delegator.findOne("FinAccountAuth", UtilMisc.toMap("finAccountAuthId", finAccountAuthId), false); - GenericValue giftCard = finAccountAuth.getRelatedOne("FinAccount"); + GenericValue giftCard = finAccountAuth.getRelatedOne("FinAccount", false); // make sure authorization has not expired Timestamp authExpiration = finAccountAuth.getTimestamp("thruDate"); if ((authExpiration != null) && (authExpiration.before(UtilDateTime.nowTimestamp()))) { @@ -634,7 +634,7 @@ public class GiftCertificateServices { // get the GiftCard VO GenericValue giftCard = null; try { - giftCard = paymentPref.getRelatedOne("GiftCard"); + giftCard = paymentPref.getRelatedOne("GiftCard", false); } catch (GenericEntityException e) { Debug.logError(e, "Unable to get GiftCard from OrderPaymentPreference", module); return ServiceUtil.returnError(UtilProperties.getMessage(resourceError, @@ -700,7 +700,7 @@ public class GiftCertificateServices { // the order header for store info GenericValue orderHeader = null; try { - orderHeader = orderItem.getRelatedOne("OrderHeader"); + orderHeader = orderItem.getRelatedOne("OrderHeader", false); } catch (GenericEntityException e) { Debug.logError(e, "Unable to get OrderHeader from OrderItem",module); return ServiceUtil.returnError(UtilProperties.getMessage(resourceOrderError, @@ -743,7 +743,7 @@ public class GiftCertificateServices { // the product entity needed for information GenericValue product = null; try { - product = orderItem.getRelatedOne("Product"); + product = orderItem.getRelatedOne("Product", false); } catch (GenericEntityException e) { Debug.logError(e, "Unable to get Product from OrderItem", module); } @@ -802,7 +802,7 @@ public class GiftCertificateServices { for(GenericValue answer : responseAnswers) { GenericValue question = null; try { - question = answer.getRelatedOne("SurveyQuestion"); + question = answer.getRelatedOne("SurveyQuestion", false); } catch (GenericEntityException e) { Debug.logError(e, module); return ServiceUtil.returnError(UtilProperties.getMessage(resourceError, @@ -955,7 +955,7 @@ public class GiftCertificateServices { // the order header for store info GenericValue orderHeader = null; try { - orderHeader = orderItem.getRelatedOne("OrderHeader"); + orderHeader = orderItem.getRelatedOne("OrderHeader", false); } catch (GenericEntityException e) { Debug.logError(e, "Unable to get OrderHeader from OrderItem",module); return ServiceUtil.returnError(UtilProperties.getMessage(resourceOrderError, @@ -1038,7 +1038,7 @@ public class GiftCertificateServices { for(GenericValue answer : responseAnswers) { GenericValue question = null; try { - question = answer.getRelatedOne("SurveyQuestion"); + question = answer.getRelatedOne("SurveyQuestion", false); } catch (GenericEntityException e) { Debug.logError(e, module); return ServiceUtil.returnError(UtilProperties.getMessage(resourceOrderError, diff --git a/applications/accounting/src/org/ofbiz/accounting/payment/PaymentGatewayServices.java b/applications/accounting/src/org/ofbiz/accounting/payment/PaymentGatewayServices.java index 9c911fe137..63012b2e41 100644 --- a/applications/accounting/src/org/ofbiz/accounting/payment/PaymentGatewayServices.java +++ b/applications/accounting/src/org/ofbiz/accounting/payment/PaymentGatewayServices.java @@ -130,7 +130,7 @@ public class PaymentGatewayServices { try { orderPaymentPreference = delegator.findOne("OrderPaymentPreference", UtilMisc.toMap("orderPaymentPreferenceId", orderPaymentPreferenceId), false); - orderHeader = orderPaymentPreference.getRelatedOne("OrderHeader"); + orderHeader = orderPaymentPreference.getRelatedOne("OrderHeader", false); } catch (GenericEntityException e) { Debug.logError(e, module); return ServiceUtil.returnError(UtilProperties.getMessage(resource, @@ -217,7 +217,7 @@ public class PaymentGatewayServices { if (!needsNsfRetry) { // is this an auto-order? if (UtilValidate.isNotEmpty(orderHeader.getString("autoOrderShoppingListId"))) { - GenericValue productStore = orderHeader.getRelatedOne("ProductStore"); + GenericValue productStore = orderHeader.getRelatedOne("ProductStore", false); // according to the store should we try other cards? if ("Y".equals(productStore.getString("autoOrderCcTryOtherCards"))) { // get other credit cards for the bill to party @@ -495,7 +495,7 @@ public class PaymentGatewayServices { processContext.put("customerIpAddress", visit.getString("clientIpAddress")); } - GenericValue productStore = orderHeader.getRelatedOne("ProductStore"); + GenericValue productStore = orderHeader.getRelatedOne("ProductStore", false); processContext.put("userLogin", userLogin); processContext.put("orderId", orh.getOrderId()); @@ -634,7 +634,7 @@ public class PaymentGatewayServices { String payToPartyId = "Company"; // default value GenericValue productStore = null; try { - productStore = orderHeader.getRelatedOne("ProductStore"); + productStore = orderHeader.getRelatedOne("ProductStore", false); } catch (GenericEntityException e) { Debug.logError(e, "Unable to get ProductStore from OrderHeader", module); return null; @@ -650,31 +650,31 @@ public class PaymentGatewayServices { private static String getBillingInformation(OrderReadHelper orh, GenericValue paymentPreference, Map toContext) throws GenericEntityException { // gather the payment related objects. String paymentMethodTypeId = paymentPreference.getString("paymentMethodTypeId"); - GenericValue paymentMethod = paymentPreference.getRelatedOne("PaymentMethod"); + GenericValue paymentMethod = paymentPreference.getRelatedOne("PaymentMethod", false); if (paymentMethod != null && "CREDIT_CARD".equals(paymentMethodTypeId)) { // type credit card - GenericValue creditCard = paymentMethod.getRelatedOne("CreditCard"); - GenericValue billingAddress = creditCard.getRelatedOne("PostalAddress"); + GenericValue creditCard = paymentMethod.getRelatedOne("CreditCard", false); + GenericValue billingAddress = creditCard.getRelatedOne("PostalAddress", false); toContext.put("creditCard", creditCard); toContext.put("billingAddress", billingAddress); } else if (paymentMethod != null && "EFT_ACCOUNT".equals(paymentMethodTypeId)) { // type eft - GenericValue eftAccount = paymentMethod.getRelatedOne("EftAccount"); - GenericValue billingAddress = eftAccount.getRelatedOne("PostalAddress"); + GenericValue eftAccount = paymentMethod.getRelatedOne("EftAccount", false); + GenericValue billingAddress = eftAccount.getRelatedOne("PostalAddress", false); toContext.put("eftAccount", eftAccount); toContext.put("billingAddress", billingAddress); } else if (paymentMethod != null && "GIFT_CARD".equals(paymentMethodTypeId)) { // type gift card - GenericValue giftCard = paymentMethod.getRelatedOne("GiftCard"); + GenericValue giftCard = paymentMethod.getRelatedOne("GiftCard", false); toContext.put("giftCard", giftCard); - GenericValue orderHeader = paymentPreference.getRelatedOne("OrderHeader"); + GenericValue orderHeader = paymentPreference.getRelatedOne("OrderHeader", false); List orderItems = orderHeader.getRelated("OrderItem"); toContext.put("orderId", orderHeader.getString("orderId")); toContext.put("orderItems", orderItems); } else if ("FIN_ACCOUNT".equals(paymentMethodTypeId)) { toContext.put("finAccountId", paymentPreference.getString("finAccountId")); } else if ("EXT_PAYPAL".equals(paymentMethodTypeId)) { - GenericValue payPalPaymentMethod = paymentMethod.getRelatedOne("PayPalPaymentMethod"); + GenericValue payPalPaymentMethod = paymentMethod.getRelatedOne("PayPalPaymentMethod", false); toContext.put("payPalPaymentMethod", payPalPaymentMethod); } else { // add other payment types here; i.e. gift cards, etc. @@ -687,7 +687,7 @@ public class PaymentGatewayServices { GenericValue billToPersonOrGroup = orh.getBillToParty(); GenericValue billToEmail = null; - Collection emails = ContactHelper.getContactMech(billToPersonOrGroup.getRelatedOne("Party"), "PRIMARY_EMAIL", "EMAIL_ADDRESS", false); + Collection emails = ContactHelper.getContactMech(billToPersonOrGroup.getRelatedOne("Party", false), "PRIMARY_EMAIL", "EMAIL_ADDRESS", false); if (UtilValidate.isNotEmpty(emails)) { billToEmail = emails.iterator().next(); @@ -1547,7 +1547,7 @@ public class PaymentGatewayServices { GenericValue orderPaymentPreference = EntityUtil.getFirst(orderPaymentPreferences); // Check the productStore setting to see if we need to do this explicitly - GenericValue productStore = order.getRelatedOne("ProductStore"); + GenericValue productStore = order.getRelatedOne("ProductStore", false); if (productStore.getString("manualAuthIsCapture") == null || (! productStore.getString("manualAuthIsCapture").equalsIgnoreCase("Y"))) { String responseId = delegator.getNextSeqId("PaymentGatewayResponse"); GenericValue pgResponse = delegator.makeValue("PaymentGatewayResponse"); @@ -1606,7 +1606,7 @@ public class PaymentGatewayServices { break; } GenericValue paymentApplication = paymentApplicationsIt.next(); - GenericValue payment = paymentApplication.getRelatedOne("Payment"); + GenericValue payment = paymentApplication.getRelatedOne("Payment", false); if (payment.getString("paymentPreferenceId") != null) { // if the payment is reserved for a specific OrderPaymentPreference, // we don't use it. @@ -1912,7 +1912,7 @@ public class PaymentGatewayServices { GenericValue paymentMethod = delegator.findOne("PaymentMethod", UtilMisc.toMap("paymentMethodId", paymentMethodId), false); GenericValue creditCard = null; if (paymentMethod != null && "CREDIT_CARD".equals(paymentMethod.getString("paymentMethodTypeId"))) { - creditCard = paymentMethod.getRelatedOne("CreditCard"); + creditCard = paymentMethod.getRelatedOne("CreditCard", false); } // create the PaymentGatewayResponse @@ -2037,9 +2037,9 @@ public class PaymentGatewayServices { boolean needsNsfRetry = false; if (Boolean.TRUE.equals(processContext.get("resultNsf"))) { // only track this for auto-orders, since we will only not fail and re-try on those - GenericValue orderHeader = orderPaymentPreference.getRelatedOne("OrderHeader"); + GenericValue orderHeader = orderPaymentPreference.getRelatedOne("OrderHeader", false); if (UtilValidate.isNotEmpty(orderHeader.getString("autoOrderShoppingListId"))) { - GenericValue productStore = orderHeader.getRelatedOne("ProductStore"); + GenericValue productStore = orderHeader.getRelatedOne("ProductStore", false); if ("Y".equals(productStore.getString("autoOrderCcTryLaterNsf"))) { // one last condition: make sure there have been less than ProductStore.autoOrderCcTryLaterMax // PaymentGatewayResponse records with the same orderPaymentPreferenceId and paymentMethodId (just in case it has changed) @@ -2132,7 +2132,7 @@ public class PaymentGatewayServices { // lookup the order header OrderReadHelper orh = null; try { - GenericValue orderHeader = paymentPreference.getRelatedOne("OrderHeader"); + GenericValue orderHeader = paymentPreference.getRelatedOne("OrderHeader", false); if (orderHeader != null) orh = new OrderReadHelper(orderHeader); } catch (GenericEntityException e) { @@ -2417,7 +2417,7 @@ public class PaymentGatewayServices { GenericValue orderHeader = null; try { - orderHeader = paymentPref.getRelatedOne("OrderHeader"); + orderHeader = paymentPref.getRelatedOne("OrderHeader", false); } catch (GenericEntityException e) { Debug.logError(e, "Cannot get OrderHeader from OrderPaymentPreference", module); return ServiceUtil.returnError(UtilProperties.getMessage(resource, @@ -2853,7 +2853,7 @@ public class PaymentGatewayServices { GenericValue paymentMethod = null; try { - paymentMethod = orderPaymentPreference.getRelatedOne("PaymentMethod"); + paymentMethod = orderPaymentPreference.getRelatedOne("PaymentMethod", false); } catch (GenericEntityException e) { Debug.logError(e, module); } @@ -2861,7 +2861,7 @@ public class PaymentGatewayServices { if (paymentMethod != null && paymentMethod.getString("paymentMethodTypeId").equals("CREDIT_CARD")) { GenericValue creditCard = null; try { - creditCard = paymentMethod.getRelatedOne("CreditCard"); + creditCard = paymentMethod.getRelatedOne("CreditCard", false); } catch (GenericEntityException e) { Debug.logError(e, module); } @@ -3022,7 +3022,7 @@ public class PaymentGatewayServices { // get the billToParty object GenericValue billToParty; try { - billToParty = paymentMethod.getRelatedOne("Party"); + billToParty = paymentMethod.getRelatedOne("Party", false); } catch (GenericEntityException e) { Debug.logError(e, module); return ServiceUtil.returnError(e.getMessage()); diff --git a/applications/accounting/src/org/ofbiz/accounting/payment/PaymentWorker.java b/applications/accounting/src/org/ofbiz/accounting/payment/PaymentWorker.java index 34afdefb5a..93aea84b22 100644 --- a/applications/accounting/src/org/ofbiz/accounting/payment/PaymentWorker.java +++ b/applications/accounting/src/org/ofbiz/accounting/payment/PaymentWorker.java @@ -69,13 +69,13 @@ public class PaymentWorker { paymentMethodValueMaps.add(valueMap); valueMap.put("paymentMethod", paymentMethod); if ("CREDIT_CARD".equals(paymentMethod.getString("paymentMethodTypeId"))) { - GenericValue creditCard = paymentMethod.getRelatedOne("CreditCard"); + GenericValue creditCard = paymentMethod.getRelatedOne("CreditCard", false); if (creditCard != null) valueMap.put("creditCard", creditCard); } else if ("GIFT_CARD".equals(paymentMethod.getString("paymentMethodTypeId"))) { - GenericValue giftCard = paymentMethod.getRelatedOne("GiftCard"); + GenericValue giftCard = paymentMethod.getRelatedOne("GiftCard", false); if (giftCard != null) valueMap.put("giftCard", giftCard); } else if ("EFT_ACCOUNT".equals(paymentMethod.getString("paymentMethodTypeId"))) { - GenericValue eftAccount = paymentMethod.getRelatedOne("EftAccount"); + GenericValue eftAccount = paymentMethod.getRelatedOne("EftAccount", false); if (eftAccount != null) valueMap.put("eftAccount", eftAccount); } } @@ -239,9 +239,9 @@ public class PaymentWorker { paymentApplication = delegator.findOne("PaymentApplication", UtilMisc.toMap("paymentApplicationId", paymentApplicationId), false); appliedAmount = paymentApplication.getBigDecimal("amountApplied"); if (paymentApplication.get("paymentId") != null) { - GenericValue payment = paymentApplication.getRelatedOne("Payment"); + GenericValue payment = paymentApplication.getRelatedOne("Payment", false); if (paymentApplication.get("invoiceId") != null && payment.get("actualCurrencyAmount") != null && payment.get("actualCurrencyUomId") != null) { - GenericValue invoice = paymentApplication.getRelatedOne("Invoice"); + GenericValue invoice = paymentApplication.getRelatedOne("Invoice", false); if (payment.getString("actualCurrencyUomId").equals(invoice.getString("currencyUomId"))) { appliedAmount = appliedAmount.multiply(payment.getBigDecimal("amount")).divide(payment.getBigDecimal("actualCurrencyAmount"),new MathContext(100)); } @@ -283,7 +283,7 @@ public class PaymentWorker { BigDecimal amountApplied = paymentApplication.getBigDecimal("amountApplied"); // check currency invoice and if different convert amount applied for display if (actual.equals(Boolean.FALSE) && paymentApplication.get("invoiceId") != null && payment.get("actualCurrencyAmount") != null && payment.get("actualCurrencyUomId") != null) { - GenericValue invoice = paymentApplication.getRelatedOne("Invoice"); + GenericValue invoice = paymentApplication.getRelatedOne("Invoice", false); if (payment.getString("actualCurrencyUomId").equals(invoice.getString("currencyUomId"))) { amountApplied = amountApplied.multiply(payment.getBigDecimal("amount")).divide(payment.getBigDecimal("actualCurrencyAmount"),new MathContext(100)); } diff --git a/applications/accounting/src/org/ofbiz/accounting/thirdparty/authorizedotnet/AIMPaymentServices.java b/applications/accounting/src/org/ofbiz/accounting/thirdparty/authorizedotnet/AIMPaymentServices.java index d1a60a1e83..40b5240188 100644 --- a/applications/accounting/src/org/ofbiz/accounting/thirdparty/authorizedotnet/AIMPaymentServices.java +++ b/applications/accounting/src/org/ofbiz/accounting/thirdparty/authorizedotnet/AIMPaymentServices.java @@ -107,7 +107,7 @@ public class AIMPaymentServices { GenericValue orderPaymentPreference = (GenericValue) context.get("orderPaymentPreference"); GenericValue creditCard = null; try { - creditCard = delegator.getRelatedOne("CreditCard",orderPaymentPreference); + creditCard = delegator.getRelatedOne("CreditCard",orderPaymentPreference, false); } catch (GenericEntityException e) { Debug.logError(e, module); return ServiceUtil.returnError(UtilProperties.getMessage(resource, @@ -155,7 +155,7 @@ public class AIMPaymentServices { GenericValue orderPaymentPreference = (GenericValue) context.get("orderPaymentPreference"); GenericValue creditCard = null; try { - creditCard = delegator.getRelatedOne("CreditCard", orderPaymentPreference); + creditCard = delegator.getRelatedOne("CreditCard", orderPaymentPreference, false); } catch (GenericEntityException e) { Debug.logError(e, module); return ServiceUtil.returnError(UtilProperties.getMessage(resource, @@ -499,13 +499,13 @@ public class AIMPaymentServices { // sometimes the ccAuthCapture interface is used, in which case the creditCard is passed directly GenericValue creditCard = (GenericValue) params.get("creditCard"); if (creditCard == null || ! (opp.get("paymentMethodId").equals(creditCard.get("paymentMethodId")))) { - creditCard = opp.getRelatedOne("CreditCard"); + creditCard = opp.getRelatedOne("CreditCard", false); } AIMRequest.put("x_First_Name", UtilFormatOut.checkNull(creditCard.getString("firstNameOnCard"))); AIMRequest.put("x_Last_Name", UtilFormatOut.checkNull(creditCard.getString("lastNameOnCard"))); AIMRequest.put("x_Company", UtilFormatOut.checkNull(creditCard.getString("companyNameOnCard"))); if (UtilValidate.isNotEmpty(creditCard.getString("contactMechId"))) { - GenericValue address = creditCard.getRelatedOne("PostalAddress"); + GenericValue address = creditCard.getRelatedOne("PostalAddress", false); if (address != null) { AIMRequest.put("x_Address", UtilFormatOut.checkNull(address.getString("address1"))); AIMRequest.put("x_City", UtilFormatOut.checkNull(address.getString("city"))); diff --git a/applications/accounting/src/org/ofbiz/accounting/thirdparty/clearcommerce/CCPaymentServices.java b/applications/accounting/src/org/ofbiz/accounting/thirdparty/clearcommerce/CCPaymentServices.java index aaa7ea8e01..2c332b5bbf 100644 --- a/applications/accounting/src/org/ofbiz/accounting/thirdparty/clearcommerce/CCPaymentServices.java +++ b/applications/accounting/src/org/ofbiz/accounting/thirdparty/clearcommerce/CCPaymentServices.java @@ -789,7 +789,7 @@ public class CCPaymentServices { String countryGeoId = address.getString("countryGeoId"); if (UtilValidate.isNotEmpty(countryGeoId)) { try { - GenericValue countryGeo = address.getRelatedOneCache("CountryGeo"); + GenericValue countryGeo = address.getRelatedOne("CountryGeo", true); UtilXml.addChildElementValue(addressElement, "Country", countryGeo.getString("geoSecCode"), document); } catch (GenericEntityException gee) { Debug.logInfo(gee, "Error finding related Geo for countryGeoId: " + countryGeoId, module); diff --git a/applications/accounting/src/org/ofbiz/accounting/thirdparty/cybersource/IcsPaymentServices.java b/applications/accounting/src/org/ofbiz/accounting/thirdparty/cybersource/IcsPaymentServices.java index 09093355d6..bf1f01b00b 100644 --- a/applications/accounting/src/org/ofbiz/accounting/thirdparty/cybersource/IcsPaymentServices.java +++ b/applications/accounting/src/org/ofbiz/accounting/thirdparty/cybersource/IcsPaymentServices.java @@ -504,7 +504,7 @@ public class IcsPaymentServices { GenericValue item = (GenericValue) orderItem; GenericValue product = null; try { - product = item.getRelatedOne("Product"); + product = item.getRelatedOne("Product", false); } catch (GenericEntityException e) { Debug.logError(e, "ERROR: Unable to get Product from OrderItem, not passing info to CyberSource"); } diff --git a/applications/accounting/src/org/ofbiz/accounting/thirdparty/eway/EwayServices.java b/applications/accounting/src/org/ofbiz/accounting/thirdparty/eway/EwayServices.java index 2330bc90dd..fd257f5beb 100644 --- a/applications/accounting/src/org/ofbiz/accounting/thirdparty/eway/EwayServices.java +++ b/applications/accounting/src/org/ofbiz/accounting/thirdparty/eway/EwayServices.java @@ -126,7 +126,7 @@ public class EwayServices { // credit card used for transaction GenericValue cc = null; try { - cc = delegator.getRelatedOne("CreditCard", paymentPref); + cc = delegator.getRelatedOne("CreditCard", paymentPref, false); } catch (GenericEntityException e) { Debug.logError(e, module); return ServiceUtil.returnError(UtilProperties.getMessage(resource, @@ -191,7 +191,7 @@ public class EwayServices { // credit card used for transaction GenericValue cc = null; try { - cc = delegator.getRelatedOne("CreditCard", paymentPref); + cc = delegator.getRelatedOne("CreditCard", paymentPref, false); } catch (GenericEntityException e) { Debug.logError(e, module); return ServiceUtil.returnError(UtilProperties.getMessage(resource, diff --git a/applications/accounting/src/org/ofbiz/accounting/thirdparty/gosoftware/RitaServices.java b/applications/accounting/src/org/ofbiz/accounting/thirdparty/gosoftware/RitaServices.java index d55cf39202..88c0b1a714 100644 --- a/applications/accounting/src/org/ofbiz/accounting/thirdparty/gosoftware/RitaServices.java +++ b/applications/accounting/src/org/ofbiz/accounting/thirdparty/gosoftware/RitaServices.java @@ -350,7 +350,7 @@ public class RitaServices { Locale locale = (Locale) context.get("locale"); GenericValue orderHeader = null; try { - orderHeader = orderPaymentPreference.getRelatedOne("OrderHeader"); + orderHeader = orderPaymentPreference.getRelatedOne("OrderHeader", false); } catch (GenericEntityException e) { Debug.logError(e, module); return ServiceUtil.returnError(UtilProperties.getMessage(resourceOrder, diff --git a/applications/accounting/src/org/ofbiz/accounting/thirdparty/orbital/OrbitalPaymentServices.java b/applications/accounting/src/org/ofbiz/accounting/thirdparty/orbital/OrbitalPaymentServices.java index 0b1b0143ad..a4f92e3743 100644 --- a/applications/accounting/src/org/ofbiz/accounting/thirdparty/orbital/OrbitalPaymentServices.java +++ b/applications/accounting/src/org/ofbiz/accounting/thirdparty/orbital/OrbitalPaymentServices.java @@ -127,7 +127,7 @@ public class OrbitalPaymentServices { GenericValue orderPaymentPreference = (GenericValue) context.get("orderPaymentPreference"); GenericValue creditCard = null; try { - creditCard = orderPaymentPreference.getRelatedOne("CreditCard"); + creditCard = orderPaymentPreference.getRelatedOne("CreditCard", false); } catch (GenericEntityException e) { Debug.logError(e, module); return ServiceUtil.returnError(UtilProperties.getMessage(resource, @@ -173,7 +173,7 @@ public class OrbitalPaymentServices { GenericValue orderPaymentPreference = (GenericValue) context.get("orderPaymentPreference"); GenericValue creditCard = null; try { - creditCard = orderPaymentPreference.getRelatedOne("CreditCard"); + creditCard = orderPaymentPreference.getRelatedOne("CreditCard", false); } catch (GenericEntityException e) { Debug.logError(e, module); return ServiceUtil.returnError(UtilProperties.getMessage(resource, @@ -218,7 +218,7 @@ public class OrbitalPaymentServices { GenericValue orderPaymentPreference = (GenericValue) context.get("orderPaymentPreference"); try { - orderPaymentPreference.getRelatedOne("CreditCard"); + orderPaymentPreference.getRelatedOne("CreditCard", false); } catch (GenericEntityException e) { Debug.logError(e, module); return ServiceUtil.returnError(UtilProperties.getMessage(resource, @@ -339,13 +339,13 @@ public class OrbitalPaymentServices { // sometimes the ccAuthCapture interface is used, in which case the creditCard is passed directly creditCard = (GenericValue) params.get("creditCard"); if (creditCard == null || ! (opp.get("paymentMethodId").equals(creditCard.get("paymentMethodId")))) { - creditCard = opp.getRelatedOne("CreditCard"); + creditCard = opp.getRelatedOne("CreditCard", false); } } request.setFieldValue("AVSname", "Demo Customer"); if (UtilValidate.isNotEmpty(creditCard.getString("contactMechId"))) { - GenericValue address = creditCard.getRelatedOne("PostalAddress"); + GenericValue address = creditCard.getRelatedOne("PostalAddress", false); if (address != null) { request.setFieldValue("AVSaddress1", UtilFormatOut.checkNull(address.getString("address1"))); request.setFieldValue("AVScity", UtilFormatOut.checkNull(address.getString("city"))); @@ -403,7 +403,7 @@ public class OrbitalPaymentServices { request.setFieldValue("PCDestName", UtilFormatOut.checkNull(creditCard.getString("firstNameOnCard") + creditCard.getString("lastNameOnCard"))); if (UtilValidate.isNotEmpty(creditCard.getString("contactMechId"))) { - GenericValue address = creditCard.getRelatedOne("PostalAddress"); + GenericValue address = creditCard.getRelatedOne("PostalAddress", false); if (address != null) { request.setFieldValue("PCOrderNum", UtilFormatOut.checkNull(orderId)); request.setFieldValue("PCDestAddress1", UtilFormatOut.checkNull(address.getString("address1"))); @@ -634,7 +634,7 @@ public class OrbitalPaymentServices { GenericValue trackingCodeOrder = EntityUtil.getFirst(orderHeader.getRelated("TrackingCodeOrder")); GenericValue trackingCode = null; if (UtilValidate.isNotEmpty(trackingCodeOrder)) { - trackingCode = trackingCodeOrder.getRelatedOne("TrackingCode"); + trackingCode = trackingCodeOrder.getRelatedOne("TrackingCode", false); } if (UtilValidate.isNotEmpty(trackingCode) && UtilValidate.isNotEmpty(trackingCode.getString("description"))) { // get tracking code description and provide it into shipping reference. diff --git a/applications/accounting/src/org/ofbiz/accounting/thirdparty/paypal/PayPalServices.java b/applications/accounting/src/org/ofbiz/accounting/thirdparty/paypal/PayPalServices.java index 8da912b869..4172df34c2 100644 --- a/applications/accounting/src/org/ofbiz/accounting/thirdparty/paypal/PayPalServices.java +++ b/applications/accounting/src/org/ofbiz/accounting/thirdparty/paypal/PayPalServices.java @@ -678,8 +678,8 @@ public class PayPalServices { GenericValue payPalPaymentSetting = getPaymentMethodGatewayPayPal(dctx, context, null); GenericValue payPalPaymentMethod = null; try { - payPalPaymentMethod = paymentPref.getRelatedOne("PaymentMethod"); - payPalPaymentMethod = payPalPaymentMethod.getRelatedOne("PayPalPaymentMethod"); + payPalPaymentMethod = paymentPref.getRelatedOne("PaymentMethod", false); + payPalPaymentMethod = payPalPaymentMethod.getRelatedOne("PayPalPaymentMethod", false); } catch (GenericEntityException e) { Debug.logError(e, module); return ServiceUtil.returnError(e.getMessage()); diff --git a/applications/accounting/src/org/ofbiz/accounting/thirdparty/sagepay/SagePayPaymentServices.java b/applications/accounting/src/org/ofbiz/accounting/thirdparty/sagepay/SagePayPaymentServices.java index 8f3f08cb0f..963df58faa 100644 --- a/applications/accounting/src/org/ofbiz/accounting/thirdparty/sagepay/SagePayPaymentServices.java +++ b/applications/accounting/src/org/ofbiz/accounting/thirdparty/sagepay/SagePayPaymentServices.java @@ -74,7 +74,7 @@ public class SagePayPaymentServices { GenericValue creditCard = (GenericValue) context.get("creditCard"); if (creditCard == null || !(opp.get("paymentMethodId").equals(creditCard.get("paymentMethodId")))) { - creditCard = opp.getRelatedOne("CreditCard"); + creditCard = opp.getRelatedOne("CreditCard", false); } securityCode = opp.getString("securityCode"); @@ -303,7 +303,7 @@ public class SagePayPaymentServices { Debug.logInfo("SagePay ccRefund captureTransaction : " + captureTransaction, module); GenericValue creditCard = null; try { - creditCard = delegator.getRelatedOne("CreditCard", orderPaymentPreference); + creditCard = delegator.getRelatedOne("CreditCard", orderPaymentPreference, false); } catch (GenericEntityException e) { Debug.logError(e, "Error getting CreditCard for OrderPaymentPreference : " + orderPaymentPreference, module); return ServiceUtil.returnError(UtilProperties.getMessage(resource, "AccountingPaymentUnableToGetCCInfo", locale) + " " + orderPaymentPreference); diff --git a/applications/accounting/src/org/ofbiz/accounting/thirdparty/valuelink/ValueLinkServices.java b/applications/accounting/src/org/ofbiz/accounting/thirdparty/valuelink/ValueLinkServices.java index 1551acfe94..70becbb54d 100644 --- a/applications/accounting/src/org/ofbiz/accounting/thirdparty/valuelink/ValueLinkServices.java +++ b/applications/accounting/src/org/ofbiz/accounting/thirdparty/valuelink/ValueLinkServices.java @@ -909,7 +909,7 @@ public class ValueLinkServices { // get the GiftCard VO GenericValue giftCard = null; try { - giftCard = paymentPref.getRelatedOne("GiftCard"); + giftCard = paymentPref.getRelatedOne("GiftCard", false); } catch (GenericEntityException e) { Debug.logError("Unable to get GiftCard from OrderPaymentPreference", module); return ServiceUtil.returnError(UtilProperties.getMessage(resourceError, @@ -974,7 +974,7 @@ public class ValueLinkServices { // get the GiftCard VO GenericValue giftCard = null; try { - giftCard = paymentPref.getRelatedOne("GiftCard"); + giftCard = paymentPref.getRelatedOne("GiftCard", false); } catch (GenericEntityException e) { Debug.logError("Unable to get GiftCard from OrderPaymentPreference", module); return ServiceUtil.returnError(UtilProperties.getMessage(resourceError, @@ -1039,7 +1039,7 @@ public class ValueLinkServices { // the order header for store info GenericValue orderHeader = null; try { - orderHeader = orderItem.getRelatedOne("OrderHeader"); + orderHeader = orderItem.getRelatedOne("OrderHeader", false); } catch (GenericEntityException e) { Debug.logError(e, "Unable to get OrderHeader from OrderItem",module); return ServiceUtil.returnError(UtilProperties.getMessage(resourceOrder, @@ -1093,7 +1093,7 @@ public class ValueLinkServices { // the product entity needed for information GenericValue product = null; try { - product = orderItem.getRelatedOne("Product"); + product = orderItem.getRelatedOne("Product", false); } catch (GenericEntityException e) { Debug.logError("Unable to get Product from OrderItem", module); } @@ -1162,7 +1162,7 @@ public class ValueLinkServices { for(GenericValue answer : responseAnswers) { GenericValue question = null; try { - question = answer.getRelatedOne("SurveyQuestion"); + question = answer.getRelatedOne("SurveyQuestion", false); } catch (GenericEntityException e) { Debug.logError(e, module); return ServiceUtil.returnError(UtilProperties.getMessage(resourceError, @@ -1333,7 +1333,7 @@ public class ValueLinkServices { // the order header for store info GenericValue orderHeader = null; try { - orderHeader = orderItem.getRelatedOne("OrderHeader"); + orderHeader = orderItem.getRelatedOne("OrderHeader", false); } catch (GenericEntityException e) { Debug.logError(e, "Unable to get OrderHeader from OrderItem",module); return ServiceUtil.returnError(UtilProperties.getMessage(resourceOrder, @@ -1417,7 +1417,7 @@ public class ValueLinkServices { for(GenericValue answer : responseAnswers) { GenericValue question = null; try { - question = answer.getRelatedOne("SurveyQuestion"); + question = answer.getRelatedOne("SurveyQuestion", false); } catch (GenericEntityException e) { Debug.logError(e, module); return ServiceUtil.returnError(UtilProperties.getMessage(resourceError, diff --git a/applications/accounting/src/org/ofbiz/accounting/thirdparty/verisign/PayflowPro.java b/applications/accounting/src/org/ofbiz/accounting/thirdparty/verisign/PayflowPro.java index 2f36d0ce79..5953263c97 100644 --- a/applications/accounting/src/org/ofbiz/accounting/thirdparty/verisign/PayflowPro.java +++ b/applications/accounting/src/org/ofbiz/accounting/thirdparty/verisign/PayflowPro.java @@ -524,11 +524,11 @@ public class PayflowPro { parameterMap.put("SHIPTOSTREET2", StringUtils.left(shippingAddress.getString("address2"), 30)); parameterMap.put("SHIPTOCITY", StringUtils.left(shippingAddress.getString("city"), 40)); if (shippingAddress.getString("stateProvinceGeoId") != null && !"_NA_".equals(shippingAddress.getString("stateProvinceGeoId"))) { - GenericValue stateProvinceGeo = shippingAddress.getRelatedOne("StateProvinceGeo"); + GenericValue stateProvinceGeo = shippingAddress.getRelatedOne("StateProvinceGeo", false); parameterMap.put("SHIPTOSTATE", StringUtils.left(stateProvinceGeo.getString("geoCode"), 40)); } parameterMap.put("SHIPTOZIP", StringUtils.left(shippingAddress.getString("postalCode"), 16)); - GenericValue countryGeo = shippingAddress.getRelatedOne("CountryGeo"); + GenericValue countryGeo = shippingAddress.getRelatedOne("CountryGeo", false); parameterMap.put("SHIPTOCOUNTRY", StringUtils.left(countryGeo.getString("geoCode"), 2)); } } @@ -613,8 +613,8 @@ public class PayflowPro { String configString = "payment.properties"; GenericValue payPalPaymentMethod = null; try { - payPalPaymentMethod = paymentPref.getRelatedOne("PaymentMethod"); - payPalPaymentMethod = payPalPaymentMethod.getRelatedOne("PayPalPaymentMethod"); + payPalPaymentMethod = paymentPref.getRelatedOne("PaymentMethod", false); + payPalPaymentMethod = payPalPaymentMethod.getRelatedOne("PayPalPaymentMethod", false); } catch (GenericEntityException e) { Debug.logError(e, module); return ServiceUtil.returnError(e.getMessage()); diff --git a/applications/accounting/src/org/ofbiz/accounting/thirdparty/worldpay/WorldPayEvents.java b/applications/accounting/src/org/ofbiz/accounting/thirdparty/worldpay/WorldPayEvents.java index d57b6f010f..f4882f35f4 100644 --- a/applications/accounting/src/org/ofbiz/accounting/thirdparty/worldpay/WorldPayEvents.java +++ b/applications/accounting/src/org/ofbiz/accounting/thirdparty/worldpay/WorldPayEvents.java @@ -126,7 +126,7 @@ public class WorldPayEvents { String country = ""; if (contactAddress != null) { try { - countryGeo = contactAddress.getRelatedOne("CountryGeo"); + countryGeo = contactAddress.getRelatedOne("CountryGeo", false); if (countryGeo != null) { country = countryGeo.getString("geoCode"); } diff --git a/applications/accounting/src/org/ofbiz/accounting/util/UtilAccounting.java b/applications/accounting/src/org/ofbiz/accounting/util/UtilAccounting.java index c7246d7150..4df23c674e 100644 --- a/applications/accounting/src/org/ofbiz/accounting/util/UtilAccounting.java +++ b/applications/accounting/src/org/ofbiz/accounting/util/UtilAccounting.java @@ -107,7 +107,7 @@ public class UtilAccounting { } } public static BigDecimal getNetBalance(GenericValue account) throws GenericEntityException { - GenericValue glAccount = account.getRelatedOne("GlAccount"); + GenericValue glAccount = account.getRelatedOne("GlAccount", false); BigDecimal balance = BigDecimal.ZERO; if (isDebitAccount(glAccount)) { balance = account.getBigDecimal("postedDebits").subtract(account.getBigDecimal("postedCredits")); @@ -145,7 +145,7 @@ public class UtilAccounting { } // otherwise, we have to go to the grandparent (recurse) - return isPaymentTypeRecurse(paymentType.getRelatedOne("ParentPaymentType"), inputTypeId); + return isPaymentTypeRecurse(paymentType.getRelatedOne("ParentPaymentType", false), inputTypeId); } @@ -158,7 +158,7 @@ public class UtilAccounting { return false; } - GenericValue paymentType = payment.getRelatedOneCache("PaymentType"); + GenericValue paymentType = payment.getRelatedOne("PaymentType", true); if (paymentType == null) { throw new GenericEntityException("Cannot find PaymentType for paymentId " + payment.getString("paymentId")); } @@ -207,7 +207,7 @@ public class UtilAccounting { } // otherwise, we have to go to the grandparent (recurse) - return isAccountClassClass(glAccountClass.getRelatedOneCache("ParentGlAccountClass"), parentGlAccountClassId); + return isAccountClassClass(glAccountClass.getRelatedOne("ParentGlAccountClass", true), parentGlAccountClassId); } /** @@ -219,7 +219,7 @@ public class UtilAccounting { return false; } - GenericValue glAccountClass = glAccount.getRelatedOneCache("GlAccountClass"); + GenericValue glAccountClass = glAccount.getRelatedOne("GlAccountClass", true); if (glAccountClass == null) { throw new GenericEntityException("Cannot find GlAccountClass for glAccountId " + glAccount.getString("glAccountId")); } @@ -276,7 +276,7 @@ public class UtilAccounting { } // otherwise, we have to go to the grandparent (recurse) - return isInvoiceTypeRecurse(invoiceType.getRelatedOne("ParentInvoiceType"), inputTypeId); + return isInvoiceTypeRecurse(invoiceType.getRelatedOne("ParentInvoiceType", false), inputTypeId); } /** @@ -288,7 +288,7 @@ public class UtilAccounting { return false; } - GenericValue invoiceType = invoice.getRelatedOneCache("InvoiceType"); + GenericValue invoiceType = invoice.getRelatedOne("InvoiceType", true); if (invoiceType == null) { throw new GenericEntityException("Cannot find InvoiceType for invoiceId " + invoice.getString("invoiceId")); } diff --git a/applications/accounting/webapp/accounting/WEB-INF/actions/admin/ListInvoiceItemTypesGlAccount.groovy b/applications/accounting/webapp/accounting/WEB-INF/actions/admin/ListInvoiceItemTypesGlAccount.groovy index faf3b6d447..6d25810aee 100644 --- a/applications/accounting/webapp/accounting/WEB-INF/actions/admin/ListInvoiceItemTypesGlAccount.groovy +++ b/applications/accounting/webapp/accounting/WEB-INF/actions/admin/ListInvoiceItemTypesGlAccount.groovy @@ -48,7 +48,7 @@ invoiceItemTypes.each { invoiceItemType -> glAccount = glAccounts[0]; } } else { - glAccount = invoiceItemType.getRelatedOne("DefaultGlAccount"); + glAccount = invoiceItemType.getRelatedOne("DefaultGlAccount", false); } if (glAccount) { diff --git a/applications/accounting/webapp/accounting/WEB-INF/actions/invoice/EditInvoice.groovy b/applications/accounting/webapp/accounting/WEB-INF/actions/invoice/EditInvoice.groovy index d6bca25811..98da660806 100644 --- a/applications/accounting/webapp/accounting/WEB-INF/actions/invoice/EditInvoice.groovy +++ b/applications/accounting/webapp/accounting/WEB-INF/actions/invoice/EditInvoice.groovy @@ -75,7 +75,7 @@ if (invoice) { invoiceItemsConv.add(invoiceItem); // get party tax id for VAT taxes: they are required in invoices by EU // also create a map with tax grand total amount by VAT tax: it is also required in invoices by UE - taxRate = invoiceItem.getRelatedOne("TaxAuthorityRateProduct"); + taxRate = invoiceItem.getRelatedOne("TaxAuthorityRateProduct", false); if (taxRate && "VAT_TAX".equals(taxRate.taxAuthorityRateTypeId)) { taxInfos = EntityUtil.filterByDate(delegator.findByAnd("PartyTaxAuthInfo", [partyId : billingParty.partyId, taxAuthGeoId : taxRate.taxAuthGeoId, taxAuthPartyId : taxRate.taxAuthPartyId], null, false), invoice.invoiceDate); taxInfo = EntityUtil.getFirst(taxInfos); @@ -140,7 +140,7 @@ if (invoice) { } context.orders = orders; - invoiceStatus = invoice.getRelatedOne("StatusItem"); + invoiceStatus = invoice.getRelatedOne("StatusItem", false); context.invoiceStatus = invoiceStatus; edit = parameters.editInvoice; diff --git a/applications/accounting/webapp/accounting/WEB-INF/actions/invoice/PrintInvoices.groovy b/applications/accounting/webapp/accounting/WEB-INF/actions/invoice/PrintInvoices.groovy index 5ae5da52e9..f8654cc75f 100644 --- a/applications/accounting/webapp/accounting/WEB-INF/actions/invoice/PrintInvoices.groovy +++ b/applications/accounting/webapp/accounting/WEB-INF/actions/invoice/PrintInvoices.groovy @@ -108,7 +108,7 @@ invoiceIds.each { invoiceId -> } invoicesMap.orders = orders; - invoiceStatus = invoice.getRelatedOne("StatusItem"); + invoiceStatus = invoice.getRelatedOne("StatusItem", false); invoicesMap.invoiceStatus = invoiceStatus; edit = parameters.editInvoice; diff --git a/applications/accounting/webapp/accounting/WEB-INF/actions/payment/ManualTx.groovy b/applications/accounting/webapp/accounting/WEB-INF/actions/payment/ManualTx.groovy index e9197edf2d..8b5a162f10 100644 --- a/applications/accounting/webapp/accounting/WEB-INF/actions/payment/ManualTx.groovy +++ b/applications/accounting/webapp/accounting/WEB-INF/actions/payment/ManualTx.groovy @@ -57,24 +57,24 @@ if (paymentMethodId) { paymentMethodTypeId = paymentMethod.paymentMethodTypeId; // party information - party = paymentMethod.getRelatedOne("Party"); + party = paymentMethod.getRelatedOne("Party", false); if (party && "PERSON".equals(party.partyTypeId)) { - person = party.getRelatedOne("Person"); + person = party.getRelatedOne("Person", false); context.person = person; } else if (party && "PARTY_GROUP".equals(party.partyTypeId)) { - partyGroup = party.getRelatedOne("PartyGroup"); + partyGroup = party.getRelatedOne("PartyGroup", false); context.partyGroup = partyGroup; } // method info + address - creditCard = paymentMethod.getRelatedOne("CreditCard"); + creditCard = paymentMethod.getRelatedOne("CreditCard", false); context.put("creditCard", creditCard); if (creditCard) { - postalAddress = creditCard.getRelatedOne("PostalAddress"); + postalAddress = creditCard.getRelatedOne("PostalAddress", false); context.postalFields = postalAddress; } - giftCard = paymentMethod.getRelatedOne("GiftCard"); + giftCard = paymentMethod.getRelatedOne("GiftCard", false); context.giftCard = giftCard; // todo add support for eft account diff --git a/applications/accounting/webapp/accounting/WEB-INF/actions/payment/PrintChecks.groovy b/applications/accounting/webapp/accounting/WEB-INF/actions/payment/PrintChecks.groovy index bcc92f5e1b..63f116f908 100644 --- a/applications/accounting/webapp/accounting/WEB-INF/actions/payment/PrintChecks.groovy +++ b/applications/accounting/webapp/accounting/WEB-INF/actions/payment/PrintChecks.groovy @@ -62,6 +62,6 @@ selected.each { row -> paymentGroupMembers = EntityUtil.filterByDate(delegator.findList("PaymentGroupMember", EntityCondition.makeCondition("paymentGroupId", EntityOperator.EQUALS, parameters.paymentGroupId), null, null, null, false)); //in the case of a multiple payments, paymentId List is supplied. paymentGroupMembers.each { paymentGropupMember-> - payments.add(paymentGropupMember.getRelatedOne("Payment")); + payments.add(paymentGropupMember.getRelatedOne("Payment", false)); } context.payments = payments; diff --git a/applications/accounting/webapp/accounting/WEB-INF/actions/period/EditCustomTimePeriod.groovy b/applications/accounting/webapp/accounting/WEB-INF/actions/period/EditCustomTimePeriod.groovy index f97ababd74..6ce8fb8f19 100644 --- a/applications/accounting/webapp/accounting/WEB-INF/actions/period/EditCustomTimePeriod.groovy +++ b/applications/accounting/webapp/accounting/WEB-INF/actions/period/EditCustomTimePeriod.groovy @@ -38,7 +38,7 @@ if (currentCustomTimePeriod) { context.currentCustomTimePeriod = currentCustomTimePeriod; } -currentPeriodType = currentCustomTimePeriod ? currentCustomTimePeriod.getRelatedOneCache("PeriodType") : null; +currentPeriodType = currentCustomTimePeriod ? currentCustomTimePeriod.getRelatedOne("PeriodType", true) : null; if (currentPeriodType) { context.currentPeriodType = currentPeriodType; } diff --git a/applications/accounting/webapp/accounting/WEB-INF/actions/reports/BalanceSheet.groovy b/applications/accounting/webapp/accounting/WEB-INF/actions/reports/BalanceSheet.groovy index cd7e7f7524..dafa616ccb 100644 --- a/applications/accounting/webapp/accounting/WEB-INF/actions/reports/BalanceSheet.groovy +++ b/applications/accounting/webapp/accounting/WEB-INF/actions/reports/BalanceSheet.groovy @@ -414,7 +414,7 @@ Map netIncomeResult = dispatcher.runSync("prepareIncomeStatement", UtilMisc.toMa BigDecimal netIncome = (BigDecimal)netIncomeResult.totalNetIncome; GenericValue retainedEarningsAccount = delegator.findOne("GlAccountTypeDefault", UtilMisc.toMap("glAccountTypeId", "RETAINED_EARNINGS", "organizationPartyId", organizationPartyId), true); if (retainedEarningsAccount) { - GenericValue retainedEarningsGlAccount = retainedEarningsAccount.getRelatedOne("GlAccount"); + GenericValue retainedEarningsGlAccount = retainedEarningsAccount.getRelatedOne("GlAccount", false); transactionTotalsMap.put(retainedEarningsGlAccount.glAccountId, UtilMisc.toMap("glAccountId", retainedEarningsGlAccount.glAccountId,"accountName", retainedEarningsGlAccount.accountName, "accountCode", retainedEarningsGlAccount.accountCode, "balance", netIncome)); } accountBalanceList = UtilMisc.sortMaps(transactionTotalsMap.values().asList(), UtilMisc.toList("accountCode")); diff --git a/applications/accounting/webapp/accounting/WEB-INF/actions/reports/SalesInvoiceByProductCategorySummary.groovy b/applications/accounting/webapp/accounting/WEB-INF/actions/reports/SalesInvoiceByProductCategorySummary.groovy index c73fad229c..089f2a2172 100644 --- a/applications/accounting/webapp/accounting/WEB-INF/actions/reports/SalesInvoiceByProductCategorySummary.groovy +++ b/applications/accounting/webapp/accounting/WEB-INF/actions/reports/SalesInvoiceByProductCategorySummary.groovy @@ -44,13 +44,13 @@ productCategoryList = FastList.newInstance(); productMemberList.each { productMember -> if (!productIdSet.contains(productMember.productId)) { - productList.add(productMember.getRelatedOneCache("Product")); + productList.add(productMember.getRelatedOne("Product", true)); } productIdSet.add(productMember.productId); } categoryRollupList.each { categoryRollup -> if (!productCategoryIdSet.contains(categoryRollup.productCategoryId)) { - productCategoryList.add(categoryRollup.getRelatedOneCache("CurrentProductCategory")); + productCategoryList.add(categoryRollup.getRelatedOne("CurrentProductCategory", true)); } productCategoryIdSet.add(categoryRollup.productCategoryId); } diff --git a/applications/accounting/webapp/accounting/WEB-INF/actions/transaction/AuthorizeTransaction.groovy b/applications/accounting/webapp/accounting/WEB-INF/actions/transaction/AuthorizeTransaction.groovy index d787280de5..6b6a016290 100644 --- a/applications/accounting/webapp/accounting/WEB-INF/actions/transaction/AuthorizeTransaction.groovy +++ b/applications/accounting/webapp/accounting/WEB-INF/actions/transaction/AuthorizeTransaction.groovy @@ -42,7 +42,7 @@ if (orderPaymentPreferenceId) { } if (orderPaymentPreference) { - paymentMethodType = orderPaymentPreference.getRelatedOneCache("PaymentMethodType"); + paymentMethodType = orderPaymentPreference.getRelatedOne("PaymentMethodType", true); context.paymentMethodType = paymentMethodType; context.overrideAmount = orderPaymentPreference.getBigDecimal("maxAmount"); } diff --git a/applications/accounting/webapp/accounting/WEB-INF/actions/transaction/CaptureTransaction.groovy b/applications/accounting/webapp/accounting/WEB-INF/actions/transaction/CaptureTransaction.groovy index 0a99162ff0..897112091a 100644 --- a/applications/accounting/webapp/accounting/WEB-INF/actions/transaction/CaptureTransaction.groovy +++ b/applications/accounting/webapp/accounting/WEB-INF/actions/transaction/CaptureTransaction.groovy @@ -39,7 +39,7 @@ if (orderPaymentPreferenceId) { } if (orderPaymentPreference) { - paymentMethodType = orderPaymentPreference.getRelatedOneCache("PaymentMethodType"); + paymentMethodType = orderPaymentPreference.getRelatedOne("PaymentMethodType", true); context.paymentMethodType = paymentMethodType; } diff --git a/applications/accounting/webapp/accounting/WEB-INF/actions/transaction/ViewGatewayResponse.groovy b/applications/accounting/webapp/accounting/WEB-INF/actions/transaction/ViewGatewayResponse.groovy index bd62ca3230..8b34c027d9 100644 --- a/applications/accounting/webapp/accounting/WEB-INF/actions/transaction/ViewGatewayResponse.groovy +++ b/applications/accounting/webapp/accounting/WEB-INF/actions/transaction/ViewGatewayResponse.groovy @@ -37,7 +37,7 @@ orderPaymentPreferenceId = context.orderPaymentPreferenceId; // first purpose: retrieve orderId and paymentPreferenceId if (!orderPaymentPreferenceId) { paymentGatewayResponse = context.paymentGatewayResponse; - orderPaymentPreference = paymentGatewayResponse.getRelatedOne("OrderPaymentPreference"); + orderPaymentPreference = paymentGatewayResponse.getRelatedOne("OrderPaymentPreference", false); context.orderId = orderPaymentPreference.orderId; context.orderPaymentPreferenceId = orderPaymentPreference.orderPaymentPreferenceId; } else { diff --git a/applications/accounting/webapp/accounting/finaccounttrans/FinAccountTrans.ftl b/applications/accounting/webapp/accounting/finaccounttrans/FinAccountTrans.ftl index dc410b195c..48d7437734 100644 --- a/applications/accounting/webapp/accounting/finaccounttrans/FinAccountTrans.ftl +++ b/applications/accounting/webapp/accounting/finaccounttrans/FinAccountTrans.ftl @@ -198,9 +198,9 @@ function getFinAccountTransRunningTotalAndBalances() { <#if payment?has_content> <#assign paymentGroupMembers = Static["org.ofbiz.entity.util.EntityUtil"].filterByDate(payment.getRelated("PaymentGroupMember")?if_exists) /> - <#assign fromParty = payment.getRelatedOne("FromParty")?if_exists /> + <#assign fromParty = payment.getRelatedOne("FromParty", false)?if_exists /> <#assign fromPartyName = delegator.findOne("PartyNameView", {"partyId" : fromParty.partyId}, true) /> - <#assign toParty = payment.getRelatedOne("ToParty")?if_exists /> + <#assign toParty = payment.getRelatedOne("ToParty", false)?if_exists /> <#assign toPartyName = delegator.findOne("PartyNameView", {"partyId" : toParty.partyId}, true) /> <#if paymentGroupMembers?has_content> <#assign paymentGroupMember = Static["org.ofbiz.entity.util.EntityUtil"].getFirst(paymentGroupMembers) /> diff --git a/applications/accounting/webapp/accounting/finaccounttrans/GlReconciledFinAccountTrans.ftl b/applications/accounting/webapp/accounting/finaccounttrans/GlReconciledFinAccountTrans.ftl index bde9c0f8dc..52d5c361f7 100644 --- a/applications/accounting/webapp/accounting/finaccounttrans/GlReconciledFinAccountTrans.ftl +++ b/applications/accounting/webapp/accounting/finaccounttrans/GlReconciledFinAccountTrans.ftl @@ -43,7 +43,7 @@ under the License. <#if currentGlReconciliation.statusId?exists> ${uiLabelMap.CommonStatus} - <#assign currentStatus = currentGlReconciliation.getRelatedOneCache("StatusItem")> + <#assign currentStatus = currentGlReconciliation.getRelatedOne("StatusItem", true)> ${currentStatus.description?if_exists} @@ -88,7 +88,7 @@ under the License. <#if previousGlReconciliation.statusId?exists> ${uiLabelMap.CommonStatus} - <#assign previousStatus = previousGlReconciliation.getRelatedOneCache("StatusItem")> + <#assign previousStatus = previousGlReconciliation.getRelatedOne("StatusItem", true)> ${previousStatus.description?if_exists} diff --git a/applications/accounting/webapp/accounting/invoice/PrintInvoices.fo.ftl b/applications/accounting/webapp/accounting/invoice/PrintInvoices.fo.ftl index c12f48aa03..d4e2f1ab8d 100644 --- a/applications/accounting/webapp/accounting/invoice/PrintInvoices.fo.ftl +++ b/applications/accounting/webapp/accounting/invoice/PrintInvoices.fo.ftl @@ -55,7 +55,7 @@ under the License. - ${invoice.getRelatedOne("InvoiceType").get("description",locale)?if_exists} + ${invoice.getRelatedOne("InvoiceType", false).get("description",locale)?if_exists} @@ -184,13 +184,13 @@ under the License. <#assign newShipmentId = ""> <#-- if the item has a description, then use its description. Otherwise, use the description of the invoiceItemType --> <#list invoiceItems as invoiceItem> - <#assign itemType = invoiceItem.getRelatedOne("InvoiceItemType")> - <#assign taxRate = invoiceItem.getRelatedOne("TaxAuthorityRateProduct")?if_exists> + <#assign itemType = invoiceItem.getRelatedOne("InvoiceItemType", false)> + <#assign taxRate = invoiceItem.getRelatedOne("TaxAuthorityRateProduct", false)?if_exists> <#assign itemBillings = invoiceItem.getRelated("OrderItemBilling")?if_exists> <#if itemBillings?has_content> <#assign itemBilling = Static["org.ofbiz.entity.util.EntityUtil"].getFirst(itemBillings)> <#if itemBilling?has_content> - <#assign itemIssuance = itemBilling.getRelatedOne("ItemIssuance")?if_exists> + <#assign itemIssuance = itemBilling.getRelatedOne("ItemIssuance", false)?if_exists> <#if itemIssuance?has_content> <#assign newShipmentId = itemIssuance.shipmentId> diff --git a/applications/accounting/webapp/accounting/invoice/invoiceReportHeaderInfo.fo.ftl b/applications/accounting/webapp/accounting/invoice/invoiceReportHeaderInfo.fo.ftl index 7f53beed5a..b02255873c 100644 --- a/applications/accounting/webapp/accounting/invoice/invoiceReportHeaderInfo.fo.ftl +++ b/applications/accounting/webapp/accounting/invoice/invoiceReportHeaderInfo.fo.ftl @@ -23,7 +23,7 @@ under the License. - ${invoice.getRelatedOne("InvoiceType").get("description",locale)} + ${invoice.getRelatedOne("InvoiceType", false).get("description",locale)} diff --git a/applications/accounting/webapp/accounting/invoice/invoiceReportItems.fo.ftl b/applications/accounting/webapp/accounting/invoice/invoiceReportItems.fo.ftl index 52b4ac5aa1..2a44e29e9b 100644 --- a/applications/accounting/webapp/accounting/invoice/invoiceReportItems.fo.ftl +++ b/applications/accounting/webapp/accounting/invoice/invoiceReportItems.fo.ftl @@ -51,7 +51,7 @@ under the License. <#list terms as term> - <#assign termType = term.getRelatedOne("TermType")/> + <#assign termType = term.getRelatedOne("TermType", false)/> ${termType.description?if_exists} ${term.description?if_exists} ${term.termDays?if_exists} ${term.textValue?if_exists} @@ -95,15 +95,15 @@ under the License. <#assign newShipmentId = ""> <#-- if the item has a description, then use its description. Otherwise, use the description of the invoiceItemType --> <#list invoiceItems as invoiceItem> - <#assign itemType = invoiceItem.getRelatedOne("InvoiceItemType")> + <#assign itemType = invoiceItem.getRelatedOne("InvoiceItemType", false)> <#assign isItemAdjustment = Static["org.ofbiz.entity.util.EntityTypeUtil"].hasParentType(delegator, "InvoiceItemType", "invoiceItemTypeId", itemType.getString("invoiceItemTypeId"), "parentTypeId", "INVOICE_ADJ")/> - <#assign taxRate = invoiceItem.getRelatedOne("TaxAuthorityRateProduct")?if_exists> + <#assign taxRate = invoiceItem.getRelatedOne("TaxAuthorityRateProduct", false)?if_exists> <#assign itemBillings = invoiceItem.getRelated("OrderItemBilling")?if_exists> <#if itemBillings?has_content> <#assign itemBilling = Static["org.ofbiz.entity.util.EntityUtil"].getFirst(itemBillings)> <#if itemBilling?has_content> - <#assign itemIssuance = itemBilling.getRelatedOne("ItemIssuance")?if_exists> + <#assign itemIssuance = itemBilling.getRelatedOne("ItemIssuance", false)?if_exists> <#if itemIssuance?has_content> <#assign newShipmentId = itemIssuance.shipmentId> <#assign issuedDateTime = itemIssuance.issuedDateTime/> diff --git a/applications/accounting/webapp/accounting/payment/PrintChecks.fo.ftl b/applications/accounting/webapp/accounting/payment/PrintChecks.fo.ftl index 23cfcaae0b..398c3c48b5 100644 --- a/applications/accounting/webapp/accounting/payment/PrintChecks.fo.ftl +++ b/applications/accounting/webapp/accounting/payment/PrintChecks.fo.ftl @@ -149,7 +149,7 @@ by hand from a real template using a ruler. <#list paymentApplications as paymentApplication> - <#assign invoice = paymentApplication.getRelatedOne("Invoice")?if_exists> + <#assign invoice = paymentApplication.getRelatedOne("Invoice", false)?if_exists> ${payment.effectiveDate?date?string.short} @@ -181,7 +181,7 @@ by hand from a real template using a ruler. <#assign sumAmount = 0> <#assign sumSubTotal = 0> <#list InvoiceItems as invoiceItem> - <#assign invoiceItemType = invoiceItem.getRelatedOne("InvoiceItemType")?if_exists> + <#assign invoiceItemType = invoiceItem.getRelatedOne("InvoiceItemType", false)?if_exists> <#assign quantity = 0> <#assign amount = 0> <#assign subTotal = 0> @@ -217,7 +217,7 @@ by hand from a real template using a ruler. <#assign sumAmount = 0> <#assign sumSubTotal = 0> <#list InvoiceItems as invoiceItem> - <#assign invoiceItemType = invoiceItem.getRelatedOne("InvoiceItemType")?if_exists> + <#assign invoiceItemType = invoiceItem.getRelatedOne("InvoiceItemType", false)?if_exists> <#assign subTotal = 0> <#if invoiceItemType.parentTypeId == payrolGroup.invoiceItemTypeId> <#if invoiceItem.quantity?has_content><#assign quantity = invoiceItem.quantity?if_exists><#else><#assign quantity = 0> @@ -241,7 +241,7 @@ by hand from a real template using a ruler. <#assign sumAmount = 0> <#assign sumSubTotal = 0> <#list InvoiceItems as invoiceItem> - <#assign invoiceItemType = invoiceItem.getRelatedOne("InvoiceItemType")?if_exists> + <#assign invoiceItemType = invoiceItem.getRelatedOne("InvoiceItemType", false)?if_exists> <#assign subTotal = 0> <#if invoiceItemType.parentTypeId == payrolGroup.invoiceItemTypeId> <#if invoiceItem.quantity?has_content><#assign quantity = invoiceItem.quantity?if_exists><#else><#assign quantity = 0> @@ -345,7 +345,7 @@ by hand from a real template using a ruler. <#list paymentApplications as paymentApplication> - <#assign invoice = paymentApplication.getRelatedOne("Invoice")?if_exists> + <#assign invoice = paymentApplication.getRelatedOne("Invoice", false)?if_exists> ${payment.effectiveDate?date?string.short} @@ -377,7 +377,7 @@ by hand from a real template using a ruler. <#assign sumAmount = 0> <#assign sumSubTotal = 0> <#list InvoiceItems as invoiceItem> - <#assign invoiceItemType = invoiceItem.getRelatedOne("InvoiceItemType")?if_exists> + <#assign invoiceItemType = invoiceItem.getRelatedOne("InvoiceItemType", false)?if_exists> <#assign quantity = 0> <#assign amount = 0> <#assign subTotal = 0> @@ -413,7 +413,7 @@ by hand from a real template using a ruler. <#assign sumAmount = 0> <#assign sumSubTotal = 0> <#list InvoiceItems as invoiceItem> - <#assign invoiceItemType = invoiceItem.getRelatedOne("InvoiceItemType")?if_exists> + <#assign invoiceItemType = invoiceItem.getRelatedOne("InvoiceItemType", false)?if_exists> <#assign subTotal = 0> <#if invoiceItemType.parentTypeId == payrolGroup.invoiceItemTypeId> <#if invoiceItem.quantity?has_content><#assign quantity = invoiceItem.quantity?if_exists><#else><#assign quantity = 0> @@ -437,7 +437,7 @@ by hand from a real template using a ruler. <#assign sumAmount = 0> <#assign sumSubTotal = 0> <#list InvoiceItems as invoiceItem> - <#assign invoiceItemType = invoiceItem.getRelatedOne("InvoiceItemType")?if_exists> + <#assign invoiceItemType = invoiceItem.getRelatedOne("InvoiceItemType", false)?if_exists> <#assign subTotal = 0> <#if invoiceItemType.parentTypeId == payrolGroup.invoiceItemTypeId> <#if invoiceItem.quantity?has_content><#assign quantity = invoiceItem.quantity?if_exists><#else><#assign quantity = 0> diff --git a/applications/accounting/webapp/accounting/period/EditCustomTimePeriod.ftl b/applications/accounting/webapp/accounting/period/EditCustomTimePeriod.ftl index c8d347be9a..ab2fd215cb 100644 --- a/applications/accounting/webapp/accounting/period/EditCustomTimePeriod.ftl +++ b/applications/accounting/webapp/accounting/period/EditCustomTimePeriod.ftl @@ -68,7 +68,7 @@ under the License. @@ -168,7 +168,7 @@ under the License. <#list allCustomTimePeriods as allCustomTimePeriod> - <#assign allPeriodType = allCustomTimePeriod.getRelatedOneCache("PeriodType")> + <#assign allPeriodType = allCustomTimePeriod.getRelatedOne("PeriodType", true)> <#assign isDefault = false> <#if currentCustomTimePeriod?exists> <#if currentCustomTimePeriod.customTimePeriodId = allCustomTimePeriod.customTimePeriodId> diff --git a/applications/accounting/webapp/accounting/reports/AcctgTransEntriesSearchResult.fo.ftl b/applications/accounting/webapp/accounting/reports/AcctgTransEntriesSearchResult.fo.ftl index 7a26e0ccb5..13eb616980 100644 --- a/applications/accounting/webapp/accounting/reports/AcctgTransEntriesSearchResult.fo.ftl +++ b/applications/accounting/webapp/accounting/reports/AcctgTransEntriesSearchResult.fo.ftl @@ -138,7 +138,7 @@ under the License. <#if (acctgTransEntry.paymentId)??> - <#assign paymentType = (delegator.findOne("Payment", {"paymentId" : (acctgTransEntry.paymentId)!}, false)).getRelatedOne("PaymentType")/> + <#assign paymentType = (delegator.findOne("Payment", {"paymentId" : (acctgTransEntry.paymentId)!}, false)).getRelatedOne("PaymentType", false)/> ${(acctgTransEntry.paymentId)!}<#if (paymentType?has_content)> -(${(paymentType.description)!}) diff --git a/applications/accounting/webapp/accounting/reports/AcctgTransEntriesSearchResultsInvoiceAndPayment.rptdesign b/applications/accounting/webapp/accounting/reports/AcctgTransEntriesSearchResultsInvoiceAndPayment.rptdesign index e4b509afb1..a68839bb51 100644 --- a/applications/accounting/webapp/accounting/reports/AcctgTransEntriesSearchResultsInvoiceAndPayment.rptdesign +++ b/applications/accounting/webapp/accounting/reports/AcctgTransEntriesSearchResultsInvoiceAndPayment.rptdesign @@ -841,7 +841,7 @@ context.put("delegator", delegator); context.put("dispatcher", dispatcher); GroovyUtil.runScriptAtLocation("component://order/webapp/ordermgr/WEB-INF/actions/order/CompanyHeader.groovy", context); var postalAddress = context.get("postalAddress"); -var country = postalAddress.getRelatedOne("CountryGeo"); +var country = postalAddress.getRelatedOne("CountryGeo", false); var phone = context.get("phone"); var email = context.get("email"); var webSite = context.get("website"); diff --git a/applications/accounting/webapp/accounting/reports/AcctgTransSearchResult.fo.ftl b/applications/accounting/webapp/accounting/reports/AcctgTransSearchResult.fo.ftl index 307d19eee6..ddf2aca0ab 100644 --- a/applications/accounting/webapp/accounting/reports/AcctgTransSearchResult.fo.ftl +++ b/applications/accounting/webapp/accounting/reports/AcctgTransSearchResult.fo.ftl @@ -119,7 +119,7 @@ under the License. <#if (acctgTrans.paymentId)??> - <#assign paymentType = (delegator.findOne("Payment", {"paymentId" : (acctgTrans.paymentId)!}, false)).getRelatedOne("PaymentType")/> + <#assign paymentType = (delegator.findOne("Payment", {"paymentId" : (acctgTrans.paymentId)!}, false)).getRelatedOne("PaymentType", false)/> ${(acctgTrans.paymentId)!}<#if (paymentType?has_content)> -(${(paymentType.description)!}) diff --git a/applications/accounting/webapp/accounting/reports/BalanceSheet.rptdesign b/applications/accounting/webapp/accounting/reports/BalanceSheet.rptdesign index 779283758f..2b062c2f5f 100644 --- a/applications/accounting/webapp/accounting/reports/BalanceSheet.rptdesign +++ b/applications/accounting/webapp/accounting/reports/BalanceSheet.rptdesign @@ -578,7 +578,7 @@ return true;]]> - delegator.findOne("PartyAcctgPreference", UtilMisc.toMap("partyId", organizationPartyId), false).getRelatedOne("Uom").getString("description") + delegator.findOne("PartyAcctgPreference", UtilMisc.toMap("partyId", organizationPartyId), false).getRelatedOne("Uom", false).getString("description") html diff --git a/applications/accounting/webapp/accounting/reports/IncomeStatement.rptdesign b/applications/accounting/webapp/accounting/reports/IncomeStatement.rptdesign index 82bd41f0ab..c6b814eb83 100644 --- a/applications/accounting/webapp/accounting/reports/IncomeStatement.rptdesign +++ b/applications/accounting/webapp/accounting/reports/IncomeStatement.rptdesign @@ -527,7 +527,7 @@ return true;]]> - delegator.findOne("PartyAcctgPreference", UtilMisc.toMap("partyId", organizationPartyId), false).getRelatedOne("Uom").getString("description") + delegator.findOne("PartyAcctgPreference", UtilMisc.toMap("partyId", organizationPartyId), false).getRelatedOne("Uom", false).getString("description") html diff --git a/applications/accounting/webapp/accounting/reports/InvoiceAcctgTransEntry.rptdesign b/applications/accounting/webapp/accounting/reports/InvoiceAcctgTransEntry.rptdesign index 0351e789c2..6c95fe07d7 100644 --- a/applications/accounting/webapp/accounting/reports/InvoiceAcctgTransEntry.rptdesign +++ b/applications/accounting/webapp/accounting/reports/InvoiceAcctgTransEntry.rptdesign @@ -46,7 +46,7 @@ dateFormatter = new java.text.SimpleDateFormat("dd MMMMM yyyy"); invoice = delegator.findOne("Invoice", UtilMisc.toMap("invoiceId", invoiceId), false); organizationPartyId = null; -if ("PURCHASE_INVOICE".equals(invoice.get("invoiceTypeId")) || "PURCHASE_INVOICE".equals(invoice.getRelatedOne("InvoiceType").get("parentTypeId"))) { +if ("PURCHASE_INVOICE".equals(invoice.get("invoiceTypeId")) || "PURCHASE_INVOICE".equals(invoice.getRelatedOne("InvoiceType", false).get("parentTypeId"))) { organizationPartyId = invoice.get("partyId"); } else { organizationPartyId = invoice.get("partyIdFrom"); @@ -523,12 +523,12 @@ return true;]]> = 1) return false; row["invoiceId"] = invoice.get("invoiceId"); row["description"] = invoice.get("description"); -row["invoiceTypeDescription"] = invoice.getRelatedOne("InvoiceType").get("description"); -row["statusDescription"] = invoice.getRelatedOne("StatusItem").get("description"); +row["invoiceTypeDescription"] = invoice.getRelatedOne("InvoiceType", false).get("description"); +row["statusDescription"] = invoice.getRelatedOne("StatusItem", false).get("description"); row["invoiceDate"] = invoice.get("invoiceDate"); var partyId = null; -if ("PURCHASE_INVOICE".equals(invoice.get("invoiceTypeId")) || "PURCHASE_INVOICE".equals(invoice.getRelatedOne("InvoiceType").get("parentTypeId"))) { +if ("PURCHASE_INVOICE".equals(invoice.get("invoiceTypeId")) || "PURCHASE_INVOICE".equals(invoice.getRelatedOne("InvoiceType", false).get("parentTypeId"))) { partyId = invoice.get("partyIdFrom"); } else { partyId = invoice.get("partyId"); diff --git a/applications/accounting/webapp/accounting/reports/PaymentAcctgTransEntry.rptdesign b/applications/accounting/webapp/accounting/reports/PaymentAcctgTransEntry.rptdesign index 8f6d9ac093..91faa62778 100644 --- a/applications/accounting/webapp/accounting/reports/PaymentAcctgTransEntry.rptdesign +++ b/applications/accounting/webapp/accounting/reports/PaymentAcctgTransEntry.rptdesign @@ -42,7 +42,7 @@ dateFormatter = new java.text.SimpleDateFormat("dd MMMMM yyyy"); payment = delegator.findOne("Payment", UtilMisc.toMap("paymentId", paymentId), false); organizationPartyId = null; -if ("DISBURSEMENT".equals(payment.get("paymentTypeId")) || "DISBURSEMENT".equals(payment.getRelatedOne("PaymentType").get("parentTypeId"))) { +if ("DISBURSEMENT".equals(payment.get("paymentTypeId")) || "DISBURSEMENT".equals(payment.getRelatedOne("PaymentType", false).get("parentTypeId"))) { organizationPartyId = payment.get("partyIdFrom"); } else { organizationPartyId = payment.get("partyIdTo"); @@ -500,12 +500,12 @@ return true;]]> = 1) return false; row["paymentId"] = payment.get("paymentId"); row["comments"] = payment.get("comments"); -row["paymentTypeDescription"] = payment.getRelatedOne("PaymentType").get("description"); -row["statusDescription"] = payment.getRelatedOne("StatusItem").get("description"); +row["paymentTypeDescription"] = payment.getRelatedOne("PaymentType", false).get("description"); +row["statusDescription"] = payment.getRelatedOne("StatusItem", false).get("description"); row["effectiveDate"] = payment.get("effectiveDate"); var partyId = null; -if ("RECEIPT".equals(payment.get("paymentTypeId")) || "RECEIPT".equals(payment.getRelatedOne("PaymentType").get("parentTypeId"))) { +if ("RECEIPT".equals(payment.get("paymentTypeId")) || "RECEIPT".equals(payment.getRelatedOne("PaymentType", false).get("parentTypeId"))) { partyId = payment.get("partyIdFrom"); } else { partyId = payment.get("partyIdTo"); diff --git a/applications/accounting/webapp/accounting/reports/TrialBalance.rptdesign b/applications/accounting/webapp/accounting/reports/TrialBalance.rptdesign index 6e09840259..d8f814570e 100644 --- a/applications/accounting/webapp/accounting/reports/TrialBalance.rptdesign +++ b/applications/accounting/webapp/accounting/reports/TrialBalance.rptdesign @@ -395,7 +395,7 @@ this.text = dateFormatter.format(fromDate) + " - " + dateFormatter.format(thruDa - delegator.findOne("PartyAcctgPreference", UtilMisc.toMap("partyId", organizationPartyId), false).getRelatedOne("Uom").getString("description") + delegator.findOne("PartyAcctgPreference", UtilMisc.toMap("partyId", organizationPartyId), false).getRelatedOne("Uom", false).getString("description") html diff --git a/applications/accounting/webapp/ap/invoices/PurchaseInvoices.ftl b/applications/accounting/webapp/ap/invoices/PurchaseInvoices.ftl index 8e9b5386c3..ce13b351dc 100644 --- a/applications/accounting/webapp/ap/invoices/PurchaseInvoices.ftl +++ b/applications/accounting/webapp/ap/invoices/PurchaseInvoices.ftl @@ -193,7 +193,7 @@ function runAction() { <#list invoices as invoice> <#assign invoicePaymentInfoList = dispatcher.runSync("getInvoicePaymentInfoList", Static["org.ofbiz.base.util.UtilMisc"].toMap("invoiceId", invoice.invoiceId, "userLogin", userLogin))/> <#assign invoicePaymentInfo = invoicePaymentInfoList.get("invoicePaymentInfoList").get(0)?if_exists> - <#assign statusItem = invoice.getRelatedOneCache("StatusItem")> + <#assign statusItem = invoice.getRelatedOne("StatusItem", true)> class="alternate-row"> ${invoice.get("invoiceId")} ${invoice.invoiceTypeDesc?default(invoice.invoiceTypeId)}