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

This commit is contained in:
vadivel J 2024-10-25 10:52:48 +05:30
commit 1779f3ab06
4 changed files with 860 additions and 871 deletions

View File

@ -237,7 +237,7 @@ class Ipinvoice_model extends Model
->join('ip_invoice_items b', 'a.invoice_id = b.invoice_id', 'left') ->join('ip_invoice_items b', 'a.invoice_id = b.invoice_id', 'left')
->join('ip_invoice_item_amounts c', 'b.item_id = c.item_id', 'left') ->join('ip_invoice_item_amounts c', 'b.item_id = c.item_id', 'left')
->where('a.invoice_date_created', date('Y-m-d')) ->where('a.invoice_date_created', date('Y-m-d'))
->where('a.invoice_status_id', 2); ->whereIn('a.invoice_status_id', [2,5]);
$query = $builder->get(); $query = $builder->get();
return $query->getRow(); // Assuming you want a single row of aggregated results return $query->getRow(); // Assuming you want a single row of aggregated results
@ -270,7 +270,7 @@ class Ipinvoice_model extends Model
->join('ip_invoice_items b', 'a.invoice_id = b.invoice_id', 'left') ->join('ip_invoice_items b', 'a.invoice_id = b.invoice_id', 'left')
->join('ip_invoice_item_amounts c', 'b.item_id = c.item_id', 'left') ->join('ip_invoice_item_amounts c', 'b.item_id = c.item_id', 'left')
->where('a.invoice_date_created >=', $fiscalMonthStart) ->where('a.invoice_date_created >=', $fiscalMonthStart)
->where('a.invoice_status_id', 2); ->whereIn('a.invoice_status_id', [2,5]);
// Execute the query // Execute the query
$query = $builder->get(); $query = $builder->get();
@ -308,7 +308,7 @@ class Ipinvoice_model extends Model
->join('ip_invoice_items b', 'a.invoice_id = b.invoice_id', 'left') ->join('ip_invoice_items b', 'a.invoice_id = b.invoice_id', 'left')
->join('ip_invoice_item_amounts c', 'b.item_id = c.item_id', 'left') ->join('ip_invoice_item_amounts c', 'b.item_id = c.item_id', 'left')
->where('a.invoice_date_created >=', $fiscalYearStart) ->where('a.invoice_date_created >=', $fiscalYearStart)
->where('a.invoice_status_id', 2); ->whereIn('a.invoice_status_id', [2,5]);
// Execute the query // Execute the query
$query = $builder->get(); $query = $builder->get();

View File

@ -164,6 +164,27 @@ $datefordropdown = format_date($datefordropdown, 0, 'M-Y');
.modal { .modal {
padding-right: 30% ! important; padding-right: 30% ! important;
} }
/* #drierTable th:nth-child(1),
#drierTable th:nth-child(2),
#drierTable td:nth-child(1),
#drierTable td:nth-child(2) {
position: sticky;
left: 0;
background-color: white;
z-index: 2;
border-right: 1px solid #ddd;
}
#drierTable th:nth-child(1),
#drierTable td:nth-child(1) {
z-index: 3;
} */
</style> </style>
<div class="content-page"> <div class="content-page">
<div class="content"> <div class="content">

View File

@ -36,7 +36,10 @@ $(function() {
$("#Date").datepicker({ $("#Date").datepicker({
// minDate : 'now', // minDate : 'now',
maxDate: 'now', maxDate: 'now',
dateFormat: 'dd-mm-yy',changeMonth: true, changeYear: true,yearRange: '-100:+0' dateFormat: 'dd-mm-yy',
changeMonth: true,
changeYear: true,
yearRange: '-100:+0'
}); });
@ -47,8 +50,8 @@ $(function() {
.num { .num {
text-align: left; text-align: left;
} }
.select2
{ .select2 {
width: 100% ! important; width: 100% ! important;
} }
</style> </style>
@ -161,7 +164,9 @@ $(function() {
<div class="modal-content"> <div class="modal-content">
<div class="modal-header"> <div class="modal-header">
<button type="button" class="close" data-dismiss="modal">&times;</button> <button type="button" class="close" data-dismiss="modal">&times;</button>
<center><h4>Add Line Item </h4></center> <center>
<h4>Add Line Item </h4>
</center>
</div> </div>
<div align="left"> <div align="left">
@ -231,7 +236,9 @@ $(function() {
</div> </div>
<div class="modal-footer"> <div class="modal-footer">
<a class="btn btn-info font addClick" ID="addClick" ><i class="fa fa-plus"></i>&nbsp;&nbsp;<span class="bold">Add</span></a> <a class="btn btn-info font addClick" ID="addClick"><i
class="fa fa-plus"></i>&nbsp;&nbsp;<span
class="bold">Add</span></a>
<a class="btn btn-info" data-dismiss="modal" value="Cancel">cancel</a> <a class="btn btn-info" data-dismiss="modal" value="Cancel">cancel</a>
</div> </div>
</div> </div>
@ -248,7 +255,9 @@ $(function() {
<div class="modal-content"> <div class="modal-content">
<div class="modal-header"> <div class="modal-header">
<button type="button" class="close" data-dismiss="modal">&times;</button> <button type="button" class="close" data-dismiss="modal">&times;</button>
<center><h4>Edit Line Item </h4></center> <center>
<h4>Edit Line Item </h4>
</center>
</div> </div>
<div align="left"> <div align="left">
@ -306,7 +315,9 @@ $(function() {
</div> </div>
<div class="modal-footer"> <div class="modal-footer">
<a class="btn btn-info font EditItem" ID="EditItem" ><i class="fa fa-plus"></i>&nbsp;&nbsp;<span class="bold">Edit</span></a> <a class="btn btn-info font EditItem" ID="EditItem"><i
class="fa fa-plus"></i>&nbsp;&nbsp;<span
class="bold">Edit</span></a>
<a class="btn btn-info" data-dismiss="modal" value="Cancel">cancel</a> <a class="btn btn-info" data-dismiss="modal" value="Cancel">cancel</a>
</div> </div>
</div> </div>
@ -328,7 +339,9 @@ $(function() {
<div class="modal-content"> <div class="modal-content">
<div class="modal-header"> <div class="modal-header">
<button type="button" class="close" data-dismiss="modal">&times;</button> <button type="button" class="close" data-dismiss="modal">&times;</button>
<center><h4>View Line Item </h4></center> <center>
<h4>View Line Item </h4>
</center>
</div> </div>
<div align="left"> <div align="left">
@ -400,7 +413,8 @@ $(function() {
</div> </div>
<div class="row" style="padding: 0px 15px 0px 10px;"> <div class="row" style="padding: 0px 15px 0px 10px;">
<table id="mytable" class="table table-bordered table-hover editableTable" style="background-color:#fff;font-size:12px;"> <table id="mytable" class="table table-bordered table-hover editableTable"
style="background-color:#fff;font-size:12px;">
<thead> <thead>
<th>SNO</th> <th>SNO</th>
<th>Item Code</th> <th>Item Code</th>
@ -448,12 +462,23 @@ $(function() {
<td> <td>
<a data-id="<?php echo $index ; ?>" data-userid="<?php echo $index ; ?>" data-target='#EditItem' data-toggle="modal" href="#EditItem"><i class="fa fa-pencil" data-toggle="tooltip" title="Click here to view/Edit the <?php echo $record->MaterialCode ; ?> Material details"></i>&nbsp;&nbsp;&nbsp;</a> <a onclick = "RemoveList(<?php echo $index ; ?>)" class="link" data-id="<?php echo $record->MaterialCode ; ?>" data-userid="<?php echo $index ; ?>" id="Del"><span class="glyphicon glyphicon-trash"></span></a></td> <a data-id="<?php echo $index ; ?>" data-userid="<?php echo $index ; ?>"
data-target='#EditItem' data-toggle="modal" href="#EditItem"><i
class="fa fa-pencil" data-toggle="tooltip"
title="Click here to view/Edit the <?php echo $record->MaterialCode ; ?> Material details"></i>&nbsp;&nbsp;&nbsp;</a>
<a onclick="RemoveList(<?php echo $index ; ?>)" class="link"
data-id="<?php echo $record->MaterialCode ; ?>"
data-userid="<?php echo $index ; ?>" id="Del"><span
class="glyphicon glyphicon-trash"></span></a>
</td>
<?php <?php
}else {?> }else {?>
<td> <td>
<a data-id="<?php echo $index ; ?>" data-userid="<?php echo $index ; ?>" data-target='#ViewItem' data-toggle="modal" href="#ViewItem"><i class="fa fa-eye" data-toggle="tooltip" title="Click here to view the <?php echo $record->MaterialCode ; ?> Material details"></i>&nbsp;&nbsp;&nbsp;</a> <a data-id="<?php echo $index ; ?>" data-userid="<?php echo $index ; ?>"
data-target='#ViewItem' data-toggle="modal" href="#ViewItem"><i class="fa fa-eye"
data-toggle="tooltip"
title="Click here to view the <?php echo $record->MaterialCode ; ?> Material details"></i>&nbsp;&nbsp;&nbsp;</a>
</td> </td>
<?php <?php
}?> }?>
@ -481,8 +506,10 @@ $(function() {
<?php if($StatusCode == STORE_DRAFT) <?php if($StatusCode == STORE_DRAFT)
{ ?> { ?>
<a class="btn btn-success Save" ID="Save" onclick="Save(0)" >&nbsp;&nbsp;<span class="bold">Save</span></a> <a class="btn btn-success Save" ID="Save" onclick="Save(0)">&nbsp;&nbsp;<span
<a class="btn btn-success submit" ID="submit" onclick="Save(1)" >&nbsp;&nbsp;<span class="bold">Submit</span></a> class="bold">Save</span></a>
<a class="btn btn-success submit" ID="submit" onclick="Save(1)">&nbsp;&nbsp;<span
class="bold">Submit</span></a>
<input type="reset" class="btn btn-success"> <input type="reset" class="btn btn-success">
<?php } <?php }
@ -490,13 +517,15 @@ $(function() {
{?> {?>
<!--<a class="btn btn-success" ID="update" onclick="update()" >&nbsp;&nbsp;<span class="bold">Update</span></a> <!--<a class="btn btn-success" ID="update" onclick="update()" >&nbsp;&nbsp;<span class="bold">Update</span></a>
<a class="btn btn-success" href="<?php echo base_url(); ?>Requisition" ID="cancel">&nbsp;&nbsp;<span class="bold">Cancel</span></a> --> <a class="btn btn-success" href="<?php echo base_url(); ?>Requisition" ID="cancel">&nbsp;&nbsp;<span class="bold">Cancel</span></a> -->
<a class="btn btn-success Save" ID="submit" onclick="Save(1)" >&nbsp;&nbsp;<span class="bold">Update</span></a> <a class="btn btn-success Save" ID="submit" onclick="Save(1)">&nbsp;&nbsp;<span
class="bold">Update</span></a>
<?php } <?php }
elseif (($StatusCode==STORE_APPROVAL)||($StatusCode==STORE_REJECT)) elseif (($StatusCode==STORE_APPROVAL)||($StatusCode==STORE_REJECT))
{?> {?>
<a class="btn btn-success Save" ID="submit" onclick="Redirect()" >&nbsp;&nbsp;<span class="bold">OK</span></a> <a class="btn btn-success Save" ID="submit" onclick="Redirect()">&nbsp;&nbsp;<span
class="bold">OK</span></a>
<?php }?> <?php }?>
@ -523,12 +552,11 @@ elseif (($StatusCode==STORE_APPROVAL)||($StatusCode==STORE_REJECT))
<td align="left"><%=Remarks%></td> <td align="left"><%=Remarks%></td>
<td> <td>
<a data-target='#EditItem' data-id="<%=index%>" data-userid="<%=index%>" data-toggle="modal" href="#EditItem"><i class="fa fa-pencil" data-toggle="tooltip" title="Click here to view/Edit the <%=MaterialCode%> Material details"></i>&nbsp;&nbsp;&nbsp;</a> <a href='#' onclick = "RemoveList(<%=index%>)" class="link" data-id="<%=index%>" data-userid="<%=index%>" id="Del" ><span class="glyphicon glyphicon-trash"></span></a> <a data-target='#EditItem' data-id="<%=index%>" data-userid="<%=index%>" data-toggle="modal" href="#EditItem"><i
class="fa fa-pencil" data-toggle="tooltip"
title="Click here to view/Edit the <%=MaterialCode%> Material details"></i>&nbsp;&nbsp;&nbsp;</a> <a
href='#' onclick="RemoveList(<%=index%>)" class="link" data-id="<%=index%>" data-userid="<%=index%>"
id="Del"><span class="glyphicon glyphicon-trash"></span></a>
</td> </td>
</tr> </tr>
@ -542,18 +570,16 @@ elseif (($StatusCode==STORE_APPROVAL)||($StatusCode==STORE_REJECT))
<!--copy script--> <!--copy script-->
<script> <script>
var isExceed = 0; var isExceed = 0;
function isNumberKey(evt)
{ function isNumberKey(evt) {
var charCode = (evt.which) ? evt.which : evt.keyCode; var charCode = (evt.which) ? evt.which : evt.keyCode;
if (charCode != 46 && charCode > 31 if (charCode != 46 && charCode > 31 &&
&& (charCode < 48 || charCode > 57)) (charCode < 48 || charCode > 57))
return false; return false;
return true; return true;
} }
</script>
<script>
$(function() { $(function() {
var j = 0; var j = 0;
var ReqLineItem = <?php echo json_encode($LineItem, JSON_PRETTY_PRINT) ?>; var ReqLineItem = <?php echo json_encode($LineItem, JSON_PRETTY_PRINT) ?>;
@ -584,12 +610,13 @@ $(function() {
}).appendTo('form'); }).appendTo('form');
}); });
$( ".datePicker" ).datepicker({ dateFormat: 'dd/mm/yy' }); $(".datePicker").datepicker({
dateFormat: 'dd/mm/yy'
});
//Initialize Select2 Elements //Initialize Select2 Elements
}); });
</script>
<script>
$('#CostCenter').change(function() { $('#CostCenter').change(function() {
var id = $('#CostCenter').val(); var id = $('#CostCenter').val();
@ -598,8 +625,7 @@ var id = $('#CostCenter').val();
$.each(y, function(idx, obj) { $.each(y, function(idx, obj) {
// alert(obj.PONO); // alert(obj.PONO);
if(id == obj.CostCenterCode) if (id == obj.CostCenterCode) {
{
//alert(obj.BudgetAmount); //alert(obj.BudgetAmount);
$("#BudgetAmount").val(obj.BudgetAmount); $("#BudgetAmount").val(obj.BudgetAmount);
@ -610,10 +636,6 @@ var id = $('#CostCenter').val();
}); });
</script>
<script>
$('#MaterialCode').change(function() { $('#MaterialCode').change(function() {
var id = $('#MaterialCode').val(); var id = $('#MaterialCode').val();
@ -631,24 +653,21 @@ $("#UOM").val('');
} }
}); });
}); });
</script>
<script>
function addHidden(theForm, key, value) { function addHidden(theForm, key, value) {
// Create a hidden input element, and append it to the form: // Create a hidden input element, and append it to the form:
var input = document.createElement('input'); var input = document.createElement('input');
input.type = 'hidden'; input.type = 'hidden';
input.name = key;'name-as-seen-at-the-server'; input.name = key;
input.id = key;'name-as-seen-at-the-server'; 'name-as-seen-at-the-server';
input.id = key;
'name-as-seen-at-the-server';
input.value = value; input.value = value;
theForm.append(input); theForm.append(input);
} }
$("#mypo").on("shown.bs.modal", function(e) { $("#mypo").on("shown.bs.modal", function(e) {
if($("option:selected", $("#CostCenter")).val() == '-1') if ($("option:selected", $("#CostCenter")).val() == '-1') {
{
alert('Please select the CostCenter '); alert('Please select the CostCenter ');
e.close(); e.close();
} }
@ -656,17 +675,14 @@ $("#mypo").on("shown.bs.modal", function(e) {
var index = <?php echo $index; ?>; var index = <?php echo $index; ?>;
$('.addClick').click(function() $('.addClick').click(function() {
{
if ($("#MaterialCode option:selected").val() =='-1' ) if ($("#MaterialCode option:selected").val() == '-1') {
{
alert('Please Select the MaterialCode '); alert('Please Select the MaterialCode ');
return false; return false;
} }
if(document.getElementById('Quantity').value == '' ) if (document.getElementById('Quantity').value == '') {
{
alert('Please Enter the Quantity'); alert('Please Enter the Quantity');
return false; return false;
@ -691,7 +707,15 @@ $("#mypo").on("shown.bs.modal", function(e) {
var template = jQuery("#tempList").html(); var template = jQuery("#tempList").html();
$('#mytab').append(_.template(template,{index:temp,MaterialCode:MaterialCode,MaterialName:Description,UOM:UOM,Quantity:Quantity,Remarks:Remarks,IssuedQty:IssuedQty})); $('#mytab').append(_.template(template, {
index: temp,
MaterialCode: MaterialCode,
MaterialName: Description,
UOM: UOM,
Quantity: Quantity,
Remarks: Remarks,
IssuedQty: IssuedQty
}));
var theForm = $(".requistion"); var theForm = $(".requistion");
@ -712,8 +736,7 @@ $("#mypo").on("shown.bs.modal", function(e) {
}); });
function clear() function clear() {
{
$('#MaterialCode').val(''); $('#MaterialCode').val('');
$('#Description').val(''); $('#Description').val('');
$('#UOM').val(''); $('#UOM').val('');
@ -723,14 +746,12 @@ function clear()
} }
var userid = ''; var userid = '';
function removeHiddenRows(rowcount)
{ function removeHiddenRows(rowcount) {
var step; var step;
if(rowcount > 2) if (rowcount > 2) {
{ for (step = 1; step < rowcount; step++) {
for (step = 1; step < rowcount ; step++)
{
var td = document.getElementById(step); var td = document.getElementById(step);
td.parentNode.removeChild(td); td.parentNode.removeChild(td);
$("#MaterialCode" + step).remove(); $("#MaterialCode" + step).remove();
@ -801,8 +822,7 @@ $('.EditItem').click(function(){
$('#txtRowCount').val(userid); $('#txtRowCount').val(userid);
}); });
function Deleterow(rowid) function Deleterow(rowid) {
{
@ -814,19 +834,16 @@ function Deleterow(rowid)
id[0] = $('#txtReqNo').val(); id[0] = $('#txtReqNo').val();
id[1] = MaterialCode; id[1] = MaterialCode;
var answer = confirm(" Do you want to delete the Item from the List?") var answer = confirm(" Do you want to delete the Item from the List?")
if (answer) if (answer) {
{
// To delete the item from list // To delete the item from list
var x = <?php echo json_encode($LineItem, JSON_PRETTY_PRINT) ?>; var x = <?php echo json_encode($LineItem, JSON_PRETTY_PRINT) ?>;
var result = '0'; var result = '0';
//alert(x); //alert(x);
//alert(MaterialCode); //alert(MaterialCode);
if(MaterialCode != "0") if (MaterialCode != "0") {
{
$.each(x, function(idx, obj) { $.each(x, function(idx, obj) {
if(obj.MaterialCode === MaterialCode) if (obj.MaterialCode === MaterialCode) {
{
result = '1'; result = '1';
return false; return false;
} }
@ -835,64 +852,55 @@ function Deleterow(rowid)
} }
if(result == '0') if (result == '0') {
{
var DelRows = $('#txtDeletedRow').val(); var DelRows = $('#txtDeletedRow').val();
tr.parentNode.removeChild(tr); tr.parentNode.removeChild(tr);
if(DelRows != '') if (DelRows != '') {
{
DelRows = DelRows + ":" + rowid; DelRows = DelRows + ":" + rowid;
} } else {
else
{
DelRows = "0" + ":" + rowid; DelRows = "0" + ":" + rowid;
} }
$('#txtDeletedRow').val(DelRows); $('#txtDeletedRow').val(DelRows);
} }
// To delete the value from Tables // To delete the value from Tables
else if(result == '1') else if (result == '1') {
{
var DelRows = $('#txtDeletedRow').val(); var DelRows = $('#txtDeletedRow').val();
tr.parentNode.removeChild(tr); tr.parentNode.removeChild(tr);
if(DelRows != '') if (DelRows != '') {
{
DelRows = DelRows + ":" + rowid; DelRows = DelRows + ":" + rowid;
} } else {
else
{
DelRows = "0" + ":" + rowid; DelRows = "0" + ":" + rowid;
} }
$('#txtDeletedRow').val(DelRows); $('#txtDeletedRow').val(DelRows);
$('#loader').show(); $('#loader').show();
$.ajax({ $.ajax({
data:{id:id}, data: {
id: id
},
type: "POST", type: "POST",
url: "<?php echo base_url() ?>storerequisitionlist/DeleteRequistionForm", url: "<?php echo base_url() ?>storerequisitionlist/DeleteRequistionForm",
success: function(data) { success: function(data) {
if(data) if (data) {
{
$('#loader').hide(); $('#loader').hide();
alert(data); alert(data);
} } else {
else
{
$('#loader').hide(); $('#loader').hide();
alert("Error"); alert("Error");
} }
}}); }
});
} }
} }
} }
// this function used to remove the item from listing table // this function used to remove the item from listing table
function RemoveList(rowid) function RemoveList(rowid) {
{
var id = []; var id = [];
@ -903,19 +911,16 @@ function Deleterow(rowid)
id[0] = $('#txtReqNo').val(); id[0] = $('#txtReqNo').val();
id[1] = MaterialCode; id[1] = MaterialCode;
var answer = confirm(" Do you want to delete the Item from the List?") var answer = confirm(" Do you want to delete the Item from the List?")
if (answer) if (answer) {
{
// To delete the item from list // To delete the item from list
var x = <?php echo json_encode($LineItem, JSON_PRETTY_PRINT) ?>; var x = <?php echo json_encode($LineItem, JSON_PRETTY_PRINT) ?>;
var result = '0'; var result = '0';
//alert(x); //alert(x);
//alert(MaterialCode); //alert(MaterialCode);
if(MaterialCode != "0") if (MaterialCode != "0") {
{
$.each(x, function(idx, obj) { $.each(x, function(idx, obj) {
if(obj.MaterialCode === MaterialCode) if (obj.MaterialCode === MaterialCode) {
{
result = '1'; result = '1';
return false; return false;
} }
@ -924,108 +929,86 @@ function Deleterow(rowid)
} }
if(result == '0') if (result == '0') {
{
var DelRows = $('#txtDeletedRow').val(); var DelRows = $('#txtDeletedRow').val();
tr.parentNode.removeChild(tr); tr.parentNode.removeChild(tr);
if(DelRows != '') if (DelRows != '') {
{
DelRows = DelRows + ":" + rowid; DelRows = DelRows + ":" + rowid;
} } else {
else
{
DelRows = "0" + ":" + rowid; DelRows = "0" + ":" + rowid;
} }
$('#txtDeletedRow').val(DelRows); $('#txtDeletedRow').val(DelRows);
} }
// To delete the value from Tables // To delete the value from Tables
else if(result == '1') else if (result == '1') {
{
$('#content').loader('show'); $('#content').loader('show');
var DelRows = $('#txtDeletedRow').val(); var DelRows = $('#txtDeletedRow').val();
tr.parentNode.removeChild(tr); tr.parentNode.removeChild(tr);
if(DelRows != '') if (DelRows != '') {
{
DelRows = DelRows + ":" + rowid; DelRows = DelRows + ":" + rowid;
} } else {
else
{
DelRows = "0" + ":" + rowid; DelRows = "0" + ":" + rowid;
} }
$('#txtDeletedRow').val(DelRows); $('#txtDeletedRow').val(DelRows);
$('#loader').show(); $('#loader').show();
$.ajax({ $.ajax({
data:{id:id}, data: {
id: id
},
type: "POST", type: "POST",
url: "<?php echo base_url() ?>storerequisitionlist/DeleteRequistionForm", url: "<?php echo base_url() ?>storerequisitionlist/DeleteRequistionForm",
success: function(data) { success: function(data) {
if(data) if (data) {
{
$('#loader').hide(); $('#loader').hide();
alert(data); alert(data);
} } else {
else
{
$('#loader').hide(); $('#loader').hide();
alert("Error"); alert("Error");
} }
}}); }
});
} }
} }
} }
function validateBeforeAdd() function validateBeforeAdd() {
{
if ($("#CostCenter option:selected").val() =='-1' ) if ($("#CostCenter option:selected").val() == '-1') {
{
alert('Please Select the CostCenterCode '); alert('Please Select the CostCenterCode ');
$("#CostCenter").focus(); $("#CostCenter").focus();
return false; return false;
} } else if (isExceed == '1') {
else if( isExceed == '1')
{
alert('You dont have available Budget Amount. You cant raise new StoreRequisition'); alert('You dont have available Budget Amount. You cant raise new StoreRequisition');
return false; return false;
} } else {
else
{
$('#mypo').modal('show'); $('#mypo').modal('show');
} }
} }
function Redirect() function Redirect() {
{
window.location = "storerequisition"; window.location = "storerequisition";
} }
function Save(status) function Save(status) {
{
//alert($(json.stringify(MaterialCode).val()); //alert($(json.stringify(MaterialCode).val());
var txtRowCount = $('#txtRowCount').val(); var txtRowCount = $('#txtRowCount').val();
//var mat = $('#MaterialCode'+txtRowCount).val(); //var mat = $('#MaterialCode'+txtRowCount).val();
if(status == '0') if (status == '0') {
{
stat = '<?php echo STORE_DRAFT; ?>'; stat = '<?php echo STORE_DRAFT; ?>';
} } else {
else
{
stat = '<?php echo STORE_PENDINGAPPROVAL; ?>'; stat = '<?php echo STORE_PENDINGAPPROVAL; ?>';
} }
@ -1040,17 +1023,12 @@ else
var splitDepCode = $('#DepartmentName').val(); var splitDepCode = $('#DepartmentName').val();
DEPCode = splitDepCode.split('-')[0]; DEPCode = splitDepCode.split('-')[0];
if (validate()) if (validate()) {
{ if (document.getElementById('mytable').rows.length < 0) {
if(document.getElementById('mytable').rows.length < 0)
{
alert('Please Select Line item to Store Requisition'); alert('Please Select Line item to Store Requisition');
$('#Deliverydt').focus(); $('#Deliverydt').focus();
return false; return false;
} } else {
else
{
console.log($('.requistion').serialize()); console.log($('.requistion').serialize());
$('#loader').show(); $('#loader').show();
@ -1060,8 +1038,7 @@ else
url: "<?php echo base_url() ?>storerequisitionlist/UpdateStoreRequistion", url: "<?php echo base_url() ?>storerequisitionlist/UpdateStoreRequistion",
success: function(data) { success: function(data) {
if(data) if (data) {
{
$('#loader').hide(); $('#loader').hide();
alert(data); alert(data);
$('#txtRowCount').val(''); $('#txtRowCount').val('');
@ -1069,9 +1046,7 @@ else
window.location = "storerequisition"; window.location = "storerequisition";
} } else {
else
{
$('#loader').hide(); $('#loader').hide();
alert("Error"); alert("Error");
@ -1084,33 +1059,22 @@ else
} }
} }
} }
function validate()
{
if($("option:selected", $("#CostCenter")).val() == '-1') function validate() {
{
if ($("option:selected", $("#CostCenter")).val() == '-1') {
alert('Please Select CostCenter'); alert('Please Select CostCenter');
return false; return false;
} } else if ($("option:selected", $("#MaterialCode")).val() == '-1') {
else if($("option:selected", $("#MaterialCode")).val() == '-1')
{
alert('Please Select MaterialCode'); alert('Please Select MaterialCode');
return false; return false;
} } else if (document.getElementById('mytable').rows.length < 1) {
else if(document.getElementById('mytable').rows.length < 1)
{
alert('Please Add Line Item'); alert('Please Add Line Item');
return false; return false;
} } else if (isExceed == 1) {
else if(isExceed == 1)
{
alert('You dont have Budget and You cant Raise New StoreRequisition'); alert('You dont have Budget and You cant Raise New StoreRequisition');
return false; return false;
} } else {
else
{
return true; return true;
} }
@ -1118,8 +1082,6 @@ function validate()
</script>
<script>
$(function() { $(function() {
$('#Items').DataTable({ $('#Items').DataTable({
@ -1132,5 +1094,7 @@ function validate()
}); });
}); });
</script> </script>

View File

@ -76,6 +76,10 @@
<link href="<?php echo base_url(); ?>public/new_assets/libs/bootstrap-datepicker/css/bootstrap-datepicker.min.css" rel="stylesheet" type="text/css" /> <link href="<?php echo base_url(); ?>public/new_assets/libs/bootstrap-datepicker/css/bootstrap-datepicker.min.css" rel="stylesheet" type="text/css" />
<style> <style>
.dropdown-menu{
box-shadow: 0px 10px 43px 0 rgb(76 76 76 / 39%);
z-index: 20;
}
.mce-edit-area.mce-container.mce-panel.mce-first.mce-last.mce-stack-layout-item { .mce-edit-area.mce-container.mce-panel.mce-first.mce-last.mce-stack-layout-item {
border-width: 0px 0px 0px !important; border-width: 0px 0px 0px !important;
} }