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
|
// Cost Center Routes
|
||||||
$routes->get('costListing', 'CostCenter::index');
|
$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('deleteCostCenter', 'CostCenter::deleteCostCenter');
|
||||||
$routes->get('exportcost', 'CostCenter::exportcost');
|
$routes->get('exportcost', 'CostCenter::exportcost');
|
||||||
|
|
||||||
|
|||||||
@ -56,6 +56,7 @@ class CostCenter extends BaseController
|
|||||||
*/
|
*/
|
||||||
public function fetchCostCenterDetails() {
|
public function fetchCostCenterDetails() {
|
||||||
$id = $this->request->getPost('id');
|
$id = $this->request->getPost('id');
|
||||||
|
log_message('error', 'id: ' . $id);
|
||||||
$CostCenterName = $this->request->getPost('CostCenterName');
|
$CostCenterName = $this->request->getPost('CostCenterName');
|
||||||
$CostCenterName = ($CostCenterName !== null && is_string($CostCenterName)) ? strtoupper(trim($CostCenterName)) : null;
|
$CostCenterName = ($CostCenterName !== null && is_string($CostCenterName)) ? strtoupper(trim($CostCenterName)) : null;
|
||||||
$userId = $this->session->get('userId');
|
$userId = $this->session->get('userId');
|
||||||
@ -64,11 +65,15 @@ class CostCenter extends BaseController
|
|||||||
|
|
||||||
$data = ['status' => false, 'message' => 'An error occurred while creating cost details'];
|
$data = ['status' => false, 'message' => 'An error occurred while creating cost details'];
|
||||||
|
|
||||||
if ($id == 0) {
|
if ((int)$id == 0) {
|
||||||
$lastccid = $this->costcenter_model->lastCCID();
|
$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);
|
$newccc = generateCostCenterCode($lastccid);
|
||||||
log_message('debug', 'newccc returned: ' . $newccc);
|
log_message('error', 'newly Generated ccc : ' . $newccc);
|
||||||
|
|
||||||
$Cost = ['CostCenterCode' => $newccc,
|
$Cost = ['CostCenterCode' => $newccc,
|
||||||
'CostCenterName' => $CostCenterName,
|
'CostCenterName' => $CostCenterName,
|
||||||
|
|||||||
@ -36,6 +36,7 @@ class Costcenter_model extends Model
|
|||||||
$builder = $this->db->table('t_costcenter_master');
|
$builder = $this->db->table('t_costcenter_master');
|
||||||
$builder->insert($Cost);
|
$builder->insert($Cost);
|
||||||
$aff_row = $this->db->affectedRows();
|
$aff_row = $this->db->affectedRows();
|
||||||
|
log_message('error', 'saveCostCenter Query: ' . $this->db->getLastQuery()->getQuery());
|
||||||
$this->db->transComplete();
|
$this->db->transComplete();
|
||||||
return $aff_row;
|
return $aff_row;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -20,6 +20,7 @@
|
|||||||
<table id="datatable" class="table table-bordered table-hover" style="background-color:#fff;font-size:12px;">
|
<table id="datatable" class="table table-bordered table-hover" style="background-color:#fff;font-size:12px;">
|
||||||
<thead style="background-color: #ddd;">
|
<thead style="background-color: #ddd;">
|
||||||
<tr>
|
<tr>
|
||||||
|
<th style="display:none;"></th>
|
||||||
<th>Create Date</th>
|
<th>Create Date</th>
|
||||||
<th>Create Time</th>
|
<th>Create Time</th>
|
||||||
<th>Cost Center Code</th>
|
<th>Cost Center Code</th>
|
||||||
@ -39,7 +40,8 @@
|
|||||||
$date = $createdat->format('d-m-Y');
|
$date = $createdat->format('d-m-Y');
|
||||||
$time = $createdat->format('h:i A');
|
$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 $date; ?></td>
|
||||||
<td align="right"><?php echo $time; ?></td>
|
<td align="right"><?php echo $time; ?></td>
|
||||||
<td><?php echo $record->code ?></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 src="https://cdn.datatables.net/plug-ins/1.10.16/sorting/datetime-moment.js"></script>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
$(function() {
|
$(function() {
|
||||||
$.fn.dataTable.moment('DD-MM-YYYY');
|
$.fn.dataTable.moment('DD-MM-YYYY HH:mm A');
|
||||||
$('#datatable').DataTable({
|
$('#datatable').DataTable({
|
||||||
"paging": true,
|
"paging": true,
|
||||||
"lengthChange": true,
|
"lengthChange": true,
|
||||||
|
|||||||
@ -14,41 +14,11 @@
|
|||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
}
|
}
|
||||||
</style>
|
</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>
|
<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;
|
|
||||||
}
|
|
||||||
th, td {
|
th, td {
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
}
|
}
|
||||||
.dataTables_wrapper {
|
|
||||||
width: 100%;
|
|
||||||
overflow-x: auto;
|
|
||||||
}
|
|
||||||
</style>
|
</style>
|
||||||
<script>
|
<script>
|
||||||
$(function() {
|
$(function() {
|
||||||
@ -82,7 +52,8 @@
|
|||||||
<thead style="background-color: #ddd;">
|
<thead style="background-color: #ddd;">
|
||||||
<tr>
|
<tr>
|
||||||
<th style="display:none;"></th>
|
<th style="display:none;"></th>
|
||||||
<th>Created Date</th>
|
<th>Create Date</th>
|
||||||
|
<th>Create time</th>
|
||||||
<th>IGR No</th>
|
<th>IGR No</th>
|
||||||
<th>PO No</th>
|
<th>PO No</th>
|
||||||
<th>Supplier Name</th>
|
<th>Supplier Name</th>
|
||||||
@ -99,14 +70,17 @@
|
|||||||
{ $index = 0;
|
{ $index = 0;
|
||||||
foreach($IGR as $record)
|
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 ?>" >
|
<tr id="<?php echo $index ?>" >
|
||||||
<th style="display:none;"><?php echo $record->CreatedDate ?></th>
|
<th style="display:none;"><?php echo $record->CreatedDate ?></th>
|
||||||
<td align="right"><?php
|
<td align="right"><?php echo $date; ?></td>
|
||||||
$createddate = new DateTime($record->CreatedDate);
|
<td align="right"><?php echo $time; ?></td>
|
||||||
echo $createddate->format('d-m-Y h:i A'); ?></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 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->SupplierName ?></td>
|
||||||
<td><?php echo $record->DeliveryChellanOrInvoiceNo ?></td>
|
<td><?php echo $record->DeliveryChellanOrInvoiceNo ?></td>
|
||||||
<td align="right"><?php
|
<td align="right"><?php
|
||||||
@ -1459,32 +1433,31 @@ function deleteBill(Billno,i){
|
|||||||
}
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
<!-- Latest DataTables JS -->
|
<script src="https://cdn.datatables.net/plug-ins/1.10.16/sorting/datetime-moment.js"></script>
|
||||||
<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/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.html5.min.js"></script>
|
||||||
<script src="https://cdn.datatables.net/buttons/2.3.4/js/buttons.print.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/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/pdfmake.min.js"></script>
|
||||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.2.7/vfs_fonts.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>
|
<script>
|
||||||
$(function () {
|
$(document).ready(function() {
|
||||||
$.fn.dataTable.moment('DD-MM-YYYY');
|
$.fn.dataTable.moment('DD-MM-YYYY HH:mm A');
|
||||||
$('#Inwardgateregistertable').DataTable({
|
$('#Inwardgateregistertable').DataTable({
|
||||||
"paging": true,
|
"paging": true,
|
||||||
"lengthChange": true,
|
"lengthChange": true,
|
||||||
"searching": true,
|
"searching": true,
|
||||||
"ordering": true,
|
"ordering": true,
|
||||||
|
"aaSorting": [[ 0, "desc" ]],
|
||||||
|
"order": [[0, "desc"]],
|
||||||
|
"pageLength": 10,
|
||||||
|
"lengthMenu": [5, 10, 20, 50, 100, 200, 500],
|
||||||
"info": true,
|
"info": true,
|
||||||
"autoWidth": true,
|
"autoWidth": true,
|
||||||
"scrollCollapse": true,
|
"dom": "<'row'<'col-sm-3'l><'col-sm-6 text-center'f><'col-sm-3 text-right'B>>" +
|
||||||
"scrollX": true,
|
"<'row'<'col-sm-12'tr>>" +
|
||||||
"pageLength": 25,
|
"<'row'<'col-sm-5'i><'col-sm-7'p>>",
|
||||||
"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": [
|
"buttons": [
|
||||||
{
|
{
|
||||||
extend: 'excelHtml5',
|
extend: 'excelHtml5',
|
||||||
@ -1498,6 +1471,13 @@ function deleteBill(Billno,i){
|
|||||||
extend: 'pdfHtml5',
|
extend: 'pdfHtml5',
|
||||||
text: 'Export to PDF',
|
text: 'Export to PDF',
|
||||||
title: 'Inward Gate Register',
|
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: {
|
exportOptions: {
|
||||||
columns: ':visible:not(:first-child):not(:last-child)' // Exclude first and last columns
|
columns: ':visible:not(:first-child):not(:last-child)' // Exclude first and last columns
|
||||||
}
|
}
|
||||||
@ -1506,3 +1486,16 @@ function deleteBill(Billno,i){
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
</script>
|
</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