List of Server Side Hooks in Web POS
Overview
This document lists the server side hooks available in Web POS.
Hooks
-
OrderLoaderPreProcessHook
- Available from: RMP26
- Executed when: When JSON is received from web POS but before process it.
- Arguments:
-
JSONObject jsonorder
: contains the json object received from Web POS with the order data.
-
-
OrderLoaderHook
- Available from: RMP26
- Executed when: After an Order, Shipment and optionally an Invoice DAL objects have been created and persisted, but not yet committed to the database.
- Arguments:
-
JSONObject jsonorder
: contains the json object received from Web POS with the order data. -
Order order
: DAL object (order) which represent the generated order. -
ShipmentInOut shipment
: DAL object (ShipmentInOut) which represent the generated Shipment. -
Invoice invoice
: DAL object (Invoice) which represent the generated Invoice (Not always present).
-
-
OrderLoaderHookForQuotations
- Available from: RR16Q1
- Executed when: When a order saved as quoation is processed. After an Order, Shipment and optionally an Invoice DAL objects have been created and persisted, but not yet committed to the database.
- Arguments:
-
JSONObject jsonorder
: contains the json object received from Web POS with the order data. -
Order order
: DAL object (order) which represent the generated order (quotation). -
ShipmentInOut shipment
: DAL object (ShipmentInOut) which represent the generated Shipment. -
Invoice invoice
: DAL object (Invoice) which represent the generated Invoice (Not always present).
-
-
CustomerLoaderHook
- Available from: RR14Q3
- Executed when: After a Customer have been created or updated and persisted, but not yet committed to the database.
- Arguments:
-
JSONObject jsonCustomer
: contains the json object received from Web POS with the customer data. -
BusinessPartner customer
: DAL object (BusinessPartner) which represent the generated or updated Customer.
-
-
FinishInvoiceHook
- Available from: RR15Q2
- Executed when: After an Invoice has been created during the cashup process, inmediately after it's correct document number has been set.
- Arguments:
-
Invoice invoice
: DAL object (Invoice) representing the created invoice. -
String cashupId
: The ID of the cashup related to the invoice.
-
-
PaidReceiptsHeaderHook
- Available from: RR15Q2
- Executed when: Filtering Receipts, Verified Returns, Layaways and Quotations, you can add columns to filter by text entered by user.
- Arguments:
-
String hqlFilter
: The actual hql to filter by user introduced text. -
String filterText
: The text introduced by user.
-
-
CustomInitialValidation
- Available from: RR16Q2
- Executed when: after login, you can check any validation that you want at the POS Terminal.
- Arguments:
-
OBPOSApplications posTerminal
: The actual POS Terminal you will check the validations.
-
-
OrderLoaderPreAddShipmentLineHook
- Available from: RR17Q4
- Executed when: before create the shipment. Developer can decide if selected locator is valid or not, propose a different locator or stop the execution raising an error
- Arguments:
-
Action
:The action which is being executed (SingleBin || Return || StandardSale_Iterate_Stock_Propossed || StandardSale_Last_Attempt) -
JSONObject jsonorder
: contains the json object received from Web POS with the order data. -
Order order
: DAL object (order) which represent the generated order (quotation). -
Bin
: DAL object (locator) which represent the locator selected to create the shipment of that line.
-
- Return Values:
-
OrderLoaderPreAddShipmentLineHook_Response
: Object which stores the response of the hook. -
return null object
: Continue with the standard flow -
isValid = true
: Continue with the standard flow. If newLocator is provided it will be used as a new bin. -
newLocator
: Dal instance of Locator. Will be used if isValid is true. Ignored when the action is "StandardSale_Iterate_Stock_Propossed" -
isValid = false
: Proposed bin is not valid. For "StandardSale_Iterate_Stock_Propossed" more bins will be proposed. Rest of cases will raise an exception -
isCancelExecution
: Is always true and connot be changed unless action is "StandardSale_Iterate_Stock_Propossed". In this case by default the value is false but the developer can change it to true. -
msg
: Will be just used when an exception is raised.
-
-
ExtendsCashManagementPaymentTypeHook
- Available from: RR19Q3
- Executed when: before getting GL Items in getCashMgmt. Developers can include all the GL Items that they want
- Arguments:
-
No arguments are recibed
-
- Return Values:
-
String array
: This hook return a String [ ] which include all new Gl Items.
-
CouponAvailabilityHook
- Module: org.openbravo.retail.discounts.coupons
- Available from: RR22Q3
- Executed when: At the end of CouponAvailability
- Arguments:
-
JSONObject jsonData
: json received from request -
JSONObject result
: result of the previous flow (other hook or CouponAvailability flow)
-
- Return Values:
-
JSONObject result
: json with the result.
-