Class InvoiceGeneratorFromGoodsShipment


  • public class InvoiceGeneratorFromGoodsShipment
    extends Object
    This class generates and processes Invoice from Goods Shipment. Only goods shipment lines not linked to a Sales Order, or from Sales Order with Invoice Term "After Delivery", "After Order Delivery" or "Immediate" are considered.
    • Constructor Detail

      • InvoiceGeneratorFromGoodsShipment

        public InvoiceGeneratorFromGoodsShipment​(String shipmentId)
        Creates an InvoiceGeneratorFromGoodsShipment based only on shipment Id. The invoice date is taken from the shipment movement date, and the invoice price list is taken from shipment business partner
        Parameters:
        shipmentId - The shipment Id
      • InvoiceGeneratorFromGoodsShipment

        public InvoiceGeneratorFromGoodsShipment​(String shipmentId,
                                                 Date invoiceDate,
                                                 PriceList priceList)
        Creates an InvoiceGeneratorFromGoodsShipment based on shipment Id
        Parameters:
        shipmentId - The shipment Id
        invoiceDate - The invoice date. If null it takes the from the shipment movement date.
        priceList - The invoice price list. If null it takes the business partner default
      • InvoiceGeneratorFromGoodsShipment

        public InvoiceGeneratorFromGoodsShipment​(String shipmentId,
                                                 Date invoiceDate,
                                                 PriceList priceList,
                                                 String invoiceDocumentNo)
        Creates an InvoiceGeneratorFromGoodsShipment based on shipment Id
        Parameters:
        shipmentId - The shipment Id
        invoiceDate - The invoice date. If null it takes the from the shipment movement date.
        priceList - The invoice price list. If null it takes the business partner default
        invoiceDocumentNo - The invoice document number.
    • Method Detail

      • setAllowInvoicePOSOrder

        public void setAllowInvoicePOSOrder​(boolean allowInvoicePOSOrder)
      • setEvictObjectOnCreation

        public void setEvictObjectOnCreation​(boolean allowEvictObjectOnCreation)
      • createInvoiceConsideringInvoiceTerms

        public Invoice createInvoiceConsideringInvoiceTerms​(boolean doProcessInvoice)
        Creates a Sales Invoice from Goods Shipment, considering the invoice terms of available orders linked to the shipment lines.
        Parameters:
        doProcessInvoice - if true the invoice will be automatically processed, otherwise it will remain in draft status
        Returns:
        The invoice created
      • invoicePendingQtyForShipmentLine

        protected void invoicePendingQtyForShipmentLine​(ShipmentInOutLine shipmentLine,
                                                        BigDecimal qtyToInvoice)