askrobots / dbbasic-object-server
Public
Runs live, versioned Python application objects on one VM, with a suite of apps: projects, notes, tasks, files and more.
fringe_benefits.json · 4.1 KB · 52 lines
| 1 | { |
| 2 | "name": "fringe_benefits", |
| 3 | "title": "Fringe Benefits", |
| 4 | "version": 1, |
| 5 | "description": "A register of non-cash benefits the business gave an employee -- personal use of a company car, a gift card, group-term life over the excludable amount, a gym membership -- with the value and whether finance has decided it is taxable, kept so they can be handed to the payroll provider (action_fringe_export, CSV or JSON). Nothing here calculates payroll, withholding or the value itself: the value is what finance determined, by the method named in valuation_method, from the source named in source (IRS Publication 15-B is the usual reference). taxable has no default on purpose -- the register's job is to make somebody decide, and a default would decide for them. Readable and writable by role:finance and admins only: it is pay information about named people. A wrong row is corrected by editing it before it is exported, or by a correcting row after; check with your accountant.", |
| 6 | "fields": [ |
| 7 | {"name": "id"}, |
| 8 | {"name": "employee_id", "type": "text", "required": true, "label": "Employee", |
| 9 | "validation": {"max_length": 120}, |
| 10 | "help": "The employee's id as the payroll provider knows them (or their user id here). Not an owner key: the employee does not get to edit their own benefit."}, |
| 11 | {"name": "employee_name", "type": "text", "required": true, "label": "Employee name", |
| 12 | "validation": {"max_length": 200}}, |
| 13 | {"name": "benefit_type", "type": "enum", "required": true, "label": "Benefit", |
| 14 | "enum": ["company_vehicle_personal_use", "group_term_life_over_limit", "gift_card_or_cash_equivalent", |
| 15 | "de_minimis", "employee_discount", "gym_or_athletic_facility", "educational_assistance", |
| 16 | "dependent_care_assistance", "transportation_and_parking", "achievement_award", |
| 17 | "meals_or_lodging", "moving_expense_reimbursement", "other"], |
| 18 | "help": "The kinds IRS Publication 15-B discusses. 'other' with a description for anything else."}, |
| 19 | {"name": "description", "type": "text", "label": "Description", |
| 20 | "validation": {"max_length": 300}}, |
| 21 | {"name": "period_start", "type": "date", "required": true, "label": "Period from"}, |
| 22 | {"name": "period_end", "type": "date", "required": true, "label": "Period to"}, |
| 23 | {"name": "value_cents", "type": "integer", "required": true, "label": "Value", |
| 24 | "validation": {"min": 0}, |
| 25 | "help": "The value finance determined, in cents. Not computed here."}, |
| 26 | {"name": "taxable", "type": "enum", "required": true, "label": "Taxable", |
| 27 | "enum": ["yes", "no"], |
| 28 | "help": "Whether finance has decided this value is taxable wages. No default: somebody has to decide."}, |
| 29 | {"name": "valuation_method", "type": "text", "label": "Valuation method", |
| 30 | "validation": {"max_length": 200}, |
| 31 | "help": "How the value was arrived at: fair market value, cents-per-mile, annual lease value, commuting rule, the Table 2-2 premium cost..."}, |
| 32 | {"name": "source", "type": "text", "label": "Source", |
| 33 | "validation": {"max_length": 500}, |
| 34 | "help": "The record the value came from: the mileage log totals, the invoice, the policy, the publication section."}, |
| 35 | {"name": "notes", "type": "textarea", "label": "Notes"}, |
| 36 | {"name": "owner_id", "type": "text", "label": "Recorded by"}, |
| 37 | {"name": "created_at", "type": "datetime", "read_only": true, "label": "Created"} |
| 38 | ], |
| 39 | "locked_checks": [ |
| 40 | {"name": "fringe_period", "object": "hook_fringe_benefits", "function": "LOCKED_CHECK", |
| 41 | "on": {"create": true, "update": ["period_start", "period_end"], "delete": false}} |
| 42 | ], |
| 43 | "hooks": {"before_write": "hook_fringe_benefits"}, |
| 44 | "search": {"fields": ["employee_name", "employee_id", "description", "notes"]}, |
| 45 | "forms": {"default": {"fields": ["employee_id", "employee_name", "benefit_type", "description", |
| 46 | "period_start", "period_end", "value_cents", "taxable", |
| 47 | "valuation_method", "source", "notes"]}}, |
| 48 | "views": {"list_mode": "table", |
| 49 | "list_fields": ["employee_name", "benefit_type", "period_start", "period_end", |
| 50 | "value_cents", "taxable"], |
| 51 | "filter_fields": ["benefit_type", "taxable"]} |
| 52 | } |