{title: 'Piano concerto no. 1 (1926) ; Rhapsody, op. 1 (1904)'},
{title: 'Piano concertos 2 & 3 & the devil makes me?'},
{title: 'Composition student recital, April 6, 2000, Huntington University / composition students of Daniel Bédard'},
+ ],
+ mbt: [
+ {id: 1, xact_start: new Date().toISOString()},
+ {id: 2, xact_start: new Date().toISOString()},
+ {id: 3, xact_start: new Date().toISOString()}
+ ],
+ mbts: [
+ { balance_owed: 1,
+ last_billing_note: 'a note',
+ last_billing_ts: new Date().toISOString(),
+ last_billing_type: 'Overdue Materials',
+ last_payment_note: '',
+ last_payment_ts: new Date().toISOString(),
+ last_payment_type: 'cash_payment',
+ total_owed: 5,
+ total_paid: 3,
+ xact_start: new Date().toISOString(),
+ xact_type: 'circulation'
+ }
]
};
const time = new Date().getTime();
return new Date(future ? time + rando : time - rando);
}
+
+ randomDateIso(future: boolean = false): string {
+ return this.randomDate(future).toISOString();
+ }
}
// Keys map to print template names
sampleData: any = {
patron_address: {},
- holds_for_bib: {}
+ holds_for_bib: {},
+ bills_current: {}
};
constructor(
// vanilla hashes are easier to work with in the admin UI.
// Classes for which sample data exists
- const classes = ['au', 'ac', 'aua', 'ahr', 'acp', 'mwde'];
+ const classes = ['au', 'ac', 'aua', 'ahr', 'acp', 'mwde', 'mbt', 'mbts'];
const samples: any = {};
classes.forEach(class_ => samples[class_] =
this.idl.toHash(this.samples.listOfThings(class_, 10)));
// Wide holds are hashes instead of IDL objects.
// Add fields as needed.
const wide_holds = [{
- request_time: this.samples.randomDate().toISOString(),
+ request_time: this.samples.randomDateIso(),
ucard_barcode: samples.ac[0].barcode,
usr_family_name: samples.au[0].family_name,
usr_alias: samples.au[0].alias,
cp_barcode: samples.acp[0].barcode
}, {
- request_time: this.samples.randomDate().toISOString(),
+ request_time: this.samples.randomDateIso(),
ucard_barcode: samples.ac[1].barcode,
usr_family_name: samples.au[1].family_name,
usr_alias: samples.au[1].alias,
};
this.sampleData.holds_for_bib = wide_holds;
+
+ // Flesh the summary
+ samples.mbt[0].summary = samples.mbts[0];
+ samples.mbt[1].summary = samples.mbts[1];
+ samples.mbt[2].summary = samples.mbts[2];
+
+ this.sampleData.bills_current.xacts = [
+ samples.mbt[0],
+ samples.mbt[1],
+ samples.mbt[2]
+ ];
}
onTabChange(evt: NgbTabChangeEvent) {
-- insert then update for easier iterative development tweaks
INSERT INTO config.print_template
(name, label, owner, active, locale, content_type, template)
-VALUES ('bills_current', 'Bills Current', 1, TRUE, 'en-US', 'text/html', '');
+VALUES ('bills_current', 'Bills, Current', 1, TRUE, 'en-US', 'text/html', '');
*/
UPDATE config.print_template SET template = $TEMPLATE$