stock changes
This commit is contained in:
parent
2927edf798
commit
9981afe243
@ -64,5 +64,27 @@ $db['default']['swap_pre'] = '';
|
||||
$db['default']['autoinit'] = TRUE;
|
||||
$db['default']['stricton'] = FALSE;
|
||||
|
||||
// DB_USERNAME=resicoin_invoice
|
||||
// DB_PASSWORD=resicoin_invoice
|
||||
// DB_DATABASE=resicoin_invoices
|
||||
// DB_DATABASE=resicoin_invoicetest #kasiram9_InvoiceTest
|
||||
|
||||
$db['invoicedb']['hostname'] = 'resicoindustries.com';
|
||||
$db['invoicedb']['username'] = 'resicoin_invoice';
|
||||
$db['invoicedb']['password'] = 'resicoin_invoice';
|
||||
//$db['invoicedb']['database'] = 'resicoin_invoicetest';
|
||||
$db['invoicedb']['database'] = 'resicoin_invoices';
|
||||
$db['invoicedb']['dbdriver'] = 'mysqli';
|
||||
$db['invoicedb']['dbprefix'] = '';
|
||||
$db['invoicedb']['pconnect'] = TRUE;
|
||||
$db['invoicedb']['db_debug'] = FALSE;
|
||||
$db['invoicedb']['cache_on'] = FALSE;
|
||||
$db['invoicedb']['cachedir'] = '';
|
||||
$db['invoicedb']['char_set'] = 'utf8';
|
||||
$db['invoicedb']['dbcollat'] = 'utf8_general_ci';
|
||||
$db['invoicedb']['swap_pre'] = '';
|
||||
$db['invoicedb']['autoinit'] = TRUE;
|
||||
$db['invoicedb']['stricton'] = FALSE;
|
||||
|
||||
/* End of file database.php */
|
||||
/* Location: ./application/config/database.php */
|
||||
File diff suppressed because it is too large
Load Diff
@ -1067,6 +1067,7 @@ class purchaseorder extends BaseController
|
||||
$DeliveryAddr = $this->input->post('txtDeliveryAddress');
|
||||
$dt = $this->input->post('Deliverydt');
|
||||
$DeliveryOption = $this->input->post('DateRange');
|
||||
|
||||
if($DeliveryOption==1){
|
||||
$Deliverydt = '';
|
||||
$DeliverySchedule = $this->input->post('Scheduleby');
|
||||
@ -1087,6 +1088,7 @@ class purchaseorder extends BaseController
|
||||
$fincap=$this->input->post('editfincap');
|
||||
$revenuetype=$this->input->post('PoTypeOptions');
|
||||
$insurancestatus=$this->input->post('insurancestatus');
|
||||
|
||||
if($insurancestatus == 1){
|
||||
$insuranceno=$this->input->post('insuranceno');
|
||||
}else{
|
||||
@ -1122,6 +1124,7 @@ class purchaseorder extends BaseController
|
||||
$POMaster = $this->purchaseorder_model->updatePOMaster($PONO,$POList);
|
||||
|
||||
$LineItemStatus = REQITEM_NEW;
|
||||
|
||||
if($PODate != $b4podate )
|
||||
{
|
||||
$logpo =array('PONO'=>$PONO,'LineItemNo'=>'-','UpdateBy'=>$updatedBy,'OldValue'=>$b4podate,'NewValue'=>$PODate,'Entity'=>'PO DateChanged');
|
||||
@ -1179,7 +1182,6 @@ class purchaseorder extends BaseController
|
||||
if($Quantity != $b4qty)
|
||||
{
|
||||
$logpo =array('PONO'=>$PONO,'LineItemNo'=>$POLineItemNo,'UpdateBy'=>$updatedBy,'OldValue'=>$b4qty,'NewValue'=>$Quantity,'Entity'=>'Quantity Changed');
|
||||
|
||||
$this->purchaseorder_model->insertlogpo($logpo);
|
||||
}
|
||||
|
||||
@ -1187,19 +1189,17 @@ class purchaseorder extends BaseController
|
||||
if($itemRate != $b4rate)
|
||||
{
|
||||
$logpo =array('PONO'=>$PONO,'LineItemNo'=>$POLineItemNo,'UpdateBy'=>$updatedBy,'OldValue'=>$b4rate,'NewValue'=>$itemRate,'Entity'=>'Rate Changed');
|
||||
|
||||
|
||||
$this->purchaseorder_model->insertlogpo($logpo);
|
||||
}
|
||||
|
||||
|
||||
$SkipInsert = "False";
|
||||
|
||||
if( count($comma_separated) > 0)
|
||||
{
|
||||
for($j = 1; $j < count($comma_separated); $j++)
|
||||
{
|
||||
$deletedRow = $comma_separated[$j] ;
|
||||
|
||||
if($deletedRow == $i )
|
||||
{
|
||||
$SkipInsert = "True";
|
||||
@ -1213,7 +1213,6 @@ class purchaseorder extends BaseController
|
||||
|
||||
$ReqDetails = array('Quantity'=>$Quantity,'UpdatedBy'=>$updatedBy,'UpdatedOn'=>$updateddt);
|
||||
|
||||
|
||||
$this->purchaseorder_model->updateReqDetails($Reqnumber,$MaterialCode,$ReqDetails);
|
||||
$recqty=0;
|
||||
|
||||
@ -1253,9 +1252,7 @@ class purchaseorder extends BaseController
|
||||
}
|
||||
$isExists = $this->purchaseorder_model->LineItemExistsinRevenueTax($LineItemNo);
|
||||
if(count($isExists) == 0)
|
||||
{
|
||||
|
||||
}
|
||||
{}
|
||||
else
|
||||
{
|
||||
|
||||
|
||||
@ -168,6 +168,19 @@ else
|
||||
$ConversionFactor = $this->input->post('conversionfactor');
|
||||
$cfuom = $this->input->post('conversionfactorUOM');//print_r( $ConversionFactorUOM);
|
||||
$HSN = $this->input->post('HSNcode');//print_r($HSNcode);
|
||||
$stock = $this->input->post('openstock');
|
||||
$reorder = $this->input->post('reorder');
|
||||
$stockdate = $this->input->post('Date');
|
||||
if (empty($stockdate))
|
||||
{
|
||||
$stockdate = NULL;
|
||||
}
|
||||
else
|
||||
{
|
||||
$stockdate = strtotime( $stockdate);
|
||||
$stockdate = date("Y-m-d ", $stockdate);
|
||||
}
|
||||
|
||||
$CreatedBy = $this->session->userdata('userId');
|
||||
|
||||
$chked = $this->input->post('isactive');
|
||||
@ -214,7 +227,7 @@ else
|
||||
$IsActive = '0';
|
||||
}
|
||||
|
||||
$RawMaterial = array('MaterialName'=>$MaterialName, 'MaterialType'=>$MaterialType, 'UOM'=>$UOM,'Category'=>$MaterialCategory, 'CreatedBy'=>$CreatedBy,'IsActive' => $IsActive,'assetcode'=>$AssetCode,'CostCenterCode'=>$CostCenterCode,'ConversionFactorUnit'=>$ConversionFactor,'ConversionFactorUOM'=>$ConversionFactorUOM,'Remarks'=>$Remarks,'HSNCODE'=>$HSNcode);
|
||||
$RawMaterial = array('MaterialName'=>$MaterialName, 'MaterialType'=>$MaterialType, 'UOM'=>$UOM,'Category'=>$MaterialCategory, 'CreatedBy'=>$CreatedBy,'IsActive' => $IsActive,'assetcode'=>$AssetCode,'CostCenterCode'=>$CostCenterCode,'ConversionFactorUnit'=>$ConversionFactor,'ConversionFactorUOM'=>$ConversionFactorUOM,'Remarks'=>$Remarks,'HSNCODE'=>$HSNcode ,'stock'=>$stock,'stockdate'=>$stockdate,'reorder'=>$reorder);
|
||||
$result = $this->rawmaterialdetails_model->addNewRawMaterial($RawMaterial);
|
||||
|
||||
if($result > 0)
|
||||
@ -245,6 +258,7 @@ else
|
||||
$RawMaterialID = $_GET['RID'];
|
||||
$MaterialType = $_GET['MType'];
|
||||
$UOM = $_GET['UOM'];
|
||||
$currentdate=$_GET['date1'];
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -252,6 +266,7 @@ else
|
||||
}
|
||||
|
||||
$data['materialDetails'] = $this->rawmaterialdetails_model->getMaterialDetails($RawMaterialID);
|
||||
$data['currentstock'] = $this->rawmaterialdetails_model->getMaterialstock($RawMaterialID, $currentdate);
|
||||
$data['materialType'] = $this->rawmaterialdetails_model->getmaterialType($MaterialType );
|
||||
$data['materialCategory'] = $this->rawmaterialdetails_model->getmaterialCategory($MaterialCategory);
|
||||
$data['UOMList'] = $this->rawmaterialdetails_model->getUOM($UOM);
|
||||
@ -319,6 +334,18 @@ else
|
||||
$ConversionFactor = $this->input->post('conversionfactor');
|
||||
$cfuom = $this->input->post('conversionfactorUOM');
|
||||
$HSN = $this->input->post('HSNcode');
|
||||
$stock = $this->input->post('openstock');
|
||||
$reorder = $this->input->post('reorder');
|
||||
$stockdate = $this->input->post('Date');
|
||||
if (empty($stockdate))
|
||||
{
|
||||
$stockdate = NULL;
|
||||
}
|
||||
else
|
||||
{
|
||||
$stockdate = strtotime( $stockdate);
|
||||
$stockdate = date("Y-m-d ", $stockdate);
|
||||
}
|
||||
$UpdatedBy = $this->session->userdata ('userId');
|
||||
$chked = $this->input->post('isactive');
|
||||
if($asset == '0')
|
||||
@ -365,6 +392,7 @@ else
|
||||
|
||||
$RawMaterial = array();
|
||||
$RawMaterial = array('MaterialName'=>$MaterialName,'MaterialType'=>$MaterialType,'UpdatedBy'=>$UpdatedBy, 'UOM'=>$UOM,'IsActive' => $IsActive,'Category'=>$MaterialCategory,'ConversionFactorUnit'=>$ConversionFactor,'ConversionFactorUOM'=>$ConversionFactorUOM,'Remarks'=>$Remarks,'assetcode'=>$AssetCode,'CostCenterCode'=>$CostCenterCode,'HSNCODE'=>$HSNcode);
|
||||
$RawMaterial = array('MaterialName'=>$MaterialName,'MaterialType'=>$MaterialType,'UpdatedBy'=>$UpdatedBy, 'UOM'=>$UOM,'IsActive' => $IsActive,'Category'=>$MaterialCategory,'ConversionFactorUnit'=>$ConversionFactor,'ConversionFactorUOM'=>$ConversionFactorUOM,'Remarks'=>$Remarks,'assetcode'=>$AssetCode,'CostCenterCode'=>$CostCenterCode,'HSNCODE'=>$HSNcode,'stock'=>$stock,'stockdate'=>$stockdate,'reorder'=>$reorder);//,'RMCode'=>$rmcode);
|
||||
$result = $this->rawmaterialdetails_model->editRawmaterial($RawMaterial, $MaterialCode);
|
||||
|
||||
if($result == true)
|
||||
|
||||
@ -2,21 +2,18 @@
|
||||
|
||||
class batchcard_model extends CI_Model
|
||||
{
|
||||
|
||||
function getEmplistforReport()
|
||||
{
|
||||
$this->db->select('T_Employee_Details.EmpID,T_Employee_Details.FirstName,T_Employee_Details.LastName,T_Employee_Details.Departmentcode,T_DepartmentDetails.shortName');
|
||||
$this->db->from('T_Employee_Details');
|
||||
$this->db->join('T_DepartmentDetails','T_Employee_Details.Departmentcode=T_DepartmentDetails.DEPCode');
|
||||
//$this->db->join('ip_invoice_items','ip_invoices.invoice_number=ip_invoice_items.invoice_number');
|
||||
//$this->db->join('ip_products','ip_invoice_items.item_product_id=ip_products.product_id');
|
||||
//$this->db->join('ip_invoice_custom','ip_invoices.invoice_number=ip_invoice_custom.invoice_number and invoice_custom_fieldid=62');
|
||||
$this->db->order_by('T_Employee_Details.EmpID');
|
||||
$res = $this->db->get();
|
||||
return $res->result();
|
||||
|
||||
function __construct(){
|
||||
parent::__construct();
|
||||
//load our second db and put in $db2
|
||||
$this->db2 = $this->load->database('invoicedb', TRUE);
|
||||
}
|
||||
|
||||
// function selectquery(){
|
||||
// $query = $this->db2->get('ip_invoices');
|
||||
// return $query->result();
|
||||
// }
|
||||
|
||||
//presented
|
||||
function getSupplierlist(){
|
||||
|
||||
$this->db->select('SupplierName,SupplierID');
|
||||
@ -26,573 +23,18 @@ class batchcard_model extends CI_Model
|
||||
|
||||
}
|
||||
|
||||
function saveHourlyBatchInfo($datatostore)
|
||||
{
|
||||
$this->db->insert('T_hourly_batch_info',$datatostore);
|
||||
$res = $this->db->affected_rows();
|
||||
|
||||
return $res;
|
||||
}
|
||||
|
||||
function saveDailyBatchCardData($datatostore)
|
||||
{
|
||||
$this->db->insert('T_daily_batchcard_data',$datatostore);
|
||||
$res = $this->db->affected_rows();
|
||||
return $res;
|
||||
}
|
||||
|
||||
function updateHourlyBatchInfo($datatostore,$hid)
|
||||
{
|
||||
$this->db->where('hourlyid',$hid);
|
||||
$this->db->update('T_hourly_batch_info',$datatostore);
|
||||
$res = $this->db->affected_rows();
|
||||
|
||||
return $res;
|
||||
}
|
||||
|
||||
function getAllHourlyData($hid='',$from='',$to='')
|
||||
{
|
||||
//echo "Model".$from.'-'.$to;
|
||||
|
||||
$this->db->select('T_hourly_batch_info.*,T_Employee_Details.FirstName as F,T_Employee_Details.LastName as L');
|
||||
$this->db->from('T_hourly_batch_info');
|
||||
$this->db->join('tbl_users','T_hourly_batch_info.checkedby=tbl_users.userId');
|
||||
$this->db->join('T_Employee_Details','tbl_users.EmpID=T_Employee_Details.EmpID');
|
||||
if(!empty($hid))
|
||||
{
|
||||
$this->db->where('hourlyid',$hid);
|
||||
}
|
||||
if(!empty($from) && !empty($to))
|
||||
{
|
||||
$this->db->where('T_hourly_batch_info.report_date <=',$to);
|
||||
$this->db->where('T_hourly_batch_info.report_date >=',$from);
|
||||
}
|
||||
$this->db->order_by('hourlyid','desc');
|
||||
$res = $this->db->get();
|
||||
//print_r($res->result());die();
|
||||
return $res->result();
|
||||
}
|
||||
|
||||
|
||||
function checkExistHourlyData($bdate,$btime)
|
||||
{
|
||||
//echo 'Model'.$bdate.'-'.$btime;
|
||||
$this->db->select('count(*) as count');
|
||||
$this->db->from('T_hourly_batch_info');
|
||||
$this->db->where('report_date',$bdate);
|
||||
$this->db->where('report_time',$btime);
|
||||
$res = $this->db->get();
|
||||
return $res->result();
|
||||
}
|
||||
|
||||
|
||||
function getPowerConsumptionDetails($rdate)
|
||||
{
|
||||
|
||||
$this->db->select('hourlyid,report_time,opening_trp_reading,close_trp_reading,auto_start,auto_stop');
|
||||
$this->db->from('T_hourly_batch_info');
|
||||
$this->db->where('report_date',$rdate);
|
||||
$res = $this->db->get();
|
||||
return $res->result();
|
||||
}
|
||||
|
||||
function getDailyBatchCardData($month)
|
||||
{
|
||||
// $this->db->select('*');
|
||||
// $this->db->from('T_daily_batchcard_data');
|
||||
// $this->db->where('month(ddate)',$month);
|
||||
$sql = 'select T_daily_batchcard_data.*,T_Employee_Details.FirstName,T_Employee_Details.LastName from T_daily_batchcard_data
|
||||
join tbl_users on T_daily_batchcard_data.createdby = tbl_users.userId
|
||||
join T_Employee_Details on T_Employee_Details.EmpID = tbl_users.EmpID
|
||||
where month(ddate) = ?';
|
||||
$res = $this->db->query($sql,array($month));
|
||||
return $res->result();
|
||||
}
|
||||
|
||||
function getIndividualDailyData($did)
|
||||
{
|
||||
|
||||
$this->db->select('*');
|
||||
$this->db->from('T_daily_batchcard_data');
|
||||
$this->db->where('dailyid',$did);
|
||||
$res = $this->db->get();
|
||||
return $res->result();
|
||||
|
||||
}
|
||||
|
||||
function checkExistDaily($rdate)
|
||||
{
|
||||
$this->db->select('count(*) as count');
|
||||
$this->db->from('T_daily_batchcard_data');
|
||||
$this->db->where('ddate',$rdate);
|
||||
$res = $this->db->get();
|
||||
return $res->result();
|
||||
}
|
||||
|
||||
function updateDailyBatchCardData($datatostore,$did)
|
||||
{
|
||||
$this->db->where('dailyid',$did);
|
||||
$this->db->update('T_daily_batchcard_data',$datatostore);
|
||||
$res = $this->db->affected_rows();
|
||||
|
||||
return $res;
|
||||
}
|
||||
|
||||
function checkAbstractReport($date)
|
||||
{
|
||||
$this->db->select('count(*) as count');
|
||||
$this->db->from('T_abstract_report');
|
||||
//$this->db->where('abstract_report_date',$date);
|
||||
$this->db->where("date_format(abstract_report_date,'%Y-%m')",$date);
|
||||
$res = $this->db->get();
|
||||
return $res->result();
|
||||
}
|
||||
|
||||
function saveAbstractReport($datatostore)
|
||||
{
|
||||
$this->db->insert('T_abstract_report',$datatostore);
|
||||
$res = $this->db->affected_rows();
|
||||
return $res;
|
||||
}
|
||||
|
||||
function updateAbstractReport($datatostore,$date,$abstract_details)
|
||||
{
|
||||
//$this->db->where('abstract_report_date',$date);
|
||||
$this->db->where("date_format(abstract_report_date,'%Y-%m')",$date);
|
||||
$this->db->where('abstract_details',$abstract_details);
|
||||
$this->db->update('T_abstract_report',$datatostore);
|
||||
$res = $this->db->affected_rows();
|
||||
|
||||
return $res;
|
||||
|
||||
}
|
||||
|
||||
function getPreviousMonthAbstractDetails($month,$year)
|
||||
{
|
||||
//$sql = "select abstract_details,close_stock from T_abstract_report where month(abstract_report_date) =? and year(abstract_report_date) =? ";
|
||||
$sql = "select abstract_details,close_stock as Available from T_abstract_report where month(abstract_report_date) =? and year(abstract_report_date) =? ";
|
||||
$res = $this->db->query($sql,array($month,$year));
|
||||
return $res->result();
|
||||
|
||||
}
|
||||
|
||||
function getMonthAbstractDetails($month_year)
|
||||
{
|
||||
$sql = "select abstract_details,close_stock,open_stock as Available,physical_stock from T_abstract_report where date_format(abstract_report_date,'%Y-%m') = ? ";
|
||||
$res = $this->db->query($sql,array($month_year));
|
||||
|
||||
return $res->result();
|
||||
}
|
||||
|
||||
function getPreviousMonthClosedStockDetails($y,$m,$sn)
|
||||
{
|
||||
$month = 'month(ddate)';
|
||||
$year = 'year(ddate)';
|
||||
//$this->db->select($sn);
|
||||
$this->db->select($sn,'ddate');
|
||||
$this->db->from('T_daily_batchcard_data');
|
||||
$this->db->where($month,$m);
|
||||
$this->db->where($year,$y);
|
||||
$this->db->order_by('ddate','desc');
|
||||
$this->db->limit(1);
|
||||
$res = $this->db->get();
|
||||
//print_r($res->result());
|
||||
return $res->result();
|
||||
}
|
||||
|
||||
function currentMonthStockDetails($m,$y,$sd1,$sd2)
|
||||
{
|
||||
$month = 'month(ddate)';
|
||||
$year = 'year(ddate)';
|
||||
$list = array('ddate',$sd1,$sd2);
|
||||
$this->db->select($list);
|
||||
$this->db->from('T_daily_batchcard_data');
|
||||
$this->db->where($month,$m);
|
||||
$this->db->where($year,$y);
|
||||
$this->db->order_by('ddate','asc');
|
||||
$res = $this->db->get();
|
||||
//print_r($res->result());
|
||||
return $res->result();
|
||||
}
|
||||
|
||||
function addmaint_dtl($array)
|
||||
{
|
||||
// $this->db->insert('T_Batchcard_MaintanceDetails',$array);
|
||||
// $bmd = $this->db->affected_rows();
|
||||
// return $bmd;
|
||||
|
||||
$this->db->insert('T_Batchcard_MaintanceDetails',$array);
|
||||
$bmd = $this->db->affected_rows();
|
||||
|
||||
|
||||
if($bmd>0)
|
||||
{
|
||||
$this->db->select('max(Maint_ID) as Maint_ID');
|
||||
$this->db->from('T_Batchcard_MaintanceDetails');
|
||||
$res = $this->db->get();
|
||||
return $res->result();
|
||||
}
|
||||
}
|
||||
function getmaint_dtl($fdate,$tdate,$type )
|
||||
{
|
||||
|
||||
|
||||
$this->db->select('BMD.*');
|
||||
// $this->db->select()
|
||||
$this->db->select('CONCAT(ED1.FirstName, " - " , ED1.LastName) AS Approver_Name', FALSE);
|
||||
$this->db->select('CONCAT(ED2.FirstName, " - " , ED2.LastName) AS Worker_Name', FALSE);
|
||||
$this->db->from('T_Batchcard_MaintanceDetails BMD');
|
||||
|
||||
$this->db->join('T_Employee_Details ED1', 'ED1.EmpID = BMD.Approved_By', 'left');
|
||||
$this->db->join('T_Employee_Details ED2', 'ED2.EmpID = BMD.WorkDone_By', 'left');
|
||||
|
||||
|
||||
|
||||
if ($fdate and $tdate != ''){
|
||||
|
||||
|
||||
$fromdate= date("Y-m-d",strtotime($fdate));
|
||||
$todate=date("Y-m-d",strtotime($tdate));
|
||||
|
||||
$date = "date(BMD.CreatedOn) >= '".$fromdate."'
|
||||
and date( BMD.CreatedOn) <= '". $todate."'";
|
||||
$this->db->where($date);
|
||||
}
|
||||
|
||||
if($type!=""){
|
||||
|
||||
$this->db->where("BMD.type" ,$type);
|
||||
|
||||
|
||||
}
|
||||
$bmd = $this->db->get();
|
||||
return $bmd->result();
|
||||
}
|
||||
|
||||
|
||||
|
||||
function getmaint_dtl_MntID($MntID)
|
||||
{
|
||||
|
||||
$this->db->select('*');
|
||||
$this->db->from('T_Batchcard_MaintanceDetails');
|
||||
$this->db->where('Maint_ID',$MntID);
|
||||
$bmd = $this->db->get();
|
||||
return $bmd->result();
|
||||
}
|
||||
|
||||
function updatemaint_dtl($array,$MntID)
|
||||
{
|
||||
$this->db->where('Maint_ID',$MntID);
|
||||
$this->db->update('T_Batchcard_MaintanceDetails',$array);
|
||||
$bmd = $this->db->affected_rows();
|
||||
|
||||
return $bmd;
|
||||
}
|
||||
|
||||
function maintenancesdata($date){
|
||||
|
||||
$this->db->select("bm.*,mm.Machine_Name");
|
||||
$this->db->select("DATE_FORMAT(bm.CreatedOn,'%d-%m-%Y') AS date", FALSE);
|
||||
$this->db->select("DATE_FORMAT(bm.CreatedOn,'%l:%i %p') AS time", FALSE);
|
||||
$this->db->select("CONCAT(ED1.FirstName, ' - ' , ED1.LastName) AS Approver_Name", FALSE);
|
||||
$this->db->select("CONCAT(ED2.FirstName, ' - ' , ED2.LastName) AS Worker_Name", FALSE);
|
||||
$this->db->from("T_Batchcard_MaintanceDetails bm");
|
||||
$this->db->join("T_Machine_Master mm", "bm.Machine_Code = mm.Machine_Code", "left");
|
||||
$this->db->join("T_Employee_Details ED1", "bm.Approved_By = ED1.EmpID", "left");
|
||||
$this->db->join("T_Employee_Details ED2", "bm.WorkDone_By = ED2.EmpID", "left");
|
||||
$this->db->where("mm.Machines_Category = 'TRP'");
|
||||
//AND DATE_FORMAT(bm.CreatedOn,'%Y-%m-%d') = '19-04-2018'
|
||||
$this->db->where("DATE_FORMAT(bm.CreatedOn,'%d-%m-%Y')",$date);
|
||||
$bmd = $this->db->get();
|
||||
return $bmd->result();
|
||||
|
||||
//print_r($this->db->last_query());
|
||||
//die();
|
||||
|
||||
}
|
||||
|
||||
function getmachine_codename(){
|
||||
$this->db->select('Machine_Code,Machine_Name');
|
||||
$this->db->from('T_Machine_Master');
|
||||
$res = $this->db->get();
|
||||
return $res->result();
|
||||
}
|
||||
|
||||
/** Machines History/Master */
|
||||
function getdept_dtls()
|
||||
{
|
||||
$this->db->select('T_DepartmentDetails.DEPCode,T_DepartmentDetails.shortName');
|
||||
$this->db->from('T_DepartmentDetails');
|
||||
$this->db->where('IsActive',1);
|
||||
$res = $this->db->get();
|
||||
return $res->result();
|
||||
}
|
||||
|
||||
function getpono(){
|
||||
|
||||
$this->db->select('PONO');
|
||||
$this->db->from('T_PurchaseOrder_Master');
|
||||
$this->db->where('Status','ST026');
|
||||
$res = $this->db->get();
|
||||
return $res->result();
|
||||
}
|
||||
|
||||
function getpo_dtls($pono){
|
||||
|
||||
// $this->db->select('T_PurchaseOrder_Master.PONO,T_PurchaseOrder_Master.SupplierID,T_SupplierDetailsN.SupplierName,DATE_FORMAT(T_PurchaseOrder_Master.PODate,"%d-%m-%Y") as PO_Date');
|
||||
// $this->db->from('T_PurchaseOrder_Master');
|
||||
// $this->db->join('T_SupplierDetailsN','T_PurchaseOrder_Master.SupplierID=T_SupplierDetailsN.SupplierID');
|
||||
// $this->db->where('PONO',$pono);
|
||||
// $res = $this->db->get();
|
||||
// return $res->result();
|
||||
$sql = "select T_PurchaseOrder_Master.PONO,T_PurchaseOrder_Master.SupplierID,T_SupplierDetailsN.SupplierName,DATE_FORMAT(T_PurchaseOrder_Master.PODate,'%d-%m-%Y') as PO_Date
|
||||
from T_PurchaseOrder_Master
|
||||
join T_SupplierDetailsN on T_PurchaseOrder_Master.SupplierID=T_SupplierDetailsN.SupplierID
|
||||
where PONO = ? ";
|
||||
$res = $this->db->query($sql,array($pono));
|
||||
return $res->result();
|
||||
|
||||
}
|
||||
|
||||
function addhist_mstr($array)
|
||||
{
|
||||
$this->db->insert('T_Machine_Master',$array);
|
||||
$mstr = $this->db->affected_rows();
|
||||
//print_r($this->db->last_query());
|
||||
//print_r($mstr);
|
||||
if($mstr>0)
|
||||
{
|
||||
|
||||
$this->db->select('max(Machine_Code) as Machine_Code');
|
||||
$this->db->from('T_Machine_Master');
|
||||
$res = $this->db->get();
|
||||
//print_r($res->result());
|
||||
return $res->result();
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
function addhist_dtl($array){
|
||||
|
||||
$this->db->insert('T_Machine_Details',$array);
|
||||
$child = $this->db->affected_rows();
|
||||
return $child;
|
||||
|
||||
}
|
||||
//This function for multi file upload option (both machine and maint/br screen)
|
||||
function addfiledetails($array){
|
||||
|
||||
$this->db->insert('T_Machines_file', $array);
|
||||
$r = $this->db->affected_rows();
|
||||
return $r;
|
||||
//return TRUE;
|
||||
|
||||
}
|
||||
function insertvalueintoconfig($config){
|
||||
|
||||
$this->db->insert('T_ConfigDetails', $config);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
//This function used to get the material category using configdetails table
|
||||
function getmachineCategory($MaterialCategory = '')
|
||||
{
|
||||
$Config_ID = 'C028';
|
||||
$this->db->select('Config_ID,ConfigValue');
|
||||
$this->db->from('T_ConfigDetails');
|
||||
$this->db->where('Config_id',$Config_ID );
|
||||
if($MaterialCategory != '')
|
||||
{
|
||||
$this->db->where('ConfigValue !=',$MaterialCategory );
|
||||
}
|
||||
$query = $this->db->get();
|
||||
|
||||
return $query->result();
|
||||
}
|
||||
|
||||
|
||||
function getHist_dtls($MachineCode = '')
|
||||
{
|
||||
|
||||
$this->db->select('*');
|
||||
$this->db->from('T_Machine_Details');
|
||||
if($MachineCode != '')
|
||||
{
|
||||
$this->db->where('Machine_Code',$MachineCode );
|
||||
}
|
||||
$bmd = $this->db->get();
|
||||
return $bmd->result();
|
||||
}
|
||||
|
||||
//This function for multi file upload option (both machine and maint/br screen)
|
||||
function getfiledetails($data = '')
|
||||
{
|
||||
|
||||
$this->db->select('*');
|
||||
$this->db->from('T_Machines_file');
|
||||
if($data != '')
|
||||
{
|
||||
$this->db->where('Machine_code/Maint_id',$data );
|
||||
}
|
||||
$bmd = $this->db->get();
|
||||
return $bmd->result();
|
||||
}
|
||||
|
||||
function getHist_mstr($MachineCode = '')
|
||||
{
|
||||
|
||||
$this->db->select('*');
|
||||
$this->db->from('T_Machine_Master');
|
||||
if($MachineCode != '')
|
||||
{
|
||||
$this->db->where('Machine_Code',$MachineCode );
|
||||
}
|
||||
$bmd = $this->db->get();
|
||||
return $bmd->result();
|
||||
}
|
||||
|
||||
// function getHist_dtlsID($MntID)
|
||||
// {
|
||||
|
||||
// $this->db->select('*');
|
||||
// $this->db->from('T_Batchcard_MaintanceDetails');
|
||||
// $this->db->where('Maint_ID',$MntID);
|
||||
// $bmd = $this->db->get();
|
||||
// return $bmd->result();
|
||||
// }
|
||||
|
||||
// function getHist_dtlsDate($dateval)
|
||||
// {
|
||||
|
||||
// $this->db->select('*');
|
||||
// $this->db->from('T_Batchcard_MaintanceDetails');
|
||||
// $this->db->where('Maint_Date',$dateval);
|
||||
// $bmd = $this->db->get();
|
||||
// return $bmd->result();
|
||||
// }
|
||||
|
||||
|
||||
function edithist_mstr($array,$machinecode){
|
||||
|
||||
$this->db->where('Machine_Code',$machinecode );
|
||||
$this->db->update('T_Machine_Master',$array);
|
||||
$mstr = $this->db->affected_rows();
|
||||
if($mstr>0)
|
||||
{
|
||||
|
||||
$this->db->select('max(Machine_Code) as Machine_Code');
|
||||
$this->db->from('T_Machine_Master');
|
||||
$res = $this->db->get();
|
||||
return $res->result();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function edithist_dtl($array,$machinecode){
|
||||
$this->db->where('Machine_Code',$machinecode );
|
||||
$this->db->update('T_Machine_Details',$array);
|
||||
$mdtl = $this->db->affected_rows();
|
||||
return $mdtl;
|
||||
}
|
||||
|
||||
function updatefilelist($array,$fileid){
|
||||
|
||||
$this->db->where('File_No',$fileid);
|
||||
$this->db->update('T_Machines_file', $array);
|
||||
$ar = $this->db->affected_rows();
|
||||
return $ar;
|
||||
|
||||
}
|
||||
|
||||
function checkMachineCategory($mc){
|
||||
|
||||
// $this->db->select('ConfigValue');
|
||||
// $this->db->from('T_ConfigDetails');
|
||||
// $this->db->where(Config_ID,'C023');
|
||||
// $this->db->like('ConfigValue',$mc);
|
||||
// $query = $this->db->get();
|
||||
// //print_r($query->result());
|
||||
// return $query->result();
|
||||
|
||||
// //return $this->db->get('T_MaterialMaster');
|
||||
// }
|
||||
$temp[] = '' ;
|
||||
|
||||
$this->db->distinct();
|
||||
$this->db->select('ConfigValue');
|
||||
$this->db->from('T_ConfigDetails');
|
||||
$this->db->where('Config_ID','C028');
|
||||
$this->db->like('ConfigValue',$mc);
|
||||
$query = $this->db->get();
|
||||
//print_r($query->result());die;
|
||||
$temparr[] = '' ;
|
||||
foreach($query->result() as $arr){
|
||||
$temparr[] = $arr->ConfigValue ;
|
||||
}
|
||||
$temp['suggestions'] = $temparr;
|
||||
//print_r($temp);
|
||||
|
||||
return $temp;
|
||||
}
|
||||
|
||||
//This function for multi file upload option (both machine and maint/br screen)
|
||||
function deletefiledetails($id,$name){
|
||||
$sql = "DELETE FROM T_Machines_file WHERE File_No =".$id;
|
||||
unlink("uploads/images/".$name);//this deletes the file on particular folder too
|
||||
$query = $this->db->query($sql);
|
||||
$ar = $this->db->affected_rows();
|
||||
return $ar;
|
||||
}
|
||||
|
||||
|
||||
function getHist_tbls($MachineCode){
|
||||
|
||||
$this->db->select('T_Machine_Master.*,T_Batchcard_MaintanceDetails.*,T_DepartmentDetails.DepartmentName');
|
||||
$this->db->select("DATE_FORMAT(T_Batchcard_MaintanceDetails.CreatedOn,'%d-%m-%Y') AS date", FALSE);
|
||||
$this->db->select("DATE_FORMAT(T_Batchcard_MaintanceDetails.CreatedOn,'%l:%i %p') AS time", FALSE);
|
||||
$this->db->select("CONCAT(ED1.FirstName, ' - ' , ED1.LastName) AS Approver_Name", FALSE);
|
||||
$this->db->select("CONCAT(ED2.FirstName, ' - ' , ED2.LastName) AS Worker_Name", FALSE);
|
||||
$this->db->from('T_Machine_Master');
|
||||
$this->db->join('T_Batchcard_MaintanceDetails','T_Batchcard_MaintanceDetails.Machine_Code=T_Machine_Master.Machine_Code');
|
||||
$this->db->join('T_DepartmentDetails','T_DepartmentDetails.DEPCode=T_Machine_Master.Machines_Dept');
|
||||
$this->db->join('T_Employee_Details ED1', 'ED1.EmpID = T_Batchcard_MaintanceDetails.Approved_By', 'left');
|
||||
$this->db->join('T_Employee_Details ED2', 'ED2.EmpID = T_Batchcard_MaintanceDetails.WorkDone_By', 'left');
|
||||
$this->db->where('T_Machine_Master.Machine_Code',$MachineCode);
|
||||
$res = $this->db->get();
|
||||
return $res->result();
|
||||
|
||||
// $sql = "SELECT T_Machine_Master.*,T_Batchcard_MaintanceDetails.*,
|
||||
// T_DepartmentDetails.DepartmentName,
|
||||
// DATE_FORMAT(T_Batchcard_MaintanceDetails.CreatedOn, '%d-%m-%Y') as date,
|
||||
// DATE_FORMAT(T_Batchcard_MaintanceDetails.CreatedOn, '%l:%i %p') as time,
|
||||
// FROM T_Machine_Master
|
||||
// LEFT JOIN T_Batchcard_MaintanceDetails ON T_Batchcard_MaintanceDetails.Machine_Code=T_Machine_Master.Machine_Code
|
||||
// LEFT JOIN T_DepartmentDetails ON T_DepartmentDetails.DEPCode=T_Machine_Master.Machines_Dept
|
||||
// WHERE T_Machine_Master.Machine_Code = '".$MachineCode."'" ;
|
||||
// $res = $this->db->query($sql);
|
||||
// return $res->result();
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//presented
|
||||
function getinvoice_products()
|
||||
{
|
||||
|
||||
$this->db->select('product_id,product_name');
|
||||
$this->db->from('ip_products');
|
||||
$supp = $this->db->get();
|
||||
$this->db2->select('product_id,product_name');
|
||||
$this->db2->from('ip_products');
|
||||
$supp = $this->db2->get();
|
||||
return $supp->result();
|
||||
|
||||
}
|
||||
|
||||
//presented
|
||||
function get_consumablematerials()
|
||||
{
|
||||
|
||||
@ -604,7 +46,7 @@ class batchcard_model extends CI_Model
|
||||
|
||||
}
|
||||
|
||||
|
||||
//presented
|
||||
function get_rawmaterials()
|
||||
{
|
||||
$this->db->select('MaterialCode,MaterialName,');
|
||||
@ -614,7 +56,7 @@ class batchcard_model extends CI_Model
|
||||
return $supp->result();
|
||||
}
|
||||
|
||||
|
||||
//presented
|
||||
function get_packmaterials()
|
||||
{
|
||||
$this->db->select('MaterialCode,MaterialName,');
|
||||
@ -624,7 +66,7 @@ class batchcard_model extends CI_Model
|
||||
return $supp->result();
|
||||
}
|
||||
|
||||
|
||||
//presented
|
||||
function getMaterial()
|
||||
{
|
||||
$this->db->select('MaterialCode,MaterialName,');
|
||||
@ -674,7 +116,7 @@ and CreatedOn >= ? and CreatedOn<=? group by Addqty';
|
||||
|
||||
}
|
||||
|
||||
|
||||
//presented
|
||||
function GetNetQty($MaterialCode,$date,$Supplier)
|
||||
{
|
||||
//echo $date;
|
||||
@ -721,7 +163,7 @@ and CreatedOn >= ? and CreatedOn<=? and SupplierID=? group by Addqty';
|
||||
|
||||
}
|
||||
|
||||
|
||||
//presented
|
||||
function GetMaterialHistory($AdjustmentId)
|
||||
{
|
||||
$this->db->select('T_Material_Adjustment.*,SupplierName,MaterialName');
|
||||
@ -737,7 +179,7 @@ and CreatedOn >= ? and CreatedOn<=? and SupplierID=? group by Addqty';
|
||||
|
||||
|
||||
|
||||
|
||||
//presented
|
||||
function AddmaterialAdjustment($adjustmentaarray)
|
||||
{
|
||||
$this->db->trans_start();
|
||||
@ -755,7 +197,7 @@ and CreatedOn >= ? and CreatedOn<=? and SupplierID=? group by Addqty';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//presented
|
||||
function AddMaterialHistory($historytable)
|
||||
{
|
||||
$this->db->trans_start();
|
||||
@ -766,7 +208,7 @@ and CreatedOn >= ? and CreatedOn<=? and SupplierID=? group by Addqty';
|
||||
|
||||
}
|
||||
|
||||
|
||||
//presented
|
||||
function insert_final_product($final_master)
|
||||
{
|
||||
$this->db->trans_start();
|
||||
@ -784,7 +226,7 @@ and CreatedOn >= ? and CreatedOn<=? and SupplierID=? group by Addqty';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//presented
|
||||
function save_finalraw($rawarray)
|
||||
{
|
||||
$this->db->trans_start();
|
||||
@ -796,6 +238,7 @@ and CreatedOn >= ? and CreatedOn<=? and SupplierID=? group by Addqty';
|
||||
}
|
||||
|
||||
|
||||
//presented
|
||||
function save_finalcon($conarray)
|
||||
{
|
||||
$this->db->trans_start();
|
||||
@ -804,7 +247,7 @@ and CreatedOn >= ? and CreatedOn<=? and SupplierID=? group by Addqty';
|
||||
$this->db->trans_complete();
|
||||
return true;
|
||||
}
|
||||
|
||||
//presented
|
||||
function save_finalpacking($packarray)
|
||||
{
|
||||
$this->db->trans_start();
|
||||
@ -814,7 +257,7 @@ and CreatedOn >= ? and CreatedOn<=? and SupplierID=? group by Addqty';
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
//presented
|
||||
function save_finalcoproduct($coparray)
|
||||
{
|
||||
|
||||
@ -826,7 +269,7 @@ and CreatedOn >= ? and CreatedOn<=? and SupplierID=? group by Addqty';
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
//presented
|
||||
function getAllMaterialAdjustments()
|
||||
{
|
||||
$this->db->select('T_Material_Adjustment.*,SupplierName,MaterialName');
|
||||
@ -839,7 +282,7 @@ and CreatedOn >= ? and CreatedOn<=? and SupplierID=? group by Addqty';
|
||||
|
||||
|
||||
|
||||
|
||||
//presented
|
||||
function save_rawmaterialto_materialHistory($materialhistory)
|
||||
{
|
||||
$this->db->trans_start();
|
||||
@ -849,7 +292,7 @@ and CreatedOn >= ? and CreatedOn<=? and SupplierID=? group by Addqty';
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
//presented
|
||||
function getFinalProductDetaisl()
|
||||
{
|
||||
$this->db->select('T_FinalProduct_Master.*,product_name,product_description');
|
||||
@ -860,7 +303,7 @@ and CreatedOn >= ? and CreatedOn<=? and SupplierID=? group by Addqty';
|
||||
|
||||
}
|
||||
|
||||
|
||||
//presented
|
||||
function getmasterProductDetails($FPId)
|
||||
{
|
||||
$this->db->select('T_FinalProduct_Master.*,product_name,product_description');
|
||||
@ -871,7 +314,7 @@ and CreatedOn >= ? and CreatedOn<=? and SupplierID=? group by Addqty';
|
||||
return $res->result();
|
||||
}
|
||||
|
||||
|
||||
//presented
|
||||
function getrawmaterialDetails($FPId)
|
||||
{
|
||||
$this->db->select('T_FinalProduct_RawMaterials.*,SupplierName,MaterialName');
|
||||
@ -883,7 +326,7 @@ and CreatedOn >= ? and CreatedOn<=? and SupplierID=? group by Addqty';
|
||||
return $res->result();
|
||||
}
|
||||
|
||||
|
||||
//presented
|
||||
function getconsumaterialDetails($FPId)
|
||||
{
|
||||
$this->db->select('T_FinalProduct_ConsumableMaterials.*,SupplierName,MaterialName');
|
||||
@ -895,7 +338,7 @@ and CreatedOn >= ? and CreatedOn<=? and SupplierID=? group by Addqty';
|
||||
return $res->result();
|
||||
}
|
||||
|
||||
|
||||
//presented
|
||||
function getpackagematerialDetails($FPId)
|
||||
{
|
||||
$this->db->select('T_FinalProduct_PackingMaterials.*,SupplierName,MaterialName');
|
||||
@ -907,7 +350,7 @@ and CreatedOn >= ? and CreatedOn<=? and SupplierID=? group by Addqty';
|
||||
return $res->result();
|
||||
}
|
||||
|
||||
|
||||
//presented
|
||||
function getcoproductmaterial($FPId)
|
||||
{
|
||||
$subQuery ='select T_FinalProduct_CoProduct_Materials.*,product_name
|
||||
@ -921,7 +364,7 @@ and CreatedOn >= ? and CreatedOn<=? and SupplierID=? group by Addqty';
|
||||
|
||||
}
|
||||
|
||||
|
||||
//presented
|
||||
function update_final_product($final_master,$FPId)
|
||||
{
|
||||
//print_r($final_master);
|
||||
@ -940,7 +383,7 @@ and CreatedOn >= ? and CreatedOn<=? and SupplierID=? group by Addqty';
|
||||
}
|
||||
|
||||
|
||||
|
||||
//presented
|
||||
function GetRawid($rawilneno)
|
||||
{
|
||||
$this->db->select('*');
|
||||
@ -952,7 +395,7 @@ and CreatedOn >= ? and CreatedOn<=? and SupplierID=? group by Addqty';
|
||||
}
|
||||
|
||||
|
||||
|
||||
//presented
|
||||
function Getconsuid($consuline)
|
||||
{
|
||||
$this->db->select('*');
|
||||
@ -975,7 +418,7 @@ and CreatedOn >= ? and CreatedOn<=? and SupplierID=? group by Addqty';
|
||||
return $query->result();
|
||||
}
|
||||
|
||||
|
||||
//presented
|
||||
function Getcopid($coplineId)
|
||||
{
|
||||
$this->db->select('*');
|
||||
@ -987,7 +430,7 @@ and CreatedOn >= ? and CreatedOn<=? and SupplierID=? group by Addqty';
|
||||
|
||||
}
|
||||
|
||||
|
||||
//presented
|
||||
function update_finalraw($rawarray,$rawilneno)
|
||||
{
|
||||
$this->db->where('RawId', $rawilneno);
|
||||
@ -995,7 +438,7 @@ and CreatedOn >= ? and CreatedOn<=? and SupplierID=? group by Addqty';
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
//presented
|
||||
function GetRawCheck($rawmaterial,$final_product_id)
|
||||
{
|
||||
$this->db->select('*');
|
||||
@ -1007,7 +450,7 @@ and CreatedOn >= ? and CreatedOn<=? and SupplierID=? group by Addqty';
|
||||
//print_r($this->db->last_query());
|
||||
return $query->result();
|
||||
}
|
||||
|
||||
//presented
|
||||
|
||||
function update_rawmaterialto_materialHistory($rawmaterialhistory,$rawmaterial,$FPID)
|
||||
{
|
||||
@ -1017,7 +460,7 @@ and CreatedOn >= ? and CreatedOn<=? and SupplierID=? group by Addqty';
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
//presented
|
||||
function update_finalconsu($conarray,$consuline)
|
||||
{
|
||||
$this->db->where('ConId', $consuline);
|
||||
@ -1025,7 +468,7 @@ and CreatedOn >= ? and CreatedOn<=? and SupplierID=? group by Addqty';
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
//presented
|
||||
function update_finalpacking($conarray,$packlineId)
|
||||
{
|
||||
$this->db->where('PackId', $packlineId);
|
||||
@ -1033,13 +476,14 @@ and CreatedOn >= ? and CreatedOn<=? and SupplierID=? group by Addqty';
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
//presented
|
||||
function update_finalcoproduct($coparray,$coplineId)
|
||||
{
|
||||
$this->db->where('CoId', $coplineId);
|
||||
$this->db->update('T_FinalProduct_CoProduct_Materials', $coparray);
|
||||
return TRUE;
|
||||
}
|
||||
//presented
|
||||
function getEditMaterialAdjustments($AdjustmentId)
|
||||
{
|
||||
|
||||
@ -1052,11 +496,13 @@ and CreatedOn >= ? and CreatedOn<=? and SupplierID=? group by Addqty';
|
||||
$res = $this->db->get();
|
||||
return $res->result();
|
||||
}
|
||||
//presented
|
||||
function material_name(){
|
||||
$sql="SELECT distinct MaterialName FROM T_MaterialMaster;";
|
||||
$query = $this->db->query($sql);
|
||||
return $query->result();
|
||||
}
|
||||
//presented
|
||||
function getMaterial_history($prod,$frm,$t)
|
||||
{
|
||||
$sql="SELECT msh.StockId,sd.SupplierName,mm.MaterialName,msh.Transaction_type,msh.Ref_Type,msh.Ref_No,msh.Quantity,msh.ItemValue,date_format(msh.UpdatedOn,'%d-%m-%Y') as updatedOn FROM T_Material_stock_history as msh
|
||||
@ -1086,6 +532,7 @@ and CreatedOn >= ? and CreatedOn<=? and SupplierID=? group by Addqty';
|
||||
}
|
||||
//created by TamilBala
|
||||
//for update quantity stockhistory
|
||||
//presented
|
||||
function updateQuantityStockHistory($updatequantity,$id)
|
||||
{
|
||||
|
||||
@ -1100,7 +547,7 @@ and CreatedOn >= ? and CreatedOn<=? and SupplierID=? group by Addqty';
|
||||
|
||||
//created by TamilBala
|
||||
//for update quantity T_Material_Adjustment
|
||||
|
||||
//presented
|
||||
function updateQuantityAdjusment($updatequantitydes,$id)
|
||||
{
|
||||
$this->db->where('AdjustmentId',$id);
|
||||
@ -1111,6 +558,7 @@ and CreatedOn >= ? and CreatedOn<=? and SupplierID=? group by Addqty';
|
||||
}
|
||||
//created by TamilBala
|
||||
//for update isactive T_Material_Adjustment
|
||||
//presented
|
||||
function updateisactiveadjusment($Updateactive,$AdjustmentId)
|
||||
{
|
||||
$this->db->where('AdjustmentId',$AdjustmentId);
|
||||
@ -1122,6 +570,7 @@ and CreatedOn >= ? and CreatedOn<=? and SupplierID=? group by Addqty';
|
||||
|
||||
//created by TamilBala
|
||||
//for update isactive stockhistory
|
||||
//
|
||||
function updateisactiveastockhistory($Updateactive,$AdjustmentId)
|
||||
{
|
||||
$this->db->where('Ref_No',$AdjustmentId);
|
||||
@ -1154,7 +603,7 @@ and CreatedOn >= ? and CreatedOn<=? and SupplierID=? group by Addqty';
|
||||
|
||||
// }
|
||||
|
||||
|
||||
//presented
|
||||
function GetFinishedProductList($starting_date,$end_date,$product_id)
|
||||
{
|
||||
|
||||
@ -1175,7 +624,7 @@ where ProductCode=? and Transactiondate >= ? and Transactiondate <= ?';
|
||||
|
||||
}
|
||||
|
||||
|
||||
//presented
|
||||
function SaveFinalHistory($final_history)
|
||||
{
|
||||
$this->db->trans_start();
|
||||
@ -1185,7 +634,7 @@ where ProductCode=? and Transactiondate >= ? and Transactiondate <= ?';
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
//presented
|
||||
function UpdateFinalHistory($final_history,$FPID,$rawmaterial)
|
||||
{
|
||||
//print_r($final_history);
|
||||
|
||||
@ -23,6 +23,7 @@ class purchaseorder_model extends CI_Model
|
||||
$query = $this->db->get();
|
||||
return $query->result();
|
||||
}
|
||||
|
||||
function getfies($pono)
|
||||
{
|
||||
|
||||
@ -47,7 +48,7 @@ return $r;
|
||||
}
|
||||
|
||||
|
||||
//function IGRDetailsupdate($PONO)
|
||||
//function IGRDetailsupdate($PONO)old file name
|
||||
function getIGRDetails($PONO)
|
||||
{
|
||||
|
||||
|
||||
@ -113,6 +113,39 @@ class rawmaterialdetails_model extends CI_Model
|
||||
return $query->result();
|
||||
}
|
||||
|
||||
function getMaterialstock($MaterialCode, $currentdate)
|
||||
{
|
||||
|
||||
$dt = date('d',strtotime($currentdate));
|
||||
$year = date('Y', strtotime($currentdate));
|
||||
$month = date('m', strtotime($currentdate));
|
||||
|
||||
if($month<04)
|
||||
{
|
||||
|
||||
$newyr = $year - 1;
|
||||
$startdate = $newyr.'-'.'04'.'-'.'01';
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
$startdate = $year.'-'.'04'.'-'.'01';
|
||||
}
|
||||
|
||||
$nedt= $dt+1;
|
||||
|
||||
$newdate=$year.'-'.$month.'-'.$nedt;
|
||||
|
||||
$subquery="SELECT SUM(IF(Transaction_type='Add',Quantity,0)) - SUM(IF(Transaction_type='Reduce',Quantity,0))as remainingqty
|
||||
FROM T_Material_stock_history
|
||||
WHERE MaterialCode=? AND CreatedOn >=? AND CreatedOn <=? ";
|
||||
$query = $this->db->query($subquery,array($MaterialCode,$startdate,$newdate));
|
||||
|
||||
return $query->result_array();
|
||||
|
||||
|
||||
}
|
||||
|
||||
function getAssetcode()
|
||||
{
|
||||
$this->db->select('AssetCode,AssetName');
|
||||
|
||||
@ -52,8 +52,9 @@ table.dataTable thead > tr > td.sorting {
|
||||
<!-- TABLE: LATEST ORDERS -->
|
||||
<div class="box box-info">
|
||||
<div class="box-header with-border">
|
||||
<center><h3 class="box-title"><p style="color:#5d0411"><b>Siddharth Industries - Material History</b><br><br>
|
||||
<center><h3 class="box-title"><p style="color:#5d0411"><b><?php echo $pageTitle; ?> - Material History</b><br><br>
|
||||
<?php
|
||||
//print_r($firstinvoice);
|
||||
|
||||
if($this->input->post('item_name')){
|
||||
$it=$this->input->post('item_name');
|
||||
|
||||
@ -6,6 +6,15 @@
|
||||
outline: 1px solid slategrey;
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
$(function() {
|
||||
$("#Date").datepicker({
|
||||
//minDate :'now',
|
||||
//maxDate : 'now',
|
||||
dateFormat: 'dd-mm-yy',changeMonth: true, changeYear: true,yearRange: '-100:+1'
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<script type="text/javascript" src="<?php echo base_url();?>assets/Autocomplete/jquery.autocomplete.js"></script>
|
||||
<div class="content-wrapper" style="min-height: 537px;">
|
||||
<!-- Content Header (Page header) -->
|
||||
@ -60,7 +69,6 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="col-md-3" >
|
||||
<div class="form-group autoSearch" id="mc">
|
||||
<label for="Matcate">Material Caterogy</label><font color="Red">*</font>
|
||||
@ -185,6 +193,27 @@
|
||||
<input type="text" class="form-control" id="HSNcode" onkeypress="return isNumberKey(event)" name="HSNcode" maxlength="8">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<div class="form-group">
|
||||
<label for="conversionfactor">Opening Stock</label>
|
||||
<input type="text" class="form-control" id="openstock" name="openstock" maxlength="255">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<label>Open Stock Date</label>
|
||||
<?php
|
||||
$data = array('name' => 'Date','value' => set_value('Date'),'id'=>'Date', 'class' => 'form-control' , 'onkeypress'=>'return false;');
|
||||
echo form_input($data);
|
||||
?>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<div class="form-group">
|
||||
<label for="conversionfactor">Reorder Level</label>
|
||||
<input type="text" class="form-control" id="reorder" name="reorder" maxlength="255">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label for="remarks">Remarks</label>
|
||||
@ -239,13 +268,13 @@ onSelect: function (suggestion) {
|
||||
var selectedvalue = $('input[name=MatCate]').val();
|
||||
if(selectedvalue=='Spares')
|
||||
{
|
||||
//alert('good');
|
||||
|
||||
//$('#contest_num').hide();
|
||||
$('#Assetcode').prop('disabled', false);
|
||||
$('#Costcenter').prop('disabled', false);
|
||||
}
|
||||
else{
|
||||
// // alert('bad');
|
||||
|
||||
$('#Assetcode').prop('disabled', 'disabled');
|
||||
$('#Costcenter').prop('disabled', 'disabled');
|
||||
}
|
||||
@ -377,7 +406,7 @@ $('#MaterialName').change(function() {
|
||||
swal( "'" + materialname + "' - related materials are ," , related_name);
|
||||
$("#MaterialName").focus();
|
||||
|
||||
});//sweet alert closed....
|
||||
});//sweet swal closed....
|
||||
|
||||
}
|
||||
|
||||
@ -388,17 +417,4 @@ $('#MaterialName').change(function() {
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
// function changeTextBox() {
|
||||
// var x = document.getElementById("MaterialCategory");
|
||||
// if(x.value=='Spares')
|
||||
// {
|
||||
// document.getElementById("Assetcode").disabled=false;
|
||||
// document.getElementById("Costcenter").disabled=false;
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// document.getElementById("Assetcode").disabled=true;
|
||||
// document.getElementById("Costcenter").disabled=true; }
|
||||
// }
|
||||
</script>
|
||||
@ -13,6 +13,10 @@ $conversionactor ='';
|
||||
$RMCode = '';
|
||||
$HSNcode = '';
|
||||
$IsActive = '';
|
||||
$openstock='';
|
||||
$date='';
|
||||
$reorder='';
|
||||
$total='0.00';
|
||||
|
||||
if(!empty($materialDetails))
|
||||
{
|
||||
@ -31,6 +35,9 @@ if(!empty($materialDetails))
|
||||
$conversionfactorUOM = $MD->ConversionFactorUOM;
|
||||
$RMCode = $MD->RMCode;
|
||||
$HSNcode = $MD->HSNCODE;
|
||||
$swal=$MD->stock;
|
||||
$date=$MD->stockdate;
|
||||
$reorder=$MD->reorder;
|
||||
$chk = $MD->IsActive;
|
||||
|
||||
if($chk == 1)
|
||||
@ -44,8 +51,41 @@ if(!empty($materialDetails))
|
||||
}
|
||||
}
|
||||
|
||||
if(!empty($currentstock))
|
||||
{
|
||||
|
||||
$currentstock =$currentstock[0]['remainingqty'];
|
||||
|
||||
$x = $swal;
|
||||
$y = $currentstock;
|
||||
$total= $x + $y;
|
||||
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<?php
|
||||
|
||||
if( $total <= $reorder){
|
||||
|
||||
echo '<script type="text/javascript">alert("Current Stock Low ");</script>';
|
||||
|
||||
}
|
||||
?>
|
||||
<script>
|
||||
|
||||
|
||||
$(function() {
|
||||
$("#Date").datepicker({
|
||||
//minDate :'now',
|
||||
//maxDate : 'now',
|
||||
dateFormat: 'dd-mm-yy',changeMonth: true, changeYear: true,yearRange: '-100:+1'
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
</script>
|
||||
<style>
|
||||
.autocomplete-suggestion{
|
||||
cursor:pointer;
|
||||
@ -183,7 +223,48 @@ if(!empty($materialDetails))
|
||||
<input type="text" class="form-control" id="HSNcode" name="HSNcode" maxlength="8" value="<?php echo $HSNcode; ?>" onkeypress="return isNumberKey(event)" >
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<div class="form-group">
|
||||
<label for="openstock">Opening Stock</label>
|
||||
<?php if($openstock!="") { ?>
|
||||
<input type="text" class="form-control required " id="openstock" readonly name="openstock" value="<?php echo $openstock;?>" maxlength="255">
|
||||
<?php } else { ?>
|
||||
<input type="text" class="form-control" id="openstock" name="openstock" maxlength="255">
|
||||
<?php } ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<div class="form-group">
|
||||
<label for="openstockdate" >Open Stock Date</label>
|
||||
<?php
|
||||
if($date!="")
|
||||
{
|
||||
$data = array('name' => 'Date','value' => set_value('Date',$date), 'class' => 'form-control','readonly'=>'true', 'onkeypress'=>'return false;');
|
||||
echo form_input($data);
|
||||
}
|
||||
else
|
||||
{
|
||||
$data = array('name' => 'Date','id'=>'Date', 'class' => 'form-control' , 'onkeypress'=>'return false;');
|
||||
echo form_input($data);
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<div class="form-group">
|
||||
<label for="reorderlevel">Reorder Level</label>
|
||||
<input type="text" class="form-control" id="reorder" value="<?php echo $reorder;?>" name="reorder" maxlength="255">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-12">
|
||||
<div class="col-md-3">
|
||||
<div class="form-group">
|
||||
<label for="currentstock">Current Stock</label>
|
||||
<input type="text" class="form-control" id="currentstock" readonly value="<?php echo $total; ?>" name="currentstock" maxlength="255">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label for="remarks">Remarks</label>
|
||||
|
||||
@ -106,6 +106,7 @@ $otherPayment = $Req->PaymentOtherDescription;
|
||||
$IGRNO =$Req->IGRNO;
|
||||
}
|
||||
}
|
||||
|
||||
if(!empty($RequistionDetails))
|
||||
{
|
||||
foreach ($RequistionDetails as $ReqDet)
|
||||
@ -202,6 +203,7 @@ else
|
||||
{
|
||||
$('#splpodiv').hide();
|
||||
}
|
||||
|
||||
var update = '<?php echo json_encode($update)?>';
|
||||
if(update !='null')
|
||||
{
|
||||
@ -211,7 +213,7 @@ else
|
||||
{
|
||||
$('#editpodiv').hide();
|
||||
}
|
||||
/*****************************/
|
||||
|
||||
$('#PoTypeOptions').attr("style", "pointer-events: none;");
|
||||
if(DelOpt=="0"){
|
||||
$('#Deliverydtdiv').show();
|
||||
@ -234,8 +236,6 @@ else{
|
||||
$('#otheroptiondiv').hide();
|
||||
$('#Otherpayment').val('');
|
||||
}
|
||||
// var insurancestatus = <?php echo $insurencestatus;?>;
|
||||
// var insuranceno = <?php echo $insurenceno;?>;
|
||||
if(insurancestatus == 1)
|
||||
{
|
||||
|
||||
@ -1770,7 +1770,6 @@ else if( $('#txtViewFreight').val() != "0" && $('#txtViewFreight').val() != '')
|
||||
var FreightValue = parseFloat($('#txtViewFreight').val());
|
||||
var UOM = parseFloat($('#ViewUOM').val());
|
||||
var Quantity = parseFloat($('#ViewQuantity').val());
|
||||
|
||||
var AfterFreight = 0.0;
|
||||
// if(FreightType == PercentageType)
|
||||
// {
|
||||
@ -2181,6 +2180,7 @@ return tot;
|
||||
<div style="border:2px solid #333">
|
||||
<div id="content"></div>
|
||||
<div>
|
||||
<!-- <center><b><h2>Siddharth Industries - Edit Revenue Purchase Order - <?php echo $PONO;?></h2></b></center></div> -->
|
||||
<center><b><h2><?php echo $pageTitle . '-' . $PONO;?></h2></b></center></div>
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
@ -4047,10 +4047,21 @@ return tot;
|
||||
|
||||
<table id="table3" class="table table-hover table-bordered" style="background-color:#fff;font-size:12px;" >
|
||||
<div class="col-md-12">
|
||||
|
||||
|
||||
|
||||
<div class="col-md-offset-10 col-md-8" >
|
||||
|
||||
<input type="button" class="btn btn-primary" id ="addmorebutton" value=" ADD FILES..">
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div id="newdiv"></div>
|
||||
<input type="hidden" name="hidecounter" id="hidecounter" value="0" />
|
||||
<input type="hidden" name="hideconstant" id="hideconstant" value="0" />
|
||||
@ -4079,19 +4090,9 @@ return tot;
|
||||
<td><?php echo $gd->BillNo ?></td>
|
||||
|
||||
<td ><?php echo (!empty($gd->FilePath))?$gd->FilePath:"No File"; ?></td>
|
||||
<!-- <input type="hidden" id="hiddenigrno" value="<?php $gd->IGRNO?>"> -->
|
||||
|
||||
<input type="hidden" id="billnos<?=$index?>" value="<?= $gd->BillNo?>">
|
||||
<input type="hidden" id="file<?=$index?>" name ='file' value="<?=$gd->FilePath?>">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<td><span onclick="openbillmodel(<?php echo $index ?>);"><i class="fa fa-pencil" data-toggle="tooltip" title="Click here to Edit the Revenue SplPO details"></i></span>
|
||||
<?php if(!empty($gd->FilePath)) { ?>
|
||||
<a target="_blank" href="<?php echo base_url().'uploads/BillFiles/'?><?php echo $gd->FilePath ?>"><i class="fa fa-download" ></i></a>
|
||||
@ -4142,8 +4143,6 @@ return tot;
|
||||
|
||||
<td><?php echo $inde; ?></td>
|
||||
<td><?php echo $oldpo->PONO ?></td>
|
||||
|
||||
|
||||
<td><?php echo $oldpo->LineItemNo;?></td>
|
||||
<td><?php echo $oldpo->Entity?></td>
|
||||
<?php if($oldpo->Entity =='PO DateChanged'){
|
||||
@ -4624,6 +4623,9 @@ return tot;
|
||||
var TotalOrderValue = $("#txtViewTotalOrderValue").val();
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
var tr= document.getElementById(userid);
|
||||
var cellval = tr.cells;
|
||||
|
||||
@ -4732,7 +4734,6 @@ return tot;
|
||||
var TotalVal =$('#TotalOrderValue'+rowid).val() == '' ? '0.00' : $('#TotalOrderValue'+rowid).val();
|
||||
|
||||
|
||||
|
||||
totBasicAmt = parseFloat(totBasicAmt ) + parseFloat(BasicVal);
|
||||
totDiscountAmt = parseFloat(totDiscountAmt ) + parseFloat(Discount);
|
||||
totPackagingAmt = parseFloat(totPackagingAmt) + parseFloat(Packaging);
|
||||
@ -4975,6 +4976,7 @@ return tot;
|
||||
|
||||
});
|
||||
|
||||
|
||||
if(result == '0')
|
||||
{
|
||||
var DelRows = $('#txtDeletedRow').val();
|
||||
@ -4989,7 +4991,6 @@ return tot;
|
||||
}
|
||||
$('#txtDeletedRow').val(DelRows);
|
||||
}
|
||||
|
||||
// To delete the value from Tables
|
||||
else if(result == '1')
|
||||
{
|
||||
@ -5024,6 +5025,7 @@ return tot;
|
||||
}});
|
||||
}
|
||||
|
||||
//populateValueMainFormForDeleteItem(rowid);
|
||||
|
||||
}
|
||||
|
||||
@ -5101,6 +5103,7 @@ return tot;
|
||||
var AvlBudAmt = '<?php echo number_format($AvlAmount+$totBasicAmt-$totDiscountAmt, 2, '.', '') ?>';
|
||||
var txtTotalbasicamount = $('#txtTotBasicAmount').val();
|
||||
var totaldiscount = $('#txtTotalDiscount').val();
|
||||
|
||||
if(validate())
|
||||
{
|
||||
if(document.getElementById('revenueTax').rows.length < 2)
|
||||
@ -5509,7 +5512,6 @@ return tot;
|
||||
$('#ViewdeptName').val($('#departmentName'+userid).val());
|
||||
$("#ViewCostCenter").val($('#costCode'+userid).val());
|
||||
$('#ViewAvlBudAmt').val(AvlBudAmt);
|
||||
//
|
||||
|
||||
$('#ViewItemName').val($('#materialName'+userid).val());
|
||||
$('#ViewUOM').val($('#uom'+userid).val());
|
||||
@ -5585,8 +5587,6 @@ return tot;
|
||||
var param1 = $('#hidebillno').val();
|
||||
var param2 = $('#hideoldfile').val();
|
||||
|
||||
// var filename = $("#billimag").val();
|
||||
// filename = filename.split('\\');
|
||||
formData.append('file',file);
|
||||
formData.append('param1',param1);
|
||||
formData.append('param2',param2);
|
||||
@ -5662,7 +5662,6 @@ return tot;
|
||||
var formData = new FormData();
|
||||
var file = $("#images"+counter).prop('files')[0];
|
||||
|
||||
|
||||
var PONO =$('#txtPONO').val();
|
||||
var igr =$('#hiddenIGRNO').val();
|
||||
|
||||
|
||||
@ -41,11 +41,12 @@
|
||||
{
|
||||
foreach($userRecords as $record)
|
||||
{
|
||||
$date=date("Y-m-d");
|
||||
?>
|
||||
<tr>
|
||||
|
||||
|
||||
<td style="width:9%;"><u><a href="<?php echo base_url().'rawmaterialdetails/viewRawmaterial?RID='.$record->MaterialCode.'&MType='.$record->MaterialType.'&UOM='.$record->UOM ?>" data-toggle="tooltip" title="<?php echo $record->MaterialCode; ?> - Click here to view Material details"><?php echo $record->MaterialCode ?> </a></u></td>
|
||||
<td style="width:9%;"><u><a href="<?php echo base_url().'rawmaterialdetails/viewRawmaterial?RID='.$record->MaterialCode.'&MType='.$record->MaterialType.'&UOM='.$record->UOM.'&date1='.$date ?>" data-toggle="tooltip" title="<?php echo $record->MaterialCode; ?> - Click here to view Material details"><?php echo $record->MaterialCode ?> </a></u></td>
|
||||
<!--<td><u><a href="<?php echo base_url().'rawmaterialdetails/viewRawmaterial?RID='.$record->RMCode.'&MType='.$record->MaterialType.'&UOM='.$record->UOM ?>" data-toogle="tooltip" title="<?php echo $record->RMCode; ?> - Click here to view Material details"><?php echo $record->RMCode ?> </a></u></td>-->
|
||||
<td style="width:12%;"><?php echo $record->MaterialName ?></td>
|
||||
<td style="width:10%;"><?php echo $record->MaterialType ?></td>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user