SWS GetRentalLedger Method
Retrieves a collection of transaction history for a specified account, rental or transaction, for a given time-frame.
Parameters
Name | DataType | Is Required |
---|---|---|
AccountID | Long | Required |
Description | The account’s ID for which you wish to retrieve the data. This is returned when you use the CreateNewAccount method or can be retrieved with the SearchBy method. | |
EndDate | DateTime | Optional |
Description | The end date of the date range for which you wish to retrieve the data. This will default to today if left undefined. | |
RentalID | Long | Optional |
Description | The rental item’s ID number. This will allow you to specify which rental if the account has more than one rental. This is returned when using the MakeReservation method or can be searched for using the SearchBy method. | |
StartDate | DateTime | Optional |
Description | The start date of the date range for which you wish to retrieve the data. This will default to today if left undefined. | |
TransactionID | Long | Optional |
Description | The transaction’s ID number. Transaction IDs are system generated for each payment transaction that occurs in the system. If there is no transaction ID the transaction failed. The transaction ID is returned when any MakePayment method is used. |
Returned Parameters
Name | DataType |
---|---|
ACCT_ID | Long |
Description | The account’s ID number. |
ADDR_ID | String |
Description | The rental contact’s address ID number. |
ASS_DATE | DateTime |
Description | The date and time the assessment was applied to the account. |
ASS_ID | Decimal |
Description | The assessment’s ID number. |
CHILD_RENTAL_ID | String |
Description | The rental ID for the service or insurance assessment that belongs to this rental. |
CLASS_REF | Decimal |
Description | The GL account’s class reference number. |
CONTACT_ID | String |
Description | The rental contact’s ID number. |
CREATED | DateTime |
Description | The date the ledger item was created. |
CREATED_BY | Long |
Description | The user’s ID number that created the ledger item. |
CREATED_NAME | String |
Description | The name of the person who created the ledger item. This is the textual value of the CREATED_BY data. |
DESCRIP | String |
Description | A description of the ledger item. |
EXTENDED | Decimal |
Description | The total amount of the assessment after quantities have been applied. |
GL | Decimal |
Description | The GL account’s reference number. |
GL_DESC | String |
Description | The GL account’s name. |
GL_MAP | String |
Description | The GL account’s reference number. |
ITEM_PRICE | Decimal |
Description | The amount to be charged for the assessment. |
LASTFOUR | String |
Description | The last four digits of the credit card number if the transaction was a credit card payment. |
OBJ_NAME | String |
Description | The name of the item assessed to the account. |
PARENT_ASS_ID | Decimal |
Description | The rental ID for the rental that owns this assessment. |
PAY_AMT | Decimal |
Description | The portion of the payment that was applied to the specific rental’s ledger. |
PAY_REF | String |
Description | The payment type payment type, if transaction is a payment. |
QTY | Decimal |
Description | The total number of items that were assessed. |
REF_TYPE | Integer |
Description | The numeric value for the assessment type. |
RENTAL_ID | Decimal |
Description | The rental item’s ID number. |
SITE_ID | Long |
Description | The site’s ID number. |
STATUS | Integer |
Description | The numeric value of the transaction’s status. |
STATUS_VAL | String |
Description | The alpha-numeric description of the transaction’s status. |
TAX | Decimal |
Description | The required tax amount, if the ledger item is not tax exempt. |
TNX_DATE | DateTime |
Description | The date the transaction occurred. |
TNX_DETAIL_ID | Decimal |
Description | The ID number for the transaction’s detail row. |
TNX_ID | Decimal |
Description | The transaction’s ID number. Transaction IDs are system generated for each payment transaction that occurs in the system. A null or “0” response indicates the transaction failed. |
TRAN_TYPE_VALUE | Decimal |
Description | The numeric value of the transaction type. |
TRANSACTION_TYPE | String |
Description | The textual value of the transaction type. |
VOIDSTAT | String |
Description | Indicates if the assessment can still be voided. This is only applicable to fees, insurance and services. Taxes will show as “Pending” (eligible for voiding) but are not voidable. A tax exempt number must be applied to the rental. |
Example
As with every method we need to pass in credentials. We do this with the LookupUser request object.
We’ll assume you’ve got a web reference, let’s name it SWS, in your Visual Studio project. At this point we need to our objects. We’ll need the standard service object, a GetRentalLedger request object and a GetRentalLedger response object. We can define and create those like this:
// Create a request and response objects
SWS.WSSoapClient service = new SWS.WSSoapClient();
SWS.GetRentalLedger_Request request = new SWS.GetRentalLedger_Request();
SWS.GetRentalLedger_Response response;
Here’s my sample code of the Request object.
// GetRentalLedger Request
request.AccountID = 123546;
request.RentalID = 123456;
request.StartDate = DateTime.Today.AddDays(-30);
request.EndDate = DateTime.Now;
Finally we can call the method and pass across the login object and the request object to get our rental ledger information. It’s a good idea to do this in a Try Catch block.
// Call the method that will load the response object
try
{
response = service.GetRentalLedger(user_request, ref request);
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
Note that if something goes wrong the service will respond with an exception. You’ll want to take a look at that message returned in that exception so it can be debugged.
For a full list of methods see SWS Methods.
Currently some items are not being returned. No ETA on a fix, but the method does have the most important information returned.