PONO reset in finance year added
This commit is contained in:
parent
7e336808ea
commit
ad33ca1aac
@ -321,3 +321,7 @@ $route['ncrlist'] = "purchaseorder/Nonconfirmativelist";
|
|||||||
|
|
||||||
|
|
||||||
$route['DeliveryPerformance']="user/deliver_perform";
|
$route['DeliveryPerformance']="user/deliver_perform";
|
||||||
|
|
||||||
|
//this function ues to ponoreset values
|
||||||
|
|
||||||
|
$route['poresetview']="purchaseorder/poresetview";
|
||||||
|
|||||||
@ -27,6 +27,101 @@ class purchaseorder extends BaseController
|
|||||||
$this->isLoggedIn();
|
$this->isLoggedIn();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// start this function used to pono reset financeyear configuration
|
||||||
|
|
||||||
|
|
||||||
|
function poresetview()
|
||||||
|
{
|
||||||
|
$this->global['pageTitle'] = 'Siddharth : PurchaseOrderNumber/FinanceYear-Configuration ';
|
||||||
|
|
||||||
|
|
||||||
|
$data['ponoreset']=$this->purchaseorder_model->ponoresetfinyear();
|
||||||
|
|
||||||
|
|
||||||
|
$this->loadViews("poresetview", $this->global,$data,Null);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function addnew()
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
$pono1 = $this->input->post('pono');
|
||||||
|
//echo $pono;
|
||||||
|
$potype1= $this->input->post('potype');
|
||||||
|
//echo $potype;
|
||||||
|
$posubtype1 = $this->input->post('posubtype');
|
||||||
|
//echo $posubtype;
|
||||||
|
//die;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
$ponoreset = array('pono'=>$pono1,
|
||||||
|
'potype'=>$potype1,
|
||||||
|
'posubtype'=>$posubtype1);
|
||||||
|
|
||||||
|
$result = $this->purchaseorder_model->ponoreset($ponoreset);
|
||||||
|
if( $result >= 0){
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
echo "<script type='text/javascript'>alert('Successfully Saved!');
|
||||||
|
|
||||||
|
|
||||||
|
</script>";
|
||||||
|
|
||||||
|
redirect('purchaseorder/poresetview','refresh');
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
function edited(){
|
||||||
|
|
||||||
|
$sno=$this->input->post('sno');
|
||||||
|
//echo $sno;
|
||||||
|
|
||||||
|
$pono = $this->input->post('pono');
|
||||||
|
//echo $pono;
|
||||||
|
|
||||||
|
$potype= $this->input->post('potype');
|
||||||
|
// echo $potype;
|
||||||
|
$posubtype = $this->input->post('posubtype');
|
||||||
|
//echo $posubtype;
|
||||||
|
//die();
|
||||||
|
|
||||||
|
$ponoreset = array('pono'=>$pono,
|
||||||
|
'potype'=>$potype,
|
||||||
|
'posubtype'=>$posubtype);
|
||||||
|
//print_r($ponoreset); die();
|
||||||
|
|
||||||
|
$result = $this->purchaseorder_model->updateponoreset($ponoreset,$sno,$potype,$posubtype);
|
||||||
|
if( $result >= 0)
|
||||||
|
{
|
||||||
|
|
||||||
|
echo "Updated Successfully Saved";
|
||||||
|
|
||||||
|
redirect('purchaseorder/poresetview','refresh');
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//end this function used to pono reset financeyear configuration
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This function used to load the first screen of the user
|
* This function used to load the first screen of the user
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -22,6 +22,41 @@ class purchaseorder_model extends CI_Model
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/////////////////// start this function used to pono reset financeyear configuration
|
||||||
|
|
||||||
|
function ponoreset($ponoreset)
|
||||||
|
{
|
||||||
|
|
||||||
|
//print_r($ponoreset); die;
|
||||||
|
$this->db->insert('T_PONO_Reset_Table',$ponoreset);
|
||||||
|
|
||||||
|
$r = $this->db->affected_rows();
|
||||||
|
return $r;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function updateponoreset($ponoreset,$sno,$potype,$posubtype)
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
$this->db->where('reset_pono_id',$sno,'POType',$potype,'POSubtype',$posubtype);
|
||||||
|
$this->db->update('T_PONO_Reset_Table',$ponoreset);
|
||||||
|
$r = $this->db->affected_rows();
|
||||||
|
return $r;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
function ponoresetfinyear()
|
||||||
|
{
|
||||||
|
$this->db->select('*');
|
||||||
|
$this->db->from('T_PONO_Reset_Table');
|
||||||
|
$query =$this->db->get();
|
||||||
|
return $query->result();
|
||||||
|
}
|
||||||
|
///////////////////end this function used to pono reset financeyear configuration
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function fileupload($myfile)
|
function fileupload($myfile)
|
||||||
{
|
{
|
||||||
@ -560,20 +595,26 @@ function GetPOType($ReqNo)
|
|||||||
{
|
{
|
||||||
$this->db->trans_start();
|
$this->db->trans_start();
|
||||||
$this->db->insert('T_PurchaseOrder_Master', $POMaster);
|
$this->db->insert('T_PurchaseOrder_Master', $POMaster);
|
||||||
|
//$this->db->update('T_PONO_Reset_Table')
|
||||||
|
|
||||||
$insert_id = $this->db->affected_rows();
|
$insert_id = $this->db->affected_rows();
|
||||||
$this->db->trans_complete();
|
$this->db->trans_complete();
|
||||||
// print_r($this->db->last_query());
|
// print_r($this->db->last_query());
|
||||||
if($insert_id>0)
|
if($insert_id>0)
|
||||||
{
|
{
|
||||||
//$subQuery = 'select max(PONO) as PONO from T_PurchaseOrder_Master where POType=? and POSubType=?';
|
$subQuery = 'select PONO from T_PurchaseOrder_Master where POType=? and POSubType=? and isnull(ParentPO) order by CreatedDate desc limit 1 ';
|
||||||
$subQuery = 'select PONO from T_PurchaseOrder_Master where POType=? and POSubType=? and isnull(ParentPO) order by CreatedDate desc limit 1';
|
|
||||||
$query = $this->db->query($subQuery,array($POType,$POSubtype));
|
$query = $this->db->query($subQuery,array($POType,$POSubtype));
|
||||||
|
|
||||||
|
//print_r($query->result());die();
|
||||||
return $query->result_array();
|
return $query->result_array();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function addAmendPOMaster($POMaster,$CreatedBy,$ParentPO)
|
function addAmendPOMaster($POMaster,$CreatedBy,$ParentPO)
|
||||||
{
|
{
|
||||||
// print_r($POMaster);
|
// print_r($POMaster);
|
||||||
@ -584,7 +625,7 @@ function GetPOType($ReqNo)
|
|||||||
// print_r($this->db->last_query());
|
// print_r($this->db->last_query());
|
||||||
if($insert_id>0)
|
if($insert_id>0)
|
||||||
{
|
{
|
||||||
$subQuery = 'select max(PONO) as PONO from T_PurchaseOrder_Master where CreatedBy=? and ParentPO=?';
|
$subQuery = 'select PONO from T_PurchaseOrder_Master where CreatedBy=? and ParentPO=? order by CreatedDate desc limit 1';
|
||||||
|
|
||||||
$query = $this->db->query($subQuery,array($CreatedBy,$ParentPO));
|
$query = $this->db->query($subQuery,array($CreatedBy,$ParentPO));
|
||||||
|
|
||||||
|
|||||||
@ -689,7 +689,12 @@ $(function() {
|
|||||||
<span class="nav-label">Company Master</span>
|
<span class="nav-label">Company Master</span>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
<li class="treeview">
|
||||||
|
<a href="<?php echo base_url(); ?>poresetview">
|
||||||
|
<i class="fa fa-building"></i>
|
||||||
|
<span>PurchaseOrderNumberReset</span>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
<li class="treeview">
|
<li class="treeview">
|
||||||
<a href="<?php echo base_url(); ?>employeeListing" >
|
<a href="<?php echo base_url(); ?>employeeListing" >
|
||||||
<i class="fa fa-user-circle"></i>
|
<i class="fa fa-user-circle"></i>
|
||||||
@ -868,6 +873,12 @@ $(function() {
|
|||||||
<span>Users</span>
|
<span>Users</span>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
<li class="treeview">
|
||||||
|
<a href="<?php echo base_url(); ?>poresetview">
|
||||||
|
<i class="fa fa-building"></i>
|
||||||
|
<span>PurchaseOrderNumberReset</span>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
|
|
||||||
<?php }?>
|
<?php }?>
|
||||||
|
|
||||||
|
|||||||
187
application/views/poresetview.php
Normal file
187
application/views/poresetview.php
Normal file
@ -0,0 +1,187 @@
|
|||||||
|
<script src="<?php echo base_url()?>assets/lightswitch/lightswitch/lib/jquery.tabletojson.js"></script>
|
||||||
|
<script src="<?php echo base_url()?>assets/lightswitch/lightswitch/lib/jquery.tabletojson.min.js"></script>
|
||||||
|
|
||||||
|
<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: #3c8dbc;
|
||||||
|
border-color: #3c8dbc;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*div.ui-datepicker{
|
||||||
|
z-index:2;
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
/*#datepick-datepicker-calendar {
|
||||||
|
display: none;
|
||||||
|
} */
|
||||||
|
#datepi>.ui-datepi-calendar
|
||||||
|
{
|
||||||
|
display:none;
|
||||||
|
}
|
||||||
|
span .hights {
|
||||||
|
background-color: green;
|
||||||
|
}
|
||||||
|
.edit{
|
||||||
|
background-color:#eeffcc ! important;
|
||||||
|
}
|
||||||
|
th{
|
||||||
|
text-align:center !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
</style>
|
||||||
|
<div class="content-wrapper">
|
||||||
|
<!-- Content Header (Page header) -->
|
||||||
|
<section class="content-header">
|
||||||
|
<h1>
|
||||||
|
<center>Siddharth Industries - PurchaseOrderNumber/FinanceYear-Configuration</center>
|
||||||
|
</h1>
|
||||||
|
</section>
|
||||||
|
</br>
|
||||||
|
</br>
|
||||||
|
<section class="content" id="loadingcontent">
|
||||||
|
|
||||||
|
<!-- <h4><span style="background-color: #FFFF00">Make sure attendance entry made before entering data in the screen</span></h4> -->
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-xs-12">
|
||||||
|
<div class="box">
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<hr>
|
||||||
|
|
||||||
|
<div class="table-responsive">
|
||||||
|
<div id="panel-recent-invoices" class="panel panel-default">
|
||||||
|
<body>
|
||||||
|
|
||||||
|
<table id="testreport" class="table table-bordered table-hover" style="background-color:#fff;font-size:12px;text-align:center;">
|
||||||
|
<thead style="background-color:#ddf;">
|
||||||
|
<tr>
|
||||||
|
|
||||||
|
<th>SNo</th>
|
||||||
|
<th>PONO</th>
|
||||||
|
<th>POType</th>
|
||||||
|
<th>POSubType</th>
|
||||||
|
<th id="act">Action</th>
|
||||||
|
|
||||||
|
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody id="databaseAppend">
|
||||||
|
<?php
|
||||||
|
if(!empty($ponoreset))
|
||||||
|
{
|
||||||
|
//print_r($ponoreset);
|
||||||
|
$i =0;
|
||||||
|
foreach($ponoreset as $key => $ps){
|
||||||
|
//print_r($key);
|
||||||
|
?>
|
||||||
|
<tr>
|
||||||
|
<!-- <td id="sno<?php echo $key?>"><?php echo $ps->sno ?></td> -->
|
||||||
|
<td style="text-align:center;" id="reset_pono_id<?php echo $key?>"><?php echo ++$i;?></td>
|
||||||
|
|
||||||
|
<td contenteditable='true' id="pono<?php echo $key?>"><?php echo $ps->PONO ?></td>
|
||||||
|
<td id ="potype<?php echo $key?>"><?php echo $ps->POType ?></td>
|
||||||
|
|
||||||
|
<td id ="posubtype<?php echo $key?>"><?php echo $ps->POSubType ?></td>
|
||||||
|
|
||||||
|
|
||||||
|
<td><button type="button" class="btn btn-default" aria-label="Left Align" id="edit<?php echo $key?>"
|
||||||
|
onclick ="edit(<?php echo $ps->reset_pono_id?>,<?php echo $key?>);" value=""><u>Save</u>
|
||||||
|
|
||||||
|
</button></td>
|
||||||
|
<!-- class ="glyphicon glyphicon-file" -->
|
||||||
|
</tr>
|
||||||
|
<?php
|
||||||
|
}
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</body>
|
||||||
|
</div></div>
|
||||||
|
<p> </p>
|
||||||
|
<hr>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div></b></div></div>
|
||||||
|
</section>
|
||||||
|
</div>
|
||||||
|
<!-- <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>
|
||||||
|
$(document).ready(function() {
|
||||||
|
table = $('#testreport').DataTable( {
|
||||||
|
|
||||||
|
"dom": "<'row'<'col-md-3'l><'col-md-9'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:$('h5').text(),
|
||||||
|
exportOptions: {
|
||||||
|
//columns: ':visible'
|
||||||
|
columns: ':lt(6)', orthogonal: 'export'
|
||||||
|
|
||||||
|
}
|
||||||
|
},
|
||||||
|
'colvis'
|
||||||
|
]
|
||||||
|
} );
|
||||||
|
} );
|
||||||
|
|
||||||
|
|
||||||
|
function edit(id,k){
|
||||||
|
// alert("hi");
|
||||||
|
//alert (id,k);die();
|
||||||
|
var sno =id;
|
||||||
|
var pono =document.getElementById('pono'+k).textContent;
|
||||||
|
var potype=document.getElementById('potype'+k).textContent;
|
||||||
|
var posubtype =document.getElementById('posubtype'+k).textContent;
|
||||||
|
|
||||||
|
//alert(sno);alert(pon);alert(potyp);alert(posubtyp); die();
|
||||||
|
$.ajax({
|
||||||
|
data:{sno:sno,pono:pono,potype:potype,posubtype:posubtype},
|
||||||
|
type:"POST",
|
||||||
|
url:"<?php echo base_url() ?>purchaseorder/edited",
|
||||||
|
|
||||||
|
success:function(data){
|
||||||
|
$('#loadingcontent').loader('hide');
|
||||||
|
alert(data);
|
||||||
|
|
||||||
|
window.location.reload();
|
||||||
|
}//success function closed
|
||||||
|
|
||||||
|
});//ajax function closed
|
||||||
|
|
||||||
|
}
|
||||||
|
</script>
|
||||||
Loading…
Reference in New Issue
Block a user