Calculate Trip Allowance
calculate_trip_allowanceApplies the regime's rules to an itinerary and returns one line per allowance, deduction and night, each with the rule it applied, plus totals.
de-bmf: >8 h one-day trips (last place of work), partial arrival/departure days, full days at the place reached before midnight, higher rate on a home stop-over day, 20 %/40 % meal deductions of that day's full-day rate (never below 0), Übernachtungspauschale per night. The three-month rule is not applied.
us-gsa: 75 % M&IE on first and last day, M&IE of the lodging location, last day at the last TDY location, 75 % for 12-24 h trips without lodging, full meal-amount deductions with an incidentals floor, max lodging per night by season.
uk-hmrc: 24-hour periods from arrival abroad, over-5/over-10-hour rates for the remainder, room rate per night, provided meals deducted at the HMRC meal rate of the location at 08:00 / 13:00 / 19:00 that day.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| legs | Yes | Destinations in chronological order (1-20) | |
| regime | Yes | Which rule set to apply | |
| overnight | No | False for a trip across midnight without an overnight stay (de-bmf/us-gsa: combine hours) | |
| leave_home | No | When the traveller leaves home / the first place of work (de-bmf, us-gsa). Default: first arrive | |
| return_home | No | When the traveller is back home. Default: last depart | |
| meals_provided | No | Meals provided by employer/host | |
| lodging_provided | No | Lodging paid directly by the employer: no lodging lines |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| days | Yes | Calendar days touched by the trip | |
| lines | Yes | One line per day/period, deduction and night, each with its rule | |
| notes | Yes | Assumptions and caveats that applied | |
| total | Yes | Grand total (null if several currencies are involved; see totals) | |
| regime | Yes | Regime applied | |
| totals | Yes | Totals per currency | |
| sources | Yes | Official publications used | |
| currency | Yes | Currency of total, if the trip has a single currency | |
| disclaimer | Yes | Informational use only, not tax advice | |
| meals_total | Yes | Meal allowances before deductions (single-currency trips, else null) | |
| lodging_total | Yes | Lodging total (single-currency trips, else null) | |
| deductions_total | Yes | Meal deductions, negative (single-currency trips, else null) |