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
This commit is contained in:
Adam Heath
2012-05-29 04:11:43 +00:00
parent 1aa422773b
commit 7d2b0d9865
48 changed files with 163 additions and 163 deletions
@@ -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());
@@ -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);
}
@@ -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());
}
@@ -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<GenericValue> billingContactMechs = billFromVendor.getRelatedOne("Party").getRelatedByAnd("PartyContactMechPurpose", UtilMisc.toMap("contactMechPurposeTypeId", "BILLING_LOCATION"));
List<GenericValue> 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<GenericValue> 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<GenericValue> 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");
@@ -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<GenericValue> 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);
@@ -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<GenericValue> 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"))) {
@@ -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,
@@ -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<String, Object> 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<GenericValue> 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<GenericValue> emails = ContactHelper.getContactMech(billToPersonOrGroup.getRelatedOne("Party"), "PRIMARY_EMAIL", "EMAIL_ADDRESS", false);
Collection<GenericValue> 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());
@@ -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));
}
@@ -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")));
@@ -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);
@@ -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");
}
@@ -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,
@@ -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,
@@ -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.
@@ -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());
@@ -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);
@@ -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,
@@ -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());
@@ -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");
}
@@ -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"));
}
@@ -48,7 +48,7 @@ invoiceItemTypes.each { invoiceItemType ->
glAccount = glAccounts[0];
}
} else {
glAccount = invoiceItemType.getRelatedOne("DefaultGlAccount");
glAccount = invoiceItemType.getRelatedOne("DefaultGlAccount", false);
}
if (glAccount) {
@@ -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;
@@ -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;
@@ -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
@@ -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;
@@ -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;
}
@@ -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"));
@@ -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);
}
@@ -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");
}
@@ -39,7 +39,7 @@ if (orderPaymentPreferenceId) {
}
if (orderPaymentPreference) {
paymentMethodType = orderPaymentPreference.getRelatedOneCache("PaymentMethodType");
paymentMethodType = orderPaymentPreference.getRelatedOne("PaymentMethodType", true);
context.paymentMethodType = paymentMethodType;
}
@@ -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 {
@@ -198,9 +198,9 @@ function getFinAccountTransRunningTotalAndBalances() {
</#if>
<#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) />
@@ -43,7 +43,7 @@ under the License.
<#if currentGlReconciliation.statusId?exists>
<tr>
<td><span class="label">${uiLabelMap.CommonStatus}</span></td>
<#assign currentStatus = currentGlReconciliation.getRelatedOneCache("StatusItem")>
<#assign currentStatus = currentGlReconciliation.getRelatedOne("StatusItem", true)>
<td>${currentStatus.description?if_exists}</td>
</tr>
</#if>
@@ -88,7 +88,7 @@ under the License.
<#if previousGlReconciliation.statusId?exists>
<tr>
<td><span class="label">${uiLabelMap.CommonStatus}</span></td>
<#assign previousStatus = previousGlReconciliation.getRelatedOneCache("StatusItem")>
<#assign previousStatus = previousGlReconciliation.getRelatedOne("StatusItem", true)>
<td>${previousStatus.description?if_exists}</td>
</tr>
</#if>
@@ -55,7 +55,7 @@ under the License.
<fo:table-body>
<fo:table-row>
<fo:table-cell>
<fo:block number-columns-spanned="2" font-weight="bold">${invoice.getRelatedOne("InvoiceType").get("description",locale)?if_exists}</fo:block>
<fo:block number-columns-spanned="2" font-weight="bold">${invoice.getRelatedOne("InvoiceType", false).get("description",locale)?if_exists}</fo:block>
</fo:table-cell>
</fo:table-row>
<fo:table-row>
@@ -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>
</#if>
@@ -23,7 +23,7 @@ under the License.
<fo:table-body>
<fo:table-row>
<fo:table-cell>
<fo:block number-columns-spanned="2" font-weight="bold">${invoice.getRelatedOne("InvoiceType").get("description",locale)}</fo:block>
<fo:block number-columns-spanned="2" font-weight="bold">${invoice.getRelatedOne("InvoiceType", false).get("description",locale)}</fo:block>
</fo:table-cell>
</fo:table-row>
@@ -51,7 +51,7 @@ under the License.
<fo:table-body>
<#list terms as term>
<#assign termType = term.getRelatedOne("TermType")/>
<#assign termType = term.getRelatedOne("TermType", false)/>
<fo:table-row>
<fo:table-cell>
<fo:block font-size ="10pt" font-weight="bold">${termType.description?if_exists} ${term.description?if_exists} ${term.termDays?if_exists} ${term.textValue?if_exists}</fo:block>
@@ -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/>
@@ -149,7 +149,7 @@ by hand from a real template using a ruler.
<fo:table-body>
<#list paymentApplications as paymentApplication>
<#assign invoice = paymentApplication.getRelatedOne("Invoice")?if_exists>
<#assign invoice = paymentApplication.getRelatedOne("Invoice", false)?if_exists>
<fo:table-row>
<fo:table-cell padding="3pt">
<fo:block>${payment.effectiveDate?date?string.short}</fo:block>
@@ -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></#if>
@@ -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></#if>
@@ -345,7 +345,7 @@ by hand from a real template using a ruler.
<fo:table-body>
<#list paymentApplications as paymentApplication>
<#assign invoice = paymentApplication.getRelatedOne("Invoice")?if_exists>
<#assign invoice = paymentApplication.getRelatedOne("Invoice", false)?if_exists>
<fo:table-row>
<fo:table-cell padding="3pt">
<fo:block>${payment.effectiveDate?date?string.short}</fo:block>
@@ -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></#if>
@@ -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></#if>
@@ -68,7 +68,7 @@ under the License.
<select name="parentPeriodId">
<option value=''>&nbsp;</option>
<#list allCustomTimePeriods as allCustomTimePeriod>
<#assign allPeriodType = allCustomTimePeriod.getRelatedOneCache("PeriodType")>
<#assign allPeriodType = allCustomTimePeriod.getRelatedOne("PeriodType", true)>
<#assign isDefault = false>
<#if (currentCustomTimePeriod.parentPeriodId)?exists>
<#if currentCustomTimePeriod.customTimePeriodId = allCustomTimePeriod.customTimePeriodId>
@@ -157,7 +157,7 @@ under the License.
<#assign line = 0>
<#list customTimePeriods as customTimePeriod>
<#assign line = line + 1>
<#assign periodType = customTimePeriod.getRelatedOneCache("PeriodType")>
<#assign periodType = customTimePeriod.getRelatedOne("PeriodType", true)>
<tr>
<form method="post" action='<@ofbizUrl>updateCustomTimePeriod</@ofbizUrl>' name='lineForm${line}'>
<input type="hidden" name="findOrganizationPartyId" value="${findOrganizationPartyId?if_exists}" />
@@ -168,7 +168,7 @@ under the License.
<select name="parentPeriodId">
<option value=''>&nbsp;</option>
<#list allCustomTimePeriods as allCustomTimePeriod>
<#assign allPeriodType = allCustomTimePeriod.getRelatedOneCache("PeriodType")>
<#assign allPeriodType = allCustomTimePeriod.getRelatedOne("PeriodType", true)>
<#assign isDefault = false>
<#if (currentCustomTimePeriod.parentPeriodId)?exists>
<#if currentCustomTimePeriod.customTimePeriodId = allCustomTimePeriod.customTimePeriodId>
@@ -248,7 +248,7 @@ under the License.
<select name="parentPeriodId">
<option value=''>&nbsp;</option>
<#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>
@@ -138,7 +138,7 @@ under the License.
<fo:table-cell border="1pt solid" border-width=".1mm">
<fo:block text-align="center" font-size="5pt">
<#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)!})</#if>
</#if>
</fo:block>
@@ -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");
@@ -119,7 +119,7 @@ under the License.
<fo:table-cell border="1pt solid" border-width=".1mm">
<fo:block text-align="center" font-size="5pt">
<#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)!})</#if>
</#if>
</fo:block>
@@ -578,7 +578,7 @@ return true;]]></method>
</cell>
<cell id="136">
<text-data id="279">
<expression name="valueExpr">delegator.findOne("PartyAcctgPreference", UtilMisc.toMap("partyId", organizationPartyId), false).getRelatedOne("Uom").getString("description")</expression>
<expression name="valueExpr">delegator.findOne("PartyAcctgPreference", UtilMisc.toMap("partyId", organizationPartyId), false).getRelatedOne("Uom", false).getString("description")</expression>
<property name="contentType">html</property>
</text-data>
</cell>
@@ -527,7 +527,7 @@ return true;]]></method>
</cell>
<cell id="136">
<text-data id="279">
<expression name="valueExpr">delegator.findOne("PartyAcctgPreference", UtilMisc.toMap("partyId", organizationPartyId), false).getRelatedOne("Uom").getString("description")</expression>
<expression name="valueExpr">delegator.findOne("PartyAcctgPreference", UtilMisc.toMap("partyId", organizationPartyId), false).getRelatedOne("Uom", false).getString("description")</expression>
<property name="contentType">html</property>
</text-data>
</cell>
@@ -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;]]></method>
<method name="fetch"><![CDATA[if (countOfRow >= 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");
@@ -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;]]></method>
<method name="fetch"><![CDATA[if (countOfRow >= 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");
@@ -395,7 +395,7 @@ this.text = dateFormatter.format(fromDate) + " - " + dateFormatter.format(thruDa
</cell>
<cell id="136">
<text-data id="279">
<expression name="valueExpr">delegator.findOne("PartyAcctgPreference", UtilMisc.toMap("partyId", organizationPartyId), false).getRelatedOne("Uom").getString("description")</expression>
<expression name="valueExpr">delegator.findOne("PartyAcctgPreference", UtilMisc.toMap("partyId", organizationPartyId), false).getRelatedOne("Uom", false).getString("description")</expression>
<property name="contentType">html</property>
</text-data>
</cell>
@@ -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)>
<tr valign="middle"<#if alt_row> class="alternate-row"</#if>>
<td><a class="buttontext" href="<@ofbizUrl>invoiceOverview?invoiceId=${invoice.invoiceId}</@ofbizUrl>">${invoice.get("invoiceId")}</a></td>
<td>${invoice.invoiceTypeDesc?default(invoice.invoiceTypeId)}</td>