finished bugs from tracker -vadivel J

This commit is contained in:
vadivel J 2024-10-30 17:29:23 +05:30
parent a79b002b96
commit 946d4706e2
2 changed files with 34 additions and 5 deletions

View File

@ -11,6 +11,7 @@ use App\Models\FactoryVehicleDieselStockSummaryModel;
use App\Models\IncomingSilicaSandDetailsModel;
use App\Models\Inwardgateregister_model;
use App\Models\Rawmaterialdetails_model;
use App\Models\BagStockDetailsModel;
use CodeIgniter\HTTP\ResponseInterface;
use DateTime;
@ -26,6 +27,7 @@ class StockController extends BaseController
protected $incomingSilicaSandDetails_model;
protected $inwardGateRegister_model;
protected $rawmaterialdetails_model;
protected $bagStockDetails_model;
/**
* This is default constructor of the class
@ -42,6 +44,7 @@ class StockController extends BaseController
$this->rawmaterialdetails_model = new Rawmaterialdetails_model();
$this->incomingSilicaSandDetails_model = new IncomingSilicaSandDetailsModel();
$this->inwardGateRegister_model = new Inwardgateregister_model();
$this->bagStockDetails_model = new BagStockDetailsModel();
$this->session = session();
helper('form');
@ -257,12 +260,41 @@ class StockController extends BaseController
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['month']=$month;
$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(){}

View File

@ -195,12 +195,9 @@
<div class="row">
<div class="col-3">
<?php $today = date('M-Y'); ?>
<input type="text" name="month" id="month" value=""
<input type="text" name="month" id="month" value="<?php echo "$month" ?>"
class="form-control mt-2" data-provide="datepicker"
data-date-format="M-yyyy" data-date-min-view-mode="1">
</div>
<div class="form-group col-md-2">
<button type="submit" class="btn btn-success"> Change Month </button>