hr.expense_note_lines
Schema: hr
English table: hr.expense_note_lines
Italian original table: hr.in_notaspese_det
Description: Expense note line items (multi-tenant). Each row represents a single reimbursable/non-reimbursable expense line linked to an expense note.
Overview
- Columns: 31
- Primary key: id
- Outgoing foreign keys: 4
- Incoming foreign keys: 1
- Indexes: 14
Columns
| English column | Italian original column | Type | Null | Default / Generated | Description |
|---|---|---|---|---|---|
id | id | integer | NO | Surrogate primary key. | |
enl_id | nsd_id | integer | NO | Logical line identifier (unique per tenant). | |
enl_expense_note_id | nsd_ns_id | integer | NO | Expense note identifier. Intended FK to hr.expense_notes(en_id, tenant_id). | |
enl_reimbursement_type_id | nsd_rimb_id | integer | NO | Reimbursement type. FK to hr.expense_reimbursement_types(ert_id, tenant_id). | |
enl_date | nsd_data | date | NO | Expense date. | |
enl_amount | nsd_importo | numeric(10,2) | NO | Line amount (in line currency). | |
enl_is_reimbursable | nsd_da_rimborsare | boolean | NO | True if the line is reimbursable. | |
enl_is_approved | nsd_approvato | boolean | NO | Approval flag for the line. | |
enl_cost_center_id | nsd_com_id | integer | YES | Identifier of the related enl cost center record. | |
enl_cost_center_line_id | nsd_coml_id | integer | YES | Identifier of the related enl cost center line record. | |
enl_er_id | nsd_rap_id | integer | NO | Identifier of the related enl er record. | |
enl_payment_method_id | nsd_nsp_id | integer | NO | Identifier of the related enl payment method record. | |
enl_currency_id | nsd_nsv_id | integer | NO | Currency identifier. Intended FK to hr.expense_note_currencies(enc_id, tenant_id). | |
enl_paid_people_count | nsd_paid_people | integer | NO | Numeric value. | |
enl_is_client_chargeable | nsd_addebito_cliente | boolean | NO | Boolean flag. | |
enl_colleagues_list | nsd_elenco_colleghi | character varying(100) | NO | Text value. | |
enl_external_people_count | nsd_numero_esterni | integer | NO | Numeric value. | |
enl_billed_amount | nsd_importo_fatturato | numeric(10,2) | NO | Enl billed amount. | |
enl_settlement_id | nsd_rendcont_id | integer | NO | Identifier of the related enl settlement record. | |
enl_vehicle_id | nsd_auto_id | integer | NO | Identifier of the related enl vehicle record. | |
enl_amount_change | nsd_value_change | numeric(12,5) | NO | Enl amount change. | |
enl_countervalue | nsd_controvalore | numeric(12,5) | NO | Countervalue/conversion amount (e.g., base currency equivalent). | |
enl_client_invoice_line_id | nsd_incli_id | integer | YES | Identifier of the related enl client invoice line record. | |
enl_notes | nsd_note | text | NO | Free-form notes. | |
enl_client_invoice_header_id | nsd_inclise_id | integer | YES | Identifier of the related enl client invoice header record. | |
enl_custom1 | nsd_custom1 | text | NO | Text value. | |
enl_custom2 | nsd_custom2 | text | NO | Text value. | |
enl_custom3 | nsd_custom3 | text | NO | Text value. | |
tenant_id | tenant_id | integer | YES | Tenant identifier for data isolation. | |
colcustom | colcustom | jsonb | YES | '{}'::jsonb | Custom fields (JSON). |
_deleted | _deleted | boolean | YES | false | Technical soft-delete flag. |
Relationships
Outgoing foreign keys
| Constraint | Local columns | References | Referenced columns | On update | On delete |
|---|---|---|---|---|---|
fk_enl_currency_id | enl_currency_id, tenant_id | hr.expense_note_currencies | enc_id, tenant_id | RESTRICT | RESTRICT |
fk_enl_expense_note_id | enl_expense_note_id, tenant_id | hr.expense_notes | en_id, tenant_id | RESTRICT | RESTRICT |
fk_enl_reimbursement_type_id | enl_reimbursement_type_id, tenant_id | hr.expense_reimbursement_types | ert_id, tenant_id | RESTRICT | RESTRICT |
fk_enl_tenant | tenant_id | cloud.tenants | ten_internal_id | RESTRICT | CASCADE |
Referenced by
| From table | Foreign key | Source columns | Target columns |
|---|---|---|---|
hr.expense_note_attachments | fk_ena_enl_id_tenant | ena_enl_id, tenant_id | enl_id, tenant_id |
Constraints
- Primary key:
pk_expense_note_lines→id - Unique:
uk_enl_id_tenant→enl_id, tenant_id
Indexes
| Name | Unique | Method | Columns / expression |
|---|---|---|---|
idx_enl_client_invoice_header_id_tenant | NO | btree | tenant_id, enl_client_invoice_header_id) WHERE (_deleted = false |
idx_enl_client_invoice_line_id_tenant | NO | btree | tenant_id, enl_client_invoice_line_id) WHERE (_deleted = false |
idx_enl_cost_center_cost_center_line_er_id_tenant | NO | btree | tenant_id, enl_cost_center_id, enl_cost_center_line_id, enl_er_id) WHERE (_deleted = false |
idx_enl_cost_center_id_tenant | NO | btree | tenant_id, enl_cost_center_id) WHERE (_deleted = false |
idx_enl_cost_center_line_id_tenant | NO | btree | tenant_id, enl_cost_center_line_id) WHERE (_deleted = false |
idx_enl_currency_id_tenant | NO | btree | tenant_id, enl_currency_id) WHERE (_deleted = false |
idx_enl_er_id_tenant | NO | btree | tenant_id, enl_er_id) WHERE (_deleted = false |
idx_enl_expense_note_id_tenant | NO | btree | tenant_id, enl_expense_note_id) WHERE (_deleted = false |
idx_enl_id_tenant | NO | btree | tenant_id, enl_id) WHERE (_deleted = false |
idx_enl_payment_method_id_tenant | NO | btree | tenant_id, enl_payment_method_id) WHERE (_deleted = false |
idx_enl_reimbursement_type_id_tenant | NO | btree | tenant_id, enl_reimbursement_type_id) WHERE (_deleted = false |
idx_enl_settlement_id_tenant | NO | btree | tenant_id, enl_settlement_id) WHERE (_deleted = false |
idx_enl_vehicle_id_tenant | NO | btree | tenant_id, enl_vehicle_id) WHERE (_deleted = false |
idx_expense_note_lines_tenant | NO | btree | tenant_id |
Navigation
- Back to main index
- [Back to
hrindex]../)