Report changes and security login issue fixed

This commit is contained in:
venbatechnologies@gmail.com 2017-12-21 19:36:31 +05:30
parent a2dc2b63ff
commit dc6c8de5c8
46 changed files with 7722 additions and 5632 deletions

View File

@ -69,7 +69,8 @@ class MRIRcontroller extends BaseController
$mpdf=new mPDF('utf-8','A4-P',8, 10,10, 10, 82, 38, 4, 6); $mpdf=new mPDF('utf-8','A4-P',10, 10,10, 10,10, 38, 4, 6);
$HTMLFooter = $this->load->view('includes/bankreport_footer',$data, true);
$mpdf->SetDisplayMode('fullpage'); $mpdf->SetDisplayMode('fullpage');
$mpdf->SetHTMLHeader($HtmlHeading); $mpdf->SetHTMLHeader($HtmlHeading);
$html = $this->load->view('Mrirprintpdf',$data,true); $html = $this->load->view('Mrirprintpdf',$data,true);

View File

@ -1,6 +1,6 @@
<?php if(!defined('BASEPATH')) exit('No direct script access allowed'); <?php if(!defined('BASEPATH')) exit('No direct script access allowed');
require APPPATH . '/librariess/BaseController.php'; require APPPATH . '/libraries/BaseController.php';
/** /**
* Class : Inward Gate Register Controller (security) * Class : Inward Gate Register Controller (security)

View File

@ -91,7 +91,7 @@ class payslip extends BaseController
$data['Totalamount']=$totalamt; $data['Totalamount']=$totalamt;
$data['Totalamtwords']=$totamtwords; $data['Totalamtwords']=$totamtwords;
$data['PayMonth']=$month; $data['PayMonth']=$month;
$filename = 'Bank Report for'.$payon.'pdf' ; $filename = 'Bank Report for'.$payon ;
$HTML = $this->load->view("bankreportprint",$data,true); $HTML = $this->load->view("bankreportprint",$data,true);
} }
if($this->input->post('PF_Report')) if($this->input->post('PF_Report'))
@ -121,7 +121,7 @@ class payslip extends BaseController
if(empty($excel)){ if(empty($excel)){
$filename = 'PF Report for'.$payon.'pdf' ; $filename = 'PF Report for'.$payon ;
$HTML = $this->load->view("pfreportprint",$data,true); $HTML = $this->load->view("pfreportprint",$data,true);
} }
@ -244,7 +244,7 @@ class payslip extends BaseController
if(empty($excel)){ if(empty($excel)){
$filename = 'ESI Report for'.$payon.'pdf'; $filename = 'ESI Report for'.$payon;
$HTML = $this->load->view("esireportprint",$data,true); $HTML = $this->load->view("esireportprint",$data,true);
} }
else { else {
@ -340,7 +340,7 @@ class payslip extends BaseController
$mpdf=new mPDF('utf-8','A4-P',10, 12,12, 10, 10, 38, 4, 6); $mpdf=new mPDF('utf-8','A4-P',10, 12,12, 10, 10, 38, 4, 6);
$HTMLFooter = $this->load->view('includes/bankreport_footer',$data, true); $HTMLFooter = $this->load->view('includes/bankreport_footer',$data, true);
$mpdf->SetDisplayMode('fullpage'); $mpdf->SetDisplayMode('fullpage');
$mpdf->SetHTMLHeader($HtmlHeading); //$mpdf->SetHTMLHeader($HtmlHeading);
$mpdf->setFooter($HTMLFooter . "Page {PAGENO} of {nb}"); $mpdf->setFooter($HTMLFooter . "Page {PAGENO} of {nb}");
// $mpdf->setFooter("Page {PAGENO} of {nb}"); // $mpdf->setFooter("Page {PAGENO} of {nb}");
$mpdf->list_indent_first_level = 1; $mpdf->list_indent_first_level = 1;
@ -767,6 +767,7 @@ class payslip extends BaseController
$mpdf=new mPDF('utf-8','A4-P',10, 10,10, 10, 10, 24, 4, 6); $mpdf=new mPDF('utf-8','A4-P',10, 10,10, 10, 10, 24, 4, 6);
$mpdf->SetDisplayMode('fullpage'); $mpdf->SetDisplayMode('fullpage');
$mpdf->SetHTMLHeader($HtmlHeading); $mpdf->SetHTMLHeader($HtmlHeading);
$mpdf->addFavicon('icons');
$mpdf->setFooter($HTMLFooter . "Page {PAGENO} of {nb}"); $mpdf->setFooter($HTMLFooter . "Page {PAGENO} of {nb}");
$mpdf->setFooter("Page {PAGENO} of {nb}"); $mpdf->setFooter("Page {PAGENO} of {nb}");
$mpdf->list_indent_first_level = 1; $mpdf->list_indent_first_level = 1;

View File

@ -68,7 +68,7 @@ class report extends BaseController
public function releasedPO() public function releasedPO()
{ {
$this->global['pageTitle'] = 'Siddharth : Reports'; $this->global['pageTitle'] = 'Resico : Reports';
if ($this->input->post('btn_submit')) { if ($this->input->post('btn_submit')) {
@ -291,7 +291,7 @@ class report extends BaseController
{ {
$this->global['pageTitle'] = 'Resico : Reports '; $this->global['pageTitle'] = 'Resico : Reports ';
//$this->input->post('btn_submit'); if ($this->input->post('btn_submit')) {
$cname = $this->input->post('client_name'); $cname = $this->input->post('client_name');
$prod = $this->input->post('item_name'); $prod = $this->input->post('item_name');
$ab=$this->input->post('financialyear'); $ab=$this->input->post('financialyear');
@ -300,11 +300,16 @@ class report extends BaseController
$m=$this->input->post('month'); $m=$this->input->post('month');
$frm = $this->input->post('from_date'); $frm = $this->input->post('from_date');
$t = $this->input->post('to_date'); $t = $this->input->post('to_date');
//print_r($prod);
$data['material']=$this->dahsboard_Model->material_name(); $data['material']=$this->dahsboard_Model->material_name();
$data['cust']=$this->dahsboard_Model->customer_name(); $data['cust']=$this->dahsboard_Model->customer_name();
$data['finyear']=$this->dahsboard_Model->report_finyear(); $data['finyear']=$this->dahsboard_Model->report_finyear();
$data['purchase']=$this->dahsboard_Model->report_purchase($cname,$prod,$fa,$aa,$m,$frm,$t); $data['purchase']=$this->dahsboard_Model->report_purchase($cname,$prod,$fa,$aa,$m,$frm,$t);
}
$data['material']=$this->dahsboard_Model->material_name();
$data['cust']=$this->dahsboard_Model->customer_name();
$data['finyear']=$this->dahsboard_Model->report_finyear();
if($this->DEPCode == MANAGEMENT) if($this->DEPCode == MANAGEMENT)
@ -437,7 +442,7 @@ class report extends BaseController
{ {
$this->global['pageTitle'] = 'Resico : Supplier-wise Reports'; $this->global['pageTitle'] = 'Resico : Supplier-wise Reports';
//$this->input->post('btn_submit'); if ($this->input->post('btn_submit')) {
$cname = $this->input->post('client_name'); $cname = $this->input->post('client_name');
$ab=$this->input->post('financialyear'); $ab=$this->input->post('financialyear');
$fa=substr($ab,0,-5); $fa=substr($ab,0,-5);
@ -445,12 +450,15 @@ class report extends BaseController
$m=$this->input->post('month'); $m=$this->input->post('month');
$frm = $this->input->post('from_date'); $frm = $this->input->post('from_date');
$t = $this->input->post('to_date'); $t = $this->input->post('to_date');
//print_r($prod);
$data['material']=$this->dahsboard_Model->material_name(); $data['material']=$this->dahsboard_Model->material_name();
$data['cust']=$this->dahsboard_Model->customer_name(); $data['cust']=$this->dahsboard_Model->customer_name();
$data['finyear']=$this->dahsboard_Model->report_finyear(); $data['finyear']=$this->dahsboard_Model->report_finyear();
$data['spurchse']=$this->dahsboard_Model->report_supplier($cname,$fa,$aa,$m,$frm,$t); $data['spurchse']=$this->dahsboard_Model->report_supplier($cname,$fa,$aa,$m,$frm,$t);
}
$data['material']=$this->dahsboard_Model->material_name();
$data['cust']=$this->dahsboard_Model->customer_name();
$data['finyear']=$this->dahsboard_Model->report_finyear();
if($this->DEPCode == MANAGEMENT) if($this->DEPCode == MANAGEMENT)
{ {
@ -465,7 +473,7 @@ class report extends BaseController
{ {
$this->global['pageTitle'] = 'Resico : Consolidated Reports'; $this->global['pageTitle'] = 'Resico : Consolidated Reports';
//$this->input->post('btn_submit'); if ($this->input->post('btn_submit')) {
$cname = $this->input->post('client_name'); $cname = $this->input->post('client_name');
$ab=$this->input->post('financialyear'); $ab=$this->input->post('financialyear');
$fa=substr($ab,0,-5); $fa=substr($ab,0,-5);
@ -474,7 +482,12 @@ class report extends BaseController
$data['material']=$this->dahsboard_Model->material_name(); $data['material']=$this->dahsboard_Model->material_name();
$data['cust']=$this->dahsboard_Model->customer_name(); $data['cust']=$this->dahsboard_Model->customer_name();
$data['finyear']=$this->dahsboard_Model->report_finyear(); $data['finyear']=$this->dahsboard_Model->report_finyear();
$data['spurchse']=$this->dahsboard_Model->report_consolidate($cname,$fa,$aa); $data['spurchse']=$this->dahsboard_Model->report_consolidate($cname,$fa,$aa);
}
$data['material']=$this->dahsboard_Model->material_name();
$data['cust']=$this->dahsboard_Model->customer_name();
$data['finyear']=$this->dahsboard_Model->report_finyear();
if($this->DEPCode == MANAGEMENT) if($this->DEPCode == MANAGEMENT)
@ -568,7 +581,7 @@ class report extends BaseController
{ {
$this->global['pageTitle'] = 'Resico : Reports'; $this->global['pageTitle'] = 'Resico : Reports';
//$this->input->post('btn_submit'); if ($this->input->post('btn_submit')) {
$cname = $this->input->post('client_name'); $cname = $this->input->post('client_name');
$prod = $this->input->post('item_name'); $prod = $this->input->post('item_name');
$ab=$this->input->post('financialyear'); $ab=$this->input->post('financialyear');
@ -586,6 +599,11 @@ class report extends BaseController
$data['cust']=$this->dahsboard_Model->customer_name(); $data['cust']=$this->dahsboard_Model->customer_name();
$data['finyear']=$this->dahsboard_Model->report_finyear(); $data['finyear']=$this->dahsboard_Model->report_finyear();
$data['purchase']=$this->dahsboard_Model->ireport_purchase($cname,$prod,$fa,$aa,$m,$frm,$t,$sid,$mid,$d); $data['purchase']=$this->dahsboard_Model->ireport_purchase($cname,$prod,$fa,$aa,$m,$frm,$t,$sid,$mid,$d);
}
$data['material']=$this->dahsboard_Model->material_name();
$data['cust']=$this->dahsboard_Model->customer_name();
$data['finyear']=$this->dahsboard_Model->report_finyear();
if($this->DEPCode == MANAGEMENT) if($this->DEPCode == MANAGEMENT)
{ {
@ -725,7 +743,7 @@ class report extends BaseController
{ {
$this->global['pageTitle'] = 'Resico : Reports'; $this->global['pageTitle'] = 'Resico : Reports';
//$this->input->post('btn_submit'); if ($this->input->post('btn_submit')) {
$cname = $this->input->post('client_name'); $cname = $this->input->post('client_name');
$ab=$this->input->post('financialyear'); $ab=$this->input->post('financialyear');
$fa=substr($ab,0,-5); $fa=substr($ab,0,-5);
@ -737,7 +755,12 @@ class report extends BaseController
$data['material']=$this->dahsboard_Model->material_name(); $data['material']=$this->dahsboard_Model->material_name();
$data['cust']=$this->dahsboard_Model->customer_name(); $data['cust']=$this->dahsboard_Model->customer_name();
$data['finyear']=$this->dahsboard_Model->report_finyear(); $data['finyear']=$this->dahsboard_Model->report_finyear();
$data['spurchse']=$this->dahsboard_Model->ireport_supplier($cname,$fa,$aa,$m,$frm,$t); $data['spurchse']=$this->dahsboard_Model->ireport_supplier($cname,$fa,$aa,$m,$frm,$t);
}
$data['material']=$this->dahsboard_Model->material_name();
$data['cust']=$this->dahsboard_Model->customer_name();
$data['finyear']=$this->dahsboard_Model->report_finyear();
if($this->DEPCode == MANAGEMENT) if($this->DEPCode == MANAGEMENT)
@ -759,7 +782,7 @@ class report extends BaseController
{ {
$this->global['pageTitle'] = 'Resico : Reports'; $this->global['pageTitle'] = 'Resico : Reports';
//$this->input->post('btn_submit'); if ($this->input->post('btn_submit')) {
$cname = $this->input->post('client_name'); $cname = $this->input->post('client_name');
$ab=$this->input->post('financialyear'); $ab=$this->input->post('financialyear');
$fa=substr($ab,0,-5); $fa=substr($ab,0,-5);
@ -768,7 +791,12 @@ class report extends BaseController
$data['material']=$this->dahsboard_Model->material_name(); $data['material']=$this->dahsboard_Model->material_name();
$data['cust']=$this->dahsboard_Model->customer_name(); $data['cust']=$this->dahsboard_Model->customer_name();
$data['finyear']=$this->dahsboard_Model->report_finyear(); $data['finyear']=$this->dahsboard_Model->report_finyear();
$data['spurchse']=$this->dahsboard_Model->ireport_consolidate($cname,$fa,$aa); $data['spurchse']=$this->dahsboard_Model->ireport_consolidate($cname,$fa,$aa);
}
$data['material']=$this->dahsboard_Model->material_name();
$data['cust']=$this->dahsboard_Model->customer_name();
$data['finyear']=$this->dahsboard_Model->report_finyear();
if($this->DEPCode == MANAGEMENT) if($this->DEPCode == MANAGEMENT)
{ {
@ -779,7 +807,69 @@ class report extends BaseController
$this->loadViews("access", $this->global, $data, NULL); $this->loadViews("access", $this->global, $data, NULL);
} }
}
public function i_consolidate_month()
{
$this->global['pageTitle'] = 'Siddharth : Reports';
//$this->input->post('btn_submit');
$sid=$this->input->get('sid');
$mid = $this->input->get('mid');
$cname = $this->input->get('cname');
$prod = $this->input->get('prod');
$cname = $this->input->get('cname');
$prod = $this->input->get('prod');
//$mat = $this->input->get('mid');
$m = $this->input->get('m');
$ab=$this->input->get('ab');
$fa=substr($ab,0,-5);
$aa=substr($ab,5,5);
//print_r($prod);
$data['material']=$this->dahsboard_Model->material_name();
$data['cust']=$this->dahsboard_Model->customer_name();
$data['finyear']=$this->dahsboard_Model->report_finyear();
$data['spurchse']=$this->dahsboard_Model->i_consolidate_month($m,$cname,$prod,$fa,$aa);
// print_r( $data['spurchse']);
if($this->DEPCode == MANAGEMENT)
{
$this->loadviews("Report_consolidate_month_inward",$this->global,$data, NULL);
}
else
{
$this->loadViews("access", $this->global, $data, NULL);
}
} }
public function i_consolidate_year()
{
$this->global['pageTitle'] = 'Siddharth : Reports';
//$this->input->post('btn_submit');
$sid=$this->input->get('sid');
$mid = $this->input->get('mid');
$cname = $this->input->get('cname');
$prod = $this->input->get('prod');
//$mat = $this->input->get('mid');
$ab=$this->input->get('ab');
$fa=substr($ab,0,-5);
$aa=substr($ab,5,5);
//print_r($prod);
$data['material']=$this->dahsboard_Model->material_name();
$data['cust']=$this->dahsboard_Model->customer_name();
$data['finyear']=$this->dahsboard_Model->report_finyear();
$data['spurchse']=$this->dahsboard_Model->i_consolidate_year($cname,$prod,$fa,$aa);
// print_r( $data['spurchse']);
if($this->DEPCode == MANAGEMENT)
{
$this->loadviews("Report_consolidate_year_inward",$this->global,$data, NULL);
}
else
{
$this->loadViews("access", $this->global, $data, NULL);
}
}
public function icumulative() public function icumulative()
{ {
@ -926,16 +1016,21 @@ class report extends BaseController
{ {
$this->global['pageTitle'] = 'Resico : Reports'; $this->global['pageTitle'] = 'Resico : Reports';
//$this->input->post('btn_submit'); if ($this->input->post('btn_submit')) {
$cname = $this->input->post('client_name');
$ab=$this->input->post('financialyear'); $cname = $this->input->post('client_name');
$fa=substr($ab,0,-5); $ab=$this->input->post('financialyear');
$aa=substr($ab,5,5); $fa=substr($ab,0,-5);
//print_r($prod); $aa=substr($ab,5,5);
$data['material']=$this->dahsboard_Model->category();
$data['cust']=$this->dahsboard_Model->customer_name(); $data['material']=$this->dahsboard_Model->category();
$data['finyear']=$this->dahsboard_Model->report_finyear(); $data['cust']=$this->dahsboard_Model->customer_name();
$data['spurchse']=$this->dahsboard_Model->rawi_report_consolidate($cname,$fa,$aa); $data['finyear']=$this->dahsboard_Model->report_finyear();
$data['spurchse']=$this->dahsboard_Model->rawi_report_consolidate($cname,$fa,$aa);
}
$data['material']=$this->dahsboard_Model->category();
$data['cust']=$this->dahsboard_Model->customer_name();
$data['finyear']=$this->dahsboard_Model->report_finyear();
if($this->DEPCode == MANAGEMENT) if($this->DEPCode == MANAGEMENT)
{ {

View File

@ -1,7 +1,11 @@
<?php if(!defined('BASEPATH')) exit('No direct script access allowed'); <?php if(!defined('BASEPATH')) exit('No direct script access allowed');
require APPPATH . '/libraries/BaseController.php'; require APPPATH . '/libraries/BaseController.php';
/** /**
* Class : storestatus (Store Stock Status -Controller) * Class : storestatus (Store Stock Status -Controller)
* storestatus Class to control all store related operations. * storestatus Class to control all store related operations.
@ -9,145 +13,267 @@ require APPPATH . '/libraries/BaseController.php';
* @version : 1.1 * @version : 1.1
* @since : 18 November 2017 * @since : 18 November 2017
*/ */
class storestatus extends BaseController class storestatus extends BaseController
{ {
/**
/**
* default constructor of the class * default constructor of the class
*/ */
public function __construct() public function __construct()
{ {
parent::__construct(); parent::__construct();
$this->load->model('store_model'); $this->load->model('store_model');
$this->load->library('form_validation');
$this->load->library('form_validation');
$this->isLoggedIn(); $this->isLoggedIn();
} }
/** /**
* Index Page for this controller (default function of the class) * Index Page for this controller (default function of the class)
*/ */
public function index() public function index()
{ {
$this->global['pageTitle'] = 'Resico Industries : Store Status';
$this->loadViews("storestatus", $this->global, NULL , NULL); $this->global['pageTitle'] = 'Siddharth Industries : Store Status';
$this->loadViews("storestatus", $this->global, NULL , NULL);
} }
/** /**
* To descripted Store Stock Availability list * To descripted Store Stock Availability list
*/ */
function storeavailability() function storeavailability()
{ {
$this->global['pageTitle'] = 'Resico Industries : Store Status';
$this->global['pageTitle'] = 'Siddharth Industries : Store Status';
$data['Stock'] = $this->store_model->viewStock(); $data['Stock'] = $this->store_model->viewStock();
$data['MaterialList'] = $this->store_model->GetAllMaterialList(); $data['MaterialList'] = $this->store_model->GetAllMaterialList();
$data['StockStatus'] = $this->store_model->GetConfigValue('C021'); $data['StockStatus'] = $this->store_model->GetConfigValue('C021');
if($this->DEPCode == STORE)
{
$this->loadViews("storestatus", $this->global, $data,null); $this->loadViews("storestatus", $this->global, $data,null);
}
else
{
$this->loadViews("access", $this->global, $data,null);
}
} }
/** /**
* Its handles add stock details Operation. * Its handles add stock details Operation.
*/ */
function AddStock() function AddStock()
{ {
$MaterialCode = $this->input->post('MaterialCode'); $MaterialCode = $this->input->post('MaterialCode');
$AvailableQty = $this->input->post('AddAvailableStock'); $AvailableQty = $this->input->post('AddAvailableStock');
$AvailbilityStatus = $this->input->post('StockAvail'); $AvailbilityStatus = $this->input->post('StockAvail');
$Remarks = $this->input->post('Remarks'); $Remarks = $this->input->post('Remarks');
$CreatedBy = $this->session->userdata('EmpID'); $CreatedBy = $this->session->userdata('EmpID');
$dt = new DateTime('now', new DateTimeZone('Asia/Kolkata')); $dt = new DateTime('now', new DateTimeZone('Asia/Kolkata'));
$createddt = $dt->format('Y-m-d H:i:s'); $createddt = $dt->format('Y-m-d H:i:s');
$Status = 1; $Status = 1;
if(trim($AvailbilityStatus) == 'YES') if(trim($AvailbilityStatus) == 'YES')
{ {
$Status = 0; $Status = 0;
} }
//this array to store the value in master table.. //this array to store the value in master table..
$Stockdetails = array('MaterialCode'=>$MaterialCode,'Quantity'=>$AvailableQty,'Status'=>$Status,'Remarks'=>$Remarks, 'CreatedBy'=>$CreatedBy,'Createdon'=>$createddt); $Stockdetails = array('MaterialCode'=>$MaterialCode,'Quantity'=>$AvailableQty,'Status'=>$Status,'Remarks'=>$Remarks, 'CreatedBy'=>$CreatedBy,'Createdon'=>$createddt);
$data['Stock'] = $this->store_model->addStock($Stockdetails); $data['Stock'] = $this->store_model->addStock($Stockdetails);
echo 'Stock Added successfully'; echo 'Stock Added successfully';
} }
/**
/**
* Its handles updated stock details Operations. * Its handles updated stock details Operations.
*/ */
function UpdateStock() function UpdateStock()
{ {
$MaterialCode = $this->input->post('EditMaterialCode'); $MaterialCode = $this->input->post('EditMaterialCode');
$AvailableQty = $this->input->post('EditAvailableStock'); $AvailableQty = $this->input->post('EditAvailableStock');
$AvailbilityStatus = $this->input->post('EditStockAvail'); $AvailbilityStatus = $this->input->post('EditStockAvail');
$Remarks = $this->input->post('EditRemarks'); $Remarks = $this->input->post('EditRemarks');
$CreatedBy = $this->session->userdata('EmpID'); $CreatedBy = $this->session->userdata('EmpID');
$dt = new DateTime('now', new DateTimeZone('Asia/Kolkata')); $dt = new DateTime('now', new DateTimeZone('Asia/Kolkata'));
$createddt = $dt->format('Y-m-d H:i:s'); $createddt = $dt->format('Y-m-d H:i:s');
$Status = 1; $Status = 1;
if(trim($AvailbilityStatus) == 'YES') if(trim($AvailbilityStatus) == 'YES')
{ {
$Status = 0; $Status = 0;
} }
//this array to store the value in master table..
//this array to store the value in master table..
$Stockdetails = array('Quantity'=>$AvailableQty,'Status'=>$Status,'Remarks'=>$Remarks, 'UpdatedBy'=>$CreatedBy,'updatedOn'=>$createddt); $Stockdetails = array('Quantity'=>$AvailableQty,'Status'=>$Status,'Remarks'=>$Remarks, 'UpdatedBy'=>$CreatedBy,'updatedOn'=>$createddt);
$data['Stock'] = $this->store_model->UpdateStock($Stockdetails,$MaterialCode); $data['Stock'] = $this->store_model->UpdateStock($Stockdetails,$MaterialCode);
echo 'Stock updated successfully'; echo 'Stock updated successfully';
} }
/**
/**
* Its handles view all stock details. * Its handles view all stock details.
*/ */
function viewStockHistory() function viewStockHistory()
{
$MaterialCode= $this->input->post('id');
$result = $this->store_model->GetStockHisory($MaterialCode); {
$MaterialCode= $this->input->post('id');
$result = $this->store_model->GetStockHisory($MaterialCode);
$TotalStock = 0; $TotalStock = 0;
$HTML="";
for ($i = 0; $i < count($result); $i++) $HTML="";
{
for ($i = 0; $i < count($result); $i++)
{
$SNo = $i + 1; $SNo = $i + 1;
$AvailableQty = $result[$i]['Quantity']; $AvailableQty = $result[$i]['Quantity'];
$UpdatedStock = $result[$i]['ActualQuantity']; $UpdatedStock = $result[$i]['ActualQuantity'];
$Remarks = $result[$i]['Remarks']; $Remarks = $result[$i]['Remarks'];
$Updatedon= new DateTime($result[$i]['updatedOn']); $Updatedon= new DateTime($result[$i]['updatedOn']);
$HTML.="<tr id='".$i."'> $HTML.="<tr id='".$i."'>
<td align='left'>".$SNo."</td> <td align='left'>".$SNo."</td>
<td align='left'>". $AvailableQty."</td> <td align='left'>". $AvailableQty."</td>
<td align='left'>".$UpdatedStock."</td> <td align='left'>".$UpdatedStock."</td>
<td align='left'>".$Updatedon->format('d-m-Y')."</td> <td align='left'>".$Updatedon->format('d-m-Y')."</td>
<td align='left'>".$Remarks."</td> <td align='left'>".$Remarks."</td>
</tr>";
</tr>";
$TotalStock = $TotalStock + $UpdatedStock; $TotalStock = $TotalStock + $UpdatedStock;
} }
die(json_encode(array('History' =>$HTML,'AvalStock'=>$TotalStock))); die(json_encode(array('History' =>$HTML,'AvalStock'=>$TotalStock)));
}
/** }
/**
* To load pagenotfound view * To load pagenotfound view
*/ */
function pageNotFound() function pageNotFound()
{ {
$this->global['pageTitle'] = 'Resico : 404 - Page Not Found';
$this->global['pageTitle'] = 'Siddharth : 404 - Page Not Found';
$this->loadViews("404", $this->global, NULL, NULL); $this->loadViews("404", $this->global, NULL, NULL);
} }
} }
?> ?>

1049
application/controllers/user.php Normal file → Executable file

File diff suppressed because it is too large Load Diff

View File

@ -5,7 +5,7 @@ class assetdetails_model extends CI_Model
/** /**
* To get the Asset data for listing * To get the Asset data for listing
* @return array $result : result of the query * @return array $result : result of the query (returns asset information)
*/ */
function assetListing() function assetListing()
{ {
@ -103,7 +103,7 @@ class assetdetails_model extends CI_Model
/** /**
* To get the PO lineitem details for revenue po. * To get the PO lineitem details for revenue po.
* @param $line : This is PO lineitem number * @param $line : This is PO lineitem number
* @return $result : result of the query (returns po lineitem details) * @return $result : result of the query (returns revenue po lineitem details)
*/ */
function getlineitemre($line){ function getlineitemre($line){
$this->db->select('POL.LineItemNo,POL.MaterialCode,MM.MaterialName,MM.UOM,POL.Quantity,POM.POType,re.TotalValue,req.ReqNo,emp.firstname,emp.Departmentcode,dep.DepartmentName,sup.SupplierName,date(POM.DeliveryDate) as DeliveryDate,POM.PODate,POM.SupplierID'); $this->db->select('POL.LineItemNo,POL.MaterialCode,MM.MaterialName,MM.UOM,POL.Quantity,POM.POType,re.TotalValue,req.ReqNo,emp.firstname,emp.Departmentcode,dep.DepartmentName,sup.SupplierName,date(POM.DeliveryDate) as DeliveryDate,POM.PODate,POM.SupplierID');
@ -126,7 +126,7 @@ class assetdetails_model extends CI_Model
/** /**
* To get the PO lineitem details for service po. * To get the PO lineitem details for service po.
* @param $line : This is PO lineitem number * @param $line : This is PO lineitem number
* @return $result : This is result of the query (returns po lineitem details) * @return $result : This is result of the query (returns service po lineitem details)
*/ */
function getlineitemser($line){ function getlineitemser($line){
$this->db->select('POL.LineItemNo,POL.MaterialCode,MM.MaterialName,MM.UOM,POM.POType,POL.Quantity,ser.TotalValue,req.ReqNo,emp.firstname,dep.DepartmentName,emp.Departmentcode,sup.SupplierName,date(POM.DeliveryDate) as DeliveryDate,POM.PODate,POM.SupplierID'); $this->db->select('POL.LineItemNo,POL.MaterialCode,MM.MaterialName,MM.UOM,POM.POType,POL.Quantity,ser.TotalValue,req.ReqNo,emp.firstname,dep.DepartmentName,emp.Departmentcode,sup.SupplierName,date(POM.DeliveryDate) as DeliveryDate,POM.PODate,POM.SupplierID');
@ -149,7 +149,7 @@ class assetdetails_model extends CI_Model
/** /**
* To get the PO lineitem details for import po. * To get the PO lineitem details for import po.
* @param $line : This is PO lineitem number * @param $line : This is PO lineitem number
* @return $result : result of the query (returns po lineitem details) * @return $result : result of the query (returns import po lineitem details)
*/ */
function getlineitemimport($line){ function getlineitemimport($line){
$this->db->select('POL.LineItemNo,POL.MaterialCode,MM.MaterialName,MM.UOM,POM.POType,POL.Quantity,ser.TotalValue,req.ReqNo,emp.firstname,dep.DepartmentName,emp.Departmentcode,sup.SupplierName,date(POM.DeliveryDate) as DeliveryDate,POM.PODate,POM.SupplierID'); $this->db->select('POL.LineItemNo,POL.MaterialCode,MM.MaterialName,MM.UOM,POM.POType,POL.Quantity,ser.TotalValue,req.ReqNo,emp.firstname,dep.DepartmentName,emp.Departmentcode,sup.SupplierName,date(POM.DeliveryDate) as DeliveryDate,POM.PODate,POM.SupplierID');
@ -171,8 +171,8 @@ class assetdetails_model extends CI_Model
/** /**
* To get the PO lineitem details for capital po. * To get the PO lineitem details for capital po.
* @param $line : To get PO lineitem number from the controller * @param $line : This is PO lineitem number
* @return $result : This is result of the query (returns po lineitem details) * @return $result : result of the query (returns po capital lineitem details)
*/ */
function getlineitemcap($line){ function getlineitemcap($line){
@ -195,7 +195,7 @@ class assetdetails_model extends CI_Model
/** /**
* To get the PO lineitem details revalant po. * To get the PO lineitem details revalant po.
* @param $type : This is PO type * @param $type : This is PO type
* @return $result : result of the query (returns po lineitem detail) * @return $result : result of the query (returns po type and lineitem no)
*/ */
function gettyp($type) function gettyp($type)
{ {
@ -232,8 +232,8 @@ class assetdetails_model extends CI_Model
/** /**
* To Store the asset information * To Store the asset information
* @param $asset : This have all the asset details datas. * @param $asset : This will have all asset datas
* @return $Asset_Code : This will return how many value are inserted (return as number/count) * @return $Asset_Code : This will return how many value are inserted (return as number(counts))
*/ */
function addNewasset($asset) function addNewasset($asset)
{ {
@ -266,7 +266,7 @@ class assetdetails_model extends CI_Model
/** /**
* To Stored edited Asset details from respective Asset Code * To Stored edited Asset details from respective Asset Code
* @param $asset : This have all the information of asset * @param $asset : This will have all the edited asset information
* @param $Asset_Code : This is asset code * @param $Asset_Code : This is asset code
*/ */
function editasset($asset, $Asset_Code) function editasset($asset, $Asset_Code)
@ -278,7 +278,7 @@ class assetdetails_model extends CI_Model
/** /**
* To Store edited Asset details in respective Asset Code * To Store edited Asset details in respective Asset Code
* @param $asset : This have all the information of asset details * @param $asset : This will have all edited aseet information
* @param $Asset_Code : This is asset code * @param $Asset_Code : This is asset code
* *
* Note : This function Temporary not in use * Note : This function Temporary not in use

View File

@ -3,8 +3,8 @@
class cashbook_model extends CI_Model class cashbook_model extends CI_Model
{ {
/** /**
* To get Account status * To get Account Type
* @return array $r->result() : result of the query * @return array $r->result() : result of the query (returns active account code)
*/ */
function getAccounTypes() function getAccounTypes()
{ {
@ -16,7 +16,7 @@ class cashbook_model extends CI_Model
/** /**
* To get Account status * To get Account status
* @param number $data : This will have all the information of asset details. * @param number $data : This will have all the income and expense information.
* @return array $r : This will return how many value are inserted (return as number/count) * @return array $r : This will return how many value are inserted (return as number/count)
*/ */
function saveIncomeExpense($data) function saveIncomeExpense($data)
@ -29,7 +29,7 @@ class cashbook_model extends CI_Model
/** /**
* To get Income and expense List * To get Income and expense List
* @param number $i : Optional : This is incomeandexpense's id * @param number $i : Optional : This is incomeandexpense's id
* @return array $r->result() : result of the query * @return array $r->result() : result of the query (returns account information)
*/ */
function getIncomeExpenseList($i="") function getIncomeExpenseList($i="")
{ {
@ -49,7 +49,7 @@ class cashbook_model extends CI_Model
/** /**
* To get Company details * To get Company details
* @return array $r->result() : result of the query * @return array $r->result() : result of the query (returns company information)
*/ */
function getCompany() function getCompany()
{ {
@ -60,7 +60,7 @@ class cashbook_model extends CI_Model
/** /**
* To get Account Information * To get Account Information
* @param number $i * @param number $i
* @return array $r->result() : result of the query * @return array $r->result() : result of the query (returns account name and incomeandexpense information)
*/ */
function getAccounutInfo($i) function getAccounutInfo($i)
{ {
@ -74,7 +74,7 @@ class cashbook_model extends CI_Model
/** /**
* To get Account Information * To get Account Information
* @return array $result : result of the query * @return array $result : result of the query (returns account information)
*/ */
function Selectcash() function Selectcash()
{ {

View File

@ -57,7 +57,7 @@ class companydetailsmodel extends CI_Model
* To update the company related files information * To update the company related files information
* @param number $compID : This is company ID * @param number $compID : This is company ID
* @param array $Comp : This have all the modified company datas * @param array $Comp : This have all the modified company datas
* @return array $this->db->last_query() : This will return changes in last executed query * @return array $this->db->last_query() : This will return changes in last executed query (return as counts in number)
*/ */
function Updatecompany($Comp, $CompID) function Updatecompany($Comp, $CompID)
{ {
@ -85,7 +85,7 @@ class companydetailsmodel extends CI_Model
/** /**
* To get the Company Information for listing * To get the Company Information for listing
* @return array $result : This is result of the query * @return array $result : result of the query (returns company information)
*/ */
function companylisting() function companylisting()
{ {
@ -101,7 +101,7 @@ class companydetailsmodel extends CI_Model
/** /**
* To get the paymentterms information for companydetails * To get the paymentterms information for companydetails
* @return array $result : This is result of the query * @return array $result : result of the query(return paymentment information)
*/ */
function getPaymentTerms() function getPaymentTerms()
{ {
@ -170,13 +170,13 @@ class companydetailsmodel extends CI_Model
} }
if($count == 0 ) if($count == 0 )// for insertion
{ {
$i = $this->db->insert('T_Bank_Details', $Bank); $i = $this->db->insert('T_Bank_Details', $Bank);
return $i; return $i;
} }
elseif($count == 1) elseif($count == 1)//for updation
{ {
$this->db->where('Bank_name',$bankname); $this->db->where('Bank_name',$bankname);
$this->db->where('IFSC',$bankifsc); $this->db->where('IFSC',$bankifsc);

View File

@ -5,7 +5,7 @@ class configmodel extends CI_Model
/** /**
* To get the Config listing * To get the Config listing
* @return array $result : This is result of the query * @return array $result : result of the query(returns config information)
*/ */
function Configlisting() function Configlisting()
{ {
@ -20,7 +20,7 @@ class configmodel extends CI_Model
/** /**
* To store config master information by configid * To store config master information by configid
* @param number $config : This will have all the config information * @param number $config : This will have all the config information
* @var $insert_id : This will return how many value are inserted (return as number/count) * @var $insert_id : This will return how many value are inserted (return as count in numbers)
* @return array $res->result_array() :This will return maximum of Configid for config lineitem table * @return array $res->result_array() :This will return maximum of Configid for config lineitem table
*/ */
function addconfigmaster($config) function addconfigmaster($config)
@ -38,7 +38,7 @@ class configmodel extends CI_Model
/** /**
* To store config details information * To store config details information
* @param number $configvalue : This will have all the config information * @param number $configvalue : This will have all the config information
* @return array $insert_id : This will return how many value are inserted (return as number/count) * @return number $insert_id : This will return how many value are inserted (return as count in numbers)
*/ */
function addconfigdetails($configvalue) function addconfigdetails($configvalue)
{ {
@ -169,7 +169,7 @@ class configmodel extends CI_Model
* To get costcenter department information by using department code and costcenter id * To get costcenter department information by using department code and costcenter id
* @param number $Depcode : Optional : This is department code * @param number $Depcode : Optional : This is department code
* @param number $CostCode : Optional : This is cost code * @param number $CostCode : Optional : This is cost code
* @return array $query->result_array() : This is result of the query (config master information) * @return array $query->result_array() : result of the query (returns cost master information)
*/ */
function checkDeptCostExists($DepCode='',$CostCode='') function checkDeptCostExists($DepCode='',$CostCode='')
{ {
@ -189,7 +189,7 @@ class configmodel extends CI_Model
/** /**
* To get the Config value from configuration table * To get the Config value from configuration table
* @param number @ConfigID : This is ConfigID * @param number @ConfigID : This is ConfigID
* @return array $result : This is result of the query * @return array $result : result of the query (returns config information)
*/ */
function getConfigValue($ConfigID) function getConfigValue($ConfigID)
{ {

View File

@ -5,7 +5,7 @@ class costcenter_model extends CI_Model
/** /**
* To get the Cost listing * To get the Cost listing
* @return array $result : This is result of the query * @return array $result : result of the query (returns )
*/ */
function CostListing() function CostListing()
{ {
@ -200,7 +200,6 @@ class costcenter_model extends CI_Model
* @param number $Year : This is Budget year * @param number $Year : This is Budget year
* @return array $query->result_array() : This is result of the query * @return array $query->result_array() : This is result of the query
*/ */
function GetCostCenterBudgetByYear($CostCenterCode,$Year) function GetCostCenterBudgetByYear($CostCenterCode,$Year)
{ {

View File

@ -4,7 +4,7 @@ class dahsboard_Model extends CI_Model
{ {
/* HR DASHBOART Model START*/ /* HR DASHBOART Model START*/
function totemp() function totemp()
{ {
@ -55,10 +55,15 @@ $sql="select EmpID,CONCAT(FirstName,' ',LastName) as name FROM T_Employee_Detai
} }
function attyesterday($WH,$date) function attyesterday($WH,$date)
{ {
//echo 'model' . $WH.'-'.$date; //echo 'model' . $WH.'-'.$date;
$sql="select EmpID,".$WH." from T_Attendance where Month_Year = ? and EmpID in (select EmpID from T_Attendance)" ; // $sql="select EmpID,".$WH." from T_Attendance where Month_Year = ? and EmpID in (select EmpID from T_Attendance)" ;
$sql="select att.EmpID,".$WH.",a.FirstName from T_Attendance as att
join T_Employee_Details as a on a.EmpID= att.EmpID
where Month_Year = ? and att.EmpID in (select EmpID from T_Attendance)";
$query = $this->db->query($sql,array($date)); $query = $this->db->query($sql,array($date));
// print_r($query->result()); // print_r($query->result());
//echo count($query->result()); //echo count($query->result());
@ -89,10 +94,30 @@ function attendance($EmpID,$dates)
function getAllAttendance($EmpID,$CURMONTH) function getAllAttendance($EmpID,$CURMONTH)
{ {
$sql="select * from T_Attendance where EmpID =? and month(Month_Year)=?"; $sql="select * from T_Attendance where EmpID =? and month(Month_Year)=?";
// $sql=" select T_Attendance.*,emp.FirstName from T_Attendance
// join T_Employee_Details emp on T_Attendance.EmpID = emp.EmpID
// where T_Attendance.EmpID = ? and month(Month_Year)= ? ";
$query = $this->db->query($sql,array($EmpID,$CURMONTH)); $query = $this->db->query($sql,array($EmpID,$CURMONTH));
return $query->result(); return $query->result();
} }
function getAllAttendances($EmpID,$JoinedMonth)
{
//$sql="select * from T_Attendance where EmpID =? and month(Month_Year)=?";
$sql=" select T_Attendance.*,emp.FirstName from T_Attendance
join T_Employee_Details emp on T_Attendance.EmpID = emp.EmpID
where T_Attendance.EmpID = ? and month(Month_Year)= ? ";
$query = $this->db->query($sql,array($EmpID,$JoinedMonth));
return $query->result();
}
function joindate($EmpID) function joindate($EmpID)
{ {
$sql="select DateofJoining from T_Employee_Details where EmpID =? "; $sql="select DateofJoining from T_Employee_Details where EmpID =? ";
@ -160,7 +185,13 @@ $sql= "select * FROM T_Emp_Pay_Data where EmpID = ?;";
function totalpurchaseorder(){ function totalpurchaseorder(){
$sql="select count(PONO) as totalpurchaseorder from T_PurchaseOrder_Master where Status != 'ST030'"; $sql="select count(PONO) as totalpurchaseorder from T_PurchaseOrder_Master pm where Status != 'ST030'
and case
when (month(pm.PODate) >=4) then
(YEAR(pm.PODate) = YEAR(CURRENT_DATE) and MONTH(pm.PODate) >= 4 ) or ( YEAR(pm.PODate) = YEAR(CURRENT_DATE)+1 and MONTH(pm.PODate) <= 3 )
else
(YEAR(pm.PODate) = YEAR(CURRENT_DATE)-1 and MONTH(pm.PODate) >= 4 ) or ( YEAR(pm.PODate) = YEAR(CURRENT_DATE) and MONTH(pm.PODate) <= 3 )
end";
$query = $this->db->query($sql); $query = $this->db->query($sql);
return $query->result(); return $query->result();
@ -168,7 +199,13 @@ $sql= "select * FROM T_Emp_Pay_Data where EmpID = ?;";
function totalordervalue(){ function totalordervalue(){
$sql="select sum(totalordervalue) as totalordervalue from T_PurchaseOrder_Master where Status != 'ST030'"; $sql="select sum(totalordervalue) as totalordervalue from T_PurchaseOrder_Master pm where Status != 'ST030'
and case
when (month(pm.PODate) >=4) then
(YEAR(pm.PODate) = YEAR(CURRENT_DATE) and MONTH(pm.PODate) >= 4 ) or ( YEAR(pm.PODate) = YEAR(CURRENT_DATE)+1 and MONTH(pm.PODate) <= 3 )
else
(YEAR(pm.PODate) = YEAR(CURRENT_DATE)-1 and MONTH(pm.PODate) >= 4 ) or ( YEAR(pm.PODate) = YEAR(CURRENT_DATE) and MONTH(pm.PODate) <= 3 )
end";
$query = $this->db->query($sql); $query = $this->db->query($sql);
return $query->result(); return $query->result();
@ -176,7 +213,13 @@ $sql= "select * FROM T_Emp_Pay_Data where EmpID = ?;";
function pendingpo(){ function pendingpo(){
$sql="select count(PONO) as pending from T_PurchaseOrder_Master where status='ST020' and Status != 'ST030'"; $sql="select count(PONO) as pending from T_PurchaseOrder_Master pm where status='ST020' and Status != 'ST030'
and case
when (month(pm.PODate) >=4) then
(YEAR(pm.PODate) = YEAR(CURRENT_DATE) and MONTH(pm.PODate) >= 4 ) or ( YEAR(pm.PODate) = YEAR(CURRENT_DATE)+1 and MONTH(pm.PODate) <= 3 )
else
(YEAR(pm.PODate) = YEAR(CURRENT_DATE)-1 and MONTH(pm.PODate) >= 4 ) or ( YEAR(pm.PODate) = YEAR(CURRENT_DATE) and MONTH(pm.PODate) <= 3 )
end";
$query = $this->db->query($sql); $query = $this->db->query($sql);
return $query->result(); return $query->result();
@ -184,7 +227,13 @@ $sql= "select * FROM T_Emp_Pay_Data where EmpID = ?;";
function req_pending(){ function req_pending(){
$sql="SELECT count(Status) as TOTAL_PENDING_REQUESTS FROM T_Requestion_Master where Status = 'ST002';"; $sql="SELECT count(Status) as TOTAL_PENDING_REQUESTS FROM T_Requestion_Master pm where Status = 'ST002'
and case
when (month(pm.ReqDate) >=4) then
(YEAR(pm.ReqDate) = YEAR(CURRENT_DATE) and MONTH(pm.ReqDate) >= 4 ) or ( YEAR(pm.ReqDate) = YEAR(CURRENT_DATE)+1 and MONTH(pm.ReqDate) <= 3 )
else
(YEAR(pm.ReqDate) = YEAR(CURRENT_DATE)-1 and MONTH(pm.ReqDate) >= 4 ) or ( YEAR(pm.ReqDate) = YEAR(CURRENT_DATE) and MONTH(pm.ReqDate) <= 3 )
end";
$query = $this->db->query($sql); $query = $this->db->query($sql);
return $query->result(); return $query->result();
@ -477,12 +526,23 @@ function servicebudgt ()
} }
function servicebal () function servicebal ()
{ {
$sql="SELECT ROUND(sum(BudgetAmount)-(SELECT $sql="SELECT Cost_Center_Budget.CostCenterCode as Cost_Center_Code, CostCenterName as Cost_Center_Name,group_concat(distinct Dept_Details.DepartmentName) as Dept_Name,Cost_Center_Budget.BudgetType as BudgetType,Cost_Center_Budget.BudgetYear as BudgetYear,
ifnull((sum(distinct PO_Line_Item.Quantity * PO_Line_Item.Rate)),0) case Cost_Center_Budget.BudgetType
as Util_Amount when 'SERVICE'
then ifnull((sum(distinct PO_Line_Item.Quantity * PO_Line_Item.Rate)),0)
end as service
from T_CostCenter_Budget Cost_Center_Budget from T_CostCenter_Budget Cost_Center_Budget
join T_PurchaseOrder_LineItem PO_Line_Item on Cost_Center_Budget.CostCenterCode=PO_Line_Item.CostCenterCode left join T_PurchaseOrder_LineItem PO_Line_Item on Cost_Center_Budget.CostCenterCode=PO_Line_Item.CostCenterCode
WHERE Cost_Center_Budget.BudgetType='SERVICE' and YEAR(STR_TO_DATE(`BudgetYear`,'%Y')) = YEAR(NOW())),2) as balservicebudget FROM T_CostCenter_Budget where BudgetType ='SERVICE' and YEAR(STR_TO_DATE(`BudgetYear`,'%Y')) = YEAR(NOW())"; left JOIN T_PurchaseOrder_Master po on po.PONO=PO_Line_Item.PONO and po.Status !='ST030'
left JOIN T_Revenue_Tax T_Rev_Tax on PO_Line_Item.LineItemNo=T_Rev_Tax.LineItemNo
JOIN T_CostCenter_Master Cost_Mast on Cost_Center_Budget.CostCenterCode=Cost_Mast.CostCenterCode
JOIN T_CostCenter_Departments CostCentDept on CostCentDept.CostCenterCode=Cost_Mast.CostCenterCode
JOIN T_DepartmentDetails Dept_Details on Dept_Details.DEPCode= CostCentDept.DEPCode
left JOIN T_Service_Tax st on st.LineItemNo = PO_Line_Item.LineItemNo
WHERE Cost_Center_Budget.BudgetType = po.POType and date(po.PODate) >= '2017-04-01' and date(po.PODate) <= '2018-03-31'
group by
Cost_Center_Budget.BudgetType
";
$query = $this->db->query($sql); $query = $this->db->query($sql);
return $query->result(); return $query->result();
} }
@ -1249,7 +1309,7 @@ left join T_MaterialMaster mm on mm.MaterialCode = pl.MaterialCode
left join T_SupplierDetailsN sd on sd.SupplierID = pm.SupplierID left join T_SupplierDetailsN sd on sd.SupplierID = pm.SupplierID
left join T_Service_Tax st on st.LineItemNo = pl.LineItemNo left join T_Service_Tax st on st.LineItemNo = pl.LineItemNo
left join T_Revenue_Tax rt on rt.LineItemNo = pl.LineItemNo left join T_Revenue_Tax rt on rt.LineItemNo = pl.LineItemNo
where pm.Status != 'ST030' and pm.Status = 'ST056' and pm.PONO in (select PONO from T_IGR_Master) "; where pm.Status != 'ST030' and pm.PONO in (select PONO from T_IGR_Master) ";
if ($cname!= ''){ if ($cname!= ''){
@ -1328,7 +1388,7 @@ left join T_SupplierDetailsN sd on sd.SupplierID = pm.SupplierID
left join T_Service_Tax st on st.LineItemNo = pl.LineItemNo left join T_Service_Tax st on st.LineItemNo = pl.LineItemNo
left join T_Revenue_Tax rt on rt.LineItemNo = pl.LineItemNo left join T_Revenue_Tax rt on rt.LineItemNo = pl.LineItemNo
where where
pm.Status != 'ST030' and pm.Status = 'ST056' and pm.PONO in (select PONO from T_IGR_Master) "; pm.Status != 'ST030' ";
if ($cname!= ''){ if ($cname!= ''){
@ -1384,9 +1444,11 @@ if ($cname!= ''){
} }
$sql.="and pm.PONO in (select PONO from T_IGR_Master) ";
$sql.="group by pono,material_name,category,supplier_name"; $sql.="group by pono,material_name,category,supplier_name";
//ho $sql; // echo $m;
// echo $sid;
//echo $sql;
$query = $this->db->query($sql); $query = $this->db->query($sql);
return $query->result(); return $query->result();
} }
@ -1400,7 +1462,7 @@ left join T_PurchaseOrder_LineItem pl on pl.PONO = pm.PONO
left join T_MaterialMaster mm on mm.MaterialCode = pl.MaterialCode left join T_MaterialMaster mm on mm.MaterialCode = pl.MaterialCode
left join T_SupplierDetailsN sd on sd.SupplierID = pm.SupplierID left join T_SupplierDetailsN sd on sd.SupplierID = pm.SupplierID
left join T_Service_Tax st on st.LineItemNo = pl.LineItemNo left join T_Service_Tax st on st.LineItemNo = pl.LineItemNo
where pm.Status != 'ST030' and pm.Status = 'ST056' and pm.PONO in (select PONO from T_IGR_Master) where pm.Status != 'ST030' and pm.PONO in (select PONO from T_IGR_Master)
group by month(created_date)"; group by month(created_date)";
$query = $this->db->query($sql); $query = $this->db->query($sql);
return $query->result(); return $query->result();
@ -1419,7 +1481,7 @@ left join T_PurchaseOrder_LineItem pl on pl.PONO = pm.PONO
left join T_MaterialMaster mm on mm.MaterialCode = pl.MaterialCode left join T_MaterialMaster mm on mm.MaterialCode = pl.MaterialCode
left join T_SupplierDetailsN sd on sd.SupplierID = pm.SupplierID left join T_SupplierDetailsN sd on sd.SupplierID = pm.SupplierID
left join T_Service_Tax st on st.LineItemNo = pl.LineItemNo left join T_Service_Tax st on st.LineItemNo = pl.LineItemNo
where pm.Status != 'ST030' and pm.Status = 'ST056' and pm.PONO in (select PONO from T_IGR_Master) and sd.SupplierName is not null and pm.PONO in (select PONO from T_IGR_Master) and month(pm.PODate)= ? and year(pm.PODate) = ? where pm.Status != 'ST030' and pm.PONO in (select PONO from T_IGR_Master) and sd.SupplierName is not null and pm.PONO in (select PONO from T_IGR_Master) and month(pm.PODate)= ? and year(pm.PODate) = ?
group by supplier_name,material_name"; group by supplier_name,material_name";
$query = $this->db->query($sql,array($month,$year)); $query = $this->db->query($sql,array($month,$year));
return $query->result(); return $query->result();
@ -1432,7 +1494,7 @@ left join T_PurchaseOrder_LineItem pl on pl.PONO = pm.PONO
left join T_MaterialMaster mm on mm.MaterialCode = pl.MaterialCode left join T_MaterialMaster mm on mm.MaterialCode = pl.MaterialCode
left join T_SupplierDetailsN sd on sd.SupplierID = pm.SupplierID left join T_SupplierDetailsN sd on sd.SupplierID = pm.SupplierID
left join T_Service_Tax st on st.LineItemNo = pl.LineItemNo left join T_Service_Tax st on st.LineItemNo = pl.LineItemNo
where pm.Status != 'ST030' and pm.Status = 'ST056' and pm.PONO in (select PONO from T_IGR_Master) and sd.SupplierName is not null and date(pm.PODate) >= '$a-04-01' and date(pm.PODate) <= '$b-03-31' where pm.Status != 'ST030' and pm.PONO in (select PONO from T_IGR_Master) and sd.SupplierName is not null and date(pm.PODate) >= '$a-04-01' and date(pm.PODate) <= '$b-03-31'
group by supplier_name,material_name"; group by supplier_name,material_name";
$query = $this->db->query($sql,array()); $query = $this->db->query($sql,array());
return $query->result(); return $query->result();
@ -1482,7 +1544,7 @@ left join T_SupplierDetailsN sd on sd.SupplierID = pm.SupplierID
left join T_Service_Tax st on st.LineItemNo = pl.LineItemNo left join T_Service_Tax st on st.LineItemNo = pl.LineItemNo
left join T_Revenue_Tax rt on rt.LineItemNo = pl.LineItemNo left join T_Revenue_Tax rt on rt.LineItemNo = pl.LineItemNo
where where
pm.Status != 'ST030' and pm.Status = 'ST056' and pm.PONO in (select PONO from T_IGR_Master) "; pm.Status != 'ST030' and pm.PONO in (select PONO from T_IGR_Master) ";
if ($cname!= ''){ if ($cname!= ''){
@ -1551,7 +1613,9 @@ FROM T_PurchaseOrder_Master pm
join T_PurchaseOrder_LineItem pl on pl.PONO = pm.PONO join T_PurchaseOrder_LineItem pl on pl.PONO = pm.PONO
join T_MaterialMaster mm on mm.MaterialCode = pl.MaterialCode join T_MaterialMaster mm on mm.MaterialCode = pl.MaterialCode
join T_SupplierDetailsN sd on sd.SupplierID = pm.SupplierID join T_SupplierDetailsN sd on sd.SupplierID = pm.SupplierID
where pm.Status != 'ST030' and pm.Status = 'ST056' and pm.PONO in (select PONO from T_IGR_Master) "; left join T_Service_Tax st on st.LineItemNo = pl.LineItemNo
left join T_Revenue_Tax rt on rt.LineItemNo = pl.LineItemNo
where pm.Status != 'ST030' and pm.PONO in (select PONO from T_IGR_Master) ";
if ($cname!= ''){ if ($cname!= ''){
@ -1573,6 +1637,51 @@ if ($cname!= ''){
return $query->result(); return $query->result();
} }
function i_consolidate_month($m=null,$cname=null,$prod=null,$fa=null,$aa=null){
$sql="select mm.Category as category,sd.SupplierID as sid,sd.SupplierName as supplier_name,mm.MaterialCode as mid,mm.MaterialName as material_name,
sum(pl.Quantity) as quantity,
sum(pl.Quantity * pl.Rate) as total
FROM T_PurchaseOrder_Master pm
join T_PurchaseOrder_LineItem pl on pl.PONO = pm.PONO
join T_MaterialMaster mm on mm.MaterialCode = pl.MaterialCode
join T_SupplierDetailsN sd on sd.SupplierID = pm.SupplierID
left join T_Service_Tax st on st.LineItemNo = pl.LineItemNo
left join T_Revenue_Tax rt on rt.LineItemNo = pl.LineItemNo
where pm.Status != 'ST030' and pm.PONO in (select PONO from T_IGR_Master) and
monthname(pm.PODate) = '".$m."' and sd.SupplierName = '".$cname."' and mm.MaterialName = '".$prod."' ";
if ($fa and $aa != ''){
$sql.=" and (pm.PODate >= '".$fa."-04-01' and pm.PODate <= '".$aa."-03-31')";
}
$sql.= "group by supplier_name,material_name";
$query = $this->db->query($sql);
//echo $sql;
return $query->result();
}
function i_consolidate_year($cname=null,$prod=null,$fa=null,$aa=null){
$sql="select mm.Category as category,sd.SupplierID as sid,sd.SupplierName as supplier_name,mm.MaterialCode as mid,mm.MaterialName as material_name,
sum(pl.Quantity) as quantity,
sum(pl.Quantity * pl.Rate) as total
FROM T_PurchaseOrder_Master pm
join T_PurchaseOrder_LineItem pl on pl.PONO = pm.PONO
join T_MaterialMaster mm on mm.MaterialCode = pl.MaterialCode
join T_SupplierDetailsN sd on sd.SupplierID = pm.SupplierID
left join T_Service_Tax st on st.LineItemNo = pl.LineItemNo
left join T_Revenue_Tax rt on rt.LineItemNo = pl.LineItemNo
where pm.Status != 'ST030' and pm.PONO in (select PONO from T_IGR_Master) and sd.SupplierName = '".$cname."' and mm.MaterialName = '".$prod."' ";
if ($fa and $aa != ''){
$sql.=" and (pm.PODate >= '".$fa."-04-01' and pm.PODate <= '".$aa."-03-31')";
}
$sql.= "group by supplier_name,material_name";
$query = $this->db->query($sql);
//echo $sql;
return $query->result();
}
function ireport_cumulative(){ function ireport_cumulative(){
$sql="SELECT year.sid as sid,year.mid as mid,year.supplier_name as supplier_name,year.material_name as material_name,year.quantity as quantity,year.total as total,month.mquantity as mquantity,month.mtotal as mtotal,today.tquantity as tquantity,today.ttotal as ttotal $sql="SELECT year.sid as sid,year.mid as mid,year.supplier_name as supplier_name,year.material_name as material_name,year.quantity as quantity,year.total as total,month.mquantity as mquantity,month.mtotal as mtotal,today.tquantity as tquantity,today.ttotal as ttotal
@ -1581,7 +1690,7 @@ FROM T_PurchaseOrder_Master pm
left join T_PurchaseOrder_LineItem pl on pl.PONO = pm.PONO left join T_PurchaseOrder_LineItem pl on pl.PONO = pm.PONO
left join T_MaterialMaster mm on mm.MaterialCode = pl.MaterialCode left join T_MaterialMaster mm on mm.MaterialCode = pl.MaterialCode
left join T_SupplierDetailsN sd on sd.SupplierID = pm.SupplierID left join T_SupplierDetailsN sd on sd.SupplierID = pm.SupplierID
where pm.Status != 'ST030' and pm.Status = 'ST056' and pm.PONO in (select PONO from T_IGR_Master) and where pm.Status != 'ST030' and pm.PONO in (select PONO from T_IGR_Master) and
case case
when (month(pm.PODate) >=4) then when (month(pm.PODate) >=4) then
(YEAR(pm.PODate) = YEAR(CURRENT_DATE) and MONTH(pm.PODate) >= 4 ) or ( YEAR(pm.PODate) = YEAR(CURRENT_DATE)+1 and MONTH(pm.PODate) <= 3 ) (YEAR(pm.PODate) = YEAR(CURRENT_DATE) and MONTH(pm.PODate) >= 4 ) or ( YEAR(pm.PODate) = YEAR(CURRENT_DATE)+1 and MONTH(pm.PODate) <= 3 )
@ -1595,7 +1704,7 @@ FROM T_PurchaseOrder_Master pm
left join T_PurchaseOrder_LineItem pl on pl.PONO = pm.PONO left join T_PurchaseOrder_LineItem pl on pl.PONO = pm.PONO
left join T_MaterialMaster mm on mm.MaterialCode = pl.MaterialCode left join T_MaterialMaster mm on mm.MaterialCode = pl.MaterialCode
left join T_SupplierDetailsN sd on sd.SupplierID = pm.SupplierID left join T_SupplierDetailsN sd on sd.SupplierID = pm.SupplierID
where pm.Status != 'ST030' and pm.Status = 'ST056' and pm.PONO in (select PONO from T_IGR_Master) and where pm.Status != 'ST030' and pm.PONO in (select PONO from T_IGR_Master) and
month(pm.PODate) = month(current_date()) month(pm.PODate) = month(current_date())
group by supplier_name,material_name group by supplier_name,material_name
) as month on month.supplier_name=year.supplier_name and month.material_name=year.material_name ) as month on month.supplier_name=year.supplier_name and month.material_name=year.material_name
@ -1605,7 +1714,7 @@ FROM T_PurchaseOrder_Master pm
left join T_PurchaseOrder_LineItem pl on pl.PONO = pm.PONO left join T_PurchaseOrder_LineItem pl on pl.PONO = pm.PONO
left join T_MaterialMaster mm on mm.MaterialCode = pl.MaterialCode left join T_MaterialMaster mm on mm.MaterialCode = pl.MaterialCode
left join T_SupplierDetailsN sd on sd.SupplierID = pm.SupplierID left join T_SupplierDetailsN sd on sd.SupplierID = pm.SupplierID
where pm.Status != 'ST030' and pm.Status = 'ST056' and pm.PONO in (select PONO from T_IGR_Master) and where pm.Status != 'ST030' and pm.PONO in (select PONO from T_IGR_Master) and
date(pm.PODate) = current_date() date(pm.PODate) = current_date()
group by supplier_name,material_name group by supplier_name,material_name
) as today on today.supplier_name=month.supplier_name and today.material_name=month.material_name ) as today on today.supplier_name=month.supplier_name and today.material_name=month.material_name
@ -1621,7 +1730,7 @@ FROM T_PurchaseOrder_Master pm
left join T_PurchaseOrder_LineItem pl on pl.PONO = pm.PONO left join T_PurchaseOrder_LineItem pl on pl.PONO = pm.PONO
left join T_MaterialMaster mm on mm.MaterialCode = pl.MaterialCode left join T_MaterialMaster mm on mm.MaterialCode = pl.MaterialCode
left join T_SupplierDetailsN sd on sd.SupplierID = pm.SupplierID left join T_SupplierDetailsN sd on sd.SupplierID = pm.SupplierID
where pm.Status != 'ST030' and pm.Status = 'ST056' and pm.PONO in (select PONO from T_IGR_Master) and month(pm.PODate) = month(current_date()) and sd.SupplierID = '".$sup."' and mm.MaterialCode = '".$mat."' where pm.Status != 'ST030' and pm.PONO in (select PONO from T_IGR_Master) and month(pm.PODate) = month(current_date()) and sd.SupplierID = '".$sup."' and mm.MaterialCode = '".$mat."'
group by supplier_name,material_name"; group by supplier_name,material_name";
$query = $this->db->query($sql); $query = $this->db->query($sql);
return $query->result(); return $query->result();
@ -1633,7 +1742,7 @@ FROM T_PurchaseOrder_Master pm
left join T_PurchaseOrder_LineItem pl on pl.PONO = pm.PONO left join T_PurchaseOrder_LineItem pl on pl.PONO = pm.PONO
left join T_MaterialMaster mm on mm.MaterialCode = pl.MaterialCode left join T_MaterialMaster mm on mm.MaterialCode = pl.MaterialCode
left join T_SupplierDetailsN sd on sd.SupplierID = pm.SupplierID left join T_SupplierDetailsN sd on sd.SupplierID = pm.SupplierID
where pm.Status != 'ST030' and pm.Status = 'ST056' and pm.PONO in (select PONO from T_IGR_Master) and where pm.Status != 'ST030' and pm.PONO in (select PONO from T_IGR_Master) and
case case
when (month(pm.PODate) >=4) then when (month(pm.PODate) >=4) then
(YEAR(pm.PODate) = YEAR(CURRENT_DATE) and MONTH(pm.PODate) >= 4 ) or ( YEAR(pm.PODate) = YEAR(CURRENT_DATE)+1 and MONTH(pm.PODate) <= 3 ) (YEAR(pm.PODate) = YEAR(CURRENT_DATE) and MONTH(pm.PODate) >= 4 ) or ( YEAR(pm.PODate) = YEAR(CURRENT_DATE)+1 and MONTH(pm.PODate) <= 3 )
@ -1652,7 +1761,7 @@ FROM T_PurchaseOrder_Master pm
left join T_PurchaseOrder_LineItem pl on pl.PONO = pm.PONO left join T_PurchaseOrder_LineItem pl on pl.PONO = pm.PONO
left join T_MaterialMaster mm on mm.MaterialCode = pl.MaterialCode left join T_MaterialMaster mm on mm.MaterialCode = pl.MaterialCode
left join T_SupplierDetailsN sd on sd.SupplierID = pm.SupplierID left join T_SupplierDetailsN sd on sd.SupplierID = pm.SupplierID
where pm.Status != 'ST030' and pm.Status = 'ST056' and pm.PONO in (select PONO from T_IGR_Master) and where pm.Status != 'ST030' and pm.PONO in (select PONO from T_IGR_Master) and
date(pm.PODate) = current_date() and sd.SupplierID = '".$sup."' and mm.MaterialCode = '".$mat."' date(pm.PODate) = current_date() and sd.SupplierID = '".$sup."' and mm.MaterialCode = '".$mat."'
group by supplier_name,material_name"; group by supplier_name,material_name";
$query = $this->db->query($sql); $query = $this->db->query($sql);
@ -1666,7 +1775,7 @@ FROM T_PurchaseOrder_Master pm
left join T_PurchaseOrder_LineItem pl on pl.PONO = pm.PONO left join T_PurchaseOrder_LineItem pl on pl.PONO = pm.PONO
left join T_MaterialMaster mm on mm.MaterialCode = pl.MaterialCode left join T_MaterialMaster mm on mm.MaterialCode = pl.MaterialCode
left join T_SupplierDetailsN sd on sd.SupplierID = pm.SupplierID left join T_SupplierDetailsN sd on sd.SupplierID = pm.SupplierID
where pm.Status != 'ST030' and pm.Status = 'ST056' and pm.PONO in (select PONO from T_IGR_Master) and where pm.Status != 'ST030' and pm.PONO in (select PONO from T_IGR_Master) and
case case
when (month(pm.PODate) >=4) then when (month(pm.PODate) >=4) then
(YEAR(pm.PODate) = YEAR(CURRENT_DATE) and MONTH(pm.PODate) >= 4 ) or ( YEAR(pm.PODate) = YEAR(CURRENT_DATE)+1 and MONTH(pm.PODate) <= 3 ) (YEAR(pm.PODate) = YEAR(CURRENT_DATE) and MONTH(pm.PODate) >= 4 ) or ( YEAR(pm.PODate) = YEAR(CURRENT_DATE)+1 and MONTH(pm.PODate) <= 3 )
@ -1680,7 +1789,7 @@ FROM T_PurchaseOrder_Master pm
left join T_PurchaseOrder_LineItem pl on pl.PONO = pm.PONO left join T_PurchaseOrder_LineItem pl on pl.PONO = pm.PONO
left join T_MaterialMaster mm on mm.MaterialCode = pl.MaterialCode left join T_MaterialMaster mm on mm.MaterialCode = pl.MaterialCode
left join T_SupplierDetailsN sd on sd.SupplierID = pm.SupplierID left join T_SupplierDetailsN sd on sd.SupplierID = pm.SupplierID
where pm.Status != 'ST030' and pm.Status = 'ST056' and pm.PONO in (select PONO from T_IGR_Master) and where pm.Status != 'ST030' and pm.PONO in (select PONO from T_IGR_Master) and
month(pm.PODate) = month(current_date()) month(pm.PODate) = month(current_date())
group by category group by category
) as month on month.category=year.category ) as month on month.category=year.category
@ -1690,7 +1799,7 @@ FROM T_PurchaseOrder_Master pm
left join T_PurchaseOrder_LineItem pl on pl.PONO = pm.PONO left join T_PurchaseOrder_LineItem pl on pl.PONO = pm.PONO
left join T_MaterialMaster mm on mm.MaterialCode = pl.MaterialCode left join T_MaterialMaster mm on mm.MaterialCode = pl.MaterialCode
left join T_SupplierDetailsN sd on sd.SupplierID = pm.SupplierID left join T_SupplierDetailsN sd on sd.SupplierID = pm.SupplierID
where pm.Status != 'ST030' and pm.Status = 'ST056' and pm.PONO in (select PONO from T_IGR_Master) and where pm.Status != 'ST030' and pm.PONO in (select PONO from T_IGR_Master) and
date(pm.PODate) = current_date() date(pm.PODate) = current_date()
group by category group by category
) as today on today.category=month.category ) as today on today.category=month.category
@ -1705,7 +1814,7 @@ FROM T_PurchaseOrder_Master pm
left join T_PurchaseOrder_LineItem pl on pl.PONO = pm.PONO left join T_PurchaseOrder_LineItem pl on pl.PONO = pm.PONO
left join T_MaterialMaster mm on mm.MaterialCode = pl.MaterialCode left join T_MaterialMaster mm on mm.MaterialCode = pl.MaterialCode
left join T_SupplierDetailsN sd on sd.SupplierID = pm.SupplierID left join T_SupplierDetailsN sd on sd.SupplierID = pm.SupplierID
where pm.Status != 'ST030' and pm.Status = 'ST056' and pm.PONO in (select PONO from T_IGR_Master) and where pm.Status != 'ST030' and pm.PONO in (select PONO from T_IGR_Master) and
case case
when (month(pm.PODate) >=4) then when (month(pm.PODate) >=4) then
(YEAR(pm.PODate) = YEAR(CURRENT_DATE) and MONTH(pm.PODate) >= 4 ) or ( YEAR(pm.PODate) = YEAR(CURRENT_DATE)+1 and MONTH(pm.PODate) <= 3 ) (YEAR(pm.PODate) = YEAR(CURRENT_DATE) and MONTH(pm.PODate) >= 4 ) or ( YEAR(pm.PODate) = YEAR(CURRENT_DATE)+1 and MONTH(pm.PODate) <= 3 )
@ -1725,7 +1834,7 @@ FROM T_PurchaseOrder_Master pm
left join T_PurchaseOrder_LineItem pl on pl.PONO = pm.PONO left join T_PurchaseOrder_LineItem pl on pl.PONO = pm.PONO
left join T_MaterialMaster mm on mm.MaterialCode = pl.MaterialCode left join T_MaterialMaster mm on mm.MaterialCode = pl.MaterialCode
left join T_SupplierDetailsN sd on sd.SupplierID = pm.SupplierID left join T_SupplierDetailsN sd on sd.SupplierID = pm.SupplierID
where pm.Status != 'ST030' and pm.Status = 'ST056' and pm.PONO in (select PONO from T_IGR_Master) and where pm.Status != 'ST030' and pm.PONO in (select PONO from T_IGR_Master) and
month(pm.PODate) = month(current_date()) and mm.Category = '".$cat."' month(pm.PODate) = month(current_date()) and mm.Category = '".$cat."'
group by supplier_name,material_name"; group by supplier_name,material_name";
$query = $this->db->query($sql); $query = $this->db->query($sql);
@ -1738,7 +1847,7 @@ FROM T_PurchaseOrder_Master pm
left join T_PurchaseOrder_LineItem pl on pl.PONO = pm.PONO left join T_PurchaseOrder_LineItem pl on pl.PONO = pm.PONO
left join T_MaterialMaster mm on mm.MaterialCode = pl.MaterialCode left join T_MaterialMaster mm on mm.MaterialCode = pl.MaterialCode
left join T_SupplierDetailsN sd on sd.SupplierID = pm.SupplierID left join T_SupplierDetailsN sd on sd.SupplierID = pm.SupplierID
where pm.Status != 'ST030' and pm.Status = 'ST056' and pm.PONO in (select PONO from T_IGR_Master) and where pm.Status != 'ST030' and pm.PONO in (select PONO from T_IGR_Master) and
date(pm.PODate) = current_date() and mm.Category = '".$cat."' date(pm.PODate) = current_date() and mm.Category = '".$cat."'
group by supplier_name,material_name"; group by supplier_name,material_name";
$query = $this->db->query($sql); $query = $this->db->query($sql);
@ -1779,7 +1888,7 @@ FROM T_PurchaseOrder_Master pm
join T_PurchaseOrder_LineItem pl on pl.PONO = pm.PONO join T_PurchaseOrder_LineItem pl on pl.PONO = pm.PONO
join T_MaterialMaster mm on mm.MaterialCode = pl.MaterialCode join T_MaterialMaster mm on mm.MaterialCode = pl.MaterialCode
join T_SupplierDetailsN sd on sd.SupplierID = pm.SupplierID join T_SupplierDetailsN sd on sd.SupplierID = pm.SupplierID
where pm.Status != 'ST030' and pm.Status = 'ST056' and pm.PONO in (select PONO from T_IGR_Master) "; where pm.Status != 'ST030' and pm.PONO in (select PONO from T_IGR_Master) ";
if ($cname!= ''){ if ($cname!= ''){
@ -1810,7 +1919,7 @@ FROM T_PurchaseOrder_Master pm
join T_PurchaseOrder_LineItem pl on pl.PONO = pm.PONO join T_PurchaseOrder_LineItem pl on pl.PONO = pm.PONO
join T_MaterialMaster mm on mm.MaterialCode = pl.MaterialCode join T_MaterialMaster mm on mm.MaterialCode = pl.MaterialCode
join T_SupplierDetailsN sd on sd.SupplierID = pm.SupplierID join T_SupplierDetailsN sd on sd.SupplierID = pm.SupplierID
where pm.Status != 'ST030' and pm.Status = 'ST056' and pm.PONO in (select PONO from T_IGR_Master) and where pm.Status != 'ST030' and pm.PONO in (select PONO from T_IGR_Master) and
monthname(pm.PODate) = '".$m."' and mm.Category = '".$cat."' "; monthname(pm.PODate) = '".$m."' and mm.Category = '".$cat."' ";
if ($fa and $aa != ''){ if ($fa and $aa != ''){
@ -1831,7 +1940,7 @@ FROM T_PurchaseOrder_Master pm
join T_PurchaseOrder_LineItem pl on pl.PONO = pm.PONO join T_PurchaseOrder_LineItem pl on pl.PONO = pm.PONO
join T_MaterialMaster mm on mm.MaterialCode = pl.MaterialCode join T_MaterialMaster mm on mm.MaterialCode = pl.MaterialCode
join T_SupplierDetailsN sd on sd.SupplierID = pm.SupplierID join T_SupplierDetailsN sd on sd.SupplierID = pm.SupplierID
where pm.Status != 'ST030' and pm.Status = 'ST056' and pm.PONO in (select PONO from T_IGR_Master) and where pm.Status != 'ST030' and pm.PONO in (select PONO from T_IGR_Master) and
mm.Category = '".$cat."' "; mm.Category = '".$cat."' ";
if ($fa and $aa != ''){ if ($fa and $aa != ''){
@ -1869,15 +1978,49 @@ if ($fa and $aa != ''){
function monthexpensereport() function monthexpensereport()
{ {
$sql="SELECT date_format(tinc.date,'%d-%m-%Y')as date,tinc.type,sum(tinc.total)as total,tinc.towhom,tinc.description,tinc.account_code,monthname(tinc.date)as month,ac.name FROM t_income_expense as tinc join t_accountcode ac on ac.code=tinc.account_code where tinc.type='PAYMENT' and month(tinc.date)= month(current_date()) group by account_code order by total desc limit 10 "; $sql="SELECT date_format(tinc.date,'%d-%m-%Y')as date,
$query = $this->db->query($sql); ifnull(case
return $query->result(); when tinc.type = 'PAYMENT'
then sum(tinc.total)
end,'0') as expense,
ifnull(case
when tinc.type = 'RECEIPT'
then sum(tinc.total)
end, '0') as income,
ifnull(case
when tinc.type = 'PAYMENT'
then tinc.towhom
end,'-') as paymentname,
ifnull(case
when tinc.type = 'RECEIPT'
then tinc.towhom
end, '-') as receiptname,
tinc.total,tinc.towhom,tinc.description,monthname(tinc.date)as month,tinc.type,tinc.account_code,ac.name FROM t_income_expense tinc join t_accountcode ac on ac.code=tinc.account_code where month(tinc.date)= month(current_date())group by tinc.account_code";
$query = $this->db->query($sql);
return $query->result();
} }
function yearexpensereport() function yearexpensereport()
{ {
$sql="SELECT date_format(date,'%d-%m-%Y')as date,type,sum(total)as total,towhom,description,account_code,monthname(date)as month FROM t_income_expense where type='PAYMENT' and year(date)= year(current_date()) group by month order by total desc limit 10 "; $sql="SELECT date_format(tinc.date,'%d-%m-%Y')as date,
ifnull(case
when tinc.type = 'PAYMENT'
then tinc.total
end,'0') as expense,
ifnull(case
when tinc.type = 'RECEIPT'
then tinc.total
end, '0') as income,
ifnull(case
when tinc.type = 'PAYMENT'
then tinc.towhom
end,'-') as paymentname,
ifnull(case
when tinc.type = 'RECEIPT'
then tinc.towhom
end, '-') as receiptname,
date_format(date,'%d-%m-%Y')as date,tinc.type,sum(tinc.total)as total,tinc.towhom,tinc.description,tinc.account_code,monthname(tinc.date)as month FROM t_income_expense tinc where year(date)= year(current_date()) group by month order by total desc limit 10 ";
$query = $this->db->query($sql); $query = $this->db->query($sql);
return $query->result(); return $query->result();
@ -1907,11 +2050,28 @@ if ($fa and $aa != ''){
return $query->result(); return $query->result();
} }
function departmentwise($sid='',$d='') function departmentwise($sid='',$d='',$c='')
{ {
$sql="SELECT date_format(tinc.date,'%d-%m-%Y')as date,tinc.type,tinc.total,tinc.towhom,.tinc.description, ac.name FROM $sql="SELECT date_format(tinc.date,'%d-%m-%Y')as date,
ifnull(case
when tinc.type = 'PAYMENT'
then tinc.total
end,'0') as expense,
ifnull(case
when tinc.type = 'RECEIPT'
then tinc.total
end, '0') as income,
ifnull(case
when tinc.type = 'PAYMENT'
then tinc.towhom
end,'-') as paymentname,
ifnull(case
when tinc.type = 'RECEIPT'
then tinc.towhom
end, '-') as receiptname,
date_format(tinc.date,'%d-%m-%Y')as date,tinc.type,tinc.total,tinc.towhom,.tinc.description, ac.name FROM
t_income_expense tinc join t_accountcode ac on ac.code=tinc.account_code t_income_expense tinc join t_accountcode ac on ac.code=tinc.account_code
WHERE tinc.type='PAYMENT' and account_code = '$sid' and monthname(date)='$d'"; WHERE account_code = '$sid' and monthname(date)='$d' and tinc.type='$c'";
$query = $this->db->query($sql); $query = $this->db->query($sql);
//print_r($this->db->last_query()); //print_r($this->db->last_query());
//echo $sql; //echo $sql;
@ -1920,9 +2080,26 @@ if ($fa and $aa != ''){
} }
function yearmonthwise($sid='') function yearmonthwise($sid='')
{ {
$sql="SELECT date_format(tinc.date,'%d-%m-%Y')as date,tinc.type,sum(tinc.total)as total,monthname(tinc.date)as month,tinc.description,tinc.towhom,tinc.account_code,ac.name FROM t_income_expense tinc $sql="SELECT date_format(tinc.date,'%d-%m-%Y')as date,
ifnull(case
when tinc.type = 'PAYMENT'
then sum(tinc.total)
end,'0') as expense,
ifnull(case
when tinc.type = 'RECEIPT'
then sum(tinc.total)
end, '0') as income,
ifnull(case
when tinc.type = 'PAYMENT'
then tinc.towhom
end,'-') as paymentname,
ifnull(case
when tinc.type = 'RECEIPT'
then tinc.towhom
end, '-') as receiptname,
date_format(tinc.date,'%d-%m-%Y')as date,tinc.type,tinc.account_code,sum(tinc.total)as total,monthname(tinc.date)as month,tinc.description,tinc.towhom,tinc.account_code,ac.name FROM t_income_expense tinc
join t_accountcode ac on ac.code=tinc.account_code join t_accountcode ac on ac.code=tinc.account_code
WHERE tinc.type='PAYMENT' and monthname(date) = ? group by account_code"; WHERE monthname(date) = ? group by tinc.account_code";
$query = $this->db->query($sql,array($sid)); $query = $this->db->query($sql,array($sid));
//print_r($this->db->last_query()); //print_r($this->db->last_query());
return $query->result(); return $query->result();
@ -1956,12 +2133,33 @@ function INRSymbol()
} }
function today() function today()
{ {
$sql="SELECT date_format(tinc.date,'%d-%m-%Y')as date,tinc.type,tinc.total,tinc.towhom,tinc.description,tinc.account_code,tac.name FROM t_income_expense tinc $sql="SELECT date_format(tinc.date,'%d-%m-%Y')as date,
LEFT JOIN t_accountcode tac ON tac.code = tinc.account_code ifnull(case
WHERE DATE(date) = CURRENT_DATE"; when tinc.type = 'PAYMENT'
$query = $this->db->query($sql); then tinc.total
return $query->result(); end,'0') as expense,
} ifnull(case
when tinc.type = 'RECEIPT'
then tinc.total
end, '0') as income,
ifnull(case
when tinc.type = 'PAYMENT'
then tinc.towhom
end,'-') as paymentname,
ifnull(case
when tinc.type = 'RECEIPT'
then tinc.towhom
end, '-') as receiptname,
tinc.total,tinc.towhom,tinc.description,tinc.type,tinc.account_code,ac.name FROM t_income_expense tinc join t_accountcode ac on ac.code=tinc.account_code WHERE DATE(date) = CURRENT_DATE";
$query = $this->db->query($sql);
return $query->result();
}
// $sql="SELECT date_format(tinc.date,'%d-%m-%Y')as date,tinc.type,tinc.total,tinc.towhom,tinc.description,tinc.account_code,tac.name FROM t_income_expense tinc
// LEFT JOIN t_accountcode tac ON tac.code = tinc.account_code
// WHERE DATE(date) = CURRENT_DATE";
// $query = $this->db->query($sql);
// return $query->result();
//}
//for menu link in monthly payments// //for menu link in monthly payments//
function monthlypayments() function monthlypayments()
{ {
@ -1971,12 +2169,30 @@ function INRSymbol()
return $query->result(); return $query->result();
} }
function departmentmenu() function departmentmenu($fdate,$tdate)
{ {
$sql="SELECT tinc.type,sum(tinc.total)as total,tinc.account_code,ac.name FROM t_income_expense tinc $fdate= date("Y-m-d",strtotime($fdate));
join t_accountcode ac on ac.code=tinc.account_code $tdate=date("Y-m-d",strtotime($tdate));
group by account_code"; $sql="SELECT date_format(tinc.date,'%d-%m-%Y')as date,
ifnull(case
when tinc.type = 'PAYMENT'
then tinc.total
end,'0') as expense,
ifnull(case
when tinc.type = 'RECEIPT'
then tinc.total
end, '0') as income,
ifnull(case
when tinc.type = 'PAYMENT'
then tinc.towhom
end,'-') as paymentname,
ifnull(case
when tinc.type = 'RECEIPT'
then tinc.towhom
end, '-') as receiptname,
tinc.total,tinc.towhom,tinc.description,tinc.type,tinc.account_code,ac.name FROM t_income_expense tinc join t_accountcode ac on ac.code=tinc.account_code where tinc.date >= '".$fdate."' and tinc.date <= '".$tdate."'";
$query = $this->db->query($sql); $query = $this->db->query($sql);
//echo $fdate;
//print_r($this->db->last_query()); //print_r($this->db->last_query());
return $query->result(); return $query->result();

View File

@ -5,7 +5,7 @@ class department_model extends CI_Model
/** /**
* This function is used to get the user listing count * This function is used to get the user listing count
* @return array $result : This is result of the query * @return array $result : result of the query(returns Department details)
*/ */
function departmentListing() function departmentListing()
{ {
@ -21,7 +21,7 @@ class department_model extends CI_Model
/** /**
* To get Department information by id * To get Department information by id
* @param array $department : This will have all the department datas * @param array $department : This will have all the department datas
* @return array $result : result of the query * @return array $result : result of the query (returns as count in numbers)
*/ */
function addNewdepartment($department) function addNewdepartment($department)
{ {
@ -66,8 +66,8 @@ class department_model extends CI_Model
} }
/** /**
* To store edited department details * To store edited department details repective depcode
* @param array $department : This wil have all edited department datas * @param array $department : This will have all edited department datas
* @param number $DEPCode : This is department code * @param number $DEPCode : This is department code
**/ **/
function Updatedepartment($department, $DEPCode) function Updatedepartment($department, $DEPCode)

View File

@ -7,7 +7,7 @@ class employeedetails_model extends CI_Model
/** /**
* To get the employee listing * To get the employee listing
* @return array $result : result of the query * @return array $result : result of the query(returns as employee details)
*/ */
function employeeListing() function employeeListing()
{ {
@ -24,7 +24,7 @@ class employeedetails_model extends CI_Model
/** /**
* To get the role data for employee * To get the role data for employee
* @return array $query->result() : result of the query * @return array $query->result() : result of the query (returns as roles information)
*/ */
function getUserRoles() function getUserRoles()
{ {
@ -38,14 +38,14 @@ class employeedetails_model extends CI_Model
/** /**
* To get the Config value from configuration table * To get the Config value from configuration table
* @return array $query->result() : This is result of the query * @return array $query->result() : result of the query (returns as config information)
*/ */
function getConfigValue($ConfigID ) function getConfigValue($ConfigID )
{ {
$this->db->select('ConfigValue'); $this->db->select('ConfigValue');
$this->db->from('T_ConfigDetails'); $this->db->from('T_ConfigDetails');
$this->db->where('Config_id ',$ConfigID ); $this->db->where('Config_id ',$ConfigID );
$query = $this->db->get(); $query = $this->db->get();
return $query->result(); return $query->result();
@ -68,7 +68,7 @@ class employeedetails_model extends CI_Model
/** /**
* To store employee details * To store employee details
* @param array $Employee : This will have all the employee datas * @param array $Employee : This will have all the employee datas
* @return number $EmpID : This will return how many value are inserted (return as number/count) * @return number $EmpID : This will return how many value are inserted (return as count in number)
*/ */
function addNewemployee($Employee) function addNewemployee($Employee)
{ {
@ -96,7 +96,7 @@ class employeedetails_model extends CI_Model
/** /**
* To get employee details * To get employee details
* @param number $EmpID : This is employee id * @param number $EmpID : This is employee id
* @return array $result : result of the query * @return array $result : result of the query(returns employee information with department name)
*/ */
function viewemployee( $EmpID) function viewemployee( $EmpID)
{ {
@ -114,7 +114,7 @@ class employeedetails_model extends CI_Model
/** /**
* To get the Employee department on respective Employee * To get the Employee department on respective Employee
* @param number $EmployeeID : this is employee Id * @param number $EmployeeID : this is employee Id
* @return array $query->result_array() : result of the query * @return array $query->result_array() : result of the query (return department name)
**/ **/
function GetEmployeeDepartment($EmployeeID) function GetEmployeeDepartment($EmployeeID)
{ {
@ -127,9 +127,9 @@ class employeedetails_model extends CI_Model
/** /**
* To check respective Employee emailid already exists or not * To check respective Employee emailid already exists or not
* @param number $empid : this is employee Id * @param number $empid : Optional :this is employee Id
* @param number $email : this is employee's emailid * @param number $email : Optional :this is employee's emailid
* @return array $query->result_array() : result of the query * @return array $query->result_array() : result of the query (returns employee email id)
**/ **/
function checkMailExists($email='',$Empid='') function checkMailExists($email='',$Empid='')
{ {
@ -148,10 +148,10 @@ class employeedetails_model extends CI_Model
} }
/** /**
* To check respective Employee aadhar no already exists or not * To get respective Employee aadhar no
* @param number $Empid : this is employee Id * @param number $Empid : Optional : this is employee Id
* @param number $AadharNo : this is employee's aadhar no * @param number $AadharNo : this is employee's aadhar no
* @return array $query->result_array() : result of the query * @return array $query->result_array() : result of the query (returns employee aadhar no)
**/ **/
function checkAadharExists($AadharNo,$Empid='') function checkAadharExists($AadharNo,$Empid='')
{ {
@ -170,10 +170,10 @@ class employeedetails_model extends CI_Model
} }
/** /**
* To check respective Employee's panno already exists or not * To get respective Employee's panno
* @param number $Empid : this is employee Id * @param number $Empid : Optional : this is employee Id
* @param number $AadharNo : this is employee's pan no * @param number $PANNo : this is employee's pan no
* @return array $query->result_array() : result of the query * @return array $query->result_array() : result of the query (returns employee pan no)
**/ **/
function checkPANExists($PANNo,$Empid='') function checkPANExists($PANNo,$Empid='')
{ {
@ -192,9 +192,9 @@ class employeedetails_model extends CI_Model
} }
/** /**
* To check respective Employee's profile pic already exists or not * To get respective Employee's profile pic name
* @param number $pic : this is employee profile pic (pic name) * @param number $pic : this is employee profile pic (pic name)
* @return array $query->result_array() : result of the query * @return array $query->result_array() : result of the query (returns profilepic name)
**/ **/
function checkPhotoExists($Pic) function checkPhotoExists($Pic)
{ {
@ -211,7 +211,7 @@ class employeedetails_model extends CI_Model
/** /**
* To get employee's count * To get employee's count
* @return array $query->result_array() : result of the query * @return array $query->result_array() : result of the query (returns employees count)
**/ **/
function getEmployeeCount( ) function getEmployeeCount( )
{ {
@ -225,7 +225,7 @@ class employeedetails_model extends CI_Model
/** /**
* To get bank details * To get bank details
* @return array $result : result of the query * @return array $result : result of the query (returns bank details)
**/ **/
function getBankDetails() function getBankDetails()
{ {

View File

@ -5,7 +5,7 @@ class emppaydate_model extends CI_Model
/** /**
* To get the employee pay listing * To get the employee pay listing
* @return array $result : This is result of the query * @return array $result : result of the query (returns employee payment details)
*/ */
function emppayListing() function emppayListing()
{ {
@ -19,7 +19,7 @@ class emppaydate_model extends CI_Model
/** /**
* To delete the employee pay datas * To delete the employee pay datas
* @return array $query : This is result of the query * @return array $query : result of the query
*/ */
function deleteEmployeePay($EmpID) function deleteEmployeePay($EmpID)
{ {
@ -32,8 +32,8 @@ class emppaydate_model extends CI_Model
/** /**
* To store the employee payments datas * To store the employee payments datas
* @param $emppay * @param $emppay : This will have all the employee pay details
* @return array $paydataid : * @return array $paydataid : result of the query (returns as count in number)
*/ */
function addNewemppay($emppay) function addNewemppay($emppay)
{ {
@ -49,9 +49,9 @@ class emppaydate_model extends CI_Model
/** /**
* To store the employees loan information * To store the employees loan information
* @param string $string : * @param string $string : This have 'add' or 'edit'
* @param array $dataarray : * @param array $dataarray : This will have all employee's loan information
* @return array $loanid : * @return array $loanid : result of the query (returns as counts in number)
*/ */
function addLoanInfo($dataarray,$string) function addLoanInfo($dataarray,$string)
{ {
@ -72,8 +72,8 @@ class emppaydate_model extends CI_Model
/** /**
* To get the employees payment information * To get the employees payment information
* @param string $paydataid: * @param string $paydataid : This is pay data id
* @return array $loanid : * @return array $query->result() : result of the query (returns employee payment details with loan information)
*/ */
function getUserInfo($paydataid) function getUserInfo($paydataid)
{ {
@ -88,7 +88,7 @@ class emppaydate_model extends CI_Model
/** /**
* To store edited emppay information * To store edited emppay information
* @param array $emppaydatas : * @param array $emppaydatas : This will have all edited employee payment details
*/ */
function editemppay($emppaydatas) function editemppay($emppaydatas)
{ {
@ -102,7 +102,7 @@ class emppaydate_model extends CI_Model
/** /**
* To view emppay information * To view emppay information
* @param number $emppaydata : This will have all edited emppay details * @param number $emppaydata : This will have all edited employee payment details
* @param array $paydateid : This is paydate id * @param array $paydateid : This is paydate id
*/ */
function viewemppay($emppaydata, $paydateid) function viewemppay($emppaydata, $paydateid)

View File

@ -5,7 +5,7 @@ class inwardgateregister_model extends CI_Model
/** /**
* To get the IGR details for listing * To get the IGR details for listing
* @return array $result : result of the query * @return array $result : result of the query (returns igr informations)
*/ */
function igrListing() function igrListing()
{ {
@ -23,7 +23,7 @@ class inwardgateregister_model extends CI_Model
/** /**
* To get the po details * To get the po details
* @return array $result : result of the query * @return array $result : result of the query (returns po information)
*/ */
function getpurchaseorder() function getpurchaseorder()
{ {
@ -46,8 +46,8 @@ class inwardgateregister_model extends CI_Model
/** /**
* To get the po details for revalant Po * To get the po details for revalant Po
* @param number $PO : this is po number * @param number $PO : This is po number
* @return array $query->result() : result of the query * @return array $query->result() : result of the query (returns po details)
*/ */
function viewpurchaseorder($PO) function viewpurchaseorder($PO)
{ {
@ -68,9 +68,9 @@ class inwardgateregister_model extends CI_Model
/** /**
* To store the igr master details * To store the igr master details
* @param array $igrM : This will have all igr master details * @param array $igrM : This will have all igr master details
* @var number $insert_id : * @var number $insert_id : This will have insertion count
* @return array $query->result() : result of the query * @return array $query->result() : result of the query (returns igr no based on count value)
*/ */
function addigrM($igrM) function addigrM($igrM)
{ {
@ -92,9 +92,9 @@ class inwardgateregister_model extends CI_Model
/** /**
* To store the igr child details * To store the igr child details
* @param array $igrD : This will have all igr child details * @param array $igrD : This will have all igr child details
* @var number $insert_id : * @var number $insert_id : This will have insertion count
* @return array $query->result() : result of the query * @return array $query->result() : result of the query (returns igr lineitem no based on count value)
*/ */
function addigrD($igrD) function addigrD($igrD)
{ {
@ -115,14 +115,13 @@ class inwardgateregister_model extends CI_Model
/** /**
* To get igr details for revalant IGRNO * To get igr details for revalant IGRNO
* @param number $IGRNO : This is IGRNO * @param number $IGRNO : This is IGRNO
* @return array $result : result of the query * @return array $result : result of the query (returns igr details)
*/ */
function viewigr($IGRNO) function viewigr($IGRNO)
{ {
$this->db->distinct(); $this->db->distinct();
$this->db->select('igr.IGRNO,igr.*,igrd.*,MM.MaterialName,MM.UOM,sup.Address,sup.SupplierName,POM.ServiceDescription,POL.Quantity'); $this->db->select('igr.IGRNO,igr.*,igrd.*,MM.MaterialName,MM.UOM,sup.Address,sup.SupplierName,POM.ServiceDescription,POL.Quantity');
$this->db->select('igr.IGRNO,igr.*,igrd.*,MM.MaterialName,MM.UOM,sup.Address,sup.SupplierName,POM.ServiceDescription,POL.Quantity');
$this->db->from('T_IGR_Master igr'); $this->db->from('T_IGR_Master igr');
$this->db->join('T_IGR_Details igrd','igrd.IGRNO = igr.IGRNO'); $this->db->join('T_IGR_Details igrd','igrd.IGRNO = igr.IGRNO');
$this->db->join('T_PurchaseOrder_Master POM','igr.PONO = POM.PONO'); $this->db->join('T_PurchaseOrder_Master POM','igr.PONO = POM.PONO');
@ -140,9 +139,9 @@ class inwardgateregister_model extends CI_Model
/** /**
* To store edited po lineitem details * To store edited po lineitem details
* @param number $PONO : This is PONO * @param number $PONO : This is PONO
* @param number $MaterialCode : This material code * @param number $MaterialCode : This material code
* @param array $Lineitem : This will have all edited po lineitem details * @param array $Lineitem : This will have all edited po lineitem details
*/ */
function UpdatePOLineItem($LineItem,$PONO,$MaterialCode) function UpdatePOLineItem($LineItem,$PONO,$MaterialCode)
{ {
@ -155,14 +154,15 @@ class inwardgateregister_model extends CI_Model
/** /**
* To store edited po master details * To store edited po master details
* @param number $PONO : This is PONO * @param number $PONO : This is PONO
* @var array $POStatus : for updation operation : this will have igrcreated's const value and updater' id * @var $query : this will have igr created po no
* @var array $POStatus : for updation operation : this will have igrcreated's const value and updater' id
* @param number $updatedBy : This is updater's id * @param number $updatedBy : This is updater's id
* @param array $Lineitem : This will have all edited po lineitem details * @param array $Lineitem : This will have all edited po lineitem details
*/ */
function UpdatePOMaster($PONO,$updatedBy) function UpdatePOMaster($PONO,$updatedBy)
{ {
$this->db->select('*'); $this->db->select('*');
$this->db->from('T_PurchaseOrder_LineItem'); $this->db->from('T_PurchaseOrder_LineItem');
$this->db->where('PONO',$PONO); $this->db->where('PONO',$PONO);
$this->db->where('Status !=',IGR_CREATED); $this->db->where('Status !=',IGR_CREATED);
@ -180,9 +180,9 @@ class inwardgateregister_model extends CI_Model
/** /**
* To get po lineitem details for recieved qty * To get po lineitem details for recieved qty
* @param number $PONO : This is PONO * @param number $PONO : This is PONO
* @param number $MaterialCode : This is material code * @param number $MaterialCode : This is material code
* @return array $result : result of the query * @return array $result : result of the query (returns po received quantity )
*/ */
function getPOLineItemReceivedQty($PONO,$MaterialCode) function getPOLineItemReceivedQty($PONO,$MaterialCode)
{ {

View File

@ -5,7 +5,7 @@ class Login_model extends CI_Model
/** /**
* To check the login credentials of the user * To check the login credentials of the user
* @param string $email : This is email of the user * @param string $email : This is email of the user
* @param string $password : This is encrypted password of the user * @param string $password : This is encrypted password of the user
*/ */
function loginMe($email, $password) function loginMe($email, $password)

View File

@ -5,8 +5,8 @@ class monthlypay_model extends CI_Model
/** /**
* To get monthwise payment list * To get monthwise payment list
* @param date $current : This is current month and year * @param date $current : This is current month and year
* @return array $result : This is result of the query * @return array $result : result of the query (returns monthly payment details)
*/ */
function monthlyListing($current="") function monthlyListing($current="")
{ {
@ -27,9 +27,9 @@ class monthlypay_model extends CI_Model
/** /**
* To get employee payment details * To get employee payment details
* @param date $current : Optional * @param date $current - Optional
* @param array $s : Optional * @param array $s - Optional
* @return array $result : This is result of the query * @return array $result : result of the query (return as active employee details)
*/ */
function getEmpPayDetails($current="",$s="") function getEmpPayDetails($current="",$s="")
{ {
@ -46,8 +46,8 @@ class monthlypay_model extends CI_Model
/** /**
* To get employee payment month wise details * To get employee payment month wise details
* @param date $current : Optional : This is current month and year value * @param date $current - Optional : This is current month and year value
* @return array $result : This is result of the query * @return array $result : result of the query (return employee payment details)
*/ */
function getEmpPayDetailsforMonthInputs($current="") function getEmpPayDetailsforMonthInputs($current="")
{ {
@ -69,8 +69,8 @@ class monthlypay_model extends CI_Model
/** /**
* To get public holiday details for attendances * To get public holiday details for attendances
* @param date $current : Optional : This is current month and year value * @param date $current - Optional : This is current month and year value
* @return array $query->result() : result of the query * @return array $query->result() : result of the query (returns public holiday information)
*/ */
function getPublicHoldays($current="") function getPublicHoldays($current="")
{ {
@ -94,8 +94,8 @@ class monthlypay_model extends CI_Model
/** /**
* To declare date is holiday * To declare date is holiday
* @param date $Date : This is date * @param date $Date : This is date
* @return array $query->result() : result of the query * @return array $query->result() : result of the query (returns public holiday rowcount)
*/ */
function checkHoliday($Date) function checkHoliday($Date)
{ {
@ -108,9 +108,9 @@ class monthlypay_model extends CI_Model
/** /**
* To store holiday date * To store holiday date
* @param array $data : This is date * @param array $data : This is date
* @param string $String : it has 'i' and 'u' ('i' handles insertion and 'u' handles updation) * @param string $String : it has 'i' and 'u' ('i' handles insertion and 'u' handles updation)
* @return array $i : result of the query * @return array $i : result of the query (returns as count in number)
*/ */
function saveHolidays($data,$string) function saveHolidays($data,$string)
{ {
@ -132,8 +132,8 @@ class monthlypay_model extends CI_Model
/** /**
* To delete holiday date * To delete holiday date
* @param date $d : This is date * @param date $d : This is date
* @return $this->db->affected_rows() : result of the query * @return $this->db->affected_rows() : result of the query (return as count in number)
*/ */
function deleteHoliday($d) function deleteHoliday($d)
{ {
@ -145,8 +145,8 @@ class monthlypay_model extends CI_Model
/** /**
* To get details for attendances * To get details for attendances
* @param date $current : Optional : This is date * @param date $current - Optional : This is date
* @return $result : result of the query * @return $result : result of the query(return as monthwise attendances datas)
*/ */
function monthlyAttendance($current="") function monthlyAttendance($current="")
{ {
@ -166,8 +166,8 @@ class monthlypay_model extends CI_Model
/** /**
* To store attendances Information (its handles insertion and updation operation) * To store attendances Information (its handles insertion and updation operation)
* @param array $data : this will have all attendances inforamtion * @param array $data : this will have all attendances inforamtion
* @var number $res : gets count * @var number $res : gets count
* @return array $i : result of the query * @return array $i : result of the query (returns as count in numbers)
*/ */
function saveMonthlyData_model($data) function saveMonthlyData_model($data)
{ {
@ -208,11 +208,12 @@ class monthlypay_model extends CI_Model
} }
/** /**
* To store cashbook Information (its insertion and updation operation) * To store attendances data (its handle both insertion and updation operation)
* @param array $monthattendance : this will have all cashbook details * @param array $monthattendance : this will have attendances information
* @param number $Month_Year : * @param number $Month_Year : this have month and date value
* @param number $EmpID : * @param number $EmpID : this is empid
* @return array $this->db->affected_rows() : result of the query * @var $isExist : exists value count
* @return array $this->db->affected_rows() : result of the query (returns as count in numbers)
*/ */
function saveAttendance($monthattendance,$Month_Year,$EmpID) function saveAttendance($monthattendance,$Month_Year,$EmpID)
{ {
@ -241,8 +242,11 @@ class monthlypay_model extends CI_Model
} }
} }
/**
function addNewmonthlisting($m_list) * To store employees monthly payment datas
* @param array $m_list : this will have all employee monthlypayment details
*/
function addNewmonthlisting($m_list)
{ {
$this->db->trans_start(); $this->db->trans_start();
$this->db->insert('T_Monthly_Pay_Inputs', $asset); $this->db->insert('T_Monthly_Pay_Inputs', $asset);
@ -252,13 +256,19 @@ function addNewmonthlisting($m_list)
$this->db->trans_complete(); $this->db->trans_complete();
return $m_list; return $m_list;
} }
function getUserInfo($EmpID,$month_year)
/**
* To get employee monthly payment details
* @param number $month_year : this have month and date value
* @param number $EmpID : this is empid
* @return array $query->result() : result of the query (returns as count in numbers)
*/
function getUserInfo($EmpID,$month_year)
{ {
$this->db->select('T_Monthly_Pay_Inputs.*,T_Employee_Details.FirstName,T_Employee_Details.LastName'); $this->db->select('T_Monthly_Pay_Inputs.*,T_Employee_Details.FirstName,T_Employee_Details.LastName');
$this->db->from('T_Monthly_Pay_Inputs'); $this->db->from('T_Monthly_Pay_Inputs');
$this->db->join('T_Employee_Details','T_Monthly_Pay_Inputs.EmpID=T_Employee_Details.EmpID'); $this->db->join('T_Employee_Details','T_Monthly_Pay_Inputs.EmpID=T_Employee_Details.EmpID');
$this->db->where('T_Monthly_Pay_Inputs.EmpID', $EmpID); $this->db->where('T_Monthly_Pay_Inputs.EmpID', $EmpID);
$this->db->where('T_Monthly_Pay_Inputs.Month_Year', $month_year); $this->db->where('T_Monthly_Pay_Inputs.Month_Year', $month_year);
$query = $this->db->get(); $query = $this->db->get();
@ -266,22 +276,26 @@ function addNewmonthlisting($m_list)
return $query->result(); return $query->result();
} }
/**
* To store edited employee monthly payment details
* @param number $monthdata : this will have all the edited employee monthly payment details
* @param number $EmpID : this is employee Id
*/
function editmonth($monthdata, $EmpID) function editmonth($monthdata, $EmpID)
{ {
$monthyear=$monthdata['Month_Year']; $monthyear=$monthdata['Month_Year'];
$this->db->where('EmpID' ,$EmpID); $this->db->where('EmpID' ,$EmpID);
$this->db->where('Month_Year',$monthyear); $this->db->where('Month_Year',$monthyear);
$this->db->update('T_Monthly_Pay_Inputs',$monthdata); $this->db->update('T_Monthly_Pay_Inputs',$monthdata);
return TRUE; return TRUE;
} }
/**
* To store edited monthyear data
* @param number $monthdata : this will have edited monthyear data
* @param number $EmpID : this is employee Id
*/
function viewmonth($monthdata, $employeeid) function viewmonth($monthdata, $employeeid)
{ {
$this->db->order_by('Month_Year'); $this->db->order_by('Month_Year');
@ -292,54 +306,69 @@ function addNewmonthlisting($m_list)
} }
/*permission form model */ /* permissionslip models */
function emplist()
{
$sql="select Emp.EmpID,CONCAT(FirstName,' ',LastName)as name ,Emp.Departmentcode, Dep.DepartmentName FROM T_Employee_Details as Emp /**
join T_DepartmentDetails as Dep on Dep.DEPCode=Emp.Departmentcode where Emp.IsActive = 1;"; * To get employee list of permission slip
$query =$this->db->query($sql); * @return array $query->result() : result of the query (returns employee details with department name)
return $query->result(); */
function emplist()
{
$sql="select Emp.EmpID,CONCAT(FirstName,' ',LastName)as name ,Emp.Departmentcode, Dep.DepartmentName FROM T_Employee_Details as Emp
join T_DepartmentDetails as Dep on Dep.DEPCode=Emp.Departmentcode where Emp.IsActive = 1;";
$query =$this->db->query($sql);
return $query->result();
}
/**
* To store permissionslip datas
* @param array $Permissiondata : this will have all permissionslip data
* @return numbers $Permission : result of the query (returns as count in numbers)
*/
function addper($Permissiondata)
{
} $this->db->trans_start();
$this->db->insert('T_Permission', $Permissiondata);
$Permission = $this->db->affected_rows();
$this->db->trans_complete();
return $Permission;
function addper($Permissiondata) }
{
$this->db->trans_start(); /**
$this->db->insert('T_Permission', $Permissiondata); * To get the permission data for list
* @return array $query->result() : result of the query (returns permission slip details)
*/
function perlist()
{
$Permission = $this->db->affected_rows(); $this->db->select('*');
$this->db->from('T_Permission');
$query =$this->db->get();
return $query->result();
$this->db->trans_complete(); }
return $Permission; /**
* To get permitted employee list
* @param number $SNO : this is sno
* @return array $query->result() : result of the query (returns permitted employee details)
*/
} function pdf($SNO)
{
function perlist() $this->db->select('per.*,emp.FirstName,LastName,dep.DepartmentName');
{ $this->db->from('T_Permission per');
$this->db->join('T_Employee_Details emp','emp.EmpID = per.EmpID');
$this->db->select('*'); $this->db->join('T_DepartmentDetails dep','dep.DEPCode = emp.Departmentcode');
$this->db->from('T_Permission'); $this->db->where('per.SNO',$SNO );
$query =$this->db->get(); $query =$this->db->get();
return $query->result(); return $query->result();
}
}
function pdf($SNO)
{
$this->db->select('per.*,emp.FirstName,LastName,dep.DepartmentName');
$this->db->from('T_Permission per');
$this->db->join('T_Employee_Details emp','emp.EmpID = per.EmpID');
$this->db->join('T_DepartmentDetails dep','dep.DEPCode = emp.Departmentcode');
$this->db->where('per.SNO',$SNO );
$query =$this->db->get();
return $query->result();
}
/* Ends permissionslip models */

View File

@ -2,9 +2,11 @@
class mrir_model extends CI_Model class mrir_model extends CI_Model
{ {
/* This function is used to get the user listing count*/
/* This function is used to display the IGR in dropdown box*/ /**
* To display the IGR in dropdown box
* @return array $res->result() : result of the query (returns Igrno)
**/
function getIGRNOonly() function getIGRNOonly()
{ {
$this->db->select('IGRNO'); $this->db->select('IGRNO');
@ -14,12 +16,10 @@ class mrir_model extends CI_Model
return $res->result(); return $res->result();
} }
/**
* This function is used to get the user listing count /**
* @param string $searchText : This is optional search text * To get mrircreated the igr list
* @param number $page : This is pagination offset * @return array $result : result of the query (returns mrircreated igr details)
* @param number $segment : This is pagination limit
* @return array $result : This is result
*/ */
function ViewigrListing() function ViewigrListing()
{ {
@ -36,12 +36,16 @@ class mrir_model extends CI_Model
return $result; return $result;
} }
/* This function is used to get the igr value (button link)*/
/**
* To get the igr value repective igrno (for button link)
* @param number $Igrno : this is igrno
* @return array $result : result of the query (returns igr details )
*/
function get_IGR($IgrNo) function get_IGR($IgrNo)
{ {
$this->db->distinct(); $this->db->distinct();
$this->db->select('IGRM.DeliveryChellanDate,IGRM.CreatedDate,IGRM.IGRNO,IGRM.VehicleNo,IGRM.DeliveryChellanOrInvoiceNo,IGRM.CourierNo,IGRM.PONO,IGRD.MaterialCode,IGRD.QuantityAsPerInvoice,POMR.ServiceDescription,POMR.PODate,POMR.DeliveryDate,POMR.CreatedBy,SUPP.SupplierName,SUPP.Address,MM.UOM,MM.MaterialName,POLT.Quantity,POLT.ReceivedQuantity,ED.FirstName'); $this->db->select('IGRM.DeliveryChellanDate,IGRM.CreatedDate,IGRM.IGRNO,IGRM.VehicleNo,IGRM.DeliveryChellanOrInvoiceNo,IGRM.CourierNo,IGRM.PONO,IGRD.MaterialCode,IGRD.QuantityAsPerInvoice,POMR.ServiceDescription,POMR.PODate,POMR.DeliveryDate,POMR.CreatedBy,SUPP.SupplierName,SUPP.Address,MM.UOM,MM.MaterialName,POLT.Quantity,POLT.ReceivedQuantity,ED.FirstName');
//$this->db->select("DATE_FORMAT(IGRM.DeliveryChellanDate, '%d %m %Y') as DCdate");
$this->db->from('T_IGR_Master IGRM'); $this->db->from('T_IGR_Master IGRM');
$this->db->join('T_PurchaseOrder_Master POMR ','IGRM.PONO=POMR.PONO'); $this->db->join('T_PurchaseOrder_Master POMR ','IGRM.PONO=POMR.PONO');
$this->db->join('T_IGR_Details IGRD','IGRM.IGRNO=IGRD.IGRNO'); $this->db->join('T_IGR_Details IGRD','IGRM.IGRNO=IGRD.IGRNO');
@ -54,56 +58,65 @@ class mrir_model extends CI_Model
$query = $this->db->get(); $query = $this->db->get();
$result = $query->result(); $result = $query->result();
//print_r($this->db->last_query());
return $result; return $result;
} }
function ViewDistributionList()
{
$subQuery = 'Select distinct ReqLine.MaterialCode, MR.PONO, REQ.ReqNo,MM.MaterialName,MM.UOM,
EMP.FirstName,DD.DEPCode,DD.DepartmentName,ReqLine.Quantity as RequestedQty,POL.Quantity
as OrderedQuantity ,(MD.ActualQuantityReceived) as ActualReceivedqty,(MD.QuantityAccepted) as
AcceptedQty,REQ.ReqDate, ReqLine.Status as ReqStatus,
st.StatusCode as ReqStatus,st.StatusName,
ReqLine.Remarks
from T_Requestion_Details ReqLine join T_PurchaseOrder_LineItem POL
on ReqLine.ReqNo = POL.ReqNo and ReqLine.MaterialCode = POL.MaterialCode
join T_Requestion_Master REQ on REQ.ReqNo = ReqLine.ReqNo
join T_PurchaseOrder_Master POMast on POMast.PONO=POL.PONO
join T_Status st on ReqLine.Status = st.StatusCode
join T_MRIR_Master MR on MR.PONO = POL.PONO join T_MRIR_Details MD
on MD.MRIRNO = MR.MRIRNO and ReqLine.MaterialCode = MD.MaterialCode join T_MaterialMaster MM on
MM.MaterialCode = ReqLine.MaterialCode join
T_Employee_Details EMP on EMP.EmpID = REQ.Requestedby join
T_DepartmentDetails DD on DD.DEPCode = EMP.Departmentcode where
POL.status in (?,?)
and ReqLine.Status not in(?) and POMast.status not in(?)
group by ReqLine.MaterialCode ,POL.PONO';
$query = $this->db->query($subQuery,array(MRIR_APPROVED,PARTIAL_MRIRAPPROVED,REQITEM_NEW,PO_AMENDED));
//print_r($this->db->last_query());
return $query->result();
}
/* This function is used to list the MRIR value*/
function view_mrir()
{
$this->db->distinct();
$this->db->select('TMM.MRIRNO,TMM.PONO,TMM.IGRNO,TMM.MRIRStatus,ST.StatusName,IGRM.DeliveryChellanOrInvoiceNo,IGRM.DeliveryChellanDate,IGRM.VehicleNo,IGRM.CourierNo,TMD.StoreInchargeID,TMD.QualityInchargeID,TMD.PlantInchargeID,TMD.UpdateBY,POM.PODate,POM.POType,POM.CreatedBy,ED.FirstName as UpdatedbyName,ED1.FirstName as CreatedByName');
$this->db->from ('T_MRIR_Master TMM');
$this->db->join ('T_MRIR_Details TMD','TMM.MRIRNO=TMD.MRIRNO');
$this->db->join ('T_IGR_Master IGRM','TMM.IGRNO=IGRM.IGRNO');
$this->db->join ('T_IGR_Details IGRD','IGRM.IGRNO=IGRD.IGRNO');
$this->db->join ('T_PurchaseOrder_Master POM','TMM.PONO=POM.PONO');
$this->db->join ('tbl_users user','user.userid=TMD.UpdateBY','left');
$this->db->join ('T_Employee_Details ED','ED.EmpID = user.EmpID','left');
$this->db->join ('tbl_users user1','user1.userid = POM.CreatedBy','left');
$this->db->join ('T_Employee_Details ED1','ED1.EmpID = user1.EmpID','left');
$this->db->join ('T_Status ST','ST.StatusCode = TMM.MRIRStatus');
//$this->db->where('POM.status !=',PO_AMENDED);
$this->db->order_by ('TMM.MRIRNO','desc');
$query = $this->db->get();
return $query->result();
} /**
* To get the mrir aprroved details
* @return array $query->result() : result of the query (returns mrir approved details )
*/
function ViewDistributionList()
{
$subQuery = 'Select distinct ReqLine.MaterialCode, MR.PONO, REQ.ReqNo,MM.MaterialName,MM.UOM,
EMP.FirstName,DD.DEPCode,DD.DepartmentName,ReqLine.Quantity as RequestedQty,POL.Quantity
as OrderedQuantity ,(MD.ActualQuantityReceived) as ActualReceivedqty,(MD.QuantityAccepted) as
AcceptedQty,REQ.ReqDate, ReqLine.Status as ReqStatus,st.StatusCode as ReqStatus,st.StatusName,
ReqLine.Remarks
from T_Requestion_Details ReqLine
join T_PurchaseOrder_LineItem POL on ReqLine.ReqNo = POL.ReqNo and ReqLine.MaterialCode = POL.MaterialCode
join T_Requestion_Master REQ on REQ.ReqNo = ReqLine.ReqNo
join T_PurchaseOrder_Master POMast on POMast.PONO=POL.PONO
join T_Status st on ReqLine.Status = st.StatusCode
join T_MRIR_Master MR on MR.PONO = POL.PONO join T_MRIR_Details MD on MD.MRIRNO = MR.MRIRNO and ReqLine.MaterialCode = MD.MaterialCode
join T_MaterialMaster MM on MM.MaterialCode = ReqLine.MaterialCode
join T_Employee_Details EMP on EMP.EmpID = REQ.Requestedby
join T_DepartmentDetails DD on DD.DEPCode = EMP.Departmentcode
where POL.status in (?,?) and ReqLine.Status not in(?) and POMast.status not in(?)
group by ReqLine.MaterialCode ,POL.PONO';
$query = $this->db->query($subQuery,array(MRIR_APPROVED,PARTIAL_MRIRAPPROVED,REQITEM_NEW,PO_AMENDED));
return $query->result();
}
/**
* To list the MRIR value
* @return $query->result() : result of the query(returns as mrir details)
*/
function view_mrir()
{
$this->db->distinct();
$this->db->select('TMM.MRIRNO,TMM.PONO,TMM.IGRNO,TMM.MRIRStatus,ST.StatusName,IGRM.DeliveryChellanOrInvoiceNo,IGRM.DeliveryChellanDate,IGRM.VehicleNo,IGRM.CourierNo,TMD.StoreInchargeID,TMD.QualityInchargeID,TMD.PlantInchargeID,TMD.UpdateBY,POM.PODate,POM.POType,POM.CreatedBy,ED.FirstName as UpdatedbyName,ED1.FirstName as CreatedByName');
$this->db->from ('T_MRIR_Master TMM');
$this->db->join ('T_MRIR_Details TMD','TMM.MRIRNO=TMD.MRIRNO');
$this->db->join ('T_IGR_Master IGRM','TMM.IGRNO=IGRM.IGRNO');
$this->db->join ('T_IGR_Details IGRD','IGRM.IGRNO=IGRD.IGRNO');
$this->db->join ('T_PurchaseOrder_Master POM','TMM.PONO=POM.PONO');
$this->db->join ('tbl_users user','user.userid=TMD.UpdateBY','left');
$this->db->join ('T_Employee_Details ED','ED.EmpID = user.EmpID','left');
$this->db->join ('tbl_users user1','user1.userid = POM.CreatedBy','left');
$this->db->join ('T_Employee_Details ED1','ED1.EmpID = user1.EmpID','left');
$this->db->join ('T_Status ST','ST.StatusCode = TMM.MRIRStatus');
$this->db->order_by ('TMM.MRIRNO','desc');
$query = $this->db->get();
return $query->result();
}
/**
* To get the status name and code
* @return array $query->result() : result of the query(returns as status code and status name)
*/
function getStatus() function getStatus()
{ {
$this->db->select('StatusCode,StatusName'); $this->db->select('StatusCode,StatusName');
@ -112,40 +125,46 @@ POL.status in (?,?)
$query = $this->db->get(); $query = $this->db->get();
return $query->result(); return $query->result();
} }
/* This function is used to list the MRIR value*/ /**
* To list the MRIR approved datas for billing
* @return array $query->result() : result of the query (returns approved mrir details )
**/
function view_mrir_Billing() function view_mrir_Billing()
{ {
$this->db->distinct(); $this->db->distinct();
$this->db->select('TMM.MRIRNO,TMM.PONO, TMM.IGRNO,IGRM.DeliveryChellanOrInvoiceNo, $this->db->select('TMM.MRIRNO,TMM.PONO, TMM.IGRNO,IGRM.DeliveryChellanOrInvoiceNo,
IGRM.DeliveryChellanDate,IGRM.VehicleNo,IGRM.CourierNo,TMD.QualityInchargeID, IGRM.DeliveryChellanDate,IGRM.VehicleNo,IGRM.CourierNo,TMD.QualityInchargeID,
TMD.PlantInchargeID,TMD.UpdateBY, POM.PODate,POM.POType,POM.ReleasedBy,ED2.FirstName as StoreinchargeName, TMD.PlantInchargeID,TMD.UpdateBY, POM.PODate,POM.POType,POM.ReleasedBy,ED2.FirstName as StoreinchargeName,
ED.FirstName as UpdatedbyName,ED1.FirstName as ReleasedbyName,MM.MaterialCode,MM.MaterialName, ED.FirstName as UpdatedbyName,ED1.FirstName as ReleasedbyName,MM.MaterialCode,MM.MaterialName,
MM.UOM, POL.Quantity,IGRD.QuantityAsPerInvoice, TMD.ActualQuantityReceived,TMD.QuantityAccepted, MM.UOM, POL.Quantity,IGRD.QuantityAsPerInvoice, TMD.ActualQuantityReceived,TMD.QuantityAccepted,
TMD.QuantityRejected,ST.StatusName,TMD.Remarks,AdvanceAmount '); TMD.QuantityRejected,ST.StatusName,TMD.Remarks,AdvanceAmount ');
$this->db->from ('T_MRIR_Master TMM'); $this->db->from ('T_MRIR_Master TMM');
$this->db->join ('T_MRIR_Details TMD','TMM.MRIRNO=TMD.MRIRNO'); $this->db->join ('T_MRIR_Details TMD','TMM.MRIRNO=TMD.MRIRNO');
$this->db->join ('T_IGR_Master IGRM','TMM.IGRNO=IGRM.IGRNO'); $this->db->join ('T_IGR_Master IGRM','TMM.IGRNO=IGRM.IGRNO');
$this->db->join ('T_IGR_Details IGRD','IGRM.IGRNO=IGRD.IGRNO and IGRD.MaterialCode = TMD.MaterialCode'); $this->db->join ('T_IGR_Details IGRD','IGRM.IGRNO=IGRD.IGRNO and IGRD.MaterialCode = TMD.MaterialCode');
$this->db->join ('T_PurchaseOrder_Master POM','POM.PONO=IGRM.PONO'); $this->db->join ('T_PurchaseOrder_Master POM','POM.PONO=IGRM.PONO');
$this->db->join ('T_PurchaseOrder_LineItem POL','POL.PONO=POM.PONO and TMD.MaterialCode = POL.MaterialCode'); $this->db->join ('T_PurchaseOrder_LineItem POL','POL.PONO=POM.PONO and TMD.MaterialCode = POL.MaterialCode');
$this->db->join('T_PurchaseOrder_AdvanceRequest PUADV','POM.PONO=PUADV.PONO','left'); $this->db->join('T_PurchaseOrder_AdvanceRequest PUADV','POM.PONO=PUADV.PONO','left');
$this->db->join ('tbl_users user','user.userid=TMD.UpdateBY'); $this->db->join ('tbl_users user','user.userid=TMD.UpdateBY');
$this->db->join ('T_Employee_Details ED','ED.EmpID = user.EmpID'); $this->db->join ('T_Employee_Details ED','ED.EmpID = user.EmpID');
$this->db->join ('tbl_users user1','user1.userid = POM.ReleasedBy'); $this->db->join ('tbl_users user1','user1.userid = POM.ReleasedBy');
$this->db->join ('T_Employee_Details ED1','ED1.EmpID = user1.EmpID'); $this->db->join ('T_Employee_Details ED1','ED1.EmpID = user1.EmpID');
$this->db->join ('tbl_users user2','user2.userid=TMD.StoreInchargeID'); $this->db->join ('tbl_users user2','user2.userid=TMD.StoreInchargeID');
$this->db->join ('T_Employee_Details ED2','ED2.EmpID = user2.EmpID'); $this->db->join ('T_Employee_Details ED2','ED2.EmpID = user2.EmpID');
$this->db->join ('T_MaterialMaster MM','MM.MaterialCode = IGRD.MaterialCode and POL.MaterialCode = MM.MaterialCode'); $this->db->join ('T_MaterialMaster MM','MM.MaterialCode = IGRD.MaterialCode and POL.MaterialCode = MM.MaterialCode');
$this->db->join ('T_Status ST','ST.StatusCode = TMD.MRIRStatus'); $this->db->join ('T_Status ST','ST.StatusCode = TMD.MRIRStatus');
$this->db->where('TMM.MRIRStatus',MRIR_APPROVED); $this->db->where('TMM.MRIRStatus',MRIR_APPROVED);
$this->db->order_by('TMM.UpdatedOn','desc'); $this->db->order_by('TMM.UpdatedOn','desc');
$query = $this->db->get(); $query = $this->db->get();
//print_r($this->db->last_query());
return $query->result(); return $query->result();
} }
/* This function is used to get the MRIR value for edit*/ /**
* To get the MRIR details respective Mrirno for edit
* @return array $result : result of the query(returnss mrir details )
**/
function edit_mrir($MrirNo) function edit_mrir($MrirNo)
{ {
$this->db->distinct(); $this->db->distinct();
@ -154,10 +173,8 @@ TMD.QuantityRejected,ST.StatusName,TMD.Remarks,AdvanceAmount ');
$this->db->join ('T_MRIR_Details TMD','TMM.MRIRNO = TMD.MRIRNO');//to get IGRNO,PONO,MRIRNO,mrirdate, $this->db->join ('T_MRIR_Details TMD','TMM.MRIRNO = TMD.MRIRNO');//to get IGRNO,PONO,MRIRNO,mrirdate,
$this->db->join ('T_IGR_Master IGRM', 'IGRM.IGRNO = TMM.IGRNO');//to get actualquantity,deliverydate,Invoicedate,vechileno,courierno,igrdate, $this->db->join ('T_IGR_Master IGRM', 'IGRM.IGRNO = TMM.IGRNO');//to get actualquantity,deliverydate,Invoicedate,vechileno,courierno,igrdate,
$this->db->join ('T_PurchaseOrder_Master POMR ','IGRM.PONO = POMR.PONO');//to get podate,deliverydate,servicedescription $this->db->join ('T_PurchaseOrder_Master POMR ','IGRM.PONO = POMR.PONO');//to get podate,deliverydate,servicedescription
// $this->db->join ('T_PurchaseOrder_LineItem POLT','IGRM.PONO=POLT.PONO');//to get receivedquantity,quantity
$this->db->join('T_PurchaseOrder_LineItem Line','TMM.PONO=Line.PONO and TMD.MaterialCode=Line.MaterialCode'); $this->db->join('T_PurchaseOrder_LineItem Line','TMM.PONO=Line.PONO and TMD.MaterialCode=Line.MaterialCode');
$this->db->join('T_CostCenter_Master COST','Line.CostCenterCode=COST.CostCenterCode'); $this->db->join('T_CostCenter_Master COST','Line.CostCenterCode=COST.CostCenterCode');
//$this->db->join ('T_IGR_Details IGRD','IGRD.IGRNO = IGRM.IGRNO');//to get invoicequantity
$this->db->join('T_IGR_Details IGRD','IGRD.IGRNO = TMM.IGRNO and TMD.MaterialCode=IGRD.MaterialCode'); $this->db->join('T_IGR_Details IGRD','IGRD.IGRNO = TMM.IGRNO and TMD.MaterialCode=IGRD.MaterialCode');
$this->db->join ('T_MaterialMaster MM','TMD.MaterialCode = MM.MaterialCode'); $this->db->join ('T_MaterialMaster MM','TMD.MaterialCode = MM.MaterialCode');
$this->db->join ('T_SupplierDetailsN SUPP','POMR.SupplierID = SUPP.SupplierID');//to get suppliername,supplieraddress $this->db->join ('T_SupplierDetailsN SUPP','POMR.SupplierID = SUPP.SupplierID');//to get suppliername,supplieraddress
@ -168,10 +185,10 @@ TMD.QuantityRejected,ST.StatusName,TMD.Remarks,AdvanceAmount ');
$this->db->join ('tbl_users user2','user2.userid=IGRM.CreatedBy');//to get igrraisedby $this->db->join ('tbl_users user2','user2.userid=IGRM.CreatedBy');//to get igrraisedby
$this->db->join ('T_Employee_Details ED2','ED2.EmpID = user2.EmpID'); $this->db->join ('T_Employee_Details ED2','ED2.EmpID = user2.EmpID');
$this->db->where('TMM.MRIRNO',$MrirNo); $this->db->where('TMM.MRIRNO',$MrirNo);
$this->db->group_by('TMM.MRIRNO,TMD.MaterialCode'); $this->db->group_by('TMM.MRIRNO,TMD.MaterialCode');
$query = $this->db->get(); $query = $this->db->get();
$result = $query->result(); $result = $query->result();
//print_r( $this->db->last_query());
return $result; return $result;
} }

View File

@ -787,11 +787,11 @@ function GetPOType($ReqNo)
function GetRevenuePurchaseOrderDetailsForPDF($PONO = '') function GetRevenuePurchaseOrderDetailsForPDF($PONO = '')
{ {
$subQuery ='SELECT distinct LineItem.LineItemNo,LineItem.Per,ReqNo,Mat.MaterialCode,Mat.MaterialName,POMaster.PaymentOtherDescription, $subQuery ='SELECT distinct LineItem.LineItemNo,LineItem.Per,ReqNo,Mat.MaterialCode,Mat.MaterialName,POMaster.PaymentOtherDescription,LineItem.ServiceMaterialDescription,
Mat.UOM,Mat.HSNCODE,Quantity,Rate,ROUND((Quantity *Rate),2 ) as BasicValue , Mat.UOM,Mat.HSNCODE,Quantity,Rate,ROUND((Quantity *Rate),2 ) as BasicValue ,
ROUND(((AfterSGST + AfterCGST + ROUND(((AfterSGST + AfterCGST +
AfterIGST)) ,2)as Taxamount,AdvanceAmount, AfterIGST)) ,2)as Taxamount,AdvanceAmount,
TotalValue,Tax.*,LineItem.CostCenterCode ,POMaster.*,sup.SupplierName,sup.Address,sup.SupplierID,sup.ContactNumber,sup.EmailAddress,sup.PAN,sup.GSTNO,LineItem.AmendedDetails as LineAmend,Payment.PaymentTerms TotalValue,Tax.*,LineItem.CostCenterCode ,POMaster.*,sup.SupplierName,sup.Address,sup.SupplierID,sup.ContactNumber,sup.EmailAddress,sup.PAN,sup.GSTNO,LineItem.AmendedDetails as LineAmend,Payment.PaymentTerms,
FROM T_PurchaseOrder_LineItem LineItem FROM T_PurchaseOrder_LineItem LineItem
join T_MaterialMaster Mat on Mat.MaterialCode = LineItem.MaterialCode join T_MaterialMaster Mat on Mat.MaterialCode = LineItem.MaterialCode
join T_Revenue_Tax Tax on Tax.LineItemNo = LineItem.LineItemNo join T_Revenue_Tax Tax on Tax.LineItemNo = LineItem.LineItemNo
@ -842,7 +842,7 @@ function GetImportPurchaseOrderDetailsForPDF($PONO = '')
// join T_SupplierDetailsN sup on sup.SupplierID = POMaster.SupplierID // join T_SupplierDetailsN sup on sup.SupplierID = POMaster.SupplierID
// where LineItem.PONO =?'; // where LineItem.PONO =?';
$subQuery='SELECT distinct LineItem.LineItemNo,LineItem.ReqNo,Mat.MaterialCode,Mat.MaterialName,Import_DispatchDetails,LineItem.Per, $subQuery='SELECT distinct LineItem.LineItemNo,LineItem.ReqNo,Mat.MaterialCode,Mat.MaterialName,Import_DispatchDetails,LineItem.Per,LineItem.ServiceMaterialDescription,
Mat.UOM,Quantity,ReqMas.Requestedby,Rate,ROUND((RMCIncludingCustomersPerKG*Quantity),2)as Taxamount , Mat.UOM,Quantity,ReqMas.Requestedby,Rate,ROUND((RMCIncludingCustomersPerKG*Quantity),2)as Taxamount ,
ProductPrice,Tax.*,LineItem.CostCenterCode ,Date(ReqMast.ReqDate) as ReqDate,POMaster.*,sup.SupplierName,sup.Address,LineItem.AmendedDetails as LineAmend,AdvanceAmount, Pay.PaymentTerms as Pay,ROUND((Quantity *Rate),2 ) as BasicValue,HSNCODE,sup.EmailAddress,sup.SupplierID,sup.PAN,sup.ContactNumber,sup.GSTNO ProductPrice,Tax.*,LineItem.CostCenterCode ,Date(ReqMast.ReqDate) as ReqDate,POMaster.*,sup.SupplierName,sup.Address,LineItem.AmendedDetails as LineAmend,AdvanceAmount, Pay.PaymentTerms as Pay,ROUND((Quantity *Rate),2 ) as BasicValue,HSNCODE,sup.EmailAddress,sup.SupplierID,sup.PAN,sup.ContactNumber,sup.GSTNO
FROM T_PurchaseOrder_LineItem LineItem FROM T_PurchaseOrder_LineItem LineItem
@ -962,7 +962,7 @@ where LineItem.PONO =?';
function GetImportPurchaseOrderDetails($PONO = '') function GetImportPurchaseOrderDetails($PONO = '')
{ {
$subQuery ='SELECT distinct LineItem.LineItemNo,Req.ReqNo,Mat.MaterialCode,Mat.MaterialName, $subQuery ='SELECT distinct LineItem.LineItemNo,Req.ReqNo,Mat.MaterialCode,Mat.MaterialName,LineItem.ServiceMaterialDescription,
Mat.UOM,Quantity,Rate,Req.Status,ROUND((Quantity *Rate),2 ) as BasicValue,ReceivedQuantity, Mat.UOM,Quantity,Rate,Req.Status,ROUND((Quantity *Rate),2 ) as BasicValue,ReceivedQuantity,
QuantityRejected,ROUND(Quantity-ReceivedQuantity)as PendingQty,Per, QuantityRejected,ROUND(Quantity-ReceivedQuantity)as PendingQty,Per,
ROUND((RMCIncludingCustomersPerKG*Quantity),2)as Taxamount,LandingCharge,HighSeasSalesCharge,CustomDuty,ExciseDuty,ExciseDutyEdCess,CustomEdCess,POMast.ExchangeRate,AfterLandingCharge,AfterHighSeasSalesCharge,AfterCustomDuty,AfterExciseDuty,AfterExciseDutyEdCess,AddlExciseDuty,AfterAddlExciseDuty,Grossdutypayable,AvailableModvat,Grossexpensesduetocustomduty,purchaseratePerKG,CustomDutyExpensesPerKG,RMCIncludingCustomersPerKG,QuantityKG,BasicPriceInMTon,ProductPrice,CustomSHCess,AfterCustomSHCess,AfterExciseDutySHCess,ExciseDutySHCess, ROUND((RMCIncludingCustomersPerKG*Quantity),2)as Taxamount,LandingCharge,HighSeasSalesCharge,CustomDuty,ExciseDuty,ExciseDutyEdCess,CustomEdCess,POMast.ExchangeRate,AfterLandingCharge,AfterHighSeasSalesCharge,AfterCustomDuty,AfterExciseDuty,AfterExciseDutyEdCess,AddlExciseDuty,AfterAddlExciseDuty,Grossdutypayable,AvailableModvat,Grossexpensesduetocustomduty,purchaseratePerKG,CustomDutyExpensesPerKG,RMCIncludingCustomersPerKG,QuantityKG,BasicPriceInMTon,ProductPrice,CustomSHCess,AfterCustomSHCess,AfterExciseDutySHCess,ExciseDutySHCess,

File diff suppressed because one or more lines are too long

View File

@ -144,7 +144,8 @@
</thead> </thead>
<tbody> <tbody>
<?php <?php
if(!empty($spurchse)){
$apr = 0; $apr = 0;
$may = 0; $may = 0;
$jun = 0; $jun = 0;
@ -223,11 +224,8 @@
</tr> </tr>
<?php <?php
}
} ?>
?>
</tbody> </tbody>
<tfoot width="100%"> <tfoot width="100%">
<tr> <tr>
@ -362,6 +360,7 @@
</tr> </tr>
</tfoot> </tfoot>
<?php } ?>
</table> </table>
</div> </div>
@ -391,7 +390,8 @@
</thead> </thead>
<tbody> <tbody>
<?php <?php
if(!empty($spurchse)){
$apr = 0; $apr = 0;
$may = 0; $may = 0;
$jun = 0; $jun = 0;
@ -606,6 +606,7 @@
</tr> </tr>
</tfoot> </tfoot>
<?php } ?>
</table> </table>
</div> </div>

View File

@ -13,7 +13,7 @@
<link rel="stylesheet" href="https://cdn.datatables.net/buttons/1.4.2/css/buttons.dataTables.min.css"> <link rel="stylesheet" href="https://cdn.datatables.net/buttons/1.4.2/css/buttons.dataTables.min.css">
<style> <style>
.dataTables_filter input {padding: 4px;} .dataTables_filter input {padding: 4px;}
.dataTables_filter { .dataTables_filter {
width: 50%; width: 50%;
float: right; float: right;
@ -80,6 +80,7 @@
<?php <?php
foreach($cust as $item): foreach($cust as $item):
{?> {?>
<option value="<?php echo $item->SupplierName;?>"><?php echo $item->SupplierName ; ?></option> <option value="<?php echo $item->SupplierName;?>"><?php echo $item->SupplierName ; ?></option>
@ -161,6 +162,7 @@
<tbody> <tbody>
<?php <?php
if(!empty($spurchse)){
$apr = 0; $apr = 0;
$may = 0; $may = 0;
$jun = 0; $jun = 0;
@ -178,64 +180,50 @@
foreach ($spurchse as $result) { ?> foreach ($spurchse as $result) { ?>
<tr> <tr>
<td style="text-align:left;"> <td style="text-align:left;">
<a href="<?= base_url() ?>report/ilink_purchase?sid=<?php echo $result->sid;?>&ab=<?php echo $ab;?>&mid=<?php echo $result->mid;?>"><?php echo $result->supplier_name;?> </a> <a href="<?= base_url() ?>report/ilink_purchase?cname=<?php echo $result->supplier_name;?>&prod=<?php echo $result->material_name;?>&ab=<?php echo $ab;?>"><?php echo $result->supplier_name;?> </a>
</td> </td>
<td style="text-align:left;"><?php <td style="text-align:left;"><?php
if(!empty($result->material_name)) { echo $result->material_name ; } else {echo "-";} if(!empty($result->material_name)) { echo $result->material_name ; } else {echo "-";}
?></td> ?></td>
<td style="text-align:right;"><?php <td style="text-align:right;"><?php $apr= $apr + round($result->April); ?>
$apr= $apr + round($result->April); <a href="<?= base_url() ?>report/i_consolidate_month?ab=<?php echo $ab;?>&cname=<?php echo $result->supplier_name;?>&prod=<?php echo $result->material_name;?>&m=<?php echo 'April';?>"><?php echo round($result->April);?> </a>
if(!empty($result->April)) { echo round($result->April); } else {echo "-";} </td>
?></td> <td style="text-align:right;"><?php $may= $may + round($result->May); ?>
<td style="text-align:right;"><?php <a href="<?= base_url() ?>report/i_consolidate_month?ab=<?php echo $ab;?>&cname=<?php echo $result->supplier_name;?>&prod=<?php echo $result->material_name;?>&m=<?php echo 'May';?>"><?php echo round($result->May);?> </a>
$may= $may + round($result->May); </td>
if(!empty($result->May)) { echo round($result->May); } else {echo "-";} <td style="text-align:right;"><?php $jun= $jun + round($result->June); ?>
?></td> <a href="<?= base_url() ?>report/i_consolidate_month?ab=<?php echo $ab;?>&cname=<?php echo $result->supplier_name;?>&prod=<?php echo $result->material_name;?>&m=<?php echo 'June';?>"><?php echo round($result->June);?> </a>
<td style="text-align:right;"><?php </td>
$jun= $jun + round($result->June); <td style="text-align:right;"><?php $jul= $jul + round($result->July); ?>
if(!empty($result->June)) { echo round($result->June); } else {echo "-";} <a href="<?= base_url() ?>report/i_consolidate_month?ab=<?php echo $ab;?>&cname=<?php echo $result->supplier_name;?>&prod=<?php echo $result->material_name;?>&m=<?php echo 'July';?>"><?php echo round($result->July);?> </a>
?></td> </td>
<td style="text-align:right;"><?php <td style="text-align:right;"><?php $aug= $aug + round($result->August); ?>
$jul= $jul + round($result->July); <a href="<?= base_url() ?>report/i_consolidate_month?ab=<?php echo $ab;?>&cname=<?php echo $result->supplier_name;?>&prod=<?php echo $result->material_name;?>&m=<?php echo 'August';?>"><?php echo round($result->August);?> </a>
if(!empty($result->July)) { echo round($result->July); } else {echo "-";} </td>
?></td> <td style="text-align:right;"><?php $sep= $sep + round($result->September); ?>
<td style="text-align:right;"><?php <a href="<?= base_url() ?>report/i_consolidate_month?ab=<?php echo $ab;?>&cname=<?php echo $result->supplier_name;?>&prod=<?php echo $result->material_name;?>&m=<?php echo 'September';?>"><?php echo round($result->September);?> </a>
$aug= $aug + round($result->August); </td>
if(!empty($result->August)) { echo round($result->August); } else {echo "-";} <td style="text-align:right;"><?php $oct= $oct + round($result->October); ?>
<a href="<?= base_url() ?>report/i_consolidate_month?ab=<?php echo $ab;?>&cname=<?php echo $result->supplier_name;?>&prod=<?php echo $result->material_name;?>&m=<?php echo 'October';?>"><?php echo round($result->October);?> </a>
?></td> </td>
<td style="text-align:right;"><?php <td style="text-align:right;"><?php $nov= $nov + round($result->November); ?>
$sep= $sep + $result->September; <a href="<?= base_url() ?>report/i_consolidate_month?ab=<?php echo $ab;?>&cname=<?php echo $result->supplier_name;?>&prod=<?php echo $result->material_name;?>&m=<?php echo 'November';?>"><?php echo round($result->November);?> </a>
if(!empty($result->September)) { echo round($result->September); } else {echo "-";} </td>
?></td> <td style="text-align:right;"><?php $dec= $dec + round($result->December); ?>
<td style="text-align:right;"><?php <a href="<?= base_url() ?>report/i_consolidate_month?ab=<?php echo $ab;?>&cname=<?php echo $result->supplier_name;?>&prod=<?php echo $result->material_name;?>&m=<?php echo 'December';?>"><?php echo round($result->December);?> </a>
$oct= $oct + round($result->October); </td>
if(!empty($result->October)) { echo round($result->October); } else {echo "-";} <td style="text-align:right;"><?php $jan= $jan + round($result->January); ?>
?></td> <a href="<?= base_url() ?>report/i_consolidate_month?ab=<?php echo $ab;?>&cname=<?php echo $result->supplier_name;?>&prod=<?php echo $result->material_name;?>&m=<?php echo 'January';?>"><?php echo round($result->January);?> </a>
<td style="text-align:right;"><?php </td>
$nov= $nov + round($result->November); <td style="text-align:right;"><?php $feb= $feb + round($result->February); ?>
if(!empty($result->November)) { echo round($result->November); } else {echo "-";} <a href="<?= base_url() ?>report/i_consolidate_month?ab=<?php echo $ab;?>&cname=<?php echo $result->supplier_name;?>&prod=<?php echo $result->material_name;?>&m=<?php echo 'February';?>"><?php echo round($result->February);?> </a>
?></td> </td>
<td style="text-align:right;"><?php <td style="text-align:right;"><?php $mar= $mar + round($result->March); ?>
$dec= $dec + round($result->December); <a href="<?= base_url() ?>report/i_consolidate_month?ab=<?php echo $ab;?>&cname=<?php echo $result->supplier_name;?>&prod=<?php echo $result->material_name;?>&m=<?php echo 'April';?>"><?php echo round($result->April);?> </a>
if(!empty($result->December)) { echo round($result->December); } else {echo "-";} </td>
?></td> <td style="text-align:right;"><?php $tot= $tot + round($result->qtotal); ?>
<td style="text-align:right;"><?php <a href="<?= base_url() ?>report/i_consolidate_year?ab=<?php echo $ab;?>&cname=<?php echo $result->supplier_name;?>&prod=<?php echo $result->material_name;?>"><?php echo round($result->qtotal);?> </a>
$jan= $jan + round($result->January); </td>
if(!empty($result->January)) { echo round($result->January); } else {echo "-";}
?></td>
<td style="text-align:right;"><?php
$feb= $feb + round($result->February);
if(!empty($result->February)) { echo round($result->February); } else {echo "-";}
?></td>
<td style="text-align:right;"><?php
$mar= $mar + round($result->March);
if(!empty($result->March)) { echo round($result->March); } else {echo "-";}
?></td>
<td style="text-align:right;"><?php
$tot= $tot + round($result->qtotal);
if(!empty($result->qtotal)) { echo round($result->qtotal); } else {echo "-";}
?></td>
</tr> </tr>
<?php <?php
@ -378,13 +366,14 @@
</tr> </tr>
</tfoot> </tfoot>
<?php } ?>
</table> </table>
</div> </div>
<div class="box-body" id="b" style="display:none"> <div class="box-body" id="b" style="display:none">
<table class="table table-bordered table-hover" style="font-size:14px;" id="ta"> <table class="table table-bordered table-hover" style="font-size:13px!important;" id="ta">
<thead> <thead>
<tr> <tr>
<th style="text-align:center;">Supplier Name</th> <th style="text-align:center;">Supplier Name</th>
@ -407,7 +396,8 @@
</thead> </thead>
<tbody> <tbody>
<?php <?php
if(!empty($spurchse)){
$apr = 0; $apr = 0;
$may = 0; $may = 0;
$jun = 0; $jun = 0;
@ -423,65 +413,66 @@
$tot = 0; $tot = 0;
foreach ($spurchse as $result) { ?> foreach ($spurchse as $result) { ?>
<tr> <tr>
<td style="text-align:left;"><?php <td style="text-align:left;">
if(!empty($result->supplier_name)) { echo $result->supplier_name; } else {echo "-";} <a href="<?= base_url() ?>report/ilink_purchase?ab=<?php echo $ab;?>&cname=<?php echo $result->supplier_name;?>&prod=<?php echo $result->material_name;?>"><?php echo $result->supplier_name;?> </a>
?></td> </td>
<td style="text-align:left;"><?php
if(!empty($result->material_name)) { echo $result->material_name ; } else {echo "-";}
?></td>
<td style="text-align:right;"><?php
$apr= $apr + round($result->vApril);
if(!empty($result->vApril)) { echo number_format($result->vApril,2,'.',''); } else {echo "-";}
?></td>
<td style="text-align:right;"><?php
$may= $may + round($result->vMay);
if(!empty($result->vMay)) { echo number_format($result->vMay,2,'.',''); } else {echo "-";}
?></td>
<td style="text-align:right;"><?php
$jun= $jun + round($result->vJune);
if(!empty($result->vJune)) { echo number_format($result->vJune,2,'.',''); } else {echo "-";}
?></td>
<td style="text-align:right;"><?php
$jul= $jul + round($result->vJuly);
if(!empty($result->vJuly)) { echo number_format($result->vJuly,2,'.',''); } else {echo "-";}
?></td>
<td style="text-align:right;"><?php
$aug= $aug + round($result->vAugust);
if(!empty($result->vAugust)) { echo number_format($result->vAugust,2,'.',''); } else {echo "-";}
?></td> <td style="text-align:left;"><?php
<td style="text-align:right;"><?php if(!empty($result->material_name)) { echo $result->material_name ; } else {echo "-";}
$sep= $sep + $result->vSeptember; ?>
if(!empty($result->vSeptember)) { echo number_format($result->vSeptember,2,'.',''); } else {echo "-";} </td>
?></td>
<td style="text-align:right;"><?php <td style="text-align:right;"><?php $apr= $apr + number_format($result->vApril,2,'.',''); ?>
$oct= $oct + round($result->vOctober); <a href="<?= base_url() ?>report/i_consolidate_month?ab=<?php echo $ab;?>&cname=<?php echo $result->supplier_name;?>&prod=<?php echo $result->material_name;?>&m=<?php echo 'April';?>"><?php echo number_format($result->vApril,2,'.','');?> </a>
if(!empty($result->vOctober)) { echo number_format($result->vOctober,2,'.',''); } else {echo "-";} </td>
?></td>
<td style="text-align:right;"><?php <td style="text-align:right;"><?php $may= $may + number_format($result->vMay,2,'.',''); ?>
$nov= $nov + round($result->vNovember); <a href="<?= base_url() ?>report/i_consolidate_month?ab=<?php echo $ab;?>&cname=<?php echo $result->supplier_name;?>&prod=<?php echo $result->material_name;?>&m=<?php echo 'May';?>"><?php echo number_format($result->vMay,2,'.','');?> </a>
if(!empty($result->vNovember)) { echo number_format($result->vNovember,2,'.',''); } else {echo "-";} </td>
?></td>
<td style="text-align:right;"><?php <td style="text-align:right;"><?php $jun= $jun + number_format($result->vJune,2,'.',''); ?>
$dec= $dec + round($result->vDecember); <a href="<?= base_url() ?>report/i_consolidate_month?ab=<?php echo $ab;?>&cname=<?php echo $result->supplier_name;?>&prod=<?php echo $result->material_name;?>&m=<?php echo 'June';?>"><?php echo number_format($result->vJune,2,'.','');?> </a>
if(!empty($result->vDecember)) { echo number_format($result->vDecember,2,'.',''); } else {echo "-";} </td>
?></td>
<td style="text-align:right;"><?php <td style="text-align:right;"><?php $jul= $jul + number_format($result->vJuly,2,'.',''); ?>
$jan= $jan + round($result->vJanuary); <a href="<?= base_url() ?>report/i_consolidate_month?ab=<?php echo $ab;?>&cname=<?php echo $result->supplier_name;?>&prod=<?php echo $result->material_name;?>&m=<?php echo 'July';?>"><?php echo number_format($result->vJuly,2,'.','');?> </a>
if(!empty($result->vJanuary)) { echo number_format($result->vJanuary,2,'.',''); } else {echo "-";} </td>
?></td>
<td style="text-align:right;"><?php <td style="text-align:right;"><?php $aug= $aug + number_format($result->vAugust,2,'.',''); ?>
$feb= $feb + round($result->vFebruary); <a href="<?= base_url() ?>report/i_consolidate_month?ab=<?php echo $ab;?>&cname=<?php echo $result->supplier_name;?>&prod=<?php echo $result->material_name;?>&m=<?php echo 'August';?>"><?php echo number_format($result->vAugust,2,'.','');?> </a>
if(!empty($result->vFebruary)) { echo number_format($result->vFebruary,2,'.',''); } else {echo "-";} </td>
?></td>
<td style="text-align:right;"><?php <td style="text-align:right;"><?php $sep= $sep + number_format($result->vSeptember,2,'.',''); ?>
$mar= $mar + round($result->vMarch); <a href="<?= base_url() ?>report/i_consolidate_month?ab=<?php echo $ab;?>&cname=<?php echo $result->supplier_name;?>&prod=<?php echo $result->material_name;?>&m=<?php echo 'September';?>"><?php echo number_format($result->vSeptember,2,'.','');?> </a>
if(!empty($result->vMarch)) { echo number_format($result->vMarch,2,'.',''); } else {echo "-";} </td>
?></td>
<td style="text-align:right;"><?php <td style="text-align:right;"><?php $oct= $oct + number_format($result->vOctober,2,'.',''); ?>
$tot= $tot + round($result->vtotal); <a href="<?= base_url() ?>report/i_consolidate_month?ab=<?php echo $ab;?>&cname=<?php echo $result->supplier_name;?>&prod=<?php echo $result->material_name;?>&m=<?php echo 'October';?>"><?php echo number_format($result->vOctober,2,'.','');?> </a>
if(!empty($result->vtotal)) { echo number_format($result->vtotal,2,'.',''); } else {echo "-";} </td>
?></td>
<td style="text-align:right;"><?php $nov= $nov + number_format($result->vNovember,2,'.',''); ?>
<a href="<?= base_url() ?>report/i_consolidate_month?ab=<?php echo $ab;?>&cname=<?php echo $result->supplier_name;?>&prod=<?php echo $result->material_name;?>&m=<?php echo 'November';?>"><?php echo number_format($result->vNovember,2,'.','');?> </a>
</td>
<td style="text-align:right;"><?php $dec= $dec + number_format($result->vDecember,2,'.',''); ?>
<a href="<?= base_url() ?>report/i_consolidate_month?ab=<?php echo $ab;?>&cname=<?php echo $result->supplier_name;?>&prod=<?php echo $result->material_name;?>&m=<?php echo 'December';?>"><?php echo number_format($result->vDecember,2,'.','');?> </a>
</td>
<td style="text-align:right;"><?php $jan= $jan + number_format($result->vJanuary,2,'.',''); ?>
<a href="<?= base_url() ?>report/i_consolidate_month?ab=<?php echo $ab;?>&cname=<?php echo $result->supplier_name;?>&prod=<?php echo $result->material_name;?>&m=<?php echo 'January';?>"><?php echo number_format($result->vJanuary,2,'.','');?> </a>
</td>
<td style="text-align:right;"><?php $feb= $feb + number_format($result->vFebruary,2,'.',''); ?>
<a href="<?= base_url() ?>report/i_consolidate_month?ab=<?php echo $ab;?>&cname=<?php echo $result->supplier_name;?>&prod=<?php echo $result->material_name;?>&m=<?php echo 'February';?>"><?php echo number_format($result->vFebruary,2,'.','');?> </a>
</td>
<td style="text-align:right;"><?php $mar= $mar + number_format($result->vMarch,2,'.',''); ?>
<a href="<?= base_url() ?>report/i_consolidate_month?ab=<?php echo $ab;?>&cname=<?php echo $result->supplier_name;?>&prod=<?php echo $result->material_name;?>&m=<?php echo 'March';?>"><?php echo number_format($result->vMarch,2,'.','');?> </a>
</td>
<td style="text-align:right;"><?php $tot= $tot + number_format($result->vtotal,2,'.',''); ?>
<a href="<?= base_url() ?>report/i_consolidate_month?ab=<?php echo $ab;?>&cname=<?php echo $result->supplier_name;?>&prod=<?php echo $result->material_name;?>"><?php echo number_format($result->vtotal,2,'.','');?> </a>
</td>
</tr> </tr>
<?php <?php
@ -624,6 +615,7 @@
</tr> </tr>
</tfoot> </tfoot>
<?php } ?>
</table> </table>
</div> </div>

View File

@ -0,0 +1,199 @@
<?php
if(!empty($mms))
{
}
?>
<link rel="stylesheet" href="https://cdn.datatables.net/1.10.16/css/jquery.dataTables.min.css">
<link rel="stylesheet" href="https://cdn.datatables.net/buttons/1.4.2/css/buttons.dataTables.min.css">
<style>
.dataTables_filter input {padding: 4px;}
.dataTables_filter {
width: 50%;
float: right;
text-align: right;
}
.dataTables_paginate {
width: 50%;
float: right;
text-align: right;
}
div.dt-buttons {
position: relative;
float: right;
}
.btn-success {
background-color: #5d0411;
border-color: #5d0411;
}
</style>
<div class="row" style="min-height: 600px;">
<!-- Left col -->
<div class="col-md-12">
<!-- TABLE: LATEST ORDERS -->
<div class="box box-info">
<div class="box-header with-border">
<center><h3 class="box-title"><p style="color:#5d0411"><b>Report - Consolidate-Inward(<?php
$m = $this->input->get('m');
echo $m;
?>)</b></p></h3></center>
</div>
<!-- /.box-header -->
<div class="box-body">
<div>
<table class="table table-bordered table-hover" id="cc" style="font-size:14px;">
<thead>
<tr>
<th style="text-align:center" rowspan="2">Supplier Name</th>
<th style="text-align:center" rowspan="2">Material Name</th>
<th style="text-align:center" colspan="2"><?php echo date('M-Y'); ?></th>
</tr>
<tr>
<th style="text-align:center">Quantity</th>
<th style="text-align:center">Value &nbsp;(<i class="fa fa-rupee "></i>)</th>
</tr>
</thead>
<tbody>
<?php
if(!empty($spurchse)){
$tqt=0;
$tvt=0;
$ab=$this->input->get('ab');
$month=date('F');
$m = $this->input->get('m');
//echo $month;
foreach($spurchse as $rel)
{
?>
<tr>
<td><span>
<a href="<?= base_url() ?>report/ilink_purchase?ab=<?php echo $ab;?>&cname=<?php echo $rel->supplier_name;?>&prod=<?php echo $rel->material_name;?>&month=<?php echo $m;?>"><?php echo $rel->supplier_name;?> </a>
</span></td>
<td><span><?php echo $rel->material_name;?></span></td>
<td style="text-align:right"><span><?php
$tqt= $tqt + round($rel->quantity);
echo round($rel->quantity);?></span></td>
<td style="text-align:right"><span><?php
$tvt= $tvt + number_format($rel->total,2,'.','');
echo number_format($rel->total,2,'.','');?></span></td>
</tr>
<?php
}
?>
</tbody>
<tfoot width="100%">
<tr>
<td style="text-align:center;"><strong>Total</strong></td>
<td style="text-align:right"><strong>
<?php
{
echo '';
}
?>
</strong>
</td>
<td style="text-align:right">
<strong>
<?php
{
echo $tqt;
}
?>
</strong>
</td>
<td style="text-align:right">
<strong>
<?php
{
echo number_format($tvt,2,'.','');
}
?>
</strong>
</td>
</tr>
</tfoot>
<?php
}
?>
</table>
</div>
</div>
</div>
<!-- /.box -->
</div>
<!-- /.col -->
</div>
<script src="https://cdn.datatables.net/1.10.16/js/jquery.dataTables.min.js"></script>
<script src="https://cdn.datatables.net/buttons/1.4.2/js/dataTables.buttons.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.1.3/jszip.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.32/pdfmake.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.32/vfs_fonts.js"></script>
<script src="https://cdn.datatables.net/buttons/1.4.2/js/buttons.html5.min.js"></script>
<script src="https://cdn.datatables.net/buttons/1.4.2/js/buttons.colVis.min.js"></script>
<script>
// Bootstrap datepicker
// Set up your table
$(document).ready(function() {
table = $('#cc').DataTable( {
"dom": "<'row'<'col-md-6'l><'col-md-6'Bf>>" +
"<'row'<'col-md-6'><'col-md-6'>>" +
"<'row'<'col-md-12't>><'row'<'col-md-4'i><'col-md-8'p>>",
buttons: [
{
extend: 'excelHtml5',
footer: 'true',
messageTop: $('h3').text(),
title: 'REPORT-Consolidate Category-Wise',
exportOptions: {
columns: ':visible'
}
},
'colvis'
]
} );
} );
$('#mySelect').on('change',function(){
table
.column(4)
.search(this.value)
.draw();
});
</script>

View File

@ -158,7 +158,8 @@
</thead> </thead>
<tbody> <tbody>
<?php <?php
if(!empty($spurchse)){
$apr = 0; $apr = 0;
$may = 0; $may = 0;
$jun = 0; $jun = 0;
@ -180,13 +181,13 @@
</td> </td>
<td style="text-align:right;"> <td style="text-align:right;">
<?php <?php
$apr= $apr + round($result->April); $apr= $apr + round($result->April);
?> ?>
<a href="<?= base_url() ?>report/rawi_consolidate_month?ab=<?php echo $ab;?>&cat=<?php echo $result->category;?>&m=<?php echo 'April';?>"><?php echo round($result->April);?> </a> <a href="<?= base_url() ?>report/rawi_consolidate_month?ab=<?php echo $ab;?>&cat=<?php echo $result->category;?>&m=<?php echo 'April';?>"><?php echo round($result->April);?> </a>
</td> </td>
<td style="text-align:right;"> <td style="text-align:right;">
<?php <?php
$may= $may + round($result->May); $may= $may + round($result->May);
?> ?>
<a href="<?= base_url() ?>report/rawi_consolidate_month?ab=<?php echo $ab;?>&cat=<?php echo $result->category;?>&m=<?php echo 'May';?>"><?php echo round($result->May);?> </a> <a href="<?= base_url() ?>report/rawi_consolidate_month?ab=<?php echo $ab;?>&cat=<?php echo $result->category;?>&m=<?php echo 'May';?>"><?php echo round($result->May);?> </a>
</td> </td>
@ -392,13 +393,14 @@
</tr> </tr>
</tfoot> </tfoot>
<?php } ?>
</table> </table>
</div> </div>
<div class="box-body" id="b" style="display:none"> <div class="box-body" id="b" style="display:none">
<table class="table table-bordered table-hover" style="font-size:14px;" id="ta"> <table class="table table-bordered table-hover" style="font-size:13px!important;" id="ta">
<thead> <thead>
<tr> <tr>
<th style="text-align:center;">Category</th> <th style="text-align:center;">Category</th>
@ -420,7 +422,8 @@
</thead> </thead>
<tbody> <tbody>
<?php <?php
if(!empty($spurchse)){
$apr = 0; $apr = 0;
$may = 0; $may = 0;
$jun = 0; $jun = 0;
@ -441,81 +444,81 @@
</td> </td>
<td style="text-align:right;"> <td style="text-align:right;">
<?php <?php
$apr= $apr + round($result->vApril); $apr= $apr + number_format($result->vApril ,2,'.','');
?> ?>
<a href="<?= base_url() ?>report/rawi_consolidate_month?ab=<?php echo $ab;?>&cat=<?php echo $result->category;?>&m=<?php echo 'April';?>"><?php echo round($result->vApril);?> </a> <a href="<?= base_url() ?>report/rawi_consolidate_month?ab=<?php echo $ab;?>&cat=<?php echo $result->category;?>&m=<?php echo 'April';?>"><?php echo number_format($result->vApril ,2,'.','');?> </a>
</td> </td>
<td style="text-align:right;"> <td style="text-align:right;">
<?php <?php
$may= $may + round($result->vMay); $may= $may + number_format($result->vMay ,2,'.','');
?> ?>
<a href="<?= base_url() ?>report/rawi_consolidate_month?ab=<?php echo $ab;?>&cat=<?php echo $result->category;?>&m=<?php echo 'May';?>"><?php echo round($result->vMay);?> </a> <a href="<?= base_url() ?>report/rawi_consolidate_month?ab=<?php echo $ab;?>&cat=<?php echo $result->category;?>&m=<?php echo 'May';?>"><?php echo number_format($result->vMay ,2,'.','');?> </a>
</td> </td>
<td style="text-align:right;"> <td style="text-align:right;">
<?php <?php
$jun= $jun + round($result->vJune); $jun= $jun + number_format($result->vJune ,2,'.','');
?> ?>
<a href="<?= base_url() ?>report/rawi_consolidate_month?ab=<?php echo $ab;?>&cat=<?php echo $result->category;?>&m=<?php echo 'June';?>"><?php echo round($result->vJune);?> </a> <a href="<?= base_url() ?>report/rawi_consolidate_month?ab=<?php echo $ab;?>&cat=<?php echo $result->category;?>&m=<?php echo 'June';?>"><?php echo number_format($result->vJune ,2,'.','');?> </a>
</td> </td>
<td style="text-align:right;"> <td style="text-align:right;">
<?php <?php
$jul= $jul + round($result->vJuly); $jul= $jul + number_format($result->vJuly ,2,'.','');
?> ?>
<a href="<?= base_url() ?>report/rawi_consolidate_month?ab=<?php echo $ab;?>&cat=<?php echo $result->category;?>&m=<?php echo 'July';?>"><?php echo round($result->vJuly);?> </a> <a href="<?= base_url() ?>report/rawi_consolidate_month?ab=<?php echo $ab;?>&cat=<?php echo $result->category;?>&m=<?php echo 'July';?>"><?php echo number_format($result->vJuly ,2,'.','');?> </a>
</td> </td>
<td style="text-align:right;"> <td style="text-align:right;">
<?php <?php
$aug= $aug + round($result->vAugust); $aug= $aug + number_format($result->vAugust ,2,'.','');
?> ?>
<a href="<?= base_url() ?>report/rawi_consolidate_month?ab=<?php echo $ab;?>&cat=<?php echo $result->category;?>&m=<?php echo 'August';?>"><?php echo round($result->vAugust);?> </a> <a href="<?= base_url() ?>report/rawi_consolidate_month?ab=<?php echo $ab;?>&cat=<?php echo $result->category;?>&m=<?php echo 'August';?>"><?php echo number_format($result->vAugust ,2,'.','');?> </a>
</td> </td>
<td style="text-align:right;"> <td style="text-align:right;">
<?php <?php
$sep= $sep + $result->vSeptember; $sep= $sep + number_format($result->vSeptember ,2,'.','');
?> ?>
<a href="<?= base_url() ?>report/rawi_consolidate_month?ab=<?php echo $ab;?>&cat=<?php echo $result->category;?>&m=<?php echo 'September';?>"><?php echo round($result->vSeptember);?> </a> <a href="<?= base_url() ?>report/rawi_consolidate_month?ab=<?php echo $ab;?>&cat=<?php echo $result->category;?>&m=<?php echo 'September';?>"><?php echo number_format($result->vSeptember ,2,'.','');?> </a>
</td> </td>
<td style="text-align:right;"> <td style="text-align:right;">
<?php <?php
$oct= $oct + round($result->vOctober); $oct= $oct + number_format($result->vOctober ,2,'.','');
?> ?>
<a href="<?= base_url() ?>report/rawi_consolidate_month?ab=<?php echo $ab;?>&cat=<?php echo $result->category;?>&m=<?php echo 'October';?>"><?php echo round($result->vOctober);?> </a> <a href="<?= base_url() ?>report/rawi_consolidate_month?ab=<?php echo $ab;?>&cat=<?php echo $result->category;?>&m=<?php echo 'October';?>"><?php echo number_format($result->vOctober ,2,'.','');?> </a>
</td> </td>
<td style="text-align:right;"> <td style="text-align:right;">
<?php <?php
$nov= $nov + round($result->vNovember); $nov= $nov + number_format($result->vNovember ,2,'.','');
?> ?>
<a href="<?= base_url() ?>report/rawi_consolidate_month?ab=<?php echo $ab;?>&cat=<?php echo $result->category;?>&m=<?php echo 'November';?>"><?php echo round($result->vNovember);?> </a> <a href="<?= base_url() ?>report/rawi_consolidate_month?ab=<?php echo $ab;?>&cat=<?php echo $result->category;?>&m=<?php echo 'November';?>"><?php echo number_format($result->vNovember ,2,'.','');?> </a>
</td> </td>
<td style="text-align:right;"> <td style="text-align:right;">
<?php <?php
$dec= $dec + round($result->vDecember); $dec= $dec + number_format($result->vDecember ,2,'.','');
?> ?>
<a href="<?= base_url() ?>report/rawi_consolidate_month?ab=<?php echo $ab;?>&cat=<?php echo $result->category;?>&m=<?php echo 'December';?>"><?php echo round($result->vDecember);?> </a> <a href="<?= base_url() ?>report/rawi_consolidate_month?ab=<?php echo $ab;?>&cat=<?php echo $result->category;?>&m=<?php echo 'December';?>"><?php echo number_format($result->vDecember ,2,'.','');?> </a>
</td> </td>
<td style="text-align:right;"> <td style="text-align:right;">
<?php <?php
$jan= $jan + round($result->vJanuary); $jan= $jan + number_format($result->vJanuary ,2,'.','');
?> ?>
<a href="<?= base_url() ?>report/rawi_consolidate_month?ab=<?php echo $ab;?>&cat=<?php echo $result->category;?>&m=<?php echo 'January';?>"><?php echo round($result->vJanuary);?> </a> <a href="<?= base_url() ?>report/rawi_consolidate_month?ab=<?php echo $ab;?>&cat=<?php echo $result->category;?>&m=<?php echo 'January';?>"><?php echo number_format($result->vJanuary ,2,'.','');?> </a>
</td> </td>
<td style="text-align:right;"> <td style="text-align:right;">
<?php <?php
$feb= $feb + round($result->vFebruary); $feb= $feb + number_format($result->vFebruary ,2,'.','');
?> ?>
<a href="<?= base_url() ?>report/rawi_consolidate_month?ab=<?php echo $ab;?>&cat=<?php echo $result->category;?>&m=<?php echo 'February';?>"><?php echo round($result->vFebruary);?> </a> <a href="<?= base_url() ?>report/rawi_consolidate_month?ab=<?php echo $ab;?>&cat=<?php echo $result->category;?>&m=<?php echo 'February';?>"><?php echo number_format($result->vFebruary ,2,'.','');?> </a>
</td> </td>
<td style="text-align:right;"> <td style="text-align:right;">
<?php <?php
$mar= $mar + round($result->vMarch); $mar= $mar + number_format($result->vMarch ,2,'.','');
?> ?>
<a href="<?= base_url() ?>report/rawi_consolidate_month?ab=<?php echo $ab;?>&cat=<?php echo $result->category;?>&m=<?php echo 'March';?>"><?php echo round($result->vMarch);?> </a> <a href="<?= base_url() ?>report/rawi_consolidate_month?ab=<?php echo $ab;?>&cat=<?php echo $result->category;?>&m=<?php echo 'March';?>"><?php echo number_format($result->vMarch ,2,'.','');?> </a>
</td> </td>
<td style="text-align:right;"> <td style="text-align:right;">
<?php <?php
$tot= $tot + round($result->vtotal); $tot= $tot + number_format($result->vtotal ,2,'.','');
?> ?>
<a href="<?= base_url() ?>report/rawi_consolidate_year?ab=<?php echo $ab;?>&cat=<?php echo $result->category;?>"><?php echo round($result->vtotal);?> </a> <a href="<?= base_url() ?>report/rawi_consolidate_year?ab=<?php echo $ab;?>&cat=<?php echo $result->category;?>"><?php echo number_format($result->vtotal ,2,'.','');?> </a>
</td> </td>
</tr> </tr>
@ -652,6 +655,7 @@
</tr> </tr>
</tfoot> </tfoot>
<?php } ?>
</table> </table>
</div> </div>

View File

@ -0,0 +1,201 @@
<?php
if(!empty($mms))
{
}
?>
<link rel="stylesheet" href="https://cdn.datatables.net/1.10.16/css/jquery.dataTables.min.css">
<link rel="stylesheet" href="https://cdn.datatables.net/buttons/1.4.2/css/buttons.dataTables.min.css">
<style>
.dataTables_filter input {padding: 4px;}
.dataTables_filter {
width: 50%;
float: right;
text-align: right;
}
.dataTables_paginate {
width: 50%;
float: right;
text-align: right;
}
div.dt-buttons {
position: relative;
float: right;
}
.btn-success {
background-color: #5d0411;
border-color: #5d0411;
}
</style>
<div class="row" style="min-height: 600px;">
<!-- Left col -->
<div class="col-md-12">
<!-- TABLE: LATEST ORDERS -->
<div class="box box-info">
<div class="box-header with-border">
<center><h3 class="box-title"><p style="color:#5d0411"><b>Report - Consolidate-Inward<?php
if ($this->input->get('ab')){
$ab = $this->input->get('ab');
echo '('.$ab.')';
}
?></b></p></h3></center>
</div>
<!-- /.box-header -->
<div class="box-body">
<div>
<table class="table table-bordered table-hover" id="cc" style="font-size:14px;">
<thead>
<tr>
<th style="text-align:center" rowspan="2">Supplier Name</th>
<th style="text-align:center" rowspan="2">Material Name</th>
<th style="text-align:center" colspan="2"><?php echo date('M-Y'); ?></th>
</tr>
<tr>
<th style="text-align:center">Quantity</th>
<th style="text-align:center">Value &nbsp;(<i class="fa fa-rupee "></i>)</th>
</tr>
</thead>
<tbody>
<?php
if(!empty($spurchse)){
$tqt=0;
$tvt=0;
$ab=$this->input->get('ab');
$month=date('F');
$m = $this->input->get('m');
//echo $month;
foreach($spurchse as $rel)
{
?>
<tr>
<td><span>
<a href="<?= base_url() ?>report/ilink_purchase?ab=<?php echo $ab;?>&cname=<?php echo $rel->supplier_name;?>&prod=<?php echo $rel->material_name;?>"><?php echo $rel->supplier_name;?> </a>
</span></td>
<td><span><?php echo $rel->material_name;?></span></td>
<td style="text-align:right"><span><?php
$tqt= $tqt + round($rel->quantity);
echo round($rel->quantity);?></span></td>
<td style="text-align:right"><span><?php
$tvt= $tvt + number_format($rel->total,2,'.','');
echo number_format($rel->total,2,'.','');?></span></td>
</tr>
<?php
}
?>
</tbody>
<tfoot width="100%">
<tr>
<td style="text-align:center;"><strong>Total</strong></td>
<td style="text-align:right"><strong>
<?php
{
echo '';
}
?>
</strong>
</td>
<td style="text-align:right">
<strong>
<?php
{
echo $tqt;
}
?>
</strong>
</td>
<td style="text-align:right">
<strong>
<?php
{
echo number_format($tvt,2,'.','');
}
?>
</strong>
</td>
</tr>
</tfoot>
<?php
}
?>
</table>
</div>
</div>
</div>
<!-- /.box -->
</div>
<!-- /.col -->
</div>
<script src="https://cdn.datatables.net/1.10.16/js/jquery.dataTables.min.js"></script>
<script src="https://cdn.datatables.net/buttons/1.4.2/js/dataTables.buttons.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.1.3/jszip.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.32/pdfmake.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.32/vfs_fonts.js"></script>
<script src="https://cdn.datatables.net/buttons/1.4.2/js/buttons.html5.min.js"></script>
<script src="https://cdn.datatables.net/buttons/1.4.2/js/buttons.colVis.min.js"></script>
<script>
// Bootstrap datepicker
// Set up your table
$(document).ready(function() {
table = $('#cc').DataTable( {
"dom": "<'row'<'col-md-6'l><'col-md-6'Bf>>" +
"<'row'<'col-md-6'><'col-md-6'>>" +
"<'row'<'col-md-12't>><'row'<'col-md-4'i><'col-md-8'p>>",
buttons: [
{
extend: 'excelHtml5',
footer: 'true',
messageTop: $('h3').text(),
title: 'REPORT-Consolidate Category-Wise',
exportOptions: {
columns: ':visible'
}
},
'colvis'
]
} );
} );
$('#mySelect').on('change',function(){
table
.column(4)
.search(this.value)
.draw();
});
</script>

View File

@ -79,7 +79,7 @@ if(!empty($mms))
if($this->input->post('from_date') && $this->input->post('to_date')){ if($this->input->post('from_date') && $this->input->post('to_date')){
$frm = $this->input->post('from_date'); $frm = $this->input->post('from_date');
$t = $this->input->post('to_date'); $t = $this->input->post('to_date');
echo $frm.'to'.$t; echo $frm.'-to-'.$t;
} }
?> ?>
@ -163,7 +163,7 @@ if(!empty($mms))
</label> </label>
<div class="input-group"> <div class="input-group">
<select class="form-control" id="month" name="month"> <select class="form-control" id="month" name="month">
<option value="">Select Month</option> <option value="">Select Month</option>
<option value="January">January</option> <option value="January">January</option>
<option value="February">February</option> <option value="February">February</option>
<option value="March">March</option> <option value="March">March</option>
@ -220,7 +220,7 @@ if(!empty($mms))
<div class="box-body"> <div class="box-body">
<div> <div>
<table class="table table-bordered table-hover" width="100%"id="cc" style="font-size:11px !important;"> <table class="table table-bordered table-hover" width="100%"id="cc" style="font-size:10px !important;">
<thead> <thead>
<tr> <tr>
<th style="text-align:center">PO NO</th> <th style="text-align:center">PO NO</th>

View File

@ -98,7 +98,7 @@ if(!empty($mms))
$t = $this->input->post('to_date'); $t = $this->input->post('to_date');
echo $frm.'to'.$t; echo $frm.'-to-'.$t;
} }
?></p></h3></center> ?></p></h3></center>
@ -237,7 +237,7 @@ if(!empty($mms))
<div class="box-body"> <div class="box-body">
<div> <div>
<table class="table table-bordered table-hover" id="cc" style="font-size:11px !important;"> <table class="table table-bordered table-hover" id="cc" style="font-size:10px !important;">
<thead> <thead>
<tr> <tr>
<th style="text-align:center">PO NO</th> <th style="text-align:center">PO NO</th>

View File

@ -23,6 +23,11 @@ if(!empty($Total))
float: right; float: right;
} }
.btn-success {
background-color:#5d0411;
border-color: #5d0411;
}
</style> </style>

View File

@ -1,46 +1,45 @@
<?php <?php
$dt = new DateTime('now', new DateTimeZone('Asia/Kolkata')); $dt = new DateTime('now', new DateTimeZone('Asia/Kolkata'));
$CurrentDate = $dt->format('d-m-Y'); $CurrentDate = $dt->format('d-m-Y');
// print_r($cost);die();
?> ?>
<script> <script>
$(function() { $(function() {
//Initialize Select2 Elements //Initialize Select2 Elements
$("#CostCenter").select2(); $("#CostCenter").select2();
$("#MaterialCode").select2(); $("#MaterialCode").select2();
$("#Date").datepicker({ $("#Date").datepicker({
// minDate : 'now', // minDate : 'now',
maxDate : 'now', maxDate : 'now',
dateFormat: 'dd-mm-yy',changeMonth: true, changeYear: true,yearRange: '-100:+0' dateFormat: 'dd-mm-yy',changeMonth: true, changeYear: true,yearRange: '-100:+0'
}); });
}); });
</script> </script>
<style type="text/css"> <style type="text/css">
.num{ .num{
text-align:left; text-align:left;
} }
.select2 .select2
{ {
width: 100% ! important; width: 100% ! important;
} }
</style> </style>
<div class="content-wrapper"> <div class="content-wrapper">
<!-- Content Header (Page header) --> <!-- Content Header (Page header) -->
<section class="content-header"> <section class="content-header">
<h1> <h1>
<center>Resico Industries - Raise Store Requisition </center> <center>Resico Industries - Raise Store Requisition </center>
</h1> </h1>
</section> </section>
<section class="content"> <section class="content">
@ -48,14 +47,11 @@ $(function() {
<div class="row" style="border:2px dotted; padding:5%"> <div class="row" style="border:2px dotted; padding:5%">
<?php <?php
$attributes = array('class' => 'form-label-left requistion ','name' => 'requistion','id' => 'requistion'); $attributes = array('class' => 'form-label-left requistion ','name' => 'requistion','id' => 'requistion');
echo form_open($this->config->base_url().'storerequisitionlist echo form_open($this->config->base_url().'storerequisitionlist
/ addstores',$attributes); ?> / addstores',$attributes); ?>
<!-- <form method="post" role="form" > --> <!-- <form method="post" role="form" > -->
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="col-md-12">
<div class="col-md-3"> <div class="col-md-3">
<label>Requested By</label> <label>Requested By</label>
<?php <?php
@ -71,39 +67,32 @@ $(function() {
?> ?>
</div> </div>
<div class="col-md-3"> <div class="col-md-3">
<label>Requested Date</label> <label>Requested Date</label>
<?php <?php
$data = array('name' => 'Date','value' => set_value('Date',$CurrentDate), 'id' =>"Date", 'class' => 'form-control num' ,'required' => 'true'); $data = array('name' => 'Date','value' => set_value('Date',$CurrentDate), 'id' =>"Date", 'class' => 'form-control num' ,'required' => 'true');
echo form_input($data); echo form_input($data);
?> ?>
</div> </div>
<div class="col-md-3"> <div class="col-md-3">
<label>Cost Center</label> <label>Cost Center</label>
<?php <?php
$Costs = array("-1"=>'Select Cost Center Name'); $Costs = array("-1"=>'Select Cost Center Name');
//print_r( $options); //print_r( $options);
if(!empty($cost)) if(!empty($cost))
{ {
foreach ($cost as $SID): foreach ($cost as $SID):
// echo $SID->ConfigValue; // echo $SID->ConfigValue;
$Costs[$SID->CostCenterCode] = $SID->CostCenterCode .'-'. $SID->CostCenterName ; $Costs[$SID->CostCenterCode] = $SID->CostCenterCode .'-'. $SID->CostCenterName ;
endforeach; endforeach;
} }
echo form_dropdown('CostCenter', $Costs,set_value('CostCenter'),'id="CostCenter"' ,'class="form-control select2"' ); echo form_dropdown('CostCenter', $Costs,set_value('CostCenter'),'id="CostCenter"' ,'class="form-control select2"' );
?> ?>
</div> </div>
<!-- <div class="col-md-2"> <!-- <div class="col-md-2">
<label>Available Budget Amount</label> <label>Available Budget Amount</label>
<?php <?php
@ -111,6 +100,7 @@ $(function() {
echo form_input($data); echo form_input($data);
?> ?>
</div> --> </div> -->
</div> </div>
</div> </div>
<br> <br>
@ -124,7 +114,6 @@ $(function() {
<!-- Add line Item --> <!-- Add line Item -->
<div class="modal fade" id="mypo" role="dialog"> <div class="modal fade" id="mypo" role="dialog">
<div class="modal-dialog"> <div class="modal-dialog">
<!-- Modal content--> <!-- Modal content-->
<div class="modal-content"> <div class="modal-content">
<div class="modal-header" style="background-color: #5d0411;color:#fff;"> <div class="modal-header" style="background-color: #5d0411;color:#fff;">
@ -133,30 +122,26 @@ $(function() {
</div> </div>
<div align="left"> <div align="left">
<div class="col-md-6"> <div class="col-md-6">
<label>Material Code</label> <label>Material Code</label>
<div > <div >
<?php <?php
$options = array("-1"=>'Select Material Code'); $options = array("-1"=>'Select Material Code');
//print_r( $options); //print_r( $options);
if(!empty($MaterialList)) if(!empty($MaterialList))
{ {
foreach ($MaterialList as $MID): foreach ($MaterialList as $MID):
$options[$MID->MaterialCode] = $MID->MaterialCode.' '.' - '.' '.$MID->MaterialName; $options[$MID->MaterialCode] = $MID->MaterialCode.' '.' - '.' '.$MID->MaterialName;
endforeach; endforeach;
} }
echo form_dropdown('MaterialCode', $options,set_value('MaterialCode'),'id="MaterialCode"' ,'class="form-control"'); echo form_dropdown('MaterialCode', $options,set_value('MaterialCode'),'id="MaterialCode"' ,'class="form-control"');
?> ?>
</div> </div>
</div> </div>
<div class="col-md-6"> <div class="col-md-6">
<label>Description</label> <label>Description</label>
<div class="form-group"> <div class="form-group">
@ -166,6 +151,7 @@ $(function() {
?> ?>
</div> </div>
</div> </div>
<div class="col-md-6"> <div class="col-md-6">
<label>UOM</label> <label>UOM</label>
<div> <div>
@ -173,9 +159,9 @@ $(function() {
$data = array('name' => 'UOM','value' => set_value('UOM'),'id'=>'UOM', 'class' => 'form-control','readonly' => 'true' ); $data = array('name' => 'UOM','value' => set_value('UOM'),'id'=>'UOM', 'class' => 'form-control','readonly' => 'true' );
echo form_input($data); echo form_input($data);
?> ?>
</div>
</div>
</div> </div>
<div class="col-md-6"> <div class="col-md-6">
<label>Quantity</label> <label>Quantity</label>
<div class="form-group"> <div class="form-group">
@ -186,6 +172,7 @@ $(function() {
</div> </div>
</div> </div>
<div class="col-md-12"> <div class="col-md-12">
<label>Remarks</label> <label>Remarks</label>
<div class="form-group"> <div class="form-group">
@ -196,22 +183,21 @@ $(function() {
</div> </div>
</div> </div>
</div>
</div>
<div class="modal-footer"> <div class="modal-footer">
<a class="btn btn-primary font addClick" ID="addClick" > &nbsp;&nbsp;<span class="bold">Add</span></a> <a class="btn btn-primary font addClick" ID="addClick" > &nbsp;&nbsp;<span class="bold">Add</span></a>
<a class="btn btn-primary" data-dismiss="modal" value="Cancel">Cancel</a> <a class="btn btn-primary" data-dismiss="modal" value="Cancel">Cancel</a>
</div> </div>
</div> </div>
</div>
</div>
</div>
</div>
<!-- Edit Line Item --> <!-- Edit Line Item -->
<div class="modal fade" id="EditItem" role="dialog"> <div class="modal fade" id="EditItem" role="dialog">
<div class="modal-dialog"> <div class="modal-dialog">
<!-- Modal content--> <!-- Modal content-->
<div class="modal-content"> <div class="modal-content">
<div class="modal-header" style="background-color: #5d0411;color:#fff;"> <div class="modal-header" style="background-color: #5d0411;color:#fff;">
@ -219,7 +205,6 @@ $(function() {
<center><h4>Edit Line Item </h4></center> <center><h4>Edit Line Item </h4></center>
</div> </div>
<div align="left"> <div align="left">
<div class="col-md-6"> <div class="col-md-6">
<label>Material Code</label> <label>Material Code</label>
<div > <div >
@ -232,6 +217,7 @@ $(function() {
</div> </div>
</div> </div>
<div class="col-md-6"> <div class="col-md-6">
<label>Description</label> <label>Description</label>
<div class="form-group"> <div class="form-group">
@ -249,8 +235,9 @@ $(function() {
echo form_input($data); echo form_input($data);
?> ?>
</div>
</div> </div>
</div>
<div class="col-md-6"> <div class="col-md-6">
<label>Quantity</label> <label>Quantity</label>
<div class="form-group"> <div class="form-group">
@ -279,8 +266,11 @@ $(function() {
</div> </div>
</div> </div>
</div> </div>
</div>
</div>
</div> </div>
</div> </div>
@ -304,9 +294,7 @@ $(function() {
</table> </table>
</div> </div>
<br>
<br>
<div class="col-md-3 col-md-offset-9" align = "right"> <div class="col-md-3 col-md-offset-9" align = "right">
<input type="hidden" name="txtRowCount" id="txtRowCount" /> <input type="hidden" name="txtRowCount" id="txtRowCount" />
<input type="hidden" name="txtDeletedRow" id="txtDeletedRow" /> <input type="hidden" name="txtDeletedRow" id="txtDeletedRow" />
@ -323,7 +311,8 @@ $(function() {
<input type="reset" class="btn btn-primary" value="Reset" /> <input type="reset" class="btn btn-primary" value="Reset" />
</div> </div>
</form>
</form>
</div> </div>
</section> </section>
</div> </div>
@ -350,11 +339,6 @@ $(function() {
</tr> </tr>
</script> </script>
<!--copy script--> <!--copy script-->
<script> <script>
var isExceed = 0; var isExceed = 0;
@ -374,7 +358,7 @@ $(function() {
$( ".datePicker" ).datepicker({ dateFormat: 'dd/mm/yy' }); $( ".datePicker" ).datepicker({ dateFormat: 'dd/mm/yy' });
//Initialize Select2 Elements //Initialize Select2 Elements
}); });
</script> </script>
<script> <script>
@ -384,6 +368,8 @@ var id = $('#CostCenter').val();
$("#BudgetAmount").val(''); $("#BudgetAmount").val('');
var y = <?php echo json_encode($cost, JSON_PRETTY_PRINT) ?>; var y = <?php echo json_encode($cost, JSON_PRETTY_PRINT) ?>;
$.each(y, function(idx, obj) { $.each(y, function(idx, obj) {
// alert(obj.PONO); // alert(obj.PONO);
if(id == obj.CostCenterCode) if(id == obj.CostCenterCode)
@ -404,10 +390,10 @@ var id = $('#CostCenter').val();
<script> <script>
$('#MaterialCode').change(function() { $('#MaterialCode').change(function() {
var id = $('#MaterialCode').val(); var id = $('#MaterialCode').val();
//alert(id); //alert(id);
("#Description").val('');
$("#Description").val('');
$("#UOM").val(''); $("#UOM").val('');
var z = <?php echo json_encode($MaterialList, JSON_PRETTY_PRINT) ?>; var z = <?php echo json_encode($MaterialList, JSON_PRETTY_PRINT) ?>;
$.each(z,function(idx,obj){ $.each(z,function(idx,obj){
@ -436,13 +422,15 @@ $("#UOM").val('');
function openmodal() function openmodal()
{ {
if($("option:selected", $("#CostCenter")).val() == '-1') if($("option:selected", $("#CostCenter")).val() == '-1')
{ {
swal('Please select the CostCenter '); swal('Please select the CostCenter ');
$("#CostCenter").focus(); $("#CostCenter").focus();
return false; return false;
}
else if($('#Date').val() == '') }
else if($('#Date').val() == '')
{ {
swal('Please Enter the Requested Date '); swal('Please Enter the Requested Date ');
$("#Date").focus(); $("#Date").focus();
@ -454,9 +442,7 @@ function openmodal()
} }
} }
var index=1;
var index=1;
$('.addClick').click(function() $('.addClick').click(function()
{ {
@ -470,14 +456,10 @@ function openmodal()
{ {
swal('Please Enter the Quantity'); swal('Please Enter the Quantity');
return false; return false;
} }
if ($("#MaterialCode option:selected").val() !='-1' && $('#Quantity').val() != '' ) if ($("#MaterialCode option:selected").val() !='-1' && $('#Quantity').val() != '' )
{ {
var temp =index; var temp =index;
var MaterialCode = $("#MaterialCode option:selected").val(); var MaterialCode = $("#MaterialCode option:selected").val();
var Description =$('#Description').val(); var Description =$('#Description').val();
@ -485,30 +467,30 @@ function openmodal()
var Quantity =$('#Quantity').val(); var Quantity =$('#Quantity').val();
var Remarks=$('#Remarks').val(); var Remarks=$('#Remarks').val();
$('#MaterialCode option[value='+MaterialCode+']').remove(); $('#MaterialCode option[value='+MaterialCode+']').remove();
index = parseInt(index)+1; index = parseInt(index)+1;
var template = jQuery("#tempList").html(); var template = jQuery("#tempList").html();
$('#mytab').append(_.template(template,{index:temp,MaterialCode:MaterialCode,MaterialName:Description,UOM:UOM,Quantity:Quantity,Remarks:Remarks})); $('#mytab').append(_.template(template,{index:temp,MaterialCode:MaterialCode,MaterialName:Description,UOM:UOM,Quantity:Quantity,Remarks:Remarks}));
var theForm = $(".requistion"); var theForm = $(".requistion");
addHidden(theForm,"MaterialCode"+temp,MaterialCode);
addHidden(theForm,"MaterialCode"+temp,MaterialCode);
addHidden(theForm,"Description"+temp,Description); addHidden(theForm,"Description"+temp,Description);
addHidden(theForm,"UOM"+temp,UOM); addHidden(theForm,"UOM"+temp,UOM);
addHidden(theForm,"Quantity"+temp,Quantity); addHidden(theForm,"Quantity"+temp,Quantity);
addHidden(theForm,"Remarks"+temp,Remarks); addHidden(theForm,"Remarks"+temp,Remarks);
//alert(JSON.stringify(Description)); //alert(JSON.stringify(Description));
$('#txtRowCount').val(temp);
$('#txtRowCount').val(temp);
clear(); clear();
}
}
}); });
@ -527,7 +509,6 @@ var userid = '';
function removeHiddenRows(rowcount) function removeHiddenRows(rowcount)
{ {
var step; var step;
if(rowcount > 2) if(rowcount > 2)
{ {
for (step = 1; step < rowcount ; step++) for (step = 1; step < rowcount ; step++)
@ -545,29 +526,25 @@ function removeHiddenRows(rowcount)
} }
} }
$("#EditItem").on("shown.bs.modal", function(e) { $("#EditItem").on("shown.bs.modal", function(e) {
userid = $(e.relatedTarget).data('userid'); userid = $(e.relatedTarget).data('userid');
// alert(userid); // alert(userid);
var tr= document.getElementById(userid); var tr= document.getElementById(userid);
var cellval = tr.cells; var cellval = tr.cells;
//alert(x[1].innerHTML); //alert(x[1].innerHTML);
$('#EditMaterialCode').val(cellval[1].innerHTML); $('#EditMaterialCode').val(cellval[1].innerHTML);
$('#EditDescription').val(cellval[2].innerHTML); $('#EditDescription').val(cellval[2].innerHTML);
$('#EditUOM').val(cellval[3].innerHTML); $('#EditUOM').val(cellval[3].innerHTML);
$('#EditQuantity').val(cellval[4].innerHTML); $('#EditQuantity').val(cellval[4].innerHTML);
$('#EditRemarks').val(cellval[5].innerHTML); $('#EditRemarks').val(cellval[5].innerHTML);
}); });
$('.EditItem').click(function(){ $('.EditItem').click(function(){
var editMaterialCode = $("#EditMaterialCode").val(); var editMaterialCode = $("#EditMaterialCode").val();
var editDescription = $("#EditDescription").val(); var editDescription = $("#EditDescription").val();
var editUOM = $('#EditUOM').val(); var editUOM = $('#EditUOM').val();
var editQuantity = $('#EditQuantity').val(); var editQuantity = $('#EditQuantity').val();
var editRemarks = $('#EditRemarks').val(); var editRemarks = $('#EditRemarks').val();
var tr= document.getElementById(userid); var tr= document.getElementById(userid);
//alert(tr); //alert(tr);
var cellval = tr.cells; var cellval = tr.cells;
@ -586,15 +563,17 @@ $('.EditItem').click(function(){
// $('#txtRowCount').val(userid); // $('#txtRowCount').val(userid);
}); });
function Deleterow(rowid) function Deleterow(rowid)
{ {
var DelRows = $('#txtDeletedRow').val(); var DelRows = $('#txtDeletedRow').val();
var answer = confirm(" Do you want to delete the Item from the List?") var answer = confirm(" Do you want to delete the Item from the List?")
if (answer) if (answer)
{ {
var td = document.getElementById(rowid); var td = document.getElementById(rowid);
td.parentNode.removeChild(td); td.parentNode.removeChild(td);
if(DelRows != '') if(DelRows != '')
{ {
DelRows = DelRows + ":" + rowid; DelRows = DelRows + ":" + rowid;
@ -607,19 +586,15 @@ function Deleterow(rowid)
} }
} }
function validateBeforeAdd() function validateBeforeAdd()
{ {
if ($("#CostCenter option:selected").val() =='-1' ) if ($("#CostCenter option:selected").val() =='-1' )
{ {
swal('Please Select the CostCenterCode '); swal('Please Select the CostCenterCode ');
$("#CostCenter").focus(); $("#CostCenter").focus();
return false; return false;
} }
else if( isExceed == '1') else if( isExceed == '1')
{ {
swal('You dont have available Budget Amount. You cant raise new StoreRequisition'); swal('You dont have available Budget Amount. You cant raise new StoreRequisition');
@ -629,14 +604,12 @@ function validateBeforeAdd()
{ {
$('#mypo').modal('show'); $('#mypo').modal('show');
} }
} }
function Save(status) function Save(status)
{ {
//alert($(json.stringify(MaterialCode).val()); //alert($(json.stringify(MaterialCode).val());
var txtRowCount= $('#txtRowCount').val(); var txtRowCount= $('#txtRowCount').val();
//var mat = $('#MaterialCode'+txtRowCount).val(); //var mat = $('#MaterialCode'+txtRowCount).val();
@ -661,6 +634,7 @@ else
var splitDepCode= $('#DepartmentName').val(); var splitDepCode= $('#DepartmentName').val();
DEPCode = splitDepCode.split('-')[0]; DEPCode = splitDepCode.split('-')[0];
if (validate()) if (validate())
{ {
if(document.getElementById('mytable').rows.length < 0) if(document.getElementById('mytable').rows.length < 0)
@ -669,15 +643,12 @@ else
$('#Deliverydt').focus(); $('#Deliverydt').focus();
return false; return false;
} }
else else
{ {
$('#content').loader('show');
$('#content').loader('show');
$.ajax({ $.ajax({
data:$('.requistion').serialize(), data:$('.requistion').serialize(),
type:"POST", type:"POST",
url:"<?php echo base_url() ?>storerequisitionlist/addNewRequistion", url:"<?php echo base_url() ?>storerequisitionlist/addNewRequistion",
success:function(data) { success:function(data) {
@ -687,25 +658,24 @@ else
swal(data); swal(data);
$('#txtRowCount').val(''); $('#txtRowCount').val('');
$('#txtDeletedRow').val(''); $('#txtDeletedRow').val('');
window.location = "addstore";
window.location = "addstore";
} }
else else
{ {
swal("Error"); swal("Error");
} }
} }
}); });
} }
} }
} }
function validate() function validate()
{ {
if($("option:selected", $("#CostCenter")).val() == '-1') if($("option:selected", $("#CostCenter")).val() == '-1')
{ {
swal('Please Select CostCenter'); swal('Please Select CostCenter');
@ -722,17 +692,13 @@ function validate()
else if(isExceed == 1) else if(isExceed == 1)
{ {
swal('You dont have Budget and You cant Raise New StoreRequisition'); swal('You dont have Budget and You cant Raise New StoreRequisition');
return false; return false;
} }
else else
{ {
return true; return true;
} }
} }
</script> </script>
<script> <script>
@ -744,8 +710,7 @@ function validate()
"ordering": false, "ordering": false,
"info": false, "info": false,
"autoWidth": true "autoWidth": true
}); });
}); });
</script>
</script>

View File

@ -3,11 +3,9 @@
//print_r($AppList); //print_r($AppList);
?> ?>
<div class="content-wrapper"> <div class="content-wrapper">
<section class="content"> <section class="content">
<div class="box"> <div class="box">
<div class="box-header"> <div class="box-header">
<center><h3 class="box-title">Resico Industries - Store Requisition Approval List</h3></center> <center><h3 class="box-title">Resico Industries - Store Requisition Approval List</h3></center>
@ -15,10 +13,8 @@
<?php <?php
$attributes = array('class' => 'form-label-left Approve ','name' => 'Approve','id' => 'Approve'); $attributes = array('class' => 'form-label-left Approve ','name' => 'Approve','id' => 'Approve');
echo form_open($this->config->base_url().'storerequisitionlist/SearchRequistLists',$attributes); ?> echo form_open($this->config->base_url().'storerequisitionlist/SearchRequistLists',$attributes); ?>
<div class="container-fluid"> <div class="container-fluid">
<!-- popup for view store requisition detail --> <!-- popup for view store requisition detail -->
<div class="modal fade" id="myModal" role="dialog"> <div class="modal fade" id="myModal" role="dialog">
<div class="modal-dialog"> <div class="modal-dialog">
@ -30,7 +26,6 @@
<center><h4> Store Requisition Details - <span id="StReqno"></span></h4></center> <center><h4> Store Requisition Details - <span id="StReqno"></span></h4></center>
</div> </div>
<div align="left"> <div align="left">
<div class="col-md-12"> <div class="col-md-12">
<!--<div class="col-md-4"> <!--<div class="col-md-4">
<label>Requistion Type</label> <label>Requistion Type</label>
@ -42,6 +37,8 @@
</div> </div>
</div> --> </div> -->
<div class="col-md-6"> <div class="col-md-6">
<label>Requested By</label> <label>Requested By</label>
<div class="form-group"> <div class="form-group">
@ -56,7 +53,7 @@
<div class="form-group"> <div class="form-group">
<?php <?php
$data = array('name' => 'Desigination','value' => set_value('Desigination'),'id'=>'Desigination', 'class' => 'form-control' ,'readonly' => 'true'); $data = array('name' => 'Desigination','value' => set_value('Desigination'),'id'=>'Desigination', 'class' => 'form-control' ,'readonly' => 'true');
echo form_input($data); echo form_input($data);
?> ?>
</div> </div>
</div> </div>
@ -66,7 +63,8 @@
<div class="col-md-6"> <div class="col-md-6">
<label>Requested Date</label> <label>Requested Date</label>
<div class="form-group"> <div class="form-group">
<?php
<?php
$data = array('name' => 'ReqDate','value' => set_value('ReqDate'),'id'=>'ReqDate', 'class' => 'form-control' ,'readonly' => 'true'); $data = array('name' => 'ReqDate','value' => set_value('ReqDate'),'id'=>'ReqDate', 'class' => 'form-control' ,'readonly' => 'true');
echo form_input($data); echo form_input($data);
?> ?>
@ -74,7 +72,8 @@
</div> </div>
<div class="col-md-6"> <div class="col-md-6">
<label>Cost Center Name</label>
<label>Cost Center Name</label>
<div class="form-group"> <div class="form-group">
<?php <?php
@ -88,7 +87,7 @@
</div> </div>
</div> </div>
<!-- <div class="col-md-4"> <!-- <div class="col-md-4">
<label>Avl Budget Amt</label>&nbsp;<img id="AlertImg" src="<?php echo base_url(); ?>assets/dist/img/red.png" alt="your image" width="25px" style="display:none"/> <label>Avl Budget Amt</label>&nbsp;<img id="AlertImg" src="<?php echo base_url(); ?>assets/dist/img/red.png" alt="your image" width="25px" style="display:none"/>
<div class="form-group"> <div class="form-group">
<?php <?php
$data = array('name' => 'AvlBudgetAmount','value' => set_value('AvlBudgetAmount'),'id'=>'AvlBudgetAmount', 'class' => 'form-control' ,'readonly' => 'true'); $data = array('name' => 'AvlBudgetAmount','value' => set_value('AvlBudgetAmount'),'id'=>'AvlBudgetAmount', 'class' => 'form-control' ,'readonly' => 'true');
@ -96,7 +95,6 @@
?> ?>
</div> --> </div> -->
</div> </div>
</div> </div>
<table id="Items" class="table table-bordered table-hover" style="background-color:#fff;font-size:12px;"> <table id="Items" class="table table-bordered table-hover" style="background-color:#fff;font-size:12px;">
@ -104,7 +102,7 @@
<div class="modal fade" role="dialog"> <div class="modal fade" role="dialog">
<thead style="background-color:#ddf"> <thead style="background-color:#ddf">
<tr> <tr>
<th>SNo</th> <th>SNo</th>
@ -117,9 +115,8 @@
<th>Remarks</th> <th>Remarks</th>
</tr> </tr>
</thead> </thead>
<tbody id="tbleAppend"> <tbody id="tbleAppend">
</tbody>
</tbody>
</div> </div>
</div> </div>
</table> </table>
@ -128,274 +125,476 @@
</div> </div>
</div> </div>
</div> </div>
</div>
</div>
</form> </form>
</div> </div>
</div> </div>
<table id="Requisition" class="table table-bordered table-hover editabletable" style="background-color:#fff;font-size:12px;"> <table id="Requisition" class="table table-bordered table-hover editabletable" style="background-color:#fff;font-size:12px;">
<div align="right" style="padding-right:10px"> <div align="right" style="padding-right:10px">
<div id="content" > </div> <div id="content" > </div>
<div class="modal fade" role="dialog"> <div class="modal fade" role="dialog">
<thead style="background-color:#ddf"> <thead style="background-color:#ddf">
<tr> <tr>
<th>Store Requisition Number</th> <th>Store Requisition Number</th>
<th>Requested By</th> <th>Requested By</th>
<th>Requested Date</th> <th>Requested Date</th>
<th>Status</th> <th>Status</th>
<th>Action</th> <th>Action</th>
<th>comments</th> <th>comments</th>
</tr> </tr>
</thead> </thead>
<tbody id="ApprovalList"> <tbody id="ApprovalList">
<?php <?php
if(!empty($AppList)) if(!empty($AppList))
{ {
//print_r($AppList); //print_r($AppList);
$index = 0; $index = 0;
foreach($AppList as $record) foreach($AppList as $record)
{ {
$index = $index +1; $index = $index +1;
?> ?>
<tr id="<?php echo $index ?>" > <tr id="<?php echo $index ?>" >
<td><a data-toggle="modal" data-target="#myModal" data-id="<%=index%>" data-userid="<?php echo $record->StoreReqNo ?>" ><u><?php echo $record->StoreReqNo ?></u></a></td> <td><a data-toggle="modal" data-target="#myModal" data-id="<%=index%>" data-userid="<?php echo $record->StoreReqNo ?>" ><u><?php echo $record->StoreReqNo ?></u></a></td>
<td><?php echo $record->FirstName?></td> <td><?php echo $record->FirstName?></td>
<td ><?php $Cdt = new DateTime($record->ReqDate); <td ><?php $Cdt = new DateTime($record->ReqDate);
$ReqDate= $Cdt->format('d-m-Y'); $ReqDate= $Cdt->format('d-m-Y');
echo $ReqDate; echo $ReqDate;
?></td> ?></td>
<td><?php echo $record->StatusName ?></td> <td><?php echo $record->StatusName ?></td>
<?php if (($record->Status) == STORE_PENDINGAPPROVAL) <?php if (($record->Status) == STORE_PENDINGAPPROVAL)
{ {
?> ?>
<!-- <td contenteditable="true"><input type="text" id="Remarks<?php echo $index ?>" name="Remarks<?php echo $index ?>"class="form-control" maxlength="100"></td> --> <!-- <td contenteditable="true"><input type="text" id="Remarks<?php echo $index ?>" name="Remarks<?php echo $index ?>"class="form-control" maxlength="100"></td> -->
<!-- <td data-name="sel" id="Action<?php echo $index ?>" onchange="saveToDatabase(this.options[this.selectedIndex].value,'question','<?php echo $record->StoreReqNo ; ?>','<?php echo $index ; ?>')"> <!-- <td data-name="sel" id="Action<?php echo $index ?>" onchange="saveToDatabase(this.options[this.selectedIndex].value,'question','<?php echo $record->StoreReqNo ; ?>','<?php echo $index ; ?>')">
<select name="status<?php echo $index ?>" id="status<?php echo $index ?>"> <select name="status<?php echo $index ?>" id="status<?php echo $index ?>">
<option value="-1">Select Action</option> <option value="-1">Select Action</option>
<option value="1">Approve</option> <option value="1">Approve</option>
<option value="2">Reject</option> <option value="2">Reject</option>
</select> </select>
</td> --> </td> -->
<td> <select name="selectId" id="selectId" title="Select Your Option" onchange="saveToDatabase('<?php echo $record->StoreReqNo ?>','<?php echo $index ; ?>',this.options[this.selectedIndex].value,'<?php echo $record->Comments ?>');"> <td> <select name="selectId" id="selectId" title="Select Your Option" onchange="saveToDatabase('<?php echo $record->StoreReqNo ?>','<?php echo $index ; ?>',this.options[this.selectedIndex].value,'<?php echo $record->Comments ?>');">
<option value="-1" >Select Option</option> <option value="-1" >Select Option</option>
<option value="1">Approve</option> <option value="1">Approve</option>
<option value="2">Reject</option> <option value="2">Reject</option>
</select></td> </select></td>
<?php
}
else
{
?>
<td><?php echo "---";//$record->Comments ?></td>
<!-- <td><?php echo $record->StatusName ?></td> -->
<?php <?php
} }
?>
<td contenteditable="true" id="newcomments<?php echo $index ; ?>" ><?php echo $record->Comments ?></td> else
</tr>
{
?>
<td><?php echo "---";//$record->Comments ?></td>
<!-- <td><?php echo $record->StatusName ?></td> -->
<?php <?php
}
?>
<td contenteditable="true" id="newcomments<?php echo $index ; ?>" ><?php echo $record->Comments ?></td>
</tr>
<?php
} }
} }
?> ?>
</tbody> </tbody>
</table> </table>
<br> <br>
</div> </div>
</div> </div>
</section> </section>
</div> </div>
<script> <script>
var startDate = ''; var startDate = '';
var endDate = ''; var endDate = '';
function Reset() function Reset()
{ {
$('#RequisitionStatus').val("-1"); $('#RequisitionStatus').val("-1");
$('#SearchDate').val(''); $('#SearchDate').val('');
} }
$("#myModal").on("shown.bs.modal", function(e) { $("#myModal").on("shown.bs.modal", function(e) {
var ReqId = $(e.relatedTarget).data('userid'); var ReqId = $(e.relatedTarget).data('userid');
$("#StReqno").html(ReqId); $("#StReqno").html(ReqId);
$('#ReqNO').val(ReqId); $('#ReqNO').val(ReqId);
$("#CostCenter").val(''); $("#CostCenter").val('');
$("#tbleAppend").empty(); $("#tbleAppend").empty();
$("#ReqDate").val(''); $("#ReqDate").val('');
$("#Desigination").val(''); $("#Desigination").val('');
$('#content').loader('show'); $('#content').loader('show');
$.ajax({ $.ajax({
data:{id:ReqId}, data:{id:ReqId},
type:"POST", type:"POST",
dataType: 'json', dataType: 'json',
url:"<?php echo base_url() ?>storerequisitionlist/ViewRequest", url:"<?php echo base_url() ?>storerequisitionlist/ViewRequest",
success:function(json) { success:function(json) {
//success:function(data) { //success:function(data) {
$('#content').loader('hide'); $('#content').loader('hide');
//alert(json.Requist); //alert(json.Requist);
if(json.Requist != '') if(json.Requist != '')
{ {
//alert(json.Requist[0]['Requestedby']) ; //alert(json.Requist[0]['Requestedby']) ;
$("#Requestedby").val(json.Requist[0]['FirstName']); $("#Requestedby").val(json.Requist[0]['FirstName']);
$("#ReqDate").val(json.Requist[0]['ReqDate']); $("#ReqDate").val(json.Requist[0]['ReqDate']);
$("#Desigination").val(json.Requist[0]['DepartmentName']); $("#Desigination").val(json.Requist[0]['DepartmentName']);
$("#CostCenter").val(json.Requist[0]['CostCenterName']); $("#CostCenter").val(json.Requist[0]['CostCenterName']);
$("#tbleAppend").append(json.Items); $("#tbleAppend").append(json.Items);
} }
} }
});
}); });
});
function saveToDatabase(ReqId,Index,option,com) function saveToDatabase(ReqId,Index,option,com)
{ {
var newcomments=document.getElementById('newcomments'+Index+'').innerHTML; var newcomments=document.getElementById('newcomments'+Index+'').innerHTML;
var id=ReqId; var id=ReqId;
var Status= ''; var Status= '';
if (option == -1 ) if (option == -1 )
{ {
alert("Please Select Approve/Reject option");
swal("Please Select Approve/Reject option");
return false; return false;
} }
else if (option == 1 ) else if (option == 1 )
{ {
// alert(' The Approval '); // alert(' The Approval ');
Status='<?php echo STORE_APPROVAL;?>'; Status='<?php echo STORE_APPROVAL;?>';
var strMsg='Do You want to Approve this requisition?'; var strMsg='Do You want to Approve this requisition?';
} }
else else
{ {
Status='<?php echo STORE_REJECT;?>'; Status='<?php echo STORE_REJECT;?>';
var strMsg='Do You want to Reject this requisition?'; var strMsg='Do You want to Reject this requisition?';
} }
var answer = confirm(strMsg); var answer = confirm(strMsg);
if (answer) if (answer)
{ {
$('#content').loader('show'); $('#content').loader('show');
$.ajax({ $.ajax({
data:{id:id,newcomments:newcomments}, data:{id:id,newcomments:newcomments},
type:"POST", type:"POST",
url:"<?php echo base_url() ?>storerequisitionlist/ApproveRequest?Status="+Status, url:"<?php echo base_url() ?>storerequisitionlist/ApproveRequest?Status="+Status,
success:function(data) { success:function(data) {
if(data) if(data)
{ {
$('#content').loader('hide'); $('#content').loader('hide');
alert(data);
swal(data);
location.reload(); location.reload();
}
else
{
alert("Error");
} }
else
{
swal("Error");
}
} }
}); });
} }
else else
{ {
return; return;
} }
} }
$(function() { $(function() {
var d = new Date(); var d = new Date();
var month = d.getMonth(); var month = d.getMonth();
var day = d.getDate(); var day = d.getDate();
var year = d.getFullYear() ; var year = d.getFullYear() ;
var SIAStartYear = year - 2015; var SIAStartYear = year - 2015;
var mindt = year-70; var mindt = year-70;
var maxdt = year-15; var maxdt = year-15;
$( ".datePicker" ).datepicker( $( ".datePicker" ).datepicker(
{ {
minDate : new Date(year-SIAStartYear,1,1), minDate : new Date(year-SIAStartYear,1,1),
maxDate :'now', maxDate :'now',
dateFormat: 'mm/dd/yy',changeMonth: true, changeYear: true, dateFormat: 'mm/dd/yy',changeMonth: true, changeYear: true,
} }
); );
//$('#SearchDate').daterangepicker( ); //$('#SearchDate').daterangepicker( );
//Initialize Select2 Elements //Initialize Select2 Elements
$(".select2").select2(); $(".select2").select2();
//$('#SearchDate').val(''); //$('#SearchDate').val('');
$('#SearchDate').daterangepicker( $('#SearchDate').daterangepicker(
{ {
locale: { locale: {
format: 'DD-MM-YYYY' format: 'DD-MM-YYYY'
}, },
showDropdowns: true
},
function(start, end, label) {
startDate = start.format('DD-MM-YYYY');
showDropdowns: true
},
function(start, end, label) {
startDate = start.format('DD-MM-YYYY');
endDate = end.format('DD-MM-YYYY'); endDate = end.format('DD-MM-YYYY');
$('#FromDate').val(startDate); $('#FromDate').val(startDate);
$('#ToDate').val(endDate); $('#ToDate').val(endDate);
//alert("A new date range was chosen: " + start.format('DD-MM-YYYY') + ' to ' + end.format('DD-MM-YYYY'));
}); });
}); });
$(function () { $(function () {
$('#Items').DataTable({ $('#Items').DataTable({
"paging": false, "paging": false,
"lengthChange": true, "lengthChange": true,
"searching": false, "searching": false,
"ordering": false, "ordering": false,
"info": false, "info": false,
"autoWidth": false "autoWidth": false
}); });
$('#Requisition').DataTable({ $('#Requisition').DataTable({
"paging": true,
"lengthChange": true, "paging": true,
"searching": true, "lengthChange": true,
"ordering": true, "searching": true,
"info": true, "ordering": true,
"autoWidth": true "info": true,
"autoWidth": true
}); });
}); });
</script> </script>

View File

@ -195,7 +195,7 @@
<td style="text-align: center;border-right: 1px solid black; <td style="text-align: center;border-right: 1px solid black;
border-left: 1px solid black;"><span style="padding-left: 2px;"><?php echo $record->MaterialCode;?></span></td> border-left: 1px solid black;"><span style="padding-left: 2px;"><?php echo $record->MaterialCode;?></span></td>
<td style="text-align: center;border-right: 1px solid black; <td style="text-align: center;border-right: 1px solid black;
border-left: 1px solid black;"><span style="padding-left: 2px;"><?php echo $record->MaterialName ; ?></span></td> border-left: 1px solid black;"><span style="padding-left: 2px;"><?php echo $record->MaterialName.$record->ServiceMaterialDescription; ?></span></td>
<td style="text-align: center;border-right: 1px solid black; <td style="text-align: center;border-right: 1px solid black;
border-left: 1px solid black;"><?php if(!empty($record->HSNCODE)){echo $record->HSNCODE;}else {echo "NIL";}?></td> border-left: 1px solid black;"><?php if(!empty($record->HSNCODE)){echo $record->HSNCODE;}else {echo "NIL";}?></td>
<td style="text-align: center;border-right: 1px solid black; <td style="text-align: center;border-right: 1px solid black;

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -14,17 +14,8 @@ if(!empty($companyinfo))
?> ?>
<style>
@page { margin: 298px 25px 30px 25px; }
.header { position: fixed; left: 0px; top: -280px; right: 0px; height: 500px;text-align: center; }
.footer { position: fixed; bottom: 0px;}
.pagenum:before { content: counter(page); }
</style>
<body style="font-family: sans-serif;">
<div class="footer" style="font-size:12px;">
Page: <span class="pagenum"></span> <body style="font-family: sans-serif;">
</div>
<div class="header"> <div class="header">
<div style="text-align: left;"> <div style="text-align: left;">

View File

@ -227,7 +227,7 @@
<td style="text-align: center;border-right: 1px solid black; <td style="text-align: center;border-right: 1px solid black;
border-left: 1px solid black;"><span style="padding-left: 2px;"><?php echo $record->MaterialCode ; ?></span></td> border-left: 1px solid black;"><span style="padding-left: 2px;"><?php echo $record->MaterialCode ; ?></span></td>
<td style="text-align: center;border-right: 1px solid black; <td style="text-align: center;border-right: 1px solid black;
border-left: 1px solid black;"><span style="padding-left: 2px;"><?php echo $record->MaterialName ; ?></span></td> border-left: 1px solid black;"><span style="padding-left: 2px;"><?php echo $record->MaterialName.$record->ServiceMaterialDescription ; ?></span></td>
<td style="text-align: center;border-right: 1px solid black; <td style="text-align: center;border-right: 1px solid black;
border-left: 1px solid black;"><?php echo $record->HSNCODE;?></td> border-left: 1px solid black;"><?php echo $record->HSNCODE;?></td>
<td style="text-align: center;border-right: 1px solid black; <td style="text-align: center;border-right: 1px solid black;

View File

@ -235,7 +235,7 @@ function validate_Vechicle(){
{ {
if (reg.test(VehicleNo) == false) if (reg.test(VehicleNo) == false)
{ {
alert('Please Enter Valid Vehicle Number'); swal('Please Enter Valid Vehicle Number');
return (false); return (false);
} }
else else
@ -272,37 +272,37 @@ function validate()
if($('#PONO').val()=='-1') if($('#PONO').val()=='-1')
{ {
alert("Please select PurchaseOrder"); swal("Please select PurchaseOrder");
$('#PONO').focus(); $('#PONO').focus();
return false; return false;
} }
else if($('#InvoiceNo').val() == '' ) else if($('#InvoiceNo').val() == '' )
{ {
alert('Please Enter Invoice Number' ); swal('Please Enter Invoice Number' );
$('#InvoiceNo').focus(); $('#InvoiceNo').focus();
return false; return false;
} }
else if($('#InvoiceDate').val() == '' ) else if($('#InvoiceDate').val() == '' )
{ {
alert('Please Enter Invoice Date' ); swal('Please Enter Invoice Date' );
$('#InvoiceDate').focus(); $('#InvoiceDate').focus();
return false; return false;
} }
else if (Noval == 0 ) else if (Noval == 0 )
{ {
alert('Advised Quantity is Empty.Please Enter the value'); swal('Advised Quantity is Empty.Please Enter the value');
return false; return false;
} }
else if($('#VehicleNo').val() == '' && $('#CourierNo').val() == '') else if($('#VehicleNo').val() == '' && $('#CourierNo').val() == '')
{ {
alert('Please Enter the Vechicle / Courier Number'); swal('Please Enter the Vechicle / Courier Number');
return false; return false;
} }
else if(isExceed == 1 ){ else if(isExceed == 1 ){
alert("Advised Quantity is exceeding the Ordered Quantity.Please Contact Purchase Team for further Process ") swal("Advised Quantity is exceeding the Ordered Quantity.Please Contact Purchase Team for further Process ")
return false; return false;
} }
else else
@ -463,7 +463,7 @@ $('<input>').attr({
if(status == '<?php echo IGR_CREATED ?>' || status == '<?php echo MRIR_CREATED ?>' || status == '<?php echo MRIR_APPROVED ?>' ) if(status == '<?php echo IGR_CREATED ?>' || status == '<?php echo MRIR_CREATED ?>' || status == '<?php echo MRIR_APPROVED ?>' )
{ {
alert('The Order is completed!!'); swal('The Order is completed!!');
$("#IGRLink").hide(); $("#IGRLink").hide();
} }
else else
@ -474,7 +474,7 @@ $('<input>').attr({
} }
else else
{ {
alert('Please Select the Purchase Order Number to Create IGR'); swal('Please Select the Purchase Order Number to Create IGR');
} }
}); });
@ -502,7 +502,7 @@ function validateReceivedQuantity(Rowid){
//alert(InvoiceQty); //alert(InvoiceQty);
if((InvoiceQty+RecQty) > OrderedQty){ if((InvoiceQty+RecQty) > OrderedQty){
alert("Advised Quantity is exceeding the Ordered Quantity.Please Contact Purchase Team for further Process ") swal("Advised Quantity is exceeding the Ordered Quantity.Please Contact Purchase Team for further Process ")
$("#QuantityAsPerInvoice"+Rowid).focus(); $("#QuantityAsPerInvoice"+Rowid).focus();
$("#QuantityAsPerInvoice"+Rowid).val(''); $("#QuantityAsPerInvoice"+Rowid).val('');
return false; return false;
@ -510,7 +510,7 @@ function validateReceivedQuantity(Rowid){
} }
else if(((InvoiceQty+RecQty) - OrderedQty) > 0.00){ else if(((InvoiceQty+RecQty) - OrderedQty) > 0.00){
alert("Order is completed.") swal("Order is completed.")
$("#QuantityAsPerInvoice"+Rowid).focus(); $("#QuantityAsPerInvoice"+Rowid).focus();
$('#QuantityAsPerInvoice'+Rowid).val(''); $('#QuantityAsPerInvoice'+Rowid).val('');
return false; return false;
@ -567,7 +567,7 @@ function Save()
} }
else else
{ {
alert("Error"); swal("Error");
} }

View File

@ -1,12 +1,7 @@
<?php <?php
$dt = new DateTime('now', new DateTimeZone('Asia/Kolkata')); $dt = new DateTime('now', new DateTimeZone('Asia/Kolkata'));
$CurrentDate = $dt->format('d-m-y'); $CurrentDate = $dt->format('d-m-y');
// print_r($cost);die();
$CostCenterCode=''; $CostCenterCode='';
$CostCenterName=''; $CostCenterName='';
$StoreReqNo=''; $StoreReqNo='';
@ -15,8 +10,11 @@ $DepartmentName='';
$DEPCode = ''; $DEPCode = '';
$RowCount = 0; $RowCount = 0;
$ReqBy = ''; $ReqBy = '';
if(!empty($ReqListDetails)) if(!empty($ReqListDetails))
{ {
foreach ($ReqListDetails as $Req ) { foreach ($ReqListDetails as $Req ) {
$CostCenterCode = $Req->CostCenterCode; $CostCenterCode = $Req->CostCenterCode;
@ -27,75 +25,88 @@ foreach ($ReqListDetails as $Req ) {
$DEPCode = $Req->DEPCode; $DEPCode = $Req->DEPCode;
$DepartmentName=$Req->DepartmentName; $DepartmentName=$Req->DepartmentName;
$ReqBy = $Req->FirstName; $ReqBy = $Req->FirstName;
} }
} }
?> ?>
<script> <script>
$(function() { $(function() {
//Initialize Select2 Elements //Initialize Select2 Elements
$("#MaterialCode").select2(); $("#MaterialCode").select2();
$("#Date").datepicker({ $("#Date").datepicker({
// minDate : 'now', // minDate : 'now',
maxDate : 'now', maxDate : 'now',
dateFormat: 'mm/dd/yy',changeMonth: true, changeYear: true,yearRange: '-100:+0' dateFormat: 'mm/dd/yy',changeMonth: true, changeYear: true,yearRange: '-100:+0'
}); });
}); });
</script> </script>
<style type="text/css"> <style type="text/css">
.num{ .num{
text-align:right; text-align:right;
} }
.select2 .select2
{ {
width: 100% ! important; width: 100% ! important;
} }
.dataTables_wrapper { .dataTables_wrapper {
padding-bottom: 0px ! important; padding-bottom: 0px ! important;
} }
span.highlight { span.highlight {
background-color: yellow; background-color: yellow;
} }
</style> </style>
<div class="content-wrapper" style="min-height: 500px ! important;"> <div class="content-wrapper" style="min-height: 500px ! important;">
<!-- Content Header (Page header) --> <!-- Content Header (Page header) -->
<section class="content-header"> <section class="content-header">
<h1> <h1>
<center>Resico Industries - Store Requisition - <?php echo $StoreReqNo; ?></center> <center>Resico Industries - Store Requisition - <?php echo $StoreReqNo; ?></center>
</h1> </h1>
</section> </section>
<section class="content"> <section class="content">
<div class="row" style="padding:2% 5%"> <div class="row" style="padding:2% 5%">
<?php <?php
$attributes = array('class' => 'form-label-left requistion ','name' => 'requistion','id' => 'requistion'); $attributes = array('class' => 'form-label-left requistion ','name' => 'requistion','id' => 'requistion');
echo form_open($this->config->base_url().'storerequisitionlist/UpdateIssueRequistion',$attributes); echo form_open($this->config->base_url().'storerequisitionlist/UpdateIssueRequistion',$attributes);
?> ?>
<!-- <form method="post" role="form" > --> <!-- <form method="post" role="form" > -->
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="col-md-12">
<input type="hidden" name="txtReqNo" id="txtReqNo" value="<?php echo $StoreReqNo?>"/> <input type="hidden" name="txtReqNo" id="txtReqNo" value="<?php echo $StoreReqNo?>"/>
<div class="col-md-3"> <div class="col-md-3">
<label>Requested By</label> <label>Requested By</label>
<?php <?php
$data = array('name' => 'RequestedBy','value' => set_value('RequestedBy',$ReqBy), 'id'=>'RequestedBy','class' => 'form-control' ,'readonly' => 'true'); $data = array('name' => 'RequestedBy','value' => set_value('RequestedBy',$ReqBy), 'id'=>'RequestedBy','class' => 'form-control' ,'readonly' => 'true');
echo form_input($data); echo form_input($data);
?> ?>
</div> </div>
<div class="col-md-3"> <div class="col-md-3">
@ -106,8 +117,6 @@ span.highlight {
?> ?>
</div> </div>
<div class="col-md-3"> <div class="col-md-3">
<label>Requested Date</label> <label>Requested Date</label>
<?php <?php
@ -115,25 +124,17 @@ span.highlight {
echo form_input($data); echo form_input($data);
?> ?>
</div> </div>
<div class="col-md-3"> <div class="col-md-3">
<label>Cost Center</label> <label>Cost Center</label>
<?php <?php
$data = array('name' => 'CostCenter','value' => set_value('CostCenter',$CostCenterCode . " - ".$CostCenterName),'id'=>"CostCenter", 'class' => 'form-control','readonly' => 'true' ); $data = array('name' => 'CostCenter','value' => set_value('CostCenter',$CostCenterCode . " - ".$CostCenterName),'id'=>"CostCenter", 'class' => 'form-control','readonly' => 'true' );
echo form_input($data); echo form_input($data);
?> ?>
</div> </div>
</div> </div>
</div> </div>
<br> <br>
<div class="row "> <div class="row ">
<div class=" box "> <div class=" box ">
<div class=" container-fluid"> <div class=" container-fluid">
@ -155,11 +156,11 @@ span.highlight {
<th>Issuing Quantity</th> <th>Issuing Quantity</th>
<th>Comments</th> <th>Comments</th>
</thead> </thead>
<tbody id='mytab'>
<tbody id='mytab'>
<?php <?php
if(!empty($ReqItem)) if(!empty($ReqItem))
{ //alert(); { //swal();
$index = 0; $index = 0;
foreach($ReqItem as $record) foreach($ReqItem as $record)
{ {
@ -167,23 +168,21 @@ span.highlight {
$index = $index + 1; $index = $index + 1;
$qty=($record->QuantityRequired)-($record->QuantityIssued); $qty=($record->QuantityRequired)-($record->QuantityIssued);
?> ?>
<tr id="<?php echo $index ; ?>">
<tr id="<?php echo $index ; ?>">
<td align="left"><?php echo $index ; ?></td> <td align="left"><?php echo $index ; ?></td>
<!-- <input type="hidden" name="<?php echo 'te'.$index ?>" id="<?php echo 'te'.$index ?>" value="<?php echo $record->MaterialCode ; ?>" /> <!-- <input type="hidden" name="<?php echo 'te'.$index ?>" id="<?php echo 'te'.$index ?>" value="<?php echo $record->MaterialCode ; ?>" />
<input type="hidden" name="<?php echo 'te'.$index ?>" id="<?php echo 'tes'.$index ?>" value="<?php echo $record->QuantityRequired ; ?>" /> --> <input type="hidden" name="<?php echo 'te'.$index ?>" id="<?php echo 'tes'.$index ?>" value="<?php echo $record->QuantityRequired ; ?>" /> -->
<td align="left"><?php echo $record->MaterialCode ?></td> <td align="left"><?php echo $record->MaterialCode ?></td>
<td align="left"><?php echo $record->MaterialName ?></td> <td align="left"><?php echo $record->MaterialName ?></td>
<td align="left"><?php echo $record->UOM ?></td> <td align="left"><?php echo $record->UOM ?></td>
<td align="right"><?php echo $record->QuantityRequired ?></td> <td align="right"><?php echo $record->QuantityRequired ?></td>
<input type="hidden" name="<?php echo 'txtqty'.$index ?>" id="<?php echo 'txtqty'.$index ?>" value=<?php echo $record->QuantityRequired?>> <input type="hidden" name="<?php echo 'txtqty'.$index ?>" id="<?php echo 'txtqty'.$index ?>" value=<?php echo $record->QuantityRequired?>>
<!-- <input type="hidden" name="<?php echo 'Reqnumber'.$index ?>" id="<?php echo 'Reqnumber'.$index ?>" value="<?php echo $record->ReqNo ; ?>" /> --> <!-- <input type="hidden" name="<?php echo 'Reqnumber'.$index ?>" id="<?php echo 'Reqnumber'.$index ?>" value="<?php echo $record->ReqNo ; ?>" /> -->
<?php if(($record->Quantity)-$qty<0) <?php if(($record->Quantity)-$qty<0)
{?> {?>
<td align="right" style="color: red" ><?php echo $record->Quantity?></td> <td align="right" style="color: red" ><?php echo $record->Quantity?></td>
@ -194,113 +193,73 @@ span.highlight {
<td align="right"><?php echo $record->Quantity?></td> <td align="right"><?php echo $record->Quantity?></td>
<? <?
}?> }?>
<td align="left"><?php echo $record->QuantityIssued ?></td> <td align="left"><?php echo $record->QuantityIssued ?></td>
<td align="left"><?php echo($record->QuantityRequired)-($record->QuantityIssued) ?></td> <td align="left"><?php echo($record->QuantityRequired)-($record->QuantityIssued) ?></td>
<td align="left"><?php echo $record->Remarks ?></td> <td align="left"><?php echo $record->Remarks ?></td>
<td align="left"> <td align="left">
<?php if((($record->Quantity)-$qty>=0)&&$record->StatusName!='ISSUED') <?php if((($record->Quantity)-$qty>=0)&&$record->StatusName!='ISSUED')
{?> {?>
<input type="text" onchange="SaveIssueQuantity(<?php echo $index ?>,<?php echo $record->QuantityRequired ?>,<?php echo $record->QuantityIssued ?>)" id="<?php echo 'issuedQuantity'.$index ?>" name="<?php echo 'issuedQuantity'.$index ?>" class="form required" onkeypress="return isNumberKey(event);"value="<?php echo $record->QuantityIssued; ?>"> <?} <input type="text" onchange="SaveIssueQuantity(<?php echo $index ?>,<?php echo $record->QuantityRequired ?>,<?php echo $record->QuantityIssued ?>)" id="<?php echo 'issuedQuantity'.$index ?>" name="<?php echo 'issuedQuantity'.$index ?>" class="form required" onkeypress="return isNumberKey(event);"value="<?php echo $record->QuantityIssued; ?>"> <?}
else else
{?> {?>
<input type="text" onchange="SaveIssueQuantity(<?php echo $index ?>,<?php echo $record->QuantityRequired ?>,<?php echo $record->QuantityIssued ?>)" id="<?php echo 'issuedQuantity'.$index ?>" name="<?php echo 'issuedQuantity'.$index ?>" class="form required" readonly=true onkeypress="return isNumberKey(event);"value="<?php echo $record->QuantityIssued; ?>"><?}?> <input type="text" onchange="SaveIssueQuantity(<?php echo $index ?>,<?php echo $record->QuantityRequired ?>,<?php echo $record->QuantityIssued ?>)" id="<?php echo 'issuedQuantity'.$index ?>" name="<?php echo 'issuedQuantity'.$index ?>" class="form required" readonly=true onkeypress="return isNumberKey(event);"value="<?php echo $record->QuantityIssued; ?>"><?}?>
</td> </td>
<td align="left"> <td align="left">
<?php if((($record->Quantity)-$qty>=0)&&$record->StatusName!='ISSUED') <?php if((($record->Quantity)-$qty>=0)&&$record->StatusName!='ISSUED')
{?> {?>
<input type="text" onchange="SaveRemarks(<?php echo $index ?>)" id="<?php echo 'Comments'.$index ?>" name="<?php echo 'Comments'.$index ?>" class="form required" value="<?php echo $record->StoreComments; ?>" ><?} <input type="text" onchange="SaveRemarks(<?php echo $index ?>)" id="<?php echo 'Comments'.$index ?>" name="<?php echo 'Comments'.$index ?>" class="form required" value="<?php echo $record->StoreComments; ?>" ><?}
else{?> else{?>
<input type="text" onchange="SaveRemarks(<?php echo $index ?>)" id="<?php echo 'Comments'.$index ?>" name="<?php echo 'Comments'.$index ?>" class="form required" readonly=true value="<?php echo $record->StoreComments; ?>" ><?}?> <input type="text" onchange="SaveRemarks(<?php echo $index ?>)" id="<?php echo 'Comments'.$index ?>" name="<?php echo 'Comments'.$index ?>" class="form required" readonly=true value="<?php echo $record->StoreComments; ?>" ><?}?>
</td> </td>
</tr> </tr>
<?php $RowCount = $index; } <?php $RowCount = $index; }
?> ?>
<?php <?php
}?> }?>
</tbody> </tbody>
</table> </table>
</div> </div>
</div> </div>
</div> </div>
<div class="col-md-3 col-md-offset-9" align = "right"> <div class="col-md-3 col-md-offset-9" align = "right">
<input type="hidden" name="txtRowCount" id="txtRowCount" value="<?php echo $RowCount;?>" /> <input type="hidden" name="txtRowCount" id="txtRowCount" value="<?php echo $RowCount;?>" />
<input type="hidden" name="txtStatus" id="txtStatus" /> <input type="hidden" name="txtStatus" id="txtStatus" />
<!--<a class="btn btn-primary Save" ID="Save" onclick="Save()" >&nbsp;&nbsp;<span class="bold">Save</span></a> -->
<!-- <a class="btn btn-primary Save" ID="Save" onclick="Save(0)" >&nbsp;&nbsp;<span class="bold">Save</span></a>
<a class="btn btn-primary Submit" ID="Submit" onclick="Save(1)" >&nbsp;&nbsp;<span class="bold">Submit</span></a>
<input type="Submit" class="btn btn-info" />-->
<input type="submit" class="btn btn-primary Submit" value="Update"/ > <input type="submit" class="btn btn-primary Submit" value="Update"/ >
<!-- <input type="reset" class="btn btn-primary" value="Cancel" href="<?php echo base_url(); ?>storerequisitionlisting" /> -->
<a class="btn btn-primary" href="<?php echo base_url(); ?>storerequisitionlisting">Cancel</a> <a class="btn btn-primary" href="<?php echo base_url(); ?>storerequisitionlisting">Cancel</a>
</div> </div>
</form> </form>
</div> </div>
</section> </section>
</div> </div>
</script> </script>
<script type="text/html" id="tempList"> <script type="text/html" id="tempList">
<tr id="<%=index%>"> <tr id="<%=index%>">
<td align="left"><%=index%></td> <td align="left"><%=index%></td>
<td align="left"><%=MaterialCode%></td> <td align="left"><%=MaterialCode%></td>
<td align="left"><%=MaterialName%></td> <td align="left"><%=MaterialName%></td>
<td align="left"><%=UOM%></td> <td align="left"><%=UOM%></td>
<td align="left"><%=Quantity%></td> <td align="left"><%=Quantity%></td>
<td><%=Remarks%></td> <td><%=Remarks%></td>
<td align="left"></td> <!-- Issued Quantity --> <td align="left"></td> <!-- Issued Quantity -->
<td></td> <!-- Comments --> <td></td> <!-- Comments -->
</tr> </tr>
</script> </script>
<!--copy script--> <!--copy script-->
<script> <script>
var j =0; var j =0;
var isExceed = 0; var isExceed = 0;
$(function() { $(function() {
var ReqLineItem = <?php echo json_encode($ReqItem, JSON_PRETTY_PRINT) ?>; var ReqLineItem = <?php echo json_encode($ReqItem, JSON_PRETTY_PRINT) ?>;
$.each(ReqLineItem, function(idx, obj) { $.each(ReqLineItem, function(idx, obj) {
//$("#SupAddress").val(obj.Address); //$("#SupAddress").val(obj.Address);
j= j +1 ; j= j +1 ;
$('<input>').attr({ $('<input>').attr({
@ -308,7 +267,6 @@ var ReqLineItem = <?php echo json_encode($ReqItem, JSON_PRETTY_PRINT) ?>;
id: 'MaterialCode' + j, id: 'MaterialCode' + j,
name: 'MaterialCode'+ j, name: 'MaterialCode'+ j,
value:obj.MaterialCode value:obj.MaterialCode
}).appendTo('form'); }).appendTo('form');
$('<input>').attr({ $('<input>').attr({
@ -318,35 +276,31 @@ var ReqLineItem = <?php echo json_encode($ReqItem, JSON_PRETTY_PRINT) ?>;
}).appendTo('form'); }).appendTo('form');
$('<input>').attr({ $('<input>').attr({
type: 'hidden', type: 'hidden',
id: 'txtRemarks' + j, id: 'txtRemarks' + j,
name: 'txtRemarks'+ j, name: 'txtRemarks'+ j,
}).appendTo('form'); }).appendTo('form');
});
}); });
});
function isNumberKey(evt) function isNumberKey(evt)
{ {
var charCode = (evt.which) ? evt.which : evt.keyCode; var charCode = (evt.which) ? evt.which : evt.keyCode;
if (charCode != 46 && charCode > 31 if (charCode != 46 && charCode > 31
&& (charCode < 48 || charCode > 57)) && (charCode < 48 || charCode > 57))
return false; return false;
return true; return true;
} }
var index = '1'; var index = '1';
var userid = ''; var userid = '';
function SaveIssueQuantity(RowId,ReqQty,Issued) function SaveIssueQuantity(RowId,ReqQty,Issued)
{ {
//alert(Issued);
var qty = $("#issuedQuantity"+RowId).val(); var qty = $("#issuedQuantity"+RowId).val();
var maxqty=ReqQty-Issued; var maxqty=ReqQty-Issued;
//alert(qty);
if( qty != '') if( qty != '')
{ {
if(qty <= (ReqQty-Issued) ) if(qty <= (ReqQty-Issued) )
@ -355,16 +309,17 @@ function SaveIssueQuantity(RowId,ReqQty,Issued)
} }
else else
{ {
alert('The Issued Quantity cannot be more than the Requested Quantity, Already Distributed Quantity is ' +Issued+ 'Maximun Qty can enter is '+maxqty); swal('The Issued Quantity cannot be more than the Requested Quantity, Already Distributed Quantity is ' +Issued+ 'Maximun Qty can enter is '+maxqty);
$("#issuedQuantity"+RowId).focus(); $("#issuedQuantity"+RowId).focus();
$("#issuedQuantity"+RowId).val(''); $("#issuedQuantity"+RowId).val('');
return false; return false;
} }
} }
} }
function SaveRemarks(RowId) function SaveRemarks(RowId)
{ {
var remks = $("#Comments"+RowId).val(); var remks = $("#Comments"+RowId).val();
if( remks != '') if( remks != '')
{ {
@ -375,11 +330,7 @@ function SaveRemarks(RowId)
function Save(status) function Save(status)
{ {
//alert($(json.stringify(MaterialCode).val());
var txtRowCount= $('#txtRowCount').val(); var txtRowCount= $('#txtRowCount').val();
//var mat = $('#MaterialCode'+txtRowCount).val();
if(status == '0') if(status == '0')
{ {
stat = '<?php echo STORE_DRAFT; ?>'; stat = '<?php echo STORE_DRAFT; ?>';
@ -390,11 +341,7 @@ else
} }
$('#txtStatus').val(stat); $('#txtStatus').val(stat);
var id=$('#txtStatus').val(); var id=$('#txtStatus').val();
var RequestedBy=$('#RequestedBy').val(); var RequestedBy=$('#RequestedBy').val();
var CostCenter=$('#CostCenter').val(); var CostCenter=$('#CostCenter').val();
var splitDepCode= $('#DepartmentName').val(); var splitDepCode= $('#DepartmentName').val();
@ -404,74 +351,81 @@ else
{ {
if(document.getElementById('mytable').rows.length < 0) if(document.getElementById('mytable').rows.length < 0)
{ {
alert('Please Select Line item to Store Requisition'); swal('Please Select Line item to Store Requisition');
$('#Deliverydt').focus(); $('#Deliverydt').focus();
return false; return false;
} }
else else
{ {
console.log($('.requistion').serialize());
console.log($('.requistion').serialize());
$('#content').loader('show'); $('#content').loader('show');
$.ajax({ $.ajax({
data:$('.requistion').serialize(), data:$('.requistion').serialize(),
type:"POST", type:"POST",
url:"<?php echo base_url() ?>storerequisitionlist/EditStoreRequisitions?ID="+id+"&RequestedBy="+RequestedBy+"&CostCenter="+CostCenter+"&DEPCode="+DEPCode+"&txtRowCount="+txtRowCount, url:"<?php echo base_url() ?>storerequisitionlist/EditStoreRequisitions?ID="+id+"&RequestedBy="+RequestedBy+"&CostCenter="+CostCenter+"&DEPCode="+DEPCode+"&txtRowCount="+txtRowCount,
success:function(data) { success:function(data) {
if(data) if(data)
{ {
$('#content').loader('hide'); $('#content').loader('hide');
alert(data); swal(data);
$('#txtRowCount').val(''); $('#txtRowCount').val('');
$('#txtDeletedRow').val(''); $('#txtDeletedRow').val('');
//window.location = "storerequisitionlist";
//window.location = "storerequisitionlist";
} }
else else
{ {
alert("Error");
swal("Error");
} }
} }
}); });
}
}
}
}
}
}
function validate() function validate()
{ {
if($("option:selected", $("#CostCenter")).val() == '-1') if($("option:selected", $("#CostCenter")).val() == '-1')
{ {
alert('Please Select CostCenter');
return false;
}
swal('Please Select CostCenter');
return false;
}
else if($("option:selected", $("#MaterialCode")).val() == '-1') else if($("option:selected", $("#MaterialCode")).val() == '-1')
{ {
alert('Please Select MaterialCode');
swal('Please Select MaterialCode');
return false; return false;
} }
else if(document.getElementById('mytable').rows.length < 1) else if(document.getElementById('mytable').rows.length < 1)
{ {
alert('Please Add Line Item');
swal('Please Add Line Item');
return false; return false;
} }
else if(isExceed == 1) else if(isExceed == 1)
{ {
alert('You dont have Budget and You cant Raise New StoreRequisition');
swal('You dont have Budget and You cant Raise New StoreRequisition');
return false; return false;
} }
else else
{ {
return true; return true;
} }
} }
@ -479,14 +433,16 @@ function Redirect()
{ {
window.location = "storerequisition"; window.location = "storerequisition";
} }
</script> </script>
<script> <script>
$(function () { $(function () {
$('#Items').DataTable({ $('#Items').DataTable({
"paging": true, "paging": true,
"lengthChange": true, "lengthChange": true,
"searching": true, "searching": true,
@ -496,4 +452,5 @@ function Redirect()
}); });
}); });
</script> </script>

View File

@ -324,13 +324,13 @@ function validate()
if (Noval == 0 ) if (Noval == 0 )
{ {
alert('Actual Quantity is Empty.Please Enter the value'); swal('Actual Quantity is Empty.Please Enter the value');
return false; return false;
} }
else if(isExceed == 1 ){ else if(isExceed == 1 ){
alert("Actual Quantity is exceeding the Invoice Quantity.Please adjust for further Process ") swal("Actual Quantity is exceeding the Invoice Quantity.Please adjust for further Process ")
return false; return false;
} }
else else
@ -353,7 +353,7 @@ function setactual(rowId)
if(InvoiceQty < actual) if(InvoiceQty < actual)
{ {
alert("Actual Quantity is exceeding the Invoice Quantity.Please change the Actual Quantity ") swal("Actual Quantity is exceeding the Invoice Quantity.Please change the Actual Quantity ")
$("#ActualQuantity"+rowId).focus(); $("#ActualQuantity"+rowId).focus();
$("#ActualQuantity"+rowId).val(''); $("#ActualQuantity"+rowId).val('');
@ -386,13 +386,13 @@ function setremark(rowId)
if(data){ if(data){
$("#content").load('hide'); $("#content").load('hide');
alert(data); swal(data);
window.location ="viewmaterialinspectionreport"; window.location ="viewmaterialinspectionreport";
} }
else else
{ {
alert("Error"); swal("Error");
} }

View File

@ -1235,7 +1235,9 @@
<label>Date</label> <label>Date</label>
<div class="form-group"> <div class="form-group">
<?php <?php
$date = date('d-m-Y');
$dt = new DateTime('now', new DateTimeZone('Asia/Kolkata'));
$date = $dt->format('d-m-Y');
$data = array('name' => 'date','value' => set_value('date',$date),'id'=>'date', 'class' => 'form-control' ,'readonly' => 'true'); $data = array('name' => 'date','value' => set_value('date',$date),'id'=>'date', 'class' => 'form-control' ,'readonly' => 'true');
echo form_input($data); echo form_input($data);
?> ?>

View File

@ -14,17 +14,9 @@ if(!empty($companyinfo))
?> ?>
<style>
@page { margin: 298px 25px 30px 25px; }
.header { position: fixed; left: 0px; top: -280px; right: 0px; height: 500px;text-align: center; }
.footer { position: fixed; bottom: 0px;}
.pagenum:before { content: counter(page); }
</style>
<body style="font-family: sans-serif;">
<div class="footer" style="font-size:12px;">
Page: <span class="pagenum"></span> <body style="font-family: sans-serif;">
</div>
<div class="header"> <div class="header">
<div style="text-align: left;"> <div style="text-align: left;">

View File

@ -203,7 +203,7 @@
<td style="text-align: center;border-right: 1px solid black; <td style="text-align: center;border-right: 1px solid black;
border-left: 1px solid black;"><span style="padding-left: 2px;"><?php echo $record->MaterialCode ; ?></span></td> border-left: 1px solid black;"><span style="padding-left: 2px;"><?php echo $record->MaterialCode ; ?></span></td>
<td style="text-align: center;border-right: 1px solid black; <td style="text-align: center;border-right: 1px solid black;
border-left: 1px solid black;"><span style="padding-left: 2px;"><?php echo $record->MaterialName ; ?></span></td> border-left: 1px solid black;"><span style="padding-left: 2px;"><?php echo $record->MaterialName.$record->ServiceMaterialDescription ; ?></span></td>
<td style="text-align: center;border-right: 1px solid black; <td style="text-align: center;border-right: 1px solid black;
border-left: 1px solid black;"><?php if(!empty($record->HSNCODE)){echo $record->HSNCODE;}else{echo "NIL";} ; ?></td> border-left: 1px solid black;"><?php if(!empty($record->HSNCODE)){echo $record->HSNCODE;}else{echo "NIL";} ; ?></td>
<td style="text-align: center;border-right: 1px solid black; <td style="text-align: center;border-right: 1px solid black;

View File

@ -1,159 +1,318 @@
<?php <?php
$DraftCount =0; $DraftCount =0;
$StoreReqNo = ''; $StoreReqNo = '';
//echo $StoreReqNo; //echo $StoreReqNo;
if(!empty($Store)) if(!empty($Store))
{ {
foreach ($Store as $St) foreach ($Store as $St)
{ {
if ($St->StatusName=='DRAFT') if ($St->StatusName=='DRAFT')
{ {
$DraftCount++; $DraftCount++;
$StoreReqNo = $St->StoreReqNo; $StoreReqNo = $St->StoreReqNo;
}
} }
}
//echo $StoreReqNo; //echo $StoreReqNo;
}?> }?>
<style> <style>
span.highlight { span.highlight {
background-color: yellow; background-color: yellow;
} }
</style> </style>
<div class="content-wrapper"> <div class="content-wrapper">
<section class="content"> <section class="content">
<div class="row"> <div class="row">
<div class="col-xs-12"> <div class="col-xs-12">
<div class="box"> <div class="box">
<div class=" container-fluid"> <div class=" container-fluid">
<div class="box-header"> <div class="box-header">
<CENTER><h3 class="box-title">Resico Industries - Requisition Listing</h3></CENTER> <CENTER><h3 class="box-title">Resico Industries - Requisition Listing</h3></CENTER>
</div>
<?php if($DraftCount > 0 ) { ?><p>
<span class="highlight">The Store Requisition No <b><?php echo $StoreReqNo;?></b> is in Draft status.</span> Please act on the requisition.<span class="highlight">Then only you can raise New StoreRequisition. </span>
</p> <?php } ?>
<div class="row">
<div class="col-xs-12 text-right" style="margin-bottom:-3%;">
<div class="form-group">
<?php if($DraftCount == 0)
{ ?>
<a class="btn btn-primary" href="<?php echo base_url(); ?>storerequisitionlist/addstores"/>Raise Store Requisition</a><?php
}?>
</div> </div>
<?php if($DraftCount > 0 ) { ?><p>
<span class="highlight">The Store Requisition No <b><?php echo $StoreReqNo;?></b> is in Draft status.</span> Please act on the requisition.<span class="highlight">Then only you can raise New StoreRequisition. </span>
</p> <?php } ?>
<div class="row">
<div class="col-xs-12 text-right" style="margin-bottom:-3%;">
<div class="form-group">
<?php if($DraftCount == 0)
{ ?>
<a class="btn btn-primary" href="<?php echo base_url(); ?>storerequisitionlist/addstores"/>Raise Store Requisition</a><?php
}?>
</div>
</div> </div>
</div> </div>
<table id="Requisition" class="table table-bordered table-hover" style="background-color:#fff;font-size:12px;"> <table id="Requisition" class="table table-bordered table-hover" style="background-color:#fff;font-size:12px;">
<thead style="background-color:#ddf"> <thead style="background-color:#ddf">
<tr> <tr>
<th>Store Requisition No</th> <th>Store Requisition No</th>
<th>Tot No.OfLineItem </th> <th>Tot No.OfLineItem </th>
<th>Issued Item Count</th> <th>Issued Item Count</th>
<th>Pending Item Count</th> <th>Pending Item Count</th>
<th>Status</th> <th>Status</th>
<th>Requested Date</th> <th>Requested Date</th>
<th>Action</th> <th>Action</th>
</tr> </tr>
</thead> </thead>
<?php <?php
if(!empty($Store)) if(!empty($Store))
{ {
// echo "VIEW"; // echo "VIEW";
// print_r($Store); // print_r($Store);
foreach($Store as $record) foreach($Store as $record)
{ //print_r($record); { //print_r($record);
?> ?>
<tr> <tr>
<td><?php echo $record->StoreReqNo ?></td> <td><?php echo $record->StoreReqNo ?></td>
<td align="right"><?php echo $record->TotalNoofLineItems ?></td> <td align="right"><?php echo $record->TotalNoofLineItems ?></td>
<td align="right"><?php echo $record->IssuesItems ?></td> <td align="right"><?php echo $record->IssuesItems ?></td>
<td align="right"><?php echo $record->PendingItems ?></td> <td align="right"><?php echo $record->PendingItems ?></td>
<td><?php echo $record->StatusName ?></td> <td><?php echo $record->StatusName ?></td>
<td align="right"><?php $dt = new DateTime($record->ReqDate); <td align="right"><?php $dt = new DateTime($record->ReqDate);
$ReqDate = $dt->format('d-m-Y'); echo $ReqDate ?> $ReqDate = $dt->format('d-m-Y'); echo $ReqDate ?>
<td> <a data-toggle="tooltip" href="<?php echo base_url().'EditStoreRequisition?StoreReqNo='.$record->StoreReqNo; ?>"><i class="fa fa-pencil" data-toggle="tooltip" title="<?php echo $record->StoreReqNo; ?> - Click here to view addstorerequisitionslip"></i>&nbsp;&nbsp;&nbsp;</a> <a data-toggle="tooltip" onclick="DeleteRow('<?php echo $record->StoreReqNo; ?>' )" ><span class="glyphicon glyphicon-trash" title="<?php echo $record->StoreReqNo; ?> - Click here to Delete Requisition details"></span></a> </td> <td> <a data-toggle="tooltip" href="<?php echo base_url().'EditStoreRequisition?StoreReqNo='.$record->StoreReqNo; ?>"><i class="fa fa-pencil" data-toggle="tooltip" title="<?php echo $record->StoreReqNo; ?> - Click here to view addstorerequisitionslip"></i>&nbsp;&nbsp;&nbsp;</a> <a data-toggle="tooltip" onclick="DeleteRow('<?php echo $record->StoreReqNo; ?>' )" ><span class="glyphicon glyphicon-trash" title="<?php echo $record->StoreReqNo; ?> - Click here to Delete Requisition details"></span></a> </td>
</tr> </tr>
<?php <?php
} }
} }
?> ?>
</table> </table>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</section> </section>
</div> </div>
<script> <script>
function DeleteRow(rowid) function DeleteRow(rowid)
{ {
id = rowid; id = rowid;
var answer = confirm(" Do you want to delete the Requisition?") var answer = confirm(" Do you want to delete the Requisition?")
if (answer) if (answer)
{ {
$.ajax({ $.ajax({
data:{id:id}, data:{id:id},
type:"POST", type:"POST",
url:"<?php echo base_url() ?>storerequisitionlist/DeleteReqNo", url:"<?php echo base_url() ?>storerequisitionlist/DeleteReqNo",
success:function(data) { success:function(data) {
if(data) if(data)
{ {
$('#content').loader('hide'); $('#content').loader('hide');
alert(data);
swal(data);
location.reload(); location.reload();
}
else
{
alert("Error");
} }
}}); else
{
swal("Error");
} }
}});
}
} }
</script> </script>
<script> <script>
$(function () { $(function () {
$('#Requisition').DataTable({ $('#Requisition').DataTable({
"paging": true, "paging": true,
"lengthChange": true, "lengthChange": true,
"searching": true, "searching": true,
"ordering": true, "ordering": true,
"info": true, "info": true,
"autoWidth": true "autoWidth": true
}); });
}); });
</script> </script>

View File

@ -1,400 +1,800 @@
<!-- <?php <!-- <?php
$DraftCount = ''; $DraftCount = '';
$ReqNo = ''; $ReqNo = '';
if(!empty($Status)) if(!empty($Status))
{ {
foreach ($Status as $St) foreach ($Status as $St)
{ {
//$DraftCount = $St->cnt; //$DraftCount = $St->cnt;
//$ReqNo = $St->ReqNo; //$ReqNo = $St->ReqNo;
} }
//echo $ReqNo; //echo $ReqNo;
}?> --> }?> -->
<style> <style>
span.highlight { span.highlight {
background-color: yellow; background-color: yellow;
} }
</style> </style>
<div class="content-wrapper"> <div class="content-wrapper">
<section class="content"> <section class="content">
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="col-md-12">
<div class="col-md-3"> <div class="col-md-3">
<div> <div>
<?php <?php
$attributes = array('class' => 'form-label-left Storerequistion ','name' => 'Storerequistion','id' => 'Storerequistion'); $attributes = array('class' => 'form-label-left Storerequistion ','name' => 'Storerequistion','id' => 'Storerequistion');
echo form_open($this->config->base_url().'storerequisitionlist echo form_open($this->config->base_url().'storerequisitionlist
/ addstorerequisitionlist',$attributes); ?> / addstorerequisitionlist',$attributes); ?>
</div> </div>
</div> </div>
<div class="col-md-3 col-md-offset-3"> <div class="col-md-3 col-md-offset-3">
<label>&nbsp;&nbsp;</label> <label>&nbsp;&nbsp;</label>
<div class="form-group"> <div class="form-group">
<input type="hidden" name="FromDate" id="FromDate" /> <input type="hidden" name="FromDate" id="FromDate" />
<input type="hidden" name="ToDate" id="ToDate" /> <input type="hidden" name="ToDate" id="ToDate" />
<!-- <input type="Reset" class="btn btn-primary" > <!-- <input type="Reset" class="btn btn-primary" >
<!-- <button type="button" class="close" data-dismiss="modal">&times;</button> <!-- <button type="button" class="close" data-dismiss="modal">&times;</button>
<!--<a class="btn btn-info" onclick="Search()" >Search</a> --> <!--<a class="btn btn-info" onclick="Search()" >Search</a> -->
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<!-- model to show Store requisition detail --> <!-- model to show Store requisition detail -->
<div class="modal fade" id="storereqdetail" role="dialog"> <div class="modal fade" id="storereqdetail" role="dialog">
<div class="modal-dialog"> <div class="modal-dialog">
<!-- Modal content--> <!-- Modal content-->
<form> <form>
<div class="modal-content"> <div class="modal-content">
<div class="modal-header" style="background-color: #3c8dbc;color:#fff;">
<div class="modal-header" style="background-color: #5d0411;color:#fff;">
<button type="button" class="close" data-dismiss="modal">&times;</button> <button type="button" class="close" data-dismiss="modal">&times;</button>
<center><h4> Store Requisition Number Details </h4></center> <center><h4> Store Requisition Number Details </h4></center>
</div> </div>
<div align="left"> <div align="left">
<div class="col-md-12"> <div class="col-md-12">
<div class="col-md-3"> <div class="col-md-3">
<label>Requistion No</label> <label>Requistion No</label>
<div class="form-group"> <div class="form-group">
<?php <?php
$data = array('name' => 'ReqNO','value' => set_value('ReqNO'),'id'=>'ReqNO', 'class' => 'form-control' ,'readonly' => 'true'); $data = array('name' => 'ReqNO','value' => set_value('ReqNO'),'id'=>'ReqNO', 'class' => 'form-control' ,'readonly' => 'true');
echo form_input($data); echo form_input($data);
?> ?>
</div> </div>
</div> </div>
<div class="col-md-3"> <div class="col-md-3">
<label>Requested By</label> <label>Requested By</label>
<div class="form-group"> <div class="form-group">
<?php <?php
$data = array('name' => 'ReqBy','value' => set_value('ReqBy'),'id'=>'ReqBy', 'class' => 'form-control' ,'readonly' => 'true'); $data = array('name' => 'ReqBy','value' => set_value('ReqBy'),'id'=>'ReqBy', 'class' => 'form-control' ,'readonly' => 'true');
echo form_input($data); echo form_input($data);
?> ?>
</div> </div>
</div> </div>
<div class="col-md-6"> <div class="col-md-6">
<label>Department</label> <label>Department</label>
<div class="form-group"> <div class="form-group">
<?php <?php
$data = array('name' => 'Desigination','value' => set_value('Desigination'),'id'=>'Desigination', 'class' => 'form-control' ,'readonly' => 'true'); $data = array('name' => 'Desigination','value' => set_value('Desigination'),'id'=>'Desigination', 'class' => 'form-control' ,'readonly' => 'true');
echo form_input($data); echo form_input($data);
?> ?>
</div> </div>
</div> </div>
</div> </div>
<div class="col-md-12"> <div class="col-md-12">
<div class="col-md-6"> <div class="col-md-6">
<label>Requested Date</label> <label>Requested Date</label>
<div class="form-group"> <div class="form-group">
<?php <?php
$data = array('name' => 'ReqDate','value' => set_value('ReqDate'),'id'=>'ReqDate', 'class' => 'form-control' ,'readonly' => 'true'); $data = array('name' => 'ReqDate','value' => set_value('ReqDate'),'id'=>'ReqDate', 'class' => 'form-control' ,'readonly' => 'true');
echo form_input($data); echo form_input($data);
?> ?>
</div> </div>
</div> </div>
<div class="col-md-6"> <div class="col-md-6">
<label>Cost Center Name</label> <label>Cost Center Name</label>
<div class="form-group"> <div class="form-group">
<?php <?php
$data = array('name' => 'CostCenter','value' => set_value('CostCenter'),'id'=>'CostCenter', 'class' => 'form-control' ,'readonly' => 'true'); $data = array('name' => 'CostCenter','value' => set_value('CostCenter'),'id'=>'CostCenter', 'class' => 'form-control' ,'readonly' => 'true');
echo form_input($data); echo form_input($data);
?> ?>
</div> </div>
</div> </div>
<!-- <div class="col-md-4"> <!-- <div class="col-md-4">
<label>Avl Budget Amt</label>&nbsp;<img id="AlertImg" src="<?php echo base_url(); ?>assets/dist/img/red.png" alt="your image" width="25px" style="display:none"/> <label>Avl Budget Amt</label>&nbsp;<img id="AlertImg" src="<?php echo base_url(); ?>assets/dist/img/red.png" alt="your image" width="25px" style="display:none"/>
<div class="form-group"> <div class="form-group">
<?php <?php
$data = array('name' => 'AvlBudgetAmount','value' => set_value('AvlBudgetAmount'),'id'=>'AvlBudgetAmount', 'class' => 'form-control' ,'readonly' => 'true'); $data = array('name' => 'AvlBudgetAmount','value' => set_value('AvlBudgetAmount'),'id'=>'AvlBudgetAmount', 'class' => 'form-control' ,'readonly' => 'true');
echo form_input($data); echo form_input($data);
?> ?>
</div> </div>
</div> --> </div> -->
</div> </div>
<table id="Items" class="table table-bordered table-hover" style="background-color:#fff;font-size:12px;"> <table id="Items" class="table table-bordered table-hover" style="background-color:#fff;font-size:12px;">
<div align="right" style="padding-right:10px"> <div align="right" style="padding-right:10px">
<div class="modal fade" role="dialog"> <div class="modal fade" role="dialog">
<thead style="background-color:#ddf"> <thead style="background-color:#ddf">
<tr> <tr>
<th>SNo</th> <th>SNo</th>
<th>Item Code</th> <th>Item Code</th>
<th>Item Description</th> <th>Item Description</th>
<th>UOM</th> <th>UOM</th>
<th>Requested Quantity</th> <th>Requested Quantity</th>
<th>Issued Quantity</th> <th>Issued Quantity</th>
<th>Remarks</th> <th>Remarks</th>
</tr> </tr>
</thead> </thead>
<tbody id="tbleAppend"> <tbody id="tbleAppend">
</tbody> </tbody>
</div> </div>
</div> </div>
</table> </table>
<div class="modal-footer"> <div class="col-md-12"> <div class="modal-footer"> <div class="col-md-12">
<a class="btn btn-info" data-dismiss="modal" value="Cancel">Ok</a> <a class="btn btn-info" data-dismiss="modal" value="Cancel">Ok</a>
</div> </div>
</div>
</div>
</div> </div>
</div>
</div>
</form> </form>
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<div class="col-xs-12"> <div class="col-xs-12">
<div class="box"> <div class="box">
<div class=" container-fluid"> <div class=" container-fluid">
<div class="box-header"> <div class="box-header">
<CENTER><h3 class="box-title">Resico Industries - Store Requisition Listing</h3></CENTER> <CENTER><h3 class="box-title">Resico Industries - Store Requisition Listing</h3></CENTER>
</div> </div>
<table id="Requisition" class="table table-bordered table-hover editabletable" style="background-color:#fff;font-size:12px;"> <table id="Requisition" class="table table-bordered table-hover editabletable" style="background-color:#fff;font-size:12px;">
<thead style="background-color:#ddf"> <thead style="background-color:#ddf">
<tr> <tr>
<th>Store Requisition No</th> <th>Store Requisition No</th>
<th>Requested Department</th> <th>Requested Department</th>
<th>Requested By</th> <th>Requested By</th>
<th>Requested Date</th> <th>Requested Date</th>
<th>Status</th> <th>Status</th>
<th>Approver Comments</th> <th>Approver Comments</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<?php <?php
if(!empty($TotNoOfLine)) if(!empty($TotNoOfLine))
{ {
$index = 0; $index = 0;
foreach($TotNoOfLine as $record) foreach($TotNoOfLine as $record)
{ {
$index = $index +1; $index = $index +1;
?> ?>
<tr id="<?php echo $index ?>" > <tr id="<?php echo $index ?>" >
<td><a data-toggle="tooltip" href="<?php echo base_url().'storerequisitionlist/issuestorerequisition?ReqNo='.$record->StoreReqNo; ?>" title="<?php echo $record->StoreReqNo; ?> - Click here to view store Requisition details" ><u><?php echo $record->StoreReqNo ?></u></a> <td><a data-toggle="tooltip" href="<?php echo base_url().'storerequisitionlist/issuestorerequisition?ReqNo='.$record->StoreReqNo; ?>" title="<?php echo $record->StoreReqNo; ?> - Click here to view store Requisition details" ><u><?php echo $record->StoreReqNo ?></u></a>
</td> </td>
<td><?php echo $record->DepartmentName ?></td> <td><?php echo $record->DepartmentName ?></td>
<td><?php echo $record->Requestedby ?></td> <td><?php echo $record->Requestedby ?></td>
<td align="right"><?php <td align="right"><?php
$rdate = new DateTime($record->ReqDate) ; $rdate = new DateTime($record->ReqDate) ;
$ReqDate = $rdate->format('d-m-Y'); $ReqDate = $rdate->format('d-m-Y');
echo $ReqDate; ?></td> echo $ReqDate; ?></td>
<td><?php echo $record->StatusName ?></td> <td><?php echo $record->StatusName ?></td>
<td> <?php echo $record->Remarks ?></td> <td> <?php echo $record->Remarks ?></td>
</tr> </tr>
<?php <?php
} }
} }
?> ?>
</tbody> </tbody>
</table> </table>
<div id="content"></div> <div id="content"></div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</section> </section>
</div> </div>
<script> <script>
var startDate = ''; var startDate = '';
var endDate = ''; var endDate = '';
function SaveIssueQuantity(rowid) function SaveIssueQuantity(rowid)
{ {
var IssueQty = $("#IssuedQuantity"+RowId).val(); var IssueQty = $("#IssuedQuantity"+RowId).val();
if( IssueQty != '') if( IssueQty != '')
{ {
$('#content').loader('show'); $('#content').loader('show');
$.ajax({ $.ajax({
data:{id:IssueQty}, data:{id:IssueQty},
type:"POST", type:"POST",
url:"<?php echo base_url() ?>storerequisitionlist/SaveIssuedQuantity", url:"<?php echo base_url() ?>storerequisitionlist/SaveIssuedQuantity",
success:function(data) { success:function(data) {
$('#content').loader('hide'); $('#content').loader('hide');
alert(data); alert(data);
location.reload(); location.reload();
} }
}); });
} }
} }
function Reset() function Reset()
{ {
$('#RequisitionStatus').val("-1"); $('#RequisitionStatus').val("-1");
$('#SearchDate').val(''); $('#SearchDate').val('');
} }
$("#storereqdetail").on("shown.bs.modal", function(e) { $("#storereqdetail").on("shown.bs.modal", function(e) {
var ReqId = $(e.relatedTarget).data('userid'); var ReqId = $(e.relatedTarget).data('userid');
$('#ReqNO').val(ReqId); $('#ReqNO').val(ReqId);
$("#CostCenter").val(''); $("#CostCenter").val('');
$("#tbleAppend").empty(); $("#tbleAppend").empty();
$("#ReqDate").val(''); $("#ReqDate").val('');
$("#Desigination").val(''); $("#Desigination").val('');
$('#content').loader('show'); $('#content').loader('show');
$.ajax({ $.ajax({
data:{id:ReqId}, data:{id:ReqId},
type:"POST", type:"POST",
dataType: 'json', dataType: 'json',
url:"<?php echo base_url() ?>storerequisitionlist/ViewRequest", url:"<?php echo base_url() ?>storerequisitionlist/ViewRequest",
success:function(json) { success:function(json) {
// success:function(data) { // success:function(data) {
$('#content').loader('hide'); $('#content').loader('hide');
// alert(data) ; // alert(data) ;
$("#ReqBy").val(json.Requist[0]['Requestedby']); $("#ReqBy").val(json.Requist[0]['Requestedby']);
$("#ReqDate").val(json.Requist[0]['ReqDate']); $("#ReqDate").val(json.Requist[0]['ReqDate']);
$("#Desigination").val(json.Requist[0]['DepartmentName']); $("#Desigination").val(json.Requist[0]['DepartmentName']);
$("#CostCenter").val(json.Requist[0]['CostCenterName']); $("#CostCenter").val(json.Requist[0]['CostCenterName']);
$("#tbleAppend").append(json.Items); $("#tbleAppend").append(json.Items);
} }
});
}); });
});
</script> </script>
<script> <script>
function DeleteRow(rowid) function DeleteRow(rowid)
{ {
id = rowid; id = rowid;
var answer = confirm(" Do you want to delete the Requisition?") var answer = confirm(" Do you want to delete the Requisition?")
if (answer) if (answer)
{ {
$.ajax({ $.ajax({
data:{id:id}, data:{id:id},
type:"POST", type:"POST",
url:"<?php echo base_url() ?>storerequisitionlist/DeleteReqNo", url:"<?php echo base_url() ?>storerequisitionlist/DeleteReqNo",
success:function(data) { success:function(data) {
if(data) if(data)
{ {
$('#content').loader('hide'); $('#content').loader('hide');
alert(data); alert(data);
location.reload(); location.reload();
}
else
{
alert("Error");
} }
}}); else
{
alert("Error");
} }
}});
}
} }
</script> </script>
<script> <script>
$(function() { $(function() {
var d = new Date(); var d = new Date();
var month = d.getMonth(); var month = d.getMonth();
var day = d.getDate(); var day = d.getDate();
var year = d.getFullYear() ; var year = d.getFullYear() ;
var SIAStartYear = year - 2015; var SIAStartYear = year - 2015;
var mindt = year-70; var mindt = year-70;
var maxdt = year-15; var maxdt = year-15;
$( ".datePicker" ).datepicker( $( ".datePicker" ).datepicker(
{ {
minDate : new Date(year-SIAStartYear,1,1), minDate : new Date(year-SIAStartYear,1,1),
maxDate :'now', maxDate :'now',
dateFormat: 'mm/dd/yy',changeMonth: true, changeYear: true, dateFormat: 'mm/dd/yy',changeMonth: true, changeYear: true,
} }
); );
//$('#SearchDate').daterangepicker( ); //$('#SearchDate').daterangepicker( );
//Initialize Select2 Elements //Initialize Select2 Elements
$(".select2").select2(); $(".select2").select2();
//$('#SearchDate').val(''); //$('#SearchDate').val('');
$('#SearchDate').daterangepicker( $('#SearchDate').daterangepicker(
{ {
locale: { locale: {
format: 'DD-MM-YYYY' format: 'DD-MM-YYYY'
}, },
showDropdowns: true showDropdowns: true
}, },
function(start, end, label) { function(start, end, label) {
startDate = start.format('DD-MM-YYYY'); startDate = start.format('DD-MM-YYYY');
endDate = end.format('DD-MM-YYYY'); endDate = end.format('DD-MM-YYYY');
$('#FromDate').val(startDate); $('#FromDate').val(startDate);
$('#ToDate').val(endDate); $('#ToDate').val(endDate);
//alert("A new date range was chosen: " + start.format('DD-MM-YYYY') + ' to ' + end.format('DD-MM-YYYY')); //alert("A new date range was chosen: " + start.format('DD-MM-YYYY') + ' to ' + end.format('DD-MM-YYYY'));
}); });
}); });
$(function () { $(function () {
$('#Requisition').DataTable({ $('#Requisition').DataTable({
"paging": true, "paging": true,
"lengthChange": true, "lengthChange": true,
"searching": true, "searching": true,
"ordering": true, "ordering": true,
"info": true, "info": true,
"autoWidth": true "autoWidth": true
}); });
}); });
</script> </script>

View File

@ -8,28 +8,39 @@
</style> </style>
<div class="content-wrapper"> <div class="content-wrapper">
<?php <?php
$attributes = array('class' => 'form-label-left StoreStock ','name' => 'StoreStock','id' => 'StoreStock','method' => 'post','role' => 'form' );
$attributes = array('class' => 'form-label-left StoreStock ','name' => 'StoreStock','id' => 'StoreStock','method' => 'post','role' => 'form' );
echo form_open($this->config->base_url().'purchaseorderform/purchaseorder',$attributes); ?> echo form_open($this->config->base_url().'purchaseorderform/purchaseorder',$attributes); ?>
<section class="content"> <section class="content">
<div class="box"> <div class="box">
<div class="container-fluid"> <div class="container-fluid">
<div class="box-header"> <div class="box-header">
<CENTER><h3 class="box-title">Resico Industries - Stock Details</h3></CENTER> <CENTER><h3 class="box-title">Resico Industries - Stock Details</h3></CENTER>
</div> </div>
<div align="right"> <div align="right">
<!-- Trigger the modal with a button to add Item--> <!-- Trigger the modal with a button to add Item-->
<button type="button" class="btn btn-primary" data-toggle="modal" data-target="#AddItemModel">Add Stock Item</button> <button type="button" class="btn btn-primary" data-toggle="modal" data-target="#AddItemModel">Add Stock Item</button>
</div> </div>
<!-- Start of Modal --> <!-- Start of Modal -->
<div id="AddItemModel" class="modal fade" role="dialog"> <div id="AddItemModel" class="modal fade" role="dialog">
<div class="modal-dialog"> <div class="modal-dialog">
<!-- Modal content--> <!-- Modal content-->
<div class="modal-content"> <div class="modal-content">
<div class="modal-header" style="background-color: #5d0411;color:#fff;"> <div class="modal-header" style="background-color: #5d0411;color:#fff;">
<button type="button" class="close" data-dismiss="modal">&times;</button> <button type="button" class="close" data-dismiss="modal">&times;</button>
@ -41,23 +52,15 @@
<label>Material Code</label> <label>Material Code</label>
<div > <div >
<?php <?php
$options = array("0"=>'Material Code'); $options = array("0"=>'Material Code');
//print_r( $options); if(!empty($MaterialList))
{
if(!empty($MaterialList)) foreach ($MaterialList as $MID):
{ $options[$MID->MaterialCode] = $MID->MaterialCode.' '.' - '.' '.$MID->MaterialName;
endforeach;
foreach ($MaterialList as $MID): }
echo form_dropdown('MaterialCode', $options,set_value('MaterialCode'),'id="MaterialCode"' ,'class = "form-control select2"');
?>
$options[$MID->MaterialCode] = $MID->MaterialCode.' '.' - '.' '.$MID->MaterialName;
endforeach;
}
echo form_dropdown('MaterialCode', $options,set_value('MaterialCode'),'id="MaterialCode"' ,'class = "form-control select2"');
?>
</div> </div>
</div> </div>
@ -70,6 +73,7 @@
?> ?>
</div> </div>
</div> </div>
<div class="col-md-6"> <div class="col-md-6">
<label>UOM</label> <label>UOM</label>
<div> <div>
@ -77,9 +81,9 @@
$data = array('name' => 'UOM','value' => set_value('UOM'),'id'=>'UOM', 'class' => 'form-control','readonly' => 'true' ); $data = array('name' => 'UOM','value' => set_value('UOM'),'id'=>'UOM', 'class' => 'form-control','readonly' => 'true' );
echo form_input($data); echo form_input($data);
?> ?>
</div> </div>
</div> </div>
<div class="col-md-6"> <div class="col-md-6">
<label>Available Stock</label> <label>Available Stock</label>
<div class="form-group"> <div class="form-group">
@ -89,29 +93,23 @@
?> ?>
</div> </div>
</div> </div>
<div class="col-md-6"> <div class="col-md-6">
<label>Stock Availablity</label> <label>Stock Availablity</label>
<div > <div>
<?php <?php
$options = array(); $options = array();
//print_r( $options);
if(!empty($StockStatus)) if(!empty($StockStatus))
{ {
foreach ($StockStatus as $MID): foreach ($StockStatus as $MID):
$options[$MID->ConfigValue] = $MID->ConfigValue; $options[$MID->ConfigValue] = $MID->ConfigValue;
endforeach; endforeach;
} }
echo form_dropdown('StockAvail', $options,set_value('StockAvail','YES'),'id="StockAvail"' ,'class="form-control"'); echo form_dropdown('StockAvail', $options,set_value('StockAvail','YES'),'id="StockAvail"' ,'class="form-control"');
?> ?>
</div> </div>
</div> </div>
<div class="col-md-6"> <div class="col-md-6">
<label>Remarks</label> <label>Remarks</label>
<div class="form-group"> <div class="form-group">
@ -122,48 +120,46 @@
</div> </div>
</div> </div>
</div>
</div>
<div class="modal-footer"> <div class="modal-footer">
<a class="btn btn-primary font EditItem" onclick="AddStock();" ID="AddItem" ></i>&nbsp;&nbsp;<span class="bold">Add</span></a> <a class="btn btn-primary font EditItem" onclick="AddStock();" ID="AddItem" ></i>&nbsp;&nbsp;<span class="bold">Add</span></a>
<a class="btn btn-primary" data-dismiss="modal" onclick="cancel();" value="Cancel">cancel</a> <a class="btn btn-primary" data-dismiss="modal" onclick="cancel();" value="Cancel">cancel</a>
</div> </div>
</div></div> </div></div>
</div> </div>
<!-- End of Model --> <!-- End of Model -->
<!-- Start of Modal --> <!-- Start of Modal -->
<div id="EditItemModel" class="modal fade" role="dialog"> <div id="EditItemModel" class="modal fade" role="dialog">
<div class="modal-dialog"> <div class="modal-dialog">
<!-- Modal content--> <!-- Modal content-->
<div class="modal-content"> <div class="modal-content">
<div class="modal-header" style="background-color: #5d0411;color:#fff;"> <div class="modal-header" style="background-color: #3c8dbc;color:#fff;">
<button type="button" class="close" data-dismiss="modal">&times;</button> <button type="button" class="close" data-dismiss="modal">&times;</button>
<center><h4>Edit Stock Item </h4></center> <center><h4>Edit Stock Item </h4></center>
</div> </div>
<div align="left">
<div align="left">
<div class="col-md-6"> <div class="col-md-6">
<label>Material Code</label> <label>Material Code</label>
<div> <div>
<?php <?php
$options = array("0"=>'Material Code'); $options = array("0"=>'Material Code');
//print_r( $options);
if(!empty($MaterialList)) if(!empty($MaterialList))
{ {
foreach ($MaterialList as $MID): foreach ($MaterialList as $MID):
$options[$MID->MaterialCode] = $MID->MaterialCode.' '.' - '.' '.$MID->MaterialName; $options[$MID->MaterialCode] = $MID->MaterialCode.' '.' - '.' '.$MID->MaterialName;
endforeach; endforeach;
} }
$data = array('name' => 'EditMaterialCode','value' => set_value('EditMaterialCode'),'id'=>'EditMaterialCode', 'class' => 'form-control','readonly' => 'true' ); $data = array('name' => 'EditMaterialCode','value' => set_value('EditMaterialCode'),'id'=>'EditMaterialCode', 'class' => 'form-control','readonly' => 'true' );
echo form_input($data); echo form_input($data);
?> ?>
</div> </div>
</div> </div>
@ -177,6 +173,7 @@
?> ?>
</div> </div>
</div> </div>
<div class="col-md-6"> <div class="col-md-6">
<label>UOM</label> <label>UOM</label>
<div> <div>
@ -184,9 +181,9 @@
$data = array('name' => 'EditUOM','value' => set_value('EditUOM'),'id'=>'EditUOM', 'class' => 'form-control','readonly' => 'true' ); $data = array('name' => 'EditUOM','value' => set_value('EditUOM'),'id'=>'EditUOM', 'class' => 'form-control','readonly' => 'true' );
echo form_input($data); echo form_input($data);
?> ?>
</div> </div>
</div> </div>
<div class="col-md-6"> <div class="col-md-6">
<label>Available Stock</label> <label>Available Stock</label>
<div class="form-group"> <div class="form-group">
@ -196,29 +193,23 @@
?> ?>
</div> </div>
</div> </div>
<div class="col-md-6"> <div class="col-md-6">
<label>Stock Availablity</label> <label>Stock Availablity</label>
<div > <div>
<?php <?php
$options = array(); $options = array();
//print_r( $options);
if(!empty($StockStatus)) if(!empty($StockStatus))
{ {
foreach ($StockStatus as $MID): foreach ($StockStatus as $MID):
$options[$MID->ConfigValue] = $MID->ConfigValue; $options[$MID->ConfigValue] = $MID->ConfigValue;
endforeach; endforeach;
} }
echo form_dropdown('EditStockAvail', $options,set_value('EditStockAvail'),'id="EditStockAvail"' ,'class="form-control select2"'); echo form_dropdown('EditStockAvail', $options,set_value('EditStockAvail'),'id="EditStockAvail"' ,'class="form-control select2"');
?> ?>
</div> </div>
</div> </div>
<div class="col-md-6"> <div class="col-md-6">
<label>Remarks</label> <label>Remarks</label>
<div class="form-group"> <div class="form-group">
@ -237,13 +228,19 @@
</div> </div>
</div></div> </div></div>
</div> </div>
<!-- End of Model --> <!-- End of Model -->
<!-- Start of Modal --> <!-- Start of Modal -->
<div id="ViewHistory" class="modal fade" role="dialog"> <div id="ViewHistory" class="modal fade" role="dialog">
<div class="modal-dialog"> <div class="modal-dialog">
<!-- Modal content--> <!-- Modal content-->
<div class="modal-content"> <div class="modal-content">
<div class="modal-header" style="background-color: #5d0411;color:#fff;"> <div class="modal-header" style="background-color: #5d0411;color:#fff;">
<button type="button" class="close" data-dismiss="modal">&times;</button> <button type="button" class="close" data-dismiss="modal">&times;</button>
@ -252,15 +249,15 @@
Material Name : <label style="font-size:15px;" id="materialNamedetails" >Default</label></br> Material Name : <label style="font-size:15px;" id="materialNamedetails" >Default</label></br>
UOM : <label style="font-size:15px;" id="materialUOMDetails" >Default</label> </br> UOM : <label style="font-size:15px;" id="materialUOMDetails" >Default</label> </br>
</div> </div>
<div align="left"> <div align="left">
<table id="ViewHistoryTable" class="table table-bordered table-hover" style="font-size:12px;"> <table id="ViewHistoryTable" class="table table-bordered table-hover" style="font-size:12px;">
<div class="modal fade" role="dialog"> <div class="modal fade" role="dialog">
<thead style="background-color:#ddf"> <thead style="background-color:#ddf">
<tr> <tr>
<th>SNo.</th> <th>SNo.</th>
<th>Available Stock</th> <th>Available Stock</th>
<th>Updated Stock</th> <th>Updated Stock</th>
@ -268,29 +265,29 @@
<th>Remarks</th> <th>Remarks</th>
</tr> </tr>
</thead> </thead>
<tbody id="tblAppend"> <tbody id="tblAppend">
</tbody> </tbody>
</table> </table>
</div> </div>
<div class="modal-footer"> <div class="modal-footer">
<a class="btn btn-primary" data-dismiss="modal" onclick="cancel();" value="Cancel">OK</a> <a class="btn btn-primary" data-dismiss="modal" onclick="cancel();" value="Cancel">OK</a>
</div> </div>
</div></div> </div></div>
</div> </div>
<table id="storestatuslisting" class="table table-bordered table-hover editableTable" style="font-size:12px;"> <table id="storestatuslisting" class="table table-bordered table-hover editableTable" style="font-size:12px;">
<div class="modal fade" role="dialog"> <div class="modal fade" role="dialog">
<thead style="background-color:#ddf"> <thead style="background-color:#ddf">
<tr> <tr>
<th>SNo.</th> <th>SNo.</th>
<th>Material Code</th> <th>Material Code</th>
<th>Material Name</th> <th>Material Name</th>
@ -300,108 +297,123 @@
<th>Updated On</th> <th>Updated On</th>
<th>Remarks</th> <th>Remarks</th>
<th>View History</th> <th>View History</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<?php if(!empty($Stock)) <?php if(!empty($Stock))
{ {
$index = 0; $index = 0;
foreach($Stock as $record) foreach($Stock as $record)
{ {
$index = $index + 1; $index = $index + 1;
?> ?>
<tr id="<?php echo $index ; ?>">
<td align="left"><?php echo $index ; ?></td>
<tr id="<?php echo $index ; ?>">
<td align="left"><?php echo $index ; ?></td>
<td align="left"><a data-toggle="modal" data-target="#EditItemModel" data-id="<%=index%>" data-userid="<?php echo $index ?>" > <u><?php echo $record->MaterialCode ?></u></a></td> <td align="left"><a data-toggle="modal" data-target="#EditItemModel" data-id="<%=index%>" data-userid="<?php echo $index ?>" > <u><?php echo $record->MaterialCode ?></u></a></td>
<td align="left"><?php echo $record->MaterialName ; ?></td> <td align="left"><?php echo $record->MaterialName ; ?></td>
<td align="left"><?php echo $record->UOM ; ?></td> <td align="left"><?php echo $record->UOM ; ?></td>
<td align="right"><?php echo $record->Quantity ; ?> <td align="right"><?php echo $record->Quantity ; ?></td>
</td>
<td align="left"><?php $St = 'In Stock'; if($record->Status == 1 ) { <td align="left"><?php $St = 'In Stock'; if($record->Status == 1 ) {
$St = 'Out of Stock'; $St = 'Out of Stock';
} echo $St ; ?></td> } echo $St ; ?></td>
<td align="right"><?php <td align="right"><?php
$dt = new DateTime($record->updatedOn );
$dt = new DateTime($record->updatedOn ); $updatedOn = $dt->format('d-m-Y');
$updatedOn = $dt->format('d-m-Y');
echo $updatedOn ; ?></td> echo $updatedOn ; ?></td>
<td><?php echo $record->storeremarks ; ?>
<td><?php echo $record->storeremarks ; ?></td>
</td>
<td> <a data-toggle="modal" data-target="#ViewHistory" data-id="<%=index%>" data-userid="<?php echo $index ?>"><i class="fa fa-eye" data-toggle="tooltip" title="<?php echo $record->MaterialCode; ?> - Click here to view the History of Stock details"></i>&nbsp;&nbsp;&nbsp;</a></td> <td> <a data-toggle="modal" data-target="#ViewHistory" data-id="<%=index%>" data-userid="<?php echo $index ?>"><i class="fa fa-eye" data-toggle="tooltip" title="<?php echo $record->MaterialCode; ?> - Click here to view the History of Stock details"></i>&nbsp;&nbsp;&nbsp;</a></td>
</tr>
<?php }
?>
</tr>
<?php } ?>
<?php <?php
}?> }?>
</tbody> </tbody>
</table> </table>
</div> </div>
</div> </div>
</div> </div>
<div id="content"></div> <div id="content"></div>
</section> </section>
</div> </div>
<script>
$(function() {
<script>
$(function() {
//Initialize Select2 Elements //Initialize Select2 Elements
// $(".select2").select2(); // $(".select2").select2();
$('#MaterialCode').change(function() { $('#MaterialCode').change(function() {
var id = $('#MaterialCode').val(); var id = $('#MaterialCode').val();
$("#Description").val(''); $("#Description").val('');
$("#UOM").val(''); $("#UOM").val('');
if(id != '-1') if(id != '-1')
{ {
$('#content').loader('show'); $('#content').loader('show');
$.ajax({ $.ajax({
data:{id:id}, data:{id:id},
dataType: 'json', dataType: 'json',
type:"POST", type:"POST",
url:"<?php echo base_url();?>requisitionform/getMaterialDetails", url:"<?php echo base_url();?>requisitionform/getMaterialDetails",
success:function(json) { success:function(json) {
$('#content').loader('hide');
$('#content').loader('hide');
$("#Description").val(json.MatDetail[0]['MaterialName']); $("#Description").val(json.MatDetail[0]['MaterialName']);
$("#UOM").val(json.MatDetail[0]['UOM']); $("#UOM").val(json.MatDetail[0]['UOM']);
} }
}); });
} }
else else
{ {
alert('Please select the MaterialCode');
swal('Please select the MaterialCode');
return false; return false;
} }
}); });
});
});
</script> </script>
<script> <script>
function isNumberKey(evt) function isNumberKey(evt)
{ {
var charCode = (evt.which) ? evt.which : evt.keyCode;
if (charCode != 46 && charCode > 31
&& (charCode < 48 || charCode > 57))
return false;
var charCode = (evt.which) ? evt.which : evt.keyCode;
if (charCode != 46 && charCode > 31 && (charCode < 48 || charCode > 57))
return false;
return true; return true;
} }
$("#ViewHistory").on("shown.bs.modal", function(e) { $("#ViewHistory").on("shown.bs.modal", function(e) {
var rowid = $(e.relatedTarget).data('userid'); var rowid = $(e.relatedTarget).data('userid');
var tr= document.getElementById(rowid); var tr= document.getElementById(rowid);
@ -410,30 +422,40 @@ $("#UOM").val('');
var materialDescription = cellval[2].innerText; var materialDescription = cellval[2].innerText;
var MaterialUOM = cellval[3].innerText; var MaterialUOM = cellval[3].innerText;
document.getElementById('materialCodeDetails').innerHTML=materialCode; document.getElementById('materialCodeDetails').innerHTML=materialCode;
document.getElementById('materialNamedetails').innerHTML=materialDescription; document.getElementById('materialNamedetails').innerHTML=materialDescription;
document.getElementById('materialUOMDetails').innerHTML=MaterialUOM; document.getElementById('materialUOMDetails').innerHTML=MaterialUOM;
$('#content').loader('show'); $('#content').loader('show');
$.ajax({ $.ajax({
data:{id:materialCode}, data:{id:materialCode},
type:"POST", type:"POST",
dataType: 'json', dataType: 'json',
url:"<?php echo base_url() ?>storestatus/viewStockHistory", url:"<?php echo base_url() ?>storestatus/viewStockHistory",
success:function(json) { success:function(json) {
// success:function(data) { // success:function(data) {
$('#content').loader('hide'); $('#content').loader('hide');
//alert(json.AvalStock); //alert(json.AvalStock);
$("#tblAppend").append(json.History); $("#tblAppend").append(json.History);
} }
}); });
}); });
$("#EditItemModel").on("shown.bs.modal", function(e) { $("#EditItemModel").on("shown.bs.modal", function(e) {
var rowid = $(e.relatedTarget).data('userid'); var rowid = $(e.relatedTarget).data('userid');
var tr= document.getElementById(rowid); var tr= document.getElementById(rowid);
var cellval = tr.cells; var cellval = tr.cells;
@ -441,6 +463,7 @@ $("#UOM").val('');
$('#EditDescription').val(cellval[2].innerText); $('#EditDescription').val(cellval[2].innerText);
$('#EditUOM').val(cellval[3].innerText); $('#EditUOM').val(cellval[3].innerText);
$('#EditAvailableStock').val(cellval[4].innerText); $('#EditAvailableStock').val(cellval[4].innerText);
if(cellval[5].innerText == 'In Stock') if(cellval[5].innerText == 'In Stock')
{ {
$('#EditStockAvail').val('YES'); $('#EditStockAvail').val('YES');
@ -451,15 +474,14 @@ $("#UOM").val('');
} }
$('#EditRemarks').val(cellval[7].innerText); $('#EditRemarks').val(cellval[7].innerText);
}); });
function AddStock() function AddStock()
{ {
id= $('#MaterialCode').val();
id= $('#MaterialCode').val();
if(validate()) if(validate())
{ {
$('#content').loader('show'); $('#content').loader('show');
$.ajax({ $.ajax({
data:$('.StoreStock').serialize(), data:$('.StoreStock').serialize(),
@ -469,30 +491,25 @@ $("#UOM").val('');
if(data) if(data)
{ {
$('#content').loader('hide'); $('#content').loader('hide');
alert(data); swal(data);
$('#MaterialCode option[value='+id+']').remove(); $('#MaterialCode option[value='+id+']').remove();
clearLineitemData(); clearLineitemData();
} }
else else
{ {
alert("Error"); swal("Error");
} }
} }
}); });
} }
} }
function EditStock() function EditStock()
{ {
if(Editvalidate()) if(Editvalidate())
{ {
$('#content').loader('show'); $('#content').loader('show');
$.ajax({ $.ajax({
data:$('.StoreStock').serialize(), data:$('.StoreStock').serialize(),
@ -502,81 +519,82 @@ function EditStock()
if(data) if(data)
{ {
$('#content').loader('hide'); $('#content').loader('hide');
alert(data); swal(data);
window.location = "Stock"; window.location = "Stock";
} }
else else
{ {
alert("Error"); swal("Error");
} }
} }
}); });
} }
} }
function Editvalidate() function Editvalidate()
{ {
if($("#EditAvailableStock").val().length < 1) if($("#EditAvailableStock").val().length < 1)
{ {
alert('Please Add Available Stock'); swal('Please Add Available Stock');
$("#EditAvailableStock").focus(); $("#EditAvailableStock").focus();
return false; return false;
} }
else else
{ {
return true; return true;
} }
} }
function cancel() function cancel()
{ {
window.location = "Stock"; window.location = "Stock";
} }
function clearLineitemData() function clearLineitemData()
{ {
$('#Description').val(''); $('#Description').val('');
$('#UOM').val(''); $('#UOM').val('');
$('#AddAvailableStock').val(''); $('#AddAvailableStock').val('');
$('#Remarks').val(''); $('#Remarks').val('');
} }
function validate() function validate()
{ {
if($("option:selected", $("#MaterialCode")).val() == '-1' || $("#MaterialCode").val() == '0') if($("option:selected", $("#MaterialCode")).val() == '-1' || $("#MaterialCode").val() == '0')
{ {
alert('Please Select MaterialCode'); swal('Please Select MaterialCode');
$("#MaterialCode").focus(); $("#MaterialCode").focus();
return false; return false;
} }
else if($("option:selected", $("#StockAvail")).val() == '-1') else if($("option:selected", $("#StockAvail")).val() == '-1')
{ {
alert('Please Select Stock Availablity'); swal('Please Select Stock Availablity');
$("#StockAvail").focus(); $("#StockAvail").focus();
return false; return false;
} }
else if($("#AddAvailableStock").val().length < 1) else if($("#AddAvailableStock").val().length < 1)
{ {
alert('Please Add Available Stock'); swal('Please Add Available Stock');
$("#AddAvailableStock").focus(); $("#AddAvailableStock").focus();
return false; return false;
} }
else else
{ {
return true; return true;
} }
} }
$(function () {
$(function () {
$('#storestatuslisting').DataTable({ $('#storestatuslisting').DataTable({
"paging": true, "paging": true,
"lengthChange": true, "lengthChange": true,
@ -595,11 +613,15 @@ function validate()
}); });
}); });
</script><script type="text/javascript">
</script>
<script type="text/javascript">
$(document).ready(function(){ $(document).ready(function(){
$("#MaterialCode").select2(); $("#MaterialCode").select2();
//$("#StockAvail").select2(); //$("#StockAvail").select2();
//$("#EditStockAvail").select2(); //$("#EditStockAvail").select2();
}); });
</script> </script>