ogr change

This commit is contained in:
venbatechnologies@gmail.com 2018-04-25 17:05:14 +05:30
parent 617e139bcf
commit 6d38bb5117
5 changed files with 91 additions and 20 deletions

View File

@ -72,7 +72,7 @@ class inwardgateregister extends BaseController
$data['Customer'] = $this->inwardgateregister_model->getCustomer();
$data['Supplier'] = $this->inwardgateregister_model->getSupplier();
//$data['Invoice'] = $this->inwardgateregister_model->getInvoice();
$data['storedmaterialcode'] = $this->inwardgateregister_model->getstoredmaterialcode();
//print_r($data['PO_NO']);
$this->loadViews("ogr", $this->global, $data, NULL);
@ -583,7 +583,12 @@ class inwardgateregister extends BaseController
$name= $this->input->post('name');
$pooutward= $this->input->post('pooutward');
$destination= $this->input->post('destination');
$Ogrline= array('OGRNO'=>$OGRNO,'MaterialCode'=>$material,'OutwardQty'=>$pooutward,'Destination'=>$destination,'Status'=>$Status,'Material_Name'=>$name);
$Remarks= $this->input->post('Remark');
$Ogrline= array('OGRNO'=>$OGRNO,'MaterialCode'=>$material,'OutwardQty'=>$pooutward,'Destination'=>$destination,'Status'=>$Status,'SupplierID'=>$name,'Remark'=>$Remarks);
print_r($Ogrline);
//die();
$addOgrline = $this->inwardgateregister_model->AddOgrLine($Ogrline);

View File

@ -318,14 +318,23 @@ class inwardgateregister_model extends CI_Model
}
function getstoredmaterialcode()
{
$subQuery='select MaterialCode,MaterialName from T_MaterialMaster';
$query = $this->db->query($subQuery);
return $query->result();
}
function getOGRData()
{
$this->db->select('T_OGR_Master.*,T_OGR_Details.*,SupplierName');
$this->db->select('T_OGR_Master.*,T_OGR_Details.*,T_SupplierDetailsN.SupplierName,sup.SupplierName as Servicesupplier');
$this->db->from('T_OGR_Master');
$this->db->join('T_OGR_Details','T_OGR_Details.OGRNO=T_OGR_Master.OGRNO');
$this->db->join('T_PurchaseOrder_Master','T_PurchaseOrder_Master.PONO=T_OGR_Master.PONO_INV','left');
$this->db->join('T_SupplierDetailsN','T_SupplierDetailsN.SupplierID=T_PurchaseOrder_Master.SupplierID','left');
$this->db->join('T_SupplierDetailsN sup','sup.SupplierID=T_OGR_Details.SupplierID','left');
$this->db->group_by('T_OGR_Master.OGRNO');
//$this->db->where();
$query = $this->db->get();
@ -337,11 +346,14 @@ class inwardgateregister_model extends CI_Model
function getOGRDataforedit($OGRNO)
{
$this->db->select('T_OGR_Master.*,SupplierName,T_OGR_Details.*');
$this->db->select('T_OGR_Master.*,T_SupplierDetailsN.SupplierName,T_OGR_Details.*,sup.SupplierName as ServiceSupname,T_MaterialMaster.MaterialName as Matname,Remark');
$this->db->from('T_OGR_Master');
$this->db->join('T_OGR_Details','T_OGR_Details.OGRNO=T_OGR_Master.OGRNO');
$this->db->join('T_PurchaseOrder_Master','T_PurchaseOrder_Master.PONO=T_OGR_Master.PONO_INV','left');
$this->db->join('T_SupplierDetailsN','T_SupplierDetailsN.SupplierID=T_PurchaseOrder_Master.SupplierID','left');
$this->db->join('T_SupplierDetailsN sup','sup.SupplierID=T_OGR_Details.SupplierID','left');
$this->db->join('T_MaterialMaster','T_MaterialMaster.MaterialCode=T_OGR_Details.MaterialCode','left');
$this->db->where('T_OGR_Master.OGRNO',$OGRNO);
//$this->db->group_by('T_OGR_Master.OGRNO');

View File

@ -22,7 +22,10 @@ $type='';
$MaterialCode='';
$name='';
$outqty='';
$matname='';
$Remark = '';
//print_r($OGR_Data);
if(!empty($OGR_Data))
{
@ -31,7 +34,7 @@ if(!empty($OGR_Data))
$type=$dt->OgrType;
if($type=='SERVICE')
{
$sup=$dt->Destination;
$sup=$dt->ServiceSupname;
}
else
{
@ -46,6 +49,8 @@ if(!empty($OGR_Data))
//$name=$dt->;
$outqty=$dt->OutwardQty;
$mrirno= $dt->MRIRNO;
$matname= $dt->Matname;
$Remark= $dt->Remark;
}
}
@ -311,7 +316,7 @@ if(!empty($OGR_Data))
<div class="form-group">
<?php
$data = array('name' => 'name','value' => set_value('name',$MaterialName),'id'=>'name', 'class' => 'form-control');
$data = array('name' => 'name','value' => set_value('name',$matname),'id'=>'name', 'class' => 'form-control');
echo form_input($data);
?>
</div>
@ -359,13 +364,20 @@ if(!empty($OGR_Data))
</div>
<div class="col-md-3">
<label>Destination</label>
<!-- <label>Destination</label>
<div class="form-group">
<?php
$data = array('name' => 'destination','value' => set_value('destination',$sup),'id'=>'destination', 'class' => 'form-control');
echo form_input($data);
?>
?> -->
<label>Remarks</label>
<?php
$data = array('name' => 'Remark','value' => set_value('Remark',$Remark),'id'=>'Remark', 'class' => 'form-control' ,'rows' => '10', 'cols' => '100','maxlength' => '500');
echo Form_textarea($data);
?>
</div>

View File

@ -434,25 +434,47 @@ $Value="&#8377;";
<div class="col-md-3">
<div class="col-md-12" style="padding-left: 0px;">
<label>Material Code</label>
<div class="form-group">
<div class="form-group">
<?php
$data = array('name' => 'material','value' => set_value('material'),'id'=>'material', 'class' => 'form-control');
echo form_input($data);
?>
</div>
<?php
$options = array("0"=>'Select');
//print_r( $options);
if(!empty($storedmaterialcode))
{
foreach ($storedmaterialcode as $SID):
// echo $SID->ConfigValue;
$options[$SID->MaterialCode] = $SID->MaterialCode .'-'. $SID->MaterialName ;
endforeach;
}
echo form_dropdown('material', $options,set_value('material'),'id="material"' ,'required="true"' ,'class="form-control select2');
?>
</div>
</div>
</div>
<div class="col-md-9" style="padding: 0px;">
<div class="col-md-3">
<label>Name</label>
<label>Supplier Name</label>
<div class="form-group">
<?php
$data = array('name' => 'name','value' => set_value('name'),'id'=>'name', 'class' => 'form-control');
echo form_input($data);
$options1 = array("0"=>'Select');
if(!empty($Supplier))
{
foreach ($Supplier as $SID):
// echo $SID->ConfigValue;
$options1[$SID->SupplierID] = $SID->SupplierID .'-'. $SID->SupplierName ;
endforeach;
}
echo form_dropdown('name', $options1,set_value('name'),'id="name"' ,'required="true"' ,'class="form-control select2');
?>
</div>
@ -498,7 +520,7 @@ $Value="&#8377;";
</div>
<div class="col-md-3">
<!-- <div class="col-md-3">
<label>Destination</label>
<div class="form-group">
@ -510,8 +532,28 @@ $Value="&#8377;";
</div> -->
<div class="col-md-3">
<label>Remarks</label>
<?php
$data = array('name' => 'Remark','value' => set_value('Remark'),'id'=>'Remark', 'class' => 'form-control' ,'rows' => '10', 'cols' => '100','maxlength' => '500');
echo Form_textarea($data);
?>
</div>
</div>
</div>
<!-- <div class="col-md-3">
<label>Remarks</label>
<?php
$data = array('name' => 'Remark','value' => set_value('Remark'),'id'=>'Remark', 'class' => 'form-control' ,'rows' => '10', 'cols' => '100','maxlength' => '500');
echo Form_textarea($data);
?>
</div> -->
</div>
</div>

View File

@ -56,7 +56,7 @@
<?php if($ogr->OgrType == 'PO'){?>
<td><?php echo $ogr->SupplierName?></td>
<? } else{ ?>
<td><?php echo $ogr->Destination?></td>
<td><?php echo $ogr->Servicesupplier?></td>
<?php }?>
<td><?php echo $dt;?></td>