igr live fixes
This commit is contained in:
parent
b2b6e788b2
commit
1b411b0e63
@ -658,7 +658,8 @@ class Inwardgateregister extends BaseController
|
||||
|
||||
if ($fileupdated_count > 0) {
|
||||
$finalstatement .= "Number of files updated: $fileupdated_count \n";
|
||||
$finalstatement .= "Files: \n" . implode(PHP_EOL, $fileupdated_name);
|
||||
// $finalstatement .= "Files: \n" . implode(PHP_EOL, $fileupdated_name);
|
||||
$finalstatement .= "Files: \n" . implode(PHP_EOL, array_map(fn($file) => "• " . $file, $fileupdated_name));
|
||||
} else {
|
||||
$finalstatement .= "No files to update";
|
||||
}
|
||||
@ -811,21 +812,23 @@ function viewIGRDetails()
|
||||
$igrarr = array('DeliveryChellanDate' => $DeliveryChellanDate, 'MaterialRcvdDate' => $MaterialRcvdDt,'VehicleNo'=>$VehicleNo,'TransporterId'=>$TransporterId,'DriverMobileNumber'=>$DriverMobileNumber,'DriverName'=>$DriverName, 'IGRStatus' => $IGRStatus,'UpdateBY' => $updateby,'DeliveryChellanOrInvoiceNo'=>$DeliveryChellanOrInvoiceNo,'Remark'=>$MasterRemarks);
|
||||
|
||||
$MasterFile = $this->request->getfile('MasterFile');
|
||||
$fileupdated_count = 0;
|
||||
$fileupdated_name = [];
|
||||
|
||||
if ($MasterFile) {
|
||||
if (!empty($MasterFile)) {
|
||||
$requestMasterFileName = $MasterFile->getName();
|
||||
if ($MasterFile && $MasterFile->isValid() && !$MasterFile->hasMoved()) {
|
||||
if (!empty($this->inwardgateregister_model->isFileExistsInIGRmaster($requestMasterFileName))) {
|
||||
log_message('error', 'File already exists in the database'.$requestMasterFileName);
|
||||
}
|
||||
else{
|
||||
$MasterFile->move($path, $requestMasterFileName);
|
||||
$MasterFile->move($path, $requestMasterFileName);
|
||||
$fileupdated_count++;
|
||||
$fileupdated_name[] = $requestMasterFileName;
|
||||
$igrarr['MasterFile'] = $requestMasterFileName;
|
||||
}
|
||||
}
|
||||
}
|
||||
$fileupdated_count = 0;
|
||||
$fileupdated_name = [];
|
||||
|
||||
$fileNames = $this->request->getPost('file_name');
|
||||
$files = $this->request->getFileMultiple('emp_file');
|
||||
@ -913,9 +916,16 @@ function viewIGRDetails()
|
||||
|
||||
}
|
||||
if ($getigrstatus == 'ST027' && ($updateigrmaster > 0 || $updateigrlineitem > 0)) {
|
||||
|
||||
|
||||
$result_for_email = $this->inwardgateregister_model->getDetailsforEmail($this->session->get('userId'));
|
||||
|
||||
if(session()->get('roleText') == 'System Administrator') // id is 1
|
||||
{
|
||||
$roleId = 2;
|
||||
}
|
||||
else if(session()->get('roleText') == 'Auditor') // id is 2
|
||||
{
|
||||
$roleId = 1;
|
||||
}
|
||||
$result_for_email = $this->inwardgateregister_model->getDetailsforEmail($this->session->get('userId'),$roleId);
|
||||
$result_for_history = $this->inwardgateregister_model->getHistoryDetailsforEmail($IGRNo);
|
||||
|
||||
|
||||
@ -982,6 +992,7 @@ function viewIGRDetails()
|
||||
$email_response = $notification->sendEmail([
|
||||
'recipient_email' => $email,
|
||||
'subject' => $result_for_email['company'].' - IGR Notification',
|
||||
// 'carboncopy'=>Sales@resicoindustries.com,Factory@resicoindustries.com,Invoice@resicoindustries.com,
|
||||
// 'description' => 'IGR Number : '.$IGRNo.' is Edited By '.($result_for_email['full_name'] ?? $this->session->get('name'))." On ".date('d-m-Y H:i A', strtotime(get_current_date_time() . ' +30 seconds')). $history_content,
|
||||
'description' => $result_for_history['first_line']."<br>" .$history_content,
|
||||
'company' => $result_for_email['company'],
|
||||
@ -1016,7 +1027,8 @@ function viewIGRDetails()
|
||||
|
||||
if ($fileupdated_count > 0) {
|
||||
$finalstatement .= "Number of files updated: $fileupdated_count \n";
|
||||
$finalstatement .= "Files: \n" . implode(PHP_EOL, $fileupdated_name);
|
||||
// $finalstatement .= "Files: \n" . implode(PHP_EOL, $fileupdated_name);
|
||||
$finalstatement .= "Files: \n" . implode(PHP_EOL, array_map(fn($file) => "• " . $file, $fileupdated_name));
|
||||
} else {
|
||||
$finalstatement .= "No files to update";
|
||||
}
|
||||
|
||||
@ -1300,7 +1300,7 @@ $builder = $this->db->table('t_igr_history')
|
||||
];
|
||||
}
|
||||
|
||||
public function getDetailsforEmail($userId,$roleId = 2)
|
||||
public function getDetailsforEmail($userId,$roleId)
|
||||
{
|
||||
$query0 = $this->db->query("
|
||||
SELECT CompanyName,EmailAddress
|
||||
|
||||
@ -127,6 +127,16 @@ if (!empty($emppay)) {
|
||||
.num {
|
||||
text-align: right;
|
||||
}
|
||||
.btn-soft-primary {
|
||||
color: white;
|
||||
background-color: rgb(42, 206, 150);
|
||||
border-color: rgb(42, 206, 150);
|
||||
}
|
||||
|
||||
.btn-soft-primary:hover {
|
||||
background-color: rgb(32, 176, 130); /* Slightly darker shade for hover */
|
||||
border-color: rgb(32, 176, 130);
|
||||
}
|
||||
</style>
|
||||
|
||||
<div class="content-page">
|
||||
@ -253,7 +263,12 @@ if (!empty($emppay)) {
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="form-group">
|
||||
<label class="d-block" for="request_letter">Request letter</label>
|
||||
<label class="d-block" for="request_letter">
|
||||
Request letter
|
||||
<!-- <?php if ($request_letter) { ?>
|
||||
<a class="btn btn-soft-primary waves-effect waves-light btn-sm" title="Download Previous Upload - <?= $request_letter; ?>" href="<?php echo base_url() . 'public/uploads/images/' . $request_letter ?>"><i class="fa fa-download"></i></a>
|
||||
<?php } ?> -->
|
||||
</label>
|
||||
<input type="file" accept=".docx,.pdf,.doc,.jpg,.png" id="request_letter" name="request_letter" style="margin-top: 5px;" />
|
||||
<input type="hidden" id="hidden_request_letter" name="hidden_request_letter" value="<?php echo $request_letter; ?>" />
|
||||
</div>
|
||||
@ -271,17 +286,23 @@ if (!empty($emppay)) {
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="form-group">
|
||||
<label class="d-block" for="payment_statement">Payment Receipt</label>
|
||||
<label class="d-block" for="payment_statement">
|
||||
Payment Receipt
|
||||
<!-- <?php if ($payment_statement) { ?>
|
||||
<a class="btn btn-soft-primary waves-effect waves-light btn-sm" title="Download Previous Upload - <?= $payment_statement; ?>" href="<?php echo base_url() . 'public/uploads/images/' . $payment_statement ?>"><i class="fa fa-download"></i></a>
|
||||
<?php } ?> -->
|
||||
</label>
|
||||
<input type="file" accept=".docx,.pdf,.doc,.jpg,.png" id="payment_statement" name="payment_statement" style="margin-top: 5px;" />
|
||||
<input type="hidden" id="hidden_payment_statement" name="hidden_payment_statement" value="<?php echo $payment_statement; ?>" />
|
||||
|
||||
</div>
|
||||
<?php if ($request_letter) { ?>
|
||||
<span class="help-block"><small>
|
||||
<a href="<?php echo base_url() . 'public/uploads/images/' . $payment_statement ?>">
|
||||
<span>Previous Upload - </span><small><?= $payment_statement; ?></small>
|
||||
</a>
|
||||
</small></span>
|
||||
<?php if ($payment_statement) { ?>
|
||||
<div class="mb-1">
|
||||
<a href="<?php echo base_url() . 'public/uploads/images/' . $payment_statement ?>">
|
||||
<span>Previous Upload - </span><small><?= $payment_statement; ?></small>
|
||||
</a>
|
||||
</div>
|
||||
<br>
|
||||
<?php } ?>
|
||||
</div>
|
||||
</div> <!-- 2nd row div closed here -->
|
||||
|
||||
@ -31,15 +31,15 @@
|
||||
<div class="card">
|
||||
<div class="row" style="padding: 18px 26px;">
|
||||
<div class="col-md-3">
|
||||
<span>Holiday Name : </span>
|
||||
<label>Holiday Name : </label>
|
||||
<input type="text" name="hname" id="hname" class="form-control">
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<span>Date : </span>
|
||||
<label>Date : </label>
|
||||
<input type="text" name="hdate" id="hdate" class="form-control">
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<input type="button" id="Add" value="Add" class="btn btn-success" class="form-control" style="margin-top: 20px;margin-bottom: 0px;">
|
||||
<input type="button" id="Add" value="Add" class="btn btn-success" class="form-control" style="margin-top: 25px;margin-bottom: 0px;">
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
|
||||
@ -235,7 +235,7 @@
|
||||
|
||||
<!-- Long Content Scroll Modal -->
|
||||
<div class="modal fade" id="scrollable-modal" tabindex="-1" role="dialog" aria-labelledby="scrollableModalTitle" aria-hidden="true" style="max-width: 100%;">
|
||||
<div class="modal-dialog modal-dialog-scrollable" role="document" style="max-width: 50%;">
|
||||
<div class="modal-dialog modal-dialog-scrollable modal-lg" role="document" style="max-width: 65%;">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="scrollableModalTitle">Material Details</h5>
|
||||
@ -312,7 +312,7 @@ $(document).ready(function () {
|
||||
<th style="text-align: center;" >PONO</th>
|
||||
<th style="text-align: center;" >PO Type</th>
|
||||
<th style="text-align: center;" >Total Value</th>
|
||||
|
||||
<th style="text-align: center;" >Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@ -321,6 +321,9 @@ $(document).ready(function () {
|
||||
result.forEach(item => {
|
||||
CreatedDate = formatDate(item.CreatedDate);
|
||||
TotalOrderValue = formatNumberToIndianCurrency(item.TotalOrderValue);
|
||||
baseUrl = "<?php echo base_url() ?>";
|
||||
href = `${baseUrl}purchaseorder/CreatePOPrint?PONO=${item.PONO}&ReqType=${item.ReqType}`;
|
||||
|
||||
tableHtml += `
|
||||
<tr>
|
||||
<td>${CreatedDate}</td>
|
||||
@ -328,9 +331,14 @@ $(document).ready(function () {
|
||||
<td class="pono-cell" data-pono="${item.PONO}" data-potype="${item.POType}" data-capitalrange="${item.CapitalRange}" style="cursor: pointer; color: #4d3a6d;">
|
||||
${item.PONO}
|
||||
</td>
|
||||
<td style="text-align: right;">${item.POType}</td>
|
||||
<td style="text-align: right;">${item.POType}</td>
|
||||
<td style="text-align: right;">${TotalOrderValue}</td>
|
||||
</tr>
|
||||
<td style="text-align: center;">
|
||||
<a data-toggle="tooltip" href=${href} target="_blank">
|
||||
<i class="fa fa-print" data-toggle="tooltip" title="${item.PONO} - Click here to Print the Purchase Order details"></i>
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
`;
|
||||
});
|
||||
|
||||
|
||||
@ -529,7 +529,7 @@
|
||||
<label> Master IGR file</label>
|
||||
<br>
|
||||
<input type="file" name="MasterFile" id="MasterFile" onchange="filenames(this.name); ">
|
||||
<label id="MasterFileLabel" style="display:none;">
|
||||
<label id="MasterFileLabel" style="display:none;" class="mt-1">
|
||||
<a><span></span><small></small></a>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user