CHANGE_FY_AY_CLIENT_DOC_PREVIEW : AADHAVAN

This commit is contained in:
aadhavan valli 2024-07-09 15:15:26 +05:30
parent 3e458e39a0
commit d2e142ae3b
5 changed files with 45 additions and 17 deletions

View File

@ -342,10 +342,13 @@ class MasterController extends BaseController
}
$docStatusByClientId = [];
$data['clientdata'] = $this->ClientModel->select('client.*, client_branch.name as client_branch_name, client_branch.id as client_branch_id')
->join('client_branch', 'client.client_id = client_branch.client_id', 'left')
// $data['clientdata'] = $this->ClientModel->select('client.*, client_branch.name as client_branch_name, client_branch.id as client_branch_id')
// ->join('client_branch', 'client.client_id = client_branch.client_id', 'left')
// ->findAll();
$data['clientdata'] = $this->ClientBranchModel->select('client.*, client_branch.name as client_branch_name, client_branch.id as client_branch_id')
->join('client', 'client_branch.client_id = client.client_id', 'left')
// ->where('client.business_id',$this->session->get('logged_in_staff_business_id'))
->findAll();
$data['serviceGroupData'] = $this->ServiceGroupModel->findAll();
// foreach ($data['serviceGroupData'] as $key => $value) {
// $check_its_okay = 0;
@ -395,9 +398,10 @@ class MasterController extends BaseController
}
$docStatusByClientId = [];
// Fetch all doc_status entries and group them by client_docs_id
$data['clientdata'] = $this->ClientModel->select('client.*, client_branch.name as client_branch_name, client_branch.id as client_branch_id')
->join('client_branch', 'client.client_id = client_branch.client_id', 'left')
->findAll();
$data['clientdata'] = $this->ClientBranchModel->select('client.*, client_branch.name as client_branch_name, client_branch.id as client_branch_id')
->join('client', 'client_branch.client_id = client.client_id', 'left')
// ->where('client.business_id',$this->session->get('logged_in_staff_business_id'))
->findAll();
$data['serviceGroupData'] = $this->ServiceGroupModel->findAll();
// foreach ($data['serviceGroupData'] as $key => $value) {
@ -591,8 +595,14 @@ class MasterController extends BaseController
}else if($this->session->has('is_client_logged_in')){
$userData = $this->ClientBranchModel->where('id',$this->session->get('is_client_logged_in'))->get()->getRow();
}
// dd();
$doc_id = $this->request->getVar('doc_id');
$data['docData'] = $this->ClientDocsModel->docPreview($doc_id);
if(!empty($this->request->getVar('view_from')) && $this->request->getVar('view_from') == 'client'){
$data['docData'] = $this->ClientDocsModel->clientDocPreview($doc_id);
}else{
$data['docData'] = $this->ClientDocsModel->docPreview($doc_id);
}
// dd($data['docData']);
$data['clientData'] = $this->ClientBranchModel->select('client.name , client.pan_no ,
client_branch.gst_no , client_branch.mobile_no ,
client_branch.email , client_branch.address ,
@ -626,23 +636,26 @@ class MasterController extends BaseController
public function dateAndYearPlaceholder()
{
$currentDate = date('d-m-Y');
$currentYear = date('Y');
$currentMonth = date('m');
// $currentMonth = date('m');
$currentMonth = 1;
if ($currentMonth >= 4) {
$financialYearStart = $currentYear . '-04-01';
$financialYearEnd = ($currentYear + 1) . '-03-31';
$financialYear = $currentYear . '-' . ($currentYear + 1);
$assessmentYear = ($currentYear + 1) . '-' . ($currentYear + 2);
$financialYear = ($currentYear - 1) . '-' . ($currentYear );
$assessmentYear = $currentYear . '-' . ($currentYear + 1);
$q1 = '01-04-' . $currentYear . ' to ' . '30-06-' . $currentYear;
$q2 = '01-07-' . $currentYear . ' to ' . '30-09-' . $currentYear;
$q3 = '01-10-' . $currentYear . ' to ' . '31-12-' . $currentYear;
$q4 = '01-01-' . ($currentYear + 1) . ' to ' . '31-03-' . ($currentYear + 1);
} else {
$financialYearStart = ($currentYear - 1) . '-04-01';
$financialYearEnd = $currentYear . '-03-31';
$financialYear = ($currentYear - 1) . '-' . $currentYear;
$assessmentYear = $currentYear . '-' . ($currentYear + 1);
$financialYear = ($currentYear - 2) . '-' . $currentYear - 1;
$assessmentYear = ($currentYear - 1) . '-' . ($currentYear);
$q1 = '01-04-' . ($currentYear - 1) . ' to ' . '30-06-' . ($currentYear - 1);
$q2 = '01-07-' . ($currentYear - 1) . ' to ' . '30-09-' . ($currentYear - 1);
$q3 = '01-10-' . ($currentYear - 1) . ' to ' . '31-12-' . ($currentYear - 1);

View File

@ -36,15 +36,30 @@ class ClientDocsModel extends Model
public function docPreview($doc_id){
$this->select('client_docs.is_approved ,client_docs.id as doc_id,client_docs.client_branch_id ,client_docs.updated_at,client_docs.ip_address,template.template_name,client_docs.body_html ,client_docs.is_active,client_docs.document_name,client_docs.place_holder_object, services.service_name , business.header_html, business.footer_html');
$this->join('template', 'template.template_id = client_docs.template_id','left');
$this->join('services', 'services.service_id = template.service_id','left');
$this->join('business', 'business.business_id = template.template_header_business','left');
// if($this->session->get('logged_in_staff_role') == 'Admin' || ){
// }else{
// }
$this->where('md5(client_docs.id)', $doc_id);
return $this->get()->getRow();
}
public function clientDocPreview($doc_id){
$this->select('client_docs.is_approved ,client_docs.id as doc_id,client_docs.client_branch_id ,client_docs.updated_at,client_docs.ip_address,template.template_name,client_docs.body_html ,client_docs.is_active,client_docs.document_name,client_docs.place_holder_object, services.service_name , business.header_html, business.footer_html');
$this->join('template', 'template.template_id = client_docs.template_id','left');
$this->join('services', 'services.service_id = template.service_id','left');
$this->join('business', 'business.business_id = template.template_header_business','left');
$this->where('client_docs.id', $doc_id);
return $this->get()->getRow();
}
}

View File

@ -63,7 +63,7 @@
<div class="btn-group dropdown">
<a href="javascript: void(0);" class="dropdown-toggle arrow-none btn btn-light btn-sm" data-toggle="dropdown" aria-expanded="false"><i class="mdi mdi-dots-horizontal"></i></a>
<div class="dropdown-menu dropdown-menu-right">
<a href="<?php echo base_url().'client_docs_preview?doc_id='.$value['doc_id']; ?>" class="dropdown-item"><i class='mdi mdi-eye-outline mr-1' style="margin-right: 16px !important;"></i>Preview</a>
<a href="<?php echo base_url().'client_docs_preview?doc_id='.$value['doc_id']. '&view_from=client' ; ?>" class="dropdown-item"><i class='mdi mdi-eye-outline mr-1' style="margin-right: 16px !important;"></i>Preview</a>
<a id="doc_history_button" data-id="<?php echo $value['doc_id']; ?>" class="dropdown-item" data-toggle="modal" data-target="#client-doc-history-modal" data-title="Share"><i class="mdi mdi-history" style="margin-right: 16px !important;"></i>History</a>
</div>
</div>

View File

@ -171,7 +171,7 @@
<div class="col-md-4">
<div class="form-group">
<label for="gstno">GST No</label>
<input class="form-control" name="gst_no" type="text" id="gst_no" required="" placeholder="GST No" pattern="[0-9]{2}[A-Z]{5}[0-9]{4}[A-Z]{1}[0-9]{1}[Z]{1}[0-9A-Z]{1}">
<input class="form-control" name="gst_no" type="text" id="gst_no" required="" placeholder="GST No" oninput="this.value = this.value.replace(/[^0-9A-Z]/g, '').toUpperCase();" pattern="[0-9]{2}[A-Z]{5}[0-9]{4}[A-Z]{1}[0-9]{1}[Z]{1}[0-9A-Z]{1}">
</div>
</div>
<div class="col-md-5">

View File

@ -144,7 +144,7 @@
<?php } ?>
<?php if($value['is_active'] == 1 && $value['is_approved'] == 0){ ?>
<a class="dropdown-item" data-id="<?php echo $value['id']; ?>" data-isactive="<?php echo $value['is_active']; ?>" title="Remember" onclick="rememberNotification(this)">
<i class="mdi mdi-email-send" style="margin-right: 16px !important; margin-left: 5px;"></i>Remember
<i class="mdi mdi-email-send" style="margin-right: 16px !important; margin-left: 5px;"></i>Reminder
</a>
<?php } ?>