From 6dce4d99f3fd193fe96ce11d70eb60bf4a460af0 Mon Sep 17 00:00:00 2001 From: velz2020 Date: Tue, 2 Jan 2018 13:43:52 +0530 Subject: [PATCH] QAD NEW CHANGES AND LOAN OVER DUE ISSUE RESLOVED --- application/controllers/quality.php | 3 +- application/models/quality_model.php | 28 ++- application/views/inward_report_create.php | 265 ++++++++++++++++----- application/views/loanreports.php | 40 +++- application/views/qualityreport.php | 67 +++--- application/views/viewindInwardreport.php | 63 +++-- application/views/viewindreport.php | 63 +++-- 7 files changed, 374 insertions(+), 155 deletions(-) diff --git a/application/controllers/quality.php b/application/controllers/quality.php index 6a2c8744..447a3bba 100755 --- a/application/controllers/quality.php +++ b/application/controllers/quality.php @@ -423,6 +423,7 @@ class quality extends BaseController function addNewInward_Report() { $data['records'] = $this->quality_model->getIGRNOforReport(); + $data['reports'] = $this->quality_model->getIGRNOReport(); ; $data['emplist'] = $this->quality_model->getEmplistforReport(); $this->global['pageTitle'] = 'Siddharth : Inward Inspection'; $this->loadViews("inward_report_create", $this->global,$data,NULL); @@ -457,4 +458,4 @@ class quality extends BaseController } } -?> \ No newline at end of file +?> diff --git a/application/models/quality_model.php b/application/models/quality_model.php index f776ec62..04d32530 100755 --- a/application/models/quality_model.php +++ b/application/models/quality_model.php @@ -148,6 +148,7 @@ class Quality_model extends CI_Model $this->db->where('ip_invoices.invoice_number NOT IN (SELECT invoiceid from T_Test_Report_Master)',NULL,false); $this->db->order_by('ip_invoices.invoice_number','desc'); $res = $this->db->get(); + //print_r($res->result());die(); return $res->result(); } @@ -352,7 +353,9 @@ class Quality_model extends CI_Model $sql = 'select distinct IGRNO from T_IGR_Details join T_MaterialMaster on T_IGR_Details.MaterialCode = T_MaterialMaster.MaterialCode - where T_MaterialMaster.Category like "%Raw Material%" order by IGRNO desc'; + where T_MaterialMaster.Category like "%Raw Material%"and T_IGR_Details.CreatedDate + between SUBDATE(CURRENT_DATE,1) and CURRENT_DATE + order by IGRNO desc'; $result = $this->db->query($sql); return $result->result(); } @@ -365,7 +368,7 @@ class Quality_model extends CI_Model $sql = 'select IGRItemNo from T_IGR_Details join T_MaterialMaster on T_IGR_Details.MaterialCode = T_MaterialMaster.MaterialCode - where IGRNO = ? and T_MaterialMaster.Category like "%Raw Material%"'; + where T_IGR_Details.IGRItemNo not in (select igrlineitemno from T_Test_Report_Master where igrno != "") and IGRNO = ? and T_MaterialMaster.Category like "%Raw Material%"'; $result = $this->db->query($sql,array($igrno)); return $result->result(); @@ -373,7 +376,26 @@ class Quality_model extends CI_Model } - + function getIGRNOReport() + { + $this->db->select('igrno,igrlineitemno'); + $this->db->from('T_Test_Report_Master'); + $res['generated'] = ($this->db->get()->result()); + + // $this->db->select('IGRNO,IGRItemNo'); + // $this->db->from('T_IGR_Details'); + // $this->db->where('IGRNO NOT IN (SELECT IGRNO from T_Test_Report_Master)',NULL,false); + // $this->db->or_where('IGRItemNo NOT IN (SELECT IGRItemNo from T_Test_Report_Master)',NULL,false); + $sql= 'select distinct IGRNO,IGRItemNo from T_IGR_Details join T_MaterialMaster on T_IGR_Details.MaterialCode = T_MaterialMaster.MaterialCode + where (T_IGR_Details.IGRNO not in (select igrno from T_Test_Report_Master where igrno != "") + or T_IGR_Details.IGRItemNo not in (select igrlineitemno from T_Test_Report_Master where igrno != "") ) + and T_MaterialMaster.Category like "%Raw Material%" + order by T_IGR_Details.IGRNO DESC'; + $r = $this->db->query($sql); + $res['notgenerated'] = ($r->result()); + + return $res; + } function getIGRDataforReport($igrno,$igrlineitemno) { diff --git a/application/views/inward_report_create.php b/application/views/inward_report_create.php index 16c7950b..a6c574c6 100755 --- a/application/views/inward_report_create.php +++ b/application/views/inward_report_create.php @@ -1,3 +1,5 @@ + +