Back to Service

Method Details for GetExpensesRaw.

Gets a list of expenses

Definition

TimeLog.TLP.WebAppCode.Service.GetExpensesRaw(System.String,System.String,System.String,System.Int32,System.Int32,System.Int32,System.Int32,System.Int32,System.Int32,System.Int32,System.DateTime,System.DateTime)

Parameters

  • siteCode String Unique identification for your TimeLog account
  • apiID String The API ID
  • apiPassword String The API password
  • customerID Integer ID of specific customer. Set to 0 to get all expenses
  • projectID Integer ID of specific project. Set to 0 to get all expenses
  • supplierCustomerID Integer ID of specific supplier. Set to 0 to get all expenses
  • employeeID Integer ID of specific employee. Set to 0 to get all expenses
  • employeeDepartmentID Integer ID of specific employee department. Set to 0 to get all expenses
  • expenseTypeID Integer ID of specific expense type. Set to 0 to get all expenses
  • paymentMethodID Integer ID of specific payment method. Set to 0 to get all expenses
  • startDate DateTime (yyyy-MM-dd) Limits result to expenses with purchase date on or later than this date
  • endDate DateTime (yyyy-MM-dd) Limits result to expenses with purchase date on or prior to this date

Returns

A list of expense objects in XML format

Result Example

<?xml version="1.0" encoding="utf-8"?>
<tlp:Expenses 
  xmlns:tlp="http://www.timelog.com/XML/Schema/tlp/v4_4"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://www.timelog.com/XML/Schema/tlp/v4_4 http://www.timelog.com/api/xsd/EventTypesRaw.xsd">
  <tlp:Expense ID="51789">
    <tlp:CustomerName>Global People Inc</tlp:CustomerName>
    <tlp:CustomerNo>037</tlp:CustomerNo>
    <tlp:CustomerID>700</tlp:CustomerID>
    <tlp:ProjectName>Implementation 2018</tlp:ProjectName>
    <tlp:ProjectNo>2003-0002.04.0003</tlp:ProjectNo>
    <tlp:ProjectID>14</tlp:ProjectID>
    <tlp:ContractName>Time and Material</tlp:ContractName>
    <tlp:ContractID>12</tlp:ContractID>
    <tlp:ExpenseType>Hotel</tlp:ExpenseType>
    <tlp:ExpenseTypeID>234</tlp:ExpenseTypeID>
    <tlp:SupplierCustomerName>SAS</tlp:SupplierCustomerName>
    <tlp:SupplierCustomerID>815</tlp:SupplierCustomerID>
    <tlp:Date>2018-04-30T00:00:00</tlp:Date>
    <tlp:Amount>1445.0000</tlp:Amount>
    <tlp:VAT>166.2400</tlp:VAT>
    <tlp:CurrencyABB>DKK</tlp:CurrencyABB>
    <tlp:CurrencyRate>100.0000</tlp:CurrencyRate>
    <tlp:PaymentMethod>Creditcard</tlp:PaymentMethod>
    <tlp:PaymentMethodID>160</tlp:PaymentMethodID>
    <tlp:Comment>Hotel when visiting customer</tlp:Comment>
    <tlp:Billable>0</tlp:Billable>
    <tlp:EmployeeFirstName>Peter</tlp:EmployeeFirstName>
    <tlp:EmployeeLastName>Nielsen</tlp:EmployeeLastName>
    <tlp:EmployeeInitials>pni</tlp:EmployeeInitials>
    <tlp:EmployeeID>411</tlp:EmployeeID>
    <tlp:UserID>39</tlp:UserID>
    <tlp:RegAmount>1278.7600</tlp:RegAmount>
    <tlp:EstimatedAmount>1278.7600</tlp:EstimatedAmount>
    <tlp:ProfitRatio>0.0000</tlp:ProfitRatio>
    <tlp:InvAmount>1278.7600</tlp:InvAmount>
  </tlp:Expense>
</tlp:Expenses>

Result Schema

<?xml version="1.0" encoding="utf-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
            xmlns:tlp="http://www.timelog.com/XML/Schema/tlp/v4_4"
            targetNamespace="http://www.timelog.com/XML/Schema/tlp/v4_4"
            elementFormDefault="qualified"
            attributeFormDefault="unqualified">
  <xsd:element name="Expenses" >
    <xsd:complexType>
      <xsd:sequence>
        <xsd:element name="Expense" type="tlp:Expense_Type" minOccurs="0" maxOccurs="unbounded" />
      </xsd:sequence>
    </xsd:complexType>
    <xsd:key name="Expense_Key">
      <xsd:selector xpath=".//tlp:Expense" />
      <xsd:field xpath="@ID" />
    </xsd:key>
  </xsd:element>

  <xsd:complexType name="Expense_Type">
    <xsd:sequence>
      <xsd:element name="CustomerName" type="xsd:string" minOccurs="0" maxOccurs="1" />
      <xsd:element name="CustomerNumber" type="xsd:string" minOccurs="0" maxOccurs="1" />
      <xsd:element name="CustomerID" type="xsd:positiveInteger" minOccurs="0" maxOccurs="1" />
      <xsd:element name="ProjectName" type="xsd:string" minOccurs="0" maxOccurs="1" />
      <xsd:element name="ProjectNumber" type="xsd:string" minOccurs="0" maxOccurs="1" />
      <xsd:element name="ProjectID" type="xsd:positiveInteger" minOccurs="0" maxOccurs="1" />
      <xsd:element name="ContractName" type="xsd:string" minOccurs="0" maxOccurs="1" />
      <xsd:element name="ContractID" type="xsd:positiveInteger" minOccurs="0" maxOccurs="1" />
      <xsd:element name="ExpenseType" type="xsd:string" minOccurs="0" maxOccurs="1" />
      <xsd:element name="ExpenseTypeID" type="xsd:positiveInteger" minOccurs="0" maxOccurs="1" />
      <xsd:element name="SupplierCustomerName" type="xsd:string" minOccurs="0" maxOccurs="1" />
      <xsd:element name="SupplierCustomerID" type="xsd:positiveInteger" minOccurs="0" maxOccurs="1" />
      <xsd:element name="Date" type="xsd:dateTime" minOccurs="0" maxOccurs="1" />
      <xsd:element name="Amount" type="xsd:decimal" minOccurs="0" maxOccurs="1" />
      <xsd:element name="VAT" type="xsd:decimal" minOccurs="0" maxOccurs="1" />
      <xsd:element name="CurrencyABB" type="xsd:string" minOccurs="0" maxOccurs="1" />
      <xsd:element name="CurrencyRate" type="xsd:decimal" minOccurs="0" maxOccurs="1" />
      <xsd:element name="PaymentMethod" type="xsd:string" minOccurs="0" maxOccurs="1" />
      <xsd:element name="PaymentMethodID" type="xsd:positiveInteger" minOccurs="0" maxOccurs="1" />
      <xsd:element name="Comment" type="xsd:string" minOccurs="0" maxOccurs="1" />
      <xsd:element name="Billable" type="xsd:unsignedInt" minOccurs="0" maxOccurs="1" />
      <xsd:element name="EmployeeFirstName" type="xsd:string" minOccurs="0" maxOccurs="1" />
      <xsd:element name="EmployeeLastName" type="xsd:string" minOccurs="0" maxOccurs="1" />
      <xsd:element name="EmployeeInitials" type="xsd:string" minOccurs="0" maxOccurs="1" />
      <xsd:element name="EmployeeID" type="xsd:positiveInteger" minOccurs="0" maxOccurs="1" />
      <xsd:element name="UserID" type="xsd:positiveInteger" minOccurs="0" maxOccurs="1" />
      <xsd:element name="RegAmount" type="xsd:decimal" minOccurs="0" maxOccurs="1" />
      <xsd:element name="EstimatedAmount" type="xsd:decimal" minOccurs="0" maxOccurs="1" />
      <xsd:element name="InvAmount" type="xsd:decimal" minOccurs="0" maxOccurs="1" />
      <xsd:element name="ProfitRatio" type="xsd:decimal" minOccurs="0" maxOccurs="1" />
    </xsd:sequence>

  </xsd:complexType>

</xsd:schema>

Download the XSD