diff --git a/application/controllers/inwardgateregister.php b/application/controllers/inwardgateregister.php index 4a440f76..7ab7aef0 100644 --- a/application/controllers/inwardgateregister.php +++ b/application/controllers/inwardgateregister.php @@ -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); diff --git a/application/models/inwardgateregister_model.php b/application/models/inwardgateregister_model.php index 28492877..c28441ab 100755 --- a/application/models/inwardgateregister_model.php +++ b/application/models/inwardgateregister_model.php @@ -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'); diff --git a/application/views/editogr.php b/application/views/editogr.php index afe396fe..cd21480f 100644 --- a/application/views/editogr.php +++ b/application/views/editogr.php @@ -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))