Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 4 Next »

With Codyt projects, cost details are saved with documents (for client costing) and jobs (for supplier costing). These details are then pulled when creating invoices. The following APIs return cost details:

PROPERTIES

A cost object has these properties:

total

Total amount, excluding VAT.

If null, then the cost has not been assigned or calculated. Note, that most (but not all) other properties below will also be null when no cost was assigned.

decimal?

totalBase

Total cost prior to applying reductions, fees/discounts and percentage of total content costed. The details of these are described in the next lines.

decimal?

details

The individual contributions to the cost (similar to invoice lines). The array is empty if there are no details available.

See chapter below for the documentation.

object[]

reduction

Information on applicable reductions

object

reduction.amount

Total reduction

decimal

reduction.percent

Total reduction in percent relative to totalBase.

decimal?

reduction.subTotal

Total after applying reduction (totalBase - reduction.amount)

decimal?

fee

Information on fee (positive) or discounts (negative)

object

fee.amount

Total amount added. If the amount is positive then it is a fee, otherwise it is a discount.

decimal

fee.percent

Total reduction in percent

decimal?

fee.subTotal

Total after applying reduction (reduction.subTotal + fee.amount).

decimal?

covered.percent

100% means that the cost is applied (and will be invoiced). 50% means that only half of the cost will be applied. By default the value is 100.

decimal

covered.subTotal

This is the same as total.

decimal?

currency

The currency code, see settings/currencies/codes

Null if cost is not calculated.

string

decimals

Decimal places used when rounding amounts.

int

COST DETAILS LINES

The details node contains an array with cost lines (when no details available then the array is empty). The properties are:

total

Total amount, excluding VAT.

If null, then the cost has not been assigned or calculated. Note, that most (but not all) other properties below will also be null when no cost was assigned.

decimal?

EXAMPLES

To clarify how reductions, fees and coverage are applied on the base cost, see this screenshot and the corresponding payload below:

"cost": {
    "total": 495.00,
    "totalBase": 1000.00,
    "details": [],
    "reduction": {
        "amount": 100.00,
        "percent": 10.0,
        "subTotal": 900.00
    },
    "fee": {
        "amount": 90.00,
        "percent": 10.0,
        "subTotal": 990.00
    },
    "covered": {
        "percent": 50.0,
        "subTotal": 495.00
    },
    "currency": "USD",
    "decimals": 2
}

An example for a details array:

[
    {
        "task": "TR",
        "count": 0.0,
        "priceUnitCode": "WD",
        "priceAmount": 2.0000,
        "priceCurrency": "EUR",
        "priceUnits": 1,
        "productCode": "",
        "reduction": 40.0,
        "amount": 0.00,
        "amountBase": 0.00,
        "fuzzyInterval": 100,
        "fuzzyCategory": 0,
        "summary": "Translation 0 Words 100% match, EUR 2.00 per Word - 40% reduction",
        "isMinCharge": false
    },
    {
        "task": "TR",
        "count": 2.0,
        "priceUnitCode": "WD",
        "priceAmount": 2.0000,
        "priceCurrency": "EUR",
        "priceUnits": 1,
        "productCode": "",
        "reduction": 0.0,
        "amount": 4.00,
        "amountBase": 4.00,
        "fuzzyInterval": null,
        "fuzzyCategory": 0,
        "summary": "Translation 2 Words, EUR 2.00 per Word",
        "isMinCharge": false
    }
]

  • No labels