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 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? |
| 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? |
| 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[] |
| Information on applicable reductions | object |
| Total reduction | decimal |
| Total reduction in percent relative to totalBase. | decimal? |
| Total after applying reduction (totalBase - reduction.amount) | decimal? |
| Information on fee (positive) or discounts (negative) | object |
| Total amount added. If the amount is positive then it is a fee, otherwise it is a discount. | decimal |
| Total reduction in percent | decimal? |
| Total after applying reduction (reduction.subTotal + fee.amount). | decimal? |
| 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 |
| This is the same as total. | decimal? |
| The currency code, see settings/currencies/codes Null if cost is not calculated. | string |
| 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:
| The description of the provided service. | string |
| The service task code such as TR for translation or RV for revision. To discover all task types, see settings/tasks/codes | string |
| Number of units (see | int |
| The unit that is costed. Such as “WD” (words) or “CH” (characters). See also: Price units. | string |
| Number of units included in the unit price. | int |
| Unit price that is the price of | decimal |
| Currency code such as “EUR” or “USD”. | string |
| Optional product code. Empty string if none. | string |
| Optional reduction in percent from 0 to 100. | decimal |
| Total amount for this line. | decimal |
| Total amount before reduction for this line. | decimal |
| ||
| ||
| Boolean that indicates if this line specifies a minimum fee. | bool |
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 } ]