diff --git a/app/Controllers/Inwardgateregister.php b/app/Controllers/Inwardgateregister.php index d99a697b..83a028c1 100755 --- a/app/Controllers/Inwardgateregister.php +++ b/app/Controllers/Inwardgateregister.php @@ -50,14 +50,14 @@ class Inwardgateregister extends BaseController function viewIGR() { + $this->global['pageTitle'] = 'View Inward Gate Register'; - $data['IGR'] = $this->inwardgateregister_model->ViewigrListing(); + $result = $this->inwardgateregister_model->ViewigrListing(); + $data['IGR'] = $result[0]; + $data['IGRDownload'] = $result[1]; $data['userRole'] = $this->session->get('role'); $data['transporter'] = $this->inwardgateregister_model->transporter(); $this->loadViews("viewinwardgateregister", $this->global, $data, NULL); - // $this->global['pageTitle'] = 'Inward Gate Register Details'; - // $data['IGR'] = $this->inwardgateregister_model->igrListing(); - // $this->loadViews("viewIGRDetails", $this->global, $data, NULL); } function addIGR() diff --git a/app/Controllers/Purchaseorder.php b/app/Controllers/Purchaseorder.php index a06ca417..b655a10d 100755 --- a/app/Controllers/Purchaseorder.php +++ b/app/Controllers/Purchaseorder.php @@ -4256,8 +4256,14 @@ class Purchaseorder extends BaseController $filelist = array('PONO' => $pono, 'IGRNO' => $igr, 'FilePath' => $Picture); $uploadfiles = $this->purchaseorder_model->insertfile($filelist); if ($uploadfiles > 0) { - echo "file updated successfully!"; - return true; + $response = [ + 'message' => 'File updated successfully!', + 'data' => $uploadfiles + ]; + + // Return the response as JSON + return $this->response->setJSON($response); + } } else{ echo " Internal Server Error..!!"; @@ -4395,8 +4401,16 @@ class Purchaseorder extends BaseController } - if($uploadfile > 0){ - echo "updated successfully!"; + if( $uploadfile['afftectedRows'] > 0){ + + $response = [ + 'message' => 'File updated successfully!', + 'data' =>$uploadfile['updatedRow'] + ]; + + // Return the response as JSON + return $this->response->setJSON($response); + } else{ echo "Update Failed (maybe same file provided for update kindly check)..!!"; diff --git a/app/Models/Inwardgateregister_model.php b/app/Models/Inwardgateregister_model.php index a0bd5054..860a415a 100755 --- a/app/Models/Inwardgateregister_model.php +++ b/app/Models/Inwardgateregister_model.php @@ -339,7 +339,7 @@ class Inwardgateregister_model extends Model $result = $query->getResult(); return $result; } - function ViewigrListing() + function ViewigrListing_old() { // $builder = $this->db->table('t_igr_master igr') @@ -368,6 +368,37 @@ class Inwardgateregister_model extends Model return $result; } + function ViewigrListing() + { + + $builder = $this->db->table('t_igr_master igr') + ->select('igr.*,PO.IsOpenOrder,PO.DeliveryDate,sup.SupplierName,PO.POType,trans.name as TransporterName , SUM(IGRD.QuantityAsPerInvoice) as ReceivedQuantity, SUM(IGRD.NetWeight) as NetWeight , count(IGRD.IGRNo) as itemCount') + ->join('t_purchaseorder_master PO', 'igr.PONO = PO.PONO') + ->join('t_supplierdetailsn sup', 'PO.SupplierID = sup.SupplierID') + ->join('t_transporter trans', 'igr.TransporterId = trans.id' , 'left') + ->join('t_igr_details IGRD', 'igr.IGRNo = IGRD.IGRNo') + ->where('igr.IGRStatus !=', MRIR_CREATED) + ->groupBy('igr.IGRNo') + ->orderBy('igr.CreatedDate', 'desc'); + $query = $builder->get(); + $result = $query->getResult(); + + $builder2 = $this->db->table('t_igr_details igr_details') + ->select('igr.*,PO.IsOpenOrder,PO.DeliveryDate,sup.SupplierName,PO.POType,trans.name as TransporterName,item.MaterialName, igr_details.QuantityAsPerInvoice as ReceivedQuantity , igr_details.NetWeight as NetWeight') + ->join('t_igr_master igr', 'igr_details.IGRNo = igr.IGRNo') + ->join('t_purchaseorder_master PO', 'igr.PONO = PO.PONO') + ->join('t_supplierdetailsn sup', 'PO.SupplierID = sup.SupplierID') + ->join('t_transporter trans', 'igr.TransporterId = trans.id' , 'left') + ->join('t_materialmaster` item', 'igr_details.MaterialCode = item.MaterialCode' , 'left') + ->where('igr.IGRStatus !=', MRIR_CREATED) + ->orderBy('igr.CreatedDate', 'desc'); + $query2 = $builder2->get(); + $result2 = $query2->getResult(); + // echo $this->db->getLastQuery()->getQuery();die; + return [$result,$result2]; + } + + function viewigr($IGRNO) { diff --git a/app/Models/Purchaseorder_model.php b/app/Models/Purchaseorder_model.php index b2d0c71e..9edea48b 100755 --- a/app/Models/Purchaseorder_model.php +++ b/app/Models/Purchaseorder_model.php @@ -2325,12 +2325,23 @@ mstr.CourierNo,pom.Status,pom.POType') //,bill.BillNo,bill.FilePath, function updatefile($bill, $Picture) { + $uploadfile; $this->db->table('t_purchaseorder_billupload') ->set('FilePath', $Picture) ->where('BillNo', $bill) ->update(); - $afftectedRows = $this->db->affectedRows(); - return $afftectedRows; + + $uploadfile['afftectedRows'] = $this->db->affectedRows(); + + if( $uploadfile['afftectedRows'] > 0){ + $uploadfile['updatedRow'] = $this->db->table('t_purchaseorder_billupload') + ->where('BillNo', $bill) + ->get() + ->getRowArray(); + + } + return $uploadfile; + } @@ -2425,11 +2436,11 @@ mstr.CourierNo,pom.Status,pom.POType') //,bill.BillNo,bill.FilePath, function insertfile($filelist) { - //print_r($myfile);die; $builder = $this->db->table('t_purchaseorder_billupload'); $builder->insert($filelist); - $myfile = $this->db->affectedRows(); - return $myfile; + $insertedID = $this->db->insertID(); + $insertedRow = $builder->where('BillNo', $insertedID)->get()->getRowArray(); + return $insertedRow; } /*------------------------------------------------------------------------------*/ diff --git a/app/Views/EditservicePurchaseorder.php b/app/Views/EditservicePurchaseorder.php index 27b751dd..f4a4900a 100755 --- a/app/Views/EditservicePurchaseorder.php +++ b/app/Views/EditservicePurchaseorder.php @@ -1096,11 +1096,11 @@ if (!empty($getlogpodtl)) {
| SNo | -Requisition No | -Item Code | +SNo | +Requisition No | +Item Code | Item Name | -Quantity | +Quantity | UOM | Rate | Basic Amount | @@ -1132,11 +1132,11 @@ if (!empty($getlogpodtl)) { ?>||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| - | ReqNo ?> | -MaterialCode ?> | ++ | ReqNo ?> | +MaterialCode ?> | MaterialName ?> | -Quantity ?> | +Quantity ?> | UOM ?> | Rate ?> | diff --git a/app/Views/POlist.php b/app/Views/POlist.php index c1bb7d8f..a3696fa1 100755 --- a/app/Views/POlist.php +++ b/app/Views/POlist.php @@ -128,7 +128,7 @@PONO# | PO Type | Supplier Name | -Total Order Value | +Total Order Value | PO Status | Delivery Option | Delivery Date | @@ -152,7 +152,7 @@ReqType ?> | SupplierName ?> | -TotalOrderValue ?> | +TotalOrderValue ?> |
User Listing+User Listing
-
|