work log entries for payments received
authorJason Etheridge <jason@esilibrary.com>
Tue, 17 Apr 2012 21:03:21 +0000 (17:03 -0400)
committerBill Erickson <berick@esilibrary.com>
Thu, 31 May 2012 15:12:54 +0000 (11:12 -0400)
Signed-off-by: Jason Etheridge <jason@esilibrary.com>
Signed-off-by: Bill Erickson <berick@esilibrary.com>
Open-ILS/xul/staff_client/server/locale/en-US/circ.properties
Open-ILS/xul/staff_client/server/patron/bill2.js

index 633c2df..3592b82 100644 (file)
@@ -429,6 +429,12 @@ staff.circ.work_log_checkin_attempt.reservation_shelf.message=%1$s attempted che
 staff.circ.work_log_checkin_attempt.cataloging.message=%1$s attempted checkin of %4$s, which is a pre-cat and was routed to Cataloging.  Route To = %5$s
 # 1 - Staff Username  2 - Patron Family  3 - Patron Barcode  4 - Item Barcode  5 - Route To text
 staff.circ.work_log_checkin_attempt.cataloging.message=%1$s attempted checkin of %4$s, which was not found, and so was routed to Cataloging.  Route To = %5$s
+# 1 - Staff Username  2 - Patron Family  3 - Patron Barcode  4 - Original Balance  5 - Voided Balance  6 - Payment Received  7 - Payment Applied
+# 8 - Change Given  9 - Credit Given  10 - New Balance  11 - Payment Type  12 - Note  13 - API call result
+staff.circ.work_log_payment_attempt.success.message=%1$s received %6$s (%11$s) for %3$s (%2$s).
+# 1 - Staff Username  2 - Patron Family  3 - Patron Barcode  4 - Original Balance  5 - Voided Balance  6 - Payment Received  7 - Payment Applied
+# 8 - Change Given  9 - Credit Given  10 - New Balance  11 - Payment Type  12 - Note  13 - API call result
+staff.circ.work_log_payment_attempt.failure.message=%1$s attempted receipt of %6$s (%11$s) for %3$s (%2$s), which failed for this reason: %13$s
 staff.circ.checkin.hold_capture=Hold Capture
 staff.circ.checkin.check_in.tab=Item Check In
 staff.circ.renew.tab.label=Renew Items
index e741494..fa0a8a0 100644 (file)
@@ -916,6 +916,38 @@ function pay(payment_blob) {
             note : payment_blob.note
         }
         var robj = g.network.simple_request( 'BILL_PAY', [ ses(), payment_blob, g.patron.last_xact_id() ]);
+
+        try {
+            g.error.work_log(
+                $('circStrings').getFormattedString(
+                    robj && robj.payments
+                        ? 'staff.circ.work_log_payment_attempt.success.message'
+                        : 'staff.circ.work_log_payment_attempt.failure.message',
+                    [
+                        ses('staff_usrname'), // 1 - Staff Username
+                        g.patron.family_name(), // 2 - Patron Family
+                        g.patron.card().barcode(), // 3 - Patron Barcode
+                        g.previous_summary.original_balance, // 4 - Original Balance
+                        g.previous_summary.voided_balance, // 5 - Voided Balance
+                        g.previous_summary.payment_received, // 6 - Payment Received
+                        g.previous_summary.payment_applied, // 7 - Payment Applied
+                        g.previous_summary.change_given, // 8 - Change Given
+                        g.previous_summary.credit_given, // 9 - Credit Given
+                        g.previous_summary.new_balance, // 10 - New Balance
+                        g.previous_summary.payment_type, // 11 - Payment Type
+                        g.previous_summary.note, // 12 - Note
+                        robj && robj.textcode ? robj.textcode : robj // 13 - API call result
+                    ]
+                ), {
+                    'au_id' : g.patron.id(),
+                    'au_family_name' : g.patron.family_name(),
+                    'au_barcode' : g.patron.card().barcode()
+                }
+            );
+        } catch(E) {
+            alert('Error logging payment in bill2.js: ' + E);
+        }
+
         if (typeof robj.ilsevent != 'undefined') {
             switch(robj.textcode) {
                 case 'SUCCESS' : return true; break;