You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by le...@apache.org on 2009/11/13 03:10:15 UTC

svn commit: r835707 - /ofbiz/trunk/applications/accounting/src/org/ofbiz/accounting/invoice/InvoiceServices.java

Author: lektran
Date: Fri Nov 13 02:10:15 2009
New Revision: 835707

URL: http://svn.apache.org/viewvc?rev=835707&view=rev
Log:
Removed a block of unused code. 
I checked back through the revision history and it was originally used to decide whether shipping adjustments had been already been charged.  That determination was refactored quite a while ago and this portion was left behind.

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=835707&r1=835706&r2=835707&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 Fri Nov 13 02:10:15 2009
@@ -153,8 +153,6 @@
         String orderId = (String) context.get("orderId");
         List<GenericValue> 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 @@
                 return ServiceUtil.returnError(UtilProperties.getMessage(resource,"AccountingNoOrderHeader",locale));
             }
 
-            // get list of previous invoices for the order
-            List<GenericValue> billedItems = delegator.findByAnd("OrderItemBilling", UtilMisc.toMap("orderId", orderId));
-            if (billedItems.size() > 0) {
-                boolean nonDigitalInvoice = false;
-                Iterator<GenericValue> 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;