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);
|
$this->loadViews("viewinwardgateregister", $this->global,NULL , NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
function viewinwardgateregister($IGRNO='',$IGR='')
|
function viewinwardgateregister()
|
||||||
{
|
{
|
||||||
$this->load->model('inwardgateregister_model');
|
$this->load->model('inwardgateregister_model');
|
||||||
$this->global['pageTitle'] = 'Siddharth : Inward Gate Register';
|
$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);
|
$this->loadViews("viewinwardgateregister",$this->global,$data,NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -134,7 +134,8 @@ class inwardgateregister extends BaseController
|
|||||||
$igr = array();
|
$igr = array();
|
||||||
|
|
||||||
$igr = array('PONO'=>$PONO,'VehicleNo'=>$VehicleNo,'DeliveryChellanOrInvoiceNo'=>$DeliveryChellanOrInvoiceNo,'DeliveryChellanDate'=>$DeliveryChellanDate,'CourierNo'=>$CourierNo,'IGRStatus'=>$IGRStatus,'CreatedBy'=>$CreatedBy,'CreatedDate' =>$createddt);
|
$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);
|
$igrM = $this->inwardgateregister_model->addigrM($igr);
|
||||||
|
|
||||||
@ -142,9 +143,12 @@ class inwardgateregister extends BaseController
|
|||||||
$IGRNO = '';
|
$IGRNO = '';
|
||||||
if(count($igrM)>0)
|
if(count($igrM)>0)
|
||||||
{
|
{
|
||||||
$IGRNO = $igrM[0]['IGRNO'];
|
foreach ($igrM as $key ) {
|
||||||
|
$IGRNO=$key->IGRNO;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
//echo $IGRNO;
|
echo $IGRNO;
|
||||||
|
|
||||||
$IGRItemStatus = REQITEM_NEW;
|
$IGRItemStatus = REQITEM_NEW;
|
||||||
//echo ("success");
|
//echo ("success");
|
||||||
|
|
||||||
@ -156,7 +160,6 @@ class inwardgateregister extends BaseController
|
|||||||
//echo $IGRNO ;
|
//echo $IGRNO ;
|
||||||
$MaterialCode = $this->input->post('MaterialCode'.$i);
|
$MaterialCode = $this->input->post('MaterialCode'.$i);
|
||||||
|
|
||||||
|
|
||||||
$QuantityAsPerInvoice = $this->input->post('ReceivedQuantity'.$i);
|
$QuantityAsPerInvoice = $this->input->post('ReceivedQuantity'.$i);
|
||||||
$Remarks = $this->input->post('Remarks'.$i);
|
$Remarks = $this->input->post('Remarks'.$i);
|
||||||
//$Remarks = $this->input->post('Remarks');
|
//$Remarks = $this->input->post('Remarks');
|
||||||
@ -169,7 +172,9 @@ class inwardgateregister extends BaseController
|
|||||||
//print_r($igrDetails);
|
//print_r($igrDetails);
|
||||||
$igrD = $this->inwardgateregister_model->addigrD($igrDetails);
|
$igrD = $this->inwardgateregister_model->addigrD($igrDetails);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
//print_r($IGRNO);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -16,18 +16,23 @@ class inwardgateregister_model extends CI_Model
|
|||||||
* @param number $segment : This is pagination limit
|
* @param number $segment : This is pagination limit
|
||||||
* @return array $result : This is result
|
* @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->select('igr.*,igrd.*,POM.DeliveryDate,sup.SupplierName,MM.MaterialName');
|
||||||
$this->db->from('T_IGR_Master igr');
|
//$this->db->from('T_IGR_Master igr');
|
||||||
$this->db->join('T_IGR_Details igrd','igrd.IGRNO = igr.IGRNO','left');
|
//$this->db->join('T_IGR_Details igrd','igrd.IGRNO = igr.IGRNO');
|
||||||
$this->db->join('T_PurchaseOrder_Master POM ', 'igr.PONO = POM.PONO','left');
|
//$this->db->join('T_PurchaseOrder_Master POM ', 'igr.PONO = POM.PONO');
|
||||||
$this->db->join('T_SupplierDetailsN sup', 'POM.SupplierID = sup.SupplierID','left');
|
//$this->db->join('T_SupplierDetailsN sup', 'POM.SupplierID = sup.SupplierID');
|
||||||
$this->db->join('T_PurchaseOrder_LineItem POL', 'POL.PONO = igr.PONO','left');
|
//$this->db->join('T_MaterialMaster MM', 'MM.MaterialCode = igrd.MaterialCode');
|
||||||
$this->db->join('T_MaterialMaster MM', 'MM.MaterialCode = igrd.MaterialCode','left');
|
//$this->db->group_by('igr.IGRNO');
|
||||||
$this->db->group_by('igr.IGRNO',$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 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();
|
$query = $this->db->get();
|
||||||
@ -76,7 +81,7 @@ class inwardgateregister_model extends CI_Model
|
|||||||
function addigrM($igrM)
|
function addigrM($igrM)
|
||||||
{
|
{
|
||||||
|
|
||||||
$this->db->trans_start();
|
$this->db->trans_start();
|
||||||
$this->db->insert('T_IGR_Master', $igrM);
|
$this->db->insert('T_IGR_Master', $igrM);
|
||||||
$insert_id = $this->db->affected_rows();
|
$insert_id = $this->db->affected_rows();
|
||||||
$this->db->trans_complete();
|
$this->db->trans_complete();
|
||||||
@ -88,7 +93,7 @@ class inwardgateregister_model extends CI_Model
|
|||||||
|
|
||||||
$query = $this->db->query($subQuery);
|
$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);
|
$query = $this->db->query($subQuery);
|
||||||
|
|
||||||
return $query->result_array();
|
return $query->result();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
function viewigr($IGRNO)
|
function viewigr($IGRNO)
|
||||||
|
|||||||
409
application/views/inwardgateregister.php
Normal file → Executable file
409
application/views/inwardgateregister.php
Normal file → Executable file
@ -3,34 +3,56 @@
|
|||||||
$(document).ready(function(){
|
$(document).ready(function(){
|
||||||
|
|
||||||
$("#PONO").select2();
|
$("#PONO").select2();
|
||||||
|
//$("#generateIGR").modal('show');
|
||||||
//$("#PurchaseOrderNoview").select2();
|
//$("#PurchaseOrderNoview").select2();
|
||||||
|
|
||||||
$("#InvoiceDate").datepicker({
|
$("#InvoiceDate").datepicker({
|
||||||
//minDate : d,
|
//minDate : d,
|
||||||
maxDate : 'now',
|
maxDate : 'now',
|
||||||
dateFormat: 'mm/dd/yy',changeMonth: true, changeYear: true,yearRange: '-100:+0'
|
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 {
|
||||||
|
text-align: center;
|
||||||
|
padding: 0!important;
|
||||||
|
}
|
||||||
|
|
||||||
</script>
|
.modal:before {
|
||||||
|
content: '';
|
||||||
|
display: inline-block;
|
||||||
|
height: 100%;
|
||||||
|
vertical-align: middle;
|
||||||
|
margin-right: -4px;
|
||||||
|
}
|
||||||
|
|
||||||
<style>
|
.modal-dialog {
|
||||||
.modal
|
display: inline-block;
|
||||||
{
|
text-align: left;
|
||||||
padding-right:25% ! important;
|
vertical-align: middle;
|
||||||
}
|
}
|
||||||
.select2
|
.select2 {
|
||||||
{
|
width: 100% ! important;
|
||||||
width: 100% ! important;
|
}
|
||||||
}
|
.num {
|
||||||
.num{
|
text-align:right;
|
||||||
text-align:right;
|
}
|
||||||
}
|
.dataTables_wrapper {
|
||||||
.dataTables_wrapper {
|
|
||||||
padding-bottom: 0px;
|
padding-bottom: 0px;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<div class="content-wrapper">
|
<div class="content-wrapper">
|
||||||
<!-- Content Header (Page header) -->
|
<!-- Content Header (Page header) -->
|
||||||
<section class="content-header">
|
<section class="content-header">
|
||||||
@ -60,7 +82,7 @@
|
|||||||
$PONO = $SI->PONO;
|
$PONO = $SI->PONO;
|
||||||
|
|
||||||
|
|
||||||
endforeach;
|
endforeach;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -93,7 +115,7 @@ endforeach;
|
|||||||
<label>Comments Of Special Instructions</label>
|
<label>Comments Of Special Instructions</label>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<?php
|
<?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);
|
echo Form_textarea($data);
|
||||||
?>
|
?>
|
||||||
</div>
|
</div>
|
||||||
@ -145,15 +167,13 @@ endforeach;
|
|||||||
<th>Material</th>
|
<th>Material</th>
|
||||||
<th>UOM</th>
|
<th>UOM</th>
|
||||||
<th>Ordered Quantity</th>
|
<th>Ordered Quantity</th>
|
||||||
<th>Received Quantity as per challan</th>
|
<th>Adviced Quantity</th>
|
||||||
<th>Remarks</th>
|
<th>Remarks</th>
|
||||||
|
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody id ="IGRappend">
|
<tbody id ="IGRappend">
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</tbody>
|
</tbody>
|
||||||
<!--<tr>
|
<!--<tr>
|
||||||
<td>2</td>
|
<td>2</td>
|
||||||
@ -172,11 +192,50 @@ endforeach;
|
|||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-1 col-md-offset-11">
|
<div class="col-md-1 col-md-offset-10">
|
||||||
<a class="btn btn-primary" type="submit" id="Save" onclick="Save(0);">Generate IGR</a>
|
|
||||||
</div>
|
<!--<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>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<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>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -185,6 +244,11 @@ endforeach;
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
|
||||||
<!-- script for table , It works under the datatable plugin-->
|
<!-- script for table , It works under the datatable plugin-->
|
||||||
@ -208,41 +272,86 @@ function validate_Vechicle(){
|
|||||||
|
|
||||||
}
|
}
|
||||||
function validate()
|
function validate()
|
||||||
{
|
{
|
||||||
|
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');
|
||||||
|
|
||||||
if($('#PONO').val()=='-1')
|
}else{
|
||||||
|
//alert('else');
|
||||||
|
exceed++;
|
||||||
|
}
|
||||||
|
finald++;
|
||||||
|
//alert('Have Value');
|
||||||
|
}
|
||||||
|
//alert("row one value" + v);
|
||||||
|
}
|
||||||
|
|
||||||
|
if($('#PONO').val()=='-1')
|
||||||
{
|
{
|
||||||
|
|
||||||
alert("Please select PurchaseOrder");
|
alert("Please select PurchaseOrder");
|
||||||
|
$('#PONO').focus();
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
else if($('#InvoiceNo').val() == '' )
|
||||||
else if($('#InvoiceNo').val() == '' )
|
{
|
||||||
{
|
|
||||||
alert('Please Enter Invoice Number' );
|
alert('Please Enter Invoice Number' );
|
||||||
}
|
$('#InvoiceNo').focus();
|
||||||
else if($('#InvoiceDate').val() == '' )
|
return false;
|
||||||
{
|
}
|
||||||
|
else if($('#InvoiceDate').val() == '' )
|
||||||
|
{
|
||||||
alert('Please Enter Invoice Date' );
|
alert('Please Enter Invoice Date' );
|
||||||
}
|
$('#InvoiceDate').focus();
|
||||||
/*else if($('#VehicleNo').val() == '' )
|
return false;
|
||||||
{
|
}
|
||||||
alert('Please Enter Vechicle Number' );
|
else if (rowcount!=finald )
|
||||||
} */
|
{
|
||||||
|
|
||||||
else if ($('#Quantity' >= '#ReceivedQuantity').val()) {
|
alert('Please Enter Received Quantity Correctly');
|
||||||
|
return false;
|
||||||
|
|
||||||
|
|
||||||
alert("Please Enter Correct Invoice Quantity");
|
|
||||||
}
|
}
|
||||||
else
|
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;
|
return true;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
<script>
|
<script>
|
||||||
$(function () {
|
$(function () {
|
||||||
@ -257,8 +366,9 @@ if($('#PONO').val()=='-1')
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
$(function() {
|
// $(function() {
|
||||||
|
|
||||||
$('#PONO').change(function() {
|
$('#PONO').change(function() {
|
||||||
|
|
||||||
@ -273,12 +383,11 @@ if($('#PONO').val()=='-1')
|
|||||||
// alert(obj.PONO);
|
// alert(obj.PONO);
|
||||||
if(id == obj.PONO)
|
if(id == obj.PONO)
|
||||||
{
|
{
|
||||||
$("#po").val(obj.PONO);
|
$("#po").val(obj.PONO);
|
||||||
$("#Sup").val(obj.SupplierName);
|
$("#Sup").val(obj.SupplierName);
|
||||||
// alert(obj.SupplierName);
|
// alert(obj.SupplierName);
|
||||||
$("#Add").val(obj.Address);
|
$("#Add").val(obj.Address);
|
||||||
$("#del").val(obj.DeliveryDate);
|
$("#del").val(obj.DeliveryDate);
|
||||||
|
|
||||||
$("#ser").val(obj.ServiceDescription);
|
$("#ser").val(obj.ServiceDescription);
|
||||||
//alert(obj.ServiceDescription);
|
//alert(obj.ServiceDescription);
|
||||||
//$("#item").text(obj.MaterialCode);
|
//$("#item").text(obj.MaterialCode);
|
||||||
@ -302,18 +411,18 @@ if($('#PONO').val()=='-1')
|
|||||||
//if(data)
|
//if(data)
|
||||||
//{
|
//{
|
||||||
var trHTML = '';
|
var trHTML = '';
|
||||||
|
//var rowcount=0;
|
||||||
$.each(JSON.parse(data), function (i, item) {
|
$.each(JSON.parse(data), function (i, item) {
|
||||||
|
|
||||||
i=i+1;
|
i=i+1;
|
||||||
trHTML += '<tr>' +
|
trHTML += '<tr>' +
|
||||||
'<td>' + i + '</td>' +
|
'<td align="right">' + i + '</td>' +
|
||||||
'<td name="MaterialName" id="MaterialCode" onchange="test('+i+')">' + item.MaterialCode + '</td>' +
|
'<td name="MaterialName" id="MaterialCode" onchange="test('+i+')">' + item.MaterialCode + '</td>' +
|
||||||
'<td>' + item.MaterialName + '</td>' +
|
'<td>' + item.MaterialName + '</td>' +
|
||||||
'<td name="UOM">' + item.UOM + '</td>' +
|
'<td name="UOM">' + item.UOM + '</td>' +
|
||||||
'<td name="Quantity1'+i+'" id="Quantity_1'+i+'" onchange="test('+i+')">' + item.Quantity + '</td>' +
|
'<td align="right" name="Quantity1'+i+'" id="Quantity_1'+i+'">' + item.Quantity + '</td>' +
|
||||||
'<td data-name="sel" ><input type="text" onchange="test('+i+')"id="QuantityAsPerInvoice'+ i +'" name="QuantityAsPerInvoice'+ i +'" class="form"></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>' +
|
||||||
'<td><input type="text" id="Remark'+ i +'" onchange = "test('+i+')" name="Remark'+ i +'" class="form"> </td>' +
|
|
||||||
'</tr>';
|
'</tr>';
|
||||||
$('#txtRowCount').val(i);
|
$('#txtRowCount').val(i);
|
||||||
|
|
||||||
@ -324,6 +433,13 @@ if($('#PONO').val()=='-1')
|
|||||||
name: 'MaterialCode'+i
|
name: 'MaterialCode'+i
|
||||||
}).appendTo('form');
|
}).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
|
// name: 'Remarks'+i
|
||||||
// }).appendTo('form');
|
// }).appendTo('form');
|
||||||
|
//rowcount++;
|
||||||
});
|
});
|
||||||
|
|
||||||
//alert(trHTML);
|
//alert(trHTML);
|
||||||
$("#IGRappend").empty();
|
$("#IGRappend").empty();
|
||||||
|
|
||||||
//$("#IGRappend").append(trHTML);
|
//$("#IGRappend").append(trHTML);
|
||||||
$('#Inwardgateregistertable > tbody').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
|
||||||
|
|
||||||
|
}).appendTo('form');
|
||||||
});
|
|
||||||
|
|
||||||
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');
|
|
||||||
//alert(s)
|
//alert(s)
|
||||||
$('<input>').attr({
|
$('<input>').attr({
|
||||||
type: 'hidden',
|
type: 'hidden',
|
||||||
id: 'ReceivedQuantity'+Rowid,
|
id: 'ReceivedQuantity'+Rowid,
|
||||||
value:q,
|
pattern : '[0-9]'+Rowid,
|
||||||
name: 'ReceivedQuantity'+Rowid
|
//requried : 'true'+Rowid,
|
||||||
}).appendTo('form');
|
value:q,
|
||||||
|
name: 'ReceivedQuantity'+Rowid,
|
||||||
|
}).appendTo('form');
|
||||||
//alert(q);
|
//alert(q);
|
||||||
$('<input>').attr({
|
$('<input>').attr({
|
||||||
type: 'hidden',
|
type: 'hidden',
|
||||||
id: 'Remarks'+Rowid,
|
id: 'Remarks'+Rowid,
|
||||||
value:r,
|
//pattern : '[a-z,A-Z]'+Rowid,
|
||||||
name: 'Remarks'+Rowid
|
value:r,
|
||||||
}).appendTo('form');
|
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("ok");
|
||||||
} else {
|
|
||||||
alert("Please Enter Correct Invoice Quantity");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
</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();
|
||||||
|
// }
|
||||||
|
|
||||||
<script>
|
|
||||||
function Save()
|
function Save()
|
||||||
{
|
{
|
||||||
|
//alert("save function worked ");
|
||||||
|
|
||||||
|
if (validate())
|
||||||
if (validate())
|
|
||||||
{
|
{
|
||||||
|
|
||||||
|
//alert(" if condition validation part ");
|
||||||
|
$('#content').loader('show');
|
||||||
|
$.ajax({
|
||||||
|
data:$('.IGR').serialize(),
|
||||||
|
type:"POST",
|
||||||
|
url:"<?php echo base_url() ?>inwardgateregister/addNewigr",
|
||||||
|
|
||||||
|
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
|
||||||
//$('#content').loader('show');
|
});//ajax closed
|
||||||
$.ajax({
|
}//validate if closed
|
||||||
data:$('.IGR').serialize(),
|
}//save function closed
|
||||||
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>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@ -41,10 +41,10 @@ collection:{container:"DTTT_dropdown dropdown-menu",buttons:{normal:"",disabled:
|
|||||||
<th>Supplier name</th>
|
<th>Supplier name</th>
|
||||||
<th>Invoice No</th>
|
<th>Invoice No</th>
|
||||||
<th>Date of Invoice</th>
|
<th>Date of Invoice</th>
|
||||||
|
|
||||||
|
|
||||||
<th>Vechicle No</th>
|
<th>Vechicle No</th>
|
||||||
<th>CourierNo</th>
|
<th>CourierNo</th>
|
||||||
|
<th>Action</th>
|
||||||
|
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
@ -58,17 +58,19 @@ collection:{container:"DTTT_dropdown dropdown-menu",buttons:{normal:"",disabled:
|
|||||||
$index = $index +1;
|
$index = $index +1;
|
||||||
?>
|
?>
|
||||||
<tr id="<?php echo $index ?>" >
|
<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><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->PONO ?></a></td>
|
||||||
<td><?php echo $record->SupplierName ?></td>
|
<td><?php echo $record->SupplierName ?></td>
|
||||||
|
|
||||||
|
|
||||||
<td><?php echo $record->DeliveryChellanOrInvoiceNo ?></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->VehicleNo ?></td>
|
||||||
<td><?php echo $record->CourierNo ?></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>
|
</tr>
|
||||||
<?php
|
<?php
|
||||||
//$SNo++;
|
//$SNo++;
|
||||||
@ -122,20 +124,23 @@ collection:{container:"DTTT_dropdown dropdown-menu",buttons:{normal:"",disabled:
|
|||||||
<input type="text" id="Invoice_Date" readonly>
|
<input type="text" id="Invoice_Date" readonly>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<br/>
|
||||||
<div class="col-md-12">
|
<div class="col-md-12">
|
||||||
<div class="col-md-3">
|
<div class="col-md-3">
|
||||||
<label>Supplier and Address :</label>
|
<label>Supplier and Address :</label>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-3">
|
<div class="col-md-3">
|
||||||
<input type="text" id="Supplier" readonly>
|
<input type="text" id="Supplier" readonly>
|
||||||
<input type="text" id="Add1" readonly>
|
<textarea rows="3" cols="21" id="Add1" readonly>
|
||||||
|
</textarea><br/>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-3">
|
<div class="col-md-3">
|
||||||
<label>Comments Of Special Instructions :</label>
|
<label>Comments Of Special Instructions :</label>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-3">
|
<div class="col-md-3">
|
||||||
<input type="text" id="ser" readonly>
|
<textarea rows="4" cols="21" id="ser" readonly>
|
||||||
|
</textarea>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- Table to show the line item of po -->
|
<!-- Table to show the line item of po -->
|
||||||
@ -204,34 +209,35 @@ $("#Igrshow").on("shown.bs.modal", function(e) {
|
|||||||
$('#content').loader('hide');
|
$('#content').loader('hide');
|
||||||
var trHTML = '';
|
var trHTML = '';
|
||||||
|
|
||||||
$.each(JSON.parse(data), function (i, item) {
|
$.each(JSON.parse(data), function (i, item) {
|
||||||
if(igr == item.IGRNO)
|
if(igr == item.IGRNO)
|
||||||
{
|
{
|
||||||
|
|
||||||
$("#IGRNO1").val(item.IGRNO);
|
$("#IGRNO1").val(item.IGRNO);
|
||||||
//alert(item.IGRNO);
|
//alert(item.IGRNO);
|
||||||
$("#PONo").val(item.PONO);
|
$("#PONo").val(item.PONO);
|
||||||
$("#Supplier").val(item.SupplierName);
|
$("#Supplier").val(item.SupplierName);
|
||||||
|
$("#Add1").val(item.Address);
|
||||||
$("#Add1").val(item.Address);
|
$("#Invoice_No").val(item.DeliveryChellanOrInvoiceNo);
|
||||||
|
//alert(item.DeliveryChellanDate);
|
||||||
$("#Invoice_No").val(item.DeliveryChellanOrInvoiceNo);
|
var dcd = new Date(item.DeliveryChellanDate);
|
||||||
//alert(item.DeliveryChellanDate);
|
//alert(dcd.getDate()+ '.' + (dcd.getMonth() + 1)+ '.' + dcd.getFullYear());
|
||||||
$("#Invoice_Date").val(item.DeliveryChellanDate);
|
var dcd2 = (dcd.getDate()+ '/' + (dcd.getMonth() + 1)+ '/' + dcd.getFullYear());
|
||||||
$("#ser").val(item.ServiceDescription);
|
$("#Invoice_Date").val(dcd2);
|
||||||
|
$("#ser").val(item.ServiceDescription);
|
||||||
|
|
||||||
|
|
||||||
i=i+1;
|
i=i+1;
|
||||||
trHTML += '<tr>' +
|
trHTML += '<tr>' +
|
||||||
'<td>' + i + '</td>' +
|
'<td align="right">' + i + '</td>' +
|
||||||
'<td name="MaterialName" id="MaterialCode" onchange="test('+i+')">' + item.MaterialCode + '</td>' +
|
'<td name="MaterialName" id="MaterialCode" onchange="test('+i+')">' + item.MaterialCode + '</td>' +
|
||||||
'<td>' + item.MaterialName + '</td>' +
|
'<td>' + item.MaterialName + '</td>' +
|
||||||
'<td name="UOM">' + item.UOM + '</td>' +
|
'<td name="UOM">' + item.UOM + '</td>' +
|
||||||
'<td name="Quantity">' + item.Quantity + '</td>' +
|
'<td align="right" name="Quantity">' + item.Quantity + '</td>' +
|
||||||
'<td data-name="sel" >'+item.QuantityAsPerInvoice+'</td>' +
|
'<td align="right" data-name="sel" >'+item.QuantityAsPerInvoice+'</td>' +
|
||||||
|
|
||||||
'<td>'+ item.Remarks+ '</td>' +
|
'<td>'+ item.Remarks+ '</td>' +
|
||||||
'</tr>';
|
'</tr>';
|
||||||
|
alert(item.QuantityAsPerInvoice);
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user