View source | View content page | Page history | Printable version   
Toolbox
Main Page
Upload file
What links here
Recent changes
Help

PDF Books
Show collection (0 pages)
Collections help

Search

Projects:DigitalCoupons/Technical Documentation

Contents

Introduction

The following document explains the technical structure of the Digital Coupons for Retail module.

Digital Coupons are coupons that can be accepted in Web POS as a payment method. These coupons include the following information: Issuing company code, coupon number, expiration date and amount.


Back to Main Project page

Module Definition

Name: Digital Coupons for Retail Repository: https://code.openbravo.com/erp/pmods/org.openbravo.retail.digitalcoupons Java Package: org.openbravo.retail.digitalcoupons DB prefix: OBDICO

Application Dictionary Modifications

A new field has been added to the OBPOS_APP_PAYMENT_TYPE table: Name: EM_OBDICO_ISDIGITALCOUPON; Type: char(1).

The following tables have been created:

1. Name: OBDICO_DIGITALCOUPONS

Columns:

Constraints:

Indexes:


2. Name: OBDICO_ISSUING_COMPANY

Columns:

Constraints:

3. Name: OBDICO_ISSUING_COMP_ACCOUNT

Columns:

Constraints:

OBDICO_ICA_ORG_UNI: Unique(AD_CLIENT_ID, AD_ORG_ID, OBDICO_ISSUING_COMPANY_ID)

4. Name: OBDICO_SUBTYPE

Columns:

Constraints:

Indexes:


Based on the mentioned tables, the following windows and tabs have been created:


Processes

DigitalCouponsOrderLoaderHook

This process is in charge of iterating the synchronized order’s payments and creating the necessary entries on the OBDICO_DIGITALCOUPONS table.

Client Components Structure

OBDICO.UI.ModalDigitalCoupons

The main modal dialog is defined on the kind OBDICO.UI.ModalDigitalCoupons. This kind provides an infrastructure to extend its components from external modules.


The components included by default on the popup are the Details Header (kind: OBDICO_DetailHeader), the Manual Mode (kind: OBDICO_ManualMode) and the List Mode (kind: OBDICO_CouponList).


There are two visibility modes for the popup: a add coupon/manual mode (from which new coupons can be added to the ticket) and a list mode (from which the coupon list can be viewed). Depending on the visibility mode, not all fields and buttons are shown.

For external fields and buttons, there are several arrays to allow complete customization of their visibility:

This kind implements the following methods:

OBDICO_DetailHeader

This kind implements the header shown on the popup, both in Manual Mode and on List mode. This header includes the following information:

The kind implements the following functions:

OBDICO_CouponList

This kind implements the list of coupons shown in list view. By default it is only visible in list view.

It implements the following function:

OBDICO_CouponListElement

This kind implements a coupon element/model on the coupon list (View List mode). This component includes a list of values to be shown, and a button to remove the coupon from the payment.

The values shown on the component can be extended or modified using the valueArray element of the component (accessed via OBDICO_CouponListElement.prototype.valueArray). Currently printed values are:

Special elements used on the valueArray element:

All meaningful values define a printValue function, which returns how the value will be shown.

OBDICO_ManualMode

This kind defines the Manual view, which allows to add coupons to the payment. The components of this kind are defined as part of an array (newAttributes), which allows extensions from external modules. Currently shown fields are Issuing Company (kind: OBDICO.UI.IssuingCompany), Check Number (kind: OBDICO.UI.Checknumber), Amount (kind: OBDICO.UI.Amount) and Expiration Date (kind: OBDICO.UI.ExpirationDate).

This kind implements the following methods:

Fields added to the newAttributes array may implement the following fields and methods:

Buttons of the main popup

By default, the following buttons are included on the popup definition:

Retrieved from "http://wiki.openbravo.com/wiki/Projects:DigitalCoupons/Technical_Documentation"

This page has been accessed 53 times. This page was last modified on 13 July 2017, at 15:18. Content is available under Creative Commons Attribution-ShareAlike 2.5 Spain License.