transactions

1430 rows


Columns

Column Type Size Nulls Auto Default Children Parents Comments
id int4 10 √ null
bill.tran_id bill_tran_id_fkey N
charge_schedule.tran_id fk_charge_schedule_tran_id N
registration_rates.tran_id fk_registration_rates_tran_id N
transactions.transfer_des fk_transactions_transfer_des R
transactions.transfer_src fk_transactions_transfer_src R
folio_item int4 10 null
folio_items.item_id fk_transactions_folio_item R
post_type t_post_type 5 'P'::bpchar
post_date date 13 √ fn_system_date()
post_time timestamptz 35,6 √ CURRENT_TIMESTAMP
tran_type t_transaction_type 5 null
dept_id int4 10 √ null
department.id fk_transactions_dept_id R
description text 2147483647 √ null
qty int4 10 1
amount t_money 15,2 null
reference text 2147483647 √ null
remark text 2147483647 √ null
post_user text 2147483647 √ null
post_shift t_shift 14 √ null
post_source text 2147483647 √ null
card_id int4 10 √ null
credit_card.id fk_transactions_card_id R
voided bool 1 false
splitted bool 1 false
splitted_src int4 10 √ null
transfer_in bool 1 false
transfer_src int4 10 √ null
transactions.id fk_transactions_transfer_src R
transfer_out bool 1 false
transfer_des int4 10 √ null
transactions.id fk_transactions_transfer_des R
original_folio_id int4 10 √ null
post_flag bpchar 1 √ null
tax_code t_code20 24 √ null
tax.code fk_transactions_tax_code R
itemizers jsonb 2147483647 √ null
charge_date date 13 √ null
active bool 1 √ ((NOT voided) AND (NOT transfer_out))
total_amount t_money 15,2 √ ((qty)::numeric * (amount)::numeric)
acc_qty int4 10 √ CASE WHEN (transfer_out OR voided) THEN 0 ELSE qty END
acc_amount t_money 15,2 √ CASE WHEN (transfer_out OR voided) THEN (0)::numeric ELSE ((qty)::numeric * CASE tran_type WHEN 'C'::bpchar THEN (- (amount)::numeric) ELSE (amount)::numeric END) END
folio_id int4 10 null
folio.id fk_transactions_folio_id C
advance_post bool 1 √ (charge_date > post_date)
details jsonb 2147483647 √ null
vat_issued bool 1 false
vat_id int8 19 √ null
bill_id int8 19 √ null
bill.id fk_transactions_bill_id N

pos.bill.id that produced this transaction (mini POS), set by pos.sp_post_bill. Kept on the transaction (not just pos.bill.tran_id) so it survives archival to backup.transactions.

legacy_gtran_id int4 10 √ null

reference to old Fromas system (GTRAN.ID)

Indexes

Constraint Name Type Sort Column(s)
pk_transactions Primary key Asc id
idx_transactions_card_id Performance Asc card_id
idx_transactions_dept_id Performance Asc dept_id
idx_transactions_folio_id Performance Asc folio_id
idx_transactions_folio_item Performance Asc folio_item
idx_transactions_post_date Performance Asc post_date
idx_transactions_post_type Performance Asc post_type
idx_transactions_splitted_src Performance Asc splitted_src
idx_transactions_transfer_des Performance Asc transfer_des
idx_transactions_transfer_src Performance Asc transfer_src
transactions_bill_id_idx Performance Asc bill_id
unq_transactions_legacy_gtran_id Must be unique Asc legacy_gtran_id

Relationships