commit alterpurchaseorder.php

This commit is contained in:
venbatechnologies@gmail.com 2017-06-26 14:04:57 +05:30
parent 6e05f847ab
commit 969b3089a5

View File

@ -94,9 +94,9 @@ if(!empty($CompanyDetails))
});
var SelectedMaterialList = {
var SelectedMaterialList = {
Mat: []
};
};
/* $('#drpSupplier').change(function() {
@ -326,7 +326,7 @@ var SelectedMaterialList = {
/*
* To calcuate the Discount */
function calculateDiscount(isEdit)
function calculateDiscount(isEdit)
{
if(isEdit == '0')
{
@ -447,7 +447,7 @@ function calculateDiscount(isEdit)
}
/*
* To calcuate the Packaging */
function calculatePackaging(isEdit)
function calculatePackaging(isEdit)
{
if(isEdit == '0')
{
@ -1463,10 +1463,10 @@ function calculatePackaging(isEdit)
}
}
}
function change(){
var isEdit=0;
// ExceedEditQuantityCheck();
//ExceedEditQuantityCheck();
if($('#Quantity').val() != '' && $('#Rate').val() != '')
{
var txtQuantity = parseFloat( $('#Quantity').val());
@ -1515,7 +1515,7 @@ function calculatePackaging(isEdit)
}
}
}
function ExceedQuantityCheck()
@ -1550,7 +1550,7 @@ function calculatePackaging(isEdit)
var tot = parseFloat(totvalue).toFixed(2);
$('#txtEditRevenueTotalOrderValue').val(tot);
validateEditExceedLimit();
// validateEditExceedLimit();
}
// calculate vat rate
@ -1658,7 +1658,7 @@ function calculatePackaging(isEdit)
$("#CostCenterName").select2();
});
function DeleteRevenueRow(rowid)
{
{
var DelRows = $('#txtDeletedRow1').val();
//alertMaterialListrowid);
@ -1696,10 +1696,10 @@ function calculatePackaging(isEdit)
}
}
}
function populateValueMainFormForDeleteItem(rowid)
{
function populateValueMainFormForDeleteItem(rowid)
{
// alert(rows);
@ -1757,12 +1757,12 @@ function populateValueMainFormForDeleteItem(rowid)
$('#txtTotalInsurance').val(parseFloat(totInsuranceAmt).toFixed(2) );
$('#txtTotalOrderValueSummary').val(parseFloat(totOrderSummaryAmt).toFixed(2) );
}
}
</script>
<style>
.num{
.num{
text-align:right;
}
}
</style>
<div class="content-wrapper">
<?php
@ -1786,11 +1786,12 @@ function populateValueMainFormForDeleteItem(rowid)
if(!empty($RequestType))
{
foreach ($RequestType as $RID):
if($RID->ConfigValue=="SERVICE" || $RID->ConfigValue=="REVENUE")
{
$options[$RID->ConfigValue] = $RID->ConfigValue;
}
endforeach;
}
@ -1803,7 +1804,7 @@ function populateValueMainFormForDeleteItem(rowid)
<label>Purchase Order Date</label>
<div class="form-group">
<?php
$data = array('name' => 'PODate','value' => set_value('PODate'),'id'=>'PODate', 'class' => 'form-control num' ,'required' => 'true');
$data = array('name' => 'PODate','value' => set_value('PODate',$CurrentDate),'id'=>'PODate', 'class' => 'form-control num' ,'required' => 'true');
echo form_input($data);
?>
</div>
@ -1893,7 +1894,7 @@ function populateValueMainFormForDeleteItem(rowid)
<label>Delivery Date</label>
<?php
$data = array('name' => 'Deliverydt','value' => set_value('Deliverydt'),'id'=>'Deliverydt', 'class' => 'form-control num' ,'required' => 'true');
$data = array('name' => 'Deliverydt','value' => set_value('Deliverydt',$CurrentDate),'id'=>'Deliverydt', 'class' => 'form-control num' ,'required' => 'true');
echo form_input($data);
?>
@ -4528,10 +4529,10 @@ function populateValueMainFormForDeleteItem(rowid)
<br/>
</div>
</div>
</div> </div>
</div> </div>
</div>
<script type="text/html" id="RevenueList">
</div>
<script type="text/html" id="RevenueList">
<tr id="<%=index%>">
<td align="left"><%=index%></td>
<td align="left"><%=ReqNo%></td>
@ -4550,13 +4551,14 @@ function populateValueMainFormForDeleteItem(rowid)
</td>
</tr>
</script>
<script>
</script>
<script>
var index = '1';
var userid = '';
$('.AddRevenue').click(function(){
if(validateRevenueTax() && validateExceedLimit())
if(validateRevenueTax() && ExceedBudget($('#txtTotalOrderValue').val(), $('#AvalBuget').val()))
{
@ -4768,8 +4770,8 @@ function populateValueMainFormForDeleteItem(rowid)
$("#txtInsurance").val('');
$("#txtTotalOrderValue").val('');
}
</script>
<script>
</script>
<script>
var SelectedMaterialCode = [];
var CollIndex = 0;
function Save()
@ -5047,10 +5049,10 @@ function populateValueMainFormForDeleteItem(rowid)
$('#purpose').change(function(){
var input='';
input=$("#purpose").val();
if(input == -1){
if(input == -1){
$("#POType").val('');
}
}
else {
$("#POType").val(input);
// $('#content').loader('show');
@ -5498,7 +5500,7 @@ if(input == -1){
type:"POST",
url:"<?php echo base_url() ?>emergencypurchaseorder/getMaterialCode?input="+EditPoType,
success:function(data) {
$('#content').loader('hide');
$('#content').loader('hide');
if(data)
{
EditGetMaterialData=data;
@ -5709,7 +5711,7 @@ $('#content').loader('hide');
var TotSwachhTax = 0;
var TotSummary = 0;
var TotBasicAmout = 0;
for (i = 1; i < rows-1; i++) {
for (i = 1; i < rows; i++) {
var AfterServiceTax = $('#ServiceTax'+i).val() == '' ? '0.00' : $('#ServiceTax'+i).val();
var AfterEduCess = $('#EduCess'+i).val() == '' ? '0.00' : $('#EduCess'+i).val();
@ -5814,12 +5816,17 @@ $('#content').loader('hide');
if(validate())
{
if(document.getElementById('serviceTax').rows.length < 3)
if(document.getElementById('serviceTax').rows.length < 2)
{
alert('Please Select Line item to Create PO');
$('#Deliverydt').focus();
return false;
}
else if($('#AvalBuget').val() < TextTotalOrderValueSummaryService) {
alert('Total Order Amount is exceeding the Budget Limit.Please adjust the product value.');
return false;
}
else
{
$('#content').loader('show');
@ -5882,12 +5889,17 @@ $('#content').loader('hide');
if(validate())
{
if(document.getElementById('serviceTax').rows.length < 3)
if(document.getElementById('serviceTax').rows.length < 2)
{
alert('Please Select Line item to Create PO');
$('#Deliverydt').focus();
return false;
}
else if($('#AvalBuget').val() < txtTotalOrderValueSummary) {
alert('Total Order Amount is exceeding the Budget Limit.Please adjust the product value.');
return false;
}
else
{
$('#content').loader('show');
@ -5925,7 +5937,8 @@ $('#content').loader('hide');
*/
function populateValueMainFormForDeleteServiceTax(deletedRow)
{
var rows = document.getElementById('serviceTax').rows.length+1;
var rows = document.getElementById('serviceTax').rows.length;
var TotServiceTax = 0;
var TotEduCess = 0;
var TotSecHighTax = 0;
@ -5933,7 +5946,8 @@ $('#content').loader('hide');
var TotSwachhTax = 0;
var TotSummary = 0;
var TotBasicAmout = 0;
for (var i = 1; i < rows; i++) {
for (var i = 1; i <= rows; i++) {
if(deletedRow==i){
$('#ServiceTax'+i).val('');
$('#EduCess'+i).val('');
@ -6176,7 +6190,7 @@ $('#content').loader('hide');
});
});
$('#EditRevenueMaterialCode').change(function(){
var editselectedMaterialCode='';
@ -6193,7 +6207,7 @@ $('#content').loader('hide');
});
});
$('.EditRevenue').click(function(){
$('.EditRevenue').click(function(){
if(validateEditRevenueTax() && validateEditExceedLimit())
@ -6345,7 +6359,7 @@ $('.EditRevenue').click(function(){
}
function populateValueMainFormForEditRevenueTax()
{
{
var rows = document.getElementById('serviceTax').rows.length;
//alert(rows);
@ -6416,9 +6430,9 @@ $('.EditRevenue').click(function(){
$('#txtTotalInsurance').val(parseFloat(totInsuranceAmt).toFixed(2) );
$('#txtTotalOrderValueSummary').val(parseFloat(totOrderSummaryAmt).toFixed(2) );
}
// this function is used to clear data changing schedule option
$('#Scheduleby').change(function(){
}
// this function is used to clear data changing schedule option
$('#Scheduleby').change(function(){
$("#Deliverydt").datepicker({
minDate : 'now',
@ -6433,5 +6447,5 @@ $('#Scheduleby').change(function(){
});
</script>
</script>