IGR screen updataion
This commit is contained in:
parent
ec87a639bd
commit
2792e52cbc
@ -34,12 +34,12 @@ class inwardgateregister extends BaseController
|
||||
$this->loadViews("viewinwardgateregister", $this->global,NULL , NULL);
|
||||
}
|
||||
|
||||
function viewinwardgateregister($IGRNO='',$IGR='')
|
||||
function viewinwardgateregister()
|
||||
{
|
||||
$this->load->model('inwardgateregister_model');
|
||||
$this->global['pageTitle'] = 'Siddharth : Inward Gate Register';
|
||||
$data['IGR']= $this->inwardgateregister_model->igrListing($IGRNO,$IGR);
|
||||
|
||||
$data['IGR']= $this->inwardgateregister_model->igrListing();
|
||||
//print_r($data['IGR']);//print_r statement is used to get the values
|
||||
$this->loadViews("viewinwardgateregister",$this->global,$data,NULL);
|
||||
}
|
||||
|
||||
@ -134,7 +134,8 @@ class inwardgateregister extends BaseController
|
||||
$igr = array();
|
||||
|
||||
$igr = array('PONO'=>$PONO,'VehicleNo'=>$VehicleNo,'DeliveryChellanOrInvoiceNo'=>$DeliveryChellanOrInvoiceNo,'DeliveryChellanDate'=>$DeliveryChellanDate,'CourierNo'=>$CourierNo,'IGRStatus'=>$IGRStatus,'CreatedBy'=>$CreatedBy,'CreatedDate' =>$createddt);
|
||||
//print_r($igr);
|
||||
//print_r($IGRNO);
|
||||
//die();
|
||||
|
||||
$igrM = $this->inwardgateregister_model->addigrM($igr);
|
||||
|
||||
@ -142,9 +143,12 @@ class inwardgateregister extends BaseController
|
||||
$IGRNO = '';
|
||||
if(count($igrM)>0)
|
||||
{
|
||||
$IGRNO = $igrM[0]['IGRNO'];
|
||||
foreach ($igrM as $key ) {
|
||||
$IGRNO=$key->IGRNO;
|
||||
}
|
||||
}
|
||||
//echo $IGRNO;
|
||||
echo $IGRNO;
|
||||
|
||||
$IGRItemStatus = REQITEM_NEW;
|
||||
//echo ("success");
|
||||
|
||||
@ -155,7 +159,6 @@ class inwardgateregister extends BaseController
|
||||
|
||||
//echo $IGRNO ;
|
||||
$MaterialCode = $this->input->post('MaterialCode'.$i);
|
||||
|
||||
|
||||
$QuantityAsPerInvoice = $this->input->post('ReceivedQuantity'.$i);
|
||||
$Remarks = $this->input->post('Remarks'.$i);
|
||||
@ -168,8 +171,10 @@ class inwardgateregister extends BaseController
|
||||
$igrDetails = array('IGRNO'=>$IGRNO,'MaterialCode'=>$MaterialCode,'QuantityAsPerInvoice'=>$QuantityAsPerInvoice,'Remarks'=>$Remarks,'IGRItemStatus'=>$IGRItemStatus,'CreatedBy'=>$CreatedBy,'CreatedDate'=>$createddt);
|
||||
//print_r($igrDetails);
|
||||
$igrD = $this->inwardgateregister_model->addigrD($igrDetails);
|
||||
|
||||
|
||||
}
|
||||
//print_r($IGRNO);
|
||||
|
||||
|
||||
|
||||
|
||||
@ -16,20 +16,25 @@ class inwardgateregister_model extends CI_Model
|
||||
* @param number $segment : This is pagination limit
|
||||
* @return array $result : This is result
|
||||
*/
|
||||
function igrListing($IGRNO,$IGR)
|
||||
function igrListing()
|
||||
{
|
||||
|
||||
$this->db->select('igr.*,igrd.*,POM.DeliveryDate,sup.SupplierName,MM.MaterialName');
|
||||
$this->db->from('T_IGR_Master igr');
|
||||
//$this->db->select('igr.*,igrd.*,POM.DeliveryDate,sup.SupplierName,MM.MaterialName');
|
||||
//$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');
|
||||
//$this->db->join('T_SupplierDetailsN sup', 'POM.SupplierID = sup.SupplierID');
|
||||
//$this->db->join('T_MaterialMaster MM', 'MM.MaterialCode = igrd.MaterialCode');
|
||||
//$this->db->group_by('igr.IGRNO');
|
||||
|
||||
$this->db->select('igr.*, igrd.*,PO.DeliveryDate,sup.SupplierName');
|
||||
$this->db->from('T_IGR_Master igr');
|
||||
$this->db->join('T_IGR_Details igrd','igrd.IGRNO = igr.IGRNO','left');
|
||||
$this->db->join('T_PurchaseOrder_Master POM ', 'igr.PONO = POM.PONO','left');
|
||||
$this->db->join('T_SupplierDetailsN sup', 'POM.SupplierID = sup.SupplierID','left');
|
||||
$this->db->join('T_PurchaseOrder_LineItem POL', 'POL.PONO = igr.PONO','left');
|
||||
$this->db->join('T_MaterialMaster MM', 'MM.MaterialCode = igrd.MaterialCode','left');
|
||||
$this->db->group_by('igr.IGRNO',$IGRNO);
|
||||
$this->db->join('T_PurchaseOrder_Master PO','igr.PONO = PO.PONO','left');
|
||||
$this->db->join('T_MaterialMaster` MM','MM.MaterialCode = igrd.MaterialCode','left');
|
||||
$this->db->join('T_SupplierDetailsN` sup','PO.SupplierID = sup.SupplierID','left');
|
||||
|
||||
|
||||
|
||||
|
||||
$query = $this->db->get();
|
||||
//print_r( $this->db->last_query());
|
||||
$result = $query->result();
|
||||
@ -76,7 +81,7 @@ class inwardgateregister_model extends CI_Model
|
||||
function addigrM($igrM)
|
||||
{
|
||||
|
||||
$this->db->trans_start();
|
||||
$this->db->trans_start();
|
||||
$this->db->insert('T_IGR_Master', $igrM);
|
||||
$insert_id = $this->db->affected_rows();
|
||||
$this->db->trans_complete();
|
||||
@ -88,7 +93,7 @@ class inwardgateregister_model extends CI_Model
|
||||
|
||||
$query = $this->db->query($subQuery);
|
||||
|
||||
return $query->result_array();
|
||||
return $query->result();
|
||||
}
|
||||
}
|
||||
|
||||
@ -105,7 +110,7 @@ class inwardgateregister_model extends CI_Model
|
||||
|
||||
$query = $this->db->query($subQuery);
|
||||
|
||||
return $query->result_array();
|
||||
return $query->result();
|
||||
}
|
||||
}
|
||||
function viewigr($IGRNO)
|
||||
|
||||
441
application/views/inwardgateregister.php
Normal file → Executable file
441
application/views/inwardgateregister.php
Normal file → Executable file
@ -3,34 +3,56 @@
|
||||
$(document).ready(function(){
|
||||
|
||||
$("#PONO").select2();
|
||||
//$("#generateIGR").modal('show');
|
||||
//$("#PurchaseOrderNoview").select2();
|
||||
|
||||
$("#InvoiceDate").datepicker({
|
||||
//minDate : d,
|
||||
maxDate : 'now',
|
||||
dateFormat: 'mm/dd/yy',changeMonth: true, changeYear: true,yearRange: '-100:+0'
|
||||
});
|
||||
// $("#Inwardgateregistertable").validate({
|
||||
// rules: {
|
||||
// QuantityAsPerInvoice: "required"
|
||||
// },
|
||||
// messages: {
|
||||
// QuantityAsPerInvoice: "Please specify your name"
|
||||
// }
|
||||
// })
|
||||
});
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.modal
|
||||
{
|
||||
padding-right:25% ! important;
|
||||
}
|
||||
.select2
|
||||
{
|
||||
width: 100% ! important;
|
||||
}
|
||||
.num{
|
||||
text-align:right;
|
||||
}
|
||||
.dataTables_wrapper {
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.modal {
|
||||
text-align: center;
|
||||
padding: 0!important;
|
||||
}
|
||||
|
||||
.modal:before {
|
||||
content: '';
|
||||
display: inline-block;
|
||||
height: 100%;
|
||||
vertical-align: middle;
|
||||
margin-right: -4px;
|
||||
}
|
||||
|
||||
.modal-dialog {
|
||||
display: inline-block;
|
||||
text-align: left;
|
||||
vertical-align: middle;
|
||||
}
|
||||
.select2 {
|
||||
width: 100% ! important;
|
||||
}
|
||||
.num {
|
||||
text-align:right;
|
||||
}
|
||||
.dataTables_wrapper {
|
||||
padding-bottom: 0px;
|
||||
}
|
||||
</style>
|
||||
|
||||
<div class="content-wrapper">
|
||||
<!-- Content Header (Page header) -->
|
||||
<section class="content-header">
|
||||
@ -60,7 +82,7 @@
|
||||
$PONO = $SI->PONO;
|
||||
|
||||
|
||||
endforeach;
|
||||
endforeach;
|
||||
|
||||
}
|
||||
|
||||
@ -93,7 +115,7 @@ endforeach;
|
||||
<label>Comments Of Special Instructions</label>
|
||||
<div class="form-group">
|
||||
<?php
|
||||
$data = array('name' => 'Comments','value' => set_value('Comments'),'id'=>'ser', 'class' => 'form-control' ,'readonly' => 'true' , 'rows'=>'3' ,'columns'=> '3');
|
||||
$data = array('name' => 'Comments','value' => set_value('Comments'),'id'=>'ser', 'class' => 'form-control' ,'readonly' => 'true' , 'rows'=>'3' ,'columns'=> '3');
|
||||
echo Form_textarea($data);
|
||||
?>
|
||||
</div>
|
||||
@ -145,15 +167,13 @@ endforeach;
|
||||
<th>Material</th>
|
||||
<th>UOM</th>
|
||||
<th>Ordered Quantity</th>
|
||||
<th>Received Quantity as per challan</th>
|
||||
<th>Adviced Quantity</th>
|
||||
<th>Remarks</th>
|
||||
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id ="IGRappend">
|
||||
|
||||
|
||||
|
||||
</tbody>
|
||||
<!--<tr>
|
||||
<td>2</td>
|
||||
@ -172,17 +192,61 @@ endforeach;
|
||||
|
||||
|
||||
</div>
|
||||
<div class="col-md-1 col-md-offset-11">
|
||||
<a class="btn btn-primary" type="submit" id="Save" onclick="Save(0);">Generate IGR</a>
|
||||
</div>
|
||||
<div class="col-md-1 col-md-offset-10">
|
||||
|
||||
<!--<a class="btn btn-primary" type="submit" id="Save" onclick="Save(0);">Generate IGR</a>-->
|
||||
<a class="btn btn-primary" onclick="Save();">Generate IGR</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="modal fade" id="generateIGR" role="dialog">
|
||||
<div class="modal-dialog modal_style">
|
||||
<!-- Modal content-->
|
||||
<form>
|
||||
|
||||
<div class="modal-content">
|
||||
|
||||
<div class="modal-header" style="background-color: #3c8dbc;color:#fff;">
|
||||
<button type="button" class="close" data-dismiss="modal">×</button>
|
||||
<center><h4>Inward Gate Register Number</h4></center>
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<center>IGRNO Successfully Created</center>
|
||||
<center><label style="font-size:40px;" id="finaligr" >DEFAULT</label> <center>
|
||||
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<center>
|
||||
<button type="reset" value="Reset" onClick="window.location.reload()"> ok </button>
|
||||
</center>
|
||||
</div><!-- footer div closed -->
|
||||
</div><!-- modal content div closed-->
|
||||
</form><!-- form closed-->
|
||||
</div><!-- modal content closed-->
|
||||
</div><!-- modal fade closed-->
|
||||
<!-- new modal ended-->
|
||||
|
||||
|
||||
|
||||
<!-- new modal ended-->
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</section>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<script>
|
||||
@ -208,41 +272,86 @@ function validate_Vechicle(){
|
||||
|
||||
}
|
||||
function validate()
|
||||
{
|
||||
|
||||
|
||||
if($('#PONO').val()=='-1')
|
||||
{
|
||||
var rowcount = $("#txtRowCount").val();
|
||||
var finald=0;
|
||||
var oldvalue=0;
|
||||
var exceed=0;
|
||||
//alert("validate rowcount " + rowcount);
|
||||
//$('#content').loader('show');
|
||||
for(i=1;i<=rowcount;i++)
|
||||
{
|
||||
//alert("inside for loop Row" + i);
|
||||
var v=v+i
|
||||
v =$("#QuantityAsPerInvoice"+i).val();
|
||||
//alert("new value"+ v);
|
||||
if(v !=''){
|
||||
var temp=$('#Quantity_1'+i).text();
|
||||
//alert("old value"+temp);
|
||||
|
||||
if(v <= temp){
|
||||
//alert('if');
|
||||
|
||||
}else{
|
||||
//alert('else');
|
||||
exceed++;
|
||||
}
|
||||
finald++;
|
||||
//alert('Have Value');
|
||||
}
|
||||
//alert("row one value" + v);
|
||||
}
|
||||
|
||||
if($('#PONO').val()=='-1')
|
||||
{
|
||||
|
||||
alert("Please select PurchaseOrder");
|
||||
$('#PONO').focus();
|
||||
return false;
|
||||
}
|
||||
|
||||
else if($('#InvoiceNo').val() == '' )
|
||||
{
|
||||
else if($('#InvoiceNo').val() == '' )
|
||||
{
|
||||
alert('Please Enter Invoice Number' );
|
||||
}
|
||||
else if($('#InvoiceDate').val() == '' )
|
||||
{
|
||||
$('#InvoiceNo').focus();
|
||||
return false;
|
||||
}
|
||||
else if($('#InvoiceDate').val() == '' )
|
||||
{
|
||||
alert('Please Enter Invoice Date' );
|
||||
}
|
||||
/*else if($('#VehicleNo').val() == '' )
|
||||
{
|
||||
alert('Please Enter Vechicle Number' );
|
||||
} */
|
||||
|
||||
else if ($('#Quantity' >= '#ReceivedQuantity').val()) {
|
||||
|
||||
|
||||
alert("Please Enter Correct Invoice Quantity");
|
||||
}
|
||||
else
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
$('#InvoiceDate').focus();
|
||||
return false;
|
||||
}
|
||||
else if (rowcount!=finald )
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
alert('Please Enter Received Quantity Correctly');
|
||||
return false;
|
||||
|
||||
}
|
||||
else if(exceed!=0 ){
|
||||
|
||||
alert('Adviced quantity is exceeding the Ordered quantity!');
|
||||
return false;
|
||||
}
|
||||
|
||||
// else if (($('#VehicleNo').val() == '' ) && ($('#CourierNo').val() == '' ))
|
||||
// {
|
||||
// alert('Please Enter Vechicle Number or Please Enter CourierNo' );
|
||||
// }
|
||||
// else if($('#ReceivedQuantity'+i+).val() == '')
|
||||
// {
|
||||
// alert('Please Enter Received Quantity' );
|
||||
// }
|
||||
// else if ($('#Quantity' >= '#ReceivedQuantity').val()) {
|
||||
|
||||
// alert("Please Enter Correct Invoice Quantity");
|
||||
|
||||
// }
|
||||
else
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<script>
|
||||
$(function () {
|
||||
@ -256,9 +365,10 @@ if($('#PONO').val()=='-1')
|
||||
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</script>
|
||||
|
||||
<script>
|
||||
$(function() {
|
||||
// $(function() {
|
||||
|
||||
$('#PONO').change(function() {
|
||||
|
||||
@ -273,12 +383,11 @@ if($('#PONO').val()=='-1')
|
||||
// alert(obj.PONO);
|
||||
if(id == obj.PONO)
|
||||
{
|
||||
$("#po").val(obj.PONO);
|
||||
$("#Sup").val(obj.SupplierName);
|
||||
// alert(obj.SupplierName);
|
||||
$("#po").val(obj.PONO);
|
||||
$("#Sup").val(obj.SupplierName);
|
||||
// alert(obj.SupplierName);
|
||||
$("#Add").val(obj.Address);
|
||||
$("#del").val(obj.DeliveryDate);
|
||||
|
||||
$("#ser").val(obj.ServiceDescription);
|
||||
//alert(obj.ServiceDescription);
|
||||
//$("#item").text(obj.MaterialCode);
|
||||
@ -302,18 +411,18 @@ if($('#PONO').val()=='-1')
|
||||
//if(data)
|
||||
//{
|
||||
var trHTML = '';
|
||||
//var rowcount=0;
|
||||
$.each(JSON.parse(data), function (i, item) {
|
||||
|
||||
i=i+1;
|
||||
trHTML += '<tr>' +
|
||||
'<td>' + i + '</td>' +
|
||||
'<td align="right">' + i + '</td>' +
|
||||
'<td name="MaterialName" id="MaterialCode" onchange="test('+i+')">' + item.MaterialCode + '</td>' +
|
||||
'<td>' + item.MaterialName + '</td>' +
|
||||
'<td name="UOM">' + item.UOM + '</td>' +
|
||||
'<td name="Quantity1'+i+'" id="Quantity_1'+i+'" onchange="test('+i+')">' + item.Quantity + '</td>' +
|
||||
'<td data-name="sel" ><input type="text" onchange="test('+i+')"id="QuantityAsPerInvoice'+ i +'" name="QuantityAsPerInvoice'+ i +'" class="form"></td>' +
|
||||
|
||||
'<td><input type="text" id="Remark'+ i +'" onchange = "test('+i+')" name="Remark'+ i +'" class="form"> </td>' +
|
||||
'<td align="right" name="Quantity1'+i+'" id="Quantity_1'+i+'">' + item.Quantity + '</td>' +
|
||||
'<td align="right" data-name="sel" ><input type="number" onchange="test('+i+')"id="QuantityAsPerInvoice'+ i +'" name="QuantityAsPerInvoice'+ i +'" class="form required" value=""></td>' +
|
||||
'<td><input type="text" id="Remark'+ i +'" name="Remark'+ i +'" class="form"> </td>' +
|
||||
'</tr>';
|
||||
$('#txtRowCount').val(i);
|
||||
|
||||
@ -324,6 +433,13 @@ if($('#PONO').val()=='-1')
|
||||
name: 'MaterialCode'+i
|
||||
}).appendTo('form');
|
||||
|
||||
// $('<input>').attr({
|
||||
// type:'hidden',
|
||||
// id: 'QuantityAsPerInvoice'+i,
|
||||
// value:$("#QuantityAsPerInvoice"+i).val();
|
||||
// name: 'QuantityAsPerInvoice'+i
|
||||
// }).appendTo('form');
|
||||
|
||||
|
||||
|
||||
|
||||
@ -333,116 +449,137 @@ if($('#PONO').val()=='-1')
|
||||
|
||||
// name: 'Remarks'+i
|
||||
// }).appendTo('form');
|
||||
|
||||
//rowcount++;
|
||||
});
|
||||
|
||||
//alert(trHTML);
|
||||
$("#IGRappend").empty();
|
||||
|
||||
//$("#IGRappend").append(trHTML);
|
||||
$('#Inwardgateregistertable > tbody').append(trHTML);
|
||||
|
||||
//$('#txtRowCount').val(rowcount);
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//$('#txtRowCount').val(rowcount);
|
||||
// var temp=$("#rowcount").val();
|
||||
// alert("HIDDEN:"+temp);
|
||||
});
|
||||
});
|
||||
// });
|
||||
|
||||
function test2(Rowid){
|
||||
//alert($('#MaterialCode'+Rowid).val());
|
||||
//alert($('#Quantity1'+Rowid).val());
|
||||
//alert(Rowid);
|
||||
var q =$("#QuantityAsPerInvoice"+Rowid).val();
|
||||
//alert(q);
|
||||
var r =$("#Remark"+Rowid).val();
|
||||
//alert($("#Quantity"+Rowid).val());
|
||||
var s =($("#Quantity_1"+Rowid).text());
|
||||
// alert(q);
|
||||
//alert(s);
|
||||
//$('#txtRowCount').val(q);
|
||||
$('<input>').attr({
|
||||
type: 'hidden',
|
||||
id: 'Quantity'+Rowid,
|
||||
//pattern : '[0-9]'+Rowid,
|
||||
value:s,
|
||||
name: 'Quantity'+Rowid
|
||||
|
||||
|
||||
|
||||
});
|
||||
|
||||
function test(Rowid){
|
||||
// alert($('#MaterialCode'+Rowid).val());
|
||||
//alert($('#Quantity1'+Rowid).val());
|
||||
//alert(Rowid);
|
||||
var q =$("#QuantityAsPerInvoice"+Rowid).val();
|
||||
// alert(q);
|
||||
var r =$("#Remark"+Rowid).val();
|
||||
//alert($("#Quantity"+Rowid).val());
|
||||
var s =($("#Quantity_1"+Rowid).text());
|
||||
//alert(s);
|
||||
$('<input>').attr({
|
||||
type: 'hidden',
|
||||
id: 'Quantity'+Rowid,
|
||||
value:s,
|
||||
name: 'Quantity'+Rowid
|
||||
|
||||
}).appendTo('form');
|
||||
}).appendTo('form');
|
||||
//alert(s)
|
||||
$('<input>').attr({
|
||||
type: 'hidden',
|
||||
id: 'ReceivedQuantity'+Rowid,
|
||||
value:q,
|
||||
name: 'ReceivedQuantity'+Rowid
|
||||
}).appendTo('form');
|
||||
$('<input>').attr({
|
||||
type: 'hidden',
|
||||
id: 'ReceivedQuantity'+Rowid,
|
||||
pattern : '[0-9]'+Rowid,
|
||||
//requried : 'true'+Rowid,
|
||||
value:q,
|
||||
name: 'ReceivedQuantity'+Rowid,
|
||||
}).appendTo('form');
|
||||
//alert(q);
|
||||
$('<input>').attr({
|
||||
type: 'hidden',
|
||||
id: 'Remarks'+Rowid,
|
||||
value:r,
|
||||
name: 'Remarks'+Rowid
|
||||
}).appendTo('form');
|
||||
$('<input>').attr({
|
||||
type: 'hidden',
|
||||
id: 'Remarks'+Rowid,
|
||||
//pattern : '[a-z,A-Z]'+Rowid,
|
||||
value:r,
|
||||
name: 'Remarks'+Rowid
|
||||
}).appendTo('form');
|
||||
|
||||
|
||||
|
||||
|
||||
// if ( q=='' || q=='0') {
|
||||
|
||||
// alert("Please Enter Correct Invoice Quantity");
|
||||
|
||||
// }
|
||||
|
||||
//else
|
||||
if(q >= s){
|
||||
|
||||
alert("Adviced qunatity is exceeding the Ordered quantity! ")
|
||||
return false;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
if ( s >= q) {
|
||||
|
||||
} else {
|
||||
alert("Please Enter Correct Invoice Quantity");
|
||||
else {
|
||||
alert("ok");
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
<script>
|
||||
// <script>
|
||||
// $(#QuantityAsPerInvoice+Rowid).validate({
|
||||
// rules: {
|
||||
// field1: "required"
|
||||
// },
|
||||
// messages: {
|
||||
// field1: "Please specify your name"
|
||||
// }
|
||||
// });
|
||||
// </script>
|
||||
<script>
|
||||
// function message() //for reload the page
|
||||
// {
|
||||
// alert("message worked");
|
||||
// window.location.reload();
|
||||
// }
|
||||
|
||||
function Save()
|
||||
{
|
||||
|
||||
//alert("save function worked ");
|
||||
|
||||
if (validate())
|
||||
if (validate())
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
//$('#content').loader('show');
|
||||
$.ajax({
|
||||
data:$('.IGR').serialize(),
|
||||
type:"POST",
|
||||
url:"<?php echo base_url() ?>inwardgateregister/addNewigr",
|
||||
//alert(" if condition validation part ");
|
||||
$('#content').loader('show');
|
||||
$.ajax({
|
||||
data:$('.IGR').serialize(),
|
||||
type:"POST",
|
||||
url:"<?php echo base_url() ?>inwardgateregister/addNewigr",
|
||||
|
||||
success:function(data) {
|
||||
console.log(data);
|
||||
if(data)
|
||||
{
|
||||
alert(data);
|
||||
window.location ="<?php echo base_url() ?>inwardgateregister/viewinwardgateregister";
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
alert("Error");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
success:function(data) {
|
||||
//alert("success function worked");//....
|
||||
//console.log(data);
|
||||
//alert("before if condition");
|
||||
if(data){
|
||||
// alert("after if condition");
|
||||
$('#IGRNO').val(data);
|
||||
alert("IGRNO"+data);
|
||||
document.getElementById('finaligr').innerHTML=data;
|
||||
$('#generateIGR').modal('show');
|
||||
//window.location ="<?php echo base_url() ?>inwardgateregister/addNewigr";
|
||||
}
|
||||
else
|
||||
{
|
||||
alert("Error");
|
||||
}
|
||||
//var igrvalueno = $(this).serialize();
|
||||
|
||||
}//success function closed
|
||||
});//ajax closed
|
||||
}//validate if closed
|
||||
}//save function closed
|
||||
</script>
|
||||
@ -40,11 +40,11 @@ collection:{container:"DTTT_dropdown dropdown-menu",buttons:{normal:"",disabled:
|
||||
<th>PO NO</th>
|
||||
<th>Supplier name</th>
|
||||
<th>Invoice No</th>
|
||||
<th>Date of Invoice</th>
|
||||
|
||||
|
||||
<th>Date of Invoice</th>
|
||||
<th>Vechicle No</th>
|
||||
<th>CourierNo</th>
|
||||
<th>CourierNo</th>
|
||||
<th>Action</th>
|
||||
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@ -58,17 +58,19 @@ collection:{container:"DTTT_dropdown dropdown-menu",buttons:{normal:"",disabled:
|
||||
$index = $index +1;
|
||||
?>
|
||||
<tr id="<?php echo $index ?>" >
|
||||
<td><?php echo $index?></td>
|
||||
<td align="right"><?php echo $index?></td>
|
||||
<td><a data-toggle="modal" data-target="#Igrshow" data-id="<%=index%>" data-userid="<?php echo $record->IGRNO ?>" > <u><?php echo $record->IGRNO ?></u></a></td>
|
||||
<td><?php echo $record->PONO ?></a></td>
|
||||
<td><?php echo $record->SupplierName ?></td>
|
||||
|
||||
|
||||
<td><?php echo $record->DeliveryChellanOrInvoiceNo ?></td>
|
||||
<td><?php echo $record->DeliveryChellanDate ?></td>
|
||||
|
||||
<td align="right"><?php
|
||||
$date = new DateTime($record->DeliveryChellanDate);
|
||||
echo $date->format('d/m/Y'); ?></td>
|
||||
<td><?php echo $record->VehicleNo ?></td>
|
||||
<td><?php echo $record->CourierNo ?></td>
|
||||
<td>
|
||||
<a href="<?php echo base_url().$record->IGRNO; ?>"><button style="font-size:12px">Generate MRIR <i class="fa fa-file-text"></i></button></a>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
//$SNo++;
|
||||
@ -122,20 +124,23 @@ collection:{container:"DTTT_dropdown dropdown-menu",buttons:{normal:"",disabled:
|
||||
<input type="text" id="Invoice_Date" readonly>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<br/>
|
||||
<div class="col-md-12">
|
||||
<div class="col-md-3">
|
||||
<label>Supplier and Address :</label>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<input type="text" id="Supplier" readonly>
|
||||
<input type="text" id="Add1" readonly>
|
||||
<textarea rows="3" cols="21" id="Add1" readonly>
|
||||
</textarea><br/>
|
||||
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<label>Comments Of Special Instructions :</label>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<input type="text" id="ser" readonly>
|
||||
<textarea rows="4" cols="21" id="ser" readonly>
|
||||
</textarea>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Table to show the line item of po -->
|
||||
@ -204,34 +209,35 @@ $("#Igrshow").on("shown.bs.modal", function(e) {
|
||||
$('#content').loader('hide');
|
||||
var trHTML = '';
|
||||
|
||||
$.each(JSON.parse(data), function (i, item) {
|
||||
if(igr == item.IGRNO)
|
||||
{
|
||||
$.each(JSON.parse(data), function (i, item) {
|
||||
if(igr == item.IGRNO)
|
||||
{
|
||||
|
||||
$("#IGRNO1").val(item.IGRNO);
|
||||
//alert(item.IGRNO);
|
||||
$("#PONo").val(item.PONO);
|
||||
$("#Supplier").val(item.SupplierName);
|
||||
|
||||
$("#Add1").val(item.Address);
|
||||
|
||||
$("#Invoice_No").val(item.DeliveryChellanOrInvoiceNo);
|
||||
//alert(item.DeliveryChellanDate);
|
||||
$("#Invoice_Date").val(item.DeliveryChellanDate);
|
||||
$("#ser").val(item.ServiceDescription);
|
||||
$("#IGRNO1").val(item.IGRNO);
|
||||
//alert(item.IGRNO);
|
||||
$("#PONo").val(item.PONO);
|
||||
$("#Supplier").val(item.SupplierName);
|
||||
$("#Add1").val(item.Address);
|
||||
$("#Invoice_No").val(item.DeliveryChellanOrInvoiceNo);
|
||||
//alert(item.DeliveryChellanDate);
|
||||
var dcd = new Date(item.DeliveryChellanDate);
|
||||
//alert(dcd.getDate()+ '.' + (dcd.getMonth() + 1)+ '.' + dcd.getFullYear());
|
||||
var dcd2 = (dcd.getDate()+ '/' + (dcd.getMonth() + 1)+ '/' + dcd.getFullYear());
|
||||
$("#Invoice_Date").val(dcd2);
|
||||
$("#ser").val(item.ServiceDescription);
|
||||
|
||||
|
||||
i=i+1;
|
||||
trHTML += '<tr>' +
|
||||
'<td>' + i + '</td>' +
|
||||
'<td align="right">' + i + '</td>' +
|
||||
'<td name="MaterialName" id="MaterialCode" onchange="test('+i+')">' + item.MaterialCode + '</td>' +
|
||||
'<td>' + item.MaterialName + '</td>' +
|
||||
'<td name="UOM">' + item.UOM + '</td>' +
|
||||
'<td name="Quantity">' + item.Quantity + '</td>' +
|
||||
'<td data-name="sel" >'+item.QuantityAsPerInvoice+'</td>' +
|
||||
|
||||
'<td align="right" name="Quantity">' + item.Quantity + '</td>' +
|
||||
'<td align="right" data-name="sel" >'+item.QuantityAsPerInvoice+'</td>' +
|
||||
'<td>'+ item.Remarks+ '</td>' +
|
||||
'</tr>';
|
||||
alert(item.QuantityAsPerInvoice);
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
Loading…
Reference in New Issue
Block a user