Wiki source code of timerecording/set_costcenter.php
Last modified by YellowFox_RD on 2025/01/23 10:44
Show last authors
author | version | line-number | content |
---|---|---|---|
1 | (% class="box" %) | ||
2 | ((( | ||
3 | Table of Contents | ||
4 | ))) | ||
5 | |||
6 | {{toc/}} | ||
7 | |||
8 | (% class="box" %) | ||
9 | ((( | ||
10 | **Compatibility** | ||
11 | This function is only available for customers with activated time recording V3. | ||
12 | ))) | ||
13 | |||
14 | Allows you to create, edit and delete cost centers. | ||
15 | |||
16 | = Description = | ||
17 | |||
18 | (% class="blue mark" %)**POST**(%%)** //timerecording/set_costcenter.php?company//**//=//COMPANY_RTIKEY//**&import**=//COMPANY_IMPORTKEY**&action**=ACTION_TYPE**&name**=COSTCENTER_IDENT**&name**=COSTCENTER_NAME**&valid_from**=COSTCENTER_VALIDFROM_DATETIME**&valid_to**=COSTCENTER_VALIDTO_DATETIME**&planned_duration**=COSTCENTER_DURATION**&defined_activities**=COSTCENTER_ACTIVITIES**&allow_other_activities**=COSTCENTER_OTHER_ACTIVITIES_OPTION**&defined_persons**=COSTCENTER_PERSONS | ||
19 | |||
20 | = //Parameters// = | ||
21 | |||
22 | |=Parameter|=Description|=Type|=Note|=Mandatory | ||
23 | |company|RTI company key|string| |yes | ||
24 | |import|RTI import key|string| |yes | ||
25 | |action|Possible request modes|string|permissible modes are:((( | ||
26 | * new: create a new cost center | ||
27 | * update: edit an existing cost center | ||
28 | * delete: delete a cost center | ||
29 | )))|yes | ||
30 | |ident|Identifier of the cost center|string|Unique identifier of the cost center. | ||
31 | Only with this ID is it possible to edit or delete a cost center later.|yes | ||
32 | |name|Name of the cost center|string| |yes(1) | ||
33 | |valid_from|Start of the cost center's validity|string|YYYYmmddHHiiss|yes(1) | ||
34 | |valid_to|End of the cost center's validity|string|YYYYmmddHHiiss|no | ||
35 | |planned_duration|Planned duration of the cost center|integer|in minutes|no | ||
36 | |defined_activities|Defined activities of the cost center|array|An array of objects containing the identifier and an optional planning time in minutes per activity. | ||
37 | The identification of the activities must be unique and already stored in the system. | ||
38 | Example: | ||
39 | {{code language="js"}}[ | ||
40 | { | ||
41 | "ident": "A100", | ||
42 | "duration": 2000 | ||
43 | }, | ||
44 | { | ||
45 | "ident": "A200", | ||
46 | "duration": null | ||
47 | }, | ||
48 | { | ||
49 | "ident": "A300" | ||
50 | } | ||
51 | ]{{/code}}|no | ||
52 | |allow_other_activities|This option determines whether other activities are allowed for the booking in addition to the "defined_activities".|integer|Possible values: 0 or 1 | ||
53 | default: 0|no | ||
54 | |defined_persons|Defined persons of the cost center|array|An array of employee numbers (string). | ||
55 | If persons are specified for a cost center, it is only possible for these persons to create a time booking to this cost center. | ||
56 | The employee number is determined separately for each person via the personnel administration. | ||
57 | {{code language="js"}}[ "M1000", "M1001", "M1002" ]{{/code}}|no | ||
58 | Hints: | ||
59 | (1) Mandatory field when creating a cost center | ||
60 | If fields are not transmitted when editing cost centers, they will not be changed. | ||
61 | |||
62 | = Return = | ||
63 | |||
64 | When creating and editing, "**COSTCENTER_DATA_SAVED**" is returned if successful. | ||
65 | When deleting a cost center, "**COSTCENTER_DELETED**" is returned if successful.. | ||
66 | If entries are missing or incorrect, an "(% class="error" %)**ERROR:description**(%%)" is returned. | ||
67 | |||
68 | = Examples = | ||
69 | |||
70 | **Create a new cost center with all possible fields** | ||
71 | {{code language="java"}}https://map.yellowfox.de/rti/timerecording/set_costcenter.php?company=COMPANY_RTIKEY&import=COMPANY_IMPORTKEY&action=new&ident=B1234&name=Baustelle&valid_from=20210101000000&valid_to=20211231235959&planned_duration=10000&defined_activities=[{"ident":"A100","duration":5000},{"ident":"A200","duration":5000}]&allow_other_activities=0&defined_persons=["M1000","M1001"]{{/code}} | ||
72 | |||
73 | **Edit the name of a cost center** | ||
74 | {{code language="java"}}https://map.yellowfox.de/rti/timerecording/set_costcenter.php?company=COMPANY_RTIKEY&import=COMPANY_IMPORTKEY&ident=B1234&action=update&name=Büro{{/code}} | ||
75 | |||
76 | **Delete a cost center** | ||
77 | {{code language="java"}}https://map.yellowfox.de/rti/timerecording/set_costcenter.php?company=COMPANY_RTIKEY&import=COMPANY_IMPORTKEY&ident=B1234&action=delete{{/code}} | ||
78 |