diff --git a/applications/accounting/src/org/ofbiz/accounting/invoice/InvoiceServices.java b/applications/accounting/src/org/ofbiz/accounting/invoice/InvoiceServices.java index d80629dadc..2d7c699513 100644 --- a/applications/accounting/src/org/ofbiz/accounting/invoice/InvoiceServices.java +++ b/applications/accounting/src/org/ofbiz/accounting/invoice/InvoiceServices.java @@ -153,8 +153,6 @@ public class InvoiceServices { String orderId = (String) context.get("orderId"); List billItems = UtilGenerics.checkList(context.get("billItems")); String invoiceId = (String) context.get("invoiceId"); - // FIXME: This variable is never read, what is its purpose? - boolean previousInvoiceFound = false; if (UtilValidate.isEmpty(billItems)) { Debug.logVerbose("No order items to invoice; not creating invoice; returning success", module); @@ -167,28 +165,6 @@ public class InvoiceServices { return ServiceUtil.returnError(UtilProperties.getMessage(resource,"AccountingNoOrderHeader",locale)); } - // get list of previous invoices for the order - List billedItems = delegator.findByAnd("OrderItemBilling", UtilMisc.toMap("orderId", orderId)); - if (billedItems.size() > 0) { - boolean nonDigitalInvoice = false; - Iterator bii = billedItems.iterator(); - while (bii.hasNext() && !nonDigitalInvoice) { - GenericValue orderItemBilling = (GenericValue) bii.next(); - GenericValue invoiceItem = orderItemBilling.getRelatedOne("InvoiceItem"); - if (invoiceItem != null) { - String invoiceItemType = invoiceItem.getString("invoiceItemTypeId"); - if (invoiceItemType != null) { - if ("INV_FPROD_ITEM".equals(invoiceItemType) || "INV_PROD_FEATR_ITEM".equals(invoiceItemType)) { - nonDigitalInvoice = true; - } - } - } - } - if (nonDigitalInvoice) { - previousInvoiceFound = true; - } - } - // figure out the invoice type String invoiceType = null;