acq.invoice
|
Deferrable Constraints: The following FK constraints are deferrable — they are checked at transaction end, not statement end: |
|
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_id_seq'::regclass) |
|
receiver FK |
|
No |
||
provider FK |
|
No |
||
shipper FK |
|
No |
||
recv_date |
|
No |
now() |
|
recv_method FK |
|
No |
'EDI'::text |
|
inv_type |
|
Yes |
||
inv_ident |
|
No |
||
payment_auth |
|
Yes |
||
payment_method FK |
|
Yes |
||
note |
|
Yes |
||
close_date |
|
Yes |
||
closed_by FK |
|
Yes |
Foreign Keys
| Column(s) | References | On Delete | On Update | Deferrable | Constraint |
|---|---|---|---|---|---|
|
NO ACTION |
NO ACTION |
DEFERRED |
|
|
|
NO ACTION |
NO ACTION |
DEFERRED |
|
|
|
NO ACTION |
NO ACTION |
No |
|
|
|
NO ACTION |
NO ACTION |
No |
|
|
|
NO ACTION |
NO ACTION |
No |
|
|
|
NO ACTION |
NO ACTION |
No |
|
Indexes
| Index | Method | Definition |
|---|---|---|
|
btree |
|
|
btree |
|
Triggers
| Trigger | Timing | Event | Level | Function |
|---|---|---|---|---|
|
AFTER |
DELETE OR UPDATE |
ROW |
Trigger Bodies
audit_acq_invoice_update_trigger
Function: auditor.audit_acq_invoice_func()
Timing: AFTER DELETE OR UPDATE ROW
BEGIN
INSERT INTO auditor.acq_invoice_history ( audit_id, audit_time, audit_action, audit_user, audit_ws, id, receiver, provider, shipper, recv_date, recv_method, inv_type, inv_ident, payment_auth, payment_method, note, close_date, closed_by )
SELECT nextval('auditor.acq_invoice_pkey_seq'),
now(),
SUBSTR(TG_OP,1,1),
eg_user,
eg_ws,
OLD.id, OLD.receiver, OLD.provider, OLD.shipper, OLD.recv_date, OLD.recv_method, OLD.inv_type, OLD.inv_ident, OLD.payment_auth, OLD.payment_method, OLD.note, OLD.close_date, OLD.closed_by
FROM auditor.get_audit_info();
RETURN NULL;
END;