Projects:Gift Cards in WebPOS/Functional Specifications
Contents |
Overview
This project is about to extend current Gift Cards functionality to create a new type of Gift Card and it be possible to pay as other payment method in WebPOS.
General Business rules
- Creation:
- The user will have a menu entry to create this document Gift Card Certificate
- The user will need to enter the category (type/reason) of document to create (all properties will depend on this type of document), the amount and the expiration date of this document.
- Ticket needs to be printed with this information
- Payment with this document
- When paying with this type of document, the user will introduce the document number (scanning or manually) of the document, and it will act as a normal payment method. No negative line will be introduced in the ticket.
- When paying, the properties validations need to be done (expiration date, amount, etc...) and show the user error messages.
- Reimbursing this document in cash.
- An approval will be needed
- Only can be reimbursed to cash.
- Document must be printed
Functional Requirements
Extend Current gift cards module.
- Gift Card Instance:
- Type:
- Based on product (default in DB)
- Based on G/L Item
- Category (Reason..): This is just available for type Base on G/L Item.
- Name
- G/L Item
- Payment Method
- Document sequence suffix
- Only for this organization
- One time use
- Reimbursed
- Print Gift Card
- Gift Card Template
- Has Owner
- FIN_Payment_ID: As source Document
- Product should now be nullable
- G/L Item New column nullable
- C_OrderLine_ID should be nullable
- Type:
- Gift Card Creation:
- Payment for the gift card amount:
- Payment Method (Coming from Category)
- Financial Account (Coming from the ‘Terminal - Payment Type’
- G/L Item (coming from category)
- Gift Card Instance
- Payment for the gift card amount:
- Paying with Gift Card
- Select Payment method to pay and amount
- Enter card number
- First call to backend: Verify available amount and expiration date
- When Done: Second call to backend to create Gift card instance transaction with no payment id at first. We keep this info payment_id and instanceTransaction_Id in the payment info (the payment for the gift card).
- Order Loader should create the payment and the order and then a hook should fulfill payment_id info for Gift card instance transaction
- Reverse a gift Card Payment
- payment should be reversed
- a negative ‘Gift card instance transaction’ should be created
- Closing Gift Cards
- When expiration date is due a process should close gift cards creating a payment in for the remaining amount using the same GL Item used on creation
Implementation
This project is implemented in module org.openbravo.retail.giftcards and the module org.openbravo.retail.giftcards.newattributes will be merge in org.openbravo.retail.giftcards.
ERP
- Create a new table: GCNV_GiftcardReason
- Name: Card reason/type name
- C_Glitem_ID: G/L item
- FIN_Paymentmethod_ID: Payment Method
- Sequencesuffix: Sequence suffix for card number generation
- HAS_Owner: To indicate if card has owner
- Only_Org: To indicate if card only be used in that organization
- Reimbursed: To indicate if card can be reimbursed
- Use_One_Time: To indicate if card can be used only one time
- Printcard: To indicate if card can be printed
- Printtemplate_ID: Print template used to print card
- Alter table: GCNV_GiftCardInst
- Add a new column G/L Item nullable
- Product should now be nullable
- C_OrderLine_ID should now be nullable
- Create a new Window: Gift Cards Reason / Type
- Modify window: Gift card instance
- Create a new process Expiration Date Process: Execute periodically to close expired Gift Card
- Create a new hook: ProcessCashMgmtHookGiftCard that implements ProcessCashMgmtHook to register transactions when make a reimbursed.
- Create a new hook: PreOrderLoaderHook that implements OrderLoaderPreProcessHook to close Gift Cards with category option One time use marked.
Web POS
Create a Gift Card Certificate
Create a new main menu entry: Gift Certificate. This option allow create a new Gift Card, entering the following information:
- Gift Card Category
- Creation date (read only)
- Customer (Only when category have Has owner marked)
- Experation date (Verify it is after today)
- Amount
In the backend a Gift card instance is created, with the following values:
- Type: Based on G/L Item
- G/L Item: G/L item of Gift Card Category
- Payment: A new Payment Out with Payment Method of Gift Card Category and Financial account configured for Terminal Gift Card payment method
Pay with Gift Card
Modify a current payment process with Gift Card to differentiate between Product based and G/L Item based cards.
- Check expiration date and amount available
- Add a transaction to Gift card instance
- Implement a hook for OBPOS_preRemovePayment to remove Gift card instance transaction when a payment is removed.
- Implement a hook for OBPOS_PreAddPaymentButton to abort normal payment preprocessing.
Reimbursed
Add a new button (Gift Card Reimbursed) in Cash Management window to select a Gift Card it will be reimbursed
- Verify the selected Gift Card have reimbursable mark on the Gift Card Category.
- Return in Cash the remaining amount
Hooks
Create the following hooks (in org.openbravo.retail.posterminal module):
- OBPOS_PreAddPaymentButton
- Executed when: When toolbar payment tab is initialized
- Arguments:
- payment: Payment method information
- sidebuttons: Payment buttons
- Arguments for callback:
- cancelOperation: If this property is added to the arguments and the value of this property is true, the callback will not add the payment method.
- OBPOS_preRemovePayment
- Executed when: A payment is removed from Payment Tab
- Arguments:
- paymentToRem: Payment to be removed
- payments: Payments list
- receipt: The current order
- Arguments for callback:
- cancellation: If this property is added to the arguments and the value of this property is true, the callback will not remove the payment method.
- OBPOS_AddButtonToCashManagement
- Executed when: When Cash Management window is initialized
- Arguments:
- context: Enyo component which manages the event
- buttons: Array of buttons will be added to right panel of Cash Management window. Hook implementations must be pushed a button into this array
- OBPOS_preReversePayment
- Executed when: Before a reverse payment is created
- Arguments:
- paymentToReverse: Payment to be reversed
- payments: Payments list
- receipt: The current order
- Arguments for callback:
- cancelOperation: If this property is added to the arguments and the value of this property is true, the callback will not reverse the payment.
Create the following hooks (in org.openbravo.retail.giftcards module):
- GCNV_PreFindGiftCard
- Executed when: Before search a giftcard in the backend
- Arguments:
- giftcardid: Giftcard identifier to search
- giftcard: Giftcard model
- Arguments for callback:
- cancellation: If this property is added to the arguments and the value of this property is true, the callback will not find gifcard.
- GCNV_PostFindGiftCard
- Executed when: After search a giftcard in the backend
- Arguments:
- giftcard: Giftcard found
- Arguments for callback:
- cancellation: If this property is added to the arguments and the value of this property is true, the callback will not show gifcard detail dialog.