diff --git a/app/Controllers/Invoice.php b/app/Controllers/Invoice.php index 4d0f8aeb..4a8986c5 100755 --- a/app/Controllers/Invoice.php +++ b/app/Controllers/Invoice.php @@ -80,7 +80,7 @@ class Invoice extends BaseController $data['financial_year'] = get_financial_year(); $data['invoice_number_formatting'] = $model->getData('invoice_number_formatting', $where); $data['books'] = $model->getCategoryBooks(1); // Invocie type = 2 (invoice) - + $data['customers'] = array_reverse($data['customers']); if ($id === '0') { $this->logger->info("Book Invoice: In Add Details"); $data['page_name'] = 'Add Book Invoice Details'; @@ -115,6 +115,7 @@ class Invoice extends BaseController $data['events'] = $model->getData('events', array_merge($where, ['isactive' => 1])); $data['books'] = $model->getCategoryBooks(2); // Invocie type = 2 (subscription) $data['invoice_number_formatting'] = $model->getData('invoice_number_formatting', $where); + $data['customers'] = array_reverse($data['customers']); if ($id === '0') { $this->logger->info("Subscription Invoice: In Add Page"); $data['page_name'] = 'Add Subscription Invoice Details'; @@ -838,10 +839,14 @@ public function create_or_update_subscription($invoice_id,$invoice_status, $msg_ $business_email = $rec['business_email']; $business_mobile_no = $rec['business_mobile_no']; } + if (!isset($recipient_email)){ + log_message('error','Email Id not set for customer'); + return; + } $records['invoice_order_number'] = $reference_number; $records['invoice_serial_number'] = $invoice_serial_number; $records['recipient_name'] = $recipient_name; - $records['recipient_email'] = $recipient_email ? $recipient_email : "sanjeev.p@venbainfotech.com"; + $records['recipient_email'] = $recipient_email ? $recipient_email : $business_email; $records['subtotal'] = $subtotal; $records['tax'] = $tax; $records['total_amount'] = $total_amount; diff --git a/app/Controllers/Notifications.php b/app/Controllers/Notifications.php index 643d3849..d633fdbe 100755 --- a/app/Controllers/Notifications.php +++ b/app/Controllers/Notifications.php @@ -575,7 +575,7 @@ class Notifications extends BaseController // dd($window_time); $valid_dates = [0,1,7,15,30]; if(!in_array($window_time,$valid_dates) ){ - return "Invalid Window Time"; + return "Please enter a valid notification period. Accepted values are 0, 7, 15, or 30 days."; } $NotificationModel = new NotificationModel(); $this->update_expired_members(); diff --git a/app/Views/customer_form.php b/app/Views/customer_form.php index ef237786..7a8c162d 100755 --- a/app/Views/customer_form.php +++ b/app/Views/customer_form.php @@ -59,7 +59,7 @@
- +
@@ -173,7 +173,7 @@
- +
@@ -245,7 +245,7 @@
- +
@@ -630,7 +630,8 @@ document.getElementById('myForm').addEventListener('submit', function(event) { } function checkExisting(inputvalue,fieldname,elementid){ spanid = elementid == 'cmail' ? "emailValidationMessage" : "mobileValidationMessage"; - var validationMessage = document.getElementById(spanid); + if(spanid != ''){ + var validationMessage = document.getElementById(spanid); $.ajax({ type: "POST", url: "", @@ -645,13 +646,15 @@ document.getElementById('myForm').addEventListener('submit', function(event) { validationMessage.style.color = "red"; document.getElementById(elementid).value = ""; } else { - validationMessage.textContent = ""; + // validationMessage.textContent = ""; } }, error: function() { alert("Error occur."); } }); + } + }