<option value="bills_current">[% l('Bills, Current') %]</option>
<option value="bills_historical">[% l('Bills, Historical') %]</option>
<option value="bill_payment">[% l('Bills, Payment') %]</option>
+ <option value="checkout">[% l('Checkout') %]</option>
<option value="patron_address">[% l('Patron Address') %]</option>
<option value="patron_note">[% l('Patron Note') %]</option>
<option value="transit_slip">[% l('Transit Slip') %]</option>
</div>
<div class="col-md-7">
<h3>[% l('Template') %]</h3>
+ <div ng-if="print.load_failed" class="alert alert-danger">
+ [% l(
+ "Unable to load template '[_1]'. The web server returned an error.",
+ '{{print.template_name}}')
+ %]
+ </div>
<div>
<textarea ng-model="print.template_content" class="print-template-text">
</textarea>
main-label="[% l('Checkouts') %]"
items-provider="gridDataProvider"
persist-key="circ.patron.checkout">
- <eg-grid-field label="[% l('Barcode') %]" path='copy_barcode' visible></eg-grid-field>
- <eg-grid-field label="[% l('Circ ID') %]" path='payload.circ.id' visible></eg-grid-field>
- <eg-grid-field label="[% l('Due Date') %]" path='payload.circ.due_date'
+ <eg-grid-field label="[% l('Barcode') %]"
+ path='copy_barcode' visible></eg-grid-field>
+ <eg-grid-field label="[% l('Circ ID') %]"
+ path='payload.circ.id' visible></eg-grid-field>
+ <eg-grid-field label="[% l('Due Date') %]"
+ path='payload.circ.due_date'
visible datatype="timestamp" dateformat="short"></eg-grid-field>
- <eg-grid-field label="[% l('Response') %]" path='textcode' visible></eg-grid-field>
- <eg-grid-field label="[% l('Title') %]" path='payload.record.title' visible></eg-grid-field>
- <eg-grid-field label="[% l('Author') %]" path='payload.record.author' visible></eg-grid-field>
- <eg-grid-field label="[% l('Call Number') %]" path='payload.copy.call_number.label' visible></eg-grid-field>
- <eg-grid-field label="[% l('Alert Msg') %]" path='payload.copy.alert_message' visible></eg-grid-field>
- <eg-grid-field label="[% l('Noncat #') %]" path='noncat_count' visible></eg-grid-field>
+ <eg-grid-field label="[% l('Response') %]"
+ path='textcode' visible></eg-grid-field>
+ <eg-grid-field label="[% l('Title') %]"
+ path='payload.record.title' visible></eg-grid-field>
+ <eg-grid-field label="[% l('Author') %]"
+ path='payload.record.author' visible></eg-grid-field>
+ <eg-grid-field label="[% l('Call Number') %]"
+ path='payload.copy.call_number.label' visible></eg-grid-field>
+ <eg-grid-field label="[% l('Alert Msg') %]"
+ path='payload.copy.alert_message' visible></eg-grid-field>
+ <eg-grid-field label="[% l('Noncat #') %]"
+ path='noncat_count' visible></eg-grid-field>
</eg-grid>
+
+<div class="flex-row pad-vert">
+ <div class="flex-cell"></div>
+ <div class="pad-horiz">
+ <input ng-model="auto_print" type="checkbox"/>
+ [% l('Auto-Print') %]
+ </div>
+ <div>
+ <button class="btn btn-default"
+ ng-click="print_receipt()">[% l('Print Receipt') %]</button>
+ </div>
+</div>
+
--- /dev/null
+<div>
+ <div>[% l('Welcome to [_1]', '{{current_location.name}}') %]</div>
+ <div>[% l('You checked out the following items:') %]</div>
+ <hr/>
+ <ol>
+ <li ng-repeat="circ in circulations">
+ <div>{{circ.title}}</div>
+ <div>[% l('Barcode: [_1] Due: [_2]',
+ '{{circ.target_copy.barcode}}',
+ '{{circ.due_date | date:"short"}}') %]</div>
+ </li>
+ </ol>
+ <hr/>
+ <div>{{current_location.shortname}} {{today | date:'short'}}</div>
+ <div>[% l('You were helped by [_1]', '{{staff.first_given_name}}') %]</div>
+<br/>
+
}
],
+ circulations : [
+ {
+ due_date : new Date().toISOString(),
+ target_copy : seed_copy,
+ title : seed_record.title
+ },
+ ],
+
previous_balance : 8.45,
payment_total : 2.00,
payment_applied : 2.00,
$scope.preview_scope.payments[1].xact.copy_barcode = seed_copy.barcode;
$scope.template_changed = function() {
+ $scope.print.load_failed = false;
egCore.hatch.getPrintTemplate($scope.print.template_name)
- .then(function(html) {
- $scope.print.template_content = html;
- console.log('set template content');
- });
+ .then(
+ function(html) {
+ $scope.print.template_content = html;
+ console.log('set template content');
+ },
+ function() {
+ $scope.print.template_content = '';
+ $scope.print.load_failed = true;
+ }
+ );
}
$scope.save_locally = function() {
payload.circ.due_date(payload.noncat_circ.duedate());
}
}
+
+ $scope.print_receipt = function() {
+ var print_data = {
+ circulations : [],
+ staff : egCore.idl.toHash(egCore.auth.user()),
+ current_location : egCore.idl.toHash(
+ egCore.org.get(egCore.auth.user().ws_ou()))
+ }
+ angular.forEach($scope.checkouts, function(co) {
+ var circ = egCore.idl.toHash(co.payload.circ);
+ circ.title = co.payload.record.title;
+ print_data.circulations.push(circ);
+ });
+
+ egCore.hatch.printFromTemplate('default', 'checkout', print_data);
+ }
}])