vivipos order schema release 1 2 x rev 1 2 1

56
VIVIPOS Database Schema for Orders Release 1.2.x Page 1 of 56

Upload: racklin

Post on 22-Nov-2014

1.314 views

Category:

Technology


1 download

DESCRIPTION

VIVIPOS ORDER Schema

TRANSCRIPT

Page 1: Vivipos Order Schema Release 1 2 X Rev 1 2 1

VIVIPOS

Database Schema for Orders

Release 1.2.x

Page 1 of 45

Page 2: Vivipos Order Schema Release 1 2 X Rev 1 2 1

Rev 1.2.1

October 21, 2009

Page 2 of 45

Page 3: Vivipos Order Schema Release 1 2 X Rev 1 2 1

Table of Content1. CASHDRAWER_RECORDS 5

2. CLOCK_STAMPS 7

3. LEDGER_RECEIPTS 8

4. LEDGER_RECORDS 9

5. ORDER_ADDITIONS 11

6. ORDER_ANNOTATIONS 13

7. ORDER_ITEM_CONDIMENTS 14

8. ORDER_ITEM_TAXES 15

9. ORDER_ITEMS 17

10. ORDER_OBJECTS 20

Page 3 of 45

Page 4: Vivipos Order Schema Release 1 2 X Rev 1 2 1

11. ORDER_PAYMENTS 21

12. ORDER_PROMOTIONS 24

13. ORDER_QUEUES 26

14. ORDER_RECEIPTS 28

15. ORDERS 29

16. SHIFT_CHANGE_DETAILS 33

17. SHIFT_CHANGES 35

18. SHIFT_MARKERS 37

19. SYNC_REMOTE_MACHINES 38

20. SYNCS 38

21. UNIFORM_INVOICE_MARKERS (FOR TAIWAN MARKET) 40

22. UNIFORM_INVOICES (FOR TAIWAN MARKET) 41

Page 4 of 45

Page 5: Vivipos Order Schema Release 1 2 X Rev 1 2 1

Page 5 of 45

Page 6: Vivipos Order Schema Release 1 2 X Rev 1 2 1

1.cashdrawer_records

Stores cash drawer activities

# NAME TYPE DEFAULT DESCRIPTION

1 id VARCHAR NOT NULL globally unique record id

2 terminal_no VARCHAR NULL terminal number where the cash drawer operation took place

3 drawer_no INTEGER NULL drawer ID (currently 1 or 2)

4 clerk VARCHAR NULL username of the operator who initiated the cash drawer operation

(value from vivipos.users.username)

5 clerk_displayname VARCHAR NULL display name of the operator who initiated the cash drawer operation

(value from vivipos.users.displayname)

6 event_type VARCHAR NULL reason for cashdrawer action:

- payment

- finalization

- nosale

- shift change

Page 6 of 45

Page 7: Vivipos Order Schema Release 1 2 X Rev 1 2 1

7 status INTEGER NULL result of the cashdrawer operation:

- 0: failed

- 1: successful

8 payment_type VARCHAR NULL type of payment (present only for event types of payment and

finalization):

- cash

- creditcard

- giftcard

- coupon

- check

9 amount FLOAT NULL amount of payment (present only for event types of payment and

finalization

10 sequence VARCHAR NULL order sequence number (present only for event types of payment and

finalization)

11 order_id VARCHAR NULL foreign key into the master order record in table ‘orders’ column ‘id’

(present only for event types of payment and finalization)

12 created INTEGER NULL record creation timestamp (unix time)

13 modified INTEGER NULL record last modified timestamp (unix time)

Page 7 of 45

Page 8: Vivipos Order Schema Release 1 2 X Rev 1 2 1

2.clock_stamps

Stores employee clockin/out logs

# NAME TYPE DEFAULT DESCRIPTION

1 id VARCHAR NOT NULL globally unique record id

2 username VARCHAR NULL employee’s username

3 displayname VARCHAR NULL employee’s display name

4 job VARCHAR NULL job name

5 clockin BOOL NULL 1 if user has clocked in the current job; 0 otherwise

6 clockout BOOL NULL 1 if user has clocked out of the current job; 0 otherwise

7 clockin_time VARCHAR NULL string representation (‘yyyy-MM-dd HH:mm:ss’) of clock-in

time

8 clockout_time VARCHAR NULL string representation (‘yyyy-MM-dd HH:mm:ss’) of clock-out

time

9 branch_id VARCHAR NULL branch ID of the store

10 created INTEGER NULL record creation timestamp (unix time)

Page 8 of 45

Page 9: Vivipos Order Schema Release 1 2 X Rev 1 2 1

11 modified INTEGER NULL record last modified timestamp (unix time)

Page 9 of 45

Page 10: Vivipos Order Schema Release 1 2 X Rev 1 2 1

3.ledger_receipts

Stores ledger receipts (non-sale cash in/out)

# NAME TYPE DEFAULT DESCRIPTION

1 id VARCHAR NOT NULL globally unique record id

2 ledger_id VARCHAR NOT NULL foreign key into the corresponding ledger record on

table ‘ledger_records’ column ‘id’

3 printer VARCHAR NULL the receipt device number where the receipt is printed

4 created INTEGER NULL record creation timestamp (unix time)

5 modified INTEGER NULL record last modified timestamp (unix time)

Page 10 of 45

Page 11: Vivipos Order Schema Release 1 2 X Rev 1 2 1

4.ledger_records

Stores ledger entries (non-sale cash in/out)

# NAME TYPE DEFAULT DESCRIPTION

1 id VARCHAR NULL globally unique record id

2 type VARCHAR NULL type of ledger entry

3 description VARCHAR NULL user-provided description for this ledger entry

4 mode VARCHAR NULL whether this ledger entry is for money in or out of cash

drawer; allowed values are ‘IN’ (into cashdrawer) and

‘OUT’ (out of cashdrawer)

5 amount FLOAT NULL amount of the ledger entry

6 terminal_no VARCHAR NULL terminal number where the ledger entry was registered

7 sale_period INTEGER NULL sale period during which the ledger entry was

registered

8 shift_number INTEGER NULL shift number during which the ledger entry was

registered

Page 11 of 45

Page 12: Vivipos Order Schema Release 1 2 X Rev 1 2 1

9 service_clerk VARCHAR NULL username of the clerk that registered the ledger entry

10 service_clerk_displayname VACHAR NULL display name of the clerk that registered the ledger

entry

11 created INTEGER NULL record creation timestamp (unix time)

12 modified INTEGER NULL record last modified timestamp (unix time)

Page 12 of 45

Page 13: Vivipos Order Schema Release 1 2 X Rev 1 2 1

5.order_additions

Stores transaction discounts and surcharges registered against an order; discounts and surcharges applied against items are not stored here

# NAME TYPE DEFAULT DESCRIPTION

1 id VARCHAR NOT NULL globally unique record id

2 order_id VARCHAR NULL foreign key into the master order record on table

‘orders’ column ‘id’

3 tax_name VARCHAR NULL name of the tax to apply for this discount/surcharge

(currently not implemented)

4 tax_rate FLOAT NULL tax rate to apply for this discount/surcharge (currently

not implemented)

5 tax_type VARCHAR NULL type of tax to apply for this discount/surcharge

(currently not implemented)

6 current_tax FLOAT NULL applicable add-on tax amount (currently not

implemented)

7 discount_name VARCHAR NULL user-defined name assigned to the discount

Page 13 of 45

Page 14: Vivipos Order Schema Release 1 2 X Rev 1 2 1

8 discount_rate FLOAT NULL discount rate (percentage for discounts of type %,

absolute amount for discounts of type $)

9 discount_type VARCHAR NULL type of discount:

- %: percentage discount

- $: absolute amount

10 current_discount FLOAT NULL discount amount

11 surcharge_name VARCHAR NULL user-defined name assigned to the surcharge

12 surcharge_rate FLOAT NULL surcharge rate (percentage for surcharge of type %,

absolute amount for surcharge of type $)

13 surcharge_type VARCHAR NULL type of discount:

- %: percentage surcharge

- $: absolute amount

14 current_surcharge FLOAT NULL surcharge amount

15 has_discount BOOL NULL (not used)

16 has_surcharge BOOL NULL (not used)

17 created INTEGER NULL record creation timestamp (unix time)

18 modified INTEGER NULL record last modified timestamp (unix time)

Page 14 of 45

Page 15: Vivipos Order Schema Release 1 2 X Rev 1 2 1

6.order_annotations

Stores annotations registered against an order

# NAME TYPE DEFAULT DESCRIPTION

1 id VARCHAR NOT NULL globally unique record id

2 type VARCHAR NOT NULL type of annotations (types are stored in preferences and

not in database)

3 text VARCHAR NOT NULL annotation text

4 order_id VARCHAR NULL foreign key into the master order record in table

‘orders’ column ‘id’

5 created INTEGER NULL record creation timestamp (unix time)

6 modified INTEGER NULL record last modified timestamp (unix time)

Page 15 of 45

Page 16: Vivipos Order Schema Release 1 2 X Rev 1 2 1

7.order_item_condiments

Stores condiments registered against items in an order

# NAME TYPE DEFAULT DESCRIPTION

1 id VARCHAR NOT NULL globally unique record id

2 order_id VARCHAR NOT NULL foreign key into the master order record in table

‘orders’ column ‘id’

3 item_id VARCHAR NOT NULL foreign key into the order item record in table

‘order_items’ column ‘id’

4 name VARCHAR NULL condiment name

5 price FLOAT NULL condiment price

6 created INTEGER NULL record creation timestamp (unix time)

7 modified INTEGER NULL record last modified timestamp (unix time)

Page 16 of 45

Page 17: Vivipos Order Schema Release 1 2 X Rev 1 2 1

8.order_item_taxes

Stores detailed taxes for items, promotions, and orders

# NAME TYPE DEFAULT DESCRIPTION

1 id VARCHAR NOT NULL globally unique record id

2 order_id VARCHAR NOT NULL foreign key into the master order record that this tax

entry applies to on table ‘orders’ column ‘id’

3 order_item_id VARCHAR NULL foreign key into the order item record that this tax entry

applies to on table ‘order_items’ column ‘id’

(this field will be blank for order and promotion tax

details)

4 promotion_id VARCHAR NULL foreign key into the order promotion record that this tax

entry applies to in table ‘order_promotions’ column ‘id’

(this field will be blank for order and item tax details)

5 tax_no VARCHAR NOT NULL tax number

6 tax_name VARCHAR NOT NULL tax name

Page 17 of 45

Page 18: Vivipos Order Schema Release 1 2 X Rev 1 2 1

7 tax_type VARCHAR NOT NULL tax type (ADDON or INCLUDED)

8 tax_rate FLOAT NOT NULL tax rate (percentage for tax rate type %, absolute

amount for tax rate type $)

9 tax_rate_type VARCHAR NOT NULL type of discount:

- %: percentage surcharge

$: absolute amount

10 tax_threshold FLOAT NOT NULL tax threshold

11 tax_subtotal FLOAT NULL add-on tax amount

12 included_tax_subtotal FLOAT NULL included tax amount

13 item_count INTEGER 0 number of items subject to this tax (present only for

order tax details)

14 taxable_amount FLOAT 0 sales amount subject to this tax

Page 18 of 45

Page 19: Vivipos Order Schema Release 1 2 X Rev 1 2 1

9.order_items

Stores individual sale items

# NAME TYPE DEFAULT DESCRIPTION

1 id VARCHAR NOT NULL globally unique record id

2 order_id VARCHAR NULL foreign key into the master order record in table

‘orders’ column ‘id’

3 cate_no VARCHAR NULL department number

4 included_tax FLOAT NULL total included tax amount due on item

5 cate_name VARCHAR NULL department name

6 product_no VARCHAR NULL product number (department number for sale-able

departments)

7 product_barcode VARCHAR NULL product barcode

8 product_name VARCHAR NULL product name (department name for sale-able

departments)

9 current_qty FLOAT NULL quantity

Page 19 of 45

Page 20: Vivipos Order Schema Release 1 2 X Rev 1 2 1

10 current_price FLOAT NULL unit price

11 current_subtotal FLOAT NULL subtotal (including condiment subtotal) before item

discount/surcharge

12 tax_name VARCHAR NULL name of the tax to apply for this discount/surcharge

13 tax_rate FLOAT NULL tax rate to apply for this discount/surcharge

14 tax_type VARCHAR NULL type of tax to apply for this discount/surcharge

15 current_tax FLOAT NULL applicable add-on tax amount

16 discount_name VARCHAR NULL user-defined name assigned to the discount

17 discount_rate FLOAT NULL discount rate (percentage for discounts of type %,

absolute amount for discounts of type $)

18 discount_type VARCHAR NULL type of discount:

- %: percentage discount

- $: absolute amount

19 current_discount FLOAT NULL discount amount

20 surcharge_name VARCHAR NULL user-defined name assigned to the surcharge

21 surcharge_rate FLOAT NULL surcharge rate (percentage for surcharge of type %,

absolute amount for surcharge of type $)

22 surcharge_type VARCHAR NULL type of discount:

- %: percentage surcharge

- $: absolute amount

23 current_surcharge FLOAT NULL surcharge amount

24 condiments VARCHAR NULL string containing comma-separated list of condiments

Page 20 of 45

Page 21: Vivipos Order Schema Release 1 2 X Rev 1 2 1

25 current_condiment FLOAT NULL subtotal from condiments

26 memo TEXT NULL memo registered against the item

27 has_discount BOOL NULL 1 if discount has been registered against the item; 0

otherwise

28 has_surcharge BOOL NULL 1 if surcharge has been registered against the item; 0

otherwise

29 has_marker BOOL NULL 1 if a marker (subtotal, total, or tray marker) has been

registered against the item; 0 otherwise

30 destination VARCHAR NULL item destination

31 parent_no VARCHAR NULL product number of the set menu (present only if this

item is ordered as part of a set menu)

32 weight FLOAT 0 for scale items, the weight of the item sold, in item’s

sale unit

33 sale_unit VARCHAR ‘unit’ the unit the product is sold under

34 seat_no VARCHAR NULL the seat number the item is registered against (currently

unused)

35 parent_index VARCHAR NULL foreign key into the order item record that this item is a

set menu component of in table ‘order_items’ column

‘id’ (present only if this item is ordered as part of a set

menu)

36 has_setitems BOOLEAN 0 1 if this item is a set menu; 0 otherwise

37 stock_maintained BOOLEAN NULL 1 if stock level has been adjusted for this item; 0

Page 21 of 45

Page 22: Vivipos Order Schema Release 1 2 X Rev 1 2 1

otherwise

38 created INTEGER NULL record creation timestamp (unix time)

39 modified INTEGER NULL record last modified timestamp (unix time)

10. order_objects

Stores serialized transaction objects representing stored orders

# NAME TYPE DEFAULT DESCRIPTION

1 id VARCHAR NOT NULL globally unique record id

2 order_id VARCHAR NULL foreign key into the master order record in table

‘orders’ column ‘id’

3 object TEXT NULL serialized transaction object

4 created INTEGER NULL record creation timestamp (unix time)

5 modified INTEGER NULL record last modified timestamp (unix time)

Page 22 of 45

Page 23: Vivipos Order Schema Release 1 2 X Rev 1 2 1

11. order_payments

Stores payments registered against an order

# NAME TYPE DEFAULT DESCRIPTION

1 id VARCHAR NULL globally unique record id

2 order_id VARCHAR NULL foreign key into the master order

record in table ‘orders’ column ‘id’

3 order_items_count INTEGER NULL number of items in the order at the

time when the payment is made

4 order_total FLOAT NULL total amount of the order at the time

when the payment is made

5 name VARCHAR NULL payment type:

- cash

- check

- coupon

- creditcard

Page 23 of 45

Page 24: Vivipos Order Schema Release 1 2 X Rev 1 2 1

- giftcard

6 amount FLOAT NULL payment amount, in local currency.

When paying with giftcard, if the

giftcard face value is larger than

amount due, only the amount due is

recorded here (because no change will

be given for giftcard payments)

7 memo1 TEXT NULL payment subtype; this is taken from

the parameter assigned to the payment

function key and is used to further

define payment type; for cash payment

in local currency, this field is NULL.

8 memo2 TEXT NULL operator remarks registered against the

payment

9 origin_amount FLOAT NULL original payment amount, in actual

tendered currency. If the payment type

is giftcard, this will be the actual face

value of the giftcard

10 service_clerk VARCHAR NULL username of the clerk who registered

the payment

11 service_clerk_displayname VARCHAR NULL display name of the clerk who

registered the payment

Page 24 of 45

Page 25: Vivipos Order Schema Release 1 2 X Rev 1 2 1

12 proceeds_clerk VARCHAR NULL username of the clerk who registered

the payment (recorded only if the

payment finalizes the order)

13 proceeds_clerk_displayname VARCHAR NULL display name of the clerk who

registered the payment (recorded only

if the payment finalizes the order)

14 change FLOAT NULL amount of change given

15 sale_period INTEGER NULL the sale period in which the payment

was registered

16 shift_number INTEGER NULL the shift number in which the payment

was registered

17 terminal_no VARCHAR NULL terminal number where the payment

was registered

18 is_groupable BOOL 0 1 if this payment should be grouped

with other groupable payments of the

same name and amount from the same

shift for shift change reporting

purposes; 0 otherwise

19 created INTEGER NULL record creation timestamp (unix time)

20 modified INTEGER NULL record last modified timestamp (unix

time)

Page 25 of 45

Page 26: Vivipos Order Schema Release 1 2 X Rev 1 2 1

12. order_promotions

Stores detailed information on promotion rules that were triggered on an order

# NAME TYPE DEFAULT DESCRIPTION

1 id VARCHAR NOT NULL globally unique record id

2 order_id VARCHAR NULL foreign key into the master order record in table ‘orders’

column ‘id’

3 promotion_id TEXT NULL foreign key into the master promotions record in table

‘promotions’ column ‘id’

4 name VARCHAR NULL the name of the triggered promotions rule (taken from

vivipos.promotions)

5 code VARCHAR NULL the code of the triggered promotions rule (taken from

vivipos.promotions)

6 alt_name1 VARCHAR NULL alternate name of the triggered promotions rule (taken

from vivipos.promotions)

7 alt_name2 VARCHAR NULL second alternate name of the triggered promotions rule

Page 26 of 45

Page 27: Vivipos Order Schema Release 1 2 X Rev 1 2 1

(taken from vivipos.promotions)

8 trigger VARCHAR NULL id of the trigger

9 trigger_name VARCHAR NULL internal name of the trigger

10 trigger_label VARCHAR NULL display name of the trigger

11 type VARCHAR NULL id of the promotion type

12 type_name VARCHAR NULL internal name of the promotion type

13 type_label VARCHAR NULL display name of the promotion type

14 matched_amount INTEGER NULL number of times the rule was triggered

15 matched_items_qty INTEGER NULL quantity of items consumed by the trigger

16 matched_items_subtotal FLOAT NULL total price of consumed items (before any

discount/surcharge)

17 discount_subtotal FLOAT NULL amount of promotion

18 tax_name VARCHAR NULL name of applicable tax on this promotion

19 current_tax FLOAT NULL amount of add-on tax applicable on this promotion

20 included_tax FLOAT NULL amount of included tax applicable on this promotion

21 created INTEGER NULL record creation timestamp (unix time)

22 modified INTEGER NULL record last modified timestamp (unix time)

Page 27 of 45

Page 28: Vivipos Order Schema Release 1 2 X Rev 1 2 1

13. order_queues

Stores queued orders

# NAME TYPE DEFAULT DESCRIPTION

1 id VARCHAR NOT NULL globally unique record id

if a queued order is later stored into the orders table

(when it’s recalled and finalized, stored, or cancelled),

that order record will have the same id as this queued

order record

2 user VARCHAR NULL foreign key into the master user record in table ‘users’

column ‘username’

3 seq VARCHAR NULL sequence number of the queued order

4 status INTEGER NULL 1 if order is active; -1 if order has been recalled into the

shopping cart

5 mode INTEGER NULL 1 if order is queued in normal mode, 0 if queued in

Page 28 of 45

Page 29: Vivipos Order Schema Release 1 2 X Rev 1 2 1

training mode

6 summary TEXT NULL a short textual summary (sequence number, list of

items and quantities, and total)

7 object TEXT NULL serialized transaction object

8 created INTEGER NULL record creation timestamp (unix time)

9 modified INTEGER NULL record last modified timestamp (unix time)

Page 29 of 45

Page 30: Vivipos Order Schema Release 1 2 X Rev 1 2 1

14. order_receipts

Stores records of printed receipts

# NAME TYPE DEFAULT DESCRIPTION

1 id VARCHAR NOT NULL globally unique record id

2 order_id VARCHAR NULL foreign key into the master order record in table

‘orders’ column ‘id’

3 sequence VARCHAR NULL sequence number of the order associated with the

receipt

4 device INTEGER NULL the receipt device number where the receipt was

printed

5 batch INTEGER NULL the order batch number for which the printed was

printed

6 created INTEGER NULL record creation timestamp (unix time)

7 modified INTEGER NULL record last modified timestamp (unix time)

Page 30 of 45

Page 31: Vivipos Order Schema Release 1 2 X Rev 1 2 1

15. orders

Stores master records of individual orders

# NAME TYPE DEFAULT DESCRIPTION

1 id VARCHAR NOT NULL globally unique record id

2 sequence VARCHAR NULL order sequence number

3 items_count INTEGER NULL number of item entries in order

4 total FLOAT NULL total amount due (after discounts,

surcharges, and taxes)

5 change FLOAT NULL amount of change due

6 tax_subtotal FLOAT NULL amount of add-on tax due

7 surcharge_subtotal FLOAT NULL total amount of surcharges (item +

transaction)

8 discount_subtotal FLOAT NULL total amount of discounts (item +

transaction)

9 payment_subtotal FLOAT NULL actual payment amount received

10 rounding_prices VARCHAR NULL algorithm used for rounding prices

Page 31 of 45

Page 32: Vivipos Order Schema Release 1 2 X Rev 1 2 1

11 precision_prices VARCHAR NULL precision used for rounding prices

12 rounding_taxes VARCHAR NULL algorithm used for rounding taxes

13 precision_taxes VARCHAR NULL precision used for rounding taxes

14 status INTEGER NULL order status:

- -2: voided

- -1; cancelled

- 1: completed

- 2: stored

15 service_clerk VARCHAR NULL username of the clerk that opened the

order

16 service_clerk_displayname VARCHAR NULL display name of the clerk that opened

the order

17 proceeds_clerk VARCHAR NULL username of the clerk that finalized the

order

18 proceeds_clerk_displayname VARCHAR NULL display name of the clerk that finalized

the order

19 member VARCHAR NULL member ID

20 member_displayname VARCHAR NULL member’s display name

21 member_email VARCHAR NULL member’s email

22 member_cellphone VARCHAR NULL member’s contact number

23 invoice_type VARCHAR NULL invoice type

24 invoice_title VARCHAR NULL invoice title

Page 32 of 45

Page 33: Vivipos Order Schema Release 1 2 X Rev 1 2 1

25 invoice_no VARCHAR NULL invoice number

26 invoice_count INTEGER NULL number of pages in invoice

27 destination VARCHAR NULL order destination

28 table_no INTEGER NULL table number

29 check_no INTEGER NULL check number

30 no_of_customers INTEGER NULL number of customers

31 terminal_no VARCHAR NULL terminal number where the order was

last modified

32 transaction_created INTEGER NULL order created timestamp (unix time)

33 transaction_submitted INTEGER NULL order store/finalization timestamp

(unix time)

34 included_tax_subtotal FLOAT NULL total amount of applicable included

tax(es)

35 item_subtotal FLOAT NULL total due before discounts, surcharges,

and taxes

36 sale_period INTEGER NULL sale period in which the order was

stored or finalized

37 shift_number INTEGER NULL shift number in which the order was

stored or finalized

38 branch_id VARCHAR NULL store branch id

39 branch VARCHAR NULL store branch name

41 transaction_voided INTEGER NULL order voided timestamp (unix time)

Page 33 of 45

Page 34: Vivipos Order Schema Release 1 2 X Rev 1 2 1

40 promotion_subtotal FLOAT NULL total amount of applicable promotions

42 void_clerk VARCHAR NULL username of the clerk that voided this

order

43 void_clerk_displayname VARCHAR NULL display name of the clerk that voided

this order

44 void_sale_period INTEGER NULL sale period in which this order was

voided

45 void_shift_number INTEGER NULL shift number in which this order was

voided

46 revalue_subtotal FLOAT NULL amount of adjustments made to order

total due to revalue

47 qty_subtotal INTEGER NULL total quantity of items registered in the

order

48 inherited_order_id VARCHAR NULL

49 inherited_desc VARCHAR NULL

50 item_surcharge_subtotal FLOAT NULL total amount of surcharges applied on

items

51 trans_surcharge_subtotal FLOAT NULL total amount of surcharges applied on

the entire order (item surcharges

excluded)

52 item_discount_subtotal FLOAT NULL total amount of discounts applied on

items

Page 34 of 45

Page 35: Vivipos Order Schema Release 1 2 X Rev 1 2 1

53 trans_discount_subtotal FLOAT NULL total amount of discounts applied on

the entire order (item discounts

excluded)

54 created INTEGER NULL record creation timestamp (unix time)

55 modified INTEGER NULL record last modified timestamp (unix

time)

Page 35 of 45

Page 36: Vivipos Order Schema Release 1 2 X Rev 1 2 1

16. shift_change_details

Stores summaries of payments registered during a shift; also used to store sales amount grouped by destinations.

# NAME TYPE DEFAULT DESCRIPTION

1 id VARCHAR NULL globally unique record id

2 shift_change_id VARCHAR NULL foreign key into the master shift change record in table

‘shift_changes’ column ‘id’

3 type VARCHAR NULL payment type; in addition to standard payment types of

cash, check, coupon, creditcard, giftcard, this field may

also contain type of ‘destination’

4 amount FLOAT NULL total amount of payments registered for the given (type,

name) combination

5 name VARCHAR NULL user-defined payment sub-type

6 change FLOAT NULL amount of cash change given for non-cash types of

payments

7 excess_amount FLOAT NULL amount of excess giftcard payment (since no change is

Page 36 of 45

Page 37: Vivipos Order Schema Release 1 2 X Rev 1 2 1

given for giftcard payments)

8 count INTEGER NULL number of payments of the given (type, name)

combination

9 created INTEGER NULL record creation timestamp (unix time)

10 modified INTEGER NULL record last modified timestamp (unix time)

Page 37 of 45

Page 38: Vivipos Order Schema Release 1 2 X Rev 1 2 1

17. shift_changes

Stores various financial summaries for a shift

# NAME TYPE DEFAULT DESCRIPTION

1 id VARCHAR NULL globally unique record id

2 starttime INTEGER NULL actual start time of the shift (unix time)

3 endtime INTEGER NULL actual end time of the shift

4 balance FLOAT NULL total amount of money (including all forms of

payment) in the cashdrawer

5 note VARCHAR NULL clerk’s shift change remarks

6 terminal_no VARCHAR NULL terminal number where the shift change took place

7 sale_period INTEGER NULL the sale period

8 shift_number INTEGER NULL the shift number

9 cash FLOAT NULL total amount of cash in the cashdrawer

10 sales FLOAT NULL total amount of sales

11 excess FLOAT NULL total amount of excess giftcard payments

Page 38 of 45

Page 39: Vivipos Order Schema Release 1 2 X Rev 1 2 1

12 ledger_in FLOAT NULL amount of non-sale cash received

13 ledger_out FLOAT NULL amount of non-sale cash paid out

14 deposit FLOAT NULL amount of payments received on stored orders

15 refund FLOAT NULL amount of money paid out as refund for orders voided

in this shift

16 credit FLOAT NULL difference between sales total and payments received

from sales

17 reported_cash FLOAT NULL cash declared by clerk upon shift change/sale period

end

18 created INTEGER NULL record creation timestamp (unix time)

19 modified INTEGER NULL record last modified timestamp (unix time)

Page 39 of 45

Page 40: Vivipos Order Schema Release 1 2 X Rev 1 2 1

18. shift_markers

Stores current shift information for each terminal

# NAME TYPE DEFAULT DESCRIPTION

1 id VARCHAR NOT NULL globally unique record id

2 sale_period VARCHAR NULL sale period

3 shift_number VARCHAR NULL shift number

4 end_of_period BOOL NULL 1 if the current sale period has ended; 0 otherwise

5 end_of_shift BOOL NULL 1 if the current shift has ended; 0 otherwise

6 end_of_shift_cash VARCHAR NULL serialized payment object representing change left in

cash drawer from previous shift

7 terminal_no VARCHAR NULL indicates which terminal this shift marker is for

8 created INTEGER NULL record creation timestamp (unix time)

9 modified INTEGER NULL record last modified timestamp (unix time)

Page 40 of 45

Page 41: Vivipos Order Schema Release 1 2 X Rev 1 2 1

19. sync_remote_machines

This table maintains synchronization status and is for internal use only

# NAME TYPE DEFAULT DESCRIPTION

1 id INTEGER NULL

2 machine_id varchar(36) NULL

3 last_synced int NULL

Page 41 of 45

Page 42: Vivipos Order Schema Release 1 2 X Rev 1 2 1

20. syncs

This table maintains change logs for synchronization purposes and is for internal use only

# NAME TYPE DEFAULT DESCRIPTION

1 id INTEGER NULL

2 crud varchar(255) NULL

3 machine_id varchar(36) NULL

4 from_machine_id varchar(36) NULL

5 method_id varchar(36) NULL

6 method_type varchar(45) NULL

7 method_table varchar(45) NULL

8 created int NULL

9 modified int NULL

Page 42 of 45

Page 43: Vivipos Order Schema Release 1 2 X Rev 1 2 1

21. uniform_invoice_markers (for Taiwan market)

(統一發票)

Stores current uniform invoice sequence for individal terminals

# NAME TYPE DEFAULT DESCRIPTION

1 id VARCHAR NULL globally unique record id

2 code VARCHAR NULL uniform invoice code

3 seq VARCHAR NULL uniform invoice sequence number

4 terminal_no VARCHAR NULL terminal number where the uniform invoices are issued

5 reset_time INTEGER NULL time when the sequence was last reset (unix time); this

field is cleared if the last operation was not a sequence

reset

6 created INTEGER NULL record creation timestamp (unix time)

7 modified INTEGER NULL record last modified timestamp (unix time)

Page 43 of 45

Page 44: Vivipos Order Schema Release 1 2 X Rev 1 2 1

22. uniform_invoices (for Taiwan market)

(統一發票)

Stores information about uniform invoices that have been issued

# NAME TYPE DEFAULT DESCRIPTION

1 id VARCHAR NULL globally unique record id

2 order_id VARCHAR NULL foreign key into the master order record in

‘orders’ column ‘id’

3 code VARCHAR NULL uniform invoice code

4 start_seq VARCHAR NULL starting sequence number

5 end_seq VARCHAR NULL ending sequence number

6 terminal_no VARCHAR NULL terminal number where the uniform

invoice was issued

7 uniform_business_number VARCHAR NULL uniform business number

8 status INTEGER NULL status code:

Page 44 of 45

Page 45: Vivipos Order Schema Release 1 2 X Rev 1 2 1

- 1: successfully issued

- -1: voided without sale

- -2: voided with sale

9 sale_period INTEGER NULL the sale period in which the uniform

invoice was issued

10 shift_number INTEGER NULL the shift number in which the uniform

invoice was issued

11 memo VARCHAR NULL operator-filled memo field when issuing

paper receipts

12 reset_time INTEGER NULL the first receipt issued after a reset

operation will have this field populated

with the reset timestamp

13 manual BOOL 0 1 if this invoice is issued manually, 0

otherwise

14 created INTEGER NULL record creation timestamp (unix time)

15 modified INTEGER NULL record last modified timestamp (unix time)

Page 45 of 45