3 INSERT INTO config.upgrade_log (version) VALUES ('0125'); -- Scott McKellar
5 CREATE VIEW acq.ordered_funding_source_credit AS
7 CASE WHEN deadline_date IS NULL THEN
12 CASE WHEN deadline_date IS NULL THEN
22 acq.funding_source_credit;
24 COMMENT ON VIEW acq.ordered_funding_source_credit IS $$
26 * Copyright (C) 2009 Georgia Public Library Service
27 * Scott McKellar <scott@gmail.com>
29 * The acq.ordered_funding_source_credit view is a prioritized
30 * ordering of funding source credits. When ordered by the first
31 * three columns, this view defines the order in which the various
32 * credits are to be tapped for spending, subject to the allocations
33 * in the acq.fund_allocation table.
35 * The first column reflects the principle that we should spend
36 * money with deadlines before spending money without deadlines.
38 * The second column reflects the principle that we should spend the
39 * oldest money first. For money with deadlines, that means that we
40 * spend first from the credit with the earliest deadline. For
41 * money without deadlines, we spend first from the credit with the
42 * earliest effective date.
44 * The third column is a tie breaker to ensure a consistent
49 * This program is free software; you can redistribute it and/or
50 * modify it under the terms of the GNU General Public License
51 * as published by the Free Software Foundation; either version 2
52 * of the License, or (at your option) any later version.
54 * This program is distributed in the hope that it will be useful,
55 * but WITHOUT ANY WARRANTY; without even the implied warranty of
56 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
57 * GNU General Public License for more details.