Merge branch 'new_theme' of bitbucket.org:venbainformationtechnology/ria into new_theme
This commit is contained in:
commit
990e6a476a
@ -346,7 +346,9 @@ class Assetdetails extends BaseController
|
|||||||
function checkAssetName(){
|
function checkAssetName(){
|
||||||
|
|
||||||
$data = $this->request->getPost();
|
$data = $this->request->getPost();
|
||||||
$result = $this->assetdetails_model->checkAssetName($data['assetName']);
|
$assetId = $data['assetId']??'';
|
||||||
|
$assetName = str_replace(" ","",$data['assetName']) ;
|
||||||
|
$result = $this->assetdetails_model->checkAssetName($assetId,$assetName);
|
||||||
return $this->response->setJSON($result);
|
return $this->response->setJSON($result);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -159,9 +159,12 @@ class Configurationctrl extends BaseController
|
|||||||
public function configNameCheck(){
|
public function configNameCheck(){
|
||||||
|
|
||||||
$data = $this->request->getPost();
|
$data = $this->request->getPost();
|
||||||
$configName = ($data['configName']);
|
$configName = str_replace(" ","",$data['configName']);
|
||||||
|
$configId = $data['configId'];
|
||||||
|
|
||||||
$result = $this->configmodel->configNameCheck($configName);
|
$result = $this->configmodel->configNameCheck($configId,$configName);
|
||||||
|
|
||||||
|
// dd($result);
|
||||||
|
|
||||||
return $this->response->setJSON($result);
|
return $this->response->setJSON($result);
|
||||||
|
|
||||||
|
|||||||
@ -136,7 +136,11 @@ class CostCenter extends BaseController
|
|||||||
|
|
||||||
function checkCostCenter(){
|
function checkCostCenter(){
|
||||||
$data = $this->request->getPost();
|
$data = $this->request->getPost();
|
||||||
$result = $this->costcenter_model->checkCostCenter( $data['CostCenterName']);
|
|
||||||
|
$CostCenterId = $data['CostCenterId'];
|
||||||
|
$CostCenterName = $data['CostCenterName'];
|
||||||
|
|
||||||
|
$result = $this->costcenter_model->checkCostCenter( $CostCenterId,$CostCenterName);
|
||||||
|
|
||||||
return $this->response->setJSON($result);
|
return $this->response->setJSON($result);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -250,8 +250,10 @@ class Department extends BaseController
|
|||||||
function checkDepartmentName(){
|
function checkDepartmentName(){
|
||||||
|
|
||||||
$data = $this->request->getPost();
|
$data = $this->request->getPost();
|
||||||
|
$departmentName = str_replace(" ","",$data['departmentName']);
|
||||||
|
$depCode =$data['depCode'];
|
||||||
$departmentName = $data['departmentName'];
|
$departmentName = $data['departmentName'];
|
||||||
$result = $this->department_model->checkDepartmentName($departmentName);
|
$result = $this->department_model->checkDepartmentName($depCode,$departmentName);
|
||||||
return $this->response->setJSON($result);
|
return $this->response->setJSON($result);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -177,9 +177,11 @@ class FactoryMachineController extends BaseController
|
|||||||
|
|
||||||
$data = $this->request->getPost();
|
$data = $this->request->getPost();
|
||||||
|
|
||||||
$machineName = $data['machineName'];
|
$machineId = $data['machineId'];
|
||||||
|
|
||||||
$result = $this->factoryMachineMaster_model->where('machine_name',$machineName)->find();
|
$machineName = str_replace(" ","", $data['machineName']);
|
||||||
|
|
||||||
|
$result = $this->factoryMachineMaster_model->checkMachineName($machineId , $machineName);
|
||||||
|
|
||||||
return $this->response->setJSON($result);
|
return $this->response->setJSON($result);
|
||||||
|
|
||||||
|
|||||||
@ -414,14 +414,16 @@ class Rawmaterialdetails extends BaseController
|
|||||||
function checkmaterial()
|
function checkmaterial()
|
||||||
{
|
{
|
||||||
|
|
||||||
$material = $this->request->getPost('id');
|
$data = $this->request->getPost();
|
||||||
|
$materialCode = $data['materialCode'] ?? '';
|
||||||
|
$materialName = str_replace(' ', '', $data['materialName']);
|
||||||
|
|
||||||
$this->rawmaterialdetails_model = new rawmaterialdetails_model();;
|
$this->rawmaterialdetails_model = new rawmaterialdetails_model();;
|
||||||
$query = $this->rawmaterialdetails_model->checkMaterialExists($material);
|
$query = $this->rawmaterialdetails_model->checkMaterialExists($materialCode , $materialName);
|
||||||
|
|
||||||
|
|
||||||
return $this->response->setJSON($query);
|
return $this->response->setJSON($query);
|
||||||
|
|
||||||
//if(!empty($material)){
|
|
||||||
// echo json_encode($query);
|
|
||||||
//}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function exportmaterial()
|
function exportmaterial()
|
||||||
|
|||||||
@ -129,7 +129,6 @@ class StockController extends BaseController
|
|||||||
$data['month'] = $formattedDate;
|
$data['month'] = $formattedDate;
|
||||||
|
|
||||||
return $this->loadViews("CoatingMachineDetail", $this->global, $data, NULL);
|
return $this->loadViews("CoatingMachineDetail", $this->global, $data, NULL);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function addNewCoatingMachineDetails()
|
public function addNewCoatingMachineDetails()
|
||||||
@ -194,7 +193,6 @@ class StockController extends BaseController
|
|||||||
// Set flashdata for success message
|
// Set flashdata for success message
|
||||||
return redirect()->to("/coatingMachineDetails?month=$month")
|
return redirect()->to("/coatingMachineDetails?month=$month")
|
||||||
->with('success', $message1 . " " . $message2 . " " . $message3);
|
->with('success', $message1 . " " . $message2 . " " . $message3);
|
||||||
|
|
||||||
} catch (\Exception $error) {
|
} catch (\Exception $error) {
|
||||||
$this->db->transRollback();
|
$this->db->transRollback();
|
||||||
return redirect()->back()->with('error', ' ' . $error->getMessage());
|
return redirect()->back()->with('error', ' ' . $error->getMessage());
|
||||||
@ -239,7 +237,6 @@ class StockController extends BaseController
|
|||||||
$message2 = 'And updated gas stock consumption.';
|
$message2 = 'And updated gas stock consumption.';
|
||||||
|
|
||||||
$message3 = "Warning..!! Kindly Update the next subsequent month Gas Stock If older month Gas Stock Updated..!!";
|
$message3 = "Warning..!! Kindly Update the next subsequent month Gas Stock If older month Gas Stock Updated..!!";
|
||||||
|
|
||||||
}
|
}
|
||||||
// Commit the transaction if all queries succeed
|
// Commit the transaction if all queries succeed
|
||||||
|
|
||||||
@ -255,7 +252,6 @@ class StockController extends BaseController
|
|||||||
// Set flashdata for success message
|
// Set flashdata for success message
|
||||||
return redirect()->to("/coatingMachineDetails?month=$month")
|
return redirect()->to("/coatingMachineDetails?month=$month")
|
||||||
->with('success', $message1 . " " . $message2 . " " . $message3);
|
->with('success', $message1 . " " . $message2 . " " . $message3);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
throw new \Exception('Failed to update Coating machine details.');
|
throw new \Exception('Failed to update Coating machine details.');
|
||||||
}
|
}
|
||||||
@ -263,11 +259,6 @@ class StockController extends BaseController
|
|||||||
$this->db->transRollback();
|
$this->db->transRollback();
|
||||||
return redirect()->back()->with('error', ' ' . $error->getMessage());
|
return redirect()->back()->with('error', ' ' . $error->getMessage());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function deleteCoatingMachineDetails()
|
public function deleteCoatingMachineDetails()
|
||||||
@ -316,9 +307,8 @@ class StockController extends BaseController
|
|||||||
$materialCodes = $this->rawmaterialdetails_model->getAllSilicaRawMaterialCode();
|
$materialCodes = $this->rawmaterialdetails_model->getAllSilicaRawMaterialCode();
|
||||||
|
|
||||||
if (!empty($materialCodes)) {
|
if (!empty($materialCodes)) {
|
||||||
$data['igrDetails'] = $this->inwardGateRegister_model->findIgrDetailsForIncomingSilicaSand($materialCodes, $month,$remark);
|
$data['igrDetails'] = $this->inwardGateRegister_model->findIgrDetailsForIncomingSilicaSand($materialCodes, $month, $remark);
|
||||||
|
} else {
|
||||||
} else {
|
|
||||||
$data['igrDetails'] = [];
|
$data['igrDetails'] = [];
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -331,7 +321,6 @@ class StockController extends BaseController
|
|||||||
$data['remark'] = $remark;
|
$data['remark'] = $remark;
|
||||||
|
|
||||||
return $this->loadViews("incomingSilicaSandDetails", $this->global, $data, NULL);
|
return $this->loadViews("incomingSilicaSandDetails", $this->global, $data, NULL);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function updateIncomingSilicaSandDetails()
|
public function updateIncomingSilicaSandDetails()
|
||||||
@ -345,7 +334,7 @@ class StockController extends BaseController
|
|||||||
$updates = [];
|
$updates = [];
|
||||||
|
|
||||||
foreach ($incomingSilicaSandDetailsData as $data) {
|
foreach ($incomingSilicaSandDetailsData as $data) {
|
||||||
|
|
||||||
$id = $data['id'];
|
$id = $data['id'];
|
||||||
|
|
||||||
$dbData = [
|
$dbData = [
|
||||||
@ -379,84 +368,81 @@ class StockController extends BaseController
|
|||||||
|
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$resultExists = $this->incomingSilicaSandDetails_model
|
$resultExists = $this->incomingSilicaSandDetails_model
|
||||||
->where('id', $id)
|
->where('id', $id)
|
||||||
->first();
|
->first();
|
||||||
|
|
||||||
if(!empty($resultExists)){
|
if (!empty($resultExists)) {
|
||||||
$dbData['id'] = $resultExists['id'];
|
$dbData['id'] = $resultExists['id'];
|
||||||
$updates[] = $dbData ;
|
$updates[] = $dbData;
|
||||||
}else{
|
} else {
|
||||||
$inserts[] = $dbData;
|
$inserts[] = $dbData;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!empty($updates)){
|
if (!empty($updates)) {
|
||||||
$updated = $this->incomingSilicaSandDetails_model->updateBatch($updates,'id');
|
$updated = $this->incomingSilicaSandDetails_model->updateBatch($updates, 'id');
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!empty($inserts)){
|
if (!empty($inserts)) {
|
||||||
$inserted = $this->incomingSilicaSandDetails_model->insertBatch($inserts);
|
$inserted = $this->incomingSilicaSandDetails_model->insertBatch($inserts);
|
||||||
}
|
}
|
||||||
|
|
||||||
echo "Data Saved Successfully";
|
echo "Data Saved Successfully";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function updateLabReport(){
|
public function updateLabReport()
|
||||||
|
{
|
||||||
|
|
||||||
$postData = $this->request->getPost();
|
$postData = $this->request->getPost();
|
||||||
|
|
||||||
$id = $postData['id'];
|
$id = $postData['id'];
|
||||||
|
|
||||||
$dbData = [
|
$dbData = [
|
||||||
'igrNo_fk' =>$postData['igrNo'],
|
'igrNo_fk' => $postData['igrNo'],
|
||||||
'materialCode' => $postData['materialCode'],
|
'materialCode' => $postData['materialCode'],
|
||||||
'_10' => $postData['10Mm'],
|
'_10' => $postData['10Mm'],
|
||||||
'_20' => $postData['20Mm'],
|
'_20' => $postData['20Mm'],
|
||||||
'_30' => $postData['30Mm'],
|
'_30' => $postData['30Mm'],
|
||||||
'_40' => $postData['40Mm'],
|
'_40' => $postData['40Mm'],
|
||||||
'_50' => $postData['50Mm'],
|
'_50' => $postData['50Mm'],
|
||||||
'_70' => $postData['70Mm'],
|
'_70' => $postData['70Mm'],
|
||||||
'_100' => $postData['100Mm'],
|
'_100' => $postData['100Mm'],
|
||||||
'_140' => $postData['140Mm'],
|
'_140' => $postData['140Mm'],
|
||||||
'_200' => $postData['200Mm'],
|
'_200' => $postData['200Mm'],
|
||||||
'_300' => $postData['300Mm'],
|
'_300' => $postData['300Mm'],
|
||||||
'pan' => $postData['pan'],
|
'pan' => $postData['pan'],
|
||||||
'total' => $postData['total'],
|
'total' => $postData['total'],
|
||||||
'plus20loss' => $postData['plus20Loss'],
|
'plus20loss' => $postData['plus20Loss'],
|
||||||
'plus30Loss' => $postData['plus30Loss'],
|
'plus30Loss' => $postData['plus30Loss'],
|
||||||
'moistureSpec' => $postData['moistureSpec'],
|
'moistureSpec' => $postData['moistureSpec'],
|
||||||
'moistureActual' => $postData['moistureActual'],
|
'moistureActual' => $postData['moistureActual'],
|
||||||
'moistureLoss' => $postData['moistureLoss'],
|
'moistureLoss' => $postData['moistureLoss'],
|
||||||
'moistureLossQty'=> $postData['moistureLossQty'],
|
'moistureLossQty' => $postData['moistureLossQty'],
|
||||||
'sieveLossQty' => $postData['sieveLossQty'],
|
'sieveLossQty' => $postData['sieveLossQty'],
|
||||||
'salableQty' => $postData['salableQty'],
|
'salableQty' => $postData['salableQty'],
|
||||||
|
|
||||||
];
|
];
|
||||||
|
|
||||||
$resultExists = $this->incomingSilicaSandDetails_model
|
$resultExists = $this->incomingSilicaSandDetails_model
|
||||||
->where('id', $id)
|
->where('id', $id)
|
||||||
->first();
|
->first();
|
||||||
if($resultExists){
|
if ($resultExists) {
|
||||||
$updated = $this->incomingSilicaSandDetails_model
|
$updated = $this->incomingSilicaSandDetails_model
|
||||||
->update($id,$dbData);
|
->update($id, $dbData);
|
||||||
}else{
|
} else {
|
||||||
$updated = $this->incomingSilicaSandDetails_model
|
$updated = $this->incomingSilicaSandDetails_model
|
||||||
->insert($dbData);
|
->insert($dbData);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if($updated){
|
|
||||||
return redirect()->back()->with('success','Data Saved Successfully..!!');
|
if ($updated) {
|
||||||
}else{
|
return redirect()->back()->with('success', 'Data Saved Successfully..!!');
|
||||||
return redirect()->back()->with('error','Error Saving Data..!!');
|
} else {
|
||||||
}
|
return redirect()->back()->with('error', 'Error Saving Data..!!');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -545,10 +531,8 @@ class StockController extends BaseController
|
|||||||
$distinctMaterialCodes[] = $result[$index]['materialCode'];
|
$distinctMaterialCodes[] = $result[$index]['materialCode'];
|
||||||
}
|
}
|
||||||
$bagMaterials = $this->rawmaterialdetails_model->getSelectedBagMaterialCode($distinctMaterialCodes);
|
$bagMaterials = $this->rawmaterialdetails_model->getSelectedBagMaterialCode($distinctMaterialCodes);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
$bagMaterials = $this->rawmaterialdetails_model->getAllBagMaterialCode();
|
$bagMaterials = $this->rawmaterialdetails_model->getAllBagMaterialCode();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -576,7 +560,6 @@ class StockController extends BaseController
|
|||||||
$data['month'] = $formattedDate;
|
$data['month'] = $formattedDate;
|
||||||
|
|
||||||
return $this->loadViews("bagStockDetails", $this->global, $data, NULL);
|
return $this->loadViews("bagStockDetails", $this->global, $data, NULL);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function updateBagStockDetails()
|
public function updateBagStockDetails()
|
||||||
@ -613,11 +596,9 @@ class StockController extends BaseController
|
|||||||
|
|
||||||
if (empty($resultExists)) {
|
if (empty($resultExists)) {
|
||||||
$inserts[] = $dbData;
|
$inserts[] = $dbData;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
$dbData['id'] = $resultExists['id'];
|
$dbData['id'] = $resultExists['id'];
|
||||||
$updates[] = $dbData;
|
$updates[] = $dbData;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -634,11 +615,9 @@ class StockController extends BaseController
|
|||||||
echo "Data Updated Successfully";
|
echo "Data Updated Successfully";
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
echo "Data Saved Successfully";
|
echo "Data Saved Successfully";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -679,7 +658,6 @@ class StockController extends BaseController
|
|||||||
$data['month'] = $formattedDate;
|
$data['month'] = $formattedDate;
|
||||||
|
|
||||||
return $this->loadViews("dustAndRoughStockDetails", $this->global, $data, NULL);
|
return $this->loadViews("dustAndRoughStockDetails", $this->global, $data, NULL);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function updateDustAndRoughStockDetails()
|
public function updateDustAndRoughStockDetails()
|
||||||
@ -713,7 +691,6 @@ class StockController extends BaseController
|
|||||||
|
|
||||||
if (empty($resultExists)) {
|
if (empty($resultExists)) {
|
||||||
$inserts[] = $dbData;
|
$inserts[] = $dbData;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
$updates[] = $dbData;
|
$updates[] = $dbData;
|
||||||
}
|
}
|
||||||
@ -736,7 +713,6 @@ class StockController extends BaseController
|
|||||||
}
|
}
|
||||||
|
|
||||||
echo "Data Saved Successfully";
|
echo "Data Saved Successfully";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -825,11 +801,8 @@ class StockController extends BaseController
|
|||||||
$distinctMaterialCodes[] = $result[$index]['materialCode'];
|
$distinctMaterialCodes[] = $result[$index]['materialCode'];
|
||||||
}
|
}
|
||||||
$resinMaterials = $this->rawmaterialdetails_model->getSelectedResinMaterialCode($distinctMaterialCodes);
|
$resinMaterials = $this->rawmaterialdetails_model->getSelectedResinMaterialCode($distinctMaterialCodes);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
$resinMaterials = $this->rawmaterialdetails_model->getAllResinMaterialCode();
|
$resinMaterials = $this->rawmaterialdetails_model->getAllResinMaterialCode();
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -855,7 +828,6 @@ class StockController extends BaseController
|
|||||||
$data['month'] = $formattedDate;
|
$data['month'] = $formattedDate;
|
||||||
|
|
||||||
return $this->loadViews("resinStockDetails", $this->global, $data, NULL);
|
return $this->loadViews("resinStockDetails", $this->global, $data, NULL);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function updateResinStockDetails()
|
public function updateResinStockDetails()
|
||||||
@ -898,7 +870,6 @@ class StockController extends BaseController
|
|||||||
$dbData['id'] = $resultExists['id'];
|
$dbData['id'] = $resultExists['id'];
|
||||||
$updates[] = $dbData;
|
$updates[] = $dbData;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -919,7 +890,6 @@ class StockController extends BaseController
|
|||||||
}
|
}
|
||||||
|
|
||||||
echo "Data Saved Successfully";
|
echo "Data Saved Successfully";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -960,9 +930,10 @@ class StockController extends BaseController
|
|||||||
$endDate = date("Y-m-t", strtotime($startDate));
|
$endDate = date("Y-m-t", strtotime($startDate));
|
||||||
|
|
||||||
$data['gasStockDetails'] = $this->gasStockDetails_model
|
$data['gasStockDetails'] = $this->gasStockDetails_model
|
||||||
->select('t_gasStockDetails.*,
|
->select(
|
||||||
t_drierMachineDetails.total_gas_consumption AS drierMachineGasConsumption,
|
't_gasStockDetails.*,
|
||||||
t_drierMachineDetails.sand_dried_qty AS sandDried,
|
drier_summary.drierMachineGasconsumption AS drierMachineGasConsumption,
|
||||||
|
drier_summary.driedSand AS sandDried,
|
||||||
coating_summary.coatingMachineGasconsumption,
|
coating_summary.coatingMachineGasconsumption,
|
||||||
coating_summary.coatedSand'
|
coating_summary.coatedSand'
|
||||||
)
|
)
|
||||||
@ -981,10 +952,15 @@ class StockController extends BaseController
|
|||||||
'left'
|
'left'
|
||||||
)
|
)
|
||||||
->join(
|
->join(
|
||||||
't_drierMachineDetails',
|
'(SELECT date,
|
||||||
't_drierMachineDetails.date = t_gasStockDetails.date
|
SUM(total_gas_consumption) AS drierMachineGasconsumption,
|
||||||
AND t_drierMachineDetails.date >= ' . $this->db->escape($startDate) . '
|
SUM(sand_dried_qty) AS driedSand
|
||||||
AND t_drierMachineDetails.date <= ' . $this->db->escape($endDate),
|
FROM t_drierMachineDetails
|
||||||
|
WHERE date >= ' . $this->db->escape($startDate) . '
|
||||||
|
AND date <= ' . $this->db->escape($endDate) . '
|
||||||
|
GROUP BY date
|
||||||
|
) AS drier_summary',
|
||||||
|
'drier_summary.date = t_gasStockDetails.date',
|
||||||
'left'
|
'left'
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -1108,8 +1084,6 @@ class StockController extends BaseController
|
|||||||
|
|
||||||
|
|
||||||
$updates[] = $result;
|
$updates[] = $result;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($updates)) {
|
if (!empty($updates)) {
|
||||||
@ -1118,7 +1092,6 @@ class StockController extends BaseController
|
|||||||
} else {
|
} else {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
|
|
||||||
@ -1181,8 +1154,6 @@ class StockController extends BaseController
|
|||||||
];
|
];
|
||||||
|
|
||||||
$opening = $balanceStock;
|
$opening = $balanceStock;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($inserts)) {
|
if (!empty($inserts)) {
|
||||||
@ -1191,7 +1162,6 @@ class StockController extends BaseController
|
|||||||
} else {
|
} else {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1256,7 +1226,11 @@ class StockController extends BaseController
|
|||||||
$data['timeDropdown'] = $this->generateTimeOptions();
|
$data['timeDropdown'] = $this->generateTimeOptions();
|
||||||
$data['supplierData'] = $this->supplier_model->supplierlisting();
|
$data['supplierData'] = $this->supplier_model->supplierlisting();
|
||||||
|
|
||||||
$data['drierDetails'] = $this->drierMachineDetails_model->where('date >=', $data['startDate'])->where('date <=', $data['endDate'])->findAll();
|
$data['drierDetails'] = $this->drierMachineDetails_model->where('date >=', $data['startDate'])
|
||||||
|
->where('date <=', $data['endDate'])
|
||||||
|
->orderBy('date','asc')
|
||||||
|
->findAll();
|
||||||
|
|
||||||
if (!count($data['drierDetails'])) {
|
if (!count($data['drierDetails'])) {
|
||||||
//insert empty data
|
//insert empty data
|
||||||
$tempInsert = [];
|
$tempInsert = [];
|
||||||
@ -1265,7 +1239,10 @@ class StockController extends BaseController
|
|||||||
}
|
}
|
||||||
$this->drierMachineDetails_model->insertBatch($tempInsert);
|
$this->drierMachineDetails_model->insertBatch($tempInsert);
|
||||||
|
|
||||||
$data['drierDetails'] = $this->drierMachineDetails_model->where('date >=', $data['startDate'])->where('date <=', $data['endDate'])->findAll();
|
$data['drierDetails'] = $this->drierMachineDetails_model->where('date >=', $data['startDate'])
|
||||||
|
->where('date <=', $data['endDate'])
|
||||||
|
->orderBy('date','asc')
|
||||||
|
->findAll();
|
||||||
}
|
}
|
||||||
|
|
||||||
$data['datefordropdown'] = $currentMonth;
|
$data['datefordropdown'] = $currentMonth;
|
||||||
@ -1279,11 +1256,34 @@ class StockController extends BaseController
|
|||||||
|
|
||||||
public function addOrEditdrierMachineDetails()
|
public function addOrEditdrierMachineDetails()
|
||||||
{
|
{
|
||||||
|
$drierData = [];
|
||||||
$drierData = json_decode($this->request->getPost('drierData'), true);
|
$drierData = json_decode($this->request->getPost('drierData'), true);
|
||||||
|
|
||||||
|
|
||||||
if (empty($drierData)) {
|
if (empty($drierData)) {
|
||||||
echo "No data received.";
|
$additionalEntry = $this->request->getPost();
|
||||||
return;
|
if (!empty($additionalEntry)) {
|
||||||
|
$drierData[] = [
|
||||||
|
'Date' => $this->convertToDateWithFlexibleFormats($additionalEntry['Date'], ["d-m-Y", "Y-m-d", "m/d/Y", "m-d-Y"], "Y-m-d"),
|
||||||
|
'Drier On Time' => $additionalEntry['Drier_On_Time'],
|
||||||
|
'Drier Off Time' => $additionalEntry['Drier_Off_Time'],
|
||||||
|
'Running Hrs' => $additionalEntry['Running_Hrs'],
|
||||||
|
'Supplier Name' => $additionalEntry['Supplier_Name'],
|
||||||
|
'i/p Sand Moisture(%)' => $additionalEntry['i/p_Sand_Moisture(%)'],
|
||||||
|
'Tot Gas Consumption' => $additionalEntry['Tot_Gas_Consumption'],
|
||||||
|
'Gas Per Ton' => $additionalEntry['Gas_Per_Ton'],
|
||||||
|
'i/p Sand Qty' => $additionalEntry['i/p_Sand_Qty'],
|
||||||
|
'Moisture Loss Qty' => $additionalEntry['Moisture_Loss_Qty'],
|
||||||
|
'Sand Dried Qty' => $additionalEntry['Sand_Dried_Qty'],
|
||||||
|
'Qty Per Hrs' => $additionalEntry['Qty_Per_Hrs'],
|
||||||
|
'Dust Qty' => $additionalEntry['Dust_Qty'],
|
||||||
|
'Customer Name' => $additionalEntry['Customer_Name']
|
||||||
|
];
|
||||||
|
} else {
|
||||||
|
|
||||||
|
echo "No data received.";
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$message1 = '';
|
$message1 = '';
|
||||||
@ -1293,14 +1293,14 @@ class StockController extends BaseController
|
|||||||
try {
|
try {
|
||||||
foreach ($drierData as $row) {
|
foreach ($drierData as $row) {
|
||||||
$data = [
|
$data = [
|
||||||
'date' => DateTime::createFromFormat('d-m-Y', $row['Date'])->format('Y-m-d'),
|
'date' => $this->convertToDateWithFlexibleFormats($row['Date'], ["d-m-Y", "Y-m-d", "m/d/Y", "m-d-Y"], "Y-m-d"),
|
||||||
'drier_on_time' => $row['Drier On Time'],
|
'drier_on_time' => $row['Drier On Time'],
|
||||||
'drier_off_time' => $row['Drier Off Time'],
|
'drier_off_time' => $row['Drier Off Time'],
|
||||||
'drier_running_hours' => $row['Running Hrs'],
|
'drier_running_hours' => $row['Running Hrs'],
|
||||||
'supplier_name' => $row['Supplier Name'],
|
'supplier_name' => $row['Supplier Name'],
|
||||||
'input_sand_moisture' => $row['i/p Sand Moisture(%)'],
|
'input_sand_moisture' => $row['i/p Sand Moisture(%)'],
|
||||||
'total_gas_consumption' => $row['Tot Gas Consumption'],
|
'total_gas_consumption' => $row['Tot Gas Consumption'],
|
||||||
'gas_per_ton' => $row['Gas Pre Ton'],
|
'gas_per_ton' => $row['Gas Per Ton'],
|
||||||
'input_sand_qty' => $row['i/p Sand Qty'],
|
'input_sand_qty' => $row['i/p Sand Qty'],
|
||||||
'moisture_loss_qty' => $row['Moisture Loss Qty'],
|
'moisture_loss_qty' => $row['Moisture Loss Qty'],
|
||||||
'sand_dried_qty' => $row['Sand Dried Qty'],
|
'sand_dried_qty' => $row['Sand Dried Qty'],
|
||||||
@ -1310,7 +1310,7 @@ class StockController extends BaseController
|
|||||||
];
|
];
|
||||||
|
|
||||||
// Check if a row with the same date already exists
|
// Check if a row with the same date already exists
|
||||||
$existingRow = $this->drierMachineDetails_model->where('date', $data['date'])->first();
|
$existingRow = $this->drierMachineDetails_model->where('id', $row['id'] ?? '')->first();
|
||||||
|
|
||||||
$inserts = [];
|
$inserts = [];
|
||||||
$updates = [];
|
$updates = [];
|
||||||
@ -1330,7 +1330,6 @@ class StockController extends BaseController
|
|||||||
}
|
}
|
||||||
$data['id'] = $existingRow['id'];
|
$data['id'] = $existingRow['id'];
|
||||||
$updates[] = $data;
|
$updates[] = $data;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
// If not, insert a new row
|
// If not, insert a new row
|
||||||
//before inserting the row update gas stock
|
//before inserting the row update gas stock
|
||||||
@ -1340,7 +1339,6 @@ class StockController extends BaseController
|
|||||||
|
|
||||||
|
|
||||||
$inserts[] = $data;
|
$inserts[] = $data;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($inserts)) {
|
if (!empty($inserts)) {
|
||||||
@ -1358,21 +1356,47 @@ class StockController extends BaseController
|
|||||||
if ($this->db->transStatus() === false) {
|
if ($this->db->transStatus() === false) {
|
||||||
throw new \Exception('Transaction failed due to database error.');
|
throw new \Exception('Transaction failed due to database error.');
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->db->transCommit();
|
$this->db->transCommit();
|
||||||
echo "Data successfully saved. $message1";
|
|
||||||
} catch (\Exception $e) {
|
if (!empty($additionalEntry)) {
|
||||||
|
return redirect()->back()->with('success', " Data Saved Successfully..!!");
|
||||||
|
}
|
||||||
|
|
||||||
|
echo "Data saved successfully . $message1";
|
||||||
|
|
||||||
|
|
||||||
|
} catch (\Exception $e) {
|
||||||
// Rollback the transaction on any failure
|
// Rollback the transaction on any failure
|
||||||
$this->db->transRollback();
|
$this->db->transRollback();
|
||||||
echo "Failed to save/Update data: " . $e->getMessage();
|
echo "Failed to save/Update data: " . $e->getMessage();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function convertToDateWithFlexibleFormats($dateInput, array $inputFormats, string $outputFormat): ?string
|
||||||
|
{
|
||||||
|
// If it's already a DateTime object, just format it
|
||||||
|
if ($dateInput instanceof DateTime) {
|
||||||
|
return $dateInput->format($outputFormat);
|
||||||
|
}
|
||||||
|
|
||||||
|
// If it's a string, attempt to parse it
|
||||||
|
if (is_string($dateInput)) {
|
||||||
|
foreach ($inputFormats as $format) {
|
||||||
|
$date = DateTime::createFromFormat($format, $dateInput);
|
||||||
|
if ($date) {
|
||||||
|
return $date->format($outputFormat);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return $dateInput;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public function factoryVehicleDieselDetails()
|
public function factoryVehicleDieselDetails()
|
||||||
{
|
{
|
||||||
$currentMonth = $this->request->getPost('month') ? $this->request->getPost('month') : date('M-Y');
|
$currentMonth = $this->request->getPost('month') ? $this->request->getPost('month') : date('M-Y');
|
||||||
@ -1437,7 +1461,6 @@ class StockController extends BaseController
|
|||||||
|
|
||||||
$this->global['pageTitle'] = 'Drier Details';
|
$this->global['pageTitle'] = 'Drier Details';
|
||||||
$this->loadViews("factoryDieselMachineDetails", $this->global, $data, NULL);
|
$this->loadViews("factoryDieselMachineDetails", $this->global, $data, NULL);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getDieselConsumptionPivot($machineDetails, $startDate, $endDeate)
|
public function getDieselConsumptionPivot($machineDetails, $startDate, $endDeate)
|
||||||
@ -1514,7 +1537,6 @@ class StockController extends BaseController
|
|||||||
if ($row['machine_id'] == 0) {
|
if ($row['machine_id'] == 0) {
|
||||||
// Summary data: if machine_id is 0, it indicates summary data. This distinction is used because these records will be stored in a separate table.
|
// Summary data: if machine_id is 0, it indicates summary data. This distinction is used because these records will be stored in a separate table.
|
||||||
$this->factoryVehicleDieselStockSummary_model->where('date', $row['date'])->set($row)->update();
|
$this->factoryVehicleDieselStockSummary_model->where('date', $row['date'])->set($row)->update();
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
// Diesel - factory vehicle data :
|
// Diesel - factory vehicle data :
|
||||||
@ -1524,14 +1546,11 @@ class StockController extends BaseController
|
|||||||
} else {
|
} else {
|
||||||
$this->factoryVehicleDieselDetails_model->insert($row);
|
$this->factoryVehicleDieselDetails_model->insert($row);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
echo "Data successfully saved.";
|
echo "Data successfully saved.";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1573,7 +1592,6 @@ class StockController extends BaseController
|
|||||||
|
|
||||||
$this->global['pageTitle'] = 'Power Consumption Details';
|
$this->global['pageTitle'] = 'Power Consumption Details';
|
||||||
$this->loadViews("powerConsumptionDetails", $this->global, $data, NULL);
|
$this->loadViews("powerConsumptionDetails", $this->global, $data, NULL);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getElectricConsumptionPivot($machineDetails, $startDate, $endDeate)
|
public function getElectricConsumptionPivot($machineDetails, $startDate, $endDeate)
|
||||||
@ -1654,8 +1672,5 @@ class StockController extends BaseController
|
|||||||
|
|
||||||
|
|
||||||
echo "Data successfully saved.";
|
echo "Data successfully saved.";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -309,11 +309,17 @@ class Supplier extends BaseController
|
|||||||
|
|
||||||
function checksupplier()
|
function checksupplier()
|
||||||
{
|
{
|
||||||
|
|
||||||
|
$supp_id = $this->request->getPost('supplierId') ?? '';
|
||||||
|
|
||||||
$supp_name = $this->request->getPost('id');
|
$supp_name = $this->request->getPost('supplierName');
|
||||||
|
|
||||||
|
$supp_name = str_replace(' ', '', $supp_name);
|
||||||
|
|
||||||
$query = $this->supplier_model->checkSupplierExists($supp_name);
|
|
||||||
|
|
||||||
|
$query = $this->supplier_model->checkSupplierExists($supp_id , $supp_name);
|
||||||
|
|
||||||
|
|
||||||
return $this->response->setJSON($query);
|
return $this->response->setJSON($query);
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -467,11 +473,14 @@ class Supplier extends BaseController
|
|||||||
* check the Transporter exists?
|
* check the Transporter exists?
|
||||||
*/
|
*/
|
||||||
|
|
||||||
function checkTransporter(){
|
function checkTransporter(){
|
||||||
|
|
||||||
$data = $this->request->getPost();
|
$data = $this->request->getPost();
|
||||||
$message = $this->supplier_model->checkTransporter($data['transportername']);
|
$transporterId = $data['transporterid']??'';
|
||||||
return $this->response->setJSON($message);
|
$transporterName = $data['transportername'];
|
||||||
|
$message = $this->supplier_model->checkTransporter($transporterId,$transporterName);
|
||||||
|
|
||||||
|
return $this->response->setJSON($message);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -269,14 +269,20 @@ class Assetdetails_model extends Model
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function checkAssetName($assetName)
|
function checkAssetName($assetId,$assetName)
|
||||||
{
|
{
|
||||||
$builder = $this->db->table('t_asset_details')
|
$builder = $this->db->table('t_asset_details')
|
||||||
->select('t_asset_details.*')
|
->select('t_asset_details.*');
|
||||||
->where('AssetName', $assetName);
|
|
||||||
$query = $builder->get();
|
if(!empty($assetId)){
|
||||||
|
$builder = $builder->where('AssetCode !=', $assetId);
|
||||||
|
}
|
||||||
|
|
||||||
|
$builder = $builder->where('REPLACE(AssetName , " ", "") ',$assetName);
|
||||||
|
|
||||||
return $query->getResultArray();
|
$query = $builder->get();
|
||||||
|
|
||||||
|
return $query->getResultArray();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -178,14 +178,17 @@ class Config_model extends Model
|
|||||||
return $query->getResult();
|
return $query->getResult();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function configNameCheck($configName){
|
public function configNameCheck($configId,$configName){
|
||||||
$builder = $this->db->table('t_configmaster')
|
$builder = $this->db->table('t_configmaster');
|
||||||
->where('ConfigName ', $configName);
|
|
||||||
$query = $builder->get();
|
|
||||||
|
|
||||||
// dd( $this->db->getLastQuery());
|
if(!empty($configId)){
|
||||||
|
$builder = $builder -> where('Config_ID !=' ,$configId);
|
||||||
|
}
|
||||||
|
|
||||||
|
$builder = $builder->where('REPLACE(ConfigName , " ", "") ',$configName);
|
||||||
|
$query = $builder->get();
|
||||||
|
|
||||||
return $query->getResultArray();
|
return $query->getResultArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function configValueCheck($configId , $configValue){
|
public function configValueCheck($configId , $configValue){
|
||||||
|
|||||||
@ -429,10 +429,14 @@ where Dept.DEPCode not in
|
|||||||
return "Cost center $CostCenterCode deactivated successfully.";
|
return "Cost center $CostCenterCode deactivated successfully.";
|
||||||
}
|
}
|
||||||
|
|
||||||
function checkCostCenter($CostCenterName){
|
function checkCostCenter($CostCenterId,$CostCenterName){
|
||||||
$builder = $this->db->table('t_costcenter_master')
|
$builder = $this->db->table('t_costcenter_master')
|
||||||
->select('CostCenterName,IsActive')
|
->select('CostCenterName,IsActive');
|
||||||
->where('CostCenterName', $CostCenterName);
|
|
||||||
|
if(!empty($CostCenterId)){
|
||||||
|
$builder = $builder -> where('id !=' ,$CostCenterId);
|
||||||
|
}
|
||||||
|
$builder = $builder->where('REPLACE(CostCenterName , " ", "") ',$CostCenterName);
|
||||||
$query = $builder->get();
|
$query = $builder->get();
|
||||||
|
|
||||||
return $query->getResult();
|
return $query->getResult();
|
||||||
|
|||||||
@ -150,12 +150,18 @@ function getdepcode()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function checkDepartmentName($departmentName){
|
function checkDepartmentName($depCode ,$departmentName){
|
||||||
$builder = $this->db->table('t_departmentdetails')
|
$builder = $this->db->table('t_departmentdetails');
|
||||||
->where('DepartmentName', $departmentName);
|
|
||||||
|
if(!empty($depCode)){
|
||||||
|
$builder = $builder -> where(' DEPCode !=', $depCode);
|
||||||
|
}
|
||||||
|
|
||||||
|
$builder = $builder->where('REPLACE(DepartmentName , " ", "") ',$departmentName);
|
||||||
$query = $builder->get();
|
$query = $builder->get();
|
||||||
$result =$query->getResultArray();
|
$result =$query->getResultArray();
|
||||||
return $result;
|
return $result;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -38,5 +38,31 @@ class FactoryMachineModel extends Model
|
|||||||
|
|
||||||
// Skip validation (set to true to skip validation rules)
|
// Skip validation (set to true to skip validation rules)
|
||||||
protected $skipValidation = false;
|
protected $skipValidation = false;
|
||||||
|
|
||||||
|
public function checkMachineName($machineId,$machineName){
|
||||||
|
|
||||||
|
$builder = $this->db->table('t_factoryMachineMaster');
|
||||||
|
|
||||||
|
if(!empty($machineId)){
|
||||||
|
$builder = $builder->where('id !=' , $machineId);
|
||||||
|
}
|
||||||
|
|
||||||
|
$builder = $builder->where('REPLACE(machine_name, " ", "") ',$machineName);
|
||||||
|
|
||||||
|
$query = $builder->get();
|
||||||
|
|
||||||
|
|
||||||
|
if ($query->getNumRows() > 0) {
|
||||||
|
return $query->getResultArray();
|
||||||
|
} else {
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -348,7 +348,7 @@ class Ipinvoice_model extends Model
|
|||||||
->join('ip_invoice_items b', 'a.invoice_id = b.invoice_id', 'left')
|
->join('ip_invoice_items b', 'a.invoice_id = b.invoice_id', 'left')
|
||||||
->join('ip_invoice_item_amounts c', 'b.item_id = c.item_id', 'left')
|
->join('ip_invoice_item_amounts c', 'b.item_id = c.item_id', 'left')
|
||||||
->where('a.invoice_date_created >=', $fiscalYearStartCurrent)
|
->where('a.invoice_date_created >=', $fiscalYearStartCurrent)
|
||||||
->where('a.invoice_status_id', 2)
|
->whereIn('a.invoice_status_id', [2,5])
|
||||||
->groupBy("DATE_FORMAT(a.invoice_date_created, '%b')")
|
->groupBy("DATE_FORMAT(a.invoice_date_created, '%b')")
|
||||||
->orderBy('MONTH(a.invoice_date_created)');
|
->orderBy('MONTH(a.invoice_date_created)');
|
||||||
|
|
||||||
@ -360,7 +360,7 @@ class Ipinvoice_model extends Model
|
|||||||
->join('ip_invoice_item_amounts c', 'b.item_id = c.item_id', 'left')
|
->join('ip_invoice_item_amounts c', 'b.item_id = c.item_id', 'left')
|
||||||
->where('a.invoice_date_created >=', $fiscalYearStartLast)
|
->where('a.invoice_date_created >=', $fiscalYearStartLast)
|
||||||
->where('a.invoice_date_created <', $fiscalYearStartCurrent)
|
->where('a.invoice_date_created <', $fiscalYearStartCurrent)
|
||||||
->where('a.invoice_status_id', 2)
|
->whereIn('a.invoice_status_id', [2,5])
|
||||||
->groupBy("DATE_FORMAT(a.invoice_date_created, '%b')")
|
->groupBy("DATE_FORMAT(a.invoice_date_created, '%b')")
|
||||||
->orderBy('MONTH(a.invoice_date_created)');
|
->orderBy('MONTH(a.invoice_date_created)');
|
||||||
|
|
||||||
@ -412,8 +412,8 @@ class Ipinvoice_model extends Model
|
|||||||
SUM(iia.item_cgst_amt) AS 'CGST',
|
SUM(iia.item_cgst_amt) AS 'CGST',
|
||||||
SUM(iia.item_sgst_amt) AS 'SGST',
|
SUM(iia.item_sgst_amt) AS 'SGST',
|
||||||
SUM(iia.item_igst_amt) AS 'IGST',
|
SUM(iia.item_igst_amt) AS 'IGST',
|
||||||
SUM(IFNULL(tcs.tax_rate_percent * iia.item_total / 100, 0)) AS 'TCS',
|
truncate(SUM(IFNULL(tcs.tax_rate_percent * iia.item_total / 100, 0)),2) AS 'TCS',
|
||||||
SUM(IFNULL(tcs.tax_rate_percent * iia.item_total / 100, 0)) + SUM(iia.item_total) AS 'Total'
|
truncate(SUM(IFNULL(tcs.tax_rate_percent * iia.item_total / 100, 0)) + SUM(iia.item_total),2) AS 'Total'
|
||||||
")
|
")
|
||||||
->join('ip_invoice_custom icf', 'icf.invoice_id = ii.invoice_id', 'left')
|
->join('ip_invoice_custom icf', 'icf.invoice_id = ii.invoice_id', 'left')
|
||||||
->join('ip_invoice_tax_rates tc', 'tc.invoice_id = ii.invoice_id', 'left')
|
->join('ip_invoice_tax_rates tc', 'tc.invoice_id = ii.invoice_id', 'left')
|
||||||
@ -425,7 +425,7 @@ class Ipinvoice_model extends Model
|
|||||||
->join('ip_tax_rates igst', 'igst.tax_rate_id = iit.igst_item_tax_rate_id', 'left')
|
->join('ip_tax_rates igst', 'igst.tax_rate_id = iit.igst_item_tax_rate_id', 'left')
|
||||||
->join('ip_tax_rates tcs', 'tcs.tax_rate_id = tc.tax_rate_id', 'left')
|
->join('ip_tax_rates tcs', 'tcs.tax_rate_id = tc.tax_rate_id', 'left')
|
||||||
->where('icf.invoice_custom_fieldid', $vehicleCustomFieldId)
|
->where('icf.invoice_custom_fieldid', $vehicleCustomFieldId)
|
||||||
->where('ii.invoice_status_id', 2)
|
->whereIn('ii.invoice_status_id', [2,5])
|
||||||
->where('ii.invoice_date_created', date('Y-m-d'))
|
->where('ii.invoice_date_created', date('Y-m-d'))
|
||||||
->groupBy('ii.invoice_number, iit.item_description')
|
->groupBy('ii.invoice_number, iit.item_description')
|
||||||
->orderBy('ii.invoice_number');
|
->orderBy('ii.invoice_number');
|
||||||
|
|||||||
@ -313,20 +313,21 @@ class Rawmaterialdetails_model extends Model
|
|||||||
// $this->db->update('T_PurchaseOrderDetails', $POInfo);
|
// $this->db->update('T_PurchaseOrderDetails', $POInfo);
|
||||||
// return $this->db->affectedRows();
|
// return $this->db->affectedRows();
|
||||||
// }
|
// }
|
||||||
function checkMaterialExists($material)
|
function checkMaterialExists($materialCode , $materialName)
|
||||||
{
|
{
|
||||||
// $sql="SELECT MaterialCode, MaterialName, MaterialType, Category,REPLACE(MaterialName, ' ', '')
|
|
||||||
// FROM t_materialmaster
|
|
||||||
// WHERE REPLACE(MaterialName, ' ', '') LIKE REPLACE('%'".$material."'%', ' ', '')";
|
|
||||||
|
|
||||||
|
|
||||||
$builder = $this->db->table('t_materialmaster')
|
$builder = $this->db->table('t_materialmaster')
|
||||||
->select('MaterialCode,MaterialName,MaterialType,Category,IsActive')
|
->select('MaterialCode,MaterialName,MaterialType,Category,IsActive');
|
||||||
->like('REPLACE(MaterialName, " ", "")', $material);
|
if(!empty($materialCode)){
|
||||||
|
$builder = $builder->where('MaterialCode !=' , $materialCode);
|
||||||
|
}
|
||||||
|
$builder->where('REPLACE(MaterialName, " ", "")' , $materialName);
|
||||||
|
|
||||||
$query = $builder->get();
|
$query = $builder->get();
|
||||||
//print_r($query-getResult());
|
if ($query->getNumRows() > 0) {
|
||||||
return $query->getResult();
|
return $query->getResultArray();
|
||||||
|
} else {
|
||||||
|
return [];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function checkMaterialCategory($mc)
|
function checkMaterialCategory($mc)
|
||||||
|
|||||||
@ -53,16 +53,17 @@ class Supplier_model extends Model
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function checkTransporter($transporterName){
|
function checkTransporter($transporterId,$transporterName){
|
||||||
$builder = $this->db->table('t_transporter')
|
$builder = $this->db->table('t_transporter');
|
||||||
->where('name', $transporterName);
|
if(!empty($transporterId)){
|
||||||
|
$builder = $builder->where('id !=',$transporterId);
|
||||||
|
}
|
||||||
|
$builder = $builder->where('REPLACE(name , " ", "") ',$transporterName);
|
||||||
$query = $builder->get();
|
$query = $builder->get();
|
||||||
|
|
||||||
return $query->getResult();
|
return $query->getResult();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function deleteTransporter($Sid, $SupplierInfo){
|
function deleteTransporter($Sid, $SupplierInfo){
|
||||||
|
|
||||||
$builder = $this->db->table('t_transporter')
|
$builder = $this->db->table('t_transporter')
|
||||||
@ -198,15 +199,20 @@ class Supplier_model extends Model
|
|||||||
return $query->getResultArray();
|
return $query->getResultArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
function checkSupplierExists($supp_name)
|
function checkSupplierExists($supp_id,$supp_name)
|
||||||
{
|
{
|
||||||
|
|
||||||
$builder = $this->db->table('t_supplierdetailsn')
|
$builder = $this->db->table('t_supplierdetailsn');
|
||||||
->select('SupplierID,SupplierName,Address,IsActive')
|
$builder = $builder->select('SupplierID, SupplierName, Address, IsActive');
|
||||||
->like('REPLACE(SupplierName, " ", "")', $supp_name);
|
|
||||||
|
if(!empty($supp_id)){
|
||||||
|
$builder = $builder->where('SupplierID !=' , $supp_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
$builder = $builder->where('REPLACE(SupplierName, " ", "") ',$supp_name);
|
||||||
|
|
||||||
$query = $builder->get();
|
$query = $builder->get();
|
||||||
|
|
||||||
if ($query->getNumRows() > 0) {
|
if ($query->getNumRows() > 0) {
|
||||||
return $query->getResultArray();
|
return $query->getResultArray();
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -293,19 +293,20 @@
|
|||||||
|
|
||||||
$('#MaterialName').change(function() {
|
$('#MaterialName').change(function() {
|
||||||
|
|
||||||
var materialname = $('#MaterialName').val().trim();
|
var materialName = $('#MaterialName').val();
|
||||||
|
var materialCode = '';
|
||||||
|
|
||||||
if(materialname == ''){
|
if(materialName == ''){
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
//material = material.replace(/\s*$/,"");
|
var material = materialName.replace(/ /g, '');
|
||||||
var material = materialname.replace(/ /g, '');
|
|
||||||
//alert(m.length+" "+m+" "+s+" "+s.length);
|
|
||||||
$('#loader').show();
|
$('#loader').show();
|
||||||
$.ajax({
|
$.ajax({
|
||||||
data: {
|
data: {
|
||||||
id: material
|
materialCode,
|
||||||
|
materialName
|
||||||
},
|
},
|
||||||
type: "POST",
|
type: "POST",
|
||||||
url: "<?php echo base_url(); ?>materialExist",
|
url: "<?php echo base_url(); ?>materialExist",
|
||||||
@ -335,9 +336,9 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
error: function() {
|
error: function(error) {
|
||||||
$('#loader').hide();
|
$('#loader').hide();
|
||||||
alert("Error Occur");
|
alert("Error Occur" ,error);
|
||||||
},
|
},
|
||||||
complete: function(){
|
complete: function(){
|
||||||
$('#loader').hide();
|
$('#loader').hide();
|
||||||
|
|||||||
@ -258,14 +258,16 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
$('#supplierName').change(function() {
|
$('#supplierName').change(function() {
|
||||||
var suppliername = $('#supplierName').val();
|
var supplierName = $('#supplierName').val().trim();
|
||||||
var supplier = suppliername.replace(/ /g, '');
|
var supplierId = $('#SupplierID').val();
|
||||||
|
|
||||||
$('#loader').show();
|
$('#loader').show();
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: "POST",
|
type: "POST",
|
||||||
url: "<?= base_url() . 'supplierExist' ?>",
|
url: "<?= base_url() . 'supplierExist' ?>",
|
||||||
data: {
|
data: {
|
||||||
id: supplier
|
supplierId ,
|
||||||
|
supplierName
|
||||||
},
|
},
|
||||||
success: function(data) {
|
success: function(data) {
|
||||||
var count = data?data.length:0;
|
var count = data?data.length:0;
|
||||||
|
|||||||
@ -25,7 +25,7 @@
|
|||||||
<div class="form-row">
|
<div class="form-row">
|
||||||
<div class=" col-md-3">
|
<div class=" col-md-3">
|
||||||
<label class="col-form-label" for="AssetName">Asset Name<span class="badge">*</span></label>
|
<label class="col-form-label" for="AssetName">Asset Name<span class="badge">*</span></label>
|
||||||
<input type="text" class="form-control " required style="text-transform:uppercase;" id="AssetName" name="AssetName" value="<?php echo isset($_POST['AssetName']) ? $_POST['AssetName'] : '' ?>">
|
<input type="text" class="form-control " required id="AssetName" name="AssetName" value="<?php echo isset($_POST['AssetName']) ? $_POST['AssetName'] : '' ?>">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class=" col-md-3">
|
<div class=" col-md-3">
|
||||||
@ -433,14 +433,15 @@
|
|||||||
|
|
||||||
$('#AssetName').on('change',function(){
|
$('#AssetName').on('change',function(){
|
||||||
|
|
||||||
let assetName = $(this).val();
|
let assetName = $(this).val().trim();
|
||||||
|
let assetId = $('#AssetCode').val() ?? '';
|
||||||
|
|
||||||
$('#loader').show();
|
$('#loader').show();
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type:'POST',
|
type:'POST',
|
||||||
url:'<?php echo base_url()?>assetdetails/checkAssetName',
|
url:'<?php echo base_url()?>assetdetails/checkAssetName',
|
||||||
data:{assetName},
|
data:{assetId,assetName},
|
||||||
success: function(data){
|
success: function(data){
|
||||||
if(data && data.length>0){
|
if(data && data.length>0){
|
||||||
let IsActive = data[0].IsActive;
|
let IsActive = data[0].IsActive;
|
||||||
|
|||||||
@ -391,17 +391,18 @@
|
|||||||
$('#configurationname').change(function () {
|
$('#configurationname').change(function () {
|
||||||
$('#loader').show();
|
$('#loader').show();
|
||||||
$.ajax({
|
$.ajax({
|
||||||
data: {configName: $('#configurationname').val()},
|
|
||||||
|
data: {configName: $('#configurationname').val().trim() , configId : $('#ConfigId').val()??''},
|
||||||
type: 'POST',
|
type: 'POST',
|
||||||
url: "<?php echo base_url(); ?>configurationctrl/configNameCheck",
|
url: "<?php echo base_url(); ?>configurationctrl/configNameCheck",
|
||||||
|
|
||||||
success: function (data) {
|
success: function (data) {
|
||||||
if(data && data.length > 0){
|
if(data && data.length > 0){
|
||||||
|
|
||||||
if(data[0].isActive == 1){
|
if(data[0].isActive == 1){
|
||||||
alert("This Configuration Name is already present. kindly change it..!!");
|
alert("This Configuration Name is already present. kindly change it..!!");
|
||||||
$('#configurationname').val('');
|
$('#configurationname').val('');
|
||||||
return;
|
return;
|
||||||
}else{
|
}else{
|
||||||
alert("This Configuration Name is already present in deleted section. kindly reactivate it If needed..!!");
|
alert("This Configuration Name is already present in deleted section. kindly reactivate it If needed..!!");
|
||||||
$('#configurationname').val('');
|
$('#configurationname').val('');
|
||||||
|
|||||||
@ -155,11 +155,12 @@
|
|||||||
<script>
|
<script>
|
||||||
|
|
||||||
$("#DepartmentName").on('change',function(){
|
$("#DepartmentName").on('change',function(){
|
||||||
let departmentName = $("#DepartmentName").val();
|
let departmentName = $("#DepartmentName").val().trim();
|
||||||
|
let depCode =$("#DEPCode").val()??'';
|
||||||
$('#loader').show();
|
$('#loader').show();
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type:"POST",
|
type:"POST",
|
||||||
data:{departmentName},
|
data:{departmentName,depCode},
|
||||||
url:"<?php echo base_url();?>checkDepartmentName",
|
url:"<?php echo base_url();?>checkDepartmentName",
|
||||||
success:function(data){
|
success:function(data){
|
||||||
|
|
||||||
|
|||||||
@ -670,7 +670,7 @@
|
|||||||
for (let i = 1; i < rowCells.length; i += 7) {
|
for (let i = 1; i < rowCells.length; i += 7) {
|
||||||
const rowData = {
|
const rowData = {
|
||||||
date: rowCells.eq(i).text().trim(),
|
date: rowCells.eq(i).text().trim(),
|
||||||
materialCode: rowCells.eq(i+1).text().trim(),
|
materialCode: rowCells.eq(i+1).text().trim(),
|
||||||
customer: rowCells.eq(i+2).text().trim(),
|
customer: rowCells.eq(i+2).text().trim(),
|
||||||
opening: rowCells.eq(i+3).text().trim(),
|
opening: rowCells.eq(i+3).text().trim(),
|
||||||
receipt: rowCells.eq(i+4).text().trim(),
|
receipt: rowCells.eq(i+4).text().trim(),
|
||||||
|
|||||||
@ -124,7 +124,6 @@
|
|||||||
<td><?php echo $record->CostCenterName ?></td>
|
<td><?php echo $record->CostCenterName ?></td>
|
||||||
<td><?php echo $record->FirstName ?></td>
|
<td><?php echo $record->FirstName ?></td>
|
||||||
<td><?php if ($record->IsActive == 1) {echo"Active";}else{echo "InActive";}?></td>
|
<td><?php if ($record->IsActive == 1) {echo"Active";}else{echo "InActive";}?></td>
|
||||||
<td><?php if ($record->IsActive == 1) {echo"Active";}else{echo "InActive";}?></td>
|
|
||||||
<td>
|
<td>
|
||||||
<?php
|
<?php
|
||||||
if ($record->IsActive == 0) {
|
if ($record->IsActive == 0) {
|
||||||
@ -227,7 +226,8 @@
|
|||||||
type: 'POST',
|
type: 'POST',
|
||||||
url: "<?php echo base_url(); ?>checkCostCenter",
|
url: "<?php echo base_url(); ?>checkCostCenter",
|
||||||
data: {
|
data: {
|
||||||
CostCenterName: $('#CostCenterName').val()
|
CostCenterId : $('#id').val(),
|
||||||
|
CostCenterName: $('#CostCenterName').val().trim()
|
||||||
},
|
},
|
||||||
success: function (data) {
|
success: function (data) {
|
||||||
$('#loader').hide();
|
$('#loader').hide();
|
||||||
|
|||||||
@ -1,5 +1,3 @@
|
|||||||
|
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
$datefordropdown = format_date($datefordropdown, 0, 'M-Y');
|
$datefordropdown = format_date($datefordropdown, 0, 'M-Y');
|
||||||
?>
|
?>
|
||||||
@ -35,7 +33,7 @@ $datefordropdown = format_date($datefordropdown, 0, 'M-Y');
|
|||||||
width: auto;
|
width: auto;
|
||||||
border-collapse: collapse;
|
border-collapse: collapse;
|
||||||
border-spacing: 0;
|
border-spacing: 0;
|
||||||
white-space:nowrap;
|
white-space: nowrap;
|
||||||
}
|
}
|
||||||
|
|
||||||
.fht-table th,
|
.fht-table th,
|
||||||
@ -160,43 +158,26 @@ $datefordropdown = format_date($datefordropdown, 0, 'M-Y');
|
|||||||
height: 20px;
|
height: 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#drierTable th:nth-child(1) {
|
|
||||||
position: sticky;
|
|
||||||
left: 0;
|
|
||||||
background-color: #00a65a;
|
|
||||||
z-index: 2;
|
|
||||||
border-right: 2px solid #ddd;
|
|
||||||
color: #ffffff;
|
|
||||||
}
|
|
||||||
|
|
||||||
#drierTable td:nth-child(1) {
|
|
||||||
position: sticky;
|
|
||||||
left: 0;
|
|
||||||
background-color: #ffffff;
|
|
||||||
z-index: 2;
|
|
||||||
border-right: 2px solid #ddd;
|
|
||||||
color: #0e0b0b;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* #drierTable th:nth-child(1),
|
#drierTable th:nth-child(1) {
|
||||||
#drierTable th:nth-child(2),
|
position: sticky;
|
||||||
#drierTable td:nth-child(1),
|
left: 0;
|
||||||
#drierTable td:nth-child(2) {
|
background-color: #00a65a;
|
||||||
position: sticky;
|
z-index: 2;
|
||||||
left: 0;
|
border-right: 2px solid #ddd;
|
||||||
background-color: white;
|
color: #ffffff;
|
||||||
z-index: 2;
|
}
|
||||||
border-right: 1px solid #ddd;
|
|
||||||
}
|
#drierTable td:nth-child(1) {
|
||||||
#drierTable th:nth-child(1),
|
position: sticky;
|
||||||
#drierTable td:nth-child(1) {
|
left: 0;
|
||||||
z-index: 3;
|
background-color: #ffffff;
|
||||||
} */
|
z-index: 2;
|
||||||
|
border-right: 2px solid #ddd;
|
||||||
|
color: #0e0b0b;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
<div class="content-page">
|
<div class="content-page">
|
||||||
<div class="content">
|
<div class="content">
|
||||||
@ -207,15 +188,17 @@ $datefordropdown = format_date($datefordropdown, 0, 'M-Y');
|
|||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-6">
|
<div class="col-6">
|
||||||
<div class="page-title-box page-title-box-alt">
|
<div class="page-title-box page-title-box-alt">
|
||||||
<div class="page-title-right">
|
<div class="page-title-right">
|
||||||
<ol class="breadcrumb m-0">
|
<ol class="breadcrumb m-0">
|
||||||
<li class="breadcrumb-item"><a href="javascript: void(0);">Stocks</a></li>
|
<li class="breadcrumb-item"><a href="javascript: void(0);">Stocks</a></li>
|
||||||
<li class="breadcrumb-item active">
|
<li class="breadcrumb-item active">
|
||||||
<h4 class="page-title">10 Ton Drier Details </h4>
|
<h4 class="page-title">10 Ton Drier Details </h4>
|
||||||
</li>
|
</li>
|
||||||
</ol>
|
</ol>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-6 text-right">
|
<div class="col-6 text-right">
|
||||||
@ -229,140 +212,202 @@ $datefordropdown = format_date($datefordropdown, 0, 'M-Y');
|
|||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
<div class="card">
|
<div class="card">
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
|
|
||||||
|
|
||||||
<form action="<?= base_url('drierMachineDetails'); ?>" method="post">
|
|
||||||
<div class="row">
|
|
||||||
|
|
||||||
<div class="col-3">
|
|
||||||
<?php $today = date('M-Y'); ?>
|
|
||||||
<input type="text" name="month" id="month" value="<?php echo $datefordropdown; ?>" class="form-control" data-provide="datepicker" data-date-format="M-yyyy" data-date-min-view-mode="1">
|
|
||||||
|
|
||||||
|
|
||||||
|
<form action="<?= base_url('drierMachineDetails'); ?>" method="post">
|
||||||
|
<div class="row">
|
||||||
|
|
||||||
|
<div class="col-3">
|
||||||
|
<?php $today = date('M-Y'); ?>
|
||||||
|
<input type="text" name="month" id="month" value="<?php echo $datefordropdown; ?>" class="form-control" data-provide="datepicker" data-date-format="M-yyyy" data-date-min-view-mode="1">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="col-3">
|
||||||
|
<input type="submit" value="Change Month" class="btn btn-success" style="margin-top:0px;">
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="col-6">
|
||||||
|
<div class="dropdown float-right">
|
||||||
|
<a href="#" class="dropdown-toggle arrow-none" data-toggle="dropdown"
|
||||||
|
aria-expanded="false">
|
||||||
|
<i class="mdi mdi-dots-vertical m-0 text-muted h3"></i>
|
||||||
|
</a>
|
||||||
|
<div class="dropdown-menu dropdown-menu-right">
|
||||||
|
<a style="cursor:pointer"
|
||||||
|
class="dropdown-item" data-toggle="modal" data-target="#filterModalId">Filter</a>
|
||||||
|
<a style="cursor:pointer"
|
||||||
|
class="dropdown-item" data-toggle="modal" data-target="#additionalEntriesModalId">Add Entry</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-3">
|
</form>
|
||||||
<input type="submit" value="Change Month" class="btn btn-success" style="margin-top:0px;">
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</form>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<!-- Add table-responsive for horizontal scroll -->
|
|
||||||
<div class="table-responsive">
|
|
||||||
<table id="drierTable" class="fht-table table-striped" style="font-size: small;">
|
|
||||||
<thead>
|
|
||||||
<tr>
|
|
||||||
|
|
||||||
|
|
||||||
<th class="celda_encabezado_general" style="padding: 10px;">Date</th>
|
|
||||||
<th class="celda_encabezado_general" style="padding: 10px;">Drier On Time</th>
|
|
||||||
<th class="celda_encabezado_general" style="padding: 10px;">Drier Off Time</th>
|
|
||||||
<th class="celda_encabezado_general" style="padding: 10px;">Running Hrs</th>
|
|
||||||
<th class="celda_encabezado_general" style="padding: 10px;">Supplier Name</th>
|
|
||||||
<th class="celda_encabezado_general" style="padding: 10px;">i/p Sand Moisture(%)</th>
|
|
||||||
<th class="celda_encabezado_general" style="padding: 10px;">Tot Gas Consumption</th>
|
|
||||||
<th class="celda_encabezado_general" style="padding: 10px;">Gas Pre Ton</th>
|
|
||||||
<th class="celda_encabezado_general" style="padding: 10px;">i/p Sand Qty</th>
|
|
||||||
<th class="celda_encabezado_general" style="padding: 10px;">Moisture Loss Qty</th>
|
|
||||||
<th class="celda_encabezado_general" style="padding: 10px;">Sand Dried Qty</th>
|
|
||||||
<th class="celda_encabezado_general" style="padding: 10px;">Qty Per Hrs</th>
|
|
||||||
<th class="celda_encabezado_general" style="padding: 10px;">Dust Qty</th>
|
|
||||||
<th class="celda_encabezado_general" style="padding: 10px;">Customer Name</th>
|
|
||||||
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
</thead>
|
<!-- Add table-responsive for horizontal scroll -->
|
||||||
<tbody style="background-color: #fff;">
|
<div class="table-responsive">
|
||||||
|
<table id="drierTable" class="fht-table table-striped" style="font-size: small;">
|
||||||
<?php $index = 0;
|
<thead>
|
||||||
$row = 0;
|
<tr>
|
||||||
foreach ($drierDetails as $a) {
|
|
||||||
$row++;
|
|
||||||
$index++; ?>
|
|
||||||
|
|
||||||
<tr id="<?php echo $row; ?>"
|
|
||||||
|
|
||||||
<?php
|
|
||||||
$date = DateTime::createFromFormat('Y-m-d', $a['date'])->format('Y-m-d');
|
|
||||||
$currentDate = date('Y-m-d');
|
|
||||||
if ($date === $currentDate) { echo 'style="background: #cef0ad;"'; }
|
|
||||||
?>
|
|
||||||
>
|
|
||||||
|
|
||||||
<td width="79" height="45" class="celda_normal"><?php echo DateTime::createFromFormat('Y-m-d', $a['date'])->format('d-m-Y'); ?></td>
|
<th class="celda_encabezado_general" style="padding: 10px;">Date</th>
|
||||||
<td class="celda_normal" >
|
<th class="celda_encabezado_general" style="padding: 10px;">Drier On Time</th>
|
||||||
<select class="timeDropdown drier_on_time" style="width: 100px;" >
|
<th class="celda_encabezado_general" style="padding: 10px;">Drier Off Time</th>
|
||||||
<option value="">Select</option>
|
<th class="celda_encabezado_general" style="padding: 10px;">Running Hrs</th>
|
||||||
<?php foreach ($timeDropdown as $key => $time) { ?>
|
<th class="celda_encabezado_general" style="padding: 10px;">Supplier Name</th>
|
||||||
<option value="<?= $time; ?>" <?php if($a['drier_on_time'] == $time){ echo 'selected'; } ?> ><?= $time; ?></option>
|
<th class="celda_encabezado_general" style="padding: 10px;">i/p Sand Moisture(%)</th>
|
||||||
<?php } ?>
|
<th class="celda_encabezado_general" style="padding: 10px;">Tot Gas Consumption</th>
|
||||||
</select>
|
<th class="celda_encabezado_general" style="padding: 10px;">Gas Per Ton</th>
|
||||||
</td>
|
<th class="celda_encabezado_general" style="padding: 10px;">i/p Sand Qty</th>
|
||||||
<td class="celda_normal" >
|
<th class="celda_encabezado_general" style="padding: 10px;">Moisture Loss Qty</th>
|
||||||
<select class="timeDropdown drier_off_time" style="width: 100px;">
|
<th class="celda_encabezado_general" style="padding: 10px;">Sand Dried Qty</th>
|
||||||
<option value="">Select</option>
|
<th class="celda_encabezado_general" style="padding: 10px;">Qty Per Hrs</th>
|
||||||
<?php foreach ($timeDropdown as $key => $time) { ?>
|
<th class="celda_encabezado_general" style="padding: 10px;">Dust Qty</th>
|
||||||
<option value="<?= $time; ?>" <?php if($a['drier_off_time'] == $time){ echo 'selected'; } ?> ><?= $time; ?></option>
|
<th class="celda_encabezado_general" style="padding: 10px;">Customer Name</th>
|
||||||
<?php } ?>
|
<th class="celda_encabezado_general" style="display:none;">id</th>
|
||||||
</select>
|
|
||||||
</td>
|
|
||||||
<td class="celda_normal">
|
|
||||||
<?php echo $a['drier_running_hours']; ?>
|
|
||||||
</td>
|
|
||||||
<td class="celda_normal" contenteditable="true">
|
|
||||||
<select class="timeDropdown supplier_name" style="width: 300px;">
|
|
||||||
<option value="">Select</option>
|
|
||||||
<?php foreach ($supplierData as $key => $value) { ?>
|
|
||||||
<option value="<?= $value->SupplierID; ?>" <?php if($a['supplier_name'] == $value->SupplierID){ echo 'selected'; } ?> ><?= $value->SupplierName; ?></option>
|
|
||||||
<?php } ?>
|
|
||||||
</select>
|
|
||||||
</td>
|
|
||||||
<td class="celda_normal" contenteditable="true" >
|
|
||||||
<?php echo $a['input_sand_moisture']; ?>
|
|
||||||
</td>
|
|
||||||
<td class="celda_normal" onkeyup="gasPerTon(this.parentNode.id,this.textContent);" contenteditable="true" >
|
|
||||||
<?php echo $a['total_gas_consumption']; ?>
|
|
||||||
</td>
|
|
||||||
<td class="celda_normal">
|
|
||||||
<?php echo $a['gas_per_ton']; ?>
|
|
||||||
</td>
|
|
||||||
<td class="celda_normal" onkeyup="moistureLossQty(this.parentNode.id,this.textContent);" contenteditable="true" >
|
|
||||||
<?php echo $a['input_sand_qty']; ?>
|
|
||||||
</td>
|
|
||||||
<td class="celda_normal" >
|
|
||||||
<?php echo $a['moisture_loss_qty']; ?>
|
|
||||||
</td>
|
|
||||||
<td class="celda_normal" onkeyup="gasPerTon(this.parentNode.id, this.textContent); moistureLossQty(this.parentNode.id, this.textContent); qtyPerHrs(this.parentNode.id, this.textContent)" contenteditable="true" >
|
|
||||||
<?php echo $a['sand_dried_qty']; ?>
|
|
||||||
</td>
|
|
||||||
<td class="celda_normal" >
|
|
||||||
<?php echo $a['qty_per_hours']; ?>
|
|
||||||
</td>
|
|
||||||
<td class="celda_normal" contenteditable="true" >
|
|
||||||
<?php echo $a['dust_qty']; ?>
|
|
||||||
</td>
|
|
||||||
<td class="celda_normal" contenteditable="true">
|
|
||||||
<?php echo $a['customer_name']; ?>
|
|
||||||
</td>
|
|
||||||
|
|
||||||
</tr>
|
</tr>
|
||||||
<?php } ?>
|
|
||||||
|
</thead>
|
||||||
|
<tbody style="background-color: #fff;">
|
||||||
|
|
||||||
|
<?php $index = 0;
|
||||||
|
$row = 0;
|
||||||
|
foreach ($drierDetails as $a) {
|
||||||
|
$row++;
|
||||||
|
$index++; ?>
|
||||||
|
|
||||||
|
<tr id="<?php echo $row; ?>"
|
||||||
|
|
||||||
|
<?php
|
||||||
|
$date = DateTime::createFromFormat('Y-m-d', $a['date'])->format('Y-m-d');
|
||||||
|
$currentDate = date('Y-m-d');
|
||||||
|
if ($date === $currentDate) {
|
||||||
|
echo 'style="background: #cef0ad;"';
|
||||||
|
}
|
||||||
|
?>>
|
||||||
|
|
||||||
|
<!-- td:eq(0) date -->
|
||||||
|
<td width="79" height="45" class="celda_normal"><?php echo DateTime::createFromFormat('Y-m-d', $a['date'])->format('d-m-Y'); ?></td>
|
||||||
|
|
||||||
|
|
||||||
</tbody>
|
<!-- td:eq(1) drier on time -->
|
||||||
</table>
|
<td class="celda_normal">
|
||||||
|
<select class="timeDropdown drier_on_time" style="width: 100px;">
|
||||||
|
<option value="">Select</option>
|
||||||
|
<?php foreach ($timeDropdown as $key => $time) { ?>
|
||||||
|
<option value="<?= $time; ?>" <?php if ($a['drier_on_time'] == $time) {
|
||||||
|
echo 'selected';
|
||||||
|
} ?>><?= $time; ?></option>
|
||||||
|
<?php } ?>
|
||||||
|
</select>
|
||||||
|
</td>
|
||||||
|
|
||||||
|
<!-- td:eq(2) drier off time -->
|
||||||
|
<td class="celda_normal">
|
||||||
|
<select class="timeDropdown drier_off_time" style="width: 100px;">
|
||||||
|
<option value="">Select</option>
|
||||||
|
<?php foreach ($timeDropdown as $key => $time) { ?>
|
||||||
|
<option value="<?= $time; ?>" <?php if ($a['drier_off_time'] == $time) {
|
||||||
|
echo 'selected';
|
||||||
|
} ?>><?= $time; ?></option>
|
||||||
|
<?php } ?>
|
||||||
|
</select>
|
||||||
|
</td>
|
||||||
|
|
||||||
|
<!-- td:eq(3) drier_running_hours-->
|
||||||
|
<td class="celda_normal">
|
||||||
|
<?php echo $a['drier_running_hours']; ?>
|
||||||
|
</td>
|
||||||
|
|
||||||
|
<!-- td:eq(4) supplier_name -->
|
||||||
|
<td class="celda_normal" contenteditable="true">
|
||||||
|
<select class="timeDropdown supplier_name" style="width: 300px;">
|
||||||
|
<option value="">Select</option>
|
||||||
|
<?php foreach ($supplierData as $key => $value) { ?>
|
||||||
|
<option value="<?= $value->SupplierID; ?>" <?php if ($a['supplier_name'] == $value->SupplierID) {
|
||||||
|
echo 'selected';
|
||||||
|
} ?>><?= $value->SupplierName; ?></option>
|
||||||
|
<?php } ?>
|
||||||
|
</select>
|
||||||
|
</td>
|
||||||
|
|
||||||
|
<!-- td:eq(5) input_sand_moisture -->
|
||||||
|
<td class="celda_normal" contenteditable="true">
|
||||||
|
<?php echo $a['input_sand_moisture']; ?>
|
||||||
|
</td>
|
||||||
|
|
||||||
|
<!-- td:eq(6) total_gas_consumption -->
|
||||||
|
<td class="celda_normal" oninput="gasPerTon(this);
|
||||||
|
moistureLossQty(this);
|
||||||
|
qtyPerHrs(this)" contenteditable="true">
|
||||||
|
<?php echo $a['total_gas_consumption']; ?>
|
||||||
|
</td>
|
||||||
|
|
||||||
|
<!-- td:eq(7) gas_per_ton -->
|
||||||
|
<td class="celda_normal">
|
||||||
|
<?php echo $a['gas_per_ton']; ?>
|
||||||
|
</td>
|
||||||
|
|
||||||
|
<!-- td:eq(8) input_sand_qty -->
|
||||||
|
<td class="celda_normal" oninput="gasPerTon(this);
|
||||||
|
moistureLossQty(this);
|
||||||
|
qtyPerHrs(this)" contenteditable="true">
|
||||||
|
<?php echo $a['input_sand_qty']; ?>
|
||||||
|
</td>
|
||||||
|
|
||||||
|
<!-- td:eq(9) moisture_loss_qty -->
|
||||||
|
<td class="celda_normal">
|
||||||
|
<?php echo $a['moisture_loss_qty']; ?>
|
||||||
|
</td>
|
||||||
|
|
||||||
|
<!-- td:eq(10) sand_dried_qty -->
|
||||||
|
<td class="celda_normal" oninput="gasPerTon(this);
|
||||||
|
moistureLossQty(this);
|
||||||
|
qtyPerHrs(this)" contenteditable="true">
|
||||||
|
<?php echo $a['sand_dried_qty']; ?>
|
||||||
|
</td>
|
||||||
|
|
||||||
|
<!-- td:eq(11) qty_per_hours -->
|
||||||
|
<td class="celda_normal">
|
||||||
|
<?php echo $a['qty_per_hours']; ?>
|
||||||
|
</td>
|
||||||
|
|
||||||
|
<!-- td:eq(12) dust_qty -->
|
||||||
|
<td class="celda_normal" contenteditable="true">
|
||||||
|
<?php echo $a['dust_qty']; ?>
|
||||||
|
</td>
|
||||||
|
|
||||||
|
<!-- td:eq(13) customer_name -->
|
||||||
|
<td class="celda_normal" contenteditable="true">
|
||||||
|
<?php echo $a['customer_name']; ?>
|
||||||
|
</td>
|
||||||
|
|
||||||
|
<!-- td:eq(14) id -->
|
||||||
|
<td class="celda_normal" style="display:none;">
|
||||||
|
<?php echo $a['id']??''; ?>
|
||||||
|
</td>
|
||||||
|
|
||||||
|
</tr>
|
||||||
|
<?php } ?>
|
||||||
|
|
||||||
|
|
||||||
</div><!-- End table-responsive -->
|
</tbody>
|
||||||
|
</table>
|
||||||
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-md-12 text-right">
|
</div><!-- End table-responsive -->
|
||||||
<input type="button" class="btn btn-success" id="save" value="save">
|
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-12 text-right">
|
||||||
|
<input type="button" class="btn btn-success" id="save" value="save">
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div> <!-- End card-body -->
|
</div> <!-- End card-body -->
|
||||||
</div> <!-- End card -->
|
</div> <!-- End card -->
|
||||||
</div> <!-- End col -->
|
</div> <!-- End col -->
|
||||||
@ -375,38 +420,205 @@ $datefordropdown = format_date($datefordropdown, 0, 'M-Y');
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<!-- modal section -->
|
||||||
|
|
||||||
|
|
||||||
|
<div class="modal fade" id="filterModalId" tabindex="-1" role="dialog" aria-labelledby="filterModalLabelId" aria-hidden="true">
|
||||||
|
<div class="modal-dialog modal-lg">
|
||||||
|
<div class="modal-content">
|
||||||
|
<div class="modal-header">
|
||||||
|
<h4 class="modal-title" id="filterModalLabelId">Filter Options</h4>
|
||||||
|
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||||
|
</div>
|
||||||
|
<div class="modal-body">
|
||||||
|
<div class="row">
|
||||||
|
|
||||||
|
<!-- Date Filter -->
|
||||||
|
<div class="col-md-6">
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="fromDateFilter">Select Date</label>
|
||||||
|
<select id="fromDateFilter" name="fromDateFilter" class="form-control">
|
||||||
|
<?php foreach ($drierDetails as $a) :
|
||||||
|
$selectDate = DateTime::createFromFormat('Y-m-d', $a['date'])->format('d-m-Y'); ?>
|
||||||
|
<option value="<?= $selectDate ?>"><?= $selectDate ?></option>
|
||||||
|
|
||||||
|
<?php endforeach; ?>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Date Filter -->
|
||||||
|
<div class="col-md-6">
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="toDateFilter">Select Date</label>
|
||||||
|
<select id="toDateFilter" name="toDateFilter" class="form-control">
|
||||||
|
<?php foreach ($drierDetails as $a) :
|
||||||
|
$selectDate = DateTime::createFromFormat('Y-m-d', $a['date'])->format('d-m-Y'); ?>
|
||||||
|
<option value="<?= $selectDate ?>"><?= $selectDate ?></option>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<button class="btn btn-primary float-right" onclick="filterDate()">Filter</button>
|
||||||
|
</div>
|
||||||
|
</div><!-- /.modal-content -->
|
||||||
|
</div><!-- /.modal-dialog -->
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- additional entries modal -->
|
||||||
|
<div class="modal fade" id="additionalEntriesModalId" tabindex="-1" role="dialog" aria-labelledby="additionalEntriesIdModalLabelId" aria-hidden="true">
|
||||||
|
<div class="modal-dialog modal-xl">
|
||||||
|
<div class="modal-content">
|
||||||
|
<div class="modal-header">
|
||||||
|
<h4 class="modal-title" id="additionalEntriesIdModalLabelId">Additional Entries</h4>
|
||||||
|
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||||
|
</div>
|
||||||
|
<div class="modal-body">
|
||||||
|
|
||||||
|
<form action="<?php echo base_url("/addOrEditdrierMachineDetails")?>" method="POST">
|
||||||
|
<!--14 -->
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-3">
|
||||||
|
<label class="form" for="additionalEntryDateId">Date</label>
|
||||||
|
<input type="date" class="form-control" id="additionalEntryDateId" name="Date" value="">
|
||||||
|
</div>
|
||||||
|
<div class="col-md-3">
|
||||||
|
<label class="form" for="additionalEntryDrierOnTimeId">Drier On Time</label>
|
||||||
|
|
||||||
|
<select onchange="calculateMachineRunningHrs()"
|
||||||
|
class="timeDropdown" style="width: 100px;"
|
||||||
|
id="additionalEntryDrierOnTimeId" name="Drier On Time">
|
||||||
|
<option value="">Select</option>
|
||||||
|
<?php foreach ($timeDropdown as $key => $time) { ?>
|
||||||
|
<option value="<?= $time; ?>"> <?= $time; ?></option>
|
||||||
|
<?php } ?>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-3">
|
||||||
|
<label class="form" for="additionalEntryDrierOffTimeId">Drier Off Time</label>
|
||||||
|
|
||||||
|
<select onchange="calculateMachineRunningHrs()"
|
||||||
|
class="timeDropdown " style="width: 100px;"
|
||||||
|
id="additionalEntryDrierOffTimeId" name="Drier Off Time">
|
||||||
|
<option value="">Select</option>
|
||||||
|
<?php foreach ($timeDropdown as $key => $time) { ?>
|
||||||
|
<option value="<?= $time; ?>"> <?= $time; ?></option>
|
||||||
|
<?php } ?>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-3">
|
||||||
|
<label class="form" for="additionalEntryRunningHrsId">Running hrs</label>
|
||||||
|
<input type="text" class="form-control" id="additionalEntryRunningHrsId" name="Running Hrs" value=""
|
||||||
|
readonly>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="row mt-2">
|
||||||
|
<div class="col-md-3">
|
||||||
|
<label class="form" for="additionalEntryInputSandMoistureId">Input Sand Moisture (%)</label>
|
||||||
|
<input type="text" class="form-control" id="additionalEntryInputSandMoistureId" name="i/p Sand Moisture(%)" value="">
|
||||||
|
</div>
|
||||||
|
<div class="col-md-3">
|
||||||
|
<label class="form" for="additionalEntryTotalGasConsumptionId">Total Gas Consumption</label>
|
||||||
|
<input onchange="additionalEntryGasPerTon(); additionalEntryMoistureLossQty(); additionalEntryQtyPerHrs(); "
|
||||||
|
type="text" class="form-control" id="additionalEntryTotalGasConsumptionId" name="Tot Gas Consumption" value="">
|
||||||
|
</div>
|
||||||
|
<div class="col-md-3">
|
||||||
|
<label class="form" for="additionalEntrySandDriedQtyId">Sand Dried Qty</label>
|
||||||
|
<input onchange="additionalEntryGasPerTon(); additionalEntryMoistureLossQty(); additionalEntryQtyPerHrs(); "
|
||||||
|
type="text" class="form-control" id="additionalEntrySandDriedQtyId" name="Sand Dried Qty" value="">
|
||||||
|
</div>
|
||||||
|
<div class="col-md-3">
|
||||||
|
<label class="form" for="additionalEntryGasPerTonId">Gas per Ton</label>
|
||||||
|
<input type="text" class="form-control" id="additionalEntryGasPerTonId" name="Gas Per Ton" value=""
|
||||||
|
readonly>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="row mt-2">
|
||||||
|
<div class="col-md-3">
|
||||||
|
<label class="form" for="additionalEntryDustQtyId">Dust Qty</label>
|
||||||
|
<input type="text" class="form-control" id="additionalEntryDustQtyId" name="Dust Qty" value="">
|
||||||
|
</div>
|
||||||
|
<div class="col-md-3">
|
||||||
|
<label class="form" for="additionalEntryInputSandQtyId">Input sand Quantity</label>
|
||||||
|
<input onchange="additionalEntryGasPerTon(); additionalEntryMoistureLossQty(); additionalEntryQtyPerHrs(); "
|
||||||
|
type="text" class="form-control" id="additionalEntryInputSandQtyId" name="i/p Sand Qty" value="">
|
||||||
|
</div>
|
||||||
|
<div class="col-md-3">
|
||||||
|
<label class="form" for="additionalEntryMoistureLossQtyId">Moisture Loss Qty</label>
|
||||||
|
<input type="text" class="form-control" id="additionalEntryMoistureLossQtyId" name="Moisture Loss Qty" value=""
|
||||||
|
readonly>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-3">
|
||||||
|
<label class="form" for="additionalEntryQtyPerHoursId">Qty per Hours</label>
|
||||||
|
<input type="text" class="form-control" id="additionalEntryQtyPerHoursId" name="Qty Per Hrs" value=""
|
||||||
|
readonly>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="row mt-2">
|
||||||
|
<div class="col-md-3">
|
||||||
|
<label class="form" for="additionalEntrySupplierNameId">Supplier Name</label>
|
||||||
|
<select class="timeDropdown supplier_name" style="width: 300px;"
|
||||||
|
id="additionalEntrySupplierNameId" name="Supplier Name">
|
||||||
|
<option value="">Select</option>
|
||||||
|
<?php foreach ($supplierData as $key => $value) { ?>
|
||||||
|
<option value="<?= $value->SupplierID; ?>"> <?= $value->SupplierName; ?> </option>
|
||||||
|
<?php } ?>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-3">
|
||||||
|
<label class="form" for="additionalEntryCustomerNameId">Customer Name</label>
|
||||||
|
<input type="text" class="form-control" id="additionalEntryCustomerNameId" name="Customer Name" value="">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<button type="submit" class="btn btn-primary float-right">Add</button>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- hidden fields -->
|
||||||
|
|
||||||
|
</form>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div><!-- /.modal-content -->
|
||||||
|
</div><!-- /.modal-dialog -->
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<!-- /.modal -->
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
$(document).ready(function() {
|
||||||
|
|
||||||
$(document).ready(function()
|
|
||||||
{
|
|
||||||
|
|
||||||
$('.timeDropdown').select2({
|
$('.timeDropdown').select2({
|
||||||
placeholder: "Select",
|
placeholder: "Select",
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$('#save').click(function() {
|
$('#save').click(function() {
|
||||||
|
|
||||||
var alldata = $("#drierTable").tableToJSON();
|
var alldata = $("#drierTable").tableToJSON();
|
||||||
|
|
||||||
$('#drierTable tbody tr').each(function (index) {
|
$('#drierTable tbody tr').each(function(index) {
|
||||||
|
|
||||||
let row = alldata[index];
|
let row = alldata[index];
|
||||||
|
|
||||||
// Get the selected values from dropdowns
|
// Get the selected values from dropdowns
|
||||||
row['Drier On Time'] = $(this).find('.drier_on_time').val();
|
row['Drier On Time'] = $(this).find('.drier_on_time').val();
|
||||||
row['Drier Off Time'] = $(this).find('.drier_off_time').val();
|
row['Drier Off Time'] = $(this).find('.drier_off_time').val();
|
||||||
row['Supplier Name'] = $(this).find('.supplier_name').val();
|
row['Supplier Name'] = $(this).find('.supplier_name').val();
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
alldata = JSON.stringify(alldata);
|
alldata = JSON.stringify(alldata);
|
||||||
|
|
||||||
@ -420,29 +632,39 @@ $datefordropdown = format_date($datefordropdown, 0, 'M-Y');
|
|||||||
|
|
||||||
success: function(data) {
|
success: function(data) {
|
||||||
if (data) {
|
if (data) {
|
||||||
|
|
||||||
$('#loader').hide();
|
$('#loader').hide();
|
||||||
alert(data);
|
alert(data);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
},
|
||||||
|
error:function(error){
|
||||||
|
|
||||||
|
console.log("error occured", error);
|
||||||
|
},
|
||||||
|
complete:function()
|
||||||
|
{
|
||||||
|
$('#loader').hide();
|
||||||
|
console.log('ajax call is completed..!!');
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
// time diff finding script start
|
// time diff finding script start
|
||||||
$('.drier_on_time').change(function() {
|
$('.drier_on_time').change(function() {
|
||||||
|
|
||||||
var tr = $(this).closest('tr');
|
var tr = $(this).closest('tr');
|
||||||
|
|
||||||
var drierOnTime = $(this).val();
|
var drierOnTime = $(this).val();
|
||||||
var drierOffTime = tr.find('.drier_off_time').val();
|
var drierOffTime = tr.find('.drier_off_time').val();
|
||||||
|
|
||||||
if(drierOnTime != '' && drierOffTime != ''){
|
if (drierOnTime != '' && drierOffTime != '') {
|
||||||
|
|
||||||
|
|
||||||
const startDate = new Date(`1970-01-01T${convertTo24Hour(drierOnTime)}`);
|
const startDate = new Date(`1970-01-01T${convertTo24Hour(drierOnTime)}`);
|
||||||
const endDate = new Date(`1970-01-01T${convertTo24Hour(drierOffTime)}`);
|
const endDate = new Date(`1970-01-01T${convertTo24Hour(drierOffTime)}`);
|
||||||
@ -463,18 +685,22 @@ $datefordropdown = format_date($datefordropdown, 0, 'M-Y');
|
|||||||
|
|
||||||
tr.find('td:eq(3)').text(totalHours);
|
tr.find('td:eq(3)').text(totalHours);
|
||||||
|
|
||||||
|
gasPerTon(this);
|
||||||
|
moistureLossQty(this);
|
||||||
|
qtyPerHrs(this);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
$('.drier_off_time').change(function() {
|
$('.drier_off_time').change(function() {
|
||||||
|
|
||||||
var tr = $(this).closest('tr');
|
var tr = $(this).closest('tr');
|
||||||
|
|
||||||
var drierOffTime = $(this).val();
|
var drierOffTime = $(this).val();
|
||||||
var drierOnTime = tr.find('.drier_on_time').val();
|
var drierOnTime = tr.find('.drier_on_time').val();
|
||||||
|
|
||||||
if(drierOnTime != '' && drierOffTime != ''){
|
if (drierOnTime != '' && drierOffTime != '') {
|
||||||
|
|
||||||
|
|
||||||
const startDate = new Date(`1970-01-01T${convertTo24Hour(drierOnTime)}`);
|
const startDate = new Date(`1970-01-01T${convertTo24Hour(drierOnTime)}`);
|
||||||
const endDate = new Date(`1970-01-01T${convertTo24Hour(drierOffTime)}`);
|
const endDate = new Date(`1970-01-01T${convertTo24Hour(drierOffTime)}`);
|
||||||
@ -495,90 +721,221 @@ $datefordropdown = format_date($datefordropdown, 0, 'M-Y');
|
|||||||
|
|
||||||
tr.find('td:eq(3)').text(totalHours);
|
tr.find('td:eq(3)').text(totalHours);
|
||||||
|
|
||||||
|
gasPerTon(this);
|
||||||
|
moistureLossQty(this);
|
||||||
|
qtyPerHrs(this);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
function convertTo24Hour(time)
|
|
||||||
{
|
|
||||||
const [timePart, modifier] = time.split(" ");
|
|
||||||
let [hours, minutes] = timePart.split(":");
|
|
||||||
|
|
||||||
// Convert hours to a number
|
|
||||||
hours = parseInt(hours, 10);
|
|
||||||
|
|
||||||
// Adjust hours based on AM/PM
|
|
||||||
if (modifier === "PM" && hours < 12) {
|
|
||||||
hours += 12;
|
|
||||||
} else if (modifier === "AM" && hours === 12) {
|
|
||||||
hours = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
return `${String(hours).padStart(2, '0')}:${minutes}`;
|
|
||||||
}
|
|
||||||
// time diff finding script end
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
function gasPerTon(value) {
|
||||||
|
|
||||||
function gasPerTon(parentId , textContent) {
|
let tr = $(value).closest('tr');
|
||||||
var tr = $('#' + parentId);
|
var totalGasConsumption = tr.find('td:eq(6)').text();
|
||||||
var totalGasConsumption = tr.find('td:eq(7)').text();
|
var sandDriedQty = tr.find('td:eq(10)').text();
|
||||||
var sandDriedQty = tr.find('td:eq(11)').text();
|
if (totalGasConsumption != '' && sandDriedQty != '') {
|
||||||
if(totalGasConsumption != '' && sandDriedQty != '')
|
var gasPerTon = parseFloat(totalGasConsumption) / parseFloat(sandDriedQty);
|
||||||
{
|
|
||||||
var gasPerTon = totalGasConsumption / sandDriedQty;
|
|
||||||
|
|
||||||
if(gasPerTon != NaN && gasPerTon != Infinity)
|
if (gasPerTon && gasPerTon != NaN && gasPerTon != Infinity)
|
||||||
tr.find('td:eq(8)').text(gasPerTon.toFixed(1));
|
tr.find('td:eq(7)').text(gasPerTon.toFixed(2));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}else{
|
|
||||||
tr.find('td:eq(8)').text(0.0);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function moistureLossQty(value) {
|
||||||
|
|
||||||
|
let tr = $(value).closest('tr');
|
||||||
|
var inputSandQty = tr.find('td:eq(8)').text();
|
||||||
|
var sandDriedQty = tr.find('td:eq(10)').text();
|
||||||
|
|
||||||
|
if (inputSandQty != '' && sandDriedQty != '') {
|
||||||
|
|
||||||
|
var moistureLossQty = parseFloat(inputSandQty) - parseFloat(sandDriedQty);
|
||||||
|
|
||||||
|
if (moistureLossQty != NaN && moistureLossQty != Infinity)
|
||||||
|
tr.find('td:eq(9)').text(moistureLossQty.toFixed(2));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
function qtyPerHrs(value) {
|
||||||
|
|
||||||
|
let tr = $(value).closest('tr');
|
||||||
|
var drierRunninhHrs = tr.find('td:eq(3)').text();
|
||||||
|
var sandDriedQty = tr.find('td:eq(10)').text();
|
||||||
|
|
||||||
|
if (drierRunninhHrs != '' && sandDriedQty != '') {
|
||||||
|
|
||||||
|
var qtyPerHrs = parseFloat(sandDriedQty) / parseFloat(drierRunninhHrs);
|
||||||
|
|
||||||
|
if (qtyPerHrs && qtyPerHrs != NaN && qtyPerHrs != Infinity)
|
||||||
|
tr.find('td:eq(11)').text(qtyPerHrs.toFixed(3));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function convertTo24Hour(time) {
|
||||||
|
const [timePart, modifier] = time.split(" ");
|
||||||
|
let [hours, minutes] = timePart.split(":");
|
||||||
|
|
||||||
|
// Convert hours to a number
|
||||||
|
hours = parseInt(hours, 10);
|
||||||
|
|
||||||
|
// Adjust hours based on AM/PM
|
||||||
|
if (modifier === "PM" && hours < 12) {
|
||||||
|
hours += 12;
|
||||||
|
} else if (modifier === "AM" && hours === 12) {
|
||||||
|
hours = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
return `${String(hours).padStart(2, '0')}:${minutes}`;
|
||||||
|
}
|
||||||
|
// time diff finding script end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
function calculateMachineRunningHrs() {
|
||||||
|
|
||||||
|
let dreierMachineOnTime = $('#additionalEntryDrierOnTimeId').val();
|
||||||
|
let dreierMachineOffTime = $('#additionalEntryDrierOffTimeId').val();
|
||||||
|
|
||||||
|
|
||||||
|
if (dreierMachineOnTime != '' && dreierMachineOffTime != '') {
|
||||||
|
|
||||||
|
|
||||||
|
const startDate = new Date(`1970-01-01T${convertTo24Hour(dreierMachineOnTime)}`);
|
||||||
|
const endDate = new Date(`1970-01-01T${convertTo24Hour(dreierMachineOffTime)}`);
|
||||||
|
|
||||||
|
// Handle the case where end time is on the next day
|
||||||
|
if (endDate < startDate) {
|
||||||
|
endDate.setDate(endDate.getDate() + 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Calculate the difference in milliseconds
|
||||||
|
const diffInMs = endDate - startDate;
|
||||||
|
|
||||||
|
// Convert milliseconds to hours and minutes
|
||||||
|
const hours = Math.floor(diffInMs / (1000 * 60 * 60));
|
||||||
|
const minutes = Math.floor((diffInMs % (1000 * 60 * 60)) / (1000 * 60));
|
||||||
|
|
||||||
|
const totalHours = hours + (minutes / 60);
|
||||||
|
|
||||||
|
console.log('working here', 'totalHours', totalHours);
|
||||||
|
|
||||||
|
if (totalHours != NaN && totalHours != Infinity) {
|
||||||
|
$('#additionalEntryRunningHrsId').val(totalHours);
|
||||||
|
additionalEntryGasPerTon();
|
||||||
|
additionalEntryMoistureLossQty();
|
||||||
|
additionalEntryQtyPerHrs();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
function additionalEntryGasPerTon() {
|
||||||
|
|
||||||
|
var totalGasConsumption = $('#additionalEntryTotalGasConsumptionId').val();
|
||||||
|
var sandDriedQty = $('#additionalEntrySandDriedQtyId').val();
|
||||||
|
if (totalGasConsumption != '' && sandDriedQty != '') {
|
||||||
|
var gasPerTon = parseFloat(totalGasConsumption) / parseFloat(sandDriedQty);
|
||||||
|
|
||||||
|
if (gasPerTon && gasPerTon != NaN && gasPerTon != Infinity)
|
||||||
|
$('#additionalEntryGasPerTonId').val(gasPerTon);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
function additionalEntryMoistureLossQty(value) {
|
||||||
|
|
||||||
|
var inputSandQty = $('#additionalEntryInputSandQtyId').val();
|
||||||
|
var sandDriedQty = $('#additionalEntrySandDriedQtyId').val();
|
||||||
|
|
||||||
|
if (inputSandQty != '' && sandDriedQty != '') {
|
||||||
|
|
||||||
|
var moistureLossQty = parseFloat(inputSandQty) - parseFloat(sandDriedQty);
|
||||||
|
|
||||||
|
if (moistureLossQty != NaN && moistureLossQty != Infinity)
|
||||||
|
$('#additionalEntryMoistureLossQtyId').val(moistureLossQty);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
function additionalEntryQtyPerHrs(value) {
|
||||||
|
|
||||||
|
var drierRunninhHrs = $('#additionalEntryRunningHrsId').val();
|
||||||
|
var sandDriedQty = $('#additionalEntrySandDriedQtyId').val();
|
||||||
|
|
||||||
|
if (drierRunninhHrs != '' && sandDriedQty != '') {
|
||||||
|
|
||||||
|
var qtyPerHrs = parseFloat(sandDriedQty) / parseFloat(drierRunninhHrs);
|
||||||
|
|
||||||
|
if (qtyPerHrs && qtyPerHrs != NaN && qtyPerHrs != Infinity)
|
||||||
|
$('#additionalEntryQtyPerHoursId').val((qtyPerHrs.toFixed(2)));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
|
||||||
|
<script>
|
||||||
|
|
||||||
|
function filterDate(){
|
||||||
|
|
||||||
|
let fromDate = $('#fromDateFilter').val(); //01-12-2024
|
||||||
|
let toDate = $('#toDateFilter').val(); //05-12-2024
|
||||||
|
|
||||||
|
$('#drierTable').find('tbody tr').each(function() {
|
||||||
|
const rowCells = $(this).find('td');
|
||||||
|
let tableDate = rowCells.eq(0).text(); // prints every date in the month from 1 to 30 .
|
||||||
|
let result = checkDateRange(fromDate,toDate,tableDate);
|
||||||
|
if (result) {
|
||||||
|
$(this).show(); // Show the row if the date is within range
|
||||||
|
} else {
|
||||||
|
$(this).hide(); // Hide the row if the date is out of range
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
$('#filterModalId').modal('hide');
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function checkDateRange(fromDate, toDate, tableDate) {
|
||||||
|
// Convert the dates to a comparable format (YYYY-MM-DD)
|
||||||
|
let from = convertToDate(fromDate);
|
||||||
|
let to = convertToDate(toDate);
|
||||||
|
let table = convertToDate(tableDate);
|
||||||
|
|
||||||
|
// Return true if the table date is within the range
|
||||||
|
return table >= from && table <= to;
|
||||||
}
|
}
|
||||||
|
|
||||||
function moistureLossQty(parentId , textContent) {
|
function convertToDate(dateString) {
|
||||||
var tr = $('#' + parentId);
|
// Convert from DD-MM-YYYY to YYYY-MM-DD for comparison
|
||||||
var inputSandQty = tr.find('td:eq(9)').text();
|
let parts = dateString.split('-');
|
||||||
var sandDriedQty = tr.find('td:eq(11)').text();
|
return new Date(parts[2], parts[1] - 1, parts[0]); // Year, Month (0-based), Day
|
||||||
if(inputSandQty != '' && sandDriedQty != '')
|
|
||||||
{
|
|
||||||
var moistureLossQty = inputSandQty - sandDriedQty;
|
|
||||||
|
|
||||||
if(moistureLossQty != NaN && moistureLossQty != Infinity)
|
|
||||||
tr.find('td:eq(10)').text(moistureLossQty.toFixed(1));
|
|
||||||
|
|
||||||
}else{
|
|
||||||
tr.find('td:eq(10)').text(0.0);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function qtyPerHrs(parentId , textContent) {
|
|
||||||
var tr = $('#' + parentId);
|
|
||||||
var drierRunninhHrs = tr.find('td:eq(4)').text();
|
|
||||||
var sandDriedQty = tr.find('td:eq(11)').text();
|
|
||||||
if(drierRunninhHrs != '' && sandDriedQty != '')
|
|
||||||
{
|
|
||||||
var qtyPerHrs = sandDriedQty / drierRunninhHrs;
|
|
||||||
|
|
||||||
if(qtyPerHrs != NaN && qtyPerHrs != Infinity)
|
|
||||||
tr.find('td:eq(12)').text(qtyPerHrs.toFixed(3));
|
|
||||||
|
|
||||||
}else{
|
|
||||||
tr.find('td:eq(12)').text(0.000);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
@ -163,7 +163,7 @@ if (!empty($assetList)) {
|
|||||||
|
|
||||||
<div class="col-md-3">
|
<div class="col-md-3">
|
||||||
<label for="AssetName">Asset Name <span class="badge">*</span></label>
|
<label for="AssetName">Asset Name <span class="badge">*</span></label>
|
||||||
<input type="text" class="form-control" id="AssetName" name="AssetName" value="<?php echo $AssetName; ?>" style="text-transform:uppercase;" required>
|
<input type="text" class="form-control" id="AssetName" name="AssetName" value="<?php echo $AssetName; ?>" required>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-3">
|
<div class="col-md-3">
|
||||||
<label for="Description">Asset Description <span class="badge">*</span></label>
|
<label for="Description">Asset Description <span class="badge">*</span></label>
|
||||||
@ -428,14 +428,15 @@ if (!empty($assetList)) {
|
|||||||
|
|
||||||
$('#AssetName').on('change',function(){
|
$('#AssetName').on('change',function(){
|
||||||
|
|
||||||
let assetName = $(this).val();
|
let assetId = $('#AssetCode').val();
|
||||||
|
let assetName = $(this).val().trim();
|
||||||
|
|
||||||
$('#loader').show();
|
$('#loader').show();
|
||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type:'POST',
|
type:'POST',
|
||||||
url:'<?php echo base_url()?>assetdetails/checkAssetName',
|
url:'<?php echo base_url()?>assetdetails/checkAssetName',
|
||||||
data:{assetName},
|
data:{assetId,assetName},
|
||||||
success: function(data){
|
success: function(data){
|
||||||
if(data && data.length>0){
|
if(data && data.length>0){
|
||||||
let IsActive = data[0].IsActive;
|
let IsActive = data[0].IsActive;
|
||||||
@ -452,7 +453,7 @@ if (!empty($assetList)) {
|
|||||||
},
|
},
|
||||||
error: function(error){
|
error: function(error){
|
||||||
//error
|
//error
|
||||||
console.error('error ocurred' + error);
|
console.error( error);
|
||||||
},
|
},
|
||||||
complete :function (){
|
complete :function (){
|
||||||
$('#loader').hide();
|
$('#loader').hide();
|
||||||
|
|||||||
@ -440,18 +440,20 @@ if ($total <= $reorder) {
|
|||||||
|
|
||||||
$('#MaterialName').change(function() {
|
$('#MaterialName').change(function() {
|
||||||
|
|
||||||
var materialname = $('#MaterialName').val();
|
var materialName = $('#MaterialName').val();
|
||||||
|
var materialCode = $('#RMcode').val();
|
||||||
|
|
||||||
if(materialname == ''){
|
if(materialName == ''){
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var material = materialname.replace(/ /g, '');
|
var material = materialName.replace(/ /g, '');
|
||||||
|
|
||||||
$('#loader').show();
|
$('#loader').show();
|
||||||
$.ajax({
|
$.ajax({
|
||||||
data: {
|
data: {
|
||||||
id: material
|
materialCode,
|
||||||
|
materialName
|
||||||
},
|
},
|
||||||
type: "POST",
|
type: "POST",
|
||||||
url: "<?php echo base_url(); ?>materialExist",
|
url: "<?php echo base_url(); ?>materialExist",
|
||||||
|
|||||||
@ -596,16 +596,19 @@ if (!empty($supplier)) {
|
|||||||
|
|
||||||
//Call to ajax existing PAN
|
//Call to ajax existing PAN
|
||||||
$('#supplierName').change(function () {
|
$('#supplierName').change(function () {
|
||||||
var suppliername = $('#supplierName').val();
|
var supplierName = $('#supplierName').val().trim();
|
||||||
var supplier = suppliername.replace(/ /g, '');
|
var supplierId = $('#SupplierID').val();
|
||||||
|
|
||||||
$('#loader').show();
|
$('#loader').show();
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: "POST",
|
type: "POST",
|
||||||
url: "<?= base_url() . 'supplierExist' ?>",
|
url: "<?= base_url() . 'supplierExist' ?>",
|
||||||
data: {
|
data: {
|
||||||
id: supplier
|
supplierId ,
|
||||||
|
supplierName
|
||||||
},
|
},
|
||||||
success: function (data) {
|
success: function (data) {
|
||||||
|
console.log(data)
|
||||||
var count = data.length;
|
var count = data.length;
|
||||||
if (count >= 1) {
|
if (count >= 1) {
|
||||||
$('#loader').hide();
|
$('#loader').hide();
|
||||||
@ -618,21 +621,16 @@ if (!empty($supplier)) {
|
|||||||
$.each(data, function (i, obj) {
|
$.each(data, function (i, obj) {
|
||||||
related_supplier += obj.SupplierID + " - " + obj.SupplierName + " - " + obj.Address + "\n";
|
related_supplier += obj.SupplierID + " - " + obj.SupplierName + " - " + obj.Address + "\n";
|
||||||
});
|
});
|
||||||
alert("'" + suppliername + "' - supplier details are , " + " \n \n" + related_supplier);
|
alert("'" + supplierName + "' - supplier details are , " + " \n \n" + related_supplier);
|
||||||
$("#supplierName").val('');
|
$("#supplierName").val('');
|
||||||
$("#supplierName").focus();
|
$("#supplierName").focus();
|
||||||
} else {
|
} else {
|
||||||
$('#loader').hide();
|
$('#loader').hide();
|
||||||
//4Debug
|
|
||||||
// alert('This is New Supplier! ');
|
|
||||||
}
|
}
|
||||||
//4Debug
|
|
||||||
//console.log(data);
|
|
||||||
},
|
},
|
||||||
error: function (error) {
|
error: function (error) {
|
||||||
$('#loader').hide();
|
$('#loader').hide();
|
||||||
//4Debug
|
|
||||||
// alert("Error Occur");
|
|
||||||
console.error("an error occur supplierExist", error)
|
console.error("an error occur supplierExist", error)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -496,7 +496,10 @@ if (!empty($master)) {
|
|||||||
$('#ConfigName').change(function () {
|
$('#ConfigName').change(function () {
|
||||||
$('#loader').show();
|
$('#loader').show();
|
||||||
$.ajax({
|
$.ajax({
|
||||||
data: { configName: $('#ConfigName').val() },
|
data: {
|
||||||
|
configName: $('#ConfigName').val().trim(),
|
||||||
|
configId : $('#ConfigId').val().trim()
|
||||||
|
},
|
||||||
type: 'POST',
|
type: 'POST',
|
||||||
url: "<?php echo base_url(); ?>configurationctrl/configNameCheck",
|
url: "<?php echo base_url(); ?>configurationctrl/configNameCheck",
|
||||||
success: function (data) {
|
success: function (data) {
|
||||||
|
|||||||
@ -168,4 +168,43 @@
|
|||||||
<!-- end row -->
|
<!-- end row -->
|
||||||
</div> <!-- container -->
|
</div> <!-- container -->
|
||||||
</div> <!-- content -->
|
</div> <!-- content -->
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<script>
|
||||||
|
|
||||||
|
$("#DepartmentName").on('change',function(){
|
||||||
|
let departmentName = $("#DepartmentName").val().trim();
|
||||||
|
let depCode =$("#DEPCode").val();
|
||||||
|
$('#loader').show();
|
||||||
|
$.ajax({
|
||||||
|
type:"POST",
|
||||||
|
data:{departmentName,depCode},
|
||||||
|
url:"<?php echo base_url();?>checkDepartmentName",
|
||||||
|
success:function(data){
|
||||||
|
|
||||||
|
if(data && data.length >0){
|
||||||
|
let isActive = data[0].IsActive;
|
||||||
|
if(isActive == 1){
|
||||||
|
alert("Department name already Exists ..!! ");
|
||||||
|
}else{
|
||||||
|
alert("Department Name already Existing in the deleted section.!!");
|
||||||
|
}
|
||||||
|
window.location.reload();
|
||||||
|
}
|
||||||
|
|
||||||
|
},
|
||||||
|
error:function(error){
|
||||||
|
console.log("error occured..!!")
|
||||||
|
console.error(error);
|
||||||
|
},
|
||||||
|
complete:function(){
|
||||||
|
$('#loader').hide();
|
||||||
|
console.log("ajax call is completed..!!")
|
||||||
|
}
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
</script>
|
||||||
@ -52,6 +52,8 @@ $energyType = $masterData['energy_type'] ?? '';
|
|||||||
<div class="card">
|
<div class="card">
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<form action="<?= empty($masterData)
|
<form action="<?= empty($masterData)
|
||||||
? base_url('createFactoryMachineMasterDetails')
|
? base_url('createFactoryMachineMasterDetails')
|
||||||
: base_url('updateFactoryMachineMasterDetails?id=' . $masterData['id']); ?>" method="post"
|
: base_url('updateFactoryMachineMasterDetails?id=' . $masterData['id']); ?>" method="post"
|
||||||
@ -90,6 +92,9 @@ $energyType = $masterData['energy_type'] ?? '';
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<?php if(!empty($masterData)){ ?>
|
||||||
|
<input type="hidden" id="machineId" value="<?=$masterData['id']?>">
|
||||||
|
<?php } ?>
|
||||||
<br>
|
<br>
|
||||||
|
|
||||||
<!-- submit and cancel button section -->
|
<!-- submit and cancel button section -->
|
||||||
@ -123,12 +128,13 @@ $energyType = $masterData['energy_type'] ?? '';
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
$('#machineName').on('change', function () {
|
$('#machineName').on('change', function () {
|
||||||
let machineName = $(this).val();
|
let machineName = $(this).val().trim();
|
||||||
|
let machineId = $('#machineId').val()??'';
|
||||||
$('#loader').show();
|
$('#loader').show();
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: "POST",
|
type: "POST",
|
||||||
url: "<?php echo base_url(); ?>/checkMachineName",
|
url: "<?php echo base_url(); ?>/checkMachineName",
|
||||||
data: { machineName },
|
data: { machineName , machineId },
|
||||||
success: function (data) {
|
success: function (data) {
|
||||||
if (data && data.length > 0) {
|
if (data && data.length > 0) {
|
||||||
let isActive = data[0].is_active;
|
let isActive = data[0].is_active;
|
||||||
|
|||||||
@ -11,7 +11,8 @@
|
|||||||
.fht-table tr,
|
.fht-table tr,
|
||||||
.fht-table th,
|
.fht-table th,
|
||||||
.fht-table td {
|
.fht-table td {
|
||||||
margin: 0;
|
margin-top: 0;
|
||||||
|
padding:0 8px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.fht-table td {
|
.fht-table td {
|
||||||
@ -479,7 +480,7 @@
|
|||||||
<!-- need to check the status and select values before hand -->
|
<!-- need to check the status and select values before hand -->
|
||||||
|
|
||||||
<!-- 'td:eq(32)' -->
|
<!-- 'td:eq(32)' -->
|
||||||
<td class="celda_normal" contenteditable="true">
|
<td class="celda_normal" style="color:#02d0eb; background:white;" contenteditable="true">
|
||||||
<select class="status sand-status" style="width:210px;">
|
<select class="status sand-status" style="width:210px;">
|
||||||
<option value="noRemark">Select</option>
|
<option value="noRemark">Select</option>
|
||||||
<option value="accepted"
|
<option value="accepted"
|
||||||
@ -1011,6 +1012,8 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
html2pdf().from(element).set(opt).save();
|
html2pdf().from(element).set(opt).save();
|
||||||
|
|
||||||
|
$('#downloadLabReportModel').modal('hide');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -169,14 +169,15 @@
|
|||||||
<td><?php echo $invoice['Vehicle No.']; ?></td>
|
<td><?php echo $invoice['Vehicle No.']; ?></td>
|
||||||
<td><?php echo $invoice['Product']; ?></td>
|
<td><?php echo $invoice['Product']; ?></td>
|
||||||
<td><?php echo $invoice['Client']; ?></td>
|
<td><?php echo $invoice['Client']; ?></td>
|
||||||
<td><?php echo $invoice['Quantity']; ?></td>
|
|
||||||
<td><?php echo $invoice['Rate']; ?></td>
|
<td align="right"> <?php echo number_format($invoice['Quantity'], 2, '.', ',') ?></td>
|
||||||
<td><?php echo $invoice['Value']; ?></td>
|
<td align="right"> <?php echo number_format($invoice['Rate'], 2, '.', ',') ?></td>
|
||||||
<td><?php echo $invoice['CGST']; ?></td>
|
<td align="right"> <?php echo number_format($invoice['Value'], 2, '.', ',') ?></td>
|
||||||
<td><?php echo $invoice['SGST']; ?></td>
|
<td align="right"> <?php echo number_format($invoice['CGST'], 2, '.', ',') ?></td>
|
||||||
<td><?php echo $invoice['IGST']; ?></td>
|
<td align="right"> <?php echo number_format($invoice['SGST'], 2, '.', ',') ?></td>
|
||||||
<td><?php echo $invoice['TCS']; ?></td>
|
<td align="right"> <?php echo number_format($invoice['IGST'], 2, '.', ',') ?></td>
|
||||||
<td><?php echo $invoice['Total']; ?></td>
|
<td align="right"> <?php echo number_format($invoice['TCS'], 2, '.', ',') ?></td>
|
||||||
|
<td align="right"> <?php echo number_format($invoice['Total'], 2, '.', ',') ?></td>
|
||||||
</tr>
|
</tr>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
</tbody>
|
</tbody>
|
||||||
|
|||||||
@ -171,13 +171,13 @@
|
|||||||
<th>Invoice No</th>
|
<th>Invoice No</th>
|
||||||
<th>Client Name</th>
|
<th>Client Name</th>
|
||||||
<th>Product</th>
|
<th>Product</th>
|
||||||
<th>Rate</th>
|
|
||||||
<th>Quantity</th>
|
<th>Quantity</th>
|
||||||
|
<th>Rate</th>
|
||||||
<th>Sub Total</th>
|
<th>Sub Total</th>
|
||||||
<th>GST</th>
|
<th>GST</th>
|
||||||
<th>Total</th>
|
<th>Total</th>
|
||||||
<th>Status</th>
|
<th>Status</th>
|
||||||
<th>E-Invoice Number</th>
|
<!-- <th>E-Invoice Number</th> -->
|
||||||
<th>Action</th>
|
<th>Action</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
@ -205,13 +205,13 @@
|
|||||||
</td>
|
</td>
|
||||||
<td><?php echo $invoice->client_name ?></td>
|
<td><?php echo $invoice->client_name ?></td>
|
||||||
<td><?php echo $invoice->item_name ?></td>
|
<td><?php echo $invoice->item_name ?></td>
|
||||||
<td><?php echo $invoice->item_price ?></td>
|
<td align="right"><?php echo number_format($invoice->item_quantity, 2, '.', ',') ?></td>
|
||||||
<td><?php echo number_format($invoice->item_quantity, 2, '.', ',') ?></td>
|
<td align="right"><?php echo number_format($invoice->item_price, 2, '.', ',') ?></td>
|
||||||
<td><?php echo number_format($subtotal, 2, '.', ',') ?></td>
|
<td align="right"><?php echo number_format($subtotal, 2, '.', ',') ?></td>
|
||||||
<td><?php echo number_format($cgst_amount + $sgst_amount, 2, '.', ',') ?></td>
|
<td align="right"><?php echo number_format($cgst_amount + $sgst_amount, 2, '.', ',') ?></td>
|
||||||
<td><?php echo number_format($total, 2, '.', ',') ?></td>
|
<td align="right"><?php echo number_format($total, 2, '.', ',') ?></td>
|
||||||
<td><?php echo $invoice->status ?></td>
|
<td><?php echo $invoice->status ?></td>
|
||||||
<td><?php echo $invoice->e_invoice_number; ?></td>
|
<!-- <td><?php echo $invoice->e_invoice_number; ?></td> -->
|
||||||
<td>
|
<td>
|
||||||
<a class="edit-button" style="cursor: pointer; display: inline-block;" title="Files Upload" onclick="openInvoiceModal('<?php echo $invoice->invoice_number; ?>', '<?php echo $invoice->client_name; ?>', '<?php echo $invoice->invoice_date_created; ?>', '<?php echo $invoice->invoice_id; ?>')">
|
<a class="edit-button" style="cursor: pointer; display: inline-block;" title="Files Upload" onclick="openInvoiceModal('<?php echo $invoice->invoice_number; ?>', '<?php echo $invoice->client_name; ?>', '<?php echo $invoice->invoice_date_created; ?>', '<?php echo $invoice->invoice_id; ?>')">
|
||||||
<i class="fas fa-file-upload text-muted" style="font-size: 18px; vertical-align: middle;"></i>
|
<i class="fas fa-file-upload text-muted" style="font-size: 18px; vertical-align: middle;"></i>
|
||||||
|
|||||||
@ -259,7 +259,7 @@
|
|||||||
|
|
||||||
var formData = {
|
var formData = {
|
||||||
transporterid: $('#transporterid').val(),
|
transporterid: $('#transporterid').val(),
|
||||||
transportername: $('#transportername').val()
|
transportername: $('#transportername').val().trim()
|
||||||
};
|
};
|
||||||
|
|
||||||
let checkTransporterExists = function checkTransporterExists() {
|
let checkTransporterExists = function checkTransporterExists() {
|
||||||
@ -269,6 +269,7 @@
|
|||||||
type: 'POST',
|
type: 'POST',
|
||||||
url: "<?php echo base_url(); ?>checkTransporter",
|
url: "<?php echo base_url(); ?>checkTransporter",
|
||||||
data: {
|
data: {
|
||||||
|
transporterid:$('#transporterid').val()??'',
|
||||||
transportername
|
transportername
|
||||||
},
|
},
|
||||||
success: function (data) {
|
success: function (data) {
|
||||||
|
|||||||
@ -214,9 +214,15 @@
|
|||||||
<th>Supplier Name</th>
|
<th>Supplier Name</th>
|
||||||
<th>Invoice No</th>
|
<th>Invoice No</th>
|
||||||
<th>Invoice Date </th>
|
<th>Invoice Date </th>
|
||||||
<th>Item Count</th>
|
|
||||||
<th>Rec Qty</th>
|
<!--!!!!!..... Don't remove the comment ..!!!!!!!!!!!! -->
|
||||||
<th>Net Weight</th>
|
|
||||||
|
<!-- temporarily removed as per client requirement to remove item count -->
|
||||||
|
<th style="display:none;">Item Count</th>
|
||||||
|
<!-- Rec qty changed to invoice qty -->
|
||||||
|
<th>Invoice Qty</th>
|
||||||
|
<!-- net weight changed to received qty -->
|
||||||
|
<th>Recieved Qty</th>
|
||||||
<th>Vechicle No</th>
|
<th>Vechicle No</th>
|
||||||
<th>Driver</th>
|
<th>Driver</th>
|
||||||
<th>Transporter</th>
|
<th>Transporter</th>
|
||||||
@ -247,9 +253,15 @@
|
|||||||
<td align="right"><?php
|
<td align="right"><?php
|
||||||
$date = new DateTime($record->DeliveryChellanDate);
|
$date = new DateTime($record->DeliveryChellanDate);
|
||||||
echo $date->format('d-m-Y'); ?></td>
|
echo $date->format('d-m-Y'); ?></td>
|
||||||
<td align="center"><?php echo $record->itemCount ?></td>
|
<td align="center"
|
||||||
<td align="right"><?php echo $record->ReceivedQuantity ?></td>
|
style=" display : none ;"><?php echo $record->itemCount ?></td>
|
||||||
<td align="center"><?php echo $record->NetWeight ?></td>
|
|
||||||
|
<!-- below one is currently shown as invoice qty -->
|
||||||
|
<td align="right"><?php echo (int)$record->ReceivedQuantity ?></td>
|
||||||
|
|
||||||
|
<!-- below one is currently shown as received qty -->
|
||||||
|
<td align="right"><?php echo (int)$record->NetWeight ?></td>
|
||||||
|
|
||||||
<td><?php echo $record->VehicleNo ?></td>
|
<td><?php echo $record->VehicleNo ?></td>
|
||||||
<td><?php echo $record->DriverName ?></td>
|
<td><?php echo $record->DriverName ?></td>
|
||||||
<td><?php echo $record->TransporterName ?></td>
|
<td><?php echo $record->TransporterName ?></td>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user