Merge branch 'CI4-Application' of bitbucket.org:venbainformationtechnology/ria into CI4-Application
This commit is contained in:
commit
939492f202
@ -65,7 +65,7 @@ $routes->get('rawmaterialdetailsautocomplete' , 'Rawmaterialdetails::autocomplet
|
||||
|
||||
// Cost Center Routes
|
||||
$routes->get('costListing', 'CostCenter::index');
|
||||
$routes->get('fetchCostCenterDetails', 'CostCenter::fetchCostCenterDetails');// for Ajax both add and edit....
|
||||
$routes->post('fetchCostCenterDetails', 'CostCenter::fetchCostCenterDetails');// for Ajax both add and edit....
|
||||
$routes->get('deleteCostCenter', 'CostCenter::deleteCostCenter');
|
||||
$routes->get('exportcost', 'CostCenter::exportcost');
|
||||
|
||||
|
||||
@ -56,6 +56,7 @@ class CostCenter extends BaseController
|
||||
*/
|
||||
public function fetchCostCenterDetails() {
|
||||
$id = $this->request->getPost('id');
|
||||
log_message('error', 'id: ' . $id);
|
||||
$CostCenterName = $this->request->getPost('CostCenterName');
|
||||
$CostCenterName = ($CostCenterName !== null && is_string($CostCenterName)) ? strtoupper(trim($CostCenterName)) : null;
|
||||
$userId = $this->session->get('userId');
|
||||
@ -64,11 +65,15 @@ class CostCenter extends BaseController
|
||||
|
||||
$data = ['status' => false, 'message' => 'An error occurred while creating cost details'];
|
||||
|
||||
if ($id == 0) {
|
||||
if ((int)$id == 0) {
|
||||
$lastccid = $this->costcenter_model->lastCCID();
|
||||
$lastccid = (int)$lastccid++;
|
||||
log_message('error', 'LAST CodeCenterID : ' . $lastccid);
|
||||
|
||||
$newccid = (int)$lastccid++;
|
||||
log_message('error', 'CodeCenterID with Incremented : ' . $newccid);
|
||||
|
||||
$newccc = generateCostCenterCode($lastccid);
|
||||
log_message('debug', 'newccc returned: ' . $newccc);
|
||||
log_message('error', 'newly Generated ccc : ' . $newccc);
|
||||
|
||||
$Cost = ['CostCenterCode' => $newccc,
|
||||
'CostCenterName' => $CostCenterName,
|
||||
|
||||
@ -36,6 +36,7 @@ class Costcenter_model extends Model
|
||||
$builder = $this->db->table('t_costcenter_master');
|
||||
$builder->insert($Cost);
|
||||
$aff_row = $this->db->affectedRows();
|
||||
log_message('error', 'saveCostCenter Query: ' . $this->db->getLastQuery()->getQuery());
|
||||
$this->db->transComplete();
|
||||
return $aff_row;
|
||||
}
|
||||
|
||||
@ -20,6 +20,7 @@
|
||||
<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>
|
||||
@ -39,7 +40,8 @@
|
||||
$date = $createdat->format('d-m-Y');
|
||||
$time = $createdat->format('h:i A');
|
||||
?>
|
||||
<tr></td>
|
||||
<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>
|
||||
@ -122,7 +124,7 @@
|
||||
<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');
|
||||
$.fn.dataTable.moment('DD-MM-YYYY HH:mm A');
|
||||
$('#datatable').DataTable({
|
||||
"paging": true,
|
||||
"lengthChange": true,
|
||||
|
||||
@ -14,42 +14,12 @@
|
||||
white-space: nowrap;
|
||||
}
|
||||
</style>
|
||||
<link rel="stylesheet" href="https://cdn.datatables.net/1.13.6/css/jquery.dataTables.min.css">
|
||||
<!-- Latest DataTables Buttons CSS -->
|
||||
<link rel="stylesheet" href="https://cdn.datatables.net/buttons/2.3.4/css/buttons.dataTables.min.css">
|
||||
<style>
|
||||
.dataTables_wrapper .dataTables_length select {
|
||||
background-color:white !important;
|
||||
}
|
||||
.dataTables_wrapper .dataTables_filter input {
|
||||
background-color: white !important;
|
||||
}
|
||||
button.dt-button, div.dt-button, a.dt-button, input.dt-button {
|
||||
background-color: white !important;
|
||||
}
|
||||
.dataTables_length, label{
|
||||
display: flex !important;
|
||||
}
|
||||
.dataTables_wrapper .dataTables_filter {
|
||||
text-align: center;
|
||||
}
|
||||
.dataTables_wrapper .dataTables_length {
|
||||
float: left;
|
||||
}
|
||||
.dataTables_wrapper .dt-buttons {
|
||||
float: right;
|
||||
}
|
||||
.dataTables_wrapper .clear {
|
||||
clear: both;
|
||||
}
|
||||
<style>
|
||||
|
||||
th, td {
|
||||
white-space: nowrap;
|
||||
}
|
||||
.dataTables_wrapper {
|
||||
width: 100%;
|
||||
overflow-x: auto;
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
<script>
|
||||
$(function() {
|
||||
var d = new Date();
|
||||
@ -82,7 +52,8 @@
|
||||
<thead style="background-color: #ddd;">
|
||||
<tr>
|
||||
<th style="display:none;"></th>
|
||||
<th>Created Date</th>
|
||||
<th>Create Date</th>
|
||||
<th>Create time</th>
|
||||
<th>IGR No</th>
|
||||
<th>PO No</th>
|
||||
<th>Supplier Name</th>
|
||||
@ -98,15 +69,18 @@
|
||||
if(!empty($IGR))
|
||||
{ $index = 0;
|
||||
foreach($IGR as $record)
|
||||
{ $index = $index +1;
|
||||
{ $index = $index +1;
|
||||
$createddate = new DateTime($record->CreatedDate);
|
||||
$datewithtime = $createddate->format('d-m-Y h:i A');
|
||||
$date = $createddate->format('d-m-Y');
|
||||
$time = $createddate->format('h:i A');
|
||||
?>
|
||||
<tr id="<?php echo $index ?>" >
|
||||
<th style="display:none;"><?php echo $record->CreatedDate ?></th>
|
||||
<td align="right"><?php
|
||||
$createddate = new DateTime($record->CreatedDate);
|
||||
echo $createddate->format('d-m-Y h:i A'); ?></td>
|
||||
<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>
|
||||
<td><a target="_blank" data-toggle="modal" data-target="#CostCentershow" data-id="<%=index%>" title="Cost Center" data-igrno="<?php echo $record->IGRNO ?>" data-pono="<?php echo $record->PONO ?>"><u><?php echo $record->PONO ?></u></a></td>
|
||||
<td><a data-toggle="modal" data-target="#CostCentershow" data-id="<?php echo $index;?>" data-igno="<?php echo $record->IGRNO;?>" data-pono="<?php echo $record->PONO ?>" target="_blank"> <u><?php echo $record->PONO ?></u></a></td>
|
||||
<td><?php echo $record->SupplierName ?></td>
|
||||
<td><?php echo $record->DeliveryChellanOrInvoiceNo ?></td>
|
||||
<td align="right"><?php
|
||||
@ -1459,50 +1433,69 @@ function deleteBill(Billno,i){
|
||||
}
|
||||
|
||||
</script>
|
||||
<!-- Latest DataTables JS -->
|
||||
<script src="https://cdn.datatables.net/1.13.6/js/jquery.dataTables.min.js"></script>
|
||||
<!-- Latest DataTables Buttons JS -->
|
||||
<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>
|
||||
$(function () {
|
||||
$.fn.dataTable.moment('DD-MM-YYYY');
|
||||
$('#Inwardgateregistertable').DataTable({
|
||||
"paging": true,
|
||||
"lengthChange": true,
|
||||
"searching": true,
|
||||
"ordering": true,
|
||||
"info": true,
|
||||
"autoWidth": true,
|
||||
"scrollCollapse": true,
|
||||
"scrollX": true,
|
||||
"pageLength": 25,
|
||||
"order": [[0, "desc"]], // Assuming the "Created Date" is the first column and you want to order by it in descending order
|
||||
"dom": '<"top"lBf>rt<"bottom"ip><"clear">', // Custom layout
|
||||
"buttons": [
|
||||
{
|
||||
extend: 'excelHtml5',
|
||||
text: 'Export to Excel',
|
||||
title: 'Inward Gate Register',
|
||||
exportOptions: {
|
||||
columns: ':visible:not(:first-child):not(:last-child)' // Exclude first and last columns
|
||||
}
|
||||
},
|
||||
{
|
||||
extend: 'pdfHtml5',
|
||||
text: 'Export to PDF',
|
||||
title: 'Inward Gate Register',
|
||||
exportOptions: {
|
||||
columns: ':visible:not(:first-child):not(:last-child)' // Exclude first and last columns
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<script src="https://cdn.datatables.net/plug-ins/1.10.16/sorting/datetime-moment.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>
|
||||
$(document).ready(function() {
|
||||
$.fn.dataTable.moment('DD-MM-YYYY HH:mm A');
|
||||
$('#Inwardgateregistertable').DataTable({
|
||||
"paging": true,
|
||||
"lengthChange": true,
|
||||
"searching": true,
|
||||
"ordering": true,
|
||||
"aaSorting": [[ 0, "desc" ]],
|
||||
"order": [[0, "desc"]],
|
||||
"pageLength": 10,
|
||||
"lengthMenu": [5, 10, 20, 50, 100, 200, 500],
|
||||
"info": true,
|
||||
"autoWidth": true,
|
||||
"dom": "<'row'<'col-sm-3'l><'col-sm-6 text-center'f><'col-sm-3 text-right'B>>" +
|
||||
"<'row'<'col-sm-12'tr>>" +
|
||||
"<'row'<'col-sm-5'i><'col-sm-7'p>>",
|
||||
"buttons": [
|
||||
{
|
||||
extend: 'excelHtml5',
|
||||
text: 'Export to Excel',
|
||||
title: 'Inward Gate Register',
|
||||
exportOptions: {
|
||||
columns: ':visible:not(:first-child):not(:last-child)' // Exclude first and last columns
|
||||
}
|
||||
},
|
||||
{
|
||||
extend: 'pdfHtml5',
|
||||
text: 'Export to PDF',
|
||||
title: 'Inward Gate Register',
|
||||
customize: function (doc) {
|
||||
doc.content[1].margin = [ 10, 0, 10, 0 ]; // left, top, right, bottom
|
||||
doc.pageSize = 'A4'; // Ensure it's A4
|
||||
doc.pageOrientation = 'landscape'; // Set landscape orientation
|
||||
doc.defaultStyle.fontSize = 10; // Set default font size
|
||||
doc.styles.tableHeader.fontSize = 12; // Set font size for header
|
||||
},
|
||||
exportOptions: {
|
||||
columns: ':visible:not(:first-child):not(:last-child)' // Exclude first and last columns
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.dataTables_wrapper .col-sm-3 .dataTables_length {
|
||||
float: left;
|
||||
}
|
||||
.dataTables_wrapper .col-sm-6 .dataTables_filter {
|
||||
float: none;
|
||||
text-align: center;
|
||||
}
|
||||
.dataTables_wrapper .col-sm-3 .dt-buttons {
|
||||
float: right;
|
||||
}
|
||||
</style>
|
||||
Loading…
Reference in New Issue
Block a user