Emergency PO changes-1 vadivel J 02-12--2024

This commit is contained in:
vadivelJ96 2024-12-02 18:19:37 +05:30
parent 845a12492a
commit 7ad0d2853c
4 changed files with 48 additions and 126 deletions

View File

@ -806,6 +806,9 @@ class Emergencypurchaseorder extends BaseController
$counts = $this->request->getPost('hidecounter');
$constants = $this->request->getPost('hideconstant');
$file = $this->request->getFiles();
dd($file);
$arr = [];
$prefile = array();

View File

@ -4783,7 +4783,7 @@ if (!empty($INRSYMBOL)) {
<div id="packagingcalmodel" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
aria-hidden="true" data-bs-backdrop="static" data-bs-keyboard="false" style="display: none;">
<div class="modal-dialog " style="width: 720px;" >
<div class="modal-dialog " style="width: 720px;">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">Packing Calculation On <span id="WeightTitle"></span></h4>
@ -4904,9 +4904,14 @@ if (!empty($INRSYMBOL)) {
<div class="row">
<div class="col-md-12">
<input type="button" class="btn btn-success" id="addmorebutton"
value=" + ADD FILES..">
<div id="newdiv"></div><!-- this div for add more section-->
<button type="button" class="btn btn-success" id="addMoreRevenueFileButton">Add
File</button>
<button type="button" class="btn btn-danger" id="removeRevenueFileButton">Remove
File</button>
<div id="newdiv"></div>
</div>
@ -7297,6 +7302,9 @@ if (!empty($INRSYMBOL)) {
formData.append('PaymentMethod', $('#PaymentMethod').val());
formData.append('workStatus', $('#workstatusValue').val());
//add igr files too here ..!!
// Perform form validation
if (validate()) {
if (document.getElementById('serviceTax').rows.length < 2) {
@ -8299,74 +8307,55 @@ if (!empty($INRSYMBOL)) {
var counterConstant = 0;
$(document).ready(function () {
$("#removeRevenueFileButton").hide();
});
$("#addMoreRevenueFileButton").click(function () {
let filesAdded = $(".revenuefiles").length;
$("#addmorebutton").click(function () {
if (counter > 4) {
alert("You have to upload five files only"); //this allows only 5 files;
return false;
if (filesAdded >= 5) {
alert("Maximum of five files Only be uploaded..!!");
return;
} else {
$("#removeRevenueFileButton").show();
counter++;
counterConstant++;
filesAdded++;
let newFile = filesAdded;
var div = document.createElement('div');
div.id = "divid" + counter;
div.className = "row";
div.id = "divid" + newFile;
div.className = "row revenuefiles mt-2";
div.innerHTML =
'<br>' +
'<div class="col-md-3">' +
'<label>Select File</label>' +
'<input type="file" name="browseFiles' + counterConstant + '" id="imag" onchange="Copyfilename(this.name); "><br>' +
'<input type="file" name="browseFiles' + newFile + '" "><br>' +
'</div>' +
'<div class="col-md-3" style="margin-top:1.0%; ">' +
'<button style="margin-right:2px;" class="btn btn-success" type="button" onclick="addRow(' + counter + ')"id="addbtn1" ><i class="fa fa-plus-square"></i></button> ' +
'<button class="btn btn-danger remove remove_this" id="removebtn' + counter + '" onclick="removeRow(this.id)"><i class="fa fa-minus-square"></i> </button>'
+
'</div>' +
'<div class="col-md-3" style="margin-top:1.8%; ">' +
'<div class="col-md-3" > ' +
'</div> ' +
'</div><br>';
'<br>';
$('#newdiv').append(div);
$('#hidecounter').val(counter);
$('#hideconstant').val(counterConstant);
if (counter > 1) {
alert("Add button click here"); //this allows only 5 files;
return false;
} else {
$('#addmorebutton').hide();
}
// if(counter > 1){
// alert("Add button click here");//this allows only 5 files;
// return false;
// }
// else {
// $('#addemorebutton').hide();
// }
$('#hidecounter').val(newFile);
$('#hideconstant').val(newFile);
}
})
$("#removeRevenueFileButton").click(function () {
let filesAdded = $(".revenuefiles").length;
if (filesAdded > 1) {
$(".revenuefiles:last").remove();
} else if (filesAdded == 1) {
$(".revenuefiles:last").remove();
$('#removeRevenueFileButton').hide();
}
@ -8375,77 +8364,6 @@ if (!empty($INRSYMBOL)) {
// var count = 0;
// var countConstant = 0;
function addRow(input) {
if (input < 5) {
if (input == 0) {
input = input + 1;
$("#addbtn" + input).hide();
$("#removebtn" + input).hide();
} else {
$("#addbtn" + input).hide();
$("#removebtn" + input).hide();
}
} else {
$("#addbtn" + input).show();
$("#removebtn" + input).show();
}
// alert(s);
if (counter > 4) {
alert("No more files to add"); //this allows only 5 files;
return false;
} else {
counter++;
counterConstant++;
//alert("count"+counterConstants);
var div = document.createElement('div');
div.id = "divid" + counter;
div.className = "row";
div.innerHTML =
'<div class="col-md-3">' +
'<label><br></label>' +
'<input type="file" name="browseFiles' + counterConstant + '" id="imag" onchange="Copyfilename(this.name); "><br>' +
'</div>' +
'<div class="col-md-3" style="margin-top:1.0%; ">' +
'<button style="margin-right:2px;" class="btn btn-success" type="button" onclick="addRow(' + counter + ')"id="addbtn1" ><i class="fa fa-plus-square"></i></button> ' +
'<button class="btn btn-danger remove remove_this" id="removebtn' + counter + '" onclick="removeRow(this.id)"><i class="fa fa-minus-square"></i> </button>'
+
'</div>' +
'<div class="col-md-3" style="margin-top:1.8%; ">' +
'<div class="col-md-3" > ' +
'</div> ' +
'</div>';
$('#newdiv').append(div);
$('#hidecounter').val(counter);
$('#hideconstant').val(counterConstant);
if (counter > 1) {
//alert("Next File choose + button click here");//this allows only 5 files;
//return false;
$('#addbtn').hide();
$("#removebtn").hide();
} else {
$('#addmorebutton').hide();
}
}
}
function rfilealert() {

View File

@ -2743,6 +2743,7 @@ if (!empty($RequistionDetails)) {
}
$('#editimportpomodel').modal('hide');
});

View File

@ -142,7 +142,7 @@ if (!empty($Emp)) {
<tr>
<th class="th">SNo</th>
<th class="th">Material Code</th>
<th class="th">Material Name</th>
<th class="th" style="text-align:left !important;">Material Name</th>
<th class="th">Uom</th>
<th class="th">Quantity</th>
<th class="th">Action</th>
@ -641,7 +641,7 @@ if (!empty($Emp)) {
var rowHtml = `<tr id="${temp}">
<td align="center">${temp}</td>
<td align="center">${materialCode}</td>
<td align="center">${materialName}</td>
<td align="left">${materialName}</td>
<td align="center">${uom}</td>
<td align="center">${quantity}</td>
<td align="center">