Author: sichen Date: Thu Jul 3 15:12:46 2008 New Revision: 673843 URL: http://svn.apache.org/viewvc?rev=673843&view=rev Log: Fix issue where invoice items for adjustments have no description. Some adjustments use the comments field instead, so use it if the description is empty.
Modified: ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/invoice/InvoiceServices.java Modified: ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/invoice/InvoiceServices.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/invoice/InvoiceServices.java?rev=673843&r1=673842&r2=673843&view=diff ============================================================================== --- ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/invoice/InvoiceServices.java (original) +++ ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/invoice/InvoiceServices.java Thu Jul 3 15:12:46 2008 @@ -560,7 +560,6 @@ createInvoiceItemAdjContext.put("invoiceId", invoiceId); createInvoiceItemAdjContext.put("invoiceItemSeqId", invoiceItemSeqId); createInvoiceItemAdjContext.put("invoiceItemTypeId", getInvoiceItemType(delegator, adj.getString("orderAdjustmentTypeId"), null, invoiceType, "INVOICE_ITM_ADJ")); - createInvoiceItemAdjContext.put("description", adj.get("description")); createInvoiceItemAdjContext.put("quantity", new Double(1)); createInvoiceItemAdjContext.put("amount", new Double(amount.doubleValue())); createInvoiceItemAdjContext.put("productId", orderItem.get("productId")); @@ -573,6 +572,10 @@ createInvoiceItemAdjContext.put("taxAuthPartyId", adj.get("taxAuthPartyId")); createInvoiceItemAdjContext.put("taxAuthGeoId", adj.get("taxAuthGeoId")); createInvoiceItemAdjContext.put("taxAuthorityRateSeqId", adj.get("taxAuthorityRateSeqId")); + + // some adjustments fill out the comments field instead + String description = (UtilValidate.isEmpty(adj.getString("description")) ? adj.getString("comments") : adj.getString("description")); + createInvoiceItemAdjContext.put("description", description); // invoice items for sales tax are not taxable themselves // TODO: This is not an ideal solution. Instead, we need to use OrderAdjustment.includeInTax when it is implemented