acq.invoice_entry
|
Cascading Deletes: Deleting rows from this table will cascade to: acq.invoice. |
|
Trigger Side Effects: Writing to this table automatically triggers writes to other tables:
|
Columns
| Column | Type | Nullable | Default | Notes |
|---|---|---|---|---|
id PK |
|
No |
nextval('acq.invoice_entry_id_seq'::regclass) |
|
invoice FK |
|
No |
||
purchase_order FK |
|
Yes |
||
lineitem FK |
|
Yes |
||
inv_item_count |
|
No |
||
phys_item_count |
|
Yes |
||
note |
|
Yes |
||
billed_per_item |
|
Yes |
||
cost_billed |
|
Yes |
||
actual_cost |
|
Yes |
||
amount_paid |
|
Yes |
Foreign Keys
| Column(s) | References | On Delete | On Update | Deferrable | Constraint |
|---|---|---|---|---|---|
|
CASCADE |
NO ACTION |
No |
|
|
|
SET NULL |
CASCADE |
No |
|
|
|
SET NULL |
CASCADE |
No |
|
Indexes
| Index | Method | Definition |
|---|---|---|
|
btree |
|
|
btree |
|
|
btree |
|
|
btree |
|
Triggers
| Trigger | Timing | Event | Level | Function |
|---|---|---|---|---|
|
AFTER |
DELETE OR UPDATE |
ROW |
Trigger Bodies
audit_acq_invoice_entry_update_trigger
Function: auditor.audit_acq_invoice_entry_func()
Timing: AFTER DELETE OR UPDATE ROW
BEGIN
INSERT INTO auditor.acq_invoice_entry_history ( audit_id, audit_time, audit_action, audit_user, audit_ws, id, invoice, purchase_order, lineitem, inv_item_count, phys_item_count, note, billed_per_item, cost_billed, actual_cost, amount_paid )
SELECT nextval('auditor.acq_invoice_entry_pkey_seq'),
now(),
SUBSTR(TG_OP,1,1),
eg_user,
eg_ws,
OLD.id, OLD.invoice, OLD.purchase_order, OLD.lineitem, OLD.inv_item_count, OLD.phys_item_count, OLD.note, OLD.billed_per_item, OLD.cost_billed, OLD.actual_cost, OLD.amount_paid
FROM auditor.get_audit_info();
RETURN NULL;
END;