Merge branch 'new_theme' of bitbucket.org:venbainformationtechnology/ria into new_theme
This commit is contained in:
commit
74d6b0fd85
@ -200,6 +200,7 @@ $routes->post('monthlypay/deletePublicHoliday', 'Monthlypay::deletePublicHoliday
|
|||||||
$routes->get('leaveApplicationForm', 'Monthlypay::leaveApplicationForm');
|
$routes->get('leaveApplicationForm', 'Monthlypay::leaveApplicationForm');
|
||||||
$routes->post('fetchLeaveApplicationForm', 'Monthlypay::fetchLeaveApplicationForm');
|
$routes->post('fetchLeaveApplicationForm', 'Monthlypay::fetchLeaveApplicationForm');
|
||||||
$routes->get('deleteLeaveApplicationForm', 'Monthlypay::deleteLeaveApplicationForm');
|
$routes->get('deleteLeaveApplicationForm', 'Monthlypay::deleteLeaveApplicationForm');
|
||||||
|
$routes->post('validateDateRange', 'Monthlypay::validateDateRange');
|
||||||
$routes->match(['GET', 'POST'], 'leaveApplicationPDF/(:any)', 'Monthlypay::leaveApplicationPDF/$1');
|
$routes->match(['GET', 'POST'], 'leaveApplicationPDF/(:any)', 'Monthlypay::leaveApplicationPDF/$1');
|
||||||
$routes->match(['GET', 'POST'], 'overTimeDetails', 'Monthlypay::overTimeDetails');
|
$routes->match(['GET', 'POST'], 'overTimeDetails', 'Monthlypay::overTimeDetails');
|
||||||
|
|
||||||
|
|||||||
@ -617,12 +617,14 @@ class Emergencypurchaseorder extends BaseController
|
|||||||
|
|
||||||
$igr = array();
|
$igr = array();
|
||||||
$paymentstatus = NO_PAIDIGR;
|
$paymentstatus = NO_PAIDIGR;
|
||||||
$igr = array('PONO' => $PONO, 'VehicleNo' => $Vehicle, 'DeliveryChellanOrInvoiceNo' => $DeliveryChellanInvoiceNo, 'DeliveryChellanDate' => $DeliveryChellanDate, 'MaterialRcvdDate' => $DeliveryChellanDate, 'CourierNo' => $Courier, 'IGRStatus' => $IGRStatus, 'CreatedBy' => $CreatedBy, 'CreatedDate' => $createddt, 'MaterialRcvdDate' => $MaterialReceivedate, 'Paymentstatus' => $paymentstatus);
|
$last_igrno = $this->inwardgateregister_model->lastIGRNO();
|
||||||
|
$newIGRNO = generate_igr_number($last_igrno);
|
||||||
|
$igr = array('IGRNO'=>$newIGRNO,'PONO' => $PONO, 'VehicleNo' => $Vehicle, 'DeliveryChellanOrInvoiceNo' => $DeliveryChellanInvoiceNo, 'DeliveryChellanDate' => $DeliveryChellanDate, 'MaterialRcvdDate' => $DeliveryChellanDate, 'CourierNo' => $Courier, 'IGRStatus' => $IGRStatus, 'CreatedBy' => $CreatedBy, 'CreatedDate' => $createddt, 'MaterialRcvdDate' => $MaterialReceivedate, 'Paymentstatus' => $paymentstatus);
|
||||||
|
|
||||||
//print_r($igr);
|
//print_r($igr);
|
||||||
|
|
||||||
$igrM = $this->inwardgateregister_model->addigrM($igr);
|
$igrM = $this->inwardgateregister_model->addigrM($igr);
|
||||||
$IGRNO = !empty($igrM) ? $igrM : '';
|
$IGRNO = $newIGRNO;
|
||||||
|
|
||||||
if ($Qualitycheck == 0) {
|
if ($Qualitycheck == 0) {
|
||||||
|
|
||||||
|
|||||||
@ -451,7 +451,11 @@ class Inwardgateregister extends BaseController
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
#Step 3 Master Details Gathering to Save In DB
|
#Step 3 Master Details Gathering to Save In DB
|
||||||
$igr = array('PONO' => $PONO, 'VehicleNo' => $VehicleNo, 'TransporterId'=>$TransporterId,'DeliveryChellanOrInvoiceNo' => $DeliveryChellanOrInvoiceNo, 'DeliveryChellanDate' => $DeliveryChellanDate, 'MaterialRcvdDate' => $MaterialRcvdDt, 'DriverName' => $DriverName, 'DriverMobileNumber' => $DriverMobileNumber,'IGRStatus' => $IGRStatus, 'CreatedBy' => $CreatedBy, 'CreatedDate' => $createddt, 'PaymentStatus' => $paymentstatus, 'Remark'=>$MasterRemarks);
|
$last_igrno = $this->inwardgateregister_model->lastIGRNO();
|
||||||
|
// echo $last_igrno;
|
||||||
|
$newIGRNO = generate_igr_number($last_igrno);
|
||||||
|
// echo $newIGRNO;die;
|
||||||
|
$igr = array('IGRNO'=>$newIGRNO,'PONO' => $PONO, 'VehicleNo' => $VehicleNo, 'TransporterId'=>$TransporterId,'DeliveryChellanOrInvoiceNo' => $DeliveryChellanOrInvoiceNo, 'DeliveryChellanDate' => $DeliveryChellanDate, 'MaterialRcvdDate' => $MaterialRcvdDt, 'DriverName' => $DriverName, 'DriverMobileNumber' => $DriverMobileNumber,'IGRStatus' => $IGRStatus, 'CreatedBy' => $CreatedBy, 'CreatedDate' => $createddt, 'PaymentStatus' => $paymentstatus, 'Remark'=>$MasterRemarks);
|
||||||
$igr['MasterFile'] = $requestMasterFileName;
|
$igr['MasterFile'] = $requestMasterFileName;
|
||||||
#Step 4 Calling DB to Save IGR Master
|
#Step 4 Calling DB to Save IGR Master
|
||||||
$IGRNO = $this->inwardgateregister_model->addigrM($igr);
|
$IGRNO = $this->inwardgateregister_model->addigrM($igr);
|
||||||
@ -992,13 +996,13 @@ function viewIGRDetails()
|
|||||||
$to_email_addr = "";
|
$to_email_addr = "";
|
||||||
for ($i = 0; $i < count($result_for_email['to_mails']); $i++) {
|
for ($i = 0; $i < count($result_for_email['to_mails']); $i++) {
|
||||||
$to_email_addr .= $result_for_email['to_mails'][$i]->email . " , ";
|
$to_email_addr .= $result_for_email['to_mails'][$i]->email . " , ";
|
||||||
// $to_email_addr .= "sanjeev.p@venbainfotech.com,gowtham.m@venbainfotech.com";
|
|
||||||
}
|
}
|
||||||
|
// $to_email_addr .= "sanjeev.p@venbainfotech.com,gowtham.m@venbainfotech.com";
|
||||||
$to_email_addr = rtrim($to_email_addr, " ,");
|
$to_email_addr = rtrim($to_email_addr, " ,");
|
||||||
$email_response = $notification->sendEmail([
|
$email_response = $notification->sendEmail([
|
||||||
'recipient_email' => $to_email_addr,
|
'recipient_email' => $to_email_addr,
|
||||||
'subject' => $result_for_email['company'].' - IGR Notification',
|
'subject' => $result_for_email['company'].' - IGR Notification',
|
||||||
// 'carboncopy'=>Sales@resicoindustries.com,Factory@resicoindustries.com,Invoice@resicoindustries.com,
|
'carboncopy' =>"pavithra.t@venbainfotech.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' => '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,
|
'description' => $result_for_history['first_line']."<br>" .$history_content,
|
||||||
'company' => $result_for_email['company'],
|
'company' => $result_for_email['company'],
|
||||||
@ -1436,7 +1440,7 @@ function updateIGRWeight(){
|
|||||||
for ($i = 0; $i < count($result_for_email['to_mails']); $i++) {
|
for ($i = 0; $i < count($result_for_email['to_mails']); $i++) {
|
||||||
$to_email_addr .= $result_for_email['to_mails'][$i]->email . " , ";
|
$to_email_addr .= $result_for_email['to_mails'][$i]->email . " , ";
|
||||||
}
|
}
|
||||||
// $to_email_addr = " gowtham.m@venbainfotech.com , sanjeev.p@venbainfotech.com";
|
// $to_email_addr = " venbalap08@gmail.com , sanjeev.p@venbainfotech.com";
|
||||||
$to_email_addr = rtrim($to_email_addr, " ,");
|
$to_email_addr = rtrim($to_email_addr, " ,");
|
||||||
|
|
||||||
$content = 'A new remark was created by '.$result_for_email['full_name'].' against IGR no '.$IGRNo.',</br></br> "'.$remark.'"';
|
$content = 'A new remark was created by '.$result_for_email['full_name'].' against IGR no '.$IGRNo.',</br></br> "'.$remark.'"';
|
||||||
@ -1445,6 +1449,7 @@ function updateIGRWeight(){
|
|||||||
$notification->sendEmail([
|
$notification->sendEmail([
|
||||||
'recipient_email' => $to_email_addr,
|
'recipient_email' => $to_email_addr,
|
||||||
'subject' => $result_for_email['company'].' - IGR Remark Raised',
|
'subject' => $result_for_email['company'].' - IGR Remark Raised',
|
||||||
|
'carboncopy' =>"pavithra.t@venbainfotech.com",
|
||||||
'description' => $content,
|
'description' => $content,
|
||||||
'company' => $result_for_email['company'],
|
'company' => $result_for_email['company'],
|
||||||
'from_mail'=> $result_for_email['from_mails']
|
'from_mail'=> $result_for_email['from_mails']
|
||||||
|
|||||||
@ -111,7 +111,7 @@ class Monthlypay extends BaseController
|
|||||||
|
|
||||||
$current = $this->request->getPost('month');
|
$current = $this->request->getPost('month');
|
||||||
$month_short_name = substr((string)$current, 0, 3);
|
$month_short_name = substr((string)$current, 0, 3);
|
||||||
$year = substr((string)$current, 4);
|
$year = substr((string)$current, 4);// also used
|
||||||
$month_arr = date_parse($month_short_name);
|
$month_arr = date_parse($month_short_name);
|
||||||
$month = $month_arr['month'];
|
$month = $month_arr['month'];
|
||||||
$current = $year . "-" . $month . '-01';
|
$current = $year . "-" . $month . '-01';
|
||||||
@ -151,7 +151,44 @@ class Monthlypay extends BaseController
|
|||||||
$data['datefordropdown'] = $current;
|
$data['datefordropdown'] = $current;
|
||||||
$data['attendance'] = $this->monthlypay_model->monthlyAttendance($current);
|
$data['attendance'] = $this->monthlypay_model->monthlyAttendance($current);
|
||||||
$data['emppay'] = $this->monthlypay_model->getEmpPayDetails($current, $string);
|
$data['emppay'] = $this->monthlypay_model->getEmpPayDetails($current, $string);
|
||||||
// dd($data);
|
$leavedate = $this->monthlypay_model->employeeLeaveDates($month . "-" . $year);
|
||||||
|
$employeeLeaveDate = [];
|
||||||
|
|
||||||
|
if(!empty($leavedate)){
|
||||||
|
foreach ($leavedate as $entry) {
|
||||||
|
$empId = $entry['emp_id'];
|
||||||
|
|
||||||
|
list($stYear,$stMonth,$stDate) = explode('-', $entry['start_date']);
|
||||||
|
list($eYear,$eMonth,$eDate) = explode('-', $entry['end_date']);
|
||||||
|
|
||||||
|
$start = (int)$stDate;
|
||||||
|
$end = (int)$eDate;
|
||||||
|
|
||||||
|
if ((int)$stYear < (int)$year || ((int)$stYear == (int)$year && (int)$stMonth < (int)$month)) {
|
||||||
|
$start = 1;
|
||||||
|
}
|
||||||
|
// if ((int)$stMonth < (int)$month) $start = 1; // old if
|
||||||
|
|
||||||
|
if ((int)$eYear > (int)$year || ((int)$eYear == (int)$year && (int)$eMonth > (int)$month)) {
|
||||||
|
$end = $monthdays;
|
||||||
|
}
|
||||||
|
// if ((int)$eMonth > (int)$month) $end = $monthdays; // old if
|
||||||
|
|
||||||
|
if ($start > $monthdays) $start = 1;
|
||||||
|
|
||||||
|
for ($i = $start; $i <= $end; $i++) {
|
||||||
|
$employeeLeaveDate[$empId][] = $i;
|
||||||
|
// $employeeLeaveDate[$empId][] = str_pad($i, 2, '0', STR_PAD_LEFT);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if($employeeLeaveDate){
|
||||||
|
array_walk($employeeLeaveDate, fn(&$dates) => $dates = array_unique($dates));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$data['employeeleavedate'] = $employeeLeaveDate;
|
||||||
|
// dd($data['employeeleavedate']);
|
||||||
$this->global['pageTitle'] = 'Monthly Attendance';
|
$this->global['pageTitle'] = 'Monthly Attendance';
|
||||||
$this->loadViews("attendance", $this->global, $data, NULL);
|
$this->loadViews("attendance", $this->global, $data, NULL);
|
||||||
}
|
}
|
||||||
@ -971,6 +1008,20 @@ class Monthlypay extends BaseController
|
|||||||
|
|
||||||
return $this->response->setJSON($data);
|
return $this->response->setJSON($data);
|
||||||
}
|
}
|
||||||
|
public function validateDateRange(){
|
||||||
|
|
||||||
|
$emp_id = $this->request->getPost('emp_id');
|
||||||
|
$start_date = $this->request->getPost('start_date');
|
||||||
|
$end_date = $this->request->getPost('end_date');
|
||||||
|
$array = $this->monthlypay_model->validateDateRange($emp_id,$start_date,$end_date);
|
||||||
|
if (!empty($array) && count($array) > 0) {
|
||||||
|
$data = ['status' => true, 'message' => 'The selected date range overlaps with an existing approved leave.','details'=>$array];
|
||||||
|
}else{
|
||||||
|
$data = ['status' => false, 'message' => '','details'=>$array];
|
||||||
|
}
|
||||||
|
|
||||||
|
return $this->response->setJSON($data);
|
||||||
|
}
|
||||||
|
|
||||||
function deleteLeaveApplicationForm()
|
function deleteLeaveApplicationForm()
|
||||||
{
|
{
|
||||||
|
|||||||
@ -178,6 +178,8 @@ class Payslip extends BaseController
|
|||||||
$data['fresh'] = $this->monthlypay_model->getEmpPayDetailsforMonthInputs($current);
|
$data['fresh'] = $this->monthlypay_model->getEmpPayDetailsforMonthInputs($current);
|
||||||
// dd($data['fresh']);
|
// dd($data['fresh']);
|
||||||
$data['drivermonthinputs'] = $this->driverMonthlyPayInputs($current);
|
$data['drivermonthinputs'] = $this->driverMonthlyPayInputs($current);
|
||||||
|
// $leavedate = $this->monthlypay_model->employeeLeaveDates($current);
|
||||||
|
|
||||||
$employeeSalary = [];
|
$employeeSalary = [];
|
||||||
$esi = [];
|
$esi = [];
|
||||||
$pf = [];
|
$pf = [];
|
||||||
@ -303,7 +305,6 @@ class Payslip extends BaseController
|
|||||||
$data['pf'] = $pf;
|
$data['pf'] = $pf;
|
||||||
$data['over_time'] = $ot;
|
$data['over_time'] = $ot;
|
||||||
|
|
||||||
|
|
||||||
$this->global['pageTitle'] = 'Payroll Monthly Inputs';
|
$this->global['pageTitle'] = 'Payroll Monthly Inputs';
|
||||||
$this->loadViews("monthlypayinputs", $this->global, $data, NULL);
|
$this->loadViews("monthlypayinputs", $this->global, $data, NULL);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1020,7 +1020,7 @@ class User extends BaseController
|
|||||||
|
|
||||||
// Validation passed
|
// Validation passed
|
||||||
$EmpID = $this->request->getPost('EmpList');
|
$EmpID = $this->request->getPost('EmpList');
|
||||||
$roleId = '2';
|
$roleId = !empty($this->request->getPost('role')) ? $this->request->getPost('role') : '2' ;
|
||||||
$password = (string)$this->request->getPost('password');
|
$password = (string)$this->request->getPost('password');
|
||||||
$Createddt = date('Y-m-d H:i:s');
|
$Createddt = date('Y-m-d H:i:s');
|
||||||
$email = $this->request->getPost('MailID');
|
$email = $this->request->getPost('MailID');
|
||||||
|
|||||||
@ -27,6 +27,48 @@ if (!function_exists('generate_po_number')) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!function_exists('generate_igr_number')) {
|
||||||
|
function generate_igr_number($last_igrno)
|
||||||
|
{
|
||||||
|
$shortenFinYear = get_shorten_financial_year();
|
||||||
|
|
||||||
|
if (preg_match('/^\w+\/\d+-\d+\/\d+$/', $last_igrno)) {
|
||||||
|
// echo $last_igrno;
|
||||||
|
$type = 1; // IGRNO/25-26/00001 // 2025 april onwards karthick asked to changed this type.
|
||||||
|
} elseif (preg_match('/^\w+-\d+$/', $last_igrno)) {
|
||||||
|
// echo $last_igrno;
|
||||||
|
$type = 2; // IGRNO-0001 // karthick asked to checked this type 2023- 2025 april
|
||||||
|
} else {
|
||||||
|
// echo $last_igrno;
|
||||||
|
$type = 3; // IGRNO00001 // very first time we followed this type
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($type == 1) {
|
||||||
|
$result = explode('/', $last_igrno);
|
||||||
|
$requestedFinYear = $result[1];
|
||||||
|
$leftPad = "IGR";
|
||||||
|
$digit = 4;
|
||||||
|
|
||||||
|
if($requestedFinYear == $shortenFinYear){ // here i am comparing the shoren fin year
|
||||||
|
$number = ((int)$result[2])+1;
|
||||||
|
$IgrNo = $leftPad . '/' . $shortenFinYear . '/' . str_pad($number, $digit, '0', STR_PAD_LEFT);
|
||||||
|
}else{
|
||||||
|
// here not same means ressetted type 1 format
|
||||||
|
$counter = 1;
|
||||||
|
$IgrNo = $leftPad . '/' . $shortenFinYear . '/' . str_pad($counter, $digit, '0', STR_PAD_LEFT);
|
||||||
|
}
|
||||||
|
return $IgrNo;
|
||||||
|
}else{
|
||||||
|
// type 2 and type 3 is converted into type 1 format
|
||||||
|
$leftPad = "IGR";
|
||||||
|
$digit = 5;
|
||||||
|
$counter = 1;
|
||||||
|
$IgrNo = $leftPad . '/' . $shortenFinYear . '/' . str_pad($counter, $digit, '0', STR_PAD_LEFT);
|
||||||
|
return $IgrNo;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function generate_amendment_po_number($PoNo, $increment = 1) {
|
function generate_amendment_po_number($PoNo, $increment = 1) {
|
||||||
if (strpos($PoNo, '.') !== false) {
|
if (strpos($PoNo, '.') !== false) {
|
||||||
list($base, $decimal) = explode('.', $PoNo);
|
list($base, $decimal) = explode('.', $PoNo);
|
||||||
|
|||||||
@ -221,7 +221,9 @@ class Inwardgateregister_model extends Model
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function igr_history($hsty_arr) {
|
public function igr_history($hsty_arr) {
|
||||||
$keysToRemove = ["UpdateBY", "MaterialRcvdDate", "DeliveryChellanDate"];
|
|
||||||
|
$keysToRemove = ["UpdateBY","UpdateBy", "MaterialRcvdDate", "DeliveryChellanDate"];
|
||||||
|
|
||||||
foreach ($keysToRemove as $key) {
|
foreach ($keysToRemove as $key) {
|
||||||
if (isset($hsty_arr[$key])) {
|
if (isset($hsty_arr[$key])) {
|
||||||
unset($hsty_arr[$key]);
|
unset($hsty_arr[$key]);
|
||||||
@ -230,8 +232,7 @@ class Inwardgateregister_model extends Model
|
|||||||
|
|
||||||
$builder = $this->db->table('t_igr_history');
|
$builder = $this->db->table('t_igr_history');
|
||||||
$builder->insert($hsty_arr);
|
$builder->insert($hsty_arr);
|
||||||
|
return $this->db->insertID();
|
||||||
return $this->db->insertID(); // Return last inserted ID
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function get_igr_history($col,$IGR,$IGRITEM = null)
|
function get_igr_history($col,$IGR,$IGRITEM = null)
|
||||||
@ -273,6 +274,13 @@ class Inwardgateregister_model extends Model
|
|||||||
return $result; // Return the field value directly
|
return $result; // Return the field value directly
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function lastIGRNO()
|
||||||
|
{
|
||||||
|
$query = $this->db->table('t_igr_master')->select('IGRNO')->orderBy('IGRID', 'DESC')->limit(1)->get();
|
||||||
|
$lastIGRNO = $query->getRow()->IGRNO;
|
||||||
|
return $lastIGRNO;
|
||||||
|
}
|
||||||
|
|
||||||
function addigrM($igrM)
|
function addigrM($igrM)
|
||||||
{
|
{
|
||||||
// print_r($igrM);die;
|
// print_r($igrM);die;
|
||||||
|
|||||||
@ -571,6 +571,26 @@ where Month_Year = ? and att.EmpID in (select EmpID from t_attendance)";
|
|||||||
return $this->db->affectedRows();
|
return $this->db->affectedRows();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
public function validateDateRange($emp_id,$start_date,$end_date){
|
||||||
|
|
||||||
|
$array = $this->db->table('t_employee_leave_application_form')
|
||||||
|
->where('emp_id', $emp_id)
|
||||||
|
->where('status', 'Approved')
|
||||||
|
->groupStart() // Start grouping OR conditions
|
||||||
|
->where("'$start_date' BETWEEN start_date AND end_date", null, false)
|
||||||
|
->orWhere("'$end_date' BETWEEN start_date AND end_date", null, false)
|
||||||
|
->orWhere("start_date BETWEEN '$start_date' AND '$end_date'", null, false)
|
||||||
|
->orWhere("end_date BETWEEN '$start_date' AND '$end_date'", null, false)
|
||||||
|
->groupEnd() // End grouping
|
||||||
|
->get()
|
||||||
|
->getRowArray();
|
||||||
|
|
||||||
|
// $last_query = $this->db->getLastQuery();
|
||||||
|
// echo $last_query;
|
||||||
|
|
||||||
|
return $array;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
function getEmpPayDetailsforOTListing($current = "")
|
function getEmpPayDetailsforOTListing($current = "")
|
||||||
{
|
{
|
||||||
@ -617,5 +637,25 @@ where Month_Year = ? and att.EmpID in (select EmpID from t_attendance)";
|
|||||||
return $query->getResult();
|
return $query->getResult();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function employeeLeaveDates($current){
|
||||||
|
$current =get_date_time_dynamical_format('m-Y','Y-m',"$current");
|
||||||
|
$array = $this->db->table('t_employee_leave_application_form')
|
||||||
|
->select("emp_id,start_date,end_date,status")
|
||||||
|
->where('status', 'Approved')
|
||||||
|
->groupStart() // Start grouping OR conditions
|
||||||
|
->where("DATE_FORMAT(start_date, '%Y-%m') = '$current'", null, false)
|
||||||
|
->orWhere("DATE_FORMAT(end_date, '%Y-%m') = '$current'", null, false)
|
||||||
|
->orWhere("DATE_FORMAT(start_date, '%Y-%m') <= '$current' AND DATE_FORMAT(end_date, '%Y-%m') >= '$current'", null, false)
|
||||||
|
->groupEnd() // End grouping
|
||||||
|
->get()
|
||||||
|
->getResultArray();
|
||||||
|
|
||||||
|
// $last_query = $this->db->getLastQuery();
|
||||||
|
// echo $last_query;
|
||||||
|
|
||||||
|
return $array;
|
||||||
|
// return [$current];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -1504,34 +1504,37 @@ if (!empty($getlogpodtl)) {
|
|||||||
|
|
||||||
<div class="form-row ">
|
<div class="form-row ">
|
||||||
<div class="form-group col-md-12" id="splpodiv">
|
<div class="form-group col-md-12" id="splpodiv">
|
||||||
<label>Special po Table List</label>
|
<div class="form-row">
|
||||||
<table id="table2" class="table table-striped table-hover mb-0" style="font-size:12px;">
|
<div class="col-md-5 text-left">
|
||||||
|
<label class="mt-2">Special po Table List</label>
|
||||||
<div class="form-group col-md-12">
|
|
||||||
|
|
||||||
|
|
||||||
<div class="col-md-offset-10 col-md-8">
|
|
||||||
<button type="button" class="btn btn-success" id="addmorebutton">ADD FILES</button>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="col-md-7 text-right">
|
||||||
|
<button type="button" class="btn btn-success btn-sm" id="addmorebutton">ADD FILES</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-md-12" style="text-align:right">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div id="newdiv"></div>
|
<div id="newdiv"></div>
|
||||||
<input type="hidden" name="hidecounter" id="hidecounter" value="0" />
|
<input type="hidden" name="hidecounter" id="hidecounter" value="0" />
|
||||||
<input type="hidden" name="hideconstant" id="hideconstant" value="0" />
|
<input type="hidden" name="hideconstant" id="hideconstant" value="0" />
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
<table id="table2" class="table table-striped table-hover mb-0" style="font-size: 12px;border-collapse: collapse;margin: auto;width: 60%;">
|
||||||
|
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>Bill No </th>
|
<th>Bill No </th>
|
||||||
<!-- <th>Materials</th> -->
|
<!-- <th>Materials</th> -->
|
||||||
<!-- <th>Delivery Challan No</th> -->
|
<!-- <th>Delivery Challan No</th> -->
|
||||||
<!-- <th>Delivery Challan Date</th>
|
<!-- <th>Delivery Challan Date</th> -->
|
||||||
<th>Vehicle No</th>
|
<!-- <th>Vehicle No</th> -->
|
||||||
<th>Courier No</th> -->
|
<!-- <th>Courier No</th> -->
|
||||||
<!-- <th>Quantity</th> -->
|
<!-- <th>Quantity</th> -->
|
||||||
<th>File</th>
|
<th>File</th>
|
||||||
|
|
||||||
<th>Action</th>
|
<th>Action</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
@ -1547,7 +1550,9 @@ if (!empty($getlogpodtl)) {
|
|||||||
<input type="hidden" id="billnos<?= $row ?>" value="<?= $gd->BillNo ?>">
|
<input type="hidden" id="billnos<?= $row ?>" value="<?= $gd->BillNo ?>">
|
||||||
<input type="hidden" id="file<?= $row ?>" value="<?= $gd->FilePath ?>">
|
<input type="hidden" id="file<?= $row ?>" value="<?= $gd->FilePath ?>">
|
||||||
<td><?php echo (!empty($gd->FilePath)) ? $gd->FilePath : "No File"; ?></td>
|
<td><?php echo (!empty($gd->FilePath)) ? $gd->FilePath : "No File"; ?></td>
|
||||||
<td><span onclick="openmodel(<?= $row ?>);"><i class="ri-pencil-fill" data-toggle="tooltip" title="Click here to Edit the Revenue SplPO details"></i></span>
|
<td><a href="javascript:void(0);" onclick="openmodel(<?= $row ?>);" data-toggle="tooltip" title="Click here to Edit the Special PO details">
|
||||||
|
<i class="ri-pencil-fill"></i>
|
||||||
|
</a>
|
||||||
<?php if (!empty($gd->FilePath)) { ?>
|
<?php if (!empty($gd->FilePath)) { ?>
|
||||||
<a target="_blank" href="<?php echo base_url() . 'public/uploads/BillFiles/' ?><?php echo $gd->FilePath ?>"><i class="fa fa-download"></i></a>
|
<a target="_blank" href="<?php echo base_url() . 'public/uploads/BillFiles/' ?><?php echo $gd->FilePath ?>"><i class="fa fa-download"></i></a>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
@ -1561,6 +1566,7 @@ if (!empty($getlogpodtl)) {
|
|||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<!-- update if condition here -->
|
||||||
<?php if (!empty($update)) { ?>
|
<?php if (!empty($update)) { ?>
|
||||||
<!-- <div class="form-group col-md-12" id="editpodiv">
|
<!-- <div class="form-group col-md-12" id="editpodiv">
|
||||||
<div class="form-group col-md-12"><label>Editable POScreen</label>
|
<div class="form-group col-md-12"><label>Editable POScreen</label>
|
||||||
@ -1592,7 +1598,6 @@ if (!empty($getlogpodtl)) {
|
|||||||
$inde = $inde + 1;
|
$inde = $inde + 1;
|
||||||
?>
|
?>
|
||||||
<tr id="<?php echo $inde; ?>">
|
<tr id="<?php echo $inde; ?>">
|
||||||
|
|
||||||
<td><?php echo $inde; ?></td>
|
<td><?php echo $inde; ?></td>
|
||||||
<td><?php echo $oldpo->PONO ?></td>
|
<td><?php echo $oldpo->PONO ?></td>
|
||||||
|
|
||||||
@ -1633,7 +1638,8 @@ if (!empty($getlogpodtl)) {
|
|||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</div>--> <?php } else {} ?>
|
</div>-->
|
||||||
|
<?php } else {} ?>
|
||||||
<!-- ends here -->
|
<!-- ends here -->
|
||||||
|
|
||||||
<!-- f i l e c h o o s e n -->
|
<!-- f i l e c h o o s e n -->
|
||||||
@ -1715,10 +1721,9 @@ if (!empty($getlogpodtl)) {
|
|||||||
</div>
|
</div>
|
||||||
<!--/. f o o t e r b u t t o n -->
|
<!--/. f o o t e r b u t t o n -->
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div> <!-- end card body-->
|
</div> <!-- end card body-->
|
||||||
</div> <!-- end card -->
|
</div> <!-- end card -->
|
||||||
</div><!-- end col-->
|
</div><!-- end col @945-->
|
||||||
</div><!-- end form row -->
|
</div><!-- end form row -->
|
||||||
</div> <!-- end container-fluid -->
|
</div> <!-- end container-fluid -->
|
||||||
</div> <!-- end content -->
|
</div> <!-- end content -->
|
||||||
@ -1969,26 +1974,25 @@ if (!empty($getlogpodtl)) {
|
|||||||
<!-- Service Special PO Modal Starts Here -->
|
<!-- Service Special PO Modal Starts Here -->
|
||||||
<div id="EditServiceSplPOModel" class="modal fade" tabindex="-1" role="dialog"
|
<div id="EditServiceSplPOModel" class="modal fade" tabindex="-1" role="dialog"
|
||||||
aria-labelledby="myModalLabel" aria-hidden="true" style="display: none;">
|
aria-labelledby="myModalLabel" aria-hidden="true" style="display: none;">
|
||||||
<div class="modal-dialog modal-full-width">
|
<div class="modal-dialog"><!-- class="modal-dialog modal-full-width" -->
|
||||||
<div class="modal-content">
|
<div class="modal-content">
|
||||||
<div class="modal-header">
|
<div class="modal-header">
|
||||||
<h4 class="modal-title">Update Bill <span id="bill"><span> Details</h4>
|
<h4 class="modal-title" id="bill-title">Update Bill</h4>
|
||||||
<button type="button" class="close" data-dismiss="modal"
|
<button type="button" class="close" data-dismiss="modal"
|
||||||
aria-hidden="true">×</button>
|
aria-hidden="true">×</button>
|
||||||
</div>
|
</div>
|
||||||
<form class="tagForm" id="tag-form" method="post" enctype="multipart/form-data">
|
<form class="tagForm" id="tag-form" method="post" enctype="multipart/form-data">
|
||||||
|
|
||||||
<div class="modal-body p-4">
|
<div class="modal-body">
|
||||||
<div class="form-group col-md-12">
|
<div class="col-md-12">
|
||||||
<div class="form-group col-md-5">
|
<span><label for="images">Select file </label><small> (only .pdf,.excel,.doc,.png,.jpg)</small></span><br>
|
||||||
<label for="oldimagename">Old file Name :<div class="oldimage"></div></label>
|
|
||||||
<input type="file" size="20" input accept=".docx,.pdf,.doc.JPG,.PNG,.jpg" id="imag" name="images" onChange="filecheck();" />
|
<input type="file" size="20" input accept=".docx,.pdf,.doc.JPG,.PNG,.jpg" id="imag" name="images" onChange="filecheck();" />
|
||||||
<label for="images">Select file <br /><small>(only .pdf,.excel,.doc,.png,.jpg)</small></label>
|
<label class="oldimage mt-2"></label>
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
<input type="hidden" name="hideoldfile" id="hideoldfile" class="form-control" readonly>
|
<input type="hidden" name="hideoldfile" id="hideoldfile" class="form-control" readonly>
|
||||||
<input type="hidden" name="hidebillno" id="hidebillno" class="form-control" readonly>
|
<input type="hidden" name="hidebillno" id="hidebillno" class="form-control" readonly>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="modal-footer">
|
<div class="modal-footer">
|
||||||
<button type="button" class="btn btn-secondary waves-effect"
|
<button type="button" class="btn btn-secondary waves-effect"
|
||||||
data-dismiss="modal" value="Cancel" onclick="SetExciseCalculationCancel();">Cancel</button>
|
data-dismiss="modal" value="Cancel" onclick="SetExciseCalculationCancel();">Cancel</button>
|
||||||
@ -2731,10 +2735,11 @@ if (!empty($getlogpodtl)) {
|
|||||||
var Billno = $("#billnos" + i).val();
|
var Billno = $("#billnos" + i).val();
|
||||||
//alert(Billno);
|
//alert(Billno);
|
||||||
$("#EditServiceSplPOModel").modal("show");
|
$("#EditServiceSplPOModel").modal("show");
|
||||||
$(".oldimage").text(file);
|
$(".oldimage").text("Previous Upload - "+file);
|
||||||
$("#hideoldfile").val(file);
|
$("#hideoldfile").val(file);
|
||||||
$("#hidebillno").val(Billno);
|
$("#hidebillno").val(Billno);
|
||||||
$("#bill").text(Billno);
|
$("#bill-title").text("Update Bill Number - "+Billno);
|
||||||
|
|
||||||
}
|
}
|
||||||
$('.EditService').click(function() {
|
$('.EditService').click(function() {
|
||||||
tinyMCE.triggerSave();
|
tinyMCE.triggerSave();
|
||||||
@ -3817,8 +3822,8 @@ if (!empty($getlogpodtl)) {
|
|||||||
|
|
||||||
'<div class="form-group col">' +
|
'<div class="form-group col">' +
|
||||||
'<label><br></label>' +
|
'<label><br></label>' +
|
||||||
'<input type="file" name="browseFiles" id="images' + counter + '" onchange="Copyfilename(this.name); "><br>' +
|
'<input type="file" name="browseFiles" id="images' + counter + '" onchange="Copyfilename(this.name); ">' +
|
||||||
'<button class="btn btn-success btn-sm add add_this" id="addbtn" onclick="addRow()">ADD</button>'
|
'<button class="btn btn-success btn-sm add add_this ml-1" id="addbtn" onclick="addRow()">ADD</button>'
|
||||||
'</div>' +
|
'</div>' +
|
||||||
'</div>' +
|
'</div>' +
|
||||||
|
|
||||||
|
|||||||
@ -1975,12 +1975,12 @@ if (!empty($INRSYMBOL)) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (isChecked) {
|
if (isChecked) {
|
||||||
if (PO == 'REVENUE') {
|
if (POTy == 'REVENUE') {
|
||||||
//alert('normalemergency');
|
//alert('normalemergency');
|
||||||
$('#txtSpecial').val(0);
|
$('#txtSpecial').val(0);
|
||||||
// $('#content').loader('show');
|
// $('#content').loader('show');
|
||||||
RevenueSave(1)
|
RevenueSave(1)
|
||||||
} else if (PO == 'SERVICE') {
|
} else if (POTy == 'SERVICE') {
|
||||||
///alert('normal SERVICE emergency');
|
///alert('normal SERVICE emergency');
|
||||||
$('#txtSpecialservice').val(0);
|
$('#txtSpecialservice').val(0);
|
||||||
Save(1)
|
Save(1)
|
||||||
|
|||||||
@ -1,14 +1,11 @@
|
|||||||
<
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
$datefordropdown = format_date($datefordropdown, 0, 'M-Y');
|
$datefordropdown = format_date($datefordropdown, 0, 'M-Y');
|
||||||
//echo $datefordropdown;
|
//echo $datefordropdown;
|
||||||
$attendance = array_merge($attendance, $emppay);
|
$attendance = array_merge($attendance, $emppay);
|
||||||
date_default_timezone_set('Asia/Kolkata');
|
date_default_timezone_set('Asia/Kolkata');
|
||||||
$currentday = date('d');
|
$currentday = date('d');
|
||||||
// print_r($attendance);
|
// print_r($employeeleavedate);
|
||||||
|
// dd($attendance);die;
|
||||||
// echo "<br>------------------------------<br>";
|
// echo "<br>------------------------------<br>";
|
||||||
|
|
||||||
?>
|
?>
|
||||||
@ -327,6 +324,7 @@ $currentday = date('d');
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
|
|
||||||
@ -377,6 +375,7 @@ $currentday = date('d');
|
|||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
</thead>
|
</thead>
|
||||||
|
|
||||||
<tbody style="background-color: #fff;">
|
<tbody style="background-color: #fff;">
|
||||||
|
|
||||||
<?php $index = 0;
|
<?php $index = 0;
|
||||||
@ -396,6 +395,7 @@ $currentday = date('d');
|
|||||||
<?php for ($col = 1; $col <= $monthdays; $col++) {
|
<?php for ($col = 1; $col <= $monthdays; $col++) {
|
||||||
$flag = 0;
|
$flag = 0;
|
||||||
$flag2 = 0;
|
$flag2 = 0;
|
||||||
|
$absent = 0;
|
||||||
|
|
||||||
if ($col == $currentday) {
|
if ($col == $currentday) {
|
||||||
$todayflag = 1;
|
$todayflag = 1;
|
||||||
@ -423,9 +423,26 @@ $currentday = date('d');
|
|||||||
$WH = 'WH' . $col;
|
$WH = 'WH' . $col;
|
||||||
$OT = 'OT' . $col;
|
$OT = 'OT' . $col;
|
||||||
|
|
||||||
|
foreach ($employeeleavedate as $eid => $absentdate){
|
||||||
|
|
||||||
|
if($a->EmpID == $eid){
|
||||||
|
foreach ($absentdate as $particulardate){
|
||||||
|
// echo " $eid particulardate = ".$particulardate ." col = ".$col;
|
||||||
|
if($col === $particulardate){
|
||||||
|
$absent = 1;
|
||||||
|
// echo "1) empid = $a->EmpID, date = $col, absent = $absent";
|
||||||
|
}// else $absent = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
// echo "<pre>"."empid = $a->EmpID, date = $col, absent = $absent"."</pre>";
|
||||||
|
// echo "<pre>"."2) all Flags : flag2 = $flag2, flag = $flag2, absent = $absent"."</pre>";
|
||||||
?>
|
?>
|
||||||
<td <?php if ($flag2 == 1) { ?> title=" <?php echo $title; ?> "
|
<td <?php if ($flag2 == 1) { ?> title=" <?php echo $title; ?> "
|
||||||
<?php } else if ($flag == 1) { ?> title="sunday" <?php } ?>
|
<?php } else if ($flag == 1) { ?> title="sunday" <?php } ?>
|
||||||
|
<?php if ($absent == 1) { ?> title="absent" <?php } ?>
|
||||||
class="celda_normal"
|
class="celda_normal"
|
||||||
onkeyup="myFunction(this.parentNode.id,this.id,this.textContent);"
|
onkeyup="myFunction(this.parentNode.id,this.id,this.textContent);"
|
||||||
id="<?php echo $row . 'row' . $col . 'W'; ?>"
|
id="<?php echo $row . 'row' . $col . 'W'; ?>"
|
||||||
@ -434,7 +451,12 @@ $currentday = date('d');
|
|||||||
} else if ($todayflag == 1) {
|
} else if ($todayflag == 1) {
|
||||||
echo "style='background: #cef0ad ;'";
|
echo "style='background: #cef0ad ;'";
|
||||||
} ?>
|
} ?>
|
||||||
contenteditable="true" tabindex="<?php echo $col; ?>">
|
<?php if ($absent == 1) {
|
||||||
|
echo "contenteditable='false'";
|
||||||
|
} else if ($absent == 0) {
|
||||||
|
echo "contenteditable='true'";
|
||||||
|
} ?>
|
||||||
|
tabindex="<?php echo $col; ?>">
|
||||||
<?php if (!empty($a->$WH)) {
|
<?php if (!empty($a->$WH)) {
|
||||||
echo $a->$WH;
|
echo $a->$WH;
|
||||||
} else {
|
} else {
|
||||||
@ -442,6 +464,7 @@ $currentday = date('d');
|
|||||||
} ?></td>
|
} ?></td>
|
||||||
<td <?php if ($flag2 == 1) { ?> title=" <?php echo $title; ?> "
|
<td <?php if ($flag2 == 1) { ?> title=" <?php echo $title; ?> "
|
||||||
<?php } else if ($flag == 1) { ?> title="sunday" <?php } ?>
|
<?php } else if ($flag == 1) { ?> title="sunday" <?php } ?>
|
||||||
|
<?php if ($absent == 1) { ?> title="absent" <?php } ?>
|
||||||
class="celda_normal"
|
class="celda_normal"
|
||||||
onkeyup="myFunction(this.parentNode.id,this.id,this.textContent);"
|
onkeyup="myFunction(this.parentNode.id,this.id,this.textContent);"
|
||||||
id="<?php echo $row . 'row' . $col . 'OT'; ?>"
|
id="<?php echo $row . 'row' . $col . 'OT'; ?>"
|
||||||
@ -450,7 +473,12 @@ $currentday = date('d');
|
|||||||
} else if ($todayflag == 1) {
|
} else if ($todayflag == 1) {
|
||||||
echo "style='background: #cef0ad ;'";
|
echo "style='background: #cef0ad ;'";
|
||||||
} ?>
|
} ?>
|
||||||
contenteditable="true" tabindex="<?php echo $col; ?>">
|
<?php if ($absent == 1) {
|
||||||
|
echo "contenteditable='false'";
|
||||||
|
} else if ($absent == 0) {
|
||||||
|
echo "contenteditable='true'";
|
||||||
|
} ?>
|
||||||
|
tabindex="<?php echo $col; ?>">
|
||||||
<?php if (!empty($a->$OT)) {
|
<?php if (!empty($a->$OT)) {
|
||||||
echo $a->$OT;
|
echo $a->$OT;
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -55,7 +55,7 @@
|
|||||||
<td>
|
<td>
|
||||||
<?php if($record->is_driver){ ?>
|
<?php if($record->is_driver){ ?>
|
||||||
|
|
||||||
<a title="Trip Details" style="cursor:pointer;" href="<?= base_url() . 'loadDriverAttendance?drv_id=' . $record->EmpID; ?>">
|
<a class="tooltip-trigger" title="Click here to View <?php echo $record->FirstName; ?> Trip Details" style="cursor:pointer;" href="<?= base_url() . 'loadDriverAttendance?drv_id=' . $record->EmpID; ?>">
|
||||||
<i class="fa fa-truck"></i>
|
<i class="fa fa-truck"></i>
|
||||||
</a>
|
</a>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
@ -122,6 +122,7 @@
|
|||||||
</div><!-- /.modal -->
|
</div><!-- /.modal -->
|
||||||
<script>
|
<script>
|
||||||
$(document).ready(function () {
|
$(document).ready(function () {
|
||||||
|
$('.tooltip-trigger').tooltip();
|
||||||
$("#ddwizard").on("shown.bs.modal", function (e) {
|
$("#ddwizard").on("shown.bs.modal", function (e) {
|
||||||
var id = $(e.relatedTarget).data('id');
|
var id = $(e.relatedTarget).data('id');
|
||||||
var name = $(e.relatedTarget).data('name');
|
var name = $(e.relatedTarget).data('name');
|
||||||
|
|||||||
@ -2764,9 +2764,10 @@ if (!empty($getlogpodtl)) {
|
|||||||
<input type="hidden" id="MaterialRcvdDate<?= $row ?>"
|
<input type="hidden" id="MaterialRcvdDate<?= $row ?>"
|
||||||
value="<?= $gd->MaterialRcvdDate ?>">
|
value="<?= $gd->MaterialRcvdDate ?>">
|
||||||
|
|
||||||
<td style="cursor:pointer;"><span onclick="openmodel(<?= $row ?>);"><i
|
<td style="cursor:pointer;">
|
||||||
class="ri-pencil-fill"></i></span>
|
<a href="javascript:void(0);" onclick="openmodel(<?= $row ?>);" data-toggle="tooltip" title="Click here to Edit the Special PO details">
|
||||||
|
<i class="ri-pencil-fill"></i>
|
||||||
|
</a>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<?php
|
<?php
|
||||||
@ -2801,7 +2802,6 @@ if (!empty($getlogpodtl)) {
|
|||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>Bill No </th>
|
<th>Bill No </th>
|
||||||
|
|
||||||
<th>File</th>
|
<th>File</th>
|
||||||
<th>Action</th>
|
<th>Action</th>
|
||||||
</tr>
|
</tr>
|
||||||
|
|||||||
@ -212,7 +212,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="col-md-3">
|
<div class="col-md-3">
|
||||||
<label class="form" for="no_of_days">No Of Days </label>
|
<label class="form" for="no_of_days">No Of Days </label>
|
||||||
<input type="text" class="form-control" id="no_of_days" name="no_of_days">
|
<input type="text" class="form-control" id="no_of_days" name="no_of_days" readonly>
|
||||||
</div>
|
</div>
|
||||||
</div><!--/. r o w 5 -->
|
</div><!--/. r o w 5 -->
|
||||||
<div class="row mt-2">
|
<div class="row mt-2">
|
||||||
@ -263,56 +263,62 @@
|
|||||||
let today = new Date().toISOString().split("T")[0]; // Format: YYYY-MM-DD
|
let today = new Date().toISOString().split("T")[0]; // Format: YYYY-MM-DD
|
||||||
$("#start_date").attr("min", today);
|
$("#start_date").attr("min", today);
|
||||||
$("#end_date").attr("min", today);
|
$("#end_date").attr("min", today);
|
||||||
|
$('#start_date').change(function() {
|
||||||
|
let start = new Date($('#start_date').val());
|
||||||
|
let formattedStart = start.toISOString().split('T')[0]; // Convert to YYYY-MM-DD format
|
||||||
|
|
||||||
|
// Reset the end_date input and set its min attribute
|
||||||
|
$('#end_date').val('').attr('min', formattedStart);
|
||||||
|
});
|
||||||
|
|
||||||
$('#start_date, #end_date').change(function() {
|
$('#start_date, #end_date').change(function() {
|
||||||
const start = new Date($('#start_date').val());
|
let start = new Date($('#start_date').val());
|
||||||
const end = new Date($('#end_date').val());
|
let end = new Date($('#end_date').val());
|
||||||
if (!isNaN(start.getTime())) {
|
let formattedStart = start.toISOString().split('T')[0]; // Convert to YYYY-MM-DD format
|
||||||
$('#end_date').val("");
|
|
||||||
let minDate = start.toISOString().split("T")[0]; // Convert Date to YYYY-MM-DD format
|
$("#end_date").attr("min", formattedStart);
|
||||||
$("#end_date").attr("min", minDate); // Set min attribute for end_date
|
|
||||||
}
|
|
||||||
if (!isNaN(start) && !isNaN(end)) {
|
if (!isNaN(start) && !isNaN(end)) {
|
||||||
const days = Math.floor((end - start) / 86400000) + 1;
|
const days = Math.floor((end - start) / 86400000) + 1;
|
||||||
$('#no_of_days').val(days > 0 ? days : 1);
|
$('#no_of_days').val(days > 0 ? days : 1);
|
||||||
} else {
|
} else {
|
||||||
$('#no_of_days').val('');
|
$('#no_of_days').val('');
|
||||||
}
|
}
|
||||||
|
validateDateRange();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
$("#applicationModal").on("shown.bs.modal", function (e) {
|
$("#applicationModal").on("shown.bs.modal", function (e) {
|
||||||
|
|
||||||
var id = $(e.relatedTarget).data('id');
|
var id = $(e.relatedTarget).data('id');
|
||||||
|
var arr = $(e.relatedTarget).data('arr') || {};
|
||||||
let fields = ['leave_application_id','emp_name','emp_id','start_date','end_date','no_of_days','reason','status_val','department','designation'];
|
let fields = ['leave_application_id','emp_name','emp_id','start_date','end_date','no_of_days','reason','status_val','department','designation'];
|
||||||
|
|
||||||
fields.forEach(function(field) {
|
fields.forEach(field => $("#" + field).val(arr[field] || "").prop('readonly', true));
|
||||||
$("#" + field).val("");
|
|
||||||
});
|
|
||||||
|
|
||||||
if (id == 0) {
|
if (id == 0) {
|
||||||
$('#emp_name').val("").select2();
|
$('#emp_name').val("").select2();
|
||||||
$('#applicationformTitle').html("Apply Leave");
|
$('#applicationformTitle').text("Apply Leave");
|
||||||
$("#leave_application_id").val(0);
|
$("#leave_application_id").val(0);
|
||||||
|
$("#tempClick").show();
|
||||||
} else {
|
} else {
|
||||||
var arr = $(e.relatedTarget).data('arr');
|
$('#applicationformTitle').text(arr.status === "Approved" ? "View Leave" : "Edit Leave");
|
||||||
|
$("#tempClick").toggle(arr.status !== "Approved");
|
||||||
|
}
|
||||||
|
|
||||||
fields.forEach(function(field) {
|
if (id == 0 || arr.status !== "Approved") {
|
||||||
|
$("#emp_name, #start_date, #end_date, #status_val, #reason").prop({readonly: false, disabled: false});
|
||||||
if(field == 'emp_name'){
|
$("#start_date, #end_date").prop('required', true);
|
||||||
let empID = arr && arr['emp_id'] ? arr['emp_id'] : "";
|
|
||||||
$("#emp_name").val(empID).select2();
|
|
||||||
}else if(field == 'status_val'){
|
|
||||||
$("#status_val").val(arr && arr['status']);
|
|
||||||
} else {
|
} else {
|
||||||
$("#" + field).val(arr && arr[field] ? arr[field] : "");
|
$("#emp_name, #status_val").prop('disabled', true);
|
||||||
}
|
|
||||||
});
|
|
||||||
$('#applicationformTitle').html("Edit Leave");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (arr.emp_id) $("#emp_name").val(arr.emp_id).select2();
|
||||||
|
if (arr.status) $("#status_val").val(arr.status);
|
||||||
});
|
});
|
||||||
|
|
||||||
$('#tempClick').click(function () {
|
$('#tempClick').click(function () {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if ($('#emp_id').val() === '') {
|
if ($('#emp_id').val() === '') {
|
||||||
alert('Please Select the Valid Employee');
|
alert('Please Select the Valid Employee');
|
||||||
return;
|
return;
|
||||||
@ -333,7 +339,11 @@
|
|||||||
alert('Please Select Status');
|
alert('Please Select Status');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
// validateDateRange(function(isValid) {
|
||||||
|
// if (!isValid) {
|
||||||
|
// alert("The selected date range overlaps with an existing approved leave.");
|
||||||
|
// return;
|
||||||
|
// }
|
||||||
|
|
||||||
var formData = {
|
var formData = {
|
||||||
leave_application_id:$('#leave_application_id').val(),
|
leave_application_id:$('#leave_application_id').val(),
|
||||||
@ -372,7 +382,7 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// });
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -463,6 +473,39 @@
|
|||||||
// }
|
// }
|
||||||
// });
|
// });
|
||||||
});
|
});
|
||||||
|
|
||||||
|
function validateDateRange() {
|
||||||
|
let startDate = $("#start_date").val();
|
||||||
|
let endDate = $("#end_date").val();
|
||||||
|
let empId = $("#emp_name").val();
|
||||||
|
|
||||||
|
if (!startDate || !endDate || !empId) return;
|
||||||
|
else{
|
||||||
|
|
||||||
|
$.ajax({
|
||||||
|
url: "<?php echo base_url(); ?>validateDateRange", // Replace with your actual API endpoint
|
||||||
|
type: "POST",
|
||||||
|
data: { emp_id: empId, start_date: startDate, end_date: endDate },
|
||||||
|
dataType: 'json',
|
||||||
|
success: function (response) {
|
||||||
|
if (response.status) {
|
||||||
|
alert(response.message);
|
||||||
|
$("#start_date, #end_date, #no_of_days").val("");
|
||||||
|
}else{
|
||||||
|
console.log(response.status,response.array);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
error: function (xhr, status, error) {
|
||||||
|
alert("Error checking leave dates.");
|
||||||
|
},
|
||||||
|
complete: function () {
|
||||||
|
console.log("validate leave dates ajax call completed");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
|||||||
@ -136,14 +136,14 @@
|
|||||||
$cdate = date('d-m-Y', strtotime($record->Created_date));
|
$cdate = date('d-m-Y', strtotime($record->Created_date));
|
||||||
} ?>
|
} ?>
|
||||||
<td>
|
<td>
|
||||||
<a class="a_tag_link" href="<?php echo base_url() . 'employeedetails/ViewEmployee/?EmpID=' . $record->EmpID; ?>" data-toggle="tooltip" title="<?php echo $record->EmpID; ?> - Click here to view Employee Details"><?php echo $record->EmpID ?> </a></u>
|
<a class="tooltip-trigger a_tag_link" href="<?php echo base_url() . 'employeedetails/ViewEmployee/?EmpID=' . $record->EmpID; ?>" title="<?php echo $record->EmpID; ?> - Click here to view Employee Details"><?php echo $record->EmpID ?> </a></u>
|
||||||
|
|
||||||
|
|
||||||
<a href="<?php echo base_url() . 'employeedetails/downloadEmployeeDetails/?EmpID=' . $record->EmpID; ?>" data-toggle="tooltip" title="<?php echo $record->EmpID; ?> - Click here to Download Employee Details">
|
<a href="<?php echo base_url() . 'employeedetails/downloadEmployeeDetails/?EmpID=' . $record->EmpID; ?>" class="tooltip-trigger" title="<?php echo $record->EmpID; ?> - Click here to Download Employee Details">
|
||||||
<i class="fas fa-download"></i>
|
<i class="fas fa-download"></i>
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
<a href="#" data-toggle="modal" data-target="#accordion-modal" data-emp="<?php echo $record->EmpID ?>" data-toggle="tooltip" title="<?php echo $record->EmpID; ?> - Click here to view Employee History">
|
<a href="#" data-toggle="modal" data-target="#accordion-modal" data-emp="<?php echo $record->EmpID ?>" class="tooltip-trigger" title="<?php echo $record->EmpID; ?> - Click here to View Employee History">
|
||||||
<i class="fas fa-history"style="text-align: center;"></i>
|
<i class="fas fa-history"style="text-align: center;"></i>
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
@ -245,6 +245,7 @@
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
|
$('.tooltip-trigger').tooltip();
|
||||||
$("#accordion-modal").on("shown.bs.modal", function(e) {
|
$("#accordion-modal").on("shown.bs.modal", function(e) {
|
||||||
var emp = $(e.relatedTarget).data('emp');
|
var emp = $(e.relatedTarget).data('emp');
|
||||||
var noData = '<p style="text-align: center;">No History Data Available</p>';
|
var noData = '<p style="text-align: center;">No History Data Available</p>';
|
||||||
|
|||||||
@ -78,7 +78,9 @@
|
|||||||
</li>
|
</li>
|
||||||
</ol>
|
</ol>
|
||||||
</div>
|
</div>
|
||||||
|
<?php if(session()->get('roleText') == 'System Administrator' || session()->get('roleText') == 'Security' || session()->get('roleText') == 'Auditor'){?>
|
||||||
<a id="addExpense" class="btn btn-success" data-toggle="modal" data-target="#expenseModal" href="">Add New Expense</a>
|
<a id="addExpense" class="btn btn-success" data-toggle="modal" data-target="#expenseModal" href="">Add New Expense</a>
|
||||||
|
<?php } ?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -184,7 +186,9 @@
|
|||||||
<button title="Download FIle" class="download_button" onclick="downloadFile('<?php echo $record['id']; ?>', '<?php echo $record['transporter_file']; ?>')" style="border: none;background-color: white;color: #02a8b5;">
|
<button title="Download FIle" class="download_button" onclick="downloadFile('<?php echo $record['id']; ?>', '<?php echo $record['transporter_file']; ?>')" style="border: none;background-color: white;color: #02a8b5;">
|
||||||
<i class="fas fa-file-download"></i>
|
<i class="fas fa-file-download"></i>
|
||||||
</button>
|
</button>
|
||||||
|
<?php if(session()->get('roleText') == 'System Administrator' || session()->get('roleText') == 'Security' || session()->get('roleText') == 'Auditor'){?>
|
||||||
<button title="Delete File" id="deleteFile" class="delete_button" data-value="<?php echo $record['id'] ?>" data-id="<?php echo $record['id'] ?>" data-file="<?php echo $record['transporter_file'] ?>"><i class="fas fa-trash"></i></button>
|
<button title="Delete File" id="deleteFile" class="delete_button" data-value="<?php echo $record['id'] ?>" data-id="<?php echo $record['id'] ?>" data-file="<?php echo $record['transporter_file'] ?>"><i class="fas fa-trash"></i></button>
|
||||||
|
<?php } ?>
|
||||||
|
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
<button title="Edit" class="edit-button" data-toggle="modal" data-target="#expenseModal" data-id="<?php echo $record['id']; ?>" style="border: none;background-color: white;color: #02a8b5;">
|
<button title="Edit" class="edit-button" data-toggle="modal" data-target="#expenseModal" data-id="<?php echo $record['id']; ?>" style="border: none;background-color: white;color: #02a8b5;">
|
||||||
@ -332,7 +336,9 @@
|
|||||||
|
|
||||||
<div class="modal-footer">
|
<div class="modal-footer">
|
||||||
<button type="button" class="btn btn-secondary waves-effect" data-dismiss="modal">Cancel</button>
|
<button type="button" class="btn btn-secondary waves-effect" data-dismiss="modal">Cancel</button>
|
||||||
|
<?php if(session()->get('roleText') == 'System Administrator' || session()->get('roleText') == 'Security' || session()->get('roleText') == 'Auditor'){?>
|
||||||
<button type="button" class="btn btn-info waves-effect waves-light tempClick" id="tempClick">Submit</button>
|
<button type="button" class="btn btn-info waves-effect waves-light tempClick" id="tempClick">Submit</button>
|
||||||
|
<?php } ?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -363,7 +369,7 @@ dateInput.addEventListener('change', function () {
|
|||||||
|
|
||||||
|
|
||||||
$(document).on('click', '.edit-button', function() {
|
$(document).on('click', '.edit-button', function() {
|
||||||
|
var roleText = '<?php echo session()->get('roleText') ?>';
|
||||||
$('.modal-title').html('Edit Expense');
|
$('.modal-title').html('Edit Expense');
|
||||||
var expenseId = $(this).data('id');
|
var expenseId = $(this).data('id');
|
||||||
var supplier_list = [<?php echo $supplier_list; ?>];
|
var supplier_list = [<?php echo $supplier_list; ?>];
|
||||||
@ -414,7 +420,11 @@ dateInput.addEventListener('change', function () {
|
|||||||
var deleteButton = '<button id="deleteFile" class="delete_button" data-value="' + expense.id + '" data-id="' + expense.id + '" data-file="' + expense.transporter_file + '"><i class="fas fa-trash"></i></button>';
|
var deleteButton = '<button id="deleteFile" class="delete_button" data-value="' + expense.id + '" data-id="' + expense.id + '" data-file="' + expense.transporter_file + '"><i class="fas fa-trash"></i></button>';
|
||||||
|
|
||||||
// Add the file link and delete button
|
// Add the file link and delete button
|
||||||
|
if(roleText == 'System Administrator' ||roleText == 'Security' ||roleText == 'Auditor'){
|
||||||
$('#transporterfile').after(fileLink + ' ' + deleteButton);
|
$('#transporterfile').after(fileLink + ' ' + deleteButton);
|
||||||
|
}else{
|
||||||
|
$('#transporterfile').after(fileLink);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
$('#transporterfile_name').val(''); // Clear hidden input if no file
|
$('#transporterfile_name').val(''); // Clear hidden input if no file
|
||||||
}
|
}
|
||||||
|
|||||||
@ -718,7 +718,7 @@
|
|||||||
<!-- IGR module -->
|
<!-- IGR module -->
|
||||||
|
|
||||||
|
|
||||||
<?php if(session()->get('roleText') == 'System Administrator' || session()->get('roleText') == 'Auditor' || session()->get('roleText') == 'Security' || session()->get('roleText') == 'Stock Handler'){?>
|
<?php if(session()->get('roleText') == 'System Administrator' || session()->get('roleText') == 'Auditor' || session()->get('roleText') == 'Security' || session()->get('roleText') == 'Stock Handler' || session()->get('roleText') == 'Lab Staff'){?>
|
||||||
<!-- Inward Module -->
|
<!-- Inward Module -->
|
||||||
<li class="nav-item dropdown">
|
<li class="nav-item dropdown">
|
||||||
<a class="nav-link dropdown-toggle arrow-none" href="#" id="topnav-purchase" role="button"
|
<a class="nav-link dropdown-toggle arrow-none" href="#" id="topnav-purchase" role="button"
|
||||||
@ -740,13 +740,15 @@
|
|||||||
View Inward Gate Register</a>
|
View Inward Gate Register</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<?php if(session()->get('roleText') == 'System Administrator' || session()->get('roleText') == 'Security' || session()->get('roleText') == 'Auditor'){?>
|
<?php if(session()->get('roleText') == 'System Administrator' || session()->get('roleText') == 'Security' || session()->get('roleText') == 'Auditor' || session()->get('roleText') == 'Lab Staff'){?>
|
||||||
<div class="">
|
<div class="">
|
||||||
<a href="<?php echo base_url(); ?>ListIGR" class="dropdown-item"><i class="ri-file-list-3-line align-middle mr-1"></i>
|
<a href="<?php echo base_url(); ?>ListIGR" class="dropdown-item"><i class="ri-file-list-3-line align-middle mr-1"></i>
|
||||||
Non IGR / Expense</a>
|
Non IGR / Expense</a>
|
||||||
</div>
|
</div>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
|
|
||||||
|
|
||||||
|
<?php if(session()->get('roleText') == 'System Administrator' || session()->get('roleText') == 'Auditor' || session()->get('roleText') == 'Security' || session()->get('roleText') == 'Stock Handler'){?>
|
||||||
<div class="dropdown" >
|
<div class="dropdown" >
|
||||||
|
|
||||||
<a class="dropdown-item dropdown-toggle arrow-none" href="#" id="topnav-po"
|
<a class="dropdown-item dropdown-toggle arrow-none" href="#" id="topnav-po"
|
||||||
@ -761,7 +763,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
<?php } ?>
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
@ -881,7 +883,7 @@
|
|||||||
|
|
||||||
<!-- Stock module -->
|
<!-- Stock module -->
|
||||||
|
|
||||||
<?php if(session()->get('roleText') == 'System Administrator' || session()->get('roleText') == 'Stock Handler'){?>
|
<?php if(session()->get('roleText') == 'System Administrator' || session()->get('roleText') == 'Stock Handler' || session()->get('roleText') == 'Lab Staff'){?>
|
||||||
|
|
||||||
<li class="nav-item dropdown">
|
<li class="nav-item dropdown">
|
||||||
<a class="nav-link dropdown-toggle arrow-none" href="#" id="topnav-stock" role="button"
|
<a class="nav-link dropdown-toggle arrow-none" href="#" id="topnav-stock" role="button"
|
||||||
|
|||||||
@ -641,8 +641,10 @@
|
|||||||
<div class="modal-footer">
|
<div class="modal-footer">
|
||||||
<button type="button" class="btn btn-secondary waves-effect"
|
<button type="button" class="btn btn-secondary waves-effect"
|
||||||
data-dismiss="modal" value="Cancel">Cancel</button>
|
data-dismiss="modal" value="Cancel">Cancel</button>
|
||||||
|
<?php if(session()->get('roleText') == 'System Administrator' || session()->get('roleText') == 'Security' || session()->get('roleText') == 'Auditor'){?>
|
||||||
<button type="button"
|
<button type="button"
|
||||||
class="btn btn-info waves-effect waves-light" onclick="modalSave()">Save</button>
|
class="btn btn-info waves-effect waves-light" onclick="modalSave()">Save</button>
|
||||||
|
<?php } ?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -1082,6 +1084,7 @@
|
|||||||
var inx = $(e.relatedTarget).data('id');
|
var inx = $(e.relatedTarget).data('id');
|
||||||
var igr = $(e.relatedTarget).data('userid');
|
var igr = $(e.relatedTarget).data('userid');
|
||||||
var igrstatus = $(e.relatedTarget).data('igrstatus');
|
var igrstatus = $(e.relatedTarget).data('igrstatus');
|
||||||
|
var roleText = '<?php echo session()->get('roleText') ?>';
|
||||||
|
|
||||||
// alert(igrstatus);
|
// alert(igrstatus);
|
||||||
var buttonContainer = $(".buttonContainer");
|
var buttonContainer = $(".buttonContainer");
|
||||||
@ -1295,10 +1298,9 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
// userrole is security based on status we show and here (else if)
|
// other userrole(except admin). based on status we show and here (else if)
|
||||||
else if (userRole !== 1) {
|
else if (userRole !== 1) {
|
||||||
|
|
||||||
|
|
||||||
if (igrstatus === "ST074") {
|
if (igrstatus === "ST074") {
|
||||||
$("#pendingQuantityHeader").css("display", "table-cell");
|
$("#pendingQuantityHeader").css("display", "table-cell");
|
||||||
trIGRHTML += '<tr>' +
|
trIGRHTML += '<tr>' +
|
||||||
@ -1306,15 +1308,26 @@
|
|||||||
'<td style="width: 100px;" name="MaterialName" onchange="test(' + i + ')">' + item.MaterialCode + '</td>' +
|
'<td style="width: 100px;" name="MaterialName" onchange="test(' + i + ')">' + item.MaterialCode + '</td>' +
|
||||||
'<td style="width: 150px; word-wrap: break-word; word-break: break-all; white-space: normal;">' + item.MaterialName + '</td>' +
|
'<td style="width: 150px; word-wrap: break-word; word-break: break-all; white-space: normal;">' + item.MaterialName + '</td>' +
|
||||||
'<td style="width: 50px;" name="UOM">' + item.UOM + '</td>' +
|
'<td style="width: 50px;" name="UOM">' + item.UOM + '</td>' +
|
||||||
'<td style="width: 100px;" id="Quantity' + i + '" name="Quantity">' + parseInt(item.Quantity) + '</td>' +
|
'<td style="width: 100px;" id="Quantity' + i + '" name="Quantity">' + parseInt(item.Quantity) + '</td>';
|
||||||
'<td style="width: 100px;" data-name="sel" ><input type="text" onchange="validateReceivedQuantity(' + i + ',' + isOpenOrder + ')"id="QuantityAsPerInvoice' + i + '" name="QuantityAsPerInvoice' + i + '" value="' + parseInt(item.QuantityAsPerInvoice) + '" onkeypress="return isNumberKey(event);" style="width: 75px;"></td>' +
|
if (userRole == 5) { // 5 - lab staff
|
||||||
'<td style="width: 100px;" name="PendingQuantity' + i + '" id="PendingQuantity' + i + '">' + ((isOpenOrder) ? 0 : parseInt(item.Quantity - item.QuantityAsPerInvoice)) + '</td>' +
|
trIGRHTML += '<td style="width: 100px;"> ' + parseInt(item.QuantityAsPerInvoice) + ' </td>';
|
||||||
|
} else {
|
||||||
|
trIGRHTML += '<td style="width: 100px;" data-name="sel" ><input type="text" onchange="validateReceivedQuantity(' + i + ',' + isOpenOrder + ')"id="QuantityAsPerInvoice' + i + '" name="QuantityAsPerInvoice' + i + '" value="' + parseInt(item.QuantityAsPerInvoice) + '" onkeypress="return isNumberKey(event);" style="width: 75px;"></td>';
|
||||||
|
}
|
||||||
|
trIGRHTML += '<td style="width: 100px;" name="PendingQuantity' + i + '" id="PendingQuantity' + i + '">' + ((isOpenOrder) ? 0 : parseInt(item.Quantity - item.QuantityAsPerInvoice)) + '</td>' +
|
||||||
'<td style="width: 50px;" id="Rate' + i + '" >' + Number(item.Rate).toFixed(2) + '</td>' +
|
'<td style="width: 50px;" id="Rate' + i + '" >' + Number(item.Rate).toFixed(2) + '</td>' +
|
||||||
'<td style="width: 50px;" id="tax_percentage' + i + '">' + tax_percentage + '</td>' +
|
'<td style="width: 50px;" id="tax_percentage' + i + '">' + tax_percentage + '</td>' +
|
||||||
'<td style="width: 50px;" id="amount' + i + '">' + amount + '</td>' +
|
'<td style="width: 50px;" id="amount' + i + '">' + amount + '</td>' +
|
||||||
'<td style="width: 50px;" id="grand_total_amount' + i + '">' + grand_total_amount + '</td>' +
|
'<td style="width: 50px;" id="grand_total_amount' + i + '">' + grand_total_amount + '</td>';
|
||||||
'<td style="width: 100px;"><input type="text" id="Remark' + i + '" name="Remark' + i + '" class="form" onchange="SetRemarks(' + i + ')" style="width: 75px;" value="'+item.Remarks+'"> </td>' +
|
if (userRole == 5) {
|
||||||
'<td style="width: 25px;"><a target="_blank" data-toggle="modal" data-target="#WeightCalculator" title="Weight Calculator" data-index="' + i + '" data-material="' + item.MaterialName + '" data-igrstatus = "' + igrstatus + '"><i class="fa fa-solid fa-truck" style="text-align: center;"></i></a> </td>' +
|
trIGRHTML += '<td style="width: 100px;"> ' + item.Remarks + ' </td>';
|
||||||
|
} else {
|
||||||
|
trIGRHTML += '<td style="width: 100px;">' +
|
||||||
|
'<input type="text" id="Remark' + i + '" name="Remark' + i + '" class="form" ' +
|
||||||
|
'onchange="SetRemarks(' + i + ')" style="width: 75px;" value="' + item.Remarks + '">' +
|
||||||
|
'</td>';
|
||||||
|
}
|
||||||
|
trIGRHTML += '<td style="width: 25px;">' + '<a target="_blank" data-toggle="modal" data-target="#WeightCalculator" title="Weight Calculator" ' + 'data-index="' + i + '" data-material="' + item.MaterialName + '" data-igrstatus="' + igrstatus + '">' + '<i class="fa fa-solid fa-truck" style="text-align: center;"></i></a>' + '</td>' +
|
||||||
'<input type="hidden" id="IGRNO' + i + '" name="IGRNO' + i + '" value="' + item.IGRNO + '">' +
|
'<input type="hidden" id="IGRNO' + i + '" name="IGRNO' + i + '" value="' + item.IGRNO + '">' +
|
||||||
'<input type="hidden" id="MaterialCode' + i + '" name="MaterialCode' + i + '" value="' + item.MaterialCode + '">' +
|
'<input type="hidden" id="MaterialCode' + i + '" name="MaterialCode' + i + '" value="' + item.MaterialCode + '">' +
|
||||||
'<input type="hidden" id="txtQuantityAsPerInvoice' + i + '" name="txtQuantityAsPerInvoice' + i + '" value="' + item.QuantityAsPerInvoice + '">' +
|
'<input type="hidden" id="txtQuantityAsPerInvoice' + i + '" name="txtQuantityAsPerInvoice' + i + '" value="' + item.QuantityAsPerInvoice + '">' +
|
||||||
@ -1342,6 +1355,7 @@
|
|||||||
trIGRHTML +='</tr>';
|
trIGRHTML +='</tr>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if ((item.Quantity - item.QuantityAsPerInvoice) == 0.00) {
|
if ((item.Quantity - item.QuantityAsPerInvoice) == 0.00) {
|
||||||
$('#QuantityAsPerInvoice' + i).attr('readonly', 'true');
|
$('#QuantityAsPerInvoice' + i).attr('readonly', 'true');
|
||||||
}
|
}
|
||||||
@ -1354,13 +1368,25 @@
|
|||||||
'<td style="width: 100px;" name="MaterialName" id="MaterialCode" onchange="test(' + i + ')">' + item.MaterialCode + '</td>' +
|
'<td style="width: 100px;" name="MaterialName" id="MaterialCode" onchange="test(' + i + ')">' + item.MaterialCode + '</td>' +
|
||||||
'<td style="width: 150px; word-wrap: break-word; word-break: break-all; white-space: normal;">' + item.MaterialName + '</td>' +
|
'<td style="width: 150px; word-wrap: break-word; word-break: break-all; white-space: normal;">' + item.MaterialName + '</td>' +
|
||||||
'<td style="width: 50px;" name="UOM">' + item.UOM + '</td>' +
|
'<td style="width: 50px;" name="UOM">' + item.UOM + '</td>' +
|
||||||
'<td style="width: 100px;" name="Quantity">' + item.Quantity + '</td>' +
|
'<td style="width: 100px;" name="Quantity">' + item.Quantity + '</td>' ;
|
||||||
'<td style="width: 100px;" data-name="sel" >' + item.QuantityAsPerInvoice + '</td>' +
|
if (userRole == 5) { // 5 - lab staff
|
||||||
'<td style="width: 50px;" id="Rate' + i + '" >' + Number(item.Rate).toFixed(2) + '</td>' +
|
trIGRHTML += '<td style="width: 100px;"> ' + Number(item.QuantityAsPerInvoice).toFixed(2) + ' </td>';
|
||||||
|
} else {
|
||||||
|
trIGRHTML += '<td style="width: 100px;" data-name="sel" >' + item.QuantityAsPerInvoice + '</td>';
|
||||||
|
}
|
||||||
|
trIGRHTML += '<td style="width: 50px;" id="Rate' + i + '" >' + Number(item.Rate).toFixed(2) + '</td>' +
|
||||||
'<td style="width: 50px;" id="tax_percentage' + i + '">' + tax_percentage + '</td>' +
|
'<td style="width: 50px;" id="tax_percentage' + i + '">' + tax_percentage + '</td>' +
|
||||||
'<td style="width: 50px;" id="amount' + i + '">' + amount + '</td>' +
|
'<td style="width: 50px;" id="amount' + i + '">' + amount + '</td>' +
|
||||||
'<td style="width: 50px;" id="grand_total_amount' + i + '">' + grand_total_amount + '</td>' +
|
'<td style="width: 50px;" id="grand_total_amount' + i + '">' + grand_total_amount + '</td>';
|
||||||
'<td style="width: 25px;"><a target="_blank" data-toggle="modal" data-target="#WeightCalculator" title="Weight Calculator" data-index="' + i + '" data-material="' + item.MaterialName + '" data-igrstatus = "' + igrstatus + '"><i class="fa fa-solid fa-truck" style="text-align: center;"></i></a> </td>' +
|
if (userRole == 5) {
|
||||||
|
trIGRHTML += '<td style="width: 100px;"> ' + item.Remarks + ' </td>';
|
||||||
|
} else {
|
||||||
|
trIGRHTML += '<td style="width: 100px;">' +
|
||||||
|
'<input type="text" id="Remark' + i + '" name="Remark' + i + '" class="form" ' +
|
||||||
|
'onchange="SetRemarks(' + i + ')" style="width: 75px;" value="' + item.Remarks + '">' +
|
||||||
|
'</td>';
|
||||||
|
}
|
||||||
|
trIGRHTML += '<td style="width: 25px;"><a target="_blank" data-toggle="modal" data-target="#WeightCalculator" title="Weight Calculator" data-index="' + i + '" data-material="' + item.MaterialName + '" data-igrstatus = "' + igrstatus + '"><i class="fa fa-solid fa-truck" style="text-align: center;"></i></a> </td>' +
|
||||||
'<input type="hidden" id="IGRNO' + i + '" name="IGRNO' + i + '" value="' + item.IGRNO + '">' +
|
'<input type="hidden" id="IGRNO' + i + '" name="IGRNO' + i + '" value="' + item.IGRNO + '">' +
|
||||||
'<input type="hidden" id="MaterialCode' + i + '" name="MaterialCode' + i + '" value="' + item.MaterialCode + '">' +
|
'<input type="hidden" id="MaterialCode' + i + '" name="MaterialCode' + i + '" value="' + item.MaterialCode + '">' +
|
||||||
'<input type="hidden" id="txtQuantityAsPerInvoice' + i + '" name="txtQuantityAsPerInvoice' + i + '" value="' + item.QuantityAsPerInvoice + '">' +
|
'<input type="hidden" id="txtQuantityAsPerInvoice' + i + '" name="txtQuantityAsPerInvoice' + i + '" value="' + item.QuantityAsPerInvoice + '">' +
|
||||||
@ -1388,6 +1414,7 @@
|
|||||||
trIGRHTML +='</tr>';
|
trIGRHTML +='</tr>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user