Merge branch 'new_theme' of bitbucket.org:venbainformationtechnology/ria into new_theme
This commit is contained in:
commit
08d4738cfe
@ -303,6 +303,7 @@ $routes->post('purchaseorder/EditRevenuePurchaseOrder', 'Purchaseorder::EditReve
|
|||||||
$routes->post('purchaseorder/deletePurchaseOrderFile', 'Purchaseorder::deletePurchaseOrderFile');
|
$routes->post('purchaseorder/deletePurchaseOrderFile', 'Purchaseorder::deletePurchaseOrderFile');
|
||||||
|
|
||||||
$routes->post('VerifyWithSupplierForPendingPO', 'Purchaseorder::VerifyWithSupplierForPendingPO');
|
$routes->post('VerifyWithSupplierForPendingPO', 'Purchaseorder::VerifyWithSupplierForPendingPO');
|
||||||
|
$routes->post('exceedEditQuantityCheck', 'Purchaseorder::exceedEditQuantityCheck');
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -129,6 +129,10 @@ class Amendmentpurchaseorder extends BaseController
|
|||||||
}
|
}
|
||||||
/* End Here */
|
/* End Here */
|
||||||
|
|
||||||
|
$data['isOpenOrder'] = $this->purchaseorder_model->isOpenOrder($PONO)->IsOpenOrder;
|
||||||
|
|
||||||
|
$data['isOpenOrder'] = empty($data['isOpenOrder']) ? 0 : 1 ;
|
||||||
|
|
||||||
$data['POMaster'] = $this->purchaseorder_model->GetServicePurchaseOrder($PONO);
|
$data['POMaster'] = $this->purchaseorder_model->GetServicePurchaseOrder($PONO);
|
||||||
$data['MaxPODate'] = $this->purchaseorder_model->getLastCreatedPODate();
|
$data['MaxPODate'] = $this->purchaseorder_model->getLastCreatedPODate();
|
||||||
$data['TaxType'] = $this->purchaseorder_model->getConfigValue('C006');
|
$data['TaxType'] = $this->purchaseorder_model->getConfigValue('C006');
|
||||||
|
|||||||
@ -661,6 +661,12 @@ class Purchaseorder extends BaseController
|
|||||||
$data['MaxPODate'] = $this->purchaseorder_model->getLastReleasedPODate();
|
$data['MaxPODate'] = $this->purchaseorder_model->getLastReleasedPODate();
|
||||||
$data['TaxType'] = $this->purchaseorder_model->getConfigValue('C006');
|
$data['TaxType'] = $this->purchaseorder_model->getConfigValue('C006');
|
||||||
$data['FreightType'] = $this->purchaseorder_model->getConfigValue('C018');
|
$data['FreightType'] = $this->purchaseorder_model->getConfigValue('C018');
|
||||||
|
|
||||||
|
$data['isOpenOrder'] = $this->purchaseorder_model->isOpenOrder($PONO)->IsOpenOrder;
|
||||||
|
|
||||||
|
$data['isOpenOrder'] = empty($data['isOpenOrder']) ? 0 : 1 ;
|
||||||
|
|
||||||
|
|
||||||
if ($ReqType == SERVICE) {
|
if ($ReqType == SERVICE) {
|
||||||
|
|
||||||
$data['POItem'] = $this->purchaseorder_model->GetServicePurchaseOrderDetails($PONO);
|
$data['POItem'] = $this->purchaseorder_model->GetServicePurchaseOrderDetails($PONO);
|
||||||
@ -4616,5 +4622,22 @@ class Purchaseorder extends BaseController
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function exceedEditQuantityCheck(){
|
||||||
|
|
||||||
|
$ReqNo = $this->request->getPost('ReqNo');
|
||||||
|
$MaterialCode = $this->request->getPost('MaterialCode');
|
||||||
|
$PONO = $this->request->getPost('PONO');
|
||||||
|
|
||||||
|
$result = $this->purchaseorder_model->exceedEditQuantityCheck($ReqNo,$MaterialCode,$PONO);
|
||||||
|
|
||||||
|
return $this->response->setJSON(
|
||||||
|
[
|
||||||
|
'status' => '201',
|
||||||
|
'data' => $result
|
||||||
|
]);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*--------------------------------------------------------------------------------------*/
|
/*--------------------------------------------------------------------------------------*/
|
||||||
}
|
}
|
||||||
|
|||||||
@ -603,7 +603,7 @@ class StockController extends BaseController
|
|||||||
$insertedId = $this->coatingMachineDetails_model->insert($postData);
|
$insertedId = $this->coatingMachineDetails_model->insert($postData);
|
||||||
|
|
||||||
if (!$insertedId) {
|
if (!$insertedId) {
|
||||||
throw new \Exception('Failed to insert Coating Machine Details.');
|
throw new \Exception('Failed to Insert Coating Machine Details.');
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->updateGasConsumptionOrFail($postData['date'], $postData['totalGasConsumption']);
|
$this->updateGasConsumptionOrFail($postData['date'], $postData['totalGasConsumption']);
|
||||||
@ -644,7 +644,7 @@ class StockController extends BaseController
|
|||||||
|
|
||||||
$this->handleBatchCardUploads($id);
|
$this->handleBatchCardUploads($id);
|
||||||
|
|
||||||
$messages = ['successfully updated Coating machineDetail.'];
|
$messages = ['Successfully Updated Coating Machine Detail.'];
|
||||||
|
|
||||||
$this->handleGasConsumptionAdjustment($putData, $messages);
|
$this->handleGasConsumptionAdjustment($putData, $messages);
|
||||||
|
|
||||||
@ -873,14 +873,14 @@ class StockController extends BaseController
|
|||||||
|
|
||||||
foreach ($records as $i => &$r) {
|
foreach ($records as $i => &$r) {
|
||||||
if ($i == 0) {
|
if ($i == 0) {
|
||||||
$r['consumption'] += (float)$consumption;
|
$r['consumption'] = (float) $r['consumption'] + (float)$consumption;
|
||||||
$r['total'] = (float)$r['opening'] + (float)$r['purchaseBharath'] + (float)$r['purchaseIndian'];
|
$r['total'] = (float)$r['opening'] + (float)$r['purchaseBharath'] + (float)$r['purchaseIndian'];
|
||||||
$r['balanceStock'] = $r['total'] - $r['consumption'];
|
$r['balanceStock'] = $r['total'] - $r['consumption'];
|
||||||
$updatedOpeningStock = (int)$r['balanceStock'];
|
$updatedOpeningStock = (int)$r['balanceStock'];
|
||||||
} else {
|
} else {
|
||||||
$r['opening'] = (float)$updatedOpeningStock;
|
$r['opening'] = (float)$updatedOpeningStock;
|
||||||
$r['total'] = (float)$r['opening'] + (float)$r['purchaseBharath'] + (float)$r['purchaseIndian'];
|
$r['total'] = (float)$r['opening'] + (float)$r['purchaseBharath'] + (float)$r['purchaseIndian'];
|
||||||
$r['balanceStock'] = $r['total'] - $r['consumption'];
|
$r['balanceStock'] = $r['total'] - (float) $r['consumption'];
|
||||||
$updatedOpeningStock = (int)$r['balanceStock'];
|
$updatedOpeningStock = (int)$r['balanceStock'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -936,11 +936,6 @@ class StockController extends BaseController
|
|||||||
$customisedMachineCodes = $this->getOrUpdateCustomisedMachineCodes($month);
|
$customisedMachineCodes = $this->getOrUpdateCustomisedMachineCodes($month);
|
||||||
|
|
||||||
|
|
||||||
if ($this->isCurrentMonth($startDate, $endDate, $currentDate)) {
|
|
||||||
$this->ensureDieselDetailsForMonth($customisedMachineCodes, $startDate, $endDate);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
$dieselMachines = $this->factoryMachine_model->getSelectedDieselMachines($customisedMachineCodes);
|
$dieselMachines = $this->factoryMachine_model->getSelectedDieselMachines($customisedMachineCodes);
|
||||||
$dieselMachinesCount = count($dieselMachines);
|
$dieselMachinesCount = count($dieselMachines);
|
||||||
|
|
||||||
@ -949,6 +944,14 @@ class StockController extends BaseController
|
|||||||
$data['previousMonthDieselMachineStockDetails'] = $prevDetails;
|
$data['previousMonthDieselMachineStockDetails'] = $prevDetails;
|
||||||
$data['previousMonthTotalDieselMachineStockDetails'] = $prevTotals;
|
$data['previousMonthTotalDieselMachineStockDetails'] = $prevTotals;
|
||||||
|
|
||||||
|
$previousMonth = DateTime::createFromFormat('Y-m-d', "$month-01")->modify('-1 month')->format('Y-m');
|
||||||
|
$prevStart = "$previousMonth-01";
|
||||||
|
$prevEnd = date("Y-m-t", strtotime($prevStart));
|
||||||
|
|
||||||
|
if ($this->isCurrentMonth($startDate, $endDate, $currentDate)) {
|
||||||
|
$this->ensureDieselDetailsForMonth($customisedMachineCodes, $startDate, $endDate, $prevEnd);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
$data['dieselMachineStockDetails'] = $this->factoryVehicleDieselDetails_model
|
$data['dieselMachineStockDetails'] = $this->factoryVehicleDieselDetails_model
|
||||||
->where('date >=', $startDate)
|
->where('date >=', $startDate)
|
||||||
@ -1250,30 +1253,8 @@ class StockController extends BaseController
|
|||||||
//this existingCustomMachineCodes gets its machine after visiting factory machine master table
|
//this existingCustomMachineCodes gets its machine after visiting factory machine master table
|
||||||
$machineCodeList = array_column($existingCustomMachineCodes, 'id');
|
$machineCodeList = array_column($existingCustomMachineCodes, 'id');
|
||||||
|
|
||||||
$currentDate = new DateTime();
|
|
||||||
|
|
||||||
|
|
||||||
if($startDate == $currentDate->format('Y-m-01') && $endDate == $currentDate->format('Y-m-t')){
|
|
||||||
|
|
||||||
foreach($machineCodeList as $index => $machineCode){
|
|
||||||
|
|
||||||
//checking filtered material code present in table , if not create dummy one for whole month
|
|
||||||
$findMachineCode = $this->powerConsumptionDetails_model
|
|
||||||
->where('date >=', $startDate)
|
|
||||||
->where('date <=', $endDate)
|
|
||||||
->where('machine_id',$machineCode)
|
|
||||||
->findAll();
|
|
||||||
|
|
||||||
|
|
||||||
//check any material code is not present in stock table but applied in filter
|
|
||||||
if(empty($findMachineCode)){
|
|
||||||
//create dummy entry for this
|
|
||||||
$this->createDummyEntryForElectricMachine($machineCode,$startDate,$endDate);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$electricMachines = $existingCustomMachineCodes;
|
$electricMachines = $existingCustomMachineCodes;
|
||||||
@ -1304,6 +1285,30 @@ class StockController extends BaseController
|
|||||||
->orderBy('machine_id', 'asc')
|
->orderBy('machine_id', 'asc')
|
||||||
->findAll();
|
->findAll();
|
||||||
|
|
||||||
|
$currentDate = new DateTime();
|
||||||
|
|
||||||
|
|
||||||
|
if($startDate == $currentDate->format('Y-m-01') && $endDate == $currentDate->format('Y-m-t')){
|
||||||
|
|
||||||
|
foreach($machineCodeList as $index => $machineCode){
|
||||||
|
|
||||||
|
//checking filtered material code present in table , if not create dummy one for whole month
|
||||||
|
$findMachineCode = $this->powerConsumptionDetails_model
|
||||||
|
->where('date >=', $startDate)
|
||||||
|
->where('date <=', $endDate)
|
||||||
|
->where('machine_id',$machineCode)
|
||||||
|
->findAll();
|
||||||
|
|
||||||
|
|
||||||
|
//check any material code is not present in stock table but applied in filter
|
||||||
|
if(empty($findMachineCode)){
|
||||||
|
//create dummy entry for this
|
||||||
|
$this->createDummyEntryForElectricMachine($machineCode,$startDate,$endDate , $previousMonthEndDate);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$data['previousMonthTotalPowerMachineStockDetails'] = $this->powerConsumptionSummary_model
|
$data['previousMonthTotalPowerMachineStockDetails'] = $this->powerConsumptionSummary_model
|
||||||
->select(['id', 'date', 'final_reading'])
|
->select(['id', 'date', 'final_reading'])
|
||||||
->distinct()
|
->distinct()
|
||||||
@ -1778,29 +1783,7 @@ class StockController extends BaseController
|
|||||||
|
|
||||||
$materialCodeList = array_column($existingCustomMaterialCodes, 'MaterialCode');
|
$materialCodeList = array_column($existingCustomMaterialCodes, 'MaterialCode');
|
||||||
|
|
||||||
$currentDate = new DateTime();
|
|
||||||
|
|
||||||
if($startDate == $currentDate->format('Y-m-01') && $endDate == $currentDate->format('Y-m-t')){
|
|
||||||
|
|
||||||
foreach($materialCodeList as $index => $materialCode){
|
|
||||||
|
|
||||||
|
|
||||||
//checking filtered material code present in table , if not create dummy one for whole month if it is current month
|
|
||||||
$findMachineCode = $this->resinStockDetails_model
|
|
||||||
->where('date >=', $startDate)
|
|
||||||
->where('date <=', $endDate)
|
|
||||||
->where('materialCode',$materialCode)
|
|
||||||
->findAll();
|
|
||||||
|
|
||||||
|
|
||||||
//check any material code is not present in stock table but applied in filter
|
|
||||||
if(empty($findMachineCode)){
|
|
||||||
//create dummy entry for this
|
|
||||||
$this->createDummyEntryForResin($materialCode,$startDate,$endDate);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -1825,6 +1808,31 @@ class StockController extends BaseController
|
|||||||
->findAll();
|
->findAll();
|
||||||
|
|
||||||
|
|
||||||
|
$currentDate = new DateTime();
|
||||||
|
|
||||||
|
if($startDate == $currentDate->format('Y-m-01') && $endDate == $currentDate->format('Y-m-t')){
|
||||||
|
|
||||||
|
foreach($materialCodeList as $index => $materialCode){
|
||||||
|
|
||||||
|
|
||||||
|
//checking filtered material code present in table , if not create dummy one for whole month if it is current month
|
||||||
|
$findMachineCode = $this->resinStockDetails_model
|
||||||
|
->where('date >=', $startDate)
|
||||||
|
->where('date <=', $endDate)
|
||||||
|
->where('materialCode',$materialCode)
|
||||||
|
->findAll();
|
||||||
|
|
||||||
|
|
||||||
|
//check any material code is not present in stock table but applied in filter
|
||||||
|
if(empty($findMachineCode)){
|
||||||
|
//create dummy entry for this
|
||||||
|
$this->createDummyEntryForResin($materialCode,$startDate,$endDate ,$previousMonthEndDate);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// checking in database if the data is available for the month
|
// checking in database if the data is available for the month
|
||||||
|
|
||||||
@ -2158,30 +2166,6 @@ class StockController extends BaseController
|
|||||||
|
|
||||||
$materialCodeList = array_column($existingCustomMaterialCodes, 'MaterialCode');
|
$materialCodeList = array_column($existingCustomMaterialCodes, 'MaterialCode');
|
||||||
|
|
||||||
$currentDate = new DateTime();
|
|
||||||
|
|
||||||
if($startDate == $currentDate->format('Y-m-01') && $endDate == $currentDate->format('Y-m-t')){
|
|
||||||
|
|
||||||
foreach($materialCodeList as $index => $materialCode){
|
|
||||||
|
|
||||||
|
|
||||||
//checking filtered material code present in table , if not create dummy one for whole month for current month only
|
|
||||||
$findMachineCode = $this->bagStockDetails_model
|
|
||||||
->where('date >=', $startDate)
|
|
||||||
->where('date <=', $endDate)
|
|
||||||
->where('materialCode',$materialCode)
|
|
||||||
->findAll();
|
|
||||||
|
|
||||||
|
|
||||||
//check any material code is not present in stock table but applied in filter
|
|
||||||
if(empty($findMachineCode)){
|
|
||||||
//create dummy entry for this
|
|
||||||
$this->createDummyEntryForBag($materialCode,$startDate,$endDate);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$bagMaterials = $existingCustomMaterialCodes ;
|
$bagMaterials = $existingCustomMaterialCodes ;
|
||||||
@ -2207,6 +2191,31 @@ class StockController extends BaseController
|
|||||||
->findAll();
|
->findAll();
|
||||||
|
|
||||||
|
|
||||||
|
$currentDate = new DateTime();
|
||||||
|
|
||||||
|
if($startDate == $currentDate->format('Y-m-01') && $endDate == $currentDate->format('Y-m-t')){
|
||||||
|
|
||||||
|
foreach($materialCodeList as $index => $materialCode){
|
||||||
|
|
||||||
|
|
||||||
|
//checking filtered material code present in table , if not create dummy one for whole month for current month only
|
||||||
|
$findMachineCode = $this->bagStockDetails_model
|
||||||
|
->where('date >=', $startDate)
|
||||||
|
->where('date <=', $endDate)
|
||||||
|
->where('materialCode',$materialCode)
|
||||||
|
->findAll();
|
||||||
|
|
||||||
|
|
||||||
|
//check any material code is not present in stock table but applied in filter
|
||||||
|
if(empty($findMachineCode)){
|
||||||
|
//create dummy entry for this
|
||||||
|
$this->createDummyEntryForBag($materialCode,$startDate,$endDate , $previousMonthEndDate);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// checking in database if the data is available for the month
|
// checking in database if the data is available for the month
|
||||||
|
|
||||||
@ -2935,24 +2944,35 @@ class StockController extends BaseController
|
|||||||
return $dateInput;
|
return $dateInput;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function createDummyEntryForBag($customisedMaterialCode, $startDate, $endDate)
|
public function createDummyEntryForBag($customisedMaterialCode, $startDate, $endDate , $previousMonthEndDate)
|
||||||
{
|
{
|
||||||
if (!empty($customisedMaterialCode)) {
|
if (!empty($customisedMaterialCode)) {
|
||||||
$inserts = [];
|
$inserts = [];
|
||||||
|
|
||||||
// Convert start and end date to timestamps
|
// Convert start and end date to timestamps
|
||||||
$startTimestamp = strtotime($startDate);
|
$startTimestamp = strtotime($startDate);
|
||||||
$endTimestamp = strtotime($endDate);
|
$endTimestamp = strtotime($endDate);
|
||||||
|
|
||||||
|
$previousMonthBalance = $this->bagStockDetails_model
|
||||||
|
->select(['materialCode', 'date', 'balanceStock'])
|
||||||
|
->distinct()
|
||||||
|
->where('date =', $previousMonthEndDate)
|
||||||
|
->where('materialCode', $customisedMaterialCode)
|
||||||
|
->groupBy(['materialCode', 'date'])
|
||||||
|
->orderBy('date', 'desc')
|
||||||
|
->orderBy('materialCode', 'asc')
|
||||||
|
->findAll();
|
||||||
|
|
||||||
|
|
||||||
while ($startTimestamp <= $endTimestamp) {
|
while ($startTimestamp <= $endTimestamp) {
|
||||||
$inserts[] = [
|
$inserts[] = [
|
||||||
'date' => date('Y-m-d', $startTimestamp), // Convert timestamp to date format
|
'date' => date('Y-m-d', $startTimestamp), // Convert timestamp to date format
|
||||||
'materialCode' => $customisedMaterialCode,
|
'materialCode' => $customisedMaterialCode,
|
||||||
'customer' => ' ',
|
'customer' => ' ',
|
||||||
'opening' => ' ',
|
'opening' => $previousMonthBalance[0]['balanceStock'] ?? ' ',
|
||||||
'receipt' => ' ',
|
'receipt' => ' ',
|
||||||
'used' => ' ',
|
'used' => ' ',
|
||||||
'balanceStock' => ' ',
|
'balanceStock' => $previousMonthBalance[0]['balanceStock'] ?? ' ',
|
||||||
];
|
];
|
||||||
|
|
||||||
$startTimestamp = strtotime('+1 day', $startTimestamp); // Move to the next day
|
$startTimestamp = strtotime('+1 day', $startTimestamp); // Move to the next day
|
||||||
@ -2963,7 +2983,7 @@ class StockController extends BaseController
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public function createDummyEntryForResin($customisedMaterialCode, $startDate, $endDate)
|
public function createDummyEntryForResin($customisedMaterialCode, $startDate, $endDate ,$previousMonthEndDate)
|
||||||
{
|
{
|
||||||
if (!empty($customisedMaterialCode)) {
|
if (!empty($customisedMaterialCode)) {
|
||||||
$inserts = [];
|
$inserts = [];
|
||||||
@ -2972,15 +2992,25 @@ class StockController extends BaseController
|
|||||||
$startTimestamp = strtotime($startDate);
|
$startTimestamp = strtotime($startDate);
|
||||||
$endTimestamp = strtotime($endDate);
|
$endTimestamp = strtotime($endDate);
|
||||||
|
|
||||||
|
$previousMonthBalance = $this->resinStockDetails_model
|
||||||
|
->select(['materialCode', 'date', 'balanceStock'])
|
||||||
|
->distinct()
|
||||||
|
->where('date =', $previousMonthEndDate)
|
||||||
|
->where('materialCode', $customisedMaterialCode)
|
||||||
|
->groupBy(['materialCode', 'date'])
|
||||||
|
->orderBy('date', 'desc')
|
||||||
|
->orderBy('materialCode', 'asc')
|
||||||
|
->findAll();
|
||||||
|
|
||||||
while ($startTimestamp <= $endTimestamp) {
|
while ($startTimestamp <= $endTimestamp) {
|
||||||
$inserts[] = [
|
$inserts[] = [
|
||||||
'date' => date('Y-m-d', $startTimestamp), // Convert timestamp to date format
|
'date' => date('Y-m-d', $startTimestamp), // Convert timestamp to date format
|
||||||
'materialCode' => $customisedMaterialCode,
|
'materialCode' => $customisedMaterialCode,
|
||||||
'customer' => ' ',
|
'customer' => ' ',
|
||||||
'opening' => ' ',
|
'opening' => $previousMonthBalance[0]['balanceStock'] ?? ' ',
|
||||||
'receipt' => ' ',
|
'receipt' => ' ',
|
||||||
'used' => ' ',
|
'used' => ' ',
|
||||||
'balanceStock' => ' ',
|
'balanceStock' => $previousMonthBalance[0]['balanceStock'] ?? ' ',
|
||||||
];
|
];
|
||||||
|
|
||||||
$startTimestamp = strtotime('+1 day', $startTimestamp); // Move to the next day
|
$startTimestamp = strtotime('+1 day', $startTimestamp); // Move to the next day
|
||||||
@ -2992,7 +3022,7 @@ class StockController extends BaseController
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function createDummyEntryForDieselMachine($customisedMachineCode, $startDate, $endDate)
|
public function createDummyEntryForDieselMachine($customisedMachineCode, $startDate, $endDate ,$prevEnd)
|
||||||
{
|
{
|
||||||
if (!empty($customisedMachineCode)) {
|
if (!empty($customisedMachineCode)) {
|
||||||
$inserts = [];
|
$inserts = [];
|
||||||
@ -3001,13 +3031,29 @@ class StockController extends BaseController
|
|||||||
$startTimestamp = strtotime($startDate);
|
$startTimestamp = strtotime($startDate);
|
||||||
$endTimestamp = strtotime($endDate);
|
$endTimestamp = strtotime($endDate);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
$previousMonthBalance = $this->factoryVehicleDieselDetails_model
|
||||||
|
->select(['machine_id', 'date', 'closing_reading'])
|
||||||
|
->distinct()
|
||||||
|
->where('date =', $prevEnd)
|
||||||
|
->where('machine_id', $customisedMachineCode)
|
||||||
|
->groupBy(['machine_id', 'date'])
|
||||||
|
->orderBy('date', 'desc')
|
||||||
|
->orderBy('machine_id', 'asc')
|
||||||
|
->findAll();
|
||||||
|
|
||||||
|
|
||||||
while ($startTimestamp <= $endTimestamp) {
|
while ($startTimestamp <= $endTimestamp) {
|
||||||
$inserts[] = [
|
$inserts[] = [
|
||||||
'date' => date('Y-m-d', $startTimestamp), // Convert timestamp to date format
|
'date' => date('Y-m-d', $startTimestamp), // Convert timestamp to date format
|
||||||
'machine_id' => $customisedMachineCode,
|
'machine_id' => $customisedMachineCode,
|
||||||
'opening_units' => ' ',
|
'opening_reading' => $previousMonthBalance[0]['closing_reading'] ?? ' ',
|
||||||
'closing_units' => ' ',
|
'closing_reading' => $previousMonthBalance[0]['closing_reading'] ?? ' ',
|
||||||
'total_units' => ' ',
|
'filling_diesel' => ' ',
|
||||||
|
'consumption' => ' ',
|
||||||
|
'running_hours' => ' ',
|
||||||
|
'mileage' => ' ',
|
||||||
];
|
];
|
||||||
|
|
||||||
$startTimestamp = strtotime('+1 day', $startTimestamp); // Move to the next day
|
$startTimestamp = strtotime('+1 day', $startTimestamp); // Move to the next day
|
||||||
@ -3019,7 +3065,7 @@ class StockController extends BaseController
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function createDummyEntryForElectricMachine($customisedMachineCode, $startDate, $endDate)
|
public function createDummyEntryForElectricMachine($customisedMachineCode, $startDate, $endDate ,$previousMonthEndDate)
|
||||||
{
|
{
|
||||||
if (!empty($customisedMachineCode)) {
|
if (!empty($customisedMachineCode)) {
|
||||||
$inserts = [];
|
$inserts = [];
|
||||||
@ -3028,12 +3074,23 @@ class StockController extends BaseController
|
|||||||
$startTimestamp = strtotime($startDate);
|
$startTimestamp = strtotime($startDate);
|
||||||
$endTimestamp = strtotime($endDate);
|
$endTimestamp = strtotime($endDate);
|
||||||
|
|
||||||
|
$previousMonthBalance = $this->powerConsumptionDetails_model
|
||||||
|
->select(['machine_id', 'date', 'closing_units'])
|
||||||
|
->distinct()
|
||||||
|
->where('date =', $previousMonthEndDate)
|
||||||
|
->where('machine_id', $customisedMachineCode)
|
||||||
|
->groupBy(['machine_id', 'date'])
|
||||||
|
->orderBy('date', 'desc')
|
||||||
|
->orderBy('machine_id', 'asc')
|
||||||
|
->findAll();
|
||||||
|
|
||||||
|
|
||||||
while ($startTimestamp <= $endTimestamp) {
|
while ($startTimestamp <= $endTimestamp) {
|
||||||
$inserts[] = [
|
$inserts[] = [
|
||||||
'date' => date('Y-m-d', $startTimestamp), // Convert timestamp to date format
|
'date' => date('Y-m-d', $startTimestamp), // Convert timestamp to date format
|
||||||
'machine_id' => $customisedMachineCode,
|
'machine_id' => $customisedMachineCode,
|
||||||
'opening_units' => ' ',
|
'opening_units' => $previousMonthBalance[0]['closing_units'] ?? ' ',
|
||||||
'closing_units' => ' ',
|
'closing_units' => $previousMonthBalance[0]['closing_units'] ?? ' ',
|
||||||
'total_units' => ' ',
|
'total_units' => ' ',
|
||||||
];
|
];
|
||||||
|
|
||||||
@ -3311,7 +3368,7 @@ class StockController extends BaseController
|
|||||||
return $startDate == $currentDate->format('Y-m-01') && $endDate == $currentDate->format('Y-m-t');
|
return $startDate == $currentDate->format('Y-m-01') && $endDate == $currentDate->format('Y-m-t');
|
||||||
}
|
}
|
||||||
|
|
||||||
private function ensureDieselDetailsForMonth($machineCodes, $startDate, $endDate)
|
private function ensureDieselDetailsForMonth($machineCodes, $startDate, $endDate, $prevEnd)
|
||||||
{
|
{
|
||||||
foreach ($machineCodes as $code) {
|
foreach ($machineCodes as $code) {
|
||||||
$exists = $this->factoryVehicleDieselDetails_model
|
$exists = $this->factoryVehicleDieselDetails_model
|
||||||
@ -3321,7 +3378,7 @@ class StockController extends BaseController
|
|||||||
->findAll();
|
->findAll();
|
||||||
|
|
||||||
if (empty($exists)) {
|
if (empty($exists)) {
|
||||||
$this->createDummyEntryForDieselMachine($code, $startDate, $endDate);
|
$this->createDummyEntryForDieselMachine($code, $startDate, $endDate, $prevEnd);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1153,15 +1153,38 @@ mstr.CourierNo,pom.Status,pom.POType') //,bill.BillNo,bill.FilePath,
|
|||||||
function GetRevenuePurchaseOrderDetails($PONO = '')
|
function GetRevenuePurchaseOrderDetails($PONO = '')
|
||||||
{
|
{
|
||||||
|
|
||||||
$subQuery = 'SELECT distinct LineItem.LineitemAuditorNotes,LineItem.LineItemNo,Req.ReqNo,Mat.MaterialCode,Mat.MaterialName,Mat.UOM,Quantity,Per,ServiceMaterialDescription,ReceivedQuantity,Rate,Req.Status,(Quantity *Rate) as BasicValue , (( AfterSGST + AfterCGST +
|
$subQuery = 'SELECT distinct
|
||||||
AfterIGST )) as Taxamount ,TotalValue,Tax.*,Req.CostCenterCode,Dept.DepartmentName,LineItem.LineitemAuditorNotes,Mat.HSNCODE
|
LineItem.LineitemAuditorNotes,
|
||||||
FROM t_purchaseorder_lineitem LineItem
|
LineItem.LineItemNo,
|
||||||
join t_materialmaster Mat on Mat.MaterialCode = LineItem.MaterialCode
|
Req.ReqNo,
|
||||||
left join t_revenue_tax Tax on Tax.LineItemNo = LineItem.LineItemNo
|
Mat.MaterialCode,
|
||||||
join t_requestion_master Req on Req.ReqNo = LineItem.ReqNo
|
Mat.MaterialName,
|
||||||
left join t_employee_details emp on Req.Requestedby = emp.EmpID
|
Mat.UOM,
|
||||||
join t_departmentdetails Dept on Req.RequestedDept = Dept.DEPCode
|
Quantity,
|
||||||
where LineItem.PONO =?';
|
Per,
|
||||||
|
ServiceMaterialDescription,
|
||||||
|
ReceivedQuantity,
|
||||||
|
Rate,
|
||||||
|
Req.Status,
|
||||||
|
(Quantity *Rate) as BasicValue ,
|
||||||
|
(( AfterSGST + AfterCGST +
|
||||||
|
AfterIGST )) as Taxamount ,
|
||||||
|
TotalValue,
|
||||||
|
Tax.*,
|
||||||
|
Req.CostCenterCode,
|
||||||
|
Dept.DepartmentName,
|
||||||
|
LineItem.LineitemAuditorNotes,
|
||||||
|
Mat.HSNCODE
|
||||||
|
|
||||||
|
FROM t_purchaseorder_lineitem LineItem
|
||||||
|
|
||||||
|
join t_materialmaster Mat on Mat.MaterialCode = LineItem.MaterialCode
|
||||||
|
left join t_revenue_tax Tax on Tax.LineItemNo = LineItem.LineItemNo
|
||||||
|
join t_requestion_master Req on Req.ReqNo = LineItem.ReqNo
|
||||||
|
left join t_employee_details emp on Req.Requestedby = emp.EmpID
|
||||||
|
join t_departmentdetails Dept on Req.RequestedDept = Dept.DEPCode
|
||||||
|
|
||||||
|
where LineItem.PONO =?';
|
||||||
|
|
||||||
$query = $this->db->query($subQuery, array($PONO));
|
$query = $this->db->query($subQuery, array($PONO));
|
||||||
|
|
||||||
@ -2629,6 +2652,112 @@ mstr.CourierNo,pom.Status,pom.POType') //,bill.BillNo,bill.FilePath,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function isOpenOrder($PONO){
|
||||||
|
|
||||||
|
$builder = $this->db->table('t_purchaseorder_master POMast')
|
||||||
|
->select('IsOpenOrder')
|
||||||
|
->where('PONO',$PONO);
|
||||||
|
$query = $builder->get();
|
||||||
|
$result = $query->getRow();
|
||||||
|
|
||||||
|
return $result;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getRequisitionMaterialInfo($reqNos)
|
||||||
|
{
|
||||||
|
$builder = $this->db->table('t_requestion_details Req')
|
||||||
|
|
||||||
|
->select("
|
||||||
|
Req.MaterialCode,
|
||||||
|
Req.ReqNo,
|
||||||
|
mat.MaterialName,
|
||||||
|
mat.UOM, Req.Quantity,
|
||||||
|
SUM(Req.Quantity - IFNULL(Line.Quantity, 0)) AS BalancedQuantity,
|
||||||
|
mat.material_rate,
|
||||||
|
mat.HSNCODE")
|
||||||
|
|
||||||
|
->join('t_materialmaster mat', 'Req.MaterialCode = mat.MaterialCode')
|
||||||
|
->join('t_purchaseorder_lineitem Line', 'Line.ReqNo = Req.ReqNo AND Line.MaterialCode = Req.MaterialCode', 'left')
|
||||||
|
->whereIn('Req.ReqNo', $reqNos);
|
||||||
|
$query = $builder->groupBy('Req.MaterialCode')->get();
|
||||||
|
return $query->getResult();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public function exceedEditQuantityCheck($ReqNo, $MaterialCode,$PONO)
|
||||||
|
{
|
||||||
|
$subQuery1 =
|
||||||
|
'SELECT
|
||||||
|
tpolm.ReqNo,
|
||||||
|
tpolm.MaterialCode,
|
||||||
|
SUM(tpol.Quantity) AS usedReqQty
|
||||||
|
FROM
|
||||||
|
(
|
||||||
|
SELECT
|
||||||
|
pol.ReqNo,
|
||||||
|
pol.MaterialCode,
|
||||||
|
MAX(pol.PONO) AS PONO
|
||||||
|
|
||||||
|
FROM t_purchaseorder_lineitem pol
|
||||||
|
WHERE pol.ReqNo = ?
|
||||||
|
AND pol.MaterialCode = ?
|
||||||
|
GROUP BY
|
||||||
|
pol.ReqNo,
|
||||||
|
pol.MaterialCode,
|
||||||
|
CASE
|
||||||
|
WHEN INSTR(pol.PONO, ".") > 0 THEN SUBSTR(pol.PONO, 1, INSTR(pol.PONO, ".") - 1)
|
||||||
|
ELSE pol.PONO
|
||||||
|
END
|
||||||
|
) as tpolm
|
||||||
|
|
||||||
|
Inner JOIN t_purchaseorder_lineitem tpol
|
||||||
|
ON tpol.ReqNo = tpolm.ReqNo
|
||||||
|
AND tpol.MaterialCode = tpolm.MaterialCode
|
||||||
|
AND tpol.PONO = tpolm.PONO
|
||||||
|
|
||||||
|
GROUP BY tpolm.ReqNo, tpolm.MaterialCode';
|
||||||
|
|
||||||
|
$query1 = $this->db->query($subQuery1, [$ReqNo, $MaterialCode]);
|
||||||
|
|
||||||
|
$usedReqQty = $query1->getResultArray();
|
||||||
|
|
||||||
|
$subQuery2 =
|
||||||
|
' SELECT
|
||||||
|
Req.Quantity AS originalReqQty
|
||||||
|
From t_requestion_details Req
|
||||||
|
WHERE Req.ReqNo = ?
|
||||||
|
AND Req.MaterialCode = ?';
|
||||||
|
|
||||||
|
$query2 = $this->db->query($subQuery2, [$ReqNo, $MaterialCode]);
|
||||||
|
|
||||||
|
$originalReqQty = $query2->getResultArray();
|
||||||
|
|
||||||
|
|
||||||
|
$subQuery3 =
|
||||||
|
' SELECT
|
||||||
|
SUM(tpol.Quantity) AS currentPOQty
|
||||||
|
From t_purchaseorder_lineitem tpol
|
||||||
|
WHERE tpol.ReqNo = ?
|
||||||
|
AND tpol.MaterialCode = ?
|
||||||
|
AND tpol.PONO = ?
|
||||||
|
GROUP BY tpol.ReqNo, tpol.MaterialCode , tpol.PONO';
|
||||||
|
|
||||||
|
$query3 = $this->db->query($subQuery3, [$ReqNo, $MaterialCode, $PONO]);
|
||||||
|
|
||||||
|
$currentPOQty = $query3->getResultArray();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
return [
|
||||||
|
'usedReqQty' => $usedReqQty,
|
||||||
|
'originalReqQty' => $originalReqQty,
|
||||||
|
'currentPOQty' => $currentPOQty
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@ -1923,7 +1923,7 @@ if (!empty($POItem) && $CapitalRange == '1') {
|
|||||||
<div class="form-group col-md-3">
|
<div class="form-group col-md-3">
|
||||||
<label>Quantity</label>
|
<label>Quantity</label>
|
||||||
<?php
|
<?php
|
||||||
$data = array('name' => 'EditCPQuantity', 'value' => set_value('EditCPQuantity'), 'id' => 'EditCPQuantity', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'EditRatechange();calculateFreight(3);calculateFreightloceditper()');
|
$data = array('name' => 'EditCPQuantity', 'value' => set_value('EditCPQuantity'), 'id' => 'EditCPQuantity', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'ExceedEditQuantityCheck();EditRatechange();calculateFreight(3);calculateFreightloceditper()');
|
||||||
echo form_input($data);
|
echo form_input($data);
|
||||||
?>
|
?>
|
||||||
</div>
|
</div>
|
||||||
@ -2860,24 +2860,6 @@ if (!empty($POItem) && $CapitalRange == '1') {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* This function used to check quantity exceeding or not */
|
|
||||||
|
|
||||||
// function ExceedQuantityCheck()
|
|
||||||
// {
|
|
||||||
// var EnterQuantity = $("#CPQuantity").val()== '' ? "0.00" : parseFloat($("#CPQuantity").val());
|
|
||||||
// var ReqQuantity = parseFloat(RequistQuantity);
|
|
||||||
// //alert(ReqQuantity);
|
|
||||||
// if(EnterQuantity > ReqQuantity)
|
|
||||||
// {
|
|
||||||
// alert('Your exceeding the Quantity from the Requisition Quantity:'+ RequistQuantity +'.Please adjust the Quantity to proceed further.');
|
|
||||||
|
|
||||||
// $('#CPQuantity').focus();
|
|
||||||
// return false;
|
|
||||||
// }
|
|
||||||
// else {
|
|
||||||
// return true;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
/*
|
/*
|
||||||
This function is used to calculate tax
|
This function is used to calculate tax
|
||||||
*/
|
*/
|
||||||
@ -3693,9 +3675,7 @@ Calculate Landing charge
|
|||||||
$('#EditCostCenter').focus();
|
$('#EditCostCenter').focus();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
// EditExceedQuantityCheck();
|
|
||||||
|
|
||||||
// if(EditExceedQuantityCheck()){
|
|
||||||
|
|
||||||
|
|
||||||
if ($('#EditCPQuantity').val() != '' && $('#EditCPRate').val() != '') {
|
if ($('#EditCPQuantity').val() != '' && $('#EditCPRate').val() != '') {
|
||||||
@ -3854,31 +3834,69 @@ Calculate Landing charge
|
|||||||
$('CPRate').focus();
|
$('CPRate').focus();
|
||||||
}
|
}
|
||||||
|
|
||||||
// }
|
|
||||||
// else{
|
|
||||||
// clearTaxField();
|
|
||||||
// }
|
|
||||||
|
|
||||||
}
|
}
|
||||||
/* This function used to check quantity exceeding or not while Editing*/
|
/* This function used to check quantity exceeding or not while Editing */
|
||||||
|
|
||||||
// function EditExceedQuantityCheck()
|
function ExceedEditQuantityCheck() {
|
||||||
// {
|
|
||||||
// var EnterQuantity = $("#EditCPQuantity").val()== '' ? "0.00" : parseFloat($("#EditCPQuantity").val());
|
|
||||||
// var ReqQuantity = parseFloat(RequistQuantity);
|
|
||||||
|
|
||||||
// //alert(ReqQuantity);
|
|
||||||
// if(EnterQuantity > ReqQuantity)
|
|
||||||
// {
|
|
||||||
// alert('Your exceeding the Quantity from the Requisition Quantity:'+ RequistQuantity +'.Please adjust the Quantity to proceed further.');
|
|
||||||
|
|
||||||
// $('#EditCPQuantity').focus();
|
let availableReqQty = 0 ;
|
||||||
// return false;
|
let usedReqQty = 0;
|
||||||
// }
|
let originalReqQty = 0;
|
||||||
// else {
|
|
||||||
// return true;
|
$('#loader').show();
|
||||||
// }
|
|
||||||
// }
|
$.ajax({
|
||||||
|
type: "POST",
|
||||||
|
url: "<?php echo base_url();?>exceedEditQuantityCheck",
|
||||||
|
data: {
|
||||||
|
'ReqNo': $('#EditReqnumber').val(),
|
||||||
|
'MaterialCode': $('#EditMaterialCode').val(),
|
||||||
|
'PONO' : "<?php echo $PONO; ?>"
|
||||||
|
},
|
||||||
|
success: function (response) {
|
||||||
|
|
||||||
|
usedReqQty = response.data.usedReqQty[0].usedReqQty;
|
||||||
|
|
||||||
|
originalReqQty = response.data.originalReqQty[0].originalReqQty;
|
||||||
|
|
||||||
|
currentPOQty = response.data.currentPOQty[0].currentPOQty;
|
||||||
|
|
||||||
|
availableReqQty = parseFloat(originalReqQty) - parseFloat(usedReqQty);
|
||||||
|
|
||||||
|
availableReqQty += parseFloat(currentPOQty);
|
||||||
|
|
||||||
|
var EnterQuantity = $("#EditCPQuantity").val() == '' ? "0.00" : parseFloat($("#EditCPQuantity").val());
|
||||||
|
|
||||||
|
availableReqQty = parseFloat(availableReqQty);
|
||||||
|
|
||||||
|
|
||||||
|
if(EnterQuantity > availableReqQty )
|
||||||
|
{
|
||||||
|
alert('Your exceeding the Quantity from the Available Requisition Quantity:'+ availableReqQty +'.Please adjust the Quantity to proceed further.');
|
||||||
|
$('#EditCPQuantity').focus();
|
||||||
|
$('#EditCPQuantity').val('');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
|
||||||
|
return true;
|
||||||
|
|
||||||
|
}
|
||||||
|
},
|
||||||
|
error: function (xhr, status, error) {
|
||||||
|
console.error("Error fetching requisition quantity: " + error);
|
||||||
|
},complete: function () {
|
||||||
|
console.log("Ajax request for ---> exceedEditQuantityCheck completed....!!");
|
||||||
|
$('#loader').hide();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This function is used for Edit Capital
|
* This function is used for Edit Capital
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -1885,7 +1885,7 @@ $(document).ready(function () {
|
|||||||
<label>Quantity<span class="text-danger">*</span></label>
|
<label>Quantity<span class="text-danger">*</span></label>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<?php
|
<?php
|
||||||
$data = array('name' => 'CPQuantity', 'value' => set_value('CPQuantity'), 'id' => 'CPQuantity', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'Ratechange();calculateFreight(3);calculateFreightlocaddper()');
|
$data = array('name' => 'CPQuantity', 'value' => set_value('CPQuantity'), 'id' => 'CPQuantity', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'ExceedQuantityCheck();Ratechange();calculateFreight(3);calculateFreightlocaddper()');
|
||||||
echo form_input($data);
|
echo form_input($data);
|
||||||
?>
|
?>
|
||||||
</div>
|
</div>
|
||||||
@ -2562,7 +2562,7 @@ $(document).ready(function () {
|
|||||||
<label>Quantity<span class="text-danger">*</span></label>
|
<label>Quantity<span class="text-danger">*</span></label>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<?php
|
<?php
|
||||||
$data = array('name' => 'EditCPQuantity', 'value' => set_value('EditCPQuantity'), 'id' => 'EditCPQuantity', 'class' => 'form-control', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'EditRatechange();calculateFreight(4);calculateFreightloceditper()');
|
$data = array('name' => 'EditCPQuantity', 'value' => set_value('EditCPQuantity'), 'id' => 'EditCPQuantity', 'class' => 'form-control', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'ExceedEditQuantityCheck();EditRatechange();calculateFreight(4);calculateFreightloceditper()');
|
||||||
echo form_input($data);
|
echo form_input($data);
|
||||||
?>
|
?>
|
||||||
</div>
|
</div>
|
||||||
@ -4270,9 +4270,6 @@ $(document).ready(function () {
|
|||||||
$('#CostCenter').focus();
|
$('#CostCenter').focus();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
//ExceedQuantityCheck();
|
|
||||||
|
|
||||||
if (ExceedQuantityCheck()) {
|
|
||||||
|
|
||||||
|
|
||||||
if ($('#CPQuantity').val() != '' && $('#CPRate').val() != '') {
|
if ($('#CPQuantity').val() != '' && $('#CPRate').val() != '') {
|
||||||
@ -4427,32 +4424,133 @@ $(document).ready(function () {
|
|||||||
$('CPRate').focus();
|
$('CPRate').focus();
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
|
||||||
//clearTaxField();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* This function used to check quantity exceeding or not */
|
/* This function used to check quantity exceeding or not */
|
||||||
|
|
||||||
function ExceedQuantityCheck() {
|
function ExceedQuantityCheck() {
|
||||||
var EnterQuantity = $("#CPQuantity").val() == '' ? "0.00" : parseFloat($("#CPQuantity").val());
|
|
||||||
var ReqQuantity = parseFloat(RequistQuantity);
|
let availableReqQty = 0 ;
|
||||||
//alert(ReqQuantity);
|
let usedReqQty = 0;
|
||||||
//if(EnterQuantity > ReqQuantity)
|
let originalReqQty = 0;
|
||||||
// {
|
|
||||||
// alert('Your exceeding the Quantity from the Requisition Quantity:'+ RequistQuantity +'.Please adjust the Quantity to proceed further.');
|
$('#loader').show();
|
||||||
|
|
||||||
|
$.ajax({
|
||||||
|
type: "POST",
|
||||||
|
url: "<?php echo base_url();?>exceedEditQuantityCheck",
|
||||||
|
data: {
|
||||||
|
'ReqNo': $('#Reqnumber').val(),
|
||||||
|
'MaterialCode': $('#MaterialCode').val(),
|
||||||
|
'PONO' : "<?php echo $PONO; ?>"
|
||||||
|
},
|
||||||
|
success: function (response) {
|
||||||
|
|
||||||
|
usedReqQty = response.data.usedReqQty[0].usedReqQty;
|
||||||
|
|
||||||
|
originalReqQty = response.data.originalReqQty[0].originalReqQty;
|
||||||
|
|
||||||
|
currentPOQty = response.data.currentPOQty[0].currentPOQty;
|
||||||
|
|
||||||
|
availableReqQty = parseFloat(originalReqQty) - parseFloat(usedReqQty);
|
||||||
|
|
||||||
|
availableReqQty += parseFloat(currentPOQty);
|
||||||
|
|
||||||
|
var EnterQuantity = $("#CPQuantity").val() == '' ? "0.00" : parseFloat($("#CPQuantity").val());
|
||||||
|
|
||||||
|
availableReqQty = parseFloat(availableReqQty);
|
||||||
|
|
||||||
|
|
||||||
|
if(EnterQuantity > availableReqQty )
|
||||||
|
{
|
||||||
|
alert('Your exceeding the Quantity from the Available Requisition Quantity:'+ availableReqQty +'.Please adjust the Quantity to proceed further.');
|
||||||
|
$('#CPQuantity').focus();
|
||||||
|
$('#CPQuantity').val('');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
|
||||||
|
return true;
|
||||||
|
|
||||||
|
}
|
||||||
|
},
|
||||||
|
error: function (xhr, status, error) {
|
||||||
|
console.error("Error fetching requisition quantity: " + error);
|
||||||
|
},complete: function () {
|
||||||
|
console.log("Ajax request for ---> exceedEditQuantityCheck completed....!!");
|
||||||
|
$('#loader').hide();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
function ExceedEditQuantityCheck() {
|
||||||
|
|
||||||
|
|
||||||
|
let availableReqQty = 0 ;
|
||||||
|
let usedReqQty = 0;
|
||||||
|
let originalReqQty = 0;
|
||||||
|
|
||||||
|
$('#loader').show();
|
||||||
|
|
||||||
|
$.ajax({
|
||||||
|
type: "POST",
|
||||||
|
url: "<?php echo base_url();?>exceedEditQuantityCheck",
|
||||||
|
data: {
|
||||||
|
'ReqNo': $('#EditReqnumber').val(),
|
||||||
|
'MaterialCode': $('#EditMaterialCode').val(),
|
||||||
|
'PONO' : "<?php echo $PONO; ?>"
|
||||||
|
},
|
||||||
|
success: function (response) {
|
||||||
|
|
||||||
|
usedReqQty = response.data.usedReqQty[0].usedReqQty;
|
||||||
|
|
||||||
|
originalReqQty = response.data.originalReqQty[0].originalReqQty;
|
||||||
|
|
||||||
|
currentPOQty = response.data.currentPOQty[0].currentPOQty;
|
||||||
|
|
||||||
|
availableReqQty = parseFloat(originalReqQty) - parseFloat(usedReqQty);
|
||||||
|
|
||||||
|
availableReqQty += parseFloat(currentPOQty);
|
||||||
|
|
||||||
|
var EnterQuantity = $("#EditCPQuantity").val() == '' ? "0.00" : parseFloat($("#EditCPQuantity").val());
|
||||||
|
|
||||||
|
availableReqQty = parseFloat(availableReqQty);
|
||||||
|
|
||||||
|
|
||||||
|
if(EnterQuantity > availableReqQty )
|
||||||
|
{
|
||||||
|
alert('Your exceeding the Quantity from the Available Requisition Quantity:'+ availableReqQty +'.Please adjust the Quantity to proceed further.');
|
||||||
|
$('#EditCPQuantity').focus();
|
||||||
|
$('#EditCPQuantity').val('');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
|
||||||
|
return true;
|
||||||
|
|
||||||
|
}
|
||||||
|
},
|
||||||
|
error: function (xhr, status, error) {
|
||||||
|
console.error("Error fetching requisition quantity: " + error);
|
||||||
|
},complete: function () {
|
||||||
|
console.log("Ajax request for ---> exceedEditQuantityCheck completed....!!");
|
||||||
|
$('#loader').hide();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// $('#CPQuantity').focus();
|
|
||||||
// return false;
|
|
||||||
// }
|
|
||||||
// else
|
|
||||||
//{
|
|
||||||
return true;
|
|
||||||
|
|
||||||
//}
|
|
||||||
}
|
|
||||||
/*
|
/*
|
||||||
This function is used to calculate tax
|
This function is used to calculate tax
|
||||||
*/
|
*/
|
||||||
@ -4802,7 +4900,7 @@ $(document).ready(function () {
|
|||||||
$('.AddCapital').click(function() {
|
$('.AddCapital').click(function() {
|
||||||
tinyMCE.triggerSave();
|
tinyMCE.triggerSave();
|
||||||
|
|
||||||
if (validateCapitalTax() && validateExceedLimit() && ExceedQuantityCheck()) {
|
if (validateCapitalTax() && validateExceedLimit() ) {
|
||||||
var temp = index;
|
var temp = index;
|
||||||
var capital = <?php echo json_encode($CapitalRange, JSON_PRETTY_PRINT) ?>;
|
var capital = <?php echo json_encode($CapitalRange, JSON_PRETTY_PRINT) ?>;
|
||||||
var Reqnumber = $('#Reqnumber').val();
|
var Reqnumber = $('#Reqnumber').val();
|
||||||
@ -5184,7 +5282,6 @@ $(document).ready(function () {
|
|||||||
$('#txtTotalOrderValue').val(tot);
|
$('#txtTotalOrderValue').val(tot);
|
||||||
|
|
||||||
validateExceedLimit();
|
validateExceedLimit();
|
||||||
ExceedQuantityCheck();
|
|
||||||
}
|
}
|
||||||
/* calculate tax value*/
|
/* calculate tax value*/
|
||||||
function calculateTaxValue() {
|
function calculateTaxValue() {
|
||||||
@ -6327,10 +6424,6 @@ $(document).ready(function () {
|
|||||||
$('#EditCostCenter').focus();
|
$('#EditCostCenter').focus();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
// EditExceedQuantityCheck();
|
|
||||||
|
|
||||||
if (EditExceedQuantityCheck()) {
|
|
||||||
|
|
||||||
|
|
||||||
if ($('#EditCPQuantity').val() != '' && $('#EditCPRate').val() != '') {
|
if ($('#EditCPQuantity').val() != '' && $('#EditCPRate').val() != '') {
|
||||||
|
|
||||||
@ -6486,9 +6579,6 @@ $(document).ready(function () {
|
|||||||
$('CPRate').focus();
|
$('CPRate').focus();
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
|
||||||
//clearTaxField();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -6531,34 +6621,14 @@ $(document).ready(function () {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* This function used to check quantity exceeding or not while Editing*/
|
|
||||||
|
|
||||||
function EditExceedQuantityCheck() {
|
|
||||||
var EnterQuantity = $("#EditCPQuantity").val() == '' ? "0.00" : parseFloat($("#EditCPQuantity").val());
|
|
||||||
var ReqQuantity = parseFloat(RequistQuantity);
|
|
||||||
|
|
||||||
//alert(ReqQuantity);
|
|
||||||
// if(EnterQuantity != ReqQuantity)
|
|
||||||
// {
|
|
||||||
// alert('Your exceeding the Quantity from the Requisition Quantity:'+ RequistQuantity +'.Please adjust the Quantity to proceed further.');
|
|
||||||
|
|
||||||
// $('#EditCPQuantity').focus();
|
|
||||||
// return false;
|
|
||||||
// }
|
|
||||||
// else
|
|
||||||
// {
|
|
||||||
|
|
||||||
return true;
|
|
||||||
|
|
||||||
//}
|
|
||||||
}
|
|
||||||
/**
|
/**
|
||||||
* This function is used for Edit Capital
|
* This function is used for Edit Capital
|
||||||
*/
|
*/
|
||||||
$('.EditCapital').click(function() {
|
$('.EditCapital').click(function() {
|
||||||
|
|
||||||
tinyMCE.triggerSave();
|
tinyMCE.triggerSave();
|
||||||
if (validateEditCapitalTax() && EditExceedQuantityCheck() && validateEditExceedLimit()) {
|
if (validateEditCapitalTax() && validateEditExceedLimit()) {
|
||||||
var capital = <?php echo json_encode($CapitalRange, JSON_PRETTY_PRINT) ?>;
|
var capital = <?php echo json_encode($CapitalRange, JSON_PRETTY_PRINT) ?>;
|
||||||
var tr = document.getElementById(userid);
|
var tr = document.getElementById(userid);
|
||||||
var cellval = tr.cells;
|
var cellval = tr.cells;
|
||||||
@ -6909,7 +6979,6 @@ $(document).ready(function () {
|
|||||||
$('#EdittxtTotalOrderValue').val(tot);
|
$('#EdittxtTotalOrderValue').val(tot);
|
||||||
|
|
||||||
validateEditExceedLimit();
|
validateEditExceedLimit();
|
||||||
EditExceedQuantityCheck();
|
|
||||||
}
|
}
|
||||||
/* calculate tax value*/
|
/* calculate tax value*/
|
||||||
function EditcalculateTaxValue() {
|
function EditcalculateTaxValue() {
|
||||||
|
|||||||
@ -853,7 +853,7 @@ if (!empty($RequistionDetails)) {
|
|||||||
<label>Quantity<span class="text-danger">*</span></label>
|
<label>Quantity<span class="text-danger">*</span></label>
|
||||||
<div>
|
<div>
|
||||||
<?php
|
<?php
|
||||||
$data = array('name' => 'EditQuantity', 'value' => set_value('EditQuantity'), 'id' => 'EditQuantity', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'EditRatechange(),ExceedEditQuantityCheck()');
|
$data = array('name' => 'EditQuantity', 'value' => set_value('EditQuantity'), 'id' => 'EditQuantity', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'ExceedEditQuantityCheck();EditRatechange();');
|
||||||
echo form_input($data);
|
echo form_input($data);
|
||||||
|
|
||||||
?>
|
?>
|
||||||
@ -969,7 +969,7 @@ if (!empty($RequistionDetails)) {
|
|||||||
<div class="form-group col-md-4">
|
<div class="form-group col-md-4">
|
||||||
<div>
|
<div>
|
||||||
<?php
|
<?php
|
||||||
$data = array('name' => 'EditLandingCharge', 'value' => set_value('EditLandingCharge'), 'id' => 'EditLandingCharge', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'EditCalculateloadingcharge()');
|
$data = array('name' => 'EditLandingCharge', 'value' => set_value('EditLandingCharge'), 'id' => 'EditLandingCharge', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'EditCalculateloadingcharge();');
|
||||||
echo form_input($data);
|
echo form_input($data);
|
||||||
?>
|
?>
|
||||||
</div>
|
</div>
|
||||||
@ -2243,18 +2243,68 @@ if (!empty($RequistionDetails)) {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
function ExceedEditQuantityCheck() {
|
function ExceedEditQuantityCheck() {
|
||||||
// RequistQuantity
|
|
||||||
var EnterQuantity = $("#EditQuantity").val() == '' ? "0.00" : parseFloat($("#EditQuantity").val());
|
|
||||||
var ReqQuantity = parseFloat(RequistQuantity);
|
let availableReqQty = 0 ;
|
||||||
if (EnterQuantity > ReqQuantity) {
|
let usedReqQty = 0;
|
||||||
alert('Your exceeding the Quantity from the Requisition Quantity:' + RequistQuantity + '.Please adjust the Quantity to proceed further.');
|
let originalReqQty = 0;
|
||||||
$('#EditQuantity').focus();
|
|
||||||
return false;
|
$('#loader').show();
|
||||||
} else {
|
|
||||||
return true;
|
$.ajax({
|
||||||
}
|
type: "POST",
|
||||||
}
|
url: "<?php echo base_url();?>exceedEditQuantityCheck",
|
||||||
|
|
||||||
|
data: {
|
||||||
|
'ReqNo': $('#EditReqNo').val(),
|
||||||
|
'MaterialCode': $('#EditMaterialCode').val(),
|
||||||
|
'PONO' : "<?php echo $PONO; ?>"
|
||||||
|
},
|
||||||
|
success: function (response) {
|
||||||
|
|
||||||
|
usedReqQty = response.data.usedReqQty[0].usedReqQty;
|
||||||
|
|
||||||
|
originalReqQty = response.data.originalReqQty[0].originalReqQty;
|
||||||
|
|
||||||
|
currentPOQty = response.data.currentPOQty[0].currentPOQty;
|
||||||
|
|
||||||
|
availableReqQty = parseFloat(originalReqQty) - parseFloat(usedReqQty);
|
||||||
|
|
||||||
|
availableReqQty += parseFloat(currentPOQty);
|
||||||
|
|
||||||
|
var EnterQuantity = $("#EditQuantity").val() == '' ? "0.00" : parseFloat($("#EditQuantity").val());
|
||||||
|
|
||||||
|
availableReqQty = parseFloat(availableReqQty);
|
||||||
|
|
||||||
|
|
||||||
|
if(EnterQuantity > availableReqQty )
|
||||||
|
{
|
||||||
|
alert('Your exceeding the Quantity from the Available Requisition Quantity:'+ availableReqQty +'.Please adjust the Quantity to proceed further.');
|
||||||
|
|
||||||
|
$('#EditQuantity').focus();
|
||||||
|
$('#EditQuantity').val('');
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
|
||||||
|
return true;
|
||||||
|
|
||||||
|
}
|
||||||
|
},
|
||||||
|
error: function (xhr, status, error) {
|
||||||
|
console.error("Error fetching requisition quantity: " + error);
|
||||||
|
},complete: function () {
|
||||||
|
console.log("Ajax request for ---> exceedEditQuantityCheck completed....!!");
|
||||||
|
$('#loader').hide();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function EditCalculateCustomduty() {
|
function EditCalculateCustomduty() {
|
||||||
@ -2745,7 +2795,7 @@ if (!empty($RequistionDetails)) {
|
|||||||
|
|
||||||
$('.EditImport').click(function() {
|
$('.EditImport').click(function() {
|
||||||
//alert('inside edit');
|
//alert('inside edit');
|
||||||
if (validateEditExceedLimit() && ExceedEditQuantityCheck() && EditQtyZerocheck()) {
|
if (validateEditExceedLimit() && EditQtyZerocheck()) {
|
||||||
|
|
||||||
var CostCode = $("#EditCostCenter").val();
|
var CostCode = $("#EditCostCenter").val();
|
||||||
var AvilBudget = $('#EditAvlBudAmt').val();
|
var AvilBudget = $('#EditAvlBudAmt').val();
|
||||||
@ -3263,11 +3313,13 @@ if (!empty($RequistionDetails)) {
|
|||||||
} else {
|
} else {
|
||||||
var basicValue = parseFloat($('#EditINRBasicvalue').val());
|
var basicValue = parseFloat($('#EditINRBasicvalue').val());
|
||||||
var FreightType = $("#drpamendFreight").val();
|
var FreightType = $("#drpamendFreight").val();
|
||||||
if (FreightType == "0") {
|
|
||||||
alert('Please select Freight Type');
|
// if (FreightType == "0") {
|
||||||
$('#AmendtxtFreight').val('');
|
// alert('Please select Freight Type');
|
||||||
$("#drpamendFreight").focus();
|
// $('#AmendtxtFreight').val('');
|
||||||
} else if ($('#AmendtxtFreight').val() != "0" && $('#AmendtxtFreight').val() != '') {
|
// $("#drpamendFreight").focus();
|
||||||
|
// } else
|
||||||
|
if ($('#AmendtxtFreight').val() != "0" && $('#AmendtxtFreight').val() != '') {
|
||||||
var FreightValue = parseFloat($('#AmendtxtFreight').val());
|
var FreightValue = parseFloat($('#AmendtxtFreight').val());
|
||||||
var UOM = parseFloat($('#EditUOM').val());
|
var UOM = parseFloat($('#EditUOM').val());
|
||||||
var Quantity = parseFloat($('#EditQuantity').val());
|
var Quantity = parseFloat($('#EditQuantity').val());
|
||||||
|
|||||||
@ -856,7 +856,7 @@ if (!empty($INRSYMBOL)) {
|
|||||||
|
|
||||||
|
|
||||||
function Editchange() {
|
function Editchange() {
|
||||||
//ExceedEditQuantityCheck();
|
|
||||||
if (($('#EditQuantity').val() != '' || $('#EditQuantity').val() != 0) && ($('#EditRate').val() != '' || $('#EditRate').val() != 0)) {
|
if (($('#EditQuantity').val() != '' || $('#EditQuantity').val() != 0) && ($('#EditRate').val() != '' || $('#EditRate').val() != 0)) {
|
||||||
var txtQuantity = parseFloat($('#EditQuantity').val());
|
var txtQuantity = parseFloat($('#EditQuantity').val());
|
||||||
var txtUnitPrice = parseFloat($('#EditRate').val());
|
var txtUnitPrice = parseFloat($('#EditRate').val());
|
||||||
@ -1908,7 +1908,7 @@ if (!empty($INRSYMBOL)) {
|
|||||||
<label>Quantity<span class="text-danger">*</span></label>
|
<label>Quantity<span class="text-danger">*</span></label>
|
||||||
<div>
|
<div>
|
||||||
<?php
|
<?php
|
||||||
$data = array('name' => 'EditQuantity', 'value' => set_value('EditQuantity'), 'id' => 'EditQuantity', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'Editchange()', 'style' => 'text-align:right;');
|
$data = array('name' => 'EditQuantity', 'value' => set_value('EditQuantity'), 'id' => 'EditQuantity', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'Editchange();ExceedEditQuantityCheck();', 'style' => 'text-align:right;');
|
||||||
echo form_input($data);
|
echo form_input($data);
|
||||||
?>
|
?>
|
||||||
|
|
||||||
@ -2303,6 +2303,75 @@ if (!empty($INRSYMBOL)) {
|
|||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</script> -->
|
</script> -->
|
||||||
|
|
||||||
|
|
||||||
|
<script>
|
||||||
|
|
||||||
|
|
||||||
|
let isOpenOrder = '<?php echo $isOpenOrder; ?>';
|
||||||
|
|
||||||
|
function ExceedEditQuantityCheck() {
|
||||||
|
|
||||||
|
|
||||||
|
let availableReqQty = 0 ;
|
||||||
|
let usedReqQty = 0;
|
||||||
|
let originalReqQty = 0;
|
||||||
|
|
||||||
|
$('#loader').show();
|
||||||
|
|
||||||
|
$.ajax({
|
||||||
|
type: "POST",
|
||||||
|
url: "<?php echo base_url();?>exceedEditQuantityCheck",
|
||||||
|
data: {
|
||||||
|
'ReqNo': $('#EditReqNo').val(),
|
||||||
|
'MaterialCode': $('#EditMaterialCode').val(),
|
||||||
|
'PONO' : "<?php echo $PONO; ?>"
|
||||||
|
},
|
||||||
|
success: function (response) {
|
||||||
|
|
||||||
|
usedReqQty = response.data.usedReqQty[0].usedReqQty;
|
||||||
|
|
||||||
|
originalReqQty = response.data.originalReqQty[0].originalReqQty;
|
||||||
|
|
||||||
|
currentPOQty = response.data.currentPOQty[0].currentPOQty;
|
||||||
|
|
||||||
|
availableReqQty = parseFloat(originalReqQty) - parseFloat(usedReqQty);
|
||||||
|
|
||||||
|
availableReqQty += parseFloat(currentPOQty);
|
||||||
|
|
||||||
|
var EnterQuantity = $("#EditQuantity").val() == '' ? "0.00" : parseFloat($("#EditQuantity").val());
|
||||||
|
|
||||||
|
availableReqQty = parseFloat(availableReqQty);
|
||||||
|
|
||||||
|
|
||||||
|
if(EnterQuantity > availableReqQty && isOpenOrder == 0)
|
||||||
|
{
|
||||||
|
alert('Your exceeding the Quantity from the Available Requisition Quantity:'+ availableReqQty +'.Please adjust the Quantity to proceed further.');
|
||||||
|
$('#EditQuantity').focus();
|
||||||
|
$('#EditQuantity').val('');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
|
||||||
|
return true;
|
||||||
|
|
||||||
|
}
|
||||||
|
},
|
||||||
|
error: function (xhr, status, error) {
|
||||||
|
console.error("Error fetching requisition quantity: " + error);
|
||||||
|
},complete: function () {
|
||||||
|
console.log("Ajax request for ---> exceedEditQuantityCheck completed....!!");
|
||||||
|
$('#loader').hide();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
$(document).on('click', '.editable-field', function(e) {
|
$(document).on('click', '.editable-field', function(e) {
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@ -1618,7 +1618,7 @@ foreach ($PaymentTerms as $TER) {
|
|||||||
</label>
|
</label>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<?php
|
<?php
|
||||||
$data = array('name' => 'EditQuantity', 'value' => set_value('EditQuantity'), 'id' => 'EditQuantity', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'EditRatechange()');
|
$data = array('name' => 'EditQuantity', 'value' => set_value('EditQuantity'), 'id' => 'EditQuantity', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'ExceedEditQuantityCheck();EditRatechange();');
|
||||||
echo form_input($data);
|
echo form_input($data);
|
||||||
?>
|
?>
|
||||||
</div>
|
</div>
|
||||||
@ -1807,6 +1807,71 @@ foreach ($PaymentTerms as $TER) {
|
|||||||
</div> <!-- content -->
|
</div> <!-- content -->
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
|
||||||
|
|
||||||
|
let isOpenOrder = '<?php echo $isOpenOrder; ?>';
|
||||||
|
|
||||||
|
function ExceedEditQuantityCheck() {
|
||||||
|
|
||||||
|
|
||||||
|
let availableReqQty = 0 ;
|
||||||
|
let usedReqQty = 0;
|
||||||
|
let originalReqQty = 0;
|
||||||
|
|
||||||
|
$('#loader').show();
|
||||||
|
|
||||||
|
$.ajax({
|
||||||
|
type: "POST",
|
||||||
|
url: "<?php echo base_url();?>exceedEditQuantityCheck",
|
||||||
|
data: {
|
||||||
|
'ReqNo': $('#EditReqNo').val(),
|
||||||
|
'MaterialCode': $('#EditMaterialCode').val(),
|
||||||
|
'PONO' : "<?php echo $PONO; ?>"
|
||||||
|
},
|
||||||
|
success: function (response) {
|
||||||
|
|
||||||
|
usedReqQty = response.data.usedReqQty[0].usedReqQty;
|
||||||
|
|
||||||
|
originalReqQty = response.data.originalReqQty[0].originalReqQty;
|
||||||
|
|
||||||
|
currentPOQty = response.data.currentPOQty[0].currentPOQty;
|
||||||
|
|
||||||
|
availableReqQty = parseFloat(originalReqQty) - parseFloat(usedReqQty);
|
||||||
|
|
||||||
|
availableReqQty += parseFloat(currentPOQty);
|
||||||
|
|
||||||
|
var EnterQuantity = $("#EditQuantity").val() == '' ? "0.00" : parseFloat($("#EditQuantity").val());
|
||||||
|
|
||||||
|
availableReqQty = parseFloat(availableReqQty);
|
||||||
|
|
||||||
|
if(EnterQuantity > availableReqQty && isOpenOrder == 0)
|
||||||
|
{
|
||||||
|
alert('Your exceeding the Quantity from the Available Requisition Quantity:'+ availableReqQty +'.Please adjust the Quantity to proceed further.');
|
||||||
|
$('#EditQuantity').focus();
|
||||||
|
$('#EditQuantity').val('');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
|
||||||
|
return true;
|
||||||
|
|
||||||
|
}
|
||||||
|
},
|
||||||
|
error: function (xhr, status, error) {
|
||||||
|
console.error("Error fetching requisition quantity: " + error);
|
||||||
|
},complete: function () {
|
||||||
|
console.log("Ajax request for ---> exceedEditQuantityCheck completed....!!");
|
||||||
|
$('#loader').hide();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
$(document).on('click', '.editable-field', function(e) {
|
$(document).on('click', '.editable-field', function(e) {
|
||||||
|
|||||||
@ -1561,7 +1561,7 @@ if (!empty($getlogpodtl)) {
|
|||||||
<label>Quantity<span class="text-danger" style="color:red;text-align:right;background-color: #fff;">*</span></label>
|
<label>Quantity<span class="text-danger" style="color:red;text-align:right;background-color: #fff;">*</span></label>
|
||||||
<div>
|
<div>
|
||||||
<?php
|
<?php
|
||||||
$data = array('name' => 'Quantity', 'value' => set_value('Quantity'), 'id' => 'Quantity', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'Ratechange(),calculateFreight(0)');
|
$data = array('name' => 'Quantity', 'value' => set_value('Quantity'), 'id' => 'Quantity', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'Ratechange(),ExceedQuantityCheck(),calculateFreight(0)');
|
||||||
echo form_input($data);
|
echo form_input($data);
|
||||||
|
|
||||||
?>
|
?>
|
||||||
@ -2147,7 +2147,7 @@ if (!empty($getlogpodtl)) {
|
|||||||
<label>Quantity<span class="text-danger" style="color:red;text-align:right;background-color: #fff;">*</span></label>
|
<label>Quantity<span class="text-danger" style="color:red;text-align:right;background-color: #fff;">*</span></label>
|
||||||
<div>
|
<div>
|
||||||
<?php
|
<?php
|
||||||
$data = array('name' => 'EditQuantity', 'value' => set_value('EditQuantity'), 'id' => 'EditQuantity', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'EditRatechange(),ExceedEditQuantityCheck()');
|
$data = array('name' => 'EditQuantity', 'value' => set_value('EditQuantity'), 'id' => 'EditQuantity', 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'EditRatechange();ExceedEditQuantityCheck();');
|
||||||
echo form_input($data);
|
echo form_input($data);
|
||||||
|
|
||||||
?>
|
?>
|
||||||
@ -2671,7 +2671,7 @@ if (!empty($getlogpodtl)) {
|
|||||||
<div class="form-group col-md-3">
|
<div class="form-group col-md-3">
|
||||||
<label>Quantity<span class="text-danger" style="color:red;text-align:right;background-color: #fff;">*</span></label>
|
<label>Quantity<span class="text-danger" style="color:red;text-align:right;background-color: #fff;">*</span></label>
|
||||||
<div>
|
<div>
|
||||||
<?php $data = array('name' => 'ViewQuantity', 'value' => set_value('ViewQuantity'), 'id' => 'ViewQuantity', 'readonly' => true, 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'EditRatechange(),ExceedEditQuantityCheck()');
|
<?php $data = array('name' => 'ViewQuantity', 'value' => set_value('ViewQuantity'), 'id' => 'ViewQuantity', 'readonly' => true, 'class' => 'form-control num', 'onkeypress' => 'return isNumberKey(event);', 'onchange' => 'EditRatechange()');
|
||||||
echo form_input($data); ?>
|
echo form_input($data); ?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -3706,27 +3706,6 @@ if (!empty($getlogpodtl)) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function ExceedEditQuantityCheck() { //salert();
|
|
||||||
// RequistQuantity
|
|
||||||
var EnterQuantity = $("#EditQuantity").val() == '' ? "0.00" : parseFloat($("#EditQuantity").val());
|
|
||||||
var ReqQuantity = parseFloat(RequistQuantity);
|
|
||||||
|
|
||||||
//alert(reqq);
|
|
||||||
//var ReqQuantity=parseFloat($('#EditQuantity').val());
|
|
||||||
//if(EnterQuantity != ReqQuantity)
|
|
||||||
// {
|
|
||||||
// alert('Your exceeding the Quantity from the Requisition Quantity:'+ RequistQuantity +'.Please adjust the Quantity to proceed further.');
|
|
||||||
// $('#EditQuantity').focus();
|
|
||||||
// return false;
|
|
||||||
// }
|
|
||||||
// else
|
|
||||||
// {
|
|
||||||
return true;
|
|
||||||
//}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
function EditCalculateCustomduty() {
|
function EditCalculateCustomduty() {
|
||||||
|
|
||||||
var txtbasic = 0;
|
var txtbasic = 0;
|
||||||
@ -4152,22 +4131,124 @@ if (!empty($getlogpodtl)) {
|
|||||||
|
|
||||||
//index = parseInt(index)+1;
|
//index = parseInt(index)+1;
|
||||||
|
|
||||||
function ExceedQuantityCheck() {
|
function ExceedQuantityCheck() {
|
||||||
// RequistQuantity
|
|
||||||
var EnterQuantity = $("#Quantity").val() == '' ? "0.00" : parseFloat($("#Quantity").val());
|
let availableReqQty = 0 ;
|
||||||
var ReqQuantity = parseFloat(RequistQuantity);
|
let usedReqQty = 0;
|
||||||
//if(EnterQuantity > ReqQuantity)
|
let originalReqQty = 0;
|
||||||
// {
|
|
||||||
// alert('Your exceeding the Quantity from the Requisition Quantity:'+ RequistQuantity +'.Please adjust the Quantity to proceed further.');
|
$('#loader').show();
|
||||||
// //$('#Quantity').val(RequistQuantity);
|
|
||||||
// $('#Quantity').focus();
|
$.ajax({
|
||||||
// return false;
|
type: "POST",
|
||||||
// }
|
url: "<?php echo base_url();?>exceedEditQuantityCheck",
|
||||||
// else
|
data: {
|
||||||
//{
|
'ReqNo': $('#ReqNo').val(),
|
||||||
return true;
|
'MaterialCode': $('#MaterialCode').val(),
|
||||||
//}
|
'PONO' : "<?php echo $PONO; ?>"
|
||||||
}
|
},
|
||||||
|
success: function (response) {
|
||||||
|
|
||||||
|
usedReqQty = response.data.usedReqQty[0].usedReqQty;
|
||||||
|
|
||||||
|
originalReqQty = response.data.originalReqQty[0].originalReqQty;
|
||||||
|
|
||||||
|
currentPOQty = response.data.currentPOQty[0].currentPOQty;
|
||||||
|
|
||||||
|
availableReqQty = parseFloat(originalReqQty) - parseFloat(usedReqQty);
|
||||||
|
|
||||||
|
availableReqQty += parseFloat(currentPOQty);
|
||||||
|
|
||||||
|
var EnterQuantity = $("#Quantity").val() == '' ? "0.00" : parseFloat($("#Quantity").val());
|
||||||
|
|
||||||
|
availableReqQty = parseFloat(availableReqQty);
|
||||||
|
|
||||||
|
|
||||||
|
if(EnterQuantity > availableReqQty )
|
||||||
|
{
|
||||||
|
alert('Your exceeding the Quantity from the Available Requisition Quantity:'+ availableReqQty +'.Please adjust the Quantity to proceed further.');
|
||||||
|
$('#Quantity').focus();
|
||||||
|
$('#Quantity').val('');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
|
||||||
|
return true;
|
||||||
|
|
||||||
|
}
|
||||||
|
},
|
||||||
|
error: function (xhr, status, error) {
|
||||||
|
console.error("Error fetching requisition quantity: " + error);
|
||||||
|
},complete: function () {
|
||||||
|
console.log("Ajax request for ---> exceedEditQuantityCheck completed....!!");
|
||||||
|
$('#loader').hide();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
function ExceedEditQuantityCheck() {
|
||||||
|
|
||||||
|
|
||||||
|
let availableReqQty = 0 ;
|
||||||
|
let usedReqQty = 0;
|
||||||
|
let originalReqQty = 0;
|
||||||
|
|
||||||
|
$('#loader').show();
|
||||||
|
|
||||||
|
$.ajax({
|
||||||
|
type: "POST",
|
||||||
|
url: "<?php echo base_url();?>exceedEditQuantityCheck",
|
||||||
|
|
||||||
|
data: {
|
||||||
|
'ReqNo': $('#EditReqNo').val(),
|
||||||
|
'MaterialCode': $('#EditMaterialCode').val(),
|
||||||
|
'PONO' : "<?php echo $PONO; ?>"
|
||||||
|
},
|
||||||
|
success: function (response) {
|
||||||
|
|
||||||
|
usedReqQty = response.data.usedReqQty[0].usedReqQty;
|
||||||
|
|
||||||
|
originalReqQty = response.data.originalReqQty[0].originalReqQty;
|
||||||
|
|
||||||
|
currentPOQty = response.data.currentPOQty[0].currentPOQty;
|
||||||
|
|
||||||
|
availableReqQty = parseFloat(originalReqQty) - parseFloat(usedReqQty);
|
||||||
|
|
||||||
|
availableReqQty += parseFloat(currentPOQty);
|
||||||
|
|
||||||
|
var EnterQuantity = $("#EditQuantity").val() == '' ? "0.00" : parseFloat($("#EditQuantity").val());
|
||||||
|
|
||||||
|
availableReqQty = parseFloat(availableReqQty);
|
||||||
|
|
||||||
|
|
||||||
|
if(EnterQuantity > availableReqQty )
|
||||||
|
{
|
||||||
|
alert('Your exceeding the Quantity from the Available Requisition Quantity:'+ availableReqQty +'.Please adjust the Quantity to proceed further.');
|
||||||
|
$('#EditQuantity').focus();
|
||||||
|
$('#EditQuantity').val('');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
|
||||||
|
return true;
|
||||||
|
|
||||||
|
}
|
||||||
|
},
|
||||||
|
error: function (xhr, status, error) {
|
||||||
|
console.error("Error fetching requisition quantity: " + error);
|
||||||
|
},complete: function () {
|
||||||
|
console.log("Ajax request for ---> exceedEditQuantityCheck completed....!!");
|
||||||
|
$('#loader').hide();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
var avalbudAmte = <?php echo json_encode($AvlAmount, JSON_PRETTY_PRINT) ?>;
|
var avalbudAmte = <?php echo json_encode($AvlAmount, JSON_PRETTY_PRINT) ?>;
|
||||||
@ -4981,7 +5062,7 @@ if (!empty($getlogpodtl)) {
|
|||||||
|
|
||||||
$('.EditImport').click(function() {
|
$('.EditImport').click(function() {
|
||||||
// alert('inside edit');
|
// alert('inside edit');
|
||||||
if (validateEditExceedLimit() && ExceedEditQuantityCheck() && EditQtyZerocheck()) {
|
if (validateEditExceedLimit() && EditQtyZerocheck()) {
|
||||||
var CostCode = $("#EditCostCenter").val();
|
var CostCode = $("#EditCostCenter").val();
|
||||||
var AvilBudget = $('#EditAvlBudAmt').val();
|
var AvilBudget = $('#EditAvlBudAmt').val();
|
||||||
var editMaterialCode = $("#EditMaterialCode").val();
|
var editMaterialCode = $("#EditMaterialCode").val();
|
||||||
@ -5787,11 +5868,7 @@ if (!empty($getlogpodtl)) {
|
|||||||
// var basicValue = parseFloat($('#txtBasicValue').val());
|
// var basicValue = parseFloat($('#txtBasicValue').val());
|
||||||
var basicValue = parseFloat($('#INRBasicvalue').val());
|
var basicValue = parseFloat($('#INRBasicvalue').val());
|
||||||
var FreightType = $("#drpaddFreight").val();
|
var FreightType = $("#drpaddFreight").val();
|
||||||
if (FreightType == "0") {
|
if ($('#addtxtFreight').val() != "0" && $('#addtxtFreight').val() != '') {
|
||||||
alert('Please select Freight Type');
|
|
||||||
$('#addtxtFreight').val('');
|
|
||||||
$("#drpaddFreight").focus();
|
|
||||||
} else if ($('#addtxtFreight').val() != "0" && $('#addtxtFreight').val() != '') {
|
|
||||||
var FreightValue = parseFloat($('#addtxtFreight').val());
|
var FreightValue = parseFloat($('#addtxtFreight').val());
|
||||||
var UOM = parseFloat($('#UOM').val());
|
var UOM = parseFloat($('#UOM').val());
|
||||||
var Quantity = parseFloat($('#Quantity').val());
|
var Quantity = parseFloat($('#Quantity').val());
|
||||||
@ -5850,11 +5927,7 @@ if (!empty($getlogpodtl)) {
|
|||||||
} else {
|
} else {
|
||||||
var basicValue = parseFloat($('#EditINRBasicvalue').val());
|
var basicValue = parseFloat($('#EditINRBasicvalue').val());
|
||||||
var FreightType = $("#drpeditFreight").val();
|
var FreightType = $("#drpeditFreight").val();
|
||||||
if (FreightType == "0") {
|
if ($('#edittxtFreight').val() != "0" && $('#edittxtFreight').val() != '') {
|
||||||
alert('Please select Freight Type');
|
|
||||||
$('#edittxtFreight').val('');
|
|
||||||
$("#drpeditFreight").focus();
|
|
||||||
} else if ($('#edittxtFreight').val() != "0" && $('#edittxtFreight').val() != '') {
|
|
||||||
var FreightValue = parseFloat($('#edittxtFreight').val());
|
var FreightValue = parseFloat($('#edittxtFreight').val());
|
||||||
var UOM = parseFloat($('#EditUOM').val());
|
var UOM = parseFloat($('#EditUOM').val());
|
||||||
var Quantity = parseFloat($('#EditQuantity').val());
|
var Quantity = parseFloat($('#EditQuantity').val());
|
||||||
@ -5899,11 +5972,7 @@ if (!empty($getlogpodtl)) {
|
|||||||
|
|
||||||
///console.log(basicValue);
|
///console.log(basicValue);
|
||||||
var FreightType = $("#drpviewFreight").val();
|
var FreightType = $("#drpviewFreight").val();
|
||||||
if (FreightType == "0") {
|
if ($('#viewtxtFreight').val() != "0" && $('#viewtxtFreight').val() != '') {
|
||||||
alert('Please select Freight Type');
|
|
||||||
$('#viewtxtFreight').val('');
|
|
||||||
$("#drpviewFreight").focus();
|
|
||||||
} else if ($('#viewtxtFreight').val() != "0" && $('#viewtxtFreight').val() != '') {
|
|
||||||
var FreightValue = parseFloat($('#viewtxtFreight').val());
|
var FreightValue = parseFloat($('#viewtxtFreight').val());
|
||||||
var UOM = parseFloat($('#ViewUOM').val());
|
var UOM = parseFloat($('#ViewUOM').val());
|
||||||
var Quantity = parseFloat($('#ViewQuantity').val());
|
var Quantity = parseFloat($('#ViewQuantity').val());
|
||||||
@ -5946,4 +6015,21 @@ if (!empty($getlogpodtl)) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
function Reset() { location.reload(); }
|
function Reset() { location.reload(); }
|
||||||
|
|
||||||
|
|
||||||
|
$(document).ready(function(){
|
||||||
|
|
||||||
|
$('#ImportTax').find('tbody tr').each(function() {
|
||||||
|
|
||||||
|
var row = $(this);
|
||||||
|
var requisitionNumber = row.find('td:eq(1)').text().trim();
|
||||||
|
var materialCode = row.find('td:eq(2)').text().trim();
|
||||||
|
|
||||||
|
|
||||||
|
SelectedMaterialList.Mat.push({ReqNo: requisitionNumber, materialCode: materialCode});
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
@ -72,3 +72,15 @@
|
|||||||
</div> <!-- content -->
|
</div> <!-- content -->
|
||||||
</div>
|
</div>
|
||||||
<script type="text/javascript" src="<?php echo base_url(); ?>public/assets/js/common.js" charset="utf-8"></script>
|
<script type="text/javascript" src="<?php echo base_url(); ?>public/assets/js/common.js" charset="utf-8"></script>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
$(document).ready(function() {
|
||||||
|
$('#datatable').DataTable({
|
||||||
|
dom: 'Bfrtip', // Enables the Buttons layout
|
||||||
|
buttons: [
|
||||||
|
'excelHtml5',
|
||||||
|
'pdfHtml5'
|
||||||
|
]
|
||||||
|
});
|
||||||
|
});
|
||||||
|
</script>
|
||||||
@ -95,6 +95,18 @@
|
|||||||
|
|
||||||
<script type="text/javascript" src="<?php echo base_url(); ?>public/assets/js/common.js" charset="utf-8"></script>
|
<script type="text/javascript" src="<?php echo base_url(); ?>public/assets/js/common.js" charset="utf-8"></script>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
$(document).ready(function() {
|
||||||
|
$('#phdays').DataTable({
|
||||||
|
dom: 'Bfrtip', // Enables the Buttons layout
|
||||||
|
buttons: [
|
||||||
|
'excelHtml5',
|
||||||
|
'pdfHtml5'
|
||||||
|
]
|
||||||
|
});
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
function DeleteRow(rowid) {
|
function DeleteRow(rowid) {
|
||||||
var tr = document.getElementById(rowid);
|
var tr = document.getElementById(rowid);
|
||||||
@ -183,8 +195,8 @@
|
|||||||
$('#hname').val('');
|
$('#hname').val('');
|
||||||
$('#hdate').val('');
|
$('#hdate').val('');
|
||||||
|
|
||||||
// Re-initialize DataTable if needed
|
|
||||||
$('#phdays').DataTable();
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@ -337,7 +337,7 @@
|
|||||||
|
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
use PhpOffice\PhpSpreadsheet\Reader\Xml\Style\NumberFormat;
|
use PhpOffice\PhpSpreadsheet\Reader\Xml\Style\NumberFormat;
|
||||||
|
|
||||||
if (session()->getFlashdata('error')): ?>
|
if (session()->getFlashdata('error')): ?>
|
||||||
<div class="alert alert-danger">
|
<div class="alert alert-danger">
|
||||||
@ -1001,15 +1001,15 @@
|
|||||||
<!-- td:eq(6) -->
|
<!-- td:eq(6) -->
|
||||||
<td class="celda_normal"><?php echo $record['grade'] ?? ' ' ?></td>
|
<td class="celda_normal"><?php echo $record['grade'] ?? ' ' ?></td>
|
||||||
<!-- td:eq(7) -->
|
<!-- td:eq(7) -->
|
||||||
<td class="celda_normal"><?php echo number_format((float)$record['totalCoating'],2) ?></td>
|
<td class="celda_normal"><?php echo round((float)$record['totalCoating'],2) ?></td>
|
||||||
<!-- td:eq(8) -->
|
<!-- td:eq(8) -->
|
||||||
<td class="celda_normal"><?php echo number_format((float)$record['totalCoatingSandInKg'],2) ?></td>
|
<td class="celda_normal"><?php echo round((float)$record['totalCoatingSandInKg'],2) ?></td>
|
||||||
<!-- td:eq(9) -->
|
<!-- td:eq(9) -->
|
||||||
<td class="celda_normal"><?php echo number_format((float)$record['totalGasConsumption'],2) ?></td>
|
<td class="celda_normal"><?php echo round((float)$record['totalGasConsumption'],2) ?></td>
|
||||||
<!-- td:eq(10) -->
|
<!-- td:eq(10) -->
|
||||||
<td class="celda_normal"><?php echo number_format($record['perHourGasConsumption'], 2) ?? '' ?></td>
|
<td class="celda_normal"><?php echo round((float)$record['perHourGasConsumption'], 2) ?? '' ?></td>
|
||||||
<!-- td:eq(11) -->
|
<!-- td:eq(11) -->
|
||||||
<td class="celda_normal"><?php echo number_format($record['perHourCoatingSandQTY'] , 2) ?? '' ?></td>
|
<td class="celda_normal"><?php echo round((float)$record['perHourCoatingSandQTY'] , 2) ?? '' ?></td>
|
||||||
<!-- td:eq(12) -->
|
<!-- td:eq(12) -->
|
||||||
<!-- edit and download option..!! -->
|
<!-- edit and download option..!! -->
|
||||||
<td class="celda_normal">
|
<td class="celda_normal">
|
||||||
@ -1079,11 +1079,11 @@
|
|||||||
<td class="celda_normal "> <?= $summary['totalMachineRunningHrs'] ?></td>
|
<td class="celda_normal "> <?= $summary['totalMachineRunningHrs'] ?></td>
|
||||||
<td class="celda_normal "> - </td>
|
<td class="celda_normal "> - </td>
|
||||||
<td class="celda_normal "> - </td>
|
<td class="celda_normal "> - </td>
|
||||||
<td class="celda_normal "><?= number_format($summary['totalCoating'],2) ?></td>
|
<td class="celda_normal "><?= round($summary['totalCoating'],2) ?></td>
|
||||||
<td class="celda_normal "><?= number_format($summary['totalCoatingSandInKg'],2) ?></td>
|
<td class="celda_normal "><?= round($summary['totalCoatingSandInKg'],2) ?></td>
|
||||||
<td class="celda_normal "><?= number_format($summary['totalGasConsumption'],2) ?></td>
|
<td class="celda_normal "><?= round($summary['totalGasConsumption'],2) ?></td>
|
||||||
<td class="celda_normal "><?= number_format($summary['totalGasConsumption'] / $summary['totalMachineRunningHrs'] , 2) ?> (A)</td>
|
<td class="celda_normal "><?= round($summary['totalGasConsumption'] / $summary['totalMachineRunningHrs'] , 2) ?> (A)</td>
|
||||||
<td class="celda_normal "><?= number_format($summary['totalCoatingSandInKg'] / $summary['totalMachineRunningHrs'], 2) ?> (A)</td>
|
<td class="celda_normal "><?= round($summary['totalCoatingSandInKg'] / $summary['totalMachineRunningHrs'], 2) ?> (A)</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tfoot>
|
</tfoot>
|
||||||
|
|
||||||
@ -1362,10 +1362,10 @@
|
|||||||
|
|
||||||
|
|
||||||
let string = `<div class="form-group col-md-4 batch-container">
|
let string = `<div class="form-group col-md-4 batch-container">
|
||||||
<label for="">Change Batch Card</label>
|
<label for="">Uploaded Batch Card</label>
|
||||||
<input type="file" class="editBatchFile additionalBatchFile" name="batchCard[]" >
|
<input type="file" class="editBatchFile additionalBatchFile" name="batchCard[]" disabled>
|
||||||
<p>( Previously Uploaded File ${element.client_given_name} )</p>
|
<p>( Previously Uploaded File ${element.client_given_name} )</p>
|
||||||
<button type="button" class="btn btn-danger btn-sm mt-2 removeBatch auditor-restricted-btn" data-id="${element.batchCardId}" style="display: none;">Remove</button>
|
<button type="button" class="btn btn-danger btn-sm removeBatch auditor-restricted-btn" data-id="${element.batchCardId}" >Remove</button>
|
||||||
</div>`;
|
</div>`;
|
||||||
|
|
||||||
$('#editBatchCardRowId').append(string);
|
$('#editBatchCardRowId').append(string);
|
||||||
@ -1381,8 +1381,8 @@
|
|||||||
$('#editCustomerNameId').val(customerName);
|
$('#editCustomerNameId').val(customerName);
|
||||||
$('#editDateId').val(date); //convert this from d-m-y to Y-m-d in javascript
|
$('#editDateId').val(date); //convert this from d-m-y to Y-m-d in javascript
|
||||||
$('#editShiftId').val(shift);
|
$('#editShiftId').val(shift);
|
||||||
$('#editMachineOnTimeHrId').val(machineOnTimeHr).change();
|
$('#editMachineOnTimeHrId').val(machineOnTimeHr);
|
||||||
$('#editMachineOffTimeHrId').val(machineOffTimeHr).change();
|
$('#editMachineOffTimeHrId').val(machineOffTimeHr);
|
||||||
$('#editGradeId').val(grade);
|
$('#editGradeId').val(grade);
|
||||||
$('#editTotalCoatingId').val(totalCoating);
|
$('#editTotalCoatingId').val(totalCoating);
|
||||||
$('#editTotalCoatingSandId').val(totalCoatingSandInKg);
|
$('#editTotalCoatingSandId').val(totalCoatingSandInKg);
|
||||||
@ -1469,7 +1469,7 @@
|
|||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
$('#totalCoatingId , #shiftId , #gradeId').change(function(){
|
$('#totalCoatingId , #shiftId ').change(function(){
|
||||||
|
|
||||||
let basicCheck =checkIsNumber($(this).val().trim());
|
let basicCheck =checkIsNumber($(this).val().trim());
|
||||||
|
|
||||||
@ -1582,7 +1582,7 @@
|
|||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
$('#editTotalCoatingId , #editShiftId , #editGradeId').change(function() {
|
$('#editTotalCoatingId , #editShiftId ').change(function() {
|
||||||
|
|
||||||
let basicCheck =checkIsNumber($(this).val().trim());
|
let basicCheck =checkIsNumber($(this).val().trim());
|
||||||
|
|
||||||
|
|||||||
@ -1651,7 +1651,7 @@
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$('#dwnldMoistureActualId , #dwnldMoistureSpecId , dwnldLossOfIgnitionId , #dwnldClayId , #dwnldGradeId').on('input', function() {
|
$('#dwnldMoistureActualId , #dwnldMoistureSpecId , #dwnldLossOfIgnitionId , #dwnldClayId , #dwnldGradeId').on('input', function() {
|
||||||
|
|
||||||
let input = $(this).text().trim();
|
let input = $(this).text().trim();
|
||||||
let isValid = checkIsNumber(input);
|
let isValid = checkIsNumber(input);
|
||||||
@ -1659,8 +1659,6 @@
|
|||||||
if (isValid == 0) {
|
if (isValid == 0) {
|
||||||
alert("Kindly Enter Numbers only..!!");
|
alert("Kindly Enter Numbers only..!!");
|
||||||
return;
|
return;
|
||||||
} else {
|
|
||||||
$(this).text(input);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
calculateRow(value='moistureValue');
|
calculateRow(value='moistureValue');
|
||||||
|
|||||||
@ -511,7 +511,7 @@
|
|||||||
$summary = [];
|
$summary = [];
|
||||||
|
|
||||||
foreach ($trpSandUseStockDetails as $trpSandUseStockDetailsIndex => $trpSandUseStockDetail) {
|
foreach ($trpSandUseStockDetails as $trpSandUseStockDetailsIndex => $trpSandUseStockDetail) {
|
||||||
$currentDate = date('d-m-Y');
|
$currentDate = date('Y-m-d');
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<tr class="<?=$trpSandUseStockDetail['date'] > $currentDate ? "hidden-row" : "" ?>"
|
<tr class="<?=$trpSandUseStockDetail['date'] > $currentDate ? "hidden-row" : "" ?>"
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user