Merge branch 'new_theme' of bitbucket.org:venbainformationtechnology/ria into new_theme

This commit is contained in:
vadivelJ96 2025-05-14 17:02:57 +05:30
commit aee115c545
6 changed files with 113 additions and 43 deletions

View File

@ -988,8 +988,9 @@ function viewIGRDetails()
$notification = new Notification();
$history_content = "<br>IGR History<br><br> <ul>";
$history = $result_for_history['history'];
$history_content = "<br><b>IGR History</b><br><br> <ul>";
// $history = $result_for_history['history']; // old
$history = $this->inwardgateregister_model->ViewIGRHistory($IGRNo);
if(!empty($history)){
$field_labels = [
@ -1025,22 +1026,57 @@ function viewIGRDetails()
];
// $history_content = "<br>The following values have been edited:"; //old Format
for ($j = 0; $j < count($history); $j++) {
$field_name = $history[$j]->field;
$readable_field = isset($field_labels[$field_name]) ? $field_labels[$field_name] : $field_name;
$history_content .= "<li>" .
(($history[$j]->IGRItem_No)
? $history[$j]->MaterialName . " (" . $history[$j]->MaterialCode . ") - "
: "") .
$readable_field . " " . $history[$j]->old_data .
" was updated into " . $history[$j]->new_data .
" by " . $history[$j]->history_by .
" on " . $history[$j]->indian_date .
" at " . $history[$j]->indian_time .
"</li><br>";
// $history_content .= "<br>" . $readable_field . ": `" . $history[$j]->old_data . "` was updated to `" . $history[$j]->new_data . "` .";
}
$history_content .= "</ul>";
for ($j = 0; $j < count($history); $j++) {
$field_name = $history[$j]->field;
$readable_field = isset($field_labels[$field_name]) ? $field_labels[$field_name] : $field_name;
if(intval($history[$j]->is_add) === 1) {
// $history_content .= $history[$j]->IGR_No . " was Created by " . $history[$j]->FullName . " on " . $history[$j]->indian_date . " at " . $history[$j]->indian_time . " </br></br>";
if ($history[$j]->field === "IGRStatus") {
$str1 = $history[$j]->new_data;
$str2 = preg_replace('/\bIGR\b/i', '', $str1);
$str2 = trim($str2);
$str2 = ($str2 === "CREATED") ? "GENERATED" : $str2;
$history_content .= "<li> ".$history[$j]->IGR_No . " was <b> ` " . $str2 . " ` </b> by " . $history[$j]->FullName .
" on " . $history[$j]->indian_date . " at " . $history[$j]->indian_time. " </li><br>";
} else {
$history_content .= "<li> ".$history[$j]->IGR_No . " was <b> ` GENERATED ` </b> by " . $history[$j]->FullName .
" on " . $history[$j]->indian_date . " at " . $history[$j]->indian_time. " </li><br>";
}
} else if (intval($history[$j]->is_edit) === 1) {
$str = $history[$j]->field;
if (!in_array($str, ["UpdateBY", "MaterialRcvdDate", "DeliveryChellanDate"])) {
$fieldName = preg_replace('/([a-z])([A-Z])/', '$1 $2', $str);
$displayOldData = (empty($history[$j]->old_data)) ? " " : $history[$j]->old_data;
$displayNewData = (empty($history[$j]->new_data)) ? " " : $history[$j]->new_data;
if ($history[$j]->field === "IGRStatus") {
$displayOldData = trim(preg_replace('/\bIGR\b/i', '', $displayOldData));
$displayOldData = ($displayOldData === "CREATED") ? "GENERATED" : $displayOldData;
$displayNewData = trim(preg_replace('/\bIGR\b/i', '', $displayNewData));
$displayNewData = ($displayNewData === "CREATED") ? "GENERATED" : $displayNewData;
}
if ($displayNewData || $displayOldData) {
$materialPart = (!empty($history[$j]->IGRItem_No)) ? $history[$j]->MaterialName . " ( " . $history[$j]->MaterialCode . " ) - " : "";
$history_content .= "<li> ".$materialPart . $readable_field . " <b> ` " . $displayOldData . " ` </b> was Updated into <b> ` " . $displayNewData . " ` </b> by " .
$history[$j]->FullName . " on " . $history[$j]->indian_date . " at " . $history[$j]->indian_time. " </li><br>";
}
}
} else if (intval($history[$j]->is_delete) === 1) {
$str = $history[$j]->field;
$fieldName = preg_replace('/([a-z])([A-Z])/', '$1 $2', $str);
$history_content .= "<li> ".$readable_field . " " . $history[$j]->new_data . " was deleted by " . $history[$j]->FullName .
" on " . $history[$j]->indian_date . " at " . $history[$j]->indian_time. " </li><br>";
}
// $history_content .= "<br>" . $readable_field . ": `" . $history[$j]->old_data . "` was updated to `" . $history[$j]->new_data . "` .";
}
$history_content .= " </ul>";
$to_email_addr = "";
for ($i = 0; $i < count($result_for_email['to_mails']); $i++) {
@ -1097,6 +1133,14 @@ function viewIGRDetails()
echo $finalstatement;
}
function generateSentence($record) {
$sentence = "<li>";
return $sentence;
}
function CancelIGR(){
# Step 1 : Gethering Data..

View File

@ -55,7 +55,7 @@ class Monthlypay_model extends Model
}
function getEmpPayDetails($current = "", $s = "")
function getEmpPayDetails_attendance_old($current = "", $s = "")
{
$month_val = date('m', strtotime($current));
@ -67,7 +67,7 @@ class Monthlypay_model extends Model
->select('t_employee_details.EmpID,t_employee_details.FirstName,t_employee_details.LastName,t_employee_details.DateofJoining,t_employee_details.is_driver')
//->join('t_emp_pay_data','t_emp_pay_data.EmpID=t_employee_details.EmpID','Left')
->where('t_employee_details.IsActive', 1)
->where('t_employee_details.is_driver', 0)
->where('t_employee_details.is_driver !=', 1)
->where('t_employee_details.DateofJoining <=', $lastdate)
->orderBy('EmpID', 'asc');
$query = $builder->get();
@ -77,6 +77,31 @@ class Monthlypay_model extends Model
return $result;
}
function getEmpPayDetails($current = "", $s = "")
{
$month_val = date('m', strtotime($current));
$year_val = date('Y', strtotime($current));
$date_val = cal_days_in_month(CAL_GREGORIAN, $month_val, $year_val);
//$monthyear_val = date('Y-m',strtotime($current));
$lastdate = $year_val . '-' . $month_val . '-' . $date_val;
$builder = $this->db->table('t_employee_details')
->select('t_employee_details.EmpID,t_employee_details.FirstName,t_employee_details.LastName,t_employee_details.DateofJoining,t_employee_details.is_driver')
//->join('t_emp_pay_data','t_emp_pay_data.EmpID=t_employee_details.EmpID','Left')
->join('t_monthly_pay_inputs as p','p.EmpID=t_employee_details.EmpID','Left')
->where('t_employee_details.IsActive', 1)
->where('t_employee_details.is_driver !=', 1)
->where('t_employee_details.DateofJoining <=', $lastdate)
->where("p.Month_Year IS NULL OR
STR_TO_DATE(p.Month_Year, '%m-%Y') <=", $lastdate)
->orderBy('EmpID', 'asc');
$query = $builder->get();
$result = $query->getResult();
// $last_query = $this->db->getLastQuery();
// echo $last_query;die;
return $result;
}
function getEmpPayDetailsforMonthInputs($current = "")
{

View File

@ -179,12 +179,12 @@
<table id="view_inward_gate_register" class="table table-bordered table-hover">
<thead>
<tr>
<th>Create Date</th>
<th>Invoice Date </th>
<th>IGR Date</th>
<th>IGR No</th>
<th>PO No</th>
<th>Supplier Name</th>
<th>Invoice No</th>
<th>Invoice Date </th>
<th>Item Count</th>
<th>Rec Qty</th>
<th>Net Weight</th>
@ -209,6 +209,14 @@
if(!empty($draft)){
?>
<tr id="<?php echo $index ?>" >
<td align="left" style="padding-left:0.4%;"><?php
$invdate = $record->DeliveryChellanDate;
if(!$invdate || $invdate == 'null' || $invdate === '0000-00-00 00:00:00'){
echo "";
}else{
$idate = new DateTime($invdate);
echo $idate->format('d-m-Y'); }
?></td>
<td align="left" style="padding-left:0.4%;"><?php echo $date; ?></td>
<td style="cursor:pointer; color:#0bb2b5" ><a data-toggle="modal" data-target="#Igrshow" data-id="<?php echo $index;?>" data-inx="<?php echo $index;?>" data-userid="<?php echo $record->IGRNO ?>" data-igrstatus="<?php echo $record->IGRStatus ?>">
<?php echo $record->IGRNO ?></a>
@ -218,14 +226,7 @@
</td>
<td><?php echo $record->SupplierName ?></td>
<td><?php echo $record->DeliveryChellanOrInvoiceNo ?></td>
<td align="left" style="padding-left:0.4%;"><?php
$invdate = $record->DeliveryChellanDate;
if(!$invdate || $invdate == 'null' || $invdate === '0000-00-00 00:00:00'){
echo "";
}else{
$date = new DateTime($invdate);
echo $date->format('d-m-Y'); }
?></td>
<td align="center"><?php echo $record->itemCount ?></td>
<td align="right"><?php echo $record->ReceivedQuantity ?></td>
<td align="center"><?php echo $record->NetWeight ?></td>

View File

@ -498,7 +498,7 @@ if (!empty($supplier)) {
<button type="button" class="btn btn-secondary" onclick="history.back()">
<span class="bold">Cancel</span>
</button>
<button type="button" id="updateSupplierBtnId" class="btn btn-info pull-right auditor-restricted-btn">Submit</button>
<button type="button" id="updateSupplierBtnId" class="btn btn-info pull-right">Submit</button>
</div>
</div>
</div>

View File

@ -61,7 +61,7 @@
<div class="col-12">
<div class="page-title-box page-title-box-alt">
<h4 class="page-title">Supplier Listing</h4>
<a class="btn btn-success auditor-restricted" href="<?php echo base_url(); ?>addsupplier">Add New Supplier</a>
<a class="btn btn-success" href="<?php echo base_url(); ?>addsupplier">Add New Supplier</a>
</div>
</div>
</div>
@ -164,7 +164,6 @@
<a style="cursor:pointer;" data-toggle="tooltip"
title="<?= $record->SupplierID ?> - Click here to delete Supplier details"
class="auditor-restricted-btn"
onclick="deletesupplier('<?php echo $record->SupplierID; ?>')"><i
class="fa fa-trash"
style="color:#02a8b5;"></i>&nbsp;&nbsp;&nbsp;

View File

@ -211,13 +211,14 @@
<table id="view_inward_gate_register" class="table table-bordered table-hover">
<thead>
<tr>
<th>Invoice Date</th>
<th>IGR Date</th>
<th>IGR Time</th>
<th>IGR No</th>
<th>PO No</th>
<th>Supplier Name</th>
<th>Invoice No</th>
<th>Invoice Date </th>
<!--!!!!!..... Don't remove the comment ..!!!!!!!!!!!! -->
@ -248,6 +249,13 @@
$time = $createddate->format('h:i A');
?>
<tr id="<?php echo $index ?>" >
<td align="left" style="padding-left: 0.4%"><?php
$invdate = $record->DeliveryChellanDate;
if(!$invdate || $invdate == 'null' || $invdate === '0000-00-00 00:00:00'){
echo "";
}else{
$idate = new DateTime($invdate);
echo $idate->format('d-m-Y'); } ?></td>
<td align="left" style="padding-left: 0.4%"><?php echo $date; ?></td>
<td align="center"><?php echo $time; ?></td>
<td style="cursor:pointer; color:#0bb2b5" >
@ -269,13 +277,6 @@
</td>
<td><?php echo $record->SupplierName ?></td>
<td><?php echo $record->DeliveryChellanOrInvoiceNo ?></td>
<td align="left" style="padding-left: 0.4%"><?php
$invdate = $record->DeliveryChellanDate;
if(!$invdate || $invdate == 'null' || $invdate === '0000-00-00 00:00:00'){
echo "";
}else{
$date = new DateTime($invdate);
echo $date->format('d-m-Y'); } ?></td>
<td align="center"
style=" display : none ;"><?php echo $record->itemCount ?></td>
@ -2333,7 +2334,7 @@
return new Date(parts[2], parts[1] - 1, parts[0]).getTime(); // Convert to timestamp
};
var orderColumnIndex = <?php echo (session()->get('roleText') == 'Auditor') ? 6 : 0; ?>;
var orderColumnIndex = <?php echo (session()->get('roleText') == 'Auditor') ? 0 : 1; ?>;
table = $('#view_inward_gate_register').DataTable({
dom: 'Blfrtip',
buttons: [
@ -2900,7 +2901,7 @@ $("#gasShortageCalculator, #editGasShortageCalculator").submit(function (event)
document.getElementById('exportGasShortage').addEventListener('click',function(){
exportTableToExcel(tableId, 'gas_shortage_<?= $date->format('d-m-Y') ?>.xlsx');
exportTableToExcel(tableId, 'gas_shortage_<?= $idate->format('d-m-Y') ?>.xlsx');
})