details:   https://code.openbravo.com/erp/devel/pi/rev/f0fe729cdab8
changeset: 35603:f0fe729cdab8
user:      Nono Carballo <nonofce <at> gmail.com>
date:      Wed Jan 30 15:00:51 2019 -0500
summary:   [issue-so] Controls with a parameter when to invoice POS Order lines

diffstat:

 src/org/openbravo/materialmgmt/InvoiceGeneratorFromGoodsShipment.java |  9 
+++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diffs (40 lines):

diff -r c06031aa0cab -r f0fe729cdab8 
src/org/openbravo/materialmgmt/InvoiceGeneratorFromGoodsShipment.java
--- a/src/org/openbravo/materialmgmt/InvoiceGeneratorFromGoodsShipment.java     
Fri Mar 29 06:10:36 2019 +0000
+++ b/src/org/openbravo/materialmgmt/InvoiceGeneratorFromGoodsShipment.java     
Wed Jan 30 15:00:51 2019 -0500
@@ -11,7 +11,7 @@
  * under the License.
  * The Original Code is Openbravo ERP.
  * The Initial Developer of the Original Code is Openbravo SLU
- * All portions are Copyright (C) 2018 Openbravo SLU
+ * All portions are Copyright (C) 2018-2019 Openbravo SLU
  * All Rights Reserved.
  * Contributor(s):  ______________________________________.
  *************************************************************************
@@ -79,6 +79,7 @@
   private Date invoiceDate;
   private String priceListId;
   private final Set<String> ordersWithAfterOrderDeliveryAlreadyInvoiced = new 
HashSet<>();
+  private boolean allowInvoicePOSOrder = false;
 
   private enum InvoiceTerm {
     IMMEDIATE("I"), AFTER_DELIVERY("D"), CUSTOMERSCHEDULE("S"), 
AFTER_ORDER_DELIVERY("O");
@@ -109,6 +110,10 @@
     }
   }
 
+  public void setAllowInvoicePOSOrder(boolean allowInvoicePOSOrder) {
+    this.allowInvoicePOSOrder = allowInvoicePOSOrder;
+  }
+
   /**
    * Creates an {@link InvoiceGeneratorFromGoodsShipment} based only on 
shipment Id. The invoice
    * date is taken from the shipment movement date, and the invoice price list 
is taken from
@@ -253,7 +258,7 @@
   }
 
   private boolean isOrderCandidateToBeInvoiced(final Order order) {
-    if (POS_ORDER.equals(order.getDocumentType().getSOSubType())) {
+    if (this.allowInvoicePOSOrder && 
POS_ORDER.equals(order.getDocumentType().getSOSubType())) {
       return InvoiceTerm.shouldInvoicePOSOrderLine(order.getInvoiceTerms());
     }
     return !OBDao


_______________________________________________
Openbravo-commits mailing list
Openbravo-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to