import { SpeakeasyBase } from "../../../internal/utils"; import { DataType } from "./datatype"; import { DirectCostLineItem } from "./directcostlineitem"; import { Metadata } from "./metadata"; import { PaymentAllocationPayment } from "./paymentallocationpayment"; import { SupplementalData } from "./supplementaldata"; /** * A customer or supplier associated with the direct cost. */ export declare class DirectCostContactRef extends SpeakeasyBase { /** * Available Data types */ dataType?: DataType; /** * Unique identifier for a customer or supplier. */ id: string; } export declare class DirectCostAllocation extends SpeakeasyBase { /** * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: * * @remarks * * ``` * 2020-10-08T22:40:50Z * 2021-01-01T00:00:00 * ``` * * * * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: * * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` * - Unqualified local time: `2021-11-15T01:00:00` * - UTC time offsets: `2021-11-15T01:00:00-05:00` * * > Time zones * > * > Not all dates from Codat will contain information about time zones. * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. */ allocatedOnDate?: string; /** * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. * * @remarks * * ## Unknown currencies * * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. * * There are only a very small number of edge cases where this currency code is returned by the Codat system. */ currency?: string; /** * Rate to convert the total amount of the payment into the base currency for the company at the time of the payment. * * @remarks * * Currency rates in Codat are implemented as the multiple of foreign currency units to each base currency unit. * * It is not possible to perform the currency conversion with two or more non-base currencies participating in the transaction. For example, if a company's base currency is USD, and it has a bill issued in EUR, then the bill payment must happen in USD or EUR. * * Where the currency rate is provided by the underlying accounting platform, it will be available from Codat with the same precision (up to a maximum of 9 decimal places). * * For accounting platforms which do not provide an explicit currency rate, it is calculated as `baseCurrency / foreignCurrency` and will be returned to 9 decimal places. * * ## Examples with base currency of GBP * * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (GBP) | * | :--------------- | :------------- | :------------ | :------------------------- | * | **USD** | $20 | 0.781 | £15.62 | * | **EUR** | €20 | 0.885 | £17.70 | * | **RUB** | ₽20 | 0.011 | £0.22 | * * ## Examples with base currency of USD * * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (USD) | * | :--------------- | :------------- | :------------ | :------------------------- | * | **GBP** | £20 | 1.277 | $25.54 | * | **EUR** | €20 | 1.134 | $22.68 | * | **RUB** | ₽20 | 0.015 | $0.30 | * * * ### Integration-specific details * * | Integration | Scenario | System behavior | * |-------------------|-------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------| * | QuickBooks Online | Transaction currency differs from base currency | If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, include the required currency rate in the expense transaction. | */ currencyRate?: number; /** * The total amount that has been allocated. */ totalAmount?: number; } export declare class DirectCostAccountingPaymentAllocation extends SpeakeasyBase { allocation: DirectCostAllocation; payment: PaymentAllocationPayment; } /** * > **Language tip:** Direct costs may also be referred to as **Spend transactions**, **Spend money transactions**, or **Payments** in various accounting platforms. * * @remarks * * > View the coverage for direct costs in the Data coverage explorer. * * ## Overview * * Direct costs are the expenses associated with a business' operations. For example, purchases of raw materials and service fees are considered direct costs. * * Direct costs include: * * Purchasing an item and paying it off at the point of the purchase * * Receiving cash from a refunded item if the refund is made by the supplier * * Withdrawing money from a bank account * * Writing a cheque * * Direct costs is a child data type of [account transactions](https://docs.codat.io/accounting-api#/schemas/AccountTransaction). */ export declare class DirectCost extends SpeakeasyBase { /** * A customer or supplier associated with the direct cost. */ contactRef?: DirectCostContactRef; /** * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. * * @remarks * * ## Unknown currencies * * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. * * There are only a very small number of edge cases where this currency code is returned by the Codat system. */ currency: string; /** * Rate to convert the total amount of the payment into the base currency for the company at the time of the payment. * * @remarks * * Currency rates in Codat are implemented as the multiple of foreign currency units to each base currency unit. * * It is not possible to perform the currency conversion with two or more non-base currencies participating in the transaction. For example, if a company's base currency is USD, and it has a bill issued in EUR, then the bill payment must happen in USD or EUR. * * Where the currency rate is provided by the underlying accounting platform, it will be available from Codat with the same precision (up to a maximum of 9 decimal places). * * For accounting platforms which do not provide an explicit currency rate, it is calculated as `baseCurrency / foreignCurrency` and will be returned to 9 decimal places. * * ## Examples with base currency of GBP * * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (GBP) | * | :--------------- | :------------- | :------------ | :------------------------- | * | **USD** | $20 | 0.781 | £15.62 | * | **EUR** | €20 | 0.885 | £17.70 | * | **RUB** | ₽20 | 0.011 | £0.22 | * * ## Examples with base currency of USD * * | Foreign Currency | Foreign Amount | Currency Rate | Base Currency Amount (USD) | * | :--------------- | :------------- | :------------ | :------------------------- | * | **GBP** | £20 | 1.277 | $25.54 | * | **EUR** | €20 | 1.134 | $22.68 | * | **RUB** | ₽20 | 0.015 | $0.30 | * * * ### Integration-specific details * * | Integration | Scenario | System behavior | * |-------------------|-------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------| * | QuickBooks Online | Transaction currency differs from base currency | If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, include the required currency rate in the expense transaction. | */ currencyRate?: number; /** * Identifier of the direct cost, unique for the company. */ id?: string; /** * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: * * @remarks * * ``` * 2020-10-08T22:40:50Z * 2021-01-01T00:00:00 * ``` * * * * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: * * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` * - Unqualified local time: `2021-11-15T01:00:00` * - UTC time offsets: `2021-11-15T01:00:00-05:00` * * > Time zones * > * > Not all dates from Codat will contain information about time zones. * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. */ issueDate: string; /** * An array of line items. */ lineItems: DirectCostLineItem[]; metadata?: Metadata; modifiedDate?: string; /** * A note attached to the direct cost. */ note?: string; /** * An array of payment allocations. */ paymentAllocations: DirectCostAccountingPaymentAllocation[]; /** * User-friendly reference for the direct cost. */ reference?: string; sourceModifiedDate?: string; /** * The total amount of the direct costs, excluding any taxes. */ subTotal: number; /** * Supplemental data is additional data you can include in our standard data types. * * @remarks * * It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. */ supplementalData?: SupplementalData; /** * The total amount of tax on the direct costs. */ taxAmount: number; /** * The amount of the direct costs, inclusive of tax. */ totalAmount: number; }