Temp fix for Stripe bug when there are negative bills
authorTerran McCanna <tmccanna@georgialibraries.org>
Fri, 18 Mar 2022 20:14:37 +0000 (16:14 -0400)
committerChris Sharp <csharp@georgialibraries.org>
Mon, 15 Aug 2022 18:26:35 +0000 (14:26 -0400)
This just checks the billing rows and if any of them are
negative it hides the payment buttons and directs them to staff.

Signed-off-by: Terran McCanna <tmccanna@georgialibraries.org>
Open-ILS/src/templates-bootstrap/opac/myopac/charges.tt2

index 451fc0c..ca9e3d8 100755 (executable)
             </thead>
             <tbody id='myopac_trans_tbody'>
                 [% c = 0; %]
+                               <!-- temp: --> [% neg = 0; %]
                 [% FOR f IN ctx.fines.grocery %]
                 <tr class ='myopac_trans_row'>
                 [% c = c + 1; %]
                         <span class="sr-only">Amount Owed</span>
                         <strong>
                             [% money(f.xact.balance_owed) %]
+                                                       <!-- temp: --> [% IF f.xact.balance_owed < 0; neg = neg + 1; END %]
                         </strong>
                          <input type="hidden" class="fineAmount" value="[% f.xact.balance_owed %]" hidden />
                     </td>
     <div>[% l('You have no current fines.') %]</div>
     [% ELSIF myopac_cc_allowed %]
    
-    <div class="my-3">
-        <button type="submit" value="[% l('Pay selected charges') %] - [% money(ctx.user_stats.fines.balance_owed) %]" title="[% l('Pay selected charges') %]" class="btn btn-confirm my-1"
-            id="selectPay"> <i class='fas fa-money-bill-wave' aria-hidden="true"></i> [% l('Pay Selected Charges') %] - [% money(ctx.user_stats.fines.balance_owed) %]</button>
-    <button type="submit" class="btn btn-confirm my-1"><i class="fas fa-cash-register" aria-hidden="true"></i> [% l('Pay All Charges') %] - [% money(ctx.user_stats.fines.balance_owed) %]</button>
-    </div>
+           <!-- temp: -->
+                       [% IF neg > 0 %]
+                               There are negative bills on your account that must be resolved before you are able to make
+                               a payment. Please contact your library for assistance.
+                       [% ELSE %]
+                               <div class="my-3">
+                                       <button type="submit" value="[% l('Pay selected charges') %] - [% money(ctx.user_stats.fines.balance_owed) %]" title="[% l('Pay selected charges') %]" class="btn btn-confirm my-1"
+                                               id="selectPay"> <i class='fas fa-money-bill-wave' aria-hidden="true"></i> [% l('Pay Selected Charges') %] - [% money(ctx.user_stats.fines.balance_owed) %]</button>
+                               <button type="submit" class="btn btn-confirm my-1"><i class="fas fa-cash-register" aria-hidden="true"></i> [% l('Pay All Charges') %] - [% money(ctx.user_stats.fines.balance_owed) %]</button>
+                               </div>
+                       [% END %]
     [% END %]
 [% IF myopac_cc_allowed %]
 </form>