lp1742194 - Print Current Bills only printing circ bills
authorKyle Huckins <khuckins@catalyte.io>
Thu, 11 Jan 2018 18:10:51 +0000 (18:10 +0000)
committerChris Sharp <csharp@georgialibraries.org>
Thu, 11 Jan 2018 19:40:23 +0000 (14:40 -0500)
- Check xact for Circulation before assigning circulation data to
xact for printing.

Signed-off-by: Kyle Huckins <khuckins@catalyte.io>
 Changes to be committed:
modified:   Open-ILS/web/js/ui/default/staff/circ/patron/bills.js

Open-ILS/web/js/ui/default/staff/circ/patron/bills.js

index 89e686d..a7e9b64 100644 (file)
@@ -498,8 +498,10 @@ function($scope , $q , $routeParams , egCore , egConfirmDialog , $location,
                     unrecovered : xact.unrecovered(),
                     xact_finish : xact.xact_finish(),
                     xact_start : xact.xact_start(),
-                    copy_barcode : xact.circulation().target_copy().barcode(),
-                    title : xact.circulation().target_copy().call_number().record().simple_record().title()
+                }
+                if (xact.circulation()) {
+                    newXact.copy_barcode = xact.circulation().target_copy().barcode(),
+                    newXact.title = xact.circulation().target_copy().call_number().record().simple_record().title()
                 }
                 xacts.push(newXact);
             }
@@ -962,8 +964,10 @@ function($scope,  $q , egCore , patronSvc , billSvc , egPromptDialog , $location
                     unrecovered : xact.unrecovered(),
                     xact_finish : xact.xact_finish(),
                     xact_start : xact.xact_start(),
-                    copy_barcode : xact.circulation().target_copy().barcode(),
-                    title : xact.circulation().target_copy().call_number().record().simple_record().title()
+                }
+                if (xact.circulation()) {
+                    newXact.copy_barcode = xact.circulation().target_copy().barcode(),
+                    newXact.title = xact.circulation().target_copy().call_number().record().simple_record().title()
                 }
                 xacts.push(newXact);
             }