GWM : client feedback

This commit is contained in:
Gowtham M 2025-01-10 16:04:28 +05:30
parent d695166852
commit 83a304123e
14 changed files with 90 additions and 73 deletions

View File

@ -63,8 +63,7 @@ class Expense extends BaseController
$file->move(WRITEPATH . 'uploads', $fileName);
}
$status = $this->request->getPost('status');
$paymentMethod = $status === 'Paid' ? $this->request->getPost('payment_method') : 0;
// Fetch the current month
$currentMonth = date('n'); // 'n' gives the month without leading zeros (1-12)
@ -100,8 +99,10 @@ class Expense extends BaseController
'total' => $this->request->getPost('total'),
'bill_no' => $this->request->getPost('bill_no'),
'bill_date' => $this->request->getPost('bill_date'),
'status' => $this->request->getPost('status'),
'serial_number' => $newSerialNumber,
];
$insert_id = $this->expense_model->insertExpense($data);
if ($insert_id) {
@ -140,8 +141,7 @@ class Expense extends BaseController
$fileName = $this->request->getPost('existing_file'); // Use existing file if no new file is uploaded
}
$status = $this->request->getPost('status');
$paymentMethod = $status === 'Paid' ? $this->request->getPost('payment_method') : 0;
$data = [
'supplier_id' => $this->request->getPost('supplierid'),
@ -154,6 +154,7 @@ class Expense extends BaseController
'total' => $this->request->getPost('total'),
'bill_no' => $this->request->getPost('bill_no'),
'bill_date' => $this->request->getPost('bill_date'),
'status' => $this->request->getPost('status')
];
if(!empty($fileName)){
$data['transporter_file'] = $fileName;

View File

@ -4506,9 +4506,10 @@ class Purchaseorder extends BaseController
$materialCode = $this->request->getPost('materialCode');
$data = $this->PurchaseOrderLineItemModel->select('t_purchaseorder_lineitem.PONO,t_purchaseorder_master.TotalOrderValue,t_purchaseorder_master.CreatedDate,t_purchaseorder_master.POType,t_purchaseorder_master.CapitalRange')
$data = $this->PurchaseOrderLineItemModel->select('t_purchaseorder_lineitem.PONO,t_purchaseorder_master.TotalOrderValue,t_purchaseorder_master.CreatedDate,t_purchaseorder_master.POType,t_purchaseorder_master.CapitalRange,t_supplierdetailsn.SupplierName')
->where('t_purchaseorder_lineitem.MaterialCode',$materialCode)
->join('t_purchaseorder_master', 't_purchaseorder_lineitem.PONO = t_purchaseorder_master.PONO', 'left')
->join('t_supplierdetailsn', 't_purchaseorder_master.SupplierID = t_supplierdetailsn.SupplierID', 'left')
->groupBy('t_purchaseorder_lineitem.MaterialCode,t_purchaseorder_lineitem.PONO')
->orderBy('t_purchaseorder_master.CreatedDate' , 'desc')
->findAll();
@ -4524,9 +4525,10 @@ class Purchaseorder extends BaseController
$supplier_id = $this->request->getPost('supplier_id');
$data = $this->purchaseorder_model->select('PONO,TotalOrderValue,CreatedDate,POType,CapitalRange')
->where('SupplierID',$supplier_id)
->orderBy('CreatedDate' , 'desc')
$data = $this->purchaseorder_model->select('PONO,TotalOrderValue,CreatedDate,POType,CapitalRange,t_supplierdetailsn.SupplierName')
->where('t_purchaseorder_master.SupplierID',$supplier_id)
->join('t_supplierdetailsn', 't_purchaseorder_master.SupplierID = t_supplierdetailsn.SupplierID', 'left')
->orderBy('t_purchaseorder_master.CreatedDate' , 'desc')
->findAll();

View File

@ -69,7 +69,6 @@ class Rawmaterialdetails extends BaseController
$this->rawmaterialdetails_model = new rawmaterialdetails_model();;
$data['userRecords'] = $this->rawmaterialdetails_model->rawmaterialListing();
$this->global['pageTitle'] = 'RawMaterial Listing';
$this->loadViews("rawmaterialListing", $this->global, $data, NULL);

View File

@ -9,7 +9,7 @@ class Expense_model extends Model
protected $primaryKey = 'id'; // Primary key
protected $allowedFields = [
'serial_number' , 'transporter_file', 'supplier_id', 'remarks', 'item_description', 'cost', 'cgst', 'sgst', 'igst', 'total', 'bill_no' ,'bill_date'
'serial_number' , 'transporter_file', 'supplier_id', 'remarks', 'item_description', 'cost', 'cgst', 'sgst', 'igst', 'total', 'bill_no' ,'bill_date','status'
];
public function getLastSerialNumber($financialYear)

View File

@ -18,7 +18,9 @@ class Rawmaterialdetails_model extends Model
{
$builder = $this->db->table('t_materialmaster')
->select('*')
->select('t_materialmaster.* , emp.FirstName as createdby_user')
->join('tbl_users as user', 'user.UserId = t_materialmaster.createdby', 'left')
->join('t_employee_details as emp', 'emp.EmpID = user.EmpID', 'left')
->orderBy('CreatedDate','desc');
$query = $builder->get();
$result = $query->getResult();

View File

@ -197,7 +197,7 @@ class Requistion_model extends Model
function getRawMaterialList($MaterialCode)
{
$builder = $this->db->table('t_materialmaster')
->select('MaterialName,UOM')
->select('MaterialName,UOM,Category')
->where('MaterialCode',$MaterialCode );
$query = $builder->get();

View File

@ -18,8 +18,10 @@ class Supplier_model extends Model
{
$builder = $this->db->table('t_supplierdetailsn as BaseT')
->select('BaseT.SupplierID, BaseT.SupplierName, BaseT.Address, BaseT.ContactNumber, BaseT.AlternateContactNumber,BaseT.EmailAddress,BaseT.Exiseregistration, BaseT.TIN, BaseT.PAN,,BaseT.GSTNO,BaseT.GSTRange,BaseT.CollectrateAddress,BaseT.UANumber,BaseT.CreatedOn,BaseT.PaymentID,pmt.PaymentTerms,BaseT.CSTDate,BaseT.IsActive') //,BaseT.PaymentTerms,BaseT.PaymentDays,BaseT.PayableAT,pmt.Details');
->select('BaseT.SupplierID, BaseT.SupplierName, BaseT.Address, BaseT.ContactNumber, BaseT.AlternateContactNumber,BaseT.EmailAddress,BaseT.Exiseregistration, BaseT.TIN, BaseT.PAN,,BaseT.GSTNO,BaseT.GSTRange,BaseT.CollectrateAddress,BaseT.UANumber,BaseT.CreatedOn,BaseT.PaymentID,pmt.PaymentTerms,BaseT.CSTDate,BaseT.IsActive , emp.FirstName as createdby') //,BaseT.PaymentTerms,BaseT.PaymentDays,BaseT.PayableAT,pmt.Details');
->join('t_paymentterms as pmt', 'pmt.PaymentID = BaseT.PaymentID', 'left')
->join('tbl_users as user', 'user.UserId = BaseT.createdby', 'left')
->join('t_employee_details as emp', 'emp.EmpID = user.EmpID', 'left')
->orderBy('BaseT.CreatedOn', 'desc');
$query = $builder->get();

View File

@ -604,7 +604,7 @@ $currentday = date('d');
<script type="text/javascript">
$(document).ready(function () {
function exportTableToExcel(tableId, filename = 'attendance.csv') {
function exportTableToExcel(tableId, filename = 'attendance.xlsx') {
var table = document.getElementById(tableId);
var rows = table.rows;
var csv = [];

View File

@ -320,6 +320,15 @@ td {
</div>
</div>
<div class="row" id="category_div" >
<div class="col-md-12">
<div class="form-group">
<label for="otherD" class="control-label">Category</label>
<input type ="text" id="category" readonly class="form-control">
</div>
</div>
</div>
<div class="row" id="otherDescription" style="display:none;">
<div class="col-md-12">
<div class="form-group">
@ -543,6 +552,7 @@ td {
$('#loader').hide();
//alert(json.MatDetail);
$("#Description").val(json.MatDetail[0]['MaterialName']);
$("#category").val(json.MatDetail[0]['Category']);
$("#UOM").val(json.MatDetail[0]['UOM']);
}

View File

@ -123,6 +123,7 @@
<th align="left" style="width: 5%;">SGST</th>
<th align="left" style="width: 5%;">IGST</th>
<th align="left" style="width: 7%;">Total</th>
<th align="left" style="width: 7%;">Status</th>
<th align="left" style="width: 8%;">Action</th>
</tr>
</thead>
@ -175,6 +176,7 @@
<td><?php echo $record['sgst']; ?></td>
<td><?php echo $record['igst']; ?></td>
<td><?php echo $record['total']; ?></td>
<td><?php echo $record['status']; ?></td>
<td>
<?php if ($fileExists == 1) { ?>
<button title="Download FIle" class="download_button" onclick="downloadFile('<?php echo $record['id']; ?>', '<?php echo $record['transporter_file']; ?>')" style="border: none;background-color: white;color: #02a8b5;">
@ -303,6 +305,17 @@
</small>
</div>
</div>
<div class="form-group row">
<div class="col-md-3">
<label for="status" class="col-form-label">Status</label>
</div>
<div class="col">
<select name="status" id="non_igr_status" class="form-control">
<option value="Draft">Draft</option>
<option value="Completed">Completed</option>
</select>
</div>
</div>
<div class="form-group row">
<div class="col-md-3">
<label for="note" class="col-form-label">Notes</label>
@ -333,27 +346,7 @@ dateInput.addEventListener('change', function () {
function downloadFile(fileId, fileName) {
window.location.href = 'downloadFile/' + fileName;
}
$(document).ready(function() {
// Function to toggle payment method based on status
function togglePaymentMethod() {
var status = $('#status_id').val();
console.log(status);
if (status === 'Paid') {
$('#payment_method').prop('disabled', false); // Enable payment method
} else {
$('#payment_method').prop('disabled', true).val(''); // Disable payment method and clear value
}
}
// Trigger the toggle function on page load
togglePaymentMethod();
// Trigger the toggle function whenever the status changes
$('#status_id').on('change', function() {
togglePaymentMethod();
});
});
$(document).ready(function() {
$('#supplierid').select2();
@ -365,16 +358,7 @@ dateInput.addEventListener('change', function () {
$('#file-name-display').text(fileName); // Display the file name
});
function togglePaymentMethodEdit() {
var status = $('#status_id').val();
console.log(status);
if (status === 'Paid') {
$('#payment_method').prop('disabled', false); // Enable payment method
} else {
$('#payment_method').prop('disabled', true).val(''); // Disable payment method and clear value
}
}
$(document).on('click', '.edit-button', function() {
$('.modal-title').html('Edit Expense');
@ -407,7 +391,7 @@ dateInput.addEventListener('change', function () {
$('#sgst').val(expense.sgst);
$('#igst').val(expense.igst);
$('#total').val(expense.total);
$('#status_id').val(expense.status);
$('#non_igr_status').val(expense.status);
$('#bill_no').val(expense.bill_no);
$('#bill_date').val(expense.bill_date);
@ -431,7 +415,7 @@ dateInput.addEventListener('change', function () {
} else {
$('#transporterfile_name').val(''); // Clear hidden input if no file
}
togglePaymentMethodEdit();
$('#loader').hide();
}
@ -450,8 +434,7 @@ dateInput.addEventListener('change', function () {
$('#cost').val('');
$('#gst').val('');
$('#total').val('');
$('#status_id').val('');
$('#payment_method').val('');
// $('#status').val('');
var supplier_list = [<?php echo $supplier_list; ?>];
$('#supplierid').empty(); // Clear the supplier dropdown
$('#supplierid').append('<option value="0">Select Supplier</option>');
@ -460,7 +443,7 @@ dateInput.addEventListener('change', function () {
$('#supplierid').append('<option value="' + supplier.SupplierID + '">' + supplier.SupplierName + '</option>');
});
formActionUrl = '<?php echo base_url() . 'addExpense' ?>'; // Set action URL for adding
togglePaymentMethodEdit();
});
// Handle form submission

View File

@ -561,7 +561,7 @@
$(document).ready(function () {
function exportTableToExcel(tableId, filename = 'monthlyPay.csv') {
function exportTableToExcel(tableId, filename = 'monthlyPay.xlsx') {
var table = document.getElementById(tableId);
var rows = table.rows;
var csv = [];

View File

@ -97,11 +97,12 @@
<div class="error" id="error"></div>
</form>
<div class="card-body" style="overflow-x:scroll;">
<table id="raw_material_list_table" class="table dt-responsive">
<table id="raw_material_list_table" class="table dt-responsive nowrap w-100">
<thead>
<tr>
<th>Created Date</th>
<th>Created By</th>
<th>Material Code</th>
<th>Material Description</th>
<th>Type of Material</th>
@ -132,6 +133,7 @@
$cdate = date('d-m-Y', strtotime($record->CreatedDate));
} ?>
<td><?php echo $cdate; ?></td>
<td><?php echo $record->createdby_user ?></td>
<td><a class="material-code" data-code="<?php echo $record->MaterialCode; ?>"><?php echo $record->MaterialCode ?></a></td>
<td><?php echo $record->MaterialName ?></td>
<td><?php echo $record->MaterialType ?></td>
@ -189,8 +191,8 @@
<!-- Long Content Scroll Modal -->
<div class="modal fade" id="scrollable-modal" tabindex="-1" role="dialog" aria-labelledby="scrollableModalTitle" aria-hidden="true">
<div class="modal-dialog modal-dialog-scrollable" role="document">
<div class="modal fade" id="scrollable-modal" tabindex="-1" role="dialog" aria-labelledby="scrollableModalTitle" aria-hidden="true" style="max-width: 100%;">
<div class="modal-dialog modal-dialog-scrollable" role="document" style="max-width: 50%;">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="scrollableModalTitle">Material Details</h5>
@ -262,10 +264,12 @@ $(document).ready(function () {
<table class="table table-bordered">
<thead style="background-color: #539754; color: white; font-size: 13px;">
<tr>
<th style="text-align: center;" >PONO</th>
<th style="text-align: center;" >Total Value</th>
<th style="text-align: center;" >PO Type</th>
<th style="text-align: center;" > Date</th>
<th style="text-align: center;" > Supplier</th>
<th style="text-align: center;" >PONO</th>
<th style="text-align: center;" >PO Type</th>
<th style="text-align: center;" >Total Value</th>
</tr>
</thead>
<tbody>
@ -276,12 +280,13 @@ $(document).ready(function () {
TotalOrderValue = formatNumberToIndianCurrency(item.TotalOrderValue);
tableHtml += `
<tr>
<td>${CreatedDate}</td>
<td>${item.SupplierName}</td>
<td class="pono-cell" data-pono="${item.PONO}" data-potype="${item.POType}" data-capitalrange="${item.CapitalRange}" style="cursor: pointer; color: #4d3a6d;">
${item.PONO}
</td>
<td style="text-align: right;">${TotalOrderValue}</td>
<td style="text-align: right;">${item.POType}</td>
<td>${CreatedDate}</td>
<td style="text-align: right;">${TotalOrderValue}</td>
</tr>
`;
});

View File

@ -213,7 +213,16 @@ if (!empty($Emp)) {
</div>
</div>
<div class="row" id="otherDescription" style="display:none;">
<div class="row" id="category_div" >
<div class="col-md-12">
<div class="form-group">
<label for="otherD" class="control-label">Category</label>
<input type ="text" id="category" readonly class="form-control">
</div>
</div>
</div>
<div class="row" id="otherDescription" style="display:none;" >
<div class="col-md-12">
<div class="form-group">
<label for="otherD" class="control-label">Other Description</label>
@ -456,6 +465,7 @@ if (!empty($Emp)) {
// $('#content').loader('hide');
//alert(json.MatDetail);
$("#Description").val(json.MatDetail[0]['MaterialName']);
$("#category").val(json.MatDetail[0]['Category']);
$("#UOM").val(json.MatDetail[0]['UOM']);
}

View File

@ -105,6 +105,7 @@
<thead>
<tr>
<th style="width:75px">Created Date</th>
<th>Created By</th>
<th>Supplier ID</th>
<th>Supplier Name</th>
<th>Address</th>
@ -136,7 +137,7 @@
$cdate = date('d-m-Y', strtotime($record->CreatedOn));
} ?>
<td style="width:75px" align="left"><?php echo $cdate; ?></td>
<td><?php echo $record->createdby ?></td>
<td><a class="supplier-id" data-code="<?php echo $record->SupplierID; ?>"><?php echo $record->SupplierID ?></a></td>
<td><?php echo $record->SupplierName ?></td>
<td><?php echo $record->Address ?></td>
@ -189,8 +190,8 @@
<!-- Long Content Scroll Modal -->
<div class="modal fade" id="scrollable-modal" tabindex="-1" role="dialog" aria-labelledby="scrollableModalTitle" aria-hidden="true">
<div class="modal-dialog modal-dialog-scrollable" role="document">
<div class="modal fade" id="scrollable-modal" tabindex="-1" role="dialog" aria-labelledby="scrollableModalTitle" aria-hidden="true" style="max-width: 100%;">
<div class="modal-dialog modal-dialog-scrollable" role="document" style="max-width: 50%;">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="scrollableModalTitle">Material Details</h5>
@ -260,10 +261,11 @@ function formatNumberToIndianCurrency(number) {
<table class="table table-bordered">
<thead style="background-color: #539754; color: white; font-size: 13px;">
<tr>
<th style="text-align: center;" >PONO</th>
<th style="text-align: center;" >Total Value</th>
<th style="text-align: center;" >PO Type</th>
<th style="text-align: center;" > Date</th>
<th style="text-align: center;" > Date</th>
<th style="text-align: center;" > Supplier</th>
<th style="text-align: center;" >PONO</th>
<th style="text-align: center;" >PO Type</th>
<th style="text-align: center;" >Total Value</th>
</tr>
</thead>
<tbody>
@ -274,12 +276,13 @@ function formatNumberToIndianCurrency(number) {
TotalOrderValue = formatNumberToIndianCurrency(item.TotalOrderValue);
tableHtml += `
<tr>
<td class="pono-cell" data-pono="${item.PONO}" data-potype="${item.POType}" data-capitalrange="${item.CapitalRange}" style="cursor: pointer; color: #4d3a6d;">
${item.PONO}
</td>
<td style="text-align: right;">${TotalOrderValue}</td>
<td style="text-align: right;">${item.POType}</td>
<td>${CreatedDate}</td>
<td>${CreatedDate}</td>
<td>${item.SupplierName}</td>
<td class="pono-cell" data-pono="${item.PONO}" data-potype="${item.POType}" data-capitalrange="${item.CapitalRange}" style="cursor: pointer; color: #4d3a6d;">
${item.PONO}
</td>
<td style="text-align: right;">${item.POType}</td>
<td style="text-align: right;">${TotalOrderValue}</td>
</tr>
`;
});