install_date TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT NOW()
);
-INSERT INTO config.upgrade_log (version) VALUES ('0111'); -- berick
+INSERT INTO config.upgrade_log (version) VALUES ('0112'); -- berick
CREATE TABLE config.bib_source (
id SERIAL PRIMARY KEY,
( 12, 'pickup_lib'),
( 12, 'usr');
+-- fines receipt
+
+INSERT INTO action_trigger.hook (key, core_type, description, passive)
+ VALUES (
+ 'format.selfcheck.fines',
+ 'au',
+ 'Formats fines for self-checkout receipt',
+ TRUE
+ );
+
+INSERT INTO action_trigger.event_definition (id, active, owner, name, hook, validator, reactor, granularity, template )
+ VALUES (
+ 13,
+ TRUE,
+ 1,
+ 'Self-Checkout Fines Receipt',
+ 'format.selfcheck.fines',
+ 'NOOP_True',
+ 'ProcessTemplate',
+ 'print-on-demand',
+$$
+[%- USE date -%]
+[%- SET user = target -%]
+<div>
+ <style> li { padding: 8px; margin 5px; }</style>
+ <div>[% date.format %]</div>
+ <br/>
+
+ [% user.family_name %], [% user.first_given_name %]
+ <ol>
+ [% FOR xact IN user.open_billable_transactions_summary %]
+ <li>
+ <div>Details:
+ [% IF xact.xact_type == 'circulation' %]
+ [%- helpers.get_copy_bib_basics(xact.circulation.target_copy).title -%]
+ [% ELSE %]
+ [%- xact.last_billing_type -%]
+ [% END %]
+ </div>
+ <div>Total Billed: [% xact.total_owed %]</div>
+ <div>Total Paid: [% xact.total_paid %]</div>
+ <div>Balance Owed : [% xact.balance_owed %]</div>
+ </li>
+ [% END %]
+ </ol>
+</div>
+$$
+);
+
+
+INSERT INTO action_trigger.environment ( event_def, path) VALUES
+ ( 13, 'open_billable_transactions_summary.circulation' );
+
--- /dev/null
+BEGIN;
+
+INSERT INTO config.upgrade_log (version) VALUES ('0112');
+
+INSERT INTO action_trigger.hook (key, core_type, description, passive)
+ VALUES (
+ 'format.selfcheck.fines',
+ 'au',
+ 'Formats fines for self-checkout receipt',
+ TRUE
+ );
+
+INSERT INTO action_trigger.event_definition (id, active, owner, name, hook, validator, reactor, granularity, template )
+ VALUES (
+ 13,
+ TRUE,
+ 1,
+ 'Self-Checkout Fines Receipt',
+ 'format.selfcheck.fines',
+ 'NOOP_True',
+ 'ProcessTemplate',
+ 'print-on-demand',
+$$
+[%- USE date -%]
+[%- SET user = target -%]
+<div>
+ <style> li { padding: 8px; margin 5px; }</style>
+ <div>[% date.format %]</div>
+ <br/>
+
+ [% user.family_name %], [% user.first_given_name %]
+ <ol>
+ [% FOR xact IN user.open_billable_transactions_summary %]
+ <li>
+ <div>Details:
+ [% IF xact.xact_type == 'circulation' %]
+ [%- helpers.get_copy_bib_basics(xact.circulation.target_copy).title -%]
+ [% ELSE %]
+ [%- xact.last_billing_type -%]
+ [% END %]
+ </div>
+ <div>Total Billed: [% xact.total_owed %]</div>
+ <div>Total Paid: [% xact.total_paid %]</div>
+ <div>Balance Owed : [% xact.balance_owed %]</div>
+ </li>
+ [% END %]
+ </ol>
+</div>
+$$
+);
+
+
+INSERT INTO action_trigger.environment ( event_def, path) VALUES
+ ( 13, 'open_billable_transactions_summary.circulation' );
+
+COMMIT;
var self = this;
var handler = function(dataList) {
+ self.finesCount = dataList.length;
for(var i in dataList) {
var data = dataList[i];
var row = self.finesTemplate.cloneNode(true);
}
+/**
+ * Print a receipt for this user's items out
+ */
+SelfCheckManager.prototype.printFinesReceipt = function(callback) {
+
+ progressDialog.show(true);
+
+ var params = [
+ this.authtoken,
+ this.staff.ws_ou(),
+ null,
+ 'format.selfcheck.fines',
+ 'print-on-demand',
+ [this.patron.id()]
+ ];
+
+ var self = this;
+ fieldmapper.standardRequest(
+ ['open-ils.circ', 'open-ils.circ.fire_user_trigger_events'],
+ {
+ async : true,
+ params : params,
+ oncomplete : function(r) {
+ progressDialog.hide();
+ var resp = openils.Util.readResponse(r);
+ var output = resp.template_output();
+ if(output) {
+ self.printData(output.data(), self.finesCount, callback);
+ } else {
+ var error = resp.error_output();
+ if(error) {
+ throw new Error("Error creating receipt: " + error.data());
+ } else {
+ throw new Error("No receipt data returned from server");
+ }
+ }
+ }
+ }
+ );
+}
+
+
/**
<tr>
<td>Type</td>
<td>Details</td>
- <td>Total Owed</td>
+ <td>Total Billed</td>
<td>Total Paid</td>
<td>Balance Owed</td>
</tr>