This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'test_helper' | |
require 'capybara/rails' | |
class AgentRequestsUpdateToFidelityBondTest < ActionDispatch::IntegrationTest | |
fixtures :all | |
include Capybara | |
self.use_transactional_fixtures = false | |
#Scenario: agent requests a change in principal address |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void update(RequestUtility inRU) { | |
FieldChange fc = null; | |
TypeConversion tc = new TypeConversion(); | |
String t1 = "", t2 = ""; | |
int i1 = 0, i2 = 0; | |
java.text.DecimalFormat dc = new java.text.DecimalFormat("00000"); | |
if ("M".equals(getTransactionType())) { //effectiveDate - major | |
if (getEffectiveDate() != null) | |
t1 = getEffectiveDate().getDateAsString(); | |
else |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Feature: Update coverage for a fidelity bond | |
Background: | |
And the fidelity bond templates | |
Scenario: Increase the penal sum and verify premium changed | |
Given an approved fidelity bond covering 5 individuals for 5000 dollars | |
Then the fidelity bond's premium should be 100 dollars | |
When the fidelity bond's penal sum is updated to 20000 half way through the bond's term | |
Then the fidelity bond's premium should be 126 dollars | |
And the fidelity bond's commission should be 31.5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private double calculate2011NHAdjustment() { | |
EasyDate abeyanceDate = aPrincipal.getAbeyanceDate(); | |
EasyDate giaDate = aPrincipal.getGiaDate(); | |
String abeyanceYear = abeyanceDate == null ? "" : abeyanceDate.getDateAsString("YYYY"); | |
String giaYear = giaDate == null ? "" : giaDate.getDateAsString("YYYY"); | |
if (abeyanceYear.equals("2011") && giaYear.equals("2011")) { | |
System.out.println("Account activaton dates are eligible"); | |
EasyDate endDate = new EasyDate(giaDate.getDateAsString("MM") + "/" + | |
giaDate.getDateAsString("DD") + "/" + | |
"2012"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class FidelityBondPrincipalAddressUpdatesController < CommandsController | |
filter_resource_access :additional_member => [ :execute ] | |
before_filter :set_updated_by | |
def after_execute_path | |
command.receiver | |
end | |
def after_execute_flash_message |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require 'state_machine' | |
class StringStateMachine | |
state_machine :state, :initial => :s do | |
event :a do | |
transition :s => :q | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
scope :unread_for_user, lambda { |user| | |
if user | |
{ | |
:joins => "left outer join read_receipts rr on messages.id = rr.readable_id and rr.readable_type = 'message' and rr.user_id = #{user.id}", | |
:conditions => "rr.id is NULL" | |
} | |
end | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
searchKey = state + " " + bondDescription + " " + getAgency().getPaddedAgentCode(); | |
pd = GlobalConstants.aDC.getDocumentByViewKeyExactMatch(GlobalConstants.GBONDFORMDB, GlobalConstants.GSTATELU, searchKey); | |
if (pd == null) { | |
searchKey = state + " " + bondDescription + " " + term + " " + new Long(inBondAmount).toString() + " " + getAgency().getPaddedAgentCode(); | |
pd = GlobalConstants.aDC.getDocumentByViewKeyExactMatch(GlobalConstants.GBONDFORMDB, GlobalConstants.GSTATELU, searchKey); | |
if (pd == null) { | |
searchKey = state + " " + bondDescription + " " + term + " " + getAgency().getPaddedAgentCode(); | |
pd = GlobalConstants.aDC.getDocumentByViewKeyExactMatch(GlobalConstants.GBONDFORMDB, GlobalConstants.GSTATELU, searchKey); | |
if (pd == null) { | |
searchKey = state + " " + bondDescription + " " + term + " " + new Long(inBondAmount).toString() + " " + getAgency().getPaddedAgentCode(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Function strreplace(Byval src As String, Byval dest As String, Byval arg As String) As String | |
Dim pos As Integer | |
pos = Instr(arg, src) | |
While (pos > 0) | |
arg = Left(arg, pos - 1)+ dest + Mid(arg, pos + Len(src)) | |
pos = Instr(pos + Len(dest), arg, src) | |
Wend | |
strreplace = arg | |
End Function |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import lotus.domino.*; | |
import javax.swing.*; | |
public class JavaAgent extends AgentBase { | |
public void NotesMain() { | |
try { | |
Session session = getSession(); | |
AgentContext agentContext = session.getAgentContext(); |
OlderNewer