finished bugs from tracker -vadivel J
This commit is contained in:
parent
a79b002b96
commit
946d4706e2
@ -11,6 +11,7 @@ use App\Models\FactoryVehicleDieselStockSummaryModel;
|
|||||||
use App\Models\IncomingSilicaSandDetailsModel;
|
use App\Models\IncomingSilicaSandDetailsModel;
|
||||||
use App\Models\Inwardgateregister_model;
|
use App\Models\Inwardgateregister_model;
|
||||||
use App\Models\Rawmaterialdetails_model;
|
use App\Models\Rawmaterialdetails_model;
|
||||||
|
use App\Models\BagStockDetailsModel;
|
||||||
use CodeIgniter\HTTP\ResponseInterface;
|
use CodeIgniter\HTTP\ResponseInterface;
|
||||||
use DateTime;
|
use DateTime;
|
||||||
|
|
||||||
@ -26,6 +27,7 @@ class StockController extends BaseController
|
|||||||
protected $incomingSilicaSandDetails_model;
|
protected $incomingSilicaSandDetails_model;
|
||||||
protected $inwardGateRegister_model;
|
protected $inwardGateRegister_model;
|
||||||
protected $rawmaterialdetails_model;
|
protected $rawmaterialdetails_model;
|
||||||
|
protected $bagStockDetails_model;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This is default constructor of the class
|
* This is default constructor of the class
|
||||||
@ -42,6 +44,7 @@ class StockController extends BaseController
|
|||||||
$this->rawmaterialdetails_model = new Rawmaterialdetails_model();
|
$this->rawmaterialdetails_model = new Rawmaterialdetails_model();
|
||||||
$this->incomingSilicaSandDetails_model = new IncomingSilicaSandDetailsModel();
|
$this->incomingSilicaSandDetails_model = new IncomingSilicaSandDetailsModel();
|
||||||
$this->inwardGateRegister_model = new Inwardgateregister_model();
|
$this->inwardGateRegister_model = new Inwardgateregister_model();
|
||||||
|
$this->bagStockDetails_model = new BagStockDetailsModel();
|
||||||
|
|
||||||
$this->session = session();
|
$this->session = session();
|
||||||
helper('form');
|
helper('form');
|
||||||
@ -257,12 +260,41 @@ class StockController extends BaseController
|
|||||||
|
|
||||||
public function loadView_bagStockDetails(){
|
public function loadView_bagStockDetails(){
|
||||||
|
|
||||||
|
if ($this->request->getMethod() === 'POST'){
|
||||||
|
$month = $this->request->getPost('month');
|
||||||
|
|
||||||
|
$date = DateTime::createFromFormat('M-Y', $month);
|
||||||
|
|
||||||
|
$formattedDate = $date->format('Y-m');
|
||||||
|
|
||||||
|
$month=$formattedDate;
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
$month = date('Y-m');
|
||||||
|
}
|
||||||
|
|
||||||
$data=[];
|
$data=[];
|
||||||
|
|
||||||
|
$data['month']=$month;
|
||||||
|
|
||||||
$this->global['pageTitle']='Bag Stock Details';
|
$this->global['pageTitle']='Bag Stock Details';
|
||||||
|
|
||||||
return $this->loadViews("bagStockDetails", $this->global, $data, NULL);
|
$startDate = "$month-01";
|
||||||
|
$endDate = date("Y-m-t", strtotime($startDate));
|
||||||
|
$data['bagStockDetails'] = $this->bagStockDetails_model
|
||||||
|
->where('date >=', $startDate)
|
||||||
|
->where('date <=', $endDate)
|
||||||
|
->groupBy(['materialCode','date'])
|
||||||
|
->orderBy('date','desc')
|
||||||
|
->findAll();
|
||||||
|
|
||||||
|
$date = DateTime::createFromFormat('Y-m', $month);
|
||||||
|
|
||||||
|
$formattedDate = $date->format('M-Y');
|
||||||
|
|
||||||
|
$data['month']=$formattedDate;
|
||||||
|
|
||||||
|
return $this->loadViews("bagStockDetails", $this->global, $data, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function updateBagStockDetails(){}
|
public function updateBagStockDetails(){}
|
||||||
|
|||||||
@ -195,12 +195,9 @@
|
|||||||
<div class="row">
|
<div class="row">
|
||||||
|
|
||||||
<div class="col-3">
|
<div class="col-3">
|
||||||
<?php $today = date('M-Y'); ?>
|
<input type="text" name="month" id="month" value="<?php echo "$month" ?>"
|
||||||
|
|
||||||
<input type="text" name="month" id="month" value=""
|
|
||||||
class="form-control mt-2" data-provide="datepicker"
|
class="form-control mt-2" data-provide="datepicker"
|
||||||
data-date-format="M-yyyy" data-date-min-view-mode="1">
|
data-date-format="M-yyyy" data-date-min-view-mode="1">
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group col-md-2">
|
<div class="form-group col-md-2">
|
||||||
<button type="submit" class="btn btn-success"> Change Month </button>
|
<button type="submit" class="btn btn-success"> Change Month </button>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user