Merge branch 'new_theme' of bitbucket.org:venbainformationtechnology/ria into new_theme
This commit is contained in:
commit
5804d9378f
@ -427,7 +427,7 @@ $routes->post('updateCoatingMachineDetails','StockController::updateCoatingMachi
|
||||
$routes->get('deleteCoatingMachineDetails' , 'StockController::deleteCoatingMachineDetails');
|
||||
|
||||
|
||||
|
||||
//drier machine details
|
||||
$routes->match(['GET', 'POST', 'PUT', 'DELETE'],'drierMachineDetails', 'StockController::drierMachineDetails');
|
||||
$routes->match(['GET', 'POST', 'PUT', 'DELETE'],'addOrEditdrierMachineDetails', 'StockController::addOrEditdrierMachineDetails');
|
||||
|
||||
@ -435,8 +435,11 @@ $routes->match(['GET', 'POST', 'PUT', 'DELETE'],'factoryVehicleDieselDetails', '
|
||||
$routes->match(['GET', 'POST', 'PUT', 'DELETE'],'addOrEditfactoryVehicleDieselDetails', 'StockController::addOrEditfactoryVehicleDieselDetails');
|
||||
|
||||
|
||||
//incomingSilicaSandDetaails
|
||||
//incoming Silica Sand Detaails
|
||||
$routes->match(['GET','POST'],'incomingSilicaSandDetails', 'StockController::loadView_incomingSilicaSandDetails');
|
||||
$routes->post('updateIncomingSilicaSandDetails', 'StockController::updateIncomingSilicaSandDetails');
|
||||
$routes->get('deleteIncomingSilicaSandDetails', 'StockController::deleteIncomingSilicaSandDetails');
|
||||
|
||||
|
||||
//Bag stock details
|
||||
$routes->match(['GET','POST'],'bagStockDetails', 'StockController::loadView_bagStockDetails');
|
||||
$routes->post('updateBagStockDetails', 'StockController::updateBagStockDetails');
|
||||
@ -53,6 +53,8 @@ class StockController extends BaseController
|
||||
//
|
||||
}
|
||||
|
||||
//Coating Machine Details starts
|
||||
|
||||
public function loadView_coatingMachineDetails(){
|
||||
|
||||
if ($this->request->getMethod() === 'POST'){
|
||||
@ -140,11 +142,23 @@ class StockController extends BaseController
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//incoming Silica Sand Details starts
|
||||
|
||||
public function loadView_incomingSilicaSandDetails(){
|
||||
|
||||
$month='2024-09';
|
||||
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['month']=$month;
|
||||
|
||||
$this->global['pageTitle']='Incoming Silica Sand Details';
|
||||
@ -152,24 +166,99 @@ class StockController extends BaseController
|
||||
$materialCodes = $this->rawmaterialdetails_model->getAllSilicaRawMaterialCode();
|
||||
|
||||
if (!empty($materialCodes)) {
|
||||
$data['igrDetails'] = $this->inwardGateRegister_model->findIgrForSilicaSand($materialCodes,$month);
|
||||
$data['igrDetails'] = $this->inwardGateRegister_model->findIgrDetailsForIncomingSilicaSand($materialCodes,$month);
|
||||
|
||||
} else {
|
||||
$data['igrDetails'] = [];
|
||||
}
|
||||
|
||||
$date = DateTime::createFromFormat('Y-m', $month);
|
||||
|
||||
$formattedDate = $date->format('M-Y');
|
||||
|
||||
$data['month']=$formattedDate;
|
||||
|
||||
return $this->loadViews("incomingSilicaSandDetails", $this->global, $data, NULL);
|
||||
|
||||
}
|
||||
|
||||
public function updateIncomingSilicaSandDetails(){
|
||||
|
||||
}
|
||||
$postData = $this->request->getPost();
|
||||
|
||||
public function deleteIncomingSilicaSandDetails(){
|
||||
$incomingSilicaSandDetailsData = json_decode($postData['incomingSilicaSandDetailsData'], true);
|
||||
|
||||
|
||||
foreach($incomingSilicaSandDetailsData as $data){
|
||||
|
||||
$IGRNO=$data['IGR No'];
|
||||
$materialCode=$data['MaterialCode'];
|
||||
|
||||
|
||||
$dbData=[
|
||||
'igrNo_fk'=>$data['IGR No'],
|
||||
'materialCode'=>$data['MaterialCode'],
|
||||
'grade'=>$data['Grade'],
|
||||
'gradeCondition'=>$data['Grade Condition'],
|
||||
'_10'=>$data['___10___'],
|
||||
'_20'=>$data['___20___'],
|
||||
'_30'=>$data['___30___'],
|
||||
'_40'=>$data['___40___'],
|
||||
'_50'=>$data['___50___'],
|
||||
'_70'=>$data['___70___'],
|
||||
'_100'=>$data['___100___'],
|
||||
'_140'=>$data['___140___'],
|
||||
'_200'=>$data['___200___'],
|
||||
'_300'=>$data['___300___'],
|
||||
'pan'=>$data['PAN'],
|
||||
'total'=>$data['Total'],
|
||||
'afsSpec'=>$data['AFS Spec'],
|
||||
'afsActual'=>$data['AFS Actual'],
|
||||
'plus20loss'=>$data['Plus 20 loss%'],
|
||||
'plus30Loss'=>$data['Plus 30 Loss %'],
|
||||
'moistureSpec'=>$data['Moisture % Spec'],
|
||||
'moistureActual'=>$data['Moisture Actual'],
|
||||
'moistureLoss'=>$data['Moisture Loss'],
|
||||
'moistureLossQty'=>$data['Moisture loss Qty'],
|
||||
'sieveLossQty'=>$data['Sieve Loss Qty'],
|
||||
'salableQty'=>$data['Salable Qty'],
|
||||
'remark'=>$data['Remark']
|
||||
|
||||
|
||||
];
|
||||
|
||||
$resultExists=$this->incomingSilicaSandDetails_model
|
||||
->where('igrNo_fk',$IGRNO)
|
||||
->where('materialCode',$materialCode)
|
||||
->first();
|
||||
|
||||
|
||||
|
||||
if(!empty($resultExists)){
|
||||
|
||||
$updated = $this->incomingSilicaSandDetails_model
|
||||
->where('igrNo_fk', $IGRNO)
|
||||
->where('materialCode', $materialCode)
|
||||
->set($dbData)
|
||||
->update();
|
||||
|
||||
}else{
|
||||
$inserted = $this->incomingSilicaSandDetails_model->insert($dbData);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
echo "Data Saved Successfully";
|
||||
|
||||
}
|
||||
|
||||
// Bag Stock details starts
|
||||
|
||||
public function loadView_bagStockDetails(){}
|
||||
|
||||
public function updateBagStockDetails(){}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
46
app/Models/BagStockDetailsModel.php
Normal file
46
app/Models/BagStockDetailsModel.php
Normal file
@ -0,0 +1,46 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use CodeIgniter\Model;
|
||||
|
||||
class BagStockDetailsModel extends Model
|
||||
{
|
||||
protected $table = 't_bagStockDetails';
|
||||
protected $primaryKey = 'id';
|
||||
protected $useAutoIncrement = true;
|
||||
protected $returnType = 'array';
|
||||
protected $useSoftDeletes = false;
|
||||
protected $protectFields = true;
|
||||
protected $allowedFields = [];
|
||||
|
||||
protected bool $allowEmptyInserts = false;
|
||||
protected bool $updateOnlyChanged = true;
|
||||
|
||||
protected array $casts = [];
|
||||
protected array $castHandlers = [];
|
||||
|
||||
// Dates
|
||||
protected $useTimestamps = false;
|
||||
protected $dateFormat = 'datetime';
|
||||
protected $createdField = 'created_at';
|
||||
protected $updatedField = 'updated_at';
|
||||
protected $deletedField = 'deleted_at';
|
||||
|
||||
// Validation
|
||||
protected $validationRules = [];
|
||||
protected $validationMessages = [];
|
||||
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 = [];
|
||||
}
|
||||
@ -12,7 +12,7 @@ class IncomingSilicaSandDetailsModel extends Model
|
||||
protected $returnType = 'array';
|
||||
protected $useSoftDeletes = false;
|
||||
protected $protectFields = true;
|
||||
protected $allowedFields = ['igrNo_fk','grade','gradeCondition',
|
||||
protected $allowedFields = ['igrNo_fk','materialCode','grade','gradeCondition',
|
||||
'_10' ,'_20','_30','_40','_50','_70','_100', '_140','_200','_300',
|
||||
'pan' , 'total' , 'afsSpec' ,'afsActual','plus20Loss','plus30Loss','moistureSpec','moistureActual',
|
||||
'moistureLoss', 'moistureLossQty','sieveLossQty','salableQty', 'remark',
|
||||
|
||||
@ -1031,7 +1031,7 @@ class Inwardgateregister_model extends Model
|
||||
return $result;
|
||||
}
|
||||
|
||||
public function findIgrForSilicaSand($materialCodes, $month)
|
||||
public function findIgrDetailsForIncomingSilicaSand($materialCodes, $month)
|
||||
{
|
||||
$builder = $this->db->table('t_igr_details')
|
||||
->select(
|
||||
@ -1043,7 +1043,7 @@ class Inwardgateregister_model extends Model
|
||||
igrMast.MaterialRcvdDate as materialRecievedDate,
|
||||
igrMast.VehicleNo,
|
||||
supplierDetails.SupplierName,
|
||||
SUM(t_igr_details.QuantityAsPerInvoice) as Qty,
|
||||
t_igr_details.QuantityAsPerInvoice as Qty,
|
||||
issd.* ')
|
||||
->whereIn('t_igr_details.MaterialCode', $materialCodes)
|
||||
->like('t_igr_details.CreatedDate', $month, 'after')
|
||||
|
||||
@ -161,17 +161,17 @@
|
||||
<td align="center">
|
||||
<a data-toggle="tooltip" class="edit-btn"
|
||||
data-target="editCoatingMachineDetailModal" data-toggle="modal"
|
||||
style="cursor:pointer">
|
||||
<i class="fa fa-pencil-alt" data-toggle="tooltip"
|
||||
style="cursor:pointer ;">
|
||||
<i class="fa fa-pencil-alt"
|
||||
title="Click here to Edit "></i>
|
||||
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
<a data-toggle="tooltip" onclick="confirmDelete(event)"
|
||||
<a data-toggle="tooltip" onclick="confirmDelete(event)" style="cursor:pointer ;"
|
||||
href="<?php echo base_url(); ?>deleteCoatingMachineDetails?id=<?php echo $record['id'] ?>">
|
||||
<i class="fa fa-trash" data-toggle="tooltip"
|
||||
<i class="fa fa-trash"
|
||||
title="Click here to Delete "></i>
|
||||
|
||||
</a>
|
||||
|
||||
0
app/Views/bagStockDetails.php
Normal file
0
app/Views/bagStockDetails.php
Normal file
@ -743,15 +743,16 @@
|
||||
|
||||
<div class="dropdown-menu" aria-labelledby="topnav-master">
|
||||
<!-- <a href="<?php echo base_url(); ?>supplierlisting" class="dropdown-item">Supplier Details</a> -->
|
||||
<a href="<?php echo base_url(); ?>transporterListing" class="dropdown-item">Transporter Details</a>
|
||||
<a href="<?php echo base_url(); ?>costListing" class="dropdown-item">Cost Details</a>
|
||||
<a href="<?php echo base_url(); ?>assetListing" class="dropdown-item">Asset Details</a>
|
||||
<a href="<?php echo base_url(); ?>companyview" class="dropdown-item">Business Settings</a>
|
||||
<a href="<?php echo base_url(); ?>configlisting" class="dropdown-item">Config Details</a>
|
||||
<a href="<?php echo base_url(); ?>departmentListing" class="dropdown-item">Department Details</a>
|
||||
|
||||
<a href="<?php echo base_url(); ?>transporterListing" class="dropdown-item"><i class="ri-file-settings-line align-middle mr-1"></i>Transporter Details</a>
|
||||
<a href="<?php echo base_url(); ?>costListing" class="dropdown-item"><i class="ri-file-settings-line align-middle mr-1"></i>Cost Details</a>
|
||||
<a href="<?php echo base_url(); ?>assetListing" class="dropdown-item"><i class="ri-file-settings-line align-middle mr-1"></i>Asset Details</a>
|
||||
<a href="<?php echo base_url(); ?>companyview" class="dropdown-item"><i class="ri-file-settings-line align-middle mr-1"></i>Business Settings</a>
|
||||
<a href="<?php echo base_url(); ?>configlisting" class="dropdown-item"><i class="ri-file-settings-line align-middle mr-1"></i>Config Details</a>
|
||||
<a href="<?php echo base_url(); ?>departmentListing" class="dropdown-item"><i class="ri-file-settings-line align-middle mr-1"></i>Department Details</a>
|
||||
<!-- <a href="<?php echo base_url(); ?>rawmaterialListing" class="dropdown-item">Material Details</a> -->
|
||||
<a href="<?php echo base_url(); ?>userListing" class="dropdown-item">Users</a>
|
||||
<a href="<?php echo base_url(); ?>readFactoryMachineMasterDetails" class="dropdown-item">Factory Machines Details</a>
|
||||
<a href="<?php echo base_url(); ?>userListing" class="dropdown-item"><i class="ri-file-settings-line align-middle mr-1"></i>Users</a>
|
||||
<a href="<?php echo base_url(); ?>readFactoryMachineMasterDetails" class="dropdown-item"><i class="ri-file-settings-line align-middle mr-1"></i>Factory Machines Details</a>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
@ -764,11 +765,13 @@
|
||||
<div class="dropdown-menu" aria-labelledby="topnav-stock">
|
||||
|
||||
<div class="">
|
||||
<a href="<?php echo base_url(); ?>drierMachineDetails" class="dropdown-item"><i class="ri-file-list-3-line align-middle mr-1"></i>10 TON Drier Details</a>
|
||||
<a href="<?php echo base_url(); ?>drierMachineDetails" class="dropdown-item"><i class="ri-file-info-line align-middle mr-1"></i>10 TON Drier Details</a>
|
||||
|
||||
<a href="<?php echo base_url(); ?>coatingMachineDetails" class="dropdown-item"><i class="ri-file-list-3-line align-middle mr-1"></i>Coating Machine Details</a>
|
||||
<a href="<?php echo base_url(); ?>coatingMachineDetails" class="dropdown-item"><i class="ri-file-info-line align-middle mr-1"></i>Coating Machine Details</a>
|
||||
|
||||
<a href="<?php echo base_url(); ?>incomingSilicaSandDetails" class="dropdown-item"><i class="ri-file-info-line align-middle mr-1"></i>incoming silica sand Details</a>
|
||||
|
||||
<a href="<?php echo base_url(); ?>incomingSilicaSandDetails" class="dropdown-item"><i class="ri-file-info-line align-middle mr-1"></i>Bag Stock Details</a>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
@ -197,11 +197,12 @@
|
||||
|
||||
<div class="col-3">
|
||||
<?php $today = date('M-Y'); ?>
|
||||
<input type="text" name="month" id="month" value="<?php echo "$month" ?>" class="form-control" data-provide="datepicker" data-date-format="M-yyyy" data-date-min-view-mode="1">
|
||||
|
||||
<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="col-3">
|
||||
<input type="submit" value="Change Month" class="btn btn-success" style="margin-top:0px;">
|
||||
<div class="form-group col-md-2">
|
||||
<button type="submit" class="btn btn-success"> Change Month </button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
@ -210,7 +211,7 @@
|
||||
|
||||
<!-- Add table-responsive for horizontal scroll -->
|
||||
<div class="table-responsive">
|
||||
<table id="drierTable" class="fht-table table-striped" style="font-size: small;">
|
||||
<table id="incomingSilicaSandDetailsTable" class="fht-table table-striped" style="font-size: small;">
|
||||
<thead>
|
||||
<tr>
|
||||
|
||||
@ -247,6 +248,7 @@
|
||||
<th class="celda_encabezado_general" style="padding: 10px;">Sieve Loss Qty </th>
|
||||
<th class="celda_encabezado_general" style="padding: 10px;">Salable Qty </th>
|
||||
<th class="celda_encabezado_general" style="padding: 10px;">Remark</th>
|
||||
<th class="celda_encabezado_general" style="display:none;">MaterialCode</th>
|
||||
|
||||
|
||||
|
||||
@ -272,12 +274,12 @@
|
||||
</td>
|
||||
|
||||
<!-- 'td:eq(2)' -->
|
||||
<td class="celda_normal" contenteditable="true">
|
||||
<td class="celda_normal" >
|
||||
<?php echo $record['invoiceNo']??''; ?>
|
||||
</td>
|
||||
|
||||
<!-- 'td:eq(3)' -->
|
||||
<td class="celda_normal" contenteditable="true" >
|
||||
<td class="celda_normal" >
|
||||
<?php
|
||||
$dateString = $record['invoiceDate'];
|
||||
$date = new DateTime($dateString);
|
||||
@ -287,7 +289,7 @@
|
||||
</td>
|
||||
|
||||
<!-- 'td:eq(4)' -->
|
||||
<td class="celda_normal" contenteditable="true" >
|
||||
<td class="celda_normal" >
|
||||
<?php
|
||||
$dateString = $record['materialRecievedDate'];
|
||||
$date = new DateTime($dateString);
|
||||
@ -313,14 +315,14 @@
|
||||
</td>
|
||||
|
||||
<!-- 'td:eq(8)' -->
|
||||
<td class="celda_normal" contenteditable="true" >
|
||||
<td class="celda_normal" >
|
||||
<?php echo $record['VehicleNo']??''; ?>
|
||||
</td>
|
||||
|
||||
<!-- calculateRow() for every td change below -->
|
||||
|
||||
<!-- 'td:eq(9)' -->
|
||||
<td class="celda_normal" contenteditable="true"
|
||||
<td class="celda_normal"
|
||||
onkeyup="calculateRow(this.parentNode.id);">
|
||||
<?php echo $record['Qty']??'0'; ?>
|
||||
</td>
|
||||
@ -459,6 +461,11 @@
|
||||
<td class="celda_normal" contenteditable="true">
|
||||
<?php echo $record['Remarks']??''; ?>
|
||||
</td>
|
||||
|
||||
<!-- 'td:eq(33)' -->
|
||||
<td style="display: none;">
|
||||
<?php echo $record['MaterialCode'] ?? ''; ?>
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
<?php } ?>
|
||||
@ -503,33 +510,22 @@
|
||||
|
||||
$('#save').click(function() {
|
||||
|
||||
var alldata = $("#drierTable").tableToJSON();
|
||||
var incomingSilicaSandDetailsData = $("#incomingSilicaSandDetailsTable").tableToJSON();
|
||||
|
||||
$('#drierTable tbody tr').each(function (index) {
|
||||
|
||||
let row = alldata[index];
|
||||
|
||||
// Get the selected values from dropdowns
|
||||
row['Drier On Time'] = $(this).find('.drier_on_time').val();
|
||||
row['Drier Off Time'] = $(this).find('.drier_off_time').val();
|
||||
});
|
||||
|
||||
|
||||
|
||||
alldata = JSON.stringify(alldata);
|
||||
incomingSilicaSandDetailsData = JSON.stringify(incomingSilicaSandDetailsData);
|
||||
|
||||
$('#loader').show();
|
||||
$.ajax({
|
||||
data: {
|
||||
drierData: alldata,
|
||||
incomingSilicaSandDetailsData
|
||||
},
|
||||
type: "POST",
|
||||
url: "<?php echo base_url() ?>addOrEditdrierMachineDetails",
|
||||
url: "<?php echo base_url() ?>updateIncomingSilicaSandDetails",
|
||||
|
||||
success: function(data) {
|
||||
if (data) {
|
||||
|
||||
$('#loader').hide();
|
||||
|
||||
alert(data);
|
||||
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user