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;
@ -767,6 +767,7 @@ 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->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();
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);
@ -475,6 +483,11 @@ class report extends BaseController
$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['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);
@ -738,6 +756,11 @@ class report extends BaseController
$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['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);
@ -769,6 +792,11 @@ class report extends BaseController
$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['material']=$this->dahsboard_Model->material_name();
$data['cust']=$this->dahsboard_Model->customer_name();
$data['finyear']=$this->dahsboard_Model->report_finyear();
if($this->DEPCode == MANAGEMENT)
{
@ -780,6 +808,68 @@ class report extends BaseController
}
}
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');
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);
//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);
}
$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,7 +1,11 @@
<?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.
@ -9,128 +13,239 @@ require APPPATH . '/libraries/BaseController.php';
* @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->global['pageTitle'] = 'Siddharth 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';
$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;
@ -138,16 +253,27 @@ class storestatus extends BaseController
}
die(json_encode(array('History' =>$HTML,'AvalStock'=>$TotalStock)));
}
/**
}
/**
* To load pagenotfound view
*/
function pageNotFound()
{
$this->global['pageTitle'] = 'Resico : 404 - Page Not Found';
$this->global['pageTitle'] = 'Siddharth : 404 - Page Not Found';
$this->loadViews("404", $this->global, NULL, NULL);
}
}
?>

775
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

@ -58,7 +58,12 @@ $sql="select EmpID,CONCAT(FirstName,' ',LastName) as name FROM T_Employee_Detai
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!= ''){
@ -1572,6 +1636,51 @@ if ($cname!= ''){
$query = $this->db->query($sql);
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(){
@ -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,7 +1978,24 @@ 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 ";
$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();
@ -1877,7 +2003,24 @@ if ($fa and $aa != ''){
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";
$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)
{
@ -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,7 +38,7 @@ 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 )
{
@ -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)

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)
{
@ -69,8 +69,8 @@ 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
* @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)
{
@ -93,8 +93,8 @@ 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
* @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)
{
@ -116,13 +116,12 @@ 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
* @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');
@ -156,6 +155,7 @@ class inwardgateregister_model extends CI_Model
/**
* To store edited po master details
* @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
@ -182,7 +182,7 @@ class inwardgateregister_model extends CI_Model
* To get po lineitem details for recieved qty
* @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

@ -6,7 +6,7 @@ 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
* @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="")
{
@ -95,7 +95,7 @@ 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
* @return array $query->result() : result of the query (returns public holiday rowcount)
*/
function checkHoliday($Date)
{
@ -110,7 +110,7 @@ class monthlypay_model extends CI_Model
* To store holiday 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)
{
@ -133,7 +133,7 @@ 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
* @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="")
{
@ -167,7 +167,7 @@ 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
* @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);
@ -253,12 +257,18 @@ function addNewmonthlisting($m_list)
return $m_list;
}
/**
* 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,33 +306,41 @@ function addNewmonthlisting($m_list)
}
/*permission form model */
/* 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;";
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()
{
@ -329,6 +351,12 @@ join T_DepartmentDetails as Dep on Dep.DEPCode=Emp.Departmentcode where Emp.IsA
}
/**
* 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');
@ -340,6 +368,7 @@ join T_DepartmentDetails as Dep on Dep.DEPCode=Emp.Departmentcode where Emp.IsA
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');
@ -54,36 +58,41 @@ class mrir_model extends CI_Model
$query = $this->db->get();
$result = $query->result();
//print_r($this->db->last_query());
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
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(?)
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*/
/**
* To list the MRIR value
* @return $query->result() : result of the query(returns as mrir details)
*/
function view_mrir()
{
$this->db->distinct();
@ -98,12 +107,16 @@ POL.status in (?,?)
$this->db->join ('tbl_users user1','user1.userid = POM.CreatedBy','left');
$this->db->join ('T_Employee_Details ED1','ED1.EmpID = user1.EmpID','left');
$this->db->join ('T_Status ST','ST.StatusCode = TMM.MRIRStatus');
//$this->db->where('POM.status !=',PO_AMENDED);
$this->db->order_by ('TMM.MRIRNO','desc');
$query = $this->db->get();
return $query->result();
}
/**
* To get the 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,16 +125,19 @@ 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');
@ -140,12 +156,15 @@ TMD.QuantityRejected,ST.StatusName,TMD.Remarks,AdvanceAmount ');
$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
@ -171,7 +188,7 @@ TMD.QuantityRejected,ST.StatusName,TMD.Remarks,AdvanceAmount ');
$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,

File diff suppressed because one or more lines are too long

View File

@ -145,6 +145,7 @@
<tbody>
<?php
if(!empty($spurchse)){
$apr = 0;
$may = 0;
$jun = 0;
@ -223,10 +224,7 @@
</tr>
<?php
}
?>
</tbody>
<tfoot width="100%">
@ -362,6 +360,7 @@
</tr>
</tfoot>
<?php } ?>
</table>
</div>
@ -392,6 +391,7 @@
<tbody>
<?php
if(!empty($spurchse)){
$apr = 0;
$may = 0;
$jun = 0;
@ -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;
@ -80,6 +80,7 @@
<?php
foreach($cust as $item):
{?>
<option value="<?php echo $item->SupplierName;?>"><?php echo $item->SupplierName ; ?></option>
@ -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>
@ -408,6 +397,7 @@
<tbody>
<?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;">
<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 style="text-align:left;"><?php
if(!empty($result->material_name)) { echo $result->material_name ; } else {echo "-";}
?></td>
<td style="text-align:right;"><?php
$apr= $apr + round($result->vApril);
if(!empty($result->vApril)) { echo number_format($result->vApril,2,'.',''); } else {echo "-";}
?></td>
<td style="text-align:right;"><?php
$may= $may + round($result->vMay);
if(!empty($result->vMay)) { echo number_format($result->vMay,2,'.',''); } else {echo "-";}
?></td>
<td style="text-align:right;"><?php
$jun= $jun + round($result->vJune);
if(!empty($result->vJune)) { echo number_format($result->vJune,2,'.',''); } else {echo "-";}
?></td>
<td style="text-align:right;"><?php
$jul= $jul + round($result->vJuly);
if(!empty($result->vJuly)) { echo number_format($result->vJuly,2,'.',''); } else {echo "-";}
?></td>
<td style="text-align:right;"><?php
$aug= $aug + round($result->vAugust);
if(!empty($result->vAugust)) { echo number_format($result->vAugust,2,'.',''); } else {echo "-";}
?>
</td>
?></td>
<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: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

@ -159,6 +159,7 @@
<tbody>
<?php
if(!empty($spurchse)){
$apr = 0;
$may = 0;
$jun = 0;
@ -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>
@ -421,6 +423,7 @@
<tbody>
<?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;
}
?>
@ -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>

View File

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

View File

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

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;

View File

@ -26,7 +26,7 @@ if(!empty($EmpCount))
<div class="content-wrapper">
<!-- Content Header (Page header) -->
<section class="content-header">
<center><h1> Accounts Department </h1> </center>
<center><h1> Accounts Department Dashboard</h1> </center>
</section>
<!-- Main content -->
<section class="content">
@ -46,15 +46,20 @@ if(!empty($EmpCount))
</div>
</div>
</center>
<div>
</div>
</section>
</div>
<?php
}
?>
<!-- HR Start part to-->
<style>
.small-box .icon {
top: 0px !important;
}
</style>
<?php
if($DEPCode == HR)
{
@ -68,12 +73,13 @@ if(!empty($EmpCount))
<section class="content">
<!-- Info boxes -->
<center>
<!-- Small boxes (Stat box) -->
<div class="row">
<!-- fix for small devices only -->
<div class="clearfix visible-sm-block"></div>
<div class="col-md-4 col-sm-4 col-xs-12">
<div class="info-box" style="min-height: 79px;">
<span class="info-box-icon bg-aqua" style="height: 79px;padding:16px;"><i class="fa fa-users"></i></span>
<div class="col-lg-3 col-xs-6">
<!-- small box -->
<div class="small-box bg-aqua">
<a href="#" class="small-box-footer"><p> <strong>TOTAL NO OF EMPLOYEES</strong> </p> </a>
<div class="inner">
<?php
if(!empty($totemp))
{
@ -81,116 +87,131 @@ if(!empty($EmpCount))
{
?>
<h3><?php echo $req->totemp;?></h3>
<p>&nbsp;</p>
<div class="info-box-content">
<span class="info-box-text" style="color:#00c0ef;text-align:center;" ><strong>TOTAL NO OF EMPLOYEES</strong></span>
<span class="info-box-number" style="color:black;text-align:center;"><?php echo $req->totemp;?></span>
</div>
<?php
}
}
?>
<!-- /.info-box-content -->
</div>
<div class="icon">
<i class="ion ion-android-contacts"></i>
</div>
<a href="#" class="small-box-footer"><br> </a>
</div>
</div>
<!-- ./col -->
<div class="col-lg-3 col-xs-6">
<!-- small box -->
<div class="small-box bg-red">
<a target= "_blank" href="<?php echo base_url(); ?>loanreports" class="small-box-footer"> <p> <strong>TOTAL LOAN</strong> </p></a>
<div class="inner">
<div class="col-md-4 col-sm-4 col-xs-12">
<a href="<?php echo base_url(); ?>loanreports">
<div class="info-box" style="min-height: 79px;">
<div class="col-md-6">
<?php if(!empty($totloan))
{
foreach($totloan as $req_p){
?>
<span class="info-box-text" style="color:#dd4b39;text-align:center;"><strong>TOTAL LOAN</strong></span>
<span class="info-box-number" style="color:black;text-align:center;"><i class="fa fa-rupee"></i><?php echo $req_p->totloan;?></span>
<h3> <i class="fa fa-rupee"></i><?php echo $req_p->totloan;?> </h3>
<p>&nbsp;</p>
<?php
}
}
?>
</div>
<div class="col-md-6">
<?php if(!empty($totrec))
<div class="icon">
<i class="ion ion-cash"></i>
</div>
<a target= "_blank" href="<?php echo base_url(); ?>loanreports" class="small-box-footer">
LOAN TO BE RECOVERED : <?php if(!empty($totrec))
{
foreach($totrec as $ordervalue)
{
?>
<span class="info-box-text" style="color:#00a65a; text-align:center;"><strong>LOAN TO BE RECOVERED</strong></span>
<span class="info-box-number" style="color:black; text-align:center;"><strong> <i class="fa fa-rupee"></i><?php echo $ordervalue->totrec;?></strong></span>
<i class="fa fa-rupee"></i><?php echo $ordervalue->totrec;?>
<?php
}
}
?>
?> </a>
</div>
</div>
<!-- ./col -->
<div class="col-lg-3 col-xs-6">
<!-- small box -->
<div class="small-box bg-yellow">
<a target="_blank" href="<?php echo base_url(); ?>loanreports" class="small-box-footer"> <p> <strong>SALARY COST</strong> </p> </a>
<div class="inner">
<h3 id=""><i class="fa fa-rupee"></i><?php echo $employeeSalary;?></h3>
<p>TODAY</p>
<!-- /.info-box-content -->
</div>
<div class="icon">
<i class="ion ion-calculator"></i>
</div>
<a class="small-box-footer"> THIS MONTH : <i class="fa fa-rupee"></i> <?php echo $totalSalary;?>
</a>
<!-- /.info-box -->
</div>
<div class="col-md-4 col-sm-4 col-xs-12" style="text-align:center">
<div class="info-box" style="min-height: 79px;">
<div class ="col-md-12">
<span class="info-box-text" style="color:block;"><strong>TOTAL EMPLOYEES ABSENT</strong></span>
</div>
<div class="col-md-6 col-sm-6">
<div class="col-md-12 col-sm-12 col-xs-12"><b>YESTERDAY</b></div>
<div class="col-md-12 col-sm-12 col-xs-12" style="padding:0px;">
<!-- <a href="#"> -->
<div style="padding: 5px 10px;">
<span class="info-box-number" style="color:black;"><?php echo $values;?></span>
</div>
<!-- </a> -->
<!-- /.info-box -->
</div>
</div>
<div class="col-md-6 col-sm-6">
<div class="col-md-12 col-sm-12 col-xs-12"><b>TODAY </b></div>
<!-- /.col -->
<div class="col-md-12 col-sm-12 col-xs-12" style="padding:0px;">
<div style="padding: 5px 10px;">
<span class="info-box-number" style="color:black;"><?php echo $today;?></span>
</div>
</div>
</div>
</div>
<!-- /.info-box-content -->
<!-- /col next -->
<div class="col-lg-3 col-xs-6">
<!-- small box -->
<div class="small-box bg-green">
<a href="#" class="small-box-footer"> <p> <strong>TOTAL EMPLOYEES ABSENT</strong> </p></a>
<div class="inner">
<h3> <?php echo $today;?></h3>
<p>TODAY</p>
</div>
<div class="icon">
<i class="ion ion-android-calendar"></i>
</div>
<a href="#" class="small-box-footer">YESTERDAY :<?php echo $values;?> </a>
</div>
</div>
<div class="row">
<!-- ./col -->
</div>
<!-- /.row -->
</center>
<div class="col-md-9" style="padding:0px;">
<!-- Emp performance box -->
<div class="box box-info">
<div class="box-header">
<!-- tools box -->
<div class="pull-right box-tools">
<button type="button" class="btn bg-teal btn-sm" data-widget="collapse" data-toggle="tooltip" title="Collapse" style="margin-right: 5px;">
<i class="fa fa-minus"></i></button>
</div>
<!-- /. tools -->
<div class="col-md-6 col-sm-6">
<h3 class="box-title">
<div class="col-md-8 col-sm-8">
<div style="width: 80% !important">
<?php
$options = array("0"=>'Select Employee');
//print_r( $options);
@ -205,43 +226,46 @@ if(!empty($EmpCount))
endforeach;
}
echo form_dropdown('emp', $options,set_value('emp'),'id="emp"' ,'required="true"' ,'class="form-control select2');
echo form_dropdown('emp', $options,set_value('emp'),'id="emp"' ,'class="form-control select2');
?>
</h3>
<!-- <a target="_blank" href="<?php echo base_url(); ?>employeeperform" class="btn btn-info">
View All </a> -->
</div>
</div>
<div class="col-md-6 col-sm-6">
<div class="box-body">
<div class="row">
<div class="col-md-6 col-sm-6" style="padding:0px;">
<div class="col-md-7 col-sm-7">
<div id="chart_div"></div>
</div>
<div class="col-md-6 col-sm-6">
<br><br><br>
<div class="info-box" style="min-height: 111px;">
<div class="col-md-12 col-sm-12">
<label>
<div class="col-md-5 col-sm-5">
<br>
<div class="pad box-pane-right bg-green">
<div class="description-block margin-bottom">
<h3 id="totaldays"><b>0</b></h3>
<h5 class="description-header">Working Days</h5>
No of Days Working
</label>
<div id="totaldays"><b>0</b></div>
</div>
<div class="col-md-12 col-sm-12">
<label>
<!-- /.description-block -->
<div class="description-block margin-bottom">
<h3 id="worked"><b>0</b></h3>
<h5 class="description-header">Days Present</h5>
No of Days Present
</label>
<div id="worked"><b>0</b></div>
</div>
<!-- /.description-block -->
</div>
</div>
</div>
</div>
<script type="text/javascript">
<script type="text/javascript">
google.charts.load('current', {'packages':['gauge']});
google.charts.setOnLoadCallback(drawChart);
@ -249,7 +273,7 @@ if(!empty($EmpCount))
var data = google.visualization.arrayToDataTable([
['Label', 'Value'],
['year', 0]
['Year', 0]
]);
@ -280,7 +304,7 @@ if(!empty($EmpCount))
url:"<?php echo base_url();?>user/attendanceyear",
success:function(json) {
console.log(json);
//alert(json);
// alert(json.workeds);
$('#content').loader('hide');
$('#totaldays').text(json.totaldays);
$('#worked').text(json.workeds)
@ -289,6 +313,9 @@ if(!empty($EmpCount))
data.setValue(0, 1, json.yeardata);
chart.draw(data, options);
},
error:function(){
swal('error');
}
});
@ -296,14 +323,14 @@ if(!empty($EmpCount))
}
else
{
alert('Please select the Employee');
swal('Please select the Employee');
return false;
}
});
}
</script>
</script>
<script type="text/javascript">
@ -312,73 +339,111 @@ if(!empty($EmpCount))
$("#employeeAttan").select2();
$("#emp").select2();
});
</script>
<!------ Month------>
<div class="col-md-6 col-sm-6">
</script>
<!------ Month------>
<div class="col-md-6 col-sm-6" style="padding:0px;">
<div class="col-md-8 col-sm-8">
<div style="width: 80% !important">
<?php
$options = array("0"=>'Select Employee');
//print_r( $options);
if(!empty($emplist))
{
foreach ($emplist as $SID):
$options[$SID->EmpID] = $SID->name.' '.' - '.' '.$SID->EmpID;
endforeach;
}
echo form_dropdown('employee', $options,set_value('employee'),'id="employee"' ,'required="true"' ,'class="form-control select2');
?>
</div>
</div>
<div class="col-md-6 col-sm-6">
<div class="col-md-7 col-sm-7">
<div id="chart_divs"></div>
</div>
<div class="col-md-6 col-sm-6">
<br><br><br>
<div class="info-box" style="min-height: 111px;">
<div class="col-md-12 col-sm-12">
<label>
<div class="col-md-5 col-sm-5">
<br>
<div class="pad box-pane-right bg-red">
<div class="description-block margin-bottom">
<h3 id="total_days"><b>0</b></h3>
<h5 class="description-header">Working Days</h5>
No of Days Working
</label>
<div id="total_days"><b>0</b></div>
</div>
<div class="col-md-12 col-sm-12">
<label>
<!-- /.description-block -->
<div class="description-block margin-bottom">
<h3 id="present"><b>0</b></h3>
<h5 class="description-header">Days Present</h5>
No of Days Present
</label>
<div id="present"><b>0</b></div>
</div>
<!-- /.description-block -->
<!-- <div class="description-block" style="margin:12px !important;">
<h5 class="description-header">Salary Upto Today</h5>
<i class="fa fa-rupee"></i> <h4 id="salaryInCurrentday"><b> 0.00</b></h4>
</div> -->
<!-- /.description-block -->
</div>
</div>
</div>
</div>
<!-- /end of new box -->
<!-- /.info-box -->
</div>
</center>
</div>
</div>
</div>
<!-- /.box-body-->
<!-- Start of List of employees absent-->
<div class="col-md-3">
<!-- DIRECT CHAT -->
<div class="box box-warning">
<div class="box-header with-border">
<h3 class="box-title">NAME OF ABSENTEES</h3>
<div class="box-tools pull-right">
<button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i>
</button>
</div>
</div>
<!-- /.box-header -->
<div class="box-body">
<!-- Conversations are loaded here -->
<div class="direct-chat-messages">
<!-- Message. Default to the left -->
<?php
if(!empty($absname)){
foreach ($absname as $abs) {
echo $abs.'<br/>';
?>
<?php }
}?>
</div>
<!--/.direct-chat-messages-->
</div>
<!-- /.box-body -->
<!-- /.box-footer-->
</div>
<!--/.direct-chat -->
</div>
<!-- /.col -->
<!-- End Of list of employees absent-->
<!-- /.box -->
</section>
</div>
<?php
@ -388,11 +453,12 @@ if(!empty($EmpCount))
google.charts.load('current', {'packages':['gauge']});
google.charts.setOnLoadCallback(drawChart);
function drawChart() {
function drawChart()
{
var data = google.visualization.arrayToDataTable([
['Label', 'Value'],
['month', 0]
['Month', 0]
]);
@ -405,9 +471,12 @@ if(!empty($EmpCount))
};
var chart = new google.visualization.Gauge(document.getElementById('chart_divs'));
chart.draw(data, options);
$('#employee').change(function() {
$('#emp').change(function() {
// alert();
var id = $('#employee').val();
var id = $('#emp').val();
$("#monthabs").val('');
if(id != '-1')
@ -418,7 +487,7 @@ $("#monthabs").val('');
data:{id:id},
dataType: 'json',
type:"POST",
url:"<?php echo base_url();?>user/attendancemonth",
url:"<?php echo base_url();?>user/monthattendance",
success:function(json) {
console.log(json);
@ -426,6 +495,7 @@ $("#monthabs").val('');
//alert(json.MatDetail);
$("#present").text(json.values);
$("#total_days").text(json.CUR_month);
$("#salaryInCurrentday").text(json.salaryInCurrentday);
@ -443,18 +513,26 @@ $("#monthabs").val('');
}
else
{
alert('Please select the Employee');
swal('Please select the Employee');
return false;
}
});
}
</script>
<!-- \\\\\\\\\\\\\\\ HR END of the part ////////////////////////-->
<!-- Dashboard for admin-->
<?php
if($role == ROLE_ADMIN && $DEPCode != MANAGEMENT)
if($role == ROLE_ADMIN && $DEPCode != MANAGEMENT && $DEPCode != HR)
{
?>
<div class="content">
@ -496,7 +574,7 @@ $("#monthabs").val('');
<!-- Dashboard for Manager department-->
<?php
if($role == ROLE_MANAGER && $DEPCode != MANAGEMENT && $DEPCode != FINANCE)
if($role == ROLE_MANAGER && $DEPCode != MANAGEMENT)
{
?>
<div class="content-wrapper">
@ -522,9 +600,7 @@ $("#monthabs").val('');
</div>
</div>
</center>
<div>
</div>
</section>
</div>
@ -739,28 +815,17 @@ collection:{container:"DTTT_dropdown dropdown-menu",buttons:{normal:"",disabled:
<p class="text-center">
<strong>
<?php
if (date('m') >= 4) {
$yearl = date('Y').'-'.(date('Y')+1);
} else {
$yearl = (date('Y')-1).'-'.date('Y');
}
$ab=$yearl;
$fa=substr($ab,0,-5);
$aa=substr($ab,5,5);
echo '1 April, '.$fa.' - 31 March, '.$aa.'';
?>
</strong>
</p>
@ -780,10 +845,9 @@ collection:{container:"DTTT_dropdown dropdown-menu",buttons:{normal:"",disabled:
<div class="progress-group">
<?php if(!empty($servicebudgt))
{
foreach($servicebudgt as $service)
{
?>
@ -799,16 +863,12 @@ collection:{container:"DTTT_dropdown dropdown-menu",buttons:{normal:"",disabled:
<br>
<!-- /.progress-group -->
<div class="progress-group">
<?php if(!empty($revenuebudgt))
{
foreach($revenuebudgt as $revenue)
{
?>
<span class="description-text"><strong style="font-size:16px;">REVENUE :&nbsp;&nbsp;</strong><strong style="color:#dd4b39;font-size:18px;"><i class="fa fa-rupee " style="padding: 5px;"></i><?php echo $revenue->totalrevenuebudget;?></strong></span>
@ -825,9 +885,11 @@ collection:{container:"DTTT_dropdown dropdown-menu",buttons:{normal:"",disabled:
<?php if(!empty($importbudgt))
{
foreach($importbudgt as $import)
{
?>
<span class="description-text"><strong style="font-size:16px;">IMPORT &nbsp;&nbsp;&nbsp;:&nbsp;&nbsp;</strong><strong style="color:#00a65a;font-size:18px;"><i class="fa fa-rupee " style="padding: 5px;"></i><?php echo $import->totalimportbudget?></strong></span>
<span class="description-text"><strong style="font-size:16px;">IMPORT &nbsp;&nbsp;&nbsp;:&nbsp;&nbsp;</strong><strong style="color:#00a65a;font-size:18px;"><i class="fa fa-rupee " style="padding: 5px;"></i><?php echo $import->totalimportbudget;?></strong></span>
<?php
@ -845,8 +907,7 @@ collection:{container:"DTTT_dropdown dropdown-menu",buttons:{normal:"",disabled:
{
?>
<span class="description-text"><strong style="font-size:16px;">CAPITAL &nbsp;&nbsp;&nbsp;:&nbsp;&nbsp</strong><strong style="color:#f39c12;font-size:18px;"><i class="fa fa-rupee " style="padding: 5px;"></i><?php echo $capital->totalcapitalbudget;?></strong></span>
<span class="description-text" ><strong style="font-size:16px;">CAPITAL &nbsp;&nbsp;&nbsp;:&nbsp;&nbsp</strong><strong style="color:#f39c12;font-size:18px;"><i class="fa fa-rupee " style="padding: 5px;"></i><?php echo $capital->totalcapitalbudget;?></strong></span>
<?php
@ -880,12 +941,15 @@ collection:{container:"DTTT_dropdown dropdown-menu",buttons:{normal:"",disabled:
if(!empty($servicebal))
{
foreach($servicebal as $serviceb)
$sb=$service->totalservicebudget-$serviceb->service;
{
?>
<div class="knob-label"><strong style="color:#00c0ef">SERVICE BUDGET</strong></div>
<input type="text" class="knob" data-thickness="0.4" data-readonly="true" value=<?php echo $serviceb->balservicebudget;?> data-min="20" data-max=<?php echo $service->totalservicebudget;?> data-width="" data-height="" data-fgColor="#00c0ef "> <br>
<input type="text" class="knob" data-thickness="0.4" data-readonly="true" value=<?php
echo $sb;?> data-min="20" data-max=<?php echo $service->totalservicebudget;?> data-width="" data-height="" data-fgColor="#00c0ef "> <br>
<div class="knob-label"><strong>TOTAL &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; :&nbsp;<i class="fa fa-rupee " ></i> <?php echo $service->totalservicebudget;?></strong></div>
<div class="knob-label"><strong>BALANCE :&nbsp;<i class="fa fa-rupee " ></i> <?php echo $serviceb->balservicebudget;?></strong></div>
<div class="knob-label"><strong>BALANCE :&nbsp;<i class="fa fa-rupee " ></i> <?php
echo $sb;?></strong></div>
</div>
<?php
}
@ -1157,7 +1221,7 @@ collection:{container:"DTTT_dropdown dropdown-menu",buttons:{normal:"",disabled:
revenueValues.push(obj[0].totalrevenue);
});
//console.log(serviceValues);
//alert(arr.total2);
var salesChartData = {
labels: [ "April", "May", "June", "July", "August", "September", "October", "November", "December","January", "February", "March"],
@ -1173,6 +1237,7 @@ collection:{container:"DTTT_dropdown dropdown-menu",buttons:{normal:"",disabled:
pointHighlightFill: "#fff",
pointHighlightStroke: "rgba(60,141,188,1)",
data:[serviceValues[3],serviceValues[4],serviceValues[5],serviceValues[6],serviceValues[7],serviceValues[8],serviceValues[9],serviceValues[10],serviceValues[11],serviceValues[0],serviceValues[1],serviceValues[2]]
},
{
@ -1291,8 +1356,8 @@ collection:{container:"DTTT_dropdown dropdown-menu",buttons:{normal:"",disabled:
},
{
value: 300,
color: "#3c8dbc",
highlight: "#3c8dbc",
color: "#5d0411",
highlight: "#5d0411",
label: "Opera"
},
{

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>
<body style="font-family: sans-serif;">
<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,12 +1,7 @@
<?php
$dt = new DateTime('now', new DateTimeZone('Asia/Kolkata'));
$CurrentDate = $dt->format('d-m-y');
// print_r($cost);die();
$CostCenterCode='';
$CostCenterName='';
$StoreReqNo='';
@ -15,8 +10,11 @@ $DepartmentName='';
$DEPCode = '';
$RowCount = 0;
$ReqBy = '';
if(!empty($ReqListDetails))
{
foreach ($ReqListDetails as $Req ) {
$CostCenterCode = $Req->CostCenterCode;
@ -27,75 +25,88 @@ foreach ($ReqListDetails as $Req ) {
$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">
@ -106,8 +117,6 @@ span.highlight {
?>
</div>
<div class="col-md-3">
<label>Requested Date</label>
<?php
@ -115,25 +124,17 @@ span.highlight {
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">
@ -155,11 +156,11 @@ span.highlight {
<th>Issuing Quantity</th>
<th>Comments</th>
</thead>
<tbody id='mytab'>
<tbody id='mytab'>
<?php
if(!empty($ReqItem))
{ //alert();
{ //swal();
$index = 0;
foreach($ReqItem as $record)
{
@ -167,23 +168,21 @@ span.highlight {
$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>
@ -194,113 +193,73 @@ span.highlight {
<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({
@ -308,7 +267,6 @@ var ReqLineItem = <?php echo json_encode($ReqItem, JSON_PRETTY_PRINT) ?>;
id: 'MaterialCode' + j,
name: 'MaterialCode'+ j,
value:obj.MaterialCode
}).appendTo('form');
$('<input>').attr({
@ -323,30 +281,26 @@ var ReqLineItem = <?php echo json_encode($ReqItem, JSON_PRETTY_PRINT) ?>;
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) )
@ -355,16 +309,17 @@ function SaveIssueQuantity(RowId,ReqQty,Issued)
}
else
{
alert('The Issued Quantity cannot be more than the Requested Quantity, Already Distributed Quantity is ' +Issued+ 'Maximun Qty can enter is '+maxqty);
swal('The Issued Quantity cannot be more than the Requested Quantity, Already Distributed Quantity is ' +Issued+ 'Maximun Qty can enter is '+maxqty);
$("#issuedQuantity"+RowId).focus();
$("#issuedQuantity"+RowId).val('');
return false;
}
}
}
}
}
}
function SaveRemarks(RowId)
{
var remks = $("#Comments"+RowId).val();
if( remks != '')
{
@ -375,11 +330,7 @@ function SaveRemarks(RowId)
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; ?>';
@ -390,11 +341,7 @@ else
}
$('#txtStatus').val(stat);
var id=$('#txtStatus').val();
var RequestedBy=$('#RequestedBy').val();
var CostCenter=$('#CostCenter').val();
var splitDepCode= $('#DepartmentName').val();
@ -404,74 +351,81 @@ else
{
if(document.getElementById('mytable').rows.length < 0)
{
alert('Please Select Line item to Store Requisition');
swal('Please Select Line item to Store Requisition');
$('#Deliverydt').focus();
return false;
}
else
{
console.log($('.requistion').serialize());
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);
swal(data);
$('#txtRowCount').val('');
$('#txtDeletedRow').val('');
//window.location = "storerequisitionlist";
//window.location = "storerequisitionlist";
}
else
{
alert("Error");
}
swal("Error");
}
}
});
}
}
}
}
}
}
function validate()
{
if($("option:selected", $("#CostCenter")).val() == '-1')
{
alert('Please Select CostCenter');
return false;
}
swal('Please Select CostCenter');
return false;
}
else if($("option:selected", $("#MaterialCode")).val() == '-1')
{
alert('Please Select MaterialCode');
swal('Please Select MaterialCode');
return false;
}
else if(document.getElementById('mytable').rows.length < 1)
{
alert('Please Add Line Item');
swal('Please Add Line Item');
return false;
}
else if(isExceed == 1)
{
alert('You dont have Budget and You cant Raise New StoreRequisition');
swal('You dont have Budget and You cant Raise New StoreRequisition');
return false;
}
else
{
return true;
}
}
@ -479,14 +433,16 @@ function Redirect()
{
window.location = "storerequisition";
}
</script>
<script>
$(function () {
$('#Items').DataTable({
"paging": true,
"lengthChange": true,
"searching": true,
@ -496,4 +452,5 @@ function Redirect()
});
});
</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>
<body style="font-family: sans-serif;">
<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>
<?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);
swal(data);
location.reload();
}
else
{
alert("Error");
}
else
{
swal("Error");
}
}});
}
}
</script>
<script>
$(function () {
$('#Requisition').DataTable({
"paging": true,
"lengthChange": true,
"searching": true,
"ordering": true,
"info": true,
"autoWidth": true
});
});
</script>

View File

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

View File

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