342 lines
12 KiB
PHP
342 lines
12 KiB
PHP
<link rel="stylesheet" href="https://cdn.datatables.net/1.10.16/css/jquery.dataTables.min.css">
|
|
<link rel="stylesheet" href="https://cdn.datatables.net/buttons/1.4.2/css/buttons.dataTables.min.css">
|
|
<style>
|
|
.dataTables_filter input {padding: 4px;}
|
|
.dataTables_filter {
|
|
width: 50%;
|
|
float: right;
|
|
text-align: right;
|
|
}
|
|
.dataTables_paginate {
|
|
width: 50%;
|
|
float: right;
|
|
text-align: right;
|
|
}
|
|
div.dt-buttons {
|
|
font-size: 15px;
|
|
position: relative;
|
|
float: right;
|
|
|
|
}
|
|
.btn-success {
|
|
background-color: #5d0411;
|
|
border-color: #5d0411;
|
|
}
|
|
|
|
.modal
|
|
{
|
|
padding-right:25% ! important;
|
|
}
|
|
.num{
|
|
text-align:right;
|
|
}
|
|
.modal-content
|
|
{
|
|
width: 800px ! important;
|
|
}
|
|
</style>
|
|
<div class="content-wrapper">
|
|
|
|
<section class="content"><br/>
|
|
<div class="box">
|
|
<div class=" container-fluid">
|
|
<div class="box-header">
|
|
<!-- <CENTER><h3 class="box-title">Resico Industries - View Inward Gate Register</h3></CENTER> -->
|
|
<CENTER><h3 class="box-title"><?php echo $pageTitle; ?></h3></CENTER>
|
|
</div>
|
|
<div class="row">
|
|
<div class="col-md-12">
|
|
|
|
<table id="Inwardgateregistertable" class="table table-bordered table-hover" style="background-color:#fff;font-size:12px;">
|
|
<thead style="background-color:#ddf">
|
|
<tr>
|
|
<th>S.No</th>
|
|
<th>IGR No</th>
|
|
<th>PO No</th>
|
|
<th>Supplier Name</th>
|
|
<th>Invoice No</th>
|
|
<th>Date of Invoice</th>
|
|
<th>Material Name</th>
|
|
<th>Advice Quantity</th>
|
|
<th>Vechicle No</th>
|
|
<th>Courier No</th>
|
|
<th>Action</th>
|
|
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
|
|
<?php
|
|
if(!empty($IGR))
|
|
{ $index = 0;
|
|
foreach($IGR as $record)
|
|
{
|
|
|
|
$index = $index +1;
|
|
?>
|
|
<tr id="<?php echo $index ?>" >
|
|
<td style="text-align: center;"><?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> this is igrno flow old flow -->
|
|
<td><a data-toggle="modal" data-target="#Igrshow" data-id="<?php echo $record->IGRNO.",".$record->IGRItemNo ?>" > <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 align="right"><?php
|
|
$date = new DateTime($record->DeliveryChellanDate);
|
|
echo $date->format('d-m-Y'); ?></td>
|
|
<td><?php echo $record->MaterialName ?></td>
|
|
<td><span data-toggle="tooltip" title="Quantity as per Received"><?php echo $record->QuantityAsPerInvoice ?></span></td>
|
|
<!--<td><span data-toggle="tooltip" title="Quantity as per Received"><?php echo $record->QuantityAsPerInvoice."/".$record->Quantity ?></span></td>-->
|
|
<td><?php echo $record->VehicleNo ?></td>
|
|
<td><?php echo $record->CourierNo ?></td>
|
|
<td>
|
|
<a href="<?php echo base_url().'MRIRcontroller/igrdatavalues?IGRNO='.$record->IGRNO.'&IGRitemno='.$record->IGRItemNo; ?>"><button style="font-size:12px" id="generated" name="generated">Generate MRIR <i class="fa fa-file-text"></i></button></a>
|
|
<!-- <a href="<?php echo base_url().'MRIRcontroller/igrdatavalues?IGRNO='.$record->IGRNO.'&IGRitemno='.$record->IGRItemNo; ?>"><i class="fa fa-file-text" data-toggle="tooltip" target="_blank" title="Click here to generate MRIR"></i></a> -->
|
|
</td>
|
|
</tr>
|
|
<?php
|
|
//$SNo++;
|
|
}
|
|
}
|
|
?>
|
|
|
|
|
|
|
|
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div></div>
|
|
</div>
|
|
</div>
|
|
<div class="modal fade" id="Igrshow" role="dialog">
|
|
<div class="modal-dialog">
|
|
<!-- Modal content-->
|
|
<form>
|
|
<div class="modal-content" style="width:800px;">
|
|
<div class="modal-header" style="background-color: #5d0411;color:#fff;">
|
|
<button type="button" class="close" data-dismiss="modal">×</button>
|
|
<center><h4>Inward Gate Register Details</h4></center> <!-- IGR number should display here-->
|
|
</div>
|
|
<!--<div class="col-md-12">
|
|
<div class="col-md-3">
|
|
<label>IGR Number :</label>
|
|
</div>
|
|
<div class="col-md-3">
|
|
<input type="text" id="IGRNO1" readonly>
|
|
</div>
|
|
<div class="col-md-3">
|
|
<label> Purchase Order Number:</label>
|
|
</div>
|
|
<div class="col-md-3">
|
|
<input type="text" id="PONo" readonly>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-12">
|
|
<div class="col-md-3">
|
|
<label>Delivery Challan/Invoice NO :</label>
|
|
</div>
|
|
<div class="col-md-3">
|
|
<input type="text" id="Invoice_No" readonly>
|
|
</div>
|
|
<div class="col-md-3">
|
|
<label>Delivery Challan / Invoice Date:</label>
|
|
</div>
|
|
<div class="col-md-3">
|
|
<input type="text" id="Invoice_Date" readonly>
|
|
</div>
|
|
</div>
|
|
<br/>
|
|
<div class="col-md-12">
|
|
<div class="col-md-3">
|
|
<label>Supplier Name :</label>
|
|
</div>
|
|
<div class="col-md-3">
|
|
<input type="text" id="Supplier" readonly>
|
|
|
|
|
|
</div>
|
|
|
|
</div>-->
|
|
|
|
<div class="col-md-12">
|
|
<div class="col-md-4">
|
|
<label>IGR Number </label>
|
|
<?php
|
|
$data = array('name' => 'IGRNumber','value' => set_value('IGRNumber'),'id'=>'IGRNO1', 'class' => 'form-control', 'required=>"true"' , 'readonly'=>'true' );
|
|
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
<div class="col-md-4">
|
|
<label>Purchase Order Number </label>
|
|
<?php
|
|
$data = array('name' => 'PurchaseOrderNumber','value' => set_value('PurchaseOrderNumber'),'id'=>'PONo', 'class' => 'form-control', 'required=>"true"' , 'readonly'=>'true' );
|
|
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
<div class="col-md-4">
|
|
<label>Delivery Challan/Invoice NO </label>
|
|
<?php
|
|
$data = array('name' => 'DeliveryChallan/InvoiceNO','value' => set_value('DeliveryChallan/InvoiceNO'),'id'=>'Invoice_No', 'class' => 'form-control', 'required=>"true"' , 'readonly'=>'true' );
|
|
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-12" style=" padding-bottom: 10px;">
|
|
<div class="col-md-4">
|
|
<label>Delivery Challan / Invoice Date </label>
|
|
<?php
|
|
$data = array('name' => 'DeliveryChallan/InvoiceDate','value' => set_value('DeliveryChallan/InvoiceDate'),'id'=>'Invoice_Date', 'class' => 'form-control', 'required=>"true"' , 'readonly'=>'true' );
|
|
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
<div class="col-md-4">
|
|
<label>Supplier Name </label>
|
|
<?php
|
|
$data = array('name' => 'SupplierName','value' => set_value('SupplierName'),'id'=>'Supplier', 'class' => 'form-control', 'required=>"true"' , 'readonly'=>'true' );
|
|
|
|
echo form_input($data);
|
|
?>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<!-- Table to show the line item of po -->
|
|
<div id="content" > </div>
|
|
<table class="table table-bordered" id="Inwardgateregistertable1" style="font-size:12px;">
|
|
<thead style="background-color:#ddf">
|
|
<tr>
|
|
<th>SNo</th>
|
|
<th>Item Code</th>
|
|
<th>Item Description</th>
|
|
<th>UOM</th>
|
|
<th>Ordred Quantity</th>
|
|
<th>Received Quantity</th>
|
|
<th>Remarks</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody id="tbleAppend1"></tbody>
|
|
</table>
|
|
|
|
<div class="modal-footer">
|
|
<a class="btn btn-primary" data-dismiss="modal" value="Cancel">Cancel</a>
|
|
</div>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
|
|
<script src="https://cdn.datatables.net/1.10.16/js/jquery.dataTables.min.js"></script>
|
|
<script src="https://cdn.datatables.net/buttons/1.4.2/js/dataTables.buttons.min.js"></script>
|
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.1.3/jszip.min.js"></script>
|
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.32/pdfmake.min.js"></script>
|
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.32/vfs_fonts.js"></script>
|
|
<script src="https://cdn.datatables.net/buttons/1.4.2/js/buttons.html5.min.js"></script>
|
|
<script src="https://cdn.datatables.net/buttons/1.4.2/js/buttons.colVis.min.js"></script>
|
|
|
|
<script>
|
|
<!-- script for table , It works under the datatable plugin-->
|
|
// $(function () {
|
|
// $('#Inwardgateregistertable').DataTable({
|
|
// "paging": true,
|
|
// "lengthChange": true,
|
|
// "searching": true,
|
|
// "ordering": true,
|
|
// "info": true,
|
|
// "autoWidth": true
|
|
|
|
// });
|
|
//});
|
|
|
|
|
|
$(document).ready(function() {
|
|
// buttons: [ {name: 'copy', extend: 'copy', exportOptions: {columns: ':gt(0)', orthogonal: 'export'}} ]
|
|
table = $('#Inwardgateregistertable').DataTable( {
|
|
"dom": "<'row'<'col-md-6'l><'col-md-6'Bf>>" +
|
|
"<'row'<'col-md-3'><'col-md-6'>>" +
|
|
"<'row'<'col-md-12't>><'row'<'col-md-4'i><'col-md-8'p>>",
|
|
"lengthMenu": [ 25, 50, 75, 100 ],
|
|
|
|
buttons: [
|
|
|
|
{
|
|
extend: 'excelHtml5',
|
|
footer: 'true',
|
|
//messageTop: $('h3').text(),
|
|
title: $('h3').text(),
|
|
exportOptions: {
|
|
columns: ':lt(10)', orthogonal: 'export'
|
|
|
|
}
|
|
},
|
|
|
|
]
|
|
|
|
} );
|
|
} );
|
|
</script>
|
|
</script>
|
|
<script>
|
|
$("#Igrshow").on("shown.bs.modal", function(e) {
|
|
//var igr = $(e.relatedTarget).data('userid');
|
|
var igr_nos = $(e.relatedTarget).data('id');
|
|
var igr = igr_nos.split(',');
|
|
igr = igr[1];
|
|
|
|
$('#content').loader('show');
|
|
$.ajax({
|
|
data:{id:igr},
|
|
type:"POST",
|
|
//dataType: 'json',
|
|
url:"<?php echo base_url() ?>inwardgateregister/ViewIGR",
|
|
success:function(data) {
|
|
// success:function(data) {
|
|
$('#content').loader('hide');
|
|
var trHTML = '';
|
|
|
|
$.each(JSON.parse(data), function (i, item) {
|
|
//if(igr == item.IGRNO)
|
|
if(igr == item.IGRItemNo)
|
|
{
|
|
|
|
$("#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 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 align="right" name="Quantity">' + item.Quantity + '</td>' +
|
|
'<td align="right" data-name="sel" >'+item.QuantityAsPerInvoice+'</td>' +
|
|
'<td>'+ item.Remarks+ '</td>' +
|
|
'</tr>';
|
|
//alert(item.QuantityAsPerInvoice);
|
|
}
|
|
|
|
});
|
|
$("#tbleAppend1").empty();
|
|
$('#Inwardgateregistertable1 > tbody').append(trHTML);
|
|
}
|
|
});
|
|
});
|
|
|
|
</script>
|