public with sharing class CashVeriController
{
public String barcodeKey {get;set;}
public Boolean saveCashRecFlag {get;set;}
public integer VFPAmount {get;set;}
public string VFPAmount1 {get;set;}
Envelope__c envelopeRec;
public CashVeriController()
{
saveCashRecFlag = false;
}
public void tempshow()
{
saveCashRecFlag = true;
}
public PageReference findEnvelope()
{
system.debug('code runs atleast');
if(barcodeKey != null && barcodeKey.trim().length()>0)
{
envelopeRec = [SELECT Id,Barcode_ID__c,Barcode__c,Envelope_Number__c,Name,Security_Tag__c FROM Envelope__c where Name =: barcodeKey];
if(envelopeRec != null)
{
saveCashRecFlag = true;
}
else
{
ApexPages.addMessage(new ApexPages.Message(ApexPages.Severity.ERROR,'No Envelope record found, Please enter correct Barcode ID.'));
}
}
else
{
ApexPages.addMessage(new ApexPages.Message(ApexPages.Severity.ERROR,'Please enter Barcode ID of Envelope.'));
}
return null;
}
//system.debug('1 amount is : '+VFPAmount);
//this is for number converted via JS
public PageReference MakeTransaction()
{
system.debug('2 amount is : '+VFPAmount);
Transaction__c newTransaction = new Transaction__c (Verifier_1__c=UserInfo.getUserId(), Envelope__c=envelopeRec.Id, Verifier_1_Amount__c = VFPAmount);
//integer.valueOf(VFPAmount));
//newTransaction.Verifier_1_Amount__c = Double.valueOf(VFPAmount);
system.debug('3 amount is : '+VFPAmount);
system.debug('4 amount is : '+integer.valueOf(VFPAmount));
insert newTransaction;
return null;
}
//this is for string
public PageReference MakeTransaction1()
{
system.debug('2 amount is : '+VFPAmount1);
Transaction__c newTransaction = new Transaction__c (Verifier_1__c=UserInfo.getUserId(), Envelope__c=envelopeRec.Id, Verifier_1_Amount__c = integer.valueOf(VFPAmount1));
system.debug('3 amount is : '+VFPAmount1);
system.debug('4 amount is : '+integer.valueOf(VFPAmount1));
insert newTransaction;
return null;
}
//this is for passing value directly without actionfunction
public PageReference MakeTransaction2(string aaaa)
{
system.debug('2 amount is : '+aaaa);
Transaction__c newTransaction = new Transaction__c (Verifier_1__c=UserInfo.getUserId(), Envelope__c=envelopeRec.Id, Verifier_1_Amount__c = integer.valueOf(aaaa));
//newTransaction.Verifier_1_Amount__c = Double.valueOf(aaaa);
system.debug('3 amount is : '+aaaa);
system.debug('4 amount is : '+integer.valueOf(aaaa));
insert newTransaction;
return null;
}
//someone suggested this.
public void setVFPAmount1(String n)
{
VFPAmount1= n;
}
public String getsetVFPAmount1()
{
return setVFPAmount1;
}
private String setVFPAmount1 = '0';
public void setVFPAmount(String n)
{
setVFPAmount = n;
}
public String getsetVFPAmount()
{
return setVFPAmount;
}
private String setVFPAmount = '0';
}