some changes in view file

This commit is contained in:
venbatechnologies 2018-03-23 14:45:21 +05:30
parent 5c6219d307
commit 4c49fe4f2e
5 changed files with 7826 additions and 7662 deletions

View File

@ -85,6 +85,9 @@
$ServiceTypeOptions=''; $ServiceTypeOptions='';
$FinalTotalBasic = 0; $FinalTotalBasic = 0;
$BudgetType = '';
$INR=''; $INR='';
$INRSYM=''; $INRSYM='';
if(!empty($INRSYMBOL)) if(!empty($INRSYMBOL))
@ -170,6 +173,7 @@ if(!empty($POMaster))
$InsuranceOptions=$Req->InsuranceStatus; $InsuranceOptions=$Req->InsuranceStatus;
$InsuranceNo=$Req->InsuranceNumber; $InsuranceNo=$Req->InsuranceNumber;
$ServiceTypeOptions=$Req->POSubType; $ServiceTypeOptions=$Req->POSubType;
$BudgetType = $Req->BudgetType;
} }
} }
@ -875,6 +879,35 @@ document.getElementById('dispatchinternational').style.display = 'block';
</div> </div>
<div class="col-md-2" style="padding-right: 0px;">
<label for="BudgetType">Budget Type</label>
<select id='BudgetType' name='BudgetType'>
<?php if($BudgetType== 'CAPITAL')
{
$opt1='CAPITAL';
$opt2='REVENUE';
}
else
{
$opt1='REVENUE';
$opt2='CAPITAL';
} ?>
<option value=<?php echo $opt1;?>><?php echo $opt1;?></option>
<option value=<?php echo $opt2;?>><?php echo $opt2;?></option>
</select>
</div>
</div> </div>
</div> </div>
</div> </div>
@ -2315,6 +2348,8 @@ document.getElementById('dispatchinternational').style.display = 'block';
var SelectedMaterialList = { var SelectedMaterialList = {
Mat: [] Mat: []
}; };
$('#BudgetType').attr("style", "pointer-events: none;");
var index=<?php echo $index; ?> +1; var index=<?php echo $index; ?> +1;
var myArray = <?php echo json_encode($res_arr_values); ?>; var myArray = <?php echo json_encode($res_arr_values); ?>;
@ -2417,7 +2452,7 @@ var myArray = <?php echo json_encode($res_arr_values); ?>;
} }
else else
{ {
swal('Please select the SupplierID'); alert('Please select the SupplierID');
return false; return false;
} }
@ -2503,7 +2538,7 @@ var myArray = <?php echo json_encode($res_arr_values); ?>;
} }
else else
{ {
swal('Please select the Requisition Number'); alert('Please select the Requisition Number');
return false; return false;
} }
id = ''; id = '';
@ -2546,7 +2581,7 @@ var myArray = <?php echo json_encode($res_arr_values); ?>;
} }
else else
{ {
swal('Please select the MaterialCode'); alert('Please select the MaterialCode');
return false; return false;
} }
@ -2588,7 +2623,7 @@ var myArray = <?php echo json_encode($res_arr_values); ?>;
} }
else else
{ {
swal('Please select the MaterialCode'); alert('Please select the MaterialCode');
return false; return false;
} }
@ -2977,16 +3012,16 @@ var myArray = <?php echo json_encode($res_arr_values); ?>;
var ReqAmount = parseFloat(ValuetoCheck); var ReqAmount = parseFloat(ValuetoCheck);
var BudAmount = parseFloat(budgetAmount); var BudAmount = parseFloat(budgetAmount);
if(ReqAmount > BudAmount ) // if(ReqAmount > BudAmount )
{ // {
swal('Your exceeding the Avaiable Budget :'+ BudAmount +'.Please adjust the Product to proceed further.'); // alert('Your exceeding the Avaiable Budget :'+ BudAmount +'.Please adjust the Product to proceed further.');
return false; // return false;
} // }
else // else
{ // {
return true; return true;
} // }
} }
@ -3001,47 +3036,47 @@ var myArray = <?php echo json_encode($res_arr_values); ?>;
var basicAmountRate = parseFloat($('#CPTotalAmount').val()); var basicAmountRate = parseFloat($('#CPTotalAmount').val());
var totalAmount = parseFloat($('#txtTotalOrderValue').val()); var totalAmount = parseFloat($('#txtTotalOrderValue').val());
if(basicAmountRate > avalbudAmt) // if(basicAmountRate > avalbudAmt)
{ // {
swal('Basic amount is exceeding the Budget Limit.Please adjust the product value.'); // alert('Basic amount is exceeding the Budget Limit.Please adjust the product value.');
$('#CPRate').focus(); // $('#CPRate').focus();
return false; // return false;
} // }
else // else
{ // {
return true; return true;
} //}
} }
function validateCapitalTax() function validateCapitalTax()
{ {
if($('#Reqnumber').val() == "0") if($('#Reqnumber').val() == "0")
{ {
swal('Please select the Requisition Number'); alert('Please select the Requisition Number');
$('#Reqnumber').focus(); $('#Reqnumber').focus();
return false; return false;
} }
else if($('#CostCenter').val() == "0") else if($('#CostCenter').val() == "0")
{ {
swal('Please select the Cost center'); alert('Please select the Cost center');
$('#CostCenter').focus(); $('#CostCenter').focus();
return false; return false;
} }
else if($('#MaterialCode').val() == "0") else if($('#MaterialCode').val() == "0")
{ {
swal('Please select the Material Code'); alert('Please select the Material Code');
$('#MaterialCode').focus(); $('#MaterialCode').focus();
return false; return false;
} }
else if($('#CPQuantity').val() == '') else if($('#CPQuantity').val() == '')
{ {
swal('Please Enter the Quantity value'); alert('Please Enter the Quantity value');
$('#CPQuantity').focus(); $('#CPQuantity').focus();
return false; return false;
} }
else if($('#CPRate').val() == '') else if($('#CPRate').val() == '')
{ {
swal('Please Enter the Rate of the Item'); alert('Please Enter the Rate of the Item');
$('#CPRate').focus(); $('#CPRate').focus();
return false; return false;
} }
@ -3320,7 +3355,7 @@ $('#PurQuantity').val('');
} }
else else
{ {
swal('Please select the MaterialCode'); alert('Please select the MaterialCode');
return false; return false;
} }
@ -3413,21 +3448,21 @@ basicamt=$('#txtTotalBasic').val() - $('#txtTotalDiscount').val();
//alert(AvlBudAmt); //alert(AvlBudAmt);
if(document.getElementById('serviceTax').rows.length < 2) if(document.getElementById('serviceTax').rows.length < 2)
{ {
swal('Please Select Line item to Create PO'); alert('Please Select Line item to Create PO');
$('#Deliverydt').focus(); $('#Deliverydt').focus();
return false; return false;
} }
else if($('#Otherpayment').val()=='' && $('#PaymentMethod').val()=='PT08'){ else if($('#Otherpayment').val()=='' && $('#PaymentMethod').val()=='PT08'){
swal('Please Enter Other Payable Terms Description'); alert('Please Enter Other Payable Terms Description');
$('#Otherpayment').focus(); $('#Otherpayment').focus();
return false; return false;
} }
else if(parseInt(AvlBudAmt) < parseInt(basicamt)) { // else if(parseInt(AvlBudAmt) < parseInt(basicamt)) {
swal('Total Order Amount is exceeding the Budget Limit.Please adjust the product value.'); // alert('Total Order Amount is exceeding the Budget Limit.Please adjust the product value.');
return false; // return false;
} // }
else else
{ {
@ -3445,7 +3480,7 @@ basicamt=$('#txtTotalBasic').val() - $('#txtTotalDiscount').val();
success:function(data) { success:function(data) {
if(data) if(data)
{ {
swal(data); alert(data);
$('#content').loader('hide'); $('#content').loader('hide');
$('#txtRowCount').val(''); $('#txtRowCount').val('');
@ -3458,7 +3493,7 @@ basicamt=$('#txtTotalBasic').val() - $('#txtTotalDiscount').val();
else else
{ {
$('#content').loader('hide'); $('#content').loader('hide');
swal("Error"); alert("Error");
} }
} }
@ -3486,19 +3521,19 @@ EditRatechange();
if($('#EditReqnumber').val() == "0") if($('#EditReqnumber').val() == "0")
{ {
swal('Please select the Requisition Number'); alert('Please select the Requisition Number');
$('#EditReqnumber').focus(); $('#EditReqnumber').focus();
return false; return false;
} }
else if($('#EditMaterialCode').val() == "0") else if($('#EditMaterialCode').val() == "0")
{ {
swal('Please select the Material Code'); alert('Please select the Material Code');
$('#EditMaterialCode').focus(); $('#EditMaterialCode').focus();
return false; return false;
} }
else if($('#EditCostCenter').val() == "0") else if($('#EditCostCenter').val() == "0")
{ {
swal('Please select the CostCenterCode'); alert('Please select the CostCenterCode');
$('#EditCostCenter').focus(); $('#EditCostCenter').focus();
return false; return false;
} }
@ -3918,43 +3953,43 @@ function validateEditCapitalTax()
if($('#EditReqnumber').val() == "0") if($('#EditReqnumber').val() == "0")
{ {
swal('Please select the Requisition Number'); alert('Please select the Requisition Number');
$('#EditReqnumber').focus(); $('#EditReqnumber').focus();
return false; return false;
} }
else if($('#EditCostCenter').val() == "0") else if($('#EditCostCenter').val() == "0")
{ {
swal('Please select the Cost center'); alert('Please select the Cost center');
$('#EditCostCenter').focus(); $('#EditCostCenter').focus();
return false; return false;
} }
else if($('#EditMaterialCode').val() == "0") else if($('#EditMaterialCode').val() == "0")
{ {
swal('Please select the Material Code'); alert('Please select the Material Code');
$('#EditMaterialCode').focus(); $('#EditMaterialCode').focus();
return false; return false;
} }
else if($('#EditCPQuantity').val() == '') else if($('#EditCPQuantity').val() == '')
{ {
swal('Please Enter the Quantity value'); alert('Please Enter the Quantity value');
$('#EditCPQuantity').focus(); $('#EditCPQuantity').focus();
return false; return false;
} }
else if($('#EditCPQuantity').val() == "0") else if($('#EditCPQuantity').val() == "0")
{ {
swal('Please Enter the Valid Quantity value'); alert('Please Enter the Valid Quantity value');
$('#EditCPQuantity').focus(); $('#EditCPQuantity').focus();
return false; return false;
} }
else if($('#EditCPRate').val() == '') else if($('#EditCPRate').val() == '')
{ {
swal('Please Enter the Rate of the Item'); alert('Please Enter the Rate of the Item');
$('#EditCPRate').focus(); $('#EditCPRate').focus();
return false; return false;
} }
else if($('#EditCPRate').val() == "0") else if($('#EditCPRate').val() == "0")
{ {
swal('Please Enter the Valid Rate of the Item'); alert('Please Enter the Valid Rate of the Item');
$('#EditCPRate').focus(); $('#EditCPRate').focus();
return false; return false;
} }
@ -4005,16 +4040,16 @@ function validateEditCapitalTax()
var basicAmountRate = parseFloat($('#EditCPTotalAmount').val()); var basicAmountRate = parseFloat($('#EditCPTotalAmount').val());
var totalAmount = parseFloat($('#EdittxtTotalOrderValue').val()); var totalAmount = parseFloat($('#EdittxtTotalOrderValue').val());
if(basicAmountRate > avalbudAmt) // if(basicAmountRate > avalbudAmt)
{ // {
swal('Basic amount is exceeding the Budget Limit.Please adjust the product value.'); // alert('Basic amount is exceeding the Budget Limit.Please adjust the product value.');
$('#EditCPRate').focus(); // $('#EditCPRate').focus();
return false; // return false;
} // }
else // else
{ // {
return true; return true;
} //}
} }
@ -4307,7 +4342,7 @@ $('#EditDiscountType').change(function() {
} }
else else
{ {
swal('Please Select MaterialCode and Rate Field Value'); alert('Please Select MaterialCode and Rate Field Value');
$('#EditDiscountType').val("0"); $('#EditDiscountType').val("0");
$('#EditCPRate').focus(); $('#EditCPRate').focus();
} }
@ -4325,7 +4360,7 @@ function calculateDiscount(isEdit)
if($('#CPRate').val() == '') if($('#CPRate').val() == '')
{ {
swal('Please Enter the Rate value'); alert('Please Enter the Rate value');
$('#CPRate').focus(); $('#CPRate').focus();
$('#txtDiscount').val(''); $('#txtDiscount').val('');
return false; return false;
@ -4338,7 +4373,7 @@ function calculateDiscount(isEdit)
if(DiscountType == "0") if(DiscountType == "0")
{ {
swal('Please Select the discount Type'); alert('Please Select the discount Type');
$('#txtDiscount').val(''); $('#txtDiscount').val('');
$("#DiscountType").focus(); $("#DiscountType").focus();
} }
@ -4384,7 +4419,7 @@ function calculateDiscount(isEdit)
if(DiscountType == "0") if(DiscountType == "0")
{ {
swal('Please Select the discount Type'); alert('Please Select the discount Type');
$('#txtEditDiscount').val(''); $('#txtEditDiscount').val('');
$("#EditDiscountType").focus(); $("#EditDiscountType").focus();
} }
@ -4453,7 +4488,7 @@ function calculateFreight(isEdit)
if($('#AfterBasicPriceTax').val() == '') if($('#AfterBasicPriceTax').val() == '')
{ {
swal('Please Enter the Rate value'); alert('Please Enter the Rate value');
$('#CPRate').focus(); $('#CPRate').focus();
$('#txtFreight').val('') ; $('#txtFreight').val('') ;
return false; return false;
@ -4465,7 +4500,7 @@ function calculateFreight(isEdit)
var FreightType =$("#drpFreight").val(); var FreightType =$("#drpFreight").val();
if(FreightType == "0") if(FreightType == "0")
{ {
swal('Please select Freight Type'); alert('Please select Freight Type');
$('#txtFreight').val(''); $('#txtFreight').val('');
$("#drpFreight").focus(); $("#drpFreight").focus();
} }
@ -4498,7 +4533,7 @@ function calculateFreight(isEdit)
else if(FreightType == '<?php echo PERTRIP;?>') else if(FreightType == '<?php echo PERTRIP;?>')
{ {
if($('#NOOfTrips').val()==''){ if($('#NOOfTrips').val()==''){
swal('Please Enter No of Trip'); alert('Please Enter No of Trip');
$("#NOOfTrips").focus(); $("#NOOfTrips").focus();
$('#txtFreight').val(0) $('#txtFreight').val(0)
@ -4533,7 +4568,7 @@ function calculateFreight(isEdit)
if($('#ViewAfterBasicPriceTax').val() == '') if($('#ViewAfterBasicPriceTax').val() == '')
{ {
swal('Please Enter the Rate value'); alert('Please Enter the Rate value');
$('#ViewCPRate').focus(); $('#ViewCPRate').focus();
$('#txtViewFreight').val('') ; $('#txtViewFreight').val('') ;
return false; return false;
@ -4545,7 +4580,7 @@ function calculateFreight(isEdit)
var FreightType =$("#drpViewFreight").val(); var FreightType =$("#drpViewFreight").val();
if(FreightType == "0") if(FreightType == "0")
{ {
swal('Please select Freight Type'); alert('Please select Freight Type');
$('#txtViewFreight').val(''); $('#txtViewFreight').val('');
$("#drpViewFreight").focus(); $("#drpViewFreight").focus();
} }
@ -4575,7 +4610,7 @@ function calculateFreight(isEdit)
else if(FreightType == '<?php echo PERTRIP;?>') else if(FreightType == '<?php echo PERTRIP;?>')
{ {
if($('#ViewNOOfTrips').val()==''){ if($('#ViewNOOfTrips').val()==''){
swal('Please Enter No of Trip'); alert('Please Enter No of Trip');
$("#ViewNOOfTrips").focus(); $("#ViewNOOfTrips").focus();
$('#txtViewFreight').val(0) $('#txtViewFreight').val(0)
@ -4644,7 +4679,7 @@ function calculateFreight(isEdit)
else if(FreightType == '<?php echo PERTRIP;?>') else if(FreightType == '<?php echo PERTRIP;?>')
{ {
if($('#AmendNOOfTrips').val()==''){ if($('#AmendNOOfTrips').val()==''){
swal('Please Enter No of Trip'); alert('Please Enter No of Trip');
$("#AmendNOOfTrips").focus(); $("#AmendNOOfTrips").focus();
$('#AmendtxtFreight').val(0) $('#AmendtxtFreight').val(0)
@ -4709,7 +4744,7 @@ function calculateFreight(isEdit)
else if(FreightType == '<?php echo PERTRIP;?>') else if(FreightType == '<?php echo PERTRIP;?>')
{ {
if($('#EditNOOfTrips').val()==''){ if($('#EditNOOfTrips').val()==''){
swal('Please Enter No of Trip'); alert('Please Enter No of Trip');
$("#EditNOOfTrips").focus(); $("#EditNOOfTrips").focus();
$('#txtEditFreight').val(0) $('#txtEditFreight').val(0)
@ -4742,7 +4777,7 @@ function calculateFreight(isEdit)
{ {
if($('#EditAfterBasicPriceTax').val() == '') if($('#EditAfterBasicPriceTax').val() == '')
{ {
swal('Please Enter the Rate value'); alert('Please Enter the Rate value');
$('#EditCPRate').focus(); $('#EditCPRate').focus();
$('#txtEditFreight').val('') ; $('#txtEditFreight').val('') ;
return false; return false;
@ -4754,7 +4789,7 @@ function calculateFreight(isEdit)
var FreightType =$("#drpEditFreight").val(); var FreightType =$("#drpEditFreight").val();
if(FreightType == "0") if(FreightType == "0")
{ {
swal('Please select Freight Type'); alert('Please select Freight Type');
$('#txtEditFreight').val(''); $('#txtEditFreight').val('');
$("#drpEditFreight").focus(); $("#drpEditFreight").focus();
} }
@ -4784,7 +4819,7 @@ function calculateFreight(isEdit)
else if(FreightType == '<?php echo PERTRIP;?>') else if(FreightType == '<?php echo PERTRIP;?>')
{ {
if($('#EditNOOfTrips').val()==''){ if($('#EditNOOfTrips').val()==''){
swal('Please Enter No of Trip'); alert('Please Enter No of Trip');
$("#EditNOOfTrips").focus(); $("#EditNOOfTrips").focus();
$('#txtEditFreight').val(0) $('#txtEditFreight').val(0)
@ -4872,7 +4907,7 @@ $('#drpFreighteditloc').change(function()
} }
else else
{ {
swal('Please Select MaterialCode and Rate Field Value'); alert('Please Select MaterialCode and Rate Field Value');
$('#drpFreighteditloc').val("0"); $('#drpFreighteditloc').val("0");
$('#Rate').focus(); $('#Rate').focus();
} }

View File

@ -114,6 +114,9 @@ $StatusName='';
$Reqon = ''; $Reqon = '';
$Requestedby=''; $Requestedby='';
$RequesterName=''; $RequesterName='';
$BudgetType = '';
if(!empty($POMaster)) if(!empty($POMaster))
{ {
foreach ($POMaster as $Req) foreach ($POMaster as $Req)
@ -161,6 +164,7 @@ if(!empty($POMaster))
$InsuranceNo=$Req->InsuranceNumber; $InsuranceNo=$Req->InsuranceNumber;
$Importoption=$Req->POSubType; $Importoption=$Req->POSubType;
$InsuranceStatus=$Req->InsuranceStatus; $InsuranceStatus=$Req->InsuranceStatus;
$BudgetType = $Req->BudgetType;
} }
} }
@ -821,6 +825,32 @@ if(!empty($RequistionDetails))
</div> </div>
<div class="col-md-2" style="padding-right: 0px;">
<label for="BudgetType">Budget Type</label>
<select id='BudgetType' name='BudgetType'>
<?php if($BudgetType== 'CAPITAL')
{
$opt1='CAPITAL';
$opt2='REVENUE';
}
else
{
$opt1='REVENUE';
$opt2='CAPITAL';
} ?>
<option value=<?php echo $opt1;?>><?php echo $opt1;?></option>
<option value=<?php echo $opt2;?>><?php echo $opt2;?></option>
</select>
</div>
</div> </div>
</div> </div>
</div> </div>
@ -845,7 +875,7 @@ if(!empty($RequistionDetails))
<!-- Modal content--> <!-- Modal content-->
<form> <form>
<div class="modal-content" style="width:1000px; font-size: 12px;" > <div class="modal-content" style="width:1000px; font-size: 12px;" >
<div class="modal-header" style="background-color: #3c8dbc;color:#fff;"> <div class="modal-header" style="background-color: #5d0411;color:#fff;">
<center><h4>Edit Import Purchase Order Item </h4></center> <center><h4>Edit Import Purchase Order Item </h4></center>
</div> </div>
@ -1953,6 +1983,10 @@ var NilType = '<?php echo NILTYPE;?>';
}; };
$('#BudgetType').attr("style", "pointer-events: none;");
$('#Insurance').change(function() { $('#Insurance').change(function() {
//var insure=$('#Insurance').val(); //var insure=$('#Insurance').val();
@ -2150,7 +2184,7 @@ $('#drpSupplier').change(function() {
} }
else else
{ {
swal('Please select the SupplierID'); alert('Please select the SupplierID');
return false; return false;
} }
@ -2237,7 +2271,7 @@ $("#txtBasicValue").val('');
} }
else else
{ {
swal('Please select the Requisition Number'); alert('Please select the Requisition Number');
return false; return false;
} }
id = ''; id = '';
@ -2276,7 +2310,7 @@ $("#txtBasicValue").val('');
} }
else else
{ {
swal('Please select the MaterialCode'); alert('Please select the MaterialCode');
return false; return false;
} }
@ -2313,7 +2347,7 @@ function EditQtyZerocheck()
{ {
if(($('#EditRate').val()=="0")||$('#EditQuantity').val()=="0"||($('#EditRate').val()=='')||$('#EditQuantity').val()=='') if(($('#EditRate').val()=="0")||$('#EditQuantity').val()=="0"||($('#EditRate').val()=='')||$('#EditQuantity').val()=='')
{ {
swal('Please Enter A Valid Number for Rate and Quantity'); alert('Please Enter A Valid Number for Rate and Quantity');
$('#EdittxtBasicValue').val(0); $('#EdittxtBasicValue').val(0);
$('#EditimBasicPrice').val(0); $('#EditimBasicPrice').val(0);
var txtexchangerate=parseFloat($('#ExchangeRate').val()); var txtexchangerate=parseFloat($('#ExchangeRate').val());
@ -2361,19 +2395,19 @@ function Ratechange(){
//alert(); //alert();
if($('#ReqNo').val() == "0") if($('#ReqNo').val() == "0")
{ {
swal('Please select the Requisition Number'); alert('Please select the Requisition Number');
$('#ReqNo').focus(); $('#ReqNo').focus();
return false; return false;
} }
else if($('#MaterialCode').val() == "0") else if($('#MaterialCode').val() == "0")
{ {
swal('Please select the Material Code'); alert('Please select the Material Code');
$('#MaterialCode').focus(); $('#MaterialCode').focus();
return false; return false;
} }
else if($('#CostCenter').val() == "0") else if($('#CostCenter').val() == "0")
{ {
swal('Please select the CostCenterCode'); alert('Please select the CostCenterCode');
$('#CostCenter').focus(); $('#CostCenter').focus();
return false; return false;
} }
@ -2465,7 +2499,7 @@ function ExceedEditQuantityCheck()
var ReqQuantity = parseFloat(RequistQuantity); var ReqQuantity = parseFloat(RequistQuantity);
if(EnterQuantity > ReqQuantity) if(EnterQuantity > ReqQuantity)
{ {
swal('Your exceeding the Quantity from the Requisition Quantity:'+ RequistQuantity +'.Please adjust the Quantity to proceed further.'); alert('Your exceeding the Quantity from the Requisition Quantity:'+ RequistQuantity +'.Please adjust the Quantity to proceed further.');
$('#EditQuantity').focus(); $('#EditQuantity').focus();
return false; return false;
} }
@ -2747,37 +2781,37 @@ function validateImport()
//alert(); //alert();
if($('#ReqNo').val() == "0") if($('#ReqNo').val() == "0")
{ {
swal('Please select the Requisition Number'); alert('Please select the Requisition Number');
$('#ReqNo').focus(); $('#ReqNo').focus();
return false; return false;
} }
else if($('#CostCenter').val() == "0") else if($('#CostCenter').val() == "0")
{ {
swal('Please select the Cost center'); alert('Please select the Cost center');
$('#CostCenter').focus(); $('#CostCenter').focus();
return false; return false;
} }
else if($('#MaterialCode').val() == "0") else if($('#MaterialCode').val() == "0")
{ {
swal('Please select the Material Code'); alert('Please select the Material Code');
$('#MaterialCode').focus(); $('#MaterialCode').focus();
return false; return false;
} }
else if($('#Quantity').val() == '') else if($('#Quantity').val() == '')
{ {
swal('Please Enter the Quantity value'); alert('Please Enter the Quantity value');
$('#Quantity').focus(); $('#Quantity').focus();
return false; return false;
} }
else if($('#Rate').val() == '') else if($('#Rate').val() == '')
{ {
swal('Please Enter the Rate of the Item'); alert('Please Enter the Rate of the Item');
$('#Rate').focus(); $('#Rate').focus();
return false; return false;
} }
else if($('#imBasicPrice').val()=='') else if($('#imBasicPrice').val()=='')
{ {
swal('Please Enter Basic Price In Us'); alert('Please Enter Basic Price In Us');
$('#imBasicPrice').focus(); $('#imBasicPrice').focus();
return false; return false;
} }
@ -3199,7 +3233,7 @@ function validateEditExceedLimit()
if(exp > totavlbud || totalAmount > totavlbud) if(exp > totavlbud || totalAmount > totavlbud)
{ {
swal('Basic amount is exceeding the Budget Limit.Please adjust the product value.'); alert('Basic amount is exceeding the Budget Limit.Please adjust the product value.');
$('#EditRate').focus(); $('#EditRate').focus();
return false; return false;
} }
@ -3329,16 +3363,16 @@ function Budgetcheck()
var totordring=totalorderedamount*Exchange; var totordring=totalorderedamount*Exchange;
var TotalSum=totavlbud; var TotalSum=totavlbud;
//console.log(TotalSum); //console.log(TotalSum);
if(totordring>TotalSum) // if(totordring>TotalSum)
{ // {
swal('You are Exceeding The Budget Amount'); // alert('You are Exceeding The Budget Amount');
return false; // return false;
} // }
else // else
{ // {
return true; return true;
} //}
} }
@ -3363,7 +3397,7 @@ if(validate()&&Budgetcheck())
if(document.getElementById('ImportTax').rows.length <= 0) if(document.getElementById('ImportTax').rows.length <= 0)
{ {
swal('Please Select Line item to Create PO'); alert('Please Select Line item to Create PO');
$('#Deliverydt').focus(); $('#Deliverydt').focus();
return false; return false;
} }
@ -3381,7 +3415,7 @@ if(validate()&&Budgetcheck())
if(data) if(data)
{ {
$('#content').loader('hide'); $('#content').loader('hide');
swal(data); alert(data);
$('#txtRowCount').val(''); $('#txtRowCount').val('');
$('#txtDeletedRow').val(''); $('#txtDeletedRow').val('');
//$('#SpcialInstruction').val(''); //$('#SpcialInstruction').val('');
@ -3391,7 +3425,7 @@ if(validate()&&Budgetcheck())
} }
else else
{ {
swal("Error"); alert("Error");
} }
} }
@ -3484,7 +3518,7 @@ $('#drpamendFreight').change(function(){
} }
else else
{ {
swal('Please Select MaterialCode and Rate Field Value'); alert('Please Select MaterialCode and Rate Field Value');
$('#drpamendFreight').val("0"); $('#drpamendFreight').val("0");
$('#EditRate').focus(); $('#EditRate').focus();
} }
@ -3502,14 +3536,14 @@ function calculateFreight()
//alert('af'); //alert('af');
if($('#EditMaterialCode').val() == '') if($('#EditMaterialCode').val() == '')
{ {
swal('Please Select the Material Code'); alert('Please Select the Material Code');
$('#EditMaterialCode').focus(); $('#EditMaterialCode').focus();
$('#edittxtFreight').val(''); $('#edittxtFreight').val('');
return false; return false;
} }
else if($('#EditRate').val() == '') else if($('#EditRate').val() == '')
{ {
swal('Please Enter the Rate value'); alert('Please Enter the Rate value');
$('#EditRate').focus(); $('#EditRate').focus();
$('#AmendtxtFreight').val(''); $('#AmendtxtFreight').val('');
return false; return false;
@ -3520,7 +3554,7 @@ function calculateFreight()
var FreightType =$("#drpamendFreight").val(); var FreightType =$("#drpamendFreight").val();
if(FreightType == "0") if(FreightType == "0")
{ {
swal('Please select Freight Type'); alert('Please select Freight Type');
$('#AmendtxtFreight').val(''); $('#AmendtxtFreight').val('');
$("#drpamendFreight").focus(); $("#drpamendFreight").focus();
} }
@ -3550,7 +3584,7 @@ function calculateFreight()
else if(FreightType == '<?php echo PERTRIP;?>') else if(FreightType == '<?php echo PERTRIP;?>')
{ {
if($('#AmendNOOfTrips').val()==''){ if($('#AmendNOOfTrips').val()==''){
swal('Please Enter No of Trip'); alert('Please Enter No of Trip');
$("#AmendNOOfTrips").focus(); $("#AmendNOOfTrips").focus();
$('#AmendtxtFreight').val(0) $('#AmendtxtFreight').val(0)

View File

@ -65,6 +65,7 @@ foreach ($PaymentTerms as $TER)
$revenuesubtype=''; $revenuesubtype='';
$insurencestatus=''; $insurencestatus='';
$insurenceno=''; $insurenceno='';
$BudgetType = '';
if(!empty($POMaster)) if(!empty($POMaster))
{ {
@ -103,9 +104,12 @@ if(!empty($POMaster))
$revenuesubtype = $Req->POSubType; $revenuesubtype = $Req->POSubType;
$insurencestatus = $Req->InsuranceStatus; $insurencestatus = $Req->InsuranceStatus;
$insurenceno = $Req->InsuranceNumber; $insurenceno = $Req->InsuranceNumber;
$BudgetType = $Req->BudgetType;
} }
} }
//echo $BudgetType;
if(!empty($RequistionDetails)) if(!empty($RequistionDetails))
{ {
@ -388,7 +392,7 @@ function calculateDiscount()
if($('#EditRate').val() == '') if($('#EditRate').val() == '')
{ {
swal('Please Enter the Rate value'); alert('Please Enter the Rate value');
$('#EditRate').focus(); $('#EditRate').focus();
return false; return false;
} }
@ -400,7 +404,7 @@ function calculateDiscount()
if(DiscountType == "0") if(DiscountType == "0")
{ {
swal('Please Select the discount Type'); alert('Please Select the discount Type');
$('#txtEditDiscount').val(''); $('#txtEditDiscount').val('');
$("#EditDiscountType").focus(); $("#EditDiscountType").focus();
} }
@ -483,7 +487,7 @@ function calculatePackaging()
if($('#EditRate').val() == '') if($('#EditRate').val() == '')
{ {
swal('Please Enter the Rate value'); alert('Please Enter the Rate value');
$('#EditRate').focus(); $('#EditRate').focus();
return false; return false;
} }
@ -497,7 +501,7 @@ function calculatePackaging()
if(PackagingType == "0") if(PackagingType == "0")
{ {
swal('Please select the Packaging Type'); alert('Please select the Packaging Type');
$('#txtEditPackaging').val(''); $('#txtEditPackaging').val('');
$("#EditPackagingType").focus(); $("#EditPackagingType").focus();
} }
@ -511,7 +515,7 @@ function calculatePackaging()
{ {
if(PackagingCalculation != 0 &&$('#txtEditAfterDiscount').val() == '') if(PackagingCalculation != 0 &&$('#txtEditAfterDiscount').val() == '')
{ {
swal('Please Enter the Discount value'); alert('Please Enter the Discount value');
$('#EditDiscountType').focus(); $('#EditDiscountType').focus();
$('#txtEditPackaging').val(''); $('#txtEditPackaging').val('');
return false; return false;
@ -628,7 +632,7 @@ function calculatePackaging()
if($('#EditRate').val() == '') if($('#EditRate').val() == '')
{ {
swal('Please Enter the Rate value'); alert('Please Enter the Rate value');
$('#EditRate').focus(); $('#EditRate').focus();
return false; return false;
} }
@ -667,7 +671,7 @@ function calculatePackaging()
if($('#EditRate').val() == '') if($('#EditRate').val() == '')
{ {
swal('Please Enter the Rate value'); alert('Please Enter the Rate value');
$('#EditRate').focus(); $('#EditRate').focus();
return false; return false;
} }
@ -716,7 +720,7 @@ function calculatePackaging()
if($('#EditRate').val() == '') if($('#EditRate').val() == '')
{ {
swal('Please Enter the Rate value'); alert('Please Enter the Rate value');
$('#EditRate').focus(); $('#EditRate').focus();
return false; return false;
} }
@ -727,7 +731,7 @@ function calculatePackaging()
if(FreightType == "0") if(FreightType == "0")
{ {
swal('Please select Freight Type'); alert('Please select Freight Type');
$('#txtEditFreight').val(''); $('#txtEditFreight').val('');
$("#drpEditFreight").focus(); $("#drpEditFreight").focus();
} }
@ -743,7 +747,7 @@ function calculatePackaging()
if(FreightCalculation != 0 &&$('#txtEditAfterDiscount').val() == '') if(FreightCalculation != 0 &&$('#txtEditAfterDiscount').val() == '')
{ {
//alert(FreightType); //alert(FreightType);
swal('Please Enter the Discount value'); alert('Please Enter the Discount value');
$('#EditDiscountType').focus(); $('#EditDiscountType').focus();
$('#txtEditFreight').val(''); $('#txtEditFreight').val('');
return false; return false;
@ -789,7 +793,7 @@ function calculatePackaging()
var nooftrips=$('#EditNOOfTrips').val(); var nooftrips=$('#EditNOOfTrips').val();
var freightrate=$('#txtEditFreight').val(); var freightrate=$('#txtEditFreight').val();
if((nooftrips == '') || (txtEditFreight == '')){ if((nooftrips == '') || (txtEditFreight == '')){
swal("Please Enter Number of Trips or Freight Rate!"); alert("Please Enter Number of Trips or Freight Rate!");
$('#EditNOOfTrips').val(0.0); $('#EditNOOfTrips').val(0.0);
$('#txtEditFreight').val(0.0); $('#txtEditFreight').val(0.0);
$('#txtEditAfterFreight').val(0.0); $('#txtEditAfterFreight').val(0.0);
@ -881,16 +885,16 @@ function validateEditExceedLimit()
var discount = parseFloat($('#txtEditAfterDiscount').val()); var discount = parseFloat($('#txtEditAfterDiscount').val());
basicAmountRate = basicAmountRate - discount; basicAmountRate = basicAmountRate - discount;
//alert(basicAmountRate+'-'+avalbudAmt+'-'+discount); //alert(basicAmountRate+'-'+avalbudAmt+'-'+discount);
if(basicAmountRate > avalbudAmt)// || totalAmount > avalbudAmt) // if(basicAmountRate > avalbudAmt)// || totalAmount > avalbudAmt)
{ // {
swal('Basic amount is exceeding the Budget Limit.Please adjust the product value.'); // alert('Basic amount is exceeding the Budget Limit.Please adjust the product value.');
$('#EditRate').focus(); // $('#EditRate').focus();
return false; // return false;
} // }
else // else
{ // {
return true; return true;
} //}
} }
function calculateEditTotalValue() function calculateEditTotalValue()
@ -1311,6 +1315,34 @@ function calculateEditTaxValue()
</div> </div>
<div class="col-md-2" style="padding-right: 0px;">
<label for="BudgetType">Budget Type</label>
<select id='BudgetType' name='BudgetType'>
<?php if($BudgetType== 'CAPITAL')
{
$opt1='CAPITAL';
$opt2='REVENUE';
}
else
{
$opt1='REVENUE';
$opt2='CAPITAL';
} ?>
<option value=<?php echo $opt1;?>><?php echo $opt1;?></option>
<option value=<?php echo $opt2;?>><?php echo $opt2;?></option>
</select>
</div>
</div> </div>
</div> </div>
@ -2159,6 +2191,8 @@ function calculateEditTaxValue()
var index = '1'; var index = '1';
var userid = ''; var userid = '';
$('#BudgetType').attr("style", "pointer-events: none;");
$("#EDITREVENUE").on("shown.bs.modal", function(e) { $("#EDITREVENUE").on("shown.bs.modal", function(e) {
var AvlBudAmt = '<?php echo $AvlAmount?>'; var AvlBudAmt = '<?php echo $AvlAmount?>';
@ -2513,25 +2547,25 @@ function validateEditRevenueTax()
{ {
if($('#EditCostCenter').val() == "") if($('#EditCostCenter').val() == "")
{ {
swal('Please select the Cost center'); alert('Please select the Cost center');
$('#EditCostCenter').focus(); $('#EditCostCenter').focus();
return false; return false;
} }
else if($('#EditMaterialCode').val() == "0") else if($('#EditMaterialCode').val() == "0")
{ {
swal('Please select the Material Code'); alert('Please select the Material Code');
$('#EditMaterialCode').focus(); $('#EditMaterialCode').focus();
return false; return false;
} }
else if($('#EditQuantity').val() == '' || $('#EditQuantity').val() == 0) else if($('#EditQuantity').val() == '' || $('#EditQuantity').val() == 0)
{ {
swal('Please Enter the Quantity value'); alert('Please Enter the Quantity value');
$('#EditQuantity').focus(); $('#EditQuantity').focus();
return false; return false;
} }
else if($('#EditRate').val() == '' || $('#EditRate').val() == 0) else if($('#EditRate').val() == '')
{ {
swal('Please Enter the Rate of the Item'); alert('Please Enter the Rate of the Item');
$('#EditRate').focus(); $('#EditRate').focus();
return false; return false;
} }
@ -2563,21 +2597,21 @@ function validateBudgetExceedLimit()
{ {
//alert(data); //alert(data);
avalbudAmt = parseFloat(data); avalbudAmt = parseFloat(data);
if(basicAmountRate > avalbudAmt || totalAmount > avalbudAmt) // if(basicAmountRate > avalbudAmt || totalAmount > avalbudAmt)
{ // {
swal('Basic amount is exceeding the Budget Limit.Please adjust the product value.'); // alert('Basic amount is exceeding the Budget Limit.Please adjust the product value.');
$('.content').loader('hide'); // $('.content').loader('hide');
$('#Rate').focus(); // $('#Rate').focus();
return false; // return false;
} // }
else // else
{ // {
//alert('Not exceeding in else part'); //alert('Not exceeding in else part');
return true; return true;
} //}
} }
@ -2615,15 +2649,15 @@ var txtTotalDiscount = $('#txtTotalDiscount').val();
//alert(realrows); //alert(realrows);
if(document.getElementById('revenueTax').rows.length < 2) if(document.getElementById('revenueTax').rows.length < 2)
{ {
swal('Please Select Line item to Create PO'); alert('Please Select Line item to Create PO');
$('#Deliverydt').focus(); $('#Deliverydt').focus();
return false; return false;
} }
else if(parseInt(AvlBudAmt) < (parseInt(txtTotBasicAmount) - parseInt(txtTotalDiscount))) { // else if(parseInt(AvlBudAmt) < (parseInt(txtTotBasicAmount) - parseInt(txtTotalDiscount))) {
swal('Total Order Amount is exceeding the Budget Limit.Please adjust the product value.'); // alert('Total Order Amount is exceeding the Budget Limit.Please adjust the product value.');
return false; // return false;
} // }
else else
{ {
//alert('final else for store data'); //alert('final else for store data');
@ -2636,7 +2670,7 @@ var txtTotalDiscount = $('#txtTotalDiscount').val();
if(data) if(data)
{ {
$('.content').loader('hide'); $('.content').loader('hide');
swal(data); alert(data);
$('#txtRowCount').val(''); $('#txtRowCount').val('');
$('#txtDeletedRow').val(''); $('#txtDeletedRow').val('');
$('#txtStatus').val(''); $('#txtStatus').val('');
@ -2648,7 +2682,7 @@ var txtTotalDiscount = $('#txtTotalDiscount').val();
else else
{ {
$('.content').loader('hide'); $('.content').loader('hide');
swal("Error"); alert("Error");
} }
} }

189
application/views/editServiceAmendPO.php Executable file → Normal file
View File

@ -38,6 +38,8 @@
$InsuranceNo=''; $InsuranceNo='';
$ServiceTypeOptions=''; $ServiceTypeOptions='';
$DescriptionOfPo = ''; $DescriptionOfPo = '';
$BudgetType = '';
if(!empty($INRSYMBOL)) if(!empty($INRSYMBOL))
{ {
@ -92,10 +94,14 @@
$InsuranceNo=$Req->InsuranceNumber; $InsuranceNo=$Req->InsuranceNumber;
$ServiceTypeOptions=$Req->POSubType; $ServiceTypeOptions=$Req->POSubType;
$DescriptionOfPo = $Req->Description_Of_Service; $DescriptionOfPo = $Req->Description_Of_Service;
$BudgetType = $Req->BudgetType;
} }
} }
if(!empty($RequistionDetails)) if(!empty($RequistionDetails))
{ {
@ -279,7 +285,7 @@ $('#drpSupplier').change(function() {
} }
else else
{ {
swal('Please select the SupplierID'); alert('Please select the SupplierID');
return false; return false;
} }
@ -404,7 +410,7 @@ for(i=2;i<=rows;i++){
} }
else else
{ {
swal('Please select the Requisition Number'); alert('Please select the Requisition Number');
return false; return false;
} }
id = ''; id = '';
@ -438,7 +444,7 @@ $('#MaterialCode').change(function() {
} }
else else
{ {
swal('Please select the MaterialCode'); alert('Please select the MaterialCode');
return false; return false;
} }
@ -475,7 +481,7 @@ $("#EditQuantity").val('');
} }
else else
{ {
swal('Please select the MaterialCode'); alert('Please select the MaterialCode');
return false; return false;
} }
@ -487,19 +493,19 @@ function Ratechange(){
if($('#ReqNo').val() == "0") if($('#ReqNo').val() == "0")
{ {
swal('Please select the Requisition Number'); alert('Please select the Requisition Number');
$('#ReqNo').focus(); $('#ReqNo').focus();
return false; return false;
} }
else if($('#MaterialCode').val() == "0") else if($('#MaterialCode').val() == "0")
{ {
swal('Please select the Material Code'); alert('Please select the Material Code');
$('#MaterialCode').focus(); $('#MaterialCode').focus();
return false; return false;
} }
else if($('#CostCenter').val() == "0") else if($('#CostCenter').val() == "0")
{ {
swal('Please select the CostCenterCode'); alert('Please select the CostCenterCode');
$('#CostCenter').focus(); $('#CostCenter').focus();
return false; return false;
} }
@ -536,7 +542,7 @@ function EditRatechange(){
if($('#EditCostCenter').val() == "0") if($('#EditCostCenter').val() == "0")
{ {
swal('Please select the CostCenterCode'); alert('Please select the CostCenterCode');
$('#EditCostCenter').focus(); $('#EditCostCenter').focus();
return false; return false;
} }
@ -600,15 +606,15 @@ function IGSTchange()
var ReqAmount = parseFloat(ValuetoCheck); var ReqAmount = parseFloat(ValuetoCheck);
var BudAmount = parseFloat(budgetAmount); var BudAmount = parseFloat(budgetAmount);
if(ReqAmount > BudAmount ) // if(ReqAmount > BudAmount )
{ // {
swal('Your exceeding the Avaiable Budget :'+ AvilBudAmt +'.Please adjust the Product to proceed further.'); // alert('Your exceeding the Avaiable Budget :'+ AvilBudAmt +'.Please adjust the Product to proceed further.');
return false; // return false;
} // }
else // else
{ // {
return true; return true;
} // }
} }
@ -1065,6 +1071,34 @@ $(document).ready(function () {
</div> </div>
</div> </div>
<div class="col-md-2" style="padding-right: 0px;">
<label for="BudgetType">Budget Type</label>
<select id='BudgetType' name='BudgetType'>
<?php if($BudgetType== 'CAPITAL')
{
$opt1='CAPITAL';
$opt2='REVENUE';
}
else
{
$opt1='REVENUE';
$opt2='CAPITAL';
} ?>
<option value=<?php echo $opt1;?>><?php echo $opt1;?></option>
<option value=<?php echo $opt2;?>><?php echo $opt2;?></option>
</select>
</div>
</div> </div>
</div><!--End new fields 1 sep--> </div><!--End new fields 1 sep-->
@ -1152,6 +1186,9 @@ $(document).ready(function () {
</div> </div>
</div> </div>
<div class="col-md-3" id=EditotherDescription> <div class="col-md-3" id=EditotherDescription>
<label>Item Description</label> <label>Item Description</label>
<div class="form-group"> <div class="form-group">
@ -1161,6 +1198,11 @@ $(document).ready(function () {
?> ?>
</div> </div>
</div> </div>
<div class="col-md-3"> <div class="col-md-3">
<label>UOM</label> <label>UOM</label>
<div class="form-group"> <div class="form-group">
@ -1417,71 +1459,70 @@ $(document).ready(function () {
<input type="hidden" name="<?php echo 'Reqnumber'.$index ?>" id="<?php echo 'Reqnumber'.$index ?>" value="<?php echo $record->ReqNo ; ?>" /> <input type="hidden" name="<?php echo 'Reqnumber'.$index ?>" id="<?php echo 'Reqnumber'.$index ?>" value="<?php echo $record->ReqNo ; ?>" />
<input type="hidden" name="<?php echo 'departmentName'.$index ?>" id="<?php echo 'departmentName'.$index ?>" value="<?php echo $record->ReqNo ; ?>" /> <input type="hidden" name="<?php echo 'departmentName'.$index ?>" id="<?php echo 'departmentName'.$index ?>" value="<?php echo $record->ReqNo ; ?>" />
<input type="hidden" name="<?php echo 'AvilBudget'.$index ?>" id="<?php echo 'AvilBudget'.$index ?>" value="<?php echo $AvlAmount ; ?>" /> <input type="hidden" name="<?php echo 'AvilBudget'.$index ?>" id="<?php echo 'AvilBudget'.$index ?>" value="<?php echo $AvlAmount ; ?>" />
<input type="hidden" name="<?php echo 'LineItemNo'.$index ?>" id="<?php echo 'LineItemNo'.$index ?>" value="<?php echo $record->LineItemNo ; ?>" /> <input type="hidden" name="<?php echo 'LineItemNo'.$index ?>" id="<?php echo 'LineItemNo'.$index ?>" value="<?php echo $record->LineItemNo ; ?>" />
<input type="hidden" name="<?php echo 'costCode'.$index ?>" id="<?php echo 'costCode'.$index ?>" value="<?php echo $record->CostCenterCode ; ?>" /> <input type="hidden" name="<?php echo 'costCode'.$index ?>" id="<?php echo 'costCode'.$index ?>" value="<?php echo $record->CostCenterCode ; ?>" />
<input type="hidden" name="<?php echo 'materialCode'.$index ?>" id="<?php echo 'materialCode'.$index ?>" value="<?php echo $record->MaterialCode ; ?>" /> <input type="hidden" name="<?php echo 'materialCode'.$index ?>" id="<?php echo 'materialCode'.$index ?>" value="<?php echo $record->MaterialCode ; ?>" />
<input type="hidden" name="<?php echo 'materialName'.$index ?>" id="<?php echo 'materialName'.$index ?>" value="<?php echo $record->MaterialName ; ?>" /> <input type="hidden" name="<?php echo 'materialName'.$index ?>" id="<?php echo 'materialName'.$index ?>" value="<?php echo $record->MaterialName ; ?>" />
<input type="hidden" name="<?php echo 'uom'.$index ?>" id="<?php echo 'uom'.$index ?>" value="<?php echo $record->UOM ; ?>" /> <input type="hidden" name="<?php echo 'uom'.$index ?>" id="<?php echo 'uom'.$index ?>" value="<?php echo $record->UOM ; ?>" />
<input type="hidden" name="<?php echo 'per'.$index ?>" id="<?php echo 'per'.$index ?>" value="<?php echo $record->Per ; ?>" /> <input type="hidden" name="<?php echo 'per'.$index ?>" id="<?php echo 'per'.$index ?>" value="<?php echo $record->Per ; ?>" />
<input type="hidden" name="<?php echo 'quantity'.$index ?>" id="<?php echo 'quantity'.$index ?>" value="<?php echo $record->Quantity ; ?>" /> <input type="hidden" name="<?php echo 'quantity'.$index ?>" id="<?php echo 'quantity'.$index ?>" value="<?php echo $record->Quantity ; ?>" />
<input type="hidden" name="<?php echo 'beforequantity'.$index ?>" id="<?php echo 'beforequantity'.$index ?>" value="<?php echo $record->Quantity ; ?>" /> <input type="hidden" name="<?php echo 'beforequantity'.$index ?>" id="<?php echo 'beforequantity'.$index ?>" value="<?php echo $record->Quantity ; ?>" />
<input type="hidden" name="<?php echo 'itemRate'.$index ?>" id="<?php echo 'itemRate'.$index ?>" value="<?php echo $record->Rate ; ?>" /> <input type="hidden" name="<?php echo 'itemRate'.$index ?>" id="<?php echo 'itemRate'.$index ?>" value="<?php echo $record->Rate ; ?>" />
<input type="hidden" name="<?php echo 'beforeitemRate'.$index ?>" id="<?php echo 'beforeitemRate'.$index ?>" value="<?php echo $record->Rate ; ?>" /> <input type="hidden" name="<?php echo 'beforeitemRate'.$index ?>" id="<?php echo 'beforeitemRate'.$index ?>" value="<?php echo $record->Rate ; ?>" />
<input type="hidden" name="<?php echo 'Cgst'.$index ?>" id="<?php echo 'Cgst'.$index ?>" value="<?php echo $record->CGST ; ?>" /> <input type="hidden" name="<?php echo 'Cgst'.$index ?>" id="<?php echo 'Cgst'.$index ?>" value="<?php echo $record->CGST ; ?>" />
<input type="hidden" name="<?php echo 'beforeCgst'.$index ?>" id="<?php echo 'beforeCgst'.$index ?>" value="<?php echo $record->CGST ; ?>" /> <input type="hidden" name="<?php echo 'beforeCgst'.$index ?>" id="<?php echo 'beforeCgst'.$index ?>" value="<?php echo $record->CGST ; ?>" />
<input type="hidden" name="<?php echo 'AfterCgst'.$index ?>" id="<?php echo 'AfterCgst'.$index ?>" value="<?php echo $record->After_CGST ; ?>" /> <input type="hidden" name="<?php echo 'AfterCgst'.$index ?>" id="<?php echo 'AfterCgst'.$index ?>" value="<?php echo $record->After_CGST ; ?>" />
<input type="hidden" name="<?php echo 'beforeCgstvalue'.$index ?>" id="<?php echo 'beforeCgstvalue'.$index ?>" value="<?php echo $record->After_CGST ; ?>" /> <input type="hidden" name="<?php echo 'beforeCgstvalue'.$index ?>" id="<?php echo 'beforeCgstvalue'.$index ?>" value="<?php echo $record->After_CGST ; ?>" />
<input type="hidden" name="<?php echo 'Sgst'.$index ?>" id="<?php echo 'Sgst'.$index ?>" value="<?php echo $record->SGST ; ?>" /> <input type="hidden" name="<?php echo 'Sgst'.$index ?>" id="<?php echo 'Sgst'.$index ?>" value="<?php echo $record->SGST ; ?>" />
<input type="hidden" name="<?php echo 'beforeSgst'.$index ?>" id="<?php echo 'beforeSgst'.$index ?>" value="<?php echo $record->SGST ; ?>" /> <input type="hidden" name="<?php echo 'beforeSgst'.$index ?>" id="<?php echo 'beforeSgst'.$index ?>" value="<?php echo $record->SGST ; ?>" />
<input type="hidden" name="<?php echo 'AfterSgst'.$index ?>" id="<?php echo 'AfterSgst'.$index ?>" value="<?php echo $record->After_SGST ; ?>" /> <input type="hidden" name="<?php echo 'AfterSgst'.$index ?>" id="<?php echo 'AfterSgst'.$index ?>" value="<?php echo $record->After_SGST ; ?>" />
<input type="hidden" name="<?php echo 'beforeSgstvalue'.$index ?>" id="<?php echo 'beforeSgstvalue'.$index ?>" value="<?php echo $record->After_SGST ; ?>" /> <input type="hidden" name="<?php echo 'beforeSgstvalue'.$index ?>" id="<?php echo 'beforeSgstvalue'.$index ?>" value="<?php echo $record->After_SGST ; ?>" />
<input type="hidden" name="<?php echo 'Igst'.$index ?>" id="<?php echo 'Igst'.$index ?>" value="<?php echo $record->IGST ; ?>" /> <input type="hidden" name="<?php echo 'Igst'.$index ?>" id="<?php echo 'Igst'.$index ?>" value="<?php echo $record->IGST ; ?>" />
<input type="hidden" name="<?php echo 'beforeIgst'.$index ?>" id="<?php echo 'beforeIgst'.$index ?>" value="<?php echo $record->IGST ; ?>" /> <input type="hidden" name="<?php echo 'beforeIgst'.$index ?>" id="<?php echo 'beforeIgst'.$index ?>" value="<?php echo $record->IGST ; ?>" />
<input type="hidden" name="<?php echo 'AfterIgst'.$index ?>" id="<?php echo 'AfterIgst'.$index ?>" value="<?php echo $record->After_IGST ; ?>" /> <input type="hidden" name="<?php echo 'AfterIgst'.$index ?>" id="<?php echo 'AfterIgst'.$index ?>" value="<?php echo $record->After_IGST ; ?>" />
<input type="hidden" name="<?php echo 'beforeIgstvalue'.$index ?>" id="<?php echo 'beforeIgstvalue'.$index ?>" value="<?php echo $record->After_IGST ; ?>" /> <input type="hidden" name="<?php echo 'beforeIgstvalue'.$index ?>" id="<?php echo 'beforeIgstvalue'.$index ?>" value="<?php echo $record->After_IGST ; ?>" />
<input type="hidden" name="<?php echo 'otherallowance'.$index ?>" id="<?php echo 'otherallowance'.$index ?>" value="<?php echo $record->otherallowance ; ?>" /> <input type="hidden" name="<?php echo 'otherallowance'.$index ?>" id="<?php echo 'otherallowance'.$index ?>" value="<?php echo $record->otherallowance ; ?>" />
<input type="hidden" name="<?php echo 'beforeotherallowance'.$index ?>" id="<?php echo 'beforeotherallowance'.$index ?>" value="<?php echo $record->otherallowance ; ?>" /> <input type="hidden" name="<?php echo 'beforeotherallowance'.$index ?>" id="<?php echo 'beforeotherallowance'.$index ?>" value="<?php echo $record->otherallowance ; ?>" />
<input type="hidden" name="<?php echo 'TotalOrderValue'.$index ?>" id="<?php echo 'TotalOrderValue'.$index ?>" value="<?php echo $record->TotalValue ; ?>" /> <input type="hidden" name="<?php echo 'TotalOrderValue'.$index ?>" id="<?php echo 'TotalOrderValue'.$index ?>" value="<?php echo $record->TotalValue ; ?>" />
<input type="hidden" name="<?php echo 'servicematerialdescription'.$index ?>" id="<?php echo 'servicematerialdescription'.$index ?>" value="<?php echo $record->ServiceMaterialDescription ; ?>" /> <input type="hidden" name="<?php echo 'servicematerialdescription'.$index ?>" id="<?php echo 'servicematerialdescription'.$index ?>" value="<?php echo $record->ServiceMaterialDescription ; ?>" />
<input type="hidden" name="<?php echo 'Frequency'.$index ?>" id="<?php echo 'Frequency'.$index ?>" value="<?php echo $Frequency; ?>" /> <input type="hidden" name="<?php echo 'Frequency'.$index ?>" id="<?php echo 'Frequency'.$index ?>" value="<?php echo $Frequency; ?>" />
<input type="hidden" name="<?php echo 'FrequencyNo'.$index ?>" id="<?php echo 'FrequencyNo'.$index ?>" value="<?php echo $FrequencyNo ; ?>" /> <input type="hidden" name="<?php echo 'FrequencyNo'.$index ?>" id="<?php echo 'FrequencyNo'.$index ?>" value="<?php echo $FrequencyNo ; ?>" />
<input type="hidden" name="<?php echo 'FrequencyValue'.$index ?>" id="<?php echo 'FrequencyValue'.$index ?>" value="<?php echo $FrequencyNo ; ?>" /> <input type="hidden" name="<?php echo 'FrequencyValue'.$index ?>" id="<?php echo 'FrequencyValue'.$index ?>" value="<?php echo $FrequencyNo ; ?>" />
<input type="hidden" name="<?php echo 'OtherServiceDescription'.$index ?>" id="<?php echo 'OtherServiceDescription'.$index ?>" value="<?php echo $record->MaterialDescription ; ?>" /> <input type="hidden" name="<?php echo 'OtherServiceDescription'.$index ?>" id="<?php echo 'OtherServiceDescription'.$index ?>" value="<?php echo $record->MaterialDescription ; ?>" />
<?php <?php
@ -1654,6 +1695,9 @@ var userid = '';
}; };
$('#BudgetType').attr("style", "pointer-events: none;");
$('#EditotherDescription').hide(); $('#EditotherDescription').hide();
$("#EDITSERVICE").on("shown.bs.modal", function(e) { $("#EDITSERVICE").on("shown.bs.modal", function(e) {
@ -1686,19 +1730,20 @@ $("#EDITSERVICE").on("shown.bs.modal", function(e) {
$('#EditAfterSgst').val($('#AfterSgst'+userid).val()); $('#EditAfterSgst').val($('#AfterSgst'+userid).val());
$('#EditAfterIgst').val($('#AfterIgst'+userid).val()); $('#EditAfterIgst').val($('#AfterIgst'+userid).val());
$('#otherallowance').val($('#otherallowance'+userid).val()); $('#otherallowance').val($('#otherallowance'+userid).val());
$('#EditOtheritemDescription').val($('#OtherServiceDescription'+userid).val()); $('#EditOtheritemDescription').val($('#OtherServiceDescription'+userid).val());
var res= $('#OtherServiceDescription'+userid).val(); var res= $('#OtherServiceDescription'+userid).val();
if(res=='') if(res=='')
{ {
$('#EditotherDescription').hide(); $('#EditotherDescription').hide();
} }
else else
{ {
$('#EditotherDescription').show(); $('#EditotherDescription').show();
} }
if($('#FrequencyValue'+userid).val()==1){ if($('#FrequencyValue'+userid).val()==1){
$('#EditFrequency').val($('#Frequency'+userid).val()); $('#EditFrequency').val($('#Frequency'+userid).val());
$("#EditFrequencyNo").val(1); $("#EditFrequencyNo").val(1);
@ -2033,11 +2078,11 @@ function DeleteRow(rowid)
if(data) if(data)
{ {
$('#content').loader('hide'); $('#content').loader('hide');
swal(data); alert(data);
} }
else else
{ {
swal("Error"); alert("Error");
} }
}}); }});
@ -2097,31 +2142,31 @@ function validateServiceTax()
if($('#ReqNo').val() == "0") if($('#ReqNo').val() == "0")
{ {
swal('Please select the Requisition Number'); alert('Please select the Requisition Number');
$('#ReqNo').focus(); $('#ReqNo').focus();
return false; return false;
} }
else if($('#CostCenter').val() == "0") else if($('#CostCenter').val() == "0")
{ {
swal('Please select the Cost center'); alert('Please select the Cost center');
$('#CostCenter').focus(); $('#CostCenter').focus();
return false; return false;
} }
else if($('#MaterialCode').val() == "0") else if($('#MaterialCode').val() == "0")
{ {
swal('Please select the Material Code'); alert('Please select the Material Code');
$('#MaterialCode').focus(); $('#MaterialCode').focus();
return false; return false;
} }
else if($('#Quantity').val() == '') else if($('#Quantity').val() == '')
{ {
swal('Please Enter the Quantity value'); alert('Please Enter the Quantity value');
$('#Quantity').focus(); $('#Quantity').focus();
return false; return false;
} }
else if($('#Rate').val() == '') else if($('#Rate').val() == '')
{ {
swal('Please Enter the Rate of the Item'); alert('Please Enter the Rate of the Item');
$('#Rate').focus(); $('#Rate').focus();
return false; return false;
} }
@ -2145,25 +2190,25 @@ function validateServiceTax()
if($('#EditCostCenter').val() == "0") if($('#EditCostCenter').val() == "0")
{ {
swal('Please select the Cost center'); alert('Please select the Cost center');
$('#EditCostCenter').focus(); $('#EditCostCenter').focus();
return false; return false;
} }
else if($('#EditMaterialCode').val() == "0") else if($('#EditMaterialCode').val() == "0")
{ {
swal('Please select the Material Code'); alert('Please select the Material Code');
$('#EditMaterialCode').focus(); $('#EditMaterialCode').focus();
return false; return false;
} }
else if($('#EditQuantity').val() == '' || $('#EditQuantity').val() == 0.00) else if($('#EditQuantity').val() == '' || $('#EditQuantity').val() == 0.00)
{ {
swal('Please Enter the Quantity value'); alert('Please Enter the Quantity value');
$('#EditQuantity').focus(); $('#EditQuantity').focus();
return false; return false;
} }
else if($('#EditRate').val() == '' || $('#EditRate').val() == 0.00) else if($('#EditRate').val() == '' || $('#EditRate').val() == 0.00)
{ {
swal('Please Enter the Rate of the Item'); alert('Please Enter the Rate of the Item');
$('#EditRate').focus(); $('#EditRate').focus();
return false; return false;
} }
@ -2177,7 +2222,7 @@ function validateServiceTax()
return false; return false;
} }
else if($('#EdittxtSpcialInstruction').val()==''){ else if($('#EdittxtSpcialInstruction').val()==''){
swal('Please Enter the Service Description'); alert('Please Enter the Service Description');
$('#EdittxtSpcialInstruction').focus(); $('#EdittxtSpcialInstruction').focus();
return false; return false;
} }
@ -2215,18 +2260,18 @@ var txtTotalOrderValueSummary = $('#txtTotBasicAmount').val();
if(validate()) if(validate())
{ {
if(parseInt(AvlBudAmt) < parseInt(txtTotalOrderValueSummary)) { // if(parseInt(AvlBudAmt) < parseInt(txtTotalOrderValueSummary)) {
swal('Total Order Amount is exceeding the Budget Limit.Please adjust the product value.'); // alert('Total Order Amount is exceeding the Budget Limit.Please adjust the product value.');
return false; // return false;
} // }
else if($('#Otherpayment').val()=='' && $('#PaymentTerms').val()=='PT08'){ if($('#Otherpayment').val()=='' && $('#PaymentTerms').val()=='PT08'){
swal('Please Enter Other Payment Details'); alert('Please Enter Other Payment Details');
$('#Otherpayment').focus(); $('#Otherpayment').focus();
return false; return false;
} }
else if($('#amenddescofpo').val().trim()==''){ else if($('#amenddescofpo').val().trim()==''){
swal('Please Enter Description Of Service'); alert('Please Enter Description Of Service');
$('#amenddescofpo').focus(); $('#amenddescofpo').focus();
return false; return false;
} }
@ -2241,7 +2286,7 @@ var txtTotalOrderValueSummary = $('#txtTotBasicAmount').val();
{ {
$('#content').loader('hide'); $('#content').loader('hide');
swal(data); alert(data);
$('#txtRowCount').val(''); $('#txtRowCount').val('');
$('#txtDeletedRow').val(''); $('#txtDeletedRow').val('');
$('#txtStatus').val(''); $('#txtStatus').val('');
@ -2253,7 +2298,7 @@ var txtTotalOrderValueSummary = $('#txtTotBasicAmount').val();
else else
{ {
$('#content').loader('hide'); $('#content').loader('hide');
swal("Error"); alert("Error");
} }
} }

View File

@ -63,6 +63,8 @@ if(!empty($AvlimportBudAmt))
} }
//echo $AvlAmount;
// if(!empty($AvlBudAmt)) // if(!empty($AvlBudAmt))
// { // {
@ -165,19 +167,19 @@ function vaildateBeforeOpenModal()
{ {
if($('#PODate').val() == '') if($('#PODate').val() == '')
{ {
swal('Please Enter the Purchase Order date'); alert('Please Enter the Purchase Order date');
$('#PODate').focus(); $('#PODate').focus();
return false; return false;
} }
else if($('#drpSupplier').val() == "0") else if($('#drpSupplier').val() == "0")
{ {
swal('Please Select the Supplier details'); alert('Please Select the Supplier details');
$('#drpSupplier').focus(); $('#drpSupplier').focus();
return false; return false;
} }
else if($('#DeliveryAddr').val() == '') else if($('#DeliveryAddr').val() == '')
{ {
swal('Please Enter the Delivery Address'); alert('Please Enter the Delivery Address');
$('#DeliveryAddr').focus(); $('#DeliveryAddr').focus();
return false; return false;
} }
@ -185,51 +187,52 @@ function vaildateBeforeOpenModal()
{ {
if(document.getElementById("Schedule").checked) if(document.getElementById("Schedule").checked)
{ {
swal('Please Enter Schedule By'); alert('Please Enter Schedule By');
return false; return false;
} }
else if(document.getElementById("Date").checked) else if(document.getElementById("Date").checked)
{ {
swal('Please Enter Dispatch Instruction'); alert('Please Enter Dispatch Instruction');
return false; return false;
} }
} }
else if($('#currencytype').val() == '0') else if($('#currencytype').val() == '0')
{ {
swal('Please Select the Currency Type'); alert('Please Select the Currency Type');
$('#currencytype').focus(); $('#currencytype').focus();
return false; return false;
} }
else if($('#ExchangeRate').val() == '') else if($('#ExchangeRate').val() == '')
{ {
swal('Please Enter the Exchange Rate'); alert('Please Enter the Exchange Rate');
$('#ExchangeRate').focus(); $('#ExchangeRate').focus();
return false; return false;
} }
else if($('#ExchangeRate').val() == 0) else if($('#ExchangeRate').val() == 0)
{ {
swal('Please Enter the Exchange Rate'); alert('Please Enter the Exchange Rate');
$('#ExchangeRate').focus(); $('#ExchangeRate').focus();
return false; return false;
} }
else if($('#PlaceOforigin').val()== '') else if($('#PlaceOforigin').val()== '')
{ {
swal('Please Enter Place Of Origin'); alert('Please Enter Place Of Origin');
$('#PlaceOforigin').focus(); $('#PlaceOforigin').focus();
return false; return false;
} }
else if($('#PaymentTerms').val()=='') else if($('#PaymentTerms').val()=='')
{ {
swal('Please Select Payment Terms'); alert('Please Select Payment Terms');
$('#PaymentTerms').focus(); $('#PaymentTerms').focus();
return false; return false;
} }
else if($('#BudgetType').val()=="0") else if($('#BudgetType').val()=="0")
{ {
alert('Please Select Budget Type'); alert('Please Select Budget Type');
@ -243,7 +246,7 @@ function vaildateBeforeOpenModal()
else if($('#Importoption').val()== "0") else if($('#Importoption').val()== "0")
{ {
swal('Please Select POType'); alert('Please Select POType');
$('#Importoption').focus(); $('#Importoption').focus();
return false; return false;
@ -288,7 +291,9 @@ function vaildateBeforeOpenModal()
<center><b><h2>Resico Industries - Import Purchase Order</h2></b></center><br/> <center><b><h2>Resico Industries - Import Purchase Order</h2></b></center><br/>
<div class="col-md-12 text-right" style="padding-bottom: 6px; padding-right: 23px;"> <div class="col-md-12 text-right" style="padding-bottom: 6px; padding-right: 23px;">
<a href="<?php echo base_url() ?>CreatePO" class="btn btn-primary" id="back" value="Back">Back</a> <a href="<?php echo base_url() ?>CreatePO" class="btn btn-primary" id="back" value="Back">Back</a>
</div> </div>
@ -587,6 +592,8 @@ function vaildateBeforeOpenModal()
$options3 = array("0"=>'Select'); $options3 = array("0"=>'Select');
if(!empty($PoTypeOptions)) if(!empty($PoTypeOptions))
{ {
foreach ($PoTypeOptions as $payment): foreach ($PoTypeOptions as $payment):
@ -685,6 +692,7 @@ function vaildateBeforeOpenModal()
</div> </div>
<div class="col-md-2" style="padding-right: 0px;"> <div class="col-md-2" style="padding-right: 0px;">
<label for="BudgetType">Budget Type</label> <label for="BudgetType">Budget Type</label>
<?php <?php
@ -694,7 +702,13 @@ function vaildateBeforeOpenModal()
echo form_dropdown('BudgetType', $optionsnew,set_value('BudgetType'),'id="BudgetType"' ,'required="true"' ,'class="form-control select2'); echo form_dropdown('BudgetType', $optionsnew,set_value('BudgetType'),'id="BudgetType"' ,'required="true"' ,'class="form-control select2');
?> ?>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
@ -1306,7 +1320,7 @@ echo form_textarea($data);
<!-- Modal content--> <!-- Modal content-->
<form> <form>
<div class="modal-content" style="width:1000px;font-size:12px;"> <div class="modal-content" style="width:1000px;font-size:12px;">
<div class="modal-header" style="background-color: #3c8dbc;color:#fff;"> <div class="modal-header" style="background-color: #5d0411;color:#fff;">
<button type="button" class="close" data-dismiss="modal">&times;</button> <button type="button" class="close" data-dismiss="modal">&times;</button>
<center><h4>Edit Import Purchase Order Item </h4></center> <center><h4>Edit Import Purchase Order Item </h4></center>
</div> </div>
@ -2043,7 +2057,9 @@ echo form_textarea($data);
<input type="hidden" name="txtStatus" id="txtStatus" /> <input type="hidden" name="txtStatus" id="txtStatus" />
<input type="hidden" name="txtRowCount" id="txtRowCount" /> <input type="hidden" name="txtRowCount" id="txtRowCount" />
<input type="hidden" name="txtDeletedRow" id="txtDeletedRow" /> <input type="hidden" name="txtDeletedRow" id="txtDeletedRow" />
<input type="hidden" name="Budget" id="Budget" /> <input type="hidden" name="Budget" id="Budget" />
<a class="btn btn-primary Save" ID="Save" onclick="Save(0)" >&nbsp;&nbsp;<span class="bold">Save</span></a> <a class="btn btn-primary Save" ID="Save" onclick="Save(0)" >&nbsp;&nbsp;<span class="bold">Save</span></a>
<a class="btn btn-primary Submit" ID="Submit" onclick="Save(1)" >&nbsp;&nbsp;<span class="bold">Submit</span></a> <a class="btn btn-primary Submit" ID="Submit" onclick="Save(1)" >&nbsp;&nbsp;<span class="bold">Submit</span></a>
<input type="reset" class="btn btn-primary" value="Reset" onclick="window.location.reload()"> <input type="reset" class="btn btn-primary" value="Reset" onclick="window.location.reload()">
@ -2115,6 +2131,8 @@ $(document).on('change',".changetodecimal", function(){
}); });
$("#BudgetType").change(function(){ $("#BudgetType").change(function(){
var aa = $("#BudgetType option:selected").text(); var aa = $("#BudgetType option:selected").text();
@ -2123,6 +2141,8 @@ $("#BudgetType").change(function(){
}); });
var SelectedMaterialCode = []; var SelectedMaterialCode = [];
var RequistQuantity = ''; var RequistQuantity = '';
var AvilBudAmt = ''; var AvilBudAmt = '';
@ -2159,12 +2179,15 @@ else
$('#Importoption').change(function() $('#Importoption').change(function()
{ {
var potypeval=$('#Importoption').val(); var potypeval=$('#Importoption').val();
var poopt= <?php echo json_encode($PoTypeOptions, JSON_PRETTY_PRINT) ?>; var poopt= <?php echo json_encode($PoTypeOptions, JSON_PRETTY_PRINT) ?>;
var config=poopt[0].ConfigValue; var config=poopt[0].ConfigValue;
var Payment = <?php echo json_encode($Payment, JSON_PRETTY_PRINT) ?>; var Payment = <?php echo json_encode($Payment, JSON_PRETTY_PRINT) ?>;
var default1=Payment[4].PaymentTerms; var default1=Payment[4].PaymentTerms;
if(potypeval==config) if(potypeval==config)
{ {
$('#PaymentTerms').empty(); $('#PaymentTerms').empty();
@ -2179,13 +2202,17 @@ $('#Importoption').change(function()
}); });
$.each(Payment,function(idx,obj) $.each(Payment,function(idx,obj)
{ {
if(obj.PaymentID=='PT05') if(obj.PaymentID=='PT05')
{ {
} }
else else
{ {
$("#PaymentTerms").append( $('<option></option>').val(obj.PaymentID).html(obj.PaymentTerms)); $("#PaymentTerms").append( $('<option></option>').val(obj.PaymentID).html(obj.PaymentTerms));
@ -2198,18 +2225,12 @@ $('#Importoption').change(function()
$('#drpSupplier').change(function() { $('#drpSupplier').change(function() {
var id = $('#drpSupplier').val(); var id = $('#drpSupplier').val();
$("#SupAddress").val(''); $("#SupAddress").val('');
if(id != '0') if(id != '0')
{ {
var y = <?php echo json_encode($Suplist, JSON_PRETTY_PRINT) ?>; var y = <?php echo json_encode($Suplist, JSON_PRETTY_PRINT) ?>;
@ -2217,18 +2238,15 @@ $('#drpSupplier').change(function() {
var PaymentID=''; var PaymentID='';
$('#PaymentTerms').empty(); $('#PaymentTerms').empty();
$.each(y, function(idx, obj) $.each(y, function(idx, obj)
{ {
if(obj.SupplierID === id) if(obj.SupplierID === id)
{ {
$("#SupAddress").val(obj.Address); $("#SupAddress").val(obj.Address);
PaymentID = obj.PaymentID; PaymentID = obj.PaymentID;
//PaymentID = obj.PaymentID; //PaymentID = obj.PaymentID;
$('#PaymentTerms').val(obj.PaymentTerms); $('#PaymentTerms').val(obj.PaymentTerms);
} }
}); });
@ -2253,7 +2271,6 @@ $('#drpSupplier').change(function() {
if(payobj.PaymentID == PaymentID) if(payobj.PaymentID == PaymentID)
{ {
$("#PaymentTerms").append( $('<option></option>').val(payobj.PaymentID).html(payobj.PaymentTerms)); $("#PaymentTerms").append( $('<option></option>').val(payobj.PaymentID).html(payobj.PaymentTerms));
} }
@ -2283,7 +2300,7 @@ $('#drpSupplier').change(function() {
} }
else else
{ {
swal('Please select the SupplierID'); alert('Please select the SupplierID');
return false; return false;
} }
@ -2317,6 +2334,7 @@ $("#txtBasicValue").val('');
var Material = <?php echo json_encode($MaterialList, JSON_PRETTY_PRINT) ?>; var Material = <?php echo json_encode($MaterialList, JSON_PRETTY_PRINT) ?>;
var AvlBudAmt ='<?php echo $AvlimportBudAmt ?>'; var AvlBudAmt ='<?php echo $AvlimportBudAmt ?>';
//alert(AvlBudAmt);
if(AvlBudAmt == '') if(AvlBudAmt == '')
{ {
$("#AvlBudAmt").val(parseFloat(0).toFixed(2)); $("#AvlBudAmt").val(parseFloat(0).toFixed(2));
@ -2392,7 +2410,7 @@ $("#txtBasicValue").val('');
} }
else else
{ {
swal('Please select the Requisition Number'); alert('Please select the Requisition Number');
return false; return false;
} }
id = ''; id = '';
@ -2435,7 +2453,7 @@ $("#txtBasicValue").val('');
} }
else else
{ {
swal('Please select the MaterialCode'); alert('Please select the MaterialCode');
return false; return false;
} }
@ -2518,7 +2536,7 @@ function QtyZerocheck()
{ {
if(($('#Rate').val()=="0")||$('#Quantity').val()=="0"||($('#Rate').val()=='')||$('#Quantity').val()=='') if(($('#Rate').val()=="0")||$('#Quantity').val()=="0"||($('#Rate').val()=='')||$('#Quantity').val()=='')
{ {
swal('Please Enter A Valid Number for Rate and Quantity'); alert('Please Enter A Valid Number for Rate and Quantity');
$('#txtBasicValue').val(0); $('#txtBasicValue').val(0);
$('#imBasicPrice').val(0); $('#imBasicPrice').val(0);
$('#ExchangeRt').val(0); $('#ExchangeRt').val(0);
@ -2612,7 +2630,7 @@ function EditQtyZerocheck()
{ {
if(($('#EditRate').val()=="0")||$('#EditQuantity').val()=="0"||($('#EditRate').val()=='')||$('#EditQuantity').val()=='') if(($('#EditRate').val()=="0")||$('#EditQuantity').val()=="0"||($('#EditRate').val()=='')||$('#EditQuantity').val()=='')
{ {
swal('Please Enter A Valid Number for Rate and Quantity'); alert('Please Enter A Valid Number for Rate and Quantity');
$('#EdittxtBasicValue').val(0); $('#EdittxtBasicValue').val(0);
$('#EditimBasicPrice').val(0); $('#EditimBasicPrice').val(0);
var txtexchangerate=parseFloat($('#ExchangeRate').val()); var txtexchangerate=parseFloat($('#ExchangeRate').val());
@ -2697,6 +2715,7 @@ if(isNaN(txtINR))
var avalbudAmte= <?php echo json_encode($AvlAmount, JSON_PRETTY_PRINT) ?>; var avalbudAmte= <?php echo json_encode($AvlAmount, JSON_PRETTY_PRINT) ?>;
//alert(avalbudAmte)
function validateEditExceedLimit() function validateEditExceedLimit()
{ {
//var avalbudAmt = parseFloat($('#EditAvlBudAmt').val()); //var avalbudAmt = parseFloat($('#EditAvlBudAmt').val());
@ -2709,7 +2728,7 @@ function validateEditExceedLimit()
// if(exp > avalbudAmte || totalAmount > avalbudAmte) // if(exp > avalbudAmte || totalAmount > avalbudAmte)
// { // {
// swal('Basic amount is exceeding the Budget Limit.Please adjust the product value.'); // alert('Basic amount is exceeding the Budget Limit.Please adjust the product value.');
// $('#EditRate').focus(); // $('#EditRate').focus();
// return false; // return false;
// } // }
@ -2741,14 +2760,14 @@ var avalbudAmt= <?php echo json_encode($AvlAmount, JSON_PRETTY_PRINT) ?>;
// if(exp > avalbudAmt || totalAmount > avalbudAmt) // if(exp > avalbudAmt || totalAmount > avalbudAmt)
// { // {
// swal('Basic amount is exceeding the Budget Limit.Please adjust the product value.'); // alert('Basic amount is exceeding the Budget Limit.Please adjust the product value.');
// $('#Rate').focus(); // $('#Rate').focus();
// return false; // return false;
// } // }
// else // else
// { // {
return true; return true;
// } //}
} }
@ -2903,7 +2922,7 @@ function ExceedQuantityCheck()
var ReqQuantity = parseFloat(RequistQuantity); var ReqQuantity = parseFloat(RequistQuantity);
if(EnterQuantity > ReqQuantity) if(EnterQuantity > ReqQuantity)
{ {
swal('Your exceeding the Quantity from the Requisition Quantity:'+ RequistQuantity +'.Please adjust the Quantity to proceed further.'); alert('Your exceeding the Quantity from the Requisition Quantity:'+ RequistQuantity +'.Please adjust the Quantity to proceed further.');
//$('#Quantity').val(RequistQuantity); //$('#Quantity').val(RequistQuantity);
$('#Quantity').focus(); $('#Quantity').focus();
return false; return false;
@ -2921,7 +2940,7 @@ return true;
var ReqQuantity = parseFloat(RequistQuantity); var ReqQuantity = parseFloat(RequistQuantity);
if(EnterQuantity > ReqQuantity) if(EnterQuantity > ReqQuantity)
{ {
swal('Your exceeding the Quantity from the Requisition Quantity:'+ RequistQuantity +'.Please adjust the Quantity to proceed further.'); alert('Your exceeding the Quantity from the Requisition Quantity:'+ RequistQuantity +'.Please adjust the Quantity to proceed further.');
//$('#Quantity').val(RequistQuantity); //$('#Quantity').val(RequistQuantity);
$('#EditQuantity').focus(); $('#EditQuantity').focus();
return false; return false;
@ -3388,14 +3407,7 @@ $('#drpFreight').change(function() {
{ {
$('#TripsValue').show(); $('#TripsValue').show();
} } }
else if($('#Importoption').val()== "0")
{
alert('Please Select POType');
$('#Importoption').focus();
return false;
else { else {
$('#TripsValue').hide(); $('#TripsValue').hide();
@ -3423,7 +3435,7 @@ $('#drpFreight').change(function() {
} }
else else
{ {
swal('Please Select MaterialCode and Rate Field Value'); alert('Please Select MaterialCode and Rate Field Value');
$('#drpFreight').val("0"); $('#drpFreight').val("0");
$('#Rate').focus(); $('#Rate').focus();
} }
@ -3447,14 +3459,14 @@ function calculateFreight(isEdit)
{ {
if($('#MaterialCode').val() == "0") if($('#MaterialCode').val() == "0")
{ {
swal('Please Select the Material Code'); alert('Please Select the Material Code');
$('#MaterialCode').focus(); $('#MaterialCode').focus();
$('#txtFreight').val('') ; $('#txtFreight').val('') ;
return false; return false;
} }
else if($('#Rate').val() == '') else if($('#Rate').val() == '')
{ {
swal('Please Enter the Rate value'); alert('Please Enter the Rate value');
$('#Rate').focus(); $('#Rate').focus();
$('#txtFreight').val('') ; $('#txtFreight').val('') ;
return false; return false;
@ -3497,7 +3509,7 @@ function calculateFreight(isEdit)
{ {
if($('#NOOfTrips').val()=='') if($('#NOOfTrips').val()=='')
{ {
swal('Please Enter No of Trip'); alert('Please Enter No of Trip');
$("#NOOfTrips").focus(); $("#NOOfTrips").focus();
$('#txtFreight').val(0) $('#txtFreight').val(0)
@ -3537,14 +3549,14 @@ function calculateFreight(isEdit)
//alert(); //alert();
if($('#EditMaterialCode').val() == "0") if($('#EditMaterialCode').val() == "0")
{ {
swal('Please Select the Material Code'); alert('Please Select the Material Code');
$('#EditMaterialCode').focus(); $('#EditMaterialCode').focus();
$('#txtEditFreight').val(''); $('#txtEditFreight').val('');
return false; return false;
} }
else if($('#EditRate').val() == '') else if($('#EditRate').val() == '')
{ {
swal('Please Enter the Rate value'); alert('Please Enter the Rate value');
$('#EditRate').focus(); $('#EditRate').focus();
$('#txtEditFreight').val(''); $('#txtEditFreight').val('');
return false; return false;
@ -3555,7 +3567,7 @@ function calculateFreight(isEdit)
var FreightType =$("#drpeditFreight").val(); var FreightType =$("#drpeditFreight").val();
if(FreightType == "0") if(FreightType == "0")
{ {
swal('Please select Freight Type'); alert('Please select Freight Type');
$('#txtEditFreight').val(''); $('#txtEditFreight').val('');
$("#drpeditFreight").focus(); $("#drpeditFreight").focus();
} }
@ -3585,7 +3597,7 @@ function calculateFreight(isEdit)
else if(FreightType == '<?php echo PERTRIP;?>') else if(FreightType == '<?php echo PERTRIP;?>')
{ {
if($('#editNOOfTrips').val()==''){ if($('#editNOOfTrips').val()==''){
swal('Please Enter No of Trip'); alert('Please Enter No of Trip');
$("#editNOOfTrips").focus(); $("#editNOOfTrips").focus();
$('#txtEditFreight').val(0) $('#txtEditFreight').val(0)
@ -3801,13 +3813,13 @@ function validateImport()
//alert(); //alert();
if($('#ReqNo').val() == "0") if($('#ReqNo').val() == "0")
{ {
swal('Please select the Requisition Number'); alert('Please select the Requisition Number');
$('#ReqNo').focus(); $('#ReqNo').focus();
return false; return false;
} }
else if($('#CostCenter').val() == "0") else if($('#CostCenter').val() == "0")
{ {
swal('Please select the Cost center'); alert('Please select the Cost center');
$('#CostCenter').focus(); $('#CostCenter').focus();
return false; return false;
} }
@ -3819,19 +3831,19 @@ function validateImport()
} }
else if($('#Quantity').val() == '') else if($('#Quantity').val() == '')
{ {
swal('Please Enter the Quantity value'); alert('Please Enter the Quantity value');
$('#Quantity').focus(); $('#Quantity').focus();
return false; return false;
} }
else if($('#Rate').val() == '') else if($('#Rate').val() == '')
{ {
swal('Please Enter the Rate of the Item'); alert('Please Enter the Rate of the Item');
$('#Rate').focus(); $('#Rate').focus();
return false; return false;
} }
else if($('#imBasicPrice').val()=='') else if($('#imBasicPrice').val()=='')
{ {
swal('Please Enter Basic Price In Us'); alert('Please Enter Basic Price In Us');
$('#imBasicPrice').focus(); $('#imBasicPrice').focus();
return false; return false;
} }
@ -4534,16 +4546,16 @@ function Budgetcheck()
var totordring=totalorderedamount*Exchange; var totordring=totalorderedamount*Exchange;
var TotalSum=avalbudAmte; var TotalSum=avalbudAmte;
if(totordring>TotalSum) // if(totordring>TotalSum)
{ // {
swal('You are Exceeding The Budget'); // alert('You are Exceeding The Budget');
return false; // return false;
} // }
else // else
{ // {
return true; return true;
} //}
} }
@ -4577,9 +4589,12 @@ if(validate()&&Budgetcheck())
if(document.getElementById('ImportTax').rows.length <= 0) if(document.getElementById('ImportTax').rows.length <= 0)
{ {
swal('Please Select Line item to Create PO'); alert('Please Select Line item to Create PO');
$('#Deliverydt').focus(); $('#Deliverydt').focus();
return false; return false;
} }
@ -4588,6 +4603,7 @@ if(validate()&&Budgetcheck())
alert('Please Select POType'); alert('Please Select POType');
$('#Importoption').focus(); $('#Importoption').focus();
return false; return false;
} }
else else
{ {
@ -4603,7 +4619,7 @@ if(validate()&&Budgetcheck())
if(data) if(data)
{ {
$('#content').loader('hide'); $('#content').loader('hide');
swal(data); alert(data);
$('#txtRowCount').val(''); $('#txtRowCount').val('');
$('#txtDeletedRow').val(''); $('#txtDeletedRow').val('');
//$('#SpcialInstruction').val(''); //$('#SpcialInstruction').val('');
@ -4613,7 +4629,7 @@ if(validate()&&Budgetcheck())
} }
else else
{ {
swal("Error"); alert("Error");
} }
} }
@ -4721,7 +4737,7 @@ if (FreightType == "PER TRIP")
} }
else else
{ {
swal('Please Select MaterialCode and Rate Field Value'); alert('Please Select MaterialCode and Rate Field Value');
$('#drpEditFreight').val("0"); $('#drpEditFreight').val("0");
$('#EditRate').focus(); $('#EditRate').focus();
} }