Browse Source

General fixes

Samson Mutunga 1 year ago
parent
commit
7b2446abf6

+ 5 - 0
app/Helpers/helpers.php

@@ -1158,3 +1158,8 @@ if(!function_exists('get_custom_problems')) {
     }
 }
 
+if(!function_exists('camel_case')) {
+    function camel_case($string, $dontStrip = []) {
+        return lcfirst(str_replace(' ', '', ucwords(preg_replace('/[^a-z0-9'.implode('',$dontStrip).']+/', ' ',$string))));
+    }
+}

+ 2 - 2
resources/views/app/generic-invoices/index.blade.php

@@ -1,7 +1,7 @@
 <?php
 $invoices = \App\Models\Invoice::where($parentType === 'Note' ? 'note_id' : 'care_month_id', $parentID)->get();
 ?>
-<div id="generic-invoices-{{$parentType}}-{{$parentID}}">
+<div id="generic-invoices-{{camel_case($parentType)}}-{{$parentID}}">
     <div class="d-flex align-items-baseline pb-3">
         <h4 class="font-weight-bold m-0">Invoices</h4>
         <span class="text-secondary mx-2">|</span>
@@ -258,6 +258,6 @@ $invoices = \App\Models\Invoice::where($parentType === 'Note' ? 'note_id' : 'car
                     return false;
                 });
         }
-        addMCInitializer('generic-invoices-{{$parentType}}-{{$parentID}}', init, '#generic-invoices-{{$parentType}}-{{$parentID}}')
+        addMCInitializer('generic-invoices-{{camel_case($parentType)}}-{{$parentID}}', init, '#generic-invoices-{{camel_case($parentType)}}-{{$parentID}}')
     }).call(window);
 </script>

+ 6 - 12
resources/views/app/invoice-center/_ic-add-payment-method-moe.blade.php

@@ -4,11 +4,11 @@
         <input type="hidden" name="customerUid" value="{{$customer->uid}}">
         <p class="text-secondary font-weight-bold mb-1 text-nowrap">Add Payment Method</p>
         <div class="mb-2">
-            <lable class="mb-1 text-secondary text-sm">Card Number</lable>
+            <label class="mb-1 text-secondary text-sm">Card Number</label>
             <input type="text" name="cardNumber" value="" class="form-control form-control-sm min-width-200px" required>
         </div>
         <div class="mb-2">
-            <lable class="mb-1 text-secondary text-sm">Expiry Date</lable>
+            <label class="mb-1 text-secondary text-sm">Expiry Date</label>
             <div class="d-flex align-items-start">
                 <select class="form-control form-control-sm" name="expirationMonth" required>
                     <option value="">-- select --</option>
@@ -25,22 +25,16 @@
                     <option value="11">November</option>
                     <option value="12">December</option>
                 </select>
-                <select class="form-control form-control-sm ml-2" name="expirationYear" required>
-                    <option value="">-- select --</option>
-                    <option value="2022">2022</option>
-                    <option value="2023">2023</option>
-                    <option value="2024">2024</option>
-                    <option value="2025">2025</option>
-                    <option value="2026">2026</option>
-                </select>
+                <input type="number" name="expirationYear" class="form-control form-control-sm ml-2" placeholder="Expiry Year" required>
+                
             </div>
         </div>
         <div class="mb-2">
-            <lable class="mb-1 text-secondary text-sm">CVV/CCV Number</lable>
+            <label class="mb-1 text-secondary text-sm">CVV/CCV Number</label>
             <input type="text" name="ccv" value="" class="form-control form-control-sm min-width-200px" required>
         </div>
         <div class="mb-2">
-            <lable class="mb-1 text-secondary text-sm">Billing Zip</lable>
+            <label class="mb-1 text-secondary text-sm">Billing Zip</label>
             <input type="text" name="billingZip" value="" class="form-control form-control-sm min-width-200px">
         </div>
         <div class="d-flex align-items-center">

+ 2 - 2
yemi.js

@@ -513,7 +513,7 @@ var initMoes = function() {
                             hideMoeFormMask();
                             hideMask();
                             runMCHook(hook);
-                        } else if(isDynamicStagPopupPresent()) {
+                        } else if(typeof isDynamicStagPopupPresent !== 'undefined' && isDynamicStagPopupPresent()) {
                             let targetUrl = false;
                             if (redir) {
                                 if (redir.indexOf('[data]') > -1) {
@@ -565,7 +565,7 @@ var initMoes = function() {
                             hideMoeFormMask();
                             hideMask();
                             runMCHook(hook);
-                        } else if(isDynamicStagPopupPresent()) {
+                        } else if(typeof isDynamicStagPopupPresent !== 'undefined' && isDynamicStagPopupPresent()) {
                             let targetUrl = false;
                             if (redir) {
                                 if (redir.indexOf('[data]') > -1) {