FIX_Bug : ps

This commit is contained in:
VE10-Sanjeev 2024-06-07 12:32:22 +00:00
parent edadba1a41
commit e9d1abc26f
8 changed files with 110 additions and 71 deletions

View File

@ -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++;
}

View File

@ -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'] ? '<div><strong style="float: left;">80G Registration No: </strong><span>'.$terms_data[0]['eightyG'].'</span><strong style="float: right;">Valid Upto : </strong><span>'. (!empty($terms_data[0]['eightyGVaildUpto'])) ?? date("d-m-Y", strtotime($terms_data[0]['eightyGVaildUpto'])) .'</span></div>' : '',
'twelveAA' => $terms_data[0]['twelveAA'] ? '<div><strong style="float: left;">12AA Registration No: </strong><span>'.$terms_data[0]['twelveAA'].'</span><strong style="float: right;">Valid Upto : </strong><span>'. (!empty($terms_data[0]['twelveAAVaildUpto'])) ?? date("d-m-Y", strtotime($terms_data[0]['twelveAAVaildUpto'])) .'</span></div>' : ''
'eightyG' => $terms_data[0]['eightyG'],
'eightyGVaildUpto' => $terms_data[0]['eightyGVaildUpto'],
'twelveAA' => $terms_data[0]['twelveAA'],
'twelveAAVaildUpto' => $terms_data[0]['twelveAAVaildUpto'],
]);
// echo $html;die;

View File

@ -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)
{

View File

@ -94,7 +94,7 @@
<label for="csname" class="col-form-label"><span class="contactPerson"> </span>Passport Number <i class="text-danger contactPerson"> *</i> </label>
<input type="text" class="form-control" id="passport_no"name="passport_no" value="<?= isset($customer['passport_no']) ? $customer['passport_no'] : '' ?>" placeholder="Passport Number" onchange="checkExisting(this,'passport_no','passport_no')"/>
<span id="passportValidationMessage"></span>
<span id="errorMessage" style="color: red;"></span>
<span id="errorMessage2" style="color: red;"></span>
</div>
</div>
@ -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) {

View File

@ -7,6 +7,11 @@
<a href="<?= base_url() . "export_Donor"; ?>" class="btn btn-info"><i class="ri-file-excel-2-fill"></i> Export Contributor </a>
<!-- <a href="<?= base_url() . "import_Donor"; ?>" class="btn btn-secondary"><i class="ri-file-excel-2-line"></i> Import Contributor </a> -->
<button type="button" class="btn btn-secondary" data-toggle="modal" data-target="#standard-modal"><i class="ri-file-excel-2-line"></i> Import Contributor</button>
<div class="row">
<div class="col-12 text-right">
<a href="<?= base_url() . "public/import/sample_contributor.xlsx"; ?>" download class="btn btn-link">Click here to download the sample Excel file for contributor import</a>
</div>
</div>
</div><!-- end col-->
<br>
<h4 class="header-title mb-3"><?= $page_name; ?></h4>

View File

@ -104,10 +104,23 @@
<td style="width: 69.4882%; height: 18px;text-align: right;border: none;"> <?php if($signature && file_exists(ROOTPATH."public/uploads/".$signature)) { ?><img src="<?= base_url()."public/uploads/".$signature ?>" width="100px" alt="Signature"><?php }else { echo "Signature"; } ?></td>
<tr>
</tr><td style="width: 30.5118%; height: 18px;"></td></tr>
<tr style="height: 18px;">
<td style="width: 100%; text-align: center;border: none;padding:30px 0px 0px 0px;font-size: 9px;border-top: 1px solid #ccc;" colspan="2">
<?php if($eightyG != "") { ?> <?= $eightyG ?><br> <?php } ?>
<?php if($twelveAA != "") { ?> <?= $twelveAA ?><br> <?php } ?>
<tr>
<td style="border: none;padding:5px;border-top: 1px solid #ccc;" colspan="2"></td>
</tr>
<?php if($eightyG != "") { ?>
<tr style="height: 0px; padding:0px;">
<td style="width: 30.5118%;border: none; font-size: 9px;"><strong>80G Registration No:</strong>&nbsp; <?= $eightyG ?></td>
<td style="width: 69.4882%;border: none; font-size: 9px;text-align: right;"> <?php if($eightyGVaildUpto) { ?> <strong>Valid Upto: </strong> &nbsp; <?= date("d-m-Y", strtotime($eightyGVaildUpto)) ?><?php } ?></td>
<tr>
<?php } ?>
<?php if($twelveAA != "") { ?>
<tr style="height: 0px; padding:0px;">
<td style="width: 30.5118%;border: none; font-size: 9px;"><strong>12AA Registration No:</strong>&nbsp; <?= $twelveAA ?></td>
<td style="width: 69.4882%;border: none; font-size: 9px; text-align: right;"> <?php if($twelveAAVaildUpto) { ?> <strong>Valid Upto: </strong> &nbsp; <?= date("d-m-Y", strtotime($twelveAAVaildUpto)) ?><?php } ?></td>
<tr>
<?php } ?>
<tr style="height: 0px; padding:1px;">
<td style="width: 100%; text-align: center;border: none;font-size: 9px; " colspan="2">
<strong>Note:</strong>&nbsp;<?= $Notes ?></td>
</tr>
</tbody>

101
composer.lock generated
View File

@ -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",

Binary file not shown.