From 93787bddf67beea941f19ce5a312241230a064b3 Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Thu, 14 Jul 2022 10:23:48 -0400 Subject: [PATCH] LP1904036 Copy SQL seed data into 950 file Signed-off-by: Bill Erickson Signed-off-by: Jane Sandberg Signed-off-by: Galen Charlton --- Open-ILS/src/sql/Pg/950.data.seed-values.sql | 638 +++++++++++++++++++++++++++ 1 file changed, 638 insertions(+) diff --git a/Open-ILS/src/sql/Pg/950.data.seed-values.sql b/Open-ILS/src/sql/Pg/950.data.seed-values.sql index 2ee20c8e6f..c190f811fb 100644 --- a/Open-ILS/src/sql/Pg/950.data.seed-values.sql +++ b/Open-ILS/src/sql/Pg/950.data.seed-values.sql @@ -22552,3 +22552,641 @@ VALUES ( 'cwst', 'label' ) ); + +INSERT INTO config.print_template + (name, label, owner, active, locale, content_type, template) +VALUES ('items_out', 'Patron Items Out', 1, TRUE, 'en-US', 'text/html', ''); + +UPDATE config.print_template SET template = $TEMPLATE$ +[% + USE date; + circulations = template_data.circulations; +%] +
+
Welcome to [% staff_org.name %]
+
You have the following items:
+
+
    + [% FOR checkout IN circulations %] +
  1. +
    [% checkout.title %]
    +
    + [% IF checkout.copy %]Barcode: [% checkout.copy.barcode %][% END %] + Due: [% date.format(helpers.format_date(checkout.dueDate, staff_org_timezone), '%x %r') %] +
    +
  2. + [% END %] +
+
+
[% staff_org.name %] [% date.format(date.now, '%x %r') %]
+
You were helped by [% staff.first_given_name %]
+
+
+$TEMPLATE$ WHERE name = 'items_out'; + +UPDATE config.print_template SET active = TRUE WHERE name = 'patron_address'; + +-- 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', ''); + + +UPDATE config.print_template SET template = $TEMPLATE$ +[% + USE date; + USE money = format('$%.2f'); + SET xacts = template_data.xacts; +%] +
+ +
Welcome to [% staff_org.name %]
+
You have the following bills:
+
+
    + [% FOR xact IN xacts %] +
  1. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Bill #:[% xact.id %]
    Date:[% date.format(helpers.format_date( + xact.xact_start, staff_org_timezone), '%x %r') %] +
    Last Billing:[% xact.last_billing_type %]
    Total Billed:[% money(xact.total_owed) %]
    Last Payment: + [% xact.last_payment_type %] + [% IF xact.last_payment_ts %] + at [% date.format( + helpers.format_date( + xact.last_payment_ts, staff_org_timezone), '%x %r') %] + [% END %] +
    Total Paid:[% money(xact.total_paid) %]
    Balance:[% money(xact.balance_owed) %]
    +
  2. + [% END %] +
+
+
[% staff_org.name %] [% date.format(date.now, '%x %r') %]
+
You were helped by [% staff.first_given_name %]
+
+
+$TEMPLATE$ WHERE name = 'bills_current'; + + +INSERT INTO config.print_template + (name, label, owner, active, locale, content_type, template) +VALUES ('bills_payment', 'Bills, Payment', 1, TRUE, 'en-US', 'text/html', ''); + +UPDATE config.print_template SET template = $TEMPLATE$ +[% + USE date; + USE money = format('$%.2f'); + SET payments = template_data.payments; + SET previous_balance = template_data.previous_balance; + SET new_balance = template_data.new_balance; + SET payment_type = template_data.payment_type; + SET payment_total = template_data.payment_total; + SET payment_applied = template_data.payment_applied; + SET amount_voided = template_data.amount_voided; + SET change_given = template_data.change_given; + SET payment_note = template_data.payment_note; + SET copy_barcode = template_data.copy_barcode; + SET title = template_data.title; +%] +
+ +
Welcome to [% staff_org.name %]
+
A receipt of your transaction:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Original Balance:[% money(previous_balance) %]
Payment Method: + [% SWITCH payment_type %] + [% CASE "cash_payment" %]Cash + [% CASE "check_payment" %]Check + [% CASE "credit_card_payment" %]Credit Card + [% CASE "debit_card_payment" %]Debit Card + [% CASE "credit_payment" %]Patron Credit + [% CASE "work_payment" %]Work + [% CASE "forgive_payment" %]Forgive + [% CASE "goods_payment" %]Goods + [% END %] +
Payment Received:[% money(payment_total) %]
Payment Applied:[% money(payment_applied) %]
Billings Voided:[% money(amount_voided) %]
Change Given:[% money(change_given) %]
New Balance:[% money(new_balance) %]
+

Note: [% payment_note %]

+

+ Specific Bills +

+ [% FOR payment IN payments %] + + + + + + + [% IF payment.copy_barcode %] + + + + [% END %] +
Bill # [% payment.xact.id %][% payment.xact.summary.last_billing_type %]Received: [% money(payment.amount) %]
[% payment.copy_barcode %] [% payment.title %]
+
+ [% END %] +
+

+
+

+
[% staff_org.name %] [% date.format(date.now, '%x %r') %]
+
You were helped by [% staff.first_given_name %]
+
+$TEMPLATE$ WHERE name = 'bills_payment'; + + +INSERT INTO config.print_template + (name, label, owner, active, locale, content_type, template) +VALUES ('patron_data', 'Patron Data', 1, TRUE, 'en-US', 'text/html', ''); + +UPDATE config.print_template SET template = $TEMPLATE$ +[% + USE date; + USE money = format('$%.2f'); + SET patron = template_data.patron; +%] + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + [% FOR addr IN patron.addresses %] + + + + + + + + + + + + [% END %] + + [% FOR entry IN patron.stat_cat_entries %] + + + [% END %] + +
Barcode:[% patron.card.barcode %]
Patron's Username:[% patron.usrname %]
Prefix/Title:[% patron.prefix %]
First Name:[% patron.first_given_name %]
Middle Name:[% patron.second_given_name %]
Last Name:[% patron.family_name %]
Suffix:[% patron.suffix %]
Holds Alias:[% patron.alias %]
Date of Birth:[% patron.dob %]
Juvenile:[% patron.juvenile %]
Primary Identification Type:[% patron.ident_type.name %]
Primary Identification:[% patron.ident_value %]
Secondary Identification Type:[% patron.ident_type2.name %]
Secondary Identification:[% patron.ident_value2 %]
Email Address:[% patron.email %]
Daytime Phone:[% patron.day_phone %]
Evening Phone:[% patron.evening_phone %]
Other Phone:[% patron.other_phone %]
Home Library:[% patron.home_ou.name %]
Main (Profile) Permission Group:[% patron.profile.name %]
Privilege Expiration Date:[% patron.expire_date %]
Internet Access Level:[% patron.net_access_level.name %]
Active:[% patron.active %]
Barred:[% patron.barred %]
Is Group Lead Account:[% patron.master_account %]
Claims-Returned Count:[% patron.claims_returned_count %]
Claims-Never-Checked-Out Count:[% patron.claims_never_checked_out_count %]
Alert Message:[% patron.alert_message %]
----------
Type:[% addr.address_type %]
Street (1):[% addr.street1 %]
Street (2):[% addr.street2 %]
City:[% addr.city %]
County:[% addr.county %]
State:[% addr.state %]
Postal Code:[% addr.post_code %]
Country:[% addr.country %]
Valid Address?:[% addr.valid %]
Within City Limits?:[% addr.within_city_limits %]
-----------
[% entry.stat_cat.name %][% entry.stat_cat_entry %]
+ +$TEMPLATE$ WHERE name = 'patron_data'; + + +INSERT INTO config.print_template + (name, label, owner, active, locale, content_type, template) +VALUES ('hold_shelf_slip', 'Hold Shelf Slip', 1, TRUE, 'en-US', 'text/html', ''); + + +UPDATE config.print_template SET template = $TEMPLATE$ +[% + USE date; + USE money = format('$%.2f'); + SET copy = template_data.checkin.copy; + SET hold = template_data.checkin.hold; + SET volume = template_data.checkin.volume; + SET hold = template_data.checkin.hold; + SET record = template_data.checkin.record; + SET patron = template_data.checkin.patron; +%] + +
+ [% IF hold.behind_desk == 't' %] + This item needs to be routed to the Private Holds Shelf. + [% ELSE %] + This item needs to be routed to the Public Holds Shelf. + [% END %] +
+
+ +
Barcode: [% copy.barcode %]
+
Title: [% checkin.title %]
+
Call Number: [% volume.prefix.label %] [% volume.label %] [% volume.suffix.label %]
+ +
+ +
Hold for patron: [% patron.family_name %], + [% patron.first_given_name %] [% patron.second_given_name %]
+
Barcode: [% patron.card.barcode %]
+ +[% IF hold.phone_notify %] +
Notify by phone: [% hold.phone_notify %]
+[% END %] +[% IF hold.sms_notify %] +
Notify by text: [% hold.sms_notify %]
+[% END %] +[% IF hold.email_notify %] +
Notify by email: [% patron.email %]
+[% END %] + +[% FOR note IN hold.notes %] +
    + [% IF note.slip == 't' %] +
  • [% note.title %] - [% note.body %]
  • + [% END %] +
+[% END %] +
+ +
Request Date: [% + date.format(helpers.format_date(hold.request_time, staff_org_timezone), '%x %r') %]
+
Slip Date: [% date.format(date.now, '%x %r') %]
+
Printed by [% staff.first_given_name %] at [% staff_org.shortname %]
+ + + +$TEMPLATE$ WHERE name = 'hold_shelf_slip'; + + +INSERT INTO config.print_template + (name, label, owner, active, locale, content_type, template) +VALUES ('transit_slip', 'Transit Slip', 1, TRUE, 'en-US', 'text/html', ''); + + +UPDATE config.print_template SET template = $TEMPLATE$ +[% + USE date; + USE money = format('$%.2f'); + SET checkin = template_data.checkin; + SET copy = checkin.copy; + SET destOrg = checkin.destOrg; + SET destAddress = checkin.destAddress; + SET destCourierCode = checkin.destCourierCode; +%] +
+
This item needs to be routed to [% destOrg.shortname %]
+
[% destOrg.name %]
+ [% IF destCourierCode %]Courier Code: [% destCourierCode %][% END %] + + [% IF destAddress %] +
[% destAddress.street1 %]
+
[% destAddress.street2 %]
+
[% destAddress.city %], + [% destAddress.state %] + [% destAddress.post_code %]
+ [% ELSE %] +
We do not have a holds address for this library.
+ [% END %] + +
+
Barcode: [% copy.barcode %]
+
Title: [% checkin.title %]
+
Author: [% checkin.author %]
+ +
+
Slip Date: [% date.format(date.now, '%x %r') %]
+
Printed by [% staff.first_given_name %] at [% staff_org.shortname %]
+
+ +$TEMPLATE$ WHERE name = 'transit_slip'; + + +INSERT INTO config.print_template + (name, label, owner, active, locale, content_type, template) +VALUES ('hold_transit_slip', 'Hold Transit Slip', 1, TRUE, 'en-US', 'text/html', ''); + +UPDATE config.print_template SET template = $TEMPLATE$ +[% + USE date; + USE money = format('$%.2f'); + SET checkin = template_data.checkin; + SET copy = checkin.copy; + SET hold = checkin.hold; + SET patron = checkin.patron; + SET destOrg = checkin.destOrg; + SET destAddress = checkin.destAddress; + SET destCourierCode = checkin.destCourierCode; +%] +
+
This item needs to be routed to [% destOrg.shortname %]
+
[% destOrg.name %]
+ [% IF destCourierCode %]Courier Code: [% destCourierCode %][% END %] + + [% IF destAddress %] +
[% destAddress.street1 %]
+
[% destAddress.street2 %]
+
[% destAddress.city %], + [% destAddress.state %] + [% destAddress.post_code %]
+ [% ELSE %] +
We do not have a holds address for this library.
+ [% END %] + +
+
Barcode: [% copy.barcode %]
+
Title: [% checkin.title %]
+
Author: [% checkin.author %]
+ +
+
Hold for patron [% patron.card.barcode %]
+ +
+
Request Date: [% + date.format(helpers.format_date(hold.request_time, staff_org_timezone), '%x %r') %] +
+
Slip Date: [% date.format(date.now, '%x %r') %]
+
Printed by [% staff.first_given_name %] at [% staff_org.shortname %]
+
+ +$TEMPLATE$ WHERE name = 'transit_slip'; + +INSERT INTO config.print_template + (name, label, owner, active, locale, content_type, template) +VALUES ('checkin', 'Checkin', 1, TRUE, 'en-US', 'text/html', ''); + +UPDATE config.print_template SET template = $TEMPLATE$ +[% + USE date; + USE money = format('$%.2f'); + SET checkins = template_data.checkins; +%] + +
+
Welcome to [% staff_org.name %]
+
You checked in the following items:
+
+
    + [% FOR checkin IN checkins %] +
  1. +
    [% checkin.title %]
    + Barcode: + [% checkin.copy.barcode %] + Call Number: + + [% IF checkin.volume %] + [% volume.prefix.label %] [% volume.label %] [% volume.suffix.label %] + [% ELSE %] + Not Cataloged + [% END %] + +
  2. + [% END %] +
+
+
Slip Date: [% date.format(date.now, '%x %r') %]
+
Printed by [% staff.first_given_name %] at [% staff_org.shortname %]
+
+ +$TEMPLATE$ WHERE name = 'checkin'; + + +INSERT INTO config.print_template + (name, label, owner, active, locale, content_type, template) +VALUES ('holds_for_patron', 'Holds For Patron', 1, TRUE, 'en-US', 'text/html', ''); + + +UPDATE config.print_template SET template = $TEMPLATE$ +[% + USE date; + USE money = format('$%.2f'); + SET holds = template_data; +%] + +
+
Welcome to [% staff_org.name %]
+
You have the following items on hold:
+
+
    + [% FOR hold IN holds %] +
  1. +
    [% hold.title %]
    +
  2. + [% END %] +
+
+
Slip Date: [% date.format(date.now, '%x %r') %]
+
Printed by [% staff.first_given_name %] at [% staff_org.shortname %]
+
+ +$TEMPLATE$ WHERE name = 'holds_for_patron'; + + +INSERT INTO config.print_template + (name, label, owner, active, locale, content_type, template) +VALUES ('bills_historical', 'Bills, Historical', 1, TRUE, 'en-US', 'text/html', ''); + + +UPDATE config.print_template SET template = $TEMPLATE$ +[% + USE date; + USE money = format('$%.2f'); + SET xacts = template_data.xacts; +%] +
+ +
Welcome to [% staff_org.name %]
+
You have the following bills:
+
+
    + [% FOR xact IN xacts %] +
  1. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Bill #:[% xact.id %]
    Date:[% date.format(helpers.format_date( + xact.xact_start, staff_org_timezone), '%x %r') %] +
    Last Billing:[% xact.last_billing_type %]
    Total Billed:[% money(xact.total_owed) %]
    Last Payment: + [% xact.last_payment_type %] + [% IF xact.last_payment_ts %] + at [% date.format( + helpers.format_date( + xact.last_payment_ts, staff_org_timezone), '%x %r') %] + [% END %] +
    Total Paid:[% money(xact.total_paid) %]
    Balance:[% money(xact.balance_owed) %]
    +
  2. + [% END %] +
+
+
[% staff_org.name %] [% date.format(date.now, '%x %r') %]
+
You were helped by [% staff.first_given_name %]
+
+
+$TEMPLATE$ WHERE name = 'bills_historical'; + +INSERT INTO config.print_template + (name, label, owner, active, locale, content_type, template) +VALUES ('checkout', 'Checkout', 1, TRUE, 'en-US', 'text/html', ''); + +UPDATE config.print_template SET template = $TEMPLATE$ +[% + USE date; + USE money = format('$%.2f'); + SET checkouts = template_data.checkouts; +%] + +
+
Welcome to [% staff_org.name %]
+
You checked out the following items:
+
+
    + [% FOR checkout IN checkouts %] +
  1. +
    [% checkout.title %]
    + Barcode: + [% checkout.copy.barcode %] + Call Number: + + [% IF checkout.volume %] + [% volume.prefix.label %] [% volume.label %] [% volume.suffix.label %] + [% ELSE %] + Not Cataloged + [% END %] + +
  2. + [% END %] +
+
+
Slip Date: [% date.format(date.now, '%x %r') %]
+
Printed by [% staff.first_given_name %] at [% staff_org.shortname %]
+
+ +$TEMPLATE$ WHERE name = 'checkout'; + +INSERT INTO config.print_template + (name, label, owner, active, locale, content_type, template) +VALUES ('renew', 'renew', 1, TRUE, 'en-US', 'text/html', ''); + +UPDATE config.print_template SET template = $TEMPLATE$ +[% + USE date; + USE money = format('$%.2f'); + SET renewals = template_data.renewals; +%] + +
+
Welcome to [% staff_org.name %]
+
You renewed the following items:
+
+
    + [% FOR renewal IN renewals %] +
  1. +
    [% renewal.title %]
    + Barcode: + [% renewal.copy.barcode %] + Call Number: + + [% IF renewal.volume %] + [% volume.prefix.label %] [% volume.label %] [% volume.suffix.label %] + [% ELSE %] + Not Cataloged + [% END %] + +
  2. + [% END %] +
+
+
Slip Date: [% date.format(date.now, '%x %r') %]
+
Printed by [% staff.first_given_name %] at [% staff_org.shortname %]
+
+ +$TEMPLATE$ WHERE name = 'renew'; + -- 2.11.0