Table core.sales_taxes
Details on sales tax.
# Column Name Nullable Data Type Max Length Description
1sales_tax_idinteger0Primary key of the table, which is also a serial field.
2tax_master_idinteger0Foreign key to the table core.tax_master.
3office_idinteger0Foreign key to the table office.offices.
4sales_tax_codecharacter varying24The code given to the sales tax.
5sales_tax_namecharacter varying50The name given to the sales tax, which is also a unique field.
6is_exemptionboolean0
7tax_base_amount_type_codecharacter varying12Foreign key to the table core.tax_base_amount_types.
8ratedecimal_strict20Sales tax rate.
9audit_user_idinteger0Contains the id of the user who last inserted or updated the corresponding row.
10audit_tstimestamp with time zone0Contains the date and timestamp of the last insert or update action.

Foreign Keys

# Column Name Key Name References
2 tax_master_id sales_taxes_tax_master_id_fkey core.tax_master.tax_master_id
3 office_id sales_taxes_office_id_fkey office.offices.office_id
7 tax_base_amount_type_code sales_taxes_tax_base_amount_type_code_fkey core.tax_base_amount_types.tax_base_amount_type_code
9 audit_user_id sales_taxes_audit_user_id_fkey office.users.user_id

Indices

Index Name Owner Access Method Definition Description
sales_taxes_pkey postgres btree sales_tax_id
sales_taxes_sales_tax_name_uix postgres btree office_id upper(sales_tax_name::text)
sales_taxes_sales_tax_code_uix postgres btree office_id upper(sales_tax_code::text)

Check Constraints

Constraint Name Description
taxes_is_exemption_chk
CHECK ( CASE WHEN is_exemption = true THEN rate::numeric = 0::numeric ELSE NULL::boolean END)

Default Values

# Column Name Default
1 sales_tax_id nextval('core.sales_taxes_sales_tax_id_seq'::regclass)
6 is_exemption false
7 tax_base_amount_type_code 'P'::character varying
8 rate 0
10 audit_ts now()

Triggers

Trigger Name Targets On Event Timing Condition Order Orientation Description