From: Suzanne Paterno Date: Thu, 10 Aug 2017 17:15:39 +0000 (-0400) Subject: LP #1688398 X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=refs%2Fheads%2Fuser%2Fspaterno%2Flp1688398_credit_card_improvements;p=working%2FEvergreen.git LP #1688398 -Changed table layout of the credit card charges on the Accout screen. Moved check boxed to left of screen, added a column for Billing Type. -Add button to Pay Selected vs All Charges. -Include image of credit cards accepted (need to update with one with AmEx) -Reformatted page for inputting credit card -Updated confirmation screen to bold amount, and list the titles as the ones the user is paying for. -Changed Print reciept template in seed data to look more readable and like other itemized reciepts. Signed-off-by: Suzanne Paterno --- 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 c40c86dbcc..fecf1eb96c 100644 --- a/Open-ILS/src/sql/Pg/950.data.seed-values.sql +++ b/Open-ILS/src/sql/Pg/950.data.seed-values.sql @@ -11341,64 +11341,56 @@ $$ 'xact.usr', 'print-on-demand', $$ + [%- USE date -%][%- SET user = target.0.xact.usr -%] -
-
[% date.format %]

+
+ + +
+
+ [% date.format %] +

+ + [% SET grand_total = 0.00 %]
    [% SET xact_mp_hash = {} %] - [% FOR mp IN target %][%# Template is hooked around payments, but let us make the receipt focused on transactions %] + [% FOR mp IN target %][%# Create an array of transactions/amount paid for each payment made %] [% SET xact_id = mp.xact.id %] - [% IF ! xact_mp_hash.defined( xact_id ) %][% xact_mp_hash.$xact_id = { 'xact' => mp.xact, 'payments' => [] } %][% END %] - [% xact_mp_hash.$xact_id.payments.push(mp) %] + [% SET amount = mp.amount %] + [% IF ! xact_mp_hash.defined( xact_id ) %] + [% xact_mp_hash.$xact_id = { 'xact' => mp.xact, 'payment' => amount } %] + [% END %] [% END %] + [% FOR xact_id IN xact_mp_hash.keys.sort %] [% SET xact = xact_mp_hash.$xact_id.xact %] -
  1. Transaction ID: [% xact_id %] - [% IF xact.circulation %][% helpers.get_copy_bib_basics(xact.circulation.target_copy).title %] - [% ELSE %]Miscellaneous - [% END %] - Line item billings:
      - [% SET mb_type_hash = {} %] - [% FOR mb IN xact.billings %][%# Group billings by their btype %] - [% IF mb.voided == 'f' %] - [% SET mb_type = mb.btype.id %] - [% IF ! mb_type_hash.defined( mb_type ) %][% mb_type_hash.$mb_type = { 'sum' => 0.00, 'billings' => [] } %][% END %] - [% IF ! mb_type_hash.$mb_type.defined( 'first_ts' ) %][% mb_type_hash.$mb_type.first_ts = mb.billing_ts %][% END %] - [% mb_type_hash.$mb_type.last_ts = mb.billing_ts %] - [% mb_type_hash.$mb_type.sum = mb_type_hash.$mb_type.sum + mb.amount %] - [% mb_type_hash.$mb_type.billings.push( mb ) %] - [% END %] - [% END %] - [% FOR mb_type IN mb_type_hash.keys.sort %] -
    1. [% IF mb_type == 1 %][%# Consolidated view of overdue billings %] - $[% mb_type_hash.$mb_type.sum %] for [% mb_type_hash.$mb_type.billings.0.btype.name %] - on [% mb_type_hash.$mb_type.first_ts %] through [% mb_type_hash.$mb_type.last_ts %] - [% ELSE %][%# all other billings show individually %] - [% FOR mb IN mb_type_hash.$mb_type.billings %] - $[% mb.amount %] for [% mb.btype.name %] on [% mb.billing_ts %] [% mb.note %] - [% END %] - [% END %]
    2. - [% END %] -
    - Line item payments:
      - [% FOR mp IN xact_mp_hash.$xact_id.payments %] -
    1. Payment ID: [% mp.id %] - Paid [% mp.amount %] via [% SWITCH mp.payment_type -%] - [% CASE "cash_payment" %]cash - [% CASE "check_payment" %]check - [% CASE "credit_card_payment" %]credit card - [%- IF mp.credit_card_payment.cc_number %] ([% mp.credit_card_payment.cc_number %])[% END %] - [% CASE "credit_payment" %]credit - [% CASE "forgive_payment" %]forgiveness - [% CASE "goods_payment" %]goods - [% CASE "work_payment" %]work - [%- END %] on [% mp.payment_ts %] [% mp.note %] -
    2. - [% END %] -
    +
  2. + Transaction ID: [% xact_mp_hash.$xact_id.xact.id %]
    + [% IF xact.circulation %] + Title: "[% helpers.get_copy_bib_basics(xact.circulation.target_copy).title %]"
    + [% END %] + + [%# Go get all the date needed from xact_summary %] + + [% SET mbts = xact.summary %] + + Transaction Type: [% mbts.last_billing_type%]
    + Date: [% mbts.last_billing_ts %]
    + + Note: [% mbts.last_billing_note %]
    + + Amount: $[% xact_mp_hash.$xact_id.payment | format("%.2f") %] + [% grand_total = grand_total + xact_mp_hash.$xact_id.payment %]
  3. +
    [% END %]
+ +
+ Payment Type: Credit Card
+ Total: $[% grand_total | format("%.2f") %] +
+
$$ ) diff --git a/Open-ILS/src/templates/opac/css/style.css.tt2 b/Open-ILS/src/templates/opac/css/style.css.tt2 index bdbb2d3b1c..aade957dc9 100644 --- a/Open-ILS/src/templates/opac/css/style.css.tt2 +++ b/Open-ILS/src/templates/opac/css/style.css.tt2 @@ -1214,9 +1214,17 @@ div.result_table_utils_cont { float:right; padding: 15px 0px 0px 23px; [% END -%] - background-color: [% css_colors.accent_ultralight %]; width: 177px; - height: 166px; +} + +.cc_logo_img +{ + width: 79%; + [% IF rtl == 't' -%] + padding-right: .5em; + [% ELSE -%] + padding-left: .5em; + [% END -%] } #myopac_sum_fines_placehold { @@ -1245,23 +1253,91 @@ div.result_table_utils_cont { [% END -%] } -#acct_checked_main_header, #acct_holds_main_header, #acct_checked_hist_header, #acct_holds_hist_header, #acct_list_header, #acct_list_header_anon, #temp_list_holds, #acct_messages_main_header, #ebook_circs_main_table, #ebook_holds_main_table { +#acct_checked_main_header, #acct_holds_main_header, #acct_fines_main_header, #acct_fees_main_header, #acct_checked_hist_header, #acct_holds_hist_header, #acct_list_header, #acct_list_header_anon, #temp_list_holds, #acct_messages_main_header, #ebook_circs_main_table, #ebook_holds_main_table { border-collapse: collapse; } +.acct_fines_header +{ + width: 100%; + padding-bottom:1em; + [% IF rtl == 't' -%] + float: right; + [% ELSE -%] + float:left; + [% END -%] +} + +/* tables for entering payment information */ +#acct_fines_main_header, +#acct_fees_main_header +{ + width: 100%; +} + +/* tables for entering payment information */ +#billing_info_table +{ + width: auto; + [% IF rtl == 't' -%] + float: right; + [% ELSE -%] + float:left; + [% END -%] + display:inline; + padding-left: 1em; + padding-right: 1em; +} + +/* tables for entering payment information */ +#credit_card_info_table +{ + width: auto; + display: block; +} + +/* tables for entering payment information */ +#billing_info_table td, +#credit_card_info_table td +{ + [% IF rtl == 't' -%] + padding-right: .5em; + [% ELSE -%] + padding-left: .5em; + [% END -%] + +} + +/* div for the payment buttons with the total */ +#payment_actions +{ + width: auto; + display: block; + padding: 1em 0 0 1em; + text-align:center; +} + +/* text to state what is seen on cc statement */ +.cc_disclaimer +{ + font-style:italic; + font-size: 90%; + color:[% css_colors.primary_fade %]; +} + .hold_notes { text-transform: none; font-weight: normal; } .hold_note_title { font-weight: bold; } - -#acct_checked_main_header td, #acct_holds_main_header td, #acct_checked_hist_header td, #acct_holds_hist_header td, #acct_list_header td, #acct_list_header_anon td, #temp_list_holds td, #acct_messages_main_header, #ebook_circs_main_table td, #ebook_holds_main_table td { - background-color: [% css_colors.accent_lighter2 %]; +#acct_checked_main_header td, #acct_holds_main_header td, #acct_fines_main_header td, #acct_fines_confirm_header td, #acct_fees_main_header td,#acct_checked_hist_header td, #acct_holds_hist_header td, #acct_list_header td, #acct_list_header_anon td, #temp_list_holds td, #acct_messages_main_header td, #ebook_circs_main_table td, #ebook_holds_main_table td { + background-color: [% css_colors.background %]; padding: 10px; -} + border: 1px solid #d3d3d3; +} -#acct_checked_main_header th, #acct_holds_main_header th, #acct_checked_hist_header th, acct_holds_hist_header th, #acct_list_header th, #acct_list_header_anon th, #temp_list_holds th, #acct_messages_main_header, #ebook_circs_main_table th, #ebook_holds_main_table th { +#acct_checked_main_header th, #acct_holds_main_header th, #acct_fines_main_header th, #acct_fines_confirm_header th, #acct_fees_main_header th, #acct_checked_hist_header th, #acct_holds_hist_header th, #acct_list_header th, #acct_list_header_anon th, #temp_list_holds th, #acct_messages_main_header th, #ebook_holds_main_table th { [% IF rtl == 't' -%] text-align: right; [% ELSE -%] @@ -1324,6 +1400,12 @@ div.result_table_utils_cont { .myopac_payments_table form { display: inline; } .myopac_payments_table input[type="submit"] { padding: 1px; } +.cc_header +{ + padding-top:1em; + background-color: [% css_colors.accent_lighter %]; +} + .payment-error { font-weight: bold; color: [% css_colors.text_alert %]; padding: 10px; border: 1px solid [% css_colors.accent_medium_dark %]; diff --git a/Open-ILS/src/templates/opac/myopac/main.tt2 b/Open-ILS/src/templates/opac/myopac/main.tt2 index 6df2c7f2f1..c8f18f0714 100644 --- a/Open-ILS/src/templates/opac/myopac/main.tt2 +++ b/Open-ILS/src/templates/opac/myopac/main.tt2 @@ -12,33 +12,46 @@ [% IF myopac_cc_allowed; # http://www.w3.org/TR/WCAG20-TECHS/H32.html # avoid forms w/ no submit action %] -
+ [% END %] [% IF ctx.fines.circulation.size > 0 %]
- + +
+ + + [% IF myopac_cc_allowed %] + [% l("Pay Selected Circulation Charges") %] + [% ELSE %] + [% l("Circulation Charges") %] + [% END %] + + +
+ +
+ - - - - - - - - - - [% IF myopac_cc_allowed %] - [% END %] + + + + + + + @@ -50,6 +63,24 @@ attrs.title = f.xact.reservation.target_resource_type.name; END %] + [% IF myopac_cc_allowed %] + + [% END %] + + + + + - - - - - - [% IF myopac_cc_allowed %] - - [% END %] + [% END %]
- [% l("Pay Selected Circulation Charges") %] -
[% l("Title") %][% l("Author") %][% l("Checkout Date") %][% l("Due Date") %][% l("Date Returned") %][% l("Balance Owed") %] + + [% IF myopac_cc_allowed %] + - - + title="[% l('Click to (un)select all charges') %]" /> + [% l("Owed") %][% l("Billing Type") %][% l("Title") %][% l("Checkout") %][% l(" Due ") %] + [% l(" Returned/Renewed") %] + [% l(" Returned*") %] +
+ + + + [% money(f.xact.balance_owed)%] + + + [% f.xact.last_billing_type %] + [% recid = f.xact.circulation.target_copy.call_number.record.id || f.xact.reservation.target_resource_type.record.id; IF recid; %] @@ -59,126 +90,117 @@ [% attrs.title | html %] [% END %] [%- author_query = attrs.author.replace('[,\.:;]', ''); %] - [% attrs.author | html %] - + + [% ts = f.xact.circulation.xact_start || f.xact.reservation.start_time || 0; IF ts; date.format(ctx.parse_datetime(ts), DATE_FORMAT); END %] + + [% ts = f.xact.circulation.due_date || f.xact.reservation.end_time || 0; IF ts; date.format(ctx.parse_datetime(ts), DATE_FORMAT); END %] + + [% ts = f.xact.circulation.checkin_time || f.xact.reservation.return_time || 0; IF ts; date.format(ctx.parse_datetime(ts), DATE_FORMAT); ELSE %] + here? --> [% l('(fines accruing)') %] [% END %] - - [% money(f.xact.balance_owed) %] - - - -
+ + *Items may have been renewed.
[% END %] [% IF ctx.fines.grocery.size > 0 %]
-
-
-
- +

+
+ + + [% IF myopac_cc_allowed %] + [% l("Pay Selected Other Charges") %] + [% ELSE %] + [% l("Other Charges") %] + [% END %] + + +
+ +
- - - - - - - - - - [% IF myopac_cc_allowed %] - [% END %] + + + + + + [% FOR f IN ctx.fines.grocery %] - - - - + [% END %] + + - [% IF myopac_cc_allowed %] + - [% END %] + + + [% END %]
- [% l("Pay Selected Other Charges") %] -
[% l("Transaction Start Time") %][% l("Last Payment Time") %][% l("Initial Amount Owed") %][% l("Total Amount Paid") %][% l("Balance Owed") %][% l("Billing Type") %] + + [% IF myopac_cc_allowed %] + - - + title="[% l('Click to (un)select all fines') %]" /> + [% l("Owed") %][% l("Billing Type") %][% l("Note") %] [% l("Date") %]
[% date.format( - ctx.parse_datetime(f.xact.xact_start), - DATE_FORMAT - ) %] - [% IF f.xact.last_payment_ts; - date.format( - ctx.parse_datetime( - f.xact.last_payment_ts - ), DATE_FORMAT - ); - END %] + + [% IF myopac_cc_allowed %] + + [% money(f.xact.total_owed) %][% money(f.xact.total_paid) %] [% money(f.xact.balance_owed) %] [% f.xact.last_billing_type %] - + [% f.xact.last_billing_note %] [% date.format( + ctx.parse_datetime(f.xact.xact_start), + DATE_FORMAT + ) %]
+
[% END %] [% UNLESS ctx.fines.grocery.size OR ctx.fines.circulation.size %]
[% l('You have no current fines.') %]
[% ELSIF myopac_cc_allowed %] -
+
- [% - l('Go back to try again or to cancel this payment attempt.') - %] + + [% l('Account Home') %] + [% l('Try Payment Again') %]

[% ELSE %]

[% l('Your payment has been approved.') %]

@@ -38,9 +38,11 @@ END %]

[ [% l('Print receipt') %] ]

[% ctx.printable_receipt.template_output.data %] +
[% ELSE %]
@@ -52,7 +54,7 @@ ) | html %]
[% END %] -

[ [% +

[ [% l("Back to Account Summary") %] ]

[% END %]
diff --git a/Open-ILS/src/templates/opac/myopac/main_payment_form.tt2 b/Open-ILS/src/templates/opac/myopac/main_payment_form.tt2 index 54d079297e..455af6a91c 100644 --- a/Open-ILS/src/templates/opac/myopac/main_payment_form.tt2 +++ b/Open-ILS/src/templates/opac/myopac/main_payment_form.tt2 @@ -10,11 +10,12 @@ ctx.get_org_setting(ctx.user.home_ou.id, 'credit.processor.stripe.enabled') AND ctx.get_org_setting(ctx.user.home_ou.id, 'credit.processor.default') == 'Stripe'; ctx.use_stripe = 1; END %] + +

[% l('Pay Charges') %]

[% IF ctx.fines.balance_owed <= 0 %]
- [% l("You either have no fines to pay or you have selected fines whose " _ - "total is non-positive. We cannot process non-positive amounts.") %] + [% l("The minimum amount you can pay is \$0.01.") %]
[% ELSE %] [% IF ctx.use_stripe %] @@ -26,17 +27,65 @@ [% END %]
[% IF last_chance %] -

[% l("Are you sure you are ready to charge [_1] to your credit card?", money(ctx.fines.balance_owed)) %]

+ +

[% l("Are you sure you are ready to charge ") %] + [% l("[_1] ", money(ctx.fines.balance_owed))%] + [% l("to your credit card?") %]

[% FOR k IN CGI.Vars; NEXT UNLESS k; FOR val IN CGI.param(k) %] [% END; END %] - - [% l('Cancel') %] + + + [% l('Cancel') %] + + + + + + + + + + [% + FOR f IN ctx.fines.circulation; + NEXT IF CGI.param('xact').size && + !CGI.param('xact').grep(f.xact.id).size; + attrs = {marc_xml => f.marc_xml}; + IF f.marc_xml; + PROCESS get_marc_attrs args=attrs; + ELSIF f.xact.reservation; + attrs.title = f.xact.reservation.target_resource_type.name; + END %] + + + + + [% + END; + FOR f IN ctx.fines.grocery; + NEXT IF CGI.param('xact_misc').size && + !CGI.param('xact_misc').grep(f.xact.id).size %] + + + + + [% END %] + +
[% l('Charge/Fee') %][% l('Amount') %]
[% attrs.title | html %][% money(f.xact.balance_owed) %]
[% f.xact.last_billing_type | html %][% money(f.xact.balance_owed) %]
+ +

+ [% l("Are you sure you are ready to charge ") %] + [% l("[_1] ", money(ctx.fines.balance_owed))%] + [% l("to your credit card?") %]

+ + [% l('Cancel') %] [% ELSE %] - [% END %] - - - - - - - - +
[% l('Billing Information') %] -

[% l('Selected fines you are paying for:') %]

- - - - - - - - - [% - FOR f IN ctx.fines.circulation; - NEXT IF CGI.param('xact').size && - !CGI.param('xact').grep(f.xact.id).size; - attrs = {marc_xml => f.marc_xml}; - IF f.marc_xml; - PROCESS get_marc_attrs args=attrs; - ELSIF f.xact.reservation; - attrs.title = f.xact.reservation.target_resource_type.name; - END %] - - - - - [% - END; - FOR f IN ctx.fines.grocery; - NEXT IF CGI.param('xact_misc').size && - !CGI.param('xact_misc').grep(f.xact.id).size %] - - - - - [% END %] - -
[% l('Name') %][% l('Amount') %]
[% attrs.title | html %][% money(f.xact.balance_owed) %]
[% f.xact.last_billing_type | html %][% money(f.xact.balance_owed) %]
-
-
- [% l('Total amount to pay:') %] - [% money(ctx.fines.balance_owed) %] -
-
- [% | l('', '') %]Click [_1]Cancel[_2] to go back and (un)select other fines.[% END %] -
+ + + + + + @@ -112,14 +116,17 @@ + + @@ -138,15 +145,23 @@ - + [% USE zip=String(ctx.user.billing_address.post_code) %] + + +
[% l('Billing Information') %]
- + + [% l("Update") %] -
+ + + - + - @@ -209,14 +226,24 @@ - + - [% INCLUDE "opac/parts/myopac/main_refund_policy.tt2" %] - + +
[% l('Credit Card Information') %][% l('Credit Card Information') %]
+ - + -
- - [% l('Cancel') %] - +
+ [% l('Total amount:') %] + [% money(ctx.fines.balance_owed) %]
+ + + [% l('Cancel') %] +
+ + +
+
+ [% INCLUDE "opac/parts/myopac/main_refund_policy.tt2" %] + [% END %]
diff --git a/Open-ILS/src/templates/opac/parts/myopac/main_base.tt2 b/Open-ILS/src/templates/opac/parts/myopac/main_base.tt2 index ded602185d..ea434eccfa 100644 --- a/Open-ILS/src/templates/opac/parts/myopac/main_base.tt2 +++ b/Open-ILS/src/templates/opac/parts/myopac/main_base.tt2 @@ -21,10 +21,16 @@ [% money(ctx.user_stats.fines.balance_owed) %]
[% IF (ctx.fines.grocery.size OR ctx.fines.circulation.size) AND ctx.get_org_setting(ctx.user.home_ou, 'credit.payments.allow') == 1 %] -
- [% END %] +
+
+ [% l('View Charges') %] + [% l('Credit Card Logo') %] + + [% ELSE %] +
+ [% END %]
[% END %] diff --git a/Open-ILS/web/images/credit_card_logo.png b/Open-ILS/web/images/credit_card_logo.png new file mode 100644 index 0000000000..7dc238b8e9 Binary files /dev/null and b/Open-ILS/web/images/credit_card_logo.png differ