FIX_From date and to date

This commit is contained in:
VE10-Sanjeev 2024-08-16 10:22:46 +00:00
parent a6620b84e8
commit 440c772645
24 changed files with 3156 additions and 1795 deletions

View File

@ -311,7 +311,6 @@ class Inwardgateregister extends BaseController
function SaveIGR()
{
//print_r($this->request->getPost());die;
#Step 1 IGR Details
$PONO = $this->request->getPost('PONO');
$IsThisOpenOrderPO = $this->request->getPost('hiddenIsOpenOrder');
@ -362,9 +361,9 @@ class Inwardgateregister extends BaseController
// print_r( $igr );die;
#Step 4 Calling DB to Save IGR Master
$IGRNO = $this->inwardgateregister_model->addigrM($igr);
// Get the uploaded files
// $IGRNO = "IGRNO02750";
// $IGRNO = "IGRNO02734";
// echo "master - no problem";
// $IGRNO = "IGRNO02767";
// print_r($this->request->getPost());die;
if($IGRNO){
$files = $this->request->getFiles();
$fileNames = $this->request->getPost('file_name'); // Get user-entered file names
@ -461,20 +460,25 @@ class Inwardgateregister extends BaseController
$GrossWeightDate = !empty($grossWeightDate) && is_string($grossWeightDate) ? date('Y-m-d H:i:s', strtotime($grossWeightDate)) : null;
$TareWeightDate = !empty($tareWeightDate) && is_string($tareWeightDate) ? date('Y-m-d H:i:s', strtotime($tareWeightDate)) : null;
log_message('error', "TareWeightDate" . $TareWeightDate);
if (strlen($QuantityAsPerInvoice) > 0 && $QuantityAsPerInvoice != '0') {
$Remarks = $this->request->getPost('txtRemarks' . $i);
$ItemStatus = '';
if (strlen($QuantityAsPerInvoice) > 0 && $QuantityAsPerInvoice != '0') {
if ($PendingQty == 0.00) {
$ItemStatus = $IGRStatus;
} else {
$ItemStatus = POLINEITEM_IGRPARTIAL_CREATED;
}
}
else if ((int)$IsThisOpenOrderPO == 1) {
$ItemStatus = POLINEITEM_IGRPARTIAL_CREATED;
}
$CreatedBy = $this->session->get('userId');
$igrDetails = array('IGRNO' => $IGRNO, 'MaterialCode' => $MaterialCode, 'QuantityAsPerInvoice' => $QuantityAsPerInvoice, 'Remarks' => $Remarks, 'IGRItemStatus' => $IGRItemStatus,'GrossWeight' => (float)$GrossWeight ,'GrossWeightDate'=> $GrossWeightDate,'TareWeight' => (float)$TareWeight ,'TareWeightDate' => $TareWeightDate ,'NetWeight' => (float)$NetWeight, 'CreatedBy' => $CreatedBy, 'CreatedDate' => $createddt);
$igrDetails['WeightFile'] = $requestWeightFileName;
log_message('error', 'SaveIGR igrDetails result : ' . json_encode($igrDetails));
log_message('error', 'SaveIGR igrDetails result : ' . json_encode($igrDetails));
$igrlineno = "";
$igrD = $this->inwardgateregister_model->addigrD($igrDetails);
$igrlineno = !empty($igrD) ? $igrD : '';
@ -527,7 +531,7 @@ class Inwardgateregister extends BaseController
log_message('error', "History updated successfully. History id: " . $history_id);
}
$get_pre_qty = $this->inwardgateregister_model->get_CurrentQty($MaterialCode);
$av_qty = 0;
$av_qty = 0; //$av_qty means Avaliable Quantity
if (!empty($get_pre_qty)) {
foreach ($get_pre_qty as $gt) {
$av_qty = $gt->Current_stock;
@ -543,49 +547,11 @@ class Inwardgateregister extends BaseController
$ReceivedQuantity = $key->ReceivedQuantity;
}
}
$totalReceivedqty = $ReceivedQuantity + $QuantityAsPerInvoice;
$totalReceivedqty = (int)$IsThisOpenOrderPO == 1 ? 0 : $ReceivedQuantity + $QuantityAsPerInvoice ;
// $totalReceivedqty = $ReceivedQuantity + $QuantityAsPerInvoice;
$POLineItem = array('ReceivedQuantity' => $totalReceivedqty, 'Status' => $ItemStatus, 'UpdateBY' => $CreatedBy, 'UpdatedOn' => $createddt);
$this->inwardgateregister_model->UpdatePOLineItem($POLineItem, $PONO, $MaterialCode);
}
else if ((int)$IsThisOpenOrderPO == 1) {
$ItemStatus = POLINEITEM_IGRPARTIAL_CREATED;
# Is this open order po means i have to save IGR DETAILS
$Remarks = $this->request->getPost('txtRemarks' . $i);
$ItemStatus = POLINEITEM_IGRPARTIAL_CREATED;
$CreatedBy = $this->session->get('userId');
$igrDetails = array('IGRNO' => $IGRNO, 'MaterialCode' => $MaterialCode, 'QuantityAsPerInvoice' => $QuantityAsPerInvoice, 'Remarks' => $Remarks, 'IGRItemStatus' => $IGRItemStatus,'GrossWeight' => (float)$GrossWeight ,'GrossWeightDate'=> $GrossWeightDate,'TareWeight' => (float)$TareWeight ,'TareWeightDate' => $TareWeightDate ,'NetWeight' => (float)$NetWeight, 'CreatedBy' => $CreatedBy, 'CreatedDate' => $createddt);
$igrDetails['WeightFile'] = $requestWeightFileName;
$igrD = $this->inwardgateregister_model->addigrD($igrDetails);
$igrD ='';
$igrlineno = !empty($igrD) ? $igrD : '';
log_message('error', 'SaveIGR igrDetails result : ' . json_encode($igrDetails)." IgrLineNo : ".$igrlineno);
$itemvalue = '';
$SupplierId = '';
$polineitemvalue = $this->inwardgateregister_model->getitemvalue($PONO, $MaterialCode);
foreach ($polineitemvalue as $it) {
$itemvalue = $it->Rate;
$SupplierId = $it->SupplierID;
}
# Is this open order po means i have to save add material history
$historydetails = array('MaterialCode' => $MaterialCode, 'Transaction_type' => "Add", 'Ref_Type' => "IGR", 'Ref_No' => $igrlineno, 'Quantity' => $QuantityAsPerInvoice, 'CreatedBy' => $CreatedBy, 'CreatedOn' => $createddt, 'SupplierID' => $SupplierId, 'ItemValue' => $itemvalue);
$this->inwardgateregister_model->addmaterialhistory($historydetails);
# Is this open order po means i have to save the get received qty in PO lineitem table
$get_pre_qty = $this->inwardgateregister_model->get_CurrentQty($MaterialCode);
$Recqty = $this->inwardgateregister_model->getPOLineItemReceivedQty($PONO, $MaterialCode);
$ReceivedQuantity = 0.00;
if (count($Recqty) > 0) {
foreach ($Recqty as $key) {
$ReceivedQuantity = $key->ReceivedQuantity;
}
}
$totalReceivedqty = $ReceivedQuantity + $QuantityAsPerInvoice;
$POLineItem = array('ReceivedQuantity' => $totalReceivedqty, 'Status' => $ItemStatus, 'UpdateBY' => $CreatedBy, 'UpdatedOn' => $createddt);
$this->inwardgateregister_model->UpdatePOLineItem($POLineItem, $PONO, $MaterialCode);
}
}
$this->inwardgateregister_model->UpdatePOMaster($PONO, $CreatedBy,$IGRStatus);
#Step 9 Updating Pending Quantity IN PO Master amd Line Item Details.

View File

@ -51,7 +51,7 @@ class Department_model extends Model
function departmentListing()
{
$builder = $this->db->table('t_departmentdetails as BaseT')
->select('BaseT.DepartmentName, BaseT.DEPCode, BaseT.HeadDept, BaseT.IsActive')
->select('BaseT.CreatedDt,BaseT.DepartmentName, BaseT.DEPCode, BaseT.HeadDept, BaseT.IsActive')
->orderBy("BaseT.DEPCode", "asc");
$query =$builder->get();
$result = $query->getResult();

View File

@ -153,7 +153,7 @@ class Inwardgateregister_model extends Model
->join('t_purchaseorder_lineitem POL', 'POL.PONO = POM.PONO')
->join('t_supplierdetailsn sup', 'POM.SupplierID = sup.SupplierID')
->join('t_ogr_master OGM ', 'POM.PONO = OGM.PONO_INV', 'left')
->where('POM.POType !=', SERVICE)
// ->where('POM.POType !=', SERVICE) // due to client requirements - he wants to remove the conidition.
->where('POM.Status', PO_RELEASED)
->orWhere('POM.Status',REQITEM_Emergency_PO_CREATED)
->orWhere('POM.Status',IGR_CREATED)
@ -164,6 +164,7 @@ class Inwardgateregister_model extends Model
$query = $builder->get();
$result = $query->getResult();
// echo $this->db->getLastQuery()->getQuery(); die;
return $result;
}
@ -328,11 +329,10 @@ class Inwardgateregister_model extends Model
->join('t_purchaseorder_master PO', 'igr.PONO = PO.PONO')
->join('t_supplierdetailsn` sup', 'PO.SupplierID = sup.SupplierID')
->where('igr.IGRStatus !=', MRIR_CREATED)
->where('PO.IsQualityChkReqired', 1)
->orderBy('igr.CreatedDate', 'desc');
$query = $builder->get();
$result = $query->getResult();
// echo $this->db->getLastQuery()->getQuery();die;
return $result;
}
@ -346,7 +346,7 @@ class Inwardgateregister_model extends Model
$builder = $this->db->table('t_igr_master igr')
->distinct()
->select('igr.IGRNO,igr.*,igrd.*,MM.MaterialName,MM.UOM,sup.Address,sup.SupplierName,POM.ServiceDescription,POL.Quantity,POM.POType')
->select('igr.IGRNO,igr.*,igrd.*,MM.MaterialName,MM.UOM,sup.Address,sup.SupplierName,POM.ServiceDescription,POL.Quantity,POM.POType,POM.IsOpenOrder')
->join('t_igr_details igrd', 'igrd.IGRNO = igr.IGRNO')
->join('t_purchaseorder_master POM', 'igr.PONO = POM.PONO')
->join('t_purchaseorder_lineitem POL', 'igr.PONO = POL.PONO and POL.MaterialCode=igrd.MaterialCode ')

View File

@ -1578,7 +1578,7 @@ QuantityRejected,ROUND(Quantity-ReceivedQuantity)as PendingQty,Per,
$builder = $this->db->table('t_purchaseorder_master mast')->distinct()
->select('mast.PONO,mast.TotalOrderValue,st.StatusCode,st.StatusName,emp.FirstName,mast.CreatedDate,ccm.CostCenterName,ccm.CostCenterCode,mast.POType as RType,mast.Remarks,DepartmentName,mast.ApprovedBy,(select EmpID from tbl_users where userId=mast.ApprovedBy )as EID,rmast.ReqType,mast.Status,mast.CapitalRange,
->select('mast.PODate,mast.PONO,mast.TotalOrderValue,st.StatusCode,st.StatusName,emp.FirstName,mast.CreatedDate,ccm.CostCenterName,ccm.CostCenterCode,mast.POType as RType,mast.Remarks,DepartmentName,mast.ApprovedBy,(select EmpID from tbl_users where userId=mast.ApprovedBy )as EID,rmast.ReqType,mast.Status,mast.CapitalRange,
(select FirstName from t_employee_details where EmpID=EID)as Approver,sup.SupplierName,sup.MSME')
// ->orderBy('mast.Status',"PO_CREATED");

View File

@ -18,7 +18,7 @@ class User_model extends Model
function userListing()
{
$builder = $this->db->table('t_employee_details EMP')
->select('EMP.EmpID,EMP.FirstName,EMP.LastName,EMP.Designation,EMP.EmailId,EMP.ContactNumber,
->select('user.createdDtm,EMP.EmpID,EMP.FirstName,EMP.LastName,EMP.Designation,user.email as EmailId,EMP.ContactNumber,
DEPT.DEPCode,DEPT.DepartmentName,role.role,user.userId')
->join('t_departmentdetails DEPT', 'EMP.Departmentcode = DEPT.DEPCode')
->join('tbl_users user', 'user.EmpID = EMP.EmpID')

View File

@ -5,6 +5,40 @@
margin: 0px !important;
}
</style>
<style>
.Date-filter-form {
display: flex;
align-items: center;
gap: 10px; /* Adjust the gap as needed */
}
.Date-filter-form input, .Date-filter-form button {
padding: 5px;
font-size: 14px;
}
.Date-filter-form button {
background-color: #007bff;
color: white;
border: none;
cursor: pointer;
}
.Date-filter-form button:hover {
background-color: #0056b3;
}
.icon-button {
background: none;
border: none;
cursor: pointer;
color: #007bff;
font-size: 18px;
}
.icon-button:hover {
color: #0056b3;
}
th, td {
white-space: nowrap;
}
</style>
<div class="content-wrapper">
<!-- Content Header (Page header) -->
@ -20,13 +54,25 @@
</div>
<!-- /.box-header -->
<div class="box-body">
<form class="Date-filter-form" id="DateRangeFilter" >
<input type="hidden" name="table" value="requisition">
<label for="fromDate">From:</label>
<input type="text" id="fromDate" name="fromDate" placeholder="Select From Date" autocomplete="off" required>
<label for="toDate">To:</label>
<input type="text" id="toDate" name="toDate" placeholder="Select To Date" autocomplete="off" required>
<button type="submit">Search</button>
<i class="fa fa-repeat" aria-hidden="true" class="icon-button" id="resetButton" title="Reset"></i>
<div class="error" id="error"></div>
</form>
<table id="example1" class="table table-hover editableTable" style="background-color:#fff;font-size:12px;">
<thead style="background-color: #ddd;">
<tr>
<!-- <th>#</th> -->
<th>PONO#</th>
<th>PO Type</th>
<th>PO Date</th>
<th>PONO</th>
<th>PO Type</th>
<th>Supplier Name</th>
<th>Total Order Value</th>
<th>PO Status</th>
@ -44,12 +90,12 @@
?>
<tr id="<?php echo $index; ?>">
<!-- <td align="left"><?php echo $index; ?></td> -->
<td><?php echo $record->PONO ?></td>
<td><?php echo $record->ReqType ?></td>
<td align="right"><?php $Pdt = new DateTime($record->PODate);
$PODate = $Pdt->format('d-m-Y');
echo $PODate
?></td>
<td><?php echo $record->PONO ?></td>
<td><?php echo $record->ReqType ?></td>
<td><?php echo $record->SupplierName ?></td>
<td align="right"><?php echo $record->TotalOrderValue ?></td>
@ -121,7 +167,7 @@
<!-- /.content -->
</div>
<!-- /.content-wrapper -->
<script>
<!-- <script>
$(function() {
$.fn.dataTable.moment('DD-MM-YYYY');
$('#example1').DataTable({
@ -138,5 +184,85 @@
"autoWidth": false
});
});
</script>
</script> -->
<script src="https://cdn.datatables.net/plug-ins/1.10.16/sorting/datetime-moment.js"></script>
<script>
$(document).ready(function() {
$.fn.dataTable.ext.type.order['date-eu-pre'] = function (date) {
var dateSplit = date.split('-');
return (dateSplit[2] + dateSplit[1] + dateSplit[0]) * 1;
};
// Initialize the DataTable
var table = $('#example1').DataTable({
"paging": true,
"lengthChange": true,
"searching": true,
"ordering": true,
"columnDefs": [{
"targets": 0,
"type": "date-eu"
}],
"aaSorting": [
[0, "desc"]
],
"info": true,
"autoWidth": true,
"pageLength": 10,
"lengthMenu": [10, 25, 50, 100],
});
// Initialize the datepickers
$("#fromDate").datepicker({
dateFormat: 'dd-mm-yy',
onSelect: function(selectedDate) {
var minDate = $(this).datepicker("getDate");
$("#toDate").datepicker("option", "minDate", minDate);
}
});
$("#toDate").datepicker({
dateFormat: 'dd-mm-yy',
onSelect: function(selectedDate) {
var maxDate = $(this).datepicker("getDate");
$("#fromDate").datepicker("option", "maxDate", maxDate);
}
});
// Reset button functionality
$("#resetButton").click(function() {
$("#fromDate").datepicker("setDate", null);
$("#toDate").datepicker("setDate", null);
$("#toDate").datepicker("option", "minDate", null);
$("#fromDate").datepicker("option", "maxDate", null);
table.draw();
});
// Date range filter
$.fn.dataTable.ext.search.push(
function(settings, data, dataIndex) {
var fromDate = $("#fromDate").datepicker("getDate");
var toDate = $("#toDate").datepicker("getDate");
var dateStr = data[0]; // Assuming the date is in the first column
// Convert dateStr to Date object
var dateParts = dateStr.split("-");
var date = new Date(dateParts[2], dateParts[1] - 1, dateParts[0]); // Convert dd-mm-yyyy to Date object
if (!fromDate || !toDate) {
return true; // No filter if dates are not selected
}
return date >= fromDate && date <= toDate;
}
);
// Handle form submission
$("#DateRangeFilter").submit(function(e) {
e.preventDefault();
table.draw();
});
});
</script>

View File

@ -1986,7 +1986,7 @@ if (!empty($getlogpodtl)) {
<th>SNo</th>
<th>Requisition No</th>
<th>Item Code</th>
<th>Item Description</th>
<th>Item Name</th>
<th>Quantity</th>
<th>UOM</th>
<th>Rate <?php echo "($INRSYM)" ?></th>
@ -2022,7 +2022,7 @@ if (!empty($getlogpodtl)) {
<td align="left"><?php echo $index; ?></td>
<td><?php echo $record->ReqNo ?></td>
<td><?php echo $record->MaterialCode ?></td>
<td><?php echo $record->ServiceMaterialDescription ?></td>
<td><?php echo $record->MaterialName ?></td>
<td align="right"><?php echo $record->Quantity ?></td>
<td><?php echo $record->UOM ?></td>
@ -2477,10 +2477,6 @@ if (!empty($getlogpodtl)) {
<td align="left"><%=BasicAmount%></td>
<td align="left"><%=Taxvalue%></td>
<td align="left"><%=TotalValue%></td>
<td align="left"><%=ActualQuantity%></td>
<td align="left"><%=ReceivedQuantity%></td>
<td align="left"><%=PendingQuantity%></td>
<td>
<a data-target='#EDITSERVICE' data-id="<%=index%>" data-userid="<%=index%>" data-toggle="modal" href="#EDITSERVICE"><i class="fa fa-pencil" data-toggle="tooltip" title="Click here to view/Edit the <%=ReqNo%> Requisition details"></i>&nbsp;&nbsp;&nbsp;</a> <a href='#' onclick="DeleteRow(<%=index%>)" class="link" data-id="<%=index%>" data-userid="<%=index%>" id="Del"><span class="glyphicon glyphicon-trash"></span></a>
@ -2580,16 +2576,13 @@ if (!empty($getlogpodtl)) {
index: temp,
ReqNo: Reqnumber,
MaterialCode: materialCode,
MaterialName: ServiceDescription,
MaterialName: materialName,
Quantity: quantity,
UOM: uom,
Rate: itemRate,
BasicAmount: basicval,
Taxvalue: TotalTaxValue,
TotalValue: TotalOrderValue,
ActualQuantity: quantity,
ReceivedQuantity: 0,
PendingQuantity: quantity
TotalValue: TotalOrderValue
}));
@ -2684,7 +2677,7 @@ if (!empty($getlogpodtl)) {
var cellval = tr.cells;
cellval[2].innerHTML = editMaterialCode;
cellval[3].innerHTML = ServiceDescription;
cellval[3].innerHTML = editDescription;
cellval[4].innerHTML = editQuantity;
cellval[5].innerHTML = editUOM;
cellval[6].innerHTML = parseFloat(itemRate).toFixed(2);

View File

@ -32,6 +32,29 @@
white-space: nowrap;
}
</style>
<style>
.dataTables_wrapper .top {
display: flex;
justify-content: space-between;
align-items: center;
}
.dataTables_wrapper .dataTables_length {
float: left;
}
.dataTables_wrapper .dt-buttons,
.dataTables_wrapper .dataTables_filter {
float: right;
margin-left: 10px;
}
.dataTables_wrapper .dt-buttons {
margin-top: 10px;
margin-bottom: 10px;
}
.dataTables_wrapper .dataTables_filter {
margin-top: 10px;
margin-bottom: 10px;
}
</style>
<div class="content-wrapper">
<!-- Content Header (Page header) -->
@ -85,7 +108,6 @@
<table id="dataTableHistoriek" class="table table-bordered table-hover editableTable" style="background-color:#fff;font-size:12px;">
<thead style="background-color: #ddd;">
<tr>
<th style="display:none;"></th>
<th>PO Date</th>
<th>PONO#</th>
<th>PO Type</th>
@ -105,7 +127,6 @@
$index = $index + 1;
?>
<tr id="<?php echo $index; ?>">
<td style="display:none;"><?php echo $record->PODate ?></th>
<td align="right"><?php $Pdt = new DateTime($record->PODate);
$PODate = $Pdt->format('d-m-Y');
echo $PODate
@ -184,25 +205,58 @@
</div>
<!-- /.content-wrapper -->
<script src="https://cdn.datatables.net/plug-ins/1.10.11/sorting/date-eu.js"></script>
<script src="https://cdn.datatables.net/buttons/2.3.4/js/dataTables.buttons.min.js"></script>
<script src="https://cdn.datatables.net/buttons/2.3.4/js/buttons.html5.min.js"></script>
<script src="https://cdn.datatables.net/buttons/2.3.4/js/buttons.print.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.10.1/jszip.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.7/pdfmake.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.7/vfs_fonts.js"></script>
<script src="https://cdn.datatables.net/plug-ins/1.13.6/sorting/datetime-moment.js"></script>
<script>
$(document).ready(function() {
$.fn.dataTable.ext.type.order['date-eu-pre'] = function (date) {
var dateSplit = date.split('-');
return (dateSplit[2] + dateSplit[1] + dateSplit[0]) * 1;
};
// Initialize the DataTable
var table = $('#dataTableHistoriek').DataTable({
"paging": true,
"lengthChange": true,
"scrollCollapse": true,
"searching": true,
"ordering": true,
"columnDefs": [{
"targets": 1,
"targets": 0,
"type": "date-eu"
}],
"aaSorting": [
[1, "desc"]
[0, "desc"]
],
"info": true,
"autoWidth": true,
"pageLength": 10,
"lengthMenu": [10, 25, 50, 100],
"dom": "<'row'<'col-md-6'l><'col-md-6'Bf>>" +
"<'row'<'col-md-6'><'col-md-6'>>" +
"<'row'<'col-md-12't>><'row'<'col-md-4'i><'col-md-8'p>>",
"buttons": [
{
extend: 'excelHtml5',
text: 'Export to Excel',
title: 'Purchase Order',
exportOptions: {
columns: ':visible:not(:last-child)' // Exclude first and last columns
}
},
{
extend: 'pdfHtml5',
text: 'Export to PDF',
title: 'Purchase Order',
exportOptions: {
columns: ':visible:not(:last-child)' // Exclude first and last columns
}
}]
});
@ -239,7 +293,7 @@ $(document).ready(function() {
var fromDate = $("#fromDate").datepicker("getDate");
var toDate = $("#toDate").datepicker("getDate");
var dateStr = data[1]; // Assuming the date is in the first column
var dateStr = data[0]; // Assuming the date is in the first column
// Convert dateStr to Date object
var dateParts = dateStr.split("-");

View File

@ -184,9 +184,8 @@
<table id="cc" class="table table-bordered table-hover" style="background-color:#fff;font-size:12px;" >
<thead style="background-color: #ddd;">
<tr>
<th style="text-align:center">PO No</th>
<th style="text-align:center">PO Date</th>
<th style="text-align:center">PO No</th>
<th style="text-align:center">Supplier Name</th>
<th style="text-align:center">Material Name</th>
<th style="text-align:center">Category</th>
@ -214,12 +213,13 @@
<!-- <td><span>
<a href="<?= base_url() ?>report/link_purchase?sid=<?php //echo $rel->sid;?>&ab=<?php //echo $ab;?>&mid=<?php //echo $rel->mid;?>"><?php //echo $rel->supplier_name;?></a>
</span></td>-->
<td><span>
<?php echo $rel->po;?>
</span></td>
<td><span>
<?php echo $rel->pdate;?>
</span></td>
<td><span>
<?php echo $rel->po;?>
</span></td>
<td><span>
<?php echo $rel->supplier;?>
@ -371,7 +371,9 @@ $(document).ready(function() {
"language": {
"emptyTable": "<center> Data Not Found ! </center>"
},
"aaSorting": [[ 1, "desc" ]],
"aaSorting": [[ 0, "desc" ]],
"pageLength": 10,
"lengthMenu": [10, 25, 50, 100],
"autoWidth": false,
orderCellsTop: true,
"dom": "<'row'<'col-md-6'l><'col-md-6'Bf>>" +

View File

@ -6447,7 +6447,7 @@ if (!empty($INRSYMBOL)) {
index: temp,
ReqNo: Reqnumber,
MaterialCode: materialCode,
MaterialName: ItemServiceDescription,
MaterialName: materialName,
Quantity: quantity,
UOM: uom,
Rate: itemRate,
@ -6801,7 +6801,7 @@ $('#content').loader('hide');
var tr = document.getElementById(userid);
var cellval = tr.cells;
cellval[3].innerHTML = editMaterialCode;
cellval[3].innerHTML = ItemServiceDescription;
cellval[3].innerHTML = editDescription;
cellval[4].innerHTML = editQuantity;
cellval[5].innerHTML = editUOM;
cellval[6].innerHTML = itemRate;

View File

@ -1,26 +1,80 @@
<style>
.Date-filter-form {
display: flex;
align-items: center;
gap: 10px;
/* Adjust the gap as needed */
}
.Date-filter-form input,
.Date-filter-form button {
padding: 5px;
font-size: 14px;
}
.Date-filter-form button {
background-color: #007bff;
color: white;
border: none;
cursor: pointer;
}
.Date-filter-form button:hover {
background-color: #0056b3;
}
.icon-button {
background: none;
border: none;
cursor: pointer;
color: #007bff;
font-size: 18px;
}
.icon-button:hover {
color: #0056b3;
}
</style>
<div class="content-wrapper">
<section class="content">
<div class="box">
<div class="box-header">
<CENTER><h3 class="box-title"> Asset Details</h3></CENTER>
<CENTER>
<h3 class="box-title"> Asset Details</h3>
</CENTER>
</div>
<div class="container-fluid">
<div class="row">
<div class="col-xs-12 text-right">
<div class="col-xs-12 col-md-6">
<form class="Date-filter-form" id="DateRangeFilter">
<input type="hidden" name="table" value="requisition">
<label for="fromDate">From:</label>
<input type="text" id="fromDate" name="fromDate" placeholder="Select From Date" autocomplete="off" required>
<label for="toDate">To:</label>
<input type="text" id="toDate" name="toDate" placeholder="Select To Date" autocomplete="off" required>
<button type="submit">Search</button>
<i class="fa fa-repeat" aria-hidden="true" class="icon-button" id="resetButton" title="Reset"></i>
<div class="error" id="error"></div>
</form>
</div>
<div class="col-xs-12 col-md-6 text-right">
<div class="form-group">
<a class="btn btn-success" href="<?php echo base_url(); ?>addasset">Add New Asset</a>
<a class="btn btn-success" href="<?php echo base_url(); ?>exportasset">Export Asset Details <i class="fa fa-download"aira-hidden="true"></i></a>
<a class="btn btn-success" href="<?php echo base_url(); ?>exportasset">Export Asset Details <i class="fa fa-download" aira-hidden="true"></i></a>
</div>
</div>
</div>
<div class="row">
<div class="col-xs-12">
<table class="table table-bordered table-hover" id="datatable" style="background-color:#fff;font-size:12px;" >
<table class="table table-bordered table-hover" id="datatable" style="background-color:#fff;font-size:12px;">
<thead style="background-color: #ddd;">
<tr>
<th>Created Date</th>
<th>Asset Code</th>
<th>Asset Name</th>
<th>Asset Description</th>
@ -37,13 +91,17 @@
</thead>
<tbody>
<?php
if(!empty($userRecords))
{
foreach($userRecords as $record)
{
if (!empty($userRecords)) {
foreach ($userRecords as $record) {
?>
<tr>
<td><u><a href="<?php echo base_url().'assetdetails/editOldasset/?AssetID='.$record->AssetCode ?>" data-toggle="tooltip" title="<?php echo $record->AssetCode; ?> - Click here to view Asset details"><?php echo substr($record->AssetCode, 5) ?>
<?php if (date('d-m-Y', strtotime($record->CreatedDt)) == "30-11--0001") {
$cdate = '00-00-0000';
} else {
$cdate = date('d-m-Y', strtotime($record->CreatedDt));
} ?>
<td align="right"><?php echo $cdate; ?></td>
<td><u><a href="<?php echo base_url() . 'assetdetails/editOldasset/?AssetID=' . $record->AssetCode ?>" data-toggle="tooltip" title="<?php echo $record->AssetCode; ?> - Click here to view Asset details"><?php echo substr($record->AssetCode, 5) ?>
<td><?php echo $record->AssetName ?></td>
<td><?php echo $record->Description ?></td>
<td><?php echo $record->DepartmentName ?></td>
@ -52,7 +110,7 @@
<td><?php echo $record->SupplierName ?></td>
<td><?php
$dtpurchase = new DateTime($record->DateOfPurchase);
$DOPurchase = $dtpurchase ->format('d-m-Y');
$DOPurchase = $dtpurchase->format('d-m-Y');
echo $DOPurchase ?></td>
<td><?php echo number_format($record->AssetValue, 2); ?></td>
<td><?php echo $record->AssetStatus ?></td>
@ -72,8 +130,8 @@
</section>
</div>
<script type="text/javascript" src="<?php echo base_url(); ?>public/assets/js/common.js" charset="utf-8"></script>
<script src="https://cdn.datatables.net/plug-ins/1.10.16/sorting/datetime-moment.js"></script>
<script type="text/javascript">
<script src="https://cdn.datatables.net/plug-ins/1.10.16/sorting/datetime-moment.js"></script>
<!-- <script type="text/javascript">
$(function () {
$.fn.dataTable.moment( 'DD-MM-YYYY' );
@ -90,6 +148,85 @@
});
});
</script>
</script> -->
<!-- <script src="https://cdn.datatables.net/plug-ins/1.10.11/sorting/date-eu.js"></script> -->
<script>
$(document).ready(function() {
$.fn.dataTable.ext.type.order['date-eu-pre'] = function(date) {
var dateSplit = date.split('-');
return (dateSplit[2] + dateSplit[1] + dateSplit[0]) * 1;
};
// Initialize the DataTable
var table = $('#datatable').DataTable({
"paging": true,
"lengthChange": true,
"searching": true,
"ordering": true,
"columnDefs": [{
"targets": 0,
"type": "date-eu"
}],
"aaSorting": [
[0, "desc"]
],
"info": true,
"autoWidth": true,
"pageLength": 10,
"lengthMenu": [10, 25, 50, 100],
});
// Initialize the datepickers
$("#fromDate").datepicker({
dateFormat: 'dd-mm-yy',
onSelect: function(selectedDate) {
var minDate = $(this).datepicker("getDate");
$("#toDate").datepicker("option", "minDate", minDate);
}
});
$("#toDate").datepicker({
dateFormat: 'dd-mm-yy',
onSelect: function(selectedDate) {
var maxDate = $(this).datepicker("getDate");
$("#fromDate").datepicker("option", "maxDate", maxDate);
}
});
// Reset button functionality
$("#resetButton").click(function() {
$("#fromDate").datepicker("setDate", null);
$("#toDate").datepicker("setDate", null);
$("#toDate").datepicker("option", "minDate", null);
$("#fromDate").datepicker("option", "maxDate", null);
table.draw();
});
// Date range filter
$.fn.dataTable.ext.search.push(
function(settings, data, dataIndex) {
var fromDate = $("#fromDate").datepicker("getDate");
var toDate = $("#toDate").datepicker("getDate");
var dateStr = data[0]; // Assuming the date is in the first column
// Convert dateStr to Date object
var dateParts = dateStr.split("-");
var date = new Date(dateParts[2], dateParts[1] - 1, dateParts[0]); // Convert dd-mm-yyyy to Date object
if (!fromDate || !toDate) {
return true; // No filter if dates are not selected
}
return date >= fromDate && date <= toDate;
}
);
// Handle form submission
$("#DateRangeFilter").submit(function(e) {
e.preventDefault();
table.draw();
});
});
</script>

View File

@ -1,17 +1,71 @@
<div class="content-wrapper">
<style>
.Date-filter-form {
display: flex;
align-items: center;
gap: 10px;
/* Adjust the gap as needed */
}
.Date-filter-form input,
.Date-filter-form button {
padding: 5px;
font-size: 14px;
}
.Date-filter-form button {
background-color: #007bff;
color: white;
border: none;
cursor: pointer;
}
.Date-filter-form button:hover {
background-color: #0056b3;
}
.icon-button {
background: none;
border: none;
cursor: pointer;
color: #007bff;
font-size: 18px;
}
.icon-button:hover {
color: #0056b3;
}
</style>
<div class="content-wrapper">
<section class="content">
<div class="box">
<div class="box-header">
<CENTER><h3 class="box-title"> Configuration Details</h3></CENTER>
<CENTER>
<h3 class="box-title"> Configuration Details</h3>
</CENTER>
</div>
<div class="container-fluid">
<div class="row">
<div class="col-xs-12 text-right">
<div class="col-xs-12 col-md-6">
<form class="Date-filter-form" id="DateRangeFilter">
<input type="hidden" name="table" value="requisition">
<label for="fromDate">From:</label>
<input type="text" id="fromDate" name="fromDate" placeholder="Select From Date" autocomplete="off" required>
<label for="toDate">To:</label>
<input type="text" id="toDate" name="toDate" placeholder="Select To Date" autocomplete="off" required>
<button type="submit">Search</button>
<i class="fa fa-repeat" aria-hidden="true" class="icon-button" id="resetButton" title="Reset"></i>
<div class="error" id="error"></div>
</form>
</div>
<div class="col-xs-12 col-md-6 text-right">
<div class="form-group">
<a class="btn btn-success" href="<?php echo base_url(); ?>addconfig">Add New Configuration</a>
</div>
</div>
</div>
</div>
<div class="col-md-12">
<?php
helper('form');
@ -44,10 +98,10 @@
<table id="configtable" class="table table-bordered table-hover" style="background-color:#fff;font-size:12px;">
<thead style="background-color: #ddd;">
<tr>
<th>Create Date</th>
<th>Configuration ID</th>
<th>Configuration Name</th>
<th>Description</th>
<th>Create Date</th>
<th>Action</th>
</tr>
</thead>
@ -57,7 +111,12 @@
foreach ($userRecords as $record) {
?>
<tr>
<?php if (date('d-m-Y', strtotime($record->CreatedDate)) == "30-11--0001") {
$cdate = '00-00-0000';
} else {
$cdate = date('d-m-Y', strtotime($record->CreatedDate));
} ?>
<td align="right"><?php echo $cdate; ?> </td>
<td><?php echo $record->Config_ID ?></td>
<td><?php echo $record->ConfigName ?></td>
<td><?php echo $record->Comments ?> </td>
@ -67,12 +126,7 @@
$CreatedDate = $dt->format('d-m-Y');
echo $CreatedDate ?> </td> -->
<?php if (date('d-m-Y', strtotime($record->CreatedDate)) == "30-11--0001") {
$cdate = '00-00-0000';
} else {
$cdate = date('d-m-Y', strtotime($record->CreatedDate));
} ?>
<td align="right"><?php echo $cdate; ?> </td>
<td><a href="<?php echo base_url() . 'configurationctrl/editconfig?ConfigID=' . $record->Config_ID; ?>"><i class="fa fa-pencil"></i>&nbsp;&nbsp;&nbsp;</a>
<!-- <a><i class="fa fa-trash"></i>&nbsp;&nbsp;&nbsp;</a> -->
@ -88,13 +142,13 @@
</div>
</div>
</div>
</div>
</section>
</div>
<script type="text/javascript" src="<?php echo base_url(); ?>public/assets/js/common.js" charset="utf-8"></script>
</div>
</section>
</div>
<script type="text/javascript" src="<?php echo base_url(); ?>public/assets/js/common.js" charset="utf-8"></script>
<script src="https://cdn.datatables.net/plug-ins/1.10.16/sorting/datetime-moment.js"></script>
<script type="text/javascript">
<script src="https://cdn.datatables.net/plug-ins/1.10.16/sorting/datetime-moment.js"></script>
<!-- <script type="text/javascript">
$(function() {
$.fn.dataTable.moment('DD-MM-YYYY');
$('#configtable').DataTable({
@ -110,4 +164,84 @@
});
});
</script>
</script> -->
<script>
$(document).ready(function() {
$.fn.dataTable.ext.type.order['date-eu-pre'] = function(date) {
var dateSplit = date.split('-');
return (dateSplit[2] + dateSplit[1] + dateSplit[0]) * 1;
};
// Initialize the DataTable
var table = $('#configtable').DataTable({
"paging": true,
"lengthChange": true,
"searching": true,
"ordering": true,
"columnDefs": [{
"targets": 0,
"type": "date-eu"
}],
"aaSorting": [
[0, "desc"]
],
"info": true,
"autoWidth": true,
"pageLength": 10,
"lengthMenu": [10, 25, 50, 100],
});
// Initialize the datepickers
$("#fromDate").datepicker({
dateFormat: 'dd-mm-yy',
onSelect: function(selectedDate) {
var minDate = $(this).datepicker("getDate");
$("#toDate").datepicker("option", "minDate", minDate);
}
});
$("#toDate").datepicker({
dateFormat: 'dd-mm-yy',
onSelect: function(selectedDate) {
var maxDate = $(this).datepicker("getDate");
$("#fromDate").datepicker("option", "maxDate", maxDate);
}
});
// Reset button functionality
$("#resetButton").click(function() {
$("#fromDate").datepicker("setDate", null);
$("#toDate").datepicker("setDate", null);
$("#toDate").datepicker("option", "minDate", null);
$("#fromDate").datepicker("option", "maxDate", null);
table.draw();
});
// Date range filter
$.fn.dataTable.ext.search.push(
function(settings, data, dataIndex) {
var fromDate = $("#fromDate").datepicker("getDate");
var toDate = $("#toDate").datepicker("getDate");
var dateStr = data[0]; // Assuming the date is in the first column
// Convert dateStr to Date object
var dateParts = dateStr.split("-");
var date = new Date(dateParts[2], dateParts[1] - 1, dateParts[0]); // Convert dd-mm-yyyy to Date object
if (!fromDate || !toDate) {
return true; // No filter if dates are not selected
}
return date >= fromDate && date <= toDate;
}
);
// Handle form submission
$("#DateRangeFilter").submit(function(e) {
e.preventDefault();
table.draw();
});
});
</script>

View File

@ -1,4 +1,35 @@
<div class="content-wrapper">
<style>
.Date-filter-form {
display: flex;
align-items: center;
gap: 10px; /* Adjust the gap as needed */
}
.Date-filter-form input, .Date-filter-form button {
padding: 5px;
font-size: 14px;
}
.Date-filter-form button {
background-color: #007bff;
color: white;
border: none;
cursor: pointer;
}
.Date-filter-form button:hover {
background-color: #0056b3;
}
.icon-button {
background: none;
border: none;
cursor: pointer;
color: #007bff;
font-size: 18px;
}
.icon-button:hover {
color: #0056b3;
}
</style>
<div class="content-wrapper">
<section class="content">
<div class="box">
<div class="box-header">
@ -8,19 +39,31 @@
</div>
<div class="container-fluid">
<div class="row">
<div class="col-xs-12 text-right">
<div class="col-xs-12 col-md-6">
<form class="Date-filter-form" id="DateRangeFilter" >
<input type="hidden" name="table" value="requisition">
<label for="fromDate">From:</label>
<input type="text" id="fromDate" name="fromDate" placeholder="Select From Date" autocomplete="off" required>
<label for="toDate">To:</label>
<input type="text" id="toDate" name="toDate" placeholder="Select To Date" autocomplete="off" required>
<button type="submit">Search</button>
<i class="fa fa-repeat" aria-hidden="true" class="icon-button" id="resetButton" title="Reset"></i>
<div class="error" id="error"></div>
</form>
</div>
<div class="col-xs-12 col-md-6 text-right">
<div class="form-group">
<a data-toggle="modal" href="#ccwizard" data-id="0" data-name="" class="btn btn-success">Add New Cost List</a>
<a class="btn btn-success" href="<?php echo base_url(); ?>exportcost">Export Cost Details <i class="fa fa-download" aira-hidden="true"></i></a>
</div>
</div>
</div>
<div class="row">
<div class="col-xs-12">
<table id="datatable" class="table table-bordered table-hover" style="background-color:#fff;font-size:12px;">
<thead style="background-color: #ddd;">
<tr>
<th style="display:none;"></th>
<th>Create Date</th>
<th>Create Time</th>
<th>Cost Center Code</th>
@ -34,14 +77,11 @@
<?php
if (!empty($userRecords)) {
foreach ($userRecords as $record) {
$createdat = new DateTime($record->CreatedDate);
$date = $createdat->format('d-m-Y');
$time = $createdat->format('h:i A');
?>
<tr>
<td style="display:none;"><?php echo $record->CreatedDate ?></td>
<td align="right"><?php echo $date; ?></td>
<td align="right"><?php echo $time; ?></td>
<td><?php echo $record->code ?></td>
@ -123,22 +163,22 @@
<script type="text/javascript" src="<?php echo base_url(); ?>public/assets/js/common.js" charset="utf-8"></script>
<script src="https://cdn.datatables.net/plug-ins/1.10.16/sorting/datetime-moment.js"></script>
<script type="text/javascript">
$(function() {
$.fn.dataTable.moment('DD-MM-YYYY HH:mm A');
$('#datatable').DataTable({
"paging": true,
"lengthChange": true,
"searching": true,
"ordering": true,
// "columnDefs" : [{"targets":3, "type":"date-eu"}],
"aaSorting": [
[3, "desc"]
],
"info": true,
"autoWidth": true
// $(function() {
// $.fn.dataTable.moment('DD-MM-YYYY HH:mm A');
// $('#datatable').DataTable({
// "paging": true,
// "lengthChange": true,
// "searching": true,
// "ordering": true,
// // "columnDefs" : [{"targets":3, "type":"date-eu"}],
// "aaSorting": [
// [3, "desc"]
// ],
// "info": true,
// "autoWidth": true
});
});
// });
// });
</script>
<script>
@ -188,5 +228,84 @@
});
});
</script>
<script>
$(document).ready(function() {
$.fn.dataTable.ext.type.order['date-eu-pre'] = function (date) {
var dateSplit = date.split('-');
return (dateSplit[2] + dateSplit[1] + dateSplit[0]) * 1;
};
// Initialize the DataTable
var table = $('#datatable').DataTable({
"paging": true,
"lengthChange": true,
"searching": true,
"ordering": true,
"columnDefs": [{
"targets": 0,
"type": "date-eu"
}],
"aaSorting": [
[0, "desc"]
],
"info": true,
"autoWidth": true,
"pageLength": 10,
"lengthMenu": [10, 25, 50, 100],
});
// Initialize the datepickers
$("#fromDate").datepicker({
dateFormat: 'dd-mm-yy',
onSelect: function(selectedDate) {
var minDate = $(this).datepicker("getDate");
$("#toDate").datepicker("option", "minDate", minDate);
}
});
$("#toDate").datepicker({
dateFormat: 'dd-mm-yy',
onSelect: function(selectedDate) {
var maxDate = $(this).datepicker("getDate");
$("#fromDate").datepicker("option", "maxDate", maxDate);
}
});
// Reset button functionality
$("#resetButton").click(function() {
$("#fromDate").datepicker("setDate", null);
$("#toDate").datepicker("setDate", null);
$("#toDate").datepicker("option", "minDate", null);
$("#fromDate").datepicker("option", "maxDate", null);
table.draw();
});
// Date range filter
$.fn.dataTable.ext.search.push(
function(settings, data, dataIndex) {
var fromDate = $("#fromDate").datepicker("getDate");
var toDate = $("#toDate").datepicker("getDate");
var dateStr = data[0]; // Assuming the date is in the first column
// Convert dateStr to Date object
var dateParts = dateStr.split("-");
var date = new Date(dateParts[2], dateParts[1] - 1, dateParts[0]); // Convert dd-mm-yyyy to Date object
if (!fromDate || !toDate) {
return true; // No filter if dates are not selected
}
return date >= fromDate && date <= toDate;
}
);
// Handle form submission
$("#DateRangeFilter").submit(function(e) {
e.preventDefault();
table.draw();
});
});
</script>
<!-- <script src="https://cdn.datatables.net/plug-ins/1.10.11/sorting/date-eu.js"></script> -->

View File

@ -1,9 +1,46 @@
<script>
// (function(l,q){var e=function(b,c){b.extend(!0,c.defaults,{dom:"<'row'<'col-sm-9'l><'col-sm-3'f>><'row'<'col-sm-12'tr>><'row'<'col-sm-8'i><'col-sm-4'p>>",renderer:"bootstrap"});b.extend(c.ext.classes,{sWrapper:"dataTables_wrapper form-inline dt-bootstrap",sFilterInput:"form-control input-sm",sLengthSelect:"form-control input-sm"});c.ext.renderer.pageButton.bootstrap=function(g,e,r,s,i,m){var t=new c.Api(g),u=g.oClasses,j=g.oLanguage.oPaginate,d,f,n=0,p=function(c,e){var k,h,o,a,l=function(a){a.preventDefault();
// b(a.currentTarget).hasClass("disabled")||t.page(a.data.action).draw(!1)};k=0;for(h=e.length;k<h;k++)if(a=e[k],b.isArray(a))p(c,a);else{f=d="";switch(a){case "ellipsis":d="&hellip;";f="disabled";break;case "first":d=j.sFirst;f=a+(0<i?"":" disabled");break;case "previous":d=j.sPrevious;f=a+(0<i?"":" disabled");break;case "next":d=j.sNext;f=a+(i<m-1?"":" disabled");break;case "last":d=j.sLast;f=a+(i<m-1?"":" disabled");break;default:d=a+1,f=i===a?"active":""}d&&(o=b("<li>",{"class":u.sPageButton+" "+
// f,id:0===r&&"string"===typeof a?g.sTableId+"_"+a:null}).append(b("<a>",{href:"#","aria-controls":g.sTableId,"data-dt-idx":n,tabindex:g.iTabIndex}).html(d)).appendTo(c),g.oApi._fnBindAction(o,{action:a},l),n++)}},h;try{h=b(q.activeElement).data("dt-idx")}catch(l){}p(b(e).empty().html('<ul class="pagination"/>').children("ul"),s);h&&b(e).find("[data-dt-idx="+h+"]").focus()};c.TableTools&&(b.extend(!0,c.TableTools.classes,{container:"DTTT btn-group",buttons:{normal:"btn btn-default",disabled:"disabled"},
// collection:{container:"DTTT_dropdown dropdown-menu",buttons:{normal:"",disabled:"disabled"}},print:{info:"DTTT_print_info"},select:{row:"active"}}),b.extend(!0,c.TableTools.DEFAULTS.oTags,{collection:{container:"ul",button:"li",liner:"a"}}))};"function"===typeof define&&define.amd?define(["jquery","datatables"],e):"object"===typeof exports?e(require("jquery"),require("datatables")):jQuery&&e(jQuery,jQuery.fn.dataTable)})(window,document);
// (function(l,q){var e=function(b,c){b.extend(!0,c.defaults,{dom:"<'row'<'col-sm-9'l><'col-sm-3'f>><'row'<'col-sm-12'tr>><'row'<'col-sm-8'i><'col-sm-4'p>>",renderer:"bootstrap"});b.extend(c.ext.classes,{sWrapper:"dataTables_wrapper form-inline dt-bootstrap",sFilterInput:"form-control input-sm",sLengthSelect:"form-control input-sm"});c.ext.renderer.pageButton.bootstrap=function(g,e,r,s,i,m){var t=new c.Api(g),u=g.oClasses,j=g.oLanguage.oPaginate,d,f,n=0,p=function(c,e){var k,h,o,a,l=function(a){a.preventDefault();
// b(a.currentTarget).hasClass("disabled")||t.page(a.data.action).draw(!1)};k=0;for(h=e.length;k<h;k++)if(a=e[k],b.isArray(a))p(c,a);else{f=d="";switch(a){case "ellipsis":d="&hellip;";f="disabled";break;case "first":d=j.sFirst;f=a+(0<i?"":" disabled");break;case "previous":d=j.sPrevious;f=a+(0<i?"":" disabled");break;case "next":d=j.sNext;f=a+(i<m-1?"":" disabled");break;case "last":d=j.sLast;f=a+(i<m-1?"":" disabled");break;default:d=a+1,f=i===a?"active":""}d&&(o=b("<li>",{"class":u.sPageButton+" "+
// f,id:0===r&&"string"===typeof a?g.sTableId+"_"+a:null}).append(b("<a>",{href:"#","aria-controls":g.sTableId,"data-dt-idx":n,tabindex:g.iTabIndex}).html(d)).appendTo(c),g.oApi._fnBindAction(o,{action:a},l),n++)}},h;try{h=b(q.activeElement).data("dt-idx")}catch(l){}p(b(e).empty().html('<ul class="pagination"/>').children("ul"),s);h&&b(e).find("[data-dt-idx="+h+"]").focus()};c.TableTools&&(b.extend(!0,c.TableTools.classes,{container:"DTTT btn-group",buttons:{normal:"btn btn-default",disabled:"disabled"},
// collection:{container:"DTTT_dropdown dropdown-menu",buttons:{normal:"",disabled:"disabled"}},print:{info:"DTTT_print_info"},select:{row:"active"}}),b.extend(!0,c.TableTools.DEFAULTS.oTags,{collection:{container:"ul",button:"li",liner:"a"}}))};"function"===typeof define&&define.amd?define(["jquery","datatables"],e):"object"===typeof exports?e(require("jquery"),require("datatables")):jQuery&&e(jQuery,jQuery.fn.dataTable)})(window,document);
</script>
<style>
.Date-filter-form {
display: flex;
align-items: center;
gap: 10px;
/* Adjust the gap as needed */
}
.Date-filter-form input,
.Date-filter-form button {
padding: 5px;
font-size: 14px;
}
.Date-filter-form button {
background-color: #007bff;
color: white;
border: none;
cursor: pointer;
}
.Date-filter-form button:hover {
background-color: #0056b3;
}
.icon-button {
background: none;
border: none;
cursor: pointer;
color: #007bff;
font-size: 18px;
}
.icon-button:hover {
color: #0056b3;
}
</style>
<div class="content-wrapper">
<!-- Content Header (Page header) -->
<!-- <section class="content-header"> -->
@ -39,26 +76,42 @@
</div>
<div class="box">
<div class="box-header">
<center> <h3 class="box-title">Department Details</h3></center>
<center>
<h3 class="box-title">Department Details</h3>
</center>
</div>
<div class="container-fluid">
<!-- </section> -->
<!-- <section class="content"> -->
<div class="row">
<div class="col-xs-12 text-right">
<div class="col-xs-12 col-md-6">
<form class="Date-filter-form" id="DateRangeFilter">
<input type="hidden" name="table" value="requisition">
<label for="fromDate">From:</label>
<input type="text" id="fromDate" name="fromDate" placeholder="Select From Date" autocomplete="off" required>
<label for="toDate">To:</label>
<input type="text" id="toDate" name="toDate" placeholder="Select To Date" autocomplete="off" required>
<button type="submit">Search</button>
<i class="fa fa-repeat" aria-hidden="true" class="icon-button" id="resetButton" title="Reset"></i>
<div class="error" id="error"></div>
</form>
</div>
<div class="col-xs-12 col-md-6 text-right">
<div class="form-group">
<a class="btn btn-success" href="<?php echo base_url(); ?>adddepartment">Add New department</a>
<a class="btn btn-success" href="<?php echo base_url(); ?>exportdepartment">Export department details <i class="fa fa-download"aira-hidden="true"></i></a>
<a class="btn btn-success" href="<?php echo base_url(); ?>exportdepartment">Export department details <i class="fa fa-download" aira-hidden="true"></i></a>
</div>
</div>
</div>
<div class="row">
<div class="col-xs-12">
<table class="table table-bordered table-hover" id="datatable" style="background-color:#fff;font-size:12px;" >
<table class="table table-bordered table-hover" id="datatable" style="background-color:#fff;font-size:12px;">
<thead style="background-color: #ddd;">
<tr>
<th>Create Date</th>
<th>Department Code</th>
<th>Department Name</th>
<th>Head Department</th>
@ -68,18 +121,25 @@
</thead>
<tbody>
<?php
if(!empty($userRecords))
{
foreach($userRecords as $record)
{
if (!empty($userRecords)) {
foreach ($userRecords as $record) {
?>
<tr>
<!-- <td title=" - Click here to view department details"> </td> -->
<td><u><a href="<?php echo base_url().'editOlddepartment/?SID='.$record->DEPCode?>" data-toggle="tooltip" title="<?php echo $record->DEPCode ?> - Click here to view Department details"><?php echo $record->DEPCode; ?></a></u></td>
<?php if (date('d-m-Y', strtotime($record->CreatedDt)) == "30-11--0001") {
$cdate = '00-00-0000';
} else {
$cdate = date('d-m-Y', strtotime($record->CreatedDt));
} ?>
<td align="right"><?php echo $cdate; ?> </td>
<td><u><a href="<?php echo base_url() . 'editOlddepartment/?SID=' . $record->DEPCode ?>" data-toggle="tooltip" title="<?php echo $record->DEPCode ?> - Click here to view Department details"><?php echo $record->DEPCode; ?></a></u></td>
<td><?php echo $record->DepartmentName ?></td>
<td><?php echo $record->HeadDept ?></td>
<td><?php if($record->IsActive == 1){echo "Active";}
else { echo "In Active";} ?></td>
<td><?php if ($record->IsActive == 1) {
echo "Active";
} else {
echo "In Active";
} ?></td>
<!-- <td><a data-toggle="tooltip" "><i class="fa fa-pencil" data-toggle="tooltip" title="Click here to view/Edit the department details"></i>&nbsp;&nbsp;&nbsp;</a></td> -->
</tr>
@ -98,7 +158,7 @@
</div><!-- content wrapper div closed -->
<script type="text/javascript" src="<?php echo base_url(); ?>public/assets/js/common.js" charset="utf-8"></script>
<script type="text/javascript">
<!-- <script type="text/javascript">
$(function () {
@ -113,4 +173,84 @@
});
});
</script> -->
<script>
$(document).ready(function() {
$.fn.dataTable.ext.type.order['date-eu-pre'] = function(date) {
var dateSplit = date.split('-');
return (dateSplit[2] + dateSplit[1] + dateSplit[0]) * 1;
};
// Initialize the DataTable
var table = $('#datatable').DataTable({
"paging": true,
"lengthChange": true,
"searching": true,
"ordering": true,
"columnDefs": [{
"targets": 0,
"type": "date-eu"
}],
"aaSorting": [
[0, "desc"]
],
"info": true,
"autoWidth": true,
"pageLength": 10,
"lengthMenu": [10, 25, 50, 100],
});
// Initialize the datepickers
$("#fromDate").datepicker({
dateFormat: 'dd-mm-yy',
onSelect: function(selectedDate) {
var minDate = $(this).datepicker("getDate");
$("#toDate").datepicker("option", "minDate", minDate);
}
});
$("#toDate").datepicker({
dateFormat: 'dd-mm-yy',
onSelect: function(selectedDate) {
var maxDate = $(this).datepicker("getDate");
$("#fromDate").datepicker("option", "maxDate", maxDate);
}
});
// Reset button functionality
$("#resetButton").click(function() {
$("#fromDate").datepicker("setDate", null);
$("#toDate").datepicker("setDate", null);
$("#toDate").datepicker("option", "minDate", null);
$("#fromDate").datepicker("option", "maxDate", null);
table.draw();
});
// Date range filter
$.fn.dataTable.ext.search.push(
function(settings, data, dataIndex) {
var fromDate = $("#fromDate").datepicker("getDate");
var toDate = $("#toDate").datepicker("getDate");
var dateStr = data[0]; // Assuming the date is in the first column
// Convert dateStr to Date object
var dateParts = dateStr.split("-");
var date = new Date(dateParts[2], dateParts[1] - 1, dateParts[0]); // Convert dd-mm-yyyy to Date object
if (!fromDate || !toDate) {
return true; // No filter if dates are not selected
}
return date >= fromDate && date <= toDate;
}
);
// Handle form submission
$("#DateRangeFilter").submit(function(e) {
e.preventDefault();
table.draw();
});
});
</script>

View File

@ -1293,7 +1293,7 @@ foreach ($PaymentTerms as $TER) {
<th>SNo</th>
<th>Requisition No</th>
<th>Item Code</th>
<th>Item Description</th>
<th>Item Name</th>
<th>Quantity</th>
<th>UOM</th>
<th>Rate<?php echo $INRSYM ?></th>
@ -1331,7 +1331,7 @@ foreach ($PaymentTerms as $TER) {
<td align="left"><?php echo $index; ?></td>
<td><?php echo $record->ReqNo ?></td>
<td><?php echo $record->MaterialCode ?></td>
<td><?php echo $record->ServiceMaterialDescription ?></td>
<td><?php echo $record->MaterialName ?></td>
<td align="right"><?php echo $record->Quantity ?></td>
<td><?php echo $record->UOM ?></td>
<td align="right"><?php echo $record->Rate ?></td>
@ -1755,7 +1755,7 @@ foreach ($PaymentTerms as $TER) {
var cellval = tr.cells;
cellval[2].innerHTML = editMaterialCode;
cellval[3].innerHTML = materialspecialinstruction;
cellval[3].innerHTML = editDescription;
cellval[4].innerHTML = editQuantity;
cellval[5].innerHTML = editUOM;
cellval[6].innerHTML = parseFloat(itemRate).toFixed(2);

View File

@ -1,25 +1,67 @@
<style>
#datatable_filter{
#datatable_filter {
float: inline-end;
}
#datatable_wrapper .row .col-sm-4{
#datatable_wrapper .row .col-sm-4 {
flex-basis: 50%;
float: inline-end;
}
#datatable_paginate .pagination {
flex-basis: 50%;
float: inline-end;
margin:0 0 15px;
margin: 0 0 15px;
}
#datatable_wrapper .row:nth-child(3), #datatable_wrapper .row:nth-child(1){
#datatable_wrapper .row:nth-child(3),
#datatable_wrapper .row:nth-child(1) {
padding: 0 15px;
}
#datatable_info{
#datatable_info {
margin-top: 5px;
}
.dataTables_wrapper{
.dataTables_wrapper {
padding-bottom: 0;
}
.Date-filter-form {
display: flex;
align-items: center;
gap: 10px;
/* Adjust the gap as needed */
}
.Date-filter-form input,
.Date-filter-form button {
padding: 5px;
font-size: 14px;
}
.Date-filter-form button {
background-color: #007bff;
color: white;
border: none;
cursor: pointer;
}
.Date-filter-form button:hover {
background-color: #0056b3;
}
.icon-button {
background: none;
border: none;
cursor: pointer;
color: #007bff;
font-size: 18px;
}
.icon-button:hover {
color: #0056b3;
}
</style>
<div class="content-wrapper">
@ -29,12 +71,12 @@
<?php
helper('form');
$error = session()->getFlashdata('error');
if($error){
if ($error) {
$type = "error";
echo show_alert($type, $error);
}
$success = session()->getFlashdata('success');
if($success){
if ($success) {
$type = "success";
echo show_alert($type, $success);
}
@ -49,23 +91,39 @@
</div>
<div class="box">
<div class="box-header">
<CENTER><h3 class="box-title"> Employee Details</h3></CENTER>
<CENTER>
<h3 class="box-title"> Employee Details</h3>
</CENTER>
</div>
<div class="container-fluid">
<div class="row">
<div class="col-xs-12 text-right">
<div class="col-xs-12 col-md-6">
<form class="Date-filter-form" id="DateRangeFilter">
<input type="hidden" name="table" value="requisition">
<label for="fromDate">From:</label>
<input type="text" id="fromDate" name="fromDate" placeholder="Select From Date" autocomplete="off" required>
<label for="toDate">To:</label>
<input type="text" id="toDate" name="toDate" placeholder="Select To Date" autocomplete="off" required>
<button type="submit">Search</button>
<i class="fa fa-repeat" aria-hidden="true" class="icon-button" id="resetButton" title="Reset"></i>
<div class="error" id="error"></div>
</form>
</div>
<div class="col-xs-12 col-md-6 text-right">
<div class="form-group">
<a class="btn btn-success" href="<?php echo base_url(); ?>addemployee">Add New Employee</a>
<a class="btn btn-success" href="<?php echo base_url(); ?>exportemployee">Export Employee Details <i class="fa fa-download"aira-hidden="true"></i></a>
<a class="btn btn-success" href="<?php echo base_url(); ?>exportemployee">Export Employee Details <i class="fa fa-download" aira-hidden="true"></i></a>
</div>
</div>
</div>
<div class="row">
<div class="col-xs-12">
<table id="datatable" class="table table-hover table-bordered" style="background-color:#fff;font-size:12px;" >
<table id="datatable" class="table table-hover table-bordered" style="background-color:#fff;font-size:12px;">
<thead style="background-color: #ddd;">
<tr>
<th>Created Date</th>
<th>Emp ID</th>
<th>Employee Name</th>
<th>Contact Number</th>
@ -76,18 +134,22 @@
</thead>
<tbody>
<?php
if(!empty($userRecords))
{
foreach($userRecords as $record)
{
if (!empty($userRecords)) {
foreach ($userRecords as $record) {
?>
<tr>
<td><u><a class="a_tag_link" href="<?php echo base_url().'employeedetails/ViewEmployee/?EmpID='.$record->EmpID; ?>" data-toggle="tooltip" title="<?php echo $record->EmpID; ?> - Click here to view Employee details"><?php echo $record->EmpID ?> </a></u></td>
<?php if (date('d-m-Y', strtotime($record->Created_date)) == "30-11--0001") {
$cdate = '00-00-0000';
} else {
$cdate = date('d-m-Y', strtotime($record->Created_date));
} ?>
<td align="right"><?php echo $cdate; ?></td>
<td><u><a class="a_tag_link" href="<?php echo base_url() . 'employeedetails/ViewEmployee/?EmpID=' . $record->EmpID; ?>" data-toggle="tooltip" title="<?php echo $record->EmpID; ?> - Click here to view Employee details"><?php echo $record->EmpID ?> </a></u></td>
<td><?php echo $record->FirstName; ?></td>
<td><?php echo $record->ContactNumber ?></td>
<td><?php echo $record->Designation ?></td>
<td><?php echo $record->DepartmentName ?></td>
<td><?php echo ($record->IsActive == 1)? ' Active ' : ' In Active ' ; ?></td>
<td><?php echo ($record->IsActive == 1) ? ' Active ' : ' In Active '; ?></td>
</tr>
<?php
}
@ -106,7 +168,7 @@
</div>
<script type="text/javascript" src="<?php echo base_url(); ?>public/assets/js/common.js" charset="utf-8"></script>
<script type="text/javascript">
<!-- <script type="text/javascript">
$(function () {
@ -123,4 +185,84 @@
});
});
</script> -->
<script>
$(document).ready(function() {
$.fn.dataTable.ext.type.order['date-eu-pre'] = function(date) {
var dateSplit = date.split('-');
return (dateSplit[2] + dateSplit[1] + dateSplit[0]) * 1;
};
// Initialize the DataTable
var table = $('#datatable').DataTable({
"paging": true,
"lengthChange": true,
"searching": true,
"ordering": true,
"columnDefs": [{
"targets": 0,
"type": "date-eu"
}],
"aaSorting": [
[0, "desc"]
],
"info": true,
"autoWidth": true,
"pageLength": 10,
"lengthMenu": [10, 25, 50, 100],
});
// Initialize the datepickers
$("#fromDate").datepicker({
dateFormat: 'dd-mm-yy',
onSelect: function(selectedDate) {
var minDate = $(this).datepicker("getDate");
$("#toDate").datepicker("option", "minDate", minDate);
}
});
$("#toDate").datepicker({
dateFormat: 'dd-mm-yy',
onSelect: function(selectedDate) {
var maxDate = $(this).datepicker("getDate");
$("#fromDate").datepicker("option", "maxDate", maxDate);
}
});
// Reset button functionality
$("#resetButton").click(function() {
$("#fromDate").datepicker("setDate", null);
$("#toDate").datepicker("setDate", null);
$("#toDate").datepicker("option", "minDate", null);
$("#fromDate").datepicker("option", "maxDate", null);
table.draw();
});
// Date range filter
$.fn.dataTable.ext.search.push(
function(settings, data, dataIndex) {
var fromDate = $("#fromDate").datepicker("getDate");
var toDate = $("#toDate").datepicker("getDate");
var dateStr = data[0]; // Assuming the date is in the first column
// Convert dateStr to Date object
var dateParts = dateStr.split("-");
var date = new Date(dateParts[2], dateParts[1] - 1, dateParts[0]); // Convert dd-mm-yyyy to Date object
if (!fromDate || !toDate) {
return true; // No filter if dates are not selected
}
return date >= fromDate && date <= toDate;
}
);
// Handle form submission
$("#DateRangeFilter").submit(function(e) {
e.preventDefault();
table.draw();
});
});
</script>

View File

@ -87,7 +87,6 @@
</section>
<section class="content" style="margin: 15px;"><br />
<div style="border:2px solid #333;">
<form action="<?php echo base_url() ?>SaveIGR" method="post" enctype="multipart/form-data">
<div class="row"><br /><br />
<div id="content"> </div>
@ -462,6 +461,7 @@
$('#txtRowCount').val('');
var id = $('#PONO').val();
var status = '';
var isOpenOrder = 0;
if (id != '-1') {
$('#content').loader('show');
var y = <?php echo json_encode($PO_NO, JSON_PRETTY_PRINT) ?>;
@ -473,7 +473,7 @@
$("#po").val(obj.PONO);
$("#Sup").val(obj.SupplierName);
$("#hiddenIsOpenOrder").val(obj.IsOpenOrder);
var isOpenOrder = parseInt(obj.IsOpenOrder, 2);
isOpenOrder = parseInt(obj.IsOpenOrder ? obj.IsOpenOrder : "0", 2);
var formatted_IsOpenOrder = (isOpenOrder === 0 || isNaN(isOpenOrder)) ? "" : "Open";
$('.help-block').text(formatted_IsOpenOrder);
var button_text_for_IGRDraftLink = (isOpenOrder === 0 || isNaN(isOpenOrder)) ? "Save as Draft IGR" : "Save as Open IGR";
@ -510,7 +510,7 @@
'<td name="UOM">' + item.UOM + '</td>' +
'<td name="Quantity1' + i + '" id="Quantity_1' + i + '">' + item.Quantity + '</td>' +
'<td name="ReceivedQuantity' + i + '" id="ReceivedQuantity' + i + '">' + item.ReceivedQuantity + '</td>' +
'<td name="PendingQuantity' + i + '" id="PendingQuantity' + i + '">' + item.PendingQty + '</td>' +
'<td name="PendingQuantity' + i + '" id="PendingQuantity' + i + '">' + ((isOpenOrder === 0 || isNaN(isOpenOrder)) ? item.PendingQty : 0 ) + '</td>' +
'<td data-name="sel" ><input type="text" onchange="validateReceivedQuantity(' + i + ')"id="QuantityAsPerInvoice' + i + '" name="QuantityAsPerInvoice' + i + '" value="" onkeypress="return isNumberKey(event);" autocomplete="off"></td>' +
'<td><input type="text" id="Remark' + i + '" name="Remark' + i + '" class="form" onchange="SetRemarks(' + i + ')" autocomplete="off"> </td>' +
'<td><a target="_blank" data-toggle="modal" data-target="#WeightCalculator" title="Weight Calculator" data-index="' + i + '" data-material="' + item.MaterialName + '"><i class="fa fa-solid fa-truck" style="text-align: center;"></i></a> </td>' +
@ -554,7 +554,7 @@
type: 'hidden',
id: 'txtPendingQty' + i,
name: 'txtPendingQty' + i,
value: item.PendingQty
value: ((isOpenOrder === 0 || isNaN(isOpenOrder)) ? item.PendingQty : 0 )
}).appendTo('form');
$('<input>').attr({
@ -673,8 +673,11 @@
// InvoiceQty
return true;
}}else{
console.log(InvoiceQty + RecQty);
$('#PendingQuantity' + Rowid).text(0.00);
$('#txtPendingQty' + Rowid).val(0.00);
$("#txtQuantityAsPerInvoice" + Rowid).val(0.00);
$("#ReceivedQuantity" + Rowid).val(InvoiceQty + RecQty);
$("#txtQuantityAsPerInvoice" + Rowid).val((InvoiceQty + RecQty));
// InvoiceQty
return true;
}

View File

@ -764,7 +764,8 @@
<td class="text-right" style="border:0em;"><?php echo number_alignment(abs(array_sum($igst))); ?></td>
</tr>
<?php if(isset($reveuetax)){ ?>
<?php $AfterPackagingValue = []; $AfterFreightValue= []; $AfterDiscount =[];
if(isset($reveuetax)){ ?>
<?php foreach ($reveuetax as $key => $value) {
$AfterPackagingValue[] = isset($value->AfterPackagingValue) ? $value->AfterPackagingValue : 0.00;

View File

@ -1,69 +1,131 @@
<?php
//echo "OUTIF";
if(empty($Status))
{
if (empty($Status)) {
//echo "INIF";
//print_r($Status);
}
?>
<style>
.table-bordered>thead>tr>th, .table-bordered>tbody>tr>th, .table-bordered>tfoot>tr>th, .table-bordered>thead>tr>td, .table-bordered>tbody>tr>td, .table-bordered>tfoot>tr>td {border: 1px solid #333;}
.modal-content {
width:1000px ! important;
.table-bordered>thead>tr>th,
.table-bordered>tbody>tr>th,
.table-bordered>tfoot>tr>th,
.table-bordered>thead>tr>td,
.table-bordered>tbody>tr>td,
.table-bordered>tfoot>tr>td {
border: 1px solid #333;
}
.modal
{
padding-right:25% ! important;
.modal-content {
width: 1000px ! important;
}
#Requisition_filter{
.modal {
padding-right: 25% ! important;
}
#Requisition_filter {
float: inline-end;
}
#Requisition_wrapper .row .col-sm-4{
#Requisition_wrapper .row .col-sm-4 {
flex-basis: 50%;
float: inline-end;
}
#Requisition_paginate .pagination {
flex-basis: 50%;
float: inline-end;
margin:0 0 15px;
margin: 0 0 15px;
}
#Requisition_wrapper .row:nth-child(3), #Requisition_wrapper .row:nth-child(1){
#Requisition_wrapper .row:nth-child(3),
#Requisition_wrapper .row:nth-child(1) {
padding: 0 15px;
}
#Requisition_info{
#Requisition_info {
margin-top: 5px;
}
.dataTables_wrapper{
.dataTables_wrapper {
padding-bottom: 0;
}
</style>
<style>
.Date-filter-form {
display: flex;
align-items: center;
gap: 10px;
/* Adjust the gap as needed */
}
.Date-filter-form input,
.Date-filter-form button {
padding: 5px;
font-size: 14px;
}
.Date-filter-form button {
background-color: #007bff;
color: white;
border: none;
cursor: pointer;
}
.Date-filter-form button:hover {
background-color: #0056b3;
}
.icon-button {
background: none;
border: none;
cursor: pointer;
color: #007bff;
font-size: 18px;
}
.icon-button:hover {
color: #0056b3;
}
</style>
<div class="content-wrapper">
<section class="content">
<div class="box">
<div class="box-header">
<CENTER><h3 class="box-title">Purchase Order Approve List </h3></CENTER>
<CENTER>
<h3 class="box-title">Purchase Order Approve List </h3>
</CENTER>
</div>
<div class="container-fluid">
<form class="Date-filter-form" id="DateRangeFilter">
<input type="hidden" name="table" value="requisition">
<label for="fromDate">From:</label>
<input type="text" id="fromDate" name="fromDate" placeholder="Select From Date" autocomplete="off" required>
<label for="toDate">To:</label>
<input type="text" id="toDate" name="toDate" placeholder="Select To Date" autocomplete="off" required>
<button type="submit">Search</button>
<i class="fa fa-repeat" aria-hidden="true" class="icon-button" id="resetButton" title="Reset"></i>
<div class="error" id="error"></div>
</form>
<table id="Requisition" class="table table-hover" style="background-color:#fff;font-size:12px;">
<thead style="background-color: #ddd;">
<tr>
<th>PO Date</th>
<th>Purchase Order Number</th>
<th>Purchase Order Type</th>
<th>Cost Center Name</th>
<th>Supplier Name</th>
<th>Created By</th>
<th>Department</th>
<th>Created Date</th>
<!-- <th>Created Date</th> -->
<th>Total Order Value</th>
<th>Approved By</th>
@ -77,38 +139,36 @@ if(empty($Status))
<tbody id="ApprovalList">
<?php
if(!empty($AppList))
{
if (!empty($AppList)) {
$index = 0;
foreach($AppList as $record)
{
$index = $index +1;
foreach ($AppList as $record) {
$index = $index + 1;
//echo $index;
?>
<tr id="<?php echo $index ?>" >
<td><a target="_blank" href="<?php echo base_url() ?>purchaseorder/CreatePOPrint?PONO=<?php echo $record->PONO ?>&ReqType=<?php echo $record->RType ?>" data-id="<%=index%>" data-userid="<?php echo $record->PONO ?>" ><u><?php echo $record->PONO ?> </td>
<tr id="<?php echo $index ?>">
<td align="right" style="width:75px"><?php $podt = new DateTime($record->PODate);
$PODate = $podt->format('d-m-Y');
echo $PODate;
?></td>
<td><a target="_blank" href="<?php echo base_url() ?>purchaseorder/CreatePOPrint?PONO=<?php echo $record->PONO ?>&ReqType=<?php echo $record->RType ?>" data-id="<%=index%>" data-userid="<?php echo $record->PONO ?>"><u><?php echo $record->PONO ?> </td>
<td><?php echo $record->RType ?> </td>
<td><?php echo $record->CostCenterName ?> </td>
<!-- <td><?php // echo $record->CostCenterCode?></td> -->
<!-- <td><?php // echo $record->CostCenterCode
?></td> -->
<td><?php echo $record->SupplierName ?></td>
<td><?php echo $record->FirstName ?></td>
<td><?php echo $record->DepartmentName?></td>
<td align="right"><?php $Cdt = new DateTime($record->CreatedDate);
$CreatedDate = $Cdt->format('d-m-Y');
echo $CreatedDate;
?></td>
<td><?php echo $record->DepartmentName ?></td>
<!-- <td align="right"><?php // $Cdt = new DateTime($record->CreatedDate);
// $CreatedDate = $Cdt->format('d-m-Y');
// echo $CreatedDate;
?></td> -->
<td align="right"><?php echo $record->TotalOrderValue ?></td>
<td><?php echo $record->Approver?></td>
<td><?php echo $record->Approver ?></td>
<td><?php
$statusMappings = [
'PO APPROVED' => 'AWAITING APPROVE',
@ -134,29 +194,29 @@ if(empty($Status))
<?php
// if($record->StatusName == 'RELEASER ONHOLD' or $record->StatusName == 'AWAITING RELEASE' or $record->StatusName == 'AMENDMENT PO'){
if($record->StatusCode == PO_APPROVER_ONHOLD or $record->StatusCode == PO_CREATED or $record->StatusCode == REQITEM_Emergency_PO_CREATED ){
if ($record->StatusCode == PO_APPROVER_ONHOLD or $record->StatusCode == PO_CREATED or $record->StatusCode == REQITEM_Emergency_PO_CREATED) {
?>
<td>
<select name="selectId" id="selectId" onchange="showvalue('<?php echo $record->PONO ?>','<?php echo $index ; ?>',this.options[this.selectedIndex].value,'<?php echo $record->Remarks ?>');">
<option value="-1" >Select Action</option>
<select name="selectId" id="selectId" onchange="showvalue('<?php echo $record->PONO ?>','<?php echo $index; ?>',this.options[this.selectedIndex].value,'<?php echo $record->Remarks ?>');">
<option value="-1">Select Action</option>
<!-- <option value="1">Release</option> -->
<option value="1">Approve And Release</option>
<option value="2">OnHold</option>
</select>
</td>
<?php }else{
<?php } else {
echo "<td><center>-</center></td>";
}?>
} ?>
<td contenteditable="true" id="remarks<?php echo $index ; ?>"><?php
<td contenteditable="true" id="remarks<?php echo $index; ?>"><?php
if($record->Remarks == ''){
}
else{ echo $record->Remarks; }?></td>
if ($record->Remarks == '') {
} else {
echo $record->Remarks;
} ?></td>
</tr>
@ -164,7 +224,6 @@ if(empty($Status))
<?php
}
}
?>
@ -182,90 +241,78 @@ if(empty($Status))
</section>
</div>
<script>
function showvalue(PONO,value,Status,Remark)
{
var Remarks='';
var curtremarks=document.getElementById('remarks'+value+'').innerHTML;
<script>
function showvalue(PONO, value, Status, Remark) {
var Remarks = '';
var curtremarks = document.getElementById('remarks' + value + '').innerHTML;
//var curtremarks = curtremarks.trim();
var PO=PONO;
var Status=Status;
var StatusCode='';
var srtMsg='';
var PO = PONO;
var Status = Status;
var StatusCode = '';
var srtMsg = '';
if((curtremarks == '<br>' || curtremarks == '') && Remark == ''){
Remarks='';
if ((curtremarks == '<br>' || curtremarks == '') && Remark == '') {
Remarks = '';
//alert("To Store both empty:-" + Remarks)
}
else if((curtremarks != '' && Remark == ''))
{
Remarks=curtremarks;
} else if ((curtremarks != '' && Remark == '')) {
Remarks = curtremarks;
//alert("To Store current empty:-" + Remarks)
}
else if((Remark != '') && (curtremarks == '' || curtremarks == '<br>'))
{
Remarks=Remark;
} else if ((Remark != '') && (curtremarks == '' || curtremarks == '<br>')) {
Remarks = Remark;
//alert("To Store current empty:-" + Remarks)
}
else{
Remarks=Remark+"||"+curtremarks;
} else {
Remarks = Remark + "||" + curtremarks;
//alert("To Store both:-" + Remarks)
}
//alert(PO+"-"+Status+"-"+StatusCode);
if(Status != '-1'){
if(Status == '1'){
if (Status != '-1') {
if (Status == '1') {
// var strMsg='Do you want to Release this Purchase Order?'
var strMsg='Do you want to Approve and Release this Purchase Order?'
var StatusCode='ST026';
var strMsg = 'Do you want to Approve and Release this Purchase Order?'
var StatusCode = 'ST026';
//alert(StatusCode);
}
else if(Status == '2')
{
var strMsg='Do you want to put Hold this Purchase Order?';
var StatusCode='ST052';
} else if (Status == '2') {
var strMsg = 'Do you want to put Hold this Purchase Order?';
var StatusCode = 'ST052';
//alert(StatusCode);
}
/* MSG*/
var answer = confirm(strMsg);
if (answer)
{
if (answer) {
$('#content').loader('show');
$.ajax({
data:{PONO:PO,SCode:StatusCode,NewRemarks:Remarks},
type:"POST",
url:"<?php echo base_url() ?>purchaseorder/ReleasePO",
success:function(data) {
if(data)
{
data: {
PONO: PO,
SCode: StatusCode,
NewRemarks: Remarks
},
type: "POST",
url: "<?php echo base_url() ?>purchaseorder/ReleasePO",
success: function(data) {
if (data) {
$('#content').loader('hide');
alert(data);
location.reload();
}
else
{
} else {
alert("Error");
}
}
});
});
}
else
{
return;
}
} else {
return;
}
/* MSG*/
} else {
alert('please Select Status!');
}
else
{
alert('please Select Status!');
}
} //End of showvalue function for approve/hold po status
@ -276,13 +323,12 @@ alert('please Select Status!');
var startDate = '';
var endDate = '';
function Reset()
{
function Reset() {
$('#RequisitionStatus').val("-1");
$('#SearchDate').val('');
}
<!-- JQuery For POP UP and Getting all relevant Data -->
$("#myModal").on("shown.bs.modal", function(e) {
}
// <!--JQuery For POP UP and Getting all relevant Data-- >
$("#myModal").on("shown.bs.modal", function(e) {
var ReqId = $(e.relatedTarget).data('userid');
$("#RequistionNo").val('');
$("#drpSupplier").val('');
@ -305,15 +351,17 @@ $("#myModal").on("shown.bs.modal", function(e) {
$("#txtTotalOtherTaxes").val('');
$("#txtTotalOrderValueSummary").val('');
$("#txtSpcialInstruction").val('');
$('#AlertImg').attr("style","display:none;");
$('#AlertImg').attr("style", "display:none;");
$('#content').loader('show');
$.ajax({
data:{id:ReqId},
type:"POST",
data: {
id: ReqId
},
type: "POST",
dataType: 'json',
url:"<?php echo base_url() ?>requisitionform/ViewRequest",
success:function(json) {
url: "<?php echo base_url() ?>requisitionform/ViewRequest",
success: function(json) {
// success:function(data) {
$('#content').loader('hide');
//alert(data);
@ -328,25 +376,28 @@ $("#myModal").on("shown.bs.modal", function(e) {
}
});
});
});
});
function printpdf(PONO,value,Status) {
function printpdf(PONO, value, Status) {
var PONO =PONO;
var PONO = PONO;
var Status = Status;
var value = value;
alert(PONO+Status+value);
alert(PONO + Status + value);
if(PONO != '' && Status != '' && value != ''){
alert('inside if '+PONO+Status+value);
if (PONO != '' && Status != '' && value != '') {
alert('inside if ' + PONO + Status + value);
$.ajax({
data:{PONO1:PONO,Status1:Status},
type:"POST",
url:"<?php echo base_url() ?>purchaseorder/Poprintpdf",
data: {
PONO1: PONO,
Status1: Status
},
type: "POST",
url: "<?php echo base_url() ?>purchaseorder/Poprintpdf",
/*success:function(data) {
if(data)
{
@ -360,44 +411,42 @@ function printpdf(PONO,value,Status) {
}*/
});
});
} else {
alert('inside else ' + PONO + Status + value);
}
else{
alert('inside else '+PONO+Status+value);
}
}
$(function() {
$(function() {
var d = new Date();
var month = d.getMonth();
var day = d.getDate();
var year = d.getFullYear() ;
var year = d.getFullYear();
var SIAStartYear = year - 2015;
var mindt = year-70;
var maxdt = year-15;
$( ".datePicker" ).datepicker(
{
minDate : new Date(year-SIAStartYear,1,1),
maxDate :'now',
dateFormat: 'mm/dd/yy',changeMonth: true, changeYear: true,
}
);
var mindt = year - 70;
var maxdt = year - 15;
$(".datePicker").datepicker({
minDate: new Date(year - SIAStartYear, 1, 1),
maxDate: 'now',
dateFormat: 'mm/dd/yy',
changeMonth: true,
changeYear: true,
});
//$('#SearchDate').daterangepicker( );
//Initialize Select2 Elements
$(".select2").select2();
//$('#SearchDate').val('');
$('#SearchDate').daterangepicker(
{
$('#SearchDate').daterangepicker({
locale: {
format: 'DD-MM-YYYY'
},
showDropdowns: true
},
function(start, end, label) {
},
function(start, end, label) {
startDate = start.format('DD-MM-YYYY');
endDate = end.format('DD-MM-YYYY');
@ -406,12 +455,12 @@ function(start, end, label) {
//alert("A new date range was chosen: " + start.format('DD-MM-YYYY') + ' to ' + end.format('DD-MM-YYYY'));
});
});
});
$(function () {
});
$(function() {
$('#Items').DataTable({
"paging": false,
@ -423,24 +472,104 @@ $(function () {
});
$.fn.dataTable.moment( 'DD-MM-YYYY' );
$('#Requisition').DataTable({
columnDefs: [{ width: 200}],
fixedColumns: true,
paging: true,
lengthChange: true,
searching: true,
ordering: true,
aaSorting: [[ 6, "desc" ]],
$.fn.dataTable.moment('DD-MM-YYYY');
// $('#Requisition').DataTable({
// columnDefs: [{ width: 200}],
// fixedColumns: true,
// paging: true,
// lengthChange: true,
// searching: true,
// ordering: true,
// aaSorting: [[ 0, "desc" ]],
info: true,
autoWidth: true,
pageLength: 10,
lengthMenu: [10, 25, 50, 100]
// info: true,
// autoWidth: true,
// pageLength: 10,
// lengthMenu: [10, 25, 50, 100]
// });
});
});
</script>
</script>
<script src="https://cdn.datatables.net/plug-ins/1.10.16/sorting/datetime-moment.js"></script>
<script>
$.fn.dataTable.ext.type.order['date-eu-pre'] = function(date) {
var dateSplit = date.split('/');
return (dateSplit[2] + dateSplit[1] + dateSplit[0]) * 1;
};
$(document).ready(function() {
// Initialize the DataTable
var table = $('#Requisition').DataTable({
"paging": true,
"lengthChange": true,
"searching": true,
"ordering": true,
"columnDefs": [{
"targets": 0,
"type": "date-eu"
}],
"aaSorting": [
[0, "desc"]
],
"info": true,
"autoWidth": true,
"pageLength": 10,
"lengthMenu": [10, 25, 50, 100],
});
// Initialize the datepickers
$("#fromDate").datepicker({
dateFormat: 'dd-mm-yy',
onSelect: function(selectedDate) {
var minDate = $(this).datepicker("getDate");
$("#toDate").datepicker("option", "minDate", minDate);
}
});
$("#toDate").datepicker({
dateFormat: 'dd-mm-yy',
onSelect: function(selectedDate) {
var maxDate = $(this).datepicker("getDate");
$("#fromDate").datepicker("option", "maxDate", maxDate);
}
});
// Reset button functionality
$("#resetButton").click(function() {
$("#fromDate").datepicker("setDate", null);
$("#toDate").datepicker("setDate", null);
$("#toDate").datepicker("option", "minDate", null);
$("#fromDate").datepicker("option", "maxDate", null);
table.draw();
});
// Date range filter
$.fn.dataTable.ext.search.push(
function(settings, data, dataIndex) {
var fromDate = $("#fromDate").datepicker("getDate");
var toDate = $("#toDate").datepicker("getDate");
var dateStr = data[0]; // Assuming the date is in the first column
// Convert dateStr to Date object
var dateParts = dateStr.split("-");
var date = new Date(dateParts[2], dateParts[1] - 1, dateParts[0]); // Convert dd-mm-yyyy to Date object
if (!fromDate || !toDate) {
return true; // No filter if dates are not selected
}
return date >= fromDate && date <= toDate;
}
);
// Handle form submission
$("#DateRangeFilter").submit(function(e) {
e.preventDefault();
table.draw();
});
});
</script>

View File

@ -1,16 +1,52 @@
<style>
.Date-filter-form {
display: flex;
align-items: center;
gap: 10px;
/* Adjust the gap as needed */
}
.Date-filter-form input,
.Date-filter-form button {
padding: 5px;
font-size: 14px;
}
.Date-filter-form button {
background-color: #007bff;
color: white;
border: none;
cursor: pointer;
}
.Date-filter-form button:hover {
background-color: #0056b3;
}
.icon-button {
background: none;
border: none;
cursor: pointer;
color: #007bff;
font-size: 18px;
}
.icon-button:hover {
color: #0056b3;
}
</style>
<div class="content-wrapper">
<div class="row">
<div class="row">
<div class="col-md-12">
<?php
helper('form');
$error = session()->getFlashdata('error');
if($error){
if ($error) {
$type = "error";
echo show_alert($type, $error);
}
$success = session()->getFlashdata('success');
if($success){
if ($success) {
$type = "success";
echo show_alert($type, $success);
}
@ -26,24 +62,39 @@
<section class="content">
<div class="box">
<div class="box-header">
<CENTER><h3 class="box-title"> Material Master Details</h3></CENTER>
<CENTER>
<h3 class="box-title"> Material Master Details</h3>
</CENTER>
</div>
<div class="container-fluid">
<div class="row">
<div class="col-xs-12 text-right">
<div class="col-xs-12 col-md-6">
<form class="Date-filter-form" id="DateRangeFilter">
<input type="hidden" name="table" value="requisition">
<label for="fromDate">From:</label>
<input type="text" id="fromDate" name="fromDate" placeholder="Select From Date" autocomplete="off" required>
<label for="toDate">To:</label>
<input type="text" id="toDate" name="toDate" placeholder="Select To Date" autocomplete="off" required>
<button type="submit">Search</button>
<i class="fa fa-repeat" aria-hidden="true" class="icon-button" id="resetButton" title="Reset"></i>
<div class="error" id="error"></div>
</form>
</div>
<div class="col-xs-12 col-md-6 text-right">
<div class="form-group">
<a class="btn btn-success" href="<?php echo base_url(); ?>addRawmaterial">Add New Material</a>
<a class="btn btn-success" href="<?php echo base_url(); ?>exportmaterial">Export Material Master <i class="fa fa-download"aira-hidden="true"></i></a>
<a class="btn btn-success" href="<?php echo base_url(); ?>exportmaterial">Export Material Master <i class="fa fa-download" aira-hidden="true"></i></a>
</div>
</div>
</div>
<div class="row">
<div class="col-xs-12">
<table id="datatable" class="table table-hover table-bordered" style="background-color:#fff;font-size:12px;" >
<table id="datatable" class="table table-hover table-bordered" style="background-color:#fff;font-size:12px;">
<thead style="background-color: #ddd;">
<tr>
<th style="display: none;"></th>
<th>Created On</th>
<th>Created Date</th>
<th>Material Code</th>
<th>Material Description</th>
<th>Type of Material</th>
@ -55,25 +106,26 @@
</thead>
<tbody>
<?php
if(!empty($userRecords))
{
foreach($userRecords as $record)
{
$date=date("Y-m-d");
if (!empty($userRecords)) {
foreach ($userRecords as $record) {
$date = date("Y-m-d");
?>
<tr>
<td style="display: none;"><?php echo $record->CreatedDate; ?></td>
<td style="width:8%;"><?php echo format_date($record->CreatedDate,0,'d/m/Y') ?></td>
<td style="width:9%;"><u><a class="a_tag_link" href="<?php echo base_url().'viewRawmaterial?RID='.$record->MaterialCode.'&MType='.$record->MaterialType.'&UOM='.$record->UOM.'&date1='.$date ?>" data-toggle="tooltip" title="<?php echo $record->MaterialCode; ?> - Click here to view Material details"><?php echo $record->MaterialCode ?> </a></u></td>
<?php if (date('d-m-Y', strtotime($record->CreatedDate)) == "30-11--0001") {
$cdate = '00-00-0000';
} else {
$cdate = date('d-m-Y', strtotime($record->CreatedDate));
} ?>
<td style="width:8%;" align="right"><?php echo $cdate; ?></td>
<td style="width:9%;"><u><a class="a_tag_link" href="<?php echo base_url() . 'viewRawmaterial?RID=' . $record->MaterialCode . '&MType=' . $record->MaterialType . '&UOM=' . $record->UOM . '&date1=' . $date ?>" data-toggle="tooltip" title="<?php echo $record->MaterialCode; ?> - Click here to view Material details"><?php echo $record->MaterialCode ?> </a></u></td>
<td style="width:12%;"><?php echo $record->MaterialName ?></td>
<td style="width:10%;"><?php echo $record->MaterialType ?></td>
<td style="width:7%;"><?php echo $record->UOM ?></td>
<?php if($record->stock != null || ''){?>
<td style="width:7%;"><?php echo $record->stock?></td>
<?php } else{?>
<?php if ($record->stock != null || '') { ?>
<td style="width:7%;"><?php echo $record->stock ?></td>
<?php } else { ?>
<td style="width:7%;">0</td>
<?php }?>
<?php } ?>
<td style="width:11%;"><?php echo $record->Category ?></td>
<td style="width:8%;"><?php echo $record->HSNCODE ?></td>
</tr>
@ -90,7 +142,7 @@
</section>
</div>
<script type="text/javascript" src="<?php echo base_url(); ?>public/assets/js/common.js" charset="utf-8"></script>
<script type="text/javascript">
<!-- <script type="text/javascript">
$(function () {
@ -106,4 +158,84 @@
});
});
</script> -->
<script>
$.fn.dataTable.ext.type.order['date-eu-pre'] = function(date) {
var dateSplit = date.split('-');
return (dateSplit[2] + dateSplit[1] + dateSplit[0]) * 1;
};
$(document).ready(function() {
// Initialize the DataTable
var table = $('#datatable').DataTable({
"paging": true,
"lengthChange": true,
"searching": true,
"ordering": true,
"columnDefs": [{
"targets": 0,
"type": "date-eu"
}],
"aaSorting": [
[0, "desc"]
],
"info": true,
"autoWidth": true,
"pageLength": 10,
"lengthMenu": [10, 25, 50, 100],
});
// Initialize the datepickers
$("#fromDate").datepicker({
dateFormat: 'dd-mm-yy',
onSelect: function(selectedDate) {
var minDate = $(this).datepicker("getDate");
$("#toDate").datepicker("option", "minDate", minDate);
}
});
$("#toDate").datepicker({
dateFormat: 'dd-mm-yy',
onSelect: function(selectedDate) {
var maxDate = $(this).datepicker("getDate");
$("#fromDate").datepicker("option", "maxDate", maxDate);
}
});
// Reset button functionality
$("#resetButton").click(function() {
$("#fromDate").datepicker("setDate", null);
$("#toDate").datepicker("setDate", null);
$("#toDate").datepicker("option", "minDate", null);
$("#fromDate").datepicker("option", "maxDate", null);
table.draw();
});
// Date range filter
$.fn.dataTable.ext.search.push(
function(settings, data, dataIndex) {
var fromDate = $("#fromDate").datepicker("getDate");
var toDate = $("#toDate").datepicker("getDate");
var dateStr = data[0]; // Assuming the date is in the first column
// Convert dateStr to Date object
var dateParts = dateStr.split("-");
var date = new Date(dateParts[2], dateParts[1] - 1, dateParts[0]); // Convert dd-mm-yyyy to Date object
if (!fromDate || !toDate) {
return true; // No filter if dates are not selected
}
return date >= fromDate && date <= toDate;
}
);
// Handle form submission
$("#DateRangeFilter").submit(function(e) {
e.preventDefault();
table.draw();
});
});
</script>

View File

@ -1,9 +1,9 @@
<?php
$insuranceStatus = array(
array("name" => "NO", "value" => "0"), array("name" => "YES", "value" => "1")
array("name" => "NO", "value" => "0"),
array("name" => "YES", "value" => "1")
);
$ReqType = '';
$CompanyAddress = '';
$dt = new DateTime('now', new DateTimeZone('Asia/Kolkata'));
@ -26,9 +26,7 @@ if (!empty($AvlBudAmt)) {
$AvlAmount = number_format($AvlBudAmt, 2, '.', '');
}
if (!empty($INRSYMBOL)) {
foreach ($INRSYMBOL as $INRS) {
$INRSYM = $INRS->FontCode2000;
}
@ -94,9 +92,6 @@ if (!empty($INRSYMBOL)) {
yearRange: '0:+10'
});
$('#PoTypeOptions').change(function() {
var potypeval = $('#PoTypeOptions').val();
var poopt = <?php echo json_encode($PoTypeOptions, JSON_PRETTY_PRINT) ?>;
@ -118,10 +113,6 @@ if (!empty($INRSYMBOL)) {
}
});
document.getElementById("Date").checked = true;
$('#drpSupplier').change(function() {
@ -188,7 +179,6 @@ if (!empty($INRSYMBOL)) {
$('#ReqNo').change(function() {
var id = $('#ReqNo').val();
$("#AvlBudAmt").val('');
@ -510,7 +500,6 @@ if (!empty($INRSYMBOL)) {
$('#EditTotalOrderValue').val(parseFloat(TotAmt).toFixed(2));
}
function calculateTaxValue() {
@ -628,16 +617,15 @@ if (!empty($INRSYMBOL)) {
<div class="content-wrapper">
<?php
$attributes = array('class' => 'form-label-left ServicePO ', 'name' => 'ServicePO', 'id' => 'ServicePO', 'enctype' => 'multipart/form-data');
echo form_open(base_url() . '/purchaseorder/addPO/', $attributes); ?>
<section class="content">
<div class="box">
<div id="content"></div>
<div id="content"></div><!-- content div closed here -->
<div class="header-container">
<h2>Service Purchase Order</h2>
<a href="<?php echo base_url() ?>CreatePO" class="btn btn-cancel" id="back" value="Back">Back</a>
</div>
</div> <!-- header-container div closed here -->
<div class="container-fluid">
<div class="row">
<div class="col-md-12">
@ -658,7 +646,7 @@ if (!empty($INRSYMBOL)) {
?>
</div>
</div> <!-- 1.1. col-md-3 div closed here -->
<div class="col-md-3">
<label>Purchase Order Type</label>
<div class="form-group">
@ -668,7 +656,7 @@ if (!empty($INRSYMBOL)) {
echo form_input($data);
?>
</div>
</div>
</div> <!-- 1.2. col-md-3 div closed here -->
<div class="col-md-3">
<label>Select Supplier<span class="badge mandatory">*</span></label>
@ -686,7 +674,7 @@ if (!empty($INRSYMBOL)) {
?>
</div>
</div> <!-- 1.3. col-md-3 div closed here -->
<div class="col-md-3">
<label>Supplier Address</label>
<div class="form-group">
@ -695,9 +683,9 @@ if (!empty($INRSYMBOL)) {
echo Form_textarea($data);
?>
</div>
</div>
</div>
</div>
</div> <!-- 1.4. col-md-3 div closed here -->
</div> <!-- 1. col-md-12 div closed here -->
</div> <!-- 1. row div closed here -->
<div class="row">
<div class="col-md-12">
<div class="col-md-3">
@ -756,7 +744,7 @@ if (!empty($INRSYMBOL)) {
</div>
</div>
</div>
</div>
</div><!-- 2. row div closed here -->
<div class="row">
<div class="col-md-12">
<div class="col-md-3">
@ -800,7 +788,7 @@ if (!empty($INRSYMBOL)) {
</div>
</div>
</div>
</div><!-- 3. row div closed here -->
<div class="row">
<div class="col-md-12">
<div class="col-md-3">
@ -855,7 +843,7 @@ if (!empty($INRSYMBOL)) {
</div>
</div>
</div>
</div><!-- 4. row div closed here -->
<div class="row">
<div class="col-md-12">
<div class="col-md-3">
@ -902,29 +890,27 @@ if (!empty($INRSYMBOL)) {
</div>
</div>
</div>
</div><!-- 5. row div closed here -->
<div class="col-md-12">
<div class="row">
<div class="btn-container" style="text-align: right; ">
<a data-toggle="modal"><button type="submit" onclick="openModal();" class="btn btn-success" id="abcd">Select Line Item</button> </a>
</div>
</div>
</div><!-- 6. row div closed here -->
</div>
<div class="container-fluid">
<table class="table table-bordered" style="border:1px solid #333" id="ServiceTable">
<!-- Model for Add servicepo -->
<div class="modal fade" id="SERVICE" role="dialog">
<div class="modal-dialog">
<!-- Modal content-->
<form>
<div class="modal-content" style="width:900px;">
<div class="modal-header">
<center>
<h4>Add Service Purchase Order Item </h4>
</center>
</div>
</div><!-- SERVICE modal-header closed here -->
<div align="left">
<div class="col-md-12">
<div class="col-md-3">
<label>Req No<span class="badge mandatory">*</span></label>
@ -971,7 +957,7 @@ if (!empty($INRSYMBOL)) {
?>
</div>
</div>
</div>
</div><!-- SERVICE.1 closed here -->
<div class="col-md-12">
<div class="col-md-3">
<label>Item Code<span class="badge mandatory">*</span></label>
@ -1032,7 +1018,7 @@ if (!empty($INRSYMBOL)) {
</div>
</div>
</div><!-- SERVICE.2 closed here -->
<div class="col-md-12">
<div class="col-md-3">
@ -1070,8 +1056,7 @@ if (!empty($INRSYMBOL)) {
</div>
</div>
</div><!-- SERVICE.3 closed here -->
<div class="col-md-12">
<div class="col-md-6" align="right">
@ -1099,7 +1084,7 @@ if (!empty($INRSYMBOL)) {
</div>
</div>
</div><!-- SERVICE.4 closed here -->
<div class="col-md-12">
<div class="col-md-6" align="right">
@ -1127,8 +1112,7 @@ if (!empty($INRSYMBOL)) {
</div>
</div>
</div><!-- SERVICE.5 closed here -->
<div class="col-md-12">
<div class="col-md-6" align="right">
@ -1156,7 +1140,7 @@ if (!empty($INRSYMBOL)) {
</div>
</div>
</div><!-- SERVICE.6 closed here -->
<div class="col-md-12">
<div class="col-md-5 col-md-offset-4" align="right">
<label>Other Allowances <?php echo "($INRSYM)" ?></label>
@ -1169,7 +1153,7 @@ if (!empty($INRSYMBOL)) {
?>
</div>
</div>
</div>
</div><!-- SERVICE.7 closed here -->
<div class="col-md-12">
<div class="col-md-5 col-md-offset-4" align="right">
<label><?php echo "Total Order Value ($INRSYM)"; ?></label>
@ -1182,7 +1166,7 @@ if (!empty($INRSYMBOL)) {
?>
</div>
</div>
</div>
</div><!-- SERVICE.8 closed here -->
<div class="col-md-12" style="padding: 0px 30px 10px 30px;">
@ -1193,7 +1177,7 @@ if (!empty($INRSYMBOL)) {
$data = array('name' => 'txtSpcialInstruction', 'value' => set_value('txtSpcialInstruction'), 'id' => 'txtSpcialInstruction', 'class' => 'form-control', 'rows' => '3', 'cols' => '40');
echo form_textarea($data); ?>
</div>
</div><!-- SERVICE modal-footer closed here -->
<div class="modal-footer">
@ -1201,14 +1185,13 @@ if (!empty($INRSYMBOL)) {
<a class="btn btn-cancel" data-dismiss="modal" value="Cancel">Cancel</a>
<a class="btn btn-success font AddService" ID="AddService"> &nbsp;&nbsp;<span class="bold">Add Service</span></a>
</div>
</div>
</div>
</form>
</div><!-- SERVICE modal-footer closed here -->
</div><!-- SERVICE left closed here -->
</div><!-- SERVICE modal-content closed here -->
</form><!-- SERVICE form closed here -->
</div><!-- SERVICE modal-dialog closed here -->
</div><!-- SERVICE modal closed here -->
</div>
</div>
<!-- END of model for Add servicepo -->
<!-- Edit Service po moddel-->
<div class="modal fade" id="EDITSERVICE" role="dialog">
<div class="modal-dialog">
<!-- Modal content-->
@ -1219,7 +1202,7 @@ if (!empty($INRSYMBOL)) {
<center>
<h4>Edit Service Purchase Order Item </h4>
</center>
</div>
</div><!-- EDITSERVICE modal-header closed here -->
<div align="left">
<div class="col-md-12">
@ -1231,10 +1214,8 @@ if (!empty($INRSYMBOL)) {
$data = array('name' => 'EditReqNo', 'value' => set_value('EditReqNo'), 'id' => 'EditReqNo', 'class' => 'form-control', 'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
</div><!-- EDITSERVICE.1.1 col-md-3 closed here -->
<div class="col-md-3">
<label>Department Name</label>
<div class="form-group">
@ -1243,17 +1224,16 @@ if (!empty($INRSYMBOL)) {
echo form_input($data);
?>
</div>
</div>
</div><!-- EDITSERVICE.1.2 col-md-3 closed here -->
<div class="col-md-3">
<label>Cost Center Code</label>
<div class="form-group">
<?php
$data = array('name' => 'EditCostCenter', 'value' => set_value('EditCostCenter'), 'id' => 'EditCostCenter', 'class' => 'form-control', 'readonly' => 'true');
echo form_input($data);
?>
</div>
</div>
</div><!-- EDITSERVICE.1.3 col-md-3 closed here -->
<div class="col-md-3">
<label>Avail Budget Amount <?php echo "($INRSYM)" ?></label>
<div class="form-group">
@ -1262,8 +1242,8 @@ if (!empty($INRSYMBOL)) {
echo form_input($data);
?>
</div>
</div>
</div>
</div><!-- EDITSERVICE.1.4 col-md-3 closed here -->
</div><!-- EDITSERVICE.1 col-md-12 closed here -->
<div class="col-md-12">
<div class="col-md-3">
<label>Item Code<span class="badge mandatory" #fff ;">*</span></label>
@ -1276,7 +1256,7 @@ if (!empty($INRSYMBOL)) {
?>
</div>
</div>
</div><!-- EDITSERVICE.2.1 col-md-3 closed here -->
<div class="col-md-3">
<label>Item Name</label>
<div class="form-group">
@ -1285,10 +1265,7 @@ if (!empty($INRSYMBOL)) {
echo form_input($data);
?>
</div>
</div>
</div><!-- EDITSERVICE.2.2 col-md-3 closed here -->
<div class="col-md-3" id=EditotherDescription>
<label>Item Description</label>
<div class="form-group">
@ -1297,9 +1274,7 @@ if (!empty($INRSYMBOL)) {
echo form_input($data);
?>
</div>
</div>
</div><!-- EDITSERVICE.2.3 col-md-3 closed here -->
<div class="col-md-3">
<label>UOM</label>
<div class="form-group">
@ -1308,7 +1283,7 @@ if (!empty($INRSYMBOL)) {
echo form_input($data);
?>
</div>
</div>
</div><!-- EDITSERVICE.2.4 col-md-3 closed here -->
<div class="col-md-3">
<label>Service Schedule Type</label>
<div>
@ -1318,12 +1293,9 @@ if (!empty($INRSYMBOL)) {
?>
<input type="hidden" name="EditFrequencyNo" id="EditFrequencyNo" value="EditFrequencyNo" />
</div>
</div>
</div>
</div><!-- EDITSERVICE.2.5 col-md-3 closed here -->
</div><!-- EDITSERVICE.2 col-md-12 closed here -->
<div class="col-md-12">
<div class="col-md-3">
<label>Quantity<span class="badge mandatory">*</span></label>
<div class="form-group">
@ -1332,7 +1304,7 @@ if (!empty($INRSYMBOL)) {
echo form_input($data);
?>
</div>
</div>
</div><!-- EDITSERVICE.3.1 col-md-3 closed here -->
<div class="col-md-3">
<label><?php echo "Rate ($INRSYM)"; ?><span class="badge mandatory">*</span></label>
<div class="form-group">
@ -1341,13 +1313,13 @@ if (!empty($INRSYMBOL)) {
echo form_input($data);
?>
</div>
</div>
</div><!-- EDITSERVICE.3.2 col-md-3 closed here -->
<div class="col-md-3">
<label>Per</label><!--date should be come-->
<?php
$data = array('name' => 'EditPer', 'value' => set_value('EditPer'), 'id' => 'EditPer', 'class' => 'form-control');
echo form_input($data); ?>
</div>
</div><!-- EDITSERVICE.3.3 col-md-3 closed here -->
<div class="col-md-3">
<label><?php echo "Basic Amount ($INRSYM)"; ?></label>
<div class="form-group">
@ -1356,16 +1328,13 @@ if (!empty($INRSYMBOL)) {
echo form_input($data);
?>
</div>
</div>
</div>
</div><!-- EDITSERVICE.3.4 col-md-3 closed here -->
</div><!-- EDITSERVICE.3 col-md-12 closed here -->
<div class="col-md-12">
<div class="col-md-6" align="right">
CGST In %
</div>
</div><!-- EDITSERVICE.4.1 col-md-6 closed here -->
<div class="col-md-3">
<div class="form-group">
@ -1375,7 +1344,7 @@ if (!empty($INRSYMBOL)) {
?>
</div>
</div>
</div><!-- EDITSERVICE.4.2 col-md-3 closed here -->
<div class="col-md-3">
<div class="form-group">
@ -1385,14 +1354,12 @@ if (!empty($INRSYMBOL)) {
?>
</div>
</div>
</div>
</div><!-- EDITSERVICE.4.3 col-md-3 closed here -->
</div><!-- EDITSERVICE.4 col-md-12 closed here -->
<div class="col-md-12">
<div class="col-md-6" align="right">
SGST In %
</div>
</div><!-- EDITSERVICE.5.1 col-md-6 closed here -->
<div class="col-md-3">
<div class="form-group">
@ -1403,7 +1370,7 @@ if (!empty($INRSYMBOL)) {
?>
</div>
</div>
</div><!-- EDITSERVICE.5.2 col-md-3 closed here -->
<div class="col-md-3">
<div class="form-group">
@ -1413,15 +1380,15 @@ if (!empty($INRSYMBOL)) {
?>
</div>
</div>
</div><!-- EDITSERVICE.5.3 col-md-3 closed here -->
</div>
</div><!-- EDITSERVICE.5 col-md-12 closed here -->
<div class="col-md-12">
<div class="col-md-6" align="right">
IGST In %
</div>
</div><!-- EDITSERVICE.6.1 col-md-6 closed here -->
<div class="col-md-3">
<div class="form-group">
@ -1432,7 +1399,7 @@ if (!empty($INRSYMBOL)) {
?>
</div>
</div>
</div><!-- EDITSERVICE.6.2 col-md-3 closed here -->
<div class="col-md-3">
<div class="form-group">
@ -1442,13 +1409,13 @@ if (!empty($INRSYMBOL)) {
?>
</div>
</div>
</div><!-- EDITSERVICE.6.3 col-md-3 closed here -->
</div>
</div><!-- EDITSERVICE.6 col-md-12 closed here -->
<div class="col-md-12">
<div class="col-md-5 col-md-offset-4" align="right">
<label>Other Allowances <?php echo "($INRSYM)" ?></label>
</div>
</div><!-- EDITSERVICE.7.1 col-md-5 col-md-offset-4 closed here -->
<div class="col-md-3">
<div class="form-group">
<?php
@ -1456,8 +1423,8 @@ if (!empty($INRSYMBOL)) {
echo form_input($data);
?>
</div>
</div>
</div>
</div><!-- EDITSERVICE.7.2 col-md-3 closed here -->
</div><!-- EDITSERVICE.7 col-md-12 closed here -->
<div class="col-md-12">
<div class="col-md-5 col-md-offset-4" align="right">
<label><?php echo "Total Order Value ($INRSYM)"; ?></label>
@ -1470,33 +1437,29 @@ if (!empty($INRSYMBOL)) {
?>
</div>
</div>
</div>
</div><!-- EDITSERVICE.8 col-md-12 closed here -->
<div class="col-md-12" style="padding: 0px 30px 10px 30px;">
<label>Service Description </label>
<?php
$data = array('name' => 'EdittxtSpcialInstruction', 'value' => set_value('EdittxtSpcialInstruction'), 'id' => 'EdittxtSpcialInstruction', 'class' => 'form-control', 'rows' => '3', 'cols' => '40');
echo form_textarea($data); ?>
</div>
</div><!-- EDITSERVICE.9 col-md-12 closed here -->
<div class="modal-footer">
<div class="col-md-12">
<a class="btn btn-cancel" data-dismiss="modal" value="Cancel">Cancel</a>
<a class="btn btn-success font EditService" ID="Edit">&nbsp;&nbsp;<span class="bold">Update Service</span></a>
</div>
</div>
</div>
</form>
</div><!-- EDITSERVICE modal-footer closed here -->
</div><!-- EDITSERVICE left closed here -->
</div><!-- EDITSERVICE modal-content closed here -->
</form><!-- EDITSERVICE form closed here -->
</div><!-- EDITSERVICE modal-dialog closed here -->
</div><!-- EDITSERVICE modal closed here -->
</div>
</div>
<!-- End of Model for EDIT servicepo -->
</table>
</div>
</table><!-- ServiceTable table closed here -->
</div><!-- container-fluid div closed here -->
<div class="box-body">
<table id="serviceTax" class="table table-bordered table-hover" style="background-color:#fff;font-size:12px;">
@ -1505,7 +1468,7 @@ if (!empty($INRSYMBOL)) {
<th>SNo</th>
<th>Requisition No</th>
<th>Item Code</th>
<th>Item Description</th>
<th>Item Name</th>
<th>Quantity</th>
<th>UOM</th>
<th>Rate <?php echo "($INRSYM)" ?></th>
@ -1515,12 +1478,10 @@ if (!empty($INRSYMBOL)) {
<th>Action</th>
</tr>
</thead>
<tbody id='ServiceAppend'>
</tbody>
</table>
</div>
</table><!-- serviceTax table closed here -->
</div><!-- box-body div closed here -->
<div class="row">
@ -1532,31 +1493,28 @@ if (!empty($INRSYMBOL)) {
$data = array('name' => 'txtTotBasicAmount', 'value' => set_value('txtTotBasicAmount'), 'id' => 'txtTotBasicAmount', 'class' => 'form-control num', 'readonly' => 'true');
echo form_input($data);
?>
</div>
</div><!-- 7.1.1 col-md-2 div closed here -->
<div class="col-md-2">
<label>CGST <?php echo "($INRSYM)" ?></label>
<?php
$data = array('name' => 'txtTotCgst', 'value' => set_value('txtTotCgst'), 'id' => 'txtTotCgst', 'class' => 'form-control num', 'readonly' => 'true');
echo form_input($data);
?>
</div>
</div><!-- 7.1.2 col-md-2 div closed here -->
<div class="col-md-2">
<label>SGST <?php echo "($INRSYM)" ?></label>
<?php
$data = array('name' => 'txtTotSgst', 'value' => set_value('txtTotSgst'), 'id' => 'txtTotSgst', 'class' => 'form-control num', 'readonly' => 'true');
echo form_input($data);
?>
</div>
</div><!-- 7.1.3 col-md-2 div closed here -->
<div class="col-md-2">
<label>IGST <?php echo "($INRSYM)" ?> </label>
<?php
$data = array('name' => 'txtTotIgst', 'value' => set_value('txtTotIgst'), 'id' => 'txtTotIgst', 'class' => 'form-control num', 'readonly' => 'true');
echo form_input($data);
?>
</div>
</div><!-- 7.1.4 col-md-2 div closed here -->
<div class="col-md-2">
<label>Other Allowances <?php echo "($INRSYM)" ?> </label>
<?php
@ -1564,7 +1522,7 @@ if (!empty($INRSYMBOL)) {
echo form_input($data);
?>
</div>
</div><!-- 7.1.5 col-md-2 div closed here -->
<div class="col-md-2">
<label>Total Order Value <?php echo "($INRSYM)" ?> </label>
<?php
@ -1572,9 +1530,8 @@ if (!empty($INRSYMBOL)) {
echo form_input($data);
?>
</div>
</div>
<!--start new fields 1 sep-->
</div><!-- 7.1.6 col-md-2 div closed here -->
</div><!-- 7.1 col-md-12 div closed here -->
<div class="col-md-12">
<label>Description Of Service<span class="badge mandatory">*</label>
<div class="form-group">
@ -1582,19 +1539,18 @@ if (!empty($INRSYMBOL)) {
$data = array('name' => 'descofpo', 'value' => set_value('descofpo'), 'id' => 'descofpo', 'class' => 'form-control', 'rows' => '3', 'cols' => '40');
echo form_textarea($data);
?>
</div>
</div><!--end new fields 1 sep-->
</div><!-- 7.2 form-group div closed here -->
</div><!-- 7.2 col-md-12 div closed here -->
<div class="col-md-12" style="padding:0px;">
<div class="col-md-12">
<label>Scope Of Work</label> <?php
$data = array('name' => 'ScopeOfWork', 'value' => set_value('ScopeOfWork'), 'id' => 'ScopeOfWork', 'class' => 'form-control', 'rows' => '10', 'cols' => '40');
echo form_textarea($data); ?>
</div>
</div>
</div><!-- 7.3.1 col-md-12 div closed here -->
</div><!-- 7.3 col-md-12 div closed here -->
<div class="col-md-12">
<div class="row">
<br />
<br/>
<div align="right" style="padding-right:10px">
<input type="file" name="POFile" id="POFile"><br>
<input type="hidden" name="txtStatus" id="txtStatus" />
@ -1608,19 +1564,15 @@ if (!empty($INRSYMBOL)) {
<a class="btn btn-reset Save" ID="Cancel" onclick="Reset();">&nbsp;&nbsp;<span class="bold">Reset</span></a>
<a class="btn btn-success Save" ID="Save" onclick="Save(0)">&nbsp;&nbsp;<span class="bold">Save as Draft</span></a>
<a class="btn btn-success Submit" ID="Submit" onclick="Save(1)">&nbsp;&nbsp;<span class="bold">Submit</span></a>
</div>
</div><br />
</div>
</div>
<br />
</div>
</div>
</div>
</div>
</div>
</section>
</div>
</div><!-- 7.4 btn-container div closed here -->
</div><br/><!-- 7.4 right div closed here -->
</div><!-- 7.4 row div closed here -->
</div><!-- 7.4 col-md-12 div closed here -->
</div><!-- 7. row div closed here -->
</div> <!-- container-fluid div closed here -->
</div> <!-- box div closed here -->
</section> <!-- content section closed here -->
</div> <!-- content-wrapper div closed here -->
<script type="text/html" id="ServiceList">
<tr id="<%=index%>">
<td align="left"><%=index%></td>
@ -1661,6 +1613,8 @@ if (!empty($INRSYMBOL)) {
$("#EDITSERVICE").on("shown.bs.modal", function(e) {
console.log("Worng");
userid = $(e.relatedTarget).data('userid');
var tr = document.getElementById(userid);
@ -1825,7 +1779,7 @@ if (!empty($INRSYMBOL)) {
index: temp,
ReqNo: Reqnumber,
MaterialCode: materialCode,
MaterialName: ServiceDescription,
MaterialName: materialName,
Quantity: quantity,
UOM: uom,
Rate: itemRate,
@ -1919,7 +1873,7 @@ if (!empty($INRSYMBOL)) {
var cellval = tr.cells;
cellval[2].innerHTML = editMaterialCode;
cellval[3].innerHTML = ServiceDescription;
cellval[3].innerHTML = editDescription;
cellval[4].innerHTML = editQuantity;
cellval[5].innerHTML = editUOM;
cellval[6].innerHTML = parseFloat(itemRate).toFixed(2);
@ -2341,10 +2295,6 @@ if (!empty($INRSYMBOL)) {
});
function openModal() {
if (vaildateBeforeOpenModal()) {
$('#SERVICE').modal('show');

View File

@ -1,5 +1,41 @@
<style>
.Date-filter-form {
display: flex;
align-items: center;
gap: 10px;
/* Adjust the gap as needed */
}
<div class="content-wrapper">
.Date-filter-form input,
.Date-filter-form button {
padding: 5px;
font-size: 14px;
}
.Date-filter-form button {
background-color: #007bff;
color: white;
border: none;
cursor: pointer;
}
.Date-filter-form button:hover {
background-color: #0056b3;
}
.icon-button {
background: none;
border: none;
cursor: pointer;
color: #007bff;
font-size: 18px;
}
.icon-button:hover {
color: #0056b3;
}
</style>
<div class="content-wrapper">
<section class="content">
<div class="row">
@ -7,12 +43,12 @@
<?php
helper('form');
$error = session()->getFlashdata('error');
if($error){
if ($error) {
$type = "error";
echo show_alert($type, $error);
}
$success = session()->getFlashdata('success');
if($success){
if ($success) {
$type = "success";
echo show_alert($type, $success);
}
@ -29,23 +65,38 @@
<div class="box">
<div class="box-header">
<center><b><h3 class="box-title">Supplier Listing</h3></b></center>
<center><b>
<h3 class="box-title">Supplier Listing</h3>
</b></center>
</div>
<div class="container-fluid">
<div class="row">
<div class="col-xs-12 text-right">
<div class="col-xs-12 col-md-6">
<form class="Date-filter-form" id="DateRangeFilter">
<input type="hidden" name="table" value="requisition">
<label for="fromDate">From:</label>
<input type="text" id="fromDate" name="fromDate" placeholder="Select From Date" autocomplete="off" required>
<label for="toDate">To:</label>
<input type="text" id="toDate" name="toDate" placeholder="Select To Date" autocomplete="off" required>
<button type="submit">Search</button>
<i class="fa fa-repeat" aria-hidden="true" class="icon-button" id="resetButton" title="Reset"></i>
<div class="error" id="error"></div>
</form>
</div>
<div class="col-xs-12 col-md-6 text-right">
<div class="form-group">
<a class="btn btn-success" href="<?php echo base_url(); ?>addsupplier">Add New Supplier</a>
<a class="btn btn-success" href="<?php echo base_url(); ?>exportsupplier">Export Supplier Details <i class="fa fa-download"aira-hidden="true"></i></a>
</div>
<a class="btn btn-success" href="<?php echo base_url(); ?>exportsupplier">Export Supplier Details <i class="fa fa-download" aira-hidden="true"></i></a>
</div>
</div>
<div class="row">
<div class="col-xs-12">
<table class="table table-bordered table-hover" id="datatable" style="background-color:#fff;font-size:11px !important;" >
<table class="table table-bordered table-hover" id="datatable" style="background-color:#fff;font-size:11px !important;">
<thead style="background-color: #ddd;">
<tr>
<th style="width:75px">Created Date</th>
<th>Supplier ID</th>
<th>Supplier Name</th>
<th>Address</th>
@ -59,12 +110,16 @@
</thead>
<tbody>
<?php
if(!empty($userRecords))
{
foreach($userRecords as $record)
{
if (!empty($userRecords)) {
foreach ($userRecords as $record) {
?>
<tr>
<?php if (date('d-m-Y', strtotime($record->CreatedOn)) == "30-11--0001") {
$cdate = '00-00-0000';
} else {
$cdate = date('d-m-Y', strtotime($record->CreatedOn));
} ?>
<td style="width:75px" align="right"><?php echo $cdate; ?></td>
<td><u><a class="a-tag-link" href="<?= base_url() ?>viewsupplier?SID=<?= $record->SupplierID ?>&Payment=<?= $record->PaymentTerms ?>" data-toggle="tooltip" title="<?= $record->SupplierID ?> - Click here to view Supplier details"><?= $record->SupplierID ?></a></u></td>
<td><?php echo $record->SupplierName ?></td>
<td><?php echo $record->Address ?></td>
@ -73,8 +128,10 @@
<td><?php echo $record->PAN ?></td>
<td><?php echo $record->GSTNO ?></td>
<td><?php echo $record->PaymentTerms ?></td>
<td><?php if($record->IsActive == 0){ echo "Deactived"; }else{ ?>
<a onclick="deletesupplier('<?php echo $record->SupplierID;?>')"><i class="fa fa-trash"></i>&nbsp;&nbsp;&nbsp;</a>
<td><?php if ($record->IsActive == 0) {
echo "Deactived";
} else { ?>
<a onclick="deletesupplier('<?php echo $record->SupplierID; ?>')"><i class="fa fa-trash"></i>&nbsp;&nbsp;&nbsp;</a>
<?php } ?>
</td>
</tr>
@ -90,34 +147,33 @@
</div>
</div>
</section>
</div>
<script type="text/javascript" src="<?php echo base_url(); ?>public/assets/js/common.js" charset="utf-8"></script>
<script type="text/javascript">
</div>
<script type="text/javascript" src="<?php echo base_url(); ?>public/assets/js/common.js" charset="utf-8"></script>
<script type="text/javascript">
// $(function () {
$(function () {
// $('#datatable').DataTable({
// "paging": true,
// "lengthChange": true,
// "searching": true,
// "ordering": true,
// "info": true,
// "autoWidth": true
$('#datatable').DataTable({
"paging": true,
"lengthChange": true,
"searching": true,
"ordering": true,
"info": true,
"autoWidth": true
});
});
function deletesupplier(sid)
{alert(sid);
// });
// });
function deletesupplier(sid) {
alert(sid);
var answer = confirm(" Do you want to delete the Supplier from the List?")
if (answer)
{
if (answer) {
$.ajax({
data:{id:userid},
type:"POST",
url:"<?php echo base_url() ?>deletesupplier",
success:function(data) {
if(data)
{
data: {
id: userid
},
type: "POST",
url: "<?php echo base_url() ?>deletesupplier",
success: function(data) {
if (data) {
$('#content').loader('hide');
alert(data);
location.reload();
@ -126,5 +182,84 @@
});
}
}
</script>
<script>
$(document).ready(function() {
$.fn.dataTable.ext.type.order['date-eu-pre'] = function(date) {
var dateSplit = date.split('-');
return (dateSplit[2] + dateSplit[1] + dateSplit[0]) * 1;
};
// Initialize the DataTable
var table = $('#datatable').DataTable({
"paging": true,
"lengthChange": true,
"searching": true,
"ordering": true,
"columnDefs": [{
"targets": 0,
"type": "date-eu"
}],
"aaSorting": [
[0, "desc"]
],
"info": true,
"autoWidth": true,
"pageLength": 10,
"lengthMenu": [10, 25, 50, 100],
</script>
});
// Initialize the datepickers
$("#fromDate").datepicker({
dateFormat: 'dd-mm-yy',
onSelect: function(selectedDate) {
var minDate = $(this).datepicker("getDate");
$("#toDate").datepicker("option", "minDate", minDate);
}
});
$("#toDate").datepicker({
dateFormat: 'dd-mm-yy',
onSelect: function(selectedDate) {
var maxDate = $(this).datepicker("getDate");
$("#fromDate").datepicker("option", "maxDate", maxDate);
}
});
// Reset button functionality
$("#resetButton").click(function() {
$("#fromDate").datepicker("setDate", null);
$("#toDate").datepicker("setDate", null);
$("#toDate").datepicker("option", "minDate", null);
$("#fromDate").datepicker("option", "maxDate", null);
table.draw();
});
// Date range filter
$.fn.dataTable.ext.search.push(
function(settings, data, dataIndex) {
var fromDate = $("#fromDate").datepicker("getDate");
var toDate = $("#toDate").datepicker("getDate");
var dateStr = data[0]; // Assuming the date is in the first column
// Convert dateStr to Date object
var dateParts = dateStr.split("-");
var date = new Date(dateParts[2], dateParts[1] - 1, dateParts[0]); // Convert dd-mm-yyyy to Date object
if (!fromDate || !toDate) {
return true; // No filter if dates are not selected
}
return date >= fromDate && date <= toDate;
}
);
// Handle form submission
$("#DateRangeFilter").submit(function(e) {
e.preventDefault();
table.draw();
});
});
</script>

View File

@ -1,4 +1,40 @@
<style>
.Date-filter-form {
display: flex;
align-items: center;
gap: 10px;
/* Adjust the gap as needed */
}
.Date-filter-form input,
.Date-filter-form button {
padding: 5px;
font-size: 14px;
}
.Date-filter-form button {
background-color: #007bff;
color: white;
border: none;
cursor: pointer;
}
.Date-filter-form button:hover {
background-color: #0056b3;
}
.icon-button {
background: none;
border: none;
cursor: pointer;
color: #007bff;
font-size: 18px;
}
.icon-button:hover {
color: #0056b3;
}
</style>
<div class="content-wrapper">
@ -8,12 +44,12 @@
<?php
helper('form');
$error = session()->getFlashdata('error');
if($error){
if ($error) {
$type = "error";
echo show_alert($type, $error);
}
$success = session()->getFlashdata('success');
if($success){
if ($success) {
$type = "success";
echo show_alert($type, $success);
}
@ -28,11 +64,27 @@
</div>
<div class="box">
<div class="box-header">
<center><b><h3 class="box-title">User Listing</h3></b></center>
<center><b>
<h3 class="box-title">User Listing</h3>
</b></center>
</div>
<div class="container-fluid">
<div class="row">
<div class="col-xs-12 text-right">
<div class="col-xs-12 col-md-6">
<form class="Date-filter-form" id="DateRangeFilter">
<input type="hidden" name="table" value="requisition">
<label for="fromDate">From:</label>
<input type="text" id="fromDate" name="fromDate" placeholder="Select From Date" autocomplete="off" required>
<label for="toDate">To:</label>
<input type="text" id="toDate" name="toDate" placeholder="Select To Date" autocomplete="off" required>
<button type="submit">Search</button>
<i class="fa fa-repeat" aria-hidden="true" class="icon-button" id="resetButton" title="Reset"></i>
<div class="error" id="error"></div>
</form>
</div>
<div class="col-xs-12 col-md-6 text-right">
<div class="form-group">
<a class="btn btn-success" href="<?php echo base_url(); ?>addNew">Add New User</a>
</div>
@ -40,11 +92,11 @@
</div>
<div class="row">
<div class="col-xs-12">
<table class="table table-hover table-bordered" id="datatable" style="background-color:#fff;font-size:12px;" >
<table class="table table-hover table-bordered" id="datatable" style="background-color:#fff;font-size:12px;">
<thead style="background-color: #ddd;">
<tr>
<th>User Id</th>
<th>Created Date</th>
<!-- <th>User Id</th> -->
<th>User Name</th>
<th>Email</th>
<th>Contact Number</th>
@ -56,13 +108,17 @@
</thead>
<tbody>
<?php
if(!empty($userRecords))
{
foreach($userRecords as $record)
{
if (!empty($userRecords)) {
foreach ($userRecords as $record) {
?>
<tr>
<td><?php echo $record->userId ?></td>
<?php if (date('d-m-Y', strtotime($record->createdDtm)) == "30-11--0001") {
$cdate = '00-00-0000';
} else {
$cdate = date('d-m-Y', strtotime($record->createdDtm));
} ?>
<td align="right"><?php echo $cdate; ?> </td>
<!-- <td><?php echo $record->userId ?></td> -->
<td><?php echo $record->FirstName ?></td>
<td><?php echo $record->EmailId ?></td>
<td><?php echo $record->ContactNumber ?></td>
@ -70,9 +126,9 @@
<td><?php echo $record->DepartmentName ?></td>
<td><?php echo $record->role ?></td>
<td>
<a href="<?php echo base_url().'user/editOld?UID='.$record->userId.'&EMPID='.$record->EmpID;?>"><i class="fa fa-pencil"></i>&nbsp;&nbsp;&nbsp;</a>
<a href="<?php echo base_url() . 'user/editOld?UID=' . $record->userId . '&EMPID=' . $record->EmpID; ?>"><i class="fa fa-pencil"></i>&nbsp;&nbsp;&nbsp;</a>
<a onclick="deleteUser(<?php echo $record->userId;?>)"><i class="fa fa-trash"></i>&nbsp;&nbsp;&nbsp;</a>
<a onclick="deleteUser(<?php echo $record->userId; ?>)"><i class="fa fa-trash"></i>&nbsp;&nbsp;&nbsp;</a>
</td>
</tr>
<?php
@ -90,49 +146,124 @@
</div>
<script type="text/javascript" src="<?php echo base_url(); ?>public/assets/js/common.js" charset="utf-8"></script>
<script type="text/javascript">
// $(function () {
// $('#datatable').DataTable({
// "paging": true,
// "lengthChange": true,
// "searching": true,
// "ordering": true,
// "info": true,
// "autoWidth": true
$(function () {
$('#datatable').DataTable({
"paging": true,
"lengthChange": true,
"searching": true,
"ordering": true,
"info": true,
"autoWidth": true
});
});
// });
// });
function deleteUser(userid)
{
function deleteUser(userid) {
var answer = confirm(" Do you want to delete the user from the List?")
if (answer)
{
if (answer) {
$.ajax({
data:{id:userid},
type:"POST",
url:"<?php echo base_url() ?>user/deleteUser",
success:function(data) {
if(data)
{
data: {
id: userid
},
type: "POST",
url: "<?php echo base_url() ?>user/deleteUser",
success: function(data) {
if (data) {
$('#content').loader('hide');
alert(data);
location.reload();
}
else
{
} else {
alert("Error");
}
}});
}
});
}
}
</script>
<script>
$.fn.dataTable.ext.type.order['date-eu-pre'] = function(date) {
var dateSplit = date.split('-');
return (dateSplit[2] + dateSplit[1] + dateSplit[0]) * 1;
};
$(document).ready(function() {
// Initialize the DataTable
var table = $('#datatable').DataTable({
"paging": true,
"lengthChange": true,
"searching": true,
"ordering": true,
"columnDefs": [{
"targets": 0,
"type": "date-eu"
}],
"aaSorting": [
[0, "desc"]
],
"info": true,
"autoWidth": true,
"pageLength": 10,
"lengthMenu": [10, 25, 50, 100],
});
// Initialize the datepickers
$("#fromDate").datepicker({
dateFormat: 'dd-mm-yy',
onSelect: function(selectedDate) {
var minDate = $(this).datepicker("getDate");
$("#toDate").datepicker("option", "minDate", minDate);
}
});
$("#toDate").datepicker({
dateFormat: 'dd-mm-yy',
onSelect: function(selectedDate) {
var maxDate = $(this).datepicker("getDate");
$("#fromDate").datepicker("option", "maxDate", maxDate);
}
});
// Reset button functionality
$("#resetButton").click(function() {
$("#fromDate").datepicker("setDate", null);
$("#toDate").datepicker("setDate", null);
$("#toDate").datepicker("option", "minDate", null);
$("#fromDate").datepicker("option", "maxDate", null);
table.draw();
});
// Date range filter
$.fn.dataTable.ext.search.push(
function(settings, data, dataIndex) {
var fromDate = $("#fromDate").datepicker("getDate");
var toDate = $("#toDate").datepicker("getDate");
var dateStr = data[0]; // Assuming the date is in the first column
// Convert dateStr to Date object
var dateParts = dateStr.split("-");
var date = new Date(dateParts[2], dateParts[1] - 1, dateParts[0]); // Convert dd-mm-yyyy to Date object
if (!fromDate || !toDate) {
return true; // No filter if dates are not selected
}
return date >= fromDate && date <= toDate;
}
);
// Handle form submission
$("#DateRangeFilter").submit(function(e) {
e.preventDefault();
table.draw();
});
});
</script>

View File

@ -48,6 +48,29 @@
white-space: nowrap;
}
</style>
<style>
.dataTables_wrapper .top {
display: flex;
justify-content: space-between;
align-items: center;
}
.dataTables_wrapper .dataTables_length {
float: left;
}
.dataTables_wrapper .dt-buttons,
.dataTables_wrapper .dataTables_filter {
float: right;
margin-left: 10px;
}
.dataTables_wrapper .dt-buttons {
margin-top: 10px;
margin-bottom: 10px;
}
.dataTables_wrapper .dataTables_filter {
margin-top: 10px;
margin-bottom: 10px;
}
</style>
<script>
$(function() {
var d = new Date();
@ -91,7 +114,6 @@
<table id="Inwardgateregistertable" class="table table-bordered table-hover" style="background-color:#fff;font-size:12px;">
<thead style="background-color: #ddd;">
<tr>
<th style="display:none;"></th>
<th>Create Date</th>
<th>Create time</th>
<th>IGR No</th>
@ -116,7 +138,6 @@
$time = $createddate->format('h:i A');
?>
<tr id="<?php echo $index ?>" >
<th style="display:none;"><?php echo $record->CreatedDate ?></th>
<td align="right"><?php echo $date; ?></td>
<td align="right"><?php echo $time; ?></td>
<td><a data-toggle="modal" data-target="#Igrshow" data-id="<?php echo $index;?>" data-inx="<?php echo $index;?>" data-userid="<?php echo $record->IGRNO ?>" data-igrstatus="<?php echo $record->IGRStatus ?>"> <u><?php echo $record->IGRNO ?></u></a></td>
@ -184,6 +205,7 @@
echo form_input($data);
?>
<span class="help-block"></span>
<input type="hidden" name="hiddenIsOpenOrder" id="hiddenIsOpenOrder" />
</div>
<div class="col-md-6">
<label>Supplier Name </label>
@ -608,10 +630,14 @@ console.log(parsedData);
var baseUrl = '<?php echo base_url(); ?>purchaseorder/CreatePOPrint';
var newUrl = baseUrl + '?PONO=' + item.PONO + '&ReqType=' + item.POType;
$('#printLink').attr('href', newUrl);
var isOpenOrder = parseInt(item.IsOpenOrder, 2);
var isOpenOrder = parseInt(item.IsOpenOrder ? item.IsOpenOrder : "0", 2);
console.log(item.IsOpenOrder);
console.log(isOpenOrder);
var formatted_IsOpenOrder = (isOpenOrder === 0 || isNaN(isOpenOrder)) ? "" : "Open";
$('.help-block').text(formatted_IsOpenOrder);
var button_text_for_IGRDraft= (isOpenOrder === 0 || isNaN(isOpenOrder)) ? "Save as Draft IGR" : "Save as Open IGR";
$('#draftIGR').text(button_text_for_IGRDraft);
$("#hiddenIsOpenOrder").val(isOpenOrder);
$("#Vehicle_No").val(item.VehicleNo);
$("#Driver_Name").val(item.DriverName);
$("#DriverMobileNumber").val(item.DriverMobileNumber);
@ -655,8 +681,8 @@ console.log(parsedData);
'<td style="width: 200px; word-wrap: break-word; word-break: break-all; white-space: normal;">' + item.MaterialName + '</td>' +
'<td style="width: 50px;" name="UOM">' + item.UOM + '</td>' +
'<td style="width: 100px;" align="right" id="Quantity' + i + '" name="Quantity">' + parseInt(item.Quantity) + '</td>' +
'<td style="width: 100px;" align="right" data-name="sel" ><input type="text" onchange="validateReceivedQuantity(' + i + ')"id="QuantityAsPerInvoice' + i + '" name="QuantityAsPerInvoice' + i + '" value="' + parseInt(item.QuantityAsPerInvoice) + '" onkeypress="return isNumberKey(event);" style="width: 75px;"></td>' +
'<td style="width: 100px;" name="PendingQuantity' + i + '" id="PendingQuantity' + i + '">' + parseInt(item.Quantity - item.QuantityAsPerInvoice) + '</td>' +
'<td style="width: 100px;" align="right" data-name="sel" ><input type="text" onchange="validateReceivedQuantity(' + i + ','+isOpenOrder+')"id="QuantityAsPerInvoice' + i + '" name="QuantityAsPerInvoice' + i + '" value="' + parseInt(item.QuantityAsPerInvoice) + '" onkeypress="return isNumberKey(event);" style="width: 75px;"></td>' +
'<td style="width: 100px;" name="PendingQuantity' + i + '" id="PendingQuantity' + i + '">' + ((isOpenOrder) ? 0 : parseInt(item.Quantity - item.QuantityAsPerInvoice)) + '</td>' +
'<td style="width: 150px;"><input type="text" id="Remark' + i + '" name="Remark' + i + '" class="form" onchange="SetRemarks(' + i + ')" style="width: 75px;"> </td>' +
'<td style="width: 50px;"><a target="_blank" data-toggle="modal" data-target="#WeightCalculator" title="Weight Calculator" data-index="'+i+'" data-material="'+item.MaterialName+'" data-igrstatus = "'+igrstatus+'"><i class="fa fa-solid fa-truck" style="text-align: center;"></i></a> </td>' +
'<input type="hidden" id="IGRNO' + i + '" name="IGRNO' + i + '" value="' + item.IGRNO + '">' +
@ -772,6 +798,7 @@ console.log(parsedData);
formData.append('driver_mobile', $('#DriverMobileNumber').val());
formData.append('status', status);
formData.append('tableData', JSON.stringify(tableData));
formData.append('isOpenOrder', $("#hiddenIsOpenOrder").val());
formData.append('MasterFile', $('#MasterFile')[0].files[0]);
formData.append('file_name[]', $('#file_name').val());
var empFiles = $('#emp_file')[0] ? $('#emp_file')[0].files : null;
@ -829,6 +856,7 @@ console.log(parsedData);
formData.append('driver_mobile', $('#DriverMobileNumber').val());
formData.append('status', status);
formData.append('tableData', JSON.stringify(tableData));
formData.append('isOpenOrder',$("#hiddenIsOpenOrder").val());
formData.append('MasterFile', $('#MasterFile')[0].files[0]);
formData.append('file_name[]', $('#file_name').val());
var empFiles = $('#emp_file')[0] ? $('#emp_file')[0].files : null;
@ -1376,10 +1404,16 @@ function deleteBill(Billno,i){
}
}
function validateReceivedQuantity(Rowid) {
function validateReceivedQuantity(Rowid,isOpenOrder) {
var InvoiceQty = parseFloat($('#QuantityAsPerInvoice' + Rowid).val() || '0.00'); // working fine
var OrderedQty = parseFloat($("#Quantity" + Rowid).text());
if(isOpenOrder == 1){
var PendingQty = 0;
$('#PendingQuantity' + Rowid).text(PendingQty.toFixed(0));
$('#txtPendingQty' + Rowid).val(PendingQty.toFixed(0));
$('#txtQuantityAsPerInvoice' + Rowid).val(InvoiceQty.toFixed(2));
return true;
}else{
if (parseInt(OrderedQty) !== 0) {
if ((InvoiceQty) > OrderedQty) {
alert("Pending Quantity is exceeding the Ordered Quantity. Please contact the Purchase Team for further process.");
@ -1404,6 +1438,7 @@ function deleteBill(Billno,i){
return true;
}
}
}
</script>
<script>
function isNumberKey(evt) {
@ -1524,8 +1559,20 @@ function deleteBill(Billno,i){
</script>
<script src="https://cdn.datatables.net/plug-ins/1.10.11/sorting/date-eu.js"></script>
<script src="https://cdn.datatables.net/buttons/2.3.4/js/dataTables.buttons.min.js"></script>
<script src="https://cdn.datatables.net/buttons/2.3.4/js/buttons.html5.min.js"></script>
<script src="https://cdn.datatables.net/buttons/2.3.4/js/buttons.print.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.10.1/jszip.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.7/pdfmake.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.7/vfs_fonts.js"></script>
<script src="https://cdn.datatables.net/plug-ins/1.13.6/sorting/datetime-moment.js"></script>
<script>
$(document).ready(function() {
$.fn.dataTable.ext.type.order['date-eu-pre'] = function (date) {
var dateSplit = date.split('-');
return (dateSplit[2] + dateSplit[1] + dateSplit[0]) * 1;
};
// Initialize the DataTable
var table = $('#Inwardgateregistertable').DataTable({
"paging": true,
@ -1533,16 +1580,36 @@ $(document).ready(function() {
"searching": true,
"ordering": true,
"columnDefs": [{
"targets": 1,
"targets": 0,
"type": "date-eu"
}],
"aaSorting": [
[1, "desc"]
[0, "desc"]
],
"info": true,
"autoWidth": true,
"pageLength": 10,
"lengthMenu": [10, 25, 50, 100],
"dom": "<'row'<'col-md-6'l><'col-md-6'Bf>>" +
"<'row'<'col-md-6'><'col-md-6'>>" +
"<'row'<'col-md-12't>><'row'<'col-md-4'i><'col-md-8'p>>",
"buttons": [
{
extend: 'excelHtml5',
text: 'Export to Excel',
title: 'Inward Gate Register',
exportOptions: {
columns: ':visible:not(:last-child)' // Exclude first and last columns
}
},
{
extend: 'pdfHtml5',
text: 'Export to PDF',
title: 'Inward Gate Register',
exportOptions: {
columns: ':visible:not(:last-child)' // Exclude first and last columns
}
}]
});
@ -1579,7 +1646,7 @@ $(document).ready(function() {
var fromDate = $("#fromDate").datepicker("getDate");
var toDate = $("#toDate").datepicker("getDate");
var dateStr = data[1]; // Assuming the date is in the first column
var dateStr = data[0]; // Assuming the date is in the first column
// Convert dateStr to Date object
var dateParts = dateStr.split("-");