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/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/Views/viewinwardgateregister.php b/app/Views/viewinwardgateregister.php index 55a5d38b..abe442a9 100755 --- a/app/Views/viewinwardgateregister.php +++ b/app/Views/viewinwardgateregister.php @@ -163,34 +163,41 @@ +
-
- - - +
+
+ + + + - - + + - - -
- + + +
+ +
+
+ +
+
- - + - - - + + + @@ -201,62 +208,115 @@ - CreatedDate); - $datewithtime = $createddate->format('d-m-Y h:i A'); $date = $createddate->format('d-m-Y'); $time = $createddate->format('h:i A'); ?> - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + - + +   + + + + +   + + + +
Create DateCreate time IGR NoPO NoPO No Supplier NameInvoice NoInvoice Date ItemInvoice NoInvoice Date Item Count Rec Qty Net Weight Vechicle No
IGRNO ?> PONO ?>SupplierName ?>DeliveryChellanOrInvoiceNo ?>DeliveryChellanDate); - echo $date->format('d-m-Y'); ?>MaterialName ?>ReceivedQuantity ?>NetWeight ?>VehicleNo ?>DriverName ?>TransporterName ?>IGRStatus == 'ST074' ? 'Draft' : 'Completed'; ?> - - - -   - FilePath)) { ?> +
IGRNO ?> PONO ?>SupplierName ?>DeliveryChellanOrInvoiceNo ?>DeliveryChellanDate); + echo $date->format('d-m-Y'); ?>itemCount ?>ReceivedQuantity ?>NetWeight ?>VehicleNo ?>DriverName ?>TransporterName ?>IGRStatus == 'ST074' ? 'Draft' : 'Completed'; ?> + + + +   + FilePath)) { ?> - file)) { ?> + file)) { ?> - + - -   - - - - -   - - -
+ + + + + + + + + + + + + + + + + + + + + + + CreatedDate); + $date = $createddate->format('d-m-Y'); + $time = $createddate->format('h:i A'); + ?> + + + + + + + + + + + + + + + + + + + +
@@ -415,6 +475,7 @@ --> +
@@ -1612,25 +1673,15 @@ } $(document).ready(function() { - $('#view_inward_gate_register').DataTable({ - dom: 'Blfrtip', // Buttons, length menu, filter, table, information, pagination - buttons: [ - 'copy', 'csv', 'excel', 'pdf', 'print' // Export buttons - ], - pageLength: 10, // Default rows per page + table = $('#view_inward_gate_register').DataTable({ + + pageLength: 10, lengthMenu: [ [10, 20, 30, 50, -1], [10, 20, 30, 50, "All"] - ], // Rows per page options - responsive: true, // Responsive table - - // Default ordering (column index 0, ascending) - // order: [ - // [0, 'desc'] - // ], - + ], + responsive: true, ordering:false, - language: { paginate: { next: '', // Next button icon @@ -1700,4 +1751,18 @@ } }); }); + + + + \ No newline at end of file