Merge branch 'new_theme' of bitbucket.org:venbainformationtechnology/ria into new_theme

This commit is contained in:
Smart 2024-10-25 09:09:09 +05:30
commit 0b48980548
10 changed files with 463 additions and 97 deletions

View File

@ -42,23 +42,23 @@ class Amendmentpurchaseorder extends BaseController
{
if ($this->request->getMethod() === 'GET')
{
$currentYear = date('Y');
$currentMonth = date('m');
if ($this->request->getMethod() === 'GET')
{
$currentYear = date('Y');
$currentMonth = date('m');
$startOfMonth = "$currentYear-$currentMonth-01";
$endOfMonth = date('Y-m-t');
$fromDate = $startOfMonth;
$toDate = $endOfMonth;
} elseif ($this->request->getMethod() === 'POST') {
$fromDate = $this->request->getPost('fromDate');
$toDate = $this->request->getPost('toDate');
$fromDate = $startOfMonth;
$toDate = $endOfMonth;
} elseif ($this->request->getMethod() === 'POST') {
$fromDate = $this->request->getPost('fromDate');
$toDate = $this->request->getPost('toDate');
$fromDate = date('Y-m-d', strtotime($fromDate));
$toDate = date('Y-m-d', strtotime($toDate));
}
// $this->load->library('pagination');
$forwhat = 'amendment';
$forwhat = 'amendment';
$data['POData'] = $this->purchaseorder_model->purchaseorderListing($forwhat,$fromDate,$toDate);
$data['fromDate'] = date('d-m-Y', strtotime($fromDate));
@ -1340,8 +1340,6 @@ class Amendmentpurchaseorder extends BaseController
$createddt = get_current_date_time();
$updateddt = get_current_date_time();
$PaymentTerms = $this->request->getPost('PaymentTerms');
$beforePaymentTerms = $this->request->getPost('beforePaymentterms');
@ -1410,20 +1408,17 @@ class Amendmentpurchaseorder extends BaseController
}
$LastPO = $this->purchaseorder_model->addAmendPOMaster($POMaster, $CreateBy, $PONO);
$NewPO = '';
// if (count($LastPO) > 0) {
// $NewPO = $LastPO[0]['PONO'];
// }
// print_r($LastPO);die;
foreach ($LastPO as $PO) :
$NewPO = $PO['PONO'];
endforeach;
$PODetail = array('Status' => PO_AMENDED); //TO SET PARENT PO AS AMENDMENT STATUS
$APO = $this->purchaseorder_model->updateAmendPOMaster($PONO, $PODetail);
$APO = $this->purchaseorder_model->updateAmendPOMaster($PONO, $PODetail);
$LineItemStatus = REQITEM_NEW;
$LineItemStatus = REQITEM_NEW;
$igrvalue = $this->purchaseorder_model->selectigrmaster($PONO);
$igrvalue = $this->purchaseorder_model->selectigrmaster($PONO);
$po = '';
$igrno = '';

View File

@ -1670,64 +1670,72 @@ function updateIGRWeight(){
}
public function downloadFilesAsZip($igrno)
{
// Get all file details for the given IGR number
$fileDetails = $this->inwardgateregister_model->getAllIgrFileDetails($igrno);
if (empty($fileDetails)) {
// Display an alert message
echo '<script>alert("There are no files.");</script>';
redirect('ViewIGR', 'refresh');
return;
}
// Define the root path for files
$rootPath = ROOTPATH . 'public/uploads/Igrfiles/';
// Create a new ZIP archive
$zip = new ZipArchive();
// Define the name of the ZIP file
$zipFileName = $igrno . '.zip';
$zipFilePath = $rootPath . $zipFileName;
if ($zip->open($zipFilePath, ZipArchive::CREATE | ZipArchive::OVERWRITE) === TRUE) {
$filesAdded = false;
// Add each file to the ZIP archive
foreach ($fileDetails as $file) {
$filePath = $rootPath . $file->file;
if (file_exists($filePath)) {
if (!$zip->addFile($filePath, $file->filename)) {
// Handle error when adding file to ZIP
echo '<script>alert("Failed to add file: ' . $file->filename . '");</script>';
$zip->close();
redirect('ViewIGR', 'refresh');
return;
}
$filesAdded = true;
}
}
// Close the ZIP archive
$zip->close();
if ($filesAdded) {
// Return the ZIP file as a download
return $this->response->download($zipFilePath, null)->setFileName($zipFileName);
} else {
// Delete the empty ZIP file
if (file_exists($zipFilePath)) {
unlink($zipFilePath);
}
echo '<script>alert("There are no files.");</script>';
redirect('ViewIGR', 'refresh');
return;
}
} else {
echo '<script>alert("Failed to create ZIP file");</script>';
redirect('ViewIGR', 'refresh');
return;
}
}
{
// Get all file details for the given IGR number
$fileDetails = $this->inwardgateregister_model->getAllIgrFileDetails($igrno);
if (empty($fileDetails)) {
echo '<script>alert("There are no files.");</script>';
redirect('ViewIGR', 'refresh');
return;
}
// Define the root path for files
$rootPath = ROOTPATH . 'public/uploads/Igrfiles/';
// Check if root path is valid
if (!is_dir($rootPath)) {
echo '<script>alert("Invalid file directory.");</script>';
return;
}
// Create a new ZIP archive
$zip = new ZipArchive();
$zipFileName = $igrno . '.zip';
$zipFilePath = $rootPath . $zipFileName;
if ($zip->open($zipFilePath, ZipArchive::CREATE | ZipArchive::OVERWRITE) === TRUE) {
$filesAdded = false;
// Add each file to the ZIP archive
foreach ($fileDetails as $file) {
$filePath = $rootPath . $file->file;
// Check if file exists
if (!file_exists($filePath)) {
log_message('error', 'File not found: ' . $filePath);
continue;
}
$sanitizedFilename = preg_replace('/[^a-zA-Z0-9_\-\.]/', '_', $file->filename);
if (!$zip->addFile($filePath, $sanitizedFilename)) {
log_message('error', 'Failed to add file: ' . $sanitizedFilename);
$zip->close();
redirect('ViewIGR', 'refresh');
return;
}
$filesAdded = true;
}
// Close the ZIP archive
$zip->close();
if ($filesAdded) {
return $this->response->download($zipFilePath, null)->setFileName($zipFileName);
} else {
if (file_exists($zipFilePath)) {
unlink($zipFilePath);
}
echo '<script>alert("No files were added to the ZIP.");</script>';
redirect('ViewIGR', 'refresh');
return;
}
} else {
echo '<script>alert("Failed to create ZIP file");</script>';
redirect('ViewIGR', 'refresh');
return;
}
}
}

View File

@ -254,7 +254,15 @@ class StockController extends BaseController
// Bag Stock details starts
public function loadView_bagStockDetails(){}
public function loadView_bagStockDetails(){
$data=[];
$this->global['pageTitle']='Bag Stock Details';
return $this->loadViews("bagStockDetails", $this->global, $data, NULL);
}
public function updateBagStockDetails(){}

View File

@ -389,8 +389,6 @@ mstr.CourierNo,pom.Status,pom.POType') //,bill.BillNo,bill.FilePath,
function purchaseorderListing($forwhat ,$fromDate='',$toDate='')
{
$builder = $this->db->table('t_purchaseorder_master POMast')->distinct()
->select('POMast.PONO,POMast.CreatedDate,supp.SupplierName,TotalOrderValue,PODate,Stat.StatusName,Stat.StatusCode,POMast.POType as ReqType,DeliveryDate,DeliverySchedule,DeliveryOption,POMast.CapitalRange')
@ -1595,8 +1593,6 @@ mstr.CourierNo,pom.Status,pom.POType') //,bill.BillNo,bill.FilePath,
function getPOList($type, $fromDate , $toDate)
{
$builder = $this->db->table('t_purchaseorder_master mast')->distinct()
->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')

View File

@ -109,7 +109,7 @@
<thead>
<tr>
<!-- <th>#</th> -->
<th>PO Date</th>
<th>Created Date</th>
<th>PONO</th>
<th>PO Type</th>
<th>Supplier Name</th>
@ -131,7 +131,7 @@
?>
<tr id="<?php echo $index; ?>">
<!-- <td align="left"><?php echo $index; ?></td> -->
<td><?php $Pdt = new DateTime($record->PODate);
<td><?php $Pdt = new DateTime($record->CreatedDate);
$PODate = $Pdt->format('d-m-Y');
echo $PODate
?></td>

View File

@ -0,0 +1,356 @@
<style type="text/css">
.num {
text-align: right;
}
.fht-table,
.fht-table thead,
.fht-table tfoot,
.fht-table tbody,
.fht-table tr,
.fht-table th,
.fht-table td {
margin: 0;
}
.fht-table td {
text-align: center;
}
.fht-table td:hover {
background-color: #00a65a;
color: #ffffff;
}
.fht-table {
border: 0 none;
height: auto;
width: auto;
border-collapse: collapse;
border-spacing: 0;
/*table-layout: fixed; Algoritmo de distribucion fijo */
white-space: nowrap;
}
.fht-table th,
.fht-table td {
overflow: hidden;
}
.fht-table-wrapper,
.fht-table-wrapper .fht-thead,
.fht-table-wrapper .fht-tfoot,
.fht-table-wrapper .fht-fixed-column .fht-tbody,
.fht-table-wrapper .fht-fixed-body .fht-tbody,
.fht-table-wrapper .fht-tbody {
overflow: hidden;
position: relative;
}
.fht-table-wrapper .fht-fixed-body .fht-tbody,
.fht-table-wrapper .fht-tbody {
overflow: auto;
}
.fht-table-wrapper .fht-table .fht-cell {
overflow: hidden;
height: 1px;
}
.fht-table-wrapper .fht-fixed-column,
.fht-table-wrapper .fht-fixed-body {
top: 0;
left: 0;
position: absolute;
}
.fht-table-wrapper .fht-fixed-column {
z-index: 1;
}
.fht-fixed-body .fht-thead table {
margin-right: 20px;
border: 0 none;
}
/*For Examples*/
.ContenedorTabla {
height: 500px;
margin: 0 auto;
overflow: auto;
width: auto;
position: relative;
}
.header,
.main {
display: inline-block;
height: auto;
width: 100%;
}
.titulosHeader {
border-bottom: 1px solid #e8bb25;
height: auto;
margin-bottom: 10px;
padding-bottom: 8px;
padding-top: 8px;
width: 100%;
}
.celda_encabezado_general {
background-color: #00a65a;
border: 1px solid #ccc;
color: #ffffff;
font-weight: bold;
padding: 2px 4px;
text-align: center;
}
._Separador {
background-color: #fff;
height: 12px;
border-left: 1px solid #ccc;
border-right: 1px solid #ccc;
width: 7px;
}
._Separador div {
width: 4px;
}
.celda_normal {
/*background-color: #fff;*/
/* <!-- ad9271 into ffffff brown-light to green-light --> */
border: 1px solid #ccc;
padding: 2px 4px;
}
/*style excel*/
.excel_cell {
border: 1px solid #CCC;
color: #222;
text-align: center;
font-size: 13px;
font-weight: normal;
padding: 4px;
white-space: pre-line;
empty-cells: show;
}
._cell_header {
background-color: #EEE;
}
._cell_Default {
background-color: #FFF;
text-align: left;
}
.excel_cell div {
width: 30px;
height: 20px;
}
.modal {
padding-right: 30% ! important;
}
</style>
<div class="content-page">
<div class="content">
<!-- Start Content-->
<div class="container-fluid">
<!-- start page title -->
<div>
<div class="row">
<div class="col-6">
<div class="page-title-box page-title-box-alt">
<div class="page-title-right">
<ol class="breadcrumb m-0">
<li class="breadcrumb-item"><a href="javascript: void(0);">Stocks</a></li>
<li class="breadcrumb-item active">
<h4 class="page-title">Bag Stock Details </h4>
</li>
</ol>
</div>
</div>
</div>
<div class="col-6 text-right">
<!-- Right-aligned buttons or links can be added here -->
</div>
</div>
<div class="row">
<div class="col-12">
<div class="card">
<div class="card-body">
<form action="<?= base_url('bagStockDetails'); ?>" method="post">
<div class="row">
<div class="col-3">
<?php $today = date('M-Y'); ?>
<input type="text" name="month" id="month" value=""
class="form-control mt-2" data-provide="datepicker"
data-date-format="M-yyyy" data-date-min-view-mode="1">
</div>
<div class="form-group col-md-2">
<button type="submit" class="btn btn-success"> Change Month </button>
</div>
</div>
</form>
<table id="data-table">
<thead>
<tr>
<th rowspan="4" colspan="1">
Material <br><br> Customer <br><br> Date
</th>
</tr>
<tr>
<?php foreach ($materials as $material) { ?>
<th colspan="4"><?php echo ($material) ?></th>
<?php } ?>
</tr>
<tr>
<?php foreach ($materials as $material) { ?>
<th colspan="4" contenteditable="true">
customers
</th>
<?php } ?>
</tr>
<tr>
<?php foreach ($materials as $material) { ?>
<th>info1</th>
<th>info2</th>
<th>info3</th>
<th>info4</th>
<?php } ?>
</tr>
</thead>
<tbody>
<tr>
<td>23-10-2024</td>
<td>472</td>
<td></td>
<td>-</td>
<td>472</td>
<td>472</td>
<td></td>
<td>-</td>
<td>472</td>
</tr>
<!-- Add more rows as needed -->
</tbody>
</table>
<!-- Add table-responsive for horizontal scroll -->
<div class="table-responsive">
<table id="bagStockDetailsTableId" class="fht-table table-striped"
style="font-size: small;">
<thead>
<tr>
<th class="celda_encabezado_general" style="padding: 10px;">S.NO </th>
<th class="celda_encabezado_general" style="padding: 10px;">IGR No </th>
</tr>
</thead>
<tbody style="background-color: #fff;">
<tr id="1">
<td width="45" height="45" class="celda_normal">1</td>
<td class="celda_normal">
data 2
</td>
</tr>
</tbody>
</table>
</div><!-- End table-responsive -->
<div class="row">
<div class="col-md-12 text-right">
<input type="button" class="btn btn-success" id="saveId" value="save">
</div>
</div>
</div>
</div> <!-- End card-body -->
</div> <!-- End card -->
</div> <!-- End col -->
</div> <!-- End row -->
</div>
</div> <!-- End container-fluid -->
</div>
</div>
<script type="text/javascript">
$(document).ready(function () {
$('#saveId').click(function () {
//table to json function
var updateBagStockDetails = $("#bagStockDetailsTableId").tableToJSON();
updateBagStockDetails = JSON.stringify(incomingSilicaSandDetailsData);
$('#loader').show();
$.ajax({
data: {
updateBagStockDetails
},
type: "POST",
url: "<?php echo base_url() ?>updateBagStockDetails",
success: function (data) {
if (data) {
$('#loader').hide();
alert(data);
}
}
});
});
});
</script>

View File

@ -202,7 +202,7 @@
<div class="col-md-3">
<label for="supplierid" class="col-form-label">Supplier </label>
</div>
<div class="col-md-5">
<div class="col">
<select name="supplierid" id="supplierid" class="form-control" required>
</select>
</div>
@ -211,7 +211,7 @@
<div class="col-md-3">
<label for="supplierid" class="col-form-label">Item Description </label>
</div>
<div class="col-md-5">
<div class="col">
<textarea name="item_description" id="item_description" class="form-control"></textarea>
</div>
</div>
@ -219,7 +219,7 @@
<div class="col-md-3">
<label for="cost" class="col-form-label">Cost</label>
</div>
<div class="col-md-5">
<div class="col">
<input type="number" name="cost" id="cost" class="form-control" required onchange="totalCalculate()">
</div>
</div>
@ -227,7 +227,7 @@
<div class="col-md-3">
<label for="cost" class="col-form-label">CGST</label>
</div>
<div class="col-md-5">
<div class="col">
<input type="number" name="cgst" id="cgst" class="form-control" onchange="totalCalculate()">
</div>
</div>
@ -235,7 +235,7 @@
<div class="col-md-3">
<label for="cost" class="col-form-label">SGST</label>
</div>
<div class="col-md-5">
<div class="col">
<input type="number" name="sgst" id="sgst" class="form-control" onchange="totalCalculate()">
</div>
</div>
@ -243,7 +243,7 @@
<div class="col-md-3">
<label for="igst" class="col-form-label">IGST</label>
</div>
<div class="col-md-5">
<div class="col">
<input type="number" name="igst" id="igst" class="form-control" onchange="totalCalculate()">
</div>
</div>
@ -251,7 +251,7 @@
<div class="col-md-3">
<label for="cost" class="col-form-label">Total</label>
</div>
<div class="col-md-5">
<div class="col">
<input type="number" name="total" id="total" class="form-control">
</div>
</div>
@ -260,7 +260,7 @@
<label for="transporterfile" class="col-form-label">Transporter File</label>
</div>
<div class="col-md-5">
<div class="col">
<input type="file" name="transporterfile" id="transporterfile" class="form-control">
<input type="hidden" name="transporterfile_name" id="transporterfile_name">
<small id="fileHelp" class="form-text text-muted">
@ -272,7 +272,7 @@
<div class="col-md-3">
<label for="note" class="col-form-label">Notes</label>
</div>
<div class="col-md-5">
<div class="col">
<textarea name="remarks" id="remarks" class="form-control"></textarea>
</div>
</div>

View File

@ -767,7 +767,7 @@
<a href="<?php echo base_url(); ?>incomingSilicaSandDetails" class="dropdown-item"><i class="ri-file-info-line align-middle mr-1"></i>incoming silica sand Details</a>
<a href="<?php echo base_url(); ?>incomingSilicaSandDetails" class="dropdown-item"><i class="ri-file-info-line align-middle mr-1"></i>Bag Stock Details</a>
<a href="<?php echo base_url(); ?>bagStockDetails" class="dropdown-item"><i class="ri-file-info-line align-middle mr-1"></i>Bag Stock Details</a>
</div>
</div>
</li>

View File

@ -108,7 +108,7 @@ if (empty($Status)) {
<table id="po_release" class="table table-bordered table-hover">
<thead>
<tr>
<th>PO Date</th>
<th>Created Date</th>
<th>PONO</th>
<th>PO Type</th>
<th>Cost Center</th>
@ -135,7 +135,7 @@ if (empty($Status)) {
//echo $index;
?>
<tr id="<?php echo $index ?>">
<td><?php $podt = new DateTime($record->PODate);
<td><?php $podt = new DateTime($record->CreatedDate);
$PODate = $podt->format('d-m-Y');
echo $PODate;
?></td>

View File

@ -245,10 +245,13 @@
<td><?php echo $record->TransporterName ?></td>
<td><?php echo $record->IGRStatus == 'ST074' ? 'Draft' : 'Completed'; ?></td>
<td>
<?php if(!empty($record->IGRNO)){ ?>
<a target="_blank" href="<?php echo base_url('download-files/' . $record->IGRNO); ?>">
<i class="fa fa-download" style="text-align: center;"></i>
</a>
&nbsp;
<?php } ?>
<?php if (!empty($record->FilePath)) { ?>
<!-- <a target="_blank" data-toggle="modal" data-target="#Fileshow" data-id="<%=index%>" title="Files" data-igrno="<?php echo $record->IGRNO ?>" data-pono="<?php echo $record->PONO ?>"><i class="fa fa-clone" style="text-align: center;"></i></a> -->
<?php } else if (!empty($record->file)) { ?>