Columns
| Column | Type | Size | Nulls | Auto | Default | Children | Parents | Comments | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| id | int4 | 10 | √ | null |
|
|
||||||||||||||
| folio_item | int4 | 10 | null |
|
|
|||||||||||||||
| 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 |
|
|
||||||||||||||
| 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 |
|
|
||||||||||||||
| voided | bool | 1 | false |
|
|
|||||||||||||||
| splitted | bool | 1 | false |
|
|
|||||||||||||||
| splitted_src | int4 | 10 | √ | null |
|
|
||||||||||||||
| transfer_in | bool | 1 | false |
|
|
|||||||||||||||
| transfer_src | int4 | 10 | √ | null |
|
|
||||||||||||||
| transfer_out | bool | 1 | false |
|
|
|||||||||||||||
| transfer_des | int4 | 10 | √ | null |
|
|
||||||||||||||
| original_folio_id | int4 | 10 | √ | null |
|
|
||||||||||||||
| post_flag | bpchar | 1 | √ | null |
|
|
||||||||||||||
| tax_code | t_code20 | 24 | √ | null |
|
|
||||||||||||||
| 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 |
|
|
|||||||||||||||
| advance_post | bool | 1 | √ | (charge_date > post_date) |
|
|
||||||||||||||
| details | jsonb | 2147483647 | √ | null |
|
|
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_transfer_des | Performance | Asc | transfer_des |
| idx_transactions_transfer_src | Performance | Asc | transfer_src |



