diff --git a/app/Controllers/Supplier.php b/app/Controllers/Supplier.php index 2aacb665..2d0773d8 100755 --- a/app/Controllers/Supplier.php +++ b/app/Controllers/Supplier.php @@ -291,15 +291,8 @@ class Supplier extends BaseController if($PAN){ $supplier['PAN'] = $PAN;} if($GSTNo){ $supplier['GSTNO'] = $GSTNo;} - if ($file2 && $file2->isValid() && !$file2->hasMoved()) { - if(!is_dir($path)) { mkdir($path, 0777, true); } - $GST_DOC = $file2->getName(); - $file2->move($path,$GST_DOC); - $supplier['Cert_GST'] = $GST_DOC; - } - else{ - $supplier['Cert_GST'] = $this->request->getPost('hidden_Cert_GST') ? $this->request->getPost('hidden_Cert_GST') : NULL; - } + +/********************** File Insertion - MSME **************************/ if ($file1 && $file1->isValid() && !$file1->hasMoved()) { if(!is_dir($path)) { mkdir($path, 0777, true); } @@ -311,6 +304,18 @@ class Supplier extends BaseController $supplier['Cert_MSME'] = $this->request->getPost('hidden_Cert_MSME') ? $this->request->getPost('hidden_Cert_MSME') : NULL; } +/********************** GST *******************************************/ + if ($file2 && $file2->isValid() && !$file2->hasMoved()) { + if(!is_dir($path)) { mkdir($path, 0777, true); } + $GST_DOC = $file2->getName(); + $file2->move($path,$GST_DOC); + $supplier['Cert_GST'] = $GST_DOC; + } + else{ + $supplier['Cert_GST'] = $this->request->getPost('hidden_Cert_GST') ? $this->request->getPost('hidden_Cert_GST') : NULL; + } + +/********************** BANK *******************************************/ if ($file3 && $file3->isValid() && !$file3->hasMoved()) { if(!is_dir($path)) { mkdir($path, 0777, true); } $BANK_DOC = $file3->getName(); @@ -321,6 +326,7 @@ class Supplier extends BaseController $supplier['Cert_BANK'] = $this->request->getPost('hidden_Cert_BANK') ? $this->request->getPost('hidden_Cert_BANK') : NULL; } +/********************** PAN *******************************************/ if ($file4 && $file4->isValid() && !$file4->hasMoved()) { if(!is_dir($path)) { mkdir($path, 0777, true); } $PAN_DOC = $file4->getName(); @@ -331,6 +337,8 @@ class Supplier extends BaseController $supplier['Cert_PAN'] = $this->request->getPost('hidden_Cert_PAN') ? $this->request->getPost('hidden_Cert_PAN') : NULL; } +/********************** End Of File Insertion *************************/ + $result = $this->supplier_model->UpdateSupplier($supplier, $SupplierID); if ($result == True) { diff --git a/app/Models/Dashboard_model.php b/app/Models/Dashboard_model.php index 29187ef6..1cb1ff32 100755 --- a/app/Models/Dashboard_model.php +++ b/app/Models/Dashboard_model.php @@ -3285,7 +3285,7 @@ function daybeforetotal($yesterday){ SUM(CASE WHEN date = '$startDate' THEN opening ELSE 0 END) + SUM(receipt) as total, SUM(used) as used, SUM(CASE WHEN date = '$startDate' THEN opening ELSE 0 END) + SUM(receipt) - SUM(used) as closing - FROM t_resinStockDetails tbg + FROM t_resinstockdetails tbg INNER JOIN t_materialmaster tmm ON tmm.MaterialCode = tbg.materialCode INNER JOIN t_igr_details tigrd ON tigrd.MaterialCode = tbg.materialCode AND Date(tigrd.CreatedDate) >= '$startDate' AND Date(tigrd.CreatedDate) <= '$endDate' INNER JOIN t_igr_master tigrm ON tigrd.IGRNO = tigrm.IGRNO diff --git a/app/Models/Ipinvoice_model.php b/app/Models/Ipinvoice_model.php index 5780ed04..ad97f19a 100755 --- a/app/Models/Ipinvoice_model.php +++ b/app/Models/Ipinvoice_model.php @@ -645,7 +645,7 @@ class Ipinvoice_model extends Model /************************************************************* Resin ****************************************************************/ case "resin": - $builder = $this->db->table('t_resinStockDetails trd') + $builder = $this->db->table('t_resinstockdetails trd') ->select('trd.balanceStock, tmm.MaterialName ,tmm.MaterialCode ,tmm.UOM') ->join('t_materialmaster tmm', 'tmm.MaterialCode = trd.materialCode') ->where('trd.date', $lastDateOfCurrentMonth) @@ -679,7 +679,7 @@ class Ipinvoice_model extends Model default: - $builder = $this->db->table('t_resinStockDetails trd') + $builder = $this->db->table('t_resinstockdetails trd') ->select('trd.balanceStock, tmm.MaterialName ,tmm.MaterialCode , tmm.UOM') ->join('t_materialmaster tmm', 'tmm.MaterialCode = trd.materialCode') ->where('trd.date', $lastDateOfCurrentMonth) diff --git a/app/Models/ResinStockModel.php b/app/Models/ResinStockModel.php index 22b6efca..b0868e5d 100644 --- a/app/Models/ResinStockModel.php +++ b/app/Models/ResinStockModel.php @@ -6,7 +6,7 @@ use CodeIgniter\Model; class ResinStockModel extends Model { - protected $table = 't_resinStockDetails'; + protected $table = 't_resinstockdetails'; protected $primaryKey = 'id'; protected $useAutoIncrement = true; protected $returnType = 'array'; diff --git a/app/Models/Supplier_model.php b/app/Models/Supplier_model.php index 69613bb2..9e4aea87 100755 --- a/app/Models/Supplier_model.php +++ b/app/Models/Supplier_model.php @@ -209,7 +209,7 @@ class Supplier_model extends Model $builder = $builder->select('SupplierID, SupplierName, Address, IsActive'); if(!empty($supp_id)){ - $builder = $builder->where('SupplierID !=' , $supp_id); + $builder = $builder->where('SupplierID <>' , $supp_id); } $builder = $builder->where('REPLACE(SupplierName, " ", "") ',$supp_name);