Anlagen¶
Anlagen sind Güter im Betriebsvermögen, die über mehrere Jahre hinweg abgesetzt werden.
Mit der bookamat–API können Anlagen abgefragt, hinzugefügt, geändert und gelöscht werden. Es sind also GET, POST, PUT/PATCH und DELETE Requests möglich.
Liste der Anlagen¶
Die Liste aller Anlagen wird mit einem GET–Request auf die Listen–URL abgefragt.
/inventories/
Response¶
HTTP/1.0 200 OK
Content-Type: application/json; charset=utf-8
{
"count": 2,
"next": null,
"previous": null,
"results": [
{
"id": 7896,
"title": "Laptop",
"date_purchase": "2015-01-14",
"date_commissioning": "2015-01-15",
"date_disposal": null,
"amount_after_tax": "3000.00",
"deductibility_percent": "100.00",
"deductibility_amount": "3000.00",
"deductibility_declining_percent": null,
"deductibility_switch_year": null,
"deductibility_years": 3,
"deductibility_type": {
"id": 1,
"name": "Linear"
},
"costaccount": {
"id": 2388,
"name": "Betriebs- und Geschäftsausstattung"
},
"costcentre": {
"id": 4512,
"name": "Marketing"
},
"tags": [
{
"id": 8915,
"tag": 5680,
"name": "Hardware"
}
],
"amounts": [
{
"year": 2015,
"depreciation_percent": "33.33",
"depreciation_amount": "1000.00",
"cumulated_depreciation": "1000.00",
"residual_value": "2000.00"
},
{
"year": 2016,
"depreciation_percent": "33.33",
"depreciation_amount": "1000.00",
"cumulated_depreciation": "2000.00",
"residual_value": "1000.00"
},
{
"year": 2017,
"depreciation_percent": "33.33",
"depreciation_amount": "1000.00",
"cumulated_depreciation": "3000.00",
"residual_value": "0.00"
}
],
"attachments": [
{
"id": 8914,
"name": "Rechnung.pdf",
"size": 10700
}
],
"description": "",
"seller": "",
"create_date": "2015-01-16T17:00:00",
"update_date": "2015-01-1617:00:00"
},
{
"id": 7897,
"title": "Monitor",
"date_purchase": "2015-05-14",
"date_commissioning": "2015-05-15",
"date_disposal": null,
"amount_after_tax": "400.00",
"deductibility_percent": "100.00",
"deductibility_amount": "400.00",
"deductibility_declining_percent": null,
"deductibility_switch_year": null,
"deductibility_years": 1,
"deductibility_type": {
"id": 2,
"name": "Sofortabschreibung"
},
"costaccount": {
"id": 2389,
"name": "Geringwertige WG (Abschreibung)"
},
"costcentre": null,
"tags": [],
"amounts": [
{
"year": 2015,
"depreciation_percent": "100.00",
"depreciation_amount": "400.00",
"cumulated_depreciation": "400.00",
"residual_value": "0.00"
}
],
"attachments": [],
"description": "",
"seller": "",
"create_date": "2015-05-1617:00:00",
"update_date": "2015-05-16T17:00:00"
}
]
}
Felder¶
- id:
Eindeutige Identifikationsnummer
- Format
- title:
Anlagentitel
- Format
- String (max. 50 Zeichen)
- date_purchase:
Datum der Anschaffung
- Format
- date_commissioning:
Datum der Inbetriebnahme
- Format
- Hinweis
- Muss nach dem Datum der Anschaffung liegen
- date_disposal:
Datum des Abgangs/Verkaufs
- Format
- Hinweis
- Muss nach dem Datum der Inbetriebnahme liegen
- amount_after_tax:
Nettobetrag
- Format
- deductibility_percent:
Betrieblicher Anteil des Nettobetrags in %
- Format
- deductibility_amount:
Betrieblicher Anteil des Nettobetrags in €
- Format
- deductibility_declining_percent:
AfA % (degressiv)
- Format
- Hinweis
- Nur für Abschreibungsart "Degressiv".
- deductibility_switch_year:
Jahr (degressiv > linear)
- Format
- Hinweis
- Nur für Abschreibungsart "Degressiv".
- costaccount:
Steuerkonto
- Format
- Objektwerte
- Hinweis
- Aktives Steuerkonto mit inventory=True
- costcentre:
Kostenstelle
- Format
- Objektwerte
- Details
- Siehe Kostenstellen
- tags:
Tags
- Format
- Details
- Siehe Felder der Liste tags
- description:
Beschreibung
- Format
- String (max. 500 Zeichen)
- seller:
Eindeutige Identifikationsnummer
- Format
- String (max. 500 Zeichen)
- deductibility_years:
Dauer der Absetzbarkeit (Jahre)
- Format
- deductibility_type:
Art der Absetzbarkeit
- Format
- Objektwerte
- Möglichkeiten
- 1 — Linear2 — Sofortabschreibung3 — Keine Abnutzung4 — Degressiv
- amounts:
Absetzbeträge
- Format
- Details
- Siehe Felder der Liste amounts
- attachments:
Anhänge
- Format
- Details
- create_date:
Datum/Zeit der Erstellung
- Format
- update_date:
Datum/Zeit des letzten Update
- Format
Felder (amounts)¶
Felder der Liste amounts (Absetzbeträge).
- year:
Jahr
- Format
- depreciation_percent:
Afa %
- Format
- depreciation_amount:
Afa €
- Format
- cumulated_depreciation:
Kumulierte Afa
- Format
- residual_value:
Restbuchwert
- Format
Felder (attachments)¶
Felder der Liste attachments (Anhänge):
- id:
ID des Anhangs
- Format
- Siehe
- name:
Dateiname des Anhangs
- Format
- String (max. 200 Zeichen)
- size:
Dateigröße des Anhangs (in Bytes)
- Format
Filter¶
- title:
Anlagentitel
- Format
- String (contains)
- Beispiele
- title=Servermietetitle_contains=miete
- date_purchase:
Datum der Anschaffung
- Format
- Datum (from, until)
- Beispiele
- date_purchase=2015-01-01date_purchase_from=2015-01-01&date_purchase_until=2015-01-31
- date_commissioning:
Datum der Inbetriebnahme
- Format
- Datum (from, until)
- Beispiele
- date_commissioning=2015-01-01date_commissioning_from=2015-01-01&date_commissioning_until=2015-01-31
- date_disposal:
Datum des Abgangs/Verkaufs
- Format
- Datum (from, until)
- Beispiele
- date_disposal=2015-01-01date_disposal_from=2015-01-01&date_disposal_until=2015-01-31
- amount_after_tax:
Nettobetrag
- Format
- Dezimalzahl (min, max)
- Beispiele
- amount_after_tax=100amount_after_tax_min=100&amount_after_tax_max=199.99
- deductibility_percent:
Betrieblicher Anteil der Nettobetrags in %
- Format
- Dezimalzahl (min, max)
- Beispiele
- deductibility_percent=100deductibility_percent_min=10&deductibility_percent_max=89.99
- deductibility_amount:
Betrieblicher Anteil der Nettobetrags in €
- Format
- Dezimalzahl (min, max)
- Beispiele
- deductibility_amount=100deductibility_amount_min=100&deductibility_amount_max=199.99
- deductibility_declining_percent:
AfA % (degressiv)
- Format
- Dezimalzahl (min, max)
- Beispiele
- deductibility_declining_percent=25deductibility_declining_percent_min=20&deductibility_declining_percent_max=30
- deductibility_switch_year:
Jahr (degressiv > linear)
- Format
- Ganzzahl (min, max)
- Beispiele
- deductibility_switch_year=2020deductibility_switch_year_min=2018&deductibility_switch_year_max=2022
- costaccount:
Steuerkonto
- Format
- Ganzzahl (ID)
- Beispiele
- costaccount=2361
- costcentre:
Kostenstelle
- Format
- Ganzzahl (ID)
- Beispiele
- costcentre=4512
- tag:
Tag
- Format
- Ganzzahl (ID)
- Beispiele
- tag=5680
- Anmerkung
- Es handelt sich hier um die ID des Tags, nicht um die ID des Anlagentags.
- description:
Beschreibung
- Format
- String (contains)
- Beispiele
- description=Laptopdescription_contains=laptop
- seller:
Verkäufer
- Format
- String (contains)
- Beispiele
- seller=Appleseller_contains=apple
- create_date:
Erstellungsdatum
- Format
- Datum/Zeit (from, until)
- Beispiele
- create_date=2015-01-01create_date_from=2015-01-01&create_date_until=2015-01-31create_date_from=2015-01-01T17:00:00
- Anmerkung
- Bei create_date_from und create_date_until ist sowohl ein Datum als auch eine Kombination Datum/Zeit möglich
- update_date:
Änderungsdatum
- Format
- Datum/Zeit (from, until)
- Beispiele
- update_date=2015-01-01update_date_from=2015-01-01&update_date_until=2015-01-31update_date_from=2015-01-01T17:00:00
- Anmerkung
- Bei update_date_from und update_date_until ist sowohl ein Datum als auch eine Kombination Datum/Zeit möglich
- has_attachments:
Anhänge vorhanden
- Format
- Boolean
- Beispiele
- has_attachments=true
Sortierung¶
- ordering:
Sortierung
- Möglichkeiten
- id, title, date_purchase, date_commissioning, date_disposal
- Beispiele
- ordering=idordering=group,date
Anlage Detail¶
Eine einzelne Anlage wird mit einem GET–Request auf die Detail–URL abgefragt.
/inventory/{id}/
Felder¶
Es sind dieselben Felder verfügbar wie bei der Listenansicht.
Anlage hinzufügen¶
Eine neue Anlage wird mit einem POST Request auf die Listen-URL hinzugefügt. Der Request–Body muss alle notwendigen Felder beinhalten, als Response wird die neue Anlage zurückgegeben.
/inventories/
Request¶
Content-Type: application/json; charset=utf-8
{
"title": "Drucker",
"date_purchase": "2015-11-14",
"date_commissioning": "2015-11-15",
"amount_after_tax": "200.00",
"deductibility_percent": "100.00",
"deductibility_years": 1,
"deductibility_type": 2,
"costaccount": 2389,
"costcentre": 4512
}
Response¶
Beim Abspeichern der Anlage werden die Absetzbeträge berechnet und als Teil des Response zurückgegeben.
HTTP/1.0 201 CREATED
Content-Type: application/json; charset=utf-8
{
"id": 7898,
"title": "Drucker",
"date_purchase": "2015-11-14",
"date_commissioning": "2015-11-15",
"date_disposal": null,
"amount_after_tax": "200.00",
"deductibility_percent": "100.00",
"deductibility_amount": "200.00",
"deductibility_declining_percent": null,
"deductibility_switch_year": null,
"deductibility_years": 1,
"deductibility_type": {
"id": 2,
"name": "Sofortabschreibung"
},
"costaccount": {
"id": 2389,
"name": "Geringwertige WG (Abschreibung)"
},
"costcentre": {
"id": 4512,
"name": "Marketing"
},
"tags": [],
"description": "",
"seller": "",
"amounts": [
{
"year": 2015,
"depreciation_percent": "100.00",
"depreciation_amount": "200.00",
"cumulated_depreciation": "200.00",
"residual_value": "0.00"
}
],
"attachments": [],
"create_date": "2015-11-16T17:00:00",
"update_date": "2015-11-16T17:00:00",
}
Felder¶
Notwendige Felder sind mit * gekennzeichnet.
- title *:
Anlagentitel
- Format
- String (max. 50 Zeichen)
- date_purchase *:
Datum der Anschaffung
- Format
- date_commissioning *:
Datum der Inbetriebnahme
- Format
- Hinweis
- Muss nach dem Datum der Anschaffung liegen
- date_disposal:
Datum des Abgangs/Verkaufs
- Format
- Hinweis
- Muss nach dem Datum der Inbetriebnahme liegen
- amount_after_tax *:
Nettobetrag
- Format
- deductibility_percent:
Betrieblicher Anteil des Nettobetrags in %
- Format
- Hinweis
- Falls nicht angegeben, wird der Wert auf 100.00 gesetzt.
- deductibility_declining_percent:
AfA % (degressiv)
- Format
- Hinweis
- Nur für Abschreibungsart "Degressiv".
- deductibility_switch_year:
Jahr (degressiv > linear)
- Format
- Hinweis
- Nur für Abschreibungsart "Degressiv".
- deductibility_years *:
Dauer der Absetzbarkeit (Jahre)
- Format
- deductibility_type *:
Art der Absetzbarkeit (ID)
- Format
- Möglichkeiten
- 1 — Linear halbjährlich2 — Sofortabschreibung
- costaccount *:
Steuerkonto (ID)
- Format
- Hinweis
- Aktives Steuerkonto mit inventory=True
- costcentre:
Kostenstelle (ID)
- Format
- Details
- Siehe Kostenstellen
- description:
Beschreibung
- Format
- String (max. 500 Zeichen)
- seller:
Verkäufer
- Format
- String (max. 500 Zeichen)
Anlage ändern¶
Die Anlage kann mit einem PATCH oder PUT Request auf die Detail-URL geändert werden.
/inventory/{id}/
Request (PATCH)¶
Content-Type: application/json; charset=utf-8
{
"title": "Monitor (Eizo)"
"amount_after_tax": "399.90",
}
Request (PUT)¶
Content-Type: application/json; charset=utf-8
{
"title": "Monitor",
"date_purchase": "2015-01-14",
"date_commissioning": "2015-01-15",
"amount_after_tax": "399.90",
"deductibility_years": 1,
"deductibility_type": 2,
"costaccount": 2389
}
Response¶
Als Response wird die Anlage inklusive der berechneten Absetzbeträge zurückgegeben (siehe Response beim Hinzufügen einer Anlage).
HTTP/1.0 200 OK
Content-Type: application/json; charset=utf-8
...
Felder¶
Die Felder sind deckungsgleich mit dem POST Request (siehe Felder beim Hinzufügen einer Anlage). Beim PATCH Request sind nur die geänderten Felder anzugeben, beim PUT Request sind alle Felder notwendig.
Anlage löschen¶
Die Anlage kann mit einem DELETE Request auf die Detail-URL gelöscht werden. Im Gegensatz zu Buchungen können Anlagen tatsächlich vollständig gelöscht werden, der Response ist demnach ein Status Code 204 (NO CONTENT).
/inventory/{id}/
Response¶
HTTP/1.0 204 NO CONTENT