[open-ils-commits] ***SPAM*** [GIT] Evergreen ILS branch master updated. 9f00f0942e7959e8b3d822ae221aae1ba1537749

Evergreen Git git at git.evergreen-ils.org
Wed Jan 22 10:25:00 EST 2014


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Evergreen ILS".

The branch, master has been updated
       via  9f00f0942e7959e8b3d822ae221aae1ba1537749 (commit)
       via  e9c5319bc8d8535113cd1b4c28f132fe7d21a957 (commit)
       via  e42e9b047c91c21d34db19a0ff7afd7ebcddf367 (commit)
      from  400c9c68079de152693237f39df93fe8bb035a0e (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 9f00f0942e7959e8b3d822ae221aae1ba1537749
Author: Jeff Godin <jgodin at tadl.org>
Date:   Wed Jan 22 09:56:34 2014 -0500

    Stamping 0854: data.min_max_prices
    
    Stamping 0854 and resolving permission ID conflicts due to drift.
    
    Signed-off-by: Jeff Godin <jgodin at tadl.org>

diff --git a/Open-ILS/src/sql/Pg/950.data.seed-values.sql b/Open-ILS/src/sql/Pg/950.data.seed-values.sql
index 693fab9..62f6da8 100644
--- a/Open-ILS/src/sql/Pg/950.data.seed-values.sql
+++ b/Open-ILS/src/sql/Pg/950.data.seed-values.sql
@@ -1592,9 +1592,9 @@ INSERT INTO permission.perm_list ( id, code, description ) VALUES
         'Allows a user to specify which Server Add-ons get invoked at the current workstation', 'ppl', 'description')),
  ( 552, 'ADMIN_FLOAT_GROUPS', oils_i18n_gettext( 552,
     'Allows administration of floating groups', 'ppl', 'description' )),
- ( 552, 'UPDATE_ORG_UNIT_SETTING.circ.min_item_price', oils_i18n_gettext( 552,
+ ( 553, 'UPDATE_ORG_UNIT_SETTING.circ.min_item_price', oils_i18n_gettext( 553,
     'UPDATE_ORG_UNIT_SETTING.circ.min_item_price', 'ppl', 'description' )),
- ( 553, 'UPDATE_ORG_UNIT_SETTING.circ.max_item_price', oils_i18n_gettext( 553,
+ ( 554, 'UPDATE_ORG_UNIT_SETTING.circ.max_item_price', oils_i18n_gettext( 554,
     'UPDATE_ORG_UNIT_SETTING.circ.max_item_price', 'ppl', 'description' ))
 ;
 
diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.data.min_max_prices.sql b/Open-ILS/src/sql/Pg/upgrade/0854.data.min_max_prices.sql
similarity index 89%
rename from Open-ILS/src/sql/Pg/upgrade/XXXX.data.min_max_prices.sql
rename to Open-ILS/src/sql/Pg/upgrade/0854.data.min_max_prices.sql
index acd22ee..28d93b7 100644
--- a/Open-ILS/src/sql/Pg/upgrade/XXXX.data.min_max_prices.sql
+++ b/Open-ILS/src/sql/Pg/upgrade/0854.data.min_max_prices.sql
@@ -1,21 +1,21 @@
 BEGIN;
 
--- SELECT evergreen.upgrade_deps_block_check('XXXX', :eg_version);
+SELECT evergreen.upgrade_deps_block_check('0854', :eg_version);
 
 INSERT INTO permission.perm_list ( id, code, description ) VALUES (
-    551, -- VERIFY
+    553,
     'UPDATE_ORG_UNIT_SETTING.circ.min_item_price',
     oils_i18n_gettext(
-        551, -- VERIFY
+        553,
         'UPDATE_ORG_UNIT_SETTING.circ.min_item_price',
         'ppl',
         'description'
     )
 ), (
-	552, -- VERIFY
+	554,
     'UPDATE_ORG_UNIT_SETTING.circ.max_item_price',
     oils_i18n_gettext(
-        552, -- VERIFY
+        554,
         'UPDATE_ORG_UNIT_SETTING.circ.max_item_price',
         'ppl',
         'description'

commit e9c5319bc8d8535113cd1b4c28f132fe7d21a957
Author: Remington Steed <rjs7 at calvin.edu>
Date:   Tue Sep 24 16:54:37 2013 -0400

    Release notes for lp1207903: new lost billing min/max setting
    
    Signed-off-by: Remington Steed <rjs7 at calvin.edu>
    Signed-off-by: Jeff Godin <jgodin at tadl.org>

diff --git a/docs/RELEASE_NOTES_NEXT/Circulation/lost_min_max_item_pricing.txt b/docs/RELEASE_NOTES_NEXT/Circulation/lost_min_max_item_pricing.txt
new file mode 100644
index 0000000..7ae826d
--- /dev/null
+++ b/docs/RELEASE_NOTES_NEXT/Circulation/lost_min_max_item_pricing.txt
@@ -0,0 +1,24 @@
+Lost Item Billing: New Min/Max Price Settings
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+When an item is marked lost, the user is typically billed for the item.
+In Evergreen, they can either be charged the amount recorded in the item
+object, or if that value is blank (or zero), charged a default price
+(controlled by settings).
+
+In addition to these existing settings, now we can accommodate a range of
+prices by saying the patron should be billed at least 'X' and not more
+than 'Y'. This also allows you to effectively set a fixed price for all
+lost items by setting min and max to the same amount.
+
+New Org Unit Settings
++++++++++++++++++++++
+
+ * Minimum Item Price: circ.min_item_price
+ * Maximum Item Price: circ.max_item_price
+
+New Permissions
++++++++++++++++
+
+ * UPDATE_ORG_UNIT_SETTING.circ.min_item_price
+ * UPDATE_ORG_UNIT_SETTING.circ.max_item_price

commit e42e9b047c91c21d34db19a0ff7afd7ebcddf367
Author: Dan Wells <dbw2 at calvin.edu>
Date:   Fri Dec 14 14:02:22 2012 -0500

    Add new option for max/min lost item pricing
    
    In addition to a 'default' price when price is missing or zero,
    we can also accommodate a range of prices by saying it should be
    at least 'X' and not more than 'Y'.  This also allows you to
    effectively set a fixed price for all lost items by setting min
    and max to an equal amount.
    
    Signed-off-by: Dan Wells <dbw2 at calvin.edu>
    Signed-off-by: Jeff Godin <jgodin at tadl.org>

diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/AppUtils.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/AppUtils.pm
index b5900ed..630d252 100644
--- a/Open-ILS/src/perlmods/lib/OpenILS/Application/AppUtils.pm
+++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/AppUtils.pm
@@ -1542,8 +1542,6 @@ sub get_copy_price {
 
     $copy->price(0) if $copy->price and $copy->price < 0;
 
-    return $copy->price if $copy->price and $copy->price > 0;
-
 
     my $owner;
     if(ref $volume) {
@@ -1560,17 +1558,30 @@ sub get_copy_price {
         }
     }
 
-    my $default_price = $self->ou_ancestor_setting_value(
-        $owner, OILS_SETTING_DEF_ITEM_PRICE, $e) || 0;
+    my $min_price = $self->ou_ancestor_setting_value($owner, OILS_SETTING_MIN_ITEM_PRICE);
+    my $max_price = $self->ou_ancestor_setting_value($owner, OILS_SETTING_MAX_ITEM_PRICE);
+    my $charge_on_0 = $self->ou_ancestor_setting_value($owner, OILS_SETTING_CHARGE_LOST_ON_ZERO, $e);
 
-    return $default_price unless defined $copy->price;
+    my $price = $copy->price;
 
-    # price is 0.  Use the default?
-    my $charge_on_0 = $self->ou_ancestor_setting_value(
-        $owner, OILS_SETTING_CHARGE_LOST_ON_ZERO, $e) || 0;
+    # set the default price if needed
+    if (!defined $price or ($price == 0 and $charge_on_0)) {
+        # set to default price
+        $price = $self->ou_ancestor_setting_value(
+            $owner, OILS_SETTING_DEF_ITEM_PRICE, $e) || 0;
+    }
 
-    return $default_price if $charge_on_0;
-    return 0;
+    # adjust to min/max range if needed
+    if (defined $max_price and $price > $max_price) {
+        $price = $max_price;
+    } elsif (defined $min_price and $price < $min_price
+        and ($price != 0 or $charge_on_0 or !defined $charge_on_0)) {
+        # default to raising the price to the minimum,
+        # but let 0 fall through if $charge_on_0 is set and is false
+        $price = $min_price;
+    }
+
+    return $price;
 }
 
 # given a transaction ID, this returns the context org_unit for the transaction
diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Const.pm b/Open-ILS/src/perlmods/lib/OpenILS/Const.pm
index 9bbcdf2..4f9e5c2 100644
--- a/Open-ILS/src/perlmods/lib/OpenILS/Const.pm
+++ b/Open-ILS/src/perlmods/lib/OpenILS/Const.pm
@@ -77,6 +77,8 @@ econst OILS_UNLIMITED_CIRC_DURATION   => 'unlimited';
 # ---------------------------------------------------------------------
 econst OILS_SETTING_LOST_PROCESSING_FEE => 'circ.lost_materials_processing_fee';
 econst OILS_SETTING_DEF_ITEM_PRICE => 'cat.default_item_price';
+econst OILS_SETTING_MIN_ITEM_PRICE => 'circ.min_item_price';
+econst OILS_SETTING_MAX_ITEM_PRICE => 'circ.max_item_price';
 econst OILS_SETTING_ORG_BOUNCED_EMAIL => 'org.bounced_emails';
 econst OILS_SETTING_CHARGE_LOST_ON_ZERO => 'circ.charge_lost_on_zero';
 econst OILS_SETTING_VOID_OVERDUE_ON_LOST => 'circ.void_overdue_on_lost';
diff --git a/Open-ILS/src/sql/Pg/950.data.seed-values.sql b/Open-ILS/src/sql/Pg/950.data.seed-values.sql
index 86af666..693fab9 100644
--- a/Open-ILS/src/sql/Pg/950.data.seed-values.sql
+++ b/Open-ILS/src/sql/Pg/950.data.seed-values.sql
@@ -1591,7 +1591,11 @@ INSERT INTO permission.perm_list ( id, code, description ) VALUES
  ( 551, 'ADMIN_SERVER_ADDON_FOR_WORKSTATION', oils_i18n_gettext( 551,
         'Allows a user to specify which Server Add-ons get invoked at the current workstation', 'ppl', 'description')),
  ( 552, 'ADMIN_FLOAT_GROUPS', oils_i18n_gettext( 552,
-    'Allows administration of floating groups', 'ppl', 'description' ))
+    'Allows administration of floating groups', 'ppl', 'description' )),
+ ( 552, 'UPDATE_ORG_UNIT_SETTING.circ.min_item_price', oils_i18n_gettext( 552,
+    'UPDATE_ORG_UNIT_SETTING.circ.min_item_price', 'ppl', 'description' )),
+ ( 553, 'UPDATE_ORG_UNIT_SETTING.circ.max_item_price', oils_i18n_gettext( 553,
+    'UPDATE_ORG_UNIT_SETTING.circ.max_item_price', 'ppl', 'description' ))
 ;
 
 SELECT SETVAL('permission.perm_list_id_seq'::TEXT, 1000);
@@ -2785,6 +2789,24 @@ INSERT into config.org_unit_setting_type
         'coust', 'description'),
     'currency', null)
 
+,( 'circ.min_item_price', 'finance',
+    oils_i18n_gettext('circ.min_item_price',
+        'Minimum Item Price',
+        'coust', 'label'),
+    oils_i18n_gettext('circ.min_item_price',
+        'When charging for lost items, charge this amount as a minimum.',
+        'coust', 'description'),
+    'currency', null)
+
+,( 'circ.max_item_price', 'finance',
+    oils_i18n_gettext('circ.max_item_price',
+        'Maximum Item Price',
+        'coust', 'label'),
+    oils_i18n_gettext('circ.max_item_price',
+        'When charging for lost items, limit the charge to this as a maximum.',
+        'coust', 'description'),
+    'currency', null)
+
 ,( 'cat.label.font.family', 'cat',
     oils_i18n_gettext('cat.label.font.family',
         'Spine and pocket label font family',
diff --git a/Open-ILS/src/sql/Pg/upgrade/XXXX.data.min_max_prices.sql b/Open-ILS/src/sql/Pg/upgrade/XXXX.data.min_max_prices.sql
new file mode 100644
index 0000000..acd22ee
--- /dev/null
+++ b/Open-ILS/src/sql/Pg/upgrade/XXXX.data.min_max_prices.sql
@@ -0,0 +1,55 @@
+BEGIN;
+
+-- SELECT evergreen.upgrade_deps_block_check('XXXX', :eg_version);
+
+INSERT INTO permission.perm_list ( id, code, description ) VALUES (
+    551, -- VERIFY
+    'UPDATE_ORG_UNIT_SETTING.circ.min_item_price',
+    oils_i18n_gettext(
+        551, -- VERIFY
+        'UPDATE_ORG_UNIT_SETTING.circ.min_item_price',
+        'ppl',
+        'description'
+    )
+), (
+	552, -- VERIFY
+    'UPDATE_ORG_UNIT_SETTING.circ.max_item_price',
+    oils_i18n_gettext(
+        552, -- VERIFY
+        'UPDATE_ORG_UNIT_SETTING.circ.max_item_price',
+        'ppl',
+        'description'
+    )
+);
+
+INSERT into config.org_unit_setting_type
+    ( name, grp, label, description, datatype, fm_class )
+VALUES (
+    'circ.min_item_price',
+	'finance',
+    oils_i18n_gettext(
+        'circ.min_item_price',
+        'Minimum Item Price',
+        'coust', 'label'),
+    oils_i18n_gettext(
+        'circ.min_item_price',
+        'When charging for lost items, charge this amount as a minimum.',
+        'coust', 'description'),
+    'currency',
+    NULL
+), (
+    'circ.max_item_price',
+    'finance',
+    oils_i18n_gettext(
+        'circ.max_item_price',
+        'Maximum Item Price',
+        'coust', 'label'),
+    oils_i18n_gettext(
+        'circ.max_item_price',
+        'When charging for lost items, limit the charge to this as a maximum.',
+        'coust', 'description'),
+    'currency',
+    NULL
+);
+
+COMMIT;

-----------------------------------------------------------------------

Summary of changes:
 .../perlmods/lib/OpenILS/Application/AppUtils.pm   |   31 ++++++++----
 Open-ILS/src/perlmods/lib/OpenILS/Const.pm         |    2 +
 Open-ILS/src/sql/Pg/950.data.seed-values.sql       |   24 ++++++++-
 .../sql/Pg/upgrade/0854.data.min_max_prices.sql    |   55 ++++++++++++++++++++
 .../Circulation/lost_min_max_item_pricing.txt      |   24 +++++++++
 5 files changed, 125 insertions(+), 11 deletions(-)
 create mode 100644 Open-ILS/src/sql/Pg/upgrade/0854.data.min_max_prices.sql
 create mode 100644 docs/RELEASE_NOTES_NEXT/Circulation/lost_min_max_item_pricing.txt


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list