IGR Screen Created by sriramv
This commit is contained in:
parent
2694ac3cf9
commit
d81bd8ecfb
@ -68,6 +68,12 @@ define('REQITEM_PARTIALLY_PO_CREATED', 'ST023');
|
||||
define('REQITEM_Emergency_PO_CREATED', 'ST024');
|
||||
|
||||
|
||||
/*IGR Status */
|
||||
define('IGR_CREATED', 'ST027');
|
||||
define('IGR_CLOSED', 'ST028');
|
||||
define('IGR_CANCELLED', 'ST029');
|
||||
/*IGR Status*/
|
||||
|
||||
define('REQUISTSTATUS', '0');
|
||||
define('REQUISTITEMSTATUS', '1');
|
||||
|
||||
|
||||
@ -168,5 +168,10 @@ $route['purchaseorderListing'] = "purchaseorder/PurchaseOrderList";
|
||||
$route['EditPO'] = "purchaseorder/EditPurchaseOrder";
|
||||
$route['EmergencyPO'] = "emergencypurchaseorder/CreateEmergencyPO";
|
||||
|
||||
|
||||
//<-------------IGR page----------------->
|
||||
$route['Addigr'] = "inwardgateregister/addinwardgateregister";
|
||||
$route['Viewigr'] = "inwardgateregister/viewinwardgateregister";
|
||||
|
||||
/* End of file routes.php */
|
||||
/* Location: ./application/config/routes.php */
|
||||
|
||||
@ -16,9 +16,12 @@ class inwardgateregister extends BaseController
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
parent::__construct();
|
||||
$this->load->model('inwardgateregister_model');
|
||||
|
||||
$this->load->library('session');
|
||||
$this->load->library('form_validation');
|
||||
$this->load->library('form_validation');
|
||||
|
||||
$this->isLoggedIn();
|
||||
}
|
||||
/**
|
||||
@ -28,16 +31,162 @@ class inwardgateregister extends BaseController
|
||||
{
|
||||
$this->global['pageTitle'] = 'Siddharth : Inward Gate Register';
|
||||
|
||||
$this->loadViews("inwardgateregister", $this->global, NULL , NULL);
|
||||
$this->loadViews("viewinwardgateregister", $this->global,NULL , NULL);
|
||||
}
|
||||
|
||||
function materialinspectionreport()
|
||||
{
|
||||
$this->global['pageTitle'] = 'Siddharth : Material Inspetion Report';
|
||||
|
||||
$this->loadViews("materialinspectionreport", $this->global, NULL , NULL);
|
||||
}
|
||||
function viewinwardgateregister($IGRNO='',$IGR='')
|
||||
{
|
||||
$this->load->model('inwardgateregister_model');
|
||||
$this->global['pageTitle'] = 'Siddharth : Inward Gate Register';
|
||||
$data['IGR']= $this->inwardgateregister_model->igrListing($IGRNO,$IGR);
|
||||
|
||||
$this->loadViews("viewinwardgateregister",$this->global,$data,NULL);
|
||||
}
|
||||
|
||||
function addinwardgateregister($pono='',$IGRNO='',$IGR='')
|
||||
{
|
||||
|
||||
$this->load->model('inwardgateregister_model');
|
||||
$this->global['pageTitle'] = 'Siddharth : Add Inward Gate Register';
|
||||
//$data['IGR']=$this->inwardgateregister_model->igrListing($IGRNO,$IGR);
|
||||
|
||||
$data['PO_NO'] = $this->inwardgateregister_model->getpurchaseorder($pono);
|
||||
|
||||
|
||||
//print_r($data);
|
||||
|
||||
|
||||
|
||||
$this->loadViews("inwardgateregister", $this->global, $data, NULL);
|
||||
}
|
||||
|
||||
function getDateformat($Val)
|
||||
{
|
||||
$date = new DateTime($Val,new DateTimeZone('Asia/Kolkata'));
|
||||
// print_r($date);
|
||||
$retDate = $date->format('Y-m-d H:i:s');
|
||||
return $retDate;
|
||||
}
|
||||
|
||||
function IGRITEM($PO='')
|
||||
{
|
||||
|
||||
|
||||
$PO = $this->input->post('id');
|
||||
$data = $this->inwardgateregister_model->viewpurchaseorder($PO);
|
||||
//$result = $this->inwardgateregister_model->viewpurchaseorder($PO);
|
||||
/*$HTML="";
|
||||
for ($i = 0; $i < count($data); $i++)
|
||||
{
|
||||
$SNo = $i + 1;
|
||||
$MaterialCode = $result[$i]['MaterialCode'];
|
||||
$MaterialName = $result[$i]['MaterialName'];
|
||||
$UOM = $result[$i]['UOM'];
|
||||
$Quantity = $result[$i]['Quantity'];
|
||||
$HTML.="<tr id='".$i."'>
|
||||
<td align='left'>".$SNo."</td>
|
||||
<td align='left'>". $MaterialCode."</td>
|
||||
|
||||
<td align='left'>".$MaterialName."</td>
|
||||
|
||||
<td align='left'>".$UOM."</td>
|
||||
<td align='left'>".$Quantity."</td>
|
||||
</tr>";
|
||||
|
||||
//$index = $index + 1;
|
||||
|
||||
}*/
|
||||
echo json_encode($data);
|
||||
//$this->load->view('sample',$data,NULL);
|
||||
|
||||
}
|
||||
function addNewigr()
|
||||
{
|
||||
|
||||
|
||||
|
||||
$PONO = $this->input->post('PONO');
|
||||
//$igr = $this->input->post('igr');
|
||||
|
||||
|
||||
|
||||
$DeliveryChellanOrInvoiceNo = $this->input->post('InvoiceNo');
|
||||
|
||||
$DeliveryChellan = $this->input->post('InvoiceDate');
|
||||
$DeliveryChellanDate = $this->getDateformat($DeliveryChellan);
|
||||
|
||||
|
||||
$VehicleNo = $this->input->post('VehicleNo');
|
||||
$CourierNo = $this->input->post('CourierNo');
|
||||
|
||||
|
||||
$CreatedBy = $this->session->userdata('userId');
|
||||
//$Remarks = $this->input->post('Remarks');
|
||||
$RowCount = $this->input->post('txtRowCount');
|
||||
//echo $RowCount;
|
||||
$dt = new DateTime('now', new DateTimeZone('Asia/Kolkata'));
|
||||
$createddt = $dt->format('Y-m-d H:i:s');
|
||||
$IGRStatus = IGR_CREATED;
|
||||
|
||||
|
||||
//echo $RowCount;
|
||||
|
||||
$igr = array();
|
||||
|
||||
$igr = array('PONO'=>$PONO,'VehicleNo'=>$VehicleNo,'DeliveryChellanOrInvoiceNo'=>$DeliveryChellanOrInvoiceNo,'DeliveryChellanDate'=>$DeliveryChellanDate,'CourierNo'=>$CourierNo,'IGRStatus'=>$IGRStatus,'CreatedBy'=>$CreatedBy,'CreatedDate' =>$createddt);
|
||||
//print_r($igr);
|
||||
|
||||
$igrM = $this->inwardgateregister_model->addigrM($igr);
|
||||
|
||||
|
||||
$IGRNO = '';
|
||||
if(count($igrM)>0)
|
||||
{
|
||||
$IGRNO = $igrM[0]['IGRNO'];
|
||||
}
|
||||
//echo $IGRNO;
|
||||
$IGRItemStatus = REQITEM_NEW;
|
||||
//echo ("success");
|
||||
|
||||
//print_r($RowCount);
|
||||
for ($i = 1; $i <= $RowCount; $i++)
|
||||
{
|
||||
//echo i;
|
||||
|
||||
//echo $IGRNO ;
|
||||
$MaterialCode = $this->input->post('MaterialCode'.$i);
|
||||
|
||||
|
||||
$QuantityAsPerInvoice = $this->input->post('ReceivedQuantity'.$i);
|
||||
$Remarks = $this->input->post('Remarks'.$i);
|
||||
//$Remarks = $this->input->post('Remarks');
|
||||
|
||||
$CreatedBy = $this->session->userdata('userId');
|
||||
|
||||
|
||||
|
||||
$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);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
function ViewIGR($IGRNO='')
|
||||
{
|
||||
|
||||
$IGRNO= $this->input->post('id');
|
||||
//print_r($IGRNO);
|
||||
$data = $this->inwardgateregister_model->viewigr($IGRNO);
|
||||
//print_r( $data);
|
||||
|
||||
echo json_encode($data);
|
||||
|
||||
}
|
||||
function pageNotFound()
|
||||
{
|
||||
$this->global['pageTitle'] = 'Siddharth : 404 - Page Not Found';
|
||||
|
||||
131
application/models/inwardgateregister_model.php
Normal file
131
application/models/inwardgateregister_model.php
Normal file
@ -0,0 +1,131 @@
|
||||
<?php if(!defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
class inwardgateregister_model extends CI_Model
|
||||
{
|
||||
/**
|
||||
* This function is used to get the user listing count
|
||||
* @param string $searchText : This is optional search text
|
||||
* @return number $count : This is row count
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* This function is used to get the user listing count
|
||||
* @param string $searchText : This is optional search text
|
||||
* @param number $page : This is pagination offset
|
||||
* @param number $segment : This is pagination limit
|
||||
* @return array $result : This is result
|
||||
*/
|
||||
function igrListing($IGRNO,$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','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);
|
||||
|
||||
|
||||
|
||||
$query = $this->db->get();
|
||||
//print_r( $this->db->last_query());
|
||||
$result = $query->result();
|
||||
return $result;
|
||||
}
|
||||
|
||||
function getpurchaseorder($pono='')
|
||||
{
|
||||
$this->db->select('POM.PONO,POM.ServiceDescription,POM.DeliveryDate,sup.SupplierName,sup.Address');
|
||||
$this->db->from('T_PurchaseOrder_Master POM');
|
||||
$this->db->join('T_SupplierDetailsN sup', 'POM.SupplierID = sup.SupplierID','left');
|
||||
//$this->db->join('T_PurchaseOrder_LineItem POL', 'POL.PONO = POM.PONO','left');
|
||||
//$this->db->join('T_MaterialMaster MM', 'MM.MaterialCode = POL.MaterialCode','left');
|
||||
//$this->db->where('PONO',$pono="PO0002" );
|
||||
$query = $this->db->get();
|
||||
|
||||
$result = $query->result();
|
||||
//print_r($result);
|
||||
//$this->db->last_query();
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
function viewpurchaseorder($PO)
|
||||
{
|
||||
|
||||
$this->db->select('POM.PONO,POL.MaterialCode,POL.Quantity,POL.PONO,MM.MaterialName,MM.UOM');
|
||||
$this->db->from('T_PurchaseOrder_Master POM');
|
||||
//$this->db->join('T_SupplierDetailsN sup', 'POM.SupplierID = sup.SupplierID','left');
|
||||
$this->db->join('T_PurchaseOrder_LineItem POL', 'POL.PONO = POM.PONO','left');
|
||||
$this->db->join('T_MaterialMaster MM', 'MM.MaterialCode = POL.MaterialCode','left');
|
||||
$this->db->where('POM.PONO',$PO );
|
||||
|
||||
//$this->db->where('PONO', $PO);
|
||||
$query = $this->db->get();
|
||||
|
||||
$result = $query->result();
|
||||
|
||||
$this->db->last_query();
|
||||
return $result;
|
||||
}
|
||||
function addigrM($igrM)
|
||||
{
|
||||
|
||||
$this->db->trans_start();
|
||||
$this->db->insert('T_IGR_Master', $igrM);
|
||||
$insert_id = $this->db->affected_rows();
|
||||
$this->db->trans_complete();
|
||||
// print_r($this->db->last_query());
|
||||
print_r($insert_id);
|
||||
if($insert_id>0)
|
||||
{
|
||||
$subQuery = 'select max(IGRNO) as IGRNO from T_IGR_Master';
|
||||
|
||||
$query = $this->db->query($subQuery);
|
||||
|
||||
return $query->result_array();
|
||||
}
|
||||
}
|
||||
|
||||
function addigrD($igrD)
|
||||
{
|
||||
$this->db->trans_start();
|
||||
$this->db->insert('T_IGR_Details', $igrD);
|
||||
$insert_id = $this->db->affected_rows();
|
||||
$this->db->trans_complete();
|
||||
// print_r($this->db->last_query());
|
||||
if($insert_id>0)
|
||||
{
|
||||
$subQuery = 'select max(IGRItemNo) as IGRItemNo from T_IGR_Details';
|
||||
|
||||
$query = $this->db->query($subQuery);
|
||||
|
||||
return $query->result_array();
|
||||
}
|
||||
}
|
||||
function viewigr($IGRNO)
|
||||
{
|
||||
|
||||
$this->db->select('igr.*,igrd.*,MM.MaterialName,MM.UOM,sup.Address,sup.SupplierName,POM.ServiceDescription,POL.Quantity');
|
||||
$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_PurchaseOrder_LineItem POL','POL.PONO = POM.PONO','left');
|
||||
|
||||
$this->db->join('T_SupplierDetailsN sup', 'sup.SupplierID = POM.SupplierID','left');
|
||||
|
||||
$this->db->join('T_MaterialMaster MM', 'MM.MaterialCode = igrd.MaterialCode','left');
|
||||
$this->db->order_by('igr.IGRNO');
|
||||
$this->db->where('igr.IGRNO',$IGRNO);
|
||||
|
||||
|
||||
|
||||
$query = $this->db->get();
|
||||
//print_r( $this->db->last_query());
|
||||
$result = $query->result();
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
@ -433,15 +433,27 @@
|
||||
<span id="menu" data-toggle="dropdown" ><i class="fa fa-check-square-o"></i> Inspection<span class="caret"></span></span>
|
||||
<ul class="dropdown-menu" role="menu" aria-labelledby="menu2">
|
||||
<li class="treeview">
|
||||
<a href="<?php echo base_url(); ?>inwardgateregister/inwardgateregister">
|
||||
<a href="<?php echo base_url(); ?>Addigr">
|
||||
<i class="fa fa-upload"></i>
|
||||
<span>Inward Gate Register</span>
|
||||
<span>Inward Gate Register Entry</span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="treeview">
|
||||
<a href="<?php echo base_url(); ?>Viewigr">
|
||||
<i class="fa fa-eye"></i>
|
||||
<span>View Inward Gate Register</span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="treeview">
|
||||
<a href="<?php echo base_url(); ?>inwardgateregister/materialinspectionreport">
|
||||
<i class="fa fa-upload"></i>
|
||||
<span>Material Inspection Report</span>
|
||||
<span>Material Inspection Report Entry</span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="treeview">
|
||||
<a href="<?php echo base_url(); ?>inwardgateregister/viewmaterialinspectionreport">
|
||||
<i class="fa fa-upload"></i>
|
||||
<span>View Material Inspection Report</span>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
@ -2,19 +2,17 @@
|
||||
|
||||
$(document).ready(function(){
|
||||
|
||||
$("#PurchaseOrderNo").select2();
|
||||
$("#PurchaseOrderNoview").select2();
|
||||
$("#PONO").select2();
|
||||
//$("#PurchaseOrderNoview").select2();
|
||||
$("#InvoiceDate").datepicker({
|
||||
//minDate : d,
|
||||
maxDate : 'now',
|
||||
dateFormat: 'mm/dd/yy',changeMonth: true, changeYear: true,yearRange: '-100:+0'
|
||||
});
|
||||
});
|
||||
// For table
|
||||
(function(l,q){var e=function(b,c){b.extend(!0,c.defaults,{dom:"<'row'<'col-sm-9'l><'col-sm-3'f>><'row'<'col-sm-12'tr>><'row'<'col-sm-8'i><'col-sm-4'p>>",renderer:"bootstrap"});b.extend(c.ext.classes,{sWrapper:"dataTables_wrapper form-inline dt-bootstrap",sFilterInput:"form-control input-sm",sLengthSelect:"form-control input-sm"});c.ext.renderer.pageButton.bootstrap=function(g,e,r,s,i,m){var t=new c.Api(g),u=g.oClasses,j=g.oLanguage.oPaginate,d,f,n=0,p=function(c,e){var k,h,o,a,l=function(a){a.preventDefault();
|
||||
b(a.currentTarget).hasClass("disabled")||t.page(a.data.action).draw(!1)};k=0;for(h=e.length;k<h;k++)if(a=e[k],b.isArray(a))p(c,a);else{f=d="";switch(a){case "ellipsis":d="…";f="disabled";break;case "first":d=j.sFirst;f=a+(0<i?"":" disabled");break;case "previous":d=j.sPrevious;f=a+(0<i?"":" disabled");break;case "next":d=j.sNext;f=a+(i<m-1?"":" disabled");break;case "last":d=j.sLast;f=a+(i<m-1?"":" disabled");break;default:d=a+1,f=i===a?"active":""}d&&(o=b("<li>",{"class":u.sPageButton+" "+
|
||||
f,id:0===r&&"string"===typeof a?g.sTableId+"_"+a:null}).append(b("<a>",{href:"#","aria-controls":g.sTableId,"data-dt-idx":n,tabindex:g.iTabIndex}).html(d)).appendTo(c),g.oApi._fnBindAction(o,{action:a},l),n++)}},h;try{h=b(q.activeElement).data("dt-idx")}catch(l){}p(b(e).empty().html('<ul class="pagination"/>').children("ul"),s);h&&b(e).find("[data-dt-idx="+h+"]").focus()};c.TableTools&&(b.extend(!0,c.TableTools.classes,{container:"DTTT btn-group",buttons:{normal:"btn btn-default",disabled:"disabled"},
|
||||
collection:{container:"DTTT_dropdown dropdown-menu",buttons:{normal:"",disabled:"disabled"}},print:{info:"DTTT_print_info"},select:{row:"active"}}),b.extend(!0,c.TableTools.DEFAULTS.oTags,{collection:{container:"ul",button:"li",liner:"a"}}))};"function"===typeof define&&define.amd?define(["jquery","datatables"],e):"object"===typeof exports?e(require("jquery"),require("datatables")):jQuery&&e(jQuery,jQuery.fn.dataTable)})(window,document);
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<style>
|
||||
@ -26,289 +24,425 @@ collection:{container:"DTTT_dropdown dropdown-menu",buttons:{normal:"",disabled:
|
||||
{
|
||||
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">
|
||||
<h1>
|
||||
<center>Siddharth Industries - Inward Gate Register </center>
|
||||
<center>Siddharth Industries - Inward Gate Register (IGR) Entry</center>
|
||||
</h1>
|
||||
</section>
|
||||
<section class="content"><br/>
|
||||
<div class="row" style="padding-bottom:5%">
|
||||
<div class="row" style="padding-bottom:1%">
|
||||
<div class="col-md-12">
|
||||
<div class="col-md-3">
|
||||
<label>Enter Purchase Order NO </label>
|
||||
<div class="col-md-3">
|
||||
<?php
|
||||
$attributes = array('class' => 'form-label-left IGR ','name' => 'IGR','id' => 'IGR');
|
||||
|
||||
echo form_open($this->config->base_url().'/inwardgateregister/addNewigr/',$attributes); ?>
|
||||
<label>Select Purchase Order NO </label>
|
||||
<div>
|
||||
<?php
|
||||
$options = array("0"=>'Purchase Order No');
|
||||
|
||||
|
||||
echo form_dropdown('PurchaseOrderNoview', $options,set_value('PurchaseOrderNoview'),'id="PurchaseOrderNoview"' ,'class="form-control select2"' , 'required="true"' );
|
||||
|
||||
?>
|
||||
$options = array("-1"=>'Purchase Order No');
|
||||
|
||||
if(!empty($PO_NO))
|
||||
{
|
||||
//print_r($PO_NO);
|
||||
foreach ($PO_NO as $SI):
|
||||
|
||||
$options[$SI->PONO] = $SI->PONO .'-'. $SI->SupplierName ;
|
||||
$PONO = $SI->PONO;
|
||||
|
||||
|
||||
endforeach;
|
||||
|
||||
}
|
||||
|
||||
echo form_dropdown('PONO', $options,set_value('PONO'),'id="PONO"' ,'class="form-control select2"' , 'required="true"');
|
||||
|
||||
?>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3"> <br/>
|
||||
<a class="btn btn-primary" type="submit" data-toggle="modal" data-target="#Poshow" data-dismiss="modal" >PO Details</a>
|
||||
</div>
|
||||
|
||||
<div class="col-md-3">
|
||||
<label>Supplier Name </label>
|
||||
<div class="form-group">
|
||||
<?php
|
||||
$data = array('name' => 'SupplierName','value' => set_value('SupplierName'),'id'=>'Sup', 'class' => 'form-control' ,'readonly' => 'true');
|
||||
echo form_input($data);
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<label>Supplier Address</label>
|
||||
<div class="form-group">
|
||||
<?php
|
||||
$data = array('name' => 'Address','value' => set_value('Address'),'id'=>'Add', 'class' => 'form-control' ,'readonly' => 'true' , 'rows'=>'3' ,'columns'=> '3');
|
||||
echo Form_textarea($data);
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<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');
|
||||
echo Form_textarea($data);
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<div class="col-md-3">
|
||||
<label>Delivery Challan / Invoice NO</label>
|
||||
<?php
|
||||
$data = array('name' => 'InvoiceNo','value' => set_value('InvoiceNo'),'id'=>'InvoiceNo', 'class' => 'form-control', 'required=>"true"' );
|
||||
|
||||
echo form_input($data);
|
||||
?>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<label>Delivery Challan / Invoice Date</label>
|
||||
<?php
|
||||
$data = array('name' => 'InvoiceDate','value' => set_value('InvoiceDate'),'id'=>'InvoiceDate', 'class' => 'form-control num', 'required'=>'true' );
|
||||
echo form_input($data);
|
||||
?>
|
||||
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<label>Vechicle NO</label>
|
||||
<?php
|
||||
$data = array('name' => 'VehicleNo','value' => set_value('VehicleNo'),'pattern=>"^[A-Z]{2}\s[0-9]{2}\s[A-Z]{2}\s[0-9]{4}$"','id'=>'VehicleNo', 'class' => 'form-control num', 'required'=>'true','onchange'=>'validate_Vechicle();' );
|
||||
echo form_input($data);
|
||||
?>
|
||||
<span pattern="" required="true"></span>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<label>Courier NO</label>
|
||||
<?php
|
||||
$data = array('name' => 'CourierNo','value' => set_value('CourierNo'),'id'=>'CourierNo', 'class' => 'form-control num', 'required'=>'true' );
|
||||
echo form_input($data);
|
||||
?>
|
||||
</div>
|
||||
</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;">
|
||||
<table id="Inwardgateregistertable" class="table table-bordered table-hover editabletable IGR_Line" 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>S.NO</th>
|
||||
<th>Item Code</th>
|
||||
<th>Material</th>
|
||||
<th>UOM</th>
|
||||
<th>Ordered Quantity</th>
|
||||
<th>Received Quantity</th>
|
||||
<th>Vechicle No</th>
|
||||
<th>Date</th>
|
||||
<th>Received Quantity as per challan</th>
|
||||
<th>Remarks</th>
|
||||
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>1</td>
|
||||
<td><a data-toggle="modal" data-target="#Igrshow" data-dismiss="modal" >IGR0001</a></td>
|
||||
<td>PO0034</td>
|
||||
<td>DR Enterprises</td>
|
||||
<td>Inv123232</td>
|
||||
<td>8/6/2017</td>
|
||||
<tbody id ="IGRappend">
|
||||
|
||||
|
||||
|
||||
</tbody>
|
||||
<!--<tr>
|
||||
<td>2</td>
|
||||
<td>Sand12</td>
|
||||
<td>wast sand</td>
|
||||
<td>1000kgs</td>
|
||||
<td>1000kgs</td>
|
||||
<td>TN 34 G 5434</td>
|
||||
<td>2/6/2017</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>2</td>
|
||||
<td><a data-toggle="modal" data-target="#Igrshow" data-dismiss="modal" >IGR0002</a></td>
|
||||
<td>PO0035</td>
|
||||
<td>DR Enterprises</td>
|
||||
<td>Inv123255</td>
|
||||
<td>15/6/2017</td>
|
||||
<td>Sand12</td>
|
||||
<td>wast sand</td>
|
||||
<td>1000kgs</td>
|
||||
<td>1000kgs</td>
|
||||
<td>TN 34 G 5434</td>
|
||||
<td>6/6/2017</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
<td>kgs</td>
|
||||
<td class="num">1000</td>
|
||||
<td contenteditable="true" class="num">1000</td>
|
||||
<td contenteditable="true" class="num">Received</td>
|
||||
</tr>-->
|
||||
|
||||
|
||||
|
||||
</table>
|
||||
<input type="hidden" name="txtRowCount" id="txtRowCount" />
|
||||
|
||||
|
||||
</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>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="modal fade" id="Poshow" role="dialog">
|
||||
<div class="modal-dialog">
|
||||
<!-- Modal content-->
|
||||
<form>
|
||||
<div class="modal-content" style="width:900px;">
|
||||
<div class="modal-header" style="background-color: #3c8dbc;color:#fff;">
|
||||
<button type="button" class="close" data-dismiss="modal">×</button>
|
||||
<center><h4>Purchase Order Details</h4></center>
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<div class="col-md-3">
|
||||
<label>Purchase Order Number :</label>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
PO0034
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<label> Delivery Date :</label>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
9/6/2017
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<div class="col-md-3">
|
||||
<label>Supplier and Address :</label>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
D.R Enterprises ,153/233,Uthukottai Taluk, Tiruvallur Dist,Chennai,Tamilnadu,Pin code : 602026.
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<label>Comments Of Special Instructions :</label>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
raw Sand , resin ordered
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12" style="padding:2%;">
|
||||
<div class="col-md-4">
|
||||
Invoice NO
|
||||
<?php
|
||||
$data = array('name' => 'InvoiceNo','value' => set_value('InvoiceNo'),'id'=>'InvoiceNo', 'class' => 'form-control', 'required'=>'true' );
|
||||
echo form_input($data);
|
||||
?>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
Invoice Date
|
||||
<?php
|
||||
$data = array('name' => 'InvoiceDate','value' => set_value('InvoiceDate'),'id'=>'InvoiceDate', 'class' => 'form-control', 'required'=>'true' );
|
||||
echo form_input($data);
|
||||
?>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
Vechicle NO / Courier NO
|
||||
<?php
|
||||
$data = array('name' => 'vechorCourNo','value' => set_value('vechorCourNo'),'id'=>'vechorCourNo', 'class' => 'form-control', 'required'=>'true' );
|
||||
echo form_input($data);
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<!-- Table to show the line item of po -->
|
||||
<table class="table table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>SNo</th>
|
||||
<th>Item Code</th>
|
||||
<th>Item Description</th>
|
||||
<th>UOM</th>
|
||||
<th>Ordred Quantity</th>
|
||||
<th>Received Quantity</th> <!-- It should be editable for gate keeper -->
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="tbleAppend">
|
||||
<tr>
|
||||
<td>1</td>
|
||||
<td>RM002</td>
|
||||
<td>Raw sand</td>
|
||||
<td>Kgs</td>
|
||||
<td>10000</td>
|
||||
<td>10000</td><!-- This value will be given by gate keeper once item received-->
|
||||
</tr>
|
||||
<tr>
|
||||
<td>2</td>
|
||||
<td>RM003</td>
|
||||
<td>Resin</td>
|
||||
<td>Ltr</td>
|
||||
<td>100</td>
|
||||
<td></td><!-- This value will be given by gate keeper once item received-->
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="col-md-2 col-md-offset-10">
|
||||
<a class="btn btn-info" type="submit" align="right">submit</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal fade" id="Igrshow" role="dialog">
|
||||
<div class="modal-dialog">
|
||||
<!-- Modal content-->
|
||||
<form>
|
||||
<div class="modal-content" style="width:900px;">
|
||||
<div class="modal-header" style="background-color: #3c8dbc;color:#fff;">
|
||||
<button type="button" class="close" data-dismiss="modal">×</button>
|
||||
<center><h4>Inward Gate Register Details</h4></center>
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<div class="col-md-3">
|
||||
<label>IGR Number :</label>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
IGR0001
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<label> Purchase Order Number:</label>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
PO0034
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<div class="col-md-3">
|
||||
<label>Invoice Number :</label>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
Inv12353
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<label>Invoice Date:</label>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
6/9/2017
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-12">
|
||||
<div class="col-md-3">
|
||||
<label>Supplier and Address :</label>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
D.R Enterprises ,153/233,Uthukottai Taluk, Tiruvallur Dist,Chennai,Tamilnadu,Pin code : 602026.
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<label>Comments Of Special Instructions :</label>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
raw Sand , resin ordered
|
||||
</div>
|
||||
</div>
|
||||
<!-- Table to show the line item of po -->
|
||||
<table class="table table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>SNo</th>
|
||||
<th>Item Code</th>
|
||||
<th>Item Description</th>
|
||||
<th>UOM</th>
|
||||
<th>Ordred Quantity</th>
|
||||
<th>Received Quantity</th> <!-- It should be editable for gate keeper -->
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="tbleAppend">
|
||||
<tr>
|
||||
<td>1</td>
|
||||
<td>RM002</td>
|
||||
<td>Raw sand</td>
|
||||
<td>Kgs</td>
|
||||
<td>10000</td>
|
||||
<td>10000</td><!-- This value will be given by gate keeper once item received-->
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<div class="modal-footer">
|
||||
<a class="btn btn-info" data-dismiss="modal" value="Cancel">Cancel</a>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
<script>
|
||||
|
||||
|
||||
<script>
|
||||
|
||||
<!-- script for table , It works under the datatable plugin-->
|
||||
function validate_Vechicle(){
|
||||
|
||||
var reg = /^^[A-Z]{2}\s[0-9]{2}\s[A-Z]{2}\s[0-9]{4}$/;
|
||||
// alert();
|
||||
var VehicleNo = $('#VehicleNo').val();
|
||||
if(VehicleNo != "")
|
||||
{
|
||||
if (reg.test(VehicleNo) == false)
|
||||
{
|
||||
alert('Please Enter Valid Vehicle Number');
|
||||
return (false);
|
||||
}
|
||||
else
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
function validate()
|
||||
{
|
||||
|
||||
|
||||
if($('#PONO').val()=='-1')
|
||||
{
|
||||
|
||||
alert("Please select PurchaseOrder");
|
||||
}
|
||||
|
||||
else if($('#InvoiceNo').val() == '' )
|
||||
{
|
||||
alert('Please Enter Invoice Number' );
|
||||
}
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
</script>
|
||||
<script>
|
||||
$(function () {
|
||||
$('#Inwardgateregistertable').DataTable({
|
||||
"paging": true,
|
||||
"lengthChange": true,
|
||||
"searching": true,
|
||||
"ordering": true,
|
||||
"info": true,
|
||||
"autoWidth": true
|
||||
"paging": false,
|
||||
"lengthChange": false,
|
||||
"searching": false,
|
||||
"ordering": false,
|
||||
"info": false,
|
||||
"autoWidth": false
|
||||
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</script>
|
||||
<script>
|
||||
$(function() {
|
||||
|
||||
$('#PONO').change(function() {
|
||||
|
||||
|
||||
var id = $('#PONO').val();
|
||||
|
||||
|
||||
|
||||
var y = <?php echo json_encode($PO_NO, JSON_PRETTY_PRINT) ?>;
|
||||
//alert(y);
|
||||
$.each(y, function(idx, obj) {
|
||||
// alert(obj.PONO);
|
||||
if(id == obj.PONO)
|
||||
{
|
||||
$("#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);
|
||||
|
||||
//$("MaterialName").text(obj.MaterialName);
|
||||
}
|
||||
});
|
||||
|
||||
//alert(id);
|
||||
$.ajax({
|
||||
data:{id:id},
|
||||
type:"POST",
|
||||
url:"<?php echo base_url() ?>inwardgateregister/IGRITEM",
|
||||
|
||||
success:function(data) {
|
||||
|
||||
// alert(data);
|
||||
|
||||
//var myData = JSON.parse('{"name":"hai"}');
|
||||
//alert("hao"+myData.name);
|
||||
//if(data)
|
||||
//{
|
||||
var trHTML = '';
|
||||
$.each(JSON.parse(data), function (i, item) {
|
||||
|
||||
i=i+1;
|
||||
trHTML += '<tr>' +
|
||||
'<td>' + 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>' +
|
||||
'</tr>';
|
||||
$('#txtRowCount').val(i);
|
||||
|
||||
$('<input>').attr({
|
||||
type: 'hidden',
|
||||
id: 'MaterialCode'+i,
|
||||
value:item.MaterialCode,
|
||||
name: 'MaterialCode'+i
|
||||
}).appendTo('form');
|
||||
|
||||
|
||||
|
||||
|
||||
// $('<input>').attr({
|
||||
// type: 'hidden',
|
||||
// id: 'Remark'+i,
|
||||
|
||||
// name: 'Remarks'+i
|
||||
// }).appendTo('form');
|
||||
|
||||
});
|
||||
//alert(trHTML);
|
||||
$("#IGRappend").empty();
|
||||
|
||||
//$("#IGRappend").append(trHTML);
|
||||
$('#Inwardgateregistertable > tbody').append(trHTML);
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
||||
});
|
||||
|
||||
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)
|
||||
$('<input>').attr({
|
||||
type: 'hidden',
|
||||
id: 'ReceivedQuantity'+Rowid,
|
||||
value:q,
|
||||
name: 'ReceivedQuantity'+Rowid
|
||||
}).appendTo('form');
|
||||
//alert(q);
|
||||
$('<input>').attr({
|
||||
type: 'hidden',
|
||||
id: 'Remarks'+Rowid,
|
||||
value:r,
|
||||
name: 'Remarks'+Rowid
|
||||
}).appendTo('form');
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
if ( s >= q) {
|
||||
|
||||
} else {
|
||||
alert("Please Enter Correct Invoice Quantity");
|
||||
}
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
<script>
|
||||
function Save()
|
||||
{
|
||||
|
||||
|
||||
if (validate())
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
//$('#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>
|
||||
|
||||
|
||||
245
application/views/viewinwardgateregister.php
Normal file
245
application/views/viewinwardgateregister.php
Normal file
@ -0,0 +1,245 @@
|
||||
<script>
|
||||
|
||||
// For table
|
||||
(function(l,q){var e=function(b,c){b.extend(!0,c.defaults,{dom:"<'row'<'col-sm-9'l><'col-sm-3'f>><'row'<'col-sm-12'tr>><'row'<'col-sm-9'i><'col-sm-3'p>>",renderer:"bootstrap"});b.extend(c.ext.classes,{sWrapper:"dataTables_wrapper form-inline dt-bootstrap",sFilterInput:"form-control input-sm",sLengthSelect:"form-control input-sm"});c.ext.renderer.pageButton.bootstrap=function(g,e,r,s,i,m){var t=new c.Api(g),u=g.oClasses,j=g.oLanguage.oPaginate,d,f,n=0,p=function(c,e){var k,h,o,a,l=function(a){a.preventDefault();
|
||||
b(a.currentTarget).hasClass("disabled")||t.page(a.data.action).draw(!1)};k=0;for(h=e.length;k<h;k++)if(a=e[k],b.isArray(a))p(c,a);else{f=d="";switch(a){case "ellipsis":d="…";f="disabled";break;case "first":d=j.sFirst;f=a+(0<i?"":" disabled");break;case "previous":d=j.sPrevious;f=a+(0<i?"":" disabled");break;case "next":d=j.sNext;f=a+(i<m-1?"":" disabled");break;case "last":d=j.sLast;f=a+(i<m-1?"":" disabled");break;default:d=a+1,f=i===a?"active":""}d&&(o=b("<li>",{"class":u.sPageButton+" "+
|
||||
f,id:0===r&&"string"===typeof a?g.sTableId+"_"+a:null}).append(b("<a>",{href:"#","aria-controls":g.sTableId,"data-dt-idx":n,tabindex:g.iTabIndex}).html(d)).appendTo(c),g.oApi._fnBindAction(o,{action:a},l),n++)}},h;try{h=b(q.activeElement).data("dt-idx")}catch(l){}p(b(e).empty().html('<ul class="pagination"/>').children("ul"),s);h&&b(e).find("[data-dt-idx="+h+"]").focus()};c.TableTools&&(b.extend(!0,c.TableTools.classes,{container:"DTTT btn-group",buttons:{normal:"btn btn-default",disabled:"disabled"},
|
||||
collection:{container:"DTTT_dropdown dropdown-menu",buttons:{normal:"",disabled:"disabled"}},print:{info:"DTTT_print_info"},select:{row:"active"}}),b.extend(!0,c.TableTools.DEFAULTS.oTags,{collection:{container:"ul",button:"li",liner:"a"}}))};"function"===typeof define&&define.amd?define(["jquery","datatables"],e):"object"===typeof exports?e(require("jquery"),require("datatables")):jQuery&&e(jQuery,jQuery.fn.dataTable)})(window,document);
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.modal
|
||||
{
|
||||
padding-right:25% ! important;
|
||||
}
|
||||
.num{
|
||||
text-align:right;
|
||||
}
|
||||
.modal-content
|
||||
{
|
||||
width:950px ! important;
|
||||
}
|
||||
</style>
|
||||
<div class="content-wrapper">
|
||||
<!-- Content Header (Page header) -->
|
||||
<section class="content-header">
|
||||
<h1>
|
||||
<center>Siddharth Industries - View Inward Gate Register </center>
|
||||
</h1>
|
||||
</section>
|
||||
<section class="content"><br/>
|
||||
|
||||
<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>Vechicle No</th>
|
||||
<th>CourierNo</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
<?php
|
||||
if(!empty($IGR))
|
||||
{ $index = 0;
|
||||
foreach($IGR as $record)
|
||||
{
|
||||
|
||||
$index = $index +1;
|
||||
?>
|
||||
<tr id="<?php echo $index ?>" >
|
||||
<td><?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><?php echo $record->VehicleNo ?></td>
|
||||
<td><?php echo $record->CourierNo ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
//$SNo++;
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
|
||||
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal fade" id="Igrshow" role="dialog">
|
||||
<div class="modal-dialog">
|
||||
<!-- Modal content-->
|
||||
<form>
|
||||
<div class="modal-content" style="width:900px;">
|
||||
<div class="modal-header" style="background-color: #3c8dbc;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>
|
||||
|
||||
<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>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<label>Comments Of Special Instructions :</label>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<input type="text" id="ser" readonly>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Table to show the line item of po -->
|
||||
<div id="content" > </div>
|
||||
<table class="table table-bordered" id="Inwardgateregistertable1">
|
||||
<thead>
|
||||
<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">
|
||||
<!-- <tr>
|
||||
<td>1</td>
|
||||
<td>RM002</td>
|
||||
<td>Raw sand</td>
|
||||
<td>Kgs</td>
|
||||
<td>10000</td>
|
||||
<td>10000</td>
|
||||
<td>Received</td>
|
||||
</tr>-->
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<div class="modal-footer">
|
||||
<a class="btn btn-info" data-dismiss="modal" value="Cancel">Cancel</a>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<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
|
||||
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<script>
|
||||
$("#Igrshow").on("shown.bs.modal", function(e) {
|
||||
var igr = $(e.relatedTarget).data('userid');
|
||||
|
||||
|
||||
$('#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)
|
||||
{
|
||||
|
||||
$("#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);
|
||||
|
||||
|
||||
i=i+1;
|
||||
trHTML += '<tr>' +
|
||||
'<td>' + 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>'+ item.Remarks+ '</td>' +
|
||||
'</tr>';
|
||||
}
|
||||
|
||||
});
|
||||
$("#tbleAppend1").empty();
|
||||
$('#Inwardgateregistertable1 > tbody').append(trHTML);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
</script>
|
||||
Add Comment
|
||||
Loading…
Reference in New Issue
Block a user