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

1117
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)
{ {
@ -54,7 +54,7 @@ class department_model extends CI_Model
/** /**
* To get department details * To get department details
* @param number $DEPCode : Optional : this is department code * @param number $DEPCode : Optional : this is department code
* @return array $result : result of the query * @return array $result : result of the query
*/ */
function getDeptInfo($DEPCode='') function getDeptInfo($DEPCode='')
{ {
@ -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)
@ -115,4 +115,4 @@ class emppaydate_model extends CI_Model
} }
?> ?>

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()
{ /**
* To get employee list of permission slip
* @return array $query->result() : result of the query (returns employee details with department name)
*/
function emplist()
{
$sql="select Emp.EmpID,CONCAT(FirstName,' ',LastName)as name ,Emp.Departmentcode, Dep.DepartmentName FROM T_Employee_Details as Emp $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;"; join T_DepartmentDetails as Dep on Dep.DEPCode=Emp.Departmentcode where Emp.IsActive = 1;";
$query =$this->db->query($sql); $query =$this->db->query($sql);
return $query->result(); 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;
}
} /**
* To get the permission data for list
* @return array $query->result() : result of the query (returns permission slip details)
*/
function perlist()
{
function addper($Permissiondata) $this->db->select('*');
{ $this->db->from('T_Permission');
$query =$this->db->get();
$this->db->trans_start(); return $query->result();
$this->db->insert('T_Permission', $Permissiondata);
}
/**
* 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)
{
$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();
}
$Permission = $this->db->affected_rows(); /* Ends permissionslip models */
$this->db->trans_complete();
return $Permission;
}
function perlist()
{
$this->db->select('*');
$this->db->from('T_Permission');
$query =$this->db->get();
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();
}

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');
@ -53,57 +57,66 @@ class mrir_model extends CI_Model
$this->db->where('IGRM.IGRNO',$IgrNo); $this->db->where('IGRM.IGRNO',$IgrNo);
$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()
{ /**
* 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, $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 EMP.FirstName,DD.DEPCode,DD.DepartmentName,ReqLine.Quantity as RequestedQty,POL.Quantity
as OrderedQuantity ,(MD.ActualQuantityReceived) as ActualReceivedqty,(MD.QuantityAccepted) as as OrderedQuantity ,(MD.ActualQuantityReceived) as ActualReceivedqty,(MD.QuantityAccepted) as
AcceptedQty,REQ.ReqDate, ReqLine.Status as ReqStatus, AcceptedQty,REQ.ReqDate, ReqLine.Status as ReqStatus,st.StatusCode as ReqStatus,st.StatusName,
st.StatusCode as ReqStatus,st.StatusName, ReqLine.Remarks
ReqLine.Remarks from T_Requestion_Details ReqLine
from T_Requestion_Details ReqLine join T_PurchaseOrder_LineItem POL join T_PurchaseOrder_LineItem POL on ReqLine.ReqNo = POL.ReqNo and ReqLine.MaterialCode = POL.MaterialCode
on ReqLine.ReqNo = POL.ReqNo and ReqLine.MaterialCode = POL.MaterialCode join T_Requestion_Master REQ on REQ.ReqNo = ReqLine.ReqNo
join T_Requestion_Master REQ on REQ.ReqNo = ReqLine.ReqNo join T_PurchaseOrder_Master POMast on POMast.PONO=POL.PONO
join T_PurchaseOrder_Master POMast on POMast.PONO=POL.PONO join T_Status st on ReqLine.Status = st.StatusCode
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_MRIR_Master MR on MR.PONO = POL.PONO join T_MRIR_Details MD join T_MaterialMaster MM on MM.MaterialCode = ReqLine.MaterialCode
on MD.MRIRNO = MR.MRIRNO and ReqLine.MaterialCode = MD.MaterialCode join T_MaterialMaster MM on join T_Employee_Details EMP on EMP.EmpID = REQ.Requestedby
MM.MaterialCode = ReqLine.MaterialCode join join T_DepartmentDetails DD on DD.DEPCode = EMP.Departmentcode
T_Employee_Details EMP on EMP.EmpID = REQ.Requestedby join where POL.status in (?,?) and ReqLine.Status not in(?) and POMast.status not in(?)
T_DepartmentDetails DD on DD.DEPCode = EMP.Departmentcode where group by ReqLine.MaterialCode ,POL.PONO';
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)); $query = $this->db->query($subQuery,array(MRIR_APPROVED,PARTIAL_MRIRAPPROVED,REQITEM_NEW,PO_AMENDED));
//print_r($this->db->last_query());
return $query->result(); return $query->result();
} }
/* This function is used to list the MRIR value*/
function view_mrir() /**
{ * To list the MRIR value
$this->db->distinct(); * @return $query->result() : result of the query(returns as mrir details)
$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'); function view_mrir()
$this->db->join ('T_MRIR_Details TMD','TMM.MRIRNO=TMD.MRIRNO'); {
$this->db->join ('T_IGR_Master IGRM','TMM.IGRNO=IGRM.IGRNO'); $this->db->distinct();
$this->db->join ('T_IGR_Details IGRD','IGRM.IGRNO=IGRD.IGRNO'); $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->join ('T_PurchaseOrder_Master POM','TMM.PONO=POM.PONO'); $this->db->from ('T_MRIR_Master TMM');
$this->db->join ('tbl_users user','user.userid=TMD.UpdateBY','left'); $this->db->join ('T_MRIR_Details TMD','TMM.MRIRNO=TMD.MRIRNO');
$this->db->join ('T_Employee_Details ED','ED.EmpID = user.EmpID','left'); $this->db->join ('T_IGR_Master IGRM','TMM.IGRNO=IGRM.IGRNO');
$this->db->join ('tbl_users user1','user1.userid = POM.CreatedBy','left'); $this->db->join ('T_IGR_Details IGRD','IGRM.IGRNO=IGRD.IGRNO');
$this->db->join ('T_Employee_Details ED1','ED1.EmpID = user1.EmpID','left'); $this->db->join ('T_PurchaseOrder_Master POM','TMM.PONO=POM.PONO');
$this->db->join ('T_Status ST','ST.StatusCode = TMM.MRIRStatus'); $this->db->join ('tbl_users user','user.userid=TMD.UpdateBY','left');
//$this->db->where('POM.status !=',PO_AMENDED); $this->db->join ('T_Employee_Details ED','ED.EmpID = user.EmpID','left');
$this->db->order_by ('TMM.MRIRNO','desc'); $this->db->join ('tbl_users user1','user1.userid = POM.CreatedBy','left');
$query = $this->db->get(); $this->db->join ('T_Employee_Details ED1','ED1.EmpID = user1.EmpID','left');
return $query->result(); $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,

View File

@ -1,81 +1,81 @@
<?php if(!defined('BASEPATH')) exit('No direct script access allowed'); <?php if(!defined('BASEPATH')) exit('No direct script access allowed');
class store_model extends CI_Model class store_model extends CI_Model
{ {
function viewStock() function viewStock()
{ {
$this->db->select('st.*,st.Remarks as storeremarks,MM.*'); $this->db->select('st.*,st.Remarks as storeremarks,MM.*');
$this->db->from('T_Store_Stockdetails st '); $this->db->from('T_Store_Stockdetails st ');
$this->db->join('T_MaterialMaster MM','st.MaterialCode=MM.MaterialCode'); $this->db->join('T_MaterialMaster MM','st.MaterialCode=MM.MaterialCode');
$query = $this->db->get(); $query = $this->db->get();
//print_r($this->db->last_query()); //print_r($this->db->last_query());
$result = $query->result(); $result = $query->result();
return $result; return $result;
} }
// function viewStock() // function viewStock()
// { // {
// $this->db->distinct(); // $this->db->distinct();
// $this->db->select('st.*,st.Remarks as storeremarks,MM.*,RDet.DeliveredQuantity'); // $this->db->select('st.*,st.Remarks as storeremarks,MM.*,RDet.DeliveredQuantity');
// $this->db->from('T_Store_Stockdetails st '); // $this->db->from('T_Store_Stockdetails st ');
// $this->db->join('T_MaterialMaster MM','st.MaterialCode=MM.MaterialCode'); // $this->db->join('T_MaterialMaster MM','st.MaterialCode=MM.MaterialCode');
// $this->db->join('T_Requestion_Details RDet','st.MaterialCode=RDet.MaterialCode and MM.MaterialCode=RDet.MaterialCode'); // $this->db->join('T_Requestion_Details RDet','st.MaterialCode=RDet.MaterialCode and MM.MaterialCode=RDet.MaterialCode');
// $query = $this->db->get(); // $query = $this->db->get();
// $result = $query->result(); // $result = $query->result();
// //print_r($this->db->last_query()); // //print_r($this->db->last_query());
// return $result; // return $result;
// } // }
function GetAllMaterialList() function GetAllMaterialList()
{ {
$subQuery = 'select MM.* from T_MaterialMaster MM where MaterialCode not in(select MaterialCode from T_Store_Stockdetails)'; $subQuery = 'select MM.* from T_MaterialMaster MM where MaterialCode not in(select MaterialCode from T_Store_Stockdetails)';
$query = $this->db->query($subQuery); $query = $this->db->query($subQuery);
return $query->result(); return $query->result();
} }
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();
$result = $query->result(); $result = $query->result();
return $result; return $result;
} }
function addStock($StockDetails) function addStock($StockDetails)
{ {
$this->db->trans_start(); $this->db->trans_start();
$this->db->insert('T_Store_Stockdetails', $StockDetails); $this->db->insert('T_Store_Stockdetails', $StockDetails);
$insert_id = $this->db->affected_rows(); $insert_id = $this->db->affected_rows();
$this->db->trans_complete(); $this->db->trans_complete();
} }
function UpdateStock($StockDetails,$MaterialCode) function UpdateStock($StockDetails,$MaterialCode)
{ {
$this->db->where('MaterialCode',$MaterialCode); $this->db->where('MaterialCode',$MaterialCode);
$this->db->update('T_Store_Stockdetails',$StockDetails); $this->db->update('T_Store_Stockdetails',$StockDetails);
} }
function GetStockHisory($MaterialCode) function GetStockHisory($MaterialCode)
{ {
$this->db->select('Quantity,ActualQuantity,Remarks,updatedOn'); $this->db->select('Quantity,ActualQuantity,Remarks,updatedOn');
$this->db->from('T_Store_Stockdetails_History'); $this->db->from('T_Store_Stockdetails_History');
$this->db->where('MaterialCode',$MaterialCode); $this->db->where('MaterialCode',$MaterialCode);
$query = $this->db->get(); $query = $this->db->get();
$result = $query; $result = $query;
return $result->result_array(); return $result->result_array();
} }
} }

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;
@ -222,12 +223,9 @@
?></td> ?></td>
</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;
@ -470,7 +470,7 @@
} }
?> ?>
</tbody> </tbody>
<tfoot width="100%"> <tfoot width="100%">
@ -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;
@ -79,6 +79,7 @@
<option value="">Select Supplier</option> <option value="">Select Supplier</option>
<?php <?php
foreach($cust as $item): foreach($cust as $item):
{?> {?>
@ -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>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

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;"> <body style="font-family: sans-serif;">
<div class="footer" style="font-size:12px;">
Page: <span class="pagenum"></span>
</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,499 +1,456 @@
<?php <?php
$dt = new DateTime('now', new DateTimeZone('Asia/Kolkata'));
$CurrentDate = $dt->format('d-m-y'); $dt = new DateTime('now', new DateTimeZone('Asia/Kolkata'));
$CurrentDate = $dt->format('d-m-y');
// print_r($cost);die(); $CostCenterCode='';
$CostCenterName='';
$StoreReqNo='';
$ReqDate='';
$DepartmentName='';
$CostCenterCode=''; $DEPCode = '';
$CostCenterName=''; $RowCount = 0;
$StoreReqNo=''; $ReqBy = '';
$ReqDate='';
$DepartmentName=''; if(!empty($ReqListDetails))
$DEPCode = '';
$RowCount = 0; {
$ReqBy = '';
if(!empty($ReqListDetails)) foreach ($ReqListDetails as $Req ) {
{
foreach ($ReqListDetails as $Req ) { $CostCenterCode = $Req->CostCenterCode;
$CostCenterName=$Req->CostCenterName;
$CostCenterCode = $Req->CostCenterCode; $StoreReqNo=$Req->StoreReqNo;
$CostCenterName=$Req->CostCenterName; $dt = new DateTime($Req->ReqDate);
$StoreReqNo=$Req->StoreReqNo; $ReqDate = $dt->format('d-m-y');
$dt = new DateTime($Req->ReqDate); $DEPCode = $Req->DEPCode;
$ReqDate = $dt->format('d-m-y'); $DepartmentName=$Req->DepartmentName;
$DEPCode = $Req->DEPCode; $ReqBy = $Req->FirstName;
$DepartmentName=$Req->DepartmentName;
$ReqBy = $Req->FirstName; }
}
} }
?>
?>
<script>
$(function() {
//Initialize Select2 Elements
<script>
$("#MaterialCode").select2();
$(function() {
$("#Date").datepicker({ //Initialize Select2 Elements
// minDate : 'now',
maxDate : 'now', $("#MaterialCode").select2();
dateFormat: 'mm/dd/yy',changeMonth: true, changeYear: true,yearRange: '-100:+0'
}); $("#Date").datepicker({
// minDate : 'now',
maxDate : 'now',
}); dateFormat: 'mm/dd/yy',changeMonth: true, changeYear: true,yearRange: '-100:+0'
</script>
<style type="text/css"> });
.num{ });
text-align:right;
} </script>
.select2
{ <style type="text/css">
width: 100% ! important; .num{
} text-align:right;
.dataTables_wrapper { }
padding-bottom: 0px ! important;
} .select2
{
width: 100% ! important;
span.highlight { }
background-color: yellow;
} .dataTables_wrapper {
</style>
<div class="content-wrapper" style="min-height: 500px ! important;"> padding-bottom: 0px ! important;
<!-- Content Header (Page header) -->
<section class="content-header"> }
<h1>
<center>Resico Industries - Store Requisition - <?php echo $StoreReqNo; ?></center>
</h1>
</section> span.highlight {
<section class="content">
<div class="row" style="padding:2% 5%"> background-color: yellow;
<?php
$attributes = array('class' => 'form-label-left requistion ','name' => 'requistion','id' => 'requistion'); }
echo form_open($this->config->base_url().'storerequisitionlist/UpdateIssueRequistion',$attributes); </style>
<div class="content-wrapper" style="min-height: 500px ! important;">
?>
<!-- Content Header (Page header) -->
<!-- <form method="post" role="form" > -->
<div class="row"> <section class="content-header">
<div class="col-md-12"> <h1>
<input type="hidden" name="txtReqNo" id="txtReqNo" value="<?php echo $StoreReqNo?>"/> <center>Resico Industries - Store Requisition - <?php echo $StoreReqNo; ?></center>
</h1>
</section>
<div class="col-md-3"> <section class="content">
<label>Requested By</label> <div class="row" style="padding:2% 5%">
<?php <?php
$data = array('name' => 'RequestedBy','value' => set_value('RequestedBy',$ReqBy), 'id'=>'RequestedBy','class' => 'form-control' ,'readonly' => 'true'); $attributes = array('class' => 'form-label-left requistion ','name' => 'requistion','id' => 'requistion');
echo form_input($data); echo form_open($this->config->base_url().'storerequisitionlist/UpdateIssueRequistion',$attributes);
?>
?>
</div> <!-- <form method="post" role="form" > -->
<div class="col-md-3">
<label>Department Name</label> <div class="row">
<?php <div class="col-md-12">
$data = array('name' => 'DepartmentName','value' => set_value('DepartmentName',$DEPCode . " - ".$DepartmentName), 'id'=>'DepartmentName','class' => 'form-control ' ,'readonly' => 'true'); <input type="hidden" name="txtReqNo" id="txtReqNo" value="<?php echo $StoreReqNo?>"/>
echo form_input($data); <div class="col-md-3">
?> <label>Requested By</label>
</div> <?php
$data = array('name' => 'RequestedBy','value' => set_value('RequestedBy',$ReqBy), 'id'=>'RequestedBy','class' => 'form-control' ,'readonly' => 'true');
echo form_input($data);
?>
<div class="col-md-3"> </div>
<label>Requested Date</label> <div class="col-md-3">
<?php <label>Department Name</label>
$data = array('name' => 'Date','value' => set_value('Date',$ReqDate), 'id' =>"Date", 'class' => 'form-control num' ,'readonly' => 'true'); <?php
echo form_input($data); $data = array('name' => 'DepartmentName','value' => set_value('DepartmentName',$DEPCode . " - ".$DepartmentName), 'id'=>'DepartmentName','class' => 'form-control ' ,'readonly' => 'true');
?> echo form_input($data);
?>
</div>
</div>
<div class="col-md-3"> <div class="col-md-3">
<label>Cost Center</label> <label>Requested Date</label>
<?php
<?php $data = array('name' => 'Date','value' => set_value('Date',$ReqDate), 'id' =>"Date", 'class' => 'form-control num' ,'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 class="col-md-3">
</div> <label>Cost Center</label>
</div> <?php
$data = array('name' => 'CostCenter','value' => set_value('CostCenter',$CostCenterCode . " - ".$CostCenterName),'id'=>"CostCenter", 'class' => 'form-control','readonly' => 'true' );
<br> echo form_input($data);
?>
</div>
</div>
</div>
<div class="row "> <br>
<div class=" box "> <div class="row ">
<div class=" container-fluid"> <div class=" box ">
<div class="box-header"> <div class=" container-fluid">
<CENTER><h3 class="box-title"> </h3></CENTER> <div class="box-header">
<span class="highlight">Available Stock Shown In Red Are Out Of Stock</span> <CENTER><h3 class="box-title"> </h3></CENTER>
</div> <span class="highlight">Available Stock Shown In Red Are Out Of Stock</span>
<table id="Items" class="table table-bordered table-hover editableTable" style="background-color:#fff;font-size:12px;"> </div>
<thead style="background-color: #CFCFCF;"> <table id="Items" class="table table-bordered table-hover editableTable" style="background-color:#fff;font-size:12px;">
<th>SNO</th> <thead style="background-color: #CFCFCF;">
<th>Item Code</th> <th>SNO</th>
<th>Description</th> <th>Item Code</th>
<th>UOM</th> <th>Description</th>
<th>Requested Quantity</th> <th>UOM</th>
<th>Available Stock</th> <th>Requested Quantity</th>
<th>Issued Qty</th> <th>Available Stock</th>
<th>Pending Qty</th> <th>Issued Qty</th>
<th>Requester Remarks</th> <th>Pending Qty</th>
<th>Issuing Quantity</th> <th>Requester Remarks</th>
<th>Comments</th> <th>Issuing Quantity</th>
</thead> <th>Comments</th>
<tbody id='mytab'> </thead>
<?php <tbody id='mytab'>
if(!empty($ReqItem)) <?php
{ //alert(); if(!empty($ReqItem))
$index = 0; { //swal();
foreach($ReqItem as $record) $index = 0;
{ foreach($ReqItem as $record)
//print_r($record); {
$index = $index + 1; //print_r($record);
$qty=($record->QuantityRequired)-($record->QuantityIssued); $index = $index + 1;
?> $qty=($record->QuantityRequired)-($record->QuantityIssued);
<tr id="<?php echo $index ; ?>"> ?>
<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 ; ?>" /> <tr id="<?php echo $index ; ?>">
<input type="hidden" name="<?php echo 'te'.$index ?>" id="<?php echo 'tes'.$index ?>" value="<?php echo $record->QuantityRequired ; ?>" /> --> <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 ; ?>" />
<td align="left"><?php echo $record->MaterialCode ?></td> <input type="hidden" name="<?php echo 'te'.$index ?>" id="<?php echo 'tes'.$index ?>" value="<?php echo $record->QuantityRequired ; ?>" /> -->
<td align="left"><?php echo $record->MaterialName ?></td> <td align="left"><?php echo $record->MaterialCode ?></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> <?
<? }?>
}?> <?php if(($record->Quantity)-$qty>=0)
<?php if(($record->Quantity)-$qty>=0) {?>
{?> <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->QuantityRequired)-($record->QuantityIssued) ?></td>
<td align="left"><?php echo $record->Remarks ?></td>
<td align="left"><?php echo $record->QuantityIssued ?></td> <td align="left">
<?php if((($record->Quantity)-$qty>=0)&&$record->StatusName!='ISSUED')
<td align="left"><?php echo($record->QuantityRequired)-($record->QuantityIssued) ?></td> {?>
<td align="left"><?php echo $record->Remarks ?></td> <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; ?>"> <?}
<td align="left"> else
{?>
<?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" readonly=true onkeypress="return isNumberKey(event);"value="<?php echo $record->QuantityIssued; ?>"><?}?>
{?> </td>
<td align="left">
<?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="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; ?>" ><?}?>
</td>
</tr>
<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; ?>"><?}?> <?php $RowCount = $index; }
?>
</td> <?php
}?>
</tbody>
</table>
<td align="left"> </div>
</div>
<?php if((($record->Quantity)-$qty>=0)&&$record->StatusName!='ISSUED') </div>
{?>
<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; ?>" ><?}
<div class="col-md-3 col-md-offset-9" align = "right">
else{?> <input type="hidden" name="txtRowCount" id="txtRowCount" value="<?php echo $RowCount;?>" />
<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="hidden" name="txtStatus" id="txtStatus" />
<input type="submit" class="btn btn-primary Submit" value="Update"/ >
<a class="btn btn-primary" href="<?php echo base_url(); ?>storerequisitionlisting">Cancel</a>
</td> </div>
</form>
</tr> </div>
<?php $RowCount = $index; } </section>
?> </div>
</script>
<?php
}?> <script type="text/html" id="tempList">
<tr id="<%=index%>">
</tbody> <td align="left"><%=index%></td>
</table> <td align="left"><%=MaterialCode%></td>
</div> <td align="left"><%=MaterialName%></td>
</div> <td align="left"><%=UOM%></td>
</div> <td align="left"><%=Quantity%></td>
<td><%=Remarks%></td>
<div class="col-md-3 col-md-offset-9" align = "right"> <td align="left"></td> <!-- Issued Quantity -->
<input type="hidden" name="txtRowCount" id="txtRowCount" value="<?php echo $RowCount;?>" /> <td></td> <!-- Comments -->
</tr>
<input type="hidden" name="txtStatus" id="txtStatus" /> </script>
<!--<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> <!--copy script-->
<script>
<a class="btn btn-primary Submit" ID="Submit" onclick="Save(1)" >&nbsp;&nbsp;<span class="bold">Submit</span></a> var j =0;
var isExceed = 0;
<input type="Submit" class="btn btn-info" />--> $(function() {
<input type="submit" class="btn btn-primary Submit" value="Update"/ > var ReqLineItem = <?php echo json_encode($ReqItem, JSON_PRETTY_PRINT) ?>;
$.each(ReqLineItem, function(idx, obj) {
<!-- <input type="reset" class="btn btn-primary" value="Cancel" href="<?php echo base_url(); ?>storerequisitionlisting" /> --> //$("#SupAddress").val(obj.Address);
<a class="btn btn-primary" href="<?php echo base_url(); ?>storerequisitionlisting">Cancel</a> j= j +1 ;
$('<input>').attr({
</div> type: 'hidden',
</form> id: 'MaterialCode' + j,
</div> name: 'MaterialCode'+ j,
</section> value:obj.MaterialCode
</div> }).appendTo('form');
</script> $('<input>').attr({
type: 'hidden',
<script type="text/html" id="tempList"> id: 'txtIssuedQuantity' + j,
<tr id="<%=index%>"> name: 'txtIssuedQuantity'+ j,
<td align="left"><%=index%></td> }).appendTo('form');
<td align="left"><%=MaterialCode%></td>
<td align="left"><%=MaterialName%></td> $('<input>').attr({
type: 'hidden',
<td align="left"><%=UOM%></td> id: 'txtRemarks' + j,
name: 'txtRemarks'+ j,
<td align="left"><%=Quantity%></td> }).appendTo('form');
<td><%=Remarks%></td> });
<td align="left"></td> <!-- Issued Quantity -->
});
<td></td> <!-- Comments -->
</tr> function isNumberKey(evt)
</script> {
var charCode = (evt.which) ? evt.which : evt.keyCode;
if (charCode != 46 && charCode > 31
&& (charCode < 48 || charCode > 57))
return false;
return true;
}
<!--copy script--> var index = '1';
<script> var userid = '';
var j =0;
var isExceed = 0; function SaveIssueQuantity(RowId,ReqQty,Issued)
$(function() { {
var ReqLineItem = <?php echo json_encode($ReqItem, JSON_PRETTY_PRINT) ?>;
$.each(ReqLineItem, function(idx, obj) { var qty = $("#issuedQuantity"+RowId).val();
var maxqty=ReqQty-Issued;
//$("#SupAddress").val(obj.Address); if( qty != '')
j= j +1 ; {
$('<input>').attr({ if(qty <= (ReqQty-Issued) )
type: 'hidden', {
id: 'MaterialCode' + j, $("#txtIssuedQuantity"+RowId).val(qty);
name: 'MaterialCode'+ j, }
value:obj.MaterialCode else
{
}).appendTo('form'); 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();
$('<input>').attr({ $("#issuedQuantity"+RowId).val('');
type: 'hidden', return false;
id: 'txtIssuedQuantity' + j, }
name: 'txtIssuedQuantity'+ j, }
}).appendTo('form'); }
function SaveRemarks(RowId)
$('<input>').attr({ {
type: 'hidden',
id: 'txtRemarks' + j, var remks = $("#Comments"+RowId).val();
name: 'txtRemarks'+ j, if( remks != '')
}).appendTo('form'); {
$("#txtRemarks"+RowId).val(remks);
}
}); }
});
function isNumberKey(evt)
{ function Save(status)
var charCode = (evt.which) ? evt.which : evt.keyCode; {
if (charCode != 46 && charCode > 31 var txtRowCount= $('#txtRowCount').val();
&& (charCode < 48 || charCode > 57)) if(status == '0')
return false; {
stat = '<?php echo STORE_DRAFT; ?>';
return true; }
} else
{
stat = '<?php echo STORE_PENDINGAPPROVAL; ?>';
var index = '1'; }
var userid = '';
$('#txtStatus').val(stat);
function SaveIssueQuantity(RowId,ReqQty,Issued) var id=$('#txtStatus').val();
{ var RequestedBy=$('#RequestedBy').val();
//alert(Issued); var CostCenter=$('#CostCenter').val();
var qty = $("#issuedQuantity"+RowId).val(); var splitDepCode= $('#DepartmentName').val();
var maxqty=ReqQty-Issued; DEPCode = splitDepCode.split('-')[0];
//alert(qty);
if( qty != '') if (validate())
{ {
if(qty <= (ReqQty-Issued) ) if(document.getElementById('mytable').rows.length < 0)
{ {
$("#txtIssuedQuantity"+RowId).val(qty); swal('Please Select Line item to Store Requisition');
} $('#Deliverydt').focus();
else return false;
{ }
alert('The Issued Quantity cannot be more than the Requested Quantity, Already Distributed Quantity is ' +Issued+ 'Maximun Qty can enter is '+maxqty); else
$("#issuedQuantity"+RowId).focus(); {
$("#issuedQuantity"+RowId).val('');
return false; console.log($('.requistion').serialize());
$('#content').loader('show');
} $.ajax({
} data:$('.requistion').serialize(),
} type:"POST",
function SaveRemarks(RowId) url:"<?php echo base_url() ?>storerequisitionlist/EditStoreRequisitions?ID="+id+"&RequestedBy="+RequestedBy+"&CostCenter="+CostCenter+"&DEPCode="+DEPCode+"&txtRowCount="+txtRowCount,
{ success:function(data) {
var remks = $("#Comments"+RowId).val(); if(data)
if( remks != '') {
{ $('#content').loader('hide');
$("#txtRemarks"+RowId).val(remks); swal(data);
} $('#txtRowCount').val('');
} $('#txtDeletedRow').val('');
function Save(status)
{ //window.location = "storerequisitionlist";
}
//alert($(json.stringify(MaterialCode).val()); else
var txtRowCount= $('#txtRowCount').val(); {
//var mat = $('#MaterialCode'+txtRowCount).val();
swal("Error");
if(status == '0') }
{ }
stat = '<?php echo STORE_DRAFT; ?>'; });
} }
else }
{ }
stat = '<?php echo STORE_PENDINGAPPROVAL; ?>';
} function validate()
{
$('#txtStatus').val(stat);
if($("option:selected", $("#CostCenter")).val() == '-1')
var id=$('#txtStatus').val(); {
swal('Please Select CostCenter');
var RequestedBy=$('#RequestedBy').val(); return false;
var CostCenter=$('#CostCenter').val();
var splitDepCode= $('#DepartmentName').val(); }
DEPCode = splitDepCode.split('-')[0]; else if($("option:selected", $("#MaterialCode")).val() == '-1')
{
if (validate())
{ swal('Please Select MaterialCode');
if(document.getElementById('mytable').rows.length < 0) return false;
{
alert('Please Select Line item to Store Requisition'); }
$('#Deliverydt').focus();
return false;
}
else if(document.getElementById('mytable').rows.length < 1)
else {
{
console.log($('.requistion').serialize()); swal('Please Add Line Item');
return false;
$('#content').loader('show');
$.ajax({ }
data:$('.requistion').serialize(), else if(isExceed == 1)
type:"POST", {
url:"<?php echo base_url() ?>storerequisitionlist/EditStoreRequisitions?ID="+id+"&RequestedBy="+RequestedBy+"&CostCenter="+CostCenter+"&DEPCode="+DEPCode+"&txtRowCount="+txtRowCount,
swal('You dont have Budget and You cant Raise New StoreRequisition');
success:function(data) { return false;
if(data)
{ }
$('#content').loader('hide'); else
alert(data); {
$('#txtRowCount').val(''); return true;
$('#txtDeletedRow').val(''); }
}
//window.location = "storerequisitionlist";
} function Redirect()
else {
{ window.location = "storerequisition";
alert("Error"); }
} </script>
} <script>
});
} $(function () {
}
} $('#Items').DataTable({
function validate()
{ "paging": true,
"lengthChange": true,
if($("option:selected", $("#CostCenter")).val() == '-1') "searching": true,
{ "ordering": true,
alert('Please Select CostCenter'); "info": true,
return false; "autoWidth": true
}
});
else if($("option:selected", $("#MaterialCode")).val() == '-1') });
{
alert('Please Select MaterialCode');
return false;
}
else if(document.getElementById('mytable').rows.length < 1)
{
alert('Please Add Line Item');
return false;
}
else if(isExceed == 1)
{
alert('You dont have Budget and You cant Raise New StoreRequisition');
return false;
}
else
{
return true;
}
}
function Redirect()
{
window.location = "storerequisition";
}
</script>
<script>
$(function () {
$('#Items').DataTable({
"paging": true,
"lengthChange": true,
"searching": true,
"ordering": true,
"info": true,
"autoWidth": true
});
});
</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;"> <body style="font-family: sans-serif;">
<div class="footer" style="font-size:12px;">
Page: <span class="pagenum"></span>
</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;
$StoreReqNo = '';
//echo $StoreReqNo; $DraftCount =0;
if(!empty($Store)) $StoreReqNo = '';
{
foreach ($Store as $St) //echo $StoreReqNo;
{
if ($St->StatusName=='DRAFT')
{ if(!empty($Store))
$DraftCount++;
$StoreReqNo = $St->StoreReqNo; {
}
foreach ($Store as $St)
}
//echo $StoreReqNo; {
}?>
<style> if ($St->StatusName=='DRAFT')
span.highlight {
background-color: yellow; {
}
</style> $DraftCount++;
<div class="content-wrapper">
$StoreReqNo = $St->StoreReqNo;
<section class="content">
}
<div class="row">
<div class="col-xs-12">
<div class="box">
<div class=" container-fluid"> }
<div class="box-header">
<CENTER><h3 class="box-title">Resico Industries - Requisition Listing</h3></CENTER> //echo $StoreReqNo;
</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) <style>
{ ?>
<a class="btn btn-primary" href="<?php echo base_url(); ?>storerequisitionlist/addstores"/>Raise Store Requisition</a><?php span.highlight {
}?>
background-color: yellow;
</div>
</div> }
</div>
<table id="Requisition" class="table table-bordered table-hover" style="background-color:#fff;font-size:12px;"> </style>
<thead style="background-color:#ddf">
<tr> <div class="content-wrapper">
<th>Store Requisition No</th>
<th>Tot No.OfLineItem </th>
<th>Issued Item Count</th>
<th>Pending Item Count</th> <section class="content">
<th>Status</th>
<th>Requested Date</th>
<th>Action</th> <div class="row">
</tr> <div class="col-xs-12">
</thead>
<div class="box">
<div class=" container-fluid">
<?php <div class="box-header">
if(!empty($Store)) <CENTER><h3 class="box-title">Resico Industries - Requisition Listing</h3></CENTER>
{
// echo "VIEW"; </div>
// print_r($Store);
foreach($Store as $record) <?php if($DraftCount > 0 ) { ?><p>
{ //print_r($record);
?> <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>
<tr>
<td><?php echo $record->StoreReqNo ?></td> </p> <?php } ?>
<td align="right"><?php echo $record->TotalNoofLineItems ?></td> <div class="row">
<td align="right"><?php echo $record->IssuesItems ?></td>
<td align="right"><?php echo $record->PendingItems ?></td> <div class="col-xs-12 text-right" style="margin-bottom:-3%;">
<div class="form-group">
<td><?php echo $record->StatusName ?></td> <?php if($DraftCount == 0)
<td align="right"><?php $dt = new DateTime($record->ReqDate);
$ReqDate = $dt->format('d-m-Y'); echo $ReqDate ?> { ?>
<a class="btn btn-primary" href="<?php echo base_url(); ?>storerequisitionlist/addstores"/>Raise Store Requisition</a><?php
<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> }?>
<?php
}
} </div>
?>
</table> </div>
</div>
</div> </div>
</div>
</div> <table id="Requisition" class="table table-bordered table-hover" style="background-color:#fff;font-size:12px;">
</section> <thead style="background-color:#ddf">
</div>
<script> <tr>
<th>Store Requisition No</th>
function DeleteRow(rowid)
{ <th>Tot No.OfLineItem </th>
id = rowid; <th>Issued Item Count</th>
var answer = confirm(" Do you want to delete the Requisition?") <th>Pending Item Count</th>
if (answer)
{ <th>Status</th>
$.ajax({ <th>Requested Date</th>
data:{id:id},
type:"POST",
url:"<?php echo base_url() ?>storerequisitionlist/DeleteReqNo",
success:function(data) { <th>Action</th>
if(data)
{
$('#content').loader('hide');
alert(data); </tr>
location.reload(); </thead>
}
else
{
alert("Error");
}
}});
} <?php
}
</script> if(!empty($Store))
<script>
$(function () { {
$('#Requisition').DataTable({ // echo "VIEW";
"paging": true,
"lengthChange": true, // print_r($Store);
"searching": true,
"ordering": true, foreach($Store as $record)
"info": true,
"autoWidth": true { //print_r($record);
}); ?>
});
</script> <tr>
<td><?php echo $record->StoreReqNo ?></td>
<td align="right"><?php echo $record->TotalNoofLineItems ?></td>
<td align="right"><?php echo $record->IssuesItems ?></td>
<td align="right"><?php echo $record->PendingItems ?></td>
<td><?php echo $record->StatusName ?></td>
<td align="right"><?php $dt = new DateTime($record->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>
</tr>
<?php
}
}
?>
</table>
</div>
</div>
</div>
</div>
</section>
</div>
<script>
function DeleteRow(rowid)
{
id = rowid;
var answer = confirm(" Do you want to delete the Requisition?")
if (answer)
{
$.ajax({
data:{id:id},
type:"POST",
url:"<?php echo base_url() ?>storerequisitionlist/DeleteReqNo",
success:function(data) {
if(data)
{
$('#content').loader('hide');
swal(data);
location.reload();
}
else
{
swal("Error");
}
}});
}
}
</script>
<script>
$(function () {
$('#Requisition').DataTable({
"paging": true,
"lengthChange": true,
"searching": true,
"ordering": true,
"info": true,
"autoWidth": true
});
});
</script>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff