}
}
],
+ 'cmd_copy_status_print_export' : [
+ ['command'],
+ function() {
+ try {
+ obj.list.on_all_fleshed =
+ function() {
+ try {
+ dump( obj.list.dump_csv() + '\n' );
+ //copy_to_clipboard(obj.list.dump_csv());
+ JSAN.use('util.print'); var print = new util.print();
+ print.simple(obj.list.dump_csv(),{'content_type':'text/plain'});
+ setTimeout(function(){ obj.list.on_all_fleshed = null; },0);
+ } catch(E) {
+ obj.error.standard_unexpected_error_alert('export',E);
+ }
+ }
+ obj.list.full_retrieve();
+ } catch(E) {
+ obj.error.standard_unexpected_error_alert('export',E);
+ }
+ }
+ ],
+
'cmd_add_items' : [
['command'],
function() {
if ( obj.test_barcode(barcode) ) { /* good */ } else { /* bad */ return; }
}
JSAN.use('circ.util');
- var copy = obj.network.simple_request( 'FM_ACP_RETRIEVE_VIA_BARCODE', [ barcode ]);
- if (copy == null) {
- throw('Something weird happened. null result');
- } else if (copy.ilsevent) {
- switch(copy.ilsevent) {
- case -1:
- obj.error.standard_network_error_alert();
- obj.controller.view.copy_status_barcode_entry_textbox.select();
- obj.controller.view.copy_status_barcode_entry_textbox.focus();
- break;
- case 1502 /* ASSET_COPY_NOT_FOUND */ :
- try { document.getElementById('last_scanned').setAttribute('value',barcode + ' was either mis-scanned or is not cataloged.'); } catch(E) {}
- obj.error.yns_alert(barcode + ' was either mis-scanned or is not cataloged.','Not Cataloged','OK',null,null,'Check here to confirm this message');
- obj.controller.view.copy_status_barcode_entry_textbox.select();
- obj.controller.view.copy_status_barcode_entry_textbox.focus();
- break;
- default:
- throw(copy);
- break;
- }
- } else {
- obj.network.simple_request('FM_ACP_DETAILS', [ ses(), copy.id() ], function(req) {
- try {
- var details = req.getResultObject();
- var msg = copy.barcode() + ' -- ';
- if (copy.call_number() == -1) msg += 'Item is a Pre-Cat. ';
- if (details.hold) msg += 'Item is captured for a Hold. ';
- if (details.transit) msg += 'Item is in Transit. ';
- if (details.circ && ! details.circ.checkin_time()) msg += 'Item is circulating. ';
- try { document.getElementById('last_scanned').setAttribute('value',msg); } catch(E) {}
- } catch(E) {
- alert(E);
+ obj.network.simple_request('FM_ACP_DETAILS_VIA_BARCODE', [ ses(), barcode ], function(req) {
+ try {
+ var details = req.getResultObject();
+ if (details == null) {
+ throw('Something weird happened. null result');
+ } else if (details.ilsevent) {
+ switch(details.ilsevent) {
+ case -1:
+ obj.error.standard_network_error_alert();
+ obj.controller.view.copy_status_barcode_entry_textbox.select();
+ obj.controller.view.copy_status_barcode_entry_textbox.focus();
+ return;
+ break;
+ case 1502 /* ASSET_COPY_NOT_FOUND */ :
+ try { document.getElementById('last_scanned').setAttribute('value',barcode + ' was either mis-scanned or is not cataloged.'); } catch(E) {}
+ obj.error.yns_alert(barcode + ' was either mis-scanned or is not cataloged.','Not Cataloged','OK',null,null,'Check here to confirm this message');
+ obj.controller.view.copy_status_barcode_entry_textbox.select();
+ obj.controller.view.copy_status_barcode_entry_textbox.focus();
+ return;
+ break;
+ default:
+ throw(details);
+ break;
+ }
}
- } );
- var my_mvr = obj.network.simple_request('MODS_SLIM_RECORD_RETRIEVE_VIA_COPY', [ copy.id() ]);
- if (document.getElementById('trim_list')) {
- var x = document.getElementById('trim_list');
- if (x.checked) { obj.list.trim_list = 20; } else { obj.list.trim_list = null; }
- }
- obj.list.append(
- {
- 'retrieve_id' : js2JSON( { 'renewable' : copy.circulations() ? 't' : 'f', 'copy_id' : copy.id(), 'acn_id' : (typeof copy.call_number() == 'object' ? copy.call_number().id() : copy.call_number()), 'barcode' : barcode, 'doc_id' : (typeof my_mvr.ilsevent == 'undefined' ? my_mvr.doc_id() : null ) } ),
- 'row' : {
- 'my' : {
- 'mvr' : my_mvr,
- 'acp' : copy,
- }
- },
- 'to_top' : true,
+ var msg = details.copy.barcode() + ' -- ';
+ if (details.copy.call_number() == -1) msg += 'Item is a Pre-Cat. ';
+ if (details.hold) msg += 'Item is captured for a Hold. ';
+ if (details.transit) msg += 'Item is in Transit. ';
+ if (details.circ && ! details.circ.checkin_time()) msg += 'Item is circulating. ';
+ try { document.getElementById('last_scanned').setAttribute('value',msg); } catch(E) {}
+ if (document.getElementById('trim_list')) {
+ var x = document.getElementById('trim_list');
+ if (x.checked) { obj.list.trim_list = 20; } else { obj.list.trim_list = null; }
}
- );
- obj.controller.view.copy_status_barcode_entry_textbox.value = '';
- obj.controller.view.copy_status_barcode_entry_textbox.focus();
- }
+ obj.list.append(
+ {
+ 'retrieve_id' : js2JSON(
+ {
+ 'renewable' : details.circ ? 't' : 'f',
+ 'copy_id' : details.copy.id(),
+ 'acn_id' : details.volume ? details.volume.id() : -1,
+ 'barcode' : barcode,
+ 'doc_id' : details.mvr ? details.mvr.doc_id() : null
+ }
+ ),
+ 'row' : {
+ 'my' : {
+ 'mvr' : details.mvr,
+ 'acp' : details.copy,
+ 'acn' : details.volume,
+ 'atc' : details.transit,
+ 'circ' : details.circ,
+ 'ahr' : details.hold,
+ }
+ },
+ 'to_top' : true,
+ }
+ );
+ } catch(E) {
+ obj.error.standard_unexpected_error_alert('',E);
+ }
+ } );
+ obj.controller.view.copy_status_barcode_entry_textbox.value = '';
+ obj.controller.view.copy_status_barcode_entry_textbox.focus();
+
} catch(E) {
obj.error.standard_unexpected_error_alert('',E);
obj.controller.view.copy_status_barcode_entry_textbox.select();
<caption label="Bills" style="color: red"/>
<tree id="bill_tree" flex="1" enableColumnDrag="true"/>
<hbox>
- <label value="Save Columns" class="click_link" onclick="g.bill_list.save_columns();"/>
- <label value="Copy to Clipboard" class="click_link" onclick="g.bill_list.clipboard();"/>
+ <button label="Save Columns" oncommand="g.bill_list.save_columns();"/>
+ <button label="Copy to Clipboard" oncommand="g.bill_list.clipboard();"/>
+ <button label="Print Export" oncommand="try { g.bill_list.on_all_fleshed = function() { JSAN.use('util.print'); var p = new util.print(); p.simple( g.bill_list.dump_csv(), { 'content_type' : 'text/plain' } ); setTimeout( function() { g.bill_list.on_all_fleshed = null; }, 0); }; g.bill_list.full_retrieve(); } catch(E) { alert(E); }"/>
<spacer flex="1"/>
<button id="void" label="Void selected billings" disabled="true"/>
</hbox>
<caption label="Payments" style="color: green"/>
<tree id="payment_tree" flex="1" enableColumnDrag="true"/>
<hbox>
- <label value="Save Columns" class="click_link" onclick="g.payment_list.save_columns();"/>
- <label value="Copy to Clipboard" class="click_link" onclick="g.payment_list.clipboard();"/>
+ <button label="Save Columns" oncommand="g.payment_list.save_columns();"/>
+ <button label="Copy to Clipboard" oncommand="g.payment_list.clipboard();"/>
+ <button label="Print Export" oncommand="try { g.payment_list.on_all_fleshed = function() { JSAN.use('util.print'); var p = new util.print(); p.simple( g.payment_list.dump_csv(), { 'content_type' : 'text/plain' } ); setTimeout( function() { g.payment_list.on_all_fleshed = null; }, 0); }; g.payment_list.full_retrieve(); } catch(E) { alert(E); }"/>
<spacer flex="1"/>
</hbox>
</groupbox>