Merge branch 'new_theme' of bitbucket.org:venbainformationtechnology/ria into new_theme

This commit is contained in:
Smart 2024-10-04 11:50:33 +05:30
commit 58e9818cfc
8 changed files with 119 additions and 21 deletions

View File

@ -72,7 +72,7 @@ class FactoryMachineController extends BaseController
$data['masterData'] = $this->factoryMachineMaster_model->where('id', $id)->where('is_active', 1)->first(); $data['masterData'] = $this->factoryMachineMaster_model->where('id', $id)->where('is_active', 1)->first();
//here we are using create Factory Machine Master Detail view for //here we are using same view - create Factory Machine Master Detail for
// updating Factory Machine Master Detail // updating Factory Machine Master Detail
return $this->loadViews("factoryMachineMasterDetailsCreate", $this->global, $data, NULL); return $this->loadViews("factoryMachineMasterDetailsCreate", $this->global, $data, NULL);

View File

@ -8,6 +8,8 @@ use CodeIgniter\Validation\Exceptions\ValidationException;
use App\Models\Rawmaterialdetails_model; use App\Models\Rawmaterialdetails_model;
use App\Models\MaterialCategoriesModel;
use PhpOffice\PhpSpreadsheet\Spreadsheet; use PhpOffice\PhpSpreadsheet\Spreadsheet;
use PhpOffice\PhpSpreadsheet\Writer\Xlsx; use PhpOffice\PhpSpreadsheet\Writer\Xlsx;
@ -26,6 +28,7 @@ use PhpOffice\PhpSpreadsheet\Style\Alignment;
class Rawmaterialdetails extends BaseController class Rawmaterialdetails extends BaseController
{ {
protected $rawmaterialdetails_model; protected $rawmaterialdetails_model;
protected $materialCategories_model;
protected $session; protected $session;
/** /**
@ -34,7 +37,8 @@ class Rawmaterialdetails extends BaseController
public function __construct() public function __construct()
{ {
parent::__construct(); parent::__construct();
$this->rawmaterialdetails_model = new Rawmaterialdetails_model();; $this->rawmaterialdetails_model = new Rawmaterialdetails_model();
$this->materialCategories_model = new MaterialCategoriesModel();
$this->session = session(); $this->session = session();
helper('form'); //$this->load->library('form_validation'); helper('form'); //$this->load->library('form_validation');
// $this->load->library('pagination'); // $this->load->library('pagination');
@ -90,6 +94,7 @@ class Rawmaterialdetails extends BaseController
$this->rawmaterialdetails_model = new rawmaterialdetails_model();; $this->rawmaterialdetails_model = new rawmaterialdetails_model();;
$data['material'] = $this->rawmaterialdetails_model->getmaterialType(); $data['material'] = $this->rawmaterialdetails_model->getmaterialType();
$data['materialcategory'] = $this->rawmaterialdetails_model->getmaterialCategory(); $data['materialcategory'] = $this->rawmaterialdetails_model->getmaterialCategory();
$data['materialCategoryList']= $this->materialCategories_model->where('is_active',1)->findAll();
$data['UOM'] = $this->rawmaterialdetails_model->getUOM(); $data['UOM'] = $this->rawmaterialdetails_model->getUOM();
$data['assetcode'] = $this->rawmaterialdetails_model->getAssetcode(); $data['assetcode'] = $this->rawmaterialdetails_model->getAssetcode();
$data['costcentercode'] = $this->rawmaterialdetails_model->getcostcentercode(); $data['costcentercode'] = $this->rawmaterialdetails_model->getcostcentercode();
@ -241,6 +246,7 @@ class Rawmaterialdetails extends BaseController
$data['currentstock'] = $this->rawmaterialdetails_model->getMaterialstock($RawMaterialID, $currentdate); $data['currentstock'] = $this->rawmaterialdetails_model->getMaterialstock($RawMaterialID, $currentdate);
$data['materialType'] = $this->rawmaterialdetails_model->getmaterialType($MaterialType); $data['materialType'] = $this->rawmaterialdetails_model->getmaterialType($MaterialType);
$data['materialCategory'] = $this->rawmaterialdetails_model->getmaterialCategory($MaterialCategory); $data['materialCategory'] = $this->rawmaterialdetails_model->getmaterialCategory($MaterialCategory);
$data['materialCategoryList']= $this->materialCategories_model->where('is_active',1)->findAll();
$data['UOMList'] = $this->rawmaterialdetails_model->getUOM($UOM); $data['UOMList'] = $this->rawmaterialdetails_model->getUOM($UOM);
$data['costcentercode'] = $this->rawmaterialdetails_model->getCostCenterCode(); $data['costcentercode'] = $this->rawmaterialdetails_model->getCostCenterCode();
$data['cfUOM'] = $this->rawmaterialdetails_model->getConversionfactorUOM(); $data['cfUOM'] = $this->rawmaterialdetails_model->getConversionfactorUOM();

View File

@ -0,0 +1,62 @@
<?php
namespace App\Models;
use CodeIgniter\Model;
class MaterialCategoriesModel extends Model
{
protected $table = 't_materialCategories';
protected $primaryKey = 'id';
protected $useAutoIncrement = true;
protected $returnType = 'array';
protected $useSoftDeletes = false;
protected $protectFields = true;
protected $allowedFields = ['category_name', 'is_active'];
protected bool $allowEmptyInserts = false;
protected bool $updateOnlyChanged = true;
protected array $casts = [];
protected array $castHandlers = [];
// Dates
protected $useTimestamps = true;
protected $dateFormat = 'datetime';
protected $createdField = 'created_at';
protected $updatedField = 'updated_at';
protected $deletedField = 'deleted_at';
// Validation
protected $validationRules = [
'category_name' => 'required|max_length[255]',
];
protected $validationMessages = [
'category_name' => [
'required' => 'The category name is required.',
'max_length' => 'The category name cannot exceed 255 characters.'
],
];
protected $skipValidation = false;
protected $cleanValidationRules = true;
// Callbacks
protected $allowCallbacks = true;
protected $beforeInsert = [];
protected $afterInsert = [];
protected $beforeUpdate = [];
protected $afterUpdate = [];
protected $beforeFind = [];
protected $afterFind = [];
protected $beforeDelete = [];
protected $afterDelete = [];
//all methods starts from here
}

View File

@ -69,6 +69,8 @@ class Rawmaterialdetails_model extends Model
return $query->getResult(); return $query->getResult();
} }
//This function used to get the conversionfactor using configdetails table //This function used to get the conversionfactor using configdetails table
function getConversionfactorUOM($ConversionFactorUOM = '') function getConversionfactorUOM($ConversionFactorUOM = '')
{ {
@ -116,8 +118,6 @@ class Rawmaterialdetails_model extends Model
*/ */
function getMaterialDetails($MaterialCode) function getMaterialDetails($MaterialCode)
{ {
$sql = " SELECT * FROM t_materialmaster WHERE MaterialCode ='$MaterialCode'"; $sql = " SELECT * FROM t_materialmaster WHERE MaterialCode ='$MaterialCode'";
$query = $this->db->query($sql); $query = $this->db->query($sql);
return $query->getResult(); return $query->getResult();

View File

@ -66,10 +66,23 @@
?> ?>
</select> </select>
</div> </div>
<div class="col-md-3">
<label class="col-form-label" for="MaterialCaterogy">Material Caterogy<span class="badge">*</span></label> <div class=" col-md-3">
<input type="text" class="form-control required " required id="MatCate" name="MatCate" maxlength="255"> <label class="col-form-label" for="MatCate">Material Caterogy<span class="badge">*</span></label>
<select class="form-control select2" required id="MatCate" name="MatCate">
<option value="" required>Select Material Caterogy </option>
<?php
if (!empty($materialCategoryList)) {
foreach ($materialCategoryList as $record) {
?>
<option value="<?php echo $record['category_name']?>"><?php echo $record['category_name']?></option>
<?php
}
}
?>
</select>
</div> </div>
<div class="col-md-3"> <div class="col-md-3">
<label class="col-form-label" for="UnitofMeasurement">Unit of Measurement<span class="badge">*</span></label> <label class="col-form-label" for="UnitofMeasurement">Unit of Measurement<span class="badge">*</span></label>
<select class="form-control required select2" id="UOM" name="UOM"> <select class="form-control required select2" id="UOM" name="UOM">
@ -178,22 +191,23 @@
//var tempARRAY = []; //var tempARRAY = [];
$(document).ready(function() { $(document).ready(function() {
$("#MaterialType").select2(); $("#MaterialType").select2();
$('#MatCate').select2();
// $("#MaterialCategory").select2(); // $("#MaterialCategory").select2();
$("#UOM").select2(); $("#UOM").select2();
$('#MatCate').autocomplete({ // $('#MatCate').autocomplete({
onSearchStart: function(query) { // onSearchStart: function(query) {
//alert(query); // //alert(query);
$('#MatCate').autocomplete("option", "minLength", 0); // $('#MatCate').autocomplete("option", "minLength", 0);
}, // },
serviceUrl: "<?php echo base_url(); ?>rawmaterialdetailsautocomplete", // serviceUrl: "<?php echo base_url(); ?>rawmaterialdetailsautocomplete",
onSelect: function(suggestion) { // onSelect: function(suggestion) {
var data = suggestion.ConfigValue; // var data = suggestion.ConfigValue;
} // }
}); // });
}); });

View File

@ -159,13 +159,28 @@ if ($total <= $reorder) {
</select> </select>
</div> </div>
</div> </div>
<div class="col-md-3"> <div class="col-md-3">
<div class="form-group"> <div class="form-group">
<label for="MaterialCategory">Material Category <span class="text-danger">*</span></label> <label for="MaterialCategory">Material Category <span class="text-danger">*</span></label>
<input type="text" class="form-control" id="MaterialCategory" name="MaterialCategory" value="<?php echo $MaterialCategory; ?>" maxlength="255" required> <select class="form-control select2" id="MaterialCategory" name="MaterialCategory" required>
<?php
if (!empty($materialCategoryList)) {
foreach ($materialCategoryList as $record) {
?>
<option value="<?= $record['category_name'] ?>" <?php if ($record['category_name'] === $MaterialCategory) echo "selected"; ?>>
<?php echo $record['category_name'] ?>
</option>
<?php
}
}
?>
</select>
</div> </div>
</div> </div>
</div> </div>
<div class="form-row mb-3"> <div class="form-row mb-3">
<div class="col-md-3"> <div class="col-md-3">
<div class="form-group"> <div class="form-group">
@ -286,6 +301,7 @@ if ($total <= $reorder) {
$("#UOM").select2(); $("#UOM").select2();
$("#MaterialType").select2(); $("#MaterialType").select2();
$("#MaterialCategory").select2();
/** ---- auto search code -------- */ /** ---- auto search code -------- */
$('#MaterialCategory').autocomplete({ $('#MaterialCategory').autocomplete({

View File

@ -127,11 +127,11 @@
<td align="center"> <td align="center">
<a data-toggle="tooltip" <a data-toggle="tooltip"
href="<?php echo base_url(); ?>loadView_updateFactoryMachineMasterDetail?id=<?php echo $record['id'] ?>" href="<?php echo base_url(); ?>loadView_updateFactoryMachineMasterDetail?id=<?php echo $record['id'] ?>"
target="new"><i class="fa fa-pencil-alt" data-toggle="tooltip" ><i class="fa fa-pencil-alt" data-toggle="tooltip"
title="- Click here to Edit "></i> title="- Click here to Edit "></i>
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
</a> </a>
</td> </td>
</tr> </tr>
<?php <?php
} }

View File

@ -88,7 +88,7 @@ $energyType=$masterData['energy_type']??'';
<button type="submit" class="btn btn-success">Submit</button> <button type="submit" class="btn btn-success">Submit</button>
&nbsp; &nbsp;
<button type="button" class="btn btn-danger "> <button type="button" class="btn btn-danger" onclick="window.history.back();">
Cancel</button> Cancel</button>
</div> </div>