import { SpeakeasyBase } from "../../../internal/utils"; import { BillLineItem } from "./billlineitem"; import { BillStatus } from "./billstatus"; import { Metadata } from "./metadata"; import { PaymentAllocationItems } from "./paymentallocationitems"; import { PurchaseOrderRef } from "./purchaseorderref"; import { SupplementalData } from "./supplementaldata"; import { SupplierRef } from "./supplierref"; export declare class WithholdingTax extends SpeakeasyBase { /** * Amount of tax withheld. */ amount: number; /** * Name assigned to withheld tax. */ name: string; } /** * > **Invoices or bills?** * * @remarks * > * > We distinguish between invoices where the company *owes money* vs. *is owed money*. If the company has received an invoice, and owes money to someone else (accounts payable) we call this a Bill. * > * > See [Invoices](https://docs.codat.io/accounting-api#/schemas/Invoice) for the accounts receivable equivalent of bills. * * View the coverage for bills in the Data coverage explorer. * * ## Overview * * In Codat, a bill contains details of: * * When the bill was recorded in the accounting system. * * How much the bill is for and the currency of the amount. * * Who the bill was received from — the *supplier*. * * What the bill is for — the *line items*. * * Some accounting platforms give a separate name to purchases where the payment is made immediately, such as something bought with a credit card or online payment. One example of this would be QuickBooks Online's *expenses*. * * You can find these types of transactions in our [Direct costs](https://docs.codat.io/accounting-api#/schemas/DirectCost) data model. */ export declare class Bill extends SpeakeasyBase { /** * Amount outstanding on the bill. */ amountDue?: number; /** * 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; dueDate?: string; /** * Identifier for the bill, unique for the company in the accounting platform. */ id?: string; issueDate: string; /** * Array of Bill line items. */ lineItems?: BillLineItem[]; metadata?: Metadata; modifiedDate?: string; /** * Any private, company notes about the bill, such as payment information. */ note?: string; /** * An array of payment allocations. */ paymentAllocations?: PaymentAllocationItems[]; purchaseOrderRefs?: PurchaseOrderRef[]; /** * User-friendly reference for the bill. */ reference?: string; sourceModifiedDate?: string; /** * Current state of the bill. */ status: BillStatus; /** * Total amount of the bill, 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; /** * Reference to the supplier the record relates to. */ supplierRef?: SupplierRef; /** * Amount of tax on the bill. */ taxAmount: number; /** * Amount of the bill, including tax. */ totalAmount: number; withholdingTax?: WithholdingTax[]; }