[open-ils-commits] [GIT] Evergreen ILS branch master updated. d905fd597b424cf0d53cc7e2a82775570281b09c

Evergreen Git git at git.evergreen-ils.org
Wed Aug 19 14:33:10 EDT 2015


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  d905fd597b424cf0d53cc7e2a82775570281b09c (commit)
       via  3e54f241d1944a83e6774af504fbd1880383c37c (commit)
       via  637f2a2941862ac494263dd24b684a017959a4ff (commit)
       via  a7526df453204fc3031390e3048c50bb3805abff (commit)
      from  79b3a3fbfaccc53ccf74333cfd9d0d96fd8bfcf4 (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 d905fd597b424cf0d53cc7e2a82775570281b09c
Author: Bill Erickson <berickxx at gmail.com>
Date:   Mon Nov 11 09:16:03 2013 -0500

    LP#1479107 adjust to zero UI
    
    New "Adjust to Zero" option in patron billing UI.  Selected
    transactions are updated to have a zero balance by rebilling
    and/or adding adjustments as required.
    
    Signed-off-by: Dan Wells <dbw2 at calvin.edu>
    Signed-off-by: Kathy Lussier <klussier at masslnc.org>
    Signed-off-by: Jason Stephenson <jstephenson at mvlc.org>

diff --git a/Open-ILS/web/opac/locale/en-US/lang.dtd b/Open-ILS/web/opac/locale/en-US/lang.dtd
index 92f0ec5..a820074 100644
--- a/Open-ILS/web/opac/locale/en-US/lang.dtd
+++ b/Open-ILS/web/opac/locale/en-US/lang.dtd
@@ -3323,6 +3323,8 @@
 <!ENTITY staff.patron.bill_interface.void_all_billings.accesskey "V">
 <!ENTITY staff.patron.bill_interface.refund.label "Refund">
 <!ENTITY staff.patron.bill_interface.refund.accesskey "R">
+<!ENTITY staff.patron.bill_interface.adjust_to_zero.label "Adjust to Zero">
+<!ENTITY staff.patron.bill_interface.adjust_to_zero.accesskey "Z">
 <!ENTITY staff.patron.bill_interface.full_details.label "Full Details">
 <!ENTITY staff.patron.bill_interface.full_details.accesskey "D">
 <!ENTITY staff.patron.bill_interface.show_in_catalog.label "Show in Catalog">
diff --git a/Open-ILS/xul/staff_client/chrome/content/main/constants.js b/Open-ILS/xul/staff_client/chrome/content/main/constants.js
index d435afb..e17a897 100644
--- a/Open-ILS/xul/staff_client/chrome/content/main/constants.js
+++ b/Open-ILS/xul/staff_client/chrome/content/main/constants.js
@@ -370,7 +370,8 @@ var api = {
     'USER_ORG_UNIT_OPT_IN_FEATURE' : { 'app' : 'open-ils.actor', 'method' : 'open-ils.actor.user.org_unit_opt_in.enabled' },
     'USER_ORG_UNIT_OPT_IN_CHECK' : { 'app' : 'open-ils.actor', 'method' : 'open-ils.actor.user.org_unit_opt_in.check' },
     'USER_ORG_UNIT_OPT_IN_CREATE' : { 'app' : 'open-ils.actor', 'method' : 'open-ils.actor.user.org_unit_opt_in.create' },
-    'GET_BARCODES' : { 'app' : 'open-ils.actor', 'method' : 'open-ils.actor.get_barcodes' }
+    'GET_BARCODES' : { 'app' : 'open-ils.actor', 'method' : 'open-ils.actor.get_barcodes' },
+    'ADJUST_BILLS_TO_ZERO' : { 'app' : 'open-ils.circ', 'method' : 'open-ils.circ.money.billable_xact.adjust_to_zero' }
 }
 
 var urls = {
diff --git a/Open-ILS/xul/staff_client/server/locale/en-US/patron.properties b/Open-ILS/xul/staff_client/server/locale/en-US/patron.properties
index f7d7d5f..401f19d 100644
--- a/Open-ILS/xul/staff_client/server/locale/en-US/patron.properties
+++ b/Open-ILS/xul/staff_client/server/locale/en-US/patron.properties
@@ -48,7 +48,14 @@ staff.patron.bills.handle_refund.message_singular=Are you sure you would like to
 staff.patron.bills.handle_refund.title=Refund Excess Payment
 staff.patron.bills.handle_refund.btn_yes=Yes
 staff.patron.bills.handle_refund.btn_no=No
-staff.patron.bills.handle_refund.confirm_message=Check here to confirm this message
+
+staff.patron.bills.handle_adjust_to_zero.confirm_message=Check here to confirm this message
+staff.patron.bills.handle_adjust_to_zero.message_plural=Are you sure you would like to adjust to zero the balance on bills %1$s?
+staff.patron.bills.handle_adjust_to_zero.message_singular=Are you sure you would like to adjust to zero the balance on bill %1$s?
+staff.patron.bills.handle_adjust_to_zero.title=Adjust to Zero
+staff.patron.bills.handle_adjust_to_zero.btn_yes=Yes
+staff.patron.bills.handle_adjust_to_zero.btn_no=No
+
 staff.patron.bill_history.print_bills.print_error=printing bills
 staff.patron.bill_history.column.xact_type.label=Transaction Type
 staff.patron.bill_history.column.last_billing_type.label=Last Billing Type
diff --git a/Open-ILS/xul/staff_client/server/patron/bill2.js b/Open-ILS/xul/staff_client/server/patron/bill2.js
index 8a248f3..3db87f9 100644
--- a/Open-ILS/xul/staff_client/server/patron/bill2.js
+++ b/Open-ILS/xul/staff_client/server/patron/bill2.js
@@ -108,6 +108,12 @@ function event_listeners() {
             false
         );
 
+        window.bill_event_listeners.add($('adjust_to_zero'),
+            'command',
+            handle_adjust_to_zero,
+            false
+        );
+
         window.bill_event_listeners.add($('opac'), 
             'command',
             handle_opac,
@@ -382,6 +388,48 @@ function handle_refund() {
     distribute_payment();
 }
 
+/**
+ * Calls open-ils.circ.money.billable_xact.adjust_to_zero on selected
+ * transactions to produce a zero-balance transaction.
+ * Successfully cleared transactions will disappear from the billing list.
+ */
+function handle_adjust_to_zero() {
+
+    var msgkey = g.bill_list_selection.length > 1 ?
+        'staff.patron.bills.handle_adjust_to_zero.message_plural' :
+        'staff.patron.bills.handle_adjust_to_zero.message_singular';
+
+    var msg = $("patronStrings").getFormattedString(
+        msgkey, [g.bill_list_selection]);
+
+    var r = g.error.yns_alert(msg,
+        $("patronStrings").getString(
+            'staff.patron.bills.handle_adjust_to_zero.title'),
+        $("patronStrings").getString(
+            'staff.patron.bills.handle_adjust_to_zero.btn_yes'),
+        $("patronStrings").getString(
+            'staff.patron.bills.handle_adjust_to_zero.btn_no'),null,
+        $("patronStrings").getString(
+            'staff.patron.bills.handle_adjust_to_zero.confirm_message'));
+
+    if (r == 0) {
+        var xact_ids = [];
+        for (var i = 0; i < g.bill_list_selection.length; i++) {
+            var bill_id = g.bill_list_selection[i];
+            xact_ids.push(bill_id);
+        }
+
+        var mod_ids = g.network.simple_request(
+            'ADJUST_BILLS_TO_ZERO', [ses(), xact_ids]);
+
+        g.error.sdump('D_DEBUG', 'adjusted to zero transactions ' + mod_ids);
+
+        refresh();
+        tally_all();
+        distribute_payment();
+    }
+}
+
 
 function check_all() {
     try {
@@ -524,6 +572,7 @@ function init_lists() {
             $('details').setAttribute('disabled', g.bill_list_selection.length == 0);
             $('add').setAttribute('disabled', g.bill_list_selection.length == 0);
             $('voidall').setAttribute('disabled', g.bill_list_selection.length == 0);
+            $('adjust_to_zero').setAttribute('disabled', g.bill_list_selection.length == 0);
             $('refund').setAttribute('disabled', g.bill_list_selection.length == 0);
             $('opac').setAttribute('disabled', g.bill_list_selection.length == 0);
             $('copy_details').setAttribute('disabled', g.bill_list_selection.length == 0);
diff --git a/Open-ILS/xul/staff_client/server/patron/bill2.xul b/Open-ILS/xul/staff_client/server/patron/bill2.xul
index 2889b7b..6fbd90d 100644
--- a/Open-ILS/xul/staff_client/server/patron/bill2.xul
+++ b/Open-ILS/xul/staff_client/server/patron/bill2.xul
@@ -41,6 +41,7 @@
         <command id="opac" label="&staff.patron.bill_interface.show_in_catalog.label;" accesskey="&staff.patron.bill_interface.show_in_catalog.accesskey;" disabled="true"/>
         <command id="copy_details" label="&staff.patron.items_overlay.sel_copy_details.label;" accesskey="&staff.patron.items_overlay.sel_copy_details.accesskey;" disabled="true"/>
         <command id="voidall" label="&staff.patron.bill_interface.void_all_billings.label;" accesskey="&staff.patron.bill_interface.void_all_billings.accesskey;" disabled="true"/>
+        <command id="adjust_to_zero" label="&staff.patron.bill_interface.adjust_to_zero.label;" accesskey="&staff.patron.bill_interface.adjust_to_zero.accesskey;" disabled="true"/>
         <command id="refund" label="&staff.patron.bill_interface.refund.label;" accesskey="&staff.patron.bill_interface.refund.accesskey;" disabled="true"/>
         <command id="add" label="&staff.patron.bill_interface.add_billing.label;" accesskey="&staff.patron.bill_interface.add_billing.accesskey;" disabled="true"/>
         <command id="details" label="&staff.patron.bill_interface.full_details.label;" accesskey="&staff.patron.bill_interface.full_details.accesskey;" disabled="true"/>
@@ -51,6 +52,7 @@
             <menuitem command="opac" />
             <menuitem command="copy_details" />
             <menuitem command="voidall" />
+            <menuitem command="adjust_to_zero" />
             <menuitem command="refund" />
             <menuitem command="add" />
             <menuitem command="details" />

commit 3e54f241d1944a83e6774af504fbd1880383c37c
Author: Dan Wells <dbw2 at calvin.edu>
Date:   Fri Nov 8 11:43:38 2013 -0500

    LP#1479107 adjust to zero API
    
    API call for manually adjusting a transaction to zero.  It works
    by rebilling previously voided billings (if necessary) until a
    positive balance is reached, then applying adjustment payments
    to zero out the balance.
    
    open-ils.circ.money.billable_xact.adjust_to_zero(auth, [xact_ids])
    
    Signed-off-by: Dan Wells <dbw2 at calvin.edu>
    Signed-off-by: Kathy Lussier <klussier at masslnc.org>
    Signed-off-by: Jason Stephenson <jstephenson at mvlc.org>

diff --git a/Open-ILS/examples/fm_IDL.xml b/Open-ILS/examples/fm_IDL.xml
index cd547db..b5a44b6 100644
--- a/Open-ILS/examples/fm_IDL.xml
+++ b/Open-ILS/examples/fm_IDL.xml
@@ -7278,11 +7278,13 @@ SELECT  usr,
 			<field reporter:label="Voiding Staff Member" name="voider" reporter:datatype="link"/>
 			<field reporter:label="Transaction" name="xact" reporter:datatype="link"/>
 			<field reporter:label="Type" name="btype" reporter:datatype="link"/>
+			<field reporter:label="Adjustments" name="adjustments" oils_persist:virtual="true" reporter:datatype="link"/>
 		</fields>
 		<links>
 			<link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
 			<link field="voider" reltype="has_a" key="id" map="" class="au"/>
 			<link field="btype" reltype="has_a" key="id" map="" class="cbt"/>
+			<link field="adjustments" reltype="has_many" key="billing" map="" class="maa"/>
 		</links>
         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
             <actions>
diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/AppUtils.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/AppUtils.pm
index 8c92ee5..44449f7 100644
--- a/Open-ILS/src/perlmods/lib/OpenILS/Application/AppUtils.pm
+++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/AppUtils.pm
@@ -2231,6 +2231,9 @@ sub check_open_xact {
 # values are all multiplied by 100 before being used, and the result
 # is divided by 100 in order to avoid decimal rounding errors inherent
 # in floating point math.
+#
+# XXX shifting using multiplication/division *may* still introduce
+# rounding errors -- better to implement using string manipulation?
 sub fpdiff {
     my ($class, @args) = @_;
     my $result = shift(@args) * 100;
@@ -2240,5 +2243,15 @@ sub fpdiff {
     return $result / 100;
 }
 
+sub fpsum {
+    my ($class, @args) = @_;
+    my $result = shift(@args) * 100;
+    while (my $arg = shift(@args)) {
+        $result += $arg * 100;
+    }
+    return $result / 100;
+}
+
+
 1;
 
diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Money.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Money.pm
index 038761d..2cd07f8 100644
--- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Money.pm
+++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Money.pm
@@ -922,6 +922,156 @@ sub void_bill {
 
 
 __PACKAGE__->register_method(
+    method => 'adjust_bills_to_zero_manual',
+    api_name => 'open-ils.circ.money.billable_xact.adjust_to_zero',
+    signature => {
+        desc => q/
+            Given a list of billable transactions, manipulate the
+            transaction using account adjustments to result in a
+            balance of $0.
+            /,
+        params => [
+            {desc => 'Authtoken', type => 'string'},
+            {desc => 'Array of transaction IDs', type => 'array'}
+        ],
+        return => {
+            desc => q/Array of IDs for each transaction updated,
+            Event on error./
+        }
+    }
+);
+
+sub _rebill_xact {
+    my ($e, $xact) = @_;
+
+    my $xact_id = $xact->id;
+    # the plan: rebill voided billings until we get a positive balance
+    #
+    # step 1: get the voided/adjusted billings
+    my $billings = $e->search_money_billing([
+        {
+            xact => $xact_id,
+        },
+        {
+            order_by => {mb => 'amount desc'},
+            flesh => 1,
+            flesh_fields => {mb => ['adjustments']},
+        }
+    ]);
+    my @billings = grep { $U->is_true($_->voided) or @{$_->adjustments} } @$billings;
+
+    my $xact_balance = $xact->balance_owed;
+    $logger->debug("rebilling for xact $xact_id with balance $xact_balance");
+
+    my $rebill_amount = 0;
+    my @rebill_ids;
+    # step 2: generate new bills just like the old ones
+    for my $billing (@billings) {
+        my $amount = 0;
+        if ($U->is_true($billing->voided)) {
+            $amount = $billing->amount;
+        } else { # adjusted billing
+            map { $amount = $U->fpadd($amount, $_->amount) } @{$billing->adjustments};
+        }
+        my $evt = $CC->create_bill(
+            $e,
+            $amount,
+            $billing->btype,
+            $billing->billing_type,
+            $xact_id,
+            "System: MANUAL ADJUSTMENT, BILLING #".$billing->id." REINSTATED\n(PREV: ".$billing->note.")",
+            $billing->billing_ts()
+        );
+        return $evt if $evt;
+        $rebill_amount += $billing->amount;
+
+        # if we have a postive (or zero) balance now, stop
+        last if $rebill_amount >= $xact_balance;
+    }
+}
+
+sub _is_fully_adjusted {
+    my ($billing) = @_;
+
+    my $amount_adj = 0;
+    map { $amount_adj = $U->fpadd($amount_adj, $_->amount) } @{$billing->adjustments};
+
+    return $billing->amount == $amount_adj;
+}
+
+sub adjust_bills_to_zero_manual {
+    my ($self, $client, $auth, $xact_ids) = @_;
+
+    my $e = new_editor(xact => 1, authtoken => $auth);
+    return $e->die_event unless $e->checkauth;
+
+    # in case a bare ID is passed
+    $xact_ids = [$xact_ids] unless ref $xact_ids;
+
+    my @modified;
+    for my $xact_id (@$xact_ids) {
+
+        my $xact =
+            $e->retrieve_money_billable_transaction_summary([
+                $xact_id,
+                {flesh => 1, flesh_fields => {mbts => ['usr']}}
+            ]) or return $e->die_event;
+
+        return $e->die_event unless
+            $e->allowed('ADJUST_BILLS', $xact->usr->home_ou);
+
+        if ($xact->balance_owed < 0) {
+            my $evt = _rebill_xact($e, $xact);
+            return $evt if $evt;
+            # refetch xact to get new balance
+            $xact =
+                $e->retrieve_money_billable_transaction_summary([
+                    $xact_id,
+                    {flesh => 1, flesh_fields => {mbts => ['usr']}}
+                ]) or return $e->die_event;
+        }
+
+        my $billings = $e->search_money_billing([
+            {
+                xact => $xact_id,
+            },
+            {
+                order_by => {mb => 'amount desc'},
+                flesh => 1,
+                flesh_fields => {mb => ['adjustments']},
+            }
+        ]);
+
+        if ($xact->balance_owed == 0) {
+            # if was zero, or we rebilled it to zero
+            next;
+        } else {
+            # it's positive and needs to be adjusted
+            my @billings_to_zero = grep { !$U->is_true($_->voided) or !_is_fully_adjusted($_) } @$billings;
+            $CC->adjust_bills_to_zero($e, \@billings_to_zero, "System: MANUAL ADJUSTMENT");
+        }
+
+        push(@modified, $xact->id);
+
+        # now we see if we can close the transaction
+        # same logic as make_payments();
+        my $circ = $e->retrieve_action_circulation($xact_id);
+        if ($circ and !$CC->can_close_circ($e, $circ)) {
+            # we don't check to see if the xact is already closed.  since the
+            # xact had a negative balance, it should not have been closed, so
+            # assume 'now' is the correct close time regardless.
+            my $trans = $e->retrieve_money_billable_transaction($xact_id);
+            $trans->xact_finish("now");
+            $e->update_money_billable_transaction($trans) or return $e->die_event;
+        }
+    }
+
+    $e->commit;
+    return \@modified;
+}
+
+
+__PACKAGE__->register_method(
     method        =>    'edit_bill_note',
     api_name        => 'open-ils.circ.money.billing.note.edit',
     signature    => q/

commit 637f2a2941862ac494263dd24b684a017959a4ff
Author: Dan Wells <dbw2 at calvin.edu>
Date:   Tue Aug 18 12:10:28 2015 -0400

    LP#1479107 Fix IDL classname for account adjustments
    
    This table went through two name changes, and left some debris along
    the way.  Let's standardize on the default choice of 'maa' for the IDL
    classname abbreviation.
    
    Signed-off-by: Dan Wells <dbw2 at calvin.edu>
    Signed-off-by: Kathy Lussier <klussier at masslnc.org>
    Signed-off-by: Jason Stephenson <jstephenson at mvlc.org>

diff --git a/Open-ILS/examples/fm_IDL.xml b/Open-ILS/examples/fm_IDL.xml
index 5983733..cd547db 100644
--- a/Open-ILS/examples/fm_IDL.xml
+++ b/Open-ILS/examples/fm_IDL.xml
@@ -3698,7 +3698,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
 			</actions>
 		</permacrud>
 	</class>
-	<class id="map" controller="open-ils.cstore" oils_obj:fieldmapper="money::account_adjustment" oils_persist:tablename="money.account_adjustment" reporter:label="Account Adjustment">
+	<class id="maa" controller="open-ils.cstore" oils_obj:fieldmapper="money::account_adjustment" oils_persist:tablename="money.account_adjustment" reporter:label="Account Adjustment">
 		<fields oils_persist:primary="id" oils_persist:sequence="money.payment_id_seq">
 			<field name="accepting_usr" reporter:datatype="link"/>
 			<field name="amount" reporter:datatype="money" />
@@ -7035,7 +7035,7 @@ SELECT  usr,
 			<link field="work_payment" reltype="might_have" key="id" map="" class="mwp"/>
 			<link field="forgive_payment" reltype="might_have" key="id" map="" class="mfp"/>
 			<link field="goods_payment" reltype="might_have" key="id" map="" class="mgp"/>
-			<link field="account_adjustment" reltype="might_have" key="id" map="" class="map"/>
+			<link field="account_adjustment" reltype="might_have" key="id" map="" class="maa"/>
 			<link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
 		</links>
         <permacrud xmlns="http://open-ils.org/spec/opensrf/IDL/permacrud/v1">
@@ -7073,7 +7073,7 @@ SELECT  usr,
 			<link field="work_payment" reltype="might_have" key="id" map="" class="mwp"/>
 			<link field="forgive_payment" reltype="might_have" key="id" map="" class="mfp"/>
 			<link field="goods_payment" reltype="might_have" key="id" map="" class="mgp"/>
-			<link field="account_adjustment" reltype="might_have" key="id" map="" class="mvp"/>
+			<link field="account_adjustment" reltype="might_have" key="id" map="" class="maa"/>
 			<link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
 			<link field="accepting_usr" reltype="has_a" key="id" map="" class="au"/>
 		</links>
@@ -7098,7 +7098,7 @@ SELECT  usr,
 			<link field="forgive_payment" reltype="might_have" key="id" map="" class="mfp"/>
 			<link field="goods_payment" reltype="might_have" key="id" map="" class="mgp"/>
 			<link field="credit_payment" reltype="might_have" key="id" map="" class="mcrp"/>
-			<link field="account_adjustment" reltype="might_have" key="id" map="" class="mvp"/>
+			<link field="account_adjustment" reltype="might_have" key="id" map="" class="maa"/>
 			<link field="xact" reltype="has_a" key="id" map="" class="mbt"/>
 		</links>
 	</class>

commit a7526df453204fc3031390e3048c50bb3805abff
Author: Dan Wells <dbw2 at calvin.edu>
Date:   Tue Aug 18 10:42:27 2015 -0400

    LP#1479107 Move VOID_BILLING perm check to top-level API
    
    Pemission checks are needed at entry points, but can lead to
    undesirable consequences if checked during automated processing.  In
    the case of voids, let's move the perm check up to make sure our
    automated processing can complete.
    
    Signed-off-by: Dan Wells <dbw2 at calvin.edu>
    Signed-off-by: Kathy Lussier <klussier at masslnc.org>
    Signed-off-by: Jason Stephenson <jstephenson at mvlc.org>

diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/CircCommon.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/CircCommon.pm
index 113e47c..62b5b57 100644
--- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/CircCommon.pm
+++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/CircCommon.pm
@@ -849,8 +849,6 @@ sub bill_payment_map_for_xact {
 # CStoreEditor, an arrayref of bill ids or bills, and an optional note.
 sub void_bills {
     my ($class, $e, $billids, $note) = @_;
-    return $e->die_event unless $e->checkauth;
-    return $e->die_event unless $e->allowed('VOID_BILLING');
 
     my %users;
     my $bills;
@@ -904,10 +902,6 @@ sub void_bills {
 sub adjust_bills_to_zero {
     my ($class, $e, $billids, $note) = @_;
 
-    # Get with the editor to see if we have permission to void bills.
-    return $e->die_event unless $e->checkauth;
-    return $e->die_event unless $e->allowed('VOID_BILLING');
-
     my %users;
 
     # Let's get all the billing objects and handle them by
diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Money.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Money.pm
index 30e0ca9..038761d 100644
--- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Money.pm
+++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Circ/Money.pm
@@ -907,6 +907,8 @@ __PACKAGE__->register_method(
 sub void_bill {
     my( $s, $c, $authtoken, @billids ) = @_;
     my $editor = new_editor(authtoken=>$authtoken, xact=>1);
+    return $editor->die_event unless $editor->checkauth;
+    return $editor->die_event unless $editor->allowed('VOID_BILLING');
     my $rv = $CC->void_bills($editor, \@billids);
     if (ref($rv) eq 'HASH') {
         # We got an event.

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

Summary of changes:
 Open-ILS/examples/fm_IDL.xml                       |   10 +-
 .../perlmods/lib/OpenILS/Application/AppUtils.pm   |   13 ++
 .../lib/OpenILS/Application/Circ/CircCommon.pm     |    6 -
 .../perlmods/lib/OpenILS/Application/Circ/Money.pm |  152 ++++++++++++++++++++
 Open-ILS/web/opac/locale/en-US/lang.dtd            |    2 +
 .../staff_client/chrome/content/main/constants.js  |    3 +-
 .../server/locale/en-US/patron.properties          |    9 +-
 Open-ILS/xul/staff_client/server/patron/bill2.js   |   49 +++++++
 Open-ILS/xul/staff_client/server/patron/bill2.xul  |    2 +
 9 files changed, 234 insertions(+), 12 deletions(-)


hooks/post-receive
-- 
Evergreen ILS


More information about the open-ils-commits mailing list