LP1865062 Add Credit Card Approval Code to Payment Receipt
authorTerran McCanna <tmccanna@georgialibraries.org>
Wed, 22 Sep 2021 18:34:59 +0000 (14:34 -0400)
committerMichele Morgan <mmorgan@noblenet.org>
Mon, 28 Mar 2022 17:21:35 +0000 (13:21 -0400)
Makes approval code available to Bill Payment print template (when relevant).

Signed-off-by: Terran McCanna <tmccanna@georgialibraries.org>
Signed-off-by: Llewellyn Marshall <lbmarshallv.ncdcr@gmail.com>
Signed-off-by: Michele Morgan <mmorgan@noblenet.org>

Open-ILS/src/templates/staff/share/print_templates/t_bill_payment.tt2
Open-ILS/web/js/ui/default/staff/admin/workstation/app.js
Open-ILS/web/js/ui/default/staff/circ/patron/bills.js

index de88c70..1020066 100644 (file)
@@ -20,6 +20,7 @@ includes:
 * payment_total - total paid
 * new_balance - balance after the payments were applied
 * payments - list of specific payments
+* approval_code - credit card approval code
 
 Individual payments within payments contain:
 * payment.xact.copy_barcode - Item barcode
index f5b278c..4e4b906 100644 (file)
@@ -614,6 +614,7 @@ function($scope , $q , egCore , ngToast) {
         change_given : 0,
         payment_type : 'cash_payment',
         payment_note : 'Here is a payment note',
+        approval_code : 'CH1234567',
         note : {
             create_date : new Date().toISOString(), 
             title : 'Test Note Title',
index 011e553..5c4bf55 100644 (file)
@@ -395,10 +395,10 @@ function($scope , $q , $routeParams , egCore , egConfirmDialog , $location,
             make_payments, note, $scope.check_number, cc_args, patron_credit)
         .then(
             function(payment_ids) {
-
+                var approval_code = cc_args ? cc_args.approval_code : '';
                 if (!$scope.disable_auto_print && $scope.receipt_on_pay.isChecked) {
                     printReceipt(
-                        $scope.payment_type, payment_ids, make_payments, note);
+                        $scope.payment_type, payment_ids, make_payments, note, approval_code);
                 }
 
                 refreshDisplay();
@@ -418,7 +418,7 @@ function($scope , $q , $routeParams , egCore , egConfirmDialog , $location,
         egCore.hatch.setItem('eg.circ.bills.annotatepayment', $scope.annotate_payment);
     }
 
-    function printReceipt(type, payment_ids, payments_made, note) {
+    function printReceipt(type, payment_ids, payments_made, note, approval_code) {
         var payment_blobs = [];
         var cusr = patronSvc.current;
 
@@ -441,6 +441,7 @@ function($scope , $q , $routeParams , egCore , egConfirmDialog , $location,
         var print_data = {
             payment_type : type,
             payment_note : note,
+            approval_code : approval_code,
             previous_balance : Number($scope.summary.balance_owed()),
             payment_total : Number($scope.payment_amount),
             payment_applied : $scope.pending_payment(),