stock module latest today vadivel J 04-03-2025

This commit is contained in:
vadivelJ96 2025-03-04 11:41:08 +05:30
commit 11211bf9b2
64 changed files with 3834 additions and 1604 deletions

View File

@ -87,6 +87,7 @@ $routes->post('fetchDriverAttendanceDetails', 'Driver::fetchDriverAttendanceDeta
$routes->get('reActivateDriverAttendance', 'Driver::reActivateDriverAttendance');
$routes->get('deleteDriverAttendance', 'Driver::deleteDriverAttendance');
$routes->post('gatheredCustAndQty', 'Driver::gatheredCustAndQty');
$routes->match(['GET', 'POST'], 'updateDieselAndShedValuesBasedonEmpID', 'Driver::updateDieselAndShedValuesBasedonEmpID');
// Driver Monthly Pay Inputs Routes
$routes->match(['GET', 'POST', 'PUT', 'DELETE'], 'driverMonthlyPayInputs', 'Driver::driverMonthlyPayInputs');
$routes->post('saveMonthlyData', 'Driver::saveMonthlyData');
@ -124,6 +125,7 @@ $routes->get('exportemployee', 'Employeedetails::exportemployee');
$routes->post('employeeEmailExist', 'Employeedetails::CheckEmail');
$routes->post('employeeMobileExist', 'Employeedetails::CheckMobile');
$routes->post('employeePANExist', 'Employeedetails::checkPAN');
$routes->post('employeecheckAadharNoExist', 'Employeedetails::checkAadharNo');
@ -440,6 +442,7 @@ $routes->get('sales_invoice', 'Sales::sales_invoice');
$routes->post('sales_invoice', 'Sales::sales_invoice');
$routes->post('download_sales_invoice', 'Sales::download_sales_invoice');
$routes->post('updateInvRecQty', 'Sales::updateInvRecQty');
$routes->match(['GET', 'POST'], 'sales_report', 'Sales::sales_report');
// transporter Routes
$routes->match(['GET', 'POST'],'transporterListing', 'Supplier::transporterListing');

View File

@ -546,6 +546,8 @@ class Amendmentpurchaseorder extends BaseController
$RecQtyvalue = $ReceivedQty[0]['ReceivedQuantity'];
}
if($itemRate != 0){
$this->purchaseorder_model->updateMaterialRate($MaterialCode, $itemRate); }
$POLineItemList = array('PONO' => $NewPO, 'ReqNo' => $Reqnumber, 'MaterialCode' => $MaterialCode, 'ReceivedQuantity' => $RecQtyvalue, 'Quantity' => $Quantity, 'Per' => $per, 'ServiceMaterialDescription' => $servicematerialdescription, 'Rate' => $itemRate, 'Status' => $LineItemStatus, 'CreatedBy' => $updatedBy, 'CreatedDate' => $updateddt, 'CostCenterCode' => $CostCenter, 'ServiceFrequency' => $ServiceFrequency, 'AmendedDetails' => $CAD);
$POLineItem = $this->purchaseorder_model->addPOLineItem($POLineItemList);
@ -815,6 +817,8 @@ class Amendmentpurchaseorder extends BaseController
$CAD = "<tr><td rowspan=" . $rowspanvalue . ">" . $MaterialCode . "-" . $MaterialName . "</td></tr>";
$CAD .= $CAD2;
}
if($itemRate != 0){
$this->purchaseorder_model->updateMaterialRate($MaterialCode, $itemRate); }
$POLineItemList = array('PONO' => $NewPO, 'ReqNo' => $Reqnumber, 'MaterialCode' => $MaterialCode, 'Quantity' => $Quantity, 'Rate' => $itemRate, 'Status' => $LineItemStatus, 'ServiceMaterialDescription' => $servicematerialdescription, 'CreatedBy' => $updatedBy, 'CreatedDate' => $updateddt, 'CostCenterCode' => $CostCenter, 'ServiceFrequency' => $ServiceFrequency, 'ReceivedQuantity' => $RecQtyvalue, 'AmendedDetails' => $CAD, 'Per' => $Per);
@ -1248,6 +1252,8 @@ class Amendmentpurchaseorder extends BaseController
$CAD = "<tr><td rowspan=" . $rowspanvalue . ">" . $MaterialCode . "</td></tr>";
$CAD .= $CAD2;
}
if($itemRate != 0){
$this->purchaseorder_model->updateMaterialRate($MaterialCode, $itemRate); }
$POLineItemList = array('PONO' => $NewPO, 'ReqNo' => $Reqnumber, 'MaterialCode' => $MaterialCode, 'Quantity' => $Quantity, 'Rate' => $itemRate, 'Status' => $LineItemStatus, 'CreatedBy' => $CreateBy, 'CreatedDate' => $createddt, 'CostCenterCode' => $CostCenter, 'AmendedDetails' => $CAD, 'Per' => $Per, 'ServiceMaterialDescription' => $CapitalItemDescrition);
$POLineItem = $this->purchaseorder_model->addPOLineItem($POLineItemList);
@ -1636,6 +1642,8 @@ class Amendmentpurchaseorder extends BaseController
$CAD = "<tr><td rowspan=" . $rowspanvalue . ">" . $MaterialCode . "</td></tr>";
$CAD .= $CAD2;
}
if($itemRate != 0){
$this->purchaseorder_model->updateMaterialRate($MaterialCode, $itemRate); }
$POLineItemList = array('PONO' => $NewPO, 'ReqNo' => $Reqnumber, 'MaterialCode' => $MaterialCode, 'Quantity' => $Quantity, 'Rate' => $itemRate, 'Status' => $LineItemStatus, 'CreatedBy' => $CreateBy, 'CreatedDate' => $createddt, 'CostCenterCode' => $CostCenter, 'AmendedDetails' => $CAD, 'Per' => $per, 'ServiceMaterialDescription' => $specialinstruction);

View File

@ -248,11 +248,12 @@ class Assetdetails extends BaseController
$DateOfCommission = $this->request->getPost('DateOfCommission');
$CreatedBy = $this->session->get('userId');
$DateOfPurchase = $this->request->getPost('DateOfPurchase');
$DOpurchase = "";
if ($DateOfPurchase != '') {
$DOpurchase = get_date_time_format($DateOfPurchase);
}
$AssetValue = $this->request->getPost('Assetvalue');
$DOCommission = "";
if ($DateOfCommission != '') {
$DOCommission = get_date_time_format($DateOfCommission);
//$DOCommission= get_date_time_format($DateOfCommission);

View File

@ -116,11 +116,13 @@ class CostCenter extends BaseController
if(!empty($CostCenterCode)){
$updatedBy = $this->session->get('userId');
$message = $this->costcenter_model->reActivateCostCenter($CostCenterCode, $updatedBy);
return redirect()->route('costListing');
}else{
$message = "Cost Center Code Not Avalable";
// $message = "Cost Center Code Not Avalable";
return redirect()->route('costListing');
}
$this->session->setFlashdata('success', $message);
return redirect()->route('costListing');
// $this->session->setFlashdata('success', $message);
// return redirect()->route('costListing');
}
@ -135,11 +137,13 @@ class CostCenter extends BaseController
if(!empty($CostCenterID)){
$updatedBy = $this->session->get('userId');
$message = $this->costcenter_model->deleteCostCenter($CostCenterID, $updatedBy);
return redirect()->route('costListing');
}else{
$message = "Cost Center Code Not Avalable";
return redirect()->route('costListing');
}
$this->session->setFlashdata('success', $message);
return redirect()->route('costListing');
// $this->session->setFlashdata('success', $message);
// return redirect()->route('costListing');
}

View File

@ -133,28 +133,53 @@ class Driver extends BaseController
return $this->response->setJSON($results);
}
public function loadDriverAttendance()
public function loadDriverAttendance()
{
$input_driver_id = $this->request->getPost('gobal_driver_id') ? $this->request->getPost('gobal_driver_id') : $this->request->getGet('gobal_driver_id');
$input_month_year = $this->request->getPost('month_year') ? $this->request->getPost('month_year') : $this->request->getGet('month_year');
list($month, $year) = explode('-', $input_month_year);
$input_driver_id = $this->request->getGet('gobal_driver_id');
// $input_month_year = $this->request->getPost('month_year') ? $this->request->getPost('month_year') : get_date_time_dynamical_format('d-M-Y','d-m-',"01-"+$this->request->getGet('month_year')) ;
$input_date = $this->request->getGet('date')
? $this->request->getGet('date')
: get_date_time_dynamical_format('d-M-Y','d-m-Y',"01-".$this->request->getGet('month_year'));
$month_in_number = get_date_time_dynamical_format('M','m',"$month");// refer helper
$get_last_date_of_the_month = cal_days_in_month(CAL_GREGORIAN, $month_in_number, $year);
$from_mysql_date = get_date_time_dynamical_format('d-m-Y','Y-m-d',"01-$month_in_number-$year");
$to_mysql_date = get_date_time_dynamical_format('d-m-Y','Y-m-d',"$get_last_date_of_the_month-$month_in_number-$year");
$indian_date = get_date_time_dynamical_format('d-m-Y','d-m-Y',"$get_last_date_of_the_month-$month_in_number-$year");
list($date,$month,$year) = explode('-', $input_date);
$get_last_date_of_the_month = cal_days_in_month(CAL_GREGORIAN, $month, $year);
$from_mysql_date = get_date_time_dynamical_format('d-m-Y','Y-m-d',"01-$month-$year");
$to_mysql_date = get_date_time_dynamical_format('d-m-Y','Y-m-d',"$get_last_date_of_the_month-$month-$year");
$indian_date = get_date_time_dynamical_format('d-m-Y','d-m-Y',"$get_last_date_of_the_month-$month-$year");
$amount = $this->driver_model->getDriverAttendanceTable($input_driver_id,"$year-$month");
$data['driver_attendance_list'] = $this->driver_model->useDriverAttendanceTable()->getDriverAttendanceList($input_driver_id,$from_mysql_date,$to_mysql_date);
$data['page_driver_name'] = $this->driver_model->getDriverName($input_driver_id);
$data['page_driver_name'] = $this->driver_model->getDriverName($input_driver_id,0);
$data['invoice_info'] = $this->driver_model->getInvoiceInfo();
$data['datefordropdown'] = $input_month_year;
$data['datefordropdown'] = $input_date;
$data['gobal_driver_id'] = $input_driver_id;
$data['gobal_diesel_amount'] = isset($amount->diesel_amount) ? $amount->diesel_amount : 0 ;
$data['gobal_shed_amount'] = isset($amount->shed_amount) ? $amount->shed_amount : 0 ;
$this->global['pageTitle'] = 'Driver Attendance List';
$this->loadViews("driverAttendance", $this->global, $data, NULL);
}
public function updateDieselAndShedValuesBasedonEmpID(){
$arr = $this->request->getPost();
$userId = $this->session->get('userId');
$to_mysql_date = get_date_time_dynamical_format('d-m-Y','Y-m',$arr['date']);
$update_arr = ['driver_id' =>$arr['empid'],$arr['column'] =>$arr['value'],'updated_by' => $userId];
$where_arr = ['DATE_FORMAT(t_driver_attendance.date, "%Y-%m")' =>$to_mysql_date,'t_driver_attendance.driver_id' =>$arr['empid']];
$data = $this->driver_model->updateDieselAndShedValuesBasedonEmpID($where_arr,$update_arr);
return $data;
// [column] => shed_amount
// [value] => 400
// [date] => 21-02-2025
// [empid] => RIPL136
}
public function fetchDriverAttendanceDetails(){
$userId = $this->session->get('userId');
@ -376,11 +401,11 @@ class Driver extends BaseController
echo json_encode(count($result));
}
public function driverPayslip()
public function driverPayslip_old()
{
$PayOn = $this->request->getPost('payon');
$Driver = $this->request->getPost('driver');
$Driver = $this->request->getPost('employee');
$res = $this->driver_model->getMonthlyPayDetails($Driver, $PayOn);
@ -389,13 +414,9 @@ class Driver extends BaseController
$data = [
'PayOn' => $result->month_year,
'driver_id' => $result->driver_id,
'driver_name' => $result->driver_name,
'no_of_loads' => $result->no_of_loads,
'driver_monthly_salary_amount' => $result->driver_monthly_salary_amount,
'driver_monthly_food_amount' => $result->driver_monthly_food_amount,
'driver_earnings_amount' => $result->driver_earnings_amount,
'diesel' => $result->diesel,
'shed_duty_amount' => $result->shed_duty_amount,
'driver_final_payment' => $result->driver_final_payment,
'created_by' => $this->session->get('userId')
];
@ -405,6 +426,84 @@ class Driver extends BaseController
}
public function driverPayslip()
{
$PayOn = $this->request->getPost('payon');
$Driver = $this->request->getPost('employee');
$res = $this->driver_model->getMonthlyPayDetails($Driver, $PayOn);
$result = $res[0];
$loan = [];
$loanHistory = [];
$loan_id = 0;
$BalanceAdvance = 0;
if(is_null($result->Loan_ID)){
}else{
if($result->Loan_Recovered > 0)
{
$loan_id = $result->Loan_ID;
if($result->Remaining_Due - 1 == 0){ $is_Active = 0; }else{ $is_Active = 1; }
$loan = [
'Paid_Due' => $result->Paid_Due + 1,
'Remaining_Due' => $result->Remaining_Due - 1,
'Paid_Amount' => $result->Paid_Amount + $result->Loan_Recovered,
'is_Active' => $is_Active
];
$loanHistory = [
'Loan_ID' => $loan_id,
'Due_Amount' => $result->Loan_Recovered,
'Balance_Amount' => (int)$result->Loan_Amount - ((int)$result->Paid_Amount + (int)$result->Loan_Recovered),
'Due_Date' => (string)$PayOn,
];
$BalanceAdvance = $result->Loan_Amount - ($result->Paid_Amount + $result->Loan_Recovered);
}
}
$data = [
'PayOn' => $result->month_year,
'driver_id' => $result->driver_id,
'no_of_loads' => $result->no_of_loads,
'monthly_salary_amount' => $result->monthly_salary_amount,
'monthly_food_amount' => $result->monthly_food_amount,
'final_payment' => $result->final_payment,
'created_by' => $this->session->get('userId'),
'shed_amount' => $result->total_shed_amount,
'diesel_amount' => $result->total_diesel_amount,
'ESI' => $result->ESI,
'PF' => $result->PF,
'Advance' => $result->Loan_Recovered,
'BalanceAdvance' => $BalanceAdvance,
'LessAdvance' => 0,
'Festival_Bonus' => $result->Festival_Bonus,
];
$insert = $this->driver_model->insertPayroll($data);
if($insert){
if(count($loan)){
$this->driver_model->updateLoan($loan_id,$result->driver_id,$loan);
}
if(count($loanHistory)){
$this->driver_model->insertLoanHistory($loanHistory);
}
}
return $insert;
}
public function driverPrintPdf()
{

View File

@ -125,7 +125,7 @@ class Emergencypurchaseorder extends BaseController
// print_r($this->request->getPost());die;
$txtRowCount = $this->request->getPost('txtRowCount');
$POdt = $this->request->getPost('PODate');
$PODate = get_date_time_format($POdt);
$PODate = get_date_time_dynamical_format('d-m-Y','Y-m-d',"$POdt");
$SupplierID = $this->request->getPost('drpSupplier');
$DeliveryAddr = $this->request->getPost('DeliveryAddr');
$CostCenterName = $this->request->getPost('CostCenterName');
@ -257,6 +257,8 @@ class Emergencypurchaseorder extends BaseController
$TotalOrderValue = $this->request->getPost('TotalOrderValue' . $i);
$ServiceFrequency = $this->request->getPost('Frequency' . $i) . ' - ' . $this->request->getPost('FrequencyValue' . $i);
$ServiceMaterialDescription = $this->request->getPost('ItemServiceDescription' . $i);
if($itemRate != 0){
$this->purchaseorder_model->updateMaterialRate($MaterialCode, $itemRate); }
$SkipInsert = "False";
if (count($comma_separated) > 0) {
for ($j = 1; $j < count($comma_separated); $j++) {
@ -367,7 +369,7 @@ class Emergencypurchaseorder extends BaseController
$POdt = $this->request->getPost('PODate');
$PODate = get_date_time_format($POdt);
$PODate = get_date_time_dynamical_format('d-m-Y','Y-m-d',"$POdt");
$SupplierID = $this->request->getPost('drpSupplier');
$DeliveryAddr = $this->request->getPost('DeliveryAddr');
$dt = $this->request->getPost('Deliverydt');
@ -524,6 +526,8 @@ class Emergencypurchaseorder extends BaseController
$AfterCgst = $this->request->getPost('RevenueAfterCgst' . $i);
$AfterSgst = $this->request->getPost('RevenueAfterSgst' . $i);
$AfterIgst = $this->request->getPost('RevenueAfterIgst' . $i);
if($itemRate != 0){
$this->purchaseorder_model->updateMaterialRate($MaterialCode, $itemRate); }
$SkipInsert = "False";
if (count($comma_separated) > 0) {
for ($j = 1; $j < count($comma_separated); $j++) {
@ -632,7 +636,7 @@ class Emergencypurchaseorder extends BaseController
if (count($mrirmaster) > 0) {
foreach ($mrirmaster as $key) {
$MRIRNO = $key->MRIRNo;
$MRIRNO = $key->MRIRNO;
}
}
@ -1231,7 +1235,8 @@ class Emergencypurchaseorder extends BaseController
$InsuranceValue = $this->request->getPost('Insval' . $i);
$TotalOrderValue = $this->request->getPost('TotalOrderValue' . $i);
$CostCenter = $this->request->getPost('costCode' . $i);
if($itemRate != 0){
$this->purchaseorder_model->updateMaterialRate($MaterialCode, $itemRate); }
$SkipInsert = "False";
if (count($comma_separated) > 0) {
for ($j = 1; $j < count($comma_separated); $j++) {
@ -1398,7 +1403,8 @@ class Emergencypurchaseorder extends BaseController
/*----------end--------------------*/
if($itemRate != 0){
$this->purchaseorder_model->updateMaterialRate($MaterialCode, $itemRate); }
$SkipInsert = "False";
if (count($comma_separated) > 0) {
@ -1525,6 +1531,6 @@ class Emergencypurchaseorder extends BaseController
$this->purchaseorder_model->DeletePOServiceTax($LineItemNo);
}
$this->purchaseorder_model->DeletePOLineItem($LineItemNo, $ReqNo, $MaterialCode);
echo "Successfully Deleted the Line item" . $LineItemNo;
echo "Successfully Deleted the Line item " . $LineItemNo;
}
}

View File

@ -481,6 +481,25 @@ class Employeedetails extends BaseController
return $this->response->setJSON($response);
}
function CheckMobile()
{
$ContactNumber = $this->request->getPost('ContactNumber');
//print_r($id);
$result = $this->employeedetails_model->checkMobileExists($ContactNumber);
$result = $result->getResultArray();
$response = [
"message" => "success",
"data" => $result
];
return $this->response->setJSON($response);
}
function checkPAN()
{

View File

@ -1416,6 +1416,8 @@ function updateIGRWeight(){
foreach ($request as $key => $value) {
foreach ($dbIGRMaster as $key1 => $value1) {
if ($value1 != $value && $key1 == $key) {
$value = ($key1 == "IGRStatus") ? $this->inwardgateregister_model->get_status($value) : $value;
$value1 = ($key1 == "IGRStatus") ? $this->inwardgateregister_model->get_status($value1) : $value1;
// Store each changed field in an array
$history_entries[] = [
'field' => $key1,

View File

@ -10,6 +10,7 @@ use CodeIgniter\Validation\Exceptions\ValidationException;
use App\Models\Monthlypay_model;
use App\Models\Payroll_model;
use App\Models\Driver_model;
use Mpdf\Mpdf;
use PhpOffice\PhpSpreadsheet\Spreadsheet;
@ -33,6 +34,7 @@ class Payslip extends BaseController
{
protected $payroll_model;
protected $monthlypay_model;
protected $driver_model;
protected $session;
/**
@ -43,6 +45,7 @@ class Payslip extends BaseController
parent::__construct();
$this->payroll_model = new Payroll_model();
$this->monthlypay_model = new Monthlypay_model();
$this->driver_model = new Driver_model();
$this->session = session();
helper('form'); //$this->load->library('form_validation');
$this->isLoggedIn();
@ -590,20 +593,20 @@ class Payslip extends BaseController
public function monthlyInputs()
{
$current = date("m-Y");
$current = $this->request->getPost('monthyear') ? $this->request->getPost('monthyear') :date("m-Y");
$data['month'] = $this->monthlypay_model->monthlyListing($current);
$data['dropdownvalue'] = $current;
$data['fresh'] = $this->monthlypay_model->getEmpPayDetailsforMonthInputs($current);
// dd($data['fresh']);
$data['drivermonthinputs'] = $this->driverMonthlyPayInputs($current);
$employeeSalary = [];
$esi = [];
$pf = [];
$ot = [];
foreach ($data['fresh'] as $value) {
$is_driver = $value->is_driver;
$NoofDays = $value->NoofDays; //Month day 30,31,28
$HRA_Amount = $value->HRA_Amount;
$Basic_Pay = $value->Basic_Pay;
@ -623,6 +626,11 @@ class Payslip extends BaseController
$Loan_Recovered = $value->Loan_Recovered; //MANUAL LOAN DUE
$due_start_date = $value->DueDate;
$paydate = $current; //From POST parm
if (strlen((string)$paydate) == 6) {
$paydate = '0' . $paydate;
}
$pmonth = substr($paydate, 0, 2);
$pyear = substr($paydate, -4);
$pmonth = substr($paydate, 0, 2);
$pyear = substr($paydate, -4);
@ -722,6 +730,158 @@ class Payslip extends BaseController
$this->loadViews("monthlypayinputs", $this->global, $data, NULL);
}
public function driverMonthlyPayInputs($current)
{
list($month, $year) = explode('-', $current);
$month_in_number = get_date_time_dynamical_format('n','m',"$month");// refer helper
$get_last_date_of_the_month = cal_days_in_month(CAL_GREGORIAN, $month_in_number, $year);
$from_mysql_date = get_date_time_dynamical_format('d-m-Y','Y-m-d',"01-$month_in_number-$year");
$to_mysql_date = get_date_time_dynamical_format('d-m-Y','Y-m-d',"$get_last_date_of_the_month-$month_in_number-$year");
// $data['monthinputs']
$load_driver_data = $this->driver_model->driverAttendanceForMonthlyPayInputs($from_mysql_date,$to_mysql_date);
// dd($load_driver_data);
$format_month_year = get_date_time_dynamical_format('n-Y','m-Y',"$current");
$monthly_pay_data = $this->driver_model->driverMonthlyPayInputs($format_month_year);
// both foreach refer with chatgpt array data replacement....
$monthly_pay_array = [];
foreach ($monthly_pay_data as $row) {
$monthly_pay_array[$row->driver_id] = $row;
}
for ($i = 0; $i < count((array)$load_driver_data); $i++) {
$driver_id = $load_driver_data[$i]->driver_id;
if (isset($monthly_pay_array[$driver_id])) {
$PF_Rate = $load_driver_data[$i]->PF_Rate;
$ESI_Rate = $load_driver_data[$i]->ESI_Rate;
$monthly_salary_amount = isset($load_driver_data[$i]->monthly_salary_amount) ? (int)$load_driver_data[$i]->monthly_salary_amount : 0;
$monthly_food_amount = isset($load_driver_data[$i]->monthly_food_amount) ? (int)$load_driver_data[$i]->monthly_food_amount : 0;
$final_salary_amount = $monthly_salary_amount+$monthly_food_amount;
$shed = isset($load_driver_data[$i]->shed_amount) ? (int)$load_driver_data[$i]->shed_amount : 0;
$diesel = isset($load_driver_data[$i]->diesel_amount) ? (int)$load_driver_data[$i]->diesel_amount : 0;
$load_driver_data[$i]->driver_salary = $final_salary_amount;
$load_driver_data[$i]->driver_shed = $shed;
$load_driver_data[$i]->driver_diesel = $diesel;
$Monthly_Due = $load_driver_data[$i]->Monthly_Due; // AUTO LOAN DUE
$Loan_Recovered = $load_driver_data[$i]->Loan_Recovered; //MANUAL LOAN DUE
$loan = 0;
$due_start_date = $load_driver_data[$i]->DueDate;
$paydate = $current; //From POST parm
if ($Loan_Recovered == 'NA') {
$loan = 0.00;
} else if ($Loan_Recovered == 0.00) {
if (strtotime($due_start_date) <= strtotime($to_mysql_date)) {
$loan = $Monthly_Due;
}
} else if ($Loan_Recovered >= 0.00) {
if (strtotime($due_start_date) <= strtotime($to_mysql_date)) {
$loan = $Loan_Recovered;
}
}
$Loan_amount = $load_driver_data[$i]->Loan_Amount;
$Paid_Amount = $load_driver_data[$i]->Paid_Amount;
$Balance_Amount = $Loan_amount - $Paid_Amount;
if ($Monthly_Due > $Balance_Amount) {
$loan = $Balance_Amount;
}
$empSalaryAdd = $final_salary_amount+$shed+$diesel;
$empSalarySub = $loan;
$salaryInCurrentday = $empSalaryAdd - $empSalarySub;
$load_driver_data[$i]->driver_final_payment = $salaryInCurrentday;
$load_driver_data[$i]->payroll_id = $monthly_pay_array[$driver_id]->payroll_id;
$load_driver_data[$i]->Festival_Bonus = $monthly_pay_array[$driver_id]->Festival_Bonus;
$basic = ($final_salary_amount+$shed+$diesel) * 70 / 100;
$hra = ($final_salary_amount+$shed+$diesel) * 30 / 100;
$load_driver_data[$i]->basic_worked = $basic;
$load_driver_data[$i]->hra_worked = $hra;
$load_driver_data[$i]->esi_amount = ($load_driver_data[$i]->esi_applicable == 1) ? ($basic) * $ESI_Rate / 100 : 0;
$load_driver_data[$i]->pf_amount = ($load_driver_data[$i]->pf_applicable == 1) ? ($basic) * $PF_Rate / 100 : 0;
$load_driver_data[$i]->total_cal_days = $get_last_date_of_the_month;
}else {
$PF_Rate = $load_driver_data[$i]->PF_Rate;
$ESI_Rate = $load_driver_data[$i]->ESI_Rate;
$monthly_salary_amount = isset($load_driver_data[$i]->monthly_salary_amount) ? (int)$load_driver_data[$i]->monthly_salary_amount : 0;
$monthly_food_amount = isset($load_driver_data[$i]->monthly_food_amount) ? (int)$load_driver_data[$i]->monthly_food_amount : 0;
$final_salary_amount = $monthly_salary_amount+$monthly_food_amount;
$shed = isset($load_driver_data[$i]->shed_amount) ? (int)$load_driver_data[$i]->shed_amount : 0;
$diesel = isset($load_driver_data[$i]->diesel_amount) ? (int)$load_driver_data[$i]->diesel_amount : 0;
$load_driver_data[$i]->driver_salary = $final_salary_amount;
$load_driver_data[$i]->driver_shed = $shed;
$load_driver_data[$i]->driver_diesel = $diesel;
$load_driver_data[$i]->payroll_id = '';
$load_driver_data[$i]->Festival_Bonus = 0;
$basic = ($final_salary_amount+$shed+$diesel) * 70 / 100;
$hra = ($final_salary_amount+$shed+$diesel) * 30 / 100;
$load_driver_data[$i]->basic_worked = $basic;
$load_driver_data[$i]->hra_worked = $hra;
$load_driver_data[$i]->esi_amount = ($load_driver_data[$i]->esi_applicable == 1) ? ($basic) * $ESI_Rate / 100 : 0;
$load_driver_data[$i]->pf_amount = ($load_driver_data[$i]->pf_applicable == 1) ? ($basic) * $PF_Rate / 100 : 0;
$Monthly_Due = $load_driver_data[$i]->Monthly_Due; // AUTO LOAN DUE
$Loan_Recovered = $load_driver_data[$i]->Loan_Recovered; //MANUAL LOAN DUE
$loan = 0;
$due_start_date = $load_driver_data[$i]->DueDate;
$paydate = $current; //From POST parm
if ($Loan_Recovered == 'NA') {
$loan = 0.00;
} else if ($Loan_Recovered == 0.00) {
if (strtotime($due_start_date) <= strtotime($to_mysql_date)) {
$loan = $Monthly_Due;
}
} else if ($Loan_Recovered >= 0.00) {
if (strtotime($due_start_date) <= strtotime($to_mysql_date)) {
$loan = $Loan_Recovered;
}
}
$Loan_amount = $load_driver_data[$i]->Loan_Amount;
$Paid_Amount = $load_driver_data[$i]->Paid_Amount;
$Balance_Amount = $Loan_amount - $Paid_Amount;
if ($Monthly_Due > $Balance_Amount) {
$loan = $Balance_Amount;
}
$empSalaryAdd = $final_salary_amount;
$empSalarySub = $loan;
$salaryInCurrentday = $empSalaryAdd - $empSalarySub;
$load_driver_data[$i]->driver_final_payment = $salaryInCurrentday+$shed+$diesel;
$load_driver_data[$i]->total_cal_days = $get_last_date_of_the_month;
}
}
// dd($load_driver_data);
return $load_driver_data;
}
function changeMonth()
{
@ -857,6 +1017,11 @@ class Payslip extends BaseController
$data['esi'] = $esi;
$data['pf'] = $pf;
$data['over_time'] = $ot;
// dd($data);
//echo sizeof($data['fresh'])."-".sizeof($data['empSalary']);die;
$this->global['pageTitle'] = 'Payroll Monthly Inputs';
@ -892,7 +1057,6 @@ class Payslip extends BaseController
$month = $mon . "-" . $year;
//echo $month;die();
$total = 0;
$ErrorEmpId = '';
$TotalErrorFlag = 0;
@ -1002,7 +1166,9 @@ class Payslip extends BaseController
$EmpID = $j['Emp ID'];
$is_driver = $this->driver_model->getDriverName($EmpID,1);
$DaysWorked = $j['Days Worked'];
$NoTrips = isset($j['Number Of Trips']) ? $j['Number Of Trips'] : 0.00 ;
$TotalCalDays = isset($j['Total Days']) ? $j['Total Days'] : 0.00 ;
$ActualSalary = isset($j['Basic Salary']) ? $j['Basic Salary'] : 0.00 ;
$WorkedSalary = isset($j['Worked Salary']) ? $j['Worked Salary'] : 0.00 ;
@ -1020,8 +1186,11 @@ class Payslip extends BaseController
$Festival_Bonus = isset($j['Festival Bonus in ₹']) ? $j['Festival Bonus in ₹'] : 0.00;
$tds_Deductions = isset($j['TDS Deductions in ₹']) ? $j['TDS Deductions in ₹'] : 0.00;
$Estimate = isset($j['Estimate in ₹']) ? $j['Estimate in ₹'] : 0.00;
$Created_By = $this->session->get('userId');
$Created_By = $this->session->get('userId');
if($is_driver == 0){
$monthlypaydata = array(
'Month_Year' => $month,
'EmpID' => $EmpID,
@ -1046,6 +1215,41 @@ class Payslip extends BaseController
);
// print_r($monthlypaydata); die;
$result = $this->monthlypay_model->saveMonthlyData_model($monthlypaydata);
}else{
$get_last_date_of_the_month = cal_days_in_month(CAL_GREGORIAN, $mon, $year);
$from_mysql_date = get_date_time_dynamical_format('d-m-Y','Y-m-d',"01-$mon-$year");
$to_mysql_date = get_date_time_dynamical_format('d-m-Y','Y-m-d',"$get_last_date_of_the_month-$mon-$year");
$load_driver_data = $this->driver_model->driverAttendanceForMonthlyPayInputs($from_mysql_date,$to_mysql_date);
$Food = isset($load_driver_data[0]->monthly_food_amount) ? (int)$load_driver_data[0]->monthly_food_amount : 0;
$Shed = isset($load_driver_data[0]->shed_amount) ? (int)$load_driver_data[0]->shed_amount : 0;
$Diesel = isset($load_driver_data[0]->diesel_amount) ? (int)$load_driver_data[0]->diesel_amount : 0;
$drivermonthlypaydata = array(
'month_year'=>$month,
'driver_id'=>$EmpID,
'TotalCalDays' => $TotalCalDays,
'no_of_loads'=>(strpos($NoTrips, "(trip)") !== false) ? explode(" ", $NoTrips)[0] : 0,
'monthly_food_amount'=>$Food,
'total_diesel_amount'=>$Diesel,
'total_shed_amount'=>$Shed,
'monthly_salary_amount'=>($Basic+$Food),
'final_payment'=>$Estimate,
'HRA'=>$HRA,
'ESI'=>$ESI,
'PF'=>$PF,
'Festival_Bonus'=>$Festival_Bonus,
'Loan_Recovered'=>$Loan_Recovered,
'created_by'=>$Created_By,
'updated_by'=>$Created_By
);
// print_r($drivermonthlypaydata);die;
$result = $this->driver_model->saveMonthlyData($drivermonthlypaydata);
}
$total = $total + $result;
}
}
@ -1091,6 +1295,7 @@ class Payslip extends BaseController
public function viewGenerator()
{
$Data['Payon'] = $this->payroll_model->getPayOn();
$this->global['pageTitle'] = 'Payroll Generater';
@ -1112,7 +1317,11 @@ class Payslip extends BaseController
{
$id = $this->request->getPost('id1');
$result = $this->payroll_model->getEmployeelist2($id);
$employee = $this->payroll_model->getEmployeelist2($id);
$driver = $this->driver_model->getDriverlist2($id);
$result = array_merge($employee, $driver);
$HTML = "";
@ -1120,8 +1329,7 @@ class Payslip extends BaseController
foreach ($result as $list) {
$HTML .= "<option value='" . $list->EmpId . "'>" . $list->EmpId . "-" . $list->Fname . "</option>";
$HTML .= "<option value='" . $list->EmpId . "'>" . $list->EmpId . "-" . $list->FullName . "</option>";
}
}
echo $HTML;
@ -1172,6 +1380,7 @@ class Payslip extends BaseController
$y = substr((string)$Payon, 3);
// if condition for all while checkbox is checked means.
if ($All != '') {
$filename = 'PayslipFor-' . $m . '-' . $y;
$result = $this->payroll_model->getEmpAll($Payon);
@ -1196,6 +1405,26 @@ class Payslip extends BaseController
}
} else {
$EmpID = $this->request->getPost('Employee');
// $EmpID = "RIPL136";
$is_driver = $this->driver_model->getDriverName($EmpID,1);
// print_r($is_driver);die;
if($is_driver == "1"){
$Data['PayDetails'] = $this->driver_model->GetPayslipdata($Payon, $EmpID);
// print_r($Data['PayDetails']);die;
$name = $Data['PayDetails'][0]->driver_name;
$filename = 'PayslipFor-' . $EmpID . ' ' . $name . ' ' . $m . ' ' . $y;
$totalsalary = $Data['PayDetails'][0]->final_payment;
$totalsalaryinwords = $this->convertNumberToWords(round($totalsalary));
$Data['amtinwords'] = $totalsalaryinwords;
$currentDayBasic = isset($Data['PayDetails'][0]->monthly_salary_amount) ? $Data['PayDetails'][0]->monthly_salary_amount : 0;
$PF_Rate = $Data['PayDetails'][0]->PF_Rate;
$ESI_Rate = $Data['PayDetails'][0]->ESI_Rate;
$Data['esi_amount'] = ($Data['PayDetails'][0]->esi_applicable == 1) ? $currentDayBasic * $ESI_Rate / 100 : 0;
$Data['pf_amount'] = ($Data['PayDetails'][0]->pf_applicable == 1) ? $currentDayBasic * $PF_Rate / 100 : 0;
$html = view("driverPayslipGeneratePrint", $Data);
}else{
//echo "EmpID" . $EmpID;
$Data['PayDetails'] = $this->payroll_model->GetPayslipdata($Payon, $EmpID);
@ -1210,6 +1439,8 @@ class Payslip extends BaseController
// echo view("payslipgenerateprint", $Data);die;
$html = view("payslipgenerateprint", $Data);
}
}
$mpdf = new Mpdf([
@ -1231,7 +1462,7 @@ class Payslip extends BaseController
$mpdf->WriteHTML($html);
$mpdf->SetTitle('Resico:Payslip');
$mpdf->Output("Payslip-" . $filename . ".pdf", 'D');
$mpdf->Output("Payslip-" . $filename . ".pdf", 'D');
}
@ -1530,10 +1761,24 @@ class Payslip extends BaseController
{
$empid = $this->request->getPost('employee');
$payon = $this->request->getPost('payon');
$result = $this->payroll_model->checkExistPayData($empid, $payon);
echo json_encode(count($result));
$is_driver = $this->driver_model->getDriverName($empid,1);
if($is_driver){
$result = $this->driver_model->checkDriverExistPay($empid, $payon);
$data['count'] = count($result);
$data['path'] = "driverPayslip";
echo json_encode($data);
}else{
$result = $this->payroll_model->checkExistPayData($empid, $payon);
$data['count'] = count($result);
$data['path'] = "payslip/callsp";
echo json_encode($data);
}
}
function convertNumber($amt)

View File

@ -1226,7 +1226,8 @@ class Purchaseorder extends BaseController
$AfterSgst = $this->request->getPost('RevenueAfterSgst' . $i);
$AfterIgst = $this->request->getPost('RevenueAfterIgst' . $i);
$LineitemAuditorNotes = $this->request->getPost('LineItemNoteForAuditor' . $i);
if($itemRate != 0){
$this->purchaseorder_model->updateMaterialRate($MaterialCode, $itemRate); }
$SkipInsert = "False";
if (count($comma_separated) > 0) {
for ($j = 1; $j < count($comma_separated); $j++) {
@ -1437,7 +1438,8 @@ class Purchaseorder extends BaseController
$this->purchaseorder_model->insertlogpo($logpo);
}
if($itemRate != 0){
$this->purchaseorder_model->updateMaterialRate($MaterialCode, $itemRate); }
$SkipInsert = "False";
if (count($comma_separated) > 0) {
for ($j = 1; $j < count($comma_separated); $j++) {
@ -1962,7 +1964,7 @@ class Purchaseorder extends BaseController
$this->purchaseorder_model->DeletePOServiceTax($LineItemNo);
}
$this->purchaseorder_model->DeletePOLineItem($LineItemNo, $ReqNo, $MaterialCode);
echo "Successfully Deleted the Line item" . $LineItemNo;
echo "Successfully Deleted the Line item " . $LineItemNo;
}
@ -2111,6 +2113,8 @@ class Purchaseorder extends BaseController
$per = $this->request->getPost('Per' . $i);
$LineitemAuditorNotes = $this->request->getPost('LineItemNoteForAuditor' . $i);
if($itemRate != 0){
$this->purchaseorder_model->updateMaterialRate($MaterialCode, $itemRate); }
$SkipInsert = "False";
if (count($comma_separated) > 0) {
for ($j = 1; $j < count($comma_separated); $j++) {
@ -2452,6 +2456,8 @@ class Purchaseorder extends BaseController
//die();
$currencytypeID = $this->request->getPost('currencytype');
if($itemRate != 0){
$this->purchaseorder_model->updateMaterialRate($MaterialCode, $itemRate); }
$SkipInsert = "False";
if (count($comma_separated) > 0) {
for ($j = 1; $j < count($comma_separated); $j++) {
@ -2839,6 +2845,8 @@ class Purchaseorder extends BaseController
$CapitalItemDescription = $this->request->getPost('CapitalItemDescrition' . $i);
$Per = $this->request->getPost('per' . $i);
$LineitemAuditorNotes = $this->request->getPost('LineItemNoteForAuditor' . $i);
if($itemRate != 0){
$this->purchaseorder_model->updateMaterialRate($MaterialCode, $itemRate); }
$SkipInsert = "False";
if (count($comma_separated) > 0) {
for ($j = 1; $j < count($comma_separated); $j++) {
@ -3189,7 +3197,8 @@ class Purchaseorder extends BaseController
/*----------end--------------------*/
if($itemRate != 0){
$this->purchaseorder_model->updateMaterialRate($MaterialCode, $itemRate); }
$SkipInsert = "False";
if (count($comma_separated) > 0) {
for ($j = 1; $j < count($comma_separated); $j++) {
@ -3279,7 +3288,8 @@ class Purchaseorder extends BaseController
} else {
$LineItemNo = $POLineItemNo;
if($itemRate != 0){
$this->purchaseorder_model->updateMaterialRate($MaterialCode, $itemRate); }
$POLineItemList = array('PONO' => $PONO, 'ReqNo' => $Reqnumber, 'MaterialCode' => $MaterialCode, 'Quantity' => $Quantity, 'Rate' => $itemRate, 'Status' => $LineItemStatus, 'CreatedBy' => $CreateBy, 'CostCenterCode' => $CostCenter, 'ServiceMaterialDescription' => $CapitalItemDescription, 'Per' => $Per,'LineitemAuditorNotes'=>$LineitemAuditorNotes);
$POLineItem = $this->purchaseorder_model->updatePOLineItem($PONO, $LineItemNo, $POLineItemList);
@ -4488,6 +4498,7 @@ class Purchaseorder extends BaseController
$supplierid = $this->request->getPost('supplierid');
$materialcode = $this->request->getPost('materialcode');
$result = $this->purchaseorder_model->VerifyWithSupplierForPendingPO($supplierid, $materialcode);
$materialrate = $this->purchaseorder_model->materialRate($materialcode);
$response = "";
if (!empty($result)) {

View File

@ -261,9 +261,9 @@ class Rawmaterialdetails extends BaseController
}
$HSNcode = ($HSN == '') ? null : $HSN;
$material_rate = $this->request->getPost('material_rate');
$RawMaterial = array('MaterialName' => $MaterialName, 'MaterialType' => $MaterialType, 'UOM' => $UOM, 'Category' => $MaterialCategory, 'CreatedBy' => $CreatedBy, 'Remarks' => $Remarks, 'HSNCODE' => $HSNcode, 'stock' => $stock, 'stockdate' => $stockdate, 'reorder' => $reorder, 'Current_stock' => $currentstock);
$RawMaterial = array('MaterialName' => $MaterialName, 'MaterialType' => $MaterialType, 'UOM' => $UOM, 'Category' => $MaterialCategory, 'CreatedBy' => $CreatedBy, 'Remarks' => $Remarks, 'HSNCODE' => $HSNcode, 'stock' => $stock, 'stockdate' => $stockdate, 'reorder' => $reorder, 'Current_stock' => $currentstock, 'material_rate'=>$material_rate);
//print_r($RawMaterial);die();
$result = $this->rawmaterialdetails_model->addNewRawMaterial($RawMaterial);
@ -323,6 +323,7 @@ class Rawmaterialdetails extends BaseController
$MaterialType = $this->request->getPost('MaterialType');
$MaterialCategory = $this->request->getPost('MaterialCategory');
$materialcategoryarray = $this->rawmaterialdetails_model->getmaterialCategory();
$material_rate = $this->request->getPost('material_rate');
foreach ($materialcategoryarray as $mc) {
$TempArr[] = $mc->ConfigValue;
@ -343,14 +344,15 @@ class Rawmaterialdetails extends BaseController
$stock = $this->request->getPost('openstock');
$reorder = $this->request->getPost('reorder');
$stockdate = $this->request->getPost('Date');
$stockdate = (empty($stockdate)) ? NULL : format_date($stockdate,0,"Y-m-d");
$stockdate = (empty($stockdate)) ? NULL : get_date_time_dynamical_format('d-m-Y','Y-m-d',"$stockdate");
$chked = $this->request->getPost('isactive');
$IsActive = ($chked != '') ? '1' : '0';
$HSNcode = ($HSN == '') ? null : $HSN;
$RawMaterial = array();
$RawMaterial = array('MaterialName' => $MaterialName, 'MaterialType' => $MaterialType, 'UpdatedBy' => $UpdatedBy, 'UOM' => $UOM, 'IsActive' => $IsActive, 'Category' => $MaterialCategory, 'Remarks' => $Remarks, 'HSNCODE' => $HSNcode, 'stock' => $stock, 'stockdate' => $stockdate, 'reorder' => $reorder); //,'RMCode'=>$rmcode);
$RawMaterial = array('MaterialName' => $MaterialName, 'MaterialType' => $MaterialType, 'UpdatedBy' => $UpdatedBy, 'UOM' => $UOM, 'IsActive' => $IsActive, 'Category' => $MaterialCategory, 'Remarks' => $Remarks, 'HSNCODE' => $HSNcode, 'stock' => $stock, 'stockdate' => $stockdate, 'reorder' => $reorder,'material_rate'=>$material_rate); //,'RMCode'=>$rmcode);
// print_r($RawMaterial);die;
$result = $this->rawmaterialdetails_model->editRawmaterial($RawMaterial, $MaterialCode);

View File

@ -118,6 +118,44 @@ class Sales extends BaseController
$this->loadViews("sales_invoice", $this->global, $data, NULL);
}
public function sales_report()
{
$headline = '';
$report = [];
if ($this->request->getMethod(true) === 'POST' && $this->request->getPost('btn_submit')) {
$from_date = $this->request->getPost('from_date');
$to_date = $this->request->getPost('to_date');
$hsn_number = $this->request->getPost('hsn_number');
$product_id = $this->request->getPost('product');
$client_id = $this->request->getPost('client');
$headline .= ((isset($from_date) && isset($to_date)) && (!empty($from_date) && !empty($to_date))) ? $from_date . ' to ' . $to_date. ', ' : '';
$headline .= (isset($hsn_number) && !empty($hsn_number)) ? $hsn_number . ', ' : '';
$headline .= (isset($product_id) && !empty($product_id)) ? $this->ipinvoice_model->getProductName($product_id) . ', ' : '';
$headline .= (isset($client_id) && !empty($client_id)) ? $this->ipinvoice_model->getClientName($client_id) . ', ' : '';
$report = $this->ipinvoice_model->sales_report($from_date, $to_date, $hsn_number, $product_id, $client_id);
}
$data['hsn'] = $this->ipinvoice_model->getHsn();
$data['product'] = $this->ipinvoice_model->getProducts();
$data['client'] = $this->ipinvoice_model->getClients();
$data['headline'] = $headline;
$data['sales_invoice'] = $report;
// Load the view
$this->global['pageTitle'] = 'Reports';
$this->loadviews("report_sales", $this->global, $data, NULL);
}
public function download_sales_invoice()
{
// Fetch data from the model

View File

@ -341,7 +341,7 @@ class Servicepurchaseorder extends BaseController
}
}
}
echo 'Service Purchase Order Created Successfully!The PO NO Is: ' . $PONO;
echo 'Service Purchase Order Created Successfully! PO Number Is: ' . $PONO;
}
//update service po
function UpdateServicePurchaseOrder()

View File

@ -1380,6 +1380,10 @@ class User extends BaseController
$headers_new = $result['headers_new'];
$res = json_decode($result['data'], true);
$inv_array = $res['invoices'];
// $cteditNotes = getAllCreditNotes($date_today, $date_yesterday, $token);
// dd($cteditNotes);
// dd($inv_array);
// print_r($inv_array);
// echo "rrrr";
@ -1400,6 +1404,7 @@ class User extends BaseController
// dd($res2);
foreach ($res2 as $rs) {
$gst_no = $rs['gst_no'];
$customer_id = $rs['customer_id'];
$customer_name = $rs['customer_name'];
@ -1550,7 +1555,7 @@ class User extends BaseController
if (isset($rs['line_items']) && count($rs['line_items']) > 0) {
log_message('error', 'Processing line items' . count($rs['line_items']));
dd($rs);
// dd($rs);
for ($i = 0; $i < count($rs['line_items']); $i++) { //start insert line items
$sku = $rs['line_items'][$i]['sku'];

View File

@ -110,4 +110,94 @@ if (! function_exists('test_helper')) {
}
}
if (! function_exists('getAllCreditNotes')) {
// function getAllCreditNotes($date_today, $date_yesterday, $accesstoken)
// {
// // Initialize cURL
// $ch = curl_init();
// // Zoho API credentials
// $organization_id = '776847408';
// // $url_org = "https://books.zoho.com/api/v3/creditnotes?";
// $url_org = "https://www.zohoapis.com/books/v3/creditnotes?";
// // Construct query parameters
// $fields = array(
// "usestate" => "true",
// "organization_id" => $organization_id,
// "date_start" => $date_yesterday,
// "date_end" => $date_today
// );
// $data_all = http_build_query($fields);
// // Set headers
// $headers = array(
// 'Authorization: Zoho-oauthtoken '.$accesstoken,
// 'Content-Type: application/json'
// );
// // Construct URL
// $data_access = $url_org.$data_all;
// // Set cURL options
// curl_setopt($ch, CURLOPT_URL, $data_access);
// curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
// curl_setopt($ch, CURLOPT_HEADER, 0);
// curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET");
// curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
// // Execute cURL request
// $result = curl_exec($ch);
// // Store headers and data
// $data['headers_new'] = $headers;
// $data['data'] = curl_exec($ch);
// // Return data
// return $data;
// }
function getAllCreditNotes($date_today, $date_yesterday, $accesstoken)
{
// Initialize cURL
$ch = curl_init();
var_dump($accesstoken);
// Zoho API credentials
$organization_id = '776847408';
$url_org = "https://books.zoho.com/api/v3/creditnotes?";
// Construct query parameters manually (Zoho might need raw values)
$query_string = "usestate=true&organization_id=$organization_id&date_start=$date_yesterday&date_end=$date_today";
// Set headers
$headers = array(
'Authorization: Zoho-oauthtoken ' . $accesstoken,
'Content-Type: application/json'
);
// Set cURL options
curl_setopt($ch, CURLOPT_URL, $url_org . $query_string);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
// Execute cURL request
$result = curl_exec($ch);
// Check for errors
if ($result === false) {
return ['error' => curl_error($ch)];
}
// Close cURL session
curl_close($ch);
return [
'headers_new' => $headers,
'data' => $result
];
}
}
?>

View File

@ -400,7 +400,8 @@ where Dept.DEPCode not in
}
}
return "Cost center $CostCenterCode Reactivated successfully.";
// return "Cost center $CostCenterCode Reactivated successfully.";
return true;
}
function deleteCostCenter($CostCenterCode,$UpdatedBy)
@ -427,7 +428,8 @@ where Dept.DEPCode not in
}
}
return "Cost center $CostCenterCode deactivated successfully.";
// return "Cost center $CostCenterCode deactivated successfully.";
return true;
}
function checkCostCenter($CostCenterId,$CostCenterName){

View File

@ -21,7 +21,7 @@ class Driver_model extends Model
{
$this->table = 't_driver_attendance';
$this->primaryKey = 'driver_attendance_id';
$this->allowedFields = ['driver_attendance_id','date','driver_id','invoice_number','vehicle_number','load_type','salary_amount','food_amount','created_on','created_by','updated_on','updated_by','isactive'];
$this->allowedFields = ['driver_attendance_id','date','driver_id','invoice_number','vehicle_number','load_type','salary_amount','food_amount','created_on','created_by','updated_on','updated_by','isactive','diesel_amount','shed_amount'];
return $this;
}
@ -47,11 +47,11 @@ class Driver_model extends Model
return $this->table . '.' . $field;
}, $this->allowedFields));
$selectFields = "CONCAT_WS(' ', t_employee_details.FirstName, t_employee_details.LastName) AS FullName, t_employee_details.IsActive as employee_isactive, t_driver.driver_name,ip_clients.client_name as customer,ip_invoices.received_qty as quantity,t_driver_payroll.id as payroll_id,t_driver_payroll.PayOn," . $fields;
$selectFields = "CONCAT_WS(' ', t_employee_details.FirstName, t_employee_details.LastName) AS FullName, t_employee_details.IsActive as employee_isactive, CONCAT_WS(' ', driver.FirstName, driver.LastName) AS driver_name,ip_clients.client_name as customer,ip_invoices.received_qty as quantity,t_driver_payroll.id as payroll_id,t_driver_payroll.PayOn," . $fields;
$month_year = get_date_time_dynamical_format('Y-m-d','m-Y',"$from");
return $this->select($selectFields)
->join('t_driver', 't_driver.driver_id = ' . $this->table . '.driver_id', 'left')
->join('t_employee_details as driver', 'driver.EmpID = ' . $this->table . '.driver_id', 'left')
->join('tbl_users', 'tbl_users.userId = ' . $this->table . '.created_by', 'left')
->join('t_employee_details', 'tbl_users.EmpID = t_employee_details.EmpID', 'left')
->join('ip_invoices', 'ip_invoices.invoice_number = ' . $this->table . '.invoice_number', 'left')
@ -60,6 +60,7 @@ class Driver_model extends Model
->where($this->table.'.date BETWEEN "'.$from.'" AND "'.$to.'"')
->where($this->table . '.driver_id', $driver_id)
->where($this->table . '.isactive', 1)
->where('driver.is_driver', 1)
->findAll();
}
@ -71,17 +72,24 @@ class Driver_model extends Model
return $query->getResult();
}
function getDriverName($id)
function getDriverName($id,$flag)
{
$builder = $this->db->table('t_driver')
->select('driver_name')
->where('driver_id', $id);
$builder = $this->db->table('t_employee_details')
->select('CONCAT_WS(" ", t_employee_details.FirstName, t_employee_details.LastName) as driver_name,is_driver')
->where('EmpID', $id);
$query = $builder->get()->getRow();
$driver_name = $query ? $query->driver_name : null;
return $driver_name;
if ($flag == 0){
$driver_name = $query ? $query->driver_name : null;
return $driver_name;
}
if ($flag == 1){
$is_driver = $query ? $query->is_driver : null;
return $is_driver;
}
return null;
}
function gatheredCustAndQty($invoice){
@ -92,20 +100,30 @@ class Driver_model extends Model
$query = $builder->get();
return $query->getRowArray() ?: [];
}
function driverAttendanceForMonthlyPayInputs($from,$to){
$builder = $this->db->table('t_driver_attendance')
->select('t_driver_attendance.driver_id,SUM(t_driver_attendance.salary_amount) as driver_monthly_salary_amount,SUM(t_driver_attendance.food_amount) as driver_monthly_food_amount,t_driver.driver_name,
DATE_FORMAT(date, "%M-%Y") AS month_year,SUM(salary_amount + food_amount) AS driver_earnings_amount,COUNT(t_driver_attendance.load_type) AS no_of_loads')
->join('t_driver', 't_driver.driver_id = t_driver_attendance.driver_id and t_driver.isactive = 1', 'left')
->select('t_driver_attendance.driver_id,driver_details.FirstName as driver_name,driver_details.is_driver,COUNT(DISTINCT t_driver_attendance.date) AS unique_days,
DATE_FORMAT(date, "%M-%Y") AS month_year,COUNT(t_driver_attendance.load_type) AS no_of_loads,driver_details.*,t_emp_pay_data.PF_Rate,t_emp_pay_data.ESI_Rate')
->select('SUM(t_driver_attendance.salary_amount) as monthly_salary_amount,
SUM(t_driver_attendance.food_amount) as monthly_food_amount,
diesel_amount,shed_amount,CONCAT_WS(" ", driver_details.FirstName, driver_details.LastName) AS FullName')
->select('t_loan_master.Loan_ID,Loan_Amount,Loan_Issued_Date,Monthly_Due,Due_Start_Date as DueDate,No_of_Dues,Paid_Due,Remaining_Due,Paid_Amount,t_loan_history.Balance_Amount, t_driver_monthly_pay_inputs.Loan_Recovered')
->join('t_employee_details as driver_details', 'driver_details.EmpID = t_driver_attendance.driver_id', 'left')
->join('t_emp_pay_data','t_emp_pay_data.EmpID=driver_details.EmpID','Left')
->join('t_loan_master','t_loan_master.EmpID = driver_details.EmpID','Left')
->join('t_loan_history','t_loan_history.Loan_ID = t_loan_master.Loan_ID','Left')
->join('t_driver_monthly_pay_inputs','t_driver_monthly_pay_inputs.driver_id = driver_details.EmpID','Left')
->where('t_driver_attendance.date BETWEEN "'.$from.'" AND "'.$to.'"')
->groupBy('t_driver.driver_id, DATE_FORMAT(t_driver_attendance.date, "%M-%Y")');
->groupBy('DATE_FORMAT(t_driver_attendance.date, "%M-%Y"),t_driver_attendance.driver_id');
$query = $builder->get();
// $last_query = $this->db->getLastQuery();
// echo $last_query;die;
return $query->getResult();
}
function driverMonthlyPayInputs($monthYear){
$builder = $this->db->table('t_driver_monthly_pay_inputs');
@ -142,13 +160,13 @@ class Driver_model extends Model
if ($count == 0) {
unset($data['updated_by']);
unset($data['updated_by']);// we need createdby. thats why updatedby unset
$builder = $this->db->table('t_driver_monthly_pay_inputs');
$builder->insert($data);
$i = $this->db->affectedRows();
return $i;
} elseif ($count == 1) {
unset($data['created_by']);
unset($data['created_by']); // we need updatedby. thats why createdby unset
$this->db->table('t_driver_monthly_pay_inputs')
->where('driver_id', $data['driver_id'])
->where('month_year', $data['month_year'])
@ -158,7 +176,21 @@ class Driver_model extends Model
return $i;
}
}
function updateDieselAndShedValuesBasedonEmpID($where_arr,$data){
$this->db->table('t_driver_attendance')
->where($where_arr)
->update($data);
$i = $this->db->affectedRows();
return $i;
}
public function getDriverAttendanceTable($input_driver_id,$monthyear){
$builder = $this->db->table('t_driver_attendance')
->where('DATE_FORMAT(`t_driver_attendance`.`date`, "%Y-%m")',$monthyear)
->where('t_driver_attendance.driver_id',$input_driver_id);
$query = $builder->get()->getRow();
// $last_query = $this->db->getLastQuery();
return $query;
}
function getPayOn()
{
$builder = $this->db->table('t_driver_monthly_pay_inputs')
@ -171,8 +203,8 @@ class Driver_model extends Model
function getDriverlist2($Payon = '')
{
$builder = $this->db->table('t_driver_monthly_pay_inputs Pay')
->select('Pay.driver_id as driver_id,driver.driver_name as name')
->join('t_driver driver', 'Pay.driver_id = driver.driver_id');
->select('Pay.driver_id,driver.EmpID as EmpId,CONCAT_WS(" ", driver.FirstName, driver.LastName) AS FullName')
->join('t_employee_details as driver', 'driver.EmpID = Pay.driver_id and driver.is_driver = 1', 'left');
if ($Payon != '') {
$builder->where('Pay.month_year', $Payon);
}
@ -196,14 +228,32 @@ class Driver_model extends Model
function getMonthlyPayDetails($driver_id, $PayOn)
{
$builder = $this->db->table('t_driver_monthly_pay_inputs MonthlyPay ')
->select('MonthlyPay.*')
->select('CONCAT_WS(" ", driver.FirstName, driver.LastName) AS FullName')
->select('MonthlyPay.*,driver.BankAccountNo , driver.PFNO , driver.ESI as ESINO , L.Loan_ID, L.Loan_Amount, L.Loan_Issued_Date, L.Monthly_Due, L.Due_Start_Date, L.No_of_Dues, L.Paid_Due, L.Remaining_Due, L.Paid_Amount')
->join('t_employee_details as driver', 'driver.EmpID = MonthlyPay.driver_id and driver.is_driver = 1', 'left')
->join('t_loan_master as L', 'MonthlyPay.driver_id = L.EmpID and L.is_Active = 1', 'left')
->where('MonthlyPay.driver_id', $driver_id)
->where('MonthlyPay.month_year', $PayOn);
$query = $builder->get();
return $query->getResult();
}
function insertLoanHistory($data)
{
$builder = $this->db->table('t_loan_history');
$builder->insert($data);
$count = $this->db->affectedRows();
return $count;
}
function updateLoan($LoanID,$EmpID,$data)
{
$builder = $this->db->table('t_loan_master')
->where('Loan_ID', $LoanID)
->where('EmpID', $EmpID)
->update($data);
$count = $this->db->affectedRows();
return $count;
}
function insertPayroll($data)
{
$builder = $this->db->table('t_driver_payroll');
@ -230,8 +280,17 @@ class Driver_model extends Model
function GetPayslipdata($PayOn = '', $EmpId = '')
{
//echo "FROM MODEL" . $PayOn . $EmpId;
$builder = $this->db->table('t_driver_payroll Pay')->select('Pay.*,driver.driver_name as name ')
->join('t_driver driver', 'Pay.driver_id = driver.driver_id');
$builder = $this->db->table('t_driver_payroll Pay')->select('Pay.*')
->select('Emp.EmpID,CONCAT_WS(" ", Emp.FirstName, Emp.LastName) as driver_name,Emp.DateofBirth as Dob,Emp.PANNo as Pan,Emp.BankBranchName as BankName,Emp.BankAccountNo as BankAccountNumber,Emp.IFSCCode as IFSCCode,Emp.DateofJoining as DOJ,Emp.AadharNo,Emp.Designation as Designation,Dep.DepartmentName as DeptName,Emp.esi_applicable,Emp.pf_applicable')
->select('t_emp_pay_data.PF_Rate,t_emp_pay_data.ESI_Rate')
->select('month.Festival_Bonus,month.HRA,month.Loan_Recovered,month.total_diesel_amount,month.total_shed_amount')
// ->select('month.monthly_salary_amount,month.monthly_food_amount,month.Festival_Bonus,month.final_payment,month.HRA,month.ESI,month.PF,month.Loan_Recovered,month.total_diesel_amount,month.total_shed_amount')
->join('t_employee_details Emp', 'Pay.driver_id = Emp.EmpID')
->join('t_departmentdetails Dep', 'Emp.Departmentcode = Dep.DEPCode')
->join('t_emp_pay_data','t_emp_pay_data.EmpID=Emp.EmpID','Left')
->join('t_driver_monthly_pay_inputs month', 'month.driver_id = Emp.EmpID');
if ($PayOn != '') {
$builder->where('Pay.PayOn', $PayOn);
}

View File

@ -172,6 +172,17 @@ class Employeedetails_model extends Model
return $query;
}
function checkMobileExists($ContactNumber= '', $Empid = ''){
$builder = $this->db->table('t_employee_details')->select('ContactNumber')
->where('ContactNumber', $ContactNumber);
if ($Empid != '') {
$builder->where('EmpID !=', $Empid);
}
$query = $builder->get();
return $query;
}
function checkAadharExists($aadharNo, $Empid = '')
{

View File

@ -409,6 +409,7 @@ class Inwardgateregister_model extends Model
LEFT JOIN t_purchaseorder_lineitem POL ON PONO = POL.PONO AND IGRD.MaterialCode = POL.MaterialCode
LEFT JOIN t_revenue_tax tax ON tax.LineItemNo = POL.LineItemNo
WHERE IGRD.IGRNO = igr.IGRNO AND IGRD.QuantityAsPerInvoice != 0
GROUP BY POL.PONO
LIMIT 1
)
WHEN (PO.POType = 'service' OR (PO.POType = 'capital' AND PO.CapitalRange = '1')) THEN (
@ -420,6 +421,7 @@ class Inwardgateregister_model extends Model
LEFT JOIN t_purchaseorder_lineitem POL ON PONO = POL.PONO AND IGRD.MaterialCode = POL.MaterialCode
LEFT JOIN t_service_tax tax ON tax.LineItemNo = POL.LineItemNo
WHERE IGRD.IGRNO = igr.IGRNO AND IGRD.QuantityAsPerInvoice != 0
GROUP BY POL.PONO
LIMIT 1
)
@ -1348,6 +1350,16 @@ $builder = $this->db->table('t_igr_history')
return $result;
}
public function get_status($value){
$builder = $this->db->table('t_status')
->select('StatusCode,StatusName')
->where('StatusCode', $value);
$query = $builder->get()->getRow();
$StatusName = $query ? $query->StatusName : null;
return $StatusName;
}
}

View File

@ -4,6 +4,7 @@ namespace App\Models;
use CodeIgniter\Model;
class Ipinvoice_model extends Model
{
@ -23,7 +24,7 @@ class Ipinvoice_model extends Model
ip_invoices.invoice_number, ip_invoices.invoice_terms, ip_invoices.status, ip_invoices.e_invoice_number, ip_invoices.invoice_url, ip_clients.client_name,
ip_payment_methods.payment_method_name, ip_users.user_name,
ip_products.product_name, ip_invoice_items.item_price, ip_products.cgst, ip_products.sgst,
ip_invoice_items.item_quantity, ip_invoice_items.item_price, ip_invoice_items.item_name, ip_invoice_items.item_quantity,
ip_invoice_items.item_quantity, ip_invoice_items.item_price, ip_invoice_items.item_name, ip_invoice_items.item_quantity,ip_invoice_items.hsn_or_sac,
ip_invoice_amounts.invoice_total, ip_invoice_amounts.invoice_item_subtotal, ip_invoice_amounts.invoice_item_tax_total
,ip_invoice_attachment.file_name , ip_invoices.received_qty')
->join('ip_payment_methods', 'ip_invoices.payment_method = ip_payment_methods.payment_method_id', 'left')
@ -41,47 +42,100 @@ class Ipinvoice_model extends Model
$result = $query->getResult();
// $results = $query->getResultArray();
return $result;
// $invoices = [];
// foreach ($results as $row) {
// $invoice_id = $row['invoice_id'];
// // If the invoice_id doesn't exist in the $invoices array, initialize it
// if (!isset($invoices[$invoice_id])) {
// $invoices[$invoice_id] = [
// 'invoice_id' => $row['invoice_id'],
// 'user_id' => $row['user_id'],
// 'client_id' => $row['client_id'],
// 'invoice_group_id' => $row['invoice_group_id'],
// 'invoice_status_id' => $row['invoice_status_id'],
// 'invoice_date_due' => $row['invoice_date_due'],
// 'invoice_date_created' => $row['invoice_date_created'],
// 'invoice_number' => $row['invoice_number'],
// 'invoice_terms' => $row['invoice_terms'],
// 'status' => $row['status'],
// 'e_invoice_number' => $row['e_invoice_number'],
// 'invoice_url' => $row['invoice_url'],
// 'client_name' => $row['client_name'],
// 'payment_method_name' => $row['payment_method_name'],
// 'user_name' => $row['user_name'],
// 'invoice_total' => $row['invoice_total'],
// 'invoice_item_subtotal' => $row['invoice_item_subtotal'],
// 'invoice_item_tax_total' => $row['invoice_item_tax_total'],
// 'products' => [] // Initialize the products array
// ];
// }
// // Add the product to the products array for the current invoice
// $invoices[$invoice_id]['products'][] = [
// 'product_name' => $row['product_name'],
// 'item_quantity' => $row['item_quantity'],
// 'item_price' => $row['item_price'],
// ];
// }
// // Return the grouped invoices
// return $invoices;
}
function getHsn()
{
return $this->db->table('ip_invoice_items')
->select('hsn_or_sac')
->distinct()
->get()
->getResult();
}
function getProducts()
{
return $this->db->table('ip_products')
->select('product_id,product_name')
->distinct()
->get()
->getResult();
}
function getProductName($id)
{
return $this->db->table('ip_products')
->select('product_id,product_name')
->where('product_id',$id)
->get()->getRow()->product_name;
}
function getClientName($id)
{
return $this->db->table('ip_clients')
->select('client_id,client_name')
->where('client_id',$id)
->get()->getRow()->client_name;
}
function getClients()
{
return $this->db->table('ip_clients')
->select('client_id,client_name')
->distinct()
->get()
->getResult();
}
public function sales_report($from_date, $to_date, $hsn_number, $product_id, $client_id)
{
$builder = $this->db->table('ip_invoices')
->select('ip_invoices.invoice_id, ip_invoices.user_id, ip_invoices.client_id,
ip_invoices.invoice_group_id, ip_invoices.invoice_status_id, ip_invoices.invoice_date_due, ip_invoices.invoice_date_created,
ip_invoices.invoice_number, ip_invoices.invoice_terms, ip_invoices.status, ip_invoices.e_invoice_number, ip_invoices.invoice_url, ip_clients.client_name,
ip_payment_methods.payment_method_name, ip_users.user_name,
ip_products.product_name, ip_invoice_items.item_price, ip_products.cgst, ip_products.sgst,
ip_invoice_items.item_quantity, ip_invoice_items.item_price, ip_invoice_items.item_name, ip_invoice_items.item_quantity,ip_invoice_items.hsn_or_sac,
ip_invoice_amounts.invoice_total, ip_invoice_amounts.invoice_item_subtotal, ip_invoice_amounts.invoice_item_tax_total,
ip_invoice_attachment.file_name, ip_invoices.received_qty')
->join('ip_payment_methods', 'ip_invoices.payment_method = ip_payment_methods.payment_method_id', 'left')
->join('ip_clients', 'ip_invoices.client_id = ip_clients.client_id', 'left')
->join('ip_users', 'ip_invoices.user_id = ip_users.user_id', 'left')
->join('ip_invoice_items', 'ip_invoices.invoice_id = ip_invoice_items.invoice_id', 'left')
->join('ip_products', 'ip_invoice_items.item_product_id = ip_products.product_id', 'left')
->join('ip_invoice_amounts', 'ip_invoices.invoice_id = ip_invoice_amounts.invoice_id', 'left')
->join('ip_invoice_attachment', 'ip_invoices.invoice_id = ip_invoice_attachment.invoice_id AND ip_invoice_attachment.is_active = 1', 'left');
// Apply filters only if values are provided
if (!empty($from_date) && !empty($to_date)) {
$from_date = get_date_time_dynamical_format('d-m-Y', 'Y-m-d', $from_date);
$to_date = get_date_time_dynamical_format('d-m-Y', 'Y-m-d', $to_date);
$builder->where('ip_invoices.invoice_date_created >=', $from_date);
$builder->where('ip_invoices.invoice_date_created <=', $to_date);
}
if (!empty($hsn_number)) {
$builder->where('ip_invoice_items.hsn_or_sac', $hsn_number);
}
if (!empty($product_id)) {
$builder->where('ip_invoice_items.item_product_id', $product_id);
}
if (!empty($client_id)) {
$builder->where('ip_invoices.client_id', $client_id);
}
// Order by invoice number in descending order
$builder->orderBy('ip_invoices.invoice_number', 'DESC');
$query = $builder->get();
return $query->getResult();
}

View File

@ -39,12 +39,12 @@ class Monthlypay_model extends Model
// $this->db->where('t_employee_details.DateofJoining <=',$lastdate);
// $this->db->where('Month_Year',$current);
$sql = "select t_monthly_pay_inputs.*,t_employee_details.FirstName,t_employee_details.LastName,t_loan_master.Loan_ID,t_loan_master.Monthly_Due,t_payroll.Id
$sql = "select t_monthly_pay_inputs.*,t_employee_details.FirstName,t_employee_details.LastName,t_loan_master.Loan_ID,t_loan_master.Monthly_Due,t_payroll.Id,t_employee_details.is_driver
from t_monthly_pay_inputs
left join t_employee_details on t_monthly_pay_inputs.EmpID=t_employee_details.EmpID and t_employee_details.DateofJoining <= ?
left join t_payroll on t_monthly_pay_inputs.EmpID=t_payroll.EmpID
left join t_loan_master on t_monthly_pay_inputs.EmpID=t_loan_master.EmpID and t_loan_master.is_Active = 1
where Month_Year = ?
where t_employee_details.is_driver = 0 and Month_Year = ?
order by t_employee_details.EmpID asc";
$query = $this->db->query($sql, array($lastdate, $current));
@ -64,9 +64,10 @@ class Monthlypay_model extends Model
//$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')
->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.DateofJoining <=', $lastdate)
->orderBy('EmpID', 'asc');
$query = $builder->get();
@ -100,7 +101,7 @@ class Monthlypay_model extends Model
//echo $lastdate;
//left join t_payroll on t_employee_details.EmpID = t_payroll.EmpID and month(t_payroll.PayOn) = month(?) and year(t_payroll.PayOn) = year(?)
$sql = "select t_emp_pay_data.EmpID,t_emp_pay_data.*,t_employee_details.FirstName,t_employee_details.DateofJoining,t_employee_details.Designation,t_employee_details.esi_applicable,t_employee_details.pf_applicable,t_employee_details.is_management_team,t_attendance.Days_Worked as Days_worked,t_attendance.Absent as LOP_Days,t_attendance.Paid_Leave as Paid_leave,t_attendance.Total_OTHrs as OT_Hrs_Worked,t_attendance.NoofDays,t_attendance.sunday_count,t_loan_master.Loan_ID,t_loan_master.Monthly_Due,t_loan_master.Due_Start_Date as DueDate,t_loan_master.Loan_Amount,t_loan_master.Paid_Amount,t_payroll.Id,t_monthly_pay_inputs.Loan_Recovered,t_monthly_pay_inputs.Estimate,t_monthly_pay_inputs.Festival_Bonus,t_monthly_pay_inputs.Other_Deductions,t_loan_history .Balance_Amount
$sql = "select t_emp_pay_data.EmpID,t_emp_pay_data.*,t_employee_details.FirstName,t_employee_details.DateofJoining,t_employee_details.Designation,t_employee_details.esi_applicable,t_employee_details.pf_applicable,t_employee_details.is_management_team,t_attendance.Days_Worked as Days_worked,t_attendance.Absent as LOP_Days,t_attendance.Paid_Leave as Paid_leave,t_attendance.Total_OTHrs as OT_Hrs_Worked,t_attendance.NoofDays,t_attendance.sunday_count,t_loan_master.Loan_ID,t_loan_master.Monthly_Due,t_loan_master.Due_Start_Date as DueDate,t_loan_master.Loan_Amount,t_loan_master.Paid_Amount,t_payroll.Id,t_monthly_pay_inputs.Loan_Recovered,t_monthly_pay_inputs.Estimate,t_monthly_pay_inputs.Festival_Bonus,t_monthly_pay_inputs.Other_Deductions,t_loan_history .Balance_Amount,t_employee_details.is_driver
from t_emp_pay_data
left join t_employee_details on t_employee_details.EmpID = t_emp_pay_data.EmpID
left join t_payroll on t_employee_details.EmpID = t_payroll.EmpID and t_payroll.PayOn = ?
@ -110,6 +111,7 @@ class Monthlypay_model extends Model
left join t_loan_history on t_loan_history .Loan_ID = t_loan_master.Loan_ID
where t_employee_details.DateofJoining <= ?
and month(t_attendance.Month_Year) = month(?) and year(t_attendance.Month_Year) = year(?)
and t_employee_details.is_driver = 0
order by t_employee_details.EmpID";
$query = $this->db->query($sql, array($month, $month, $lastdate, $current, $current));
@ -183,6 +185,7 @@ class Monthlypay_model extends Model
// ->where('month(t_employee_details.DateofJoining) <= ',$month_val)
->where('t_employee_details.DateofJoining <= ', $lastdate)
->where('Month_Year', $current)
->where('t_employee_details.is_driver', 0)
// ->where('t_employee_details.IsActive',1)
->orderBy('t_attendance.EmpID', 'asc');
$query = $builder->get();

View File

@ -331,9 +331,10 @@ class Payroll_model extends Model
function getEmployeelist2($Payon = '')
{
// CONCAT_WS(' ', Emp.FirstName, Emp.LastName)
$builder = $this->db->table('t_monthly_pay_inputs Pay')
->select('Pay.EmpID as EmpId,Emp.FirstName as Fname,Emp.LastName as Lname')
->join('t_employee_details Emp', 'Pay.EmpID = Emp.EmpID');
->select('Pay.EmpID as EmpId,CONCAT_WS(" ",Emp.FirstName,Emp.LastName) AS FullName')
->join('t_employee_details Emp', 'Pay.EmpID = Emp.EmpID and Emp.is_driver = 0');
if ($Payon != '') {
$builder->where('Pay.Month_Year', $Payon);
}

View File

@ -2558,6 +2558,34 @@ mstr.CourierNo,pom.Status,pom.POType') //,bill.BillNo,bill.FilePath,
return $query->getResultArray();
}
function materialRate($materialcode){
$builder = $this->db->table('t_materialmaster')
->select('t_materialmaster.material_rate')
->where('t_materialmaster.MaterialCode', $materialcode);
$query = $builder->get()->getRow();
$material_rate = $query ? $query->material_rate : 0;
return $material_rate;
}
public function updateMaterialRate($code, $incoming_rate)
{
$default_rate = $this->materialRate($code);
if ($incoming_rate == $default_rate) {
return 1;
} else {
$this->db->table('t_materialmaster')
->where('MaterialCode', $code)
->set('material_rate', $incoming_rate)
->update();
return $this->db->affectedRows();
}
}
function lastPONO()
{

View File

@ -175,7 +175,7 @@ class Requistion_model extends Model
function GetMaterialCode($ReqType,$NotArray='')
{
$builder = $this->db->table('t_materialmaster')
->select('MaterialCode, MaterialName,UOM')
->select('MaterialCode, MaterialName,UOM,material_rate')
->where('IsActive',1);
//->where('MaterialType',$ReqType );

View File

@ -1229,22 +1229,25 @@ if (!empty($getlogpodtl)) {
</div>
</div>
<div class="form-row">
<div class="table-responsive table-bordered" style="padding-bottom: 30px;">
<table id="ServiceTable" class="table table-striped table-hover mb-0" style="font-size:12px;">
<div class="table-responsive" style="padding-bottom: 30px;">
<table id="ServiceTable" class="table table-bordered table-hover mb-0"
style="font-size:12px;">
<thead>
<tr>
<th style="text-align:center !important;">SNo</th>
<th style="text-align:center !important;">Requisition No</th>
<th style="text-align:center !important;">Item Code</th>
<th>Item Name</th>
<th>Line Item Specs</th>
<th style="text-align: center;">Quantity</th>
<th>UOM</th>
<th style="text-align: right;">Rate <?php echo "($INRSYM)" ?></th>
<th style="text-align: right;">Basic Amount <?php echo "($INRSYM)" ?></th>
<th style="text-align: right;">Tax Amount <?php echo "($INRSYM)" ?></th>
<th style="text-align: right;">Total Order Amount <?php echo "($INRSYM)" ?></th>
<th style="text-align:left !important; white-space: nowrap !important;">SNo</th>
<th style="text-align:center !important; white-space: nowrap !important;">Requisition No</th>
<th style="text-align:left !important; white-space: nowrap !important;">Item Code</th>
<th style="white-space: nowrap !important;">Item Description</th>
<th style="white-space: nowrap !important;">Line Item Specs</th>
<th style="text-align: left; white-space: nowrap !important;">Quantity</th>
<th style="white-space: nowrap !important;">UOM</th>
<th style="text-align: right; white-space: nowrap !important;">Rate <?php echo "($INRSYM)" ?></th>
<th style="text-align: right; white-space: nowrap !important;">Basic Amount <?php echo "($INRSYM)" ?></th>
<th style="text-align: right; white-space: nowrap !important;">Tax Amount <?php echo "($INRSYM)" ?></th>
<th style="text-align: right; white-space: nowrap !important;">Total Order Amount <?php echo "($INRSYM)" ?></th>
<th>Action</th>
</tr>
</thead>
@ -1268,12 +1271,11 @@ if (!empty($getlogpodtl)) {
?>
<tr id="<?php echo $index; ?>">
<td align="center"><?php echo $index; ?></td>
<td align="center"><?php echo $record->ReqNo ?></td>
<td align="center"><?php echo $record->MaterialCode ?></td>
<td><?php echo $record->MaterialName ?></td>
<td>
<?php if ($PONOStatus === PO_DRAFT || $PONOStatus === PO_CREATED) { ?>
<td style="text-align:left !important;"><?php echo $index; ?></td>
<td style="text-align:center !important;"><?php echo $record->ReqNo ?></td>
<td style="text-align:left !important;"><?php echo $record->MaterialCode ?></td>
<td style="text-align:left !important;"><?php $shortName = mb_strimwidth($record->MaterialName, 0, 13, "..."); echo $shortName; ?></td>
<td style="text-align:left !important;"><?php if ($PONOStatus === PO_DRAFT || $PONOStatus === PO_CREATED) { ?>
<a href="#"
class="editable-field"
data-id ="<?php echo $index ?>" data-notes="<?php echo $record->LineitemAuditorNotes; ?>">
@ -1284,17 +1286,16 @@ if (!empty($getlogpodtl)) {
<button class="save-btn"></button>
<button class="cancel-btn"></button>
</div>
<?php }else{ echo !empty($record->LineitemAuditorNotes) ? $record->LineitemAuditorNotes : "-"; } ?>
</td>
<td align="center"><?php echo $record->Quantity ?></td>
<?php }else{ echo !empty($record->LineitemAuditorNotes) ? $record->LineitemAuditorNotes : "-"; } ?></td>
<td style="text-align:left !important;"><?php echo $record->Quantity ?></td>
<td><?php echo $record->UOM ?></td>
<td align="right"><?php echo $record->Rate ?></td>
<td style="text-align:right !important;"><?php echo $record->Rate ?></td>
<td align="right"><?php echo number_format($record->BasicValue * $FrequencyNo, 2, '.', ''); ?></td>
<td style="text-align:right !important;"><?php echo number_format($record->BasicValue * $FrequencyNo, 2, '.', ''); ?></td>
<td align="right"><?php echo $record->Taxamount ?></td>
<td align="right"><?php echo $record->TotalValue ?></td>
<td style="text-align:right !important;"><?php echo $record->Taxamount ?></td>
<td style="text-align:right !important;"><?php echo $record->TotalValue ?></td>
<!-- <td align="right"><?php echo $record->Quantity ?></td>
<td align="right"><?php echo $record->ReceivedQuantity ?></td>
<td align="right"><?php echo number_format($record->Quantity - $record->ReceivedQuantity, 2, '.', ''); ?></td> -->
@ -2610,12 +2611,13 @@ if (!empty($getlogpodtl)) {
// TotalValue: TotalOrderValue
// }));
PONOStatus = <?php echo $PONOStatus; ?>
var shorten = materialName.length > 13 ? materialName.slice(0, 13) + "..." : materialName;
var rowHtml = `
<tr id="${temp}">
<td align="left">${temp}</td>
<td align="left">${Reqnumber}</td>
<td align="left">${materialCode}</td>
<td align="left">${materialName}</td>`;
<td align="left">${shorten}</td>`;
if (PONOStatus === "PO_DRAFT" || PONOStatus === "PO_CREATED") {
rowHtml += `<td><a href="#" class="editable-field"
data-id="${temp}"
@ -2991,15 +2993,8 @@ if (!empty($getlogpodtl)) {
type: "POST",
url: "<?php echo base_url() ?>purchaseorder/DeletePODetails",
success: function(data) {
if (data) {
$('#loader').hide();
alert(data);
} else {
$('#loader').hide();
alert("Error");
}
$('#loader').hide();
(data) ? alert(response) : alert("Error");
}
});
}
@ -3168,29 +3163,31 @@ if (!empty($getlogpodtl)) {
var txtTotalOrderValueSummary = $('#txtTotBasicAmount').val();
if (validate()) {
if (document.getElementById('ServiceTable').rows.length < 2)
{
alert('Please Select Line item to Create PO');
$('#Deliverydt').focus();
return false;
}
if (serviceValidate()) {
// if (document.getElementById('ServiceTable').rows.length < 2)
// {
// alert('Please Select Line item to Create PO');
// $('#Deliverydt').focus();
// return false;
// }
// else if(parseInt(AvlBudAmt) < parseInt(txtTotalOrderValueSummary)) {
// alert('Total Order Amount is exceeding the Budget Limit.Please adjust the product value.');
// return false;
// }
else if ($('#Otherpayment').val() == '' && $('#PaymentTerms').val() == 'PT08') {
alert('Please Enter Payable Terms');
$('#Otherpayment').focus();
return false;
} else if ($('#editdescofpo').val().trim() == '') {
alert('Please Enter Description Of Service');
$('#editdescofpo').focus();
return false;
} else {
// else if ($('#Otherpayment').val() == '' && $('#PaymentTerms').val() == 'PT08') {
// alert('Please Enter Payable Terms');
// $('#Otherpayment').focus();
// return false;
// } else if ($('#editdescofpo').val().trim() == '') {
// alert('Please Enter Description Of Service');
// $('#editdescofpo').focus();
// return false;
// } else {
// $('#content').loader('show');
var formData = new FormData($('.ServicePO')[0]);
$('#loader').show();
// disableButtons();
$.ajax({
// data: $('.ServicePO').serialize(),
type: "POST",
@ -3218,16 +3215,22 @@ if (!empty($getlogpodtl)) {
$('#SpcialInstruction').val('');
$('#txtDeliveryAddress').val('')
window.location = "purchaseorderListing";
// setTimeout(function() { enableButtons(); }, 2000);
} else {
$('#loader').hide();
// setTimeout(function() { enableButtons(); }, 2000);
alert("Error");
}
},
error: function(jqXHR, textStatus, errorThrown) {
console.error("AJAX Error: " + textStatus + ": " + errorThrown);
alert("Error: " + textStatus);
// setTimeout(function() { enableButtons(); }, 2000);
}
});
}
// }
}
}

View File

@ -93,41 +93,41 @@
var mindt = year - 70;
var maxdt = year - 15;
$("#Invoice_Date , #MaterialRcvdDate").datepicker({
minDate: new Date(year - SIAStartYear, 1, 1),
maxDate: 'now',
dateFormat: 'dd-mm-yy',
changeMonth: true,
changeYear: true,
yearRange: '-100:+0'
});
$('#Driver_Name').autocomplete({
// $("#Invoice_Date , #MaterialRcvdDate").datepicker({
// minDate: new Date(year - SIAStartYear, 1, 1),
// maxDate: 'now',
// dateFormat: 'dd-mm-yy',
// changeMonth: true,
// changeYear: true,
// yearRange: '-100:+0'
// });
// $('#Driver_Name').autocomplete({
onSearchStart: function(query) {
//alert(query);
$('#Driver_Name').autocomplete("option", "minLength", 0);
},
// onSearchStart: function(query) {
// //alert(query);
// $('#Driver_Name').autocomplete("option", "minLength", 0);
// },
serviceUrl: "<?php echo base_url(); ?>drivernameautocomplete",
onSelect: function(suggestion) {
var data = suggestion.DriverName;
// serviceUrl: "<?php echo base_url(); ?>drivernameautocomplete",
// onSelect: function(suggestion) {
// var data = suggestion.DriverName;
}
});
$('#DriverMobileNumber').autocomplete({
serviceUrl: "<?php echo base_url(); ?>drivermobileautocomplete",
params: {
driverName: function() {
return $('#Driver_Name').val(); // Pass the value of the DriverName input field
}
},
onSearchStart: function(query) {
$('#DriverMobileNumber').autocomplete("option", "minLength", 0);
},
onSelect: function(suggestion) {
var data = suggestion.DriverMobileNumber;
}
});
// }
// });
// $('#DriverMobileNumber').autocomplete({
// serviceUrl: "<?php echo base_url(); ?>drivermobileautocomplete",
// params: {
// driverName: function() {
// return $('#Driver_Name').val(); // Pass the value of the DriverName input field
// }
// },
// onSearchStart: function(query) {
// $('#DriverMobileNumber').autocomplete("option", "minLength", 0);
// },
// onSelect: function(suggestion) {
// var data = suggestion.DriverMobileNumber;
// }
// });
});
@ -219,8 +219,13 @@
<td><?php echo $record->SupplierName ?></td>
<td><?php echo $record->DeliveryChellanOrInvoiceNo ?></td>
<td align="right"><?php
$date = new DateTime($record->DeliveryChellanDate);
echo $date->format('d-m-Y'); ?></td>
$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>
@ -772,9 +777,11 @@
}
// Format dates
var dcd = new Date(item.DeliveryChellanDate);
var dcd2 = (String(dcd.getDate()).padStart(2, '0') + '-' + (String(dcd.getMonth() + 1).padStart(2, '0')) + '-' + dcd.getFullYear());
$("#Invoice_Date").val(dcd2);
if(item.DeliveryChellanDate !== '0000-00-00 00:00:00' ){
var dcd = new Date(item.DeliveryChellanDate);
var dcd2 = (String(dcd.getDate()).padStart(2, '0') + '-' + (String(dcd.getMonth() + 1).padStart(2, '0')) + '-' + dcd.getFullYear());
$("#Invoice_Date").val(dcd2);
}
console.log(item.MaterialRcvdDate)
var Mat_rcv_date = (item.MaterialRcvdDate == 'null') ? ' ' : formatDateTime(item.MaterialRcvdDate, 1);
$("#MaterialRcvdDate").val(Mat_rcv_date);
@ -1179,15 +1186,22 @@
});
function constructSentence(record) {
let str = record.field;
let fieldName = str.replace(/([a-z])([A-Z])/g, '$1 $2');
let sentence = record.FullName + ' on ' + formatDateTime(record.history_dated, 2) + " " + fieldName + " ";
// let str = record.field;
// let fieldName = str.replace(/([a-z])([A-Z])/g, '$1 $2');
let sentence = " ";
if (parseInt(record.is_add) === 1) {
sentence += record.new_data + " was added.";
sentence += record.IGR_No + " was Created by "+record.FullName+ " on "+record.indian_date+" at "+record.indian_time;
} else if (parseInt(record.is_edit) === 1) {
sentence += record.old_data + " was updated into " + record.new_data + ".";
let str = record.field;
if (str !== "UpdateBY" && str !== "MaterialRcvdDate" && str !== "DeliveryChellanDate") {
let fieldName = str.replace(/([a-z])([A-Z])/g, '$1 $2');
sentence += ((record.IGRItem_No) ? record.MaterialName+" ( "+ record.MaterialCode + " ) - " : "")+fieldName+" "+record.old_data + " was Updated into " + record.new_data + " by "+record.FullName+ " on "+record.indian_date+" at "+record.indian_time;
}
} else if (parseInt(record.is_delete) === 1) {
sentence += record.new_data + " was deleted.";
let str = record.field;
let fieldName = str.replace(/([a-z])([A-Z])/g, '$1 $2');
sentence += fieldName+" "+record.new_data + " was deleted by "+record.FullName+ " on "+record.indian_date+" at "+record.indian_time;
}
return sentence;
}
@ -1396,6 +1410,7 @@
</script>
<script>
function formatDateTime(dateString, flag) {
console.log("ff",dateString);
// Note 1 means DATE only
// 2 means DATE and Time
// Check if the date string is null or empty

View File

@ -6,6 +6,13 @@
label {
font-style: bold;
}
input[type="file"] {
white-space: normal;
word-wrap: break-word;
overflow-wrap: break-word;
width: 100%;
}
</style>
<script>
$(document).ready(function() {
@ -1085,12 +1092,12 @@
<div class="row">
<div class="col-md-4"></div>
<div class="col-md-4">
<label>Bank PassBok Name</label>
<label>Bank Passbook Name</label>
<input type="text" id="file_name" name="file_name4" maxlength="255"
class="form-control" value="Bank Passbook" readonly>
</div>
<div class="col-md-4">
<label>Select Bank PassBok File</label><br>
<label>Select Bank Passbook File</label><br>
<input type="file" name="emp_file4" class="">
</div>
</div>
@ -1242,7 +1249,7 @@
return false;
}
if ($('#ContactNumber').val().length < 1) {
alert('Please Enter Contact Number');
alert('Please Enter Contact Number');
return false;
} else if (!getMobileValidation()) {
return false;
@ -1382,6 +1389,49 @@
});
$('#ContactNumber').change(function() {
var ContactNumber = $('#ContactNumber').val();
if (getMobileValidation()) {
$('#loader').show();
$.ajax({
data: {
ContactNumber
},
type: "POST",
url: "<?php echo base_url(); ?>employeeMobileExist",
success: function(response) {
$('#loader').hide();
let responseCheck = response.data[0];
let responseContactNumber=response.data[0].ContactNumber;
if(responseCheck ){
if (responseContactNumber == ContactNumber) {
var answer = confirm(" Contact Number details is already exists !!.Kindly Provide us another Contact Number"
)
$('#ContactNumber').val('');
$('#ContactNumber').focus();
return false;
}
}
},
complete: function() {
$('#loader').hide(); // Ensure the loader is always hidden after the request completes
}
});
}
});
$('#panno').change(function() {
var panNo = $('#panno').val();

View File

@ -11,11 +11,15 @@
$("#Date").datepicker({
//minDate :'now',
//maxDate : 'now',
dateFormat: 'dd-mm-yy',
format: 'dd-mm-yyyy',
changeMonth: true,
changeYear: true,
yearRange: '-100:+1'
yearRange: '-100:+1',
orientation: 'bottom',
autoclose: true,
autocomplete:'off'
});
});
</script>
<!-- <script type="text/javascript" src="<?php echo base_url(); ?>public/assets/Autocomplete/jquery.autocomplete.js"></script> -->
@ -49,7 +53,7 @@
<div class="form-row">
<div class=" col-md-3">
<label class="col-form-label" for="MaterialName">Material Name<span class="badge">*</span></label>
<input type="text" class="form-control required " required id="MaterialName" name="MaterialName" maxlength="255">
<input type="text" class="form-control required " required id="MaterialName" name="MaterialName" maxlength="255">
</div>
<div class=" col-md-3">
<label class="col-form-label" for="MaterialType">Material Type<span class="badge">*</span></label>
@ -66,11 +70,11 @@
?>
</select>
</div>
<div class=" col-md-3">
<label class="col-form-label" for="MatCate">Material Category
<span class="badge">*</span></label>
<!-- <i type="button" class="fe-plus-circle" id="addMaterialCaterogyModalButton"
<!-- <i type="button" class="fe-plus-circle" id="addMaterialCaterogyModalButton"
style="font-size: 16px; color:rgb(15, 155, 218);" data-toggle="modal" data-target="#addMaterialCaterogyModal"
title="Add Material Category">
</i> -->
@ -109,6 +113,10 @@
<label for="HSNcode">HSN code</label>
<input type="text" class="form-control" id="HSNcode" onkeypress="return isNumberKey(event)" name="HSNcode" maxlength="8">
</div>
<div class="col-md-3">
<label for="material_rate">Rate<span class="badge">*</span></label>
<input type="text" class="form-control" id="material_rate" onkeypress="return isNumberKey(event)" name="material_rate" required>
</div>
<div class="col-md-3">
<label for="OpeningStock">Opening Stock</label>
<input type="text" class="form-control" id="openstock" name="openstock" maxlength="255">
@ -116,23 +124,25 @@
<div class="col-md-3">
<label for="OpenStockDate">Open Stock Date</label>
<?php
$data = array('name' => 'Date', 'value' => set_value('Date'), 'id' => 'Date', 'class' => 'form-control', 'onkeypress' => 'return false;');
echo form_input($data);
$dt = new DateTime('now', new DateTimeZone('Asia/Kolkata'));
$formattedDate = $dt->format('d-m-Y');
$data = array('name' => 'Date', 'value' => set_value('Date', $formattedDate), 'id' => 'Date', 'class' => 'form-control', 'onkeypress' => 'return false;', 'autocomplete'=>'"off"');
echo form_input($data);
?>
</div>
</div>
<div class="form-row" style="margin-top:20px">
<div class="col-md-3">
<label for="ReorderLevel">Reorder Level</label>
<input type="text" class="form-control" id="reorder" name="reorder" maxlength="255">
</div>
</div>
<div class="form-row" style="margin-top:20px">
<div class="col-md-3">
<label for="Remarks">Remarks</label>
<input type="text" class="form-control" id="remarks" name="remarks" maxlength="255">
</div>
</div>
</div>
<div class="col-md-12 text-right">
@ -195,28 +205,28 @@
<!-- addMaterialCaterogyModal -->
<div class="modal fade" id="addMaterialCaterogyModal" tabindex="-1" aria-labelledby="addMaterialCaterogyModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="addMaterialCaterogyModalLabel">Add Material Category</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<form id="addMaterialCategoryForm">
<div class="form-group">
<label for="materialCategoryInput">Material Category</label>
<input type="text" class="form-control" id="materialCategoryInput" placeholder="Enter material category">
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
<button type="button" class="btn btn-primary" onclick="addMaterialCategory()">Save Category</button>
</div>
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="addMaterialCaterogyModalLabel">Add Material Category</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<form id="addMaterialCategoryForm">
<div class="form-group">
<label for="materialCategoryInput">Material Category</label>
<input type="text" class="form-control" id="materialCategoryInput" placeholder="Enter material category">
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
<button type="button" class="btn btn-primary" onclick="addMaterialCategory()">Save Category</button>
</div>
</div>
</div>
</div>
</div>
@ -298,7 +308,7 @@
let validation = Validate();
if(!validation){
if (!validation) {
return false;
}
@ -306,7 +316,7 @@
var materialCode = '';
var materialCategory = $('#MatCate').val();
var materialType = $('MaterialType').val();
if(materialName == ''){
if (materialName == '') {
return;
}
@ -314,45 +324,49 @@
$('#loader').show();
$.ajax({
data: {materialCode,materialName,materialCategory},
data: {
materialCode,
materialName,
materialCategory
},
type: "POST",
url: "<?php echo base_url(); ?>materialExist",
success: function(data) {
if (data && data.length >= 1) {
$('#loader').hide();
let message = "";
if (data[0]?.IsActive == 1) {
message = "Material name already exists!\n\n";
} else {
message = "Material name already exists in the deleted section!\n\n";
}
$('#loader').hide();
let message = "";
if (data[0]?.IsActive == 1) {
message = "Material name already exists!\n\n";
} else {
message = "Material name already exists in the deleted section!\n\n";
}
let related_name = "";
$.each(data, function(i, obj) {
related_name += obj.MaterialCode + " - " + obj.MaterialName + " - " + obj.MaterialType + " - " + obj.CategoryName + "\n";
});
let related_name = "";
$.each(data, function(i, obj) {
related_name += obj.MaterialCode + " - " + obj.MaterialName + " - " + obj.MaterialType + " - " + obj.CategoryName + "\n";
});
message += "'" + materialName + "' - related materials are:\n\n" + related_name;
message += "'" + materialName + "' - related materials are:\n\n" + related_name;
alert(message);
alert(message);
$("#MaterialName").val('');
$("#MaterialName").focus();
} else{
$("#MaterialName").val('');
$("#MaterialName").focus();
} else {
console.log("Material name is unique");
$('#loader').hide();
$('#addMaterialForm').submit();
}
},
error: function(error) {
$('#loader').hide();
alert("Error Occur" ,error);
alert("Error Occur", error);
},
complete: function(){
complete: function() {
$('#loader').hide();
console.log("Ajax completed..!!");
}
@ -360,35 +374,40 @@
});
function Validate() {
if ($("#MaterialName").val().length < 1) {
alert('Please Enter MaterialName');
$("#MaterialName").focus();
return false;
}
if ($("option:selected", $("#UOM")).val() == "") {
alert('Please Select UOM ');
$("#UOM").focus();
return false;
}
if ($("option:selected", $("#MaterialCategory")).val() == "") {
alert('Please Select Material Category');
$("#MaterialCategory").focus();
return false;
}
if ($("option:selected", $("#MaterialType")).val() == "") {
alert('Please Select Material Type');
$("#MaterialType").focus();
return false;
}
if ($("option:selected", $("#MatCate")).val() == "") {
alert('Please Select Material Category');
$("#MatCate").focus();
return false;
}
if ($("option:selected", $("#UOM")).val() == "") {
alert('Please Select UOM ');
$("#UOM").focus();
return false;
}
if ($("#material_rate").val().length < 1) {
alert('Please Enter Rate');
$("#material_rate").focus();
return false;
}
return true;
}
</script>
<script>
function addMaterialCategory (){
function addMaterialCategory() {
$('#materialCategoryInput').val()
@ -408,11 +427,9 @@
<script>
$(document).on('keydown', function(event) {
if (event.key === 'Enter') {
event.preventDefault(); // Prevent default Enter key behavior
}
});
$(document).on('keydown', function(event) {
if (event.key === 'Enter') {
event.preventDefault(); // Prevent default Enter key behavior
}
});
</script>

View File

@ -52,8 +52,8 @@
<input type="text" class="form-control required " readonly id="Designation" name="Designation" maxlength="128">
</div>
<div class="col-md-3">
<label for="Emailaddress">Email address</label><span class="badge">*</span>
<input type="text" class="form-control required " id="MailID" name="MailID" maxlength="128">
<label class="col-form-label" for="Emailaddress">Email address<span class="badge">*</span></label>
<input type="text" class="form-control required email" id="MailID" name="MailID" maxlength="128">
</div>
</div>
<div class="form-row" style="margin-top:20px">

View File

@ -244,8 +244,7 @@
$('#ConfigValue').show();
var temp = index;
var ConfigValue = $("#ConfigValue").val();
var ConfigValue = $.trim($("#ConfigValue").val());
$('#ConfigValue').val('');

View File

@ -1875,6 +1875,28 @@ if (!empty($INRSYMBOL)) {
} else if ($('#drpSupplier').val() == "0") {
alert('Please Select the Supplier details');
$('#drpSupplier').focus();
return false;
} else if (input == 'REVENUE' && $('#Deliverydate').val() == '' && radioValue == 0) {
alert('Please Select the Delivery Date');
$('#Deliverydate').focus();
return false;
} else if (input == 'REVENUE' && $('#Scheduleby').val().trim() == '' && radioValue == 1) {
alert('Please Enter the Schedule By');
$('#Scheduleby').focus();
return false;
} else if (input == 'SERVICE' && $('#Deliverydate').val() == '' && radioValue == 0) {
alert('Please Select the Delivery Date');
$('#Deliverydate').focus();
return false;
} else if (input == 'SERVICE' && $('#Scheduleby').val().trim() == '' && radioValue == 1) {
alert('Please Enter the Schedule By');
$('#Scheduleby').focus();
return false;
} else if ($('#DepartmentName').val() == "0") {
alert('Please Select Department Name ')
return false;
} else if ($('#CostCenterName').val() == "0") {
alert('Please Select Cost Center Name ')
return false;
} else if ($('#PoTypeOptions').val() == "0") {
@ -1891,40 +1913,19 @@ if (!empty($INRSYMBOL)) {
return false;
}
} else if ($('#DepartmentName').val() == "0") {
alert('Please Select Department Name ')
}else if ($('#Otherpayment').val() == '' && $('#PaymentTerms').val() == 'PT08') {
alert('Please Enter Payable Terms Description');
$('#Otherpayment').focus();
return false;
}else if($('#insuranceStatus').val() == "1" && $('#InsuranceNumber').val().trim() == ''){
alert('Please Enter the Insurance No / Insurance Details');
$('#InsuranceNumber').focus();
return false;
}
else if ($('#CostCenterName').val() == "0") {
alert('Please Select Cost Center Name ')
}
else if ($('#BudgetType').val() == "0") {
}else if ($('#BudgetType').val() == "0") {
alert('Please Select Budget Type');
$('#BudgetType').focus();
return false;
} else if (input == 'REVENUE' && $('#Deliverydate').val() == '' && radioValue == 0) {
alert('Please Select the Delivery Date');
$('#Deliverydate').focus();
return false;
} else if (input == 'REVENUE' && $('#Scheduleby').val().trim() == '' && radioValue == 1) {
alert('Please Enter the Schedule By');
$('#Scheduleby').focus();
return false;
}
else if ($('#Otherpayment').length > 0 && $('#Otherpayment').is(':visible') && $('#Otherpayment').val() == '') {
alert('Please Enter the Description of payable terms');
$('#Otherpayment').focus();
return false;
}
else {
} else {
$("#" + input).modal('show');
$('#isEdit').val(0);
if (StateTaxCheck == "0") {
@ -1955,12 +1956,14 @@ if (!empty($INRSYMBOL)) {
if (selectedMaterialCode == value.MaterialCode) {
$("#ServiceDescription").val(value.MaterialName);
$("#ServiceUOM").val(value.UOM);
$("#ServiceRate").val(value.material_rate);
if ($('#ScheduleType').val().trim() != 'Recurring') {
$('#FrequencyChange').val('One Time');
$('#ServiceNo').val(1);
} else {
$('#FrequencyChange').val($('#ScheduleType').val());
@ -2167,7 +2170,7 @@ if (!empty($INRSYMBOL)) {
if (selectedRevenueMaterialCode == value.MaterialCode) {
$("#ItemName").val(value.MaterialName);
$("#UOM").val(value.UOM);
$("#Rate").val(value.material_rate);
}
});
@ -2632,21 +2635,21 @@ if (!empty($INRSYMBOL)) {
<label>Purchase Order Date</label>
<div class="form-group">
<?php
$poDt = new DateTime('now', new DateTimeZone('Asia/Kolkata'));
$formattedDate = $poDt->format('Y-m-d');
$data = array(
'type' => 'date',
'name' => 'PODate',
'value' => set_value('PODate', $formattedDate),
'min' => $formattedDate,
'id' => 'PODate',
'class' => 'form-control',
'required' => 'true',
'onkeypress' => 'return false;'
);
echo form_input($data);
// $poDt = new DateTime('now', new DateTimeZone('Asia/Kolkata'));
// $formattedDate = $poDt->format('d-m-Y');
// $data = array(
// 'type' => 'text',
// 'name' => 'PODate',
// 'value' => set_value('PODate', $formattedDate),
// 'min' => $formattedDate,
// 'id' => 'PODate',
// 'class' => 'form-control num',
// 'required' => 'true',
// 'onkeypress' => 'return false;'
// );
// echo form_input($data);
?>
<input class="form-control num" data-provide="datepicker" data-date-format="dd-mm-yyyy" data-date-autoclose="true" id="PODate" name="PODate" data-date-start-date="<?= date('d-m-Y'); ?>" required autocomplete="off" value="<?= date('d-m-Y'); ?>">
</div>
</div>
<div class="col-md-3">
@ -2810,16 +2813,16 @@ if (!empty($INRSYMBOL)) {
style="background-color:#fff;">
<thead>
<tr>
<th>SNo</th>
<th>Requisition No</th>
<th>Item Code</th>
<th>Item Description</th>
<th>Quantity</th>
<th>UOM</th>
<th class="text-right">Rate<?php echo "($INRSYM)" ?></th>
<th class="text-right">Basic Amount<?php echo "($INRSYM)" ?></th>
<th class="text-right">Tax Amount<?php echo "($INRSYM)" ?></th>
<th class="text-right">Total Order Amount<?php echo "($INRSYM)" ?></th>
<th style="white-space: nowrap !important;">SNo</th>
<th style="white-space: nowrap !important; text-align:center !important">Requisition No</th>
<th style="white-space: nowrap !important;">Item Code</th>
<th style="white-space: nowrap !important;">Item Description</th>
<th style="white-space: nowrap !important;" class="text-right">Quantity</th>
<th style="white-space: nowrap !important;">UOM</th>
<th style="white-space: nowrap !important;" class="text-right">Rate<?php echo "($INRSYM)" ?></th>
<th style="white-space: nowrap !important;" class="text-right">Basic Amount<?php echo "($INRSYM)" ?></th>
<th style="white-space: nowrap !important;" class="text-right">Tax Amount<?php echo "($INRSYM)" ?></th>
<th style="white-space: nowrap !important;" class="text-right">Total Order Amount<?php echo "($INRSYM)" ?></th>
<th>Action</th>
</tr>
</thead>
@ -3577,7 +3580,7 @@ if (!empty($INRSYMBOL)) {
class="badge mandatory">*</span></label>
<div class="form-group">
<?php
$data = array('name' => 'ServiceRate', 'value' => set_value('ServiceRate'), 'id' => 'ServiceRate', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'Ratechange()');
$data = array('name' => 'ServiceRate', 'value' => set_value('ServiceRate'), 'id' => 'ServiceRate', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'Ratechange();UpdateTheRateMaster();');
echo form_input($data);
?>
</div>
@ -6027,14 +6030,15 @@ if (!empty($INRSYMBOL)) {
index = parseInt(index) + 1;
var template = jQuery("#RevenueList").html();
var rshorten = materialName.length > 13 ? materialName.slice(0, 13) + "..." : materialName;
var html = `
<tr id="${temp}">
<td>${temp}</td>
<td>${Reqnumber}</td>
<td style="text-align:center !important">${Reqnumber}</td>
<td>${materialCode}</td>
<td>${materialName}</td>
<td align="center">${quantity}</td>
<td>${rshorten}</td>
<td align="right">${quantity}</td>
<td>${uom}</td>
<td align="right">${itemRate}</td>
<td align="right">${basicval}</td>
@ -6555,7 +6559,19 @@ if (!empty($INRSYMBOL)) {
$('#ServiceMaterialCode').focus();
return false;
}
function UpdateTheRateMaster(){
if ($('#ServiceMaterialCode').val() != "0" && $('#ServiceRate').val() != "0" ) {
var MaterialCode = $('#ServiceMaterialCode').val();
var Rate = $('#ServiceRate').val();
}
if ($('#ServiceMaterialCode').val() != "0" && $('#ServiceRate').val() != "0" ) {
var MaterialCode = $('#MaterialCode').val();
var Rate = $('#Rate').val();
}
if (MaterialCode != "0" && Rate != "0" ) {
}
}
if ($('#ServiceQuantity').val() != '' && $('#ServiceRate').val() != '') {
@ -6695,14 +6711,16 @@ if (!empty($INRSYMBOL)) {
index = parseInt(index) + 1;
var template = jQuery("#ServiceList").html();
var sshorten = materialName.length > 13 ? materialName.slice(0, 13) + "..." : materialName;
var html = `
<tr id="${temp}">
<td>${temp}</td>
<td>${Reqnumber}</td>
<td style="text-align:center !important">${Reqnumber}</td>
<td>${materialCode}</td>
<td>${materialName}</td>
<td align="center">${quantity}</td>
<td>${sshorten}</td>
<td align="right">${quantity}</td>
<td>${uom}</td>
<td align="right">${itemRate}</td>
<td align="right">${basicval}</td>
@ -7222,26 +7240,27 @@ if (!empty($INRSYMBOL)) {
// Perform form validation
if (validate()) {
if (document.getElementById('serviceTax').rows.length < 2) {
alert('Please Select Line item to Create PO');
$('#Deliverydt').focus();
return false;
} else if ($('#Otherpayment').val() == '' && $('#PaymentMethod').val() == 'PT08') {
alert('Please Enter Other Payable Terms Description');
$('#Otherpayment').focus();
return false;
} else if ($('#emergdescofpo').val().trim() == '') {
alert('Please Enter Description Of Service');
$('#emergdescofpo').focus();
return false;
} else if ($('#PoTypeOptions').val() == "0") {
alert('Please Select POType');
$('#PoTypeOptions').focus();
return false;
} else {
if (serviceValidate()) {
// if (document.getElementById('serviceTax').rows.length < 2) {
// alert('Please Select Line item to Create PO');
// $('#Deliverydt').focus();
// return false;
// } else if ($('#Otherpayment').val() == '' && $('#PaymentMethod').val() == 'PT08') {
// alert('Please Enter Other Payable Terms Description');
// $('#Otherpayment').focus();
// return false;
// } else if ($('#emergdescofpo').val().trim() == '') {
// alert('Please Enter Description Of Service');
// $('#emergdescofpo').focus();
// return false;
// } else if ($('#PoTypeOptions').val() == "0") {
// alert('Please Select POType');
// $('#PoTypeOptions').focus();
// return false;
// } else {
// Submit the form using AJAX
$('#loader').show();
// disableButtons();
$.ajax({
url: "<?php echo base_url() ?>emergencypurchaseorder/addNewServicePurchaseOrder",
type: "POST",
@ -7260,14 +7279,16 @@ if (!empty($INRSYMBOL)) {
$('#SpcialInstruction').val('');
$('#txtDeliveryAddress').val('');
window.location = "purchaseorderListing";
// setTimeout(function() { enableButtons(); }, 2000);
},
error: function (xhr, status, error) {
// Handle errors
$('#loader').hide();
alert("Error: " + error);
// setTimeout(function() { enableButtons(); }, 2000);
}
});
}
// }
}
}
@ -7333,22 +7354,23 @@ if (!empty($INRSYMBOL)) {
// Perform form validation
if (validate()) {
if (document.getElementById('serviceTax').rows.length < 2) {
alert('Please Select Line item to Create PO');
$('#Deliverydt').focus();
return false;
} else if ($('#insuranceStatus').val() == 'YES' && $('#InsuranceNumber').val() == '') {
alert('Please Enter Insurance Number..!');
if (revenueValidate()) {
// if (document.getElementById('serviceTax').rows.length < 2) {
// alert('Please Select Line item to Create PO');
// $('#Deliverydt').focus();
// return false;
// } else if ($('#insuranceStatus').val() == 'YES' && $('#InsuranceNumber').val() == '') {
// alert('Please Enter Insurance Number..!');
return false;
} else if ($('#PaymentMethod').val() == 'PT08' && $('#Otherpayment').val() == '') {
alert('Please Enter Other Payment Description..!');
// return false;
// } else if ($('#PaymentMethod').val() == 'PT08' && $('#Otherpayment').val() == '') {
// alert('Please Enter Other Payment Description..!');
return false;
} else {
// return false;
// } else {
// Submit the form using AJAX
$('#loader').show();
// disableButtons();
$.ajax({
url: "<?php echo base_url() ?>emergencypurchaseorder/addNewRevenuePurchaseOrder",
type: "POST",
@ -7363,13 +7385,15 @@ if (!empty($INRSYMBOL)) {
$('#SpcialInstruction').val('');
$('#txtDeliveryAddress').val('');
window.location = "purchaseorderListing";
// setTimeout(function() { enableButtons(); }, 2000);
},
error: function (xhr, status, error) {
// Handle errors
alert("Error: " + error);
// setTimeout(function() { enableButtons(); }, 2000);
}
});
}
// }
}
}

View File

@ -224,7 +224,7 @@ $currentday = date('d');
<div class="col-6">
<div class="page-title-box page-title-box-alt">
<div class="page-title-right">
<ol class="breadcrumb m-0">
<ol class="breadcrumb mt-0.99 mb-2.5"">
<li class="breadcrumb-item"><a href="javascript: void(0);">HR</a></li>
<li class="breadcrumb-item active">
<h4 class="page-title">Attendance </h4>
@ -234,9 +234,6 @@ $currentday = date('d');
</div>
</div>
<div class="col-6 text-right">
<!-- Right-aligned buttons or links can be added here -->
</div>
</div>
<div class="row">
<div class="col-12">

View File

@ -333,64 +333,105 @@ if (!empty($INRSYMBOL)) {
function vaildateBeforeOpenModal() {
var radioValue = $("input[name='DateRange']:checked").val();
if ($('#PODate').val() == '') {
alert('Please Enter the Purchase Order date');
$('#PODate').focus();
return false;
} else if ($('#drpSupplier').val() == "0") {
alert('Please Select the Supplier details');
$('#drpSupplier').focus();
return false;
} else if (radioValue == 0 && $('#Deliverydate').val() == '') {
alert('Please Select the Delivery Date');
$('#Deliverydate').focus();
return false;
} else if (radioValue == 1 && $('#Scheduleby').val() == '') {
alert('Please Enter the Schedule By');
$('#Deliverydate').focus();
return false;
} else if (radioValue == 2 && $('#Dispatch').val().trim() == '') {
alert('Please Enter the Dispatch Instruction');
$('#Deliverydate').focus();
return false;
} else if ($('#DeliveryAddr').val() == '') {
alert('Please Enter the Delivery Address');
$('#DeliveryAddr').focus();
return false;
} else if ($('#PoTypeOptions').val() == "0") {
alert('Please Select POType');
$('#PoTypeOptions').focus();
return false;
} else if ($('#BudgetType').val() == "0") {
alert('Please Select Budget Type');
$('#BudgetType').focus();
return false;
} else if ($('#Deliverydt').val() == '' && $('#Scheduleby').val() == '') {
alert('Please Enter the Dispatch Instruction');
$('#Deliverydt').focus();
return false;
} else if ($('#currencytype').val() == '0') {
alert('Please Select the Currency Type');
$('#currencytype').focus();
return false;
} else if (capitalType == 'International') {
if ($('#ExchangeRt').val() == '') {
alert('Please Enter the Exchange Rate');
$('#ExchangeRt').focus();
return false;
} else if ($('#PlaceOforigin').val().trim() == '') {
alert('Please Enter the Place Of Origin');
$('#PlaceOforigin').focus();
return false;
} else {
return true;
}
} else {
return true;
if (capitalType == 'International') {
if ($('#drpSupplier').val() == "0") {
alert('Please Select the Supplier details');
$('#drpSupplier').focus();
return false;
} else if ($('#currencytype').val() == '0') {
alert('Please Select the Currency Type');
$('#currencytype').focus();
return false;
} else if ($('#PODate').val() == '') {
alert('Please Enter the Purchase Order date');
$('#PODate').focus();
return false;
} else if (radioValue == 0 && $('#Deliverydate').val() == '') {
alert('Please Select the Delivery Date');
$('#Deliverydate').focus();
return false;
} else if (radioValue == 1 && $('#Scheduleby').val() == '') {
alert('Please Enter the Schedule By');
$('#Deliverydate').focus();
return false;
} else if (radioValue == 2 && $('#Dispatch').val().trim() == '') {
alert('Please Enter the Dispatch Instruction');
$('#Deliverydate').focus();
return false;
} else if ($('#ExchangeRate').val() == '') {
alert('Please Enter the Exchange Rate');
$('#ExchangeRate').focus();
return false;
} else if ($('#ExchangeRate').val() == 0) {
alert('Please Enter the Exchange Rate');
$('#ExchangeRate').focus();
return false;
} else if ($('#PlaceOforigin').val() == '') {
alert('Please Enter Place Of Origin');
$('#PlaceOforigin').focus();
return false;
} else if ($('#PoTypeOptions').val() == "0") {
alert('Please Select Capital Type');
$('#PoTypeOptions').focus();
return false;
} else if ($('#PaymentTerms').val() == '') {
alert('Please Select Payment Terms');
$('#PaymentTerms').focus();
return false;
} else if ($('#Otherpayment').val() == '' && $('#PaymentTerms').val() == 'PT08') {
alert('Please Enter Payable Terms Description');
$('#Otherpayment').focus();
return false;
} else if ($('#BudgetType').val() == "0") {
alert('Please Select Budget Type');
$('#BudgetType').focus();
return false;
} else { return true; }
}
if (capitalType == 'Domestic') {
if ($('#drpSupplier').val() == "0") {
alert('Please Select the Supplier details');
$('#drpSupplier').focus();
return false;
} else if ($('#PODate').val() == '') {
alert('Please Enter the Purchase Order date');
$('#PODate').focus();
return false;
} else if (radioValue == 0 && $('#Deliverydate').val() == '') {
alert('Please Select the Delivery Date');
$('#Deliverydate').focus();
return false;
} else if (radioValue == 1 && $('#Scheduleby').val() == '') {
alert('Please Enter the Schedule By');
$('#Deliverydate').focus();
return false;
} else if (radioValue == 2 && $('#Dispatch').val().trim() == '') {
alert('Please Enter the Dispatch Instruction');
$('#Deliverydate').focus();
return false;
} else if ($('#PoTypeOptions').val() == "0") {
alert('Please Select Capital Type');
$('#PoTypeOptions').focus();
return false;
} else if ($('#PaymentTerms').val() == '') {
alert('Please Select Payment Terms');
$('#PaymentTerms').focus();
return false;
} else if ($('#Otherpayment').val() == '' && $('#PaymentTerms').val() == 'PT08') {
alert('Please Enter Payable Terms Description');
$('#Otherpayment').focus();
return false;
} else if ($('#BudgetType').val() == "0") {
alert('Please Select Budget Type');
$('#BudgetType').focus();
return false;
} else { return true; }
}
}
</script>
<div class="content-page">
@ -514,7 +555,7 @@ if (!empty($INRSYMBOL)) {
<?php
$data = array('name' => 'Scheduleby', 'value' => set_value('Scheduleby'), 'id' => 'Scheduleby', 'class' => 'form-control', 'required' => 'true', 'rows' => '3', 'cols' => '40', 'maxlength' => '110');
echo Form_textarea($data);
echo form_textarea($data);
?>
</div>
@ -525,7 +566,7 @@ if (!empty($INRSYMBOL)) {
// $data = array('name' => 'Dispatch','value' => set_value('Dispatch'),'id'=>'Dispatch', 'class' => 'form-control' ,'required' => 'true');
// echo form_input($data);
$data = array('name' => 'Dispatch', 'value' => set_value('Dispatch'), 'id' => 'Dispatch', 'class' => 'form-control', 'required' => 'true', 'rows' => '3', 'cols' => '40', 'maxlength' => '110');
echo Form_textarea($data);
echo form_textarea($data);
?>
@ -742,20 +783,21 @@ if (!empty($INRSYMBOL)) {
<br>
</div>
<div class="form-row">
<table id="serviceTax" class="table table-bordered table-hover" style="background-color:#fff;font-size:12px;">
<div class="table-responsive" style="padding-bottom: 30px;">
<table id="serviceTax" class="table nowrap table-bordered table-hover mb-0" style="font-size:12px;">
<thead>
<tr>
<th>SNo</th>
<th>Requisition No</th>
<th>Item Code</th>
<th>Item Description</th>
<th>Line Item Specs</th>
<th>Quantity</th>
<th>UOM</th>
<th>Rate</th>
<th>Basic Amount</th>
<th>Tax Amount</th>
<th>Total Order Amount</th>
<th style="white-space: nowrap !important;">SNo</th>
<th style="white-space: nowrap !important;" align="center">Requisition No</th>
<th style="white-space: nowrap !important;">Item Code</th>
<th style="white-space: nowrap !important;">Item Description</th>
<th style="white-space: nowrap !important;">Line Item Specs</th>
<th style="white-space: nowrap !important;" align="right">Quantity</th>
<th style="white-space: nowrap !important;">UOM</th>
<th style="white-space: nowrap !important;" align="right">Rate</th>
<th style="white-space: nowrap !important;" align="right">Basic Amount</th>
<th style="white-space: nowrap !important;" align="right">Tax Amount</th>
<th style="white-space: nowrap !important;" align="right">Total Order Amount</th>
<th>Action</th>
</tr>
</thead>
@ -765,6 +807,7 @@ if (!empty($INRSYMBOL)) {
</tbody>
</table>
</div>
</div>
<div class="form-row" id="DOMdiv">
<div class="form-group col-md-3">
@ -2607,6 +2650,7 @@ if (!empty($INRSYMBOL)) {
$("#MaterialCode").empty();
$("#CapitalDepartmentName").val('');
$("#CPUOM").val('');
$("#CPRate").val('');
$("#CPQuantity").val('');
$("#CapitalItemName").val('');
$("#CPTotalAmount").val('');
@ -2676,6 +2720,7 @@ if (!empty($INRSYMBOL)) {
var id = $('#MaterialCode').val();
$("#CapitalItemName").val('');
$("#CPUOM").val('');
$("#CPRate").val('');
$("#CPQuantity").val('');
$("#CPTotalAmount").val('');
RequistQuantity = '';
@ -2688,6 +2733,7 @@ if (!empty($INRSYMBOL)) {
if (obj.MaterialCode === id) {
$("#CapitalItemName").val(obj.MaterialName);
$("#CPUOM").val(obj.UOM);
$("#CPRate").val(obj.material_rate);
var CPUOMDisplay = obj.UOM;
$("#CPQuantity").val(obj.Quantity);
RequistQuantity = obj.Quantity;
@ -2739,6 +2785,7 @@ if (!empty($INRSYMBOL)) {
if (obj.MaterialCode === id) {
$("#EditItemName").val(obj.MaterialName);
$("#EditUOM").val(obj.UOM);
$("#EditRate").val(obj.material_rate);
var EDITUOMDisplay = obj.UOM;
$("#EditQuantity").val(obj.Quantity);
RequistQuantity = obj.Quantity;
@ -3481,14 +3528,14 @@ if (!empty($INRSYMBOL)) {
// Taxvalue: TotalTaxValue,
// TotalValue: Total
// }));
var shorten = materialName.length > 13 ? materialName.slice(0, 13) + "..." : materialName;
var rowHtml = `
<tr id="${temp}">
<td align="left">${temp}</td>
<td align="left">${Reqnumber}</td>
<td align="center">${Reqnumber}</td>
<td align="left">${materialCode}</td>
<td align="left">${materialName}</td>
<td>
<td align="left">${shorten}</td>
<td align="left">
<a href="#" class="editable-field"
data-notes = "-" data-id ="${temp}">-</a>
<div class="edit-container" style="display:none;">
@ -3497,12 +3544,12 @@ if (!empty($INRSYMBOL)) {
<button class="cancel-btn"></button>
</div>
</td>
<td align="left">${quantity}</td>
<td align="right">${quantity}</td>
<td align="left">${uom}</td>
<td align="left">${itemRate}</td>
<td align="left">${basicval}</td>
<td align="left">${TotalTaxValue}</td>
<td align="left">${Total}</td>
<td align="right">${itemRate}</td>
<td align="right">${basicval}</td>
<td align="right">${TotalTaxValue}</td>
<td align="right">${Total}</td>
<td>
<a data-target='#EDITCAPITAL' id="edit${temp}" data-id="${temp}" data-userid="${temp}" data-toggle="modal" href="#EDITREVENUE">
<i class="ri-pencil-fill" data-toggle="tooltip" ></i>&nbsp;&nbsp;&nbsp;
@ -4390,6 +4437,7 @@ if (!empty($INRSYMBOL)) {
var id = $('#EditMaterialCode').val();
$("#EditCapitalItemName").val('');
$("#EditCPUOM").val('');
$("#EditCPRate").val('');
$("#EditCPQuantity").val('');
$("#EditCPTotalAmount").val('');
RequistQuantity = '';
@ -4402,6 +4450,7 @@ if (!empty($INRSYMBOL)) {
if (obj.MaterialCode === id) {
$("#EditCapitalItemName").val(obj.MaterialName);
$("#EditCPUOM").val(obj.UOM);
$("#EditCPRate").val(obj.material_rate);
$("#EditCPQuantity").val(obj.Quantity);
RequistQuantity = obj.Quantity;
}
@ -4482,32 +4531,32 @@ if (!empty($INRSYMBOL)) {
} else {
basicAmountRate = parseFloat($('#CapitalBasicOrder').val()) - parseFloat($('#txtTotalDiscount').val());
}
if (validate()) {
if (document.getElementById('serviceTax').rows.length < 2) {
alert('Please Select Line item to Create PO');
$('#Deliverydt').focus();
return false;
} else if ($('#Otherpayment').val() == '' && $('#PaymentMethod').val() == 'PT08') {
alert('Please Enter Other Payable Terms Description');
$('#Otherpayment').focus();
return false;
}
// else if(parseInt(AvlBudAmt) < parseInt(basicAmountRate)) {
if (capitalValidate()) {
// if (document.getElementById('serviceTax').rows.length < 2) {
// alert('Please Select Line item to Create PO');
// $('#Deliverydt').focus();
// return false;
// } else if ($('#Otherpayment').val() == '' && $('#PaymentMethod').val() == 'PT08') {
// alert('Please Enter Other Payable Terms Description');
// $('#Otherpayment').focus();
// return false;
// }
// else if(parseInt(AvlBudAmt) < parseInt(basicAmountRate)) {
// alert('Total Order Amount is exceeding the Budget Limit.Please adjust the product value.');
// return false;
// }
else if ($('#PoTypeOptions').val() == "0") {
alert('Please Select POType');
$('#PoTypeOptions').focus();
return false;
// else if ($('#PoTypeOptions').val() == "0") {
// alert('Please Select POType');
// $('#PoTypeOptions').focus();
// return false;
} else {
// } else {
// $('#content').loader('show');
var formData = new FormData($('.CapitalPO')[0]);
formData.append('ExchangeRateOn', ExchangeRateOn);
formData.append('PaymentMethod', PaymentMethod);
$('#loader').show();
// disableButtons();
$.ajax({
data: formData,
processData: false,
@ -4529,16 +4578,22 @@ if (!empty($INRSYMBOL)) {
clearAfterAddLineItemAdd();
window.location = "purchaseorderListing";
// setTimeout(function() { enableButtons(); }, 2000);
} else {
// $('#content').loader('hide');
alert("Error");
// setTimeout(function() { enableButtons(); }, 2000);
}
}
},
error: function(jqXHR, textStatus, errorThrown) {
console.error("AJAX Error: " + textStatus + ": " + errorThrown);
alert("Error: " + textStatus);
// setTimeout(function() { enableButtons(); }, 2000);
}
});
}
// }
}
}
@ -5381,9 +5436,12 @@ if (!empty($INRSYMBOL)) {
function Reset() {
location.reload();
}
// disableButtons();
location.reload();
// setTimeout(function() {
// enableButtons();
// }, 2000);
}
$('#insuranceTxtDiv').hide();
$("#insuranceStatus").change(function() {

View File

@ -93,6 +93,7 @@ $datefordropdown = format_date($datefordropdown, 0, 'M-Y');
<th>Vehicle Number</th>
<th>Salary Amount</th>
<th>Food Amount</th>
<th>Total</th>
<th>Load Type</th>
<th>Action</th>
</tr>
@ -118,6 +119,7 @@ $datefordropdown = format_date($datefordropdown, 0, 'M-Y');
<td><?= esc($record['vehicle_number']) ?></td>
<td><?= esc($record['salary_amount']) ?></td>
<td><?= esc($record['food_amount']) ?></td>
<td><?= esc($record['salary_amount']+$record['food_amount']) ?></td>
<td><?= esc($record['load_type']) ?></td>
<td><?php if($record['payroll_id'] == ''){ ?>
<a data-toggle="modal" href="#attendanceModal" data-arr='<?php echo json_encode($record); ?>' data-id='<?= esc($record['driver_attendance_id']) ?>'>
@ -134,6 +136,64 @@ $datefordropdown = format_date($datefordropdown, 0, 'M-Y');
<?php } ?>
<?php endif; ?>
</tbody>
<tfoot>
<tr>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th>Salary Amount</th>
<th></th>
<th></th>
<th></th>
<th id="rowTotalAmount"></th>
<th></th>
<th></th>
</tr>
<tr>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th>Diesel</th>
<th><input type="text" class="editable" data-column="diesel_amount"></th>
<th></th>
<th></th>
</tr>
<tr>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th>Shed Amount</th>
<th><input type="text" class="editable" data-column="shed_amount"></th>
<th></th>
<th></th>
</tr>
<tr>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th>Total</th>
<th id="totalAmount">-</th>
<th></th>
<th></th>
</tr>
</tfoot>
</table>
</div>
@ -221,7 +281,7 @@ $datefordropdown = format_date($datefordropdown, 0, 'M-Y');
<div class="col-md-6">
<label class="form" for="load_type">Load Type</label>
<select class="form-control" id="load_type" name="load_type" onchange="salary();">
<select class="form-control" id="load_type" name="load_type" onchange="updateSalaryBasedOnType();">
<option value="">Select</option>
<option value="Load">Load</option>
<option value="Waste Core">Waste Core</option>
@ -234,11 +294,11 @@ $datefordropdown = format_date($datefordropdown, 0, 'M-Y');
<div class="row mt-2">
<div class="col-md-4">
<label class="form" for="salary_amount">Salary Amount</label>
<input type="text" class="form-control" id="salary_amount" name="salary_amount" onkeypress="return isNumber(event);" onchange="salary();">
<input type="text" class="form-control" id="salary_amount" name="salary_amount" onkeypress="return isNumber(event);" onchange="fetchSalary();">
</div>
<div class="col-md-4">
<label class="form" for="food_amount">Food Amount</label>
<input type="text" class="form-control" id="food_amount" name="food_amount" onkeypress="return isNumber(event);" onchange="salary();">
<input type="text" class="form-control" id="food_amount" name="food_amount" onkeypress="return isNumber(event);" onchange="fetchSalary();">
</div>
<div class="col-md-4">
<label class="form" for="total_amount">Total Amount</label>
@ -303,13 +363,21 @@ $datefordropdown = format_date($datefordropdown, 0, 'M-Y');
$("#gobal_driver_id").val("<?php echo $gobal_driver_id; ?>");
$("#driver_id").val("<?php echo $gobal_driver_id; ?>");
}
let gobal_diesel_amount = "<?php echo $gobal_diesel_amount; ?>";
let gobal_shed_amount = "<?php echo $gobal_shed_amount; ?>";
if(gobal_diesel_amount != '' || gobal_shed_amount != ''){
$('input[data-column="diesel_amount"]').val(parseFloat(gobal_diesel_amount) || 0);
$('input[data-column="shed_amount"]').val(parseFloat(gobal_shed_amount) || 0);
calculateTotal();
}
$("#attendanceModal").on("shown.bs.modal", function (e) {
var id = $(e.relatedTarget).data('id');
let fields = ['invoice_number', 'vehicle_number', 'load_type', 'salary_amount', 'food_amount','customer','quantity'];
let fields = ['invoice_number', 'vehicle_number', 'load_type', 'salary_amount', 'food_amount','customer','quantity','total_amount'];
fields.forEach(function(field) {
$("#" + field).val("");
@ -330,10 +398,18 @@ $datefordropdown = format_date($datefordropdown, 0, 'M-Y');
if(field == 'driver_id'){
$("#driver_id").val(arr && arr['driver_id']);
}
if(field == 'salary_amount' || field == 'food_amount') {
var ttl = parseFloat(arr['salary_amount']) + (parseFloat(arr['food_amount'] || 0));
var salary = arr['salary_amount'] ? parseFloat(arr['salary_amount']) : 0;
var food = arr['food_amount'] ? parseFloat(arr['food_amount']) : 0;
if (isNaN(salary)) salary = 0;
if (isNaN(food)) food = 0;
var ttl = salary + food;
$('#total_amount').val(ttl.toFixed(2));
var ttl = parseFloat(salary) + parseFloat(food) ;
$('#total_amount').val(ttl.toFixed(2));
}
});
$('#attendanceTitle').html("Edit Driver Trip");
}
@ -418,20 +494,88 @@ $datefordropdown = format_date($datefordropdown, 0, 'M-Y');
buttons: [
'excel', 'pdf'
],
pageLength: 10,
lengthMenu: [
[10, 20, 30, 50, -1],
[10, 20, 30, 50, "All"]
],
responsive: false,
order: false,
language: {
paginate: {
next: '<i class="fas fa-angle-right"></i>', // Next button icon
previous: '<i class="fas fa-angle-left"></i>' // Previous button icon
}
paging: false,
footerCallback: function (row, data, start, end, display) {
var api = this.api();
var isTableEmpty = api.data().length === 0;
// Hide or show the tfoot based on whether the table is empty
if (isTableEmpty) {
$(this).find('tfoot').hide(); // Hide tfoot if the table is empty
} else {
$(this).find('tfoot').show(); // Show tfoot if the table has data
}
var api = this.api();
var columnIndex = 7;
var sum = api
.column(columnIndex, { page: 'current' })
.data()
.reduce(function (a, b) {
return a + parseFloat(b.replace(/[^\d.-]/g, ''));
}, 0);
$(api.column(columnIndex).footer()).html(sum);
var api = this.api();
var columnIndex = 8;
var sum = api
.column(columnIndex, { page: 'current' })
.data()
.reduce(function (a, b) {
return a + parseFloat(b.replace(/[^\d.-]/g, ''));
}, 0);
$(api.column(columnIndex).footer()).html(sum);
var api = this.api();
var columnIndex = 9;
var sum = api
.column(columnIndex, { page: 'current' })
.data()
.reduce(function (a, b) {
return a + parseFloat(b.replace(/[^\d.-]/g, ''));
}, 0);
$(api.column(columnIndex).footer()).html(sum);
}
});
// Function to calculate the total
function calculateTotal() {
var diesel = parseFloat($('input[data-column="diesel_amount"]').val()) || 0;
var shed = parseFloat($('input[data-column="shed_amount"]').val()) || 0;
var row = parseInt($('#rowTotalAmount').text()) || 0;
console.log(row);
var total = row + diesel + shed;
$('#totalAmount').text(total); // Display the total with 2 decimal places
}
// Make the cells editable and calculate the total on input change
$(document).on('input', '.editable', function() {
calculateTotal();
});
$(document).on('blur', '.editable', function() {
var column = $(this).data('column'); // Get the column name (diesel or shed)
var value = $(this).val(); // Get the updated value
let gobal_driver_id = urlParams.get("gobal_driver_id");
let gobal_date = urlParams.get("date");
// Send data to the server using AJAX
$.ajax({
url: "<?php echo base_url(); ?>updateDieselAndShedValuesBasedonEmpID",
method: 'POST',
data: {
column: column,
value: value,
date: gobal_date,
empid:gobal_driver_id
},
success: function(response) {
console.log('Data saved successfully:', response);
},
error: function(xhr, status, error) {
console.error('Error saving data:', error);
}
});
});
// Initial calculation of the total
calculateTotal();
});
</script>
@ -463,25 +607,29 @@ $datefordropdown = format_date($datefordropdown, 0, 'M-Y');
if (result) { return result; } else { event.preventDefault(); }
}
function salary() {
var type = $('#load_type').val();
if(type == 'Load'){
var value = parseFloat(1300);
$('#salary_amount').val(value);
}else if(type == 'Waste Core'){
var value = parseFloat(1050);
$('#salary_amount').val(value);
}
var sa = parseFloat($('#salary_amount').val()) || 0;
var fa = parseFloat($('#food_amount').val()) || 0;
var ttl = sa + fa;
$('#total_amount').val(ttl.toFixed(2));
$(document).ready(function() {
updateSalaryBasedOnType();
fetchSalary();
});
function updateSalaryBasedOnType() {
var type = $('#load_type').val();
if (type == 'Load') {
$('#salary_amount').val(1300);
} else if (type == 'Waste Core') {
$('#salary_amount').val(1050);
}
fetchSalary();
}
function fetchSalary() {
var sa = parseFloat($('#salary_amount').val()) || 0;
var fa = parseFloat($('#food_amount').val()) || 0;
var ttl = sa + fa;
$('#total_amount').val(ttl.toFixed(2));
}
function customerandquantity(){
if ($('#invoice_number').val() === '') {
alert('Please Enter the Valid Invoice Number');

View File

@ -63,9 +63,7 @@
<i class="fa fa-trash"></i>&nbsp;&nbsp;&nbsp;
</a>
<?php $today = date('M-Y'); ?>
<a title="Trip Details" style="cursor:pointer;" href="<?= base_url() . 'loadDriverAttendance?gobal_driver_id=' . $record['driver_id'].'&month_year='.$today; ?>">
<i class="fa fa-truck"></i>&nbsp;&nbsp;&nbsp;
</a>
<?php } ?>
</td>
</tr>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -796,23 +796,20 @@ if (!empty($POItem) && $CapitalRange == '1') {
</div>
</div>
<div class="form-row">
<div class="table-responsive">
<table id="serviceTax" class="table table-striped table-hover mb-0"
style="font-size:12px;">
<div class="table-responsive" style="padding-bottom: 30px;">
<table id="serviceTax" class="table nowrap table-bordered table-hover mb-0" style="font-size:12px;">
<thead>
<tr>
<th>SNo</th>
<th>Requisition No</th>
<th>Item Name</th>
<th>Quantity</th>
<th>UOM</th>
<th>Rate</th>
<th>Basic Amount</th>
<th>Tax Amount</th>
<th>Total Order Amount</th>
<th>Action</th>
<th style="white-space: nowrap !important; text-align:left !important">SNo</th>
<th style="white-space: nowrap !important; text-align:center !important">Requisition No</th>
<th style="white-space: nowrap !important; text-align:left !important">Item Description</th>
<th style="white-space: nowrap !important; text-align:right !important">Quantity</th>
<th style="white-space: nowrap !important; text-align:left !important">UOM</th>
<th style="white-space: nowrap !important; text-align:right !important">Rate<?php echo "($INR)" ?></th>
<th style="white-space: nowrap !important; text-align:right !important">Basic Amount<?php echo "($INR)" ?></th>
<th style="white-space: nowrap !important; text-align:right !important">Tax Amount<?php echo "($INR)" ?></th>
<th style="white-space: nowrap !important; text-align:right !important">Total Order Amount<?php echo "($INR)" ?></th>
<th style="white-space: nowrap !important; text-align:left !important">Action</th>
</tr>
</thead>
@ -826,16 +823,17 @@ if (!empty($POItem) && $CapitalRange == '1') {
?>
<tr id="<?php echo $index; ?>">
<td align="left"><?php echo $index; ?></td>
<td><?php echo $record->ReqNo ?></td>
<td><?php echo $record->MaterialName ?></td>
<td style="text-align:right"><?php echo $record->Quantity ?></td>
<td><?php echo $record->UOM ?></td>
<td style="text-align:right"><?php echo $record->Rate ?></td>
<td style="text-align:right">
<td style="text-align:left !important"><?php echo $index; ?></td>
<td style="text-align:center !important"><?php echo $record->ReqNo ?></td>
<td style="text-align:left !important"><?php $shortName = mb_strimwidth($record->MaterialName, 0, 13, "...");
echo $shortName; ?></td>
<td style="text-align:right !important"><?php echo $record->Quantity ?></td>
<td style="text-align:left !important"><?php echo $record->UOM ?></td>
<td style="text-align:right !important"><?php echo number_format($record->Rate, 2, '.', ''); ?></td>
<td style="text-align:right !important">
<?php echo number_format($record->Rate * $record->Quantity, 2, '.', ''); ?>
</td>
<td style="text-align:right"><?php if ($CapitalRange == '1') {
<td style="text-align:right !important"><?php if ($CapitalRange == '1') {
echo $record->ServiceTaxamount;
} else if ($CapitalRange == '0') {
echo "0.0";
@ -845,12 +843,12 @@ if (!empty($POItem) && $CapitalRange == '1') {
<!-- <td style="text-align:right"><?php echo $record->TotalValue + $record->Afvalue; ?></td> -->
<td><?php echo number_format($record->Rate * $record->Quantity + $record->ServiceTaxamount + $record->otherallowance + $record->Afvalue - $record->Afterdiscountval, 2, '.', '') ?>
<td style="text-align:right !important"><?php echo number_format($record->Rate * $record->Quantity + $record->ServiceTaxamount + $record->otherallowance + $record->Afvalue - $record->Afterdiscountval, 2, '.', '') ?>
</td>
<?php } else if ($CapitalRange == '0') { ?>
<td style="text-align:right">
<td style="text-align:right !important">
<?php echo number_format(($record->Rate * $record->Quantity), 2, '.', ''); ?>
</td>
<?php } ?>
@ -3453,29 +3451,27 @@ Calculate Landing charge
//alert(basicamt);
}
if (validate()) {
if (capitalValidate()) {
var ex = $('#ExchangeRt').val();
//alert(ex);
//alert(parseInt($('#CapitalToatlOrder').val() * ex));
var AvlBudAmt = '<?php echo $AvlAmount ?>';
//alert(AvlBudAmt);
if (document.getElementById('serviceTax').rows.length < 2) {
alert('Please Select Line item to Create PO');
$('#Deliverydt').focus();
return false;
} else if ($('#Otherpayment').val() == '' && $('#PaymentMethod').val() == 'PT08') {
alert('Please Enter Other Payable Terms Description');
$('#Otherpayment').focus();
return false;
}
// if (document.getElementById('serviceTax').rows.length < 2) {
// alert('Please Select Line item to Create PO');
// $('#Deliverydt').focus();
// return false;
// } else if ($('#Otherpayment').val() == '' && $('#PaymentMethod').val() == 'PT08') {
// alert('Please Enter Other Payable Terms Description');
// $('#Otherpayment').focus();
// return false;
// }
// else if(parseInt(AvlBudAmt) < parseInt(basicamt)) {
// alert('Total Order Amount is exceeding the Budget Limit.Please adjust the product value.');
// return false;
// }
else {
// alert('Total Order Amount is exceeding the Budget Limit.Please adjust the product value.');
// return false;
// }
// else {
//alert('else');
@ -3500,7 +3496,7 @@ Calculate Landing charge
$('#loader').show();
// disableButtons();
$.ajax({
// data:$('.CapitalPO').serialize()+"&ExchangeRateOn="+ExchangeRateOn+"&PaymentMethod="+PaymentMethod+"&PayableAT="+PayableAT+"&PaymentDate="+PaymentDate,
type: "POST",
@ -3519,15 +3515,17 @@ Calculate Landing charge
$('#SpcialInstruction').val('');
$('#txtDeliveryAddress').val('');
window.location = status == 1 ? "amendmentpurchaseorder" : "purchaseorderListing";
// setTimeout(function() { enableButtons(); }, 2000);
} else {
$('#loader').hide();
alert("Error");
// setTimeout(function() { enableButtons(); }, 2000);
}
}
});
}
// }
}
}

View File

@ -870,7 +870,7 @@ if (!empty($getlogpodtl)) {
</div>
<div class="form-row">
<!-- <div class="col-md-9" align="right" style="padding:10px"> -->
<!-- <div class="col-md-9" style="text-align:right !important" style="padding:10px"> -->
<!-- <input type="checkbox" id="IsOpenOrder" name="IsOpenOrder" value="1"> IS THIS OPEN ORDER FORMAT -->
<!-- </div> -->
<div class="form-group col-md-12" align=" right">
@ -883,21 +883,22 @@ if (!empty($getlogpodtl)) {
</div>
<div class="box-body">
<table id="serviceTax" class="table table-bordered table-hover"
style="background-color:#fff;font-size:12px;">
<div class="form-row">
<div class="table-responsive" style="padding-bottom: 30px;">
<table id="serviceTax" class="table nowrap table-bordered table-hover mb-0" style="font-size:12px;">
<thead>
<tr>
<th>SNo</th>
<th>Requisition No</th>
<th>Item Code</th>
<th>Item Description</th>
<th>Line Item Specs</th>
<th>Quantity</th>
<th>UOM</th>
<th>Rate<?php echo "($INR)" ?></th>
<th>Basic Amount<?php echo "($INR)" ?></th>
<th>Tax Amount<?php echo "($INR)" ?></th>
<th>Total Order Amount<?php echo "($INR)" ?></th>
<th style="white-space: nowrap !important; text-align:center !important">Requisition No</th>
<th style="white-space: nowrap !important;">Item Code</th>
<th style="white-space: nowrap !important;">Item Description</th>
<th style="white-space: nowrap !important;">Line Item Specs</th>
<th style="white-space: nowrap !important; text-align:right !important">Quantity</th>
<th style="white-space: nowrap !important;">UOM</th>
<th style="white-space: nowrap !important; text-align:right !important">Rate<?php echo "($INR)" ?></th>
<th style="white-space: nowrap !important; text-align:right !important">Basic Amount<?php echo "($INR)" ?></th>
<th style="white-space: nowrap !important; text-align:right !important">Tax Amount<?php echo "($INR)" ?></th>
<th style="white-space: nowrap !important; text-align:right !important">Total Order Amount<?php echo "($INR)" ?></th>
<!-- <th>Actual Quantity</th>
<th>Received Quantity</th>
<th>Pending Quantity</th> -->
@ -920,9 +921,10 @@ if (!empty($getlogpodtl)) {
?>
<tr id="<?php echo $index; ?>">
<td align="left"><?php echo $index; ?></td>
<td><?php echo $record->ReqNo ?></td>
<td style="text-align:center !important"><?php echo $record->ReqNo ?></td>
<td><?php echo $record->MaterialCode ?></td>
<td><?php echo $record->MaterialName ?></td>
<td><?php $shortName = mb_strimwidth($record->MaterialName, 0, 13, "...");
echo $shortName; ?></td>
<td>
<?php if ($PONOStatus === PO_DRAFT || $PONOStatus === PO_CREATED) { ?>
<a href="#"
@ -937,28 +939,28 @@ if (!empty($getlogpodtl)) {
</div>
<?php }else{ echo !empty($record->LineitemAuditorNotes) ? $record->LineitemAuditorNotes : "-"; } ?>
</td>
<td align="right"><?php echo $record->Quantity ?></td>
<td align="right"><?php echo $record->UOM ?></td>
<td align="right"><?php echo $record->Rate ?></td>
<td align="right"><?php echo number_format($record->Rate * $record->Quantity, 2, '.', '') ?></td>
<td style="text-align:right !important"><?php echo $record->Quantity ?></td>
<td ><?php echo $record->UOM ?></td>
<td style="text-align:right !important"><?php echo $record->Rate ?></td>
<td style="text-align:right !important"><?php echo number_format($record->Rate * $record->Quantity, 2, '.', '') ?></td>
<?php if ($CapitalRange == '1') { ?>
<td align="right"><?php echo $record->ServiceTaxamount; ?></td>
<td align="right">
<td style="text-align:right !important"><?php echo $record->ServiceTaxamount; ?></td>
<td style="text-align:right !important">
<?php echo number_format($record->Rate * $record->Quantity + $record->ServiceTaxamount + $record->otherallowance + $record->Afvalue - $record->Afterdiscountval, 2, '.', '') ?>
</td>
<?php } ?>
<?php if ($CapitalRange == '0') { ?>
<td align="right"><?php echo '0'; ?></td>
<td style="text-align:right !important"><?php echo '0'; ?></td>
<td align="right"><?php echo number_format($record->Rate * $record->Quantity, 2, '.', '') ?></td>
<td style="text-align:right !important"><?php echo number_format($record->Rate * $record->Quantity, 2, '.', '') ?></td>
<?php } ?>
<!-- <td align="right"><?php echo $record->Quantity ?></td>
<td align="right"><?php echo $record->ReceivedQuantity ?></td>
<td align="right"><?php echo number_format($record->Quantity - $record->ReceivedQuantity, 2, '.', ''); ?></td> -->
<!-- <td style="text-align:right !important"><?php echo $record->Quantity ?></td>
<td style="text-align:right !important"><?php echo $record->ReceivedQuantity ?></td>
<td style="text-align:right !important"><?php echo number_format($record->Quantity - $record->ReceivedQuantity, 2, '.', ''); ?></td> -->
<?php
$row = array("materialCode" => $record->MaterialCode, "ReqNo" => $record->ReqNo);
array_push($res_arr_values, $row);
@ -990,11 +992,11 @@ if (!empty($getlogpodtl)) {
<input type="hidden" name="<?php echo 'quantity' . $index ?>"
id="<?php echo 'quantity' . $index ?>" value="<?php echo $record->Quantity; ?>" />
<input align="right" type="hidden" name="<?php echo 'b4qty' . $index ?>"
<input style="text-align:right !important" type="hidden" name="<?php echo 'b4qty' . $index ?>"
id="<?php echo 'b4qty' . $index ?>" value="<?php echo $record->Quantity; ?>" />
<input type="hidden" name="<?php echo 'itemRate' . $index ?>"
id="<?php echo 'itemRate' . $index ?>" value="<?php echo $record->Rate; ?>" />
<input align="right" type="hidden" name="<?php echo 'b4rate' . $index ?>"
<input style="text-align:right !important" type="hidden" name="<?php echo 'b4rate' . $index ?>"
id="<?php echo 'b4rate' . $index ?>" value="<?php echo $record->Rate; ?>" />
<?php if ($CapitalRange == '1') { ?>
@ -1021,11 +1023,11 @@ if (!empty($getlogpodtl)) {
<input type="hidden" name="<?php echo 'ServiceTotalOrderValue' . $index ?>"
id="<?php echo 'ServiceTotalOrderValue' . $index ?>"
value="<?php echo $record->ServiceTaxamount; ?>" />
<input align="right" type="hidden" name="<?php echo 'DisType' . $index ?>"
<input style="text-align:right !important" type="hidden" name="<?php echo 'DisType' . $index ?>"
id="<?php echo 'DisType' . $index ?>" value="<?php echo $record->discount; ?>" />
<input align="right" type="hidden" name="<?php echo 'DisVal' . $index ?>"
<input style="text-align:right !important" type="hidden" name="<?php echo 'DisVal' . $index ?>"
id="<?php echo 'DisVal' . $index ?>" value="<?php echo $record->discountval; ?>" />
<input align="right" type="hidden" name="<?php echo 'AfterDisVal' . $index ?>"
<input style="text-align:right !important" type="hidden" name="<?php echo 'AfterDisVal' . $index ?>"
id="<?php echo 'AfterDisVal' . $index ?>" value="<?php echo $record->Afterdiscountval; ?>" />
<input type="hidden" name="<?php echo 'basicvalInINR' . $index ?>"
id="<?php echo 'basicvalInINR' . $index ?>"
@ -1050,19 +1052,19 @@ if (!empty($getlogpodtl)) {
<?php } ?>
<?php if ($CapitalRange == '0') { ?>
<input align="right" type="hidden" name="<?php echo 'FreightType' . $index ?>"
<input style="text-align:right !important" type="hidden" name="<?php echo 'FreightType' . $index ?>"
id="<?php echo 'FreightType' . $index ?>" value="<?php echo $record->FreightType; ?>" />
<input align="right" type="hidden" name="<?php echo 'NoOfTrip' . $index ?>"
<input style="text-align:right !important" type="hidden" name="<?php echo 'NoOfTrip' . $index ?>"
id="<?php echo 'NoOfTrip' . $index ?>" value="<?php echo $record->NoOfTrip; ?>" />
<input align="right" type="hidden" name="<?php echo 'FreightVal' . $index ?>"
<input style="text-align:right !important" type="hidden" name="<?php echo 'FreightVal' . $index ?>"
id="<?php echo 'FreightVal' . $index ?>" value="<?php echo $record->FreightValue; ?>" />
<input align="right" type="hidden" name="<?php echo 'AfterFreightVal' . $index ?>"
<input style="text-align:right !important" type="hidden" name="<?php echo 'AfterFreightVal' . $index ?>"
id="<?php echo 'AfterFreightVal' . $index ?>"
value="<?php echo $record->AfterFreightValue; ?>" />
@ -1159,13 +1161,13 @@ if (!empty($getlogpodtl)) {
<input type="hidden" name="<?php echo 'ServiceTotalOrderValue' . $index ?>"
id="<?php echo 'ServiceTotalOrderValue' . $index ?>" value="0" />
<input align="right" type="hidden" name="<?php echo 'DisType' . $index ?>"
<input style="text-align:right !important" type="hidden" name="<?php echo 'DisType' . $index ?>"
id="<?php echo 'DisType' . $index ?>" value="0" />
<input align="right" type="hidden" name="<?php echo 'DisVal' . $index ?>"
<input style="text-align:right !important" type="hidden" name="<?php echo 'DisVal' . $index ?>"
id="<?php echo 'DisVal' . $index ?>" value="0" />
<input align="right" type="hidden" name="<?php echo 'AfterDisVal' . $index ?>"
<input style="text-align:right !important" type="hidden" name="<?php echo 'AfterDisVal' . $index ?>"
id="<?php echo 'AfterDisVal' . $index ?>" value="0" />
@ -1287,6 +1289,8 @@ if (!empty($getlogpodtl)) {
?>
</tbody>
</table>
</div>
</div>
</div>
@ -1564,7 +1568,7 @@ if (!empty($getlogpodtl)) {
</div>
</div>
<div align="right" style="padding:3% 2%;">
<div style="text-align:right !important" style="padding:3% 2%;">
<div>
@ -1957,7 +1961,7 @@ if (!empty($getlogpodtl)) {
echo form_input($data);
?>
</div>
<div class="form-group col-md-6" align="right">
<div class="form-group col-md-6" style="text-align:right !important">
<label> CGST In % </label>
</div>
@ -1982,7 +1986,7 @@ if (!empty($getlogpodtl)) {
</div>
<div class="form-row" id="ADDCAPdiv3" style="padding:0px">
<div class="form-group col-md-6" align="right">
<div class="form-group col-md-6" style="text-align:right !important">
<label> SGST In % </label>
</div>
@ -2011,7 +2015,7 @@ if (!empty($getlogpodtl)) {
</div>
<div class="form-row" id="ADDCAPdiv2" style="padding:0px">
<div class="form-group col-md-6" align="right">
<div class="form-group col-md-6" style="text-align:right !important">
<label> IGST In % </label>
</div>
@ -2038,7 +2042,7 @@ if (!empty($getlogpodtl)) {
</div>
<div class="form-row" id="ADDCAPdiv1" style="padding:0px">
<div class="col-md-9 col-md-offset-4" align="right">
<div class="col-md-9 col-md-offset-4" style="text-align:right !important">
<label>Other Allowances <?php echo "($INR)" ?></label>
</div>
<div class="form-group col-md-3">
@ -2049,7 +2053,7 @@ if (!empty($getlogpodtl)) {
?>
</div>
</div>
<div class="col-md-9 col-md-offset-4" align="right">
<div class="col-md-9 col-md-offset-4" style="text-align:right !important">
<label>Total Amount <?php echo "($INR)" ?></label>
</div>
<div class="form-group col-md-3">
@ -2645,7 +2649,7 @@ if (!empty($getlogpodtl)) {
?>
</div>
<div class="form-group col-md-6" align="right">
<div class="form-group col-md-6" style="text-align:right !important">
<label> CGST In % <label>
</div>
@ -2669,7 +2673,7 @@ if (!empty($getlogpodtl)) {
</div>
</div>
<div class="form-row" id="EDITCAPdiv1">
<div class="form-group col-md-6" align="right">
<div class="form-group col-md-6" style="text-align:right !important">
<label> SGST In % </label>
</div>
<div class="form-group col-md-3">
@ -2694,7 +2698,7 @@ if (!empty($getlogpodtl)) {
</div>
<div class="form-row" id="EDITCAPdiv2">
<div class="form-group col-md-6" align="right">
<div class="form-group col-md-6" style="text-align:right !important">
<label> IGST In % </label>
</div>
@ -2721,7 +2725,7 @@ if (!empty($getlogpodtl)) {
</div>
<div class="form-row" id="EDITCAPdiv3">
<div class="col-md-9 col-md-offset-4" align="right">
<div class="col-md-9 col-md-offset-4" style="text-align:right !important">
<label>Other Allowances <?php echo "($INR)" ?></label>
</div>
@ -2733,7 +2737,7 @@ if (!empty($getlogpodtl)) {
?>
</div>
</div>
<div class="col-md-9 col-md-offset-4" align="right">
<div class="col-md-9 col-md-offset-4" style="text-align:right !important">
<label>Total Amount <?php echo "($INR)" ?></label>
</div>
<div class="form-group col-md-3">
@ -3278,7 +3282,7 @@ if (!empty($getlogpodtl)) {
</div>
</div>
<div class="form-row">
<div class="form-group col-md-6" align="right">
<div class="form-group col-md-6" style="text-align:right !important">
CGST In %
</div>
<div class="form-group col-md-3">
@ -3295,7 +3299,7 @@ if (!empty($getlogpodtl)) {
</div>
</div>
<div class="form-row" id="VIEWCAPdiv1" style="padding: 0px;">
<div class="form-group col-md-6" align="right">
<div class="form-group col-md-6" style="text-align:right !important">
SGST In %
</div>
<div class="form-group col-md-3">
@ -3312,7 +3316,7 @@ if (!empty($getlogpodtl)) {
</div>
</div>
<div class="form-row" id="VIEWCAPdiv2" style="padding: 0px;">
<div class="form-group col-md-6" align="right">
<div class="form-group col-md-6" style="text-align:right !important">
IGST In %
</div>
<div class="form-group col-md-3">
@ -3329,7 +3333,7 @@ if (!empty($getlogpodtl)) {
</div>
</div>
<div class="form-row" id="VIEWCAPdiv3" style="padding: 0px;">
<div class="col-md-9 col-md-offset-4" align="right">
<div class="col-md-9 col-md-offset-4" style="text-align:right !important">
<label>Other Allowances <?php echo "($INR)" ?></label>
</div>
<div class="form-group col-md-3">
@ -3340,7 +3344,7 @@ if (!empty($getlogpodtl)) {
</div>
</div>
<div class="form-row" id="" style="padding: 0px;">
<div class="col-md-9 col-md-offset-4" align="right">
<div class="col-md-9 col-md-offset-4" style="text-align:right !important">
<label>Total Amount <?php echo "($INR)" ?></label>
</div>
<div class="form-group col-md-3">
@ -3642,7 +3646,7 @@ if (!empty($getlogpodtl)) {
<div class="form-group col-md-4">
</div>
</div>
<div class="form-group col-md-6" align="right" style="display:none;"> <label>Total Order Amount
<div class="form-group col-md-6" style="text-align:right !important" style="display:none;"> <label>Total Order Amount
:</label></div>
<div class="form-group col-md-6" style="display:none;">
<div class="form-group">
@ -4776,12 +4780,13 @@ if (!empty($getlogpodtl)) {
// PendingQuantity: quantity
// }));
PONOStatus = <?php echo $PONOStatus; ?>
var shorten = materialName.length > 13 ? materialName.slice(0, 13) + "..." : materialName;
var rowHtml = `
<tr id="${temp}">
<td align="left">${temp}</td>
<td align="left">${Reqnumber}</td>
<td align="left">${materialCode}</td>
<td align="left">${materialName}</td>`;
<td align="left">${shorten}</td>`;
if (PONOStatus === "PO_DRAFT" || PONOStatus === "PO_CREATED") {
rowHtml += `<td><a href="#" class="editable-field"
data-id="${temp}"
@ -4792,12 +4797,12 @@ if (!empty($getlogpodtl)) {
<button class="cancel-btn"></button>
</div></td>`;
}else{ rowHtml += `<td>-</td>`; }
rowHtml += `<td align="right">${quantity}</td>
<td align="right">${uom}</td>
<td align="right">${itemRate}</td>
<td align="right">${basicval}</td>
<td align="right">${TotalTaxValue}</td>
<td align="right">${Total}</td>
rowHtml += `<td style="text-align:right !important">${quantity}</td>
<td style="text-align:right !important">${uom}</td>
<td style="text-align:right !important">${itemRate}</td>
<td style="text-align:right !important">${basicval}</td>
<td style="text-align:right !important">${TotalTaxValue}</td>
<td style="text-align:right !important">${Total}</td>
<td>
<a data-target='#EDITCAPITAL' data-id="${temp}" data-userid="${temp}" data-toggle="modal" href="#EDITREVENUE">
<i class="ri-pencil-fill" data-toggle="tooltip" ></i>
@ -5358,15 +5363,8 @@ if (!empty($getlogpodtl)) {
type: "POST",
url: "<?php echo base_url() ?>purchaseorder/DeletePODetails",
success: function (data) {
$('#loader').show();
if (data) {
// $('#content').loader('hide');
alert(data);
} else {
alert("Error");
}
$('#loader').hide();
(data) ? alert(response) : alert("Error");
}
});
}
@ -5996,26 +5994,25 @@ if (!empty($getlogpodtl)) {
basicAmountRate = parseFloat($('#CapitalBasicOrder').val()) - parseFloat($('#txtTotalDiscount').val());
}
if (validate()) {
if (document.getElementById('serviceTax').rows.length < 2) {
alert('Please Select Line item to Create PO');
$('#Deliverydt').focus();
return false;
} else if ($('#Otherpayment').val() == '' && $('#PaymentMethod').val() == 'PT08') {
alert('Please Enter Other Payable Terms Description');
$('#Otherpayment').focus();
return false;
}
if (capitalValidate()) {
// if (document.getElementById('serviceTax').rows.length < 2) {
// alert('Please Select Line item to Create PO');
// $('#Deliverydt').focus();
// return false;
// } else if ($('#Otherpayment').val() == '' && $('#PaymentMethod').val() == 'PT08') {
// alert('Please Enter Other Payable Terms Description');
// $('#Otherpayment').focus();
// return false;
// }
// else if(parseInt(AvlBudAmt) < parseInt(basicAmountRate)) {
// alert('Total Order Amount is exceeding the Budget Limit.Please adjust the product value.');
// return false;
// }
else {
// } else {
//alert('else');
$('#loader').show();
// disableButtons();
//alert('ss');
var formData = new FormData($('.CapitalPO')[0]);
formData.append('ExchangeRateOn', ExchangeRateOn);
@ -6066,15 +6063,17 @@ if (!empty($getlogpodtl)) {
clearAfterAddLineItemAdd();
window.location = "purchaseorderListing";
// <!-- setTimeout(function() { enableButtons(); }, 2000); -->
} else {
// $('#content').loader('hide');
alert("Error");
// setTimeout(function() { enableButtons(); }, 2000);
}
}
});
}
// }
}
}

View File

@ -6,6 +6,13 @@
label {
font-style: bold;
}
input[type="file"] {
white-space: normal;
word-wrap: break-word;
overflow-wrap: break-word;
width: 100%;
}
</style>
<?php
@ -237,6 +244,11 @@ if (!empty($EmpDetails)) {
<input type='file' onchange="readURL(this);" id="photo"
name="photo" />
<?php if($Emp->ProfilePic){ ?>
<br/>
<label style="white-space: normal; word-wrap: break-word; overflow-wrap: break-word; width: 100%;"><span>previously uploaded profile picture - </span>
<small><?= $Emp->ProfilePic; ?></small></label>
<?php } ?>
<input type="hidden" name="oldImageName" id="Image"
value="<?php echo $Emp->ProfilePic; ?>" class="form-control"
@ -690,25 +702,25 @@ if (!empty($EmpDetails)) {
<div class="col-md-11">
<div class="row">
<div class="col-md-3">
<label>Bank Name</label>
<label>Bank Name<span class="badge">*</span></label>
<input type="text" id="bankbranchname" name="bankbranchname"
class="form-control"
value="<?php echo $BankBranchName; ?>" required>
</div>
<div class="col-md-3">
<label>Account Number</label>
<label>Account Number<span class="badge">*</span></label>
<input type="text" id="accountno" maxlength="20"
name="accountno" placeholder="Account Number"
class="form-control"
value="<?php echo $BankAccountNo; ?>"
onkeypress="return isNumberKey(event)">
onkeypress="return isNumberKey(event)" required>
</div>
<div class="col-md-3">
<label>IFSC Code</label>
<label>IFSC Code<span class="badge">*</span></label>
<input type="text" id="ifsccode" name="ifsccode" onkeyup="convertToUpperCase()"
placeholder="IFSC Code" class="form-control"
value="<?php echo $IFSCCode; ?>">
value="<?php echo $IFSCCode; ?>" required>
</div>
<div class="col-md-3">
<label>Bank Address</label>
@ -1124,7 +1136,7 @@ if (!empty($EmpDetails)) {
<div class="row">
<div class="col-md-4"></div>
<div class="col-md-3">
<label>Bank PassBok Name</label>
<label>Bank Passbook Name</label>
<input type="text" id="file_name" name="file_name4"
maxlength="255" class="form-control"
value="Bank Passbook" readonly>
@ -1142,7 +1154,7 @@ if (!empty($EmpDetails)) {
<?php } ?>
<div class="col-md-4">
<label>Update Bank PassBok File</label><br>
<label>Update Bank Passbook File</label><br>
<input type="file" name="emp_file4" class="">
</div>
@ -1251,13 +1263,13 @@ if (!empty($EmpDetails)) {
<div class="row">
<div class="col-md-4"></div>
<div class="col-md-4">
<label>Bank PassBok Name</label>
<label>Bank Passbook Name</label>
<input type="text" id="file_name" name="file_name4"
maxlength="255" class="form-control"
value="Bank Passbook">
</div>
<div class="col-md-4">
<label>Bank PassBok File</label>
<label>Bank Passbook File</label>
<input type="file" name="emp_file4" class="">
</div>
</div>
@ -1334,6 +1346,15 @@ if (!empty($EmpDetails)) {
}
});
$("#currentaddress, #permanentaddress").on("keyup change", function () {
if ($("#currentaddress").val().trim() === $("#permanentaddress").val().trim()) {
$("#checksame").prop("disabled", false);
$("#checksame").prop("checked", true);
} else {
$("#checksame").prop("disabled", true);
$("#checksame").prop("checked", false);
}
});
});
@ -1720,6 +1741,13 @@ if (!empty($EmpDetails)) {
$('#Total_salary').prop('required', false);
$('#Total_salary').prop('readonly', true);
}
if ($("#currentaddress").val().trim() === $("#permanentaddress").val().trim()) {
$("#checksame").prop("disabled", false); // Enable checkbox
$("#checksame").prop("checked", true); // Optionally check it
} else {
$("#checksame").prop("disabled", true); // Disable checkbox
$("#checksame").prop("checked", false);
}
$("#gender").select2();
$("#MartialStatus").select2();
$("#desigination").select2();
@ -1898,6 +1926,48 @@ if (!empty($EmpDetails)) {
}
});
$('#ContactNumber').change(function() {
var ContactNumber = $('#ContactNumber').val();
if (getMobileValidation() && ContactNumber != "<?= $ContactNumber ?>") {
$('#loader').show();
$.ajax({
data: {
ContactNumber
},
type: "POST",
url: "<?php echo base_url(); ?>employeeMobileExist",
success: function(response) {
$('#loader').hide();
let responseCheck = response.data[0];
let responseContactNumber=response.data[0].ContactNumber;
if(responseCheck ){
if (responseContactNumber == ContactNumber) {
var answer = confirm(" Contact Number details is already exists !!.Kindly Provide us another Contact Number"
)
$('#ContactNumber').val('');
$('#ContactNumber').focus();
return false;
}
}
},
complete: function() {
$('#loader').hide(); // Ensure the loader is always hidden after the request completes
}
});
}
});
$('#panno').change(function () {
var panNo = $('#panno').val();

View File

@ -1198,17 +1198,22 @@ if (!empty($RequistionDetails)) {
<br />
<div class="form-row">
<div class="table-responsive">
<table id="ImportTax" class="table table-striped table-hover mb-0" style="font-size:12px;">
<div class="table-responsive" style="padding-bottom: 30px;">
<table id="ImportTax" class="table nowrap table-bordered table-hover mb-0" style="font-size:12px;">
<thead>
<tr>
<th>SNo</th>
<th>Requisition No</th>
<th>Item Name</th>
<th>Quantity</th>
<th>UOM</th>
<th>Rate<?php echo $INR ?></th>
<th>Basic Amount<?php echo $INR ?></th>
<th style="white-space: nowrap !important; text-align:left !important">SNo</th>
<th style="white-space: nowrap !important; text-align:center !important">Requisition No</th>
<th style="white-space: nowrap !important; text-align:left !important">Item Description</th>
<th style="white-space: nowrap !important; text-align:right !important">Quantity</th>
<th style="white-space: nowrap !important; text-align:left !important">UOM</th>
<th style="white-space: nowrap !important; text-align:right !important">Rate<?php echo $INR ?></th>
<th style="white-space: nowrap !important; text-align:right !important">Basic Amount<?php echo $INR ?></th>
<!-- <th>Tax Amount</th>
<th>Total Order Amount</th> -->
<th>Action</th>
@ -1225,13 +1230,14 @@ if (!empty($RequistionDetails)) {
?>
<tr id="<?php echo $index; ?>">
<td align="left"><?php echo $index; ?></td>
<td><?php echo $record->ReqNo ?></td>
<td><?php echo $record->MaterialName ?></td>
<td><?php echo $record->Quantity ?></td>
<td><?php echo $index; ?></td>
<td style="text-align:center !important"><?php echo $record->ReqNo ?></td>
<td><?php $shortName = mb_strimwidth($record->MaterialName, 0, 13, "...");
echo $shortName; ?></td>
<td style="text-align:right !important"><?php echo $record->Quantity ?></td>
<td><?php echo $record->UOM ?></td>
<td><?php echo $record->Rate ?></td>
<td><?php echo $record->BasicValue ?></td>
<td style="text-align:right !important"><?php echo $record->Rate ?></td>
<td style="text-align:right !important"><?php echo $record->BasicValue ?></td>
<!-- <td><?php echo $record->Taxamount ?></td>
<td><?php echo $record->TotalOrderValue ?></td> -->
<input type="hidden" name="<?php echo 'Reqnumber' . $index ?>" id="<?php echo 'Reqnumber' . $index ?>" value="<?php echo $record->ReqNo; ?>" />
@ -2920,13 +2926,14 @@ if (!empty($RequistionDetails)) {
if (validate() && Budgetcheck()) {
if (document.getElementById('ImportTax').rows.length <= 0) {
// if (document.getElementById('ImportTax').rows.length <= 0) {
alert('Please Select Line item to Create PO');
$('#Deliverydt').focus();
return false;
} else {
// alert('Please Select Line item to Create PO');
// $('#Deliverydt').focus();
// return false;
// } else {
$('#loader').show();
// disableButtons();
var formData = new FormData($('.ImportPO')[0]);
if (status == 0) { // for draft
@ -2957,21 +2964,29 @@ if (!empty($RequistionDetails)) {
//$('#txtDeliveryAddress').val('');
window.location = status == 1 ? "amendmentpurchaseorder" : "purchaseorderListing";
// setTimeout(function() { enableButtons(); }, 2000);
} else {
alert("Error");
// setTimeout(function() { enableButtons(); }, 2000);
}
},
error : function (){
console.error(error);
// setTimeout(function() { enableButtons(); }, 2000);
},
complete : function (){
console.log("ajax call is completed ");
// setTimeout(function() { enableButtons(); }, 2000);
}
});
}
// }
}
}

View File

@ -26,6 +26,7 @@ if (!empty($materialDetails)) {
$UOM = $MD->UOM;
$remarks = $MD->Remarks;
$HSNcode = $MD->HSNCODE;
$material_rate = $MD->material_rate;
$openstock = $MD->stock;
$date = $MD->stockdate;
$reorder = $MD->reorder;
@ -84,10 +85,11 @@ if ($total <= $reorder) {
$("#Date").datepicker({
//minDate :'now',
//maxDate : 'now',
dateFormat: 'dd-mm-yy',
format: 'dd-mm-yyyy',
changeMonth: true,
changeYear: true,
yearRange: '-100:+1'
yearRange: '-100:+1',
orientation: 'bottom',
});
});
</script>
@ -161,25 +163,25 @@ if ($total <= $reorder) {
</select>
</div>
</div>
<div class="col-md-3">
<div class="form-group">
<label for="MaterialCategory">Material Category
<span class="badge">*</span></label>
<!-- <i type="button" class="fe-plus-circle" id="addMaterialCaterogyModalButton"
<span class="badge">*</span></label>
<!-- <i type="button" class="fe-plus-circle" id="addMaterialCaterogyModalButton"
style="font-size: 16px; color:rgb(15, 155, 218);" data-toggle="modal" data-target="#addMaterialCaterogyModal"
title="Add Material Caterogy">
</i> -->
<select class="form-control select2" id="MaterialCategory" name="MaterialCategory" required>
<?php
if (!empty($materialCategory)) {
foreach ($materialCategory as $SID) {
?>
<option value="<?php echo $SID->Key ?>" <?php if ($MaterialCategory === $SID->Key) echo "selected"; ?>><?php echo $SID->ConfigValue ?></option>
<?php
}
<select class="form-control select2" id="MaterialCategory" name="MaterialCategory" required>
<?php
if (!empty($materialCategory)) {
foreach ($materialCategory as $SID) {
?>
<option value="<?php echo $SID->Key ?>" <?php if ($MaterialCategory === $SID->Key) echo "selected"; ?>><?php echo $SID->ConfigValue ?></option>
<?php
}
?>
}
?>
</select>
</div>
</div>
@ -211,6 +213,12 @@ if ($total <= $reorder) {
<input type="text" class="form-control" id="HSNcode" name="HSNcode" maxlength="8" value="<?php echo $HSNcode; ?>" onkeypress="return isNumberKey(event)">
</div>
</div>
<div class="col-md-3">
<div class="form-group">
<label for="Rate">Rate<span class="badge">*</span></label>
<input type="text" class="form-control" id="material_rate" onkeypress="return isNumberKey(event)" value="<?php echo $material_rate; ?>" name="material_rate" required>
</div>
</div>
<?php if ($openstock != "") { ?>
<div class="col-md-3">
<div class="form-group">
@ -226,25 +234,32 @@ if ($total <= $reorder) {
</div>
</div>
<?php } ?>
</div>
<div class="form-row mb-3">
<?php if ($date != "") { ?>
<div class="col-md-3">
<div class="form-group">
<label>Open Stock Date</label>
<input type="text" name="Date" id="Date" class="form-control" value="<?php echo $date; ?>" readonly>
<?php
$formattedDate = get_date_time_dynamical_format('Y-m-d','d-m-Y',"$date");
$data = array('name' => 'Date', 'value' => set_value('Date',$formattedDate), 'id' => 'Date', 'class' => 'form-control', 'onkeypress' => 'return false;','readonly'=>true, 'autocomplete'=>'"off"');
echo form_input($data);
?>
<!-- <input type="text" name="Date" id="Date" class="form-control" value="<?php echo $date; ?>" readonly> -->
</div>
</div>
<?php } else { ?>
<div class="col-md-3">
<div class="form-group">
<label>Open Stock Date</label>
<input type="text" name="Date" id="Date" class="form-control" readonly>
<?php
$data = array('name' => 'Date', 'value' => set_value('Date'), 'id' => 'Date', 'class' => 'form-control', 'onkeypress' => 'return false;', 'autocomplete'=>'"off"');
echo form_input($data);
?>
<!-- <input type="text" name="Date" id="Date" class="form-control" readonly> -->
</div>
</div>
<?php } ?>
</div>
<div class="form-row mb-3">
<div class="col-md-3">
<div class="form-group">
<label for="reorder">Reorder Level</label>
@ -264,19 +279,27 @@ if ($total <= $reorder) {
<input type="text" class="form-control" id="avg_price" name="avg_price" readonly value="<?php echo $Average_Value ?>" maxlength="255">
</div>
</div>
</div>
<div class="form-row mb-3">
<div class="col-md-3">
<div class="form-group">
<label for="remarks">Remarks</label>
<input type="text" class="form-control" id="remarks" name="remarks" maxlength="255" value="<?php echo $remarks; ?>">
</div>
</div>
</div>
<div class="form-row mb-3">
<div class="col-md-3">
<div class="form-group">
<label class="switch">
<input type="checkbox" id="isactive" name="isactive" <?php echo $IsActive; ?> />
<span class="slider"></span>
</label>
<label class="mt-4">Is Active</label>
</div>
</div>
<div class="col-md-2">
<div class="form-group">
<label for="isactive">Is Active</label><br />
<input type="checkbox" id="isactive" name="isactive" <?php echo $IsActive; ?>>
</div>
</div>
</div>
@ -284,9 +307,9 @@ if ($total <= $reorder) {
</div>
</div>
<div class="box-footer text-right">
<button type="button" class="btn btn-secondary" onclick="history.back()">
<span class="bold">Cancel</span>
</button>
<button type="button" class="btn btn-secondary" onclick="history.back()">
<span class="bold">Cancel</span>
</button>
<input type="button" id="editRawMaterialBtnId" class="btn btn-success" value="Submit" />
</div>
</form>
@ -304,28 +327,28 @@ if ($total <= $reorder) {
<!-- modal -->
<div class="modal fade" id="addMaterialCaterogyModal" tabindex="-1" aria-labelledby="addMaterialCaterogyModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="addMaterialCaterogyModalLabel">Add Material Category</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<form id="addMaterialCategoryForm">
<div class="form-group">
<label for="materialCategoryInput">Material Category</label>
<input type="text" class="form-control" id="materialCategoryInput" placeholder="Enter material category">
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
<button type="button" class="btn btn-primary" onclick="addMaterialCategory()">Save Category</button>
</div>
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="addMaterialCaterogyModalLabel">Add Material Category</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<form id="addMaterialCategoryForm">
<div class="form-group">
<label for="materialCategoryInput">Material Category</label>
<input type="text" class="form-control" id="materialCategoryInput" placeholder="Enter material category">
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
<button type="button" class="btn btn-primary" onclick="addMaterialCategory()">Save Category</button>
</div>
</div>
</div>
</div>
</div>
@ -399,14 +422,14 @@ if ($total <= $reorder) {
return true;
}
$('#editRawMaterialBtnId').click(function(){
$('#editRawMaterialBtnId').click(function() {
var materialName = $('#MaterialName').val();
var materialCode = $('#RMcode').val();
var materialCategory = $('#MaterialCategory').val();
var materialType = $('#MaterialType').val();
if(materialName == ''){
if (materialName == '') {
return;
}
@ -414,31 +437,35 @@ if ($total <= $reorder) {
$('#loader').show();
$.ajax({
data: {materialCode,materialName,materialCategory},
data: {
materialCode,
materialName,
materialCategory
},
type: "POST",
url: "<?php echo base_url(); ?>materialExist",
success: function(data) {
if (data && data.length >= 1) {
$('#loader').hide();
let message = "";
if (data[0]?.IsActive == 1) {
message = "Material name already exists!\n\n";
} else {
message = "Material name already exists in the deleted section!\n\n";
}
let message = "";
if (data[0]?.IsActive == 1) {
message = "Material name already exists!\n\n";
} else {
message = "Material name already exists in the deleted section!\n\n";
}
let related_name = "";
$.each(data, function(i, obj) {
related_name += obj.MaterialCode + " - " + obj.MaterialName + " - " + obj.MaterialType + " - " + obj.CategoryName + "\n";
});
let related_name = "";
$.each(data, function(i, obj) {
related_name += obj.MaterialCode + " - " + obj.MaterialName + " - " + obj.MaterialType + " - " + obj.CategoryName + "\n";
});
message += "'" + materialName + "' - related materials are:\n\n" + related_name;
message += "'" + materialName + "' - related materials are:\n\n" + related_name;
alert(message);
alert(message);
$("#MaterialName").val('');
$("#MaterialName").focus();
$("#MaterialName").val('');
$("#MaterialName").focus();
} else {
$('#loader').hide();
console.log("working")
@ -450,7 +477,7 @@ if ($total <= $reorder) {
$('#loader').hide();
alert("Error Occur");
},
complete: function(){
complete: function() {
$('#loader').hide();
console.log("Ajax completed..!!");
}
@ -461,7 +488,7 @@ if ($total <= $reorder) {
<script>
function addMaterialCategory (){
function addMaterialCategory() {
$('#materialCategoryInput').val()
@ -482,11 +509,9 @@ if ($total <= $reorder) {
<script>
$(document).on('keydown', function(event) {
if (event.key === 'Enter') {
event.preventDefault(); // Prevent default Enter key behavior
}
});
</script>
$(document).on('keydown', function(event) {
if (event.key === 'Enter') {
event.preventDefault(); // Prevent default Enter key behavior
}
});
</script>

View File

@ -1218,21 +1218,20 @@ if (!empty($INRSYMBOL)) {
</div>
<br>
<div class="form-row">
<div class="table-responsive">
<table id="revenueTax" class="table table-striped table-hover mb-0"
style="font-size:12px;">
<div class="table-responsive" style="padding-bottom: 30px;">
<table id="ServiceTable" class="table table-bordered table-hover" style="font-size:12px;">
<thead>
<tr>
<th>SNo</th>
<th>Requisition No</th>
<th>Item Name</th>
<th class="text-center">Quantity</th>
<th>UOM</th>
<th class="text-right">Rate<?php echo "($INRSYM)" ?></th>
<th class="text-right">Basic Amount<?php echo "($INRSYM)" ?></th>
<th class="text-right">Tax Amount<?php echo "($INRSYM)" ?></th>
<th class="text-right">Total Order Amount<?php echo "($INRSYM)" ?></th>
<th style="white-space: nowrap !important;">SNo</th>
<th class="text-center" style="white-space: nowrap !important;">Requisition No</th>
<th style="white-space: nowrap !important;">Item Description</th>
<th class="text-right" style="white-space: nowrap !important;">Quantity</th>
<th style="white-space: nowrap !important;">UOM</th>
<th class="text-right" style="white-space: nowrap !important;">Rate<?php echo "($INRSYM)" ?></th>
<th class="text-right" style="white-space: nowrap !important;">Basic Amount<?php echo "($INRSYM)" ?></th>
<th class="text-right" style="white-space: nowrap !important;">Tax Amount<?php echo "($INRSYM)" ?></th>
<th class="text-right" style="white-space: nowrap !important;">Total Order Amount<?php echo "($INRSYM)" ?></th>
<th>Action</th>
</tr>
</thead>
@ -1248,17 +1247,18 @@ if (!empty($INRSYMBOL)) {
?>
<tr id="<?php echo $index; ?>">
<td align="left"><?php echo $index; ?></td>
<td><?php echo $record->ReqNo ?></td>
<td><?php echo $record->MaterialName ?></td>
<td align="center"><?php echo $record->Quantity ?></td>
<td class="text-center"><?php echo $record->ReqNo ?></td>
<td><?php $shortName = mb_strimwidth($record->MaterialName, 0, 13, "...");
echo $shortName; ?></td>
<td class="text-right"><?php echo $record->Quantity ?></td>
<td><?php echo $record->UOM ?></td>
<td align="right"><?php echo $record->Rate ?></td>
<td class="text-right"><?php echo $record->Rate ?></td>
<td align="right">
<td class="text-right">
<?php echo number_format($record->BasicValue, 2, '.', '') ?></td>
<td align="right"><?php echo $record->Taxamount ?></td>
<td align="right"><?php echo $record->TotalValue ?></td>
<td class="text-right"><?php echo $record->Taxamount ?></td>
<td class="text-right"><?php echo $record->TotalValue ?></td>
<input type="hidden" name="<?php echo 'Reqnumber' . $index ?>"
id="<?php echo 'Reqnumber' . $index ?>"
value="<?php echo $record->ReqNo; ?>" />
@ -2547,21 +2547,21 @@ if (!empty($INRSYMBOL)) {
var txtTotBasicAmount = $('#txtTotBasicAmount').val();
var txtTotalDiscount = $('#txtTotalDiscount').val();
//alert('Before Validate IF condition');
if (validate()) {
if (revenueValidate()) {
//alert('insdie Validate IF condition');
var realrows = document.getElementById('txtRowCount').value;
//alert(realrows);
if (document.getElementById('revenueTax').rows.length < 2) {
alert('Please Select Line item to Create PO');
$('#Deliverydt').focus();
return false;
}
// if (document.getElementById('revenueTax').rows.length < 2) {
// alert('Please Select Line item to Create PO');
// $('#Deliverydt').focus();
// return false;
// }
// else if(parseInt(AvlBudAmt) < (parseInt(txtTotBasicAmount) - parseInt(txtTotalDiscount))) {
// alert('Total Order Amount is exceeding the Budget Limit.Please adjust the product value.');
// return false;
// }
else {
// else {
//alert('final else for store data');
// $('.content').loader('show');
var formData = new FormData($('.CreatePO')[0]);
@ -2574,6 +2574,7 @@ if (!empty($INRSYMBOL)) {
};
$('#loader').show();
// disableButtons();
$.ajax({
// data:$('.CreatePO').serialize(),
type: "POST",
@ -2592,22 +2593,25 @@ if (!empty($INRSYMBOL)) {
$('#txtDeliveryAddress').val('')
window.location = (status == 1) ? "amendmentpurchaseorder" : "purchaseorderListing";
// setTimeout(function() { enableButtons(); }, 2000);
} else {
$('#loader').hide();
// setTimeout(function() { enableButtons(); }, 2000);
}
},
error : function(error){
console.error("error occured" + error);
// setTimeout(function() { enableButtons(); }, 2000);
},
complete : function (){
$('#loader').hide();
console.log("ajax call is completed ..!!")
// setTimeout(function() { enableButtons(); }, 2000);
}
});
}
// }
}
}

View File

@ -191,7 +191,7 @@ $Reqon = '';
$RequesterName = '';
if (!empty($POMaster)) {
//print_r($POMaster);
// dd($POMaster);
//print_r($POItem);
foreach ($POMaster as $Req) {
$parentPO = $Req->ParentPO;
@ -218,6 +218,7 @@ if (!empty($POMaster)) {
$DeliveryAddress = $Req->DeliveryAddress;
$PONOStatus = $Req->StatusCode;
// dd($PONOStatus);
$PONO = $Req->PONO;
$ServiceDescription = $Req->ServiceDescription;
$CapitalRange = $Req->CapitalRange;
@ -2131,9 +2132,10 @@ if (!empty($getlogpodtl)) {
<div class="form-group col-md-3" id="Deliverydtdiv">
<label>Delivery Date<span class="text-danger">*</span></label>
<div class="form-group">
<input class="form-control num" data-provide="datepicker" data-date-format="dd-mm-yyyy" data-date-autoclose="true" id="Deliverydt" name="Deliverydt" data-date-start-date="<?= date('d-m-Y'); ?>" required autocomplete="off" value="<?= $Deliverydt; ?>">
<?php
$data = array('name' => 'Deliverydt', 'value' => set_value('Deliverydt', $Deliverydt), 'id' => 'Deliverydt', 'class' => 'form-control num', 'required' => 'true', 'onkeypress' => 'return false;');
echo form_input($data);
// $data = array('name' => 'Deliverydt', 'value' => set_value('Deliverydt', $Deliverydt), 'id' => 'Deliverydt', 'class' => 'form-control num', 'required' => 'true', 'onkeypress' => 'return false;');
// echo form_input($data);
?>
</div>
@ -2160,9 +2162,10 @@ if (!empty($getlogpodtl)) {
<div class="form-group col-md-3">
<label>Purchase Order Date</label>
<div class="form-group">
<input class="form-control num" data-provide="datepicker" data-date-format="dd-mm-yyyy" data-date-autoclose="true" id="PODate" name="PODate" data-date-start-date="<?= date('d-m-Y'); ?>" required autocomplete="off" value="<?= $PODate; ?>">
<?php
$data = array('name' => 'PODate', 'value' => set_value('PODate', $PODate), 'id' => 'PODate', 'class' => 'form-control num', 'required' => 'true', 'onkeypress' => 'return false;');
echo form_input($data);
// $data = array('name' => 'PODate', 'value' => set_value('PODate', $PODate), 'id' => 'PODate', 'class' => 'form-control num', 'required' => 'true', 'onkeypress' => 'return false;');
// echo form_input($data);
?> <input type="hidden" name="b4podate" id="b4podate" value="<?php echo $PODate; ?>">
</div>
</div>
@ -2325,34 +2328,33 @@ if (!empty($getlogpodtl)) {
</div>
<br>
<div class="form-row">
<div class="table-responsive" style="padding-bottom:30px;">
<table id="revenueTax" class="table table-bordered table-hover"
style="font-size:12px;">
<div class="table-responsive" style="padding-bottom: 30px;">
<table id="revenueTax" class="table nowrap table-bordered table-hover mb-0" style="font-size:12px;">
<thead>
<tr>
<th style="text-align:center !important">SNo</th>
<th style="text-align:center !important">Requisition No</th>
<th style="text-align:center !important">Item Code</th>
<th style="text-align:left !important">Item Description</th>
<th style="text-align:center !important">Line Item Specs</th>
<th style="text-align:center !important">Quantity</th>
<th style="text-align:center !important">UOM</th>
<th style="text-align:right !important">Rate <?php echo "($INRSYM)" ?>
<th style="white-space: nowrap !important; text-align:left !important">SNo</th>
<th style="white-space: nowrap !important; text-align:center !important">Requisition No</th>
<th style="white-space: nowrap !important; text-align:left !important">Item Code</th>
<th style="white-space: nowrap !important; text-align:left !important">Item Description</th>
<th style="white-space: nowrap !important; text-align:left !important">Line Item Specs</th>
<th style="white-space: nowrap !important; text-align:right !important">Quantity</th>
<th style="white-space: nowrap !important; text-align:left !important">UOM</th>
<th style="white-space: nowrap !important; text-align:right !important">Rate <?php echo "($INRSYM)" ?>
</th>
<th style="text-align:right !important">Basic Amount
<th style="white-space: nowrap !important; text-align:right !important">Basic Amount
<?php echo "($INRSYM)" ?>
</th>
<th style="text-align:right !important">Tax Amount
<th style="white-space: nowrap !important; text-align:right !important">Tax Amount
<?php echo "($INRSYM)" ?>
</th>
<th style="text-align:right !important">Total Order Amount
<th style="white-space: nowrap !important; text-align:right !important">Total Order Amount
<?php echo "($INRSYM)" ?>
</th>
<!-- <th>Actual Quantity</th>
<th>Received Quantity</th>
<th>Pending Quantity</th> -->
<th style="text-align:center !important">Action</th>
<th style="white-space: nowrap !important; text-align:left !important">Action</th>
</tr>
</thead>
<tbody id='RevenueAppend'>
@ -2364,11 +2366,12 @@ if (!empty($getlogpodtl)) {
$index = $index + 1;
?>
<tr id="<?php echo $index; ?>">
<td align="center"><?php echo $index; ?></td>
<td align="left"><?php echo $index; ?></td>
<td align="center"><?php echo $record->ReqNo ?></td>
<td align="center"><?php echo $record->MaterialCode ?></td>
<td align="left"><?php echo $record->MaterialName ?></td>
<td>
<td align="left"><?php echo $record->MaterialCode ?></td>
<td align="left"><?php $shortName = mb_strimwidth($record->MaterialName, 0, 13, "...");
echo $shortName; ?></td>
<td align="left">
<?php if ($PONOStatus === PO_DRAFT || $PONOStatus === PO_CREATED) { ?>
<a href="#"
class="editable-field"
@ -2382,8 +2385,8 @@ if (!empty($getlogpodtl)) {
</div>
<?php }else{ echo !empty($record->LineitemAuditorNotes) ? $record->LineitemAuditorNotes : "-"; } ?>
</td>
<td align="center"><?php echo $record->Quantity ?></td>
<td align="center"><?php echo $record->UOM ?></td>
<td align="right"><?php echo $record->Quantity ?></td>
<td align="left"><?php echo $record->UOM ?></td>
<td align="right"><?php echo $record->Rate ?></td>
<td align="right">
@ -4477,7 +4480,10 @@ if (!empty($getlogpodtl)) {
});
index = parseInt(index) + 1;
// $PONOStatus == PO_DRAFT || $PONOStatus == PO_CREATED
PONOStatus = <?php echo $PONOStatus; ?>
var PONOStatus = <?php echo '"'.$PONOStatus.'"'; ?>
console.log("PONOStatus",PONOStatus);
var shorten = materialName.length > 13 ? materialName.slice(0, 13) + "..." : materialName;
// var template = jQuery("#RevenueList").html();
@ -4503,11 +4509,11 @@ if (!empty($getlogpodtl)) {
var rowHtml = `
<tr id="${temp}">
<td align="left">${temp}</td>
<td align="left">${Reqnumber}</td>
<td align="center">${Reqnumber}</td>
<td align="left">${materialCode}</td>
<td align="left">${materialName}</td>`;
<td align="left">${shorten}</td>`;
if (PONOStatus === "PO_DRAFT" || PONOStatus === "PO_CREATED") {
rowHtml += `<td><a href="#" class="editable-field"
rowHtml += `<td align="left"><a href="#" class="editable-field"
data-id="${temp}"
data-notes="-">-</a>
<div class="edit-container" style="display:none;">
@ -4515,9 +4521,9 @@ if (!empty($getlogpodtl)) {
<button class="save-btn"></button>
<button class="cancel-btn"></button>
</div></td>`;
}else{ rowHtml += `<td>-</td>`; }
}else{ rowHtml += `<td align="left">-</td>`; }
rowHtml += `
<td align="left">${quantity}</td>
<td align="right">${quantity}</td>
<td align="left">${uom}</td>
<td align="right">${itemRate}</td>
<td align="right">${basicval}</td>
@ -5087,12 +5093,7 @@ if (!empty($getlogpodtl)) {
url: "<?php echo base_url() ?>purchaseorder/DeletePODetails",
success: function (data) {
$('#loader').hide();
if (data) {
alert(data);
} else {
alert("Error");
}
(data) ? alert(response) : alert("Error");
}
});
@ -5377,12 +5378,12 @@ if (!empty($getlogpodtl)) {
var totaldiscount = $('#txtTotalDiscount').val();
//alert(txtTotalbasicamount+'-'+totaldiscount);
//alert(txtTotalbasicamount-totaldiscount);
if (validate()) {
if (document.getElementById('revenueTax').rows.length < 2) {
alert('Please Select Line item to Create PO');
$('#Deliverydt').focus();
return false;
}
if (revenueValidate()) {
// if (document.getElementById('revenueTax').rows.length < 2) {
// alert('Please Select Line item to Create PO');
// $('#Deliverydt').focus();
// return false;
// }
//else if(validateBudgetExceedLimit())
//{
// return false;
@ -5392,17 +5393,18 @@ if (!empty($getlogpodtl)) {
// return false;
// }
else if ($('#Otherpayment').val() == '' && $('#PaymentTerms').val() == 'PT08') {
alert('Please Enter Payable Terms Description');
$('#Otherpayment').focus();
return false;
} else if ($('#insurancestatus').val() == 1 && $('#InsuranceNumber').val() == '') {
alert('Please Enter Insurance No / Insurance Details..!');
$('#insurance').focus();
return false;
} else {
// else if ($('#Otherpayment').val() == '' && $('#PaymentTerms').val() == 'PT08') {
// alert('Please Enter Payable Terms Description');
// $('#Otherpayment').focus();
// return false;
// } else if ($('#insurancestatus').val() == 1 && $('#InsuranceNumber').val() == '') {
// alert('Please Enter Insurance No / Insurance Details..!');
// $('#insurance').focus();
// return false;
// } else {
var formData = new FormData($('.CreatePO')[0]);
$('#loader').show();
// disableButtons();
$.ajax({
type: "POST",
url: "<?php echo base_url() ?>purchaseorder/EditRevenuePurchaseOrder",
@ -5420,9 +5422,11 @@ if (!empty($getlogpodtl)) {
$('#SpcialInstruction').val('');
$('#txtDeliveryAddress').val('')
window.location = "purchaseorderListing";
// setTimeout(function() { enableButtons(); }, 2000);
} else {
alert("Something went wrong");
// setTimeout(function() { enableButtons(); }, 2000);
}
},
@ -5431,6 +5435,7 @@ if (!empty($getlogpodtl)) {
$('#loader').hide();
console.error("AJAX Error: ", textStatus, errorThrown);
alert("An error occurred: " + textStatus + " - " + errorThrown);
// setTimeout(function() { enableButtons(); }, 2000);
},
@ -5438,10 +5443,11 @@ if (!empty($getlogpodtl)) {
// // Actions that should always happen regardless of success or error
// console.log("AJAX request completed.");
// $('#loader').hide(); // Hide the loader in any case
// setTimeout(function() { enableButtons(); }, 2000);
// }
});
}
// }
}
}
$(document).ready(function () {

View File

@ -1012,165 +1012,170 @@ foreach ($PaymentTerms as $TER) {
<br />
<table id="ServiceTable" class="table table-bordered table-hover" style="background-color:#fff;font-size:12px;">
<thead>
<tr>
<th>SNo</th>
<th>Requisition No</th>
<th>Item Code</th>
<th>Item Name</th>
<th>Quantity</th>
<th>UOM</th>
<th>Rate<?php echo $INRSYM ?></th>
<th>Basic Amount<?php echo $INRSYM ?></th>
<th>Tax Amount<?php echo $INRSYM ?></th>
<th>Total Order Amount<?php echo $INRSYM ?></th>
<th>Actual Quantity</th>
<th>Received Quantity</th>
<th>Pending Quantity</th>
<th>Action</th>
</tr>
</thead>
<tbody id='ServiceAppend'>
<?php
if (!empty($POItem)) {
//print_r($POItem);
$index = 0;
foreach ($POItem as $record) {
$index = $index + 1;
if ($record->Schedule_Type != 'Recurring') {
$FrequencyNo = intval(1);
$Frequency = 'One Time';
} else {
$FrequencyNo = $record->NumberOfService;
$Frequency = $record->Service_Period;
}
?>
<tr id="<?php echo $index; ?>">
<td align="left"><?php echo $index; ?></td>
<td><?php echo $record->ReqNo ?> </td>
<td><?php echo $record->MaterialCode ?></td>
<td><?php echo $record->MaterialName ?></td>
<td><?php echo $record->Quantity ?></td>
<td><?php echo $record->UOM ?></td>
<td><?php echo $record->Rate ?></td>
<td><?php echo number_format($record->BasicValue * $FrequencyNo, 2, '.', ''); ?></td>
<td><?php echo $record->Taxamount ?></td>
<td><?php echo $record->TotalValue ?></td>
<td><?php echo $record->Quantity ?></td>
<td><?php echo $record->ReceivedQuantity ?></td>
<td><?php echo number_format($record->Quantity - $record->ReceivedQuantity, 2, '.', ''); ?></td>
<input type="hidden" name="<?php echo 'Reqnumber' . $index ?>" id="<?php echo 'Reqnumber' . $index ?>" value="<?php echo $record->ReqNo; ?>" />
<input type="hidden" name="<?php echo 'departmentName' . $index ?>" id="<?php echo 'departmentName' . $index ?>" value="<?php echo $record->ReqNo; ?>" />
<input type="hidden" name="<?php echo 'AvilBudget' . $index ?>" id="<?php echo 'AvilBudget' . $index ?>" value="<?php echo $AvlAmount; ?>" />
<input type="hidden" name="<?php echo 'LineItemNo' . $index ?>" id="<?php echo 'LineItemNo' . $index ?>" value="<?php echo $record->LineItemNo; ?>" />
<input type="hidden" name="<?php echo 'costCode' . $index ?>" id="<?php echo 'costCode' . $index ?>" value="<?php echo $record->CostCenterCode; ?>" />
<input type="hidden" name="<?php echo 'materialCode' . $index ?>" id="<?php echo 'materialCode' . $index ?>" value="<?php echo $record->MaterialCode; ?>" />
<input type="hidden" name="<?php echo 'materialName' . $index ?>" id="<?php echo 'materialName' . $index ?>" value="<?php echo $record->MaterialName; ?>" />
<input type="hidden" name="<?php echo 'uom' . $index ?>" id="<?php echo 'uom' . $index ?>" value="<?php echo $record->UOM; ?>" />
<input type="hidden" name="<?php echo 'per' . $index ?>" id="<?php echo 'per' . $index ?>" value="<?php echo $record->Per; ?>" />
<input type="hidden" name="<?php echo 'quantity' . $index ?>" id="<?php echo 'quantity' . $index ?>" value="<?php echo $record->Quantity; ?>" />
<input type="hidden" name="<?php echo 'beforequantity' . $index ?>" id="<?php echo 'beforequantity' . $index ?>" value="<?php echo $record->Quantity; ?>" />
<input type="hidden" name="<?php echo 'itemRate' . $index ?>" id="<?php echo 'itemRate' . $index ?>" value="<?php echo $record->Rate; ?>" />
<input type="hidden" name="<?php echo 'beforeitemRate' . $index ?>" id="<?php echo 'beforeitemRate' . $index ?>" value="<?php echo $record->Rate; ?>" />
<input type="hidden" name="<?php echo 'Cgst' . $index ?>" id="<?php echo 'Cgst' . $index ?>" value="<?php echo $record->CGST; ?>" />
<input type="hidden" name="<?php echo 'beforeCgst' . $index ?>" id="<?php echo 'beforeCgst' . $index ?>" value="<?php echo $record->CGST; ?>" />
<input type="hidden" name="<?php echo 'AfterCgst' . $index ?>" id="<?php echo 'AfterCgst' . $index ?>" value="<?php echo $record->After_CGST; ?>" />
<input type="hidden" name="<?php echo 'beforeCgstvalue' . $index ?>" id="<?php echo 'beforeCgstvalue' . $index ?>" value="<?php echo $record->After_CGST; ?>" />
<input type="hidden" name="<?php echo 'Sgst' . $index ?>" id="<?php echo 'Sgst' . $index ?>" value="<?php echo $record->SGST; ?>" />
<input type="hidden" name="<?php echo 'beforeSgst' . $index ?>" id="<?php echo 'beforeSgst' . $index ?>" value="<?php echo $record->SGST; ?>" />
<input type="hidden" name="<?php echo 'AfterSgst' . $index ?>" id="<?php echo 'AfterSgst' . $index ?>" value="<?php echo $record->After_SGST; ?>" />
<input type="hidden" name="<?php echo 'beforeSgstvalue' . $index ?>" id="<?php echo 'beforeSgstvalue' . $index ?>" value="<?php echo $record->After_SGST; ?>" />
<input type="hidden" name="<?php echo 'Igst' . $index ?>" id="<?php echo 'Igst' . $index ?>" value="<?php echo $record->IGST; ?>" />
<input type="hidden" name="<?php echo 'beforeIgst' . $index ?>" id="<?php echo 'beforeIgst' . $index ?>" value="<?php echo $record->IGST; ?>" />
<input type="hidden" name="<?php echo 'AfterIgst' . $index ?>" id="<?php echo 'AfterIgst' . $index ?>" value="<?php echo $record->After_IGST; ?>" />
<input type="hidden" name="<?php echo 'beforeIgstvalue' . $index ?>" id="<?php echo 'beforeIgstvalue' . $index ?>" value="<?php echo $record->After_IGST; ?>" />
<input type="hidden" name="<?php echo 'otherallowance' . $index ?>" id="<?php echo 'otherallowance' . $index ?>" value="<?php echo $record->otherallowance; ?>" />
<input type="hidden" name="<?php echo 'beforeotherallowance' . $index ?>" id="<?php echo 'beforeotherallowance' . $index ?>" value="<?php echo $record->otherallowance; ?>" />
<input type="hidden" name="<?php echo 'TotalOrderValue' . $index ?>" id="<?php echo 'TotalOrderValue' . $index ?>" value="<?php echo $record->TotalValue; ?>" />
<input type="hidden" name="<?php echo 'servicematerialdescription' . $index ?>" id="<?php echo 'servicematerialdescription' . $index ?>" value="<?php echo $record->ServiceMaterialDescription; ?>" />
<input type="hidden" name="<?php echo 'Frequency' . $index ?>" id="<?php echo 'Frequency' . $index ?>" value="<?php echo $Frequency; ?>" />
<input type="hidden" name="<?php echo 'FrequencyNo' . $index ?>" id="<?php echo 'FrequencyNo' . $index ?>" value="<?php echo $FrequencyNo; ?>" />
<input type="hidden" name="<?php echo 'FrequencyValue' . $index ?>" id="<?php echo 'FrequencyValue' . $index ?>" value="<?php echo $FrequencyNo; ?>" />
<input type="hidden" name="<?php echo 'OtherServiceDescription' . $index ?>" id="<?php echo 'OtherServiceDescription' . $index ?>" value="<?php echo $record->MaterialDescription; ?>" />
<?php
//if($PONOStatus == PO_DRAFT)
//{
?>
<td> <a data-target='#EDITSERVICE' data-id="<?php echo $index; ?>" data-userid="<?php echo $index; ?>"
data-toggle="modal" href="#EDITSERVICE"><i class="ri-pencil-fill" data-toggle="tooltip"
title="Click here to view/Edit the <?php echo $record->ReqNo; ?>
Requisition details"></i>&nbsp;&nbsp;&nbsp;
<!-- </a> <a href='#' onclick = "DeleteRow(<?php echo $index; ?>)" class="link" data-id="<?php echo $index; ?>" data-userid="<?php echo $index; ?>" id="Del" ><span class="ri-delete-bin-7-fill"></span></a>-->
<?php
//} else {
?>
<!-- <td> <a data-toggle="tooltip" href="#"><i class="fa fa-eye" data-toggle="tooltip" title="<?php echo $record->ReqNo; ?> - Click here to view Requistion details"></i>&nbsp;&nbsp;&nbsp;</a> </td> -->
<?php
//}
?>
<div class="form-row">
<div class="table-responsive" style="padding-bottom: 30px;">
<table id="ServiceTable" class="table nowrap table-bordered table-hover mb-0" style="font-size:12px;">
<thead>
<tr>
<th>SNo</th>
<th style="white-space: nowrap !important; text-align:center !important">Requisition No</th>
<th style="white-space: nowrap !important;">Item Code</th>
<th style="white-space: nowrap !important;">Item Description</th>
<th style="white-space: nowrap !important; text-align:right !important">Quantity</th>
<th style="white-space: nowrap !important;">UOM</th>
<th style="white-space: nowrap !important; text-align:right !important">Rate<?php echo "($INRSYM)" ?></th>
<th style="white-space: nowrap !important; text-align:right !important">Basic Amount<?php echo "($INRSYM)" ?></th>
<th style="white-space: nowrap !important; text-align:right !important">Tax Amount<?php echo "($INRSYM)" ?></th>
<th style="white-space: nowrap !important; text-align:right !important">Total Order Amount<?php echo "($INRSYM)" ?></th>
<th style="white-space: nowrap !important; text-align:right !important">Actual Quantity</th>
<th style="white-space: nowrap !important; text-align:right !important">Received Quantity</th>
<th style="white-space: nowrap !important; text-align:right !important">Pending Quantity</th>
<th>Action</th>
</tr>
<?php
$TotalCgst = $TotalCgst + $record->After_CGST;
$TotalSgst = $TotalSgst + $record->After_SGST;
$TotalIgst = $TotalIgst + $record->After_IGST;
$Totalotherallowance = $Totalotherallowance + $record->otherallowance;
$TotalSummary = $TotalSummary + $record->TotalValue;
</thead>
<tbody id='ServiceAppend'>
<?php
if (!empty($POItem)) {
//print_r($POItem);
$TotalBasicAmount = $TotalBasicAmount + ($record->BasicValue * $FrequencyNo);
}
?> <input type="hidden" name="txtRowCount" id="txtRowCount" value="<?php echo $index; ?>">
<?php
$index = 0;
}
?>
</tbody>
</table>
foreach ($POItem as $record) {
$index = $index + 1;
if ($record->Schedule_Type != 'Recurring') {
$FrequencyNo = intval(1);
$Frequency = 'One Time';
} else {
$FrequencyNo = $record->NumberOfService;
$Frequency = $record->Service_Period;
}
?>
<tr id="<?php echo $index; ?>">
<td><?php echo $index; ?></td>
<td style="text-align:center !important"><?php echo $record->ReqNo ?> </td>
<td><?php echo $record->MaterialCode ?></td>
<td><?php $shortName = mb_strimwidth($record->MaterialName, 0, 13, "...");
echo $shortName; ?></td>
<td style="text-align:right !important"><?php echo $record->Quantity ?></td>
<td><?php echo $record->UOM ?></td>
<td style="text-align:right !important"><?php echo $record->Rate ?></td>
<td style="text-align:right !important"><?php echo number_format($record->BasicValue * $FrequencyNo, 2, '.', ''); ?></td>
<td style="text-align:right !important"><?php echo $record->Taxamount ?></td>
<td style="text-align:right !important"><?php echo $record->TotalValue ?></td>
<td style="text-align:right !important"><?php echo $record->Quantity ?></td>
<td style="text-align:right !important"><?php echo $record->ReceivedQuantity ?></td>
<td style="text-align:right !important"><?php echo number_format($record->Quantity - $record->ReceivedQuantity, 2, '.', ''); ?></td>
<input type="hidden" name="<?php echo 'Reqnumber' . $index ?>" id="<?php echo 'Reqnumber' . $index ?>" value="<?php echo $record->ReqNo; ?>" />
<input type="hidden" name="<?php echo 'departmentName' . $index ?>" id="<?php echo 'departmentName' . $index ?>" value="<?php echo $record->ReqNo; ?>" />
<input type="hidden" name="<?php echo 'AvilBudget' . $index ?>" id="<?php echo 'AvilBudget' . $index ?>" value="<?php echo $AvlAmount; ?>" />
<input type="hidden" name="<?php echo 'LineItemNo' . $index ?>" id="<?php echo 'LineItemNo' . $index ?>" value="<?php echo $record->LineItemNo; ?>" />
<input type="hidden" name="<?php echo 'costCode' . $index ?>" id="<?php echo 'costCode' . $index ?>" value="<?php echo $record->CostCenterCode; ?>" />
<input type="hidden" name="<?php echo 'materialCode' . $index ?>" id="<?php echo 'materialCode' . $index ?>" value="<?php echo $record->MaterialCode; ?>" />
<input type="hidden" name="<?php echo 'materialName' . $index ?>" id="<?php echo 'materialName' . $index ?>" value="<?php echo $record->MaterialName; ?>" />
<input type="hidden" name="<?php echo 'uom' . $index ?>" id="<?php echo 'uom' . $index ?>" value="<?php echo $record->UOM; ?>" />
<input type="hidden" name="<?php echo 'per' . $index ?>" id="<?php echo 'per' . $index ?>" value="<?php echo $record->Per; ?>" />
<input type="hidden" name="<?php echo 'quantity' . $index ?>" id="<?php echo 'quantity' . $index ?>" value="<?php echo $record->Quantity; ?>" />
<input type="hidden" name="<?php echo 'beforequantity' . $index ?>" id="<?php echo 'beforequantity' . $index ?>" value="<?php echo $record->Quantity; ?>" />
<input type="hidden" name="<?php echo 'itemRate' . $index ?>" id="<?php echo 'itemRate' . $index ?>" value="<?php echo $record->Rate; ?>" />
<input type="hidden" name="<?php echo 'beforeitemRate' . $index ?>" id="<?php echo 'beforeitemRate' . $index ?>" value="<?php echo $record->Rate; ?>" />
<input type="hidden" name="<?php echo 'Cgst' . $index ?>" id="<?php echo 'Cgst' . $index ?>" value="<?php echo $record->CGST; ?>" />
<input type="hidden" name="<?php echo 'beforeCgst' . $index ?>" id="<?php echo 'beforeCgst' . $index ?>" value="<?php echo $record->CGST; ?>" />
<input type="hidden" name="<?php echo 'AfterCgst' . $index ?>" id="<?php echo 'AfterCgst' . $index ?>" value="<?php echo $record->After_CGST; ?>" />
<input type="hidden" name="<?php echo 'beforeCgstvalue' . $index ?>" id="<?php echo 'beforeCgstvalue' . $index ?>" value="<?php echo $record->After_CGST; ?>" />
<input type="hidden" name="<?php echo 'Sgst' . $index ?>" id="<?php echo 'Sgst' . $index ?>" value="<?php echo $record->SGST; ?>" />
<input type="hidden" name="<?php echo 'beforeSgst' . $index ?>" id="<?php echo 'beforeSgst' . $index ?>" value="<?php echo $record->SGST; ?>" />
<input type="hidden" name="<?php echo 'AfterSgst' . $index ?>" id="<?php echo 'AfterSgst' . $index ?>" value="<?php echo $record->After_SGST; ?>" />
<input type="hidden" name="<?php echo 'beforeSgstvalue' . $index ?>" id="<?php echo 'beforeSgstvalue' . $index ?>" value="<?php echo $record->After_SGST; ?>" />
<input type="hidden" name="<?php echo 'Igst' . $index ?>" id="<?php echo 'Igst' . $index ?>" value="<?php echo $record->IGST; ?>" />
<input type="hidden" name="<?php echo 'beforeIgst' . $index ?>" id="<?php echo 'beforeIgst' . $index ?>" value="<?php echo $record->IGST; ?>" />
<input type="hidden" name="<?php echo 'AfterIgst' . $index ?>" id="<?php echo 'AfterIgst' . $index ?>" value="<?php echo $record->After_IGST; ?>" />
<input type="hidden" name="<?php echo 'beforeIgstvalue' . $index ?>" id="<?php echo 'beforeIgstvalue' . $index ?>" value="<?php echo $record->After_IGST; ?>" />
<input type="hidden" name="<?php echo 'otherallowance' . $index ?>" id="<?php echo 'otherallowance' . $index ?>" value="<?php echo $record->otherallowance; ?>" />
<input type="hidden" name="<?php echo 'beforeotherallowance' . $index ?>" id="<?php echo 'beforeotherallowance' . $index ?>" value="<?php echo $record->otherallowance; ?>" />
<input type="hidden" name="<?php echo 'TotalOrderValue' . $index ?>" id="<?php echo 'TotalOrderValue' . $index ?>" value="<?php echo $record->TotalValue; ?>" />
<input type="hidden" name="<?php echo 'servicematerialdescription' . $index ?>" id="<?php echo 'servicematerialdescription' . $index ?>" value="<?php echo $record->ServiceMaterialDescription; ?>" />
<input type="hidden" name="<?php echo 'Frequency' . $index ?>" id="<?php echo 'Frequency' . $index ?>" value="<?php echo $Frequency; ?>" />
<input type="hidden" name="<?php echo 'FrequencyNo' . $index ?>" id="<?php echo 'FrequencyNo' . $index ?>" value="<?php echo $FrequencyNo; ?>" />
<input type="hidden" name="<?php echo 'FrequencyValue' . $index ?>" id="<?php echo 'FrequencyValue' . $index ?>" value="<?php echo $FrequencyNo; ?>" />
<input type="hidden" name="<?php echo 'OtherServiceDescription' . $index ?>" id="<?php echo 'OtherServiceDescription' . $index ?>" value="<?php echo $record->MaterialDescription; ?>" />
<?php
//if($PONOStatus == PO_DRAFT)
//{
?>
<td> <a data-target='#EDITSERVICE' data-id="<?php echo $index; ?>" data-userid="<?php echo $index; ?>"
data-toggle="modal" href="#EDITSERVICE"><i class="ri-pencil-fill" data-toggle="tooltip"
title="Click here to view/Edit the <?php echo $record->ReqNo; ?>
Requisition details"></i>&nbsp;&nbsp;&nbsp;
<!-- </a> <a href='#' onclick = "DeleteRow(<?php echo $index; ?>)" class="link" data-id="<?php echo $index; ?>" data-userid="<?php echo $index; ?>" id="Del" ><span class="ri-delete-bin-7-fill"></span></a>-->
<?php
//} else {
?>
<!-- <td> <a data-toggle="tooltip" href="#"><i class="fa fa-eye" data-toggle="tooltip" title="<?php echo $record->ReqNo; ?> - Click here to view Requistion details"></i>&nbsp;&nbsp;&nbsp;</a> </td> -->
<?php
//}
?>
</tr>
<?php
$TotalCgst = $TotalCgst + $record->After_CGST;
$TotalSgst = $TotalSgst + $record->After_SGST;
$TotalIgst = $TotalIgst + $record->After_IGST;
$Totalotherallowance = $Totalotherallowance + $record->otherallowance;
$TotalSummary = $TotalSummary + $record->TotalValue;
$TotalBasicAmount = $TotalBasicAmount + ($record->BasicValue * $FrequencyNo);
}
?> <input type="hidden" name="txtRowCount" id="txtRowCount" value="<?php echo $index; ?>">
<?php
}
?>
</tbody>
</table>
</div>
</div>
<div class="form-row">
@ -2044,14 +2049,8 @@ foreach ($PaymentTerms as $TER) {
type: "POST",
url: "<?php echo base_url() ?>purchaseorder/DeletePODetails",
success: function(data) {
if (data) {
$('#loader').hide();
alert(data);
} else {
$('#loader').hide();
alert("Error");
}
$('#loader').hide();
(data) ? alert(response) : alert("Error");
}
});
}
@ -2197,31 +2196,32 @@ foreach ($PaymentTerms as $TER) {
var txtTotalOrderValueSummary = $('#txtTotBasicAmount').val();
// alert("worked");
// if (validate()) {
if (serviceValidate()) {
// if(parseInt(AvlBudAmt) < parseInt(txtTotalOrderValueSummary)) {
// alert('Total Order Amount is exceeding the Budget Limit.Please adjust the product value.');
// return false;
// }
if ($('#Otherpayment').val() == '' && $('#PaymentTerms').val() == 'PT08') {
alert('Please Enter Other Payment Details');
$('#Otherpayment').focus();
return false;
} else if ($('#amenddescofpo').val().trim() == '') {
alert('Please Enter Description Of Service');
$('#amenddescofpo').focus();
return false;
} else {
// if ($('#Otherpayment').val() == '' && $('#PaymentTerms').val() == 'PT08') {
// alert('Please Enter Other Payment Details');
// $('#Otherpayment').focus();
// return false;
// } else if ($('#amenddescofpo').val().trim() == '') {
// alert('Please Enter Description Of Service');
// $('#amenddescofpo').focus();
// return false;
// } else {
// $('#content').loader('show');
var formData = new FormData($('.ServicePO')[0]);
if (status == 0) { // for draft
var formData = new FormData($('.ServicePO')[0]);
if (status == 0) { // for draft
formData.append('changeStatus','ST014');
};
if (status == 1) { // for approve
formData.append('changeStatus','ST026');
};
$('#loader').show();
disableButtons();
$('#loader').show();
$.ajax({
// data: $('.ServicePO').serialize(),
type: "POST",
@ -2240,15 +2240,19 @@ foreach ($PaymentTerms as $TER) {
$('#txtDeliveryAddress').val('')
window.location = status == 1 ? "amendmentpurchaseorder" : "purchaseorderListing";
// setTimeout(function() { enableButtons(); }, 2000);
} else {
// setTimeout(function() { enableButtons(); }, 2000);
$('#loader').hide();
console.error("Error");
}
},
error : function (error){
// setTimeout(function() { enableButtons(); }, 2000);
console.log("error occurred" , error);
},
complete : function (){
// setTimeout(function() { enableButtons(); }, 2000);
console.log("Ajax call is completed ..!!");
}
});

View File

@ -664,7 +664,8 @@ if (!empty($master)) {
<script>
$('#AddConfigValue, #configValue').change(function() {
let configValue = $(this).val();
let configValue = $(this).val().trim();
console.log(configValue,configValue.length);
let configTable = customTableToJson();
let configValueExisting = configTable.filter(element => element['Configuration Value'] == configValue);

View File

@ -825,258 +825,263 @@ if (!empty($getlogpodtl)) {
</div>
<br><br><br><br>
<div class="box-body" style="margin-top: -3%;">
<table id="ImportTax" class="table table-bordered table-hover" style="background-color:#fff;font-size:12px;">
<thead>
<tr>
<th>SNo</th>
<th>Requisition No</th>
<th>Material Code</th>
<th>Description</th>
<th>Line Item Specs</th>
<th>Quantity</th>
<th>UOM</th>
<th>Rate<?php echo $INR ?></th>
<th>Basic Amount<?php echo $INR ?></th>
<!-- <th>Received Qty</th>
<th>Rejected Qty</th>
<th>Pending Qty</th> -->
<!-- <th>Tax Amount</th>
<th>Total Order Amount</th> -->
<th>Action</th>
</tr>
</thead>
<tbody id='ImportAppend'>
<?php
if (!empty($POItem)) {
foreach ($POItem as $record) {
$index = $index + 1;
//echo $record->Rate;
<div class="form-row">
<div class="table-responsive" style="padding-bottom: 30px;">
<table id="ImportTax" class="table nowrap table-bordered table-hover mb-0" style="font-size:12px;">
<thead>
<tr>
<th style="white-space: nowrap !important; text-align:left !important">SNo</th>
<th style="white-space: nowrap !important; text-align:center !important">Requisition No</th>
<th style="white-space: nowrap !important; text-align:left !important">Item Code</th>
<th style="white-space: nowrap !important; text-align:left !important">Item Description</th>
<th style="white-space: nowrap !important; text-align:left !important">Line Item Specs</th>
<th style="white-space: nowrap !important; text-align:right !important">Quantity</th>
<th style="white-space: nowrap !important; text-align:left !important">UOM</th>
<th style="white-space: nowrap !important; text-align:right !important">Rate<?php echo "($INR)" ?></th>
<th style="white-space: nowrap !important; text-align:right !important">Basic Amount<?php echo "($INR)" ?></th>
<!-- <th>Received Qty</th>
<th>Rejected Qty</th>
<th>Pending Qty</th> -->
<!-- <th>Tax Amount</th>
<th>Total Order Amount</th> -->
<th>Action</th>
</tr>
</thead>
<tbody id='ImportAppend'>
<?php
if (!empty($POItem)) {
foreach ($POItem as $record) {
$index = $index + 1;
//echo $record->Rate;
?>
<tr id="<?php echo $index; ?>">
<td align="left"><?php echo $index; ?></td>
<td><?php echo $record->ReqNo ?></td>
<td><?php echo $record->MaterialCode ?></td>
<td><?php echo $record->MaterialName ?></td>
<td>
<?php if ($PONOStatus === PO_DRAFT || $PONOStatus === PO_CREATED) { ?>
<a href="#"
class="editable-field"
data-id ="<?php echo $index ?>" data-notes="<?php echo $record->LineitemAuditorNotes; ?>">
<?php echo !empty($record->LineitemAuditorNotes) ? $record->LineitemAuditorNotes : "-"; ?>
</a>
<div class="edit-container" style="display:none;">
<input type="text" class="edit-input-field" />
<button class="save-btn"></button>
<button class="cancel-btn"></button>
</div>
<?php }else{ echo !empty($record->LineitemAuditorNotes) ? $record->LineitemAuditorNotes : "-"; } ?>
</td>
<td><?php echo $record->Quantity ?></td>
<td><?php echo $record->UOM ?></td>
<td><?php echo $record->Rate ?></td>
<td><?php echo $record->BasicValue ?></td>
<!-- <td><?php echo $record->ReceivedQuantity ?></td> -->
<!-- <td><?php echo $record->QuantityRejected ?></td> -->
<!-- <td><?php echo $record->PendingQty ?></td> -->
<!-- <td><?php echo $record->Taxamount ?></td>
<td><?php echo $record->TotalOrderValue ?></td> -->
?>
<tr id="<?php echo $index; ?>">
<td align="left"><?php echo $index; ?></td>
<td align="center"><?php echo $record->ReqNo ?></td>
<td align="left"><?php echo $record->MaterialCode ?></td>
<td align="left"><?php $shortName = mb_strimwidth($record->MaterialName, 0, 13, "...");
echo $shortName; ?></td>
<td align="left">
<?php if ($PONOStatus === PO_DRAFT || $PONOStatus === PO_CREATED) { ?>
<a href="#"
class="editable-field"
data-id ="<?php echo $index ?>" data-notes="<?php echo $record->LineitemAuditorNotes; ?>">
<?php echo !empty($record->LineitemAuditorNotes) ? $record->LineitemAuditorNotes : "-"; ?>
</a>
<div class="edit-container" style="display:none;">
<input type="text" class="edit-input-field" />
<button class="save-btn"></button>
<button class="cancel-btn"></button>
</div>
<?php }else{ echo !empty($record->LineitemAuditorNotes) ? $record->LineitemAuditorNotes : "-"; } ?>
</td>
<td align="right"><?php echo $record->Quantity ?></td>
<td align="left"><?php echo $record->UOM ?></td>
<td align="right"><?php echo $record->Rate ?></td>
<td align="right"><?php echo $record->BasicValue ?></td>
<!-- <td><?php echo $record->ReceivedQuantity ?></td> -->
<!-- <td><?php echo $record->QuantityRejected ?></td> -->
<!-- <td><?php echo $record->PendingQty ?></td> -->
<!-- <td><?php echo $record->Taxamount ?></td>
<td><?php echo $record->TotalOrderValue ?></td> -->
<input type="hidden" name="<?php echo 'Reqnumber' . $index ?>" id="<?php echo 'Reqnumber' . $index ?>" value="<?php echo $record->ReqNo; ?>" />
<input type="hidden" name="<?php echo 'departmentName' . $index ?>" id="<?php echo 'departmentName' . $index ?>" value="<?php echo $record->DepartmentName; ?>" />
<input type="hidden" name="<?php echo 'Reqnumber' . $index ?>" id="<?php echo 'Reqnumber' . $index ?>" value="<?php echo $record->ReqNo; ?>" />
<input type="hidden" name="<?php echo 'departmentName' . $index ?>" id="<?php echo 'departmentName' . $index ?>" value="<?php echo $record->DepartmentName; ?>" />
<!--<input type="hidden" name="<?php //echo 'AvlBudAmt'.$index
?>" id="<?php //echo 'AvlBudAmt'.$index
?>" value="<?php //echo $record->AvlBudAmt ;
?>" /> -->
<input type="hidden" name="<?php echo 'AvlBudAmt' . $index ?>" id="<?php echo 'AvlBudAmt' . $index ?>" value="<?php echo "$AvlAmount"; ?>" />
<!--<input type="hidden" name="<?php //echo 'AvlBudAmt'.$index
?>" id="<?php //echo 'AvlBudAmt'.$index
?>" value="<?php //echo $record->AvlBudAmt ;
?>" /> -->
<input type="hidden" name="<?php echo 'AvlBudAmt' . $index ?>" id="<?php echo 'AvlBudAmt' . $index ?>" value="<?php echo "$AvlAmount"; ?>" />
<input type="hidden" name="<?php echo 'LineItemNo' . $index ?>" id="<?php echo 'LineItemNo' . $index ?>" value="<?php echo $record->LineItemNo; ?>" />
<input type="hidden" name="<?php echo 'costCode' . $index ?>" id="<?php echo 'costCode' . $index ?>" value="<?php echo $record->CostCenterCode; ?>" />
<input type="hidden" name="<?php echo 'materialCode' . $index ?>" id="<?php echo 'materialCode' . $index ?>" value="<?php echo $record->MaterialCode; ?>" />
<input type="hidden" name="<?php echo 'materialName' . $index ?>" id="<?php echo 'materialName' . $index ?>" value="<?php echo $record->MaterialName; ?>" />
<input type="hidden" name="<?php echo 'uom' . $index ?>" id="<?php echo 'uom' . $index ?>" value="<?php echo $record->UOM; ?>" />
<input type="hidden" name="<?php echo 'quantity' . $index ?>" id="<?php echo 'quantity' . $index ?>" value="<?php echo $record->Quantity; ?>" />
<input align="right" type="hidden" name="<?php echo 'b4qty' . $index ?>" id="<?php echo 'b4qty' . $index ?>" value="<?php echo $record->Quantity; ?>" />
<input type="hidden" name="<?php echo 'itemRate' . $index ?>" id="<?php echo 'itemRate' . $index ?>" value="<?php echo $record->Rate; ?>" />
<input align="right" type="hidden" name="<?php echo 'b4rate' . $index ?>" id="<?php echo 'b4rate' . $index ?>" value="<?php echo $record->Rate; ?>" />
<input type="hidden" name="<?php echo 'LandingCharge' . $index ?>" id="<?php echo 'LandingCharge' . $index ?>" value="<?php echo $record->LandingCharge; ?>" />
<input type="hidden" name="<?php echo 'AfterLandingCharge' . $index ?>" id="<?php echo 'AfterLandingCharge' . $index ?>" value="<?php echo $record->AfterLandingCharge; ?>" />
<input type="hidden" name="<?php echo 'LineItemNo' . $index ?>" id="<?php echo 'LineItemNo' . $index ?>" value="<?php echo $record->LineItemNo; ?>" />
<input type="hidden" name="<?php echo 'costCode' . $index ?>" id="<?php echo 'costCode' . $index ?>" value="<?php echo $record->CostCenterCode; ?>" />
<input type="hidden" name="<?php echo 'materialCode' . $index ?>" id="<?php echo 'materialCode' . $index ?>" value="<?php echo $record->MaterialCode; ?>" />
<input type="hidden" name="<?php echo 'materialName' . $index ?>" id="<?php echo 'materialName' . $index ?>" value="<?php echo $record->MaterialName; ?>" />
<input type="hidden" name="<?php echo 'uom' . $index ?>" id="<?php echo 'uom' . $index ?>" value="<?php echo $record->UOM; ?>" />
<input type="hidden" name="<?php echo 'quantity' . $index ?>" id="<?php echo 'quantity' . $index ?>" value="<?php echo $record->Quantity; ?>" />
<input align="right" type="hidden" name="<?php echo 'b4qty' . $index ?>" id="<?php echo 'b4qty' . $index ?>" value="<?php echo $record->Quantity; ?>" />
<input type="hidden" name="<?php echo 'itemRate' . $index ?>" id="<?php echo 'itemRate' . $index ?>" value="<?php echo $record->Rate; ?>" />
<input align="right" type="hidden" name="<?php echo 'b4rate' . $index ?>" id="<?php echo 'b4rate' . $index ?>" value="<?php echo $record->Rate; ?>" />
<input type="hidden" name="<?php echo 'LandingCharge' . $index ?>" id="<?php echo 'LandingCharge' . $index ?>" value="<?php echo $record->LandingCharge; ?>" />
<input type="hidden" name="<?php echo 'AfterLandingCharge' . $index ?>" id="<?php echo 'AfterLandingCharge' . $index ?>" value="<?php echo $record->AfterLandingCharge; ?>" />
<input type="hidden" name="<?php echo 'CustomDuty' . $index ?>" id="<?php echo 'CustomDuty' . $index ?>" value="<?php echo $record->CustomDuty; ?>" />
<input type="hidden" name="<?php echo 'AfterCustomDuty' . $index ?>" id="<?php echo 'AfterCustomDuty' . $index ?>" value="<?php echo $record->AfterCustomDuty; ?>" />
<input type="hidden" name="<?php echo 'CustomDuty' . $index ?>" id="<?php echo 'CustomDuty' . $index ?>" value="<?php echo $record->CustomDuty; ?>" />
<input type="hidden" name="<?php echo 'AfterCustomDuty' . $index ?>" id="<?php echo 'AfterCustomDuty' . $index ?>" value="<?php echo $record->AfterCustomDuty; ?>" />
<input type="hidden" name="<?php echo 'ExchangeRate' . $index ?>" id="<?php echo 'ExchangeRate' . $index ?>" value="<?php echo $record->ExchangeRate; ?>" />
<input type="hidden" name="<?php echo 'ExchangeRate' . $index ?>" id="<?php echo 'ExchangeRate' . $index ?>" value="<?php echo $record->ExchangeRate; ?>" />
<input type="hidden" name="<?php echo 'Grossdutypayable' . $index ?>" id="<?php echo 'Grossdutypayable' . $index ?>" value="<?php echo $record->Grossdutypayable; ?>" />
<input type="hidden" name="<?php echo 'Grossdutypayable' . $index ?>" id="<?php echo 'Grossdutypayable' . $index ?>" value="<?php echo $record->Grossdutypayable; ?>" />
<input type="hidden" name="<?php echo 'CustomDutyExpensesPerKG' . $index ?>" id="<?php echo 'CustomDutyExpensesPerKG' . $index ?>" value="<?php echo $record->CustomDutyExpensesPerKG; ?>" />
<input type="hidden" name="<?php echo 'CustomDutyExpensesPerKG' . $index ?>" id="<?php echo 'CustomDutyExpensesPerKG' . $index ?>" value="<?php echo $record->CustomDutyExpensesPerKG; ?>" />
<input type="hidden" name="<?php echo 'QuantityKG' . $index ?>" id="<?php echo 'QuantityKG' . $index ?>" value="<?php echo $record->QuantityKG; ?>" />
<input type="hidden" name="<?php echo 'QuantityKG' . $index ?>" id="<?php echo 'QuantityKG' . $index ?>" value="<?php echo $record->QuantityKG; ?>" />
<input type="hidden" name="<?php echo 'BasicPriceInMTon' . $index ?>" id="<?php echo 'BasicPriceInMTon' . $index ?>" value="<?php echo $record->BasicPriceInMTon; ?>" />
<input type="hidden" name="<?php echo 'BasicPriceInMTon' . $index ?>" id="<?php echo 'BasicPriceInMTon' . $index ?>" value="<?php echo $record->BasicPriceInMTon; ?>" />
<input type="hidden" name="<?php echo 'ProductPrice' . $index ?>" id="<?php echo 'ProductPrice' . $index ?>" value="<?php echo $record->ProductPrice; ?>" />
<input type="hidden" name="<?php echo 'ProductPrice' . $index ?>" id="<?php echo 'ProductPrice' . $index ?>" value="<?php echo $record->ProductPrice; ?>" />
<input type="hidden" name="<?php echo 'CustomSHCess' . $index ?>" id="<?php echo 'CustomSHCess' . $index ?>" value="<?php echo $record->CustomSHCess; ?>" />
<input type="hidden" name="<?php echo 'AfterCustomSHCess' . $index ?>" id="<?php echo 'AfterCustomSHCess' . $index ?>" value="<?php echo $record->AfterCustomSHCess; ?>" />
<input type="hidden" name="<?php echo 'CustomSHCess' . $index ?>" id="<?php echo 'CustomSHCess' . $index ?>" value="<?php echo $record->CustomSHCess; ?>" />
<input type="hidden" name="<?php echo 'AfterCustomSHCess' . $index ?>" id="<?php echo 'AfterCustomSHCess' . $index ?>" value="<?php echo $record->AfterCustomSHCess; ?>" />
<!-- <input type="hidden" name="<?php echo 'Grossdutypayable' . $index ?>" id="<?php echo 'Grossdutypayable' . $index ?>" value="<?php echo $record->Grossdutypayable; ?>" /> -->
<!-- <input type="hidden" name="<?php echo 'QuantityKG' . $index ?>" id="<?php echo 'QuantityKG' . $index ?>" value="<?php echo $record->QuantityKG; ?>" />
-->
<!-- <input type="hidden" name="<?php echo 'Grossdutypayable' . $index ?>" id="<?php echo 'Grossdutypayable' . $index ?>" value="<?php echo $record->Grossdutypayable; ?>" /> -->
<!-- <input type="hidden" name="<?php echo 'QuantityKG' . $index ?>" id="<?php echo 'QuantityKG' . $index ?>" value="<?php echo $record->QuantityKG; ?>" />-->
<input type="hidden" name="<?php echo 'BasicPriceInMTon' . $index ?>" id="<?php echo 'BasicPriceInMTonG' . $index ?>" value="<?php echo $record->BasicPriceInMTon; ?>" />
<input type="hidden" name="<?php echo 'ProductPrice' . $index ?>" id="<?php echo 'ProductPrice' . $index ?>" value="<?php echo $record->ProductPrice; ?>" />
<input type="hidden" name="<?php echo 'BasicPriceInMTon' . $index ?>" id="<?php echo 'BasicPriceInMTonG' . $index ?>" value="<?php echo $record->BasicPriceInMTon; ?>" />
<input type="hidden" name="<?php echo 'ProductPrice' . $index ?>" id="<?php echo 'ProductPrice' . $index ?>" value="<?php echo $record->ProductPrice; ?>" />
<input type="hidden" name="<?php echo 'CustomEdCess' . $index ?>" id="<?php echo 'CustomEdCess' . $index ?>" value="<?php echo $record->CustomEdCess; ?>" />
<input type="hidden" name="<?php echo 'CustomEdCess' . $index ?>" id="<?php echo 'CustomEdCess' . $index ?>" value="<?php echo $record->CustomEdCess; ?>" />
<!-- <input type="hidden" name="<?php echo 'Grossdutypayable' . $index ?>" id="<?php echo 'Grossdutypayable' . $index ?>" value="<?php echo $record->Grossdutypayable; ?>" />
-->
<!-- <input type="hidden" name="<?php echo 'Grossdutypayable' . $index ?>" id="<?php echo 'Grossdutypayable' . $index ?>" value="<?php echo $record->Grossdutypayable; ?>" />-->
<input type="hidden" name="<?php echo 'BasicINRValue' . $index ?>" id="<?php echo 'BasicINRValue' . $index ?>" value="<?php echo $record->BasicINRValue; ?>" />
<input type="hidden" name="<?php echo 'BasicINRValue' . $index ?>" id="<?php echo 'BasicINRValue' . $index ?>" value="<?php echo $record->BasicINRValue; ?>" />
<input type="hidden" name="<?php echo 'TotalValue' . $index ?>" id="<?php echo 'TotalValue' . $index ?>" value="<?php echo $record->ProductPrice; ?>" />
<input type="hidden" name="<?php echo 'ExchangeRate' . $index ?>" id="<?php echo 'ExchangeRate' . $index ?>" value="<?php echo $record->ExchangeRate; ?>" />
<input type="hidden" name="<?php echo 'TotalValue' . $index ?>" id="<?php echo 'TotalValue' . $index ?>" value="<?php echo $record->ProductPrice; ?>" />
<input type="hidden" name="<?php echo 'ExchangeRate' . $index ?>" id="<?php echo 'ExchangeRate' . $index ?>" value="<?php echo $record->ExchangeRate; ?>" />
<!-- <input type="hidden" name="<?php echo 'AfterCustomEDcess' . $index ?>" id="<?php echo 'AfterCustomEDcess' . $index ?>" value="<?php echo $record->AfterCustomEdCess; ?>" /> -->
<!-- <input type="hidden" name="<?php echo 'AfterCustomEDcess' . $index ?>" id="<?php echo 'AfterCustomEDcess' . $index ?>" value="<?php echo $record->AfterCustomEdCess; ?>" /> -->
<!-- <input type="hidden" name="<?php echo 'CustomEDcess' . $index ?>" id="<?php echo 'CustomEDcess' . $index ?>" value="<?php echo $record->CustomEdCess; ?>" /> -->
<!-- <input type="hidden" name="<?php echo 'CustomEDcess' . $index ?>" id="<?php echo 'CustomEDcess' . $index ?>" value="<?php echo $record->CustomEdCess; ?>" /> -->
<input type="hidden" name="<?php echo 'FreightType' . $index ?>" id="<?php echo 'FreightType' . $index ?>" value="<?php echo $record->FreightType; ?>" />
<input type="hidden" name="<?php echo 'FreightType' . $index ?>" id="<?php echo 'FreightType' . $index ?>" value="<?php echo $record->FreightType; ?>" />
<input type="hidden" name="<?php echo 'NoOfTrip' . $index ?>" id="<?php echo 'NoOfTrip' . $index ?>" value="<?php echo $record->NoOfTrip; ?>" />
<input type="hidden" name="<?php echo 'NoOfTrip' . $index ?>" id="<?php echo 'NoOfTrip' . $index ?>" value="<?php echo $record->NoOfTrip; ?>" />
<input type="hidden" name="<?php echo 'FreightValue' . $index ?>" id="<?php echo 'FreightValue' . $index ?>" value="<?php echo $record->FreightValue; ?>" />
<input type="hidden" name="<?php echo 'FreightValue' . $index ?>" id="<?php echo 'FreightValue' . $index ?>" value="<?php echo $record->FreightValue; ?>" />
<input type="hidden" name="<?php echo 'AfterFreightValue' . $index ?>" id="<?php echo 'AfterFreightValue' . $index ?>" value="<?php echo $record->AfterFreightValue; ?>" />
<input type="hidden" name="<?php echo 'AfterFreightValue' . $index ?>" id="<?php echo 'AfterFreightValue' . $index ?>" value="<?php echo $record->AfterFreightValue; ?>" />
<input type="hidden" name="<?php echo 'Per' . $index ?>" id="<?php echo 'Per' . $index ?>" value="<?php echo $record->Per; ?>" />
<input type="hidden" name="<?php echo 'Per' . $index ?>" id="<?php echo 'Per' . $index ?>" value="<?php echo $record->Per; ?>" />
<input type="hidden" name="<?php echo 'Addinstruction' . $index ?>" id="<?php echo 'Addinstruction' . $index ?>" value="<?php echo $record->ServiceMaterialDescription; ?>" />
<input type="hidden" name="<?php echo 'Addinstruction' . $index ?>" id="<?php echo 'Addinstruction' . $index ?>" value="<?php echo $record->ServiceMaterialDescription; ?>" />
<!-- <input type="hidden" name="<?php echo 'AfterFreightValue' . $index ?>" id="<?php echo 'AfterFreightValue' . $index ?>" value="<?php echo $record->AfterFreightValue; ?>" /> -->
<!-- <input type="hidden" name="<?php echo 'AfterFreightValue' . $index ?>" id="<?php echo 'AfterFreightValue' . $index ?>" value="<?php echo $record->AfterFreightValue; ?>" /> -->
<input type="hidden" name="<?php echo 'AssessableValue' . $index ?>" id="<?php echo 'AssessableValue' . $index ?>" value="<?php echo $record->AssessableValue; ?>" />
<input type="hidden" name="<?php echo 'AssessableValue' . $index ?>" id="<?php echo 'AssessableValue' . $index ?>" value="<?php echo $record->AssessableValue; ?>" />
<input type="hidden" name="<?php echo 'SubTotal' . $index ?>" id="<?php echo 'SubTotal' . $index ?>" value="<?php echo $record->SubTotal; ?>" />
<input type="hidden" name="<?php echo 'SubTotal' . $index ?>" id="<?php echo 'SubTotal' . $index ?>" value="<?php echo $record->SubTotal; ?>" />
<input type="hidden" name="<?php echo 'IGST' . $index ?>" id="<?php echo 'IGST' . $index ?>" value="<?php echo $record->IGST; ?>" />
<input type="hidden" name="<?php echo 'IGST' . $index ?>" id="<?php echo 'IGST' . $index ?>" value="<?php echo $record->IGST; ?>" />
<input type="hidden" name="<?php echo 'AfterIGST' . $index ?>" id="<?php echo 'AfterIGST' . $index ?>" value="<?php echo $record->AfterIGST; ?>" />
<input type="hidden" name="<?php echo 'AfterIGST' . $index ?>" id="<?php echo 'AfterIGST' . $index ?>" value="<?php echo $record->AfterIGST; ?>" />
<input type="hidden" name="<?php echo 'DutyImpact' . $index ?>" id="<?php echo 'DutyImpact' . $index ?>" value="<?php echo $record->DutyImpact; ?>" />
<input type="hidden" name="<?php echo 'DutyImpact' . $index ?>" id="<?php echo 'DutyImpact' . $index ?>" value="<?php echo $record->DutyImpact; ?>" />
<input type="hidden" name="<?php echo 'ClearingCharge' . $index ?>" id="<?php echo 'ClearingCharge' . $index ?>" value="<?php echo $record->ClearingCharge; ?>" />
<input type="hidden" name="<?php echo 'ClearingCharge' . $index ?>" id="<?php echo 'ClearingCharge' . $index ?>" value="<?php echo $record->ClearingCharge; ?>" />
<input type="hidden" name="<?php echo 'NetValue' . $index ?>" id="<?php echo 'NetValue' . $index ?>" value="<?php echo $record->NetValue; ?>" />
<input type="hidden" name="<?php echo 'NetValue' . $index ?>" id="<?php echo 'NetValue' . $index ?>" value="<?php echo $record->NetValue; ?>" />
<input type="hidden" name="<?php echo 'AfterCustomEdCess1' . $index ?>" id="<?php echo 'AfterCustomEdCess1' . $index ?>" value="<?php echo $record->AfterCustomEdCess; ?>" />
<input type="hidden" name="<?php echo 'LineItemNoteForAuditor' . $index ?>" id="<?php echo 'LineItemNoteForAuditor' . $index ?>" value="<?php echo $record->LineitemAuditorNotes; ?>" />
<input type="hidden" name="<?php echo 'AfterCustomEdCess1' . $index ?>" id="<?php echo 'AfterCustomEdCess1' . $index ?>" value="<?php echo $record->AfterCustomEdCess; ?>" />
<input type="hidden" name="<?php echo 'LineItemNoteForAuditor' . $index ?>" id="<?php echo 'LineItemNoteForAuditor' . $index ?>" value="<?php echo $record->LineitemAuditorNotes; ?>" />
<?php
<?php
if ($PONOStatus == PO_DRAFT || $PONOStatus == PO_CREATED || $PONOStatus == REQITEM_Emergency_PO_CREATED || $PONOStatus == PO_APPROVED) { ?>
<td> <a data-target='#editimportpomodel' data-id="<?php echo $index; ?>" data-userid="<?php echo $index; ?>" data-toggle="modal" href="#editimportpomodel"><i class="ri-pencil-fill" data-toggle="tooltip"></i>&nbsp;&nbsp;&nbsp;</a> <a href='#' onclick="DeleteRow(<?php echo $index; ?>)" class="link" data-id="<?php echo $index; ?>" data-userid="<?php echo $index; ?>" id="Del"><span class="ri-delete-bin-7-fill"></span></a>
<?php
} else { ?>
<td> <a data-target='#viewimportmodal' data-id="<?php echo $index; ?>" data-userid="<?php echo $index; ?>" data-toggle="modal" href="#viewimportmodal"><i class="fa fa-eye" data-toggle="tooltip" title="Click here to view the <?php echo $record->ReqNo; ?>Click here to view Requisition details"></i>&nbsp;&nbsp;&nbsp;</a> </td>
<?php
} ?>
</tr> <?php
if ($PONOStatus == PO_DRAFT || $PONOStatus == PO_CREATED || $PONOStatus == REQITEM_Emergency_PO_CREATED || $PONOStatus == PO_APPROVED) { ?>
<td> <a data-target='#editimportpomodel' data-id="<?php echo $index; ?>" data-userid="<?php echo $index; ?>" data-toggle="modal" href="#editimportpomodel"><i class="ri-pencil-fill" data-toggle="tooltip"></i>&nbsp;&nbsp;&nbsp;</a> <a href='#' onclick="DeleteRow(<?php echo $index; ?>)" class="link" data-id="<?php echo $index; ?>" data-userid="<?php echo $index; ?>" id="Del"><span class="ri-delete-bin-7-fill"></span></a>
<?php
} else { ?>
<td> <a data-target='#viewimportmodal' data-id="<?php echo $index; ?>" data-userid="<?php echo $index; ?>" data-toggle="modal" href="#viewimportmodal"><i class="fa fa-eye" data-toggle="tooltip" title="Click here to view the <?php echo $record->ReqNo; ?>Click here to view Requisition details"></i>&nbsp;&nbsp;&nbsp;</a> </td>
<?php
} ?>
</tr> <?php
//echo $record->AfterLandingCharge + $TotalLanding;
$TotalLanding = $TotalLanding + ($record->AfterLandingCharge);
$tothighseas = $tothighseas + $record->AfterHighSeasSalesCharge;
$totcustom = $totcustom + $record->AfterCustomDuty;
$totexciseduty = $totexciseduty + $record->AfterExciseDuty;
$totexcisedutyED = $totexcisedutyED + $record->AfterExciseDutyEdCess;
$totexciseSH = $totexciseSH + $record->AfterExciseDutySHCess;
$totcustomED = $totcustomED + $record->AfterCustomEdCess;
//echo $record->AfterLandingCharge + $TotalLanding;
$TotalLanding = $TotalLanding + ($record->AfterLandingCharge);
$tothighseas = $tothighseas + $record->AfterHighSeasSalesCharge;
$totcustom = $totcustom + $record->AfterCustomDuty;
$totexciseduty = $totexciseduty + $record->AfterExciseDuty;
$totexcisedutyED = $totexcisedutyED + $record->AfterExciseDutyEdCess;
$totexciseSH = $totexciseSH + $record->AfterExciseDutySHCess;
$totcustomED = $totcustomED + $record->AfterCustomEdCess;
$totcustomSH = $totcustomSH + $record->AfterCustomSHCess;
$totaddtnlexcise = $totaddtnlexcise + $record->AfterAddlExciseDuty;
$totgrossduty = $totgrossduty + $record->Grossdutypayable;
// $totavlmodvat = $totavlmodvat +$record->AvailableModvat;
//$totgrossduty=$totgrossduty+$record->Grossdutypayable;
$totavlmodvat = $totavlmodvat + $record->AvailableModvat;
$totgrossexpense = $totgrossexpense + $record->Grossexpensesduetocustomduty;
$ExchangeRate = $record->ExchangeRate;
//echo $totorder;
$totorder = $totorder + $record->TotalOrderValue;
$totcustomSH = $totcustomSH + $record->AfterCustomSHCess;
$totaddtnlexcise = $totaddtnlexcise + $record->AfterAddlExciseDuty;
$totgrossduty = $totgrossduty + $record->Grossdutypayable;
// $totavlmodvat = $totavlmodvat +$record->AvailableModvat;
//$totgrossduty=$totgrossduty+$record->Grossdutypayable;
$totavlmodvat = $totavlmodvat + $record->AvailableModvat;
$totgrossexpense = $totgrossexpense + $record->Grossexpensesduetocustomduty;
$ExchangeRate = $record->ExchangeRate;
//echo $totorder;
$totorder = $totorder + $record->TotalOrderValue;
//echo $totorder;
//echo $totorder;
$totfreight = $totfreight + $record->AfterFreightValue;
$totfreight = $totfreight + $record->AfterFreightValue;
$totassesable = $totassesable + $record->AssessableValue;
$totSubtotal = $totSubtotal + $record->SubTotal;
$totigst = $totigst + $record->AfterIGST;
$totassesable = $totassesable + $record->AssessableValue;
$totSubtotal = $totSubtotal + $record->SubTotal;
$totigst = $totigst + $record->AfterIGST;
//echo $totcustomED;
// $totorder=$record->TotalOrderValue;
// //$ServiceDescription=$record->ServiceDescription;
// echo $totorder;
//alert($totorder);
//echo $totcustomED;
// $totorder=$record->TotalOrderValue;
// //$ServiceDescription=$record->ServiceDescription;
// echo $totorder;
//alert($totorder);
}
}
?>
?>
<input type="hidden" name="txtRowCount" id="txtRowCount" value="<?php echo $index; ?>">
<input type="hidden" name="txtRowCount" id="txtRowCount" value="<?php echo $index; ?>">
<?php
//echo $totcustomED;
$totalhidden = $totorder;
$totorder = number_format($totorder, 2, '.', '');
<?php
//echo $totcustomED;
$totalhidden = $totorder;
$totorder = number_format($totorder, 2, '.', '');
//echo $to;
$TotalLanding = number_format($TotalLanding, 2, '.', '');
$tothighseas = number_format($tothighseas, 2, '.', '');
$totcustom = number_format($totcustom, 2, '.', '');
$totexciseduty = number_format($totexciseduty, 2, '.', '');
$totexcisedutyED = number_format($totexcisedutyED, 2, '.', '');
$totexciseSH = number_format($totexciseSH, 2, '.', '');
$totcustomED = number_format($totcustomED, 2, '.', '');
$totcustomSH = number_format($totcustomSH, 2, '.', '');
$totaddtnlexcise = number_format($totaddtnlexcise, 2, '.', '');
$totgrossduty = number_format($totgrossduty, 2, '.', '');
$totavlmodvat = number_format($totavlmodvat, 2, '.', '');
$totgrossexpense = number_format($totgrossexpense, 2, '.', '');
$totfreight = number_format($totfreight, 2, '.', '');
//echo $to;
$TotalLanding = number_format($TotalLanding, 2, '.', '');
$tothighseas = number_format($tothighseas, 2, '.', '');
$totcustom = number_format($totcustom, 2, '.', '');
$totexciseduty = number_format($totexciseduty, 2, '.', '');
$totexcisedutyED = number_format($totexcisedutyED, 2, '.', '');
$totexciseSH = number_format($totexciseSH, 2, '.', '');
$totcustomED = number_format($totcustomED, 2, '.', '');
$totcustomSH = number_format($totcustomSH, 2, '.', '');
$totaddtnlexcise = number_format($totaddtnlexcise, 2, '.', '');
$totgrossduty = number_format($totgrossduty, 2, '.', '');
$totavlmodvat = number_format($totavlmodvat, 2, '.', '');
$totgrossexpense = number_format($totgrossexpense, 2, '.', '');
$totfreight = number_format($totfreight, 2, '.', '');
$totassesable = number_format($totassesable, 2, '.', '');
$totSubtotal = number_format($totSubtotal, 2, '.', '');
$totigst = number_format($totigst, 2, '.', '');
}
?>
$totassesable = number_format($totassesable, 2, '.', '');
$totSubtotal = number_format($totSubtotal, 2, '.', '');
$totigst = number_format($totigst, 2, '.', '');
}
?>
</tbody>
</table>
</tbody>
</table>
</div>
</div>
</div>
</div>
<br><br>
@ -4279,12 +4284,13 @@ if (!empty($getlogpodtl)) {
//alert('in');
PONOStatus = <?php echo $PONOStatus; ?>
var shorten = materialName.length > 13 ? materialName.slice(0, 13) + "..." : materialName;
var rowHtml = `
<tr id="${temp}">
<td align="left">${temp}</td>
<td align="left">${Reqnumber}</td>
<td align="left">${materialCode}</td>
<td align="left">${materialName}</td>`;
<td align="left">${shorten}</td>`;
if (PONOStatus === "PO_DRAFT" || PONOStatus === "PO_CREATED") {
rowHtml += `<td><a href="#" class="editable-field"
data-id="${temp}"
@ -5334,14 +5340,7 @@ if (!empty($getlogpodtl)) {
url: "<?php echo base_url() ?>purchaseorder/DeletePODetails",
success: function(data) {
$('#loader').hide();
if (data) {
// $('#content').loader('hide');
alert(data);
} else {
alert("Error");
}
(data) ? alert(response) : alert("Error");
}
});
}
@ -5496,20 +5495,20 @@ if (!empty($getlogpodtl)) {
//exit();
//var TotalOrder=$('#txtToatlOrder').val();
//exit();
if (validate() && Budgetcheck()) {
if (document.getElementById('ImportTax').rows.length <= 0) {
if (importValidate() && Budgetcheck()) {
// if (document.getElementById('ImportTax').rows.length <= 0) {
alert('Please Select Line item to Create PO');
$('#Deliverydt').focus();
return false;
} else {
// alert('Please Select Line item to Create PO');
// $('#Deliverydt').focus();
// return false;
// } else {
// $('#content').loader('show');
var formData = new FormData($('.ImportPO')[0]);
formData.append('txtRowCount', Row);
formData.append('txtDeletedRow', txtDeletedRow);
formData.append('textStatus', stat);
$('#loader').show();
// disableButtons();
$.ajax({
// data:$('.ImportPO').serialize()+"&txtRowCount="+Row+"&txtDeletedRow="+txtDeletedRow+"&textStatus="+stat,
data: formData,
@ -5530,16 +5529,18 @@ if (!empty($getlogpodtl)) {
//$('#SpcialInstruction').val('');
//$('#txtDeliveryAddress').val('');
window.location = "purchaseorderListing";
// setTimeout(function() { enableButtons(); }, 2000);
} else {
alert("Error");
// setTimeout(function() { enableButtons(); }, 2000);
}
}
});
}
// }
}
}

View File

@ -70,12 +70,12 @@ td {
.th-requestedQuantity{
text-align:center !important;
text-align:right !important;
width:15%;
}
.th-PoQuantity{
text-align:center !important;
text-align:right !important;
width:15%;
}
@ -85,7 +85,7 @@ td {
}
.th-uom{
text-align:center !important;
text-align:left !important;
width:10%;
}
@ -226,9 +226,9 @@ td {
<input type="hidden" name="<?php echo 'te' . $index ?>" id="<?php echo 'tes' . $index ?>" value="<?php echo $record->Quantity; ?>" />
<td align="center"><?php echo $record->MaterialCode; ?></td>
<td align="left"><?php echo $record->MaterialName; ?></td>
<td align="center"><?php echo $record->UOM; ?></td>
<td align="center"><?php echo $record->Quantity; ?></td>
<td align="center"><?php echo $record->POQTY; ?></td>
<td align="left"><?php echo $record->UOM; ?></td>
<td align="right"><?php echo $record->Quantity; ?></td>
<td align="right"><?php echo $record->POQTY; ?></td>
<td align="center"><?php echo $record->StatusName; ?></td>
<input type="hidden" name="<?php echo 'materialdesc' . $index ?>" id="<?php echo 'materialdesc' . $index ?>" value="<?php echo isset($record->MaterialDescription) ? $record->MaterialDescription : ''; ?>" />
<td>
@ -818,9 +818,9 @@ td {
<td align="center">${temp}</td>
<td align="center">${materialCode}</td>
<td align="left">${materialName}</td>
<td align="center">${uom}</td>
<td align="center">${quantity}</td>
<td align="center">0.00</td>
<td align="left">${uom}</td>
<td align="right">${quantity}</td>
<td align="right">0.00</td>
<td align="center">NEW</td>
<td>
<a data-id="${temp}" data-userid="${temp}" data-target='#edit-req-modal' data-toggle="modal" href="#edit-req-modal">

View File

@ -135,7 +135,15 @@
} else {
$cdate = date('d-m-Y', strtotime($record->Created_date));
} ?>
<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></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>
<?php if($record->is_driver){ ?>
&nbsp;&nbsp;&nbsp;
<a title="Trip Details" style="cursor:pointer;" href="<?= base_url() . 'loadDriverAttendance?gobal_driver_id=' . $record->EmpID.'&date='.$cdate; ?>">
<i class="fa fa-truck"></i>&nbsp;&nbsp;&nbsp;
</a>
<?php } ?>
</td>
<td><?php echo $record->FirstName; ?></td>
<td><?php echo $record->ContactNumber ?></td>
<td><?php echo $record->Designation ?></td>

View File

@ -370,7 +370,7 @@ if (isset($AvlimportBudAmt) && !empty($AvlimportBudAmt)) {
$("#PODate").datepicker({
minDate: d,
maxDate: 'now',
dateFormat: 'dd-mm-yy',
format: 'dd-mm-yy',
changeMonth: true,
changeYear: true,
yearRange: '-100:+0'
@ -380,7 +380,7 @@ if (isset($AvlimportBudAmt) && !empty($AvlimportBudAmt)) {
$("#Exchangerateon").datepicker({
minDate: m,
//maxDate : 'now',
dateFormat: 'dd-mm-yy',
format: 'dd-mm-yy',
changeMonth: true,
changeYear: true,
yearRange: '-100:+0'
@ -399,31 +399,35 @@ if (isset($AvlimportBudAmt) && !empty($AvlimportBudAmt)) {
}
function vaildateBeforeOpenModal() {
if ($('#PODate').val() == '') {
alert('Please Enter the Purchase Order date');
$('#PODate').focus();
return false;
} else if ($('#drpSupplier').val() == "0") {
var radioValue = parseInt($("input[name='DateRange']:checked").val());
if ($('#drpSupplier').val() == "0") {
alert('Please Select the Supplier details');
$('#drpSupplier').focus();
return false;
} else if ($('#currencytype').val() == '0') {
alert('Please Select the Currency Type');
$('#currencytype').focus();
return false;
} else if ($('#PODate').val() == '') {
alert('Please Enter the Purchase Order date');
$('#PODate').focus();
return false;
} else if ($('#DeliveryAddr').val() == '') {
alert('Please Enter the Delivery Address');
$('#DeliveryAddr').focus();
return false;
} else if ($('#Dispatch').val() == '' && $('#Scheduleby').val() == '') {
if (document.getElementById("Schedule").checked) {
alert('Please Enter Schedule By');
return false;
} else if (document.getElementById("Date").checked) {
alert('Please Enter Dispatch Instruction');
return false;
}
} else if ($('#currencytype').val() == '0') {
alert('Please Select the Currency Type');
$('#currencytype').focus();
return false;
} else if (radioValue === 1 && $('#Scheduleby').val() == '') {
alert('Please Enter Schedule By');
$('#Scheduleby').focus();
return false;
} else if (radioValue === 2 && $('#Dispatch').val() == '') {
alert('Please Enter Dispatch Instruction');
$('#Dispatch').focus();
return false;
} else if ($('#ExchangeRate').val() == '') {
alert('Please Enter the Exchange Rate');
$('#ExchangeRate').focus();
@ -436,22 +440,25 @@ if (isset($AvlimportBudAmt) && !empty($AvlimportBudAmt)) {
alert('Please Enter Place Of Origin');
$('#PlaceOforigin').focus();
return false;
} else if ($('#PaymentTerms').val() == '') {
alert('Please Select Payment Terms');
$('#PaymentTerms').focus();
return false;
} else if ($('#BudgetType').val() == "0") {
alert('Please Select Budget Type');
$('#BudgetType').focus();
return false;
} else if ($('#Importoption').val() == "0") {
} else if ($('#Importoption').val() == "0") {
alert('Please Select Import Type');
$('#Importoption').focus();
return false;
} else {
} else if ($('#PaymentTerms').val() == '') {
alert('Please Select Payment Terms');
$('#PaymentTerms').focus();
return false;
} else if ($('#Otherpayment').val() == '' && $('#PaymentTerms').val() == 'PT08') {
alert('Please Enter Payable Terms Description');
$('#Otherpayment').focus();
return false;
} else if ($('#BudgetType').val() == "0") {
alert('Please Select Budget Type');
$('#BudgetType').focus();
return false;
}
else {
return true;
}
}
@ -814,18 +821,20 @@ if (isset($AvlimportBudAmt) && !empty($AvlimportBudAmt)) {
</div>
<br />
<div class="form-row">
<table id="ImportTax" class="table table-bordered table-hover" style="background-color:#fff;font-size:12px;">
<div class="table-responsive" style="padding-bottom: 30px;">
<table id="ImportTax" class="table nowrap table-bordered table-hover mb-0" style="font-size:12px;">
<thead>
<tr>
<th>SNo</th>
<th>Requisition No</th>
<th>Material Code</th>
<th>Description</th>
<th>Line Item Specs</th>
<th>Quantity</th>
<th>UOM</th>
<th>Rate<?php echo $INR ?></th>
<th>Basic Amount<?php echo $INR ?></th>
<th style="white-space: nowrap !important;">SNo</th>
<th style="white-space: nowrap !important; text-align:right !important">Requisition No</th>
<th style="white-space: nowrap !important;">Item Code</th>
<th style="white-space: nowrap !important;">Item Description</th>
<th style="white-space: nowrap !important;">Line Item Specs</th>
<th style="white-space: nowrap !important; text-align:right !important">Quantity</th>
<th style="white-space: nowrap !important;">UOM</th>
<th style="white-space: nowrap !important; text-align:right !important">Rate<?php echo "($INR)" ?></th>
<th style="white-space: nowrap !important; text-align:right !important">Basic Amount<?php echo "($INRSYM)" ?></th>
<!-- <th>Received Qty</th> -->
<!-- <th>Rejected Qty</th> -->
<!-- <th>Pending Qty</th> -->
@ -839,6 +848,7 @@ if (isset($AvlimportBudAmt) && !empty($AvlimportBudAmt)) {
</tbody>
</table>
</div>
</div>
<div class="form-row">
<div class="form-group col-md-4">
@ -974,30 +984,26 @@ if (isset($AvlimportBudAmt) && !empty($AvlimportBudAmt)) {
<div class="form-row">
<div class="form-group col-md-4">
<a class="btn btn-success Save" ID="Save" onclick="Save(0)">
<span class="bold">Save as Draft</span>
</a>
</div>
<div class="form-group col-md-4">
</div>
<div class="form-group col-md-4" align="right">
<div class="form-group col-md-12" align="right">
<input type="hidden" name="txtPoRange" id="txtPoRange" />
<input type="hidden" name="isEdit" id="isEdit" value="0" />
<input type="hidden" name="txtStatus" id="txtStatus" />
<input type="hidden" name="txtRowCount" id="txtRowCount" />
<input type="hidden" name="txtDeletedRow" id="txtDeletedRow" />
<input type="hidden" name="Budget" id="Budget" />
<input type="reset" class="btn btn-success" value="Reset" onclick="window.location.reload()" style="margin-right: 15px;">
<div class="btn-container" style="text-align: right;">
<a class="btn btn-success Submit" ID="Submit" onclick="Save(1)">
<span class="bold">Submit</span>
</a>
<!-- <a class="btn btn-success Save" ID="Cancel" onclick="Reset();">&nbsp;&nbsp;<span class="bold">Reset</span></a> -->
<!-- <input type="reset" class="btn btn-success" value="Reset" onclick="window.location.reload()"> -->
<a class="btn btn-success Save" ID="Cancel" onclick="Reset();">&nbsp;&nbsp;<span class="bold">Reset</span></a>
<a class="btn btn-success Save" ID="Save" onclick="Save(0)">&nbsp;&nbsp;<span class="bold">Save as Draft</span></a>
<a class="btn btn-success Submit" ID="Submit" onclick="Save(1)">&nbsp;&nbsp;<span class="bold">Submit</span></a>
</div>
</div>
@ -3513,13 +3519,14 @@ if (isset($AvlimportBudAmt) && !empty($AvlimportBudAmt)) {
// RejectedQty: rejectedqty,
// PendingQty: pendingqty
// }));
var shorten = materialName.length > 13 ? materialName.slice(0, 13) + "..." : materialName;
var rowHtml = `
<tr id="${temp}">
<td align="left">${temp}</td>
<td align="left">${Reqnumber}</td>
<td align="left">${materialCode}</td>
<td align="left">${materialName}</td>
<td>
<td style="text-align:left !important">${temp}</td>
<td style="text-align:right !important">${Reqnumber}</td>
<td style="text-align:left !important">${materialCode}</td>
<td style="text-align:left !important">${shorten}</td>
<td style="text-align:left !important">
<a href="#" class="editable-field"
data-notes = "-" data-id ="${temp}">-</a>
<div class="edit-container" style="display:none;">
@ -3528,10 +3535,10 @@ if (isset($AvlimportBudAmt) && !empty($AvlimportBudAmt)) {
<button class="cancel-btn"></button>
</div>
</td>
<td align="left">${quantity}</td>
<td align="left">${uom}</td>
<td align="left">${itemRate}</td>
<td align="left">${BasicAmt}</td>
<td style="text-align:right !important">${quantity}</td>
<td style="text-align:left !important">${uom}</td>
<td style="text-align:right !important">${itemRate}</td>
<td style="text-align:right !important">${BasicAmt}</td>
<td>
<a data-target='#editimportpomodel' data-id="${temp}" data-userid="${temp}" data-toggle="modal" href="#editimportpomodel">
<i class="ri-pencil-fill" data-toggle="tooltip"></i>
@ -4183,27 +4190,14 @@ if (isset($AvlimportBudAmt) && !empty($AvlimportBudAmt)) {
//alert(stat);
//alert(JSON.stringify(txtStatus));
//exit();
if (validate() && Budgetcheck()) {
if (document.getElementById('ImportTax').rows.length <= 0) {
alert('Please Select Line item to Create PO');
$('#Deliverydt').focus();
return false;
} else if ($('#Importoption').val() == "0") {
alert('Please Select Import Type');
$('#Importoption').focus();
return false;
} else {
if (importValidate() && Budgetcheck()) {
// $('#content').loader('show');
var formData = new FormData($('.ImportPO')[0]);
formData.append('txtRowCount', txtRowCount);
formData.append('txtDeletedRow', txtDeletedRow);
formData.append('textStatus', stat);
// disableButtons();
$.ajax({
// data:$('.ImportPO').serialize()+"&txtRowCount="+txtRowCount+"&txtDeletedRow="+txtDeletedRow+"&textStatus="+stat,
@ -4222,17 +4216,22 @@ if (isset($AvlimportBudAmt) && !empty($AvlimportBudAmt)) {
//$('#SpcialInstruction').val('');
//$('#txtDeliveryAddress').val('');
window.location = "purchaseorderListing";
// setTimeout(function() { enableButtons(); }, 2000);
} else {
alert("Error");
// setTimeout(function() { enableButtons(); }, 2000);
}
}
},
error: function(jqXHR, textStatus, errorThrown) {
console.error("AJAX Error: " + textStatus + ": " + errorThrown);
alert("Error: " + textStatus);
// setTimeout(function() { enableButtons(); }, 2000);
}
});
}
}
@ -4335,4 +4334,12 @@ if (isset($AvlimportBudAmt) && !empty($AvlimportBudAmt)) {
calculateFreight(1);
});
function Reset() {
// disableButtons();
location.reload();
// setTimeout(function() {
// enableButtons();
// }, 2000);
}
</script>

View File

@ -654,6 +654,7 @@
</a>
<div class="dropdown-menu" aria-labelledby="topnav-hr">
<a href="<?php echo base_url(); ?>sales_invoice" class="dropdown-item"><i class="ri-file-list-3-line align-middle mr-1"></i>Invoice</a>
<a href="<?php echo base_url(); ?>sales_report" class="dropdown-item"><i class="ri-file-list-3-line align-middle mr-1"></i>Invoice Report</a>
<?php if(session()->get('roleText') == 'System Administrator'){?>
<!-- <a href="<?php echo base_url(); ?>dashboard" class="dropdown-item"><i class="ri-refresh-line align-middle mr-1"></i>Sync With Zoho Books</a> -->
@ -764,13 +765,13 @@
</a>
<div class="dropdown-menu" aria-labelledby="topnav-hr">
<a href="<?php echo base_url(); ?>employeeListing" class="dropdown-item"><i class="ri-shield-user-line align-middle mr-1"></i> Employee Details</a>
<a href="<?php echo base_url(); ?>DriverListing" class="dropdown-item"><i class="ri-file-settings-line align-middle mr-1"></i> Driver Details</a>
<!-- <a href="<?php echo base_url(); ?>DriverListing" class="dropdown-item"><i class="ri-file-settings-line align-middle mr-1"></i> Driver Details</a> -->
<a href="<?php echo base_url(); ?>attendance" class="dropdown-item"><i class=" ri-time-line align-middle mr-1"></i> Attendance</a>
<div class="dropdown">
<a class="dropdown-item dropdown-toggle arrow-none" href="#" id="topnav-payslip"
role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<i class="ri-secure-payment-line align-middle mr-1"></i> Employee PaySlip <div class="arrow-down"></div>
<i class="ri-secure-payment-line align-middle mr-1"></i> PaySlip <div class="arrow-down"></div>
</a>
<div class="dropdown-menu" aria-labelledby="topnav-payslip">
<a href="<?php echo base_url(); ?>monthlypay" class="dropdown-item">Monthly Pay Information </a>
@ -781,7 +782,7 @@
</div>
</div>
<div class="dropdown">
<!-- <div class="dropdown">
<a class="dropdown-item dropdown-toggle arrow-none" href="#" id="topnav-payslip"
role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<i class="ri-secure-payment-line align-middle mr-1"></i> Driver PaySlip <div class="arrow-down"></div>
@ -790,7 +791,7 @@
<a href="<?php echo base_url(); ?>driverMonthlyPayInputs" class="dropdown-item">Monthly Pay Information </a>
<a href="<?php echo base_url(); ?>driverViewPay" class="dropdown-item">PaySlip Generator</a>
</div>
</div>
</div> -->
<div class="dropdown">
<a class="dropdown-item dropdown-toggle arrow-none" href="#" id="topnav-leave"

View File

@ -23,7 +23,7 @@
<div class="col-12">
<div class="page-title-box page-title-box-alt">
<div class="page-title-right">
<ol class="breadcrumb m-0">
<ol class="breadcrumb mt-2 mb-2.5">
<li class="breadcrumb-item"><a href="javascript: void(0);">Inward</a></li>
<li class="breadcrumb-item active">
<h4 class="page-title">Inward Gate Register</h4>
@ -91,7 +91,7 @@
</div>
<div class="form-group col-md-3">
<label class="col-form-label">Invoice Date<span class="text-danger">*</span></label>
<input class="form-control" data-provide="datepicker" data-date-format="dd-mm-yyyy" data-date-autoclose="true" id="InvoiceDate" name="InvoiceDate" data-date-end-date="<?= date('d-m-Y'); ?>" required autocomplete="off">
<input class="form-control" data-provide="datepicker" data-date-format="dd-mm-yyyy" data-date-autoclose="true" id="InvoiceDate" name="InvoiceDate" data-date-end-date="<?= date('d-m-Y'); ?>" required autocomplete="off" data-date-orientation="bottom">
</div>
@ -99,7 +99,7 @@
<div class="form-group col-md-3">
<label class="col-form-label">Material Received Date<span class="text-danger">*</span></label>
<input class="form-control" data-provide="datepicker" data-date-format="dd-mm-yyyy" data-date-autoclose="true" id="MaterialRcvdDate" name="MaterialRcvdDate" data-date-end-date="<?= date('d-m-Y'); ?>" required autocomplete="off">
<input class="form-control" data-provide="datepicker" data-date-format="dd-mm-yyyy" data-date-autoclose="true" id="MaterialRcvdDate" name="MaterialRcvdDate" data-date-end-date="<?= date('d-m-Y'); ?>" required autocomplete="off" data-date-orientation="bottom">
</div>
<div class="form-group col-md-3">

View File

@ -25,7 +25,7 @@
<div class="col-6">
<div class="page-title-box page-title-box-alt">
<div class="page-title-right">
<ol class="breadcrumb m-0">
<ol class="breadcrumb mt-2 mb-2.5">
<li class="breadcrumb-item"><a href="javascript: void(0);">HR</a></li>
<li class="breadcrumb-item"><a href="javascript: void(0);">Leave</a></li>
<li class="breadcrumb-item active">
@ -46,8 +46,8 @@
<div class="col-12">
<div class="card">
<form action="<?php echo base_url() ?>leavereports" method="POST" id="searchList">
<div class="row">
<div class="col-md-3" style="margin: 10px;">
<div class="row" style="padding: 18px 26px;">
<div class="col-md-3" style="margin: 10px 0px;">
<?php if (!empty($fiscalyears)) {
foreach ($fiscalyears as $fy):
$options[$fy] = $fy;

View File

@ -111,7 +111,7 @@
<div class="col-6">
<div class="page-title-box page-title-box-alt">
<div class="page-title-right">
<ol class="breadcrumb m-0">
<ol class="breadcrumb mt-2 mb-2.5">
<li class="breadcrumb-item"><a href="javascript: void(0);">HR</a></li>
<li class="breadcrumb-item"><a href="javascript: void(0);">PaySlip</a></li>
<li class="breadcrumb-item active">
@ -233,6 +233,7 @@
<th class="celda_encabezado_general">DOJ</th>
<th class="celda_encabezado_general">Designation</th>
<th class="celda_encabezado_general">Total Days</th>
<th class="celda_encabezado_general">Number Of Trips</th>
<th class="celda_encabezado_general">Days Worked</th>
<th class="celda_encabezado_general">LOP Days</th>
<th class="celda_encabezado_general">Paid Leave</th>
@ -264,8 +265,6 @@
if (!empty($sample)) {
$index = 0;
$i = 0;
foreach ($sample as $i => $record) {
@ -296,7 +295,7 @@
</td>
<td style="max-width:80px;text-align:center;"><?php echo $record->NoofDays; ?></td>
<td style="max-width:80px;text-align:center;"><?php echo 0; ?></td>
<td id="dayWork<?php echo $index ?>"
<?php if (empty($record->Key)) {
echo "contenteditable='false';";
@ -353,7 +352,7 @@
} ?>
</td>
<td style="max-width:80px;text-align:right;"><?php echo $record->TotalSalary; ?></td>
<td id="ttlsalary<?php echo $index ?>" style="max-width:80px;text-align:right;"><?php echo $record->TotalSalary; ?></td>
<td style="max-width:80px;text-align:right;">
<?php $perDaySalary = $record->TotalSalary / $record->NoofDays;
@ -496,7 +495,8 @@
<input type="hidden" id="duedate<?php echo $index ?>"
value="<?php echo $record->DueDate ?>">
<input type="hidden" id="is_driver<?php echo $index ?>"
value="<?php echo $record->is_driver ?>">
@ -508,9 +508,175 @@
}
}
}
$inx = $index;
if(!empty($drivermonthinputs)){
foreach ($drivermonthinputs as $i => $record) {
$inx++;
$hra_worked = $record->hra_worked;
$basic_worked = $record->basic_worked;
$sum_of_amount = ($record->driver_salary+$record->driver_shed+$record->driver_diesel);
?>
<tr class="lastvalue">
<td style="text-align:right;" style="background-color:blue;">
<?php echo $inx; ?></td>
<td style="max-width:80px"><?php echo $record->EmpID; ?></td>
<td style="background-color: #d8d8ea;" >
<?php echo $record->FirstName; ?>
</td>
<td style="max-width: 100px;">
<?php
$date = DateTime::createFromFormat('Y-m-d H:i:s', $record->DateofJoining);
$newDateFormat = $date->format('d-m-Y');
echo $newDateFormat;
?>
</td>
<td style="max-width: 150px;overflow: hidden;text-overflow: ellipsis;">
<?php echo $record->Designation; ?>
</td>
<td style="max-width:80px;text-align:center;">
<?php echo $record->total_cal_days; ?>
</td>
<td style="max-width:80px;text-align:center;">
<?php echo $record->no_of_loads." (trip)"; ?>
</td>
<td id="dayWork<?php echo $inx ?>" style="text-align:center;">
<?php echo number_format($record->unique_days, 2, '.', ''); ?>
</td>
<td id="lopDay<?php echo $inx ?>" style="text-align:center;">
<?php echo number_format(0.00, 2, '.', ''); ?>
</td>
<td id="paidLeave<?php echo $inx ?>" style="text-align:center;">
<?php echo number_format(0.00, 2, '.', ''); ?>
</td>
<td id="otHrsWork<?php echo $inx ?>" style="text-align:center;">
<?php echo number_format(0.00, 2, '.', ''); ?>
</td>
<td id="ttlsalary<?php echo $inx ?>" style="max-width:80px;text-align:right;">
<?php echo number_format($sum_of_amount, 2, '.', ''); ?>
</td>
<td style="max-width:80px;text-align:right;">
<?php
$worked_amt = $sum_of_amount / $record->total_cal_days ;
echo number_format($worked_amt, 2, '.', ''); ?>
</td>
<td style="max-width:80px;text-align:right;">
<?php echo number_format($sum_of_amount, 2, '.', ''); ?>
</td>
<td style="max-width:80px;text-align:right;">
<?php $hr_amt = $worked_amt/8;
echo number_format($hr_amt, 2, '.', ''); ?>
</td>
<td style="max-width:80px;text-align:right;">
<!-- $record->driver_salary_amount -->
<?php echo number_format($sum_of_amount, 2, '.', ''); ?>
</td>
<td style="max-width:80px;text-align:right;">
<?php
echo number_format($basic_worked, 2, '.', ''); ?>
</td>
<td style="max-width:80px;text-align:right;">
<?php
echo number_format($hra_worked, 2, '.', ''); ?>
</td>
<td style="max-width:80px;text-align:right;">
<?php echo number_format($basic_worked + $hra_worked, 2, '.', ''); ?>
</td>
<td id="esiAmt<?php echo $inx ?>" style="max-width:80px;text-align:right;"> <?php echo $record->esi_amount; ?> </td>
<td id="pfAmt<?php echo $inx ?>" style="max-width:80px;text-align:right;"> <?php echo $record->pf_amount; ?> </td>
<td style="max-width:80px;text-align:right;">
<?php echo number_format(0.00, 2, '.', ''); ?>
</td>
<td id="monthDue<?php echo $inx ?>" onkeypress="return isNumber(event);" onkeyup="driverchangeInput(event);"
<?php if (empty($record->payroll_id)) { echo "contenteditable='true';"; } ?>
<?php if (!empty($record->payroll_id)) { ?> title="Payslip Calculated"
style="text-align:right;color:blue;"
<?php } else { ?>style="text-align:right;" <?php } ?>>
<?php if (!empty($record->Monthly_Due)) {
echo $record->Monthly_Due;
$totalmonthloan[] = $record->Monthly_Due;
} else {
echo number_format(0.00, 2, '.', '');
} ?>
</td>
<td id="otherDet<?php echo $inx ?>" onkeypress="return isNumber(event);" onkeyup="changeInput(event);" style="text-align:right;">
<?php echo number_format(0.00, 2, '.', ''); ?>
</td>
<!-- <?php $totalotherDet[] = isset($Other_Deductions) ? $Other_Deductions : []; ?> -->
<td id="Festival<?php echo $inx ?>" onkeypress="return isNumber(event);"
onkeyup="driverchangeInput(event);"
<?php if (empty($record->payroll_id)) {
echo "contenteditable='true';";
} ?>
<?php if (!empty($record->payroll_id)) { ?> title="Payslip Calculated"
style="text-align:right;color:blue;"
<?php } else { ?>style="text-align:right;" <?php } ?>>
<?php if (!empty($record->Festival_Bonus)) {
echo $record->Festival_Bonus;
$totalfestival[] = $record->Festival_Bonus;
} else {
echo number_format(0.00, 2, '.', '');;
} ?>
</td>
<?php $totalfestival[] = isset($Festival_Bonus) ? $Festival_Bonus : []; ?>
<td id="empsal<?php echo $inx ?>"
<?php if (empty($record->payroll_id)) {
echo "contenteditable='false';";
} ?>
<?php if (!empty($record->payroll_id)) { ?> title="Payslip Calculated"
style="text-align:right;color:blue;" <?php }else{ ?>style="text-align:right;" <?php } ?>>
<?php if (!empty($record->driver_final_payment)) {
echo $record->driver_final_payment;
$estTotal[] = $record->driver_final_payment;
} else {
echo $empSalary[$i];
$estTotal[] = $empSalary[$i];
}
?>
</td>
<input type="hidden" id="loanatm<?php echo $inx ?>"
value="<?php echo isset($record->Loan_Amount) ? $record->Loan_Amount : 0 ?>">
<input type="hidden" id="paidamt<?php echo $inx ?>"
value="<?php echo $record->Paid_Amount ?>">
<input type="hidden" id="duedate<?php echo $inx ?>"
value="<?php echo $record->DueDate ?>">
<input type="hidden" id="is_driver<?php echo $inx ?>"
value="<?php echo $record->is_driver ?>">
</tr>
<?php }} ?>
</tbody>
<tfoot>
@ -519,7 +685,7 @@
<th></th> <th></th> <th></th> <th></th> <th></th>
<th></th> <th></th> <th></th> <th></th> <th></th>
<th></th> <th></th> <th></th> <th></th> <th></th>
<th>Total</th>
<th></th> <th>Total</th>
<th id="monthloan" style="text-align:right;">
<?php echo isset($totalmonthloan) ? number_format(array_sum($totalmonthloan), 2) : ''; ?>
</th>
@ -718,7 +884,7 @@ $(document).ready(function () {
// Convert the filtered array back to a JSON string if needed
alldata = JSON.stringify(alldata);
var month = $('#monthyear').val();
$('#loader').show();
$.ajax({
data: {
@ -732,8 +898,7 @@ $(document).ready(function () {
if (data) {
$('#loader').hide();
alert(data);
alert(data);
}
}
@ -750,7 +915,7 @@ $(document).ready(function () {
$("#formid").attr("method", "post");
//alert($s);
$("#formid").attr("action", "<?php echo base_url() ?>payslip/changeMonth");
$("#formid").attr("action", "<?php echo base_url() ?>monthlypay");
$('#formid').submit();
@ -971,6 +1136,97 @@ $(document).ready(function () {
calculategrandtotal();
}
function driverchangeInput(event, k) {
var str = event.target.id;
var sno = str.substr(8);
// console.log(sno);return true;
var driverEarn = parseFloat(document.getElementById('ttlsalary' + sno).textContent);
var Festivals = parseFloat(document.getElementById('Festival' + sno).textContent);
totalfestival[sno] = Festivals;
var element = document.getElementById('loanatm' + sno);
var loanamt = parseFloat(element.value);
var paidamt = parseFloat(document.getElementById('paidamt' + sno).value);
var monthDue = parseFloat(document.getElementById('monthDue' + sno).textContent);
var duedate = document.getElementById('duedate' + sno).value;
duedate = new Date(duedate);
var paydate = document.getElementById('paydate').value;
var paydate = document.getElementById('paydate').value;
if (paydate.length == 6) {
paydate = '0' + paydate;
}
var pmonthonly = paydate.substring(0, 2);
var pyearonly = paydate.substring(3);
var pday = new Date(pyearonly, pmonthonly, 0).getDate();
var finalpaydate = pyearonly + '-' + pmonthonly + '-' + pday;
finalpaydate = new Date(finalpaydate);
var current_loan_amt = 0;
var autoLoan = parseFloat(monthDue);
var Balance_Amount = loanamt - paidamt;
if (autoLoan > Balance_Amount) {
if (duedate <= finalpaydate) {
current_loan_amt = Balance_Amount;
}
} else {
current_loan_amt = autoLoan;
}
if (isNaN(driverEarn)) { driverEarn = 0; }
var driverSalaryAdd = driverEarn + Festivals;
var driverSalarySub = current_loan_amt;
console.log(current_loan_amt);
var driverMonthSalary = driverSalaryAdd - driverSalarySub
var driverSalary = Math.round(driverMonthSalary);
var cals = (driverSalary).toFixed(0);
document.getElementById("empsal" + sno).innerHTML = cals;
// copied from calculategrandtotal() because we need those two only thats why
var AutoLoanDueIndex = 21;
var AutoLoanDue = 0;
$('#monthlylistings tbody tr').each(function() {
var value = $(this).find('td').eq(AutoLoanDueIndex).text();
AutoLoanDue += parseFloat(value) || 0;
});
$('#monthloan').text(AutoLoanDue);
var FestivalBonusIndex = 23;
var FestivalBonus = 0;
$('#monthlylistings tbody tr').each(function() {
var value = $(this).find('td').eq(FestivalBonusIndex).text();
FestivalBonus += parseFloat(value) || 0;
});
$('#fest').text(FestivalBonus);
var EstimateIndex = 24;
var Estimate = 0;
$('#monthlylistings tbody tr').each(function() {
var value = $(this).find('td').eq(EstimateIndex).text();
Estimate += parseFloat(value) || 0;
});
$('#estsal').text(Estimate);
}
function calculategrandtotal()
{

View File

@ -57,16 +57,17 @@ $monthsoptions = array("01" => "Jan", "02" => "Feb", "03" => "Mar", "04" => "Apr
},
type: "POST",
url: "<?php echo base_url(); ?>payslip/checkExistPay",
dataType: "json",
success: function(result) {
if (result != 1) {
if (result['count'] != 1) {
$.ajax({
data: {
payon: payon,
employee: employee
},
type: "POST",
url: "<?php echo base_url(); ?>payslip/callsp",
url: "<?php echo base_url(); ?>".result['path'],
success: function(result) {
console.log(result);
$('#loader').hide();
@ -94,11 +95,9 @@ $monthsoptions = array("01" => "Jan", "02" => "Feb", "03" => "Mar", "04" => "Apr
},
type: "POST",
url: "<?php echo base_url(); ?>payslip/checkExistPay",
dataType: "json",
success: function(result) {
if (result == 1) {
if (result['count'] == 1) {
$('form#PayslipGenerator').submit();
$('#loader').hide();
@ -111,7 +110,7 @@ $monthsoptions = array("01" => "Jan", "02" => "Feb", "03" => "Mar", "04" => "Apr
employee: employee
},
type: "POST",
url: "<?php echo base_url(); ?>payslip/callsp",
url: "<?php echo base_url(); ?>"+result['path'],
success: function(result) {
$('form#PayslipGenerator').submit();
$('#loader').hide();
@ -185,11 +184,11 @@ $monthsoptions = array("01" => "Jan", "02" => "Feb", "03" => "Mar", "04" => "Apr
<option value="-1">Select Employee</option>
</select>
<br />
<input type="checkbox" name="All" id="All"> Select All<br>
<!-- <input type="checkbox" name="All" id="All"> Select All<br> -->
</div>
<div class="col-md-6" align="right">
</div>
<div class="col-md-4 col-md-offset-6" align="right">
<div class="col-md-4 col-md-offset-6" align="right" style="padding-top: 23px;">
<input type="button" class="btn btn-info" id="Calculate" value="Calculate Pay" />
</div>
<div class="row">

View File

@ -13,8 +13,9 @@
<div class="row">
<div class="col-6">
<div class="page-title-box page-title-box-alt">
<div class="page-title-right">
<ol class="breadcrumb m-0">
<div class="page-title-right"> <!-- style="margin: 15px 0;" -->
<!-- <ol class="breadcrumb mt-0"> -->
<ol class="breadcrumb mt-2 mb-2.5">
<li class="breadcrumb-item"><a href="javascript: void(0);">HR</a></li>
<li class="breadcrumb-item"><a href="javascript: void(0);">Leave</a></li>
<li class="breadcrumb-item active">
@ -22,14 +23,13 @@
</li>
</ol>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-12">
<div class="card">
<div class="row" style="padding-left: 26px;">
<div class="row" style="padding: 18px 26px;">
<div class="col-md-3">
<span>Holiday Name : </span>
<input type="text" name="hname" id="hname" class="form-control">

View File

@ -203,46 +203,47 @@ if (!empty($INRSYMBOL)) {
}
function vaildateBeforeOpenModal() {
var radioValue = $("input[name='DateRange']:checked").val();
if ($('#PODate').val() == '') {
alert('Please Enter the Purchase Order date');
$('#PODate').focus();
return false;
} else if ($('#drpSupplier').val() == "0") {
alert('Please Select the Supplier details');
$('#drpSupplier').focus();
return false;
} else if ($('#DeliveryAddr').val() == '') {
alert('Please Enter the Delivery Address');
$('#DeliveryAddr').focus();
return false;
} else if (radioValue == 0 && $('#Deliverydate').val() == '') {
alert('Please Select the Delivery Date');
$('#Deliverydate').focus();
return false;
} else if (radioValue == 1 && $('#Scheduleby').val().trim() == '') {
var radioValue = parseInt($("input[name='DateRange']:checked").val());
if ($('#drpSupplier').val() == "0") {
alert('Please Select the Supplier details');
$('#drpSupplier').focus();
return false;
}else if ($('#PODate').val().trim() == '') {
alert('Please Enter the Purchase Order date');
$('#PODate').focus();
return false;
}else if ($('#DeliveryAddr').val().trim() == '') {
alert('Please Enter the Delivery Address');
$('#DeliveryAddr').focus();
return false;
}else if (radioValue === 0 && $('#Deliverydt').val() == '') {
alert('Please Select the Delivery Date');
$('#Deliverydt').focus();
return false;
}else if (radioValue == 1) {
var scheduleBy = $('#Scheduleby').val(); // Get the value
if (!scheduleBy || scheduleBy.trim() == '') { // Check if it's empty or undefined
alert('Please Enter the Schedule By');
$('#Deliverydate').focus();
$('#Scheduleby').focus();
return false;
} else if (radioValue == 0 && $('#Deliverydate').val() == '') {
alert('Please Select the Delivery Date');
$('#Deliverydate').focus();
return false;
} else if (radioValue == 1 && $('#Scheduleby').val().trim() == '') {
alert('Please Enter the Schedule By');
$('#Deliverydate').focus();
return false;
} else if ($('#PoTypeOptions').val() == "0") {
alert('Please Select Revenue Type');
$('#PoTypeOptions').focus();
return false;
} else if ($('#BudgetType').val() == "0") {
alert('Please Select Budget Type');
$('#BudgetType').focus();
return false;
} else {
return true;
}
}else if ($('#PoTypeOptions').val() == "0") {
alert('Please Select Revenue Type');
$('#PoTypeOptions').focus();
return false;
}else if ($('#Otherpayment').val() == '' && $('#PaymentTerms').val() == 'PT08') {
alert('Please Enter Payable Terms Description');
$('#Otherpayment').focus();
return false;
}else if ($('#BudgetType').val() == "0") {
alert('Please Select Budget Type');
$('#BudgetType').focus();
return false;
} else {
return true;
}
}
var NilType = '<?php echo NILTYPE; ?>';
@ -410,7 +411,7 @@ if (!empty($INRSYMBOL)) {
});
$('#MaterialCode').change(function() {
// alert("**");
var id = $('#MaterialCode').val();
var drpSupplier = $('#drpSupplier').val();
$("#ItemName").val('');
@ -431,6 +432,7 @@ if (!empty($INRSYMBOL)) {
$("#ItemName").val(obj.MaterialName);
$("#UOM").val(obj.UOM);
$("#Quantity").val(obj.Quantity);
$("#Rate").val(obj.material_rate);
RequistQuantity = obj.Quantity;
}
});
@ -474,6 +476,7 @@ if (!empty($INRSYMBOL)) {
$("#EditItemName").val(obj.MaterialName);
$("#EditUOM").val(obj.UOM);
$("#EditQuantity").val(obj.Quantity);
$("#EditRate").val(obj.material_rate);
RequistQuantity = obj.Quantity;
}
});
@ -2026,8 +2029,8 @@ if (!empty($INRSYMBOL)) {
<!-- <div>
<?php
$data = array('name' => 'PODate', 'value' => set_value('PODate', $CurrentDate), 'id' => 'PODate', 'class' => 'form-control num', 'required' => 'true', 'onkeypress' => 'return false;');
echo form_input($data);
// $data = array('name' => 'PODate', 'value' => set_value('PODate', $CurrentDate), 'id' => 'PODate', 'class' => 'form-control num', 'required' => 'true', 'onkeypress' => 'return false;');
// echo form_input($data);
?>
</div> -->
</div>
@ -2165,20 +2168,20 @@ if (!empty($INRSYMBOL)) {
<!-- Table -->
<div class="form-row">
<div class="table-responsive" style="padding-bottom: 30px;">
<table id="revenueTax" class="table table-striped table-hover mb-0" style="font-size:12px;">
<table id="revenueTax" class="table nowrap table-bordered table-hover mb-0" style="font-size:12px;">
<thead>
<tr>
<th>SNo</th>
<th>Requisition No</th>
<th>Item Code</th>
<th>Item Description</th>
<th>Line Item Specs</th>
<th>Quantity</th>
<th>UOM</th>
<th>Rate <?php echo "($INRSYM)" ?></th>
<th>Basic Amount <?php echo "($INRSYM)" ?></th>
<th>Tax Amount <?php echo "($INRSYM)" ?></th>
<th>Total Order Amount <?php echo "($INRSYM)" ?></th>
<th style="white-space: nowrap !important;">SNo</th>
<th style="white-space: nowrap !important; text-align:left !important">Requisition No</th>
<th style="white-space: nowrap !important;">Item Code</th>
<th style="white-space: nowrap !important;">Item Description</th>
<th style="white-space: nowrap !important;">Line Item Specs</th>
<th style="white-space: nowrap !important; text-align:right !important">Quantity</th>
<th style="white-space: nowrap !important;">UOM</th>
<th style="white-space: nowrap !important; text-align:right !important">Rate<?php echo "($INRSYM)" ?></th>
<th style="white-space: nowrap !important; text-align:right !important">Basic Amount<?php echo "($INRSYM)" ?></th>
<th style="white-space: nowrap !important; text-align:right !important">Tax Amount<?php echo "($INRSYM)" ?></th>
<th style="white-space: nowrap !important; text-align:right !important">Total Order Amount<?php echo "($INRSYM)" ?></th>
<th>Action</th>
</tr>
</thead>
@ -3456,13 +3459,14 @@ if (!empty($INRSYMBOL)) {
// }));
// Define your template using ES6 template literals
var shorten = materialName.length > 13 ? materialName.slice(0, 13) + "..." : materialName;
var rowHtml = `
<tr id="${temp}">
<td align="left">${temp}</td>
<td align="left">${Reqnumber}</td>
<td align="left">${materialCode}</td>
<td align="left">${materialName}</td>
<td>
<td style="text-align:left !important">${temp}</td>
<td style="text-align:left !important">${Reqnumber}</td>
<td style="text-align:left !important">${materialCode}</td>
<td style="text-align:left !important">${shorten}</td>
<td style="text-align:left !important">
<a href="#" class="editable-field"
data-notes = "-" data-id ="${temp}">-</a>
<div class="edit-container" style="display:none;">
@ -3471,12 +3475,12 @@ if (!empty($INRSYMBOL)) {
<button class="cancel-btn"></button>
</div>
</td>
<td align="right">${quantity}</td>
<td align="left">${uom}</td>
<td align="right">${itemRate}</td>
<td align="right">${basicval}</td>
<td align="right">${TotalTaxValue}</td>
<td align="right">${TotalOrderValue}</td>
<td style="text-align:right !important">${quantity}</td>
<td style="text-align:left !important">${uom}</td>
<td style="text-align:right !important">${itemRate}</td>
<td style="text-align:right !important">${basicval}</td>
<td style="text-align:right !important">${TotalTaxValue}</td>
<td style="text-align:right !important">${TotalOrderValue}</td>
<td>
<a data-target='#EDITREVENUE' data-id="${temp}" data-userid="${temp}" data-toggle="modal" href="#EDITREVENUE">
<i class="ri-pencil-fill" data-toggle="tooltip"></i>
@ -3917,36 +3921,33 @@ if (!empty($INRSYMBOL)) {
var txtTotalDiscount = $('#txtTotalDiscount').val();
var finalBasicAmount = txtTotBasicAmount - txtTotalDiscount;
//alert(txtTotBasicAmount+"--"+txtTotalDiscount+"--"+finalBasicAmount+"--"+AvlBudAmt);
if (validate()) {
if (document.getElementById('revenueTax').rows.length < 1) {
alert('Please Select Line item to Create PO');
$('#Deliverydt').focus();
return false;
}
// else if(parseInt(AvlBudAmt) < parseInt(finalBasicAmount)) {
// alert('Total Order Amount is exceeding the Budget Limit.Please adjust the product value.');
if (revenueValidate()) {
// if (document.getElementById('revenueTax').rows.length < 1) {
// alert('Please Select Line item to Create PO');
// return false;
// }
// else if(parseInt(AvlBudAmt) < parseInt(finalBasicAmount)) {
// alert('Total Order Amount is exceeding the Budget Limit.Please adjust the product value.');
// return false;
// }
else if ($('#Otherpayment').val() == '' && $('#PaymentTerms').val() == 'PT08') {
alert('Please Enter Payable Terms Description');
$('#Otherpayment').focus();
return false;
} else if ($('#insurance').val() == 1 && $('#InsuranceNumber').val() == '') {
alert('Please Enter Insurance No / Insurance Details..!');
$('#insurance').focus();
return false;
} else if ($('#PoTypeOptions').val() == "0") {
alert('Please Select Revenue Type');
$('#PoTypeOptions').focus();
return false;
} else {
// }
// else if ($('#Otherpayment').val() == '' && $('#PaymentTerms').val() == 'PT08') {
// alert('Please Enter Payable Terms Description');
// $('#Otherpayment').focus();
// return false;
// } else if ($('#insurance').val() == 1 && $('#InsuranceNumber').val() == '') {
// alert('Please Enter Insurance No / Insurance Details..!');
// $('#insurance').focus();
// return false;
// } else if ($('#PoTypeOptions').val() == "0") {
// alert('Please Select Revenue Type');
// $('#PoTypeOptions').focus();
// return false;
// }
// else {
var formData = new FormData($('.CreatePO')[0]);
// disableButtons();
$.ajax({
type: "POST",
url: "<?php echo base_url() ?>purchaseorder/addNewPurchaseOrder",
@ -3962,19 +3963,23 @@ if (!empty($INRSYMBOL)) {
//$('#SpcialInstruction').val('');
//$('#txtDeliveryAddress').val('');
window.location = "purchaseorderListing";
// setTimeout(function() { enableButtons(); }, 2000);
} else {
alert("Error");
// setTimeout(function() { enableButtons(); }, 2000);
}
},
error: function(jqXHR, textStatus, errorThrown) {
console.error("AJAX Error: " + textStatus + ": " + errorThrown);
alert("Error: " + textStatus);
// setTimeout(function() { enableButtons(); }, 2000);
}
});
}
// }
}
}
@ -4214,9 +4219,29 @@ if (!empty($INRSYMBOL)) {
}
function Reset() {
// disableButtons();
location.reload();
// setTimeout(function() {
// enableButtons();
// }, 2000);
}
function disableButtons() {
document.querySelectorAll('.Save, .Submit').forEach(function(button) {
button.classList.add('disabled');
button.setAttribute('disabled', 'disabled');
});
}
function enableButtons() {
document.querySelectorAll('.Save, .Submit').forEach(function(button) {
button.classList.remove('disabled');
button.removeAttribute('disabled');
});
}
</script>

319
app/Views/report_sales.php Normal file
View File

@ -0,0 +1,319 @@
<script>
$(document).ready(function() {
$("#client").select2();
$("#product").select2();
$("#hsn_number").select2();
});
</script>
<link rel="stylesheet" href="https://cdn.datatables.net/buttons/1.4.2/css/buttons.dataTables.min.css">
<style>
table{
width:auto;
}
.dataTables_filter input {
padding: 4px;
}
.dataTables_filter {
/* width: 50%; */
float: right;
text-align: right;
}
.dataTables_paginate {
width: 50%;
float: right;
text-align: right;
}
div.dt-buttons {
position: relative;
/* float: right; */
}
</style>
<div class="content-page">
<div class="content">
<!-- Start Content-->
<div class="container-fluid">
<!-- start page title -->
<div>
<div class="row">
<div class="col-12">
<div class="page-title-box page-title-box-alt">
<div class="page-title-right">
<ol class="breadcrumb m-0">
<li class="breadcrumb-item"><a href="javascript: void(0);">Sales</a></li>
<li class="breadcrumb-item active">
<h4 class="page-title"><b> Sales Report </b></h4>
</li>
</ol>
</div>
</div>
</div>
<?php if(isset($headline)) : if(!empty($headline)) : ?>
<div class="col-12">
<div class="page-title-right">
<span>Result filter by : </span><h4 class="page-title" style="display: inline;"><?php echo $headline; ?></h4>
</div>
</div>
<?php endif; endif; ?>
</div>
<div class="row">
<div class="col-12">
<div class="card">
<!-- <form class="Date-filter-form" id="DateRangeFilter" style="margin-top: 14px;margin-bottom: -11px;margin-left: 33px;"> -->
<div class="card-body">
<form method="post" action="<?php echo base_url("sales_report"); ?>">
<div class="form-group">
<div class="row">
<div class="col-2">
<label for="from_date">
<?php echo 'From Date'; ?>
</label>
<div class="input-group">
<input name="from_date" id="max-date" class="form-control datepicker" autocomplete="off">
</div>
</div>
<div class="col-2">
<label for="to_date">
<?php echo 'To Date'; ?>
</label>
<div class="input-group">
<input name="to_date" id="min-date" class="form-control datepicker" autocomplete="off">
</div>
</div>
<div class="col-2">
<label for="hsn_number">
<?php echo 'HSN'; ?>
</label>
<select class="form-control" id="hsn_number" name="hsn_number">
<option value="">Select HSN</option>
<?php
foreach ($hsn as $val): { ?>
<option value="<?php echo $val->hsn_or_sac; ?>"><?php echo $val->hsn_or_sac; ?></option>
<?php }
endforeach; ?>
</select>
</div>
<div class="col-3">
<label for="product">
<?php echo 'Products'; ?>
</label>
<select class="form-control" id="product" name="product">
<option value="">Select Product</option>
<?php
foreach ($product as $val): { ?>
<option value="<?php echo $val->product_id; ?>"><?php echo $val->product_name; ?></option>
<?php }
endforeach; ?>
</select>
</div>
<div class="col-3">
<label for="client">
<?php echo 'Clients'; ?>
</label>
<select class="form-control" id="client" name="client">
<option value="">Select Client</option>
<?php
foreach ($client as $val): { ?>
<option value="<?php echo $val->client_id; ?>"><?php echo $val->client_name; ?></option>
<?php }
endforeach; ?>
</select>
</div>
<div class="col-md-6"></div>
<div class="col-md-6 text-right"><br>
<input type="submit" class="btn btn-success" name="btn_submit"
value="View Report">
</div>
</div>
</div>
<div class="form-group has-feedback">
</div>
</form>
<table id="cc" class="table table-bordered table-hover wrap" style="background-color:#fff;width: 100% !important;">
<thead>
<tr>
<th>Invoice Date</th>
<th>Invoice No</th>
<th>Client Name</th>
<th>Product</th>
<th>HSN</th>
<th>Quantity</th>
<th>Rate</th>
<th>Sub Total</th>
<th>GST</th>
<th>Total</th>
</tr>
</thead>
<tbody>
<?php if (!empty($sales_invoice)) {
$tot = 0; $totGst = 0; $totSubTot = 0;
foreach ($sales_invoice as $invoice) {
$subtotal = $invoice->item_price * $invoice->item_quantity;
// Calculate CGST and SGST
$cgst_amount = ($subtotal * $invoice->cgst) / 100;
$sgst_amount = ($subtotal * $invoice->sgst) / 100;
$total = $subtotal + $cgst_amount + $sgst_amount; ?>
<!-- Main invoice row -->
<tr>
<td><?php echo date('d-m-Y', strtotime($invoice->invoice_date_created)); ?></td>
<td>
<?php if (!empty($invoice->invoice_url)) { ?>
<a href="<?php echo $invoice->invoice_url; ?>" target="_blank" class="invoice-link">
<?php } ?>
<?php echo $invoice->invoice_number; ?>
<?php if (!empty($invoice->invoice_url)) { ?>
</a>
<?php } ?>
</td>
<td><?php echo $invoice->client_name ?></td>
<td><?php echo $invoice->item_name ?></td>
<td><?php echo $invoice->hsn_or_sac ?></td>
<td align="right"><?php echo number_format($invoice->item_quantity, 2, '.', ',') ?></td>
<td align="right"><?php echo number_format($invoice->item_price, 2, '.', ',') ?></td>
<td align="right"><?php echo number_format($subtotal, 2, '.', ',') ?></td>
<td align="right"><?php echo number_format($cgst_amount + $sgst_amount, 2, '.', ',') ?></td>
<td align="right"><?php echo number_format($total, 2, '.', ',') ?></td>
</tr>
<?php
$tot = $total + $tot;
$totGst = ($cgst_amount + $sgst_amount) + $totGst;
$totSubTot = $subtotal + $totSubTot;
} ?>
</tbody>
<tfoot width="100%">
<tr>
<td style="text-align:center;"><strong>Total</strong></td>
<td style="text-align:right"><strong><?php {echo '';}?></strong></td>
<td style="text-align:right"><strong><?php {echo '';}?></strong></td>
<td style="text-align:right"><strong><?php {echo '';}?></strong></td>
<td style="text-align:right"><strong><?php {echo '';}?></strong></td>
<td style="text-align:right"><strong><?php {echo '';}?></strong></td>
<td style="text-align:right"><strong><?php {echo '';}?></strong></td>
<td style="text-align:right"><strong><?php {echo number_format($totSubTot, 2, '.', ','); }?></strong></td>
<td style="text-align:right"><strong><?php {echo number_format($totGst, 2, '.', ','); }?></strong></td>
<td style="text-align:right"><strong><?php {echo number_format($tot, 2, '.', ','); }?></strong></td>
</td>
</tr>
</tfoot>
<?php
}
?>
</table>
</div> <!-- end card body-->
</div> <!-- end card -->
</div><!-- end col-->
</div>
</div>
</div> <!-- container -->
</div> <!-- content -->
</div>
<script src="https://cdn.datatables.net/buttons/1.4.2/js/dataTables.buttons.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.1.3/jszip.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.32/pdfmake.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.32/vfs_fonts.js"></script>
<script src="https://cdn.datatables.net/buttons/1.4.2/js/buttons.html5.min.js"></script>
<script src="https://cdn.datatables.net/buttons/1.4.2/js/buttons.colVis.min.js"></script>
<script src="https://cdn.datatables.net/plug-ins/1.10.16/sorting/datetime-moment.js"></script>
<script>
// Bootstrap datepicker
// Set up your table
$(document).ready(function() {
// Initialize the DataTable
var table = $('#cc').DataTable({
dom: 'Blfrtip', // Buttons, length menu, filter, table, information, pagination
buttons: [
'copy', 'csv' // Export buttons
],
pageLength: 10, // Default rows per page
lengthMenu: [
[10, 20, 30, 50, -1],
[10, 20, 30, 50, "All"]
], // Rows per page options
responsive: true, // Responsive table
order: [
[0, 'desc']
], // Default ordering (column index 0, descending)
language: {
paginate: {
next: '<i class="fas fa-angle-right"></i>', // Next button icon
previous: '<i class="fas fa-angle-left"></i>' // Previous button icon
}
}
});
});
$('#mySelect').on('change', function() {
table
.column(4)
.search(this.value)
.draw();
});
$(function() {
var dateFormat = 'dd-mm-yyyy';
// Initialize min-date (Start Date)
var from = $("#min-date").datepicker({
format: dateFormat,
autoclose: true,
todayHighlight: true,
clearBtn: true,
orientation: 'bottom'
}).on('changeDate', function(e) {
// When a date is selected in #min-date, update the minDate option for #max-date
// to.datepicker('setStartDate', e.date);
});
// Initialize max-date (End Date)
var to = $("#max-date").datepicker({
format: dateFormat,
// startDate: new Date(), // Start date cannot be in the past
autoclose: true,
todayHighlight: true,
clearBtn: true,
orientation: 'bottom'
}).on('changeDate', function(e) {
// When a date is selected in #max-date, update the endDate option for #min-date
from.datepicker('setStartDate', e.date);
});
});
</script>

View File

@ -144,8 +144,8 @@ if (!empty($Emp)) {
<th class="th">Material Code</th>
<th class="th" style="text-align:left !important;">Material Name</th>
<th class="th">Material Category</th>
<th class="th">Uom</th>
<th class="th">Quantity</th>
<th class="th" style="text-align:left !important;">Uom</th>
<th class="th" style="text-align:right !important;">Quantity</th>
<th class="th">Action</th>
</tr>
</thead>
@ -407,11 +407,14 @@ if (!empty($Emp)) {
$("#UOM").val('');
// Get the ID of the first option
var firstOptionId = $('#CostCenter option:first').val();
// Reset the Select2 dropdown to the first option
$('#CostCenter').val(firstOptionId).select2('data', {
id: firstOptionId,
text: $('#CostCenter option:selected').text()
});
$('#CostCenter').val("-1");
// // Reset the Select2 dropdown to the first option
// $('#CostCenter').val(firstOptionId).select2('data', {
// id: firstOptionId,
// text: $('#CostCenter option:selected').text()
// });
removeHiddenRows($('#Items').find('tr').length);
@ -605,12 +608,13 @@ if (!empty($Emp)) {
</script>
<script>
function validate() {
if ($("option:selected", $("#RequestType")).val() == '-1') {
alert('Please Select Request Type ');
return false;
} else if ($("option:selected", $("#EmpID")).val() == '-1') {
if ($("option:selected", $("#EmpID")).val() == '-1') {
alert('Please Select Request by');
return false;
}
else if ($("option:selected", $("#RequestType")).val() == '-1') {
alert('Please Select Request Type ');
return false;
} else if ($("#txtRowCount").val().length < 1) {
alert('Please Add Line Item');
return false;
@ -680,8 +684,8 @@ if (!empty($Emp)) {
<td align="center">${materialCode}</td>
<td align="left">${materialName}</td>
<td align="center">${categoryName}</td>
<td align="center">${uom}</td>
<td align="center">${quantity}</td>
<td align="left">${uom}</td>
<td align="right">${quantity}</td>
<td align="center">
<a
data-id="${temp}"

View File

@ -176,9 +176,9 @@ if (!empty($Status)) {
href="<?php echo base_url() . 'EditRequisitionForm?ReqNo=' . $record->ReqNo . '&ReqType=' . $record->ReqType; ?>"><i
class="fas fa-pencil-alt" data-toggle="tooltip"
title="<?php echo $record->ReqNo; ?> - Click here to view Requisition details"></i>&nbsp;&nbsp;&nbsp;</a>
<a data-toggle="tooltip" onclick="DeleteRow('<?php echo $record->ReqNo; ?>' )"><span
class="fas fa-trash"
title="<?php echo $record->ReqNo; ?> - Click here to Delete Requisition details"></span></a>
<a data-toggle="tooltip" href="#" onclick="DeleteRow('<?php echo $record->ReqNo; ?>' )"><i
class="fas fa-trash" data-toggle="tooltip"
title="<?php echo $record->ReqNo; ?> - Click here to Delete Requisition details"></i>&nbsp;&nbsp;&nbsp;</a>
</td>
</tr>

View File

@ -239,6 +239,7 @@
<th>Received File</th>
<th>Client Name</th>
<th>Product</th>
<th>HSN</th>
<th>Quantity</th>
<th> Rec Qty </th>
<th>Rate</th>
@ -281,6 +282,7 @@
</td>
<td><?php echo $invoice->client_name ?></td>
<td><?php echo $invoice->item_name ?></td>
<td><?php echo $invoice->hsn_or_sac ?></td>
<td align="right"><?php echo number_format($invoice->item_quantity, 2, '.', ',') ?></td>
<td>
<a href="#"
@ -306,8 +308,7 @@
</a>
</td>
</tr>
<?php }
} ?>
<?php } } ?>
</tbody>
</table>
</div> <!-- end card body-->

View File

@ -239,20 +239,21 @@ if (!empty($INRSYMBOL)) {
});
// Conditional logic for PaymentID
if (PaymentID === 'PT08') {
$('#otheroptiondiv').show();
$('#Otherpayment').val('');
} else {
if (PaymentID != 'PT08') {
$('#otheroptiondiv').hide();
$('#Otherpayment').prop('required', false);
$('#Otherpayment').val('');
} else if (PaymentID == 'PT08') {
$('#otheroptiondiv').show();
$('#Otherpayment').prop('required', true);
}
// Populate Payment Terms
var Payment = <?php echo json_encode($Payment, JSON_PRETTY_PRINT) ?>;
$('#PaymentTerms').empty();
$.each(payments, function(pay, payobj) {
$("#PaymentTerms").append($('<option></option>').val(payobj.PaymentID).html(payobj.PaymentTerms));
$.each(Payment, function(idx, obj) {
$("#PaymentTerms").append($('<option></option>').val(obj.PaymentID).html(obj.PaymentTerms));
});
$("#PaymentTerms").val(PaymentID);
} else {
alert('Please select a Supplier.');
return false;
@ -359,6 +360,7 @@ if (!empty($INRSYMBOL)) {
$("#ItemName").val(obj.MaterialName);
$("#UOM").val(obj.UOM);
$("#Quantity").val(obj.Quantity);
$("#Rate").val(obj.material_rate);
RequistQuantity = obj.Quantity;
var materialn = obj.MaterialName;
var materialname = materialn.toUpperCase();
@ -409,6 +411,7 @@ if (!empty($INRSYMBOL)) {
$("#EditItemName").val(obj.MaterialName);
$("#EditUOM").val(obj.UOM);
$("#EditQuantity").val(obj.Quantity);
$("#EditRate").val(obj.material_rate);
RequistQuantity = obj.Quantity;
}
});
@ -1044,20 +1047,20 @@ if (!empty($INRSYMBOL)) {
</div><!-- 6. form-row div closed here -->
<div class="form-row">
<div class="table-responsive" style="padding-bottom: 30px;">
<table id="serviceTax" class="table table-striped table-hover mb-0" style="font-size:12px;">
<table id="serviceTax" class="table nowrap table-bordered table-hover mb-0" style="font-size:12px;">
<thead>
<tr>
<th>SNo</th>
<th>Requisition No</th>
<th>Item Code</th>
<th>Item Name</th>
<th>Line Item Specs</th>
<th>Quantity</th>
<th>UOM</th>
<th>Rate <?php echo "($INRSYM)" ?></th>
<th>Basic Amount <?php echo "($INRSYM)" ?></th>
<th>Tax Amount <?php echo "($INRSYM)" ?></th>
<th>Total Order Amount <?php echo "($INRSYM)" ?></th>
<th style="white-space: nowrap !important;">SNo</th>
<th style="white-space: nowrap !important; text-align:center !important">Requisition No</th>
<th style="white-space: nowrap !important;">Item Code</th>
<th style="white-space: nowrap !important;">Item Description</th>
<th style="white-space: nowrap !important;">Line Item Specs</th>
<th style="white-space: nowrap !important; text-align:right !important">Quantity</th>
<th style="white-space: nowrap !important;">UOM</th>
<th style="white-space: nowrap !important; text-align:right !important">Rate <?php echo "($INRSYM)" ?></th>
<th style="white-space: nowrap !important; text-align:right !important">Basic Amount <?php echo "($INRSYM)" ?></th>
<th style="white-space: nowrap !important; text-align:right !important">Tax Amount <?php echo "($INRSYM)" ?></th>
<th style="white-space: nowrap !important; text-align:right !important">Total Order Amount <?php echo "($INRSYM)" ?></th>
<th>Action</th>
</tr>
</thead>
@ -1974,13 +1977,13 @@ if (!empty($INRSYMBOL)) {
// Taxvalue: TotalTaxValue,
// TotalValue: TotalOrderValue
// }));
var shorten = materialName.length > 13 ? materialName.slice(0, 13) + "..." : materialName;
var rowHtml = `
<tr id="${temp}">
<td align="left">${temp}</td>
<td align="left">${Reqnumber}</td>
<td align="left">${materialCode}</td>
<td align="left">${materialName}</td>
<td>${temp}</td>
<td style="text-align:center !important">${Reqnumber}</td>
<td>${materialCode}</td>
<td>${shorten}</td>
<td>
<a href="#" class="editable-field"
data-notes = "-" data-id ="${temp}">-</a>
@ -1990,12 +1993,12 @@ if (!empty($INRSYMBOL)) {
<button class="cancel-btn"></button>
</div>
</td>
<td align="left">${quantity}</td>
<td align="left">${uom}</td>
<td align="left">${itemRate}</td>
<td align="left">${basicval}</td>
<td align="left">${TotalTaxValue}</td>
<td align="left">${TotalOrderValue}</td>
<td style="text-align:right !important">${quantity}</td>
<td>${uom}</td>
<td style="text-align:right !important">${itemRate}</td>
<td style="text-align:right !important">${basicval}</td>
<td style="text-align:right !important">${TotalTaxValue}</td>
<td style="text-align:right !important">${TotalOrderValue}</td>
<td>
<a data-target='#EDITSERVICE' data-id="${temp}" data-userid="${temp}" data-toggle="modal" href="#EDITSERVICE">
<i class="ri-pencil-fill" data-toggle="tooltip"></i>
@ -2376,33 +2379,30 @@ if (!empty($INRSYMBOL)) {
$('#txtStatus').val(stat);
var AvlBudAmt = '<?php echo $AvlAmount ?>';
var txtTotalOrderValueSummary = $('#txtTotBasicAmount').val();
if (validate()) {
if (document.getElementById('serviceTax').rows.length < 2) {
alert('Please Select Line item to Create PO');
$('#Deliverydt').focus();
return false;
}
// else if(parseInt(AvlBudAmt) < parseInt(txtTotalOrderValueSummary)) {
if (serviceValidate()) {
// if (document.getElementById('serviceTax').rows.length < 2) {
// alert('Please Select Line item to Create PO');
// return false;
// }
// else if(parseInt(AvlBudAmt) < parseInt(txtTotalOrderValueSummary)) {
// alert('Total Order Amount is exceeding the Budget Limit.Please adjust the product value.');
// return false;
// }
else if ($('#Otherpayment').val() == '' && $('#PaymentTerms').val() == 'PT08') {
alert('Please Enter Other Payable Terms Description');
$('#Otherpayment').focus();
return false;
} else if ($('#descofpo').val().trim() == '') {
alert('Please Enter Description Of Service');
$('#descofpo').focus();
return false;
} else if ($('#PoTypeOptions').val() == "0") {
alert('Please Select POType');
$('#PoTypeOptions').focus();
return false;
} else {
// }
// else if ($('#Otherpayment').val() == '' && $('#PaymentTerms').val() == 'PT08') {
// alert('Please Enter Other Payable Terms Description');
// $('#Otherpayment').focus();
// return false;
// } else if ($('#descofpo').val().trim() == '') {
// alert('Please Enter Description Of Service');
// $('#descofpo').focus();
// return false;
// } else if ($('#PoTypeOptions').val() == "0") {
// alert('Please Select POType');
// $('#PoTypeOptions').focus();
// return false;
// } else {
var formData = new FormData($('.ServicePO')[0]);
// disableButtons();
console.log("inside add service purchase order view page");
console.log(formData);
@ -2422,15 +2422,21 @@ if (!empty($INRSYMBOL)) {
$('#SpcialInstruction').val('');
$('#txtDeliveryAddress').val('');
window.location = "purchaseorderListing";
// setTimeout(function() { enableButtons(); }, 2000);
} else {
alert("Error");
// setTimeout(function() { enableButtons(); }, 2000);
}
},
error: function(jqXHR, textStatus, errorThrown) {
console.error("AJAX Error: " + textStatus + ": " + errorThrown);
alert("Error: " + textStatus);
// setTimeout(function() { enableButtons(); }, 2000);
}
});
}
// }
}
}
@ -2454,45 +2460,58 @@ if (!empty($INRSYMBOL)) {
}
function vaildateBeforeOpenModal() {
var radioValue = $("input[name='DateRange']:checked").val();
if ($('#PODate').val() == '') {
alert('Please Enter the Purchase Order date');
$('#PODate').focus();
return false;
} else if ($('#drpSupplier').val() == "0") {
alert('Please Select the Supplier details');
$('#drpSupplier').focus();
return false;
} else if ($('#DeliveryAddr').val() == '') {
alert('Please Enter the Delivery Address');
$('#DeliveryAddr').focus();
return false;
} else if (radioValue == 0 && $('#Deliverydate').val() == '') {
alert('Please Select the Delivery Date');
$('#Deliverydate').focus();
return false;
} else if (radioValue == 1 && $('#Scheduleby').val().trim() == '') {
var radioValue = parseInt($("input[name='DateRange']:checked").val());
if ($('#drpSupplier').val() == "0") {
alert('Please Select the Supplier details');
$('#drpSupplier').focus();
return false;
}else if ($('#workstatus').val() == "0") {
alert('Please Select the Work Status');
$('#drpSupplier').focus();
return false;
}else if ($('#PODate').val().trim() == '') {
alert('Please Enter the Purchase Order date');
$('#PODate').focus();
return false;
}else if ($('#DeliveryAddr').val().trim() == '') {
alert('Please Enter the Delivery Address');
$('#DeliveryAddr').focus();
return false;
}else if (radioValue === 0 && $('#Deliverydt').val() == '') {
alert('Please Select the Delivery Date');
$('#Deliverydt').focus();
return false;
}else if (radioValue == 1) {
var scheduleBy = $('#Scheduleby').val(); // Get the value
if (!scheduleBy || scheduleBy.trim() == '') { // Check if it's empty or undefined
alert('Please Enter the Schedule By');
$('#Deliverydate').focus();
$('#Scheduleby').focus();
return false;
} else if ($('#workstatus').val() == "0") {
alert('Please Enter WorkStatus');
$('#workstatus').focus();
return false;
} else if ($('#PoTypeOptions').val() == "0") {
alert('Please Select POType');
$('#PoTypeOptions').focus();
return false;
} else if ($('#Otherpayment').val() == '' && $('#PaymentTerms').val() == 'PT08') {
alert('Please Enter Other Payable Terms Description');
$('#Otherpayment').focus();
return false;
} else {
return true;
}
}else if($('#PODate').val() == ''){
alert('Please Enter the Purchase Order date');
$('#PODate').focus();
return false;
}else if ($('#PoTypeOptions').val() == "0") {
alert('Please Select Service Type');
$('#PoTypeOptions').focus();
return false;
}else if ($('#Otherpayment').val() == '' && $('#PaymentTerms').val() == 'PT08') {
alert('Please Enter Payable Terms Description');
$('#Otherpayment').focus();
return false;
}else if($('#insuranceStatus').val() == "1" && $('#InsuranceNumber').val().trim() == ''){
alert('Please Enter the Insurance No / Insurance Details');
$('#InsuranceNumber').focus();
return false;
}else if ($('#BudgetType').val() == "0") {
alert('Please Select Budget Type');
$('#BudgetType').focus();
return false;
}else {
return true;
}
}
function calculateCgstTax(varBasicValue, Cgst) {
@ -2565,9 +2584,14 @@ if (!empty($INRSYMBOL)) {
function Reset() {
// disableButtons();
location.reload();
// setTimeout(function() {
// enableButtons();
// }, 2000);
}
$('#insuranceTxtDiv').hide();
$("#insuranceStatus").change(function() {

View File

@ -268,8 +268,12 @@
<td><?php echo $record->SupplierName ?></td>
<td><?php echo $record->DeliveryChellanOrInvoiceNo ?></td>
<td align="right"><?php
$date = new DateTime($record->DeliveryChellanDate);
echo $date->format('d-m-Y'); ?></td>
$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>
@ -279,7 +283,7 @@
<td align="right"><?php echo (int)$record->NetWeight ?></td>
<td align="right"><?php echo (int)$record->taxable_value ?></td>
<td align="right"><?php echo (int)$record->gst_amount ?></td>
<td align="right"><?php echo ((int)$record->gst_amount + (int)$record->gst_amount) ?></td>
<td align="right"><?php echo ((int)$record->taxable_value + (int)$record->gst_amount) ?></td>
<td><?php echo $record->VehicleNo ?></td>
<td><?php echo $record->DriverName ?></td>
@ -1216,13 +1220,15 @@
}
// Format dates
var dcd = new Date(item.DeliveryChellanDate);
var dcd2 = (String(dcd.getDate()).padStart(2, '0') + '-' + (String(dcd.getMonth() + 1).padStart(2, '0')) + '-' + dcd.getFullYear());
$("#InvoiceDate").val(dcd2);
console.log(item.MaterialRcvdDate)
// (item.DeliveryChellanDate && item.DeliveryChellanDate !== "0000-00-00 00:00:00")
var dcd = (item.DeliveryChellanDate == 'null') ? ' ' : formatDateTime(item.DeliveryChellanDate, 1);
$("#InvoiceDate").val(dcd);
var Mat_rcv_date = (item.MaterialRcvdDate == 'null') ? ' ' : formatDateTime(item.MaterialRcvdDate, 1);
$("#MaterialRcvdDate").val(Mat_rcv_date);
console.log(item.MaterialRcvdDate)
// console.log(item.MaterialRcvdDate)
var gross_rcv_date = (item.GrossWeightDate == 'null') ? ' ' : formatDateTime(item.GrossWeightDate, 2);
$("#ser").val(item.ServiceDescription);
var amount = item.Rate*item.QuantityAsPerInvoice;
@ -1572,7 +1578,10 @@
success: function(data) {
alert(data);
// location.reload();
// setTimeout(function () {
// $("#Igrshow").modal('hide');
// }, 2000);
location.reload();
},
error: function(xhr, status, error) { // Error callback
console.error('AJAX Error:', status, error);
@ -2136,6 +2145,7 @@
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.7/pdfmake.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.7/vfs_fonts.js"></script>
<script src="https://cdn.datatables.net/plug-ins/1.13.6/sorting/datetime-moment.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.29.4/moment.min.js"></script>
<script>
// $(document).ready(function() {
@ -2263,6 +2273,14 @@
}
$(document).ready(function() {
// this code for table date filed ordering
$.fn.dataTable.ext.type.order['date-dd-mm-yyyy-pre'] = function(date) {
if (!date) return 0;
var parts = date.split('-'); // Split the date into parts (DD, MM, YYYY)
return new Date(parts[2], parts[1] - 1, parts[0]).getTime(); // Convert to timestamp
};
var orderColumnIndex = <?php echo (session()->get('roleText') == 'Auditor') ? 6 : 0; ?>;
table = $('#view_inward_gate_register').DataTable({
dom: 'Blfrtip',
@ -2281,7 +2299,10 @@
[10, 20, 30, 50, "All"]
],
responsive: false,
ordering:true,
ordering: true,
columnDefs: [
{ targets: parseInt(orderColumnIndex), type: 'date-dd-mm-yyyy' } // Apply custom sorting
],
order: [[parseInt(orderColumnIndex), 'desc']],
language: {
paginate: {

View File

@ -26,6 +26,307 @@ function myFunction() {
}
}
function disableButtons() {
document.querySelectorAll('.Save, .Submit').forEach(function(button) {
button.classList.add('disabled');
button.setAttribute('disabled', 'disabled');
});
}
function enableButtons() {
document.querySelectorAll('.Save, .Submit').forEach(function(button) {
button.classList.remove('disabled');
button.removeAttribute('disabled');
});
}
function revenueValidate(){
var radioValue = parseInt($("input[name='DateRange']:checked").val());
if ($('#drpSupplier').val() == "0") {
alert('Please Select the Supplier details');
$('#drpSupplier').focus();
return false;
}else if ($('#PODate').val().trim() == '') {
alert('Please Enter the Purchase Order date');
$('#PODate').focus();
return false;
}else if ($('#DeliveryAddr').val().trim() == '') {
alert('Please Enter the Delivery Address');
$('#DeliveryAddr').focus();
return false;
}else if (radioValue === 0 && $('#Deliverydt').val() == '') {
alert('Please Select the Delivery Date');
$('#Deliverydt').focus();
return false;
}else if (radioValue == 1) {
var scheduleBy = $('#Scheduleby').val(); // Get the value
if (!scheduleBy || scheduleBy.trim() == '') { // Check if it's empty or undefined
alert('Please Enter the Schedule By');
$('#Scheduleby').focus();
return false;
}
}else if($('#PODate').val() == ''){
alert('Please Enter the Purchase Order date');
$('#PODate').focus();
return false;
}else if ($('#PoTypeOptions').val() == "0") {
alert('Please Select Revenue Type');
$('#PoTypeOptions').focus();
return false;
}else if ($('#Otherpayment').val() == '' && $('#PaymentTerms').val() == 'PT08') {
alert('Please Enter Payable Terms Description');
$('#Otherpayment').focus();
return false;
}else if($('#insuranceStatus').val() == "1" && $('#InsuranceNumber').val().trim() == ''){
alert('Please Enter the Insurance No / Insurance Details');
$('#InsuranceNumber').focus();
return false;
}else if ($('#BudgetType').val() == "0") {
alert('Please Select Budget Type');
$('#BudgetType').focus();
return false;
}else if ($('#revenueTax tbody tr').length < 1) {
alert('Atleast One Line needed');
return false;
}else {
return true;
}
}
function serviceValidate(){
var radioValue = parseInt($("input[name='DateRange']:checked").val());
if ($('#drpSupplier').val() == "0") {
alert('Please Select the Supplier details');
$('#drpSupplier').focus();
return false;
}else if ($('#workstatus').val() == "0") {
alert('Please Select the Work Status');
$('#workstatus').focus();
return false;
}else if ($('#PODate').val().trim() == '') {
alert('Please Enter the Purchase Order date');
$('#PODate').focus();
return false;
}else if ($('#DeliveryAddr').val().trim() == '') {
alert('Please Enter the Delivery Address');
$('#DeliveryAddr').focus();
return false;
}else if (radioValue === 0 && $('#Deliverydt').val() == '') {
alert('Please Select the Delivery Date');
$('#Deliverydt').focus();
return false;
}else if (radioValue == 1) {
var scheduleBy = $('#Scheduleby').val(); // Get the value
if (!scheduleBy || scheduleBy.trim() == '') { // Check if it's empty or undefined
alert('Please Enter the Schedule By');
$('#Scheduleby').focus();
return false;
}
}else if($('#PODate').val() == ''){
alert('Please Enter the Purchase Order date');
$('#PODate').focus();
return false;
}else if ($('#PoTypeOptions').val() == "0") {
alert('Please Select Service Type');
$('#PoTypeOptions').focus();
return false;
}else if ($('#Otherpayment').val() == '' && $('#PaymentTerms').val() == 'PT08') {
alert('Please Enter Payable Terms Description');
$('#Otherpayment').focus();
return false;
}else if($('#insuranceStatus').val() == "1" && $('#InsuranceNumber').val().trim() == ''){
alert('Please Enter the Insurance No / Insurance Details');
$('#InsuranceNumber').focus();
return false;
}else if ($('#BudgetType').val() == "0") {
alert('Please Select Budget Type');
$('#BudgetType').focus();
return false;
}else if ($('#serviceTax tbody tr').length < 1) {
alert('Atleast One Line needed');
return false;
} else if ($('#descofpo').val().trim() == '') {
alert('Please Enter Description Of Service');
$('#descofpo').focus();
return false;
}else {
return true;
}
}
function capitalValidate(){
var radioValue = parseInt($("input[name='DateRange']:checked").val());
var PoType = $('#POType').val();
if(PoType=='CAPITAL' && capitalType=='International'){
if ($('#drpSupplier').val() == "0") {
alert('Please Select the Supplier details');
$('#drpSupplier').focus();
return false;
} else if ($('#currencytype').val() == '0') {
alert('Please Select the Currency Type');
$('#currencytype').focus();
return false;
} else if ($('#PODate').val() == '') {
alert('Please Enter the Purchase Order date');
$('#PODate').focus();
return false;
} else if (radioValue == 0 && $('#Deliverydate').val() == '') {
alert('Please Select the Delivery Date');
$('#Deliverydate').focus();
return false;
} else if (radioValue == 1 && $('#Scheduleby').val() == '') {
alert('Please Enter the Schedule By');
$('#Deliverydate').focus();
return false;
} else if (radioValue == 2 && $('#Dispatch').val().trim() == '') {
alert('Please Enter the Dispatch Instruction');
$('#Deliverydate').focus();
return false;
} else if ($('#ExchangeRate').val() == '') {
alert('Please Enter the Exchange Rate');
$('#ExchangeRate').focus();
return false;
} else if ($('#ExchangeRate').val() == 0) {
alert('Please Enter the Exchange Rate');
$('#ExchangeRate').focus();
return false;
} else if ($('#PlaceOforigin').val() == '') {
alert('Please Enter Place Of Origin');
$('#PlaceOforigin').focus();
return false;
} else if ($('#PoTypeOptions').val() == "0") {
alert('Please Select Capital Type');
$('#PoTypeOptions').focus();
return false;
} else if ($('#PaymentTerms').val() == '') {
alert('Please Select Payment Terms');
$('#PaymentTerms').focus();
return false;
} else if ($('#Otherpayment').val() == '' && $('#PaymentTerms').val() == 'PT08') {
alert('Please Enter Payable Terms Description');
$('#Otherpayment').focus();
return false;
} else if ($('#BudgetType').val() == "0") {
alert('Please Select Budget Type');
$('#BudgetType').focus();
return false;
} else if ($('#serviceTax tbody tr').length < 1) {
alert('Atleast One Line needed');
return false;
} else { return true; }
}
if(PoType=='CAPITAL' && capitalType=='Domestic'){
if ($('#drpSupplier').val() == "0") {
alert('Please Select the Supplier details');
$('#drpSupplier').focus();
return false;
} else if ($('#PODate').val() == '') {
alert('Please Enter the Purchase Order date');
$('#PODate').focus();
return false;
} else if (radioValue == 0 && $('#Deliverydate').val() == '') {
alert('Please Select the Delivery Date');
$('#Deliverydate').focus();
return false;
} else if (radioValue == 1 && $('#Scheduleby').val() == '') {
alert('Please Enter the Schedule By');
$('#Deliverydate').focus();
return false;
} else if (radioValue == 2 && $('#Dispatch').val().trim() == '') {
alert('Please Enter the Dispatch Instruction');
$('#Deliverydate').focus();
return false;
} else if ($('#PoTypeOptions').val() == "0") {
alert('Please Select Capital Type');
$('#PoTypeOptions').focus();
return false;
} else if ($('#PaymentTerms').val() == '') {
alert('Please Select Payment Terms');
$('#PaymentTerms').focus();
return false;
} else if ($('#Otherpayment').val() == '' && $('#PaymentTerms').val() == 'PT08') {
alert('Please Enter Payable Terms Description');
$('#Otherpayment').focus();
return false;
} else if ($('#BudgetType').val() == "0") {
alert('Please Select Budget Type');
$('#BudgetType').focus();
return false;
} else if ($('#serviceTax tbody tr').length < 1) {
alert('Atleast One Line needed');
return false;
} else { return true; }
}
}
function importValidate(){
var radioValue = parseInt($("input[name='DateRange']:checked").val());
if ($('#drpSupplier').val() == "0") {
alert('Please Select the Supplier details');
$('#drpSupplier').focus();
return false;
} else if ($('#currencytype').val() == '0') {
alert('Please Select the Currency Type');
$('#currencytype').focus();
return false;
} else if ($('#PODate').val() == '') {
alert('Please Enter the Purchase Order date');
$('#PODate').focus();
return false;
} else if ($('#DeliveryAddr').val() == '') {
alert('Please Enter the Delivery Address');
$('#DeliveryAddr').focus();
return false;
} else if (radioValue === 1 && $('#Scheduleby').val() == '') {
alert('Please Enter Schedule By');
$('#Scheduleby').focus();
return false;
} else if (radioValue === 2 && $('#Dispatch').val() == '') {
alert('Please Enter Dispatch Instruction');
$('#Dispatch').focus();
return false;
} else if ($('#ExchangeRate').val() == '') {
alert('Please Enter the Exchange Rate');
$('#ExchangeRate').focus();
return false;
} else if ($('#ExchangeRate').val() == 0) {
alert('Please Enter the Exchange Rate');
$('#ExchangeRate').focus();
return false;
} else if ($('#PlaceOforigin').val() == '') {
alert('Please Enter Place Of Origin');
$('#PlaceOforigin').focus();
return false;
} else if ($('#Importoption').val() == "0") {
alert('Please Select Import Type');
$('#Importoption').focus();
return false;
} else if ($('#PaymentTerms').val() == '') {
alert('Please Select Payment Terms');
$('#PaymentTerms').focus();
return false;
} else if ($('#Otherpayment').val() == '' && $('#PaymentTerms').val() == 'PT08') {
alert('Please Enter Payable Terms Description');
$('#Otherpayment').focus();
return false;
} else if ($('#BudgetType').val() == "0") {
alert('Please Select Budget Type');
$('#BudgetType').focus();
return false;
} else if ($('#ImportTax tbody tr').length < 1) {
alert('Atleast One Line needed');
return false;
}else {
return true;
}
}
function validate()
{
var radioValue = $("input[name='DateRange']:checked").val();