{"$schema":"https://json-schema.org/draft/2020-12/schema","title":"Stock card and movements - Fiche de stock et mouvement / Voorraad- en mutatiekaart (BE)","description":"A stock record for an SME without stock software, in two profiles: item_card (one item over a period: opening balance, dated movements, net movement and closing balance, all typed) and stock_list (a list of items at a date with quantity, unit and optional typed values). The template adds nothing: no balance, value or total is computed, a missing value prints a dash.","type":"object","additionalProperties":false,"required":["profile","company","keeper","as_of_date"],"properties":{"profile":{"type":"string","enum":["item_card","stock_list"],"description":"item_card: one item with its movements over a period; stock_list: items at a date."},"company":{"type":"object","description":"The enterprise that keeps the stock (an internal record).","additionalProperties":false,"properties":{"name":{"type":"string"},"enterprise_number":{"type":"string","pattern":"^[01][0-9]{3}\\.[0-9]{3}\\.[0-9]{3}$","description":"Belgian enterprise number (KBO/BCE), written 0123.456.789."},"seat_region":{"type":"string","enum":["nl_region","fr_region","brussels","de_region"],"description":"Linguistic region of the operating seat (optional). Nothing is compared with it."}},"required":["name"]},"item":{"type":"object","description":"item_card profile: the item the card is kept for.","additionalProperties":false,"properties":{"name":{"type":"string"},"reference":{"type":"string"},"unit":{"type":"string"},"location":{"type":"string"},"valuation_note":{"type":"string"}},"required":["name","unit"]},"period":{"type":"object","description":"item_card profile: the period of the card.","additionalProperties":false,"properties":{"from":{"type":"string","format":"date"},"to":{"type":"string","format":"date"}},"required":["from","to"]},"opening_balance":{"type":"number"},"movements":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"date":{"type":"string","format":"date"},"kind":{"type":"string","enum":["in","out","adjustment","transfer_in","transfer_out"]},"quantity_delta":{"type":"number"},"lot":{"type":"string"},"reference":{"type":"string"},"location":{"type":"string"},"by":{"type":"string"}},"required":["date","kind","quantity_delta"]},"minItems":1},"net_movement":{"type":"number"},"closing_balance":{"type":"number"},"items":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"name":{"type":"string"},"reference":{"type":"string"},"quantity":{"type":"number","minimum":0},"unit":{"type":"string"},"location":{"type":"string"},"lot":{"type":"string"},"unit_value":{"type":["string","number"]},"total_value":{"type":["string","number"]}},"required":["name","quantity","unit"]},"minItems":1},"total_value":{"type":["string","number"]},"keeper":{"type":"object","additionalProperties":false,"properties":{"name":{"type":"string"}},"required":["name"]},"as_of_date":{"type":"string","format":"date"}},"allOf":[{"if":{"properties":{"profile":{"const":"item_card"}},"required":["profile"]},"then":{"required":["item","period","opening_balance","movements","net_movement","closing_balance"]}},{"if":{"properties":{"profile":{"const":"stock_list"}},"required":["profile"]},"then":{"required":["items"]}}]}