From ed22d87e1f52f287b20e57c6f118399ef3aa445a Mon Sep 17 00:00:00 2001 From: VE10-Sanjeev Date: Fri, 31 Jan 2025 06:08:10 +0000 Subject: [PATCH] Supplier Bug fixes : ps --- app/Controllers/Supplier.php | 73 +++++++--- app/Views/addSupplier.php | 90 ++++++------ app/Views/editSupplier.php | 256 ++++++++++++++++------------------- 3 files changed, 214 insertions(+), 205 deletions(-) diff --git a/app/Controllers/Supplier.php b/app/Controllers/Supplier.php index f85b4d3b..3cc7562b 100755 --- a/app/Controllers/Supplier.php +++ b/app/Controllers/Supplier.php @@ -87,19 +87,28 @@ class Supplier extends BaseController 'Address' => [ 'label' => 'Address', 'rules' => 'trim|required' - ], - 'ContactNumber' => [ - 'label' => 'Contact Number', - 'rules' => 'trim|required|max_length[13]' - ], - 'AlternateContactNumber' => [ - 'label' => 'Alternate Contact Number', - 'rules' => 'trim|max_length[13]' - ], - 'emailid' => [ - 'label' => 'Email', - 'rules' => 'valid_email|max_length[128]|required' + ],'accno' => [ + 'label' => 'accno', + 'rules' => 'trim|required' + ],'ifsc' => [ + 'label' => 'ifsc', + 'rules' => 'trim|required' + ],'Payment' => [ + 'label' => 'Payment', + 'rules' => 'trim|required' ] + // 'ContactNumber' => [ + // 'label' => 'Contact Number', + // 'rules' => 'trim|required|max_length[13]' + // ], + // 'AlternateContactNumber' => [ + // 'label' => 'Alternate Contact Number', + // 'rules' => 'trim|max_length[13]' + // ], + // 'emailid' => [ + // 'label' => 'Email', + // 'rules' => 'valid_email|max_length[128]|required' + // ] ]; $messages = [ @@ -109,18 +118,27 @@ class Supplier extends BaseController 'Address' => [ 'required' => 'Please enter an address.' ], - 'ContactNumber' => [ - 'required' => 'Please enter a contact number.', - 'max_length' => 'The contact number cannot exceed {param} characters.' + 'accno' => [ + 'required' => 'Please enter an Account Number.' ], - 'AlternateContactNumber' => [ - 'max_length' => 'The alternate contact number cannot exceed {param} characters.' + 'ifsc' => [ + 'required' => 'Please enter a Bank IFSC Code.' ], - 'emailid' => [ - 'required' => 'Please enter an email address.', - 'valid_email' => 'Please enter a valid email address.', - 'max_length' => 'The email address cannot exceed {param} characters.' - ] + 'Payment' => [ + 'required' => 'Please Select the Payment option.' + ], + // 'ContactNumber' => [ + // 'required' => 'Please enter a contact number.', + // 'max_length' => 'The contact number cannot exceed {param} characters.' + // ], + // 'AlternateContactNumber' => [ + // 'max_length' => 'The alternate contact number cannot exceed {param} characters.' + // ], + // 'emailid' => [ + // 'required' => 'Please enter an email address.', + // 'valid_email' => 'Please enter a valid email address.', + // 'max_length' => 'The email address cannot exceed {param} characters.' + // ] // 'panno' => [ // 'required' => 'Please enter an panno address.', // 'max_length' => 'The panno cannot exceed {param} characters.' @@ -253,6 +271,7 @@ class Supplier extends BaseController $file1 = $this->request->getFile('Cert_MSME'); $file2 = $this->request->getFile('Cert_GST'); $file3 = $this->request->getFile('Cert_BANK'); + $file4 = $this->request->getFile('Cert_PAN'); $path = ROOTPATH.'public/uploads/images/'; if($PAN){ $supplier['PAN'] = $PAN;} @@ -287,6 +306,16 @@ class Supplier extends BaseController $supplier['Cert_BANK'] = $this->request->getPost('hidden_Cert_BANK') ? $this->request->getPost('hidden_Cert_BANK') : NULL; } + if ($file4 && $file4->isValid() && !$file4->hasMoved()) { + if(!is_dir($path)) { mkdir($path, 0777, true); } + $PAN_DOC = $file4->getName(); + $file4->move($path,$PAN_DOC); + $supplier['Cert_PAN'] = $PAN_DOC; + } + else{ + $supplier['Cert_PAN'] = $this->request->getPost('hidden_Cert_PAN') ? $this->request->getPost('hidden_Cert_PAN') : NULL; + } + $result = $this->supplier_model->UpdateSupplier($supplier, $SupplierID); if ($result == True) { diff --git a/app/Views/addSupplier.php b/app/Views/addSupplier.php index 290943dc..54439736 100755 --- a/app/Views/addSupplier.php +++ b/app/Views/addSupplier.php @@ -73,7 +73,7 @@
- +
@@ -174,34 +174,37 @@
+
+
+ + Payment Details - - -
-
- - - - +
+
+ + + +
+
@@ -246,10 +249,7 @@ $("#ContactNumber").focus(); return false; } - if (!validateEmail()) { - $('#emailid').focus(); - return false; - } + if ($("#Address").val().length < 1) { alert('Please Enter Address'); @@ -257,12 +257,24 @@ return false; } - if (!validateEmail()) { - alert('Please Enter Valid Email Address'); - $('#emailid').focus(); + if ($("#accno").val().length < 1) { + alert('Please Enter Account number'); + $("#accno").focus(); return false; } + if ($("#ifsc").val().length < 1) { + alert('Please Enter Bank IFSC code'); + $("#ifsc").focus(); + return false; + } + + if ($("#Payment").val().length < 1) { + alert('Please select the Payment option'); + $("#Payment").focus(); + return false; + } + return true; } @@ -311,21 +323,6 @@ }); }); - //Email Validate - function validateEmail() { - var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/; - - var email = $('#EmailAddress').val(); - if (email != "") { - if (reg.test(email) == false) { - alert('Please Enter Valid Email Address'); - return (false); - } else { - return true; - } - } - } - function alphaNumberic(e) { var k; document.all ? k = e.keyCode : k = e.which; @@ -480,9 +477,10 @@ } else { return true; } - } else { - alert('Please Enter email id'); - } + } + // else { + // alert('Please Enter email id'); + // } } diff --git a/app/Views/editSupplier.php b/app/Views/editSupplier.php index 6eccc6b2..7bb17aa7 100755 --- a/app/Views/editSupplier.php +++ b/app/Views/editSupplier.php @@ -22,6 +22,7 @@ $IsRawMaterial = ''; $PaymentId = ''; $hidden_Cert_MSME = ''; $hidden_Cert_GST = ''; +$hidden_Cert_PAN = ''; $hidden_Cert_BANK = ''; if (!empty($supplier)) { @@ -51,6 +52,7 @@ if (!empty($supplier)) { $PaymentId = $uf->PaymentID; $hidden_Cert_MSME = $uf->Cert_MSME; $hidden_Cert_GST = $uf->Cert_GST; + $hidden_Cert_PAN = $uf->Cert_PAN; $hidden_Cert_BANK = $uf->Cert_BANK; } } @@ -175,9 +177,10 @@ if (!empty($supplier)) { } else { return true; } - } else { - alert('Please Enter email id'); - } + } + // else { + // alert('Please Enter email id'); + // } } @@ -282,7 +285,7 @@ if (!empty($supplier)) {
-

Edit Supplier Details

+

Edit Supplier Details

@@ -311,57 +314,37 @@ if (!empty($supplier)) {
-
- - -
-
- - + +
+ +
- +
- +
- +
-
+  
- name="service" value="1"> - SERVICE + value="1"> SERVICE  
- name="rawmaterial" - value="1"> RAW MATERIALS + value="1"> RAW MATERIALS  
- name="maintanance" - value="1"> MAINTENANCE + value="1"> MAINTENANCE  
@@ -370,64 +353,66 @@ if (!empty($supplier)) { Address Details
-
- - +
+ +
-
+
Tax Related Data +
-
-
- - +
+
+ +
-
- - -
-
- - +
+ + +
- -
- -
-
-
- - +
+
+ +
-
- - +
+ + + + + +
+ + + +
+
+
+ + +
+
+ +
@@ -441,42 +426,31 @@ if (!empty($supplier)) {
-
- - + Bank Details - -
-
-
- - +
+
+ +
-
- - +
+ +
-
- - +
+ +
- -
-
- - +
+
+ +
-
- - +
+ +
@@ -491,39 +465,37 @@ if (!empty($supplier)) {
+ +
+
+
+
- Payment Details - -
-
-
+
+
- - - - + ?> + +
- - -
-
+
+
-
-
+ +
@@ -565,14 +537,6 @@ if (!empty($supplier)) { $("#supplierName").focus(); return false; } - if (!getContactNumberValidation) { - $("#ContactNumber").focus(); - return false; - } - if (!validateEmail()) { - $('#emailid').focus(); - return false; - } if ($("#Address").val().length < 1) { alert('Please Enter Address'); @@ -580,6 +544,24 @@ if (!empty($supplier)) { return false; } + if ($("#accno").val().length < 1) { + alert('Please Enter Account number'); + $("#accno").focus(); + return false; + } + + if ($("#ifsc").val().length < 1) { + alert('Please Enter Bank IFSC code'); + $("#ifsc").focus(); + return false; + } + + if ($("#PaymentTerms").val().length < 1) { + alert('Please select the Payment option'); + $("#PaymentTerms").focus(); + return false; + } + return true; }