lp1742194 - Print Current Bills only printing circ bills
authorKyle Huckins <khuckins@catalyte.io>
Thu, 11 Jan 2018 18:10:51 +0000 (18:10 +0000)
committerGalen Charlton <gmc@equinoxinitiative.org>
Fri, 12 Jan 2018 18:50:46 +0000 (13:50 -0500)
- Check xact for Circulation before assigning circulation data to
xact for printing.

To test
-------
[1] Set up a patron with at least one "grocery" bill.
[2] In the web staff client, go to
    Patron Account > Bills > Actions > Print Bills
[3] Note that the current bills summary is not printed
    and that there an error in the browser console.
[4] Apply the patch and repeat step #2. This time, the
    bills summary should be printed.

Signed-off-by: Kyle Huckins <khuckins@catalyte.io>
Signed-off-by: Terra McCanna <tmccanna@georgialibraries.org>
Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>

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

index ce240f9..46fc0b9 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);
             }
@@ -963,8 +965,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);
             }