3 SELECT evergreen.upgrade_deps_block_check('0921', :eg_version);
5 CREATE TABLE money.account_adjustment (
6 billing BIGINT REFERENCES money.billing (id) ON DELETE SET NULL
7 ) INHERITS (money.bnm_payment);
8 ALTER TABLE money.account_adjustment ADD PRIMARY KEY (id);
9 CREATE INDEX money_adjustment_id_idx ON money.account_adjustment (id);
10 CREATE INDEX money_account_adjustment_xact_idx ON money.account_adjustment (xact);
11 CREATE INDEX money_account_adjustment_bill_idx ON money.account_adjustment (billing);
12 CREATE INDEX money_account_adjustment_payment_ts_idx ON money.account_adjustment (payment_ts);
13 CREATE INDEX money_account_adjustment_accepting_usr_idx ON money.account_adjustment (accepting_usr);
15 CREATE TRIGGER mat_summary_add_tgr AFTER INSERT ON money.account_adjustment FOR EACH ROW EXECUTE PROCEDURE money.materialized_summary_payment_add ('account_adjustment');
16 CREATE TRIGGER mat_summary_upd_tgr AFTER UPDATE ON money.account_adjustment FOR EACH ROW EXECUTE PROCEDURE money.materialized_summary_payment_update ('account_adjustment');
17 CREATE TRIGGER mat_summary_del_tgr BEFORE DELETE ON money.account_adjustment FOR EACH ROW EXECUTE PROCEDURE money.materialized_summary_payment_del ('account_adjustment');
19 -- Insert new org. unit settings.
20 INSERT INTO config.org_unit_setting_type
21 (name, grp, datatype, label, description)
23 ('bill.prohibit_negative_balance_default',
26 'bill.prohibit_negative_balance_default',
27 'Prohibit negative balance on bills (DEFAULT)',
30 'bill.prohibit_negative_balance_default',
31 'Default setting to prevent negative balances (refunds) on circulation related bills',
32 'coust', 'description')
34 ('bill.prohibit_negative_balance_on_overdues',
37 'bill.prohibit_negative_balance_on_overdues',
38 'Prohibit negative balance on bills for overdue materials',
41 'bill.prohibit_negative_balance_on_overdues',
42 'Prevent negative balances (refunds) on bills for overdue materials',
43 'coust', 'description')
45 ('bill.prohibit_negative_balance_on_lost',
48 'bill.prohibit_negative_balance_on_lost',
49 'Prohibit negative balance on bills for lost materials',
52 'bill.prohibit_negative_balance_on_lost',
53 'Prevent negative balances (refunds) on bills for lost/long-overdue materials',
54 'coust', 'description')
56 ('bill.negative_balance_interval_default',
57 'finance', 'interval',
59 'bill.negative_balance_interval_default',
60 'Negative Balance Interval (DEFAULT)',
63 'bill.negative_balance_interval_default',
64 'Amount of time after which no negative balances (refunds) are allowed on circulation bills',
65 'coust', 'description')
67 ('bill.negative_balance_interval_on_overdues',
68 'finance', 'interval',
70 'bill.negative_balance_interval_on_overdues',
71 'Negative Balance Interval for Overdues',
74 'bill.negative_balance_interval_on_overdues',
75 'Amount of time after which no negative balances (refunds) are allowed on bills for overdue materials',
76 'coust', 'description')
78 ('bill.negative_balance_interval_on_lost',
79 'finance', 'interval',
81 'bill.negative_balance_interval_on_lost',
82 'Negative Balance Interval for Lost',
85 'bill.negative_balance_interval_on_lost',
86 'Amount of time after which no negative balances (refunds) are allowed on bills for lost/long overdue materials',
87 'coust', 'description')