...
Page Properties | ||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
URL
Sample Request URL |
---|
https://dev.api.finance.uconn.edu/webapi/accounts/balance?accountNumber=3122250&chart=UC |
Sample Response
<accountBalance> <accountBalance>-80.85</accountBalance> </accountBalance> | |
Criteria Used for Balance Checking:
- University Fiscal Year defaults to the current fiscal year.
- Chart of Accounts defaults to "UC", if not entered.
- Use the Available Balances Lookup logic in KFS, using the following selection criteria.
- Consolidation Option = Consolidation
- Include Pending Ledger Entry = All
- Transfers = Include
- Balance Sheet = Include
- Indirect Cost = Exclude
- Object Code Grouping = Exclude
- For Agency Accounts, no matter what fundsid, we will use the cash balance:
- Subfund group EQUALS "AGEN",
- Only include the balance of Object Code = 1100Lori – is this correct or is it the balance of the beginning balance and fiscal YTD balance? This is what I would define as the "available cash balance".If we are looking at it from the Available Balance screen, the available cash is simply the Actual Amount. If we are looking at it from the General Ledger Balance screen it would be the Beginning Balance plus the Annual Balance (current FY activity). I assume we are pulling from Available Balance. Is this correct, Bruce?
.
- For non-sponsored fiscal accounts in the 1171 fundsid (which are not specifically budgeted during the annual budget process), we will use the available cash balance:
- Subfund group NOT EQUAL to "RSTSP",
- Fund Sid EQUALS 1171
- Only include the balance of Object Code = 1100See comment above regarding definition of "available cash balance.".
- For project accounts (as defined by subfund group code RSTSP), across all fundsids, we will include available budget balances from object codes 6000 – 6999. For these, the budget available is based on project-to-date and not fiscal-year-to-date $$.
- Subfund group EQUALS "RSTSP",
- All fundsids,
- Include (sum) the balances of Object Codes 6000 – 6999"Budget available" defined as budget amount less project-to-date actual expenses.
If we are looking at the Available Balance screen, both Budget and Actuals are cumulative project to date. We should also decut the Encumbrances. So, in my opinion, it is really the sum of the Variance column for object codes 6000-6999..
- For all other non-sponsored accounts (subfund NOT RSTSP), across all other fundsids (NOT 1171), we will use the sum of all BUDGET AVAILABLE BALANCES IN(as defined in 3 above) object code in the 6000 – 6999 range:
- All other Subfund groups NOT EQUAL to "AGEN" and "RSTSP",
- Fund sid NOT EQUAL to 1171,
- Include (sum) the balances of Object Codes 6000 – 6999.
Calculation:
Available Balance = (BudgetAmount – ActualsAmount – EncumbranceAmount)
WSDL Definition
Definition URLs | UAT - https://kualinp.uconn.edu/kfs-uat/remoting/accountBalanceInquiry?wsdl |
---|---|
Binding | {http://kfs.kuali.org/kfs/v5_0}accountBalanceInquirySoapBinding |
SOAP Version | SOAP 1.1 |
Operations
Name | Description | Input |
---|---|---|
getAccountBalance | Will retrieve the available account balance for one account. | chartOfAccountsCode [Default 'UC'] (Optional) account number (Required) |
Response
Attribute | Description | Values |
---|---|---|
accountBalance | The Account Balance | 999999.99 |
Sample Request XML (SOAP)
Code Block | ||||
---|---|---|---|---|
| ||||
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:v5="http://kfs.kuali.org/core/v5_0"> <soapenv:Header/> <soapenv:Body> <v5:getAccountBalance> <!-Optional:-> <arg0> <chartOfAccountsCode></chartOfAccountsCode> <accountNumber>5612710</accountNumber> </arg0> </v5:getAccountBalance> </soapenv:Body> </soapenv:Envelope> |
Sample Response XML - SOAP (Good)
Code Block | ||||
---|---|---|---|---|
| ||||
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Body> <ns2:getAccountBalanceResponse xmlns:ns2="http://kfs.kuali.org/core/v5_0"> <return> <accountBalance>10955.85</accountBalance> </return> </ns2:getAccountBalanceResponse> </soap:Body> </soap:Envelope> |
Sample Response XML - SOAP (Bad)
Code Block | ||||
---|---|---|---|---|
| ||||
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Body> <soap:Fault> <faultcode>soap:Server</faultcode> <faultstring>Invalid/empty Account Parameter.</faultstring> <detail> <ns2:AccountInquiryFault xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns2="http://kfs.kuali.org/core/v5_0"/> </detail> </soap:Fault> </soap:Body> </soap:Envelope> |
...
Java
Code Block language java title JUnit package com.example.coa.service; import java.time.LocalDate; import java.util.ArrayList; import java.util.List; import javax.xml.bind.JAXBElement; import org.junit.Test; import org.kuali.kfs.core.v5_0.GetAccountsResponseGetAccountBalanceResponse; import org.springframework.oxm.jaxb.Jaxb2Marshaller; import junit.framework.TestCase; public class AccountInquiryServiceTestAccountBalanceInquiryServiceTest extends TestCase { @Test public void testGetAccounts() throws Exception { String chartOfAccountsCode List<String> subFunds = new ArrayList<String>(); subFunds.add("PLEQPUC"); subFunds.add("PLRES"); subFunds.add("PLBHC"); subFunds.add("PLRHC"); subFunds.add("OPOTF"); subFunds.add("PLBND"); subFunds.add("PLREV"); subFunds.add("PLUNR"); List<String> organizationcodes = new ArrayList<String>(); organizationcodes.add("1832"); organizationcodes.add("1731")String accountNumber = "5612710"; organizationcodes.add("1863"); LocalDate fromDate = LocalDate.parse("2016-08-26"); LocalDate toDate = LocalDate.parse("2016-09-15"); ChartOfAccountsInquiryServiceClient AccountBalanceInquiryServiceClient client = new ChartOfAccountsInquiryServiceClientAccountBalanceInquiryServiceClient(); Jaxb2Marshaller marshaller = new Jaxb2Marshaller(); marshaller.setContextPath("org.kuali.kfs.core.v5_0"); client.setMarshaller(marshaller); client.setUnmarshaller(marshaller); JAXBElement<GetAccountsResponse>JAXBElement<GetAccountBalanceResponse> response = client.getAccountsgetAccountBalance(subFundschartOfAccountsCode, organizationcodes, fromDate, toDateaccountNumber); assertNotNull(response); } }
Code Block language java title Client package com.example.coa.service; import java.timeio.LocalDateStringWriter; import javajavax.xml.utilbind.ListJAXBContext; import javax.xml.bind.JAXBElement; import javax.xml.transform.Result; import javax.xml.transform.datatypestream.DatatypeFactoryStreamResult; import org.kuali.kfs.core.v5_0.AllAccountRequestAccountBalanceInquiryRequest; import org.kuali.kfs.core.v5_0.GetAccountsGetAccountBalance; import org.kuali.kfs.core.v5_0.GetAccountsResponseGetAccountBalanceResponse; import org.kualispringframework.kfs.core.v5_0.ObjectFactoryoxm.Marshaller; import org.springframework.ws.client.core.support.WebServiceGatewaySupport; public class ChartOfAccountsInquiryServiceClientAccountBalanceInquiryServiceClient extends WebServiceGatewaySupport { public JAXBElement<GetAccountsResponse>JAXBElement<GetAccountBalanceResponse> getAccountsgetAccountBalance(List<String>String subFundschartOfAccountsCode, List<String> organizationcodes, LocalDate fromDate, LocalDate toDateString accountNumber) throws Exception { ObjectFactory factory = new ObjectFactory(); DatatypeFactory datatypeFactory = DatatypeFactory.newInstance(); String uri = "https://kualinp.uconn.edu/kfs-dev/remoting/chartOfAccountsInquiryaccountBalanceInquiry"; GetAccountsGetAccountBalance request = new GetAccountsGetAccountBalance(); AllAccountRequestAccountBalanceInquiryRequest allAccountRequestaccountBalanceInquiryRequest = new AllAccountRequestAccountBalanceInquiryRequest(); allAccountRequestaccountBalanceInquiryRequest.getSubFundsetChartOfAccountsCode(chartOfAccountsCode).addAll(subFunds); allAccountRequestaccountBalanceInquiryRequest.getOrganizationCodesetAccountNumber(accountNumber).addAll(organizationcodes); allAccountRequestrequest.setFromDate(factory.createAllAccountRequestFromDate(datatypeFactory.newXMLGregorianCalendar(fromDate.toString()))setArg0(accountBalanceInquiryRequest); allAccountRequest.setToDate(factory.createAllAccountRequestToDate(datatypeFactory.newXMLGregorianCalendar(toDate.toString()))); logXml(request.setArg0(allAccountRequest); Object object return= (JAXBElement<GetAccountsResponse>) getWebServiceTemplate().marshalSendAndReceive(uri, request); logXml(object); return (JAXBElement<GetAccountBalanceResponse>) object; } }
Criteria Used for Balance Checking:
- University Fiscal Year defaults to the current fiscal year.
- Chart of Accounts defaults to "UC", if not entered.
- Use the Available Balances Lookup logic in KFS, using the following selection criteria.
- Consolidation Option = Consolidation
- Include Pending Ledger Entry = All
- Transfers = Include
- Balance Sheet = Include
- Indirect Cost = Exclude
- Object Code Grouping = Exclude
- For Agency Accounts, no matter what fundsid, we will use the cash balance:
- Subfund group EQUALS "AGEN",
- Only include the balance of Object Code = 1100Lori – is this correct or is it the balance of the beginning balance and fiscal YTD balance? This is what I would define as the "available cash balance".If we are looking at it from the Available Balance screen, the available cash is simply the Actual Amount. If we are looking at it from the General Ledger Balance screen it would be the Beginning Balance plus the Annual Balance (current FY activity). I assume we are pulling from Available Balance. Is this correct, Bruce?
.
- For non-sponsored fiscal accounts in the 1171 fundsid (which are not specifically budgeted during the annual budget process), we will use the available cash balance:
- Subfund group NOT EQUAL to "RSTSP",
- Fund Sid EQUALS 1171
- Only include the balance of Object Code = 1100See comment above regarding definition of "available cash balance.".
- For project accounts (as defined by subfund group code RSTSP), across all fundsids, we will include available budget balances from object codes 6000 – 6999. For these, the budget available is based on project-to-date and not fiscal-year-to-date $$.
- Subfund group EQUALS "RSTSP",
- All fundsids,
- Include (sum) the balances of Object Codes 6000 – 6999"Budget available" defined as budget amount less project-to-date actual expenses.
If we are looking at the Available Balance screen, both Budget and Actuals are cumulative project to date. We should also decut the Encumbrances. So, in my opinion, it is really the sum of the Variance column for object codes 6000-6999..
- For all other non-sponsored accounts (subfund NOT RSTSP), across all other fundsids (NOT 1171), we will use the sum of all BUDGET AVAILABLE BALANCES IN(as defined in 3 above) object code in the 6000 – 6999 range:
- All other Subfund groups NOT EQUAL to "AGEN" and "RSTSP",
- Fund sid NOT EQUAL to 1171,
- Include (sum) the balances of Object Codes 6000 – 6999.
...
public void logXml(Object element) { try { JAXBContext jc = JAXBContext.newInstance(element.getClass()); Marshaller marshaller = getMarshaller(); StreamResult result = new StreamResult(new StringWriter()); marshaller.marshal(element, result); System.out.println("XML : " + result.getWriter().toString()); } catch (Exception e) { e.printStackTrace(); } } }