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->SetHTMLHeader($HtmlHeading);
$html = $this->load->view('Mrirprintpdf',$data,true);

View File

@ -1,6 +1,6 @@
<?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)

View File

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

View File

@ -68,7 +68,7 @@ class report extends BaseController
public function releasedPO()
{
$this->global['pageTitle'] = 'Siddharth : Reports';
$this->global['pageTitle'] = 'Resico : Reports';
if ($this->input->post('btn_submit')) {
@ -291,7 +291,7 @@ class report extends BaseController
{
$this->global['pageTitle'] = 'Resico : Reports ';
//$this->input->post('btn_submit');
if ($this->input->post('btn_submit')) {
$cname = $this->input->post('client_name');
$prod = $this->input->post('item_name');
$ab=$this->input->post('financialyear');
@ -300,11 +300,16 @@ class report extends BaseController
$m=$this->input->post('month');
$frm = $this->input->post('from_date');
$t = $this->input->post('to_date');
//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['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();
$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)
@ -437,7 +442,7 @@ class report extends BaseController
{
$this->global['pageTitle'] = 'Resico : Supplier-wise Reports';
//$this->input->post('btn_submit');
if ($this->input->post('btn_submit')) {
$cname = $this->input->post('client_name');
$ab=$this->input->post('financialyear');
$fa=substr($ab,0,-5);
@ -445,12 +450,15 @@ class report extends BaseController
$m=$this->input->post('month');
$frm = $this->input->post('from_date');
$t = $this->input->post('to_date');
//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->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)
{
@ -465,7 +473,7 @@ class report extends BaseController
{
$this->global['pageTitle'] = 'Resico : Consolidated Reports';
//$this->input->post('btn_submit');
if ($this->input->post('btn_submit')) {
$cname = $this->input->post('client_name');
$ab=$this->input->post('financialyear');
$fa=substr($ab,0,-5);
@ -474,7 +482,12 @@ class report extends BaseController
$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->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)
@ -568,7 +581,7 @@ class report extends BaseController
{
$this->global['pageTitle'] = 'Resico : Reports';
//$this->input->post('btn_submit');
if ($this->input->post('btn_submit')) {
$cname = $this->input->post('client_name');
$prod = $this->input->post('item_name');
$ab=$this->input->post('financialyear');
@ -586,6 +599,11 @@ class report extends BaseController
$data['cust']=$this->dahsboard_Model->customer_name();
$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['material']=$this->dahsboard_Model->material_name();
$data['cust']=$this->dahsboard_Model->customer_name();
$data['finyear']=$this->dahsboard_Model->report_finyear();
if($this->DEPCode == MANAGEMENT)
{
@ -725,7 +743,7 @@ class report extends BaseController
{
$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');
$fa=substr($ab,0,-5);
@ -737,7 +755,12 @@ class report extends BaseController
$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->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)
@ -759,7 +782,7 @@ class report extends BaseController
{
$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');
$fa=substr($ab,0,-5);
@ -768,7 +791,12 @@ class report extends BaseController
$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->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)
{
@ -779,7 +807,69 @@ class report extends BaseController
$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()
{
@ -926,16 +1016,21 @@ class report extends BaseController
{
$this->global['pageTitle'] = 'Resico : Reports';
//$this->input->post('btn_submit');
$cname = $this->input->post('client_name');
$ab=$this->input->post('financialyear');
$fa=substr($ab,0,-5);
$aa=substr($ab,5,5);
//print_r($prod);
$data['material']=$this->dahsboard_Model->category();
$data['cust']=$this->dahsboard_Model->customer_name();
$data['finyear']=$this->dahsboard_Model->report_finyear();
$data['spurchse']=$this->dahsboard_Model->rawi_report_consolidate($cname,$fa,$aa);
if ($this->input->post('btn_submit')) {
$cname = $this->input->post('client_name');
$ab=$this->input->post('financialyear');
$fa=substr($ab,0,-5);
$aa=substr($ab,5,5);
$data['material']=$this->dahsboard_Model->category();
$data['cust']=$this->dahsboard_Model->customer_name();
$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)
{

View File

@ -1,153 +1,279 @@
<?php if(!defined('BASEPATH')) exit('No direct script access allowed');
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 extends BaseController
{
/**
* default constructor of the class
*/
public function __construct()
{
parent::__construct();
$this->load->model('store_model');
$this->load->library('form_validation');
$this->isLoggedIn();
}
/**
* Index Page for this controller (default function of the class)
*/
public function index()
{
$this->global['pageTitle'] = 'Resico Industries : Store Status';
$this->loadViews("storestatus", $this->global, NULL , NULL);
}
/**
* To descripted Store Stock Availability list
*/
function storeavailability()
{
$this->global['pageTitle'] = 'Resico Industries : Store Status';
$data['Stock'] = $this->store_model->viewStock();
$data['MaterialList'] = $this->store_model->GetAllMaterialList();
$data['StockStatus'] = $this->store_model->GetConfigValue('C021');
$this->loadViews("storestatus", $this->global, $data,null);
}
/**
* Its handles add stock details Operation.
*/
function AddStock()
{
$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'));
$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('MaterialCode'=>$MaterialCode,'Quantity'=>$AvailableQty,'Status'=>$Status,'Remarks'=>$Remarks, 'CreatedBy'=>$CreatedBy,'Createdon'=>$createddt);
$data['Stock'] = $this->store_model->addStock($Stockdetails);
echo 'Stock Added successfully';
}
/**
* Its handles updated stock details Operations.
*/
function UpdateStock()
{
$MaterialCode = $this->input->post('EditMaterialCode');
$AvailableQty = $this->input->post('EditAvailableStock');
$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'] = 'Resico : 404 - Page Not Found';
$this->loadViews("404", $this->global, NULL, NULL);
}
}
<?php if(!defined('BASEPATH')) exit('No direct script access allowed');
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 extends BaseController
{
/**
* default constructor of the class
*/
public function __construct()
{
parent::__construct();
$this->load->model('store_model');
$this->load->library('form_validation');
$this->isLoggedIn();
}
/**
* Index Page for this controller (default function of the class)
*/
public function index()
{
$this->global['pageTitle'] = 'Siddharth Industries : Store Status';
$this->loadViews("storestatus", $this->global, NULL , NULL);
}
/**
* To descripted Store Stock Availability list
*/
function storeavailability()
{
$this->global['pageTitle'] = 'Siddharth Industries : Store Status';
$data['Stock'] = $this->store_model->viewStock();
$data['MaterialList'] = $this->store_model->GetAllMaterialList();
$data['StockStatus'] = $this->store_model->GetConfigValue('C021');
if($this->DEPCode == STORE)
{
$this->loadViews("storestatus", $this->global, $data,null);
}
else
{
$this->loadViews("access", $this->global, $data,null);
}
}
/**
* Its handles add stock details Operation.
*/
function AddStock()
{
$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'));
$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('MaterialCode'=>$MaterialCode,'Quantity'=>$AvailableQty,'Status'=>$Status,'Remarks'=>$Remarks, 'CreatedBy'=>$CreatedBy,'Createdon'=>$createddt);
$data['Stock'] = $this->store_model->addStock($Stockdetails);
echo 'Stock Added successfully';
}
/**
* Its handles updated stock details Operations.
*/
function UpdateStock()
{
$MaterialCode = $this->input->post('EditMaterialCode');
$AvailableQty = $this->input->post('EditAvailableStock');
$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
* @return array $result : result of the query
* @return array $result : result of the query (returns asset information)
*/
function assetListing()
{
@ -103,7 +103,7 @@ class assetdetails_model extends CI_Model
/**
* To get the PO lineitem details for revenue po.
* @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){
$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.
* @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){
$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.
* @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){
$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.
* @param $line : To get PO lineitem number from the controller
* @return $result : This is result of the query (returns po lineitem details)
* @param $line : This is PO lineitem number
* @return $result : result of the query (returns po capital lineitem details)
*/
function getlineitemcap($line){
@ -195,7 +195,7 @@ class assetdetails_model extends CI_Model
/**
* To get the PO lineitem details revalant po.
* @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)
{
@ -232,8 +232,8 @@ class assetdetails_model extends CI_Model
/**
* To Store the asset information
* @param $asset : This have all the asset details datas.
* @return $Asset_Code : This will return how many value are inserted (return as number/count)
* @param $asset : This will have all asset datas
* @return $Asset_Code : This will return how many value are inserted (return as number(counts))
*/
function addNewasset($asset)
{
@ -266,7 +266,7 @@ class assetdetails_model extends CI_Model
/**
* 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
*/
function editasset($asset, $Asset_Code)
@ -278,7 +278,7 @@ class assetdetails_model extends CI_Model
/**
* 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
*
* Note : This function Temporary not in use

View File

@ -3,8 +3,8 @@
class cashbook_model extends CI_Model
{
/**
* To get Account status
* @return array $r->result() : result of the query
* To get Account Type
* @return array $r->result() : result of the query (returns active account code)
*/
function getAccounTypes()
{
@ -16,7 +16,7 @@ class cashbook_model extends CI_Model
/**
* 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)
*/
function saveIncomeExpense($data)
@ -29,7 +29,7 @@ class cashbook_model extends CI_Model
/**
* To get Income and expense List
* @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="")
{
@ -49,7 +49,7 @@ class cashbook_model extends CI_Model
/**
* 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()
{
@ -60,7 +60,7 @@ class cashbook_model extends CI_Model
/**
* To get Account Information
* @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)
{
@ -74,7 +74,7 @@ class cashbook_model extends CI_Model
/**
* To get Account Information
* @return array $result : result of the query
* @return array $result : result of the query (returns account information)
*/
function Selectcash()
{

View File

@ -57,7 +57,7 @@ class companydetailsmodel extends CI_Model
* To update the company related files information
* @param number $compID : This is company ID
* @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)
{
@ -85,7 +85,7 @@ class companydetailsmodel extends CI_Model
/**
* 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()
{
@ -101,7 +101,7 @@ class companydetailsmodel extends CI_Model
/**
* 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()
{
@ -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);
return $i;
}
elseif($count == 1)
elseif($count == 1)//for updation
{
$this->db->where('Bank_name',$bankname);
$this->db->where('IFSC',$bankifsc);

View File

@ -5,7 +5,7 @@ class configmodel extends CI_Model
/**
* 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()
{
@ -20,7 +20,7 @@ class configmodel extends CI_Model
/**
* To store config master information by configid
* @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
*/
function addconfigmaster($config)
@ -38,7 +38,7 @@ class configmodel extends CI_Model
/**
* To store config details 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)
{
@ -169,7 +169,7 @@ class configmodel extends CI_Model
* To get costcenter department information by using department code and costcenter id
* @param number $Depcode : Optional : This is department 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='')
{
@ -189,7 +189,7 @@ class configmodel extends CI_Model
/**
* To get the Config value from configuration table
* @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)
{

View File

@ -5,7 +5,7 @@ class costcenter_model extends CI_Model
/**
* To get the Cost listing
* @return array $result : This is result of the query
* @return array $result : result of the query (returns )
*/
function CostListing()
{
@ -200,7 +200,6 @@ class costcenter_model extends CI_Model
* @param number $Year : This is Budget year
* @return array $query->result_array() : This is result of the query
*/
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()
{
@ -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;
$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));
// print_r($query->result());
//echo count($query->result());
@ -89,10 +94,30 @@ function attendance($EmpID,$dates)
function getAllAttendance($EmpID,$CURMONTH)
{
$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));
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)
{
$sql="select DateofJoining from T_Employee_Details where EmpID =? ";
@ -160,7 +185,13 @@ $sql= "select * FROM T_Emp_Pay_Data where EmpID = ?;";
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);
return $query->result();
@ -168,7 +199,13 @@ $sql= "select * FROM T_Emp_Pay_Data where EmpID = ?;";
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);
return $query->result();
@ -176,7 +213,13 @@ $sql= "select * FROM T_Emp_Pay_Data where EmpID = ?;";
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);
return $query->result();
@ -184,7 +227,13 @@ $sql= "select * FROM T_Emp_Pay_Data where EmpID = ?;";
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);
return $query->result();
@ -477,12 +526,23 @@ function servicebudgt ()
}
function servicebal ()
{
$sql="SELECT ROUND(sum(BudgetAmount)-(SELECT
ifnull((sum(distinct PO_Line_Item.Quantity * PO_Line_Item.Rate)),0)
as Util_Amount
$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,
case Cost_Center_Budget.BudgetType
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
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_LineItem PO_Line_Item on Cost_Center_Budget.CostCenterCode=PO_Line_Item.CostCenterCode
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);
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_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.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!= ''){
@ -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_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) ";
pm.Status != 'ST030' ";
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";
//ho $sql;
// echo $m;
// echo $sid;
//echo $sql;
$query = $this->db->query($sql);
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_SupplierDetailsN sd on sd.SupplierID = pm.SupplierID
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)";
$query = $this->db->query($sql);
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_SupplierDetailsN sd on sd.SupplierID = pm.SupplierID
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";
$query = $this->db->query($sql,array($month,$year));
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_SupplierDetailsN sd on sd.SupplierID = pm.SupplierID
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";
$query = $this->db->query($sql,array());
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_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) ";
pm.Status != 'ST030' and pm.PONO in (select PONO from T_IGR_Master) ";
if ($cname!= ''){
@ -1551,7 +1613,9 @@ 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
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!= ''){
@ -1573,6 +1637,51 @@ if ($cname!= ''){
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(){
$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_MaterialMaster mm on mm.MaterialCode = pl.MaterialCode
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
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 )
@ -1595,7 +1704,7 @@ FROM T_PurchaseOrder_Master pm
left join T_PurchaseOrder_LineItem pl on pl.PONO = pm.PONO
left join T_MaterialMaster mm on mm.MaterialCode = pl.MaterialCode
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())
group by supplier_name,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_MaterialMaster mm on mm.MaterialCode = pl.MaterialCode
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()
group by supplier_name,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_MaterialMaster mm on mm.MaterialCode = pl.MaterialCode
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";
$query = $this->db->query($sql);
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_MaterialMaster mm on mm.MaterialCode = pl.MaterialCode
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
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 )
@ -1652,7 +1761,7 @@ FROM T_PurchaseOrder_Master pm
left join T_PurchaseOrder_LineItem pl on pl.PONO = pm.PONO
left join T_MaterialMaster mm on mm.MaterialCode = pl.MaterialCode
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."'
group by supplier_name,material_name";
$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_MaterialMaster mm on mm.MaterialCode = pl.MaterialCode
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
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 )
@ -1680,7 +1789,7 @@ FROM T_PurchaseOrder_Master pm
left join T_PurchaseOrder_LineItem pl on pl.PONO = pm.PONO
left join T_MaterialMaster mm on mm.MaterialCode = pl.MaterialCode
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())
group by 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_MaterialMaster mm on mm.MaterialCode = pl.MaterialCode
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()
group by 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_MaterialMaster mm on mm.MaterialCode = pl.MaterialCode
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
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 )
@ -1725,7 +1834,7 @@ FROM T_PurchaseOrder_Master pm
left join T_PurchaseOrder_LineItem pl on pl.PONO = pm.PONO
left join T_MaterialMaster mm on mm.MaterialCode = pl.MaterialCode
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."'
group by supplier_name,material_name";
$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_MaterialMaster mm on mm.MaterialCode = pl.MaterialCode
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."'
group by supplier_name,material_name";
$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_MaterialMaster mm on mm.MaterialCode = pl.MaterialCode
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!= ''){
@ -1810,7 +1919,7 @@ 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
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."' ";
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_MaterialMaster mm on mm.MaterialCode = pl.MaterialCode
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."' ";
if ($fa and $aa != ''){
@ -1869,15 +1978,49 @@ if ($fa and $aa != ''){
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 ";
$query = $this->db->query($sql);
return $query->result();
$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,
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()
{
$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);
return $query->result();
@ -1907,11 +2050,28 @@ if ($fa and $aa != ''){
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
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);
//print_r($this->db->last_query());
//echo $sql;
@ -1920,9 +2080,26 @@ if ($fa and $aa != ''){
}
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
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));
//print_r($this->db->last_query());
return $query->result();
@ -1956,12 +2133,33 @@ function INRSymbol()
}
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
LEFT JOIN t_accountcode tac ON tac.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,
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 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//
function monthlypayments()
{
@ -1971,12 +2169,30 @@ function INRSymbol()
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
join t_accountcode ac on ac.code=tinc.account_code
group by account_code";
$fdate= date("Y-m-d",strtotime($fdate));
$tdate=date("Y-m-d",strtotime($tdate));
$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);
//echo $fdate;
//print_r($this->db->last_query());
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
* @return array $result : This is result of the query
* @return array $result : result of the query(returns Department details)
*/
function departmentListing()
{
@ -21,7 +21,7 @@ class department_model extends CI_Model
/**
* To get Department information by id
* @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)
{
@ -54,7 +54,7 @@ class department_model extends CI_Model
/**
* To get department details
* @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='')
{
@ -66,8 +66,8 @@ class department_model extends CI_Model
}
/**
* To store edited department details
* @param array $department : This wil have all edited department datas
* To store edited department details repective depcode
* @param array $department : This will have all edited department datas
* @param number $DEPCode : This is department code
**/
function Updatedepartment($department, $DEPCode)

View File

@ -7,7 +7,7 @@ class employeedetails_model extends CI_Model
/**
* 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()
{
@ -24,7 +24,7 @@ class employeedetails_model extends CI_Model
/**
* 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()
{
@ -38,14 +38,14 @@ class employeedetails_model extends CI_Model
/**
* 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 )
{
$this->db->select('ConfigValue');
$this->db->from('T_ConfigDetails');
$this->db->where('Config_id ',$ConfigID );
$this->db->where('Config_id ',$ConfigID );
$query = $this->db->get();
return $query->result();
@ -68,7 +68,7 @@ class employeedetails_model extends CI_Model
/**
* To store employee details
* @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)
{
@ -96,7 +96,7 @@ class employeedetails_model extends CI_Model
/**
* To get employee details
* @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)
{
@ -114,7 +114,7 @@ class employeedetails_model extends CI_Model
/**
* To get the Employee department on respective Employee
* @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)
{
@ -127,9 +127,9 @@ class employeedetails_model extends CI_Model
/**
* To check respective Employee emailid already exists or not
* @param number $empid : this is employee Id
* @param number $email : this is employee's emailid
* @return array $query->result_array() : result of the query
* @param number $empid : Optional :this is employee Id
* @param number $email : Optional :this is employee's emailid
* @return array $query->result_array() : result of the query (returns employee email id)
**/
function checkMailExists($email='',$Empid='')
{
@ -148,10 +148,10 @@ class employeedetails_model extends CI_Model
}
/**
* To check respective Employee aadhar no already exists or not
* @param number $Empid : this is employee Id
* To get respective Employee aadhar no
* @param number $Empid : Optional : this is employee Id
* @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='')
{
@ -170,10 +170,10 @@ class employeedetails_model extends CI_Model
}
/**
* To check respective Employee's panno already exists or not
* @param number $Empid : this is employee Id
* @param number $AadharNo : this is employee's pan no
* @return array $query->result_array() : result of the query
* To get respective Employee's panno
* @param number $Empid : Optional : this is employee Id
* @param number $PANNo : this is employee's pan no
* @return array $query->result_array() : result of the query (returns employee pan no)
**/
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)
* @return array $query->result_array() : result of the query
* @return array $query->result_array() : result of the query (returns profilepic name)
**/
function checkPhotoExists($Pic)
{
@ -211,7 +211,7 @@ class employeedetails_model extends CI_Model
/**
* 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( )
{
@ -225,7 +225,7 @@ class employeedetails_model extends CI_Model
/**
* To get bank details
* @return array $result : result of the query
* @return array $result : result of the query (returns bank details)
**/
function getBankDetails()
{

View File

@ -5,7 +5,7 @@ class emppaydate_model extends CI_Model
/**
* 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()
{
@ -19,7 +19,7 @@ class emppaydate_model extends CI_Model
/**
* 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)
{
@ -32,8 +32,8 @@ class emppaydate_model extends CI_Model
/**
* To store the employee payments datas
* @param $emppay
* @return array $paydataid :
* @param $emppay : This will have all the employee pay details
* @return array $paydataid : result of the query (returns as count in number)
*/
function addNewemppay($emppay)
{
@ -49,9 +49,9 @@ class emppaydate_model extends CI_Model
/**
* To store the employees loan information
* @param string $string :
* @param array $dataarray :
* @return array $loanid :
* @param string $string : This have 'add' or 'edit'
* @param array $dataarray : This will have all employee's loan information
* @return array $loanid : result of the query (returns as counts in number)
*/
function addLoanInfo($dataarray,$string)
{
@ -72,8 +72,8 @@ class emppaydate_model extends CI_Model
/**
* To get the employees payment information
* @param string $paydataid:
* @return array $loanid :
* @param string $paydataid : This is pay data id
* @return array $query->result() : result of the query (returns employee payment details with loan information)
*/
function getUserInfo($paydataid)
{
@ -88,7 +88,7 @@ class emppaydate_model extends CI_Model
/**
* To store edited emppay information
* @param array $emppaydatas :
* @param array $emppaydatas : This will have all edited employee payment details
*/
function editemppay($emppaydatas)
{
@ -102,7 +102,7 @@ class emppaydate_model extends CI_Model
/**
* 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
*/
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
* @return array $result : result of the query
* @return array $result : result of the query (returns igr informations)
*/
function igrListing()
{
@ -23,7 +23,7 @@ class inwardgateregister_model extends CI_Model
/**
* To get the po details
* @return array $result : result of the query
* @return array $result : result of the query (returns po information)
*/
function getpurchaseorder()
{
@ -46,8 +46,8 @@ class inwardgateregister_model extends CI_Model
/**
* To get the po details for revalant Po
* @param number $PO : this is po number
* @return array $query->result() : result of the query
* @param number $PO : This is po number
* @return array $query->result() : result of the query (returns po details)
*/
function viewpurchaseorder($PO)
{
@ -68,9 +68,9 @@ class inwardgateregister_model extends CI_Model
/**
* To store the igr master details
* @param array $igrM : This will have all igr master details
* @var number $insert_id :
* @return array $query->result() : result of the query
* @param array $igrM : This will have all igr master details
* @var number $insert_id : This will have insertion count
* @return array $query->result() : result of the query (returns igr no based on count value)
*/
function addigrM($igrM)
{
@ -92,9 +92,9 @@ class inwardgateregister_model extends CI_Model
/**
* To store the igr child details
* @param array $igrD : This will have all igr child details
* @var number $insert_id :
* @return array $query->result() : result of the query
* @param array $igrD : This will have all igr child details
* @var number $insert_id : This will have insertion count
* @return array $query->result() : result of the query (returns igr lineitem no based on count value)
*/
function addigrD($igrD)
{
@ -115,14 +115,13 @@ class inwardgateregister_model extends CI_Model
/**
* To get igr details for revalant IGRNO
* @param number $IGRNO : This is IGRNO
* @return array $result : result of the query
* @param number $IGRNO : This is IGRNO
* @return array $result : result of the query (returns igr details)
*/
function viewigr($IGRNO)
{
$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->from('T_IGR_Master igr');
$this->db->join('T_IGR_Details igrd','igrd.IGRNO = igr.IGRNO');
$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
* @param number $PONO : This is PONO
* @param number $PONO : This is PONO
* @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)
{
@ -155,14 +154,15 @@ class inwardgateregister_model extends CI_Model
/**
* To store edited po master details
* @param number $PONO : This is PONO
* @var array $POStatus : for updation operation : this will have igrcreated's const value and updater' id
* @param number $PONO : This is PONO
* @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 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)
{
$this->db->select('*');
$this->db->select('*');
$this->db->from('T_PurchaseOrder_LineItem');
$this->db->where('PONO',$PONO);
$this->db->where('Status !=',IGR_CREATED);
@ -180,9 +180,9 @@ class inwardgateregister_model extends CI_Model
/**
* 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
* @return array $result : result of the query
* @return array $result : result of the query (returns po received quantity )
*/
function getPOLineItemReceivedQty($PONO,$MaterialCode)
{

View File

@ -5,7 +5,7 @@ class Login_model extends CI_Model
/**
* 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
*/
function loginMe($email, $password)

View File

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

View File

@ -2,9 +2,11 @@
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()
{
$this->db->select('IGRNO');
@ -14,12 +16,10 @@ class mrir_model extends CI_Model
return $res->result();
}
/**
* This function is used to get the user listing count
* @param string $searchText : This is optional search text
* @param number $page : This is pagination offset
* @param number $segment : This is pagination limit
* @return array $result : This is result
/**
* To get mrircreated the igr list
* @return array $result : result of the query (returns mrircreated igr details)
*/
function ViewigrListing()
{
@ -36,12 +36,16 @@ class mrir_model extends CI_Model
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)
{
{
$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("DATE_FORMAT(IGRM.DeliveryChellanDate, '%d %m %Y') as DCdate");
$this->db->from('T_IGR_Master IGRM');
$this->db->join('T_PurchaseOrder_Master POMR ','IGRM.PONO=POMR.PONO');
$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);
$query = $this->db->get();
$result = $query->result();
//print_r($this->db->last_query());
$result = $query->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,
EMP.FirstName,DD.DEPCode,DD.DepartmentName,ReqLine.Quantity as RequestedQty,POL.Quantity
as OrderedQuantity ,(MD.ActualQuantityReceived) as ActualReceivedqty,(MD.QuantityAccepted) as
AcceptedQty,REQ.ReqDate, ReqLine.Status as ReqStatus,
st.StatusCode as ReqStatus,st.StatusName,
ReqLine.Remarks
from T_Requestion_Details ReqLine join T_PurchaseOrder_LineItem POL
on ReqLine.ReqNo = POL.ReqNo and ReqLine.MaterialCode = POL.MaterialCode
join T_Requestion_Master REQ on REQ.ReqNo = ReqLine.ReqNo
join T_PurchaseOrder_Master POMast on POMast.PONO=POL.PONO
join T_Status st on ReqLine.Status = st.StatusCode
join T_MRIR_Master MR on MR.PONO = POL.PONO join T_MRIR_Details MD
on MD.MRIRNO = MR.MRIRNO and ReqLine.MaterialCode = MD.MaterialCode join T_MaterialMaster MM on
MM.MaterialCode = ReqLine.MaterialCode join
T_Employee_Details EMP on EMP.EmpID = REQ.Requestedby join
T_DepartmentDetails DD on DD.DEPCode = EMP.Departmentcode where
POL.status in (?,?)
and ReqLine.Status not in(?) and POMast.status not in(?)
group by ReqLine.MaterialCode ,POL.PONO';
EMP.FirstName,DD.DEPCode,DD.DepartmentName,ReqLine.Quantity as RequestedQty,POL.Quantity
as OrderedQuantity ,(MD.ActualQuantityReceived) as ActualReceivedqty,(MD.QuantityAccepted) as
AcceptedQty,REQ.ReqDate, ReqLine.Status as ReqStatus,st.StatusCode as ReqStatus,st.StatusName,
ReqLine.Remarks
from T_Requestion_Details ReqLine
join T_PurchaseOrder_LineItem POL on ReqLine.ReqNo = POL.ReqNo and ReqLine.MaterialCode = POL.MaterialCode
join T_Requestion_Master REQ on REQ.ReqNo = ReqLine.ReqNo
join T_PurchaseOrder_Master POMast on POMast.PONO=POL.PONO
join T_Status st on ReqLine.Status = st.StatusCode
join T_MRIR_Master MR on MR.PONO = POL.PONO join T_MRIR_Details MD on MD.MRIRNO = MR.MRIRNO and ReqLine.MaterialCode = MD.MaterialCode
join T_MaterialMaster MM on MM.MaterialCode = ReqLine.MaterialCode
join T_Employee_Details EMP on EMP.EmpID = REQ.Requestedby
join T_DepartmentDetails DD on DD.DEPCode = EMP.Departmentcode
where POL.status in (?,?) and ReqLine.Status not in(?) and POMast.status not in(?)
group by ReqLine.MaterialCode ,POL.PONO';
$query = $this->db->query($subQuery,array(MRIR_APPROVED,PARTIAL_MRIRAPPROVED,REQITEM_NEW,PO_AMENDED));
//print_r($this->db->last_query());
return $query->result();
}
/* This function is used to list the MRIR value*/
function view_mrir()
{
$this->db->distinct();
$this->db->select('TMM.MRIRNO,TMM.PONO,TMM.IGRNO,TMM.MRIRStatus,ST.StatusName,IGRM.DeliveryChellanOrInvoiceNo,IGRM.DeliveryChellanDate,IGRM.VehicleNo,IGRM.CourierNo,TMD.StoreInchargeID,TMD.QualityInchargeID,TMD.PlantInchargeID,TMD.UpdateBY,POM.PODate,POM.POType,POM.CreatedBy,ED.FirstName as UpdatedbyName,ED1.FirstName as CreatedByName');
$this->db->from ('T_MRIR_Master TMM');
$this->db->join ('T_MRIR_Details TMD','TMM.MRIRNO=TMD.MRIRNO');
$this->db->join ('T_IGR_Master IGRM','TMM.IGRNO=IGRM.IGRNO');
$this->db->join ('T_IGR_Details IGRD','IGRM.IGRNO=IGRD.IGRNO');
$this->db->join ('T_PurchaseOrder_Master POM','TMM.PONO=POM.PONO');
$this->db->join ('tbl_users user','user.userid=TMD.UpdateBY','left');
$this->db->join ('T_Employee_Details ED','ED.EmpID = user.EmpID','left');
$this->db->join ('tbl_users user1','user1.userid = POM.CreatedBy','left');
$this->db->join ('T_Employee_Details ED1','ED1.EmpID = user1.EmpID','left');
$this->db->join ('T_Status ST','ST.StatusCode = TMM.MRIRStatus');
//$this->db->where('POM.status !=',PO_AMENDED);
$this->db->order_by ('TMM.MRIRNO','desc');
$query = $this->db->get();
return $query->result();
}
}
/**
* To list the MRIR value
* @return $query->result() : result of the query(returns as mrir details)
*/
function view_mrir()
{
$this->db->distinct();
$this->db->select('TMM.MRIRNO,TMM.PONO,TMM.IGRNO,TMM.MRIRStatus,ST.StatusName,IGRM.DeliveryChellanOrInvoiceNo,IGRM.DeliveryChellanDate,IGRM.VehicleNo,IGRM.CourierNo,TMD.StoreInchargeID,TMD.QualityInchargeID,TMD.PlantInchargeID,TMD.UpdateBY,POM.PODate,POM.POType,POM.CreatedBy,ED.FirstName as UpdatedbyName,ED1.FirstName as CreatedByName');
$this->db->from ('T_MRIR_Master TMM');
$this->db->join ('T_MRIR_Details TMD','TMM.MRIRNO=TMD.MRIRNO');
$this->db->join ('T_IGR_Master IGRM','TMM.IGRNO=IGRM.IGRNO');
$this->db->join ('T_IGR_Details IGRD','IGRM.IGRNO=IGRD.IGRNO');
$this->db->join ('T_PurchaseOrder_Master POM','TMM.PONO=POM.PONO');
$this->db->join ('tbl_users user','user.userid=TMD.UpdateBY','left');
$this->db->join ('T_Employee_Details ED','ED.EmpID = user.EmpID','left');
$this->db->join ('tbl_users user1','user1.userid = POM.CreatedBy','left');
$this->db->join ('T_Employee_Details ED1','ED1.EmpID = user1.EmpID','left');
$this->db->join ('T_Status ST','ST.StatusCode = TMM.MRIRStatus');
$this->db->order_by ('TMM.MRIRNO','desc');
$query = $this->db->get();
return $query->result();
}
/**
* To get the status name and code
* @return array $query->result() : result of the query(returns as status code and status name)
*/
function getStatus()
{
$this->db->select('StatusCode,StatusName');
@ -112,40 +125,46 @@ POL.status in (?,?)
$query = $this->db->get();
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()
{
$this->db->distinct();
$this->db->select('TMM.MRIRNO,TMM.PONO, TMM.IGRNO,IGRM.DeliveryChellanOrInvoiceNo,
IGRM.DeliveryChellanDate,IGRM.VehicleNo,IGRM.CourierNo,TMD.QualityInchargeID,
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,
MM.UOM, POL.Quantity,IGRD.QuantityAsPerInvoice, TMD.ActualQuantityReceived,TMD.QuantityAccepted,
TMD.QuantityRejected,ST.StatusName,TMD.Remarks,AdvanceAmount ');
IGRM.DeliveryChellanDate,IGRM.VehicleNo,IGRM.CourierNo,TMD.QualityInchargeID,
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,
MM.UOM, POL.Quantity,IGRD.QuantityAsPerInvoice, TMD.ActualQuantityReceived,TMD.QuantityAccepted,
TMD.QuantityRejected,ST.StatusName,TMD.Remarks,AdvanceAmount ');
$this->db->from ('T_MRIR_Master TMM');
$this->db->join ('T_MRIR_Details TMD','TMM.MRIRNO=TMD.MRIRNO');
$this->db->join ('T_IGR_Master IGRM','TMM.IGRNO=IGRM.IGRNO');
$this->db->join ('T_IGR_Details IGRD','IGRM.IGRNO=IGRD.IGRNO and IGRD.MaterialCode = TMD.MaterialCode');
$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_AdvanceRequest PUADV','POM.PONO=PUADV.PONO','left');
$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 ('tbl_users user','user.userid=TMD.UpdateBY');
$this->db->join ('T_Employee_Details ED','ED.EmpID = user.EmpID');
$this->db->join ('tbl_users user1','user1.userid = POM.ReleasedBy');
$this->db->join ('T_Employee_Details ED1','ED1.EmpID = user1.EmpID');
$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_MaterialMaster MM','MM.MaterialCode = IGRD.MaterialCode and POL.MaterialCode = MM.MaterialCode');
$this->db->join ('T_Status ST','ST.StatusCode = TMD.MRIRStatus');
$this->db->where('TMM.MRIRStatus',MRIR_APPROVED);
$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_Status ST','ST.StatusCode = TMD.MRIRStatus');
$this->db->where('TMM.MRIRStatus',MRIR_APPROVED);
$this->db->order_by('TMM.UpdatedOn','desc');
$query = $this->db->get();
//print_r($this->db->last_query());
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)
{
$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_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_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_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_MaterialMaster MM','TMD.MaterialCode = MM.MaterialCode');
$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 ('T_Employee_Details ED2','ED2.EmpID = user2.EmpID');
$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();
$result = $query->result();
//print_r( $this->db->last_query());
return $result;
}

View File

@ -787,11 +787,11 @@ function GetPOType($ReqNo)
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 ,
ROUND(((AfterSGST + AfterCGST +
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
join T_MaterialMaster Mat on Mat.MaterialCode = LineItem.MaterialCode
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
// 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 ,
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
@ -962,7 +962,7 @@ where LineItem.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,
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,

View File

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

File diff suppressed because one or more lines are too long

View File

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

View File

@ -13,7 +13,7 @@
<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 input {padding: 4px;}
.dataTables_filter {
width: 50%;
float: right;
@ -79,6 +79,7 @@
<option value="">Select Supplier</option>
<?php
foreach($cust as $item):
{?>
@ -161,6 +162,7 @@
<tbody>
<?php
if(!empty($spurchse)){
$apr = 0;
$may = 0;
$jun = 0;
@ -178,64 +180,50 @@
foreach ($spurchse as $result) { ?>
<tr>
<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 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->April);
if(!empty($result->April)) { echo round($result->April); } else {echo "-";}
?></td>
<td style="text-align:right;"><?php
$may= $may + round($result->May);
if(!empty($result->May)) { echo round($result->May); } else {echo "-";}
?></td>
<td style="text-align:right;"><?php
$jun= $jun + round($result->June);
if(!empty($result->June)) { echo round($result->June); } else {echo "-";}
?></td>
<td style="text-align:right;"><?php
$jul= $jul + round($result->July);
if(!empty($result->July)) { echo round($result->July); } else {echo "-";}
?></td>
<td style="text-align:right;"><?php
$aug= $aug + round($result->August);
if(!empty($result->August)) { echo round($result->August); } else {echo "-";}
?></td>
<td style="text-align:right;"><?php
$sep= $sep + $result->September;
if(!empty($result->September)) { echo round($result->September); } else {echo "-";}
?></td>
<td style="text-align:right;"><?php
$oct= $oct + round($result->October);
if(!empty($result->October)) { echo round($result->October); } else {echo "-";}
?></td>
<td style="text-align:right;"><?php
$nov= $nov + round($result->November);
if(!empty($result->November)) { echo round($result->November); } else {echo "-";}
?></td>
<td style="text-align:right;"><?php
$dec= $dec + round($result->December);
if(!empty($result->December)) { echo round($result->December); } else {echo "-";}
?></td>
<td style="text-align:right;"><?php
$jan= $jan + round($result->January);
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>
<td style="text-align:right;"><?php $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>
</td>
<td style="text-align:right;"><?php $may= $may + round($result->May); ?>
<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>
</td>
<td style="text-align:right;"><?php $jun= $jun + round($result->June); ?>
<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>
<td style="text-align:right;"><?php $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 'July';?>"><?php echo round($result->July);?> </a>
</td>
<td style="text-align:right;"><?php $aug= $aug + round($result->August); ?>
<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>
</td>
<td style="text-align:right;"><?php $sep= $sep + round($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 'September';?>"><?php echo round($result->September);?> </a>
</td>
<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 style="text-align:right;"><?php $nov= $nov + round($result->November); ?>
<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>
</td>
<td style="text-align:right;"><?php $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 'December';?>"><?php echo round($result->December);?> </a>
</td>
<td style="text-align:right;"><?php $jan= $jan + round($result->January); ?>
<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>
<td style="text-align:right;"><?php $feb= $feb + round($result->February); ?>
<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 style="text-align:right;"><?php $mar= $mar + round($result->March); ?>
<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>
</td>
<td style="text-align:right;"><?php $tot= $tot + round($result->qtotal); ?>
<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>
</td>
</tr>
<?php
@ -378,13 +366,14 @@
</tr>
</tfoot>
<?php } ?>
</table>
</div>
<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>
<tr>
<th style="text-align:center;">Supplier Name</th>
@ -407,7 +396,8 @@
</thead>
<tbody>
<?php
<?php
if(!empty($spurchse)){
$apr = 0;
$may = 0;
$jun = 0;
@ -423,65 +413,66 @@
$tot = 0;
foreach ($spurchse as $result) { ?>
<tr>
<td style="text-align:left;"><?php
if(!empty($result->supplier_name)) { echo $result->supplier_name; } else {echo "-";}
?></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 style="text-align:left;">
<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:right;"><?php
$sep= $sep + $result->vSeptember;
if(!empty($result->vSeptember)) { echo number_format($result->vSeptember,2,'.',''); } else {echo "-";}
?></td>
<td style="text-align:right;"><?php
$oct= $oct + round($result->vOctober);
if(!empty($result->vOctober)) { echo number_format($result->vOctober,2,'.',''); } else {echo "-";}
?></td>
<td style="text-align:right;"><?php
$nov= $nov + round($result->vNovember);
if(!empty($result->vNovember)) { echo number_format($result->vNovember,2,'.',''); } else {echo "-";}
?></td>
<td style="text-align:right;"><?php
$dec= $dec + round($result->vDecember);
if(!empty($result->vDecember)) { echo number_format($result->vDecember,2,'.',''); } else {echo "-";}
?></td>
<td style="text-align:right;"><?php
$jan= $jan + round($result->vJanuary);
if(!empty($result->vJanuary)) { echo number_format($result->vJanuary,2,'.',''); } else {echo "-";}
?></td>
<td style="text-align:right;"><?php
$feb= $feb + round($result->vFebruary);
if(!empty($result->vFebruary)) { echo number_format($result->vFebruary,2,'.',''); } else {echo "-";}
?></td>
<td style="text-align:right;"><?php
$mar= $mar + round($result->vMarch);
if(!empty($result->vMarch)) { echo number_format($result->vMarch,2,'.',''); } else {echo "-";}
?></td>
<td style="text-align:right;"><?php
$tot= $tot + round($result->vtotal);
if(!empty($result->vtotal)) { echo number_format($result->vtotal,2,'.',''); } else {echo "-";}
?></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 + number_format($result->vApril,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 'April';?>"><?php echo number_format($result->vApril,2,'.','');?> </a>
</td>
<td style="text-align:right;"><?php $may= $may + number_format($result->vMay,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 'May';?>"><?php echo number_format($result->vMay,2,'.','');?> </a>
</td>
<td style="text-align:right;"><?php $jun= $jun + number_format($result->vJune,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 'June';?>"><?php echo number_format($result->vJune,2,'.','');?> </a>
</td>
<td style="text-align:right;"><?php $jul= $jul + number_format($result->vJuly,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 'July';?>"><?php echo number_format($result->vJuly,2,'.','');?> </a>
</td>
<td style="text-align:right;"><?php $aug= $aug + number_format($result->vAugust,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 'August';?>"><?php echo number_format($result->vAugust,2,'.','');?> </a>
</td>
<td style="text-align:right;"><?php $sep= $sep + number_format($result->vSeptember,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 'September';?>"><?php echo number_format($result->vSeptember,2,'.','');?> </a>
</td>
<td style="text-align:right;"><?php $oct= $oct + number_format($result->vOctober,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 'October';?>"><?php echo number_format($result->vOctober,2,'.','');?> </a>
</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>
<?php
@ -624,6 +615,7 @@
</tr>
</tfoot>
<?php } ?>
</table>
</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>
<tbody>
<?php
<?php
if(!empty($spurchse)){
$apr = 0;
$may = 0;
$jun = 0;
@ -180,13 +181,13 @@
</td>
<td style="text-align:right;">
<?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>
</td>
<td style="text-align:right;">
<?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>
</td>
@ -392,13 +393,14 @@
</tr>
</tfoot>
<?php } ?>
</table>
</div>
<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>
<tr>
<th style="text-align:center;">Category</th>
@ -420,7 +422,8 @@
</thead>
<tbody>
<?php
<?php
if(!empty($spurchse)){
$apr = 0;
$may = 0;
$jun = 0;
@ -441,81 +444,81 @@
</td>
<td style="text-align:right;">
<?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 style="text-align:right;">
<?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 style="text-align:right;">
<?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 style="text-align:right;">
<?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 style="text-align:right;">
<?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 style="text-align:right;">
<?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 style="text-align:right;">
<?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 style="text-align:right;">
<?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 style="text-align:right;">
<?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 style="text-align:right;">
<?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 style="text-align:right;">
<?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 style="text-align:right;">
<?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 style="text-align:right;">
<?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>
</tr>
@ -652,6 +655,7 @@
</tr>
</tfoot>
<?php } ?>
</table>
</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')){
$frm = $this->input->post('from_date');
$t = $this->input->post('to_date');
echo $frm.'to'.$t;
echo $frm.'-to-'.$t;
}
?>
@ -163,7 +163,7 @@ if(!empty($mms))
</label>
<div class="input-group">
<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="February">February</option>
<option value="March">March</option>
@ -220,7 +220,7 @@ if(!empty($mms))
<div class="box-body">
<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>
<tr>
<th style="text-align:center">PO NO</th>

View File

@ -98,7 +98,7 @@ if(!empty($mms))
$t = $this->input->post('to_date');
echo $frm.'to'.$t;
echo $frm.'-to-'.$t;
}
?></p></h3></center>
@ -237,7 +237,7 @@ if(!empty($mms))
<div class="box-body">
<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>
<tr>
<th style="text-align:center">PO NO</th>

View File

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

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

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

View File

@ -227,7 +227,7 @@
<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>
<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;
border-left: 1px solid black;"><?php echo $record->HSNCODE;?></td>
<td style="text-align: center;border-right: 1px solid black;

View File

@ -235,7 +235,7 @@ function validate_Vechicle(){
{
if (reg.test(VehicleNo) == false)
{
alert('Please Enter Valid Vehicle Number');
swal('Please Enter Valid Vehicle Number');
return (false);
}
else
@ -272,37 +272,37 @@ function validate()
if($('#PONO').val()=='-1')
{
alert("Please select PurchaseOrder");
swal("Please select PurchaseOrder");
$('#PONO').focus();
return false;
}
else if($('#InvoiceNo').val() == '' )
{
alert('Please Enter Invoice Number' );
swal('Please Enter Invoice Number' );
$('#InvoiceNo').focus();
return false;
}
else if($('#InvoiceDate').val() == '' )
{
alert('Please Enter Invoice Date' );
swal('Please Enter Invoice Date' );
$('#InvoiceDate').focus();
return false;
}
else if (Noval == 0 )
{
alert('Advised Quantity is Empty.Please Enter the value');
swal('Advised Quantity is Empty.Please Enter the value');
return false;
}
else if($('#VehicleNo').val() == '' && $('#CourierNo').val() == '')
{
alert('Please Enter the Vechicle / Courier Number');
swal('Please Enter the Vechicle / Courier Number');
return false;
}
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;
}
else
@ -463,7 +463,7 @@ $('<input>').attr({
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();
}
else
@ -474,7 +474,7 @@ $('<input>').attr({
}
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);
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).val('');
return false;
@ -510,7 +510,7 @@ function validateReceivedQuantity(Rowid){
}
else if(((InvoiceQty+RecQty) - OrderedQty) > 0.00){
alert("Order is completed.")
swal("Order is completed.")
$("#QuantityAsPerInvoice"+Rowid).focus();
$('#QuantityAsPerInvoice'+Rowid).val('');
return false;
@ -567,7 +567,7 @@ function Save()
}
else
{
alert("Error");
swal("Error");
}

View File

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

View File

@ -324,13 +324,13 @@ function validate()
if (Noval == 0 )
{
alert('Actual Quantity is Empty.Please Enter the value');
swal('Actual Quantity is Empty.Please Enter the value');
return false;
}
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;
}
else
@ -353,7 +353,7 @@ function setactual(rowId)
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).val('');
@ -386,13 +386,13 @@ function setremark(rowId)
if(data){
$("#content").load('hide');
alert(data);
swal(data);
window.location ="viewmaterialinspectionreport";
}
else
{
alert("Error");
swal("Error");
}

View File

@ -1235,7 +1235,9 @@
<label>Date</label>
<div class="form-group">
<?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');
echo form_input($data);
?>

View File

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

View File

@ -203,7 +203,7 @@
<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>
<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;
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;

View File

@ -1,159 +1,318 @@
<?php
$DraftCount =0;
$StoreReqNo = '';
//echo $StoreReqNo;
if(!empty($Store))
{
foreach ($Store as $St)
{
if ($St->StatusName=='DRAFT')
{
$DraftCount++;
$StoreReqNo = $St->StoreReqNo;
}
}
//echo $StoreReqNo;
}?>
<style>
span.highlight {
background-color: yellow;
}
</style>
<div class="content-wrapper">
<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>
</div>
<?php if($DraftCount > 0 ) { ?><p>
<span class="highlight">The Store Requisition No <b><?php echo $StoreReqNo;?></b> is in Draft status.</span> Please act on the requisition.<span class="highlight">Then only you can raise New StoreRequisition. </span>
</p> <?php } ?>
<div class="row">
<div class="col-xs-12 text-right" style="margin-bottom:-3%;">
<div class="form-group">
<?php if($DraftCount == 0)
{ ?>
<a class="btn btn-primary" href="<?php echo base_url(); ?>storerequisitionlist/addstores"/>Raise Store Requisition</a><?php
}?>
</div>
</div>
</div>
<table id="Requisition" class="table table-bordered table-hover" style="background-color:#fff;font-size:12px;">
<thead style="background-color:#ddf">
<tr>
<th>Store Requisition No</th>
<th>Tot No.OfLineItem </th>
<th>Issued Item Count</th>
<th>Pending Item Count</th>
<th>Status</th>
<th>Requested Date</th>
<th>Action</th>
</tr>
</thead>
<?php
if(!empty($Store))
{
// echo "VIEW";
// print_r($Store);
foreach($Store as $record)
{ //print_r($record);
?>
<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');
alert(data);
location.reload();
}
else
{
alert("Error");
}
}});
}
}
</script>
<script>
$(function () {
$('#Requisition').DataTable({
"paging": true,
"lengthChange": true,
"searching": true,
"ordering": true,
"info": true,
"autoWidth": true
});
});
</script>
<?php
$DraftCount =0;
$StoreReqNo = '';
//echo $StoreReqNo;
if(!empty($Store))
{
foreach ($Store as $St)
{
if ($St->StatusName=='DRAFT')
{
$DraftCount++;
$StoreReqNo = $St->StoreReqNo;
}
}
//echo $StoreReqNo;
}?>
<style>
span.highlight {
background-color: yellow;
}
</style>
<div class="content-wrapper">
<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>
</div>
<?php if($DraftCount > 0 ) { ?><p>
<span class="highlight">The Store Requisition No <b><?php echo $StoreReqNo;?></b> is in Draft status.</span> Please act on the requisition.<span class="highlight">Then only you can raise New StoreRequisition. </span>
</p> <?php } ?>
<div class="row">
<div class="col-xs-12 text-right" style="margin-bottom:-3%;">
<div class="form-group">
<?php if($DraftCount == 0)
{ ?>
<a class="btn btn-primary" href="<?php echo base_url(); ?>storerequisitionlist/addstores"/>Raise Store Requisition</a><?php
}?>
</div>
</div>
</div>
<table id="Requisition" class="table table-bordered table-hover" style="background-color:#fff;font-size:12px;">
<thead style="background-color:#ddf">
<tr>
<th>Store Requisition No</th>
<th>Tot No.OfLineItem </th>
<th>Issued Item Count</th>
<th>Pending Item Count</th>
<th>Status</th>
<th>Requested Date</th>
<th>Action</th>
</tr>
</thead>
<?php
if(!empty($Store))
{
// echo "VIEW";
// print_r($Store);
foreach($Store as $record)
{ //print_r($record);
?>
<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