diff --git a/app/Controllers/Customer.php b/app/Controllers/Customer.php index 427fbc8..0e3b7c4 100644 --- a/app/Controllers/Customer.php +++ b/app/Controllers/Customer.php @@ -9,7 +9,8 @@ use PhpOffice\PhpSpreadsheet\Spreadsheet; use PhpOffice\PhpSpreadsheet\Writer\Xlsx; use PhpOffice\PhpSpreadsheet\Reader\Csv as ReaderCsv; use PhpOffice\PhpSpreadsheet\Reader\Xlsx as ReaderXlsx; - +use PhpOffice\PhpSpreadsheet\Cell\DataType; +use PhpOffice\PhpSpreadsheet\Style\NumberFormat; class Customer extends BaseController { @@ -137,7 +138,7 @@ class Customer extends BaseController 'date_of_birth' => $dob, 'pan_no' => $pan, 'adhar_no' => $this->request->getPost('adhar_no'), - + 'passport_no' => $this->request->getPost('DonorType') == 'individual' && $this->request->getPost('passport_no') ? $this->request->getPost('passport_no') : null, 'donor_type' => $this->request->getPost('DonorType'), 'org_name' => $this->request->getPost('org_name') !== '' || $this->request->getPost('org_name') !== null ? $this->request->getPost('org_name') : NULL, 'org_reg_details'=> $this->request->getPost('org_reg_Details'), @@ -577,6 +578,14 @@ class Customer extends BaseController foreach ($data as $d) { $col = 'A'; // Start from column A foreach ($d as $value) { + + + if (is_numeric($value)) { + $sheet->setCellValueExplicit($col . $row, $value, DataType::TYPE_STRING); + $sheet->getStyle($col . $row)->getNumberFormat()->setFormatCode(NumberFormat::FORMAT_NUMBER); + } else { + $sheet->setCellValue($col . $row, $value); + } $sheet->setCellValue($col . $row, $value); $col++; } diff --git a/app/Controllers/Invoice.php b/app/Controllers/Invoice.php index caac569..d823e3c 100644 --- a/app/Controllers/Invoice.php +++ b/app/Controllers/Invoice.php @@ -556,8 +556,11 @@ class Invoice extends BaseController 'signature' => $data[0]->signature, 'staff_name' => $user[0]['first_name'] . ' ' .$user[0]['last_name'], 'Notes' => $terms_data[0]['terms'], - 'eightyG' => $terms_data[0]['eightyG'] ? '
80G Registration No: '.$terms_data[0]['eightyG'].'Valid Upto : '. (!empty($terms_data[0]['eightyGVaildUpto'])) ?? date("d-m-Y", strtotime($terms_data[0]['eightyGVaildUpto'])) .'
' : '', - 'twelveAA' => $terms_data[0]['twelveAA'] ? '
12AA Registration No: '.$terms_data[0]['twelveAA'].'Valid Upto : '. (!empty($terms_data[0]['twelveAAVaildUpto'])) ?? date("d-m-Y", strtotime($terms_data[0]['twelveAAVaildUpto'])) .'
' : '' + 'eightyG' => $terms_data[0]['eightyG'], + 'eightyGVaildUpto' => $terms_data[0]['eightyGVaildUpto'], + 'twelveAA' => $terms_data[0]['twelveAA'], + 'twelveAAVaildUpto' => $terms_data[0]['twelveAAVaildUpto'], + ]); // echo $html;die; diff --git a/app/Models/CustomerModel.php b/app/Models/CustomerModel.php index 4366fb5..faf1dea 100644 --- a/app/Models/CustomerModel.php +++ b/app/Models/CustomerModel.php @@ -10,7 +10,7 @@ class CustomerModel extends Model protected $table = 'donor'; protected $primaryKey = 'donor_id '; // protected $allowedFields = ['donor_id ','first_name','city','last_name','email','mobile_no','country','state','postal_code' ,'address','profile_picture','date_of_birth','gender','mode','isactive','business_id']; - protected $allowedFields = ['donor_id ','first_name','city','last_name','email','mobile_no','country','state','postal_code' ,'address','org_name','date_of_birth','pan_no','adhar_no','org_reg_details','donor_type','isactive','business_id','created_by','updated_by','XL_file_name','ip_address']; + protected $allowedFields = ['donor_id ','first_name','city','last_name','email','mobile_no','country','state','postal_code' ,'address','org_name','date_of_birth','pan_no','adhar_no','org_reg_details','donor_type','isactive','business_id','created_by','updated_by','XL_file_name','ip_address','passport_no']; public function insertCustomer($data) { diff --git a/app/Views/customer_form.php b/app/Views/customer_form.php index d7560bd..4ed5320 100644 --- a/app/Views/customer_form.php +++ b/app/Views/customer_form.php @@ -94,7 +94,7 @@ - + @@ -176,28 +176,32 @@ var panInput = document.getElementById('pan_no'); var passportInput = document.getElementById('passport_no'); var errorMessage = document.getElementById('errorMessage'); - + var errorMessage = document.getElementById('passportValidationMessage'); if (type === 'organization') { panInput.setAttribute('required', 'required'); passportInput.removeAttribute('required'); errorMessage.textContent = ""; // Clear any existing error message + passportValidationMessage.textContent = ""; } else if (type === 'individual') { if (panInput.value === "" && passportInput.value === "") { // If both PAN and Passport are empty, require either one panInput.setAttribute('required', 'required'); passportInput.setAttribute('required', 'required'); errorMessage.textContent = "Either PAN or Passport is required."; + passportValidationMessage.textContent = "Either PAN or Passport is required."; } else { // If either PAN or Passport is filled, reset requirements panInput.removeAttribute('required'); passportInput.removeAttribute('required'); errorMessage.textContent = ""; // Clear error message + passportValidationMessage.textContent = ""; } } else { // For other type, set PAN or Passport as required based on the default logic panInput.removeAttribute('required'); passportInput.removeAttribute('required'); errorMessage.textContent = ""; // Clear any existing error message + passportValidationMessage.textContent = ""; } } @@ -238,21 +242,23 @@ invalidFields.forEach(function(field) { } } - - if (panValue !== '') { - if (!validatePANNumber(panValue)) { + if (panValue === '' && passportValue === '') { event.preventDefault(); // Prevent form submission return; + }else{ + if (panValue !== '') { + if (!validatePANNumber(panValue)) { + event.preventDefault(); // Prevent form submission + return; + } } - } - - - if (passportValue !== '') { - if (!validatePassport(passportValue)) { - event.preventDefault(); // Prevent form submission - return; + if (passportValue !== '') { + if (!validatePassport(passportValue)) { + event.preventDefault(); // Prevent form submission + return; + } } - } + } } if (form.checkValidity() === true) { diff --git a/app/Views/customer_list.php b/app/Views/customer_list.php index 7692264..8481693 100644 --- a/app/Views/customer_list.php +++ b/app/Views/customer_list.php @@ -7,6 +7,11 @@ " class="btn btn-info"> Export Contributor +
+
+ " download class="btn btn-link">Click here to download the sample Excel file for contributor import +
+

diff --git a/app/Views/invoice_pdf_template.php b/app/Views/invoice_pdf_template.php index 1061046..20e973a 100644 --- a/app/Views/invoice_pdf_template.php +++ b/app/Views/invoice_pdf_template.php @@ -104,10 +104,23 @@ " width="100px" alt="Signature"> - - -
-
+ + + + + +80G Registration No:  + Valid Upto:   + + + + +12AA Registration No:  + Valid Upto:   + + + + Note:  diff --git a/composer.lock b/composer.lock index ae3b51b..3a1cecd 100644 --- a/composer.lock +++ b/composer.lock @@ -4380,16 +4380,16 @@ }, { "name": "symfony/console", - "version": "v7.0.7", + "version": "v7.1.1", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "c981e0e9380ce9f146416bde3150c79197ce9986" + "reference": "9b008f2d7b21c74ef4d0c3de6077a642bc55ece3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/c981e0e9380ce9f146416bde3150c79197ce9986", - "reference": "c981e0e9380ce9f146416bde3150c79197ce9986", + "url": "https://api.github.com/repos/symfony/console/zipball/9b008f2d7b21c74ef4d0c3de6077a642bc55ece3", + "reference": "9b008f2d7b21c74ef4d0c3de6077a642bc55ece3", "shasum": "" }, "require": { @@ -4453,7 +4453,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v7.0.7" + "source": "https://github.com/symfony/console/tree/v7.1.1" }, "funding": [ { @@ -4469,7 +4469,7 @@ "type": "tidelift" } ], - "time": "2024-04-18T09:29:19+00:00" + "time": "2024-05-31T14:57:53+00:00" }, { "name": "symfony/deprecation-contracts", @@ -4540,16 +4540,16 @@ }, { "name": "symfony/event-dispatcher", - "version": "v7.0.7", + "version": "v7.1.1", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "db2a7fab994d67d92356bb39c367db115d9d30f9" + "reference": "9fa7f7a21beb22a39a8f3f28618b29e50d7a55a7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/db2a7fab994d67d92356bb39c367db115d9d30f9", - "reference": "db2a7fab994d67d92356bb39c367db115d9d30f9", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/9fa7f7a21beb22a39a8f3f28618b29e50d7a55a7", + "reference": "9fa7f7a21beb22a39a8f3f28618b29e50d7a55a7", "shasum": "" }, "require": { @@ -4600,7 +4600,7 @@ "description": "Provides tools that allow your application components to communicate with each other by dispatching events and listening to them", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/event-dispatcher/tree/v7.0.7" + "source": "https://github.com/symfony/event-dispatcher/tree/v7.1.1" }, "funding": [ { @@ -4616,7 +4616,7 @@ "type": "tidelift" } ], - "time": "2024-04-18T09:29:19+00:00" + "time": "2024-05-31T14:57:53+00:00" }, { "name": "symfony/event-dispatcher-contracts", @@ -4696,22 +4696,24 @@ }, { "name": "symfony/filesystem", - "version": "v7.0.7", + "version": "v7.1.1", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "cc168be6fbdcdf3401f50ae863ee3818ed4338f5" + "reference": "802e87002f919296c9f606457d9fa327a0b3d6b2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/cc168be6fbdcdf3401f50ae863ee3818ed4338f5", - "reference": "cc168be6fbdcdf3401f50ae863ee3818ed4338f5", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/802e87002f919296c9f606457d9fa327a0b3d6b2", + "reference": "802e87002f919296c9f606457d9fa327a0b3d6b2", "shasum": "" }, "require": { "php": ">=8.2", "symfony/polyfill-ctype": "~1.8", - "symfony/polyfill-mbstring": "~1.8", + "symfony/polyfill-mbstring": "~1.8" + }, + "require-dev": { "symfony/process": "^6.4|^7.0" }, "type": "library", @@ -4740,7 +4742,7 @@ "description": "Provides basic utilities for the filesystem", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/filesystem/tree/v7.0.7" + "source": "https://github.com/symfony/filesystem/tree/v7.1.1" }, "funding": [ { @@ -4756,20 +4758,20 @@ "type": "tidelift" } ], - "time": "2024-04-18T09:29:19+00:00" + "time": "2024-05-31T14:57:53+00:00" }, { "name": "symfony/finder", - "version": "v7.0.7", + "version": "v7.1.1", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "4d58f0f4fe95a30d7b538d71197135483560b97c" + "reference": "fbb0ba67688b780efbc886c1a0a0948dcf7205d6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/4d58f0f4fe95a30d7b538d71197135483560b97c", - "reference": "4d58f0f4fe95a30d7b538d71197135483560b97c", + "url": "https://api.github.com/repos/symfony/finder/zipball/fbb0ba67688b780efbc886c1a0a0948dcf7205d6", + "reference": "fbb0ba67688b780efbc886c1a0a0948dcf7205d6", "shasum": "" }, "require": { @@ -4804,7 +4806,7 @@ "description": "Finds files and directories via an intuitive fluent interface", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/finder/tree/v7.0.7" + "source": "https://github.com/symfony/finder/tree/v7.1.1" }, "funding": [ { @@ -4820,20 +4822,20 @@ "type": "tidelift" } ], - "time": "2024-04-28T11:44:19+00:00" + "time": "2024-05-31T14:57:53+00:00" }, { "name": "symfony/options-resolver", - "version": "v7.0.7", + "version": "v7.1.1", "source": { "type": "git", "url": "https://github.com/symfony/options-resolver.git", - "reference": "23cc173858776ad451e31f053b1c9f47840b2cfa" + "reference": "47aa818121ed3950acd2b58d1d37d08a94f9bf55" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/options-resolver/zipball/23cc173858776ad451e31f053b1c9f47840b2cfa", - "reference": "23cc173858776ad451e31f053b1c9f47840b2cfa", + "url": "https://api.github.com/repos/symfony/options-resolver/zipball/47aa818121ed3950acd2b58d1d37d08a94f9bf55", + "reference": "47aa818121ed3950acd2b58d1d37d08a94f9bf55", "shasum": "" }, "require": { @@ -4871,7 +4873,7 @@ "options" ], "support": { - "source": "https://github.com/symfony/options-resolver/tree/v7.0.7" + "source": "https://github.com/symfony/options-resolver/tree/v7.1.1" }, "funding": [ { @@ -4887,7 +4889,7 @@ "type": "tidelift" } ], - "time": "2024-04-18T09:29:19+00:00" + "time": "2024-05-31T14:57:53+00:00" }, { "name": "symfony/polyfill-ctype", @@ -5365,16 +5367,16 @@ }, { "name": "symfony/process", - "version": "v7.0.7", + "version": "v7.1.1", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "3839e56b94dd1dbd13235d27504e66baf23faba0" + "reference": "febf90124323a093c7ee06fdb30e765ca3c20028" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/3839e56b94dd1dbd13235d27504e66baf23faba0", - "reference": "3839e56b94dd1dbd13235d27504e66baf23faba0", + "url": "https://api.github.com/repos/symfony/process/zipball/febf90124323a093c7ee06fdb30e765ca3c20028", + "reference": "febf90124323a093c7ee06fdb30e765ca3c20028", "shasum": "" }, "require": { @@ -5406,7 +5408,7 @@ "description": "Executes commands in sub-processes", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/process/tree/v7.0.7" + "source": "https://github.com/symfony/process/tree/v7.1.1" }, "funding": [ { @@ -5422,7 +5424,7 @@ "type": "tidelift" } ], - "time": "2024-04-18T09:29:19+00:00" + "time": "2024-05-31T14:57:53+00:00" }, { "name": "symfony/service-contracts", @@ -5509,16 +5511,16 @@ }, { "name": "symfony/stopwatch", - "version": "v7.0.7", + "version": "v7.1.1", "source": { "type": "git", "url": "https://github.com/symfony/stopwatch.git", - "reference": "41a7a24aa1dc82adf46a06bc292d1923acfe6b84" + "reference": "5b75bb1ac2ba1b9d05c47fc4b3046a625377d23d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/stopwatch/zipball/41a7a24aa1dc82adf46a06bc292d1923acfe6b84", - "reference": "41a7a24aa1dc82adf46a06bc292d1923acfe6b84", + "url": "https://api.github.com/repos/symfony/stopwatch/zipball/5b75bb1ac2ba1b9d05c47fc4b3046a625377d23d", + "reference": "5b75bb1ac2ba1b9d05c47fc4b3046a625377d23d", "shasum": "" }, "require": { @@ -5551,7 +5553,7 @@ "description": "Provides a way to profile code", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/stopwatch/tree/v7.0.7" + "source": "https://github.com/symfony/stopwatch/tree/v7.1.1" }, "funding": [ { @@ -5567,20 +5569,20 @@ "type": "tidelift" } ], - "time": "2024-04-18T09:29:19+00:00" + "time": "2024-05-31T14:57:53+00:00" }, { "name": "symfony/string", - "version": "v7.0.7", + "version": "v7.1.1", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "e405b5424dc2528e02e31ba26b83a79fd4eb8f63" + "reference": "60bc311c74e0af215101235aa6f471bcbc032df2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/e405b5424dc2528e02e31ba26b83a79fd4eb8f63", - "reference": "e405b5424dc2528e02e31ba26b83a79fd4eb8f63", + "url": "https://api.github.com/repos/symfony/string/zipball/60bc311c74e0af215101235aa6f471bcbc032df2", + "reference": "60bc311c74e0af215101235aa6f471bcbc032df2", "shasum": "" }, "require": { @@ -5594,6 +5596,7 @@ "symfony/translation-contracts": "<2.5" }, "require-dev": { + "symfony/emoji": "^7.1", "symfony/error-handler": "^6.4|^7.0", "symfony/http-client": "^6.4|^7.0", "symfony/intl": "^6.4|^7.0", @@ -5637,7 +5640,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v7.0.7" + "source": "https://github.com/symfony/string/tree/v7.1.1" }, "funding": [ { @@ -5653,7 +5656,7 @@ "type": "tidelift" } ], - "time": "2024-04-18T09:29:19+00:00" + "time": "2024-06-04T06:40:14+00:00" }, { "name": "theseer/tokenizer", diff --git a/public/import/sample_contributor.xlsx b/public/import/sample_contributor.xlsx new file mode 100644 index 0000000..3ff064a Binary files /dev/null and b/public/import/sample_contributor.xlsx differ