report changes merged in ria

This commit is contained in:
venbatechnologies@gmail.com 2017-12-19 10:54:20 +05:30
parent 33a76fe9f0
commit 6bcc120316
11 changed files with 1296 additions and 169 deletions

View File

@ -160,6 +160,16 @@ class quality extends BaseController
$this->loadViews("viewindreport", $this->global, $data, NULL);
}
function viewIndInwardReport()
{
$reportid = $this->uri->segment(3);
$data['reportdata'] = $this->quality_model->getIndividualInwardReportData($reportid);
$this->global['pageTitle'] = 'Resico : View Individual Report';
$this->loadViews("viewindInwardreport", $this->global, $data, NULL);
}
/**
@ -400,7 +410,7 @@ class quality extends BaseController
{
$data['records'] = $this->quality_model->getIGRNOforReport();
$data['emplist'] = $this->quality_model->getEmplistforReport();
$this->global['pageTitle'] = 'Siddharth : Inward Inspection';
$this->global['pageTitle'] = 'Resico : Inward Inspection';
$this->loadViews("inward_report_create", $this->global,$data,NULL);
}

View File

@ -23,10 +23,38 @@ class report extends BaseController
public function pending_report()
{
$this->global['pageTitle'] = 'Resico : Reports';
if ($this->input->post('btn_submit')) {
$this->global['pageTitle'] = 'Total Pending Requests Reports -';
$this->global['pageTitle'] = 'Total Pending Requests Reports -';
$data['pending_list']=$this->dahsboard_Model->req_list();
$ab=$this->input->post('financialyear');
$fa=substr($ab,0,-5);
$aa=substr($ab,5,5);
$m=$this->input->post('month');
$frm = $this->input->post('from_date');
$t = $this->input->post('to_date');
$agf = $this->input->post('aging_from');
$agt = $this->input->post('aging_to');
$data['finyear']=$this->dahsboard_Model->report_finyear();
$data['pending_list']=$this->dahsboard_Model->req_list($fa,$aa,$m,$frm,$t,$agf,$agt);
}
$data['finyear']=$this->dahsboard_Model->report_finyear();
if($this->DEPCode == MANAGEMENT)
{
@ -40,12 +68,37 @@ class report extends BaseController
public function releasedPO()
{
$this->global['pageTitle'] = 'Siddharth : Reports';
if ($this->input->post('btn_submit')) {
$this->global['pageTitle'] = 'Order Value - Released Reports - ';
$this->global['pageTitle'] = 'Order Value - Released Reports - ';
$ab=$this->input->post('financialyear');
$fa=substr($ab,0,-5);
$aa=substr($ab,5,5);
$m=$this->input->post('month');
$frm = $this->input->post('from_date');
$t = $this->input->post('to_date');
$agf = $this->input->post('total_order_value_From');
$agt = $this->input->post('total_order_value_To');
$data['finyear']=$this->dahsboard_Model->report_finyear();
$data['rel_po']=$this->dahsboard_Model->report_relpo($fa,$aa,$m,$frm,$t,$agf,$agt);
}
$data['finyear']=$this->dahsboard_Model->report_finyear();
$data['rel_po']=$this->dahsboard_Model->report_relpo();
//$data['rel_po']=$this->dahsboard_Model->report_relpo();
if($this->DEPCode == MANAGEMENT)
{
@ -59,12 +112,45 @@ class report extends BaseController
public function openorderPO()
{
$this->global['pageTitle'] = 'Resico : Reports';
if ($this->input->post('btn_submit')) {
$this->global['pageTitle'] = 'Open Orders - Pending Reports - ';
$ab=$this->input->post('financialyear');
$fa=substr($ab,0,-5);
$aa=substr($ab,5,5);
$m=$this->input->post('month');
$frm = $this->input->post('from_date');
$t = $this->input->post('to_date');
$agf = $this->input->post('total_order_value_From');
$agt = $this->input->post('total_order_value_To');
$data['finyear']=$this->dahsboard_Model->report_finyear();
$data['open_po']=$this->dahsboard_Model->report_openpending($fa,$aa,$m,$frm,$t,$agf,$agt);
}
$data['finyear']=$this->dahsboard_Model->report_finyear();
$this->global['pageTitle'] = 'Open Orders - Pending Reports - ';
$data['open_po']=$this->dahsboard_Model->report_openpending();
//$data['open_po']=$this->dahsboard_Model->report_openpending();
if($this->DEPCode == MANAGEMENT)
{
@ -167,13 +253,29 @@ class report extends BaseController
}
public function MM_ReceiptValue()
{
$this->global['pageTitle'] = 'Material Master - Receipt Value Reports-';
$this->global['pageTitle'] = 'Resico : Reports';
if ($this->input->post('btn_submit')) {
$this->global['pageTitle'] = 'Material Master - Receipt Value Reports-';
$ab=$this->input->post('financialyear');
$fa=substr($ab,0,-5);
$aa=substr($ab,5,5);
$m=$this->input->post('month');
$data['finyear']=$this->dahsboard_Model->report_finyear();
$data['mmr']=$this->dahsboard_Model->report_MMReceiptValue($fa,$aa,$m);
}
$data['finyear']=$this->dahsboard_Model->report_finyear();
$data['mmr']=$this->dahsboard_Model->report_MMReceiptValue();
if($this->DEPCode == MANAGEMENT)
{

View File

@ -50,7 +50,7 @@ class user extends BaseController
$data['details']=$this->dahsboard_Model->reqdetail();
$data['pending_details']=$this->dahsboard_Model->req_pending();
$data['list']=$this->dahsboard_Model->req_list();
// $data['list']=$this->dahsboard_Model->req_list();
$data['serviceprogress']=$this->dahsboard_Model->serviceprogress();
$data['revenueprogress']=$this->dahsboard_Model->revenueprogress();

View File

@ -4,6 +4,7 @@ class dahsboard_Model extends CI_Model
{
/* HR DASHBOART Model START*/
function totemp()
{
@ -55,15 +56,27 @@ $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)" ;
$query = $this->db->query($sql,array($date));
// print_r($query->result());
//echo count($query->result());
return $query->result_array();
}
function dayAllPersentEmpSalary($WH,$OT,$date)
{
//echo $EmpID.'-'.$dates;
$sql="select ".$WH." from T_Attendance where Month_Year = ? and EmpID in (select EmpID from T_Attendance)";
$sql="select EmpID,".$WH.",".$OT." from T_Attendance where Month_Year = ? and EmpID in (select EmpID from T_Attendance)";
$query = $this->db->query($sql,array($date));
//return
return $query->result_array();
}
function attendance($EmpID,$dates)
{
//echo $EmpID.'-'.$dates;
@ -105,26 +118,44 @@ where att.Month_Year = ? and att.EmpID = ?;";
}
function persentEmployeeDetails($EmpID){
//join T_Attendance att on att.EmpID = pay.EmpID
$sql= "select * FROM T_Emp_Pay_Data where EmpID = ?;";
$query = $this->db->query($sql,array($EmpID));
return $query->result();
function attendanceyear($EmpID , $MONTH)
}
function attendanceyear($EmpID,$MONTH)
{
// $sql="select Att.EmpID,Att.Month_Year,Att.*,NoofDays,Days_Worked,emp.DateofJoining from T_Attendance Att
// join T_Employee_Details as emp on emp.EmpID = Att.EmpID
// where Att.Month_Year between ? and ? and Att.EmpID = ?";
// else
// (YEAR(Month_Year) = YEAR(CURRENT_DATE)-1 and MONTH(Month_Year) >= ? ) or ( YEAR(Month_Year) = YEAR(CURRENT_DATE) and MONTH(Month_Year) <= 3 )
$sql = 'select sum(NoofDays) as TotalWorkingDays,sum(Days_worked) as DaysWorked from T_Attendance where
case
when (month(Month_Year) >=4) then
(YEAR(Month_Year) = YEAR(CURRENT_DATE) and MONTH(Month_Year) >= ? ) or ( YEAR(Month_Year) = YEAR(CURRENT_DATE)+1 and MONTH(Month_Year) <= 3 )
else
(YEAR(Month_Year) = YEAR(CURRENT_DATE)-1 and MONTH(Month_Year) >= ? ) or ( YEAR(Month_Year) = YEAR(CURRENT_DATE) and MONTH(Month_Year) <= 3 )
end and EmpID = ? and month(Month_Year) != month(current_date());';
$query= $this->db->query($sql,array($MONTH, $MONTH, $EmpID));
$query= $this->db->query($sql,array($MONTH, $EmpID));
return $query->result();
}
/* HR DASHBOARD Model END*/
function totalpurchaseorder(){
@ -476,27 +507,44 @@ WHERE Cost_Center_Budget.BudgetType='REVENUE' and YEAR(STR_TO_DATE(`BudgetYear`,
function req_list(){
function req_list($fa,$aa,$m,$frm,$t,$agf,$agt){
$sql="select date_format(mas.ReqDate,'%d-%m-%Y') as ReqDate,mas.ReqNo,emp.FirstName as Requestedby,dep.DepartmentName,mas.ReqType,DATEDIFF(CURDATE(),mas.ReqDate) AS Aging from T_Requestion_Master as mas
join T_CostCenter_Master cos on cos.CostCenterCode = mas.CostCenterCode
join T_Employee_Details emp on emp.EmpID = mas.Requestedby
join T_DepartmentDetails dep on dep.DEPCode=emp.Departmentcode
where mas.Status = 'ST002'
";
if ($fa and $aa != ''){
$sql.=" and (mas.ReqDate >= '".$fa."-04-01' and mas.ReqDate <= '".$aa."-03-31')";
}
if ($m!= ''){
$sql.="and monthname(mas.ReqDate) = '".$m."'";
}
if ($frm and $t != ''){
$fromd= date("Y-m-d",strtotime($frm));
$tod=date("Y-m-d",strtotime($t));
$sql.="and date(mas.ReqDate) >= '".$fromd."'
and date(mas.ReqDate) <= '".$tod."'";
}
if ($agf and $agt != ''){
$sql.="and DATEDIFF(CURDATE(),mas.ReqDate) >= '".$agf."'
and DATEDIFF(CURDATE(),mas.ReqDate) <= '".$agt."'";
}
$query = $this->db->query($sql);
//print_r($this->db->last_query());
return $query->result();
}
}
function report_relpo(){
function report_relpo($fa,$aa,$m,$frm,$t,$agf,$agt){
$sql="select Mast.PONO,Mast.POType,date_format(Mast.PODate,'%d-%m-%Y') as PODate,date_format(Mast.ReleasedOn,'%d-%m-%Y') as ReleasedDate,Dept_Details.DepartmentName As Dept_Name,Mast.TotalOrderValue
from T_PurchaseOrder_Master Mast
JOIN T_PurchaseOrder_LineItem Det on Det.PONO=Mast.PONO
@ -507,17 +555,38 @@ JOIN T_CostCenter_Master as Cost on
Cost.CostCenterCode=Req.CostCenterCode
JOIN T_CostCenter_Budget as Cost_Center_Bdgt on Cost.CostCenterCode=Cost_Center_Bdgt.CostCenterCode
where Mast.Status='ST026'
group by Mast.PONO";
";
if ($fa and $aa != ''){
$sql.=" and (Mast.PODate >= '".$fa."-04-01' and Mast.PODate <= '".$aa."-03-31')";
}
if ($m!= ''){
$sql.="and monthname(Mast.PODate) = '".$m."'";
}
if ($frm and $t != ''){
$fromd= date("Y-m-d",strtotime($frm));
$tod=date("Y-m-d",strtotime($t));
$sql.="and date(Mast.PODate) >= '".$fromd."'
and date(Mast.PODate) <= '".$tod."'";
}
if ($agf and $agt != ''){
$sql.="and Mast.TotalOrderValue >= '".$agf."'
and Mast.TotalOrderValue <= '".$agt."'";
}
$sql.=" group by Mast.PONO";
$query = $this->db->query($sql);
return $query->result();
}
}
function report_openpending(){
function report_openpending($fa,$aa,$m,$frm,$t,$agf,$agt){
$sql="select Mast.PONO as PONO,Mast.POType as POType,date_format(Mast.PODate,'%d-%m-%Y') as PODate,date_format(Mast.ApprovedOn,'%d-%m-%Y') as ApprovedDate,Dept_Details.DepartmentName As Dept_Name,Mast.TotalOrderValue
from T_PurchaseOrder_Master Mast
JOIN T_PurchaseOrder_LineItem Det on Det.PONO=Mast.PONO
@ -527,9 +596,36 @@ JOIN T_DepartmentDetails Dept_Details on Dept_Details.DEPCode=Emp_Det.Department
JOIN T_CostCenter_Master as Cost on
Cost.CostCenterCode=Req.CostCenterCode
JOIN T_CostCenter_Budget as Cost_Center_Bdgt on Cost.CostCenterCode=Cost_Center_Bdgt.CostCenterCode
where Mast.Status='ST025' or Mast.Status='ST005'
group by PONO,POType,Dept_Name";
where (Mast.Status='ST025' or Mast.Status='ST005')
";
if ($fa and $aa != ''){
$sql.=" and (Mast.PODate >= '".$fa."-04-01' and Mast.PODate <= '".$aa."-03-31')";
}
if ($m!= ''){
$sql.="and monthname(Mast.PODate) = '".$m."'";
}
if ($frm and $t != ''){
$fromd= date("Y-m-d",strtotime($frm));
$tod=date("Y-m-d",strtotime($t));
$sql.="and date(Mast.PODate) >= '".$fromd."'
and date(Mast.PODate) <= '".$tod."'";
}
if ($agf and $agt != ''){
$sql.="and Mast.TotalOrderValue >= '".$agf."'
and Mast.TotalOrderValue <= '".$agt."'";
}
$sql.=" group by PONO,POType,Dept_Name";
$query = $this->db->query($sql);
//echo $sql;
return $query->result();
@ -635,17 +731,28 @@ group by po.SupplierID,pl.MaterialCode";
}
function report_MMReceiptValue(){
function report_MMReceiptValue($fa,$aa,$m){
$sql="select
DATE_FORMAT(IF(pm.PODate = '0000-00-00', NOW(), pm.PODate), '%b-%Y') AS Month,
matv.MaterialCode,mat.MaterialName,mat.UOM,ROUND(AVG(matv.Rate),2) as Average_Rate
from T_MaterialItem_PO matv
join T_PurchaseOrder_Master pm on pm.CreatedDate = matv.CreatedDate
join T_MaterialMaster mat on matv.MaterialCode=mat.MaterialCode
group by matv.MaterialCode
order by monthname(pm.PODate)";
DATE_FORMAT(IF(pm.PODate = '0000-00-00', NOW(), pm.PODate), '%b-%Y') AS Month,
matv.MaterialCode,mat.MaterialName,mat.UOM,ROUND(AVG(matv.Rate),2) as Average_Rate
from T_MaterialItem_PO matv
join T_PurchaseOrder_Master pm on pm.CreatedDate = matv.CreatedDate
join T_MaterialMaster mat on matv.MaterialCode=mat.MaterialCode
where pm.PODate != 0 ";
if ($fa and $aa != ''){
$sql.=" and (pm.PODate >= '".$fa."-04-01' and pm.PODate <= '".$aa."-03-31')";
}
if ($m!= ''){
$sql.="and monthname(pm.PODate) = '".$m."'";
}
$sql.=" group by matv.MaterialCode";
$sql.=" order by monthname(pm.PODate)";
$query = $this->db->query($sql);
return $query->result();

View File

@ -28,6 +28,12 @@ if(!empty($mmr))
float: right;
}
.btn-success {
background-color: #5d0411;
border-color: #5d0411;
}
</style>
@ -45,11 +51,145 @@ if(!empty($mmr))
<!-- 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 - Material Master - Receipt Value</b></p></h3></center>
<center><h3 class="box-title"><p style="color:#5d0411"><b>Report - Material Master - Receipt Value</b> <br><br>
<?php
if($this->input->post('financialyear')){
$ab=$this->input->post('financialyear');
echo '('.$ab.')';
echo ' ';
}
if($this->input->post('month')){
$m=$this->input->post('month');
echo '('.$m.')';
echo ' ';
}
?></p></h3></center>
</div>
<!-- /.box-header -->
<div class="panel-body">
<form method="post" action="<?php echo base_url($this->uri->uri_string()); ?>">
<div class="form-group has-feedback">
<div class="col-md-2">
<label for="to_date">
<?php echo 'Year'; ?>
</label>
<div class="input-group">
<select class="form-control" id="financialyear" name="financialyear">
<option value="">Select Year</option>
<?php
foreach($finyear as $item):
{?>
<option value="<?php echo $item->financial_year;?>"><?php echo $item->financial_year ; ?></option>
<?php } endforeach; ?>
</select>
</div>
</div>
<div class="col-md-2">
<label for="to_date">
<?php echo 'Month'; ?>
</label>
<div class="input-group">
<select class="form-control" id="month" name="month">
<option value="">Select Month</option>
<option value="January">January</option>
<option value="February">February</option>
<option value="March">March</option>
<option value="April">April</option>
<option value="May">May</option>
<option value="June">June</option>
<option value="July">July</option>
<option value="August">August</option>
<option value="September">September</option>
<option value="October">October</option>
<option value="November">November</option>
<option value="December">December</option>
</select>
</div>
</div>
<div class="col-md-2 col-md-offset-0"><br>
<input type="submit" class="btn btn-success" name="btn_submit" style="padding:10px;"
value="View Report">
</div>
</div>
</form>
</div>
@ -69,7 +209,9 @@ if(!empty($mmr))
</tr>
</thead>
<tbody>
<?php if(!empty($mmr)){
<?php
$tot=0.00;
if(!empty($mmr)){
foreach($mmr as $rel)
{
?>
@ -79,9 +221,9 @@ if(!empty($mmr))
<td><span><?php echo $rel->MaterialCode?></span></td>
<td><span><?php echo $rel->MaterialName?></span></td>
<td><span><?php echo $rel->UOM?></span></td>
<td align="right"><span><?php echo $rel->Average_Rate?></span></td>
<td align="right"><span><?php
$tot= $tot + number_format($rel->Average_Rate,2,'.','');
echo number_format($rel->Average_Rate,2,'.','')?></span></td>
</tr>
<?php
@ -90,6 +232,22 @@ if(!empty($mmr))
}
?>
</tbody>
<tfoot>
<td style="text-align:center"><?php
$t='Total';
echo $t;?></td>
<td><?php echo '';?></td>
<td><?php echo '';?></td>
<td><?php echo '';?></td>
<td style="text-align:right"><?php echo number_format($tot,2,'.','');?></td>
</tfoot>
</table>
</div>
@ -119,6 +277,7 @@ buttons: [
{
extend: 'excelHtml5',
footer: 'true',
messageTop: $('h3').text(),
title: 'Report - Material Master - ReceiptValue',
exportOptions: {
columns: ':visible'

View File

@ -26,6 +26,10 @@ if(!empty($rel_po))
float: right;
}
.btn-success {
background-color: #5d0411;
border-color: #5d0411;
}
</style>
@ -35,10 +39,59 @@ if(!empty($rel_po))
<!-- TABLE: LATEST ORDERS -->
<div class="box box-info">
<div class="box-header with-border">
<center><h3 class="box-title"><p style="color:#5d0411"><b>Order Value - Released</b></p></h3></center>
<center><h3 class="box-title"><p style="color:#5d0411"><b>Order Value - Released</b>
<br><br>
<?php
if($this->input->post('financialyear')){
$ab=$this->input->post('financialyear');
echo '('.$ab.')';
echo ' ';
}
if($this->input->post('month')){
$m=$this->input->post('month');
echo '('.$m.')';
echo ' ';
}
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;
}
if($this->input->post('total_order_value_From') && $this->input->post('total_order_value_To')){
$tfrm = $this->input->post('total_order_value_From');
$tt = $this->input->post('total_order_value_To');
echo 'Total Order Value between'.' '.'RS.'.$tfrm.'-to-'.'RS.'.$tt;
}
?></p></h3></center>
</div>
<!-- /.box-header -->
<div class="row">
<!-- <div class="row">
<div class="col-md-6">
<div class="input-group input-daterange input" >
<div class="input-group-addon"><b>Total Order Value From:</b></div>
@ -58,8 +111,192 @@ if(!empty($rel_po))
<div class="input-group-addon"> <a onclick="Reset()" ><b>Clear</b></a></div>
</div>
</div>
</div>
</div> -->
<div class="panel-body">
<form method="post" action="<?php echo base_url($this->uri->uri_string()); ?>">
<div class="form-group has-feedback">
<div class="col-md-2">
<label for="to_date">
<?php echo 'Year'; ?>
</label>
<div class="input-group">
<select class="form-control" id="financialyear" name="financialyear">
<option value="">Select Year</option>
<?php
foreach($finyear as $item):
{?>
<option value="<?php echo $item->financial_year;?>"><?php echo $item->financial_year ; ?></option>
<?php } endforeach; ?>
</select>
</div>
</div>
<div class="col-md-2">
<label for="to_date">
<?php echo 'Month'; ?>
</label>
<div class="input-group">
<select class="form-control" id="month" name="month">
<option value="">Select Month</option>
<option value="January">January</option>
<option value="February">February</option>
<option value="March">March</option>
<option value="April">April</option>
<option value="May">May</option>
<option value="June">June</option>
<option value="July">July</option>
<option value="August">August</option>
<option value="September">September</option>
<option value="October">October</option>
<option value="November">November</option>
<option value="December">December</option>
</select>
</div>
</div>
<div class="col-md-2">
<label for="total_order_value_From">
<?php echo 'Total Order Value From'; ?>
</label>
<div class="input-group">
<input name="total_order_value_From" id="total_order_value_From" style="padding:4px;">
</span>
</div>
</div>
<div class="col-md-2">
<label for="total_order_value_To">
<?php echo 'Total Order Value To'; ?>
</label>
<div class="input-group">
<input name="total_order_value_To" id="total_order_value_To" style="padding:4px;">
</span>
</div>
</div>
<div class="col-md-2">
<label for="from_date">
<?php echo 'From Date'; ?>
</label>
<div class="input-group">
<input name="from_date" id="max-date" class="form-control datepicker">
<span class="input-group-addon">
<i class="fa fa-calendar fa-fw"></i>
</span>
</div>
</div>
<div class="col-md-2">
<label for="to_date">
<?php echo 'To Date'; ?>
</label>
<div class="input-group">
<input name="to_date" id="min-date" class="form-control datepicker">
<span class="input-group-addon">
<i class="fa fa-calendar fa-fw"></i>
</span>
</div>
</div>
<div class="col-md-2 col-md-offset-11"><br>
<input type="submit" class="btn btn-success" name="btn_submit"
value="View Report">
</div>
</div>
</form>
</div>
<div class="box-body">
<div>
@ -68,7 +305,7 @@ if(!empty($rel_po))
<tr>
<th>PO NO</th>
<th>PO Type</th>
<th>Created Date</th>
<th>PO Date</th>
<th>Released Date</th>
<th>Requested Department</th>
<th>Total Order Value</th>
@ -76,7 +313,7 @@ if(!empty($rel_po))
</tr>
</thead>
<tbody>
<?php if(!empty($rel_po)){
<?php $tot=0.00; if(!empty($rel_po)){
foreach($rel_po as $rel)
{
?>
@ -86,7 +323,10 @@ if(!empty($rel_po))
<td><span><?php $date = new DateTime($rel->PODate);echo $date->format('d-m-Y'); ?></span></td>
<td><span><?php $date = new DateTime($rel->ReleasedDate);echo $date->format('d-m-Y'); ?></span></td>
<td><span><?php echo $rel->Dept_Name?></span></td>
<td align="right"><span><?php echo $rel->TotalOrderValue?></span></td>
<!-- <td align="right"><span><?php echo $rel->TotalOrderValue?></span></td> -->
<td align="right"><span><?php
$tot= $tot number_format($rel->TotalOrderValue,2,'.','');
echo number_format($rel->TotalOrderValue,2,'.','')?></span></td>
</tr>
@ -96,6 +336,25 @@ if(!empty($rel_po))
}
?>
</tbody>
<tfoot>
<td style="text-align:center"><?php
$t='Total';
echo $t;?></td>
<td><?php echo '';?></td>
<td><?php echo '';?></td>
<td><?php echo '';?></td>
<td><?php echo '';?></td>
<td style="text-align:right"><?php echo number_format($tot,2,'.','');?></td>
</tfoot>
</table>
</div>
@ -128,6 +387,7 @@ $(document).ready(function() {
extend: 'excelHtml5',
footer: 'true',
title: 'Report - Released PO',
messageTop: $('h3').text(),
exportOptions: {
columns: ':visible'
}

View File

@ -25,6 +25,11 @@ if(!empty($open_po))
float: right;
}
.btn-success {
background-color: #5d0411;
border-color: #5d0411;
}
</style>
@ -34,10 +39,52 @@ if(!empty($open_po))
<!-- TABLE: LATEST ORDERS -->
<div class="box box-info">
<div class="box-header with-border">
<center><h3 class="box-title"><p style="color:#5d0411"><b>Open Orders - Pending</b></p></h3></center>
<center><h3 class="box-title"><p style="color:#5d0411"><b>Open Orders - Pending</b><br><br>
<?php
if($this->input->post('financialyear')){
$ab=$this->input->post('financialyear');
echo '('.$ab.')';
echo ' ';
}
if($this->input->post('month')){
$m=$this->input->post('month');
echo '('.$m.')';
echo ' ';
}
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;
}
if($this->input->post('total_order_value_From') && $this->input->post('total_order_value_To')){
$tfrm = $this->input->post('total_order_value_From');
$tt = $this->input->post('total_order_value_To');
echo 'Total Order Value between'.' '.'RS.'.$tfrm.'-to-'.'RS.'.$tt;
}
?></p></h3></center>
</div>
<!-- /.box-header -->
<div class="row">
<!-- <div class="row">
<div class="col-md-6">
<div class="input-group input-daterange input" >
<div class="input-group-addon"><b>Total Order Value From:</b></div>
@ -56,8 +103,161 @@ if(!empty($open_po))
<div class="input-group-addon"> <a onclick="Reset()" ><b>Clear</b></a></div>
</div>
</div>
</div>
</div> -->
<div class="panel-body">
<form method="post" action="<?php echo base_url($this->uri->uri_string()); ?>">
<div class="form-group has-feedback">
<div class="col-md-2">
<label for="to_date">
<?php echo 'Year'; ?>
</label>
<div class="input-group">
<select class="form-control" id="financialyear" name="financialyear">
<option value="">Select Year</option>
<?php
foreach($finyear as $item):
{?>
<option value="<?php echo $item->financial_year;?>"><?php echo $item->financial_year ; ?></option>
<?php } endforeach; ?>
</select>
</div>
</div>
<div class="col-md-2">
<label for="to_date">
<?php echo 'Month'; ?>
</label>
<div class="input-group">
<select class="form-control" id="month" name="month">
<option value="">Select Month</option>
<option value="January">January</option>
<option value="February">February</option>
<option value="March">March</option>
<option value="April">April</option>
<option value="May">May</option>
<option value="June">June</option>
<option value="July">July</option>
<option value="August">August</option>
<option value="September">September</option>
<option value="October">October</option>
<option value="November">November</option>
<option value="December">December</option>
</select>
</div>
</div>
<div class="col-md-2">
<label for="total_order_value_From">
<?php echo 'Total Order Value From'; ?>
</label>
<div class="input-group">
<input name="total_order_value_From" id="total_order_value_From" style="padding:4px;">
</span>
</div>
</div>
<div class="col-md-2">
<label for="total_order_value_To">
<?php echo 'Total Order Value To'; ?>
</label>
<div class="input-group">
<input name="total_order_value_To" id="total_order_value_To" style="padding:4px;">
</span>
</div>
</div>
<div class="col-md-2">
<label for="from_date">
<?php echo 'From Date'; ?>
</label>
<div class="input-group">
<input name="from_date" id="max-date" class="form-control datepicker">
<span class="input-group-addon">
<i class="fa fa-calendar fa-fw"></i>
</span>
</div>
</div>
<div class="col-md-2">
<label for="to_date">
<?php echo 'To Date'; ?>
</label>
<div class="input-group">
<input name="to_date" id="min-date" class="form-control datepicker">
<span class="input-group-addon">
<i class="fa fa-calendar fa-fw"></i>
</span>
</div>
</div>
<div class="col-md-2 col-md-offset-11"><br>
<input type="submit" class="btn btn-success" name="btn_submit"
value="View Report">
</div>
</div>
</form>
</div>
<div class="box-body">
<div>
@ -74,7 +274,7 @@ if(!empty($open_po))
</tr>
</thead>
<tbody>
<?php if(!empty($open_po)){
<?php $tot=0.00; if(!empty($open_po)){
foreach($open_po as $rel)
{
?>
@ -84,7 +284,14 @@ if(!empty($open_po))
<td><span><?php echo $rel->CreatedDate?></span></td>
<td><span><?php echo $rel->ApprovedDate?></span></td>
<td><span><?php echo $rel->Dept_Name?></span></td>
<td align="right"><span><?php echo number_format($rel->TotalOrderValue,2,'.','')?></span></td>
<!-- <td align="right"><span><?php echo number_format($rel->TotalOrderValue,2,'.','')?></span></td> -->
<td align="right"><span><?php
$tot= $tot + number_format($rel->TotalOrderValue,2,'.','');
echo number_format($rel->TotalOrderValue,2,'.','')?></span></td>
</tr>
@ -94,6 +301,25 @@ if(!empty($open_po))
}
?>
</tbody>
<tfoot>
<td style="text-align:center"><?php
$t='Total';
echo $t;?></td>
<td><?php echo '';?></td>
<td><?php echo '';?></td>
<td><?php echo '';?></td>
<td><?php echo '';?></td>
<td style="text-align:right"><?php echo number_format($tot,2,'.','');?></td>
</tfoot>
</table>
</div>

View File

@ -23,6 +23,7 @@ foreach($customersoutward as $customer)
}
$productsinward1=array(-1=>'Select Products');
foreach($productsinward as $product)
{
$productsinward1[$product->MaterialCode] =$product->MaterialCode.'-'.$product->MaterialName;
@ -64,38 +65,51 @@ foreach($customersinward as $customer)
<div class="box-body">
<div class="row">
<div class="col-md-1">
<?php
// $data = array(
// 'name' => 'newsletter',
// 'id' => 'newsletter',
// 'value' => 'accept',
// 'checked' => TRUE,
// 'style' => 'margin:10px'
// );
<div class="col-md-1">
<input type="radio" value="1" name="type" id="OutWard" onclick="changeType(this.value);"/>&nbsp;&nbsp;OutWard
</div>
<div class="col-md-1">
<input type="radio" value="0" name="type" id="Inward" onclick="changeType(this.value);"/>&nbsp;&nbsp;InWard
</div>
<div id='outwardarea' style="display:block;">
<div class="col-md-3">
<?php echo form_dropdown('name="product"',$products2,set_value('product',$products2[-1]),'id="product"' ,'class="form-control select2');?>
</div>
<div class="col-md-3">
<?php echo form_dropdown('name="customer"',$customers2,set_value('customer',$customers2[-1]),'id="customer"' ,'class="form-control select2');?>
</div>
</div>
<div id='inwardarea' style="display:none;">
<div class="col-md-3">
<?php echo form_dropdown('name="productinward"',$productsinward1,set_value('productinward',$productsinward1[-1]),'id="productinward"' ,'class="form-control select2');?>
</div>
<div class="col-md-3">
<?php echo form_dropdown('name="customerinward"',$customersinward1,set_value('customerinward',$customersinward1[-1]),'id="customerinward"' ,'class="form-control select2');?>
</div>
</div>
<div class="col-md-3">
<input type="button" id="addspec" class="btn btn-primary" value = "Add New Specification">
</div>
// echo form_checkbox($data);
?>
<input type="radio" value="1" name="type" id="OutWard" onclick="changeType(this.value);"/>&nbsp;&nbsp;OutWard
</div>
<div class="col-md-1">
<input type="radio" value="0" name="type" id="Inward" onclick="changeType(this.value);"/>&nbsp;&nbsp;InWard
</div>
<div id='outwardarea' style="display:block;">
<div class="col-md-3">
<?php echo form_dropdown('name="product"',$products2,set_value('product',$products2[-1]),'id="product"' ,'class="form-control select2');?>
</div>
<div class="col-md-3">
<?php echo form_dropdown('name="customer"',$customers2,set_value('customer',$customers2[-1]),'id="customer"' ,'class="form-control select2');?>
</div>
</div>
<div id='inwardarea' style="display:none;">
<div class="col-md-3">
<?php echo form_dropdown('name="productinward"',$productsinward1,set_value('productinward',$productsinward1[-1]),'id="productinward"' ,'class="form-control select2');?>
</div>
<div class="col-md-3">
<?php echo form_dropdown('name="customerinward"',$customersinward1,set_value('customerinward',$customersinward1[-1]),'id="customerinward"' ,'class="form-control select2');?>
</div>
</div>
<div class="col-md-3">
<input type="button" id="addspec" class="btn btn-primary" value = "Add New Specification">
</div>
</div>
<br/>
@ -108,7 +122,7 @@ foreach($customersinward as $customer)
<th>Min</th>
<th>Max</th>
<th>Temp</th>
<th>Action</th>
<!-- <th>Action</th> -->
</tr>
@ -210,42 +224,40 @@ foreach($customersinward as $customer)
<td align="right" contenteditable="true"><%=Min%></td>
<td align="right" contenteditable="true"><%=Max%></td>
<td align="right" contenteditable="true"><%=Temp%></td>
<td align="center" contenteditable="false"><a data-target='#specmodel' data-id="<%=index%>" data-userid="<%=index%>" data-toggle="modal" href="#specmodel">&nbsp;&nbsp;&nbsp;</a> <a href='#' onclick = "DeleteRow(<%=index%>)" class="link" data-id="<%=index%>" data-userid="<%=index%>" id="Del" ><span class="glyphicon glyphicon-trash"></span></a></td>
<!-- <td align="center" contenteditable="false"><a data-target='#specmodel' data-id="<%=index%>" data-userid="<%=index%>" data-toggle="modal" href="#specmodel">&nbsp;&nbsp;&nbsp;</a> <a href='#' onclick = "DeleteRow(<%=index%>)" class="link" data-id="<%=index%>" data-userid="<%=index%>" id="Del" ><span class="glyphicon glyphicon-trash"></span></a></td> -->
</tr> <!-- <i class="fa fa-pencil" data-toggle="tooltip" title="Click here to view/Edit <%=index%> "></i> -->
</script>
<script>
$(document).ready(function() {
$('#OutWard').attr('checked','true');
});
function changeType(v)
{
//alert();
$('#OutWard').attr('checked','true');
});
function changeType(v)
{
var val = v
// alert(val);
if(val == 0)
{
//alert('InWard');
$('#inwardarea').css({'display':'block'});
$('#outwardarea').css({'display':'none'});
}
else if(val == 1)
{
//alert('OutWard');
$('#inwardarea').css({'display':'none'});
$('#outwardarea').css({'display':'block'});
}
}
}
$('#addspec').click(function(){
if($('#OutWard').is(':checked'))
{
{
var product = $('#product').val();
var customer = $('#customer').val();
if(product == -1 || customer == -1)
@ -256,25 +268,28 @@ $('#addspec').click(function(){
{
$('#specmodel').modal('show');
}
}
else
{
var productinward = $('#productinward').val();
}
else//if($('#InWard').is(':checked'))
{
//alert('kj');
var productinward = $('#productinward').val();
var customerinward = $('#customerinward').val();
if(productinward == -1 || customerinward == -1)
{
alert('Please Select Product and Customer.');
}
else
{
$('#specmodel').modal('show');
}
}
});
//alert('kj');
}
});
function addNewRow()
{
@ -314,24 +329,26 @@ $("#specmodel").on("shown.bs.modal", function(e) {
function getAllData()
{
var type = '';
var product = '';
var customer = '';
if($('#OutWard').is(':checked'))
{
type = 'OUTWARD';
product = $('#product').val();
customer = $('#customer').val();
}
else
{
type = 'INWARD';
product = $('#productinward').val();
customer = $('#customerinward').val();
}
var alldata = $("#testspecifications").tableToJSON();
var type = '';
var product = '';
var customer = '';
if($('#OutWard').is(':checked'))
{
type = 'OUTWARD';
product = $('#product').val();
customer = $('#customer').val();
}
else
{
type = 'INWARD';
product = $('#productinward').val();
customer = $('#customerinward').val();
}
var alldata = $("#testspecifications").tableToJSON();
//alert(JSON.stringify(alldata));
alldata=JSON.stringify(alldata)
// alert(customer);exit();
if(product == -1 || customer == -1)
{
alert('Please Select Product and Customer.');
@ -339,16 +356,20 @@ $("#specmodel").on("shown.bs.modal", function(e) {
else{
$('#content').loader('show');
$.ajax({
data:{param1:alldata,param2:product,param3:customer,param4:type},
data:{param1:alldata,param2:product,param3:customer,param4:type},
//dataType:"json",
type:"POST",
url:"<?php echo base_url() ?>quality/saveSpectficationData",
success:function(data) {
if(data)
{
alert(data);
//console.log(data);
window.location = "<?php echo base_url().'quality';?>";
$('#content').loader('hide');
$('#content').loader('hide');
}
}

View File

@ -55,8 +55,8 @@
<tr>
<th>Product Name</th>
<th>Company Name</th>
<th>Type</th>
<th>Company Name</th>
<th>Type</th>
<th>Total Specification</th>
@ -69,21 +69,28 @@
{
foreach($existspec as $data)
{
//print_r($data);echo "</br></br>";
?>
<tr> <td><a href="<?php echo base_url()?>quality/viewSpec/<?php echo $data->product_id.'/'.$data->customer_id ?>"><?php echo $data->product_name.'-'.$data->product_description?></a></td> <td><a href="<?php echo base_url()?>quality/viewSpec/<?php echo $data->product_id.'/'.$data->customer_id ?>"><?php echo $data->client_name?></a></td> <td><?php echo $data->type?> </td><td><?php echo $data->count?></td></tr>
<tr> <td><a href="<?php echo base_url()?>quality/viewSpec/<?php echo $data->product_id.'/'.$data->customer_id ?>"><?php echo $data->product_name.'-'.$data->product_description?></a></td> <td><a href="<?php echo base_url()?>quality/viewSpec/<?php echo $data->product_id.'/'.$data->customer_id ?>"><?php echo $data->client_name?></a></td> <td><?php echo $data->type?> </td><td><?php echo $data->count?></td></tr>
<?php
} }
}
}
if(!empty($existspecinward))
{
foreach($existspecinward as $in)
{
//print_r($data);echo "</br></br>";
?>
<tr> <td><a href="<?php echo base_url()?>quality/viewSpec/<?php echo $in->MaterialCode.'/'.$in->SupplierID ?>"><?php echo $in->MaterialName?></a></td> <td><a href="<?php echo base_url()?>quality/viewSpec/<?php echo $in->MaterialCode.'/'.$in->SupplierID ?>"><?php echo $in->SupplierName?></a></td> <td><?php echo $in->type?> </td><td><?php echo $in->count?></td></tr>
<?php
}
}
?>
</tbody>
</table>
<p>&nbsp;</p>
@ -176,7 +183,7 @@ $('#addspec').click(function(){
var customer = $('#customer').val();
if(product == -1 || customer == -1)
{
swal('Please Select Product and Customer.');
alert('Please Select Product and Customer.');
}
else
{
@ -196,7 +203,7 @@ function addNewRow()
if(sname == '' || uom =='' || min == '' || max == '')
{
swal('Please Enter all specification');
alert('Please Enter all specification');
}
else
{
@ -232,7 +239,7 @@ $("#specmodel").on("shown.bs.modal", function(e) {
var customer = $('#customer').val();
if(product == -1 || customer == -1)
{
swal('Please Select Product and Customer.');
alert('Please Select Product and Customer.');
}
else{
$('#content').loader('show');
@ -245,7 +252,7 @@ $("#specmodel").on("shown.bs.modal", function(e) {
if(data)
{
$('#content').loader('hide');
swal(data);
alert(data);
//console.log(data);
@ -263,7 +270,7 @@ $("#specmodel").on("shown.bs.modal", function(e) {
var customer = $('#customer').val();
if(product == -1 || customer == -1)
{
swal('Please Select Product and Customer.');
alert('Please Select Product and Customer.');
}
else{
var d='';
@ -285,7 +292,7 @@ $("#specmodel").on("shown.bs.modal", function(e) {
success:function(data){
$('#content').loader('hide');
swal(data);
alert(data);
}
});

View File

@ -25,6 +25,11 @@ if(!empty($pending_list))
float: right;
}
.btn-success {
background-color: #5d0411;
border-color: #5d0411;
}
</style>
@ -34,10 +39,58 @@ if(!empty($pending_list))
<!-- TABLE: LATEST ORDERS -->
<div class="box box-info">
<div class="box-header with-border">
<center><h3 class="box-title"><p style="color:#5d0411"><b>Total Pending Requests</b></p></h3></center>
<center><h3 class="box-title"><p style="color:#5d0411"><b>Total Pending Requests</b> <br><br>
<?php
if($this->input->post('financialyear')){
$ab=$this->input->post('financialyear');
echo '('.$ab.')';
echo ' ';
}
if($this->input->post('month')){
$m=$this->input->post('month');
echo '('.$m.')';
echo ' ';
}
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;
}
if($this->input->post('aging_from') && $this->input->post('aging_to')){
$tfrm = $this->input->post('aging_from');
$tt = $this->input->post('aging_to');
echo 'Aging between'.' '.$tfrm.'-to-'.$tt.' '.'days';
}
?></p></h3></center>
</div>
<!-- /.box-header -->
<div class="row">
<!--<div class="row">
<div class="col-md-6">
<div class="input-group input-daterange input" >
<div class="input-group-addon"><b>Aging From:</b></div>
@ -56,9 +109,189 @@ if(!empty($pending_list))
<div class="input-group-addon"> <a onclick="Reset()" ><b>Clear</b></a></div>
</div>
</div>
</div>
</div> -->
<div class="panel-body">
<form method="post" action="<?php echo base_url($this->uri->uri_string()); ?>">
<div class="form-group has-feedback">
<div class="col-md-2">
<label for="to_date">
<?php echo 'Year'; ?>
</label>
<div class="input-group">
<select class="form-control" id="financialyear" name="financialyear">
<option value="">Select Year</option>
<?php
foreach($finyear as $item):
{?>
<option value="<?php echo $item->financial_year;?>"><?php echo $item->financial_year ; ?></option>
<?php } endforeach; ?>
</select>
</div>
</div>
<div class="col-md-2">
<label for="to_date">
<?php echo 'Month'; ?>
</label>
<div class="input-group">
<select class="form-control" id="month" name="month">
<option value="">Select Month</option>
<option value="January">January</option>
<option value="February">February</option>
<option value="March">March</option>
<option value="April">April</option>
<option value="May">May</option>
<option value="June">June</option>
<option value="July">July</option>
<option value="August">August</option>
<option value="September">September</option>
<option value="October">October</option>
<option value="November">November</option>
<option value="December">December</option>
</select>
</div>
</div>
<div class="col-md-2">
<label for="Aging_From">
<?php echo 'Aging From'; ?>
</label>
<div class="input-group">
<input name="aging_from" id="aging_from" style="padding:4px;">
</span>
</div>
</div>
<div class="col-md-2">
<label for="Aging_To">
<?php echo 'Aging To'; ?>
</label>
<div class="input-group">
<input name="aging_to" id="aging_to" style="padding:4px;">
</span>
</div>
</div>
<div class="col-md-2">
<label for="from_date">
<?php echo 'From Date'; ?>
</label>
<div class="input-group">
<input name="from_date" id="max-date" class="form-control datepicker">
<span class="input-group-addon">
<i class="fa fa-calendar fa-fw"></i>
</span>
</div>
</div>
<div class="col-md-2">
<label for="to_date">
<?php echo 'To Date'; ?>
</label>
<div class="input-group">
<input name="to_date" id="min-date" class="form-control datepicker">
<span class="input-group-addon">
<i class="fa fa-calendar fa-fw"></i>
</span>
</div>
</div>
<div class="col-md-2 col-md-offset-11"><br>
<input type="submit" class="btn btn-success" name="btn_submit"
value="View Report">
</div>
</div>
</form>
</div>
<div class="box-body">
<div>
<table class="table table-bordered table-hover" id="req" >
@ -126,7 +359,7 @@ buttons: [
footer: 'true',
//messageTop: $('h3').text(),
messageTop: $('h3').text(),
title: 'Report - Pending Request',

View File

@ -4,18 +4,18 @@ th{
}
</style>
<?php
//print_r($specifications);
$pname = '';
$cnamme = '';
$pdec = '';
$type = '';
$cnamme = '';
$pid='';
$cid='';
$type= '';
foreach($specifications as $s)
{
$pname = $s->product_name;
if(!empty($s->product_description)){
$pdec = $s->product_description;
$pdec = $s->product_description;
}
$cname = $s->client_name;
$pid = $s->product_id;
@ -56,7 +56,7 @@ foreach($specifications as $s)
<div class="row">
<div class="col-md-3">
<input type="text" name="p" id="p" class="form-control" value="<?php echo $pname;if(!empty($pdec)){echo '-'.$pdec;};?>" readonly>
<input type="text" name="p" id="p" class="form-control" value="<?php echo $pname;if(!empty($pdec)){echo '-'.$pdec;};?>" readonly>
<input type="hidden" name="product" id="product" value="<?php echo $pid;?>">
</div>
@ -64,7 +64,7 @@ foreach($specifications as $s)
<input type="text" name="c" id="c" class="form-control" value="<?php echo $cname;?>" readonly>
<input type="hidden" name="customer" id="customer" value="<?php echo $cid;?>">
</div>
<div class="col-md-2">
<div class="col-md-2">
<input type="text" id="ttype" class="form-control" value = "<?php echo $type;?>" readonly>
</div>
<div class="col-md-3">
@ -197,7 +197,7 @@ $('#addspec').click(function(){
var customer = $('#customer').val();
if(product == -1 || customer == -1)
{
swal('Please Select Product and Customer.');
alert('Please Select Product and Customer.');
}
else
{
@ -217,7 +217,7 @@ function addNewRow()
var temp = $('#temp').val();
if(sname == '' || uom =='' || min == '' || max == '' || temp == '')
{
swal('Please Enter all specification');
alert('Please Enter all specification');
}
else
{
@ -254,12 +254,12 @@ $("#specmodel").on("shown.bs.modal", function(e) {
var type = $('#ttype').val();
if(product == -1 || customer == -1)
{
swal('Please Select Product and Customer.');
alert('Please Select Product and Customer.');
}
else{
$('#content').loader('show');
$.ajax({
data:{param1:alldata,param2:product,param3:customer,param4:type},
data:{param1:alldata,param2:product,param3:customer,param4:type},
//dataType:"json",
type:"POST",
url:"<?php echo base_url() ?>quality/saveSpectficationData",
@ -267,9 +267,11 @@ $("#specmodel").on("shown.bs.modal", function(e) {
if(data)
{
swal(data);
alert(data);
window.location = "<?php echo base_url().'quality';?>";
$('#content').loader('hide');
//console.log(data);
}
@ -285,7 +287,7 @@ $("#specmodel").on("shown.bs.modal", function(e) {
var customer = $('#customer').val();
if(product == '' || customer == '')
{
swal('Please Select Product and Customer.');
alert('Please Select Product and Customer.');
}
else{
var rowid = r;
@ -310,7 +312,7 @@ $("#specmodel").on("shown.bs.modal", function(e) {
success:function(data){
$('#content').loader('hide');
swal(data);
alert(data);
}
});