Class CreateLinesFromProcessHook


  • public abstract class CreateLinesFromProcessHook
    extends Object
    Interface to be implemented by the hooks to be executed on the Create Lines From Order process. Example of a hook:
     @Dependent
     @Qualifier(CreateLinesFromProcessHook.CREATE_LINES_FROM_PROCESS_HOOK_QUALIFIER)
     public class TestHook implements CreateLinesFromProcessHook {
     
       @Override
       public int getOrder() {
         return 10;
       }
     
       @Override
       public void exec() {
         getInvoiceLine().setDescription("Test");
       }
     }
     
    This class has useful public method to access to the invoice and invoice line currently being created, the BaseOBObject line (Order/InOut) from which the invoice line is being created or even the JSONObject from which the invoice line is being created.
    • Field Detail

      • CREATE_LINES_FROM_PROCESS_HOOK_QUALIFIER

        public static final String CREATE_LINES_FROM_PROCESS_HOOK_QUALIFIER
        See Also:
        Constant Field Values
    • Constructor Detail

      • CreateLinesFromProcessHook

        public CreateLinesFromProcessHook()
    • Method Detail

      • getOrder

        public abstract int getOrder()
        Returns the order when the concrete hook will be implemented. A positive value will execute the hook after the core's logic
      • exec

        public abstract void exec()
        Executes the hook logic on the Create Lines From process
      • getInvoice

        public Invoice getInvoice()
        Returns the Invoice currently being created
      • getInvoiceLine

        public InvoiceLine getInvoiceLine()
        Returns the Invoice Line currently being created
      • getCopiedFromLine

        public BaseOBObject getCopiedFromLine()
        Returns the line from which the invoice line will be created. It can be either a shipment or an order line
      • isCopiedFromOrderLine

        public boolean isCopiedFromOrderLine()
        Returns true if the line from which the invoice line will be created is an order line.
      • getPickExecJSONObject

        public org.codehaus.jettison.json.JSONObject getPickExecJSONObject()