revnext 0.1.0__py3-none-any.whl → 0.1.2__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- revnext/__init__.py +16 -18
- revnext/common.py +196 -196
- revnext/config.py +61 -61
- revnext/parts_by_bin_report.py +250 -250
- revnext/parts_price_list_report.py +254 -254
- revnext-0.1.2.dist-info/METADATA +126 -0
- revnext-0.1.2.dist-info/RECORD +9 -0
- revnext/download_all_reports.py +0 -49
- revnext-0.1.0.dist-info/METADATA +0 -24
- revnext-0.1.0.dist-info/RECORD +0 -10
- {revnext-0.1.0.dist-info → revnext-0.1.2.dist-info}/WHEEL +0 -0
- {revnext-0.1.0.dist-info → revnext-0.1.2.dist-info}/top_level.txt +0 -0
revnext/parts_by_bin_report.py
CHANGED
|
@@ -1,250 +1,250 @@
|
|
|
1
|
-
"""
|
|
2
|
-
Download Parts By Bin Location CSV report from Revolution Next (*.revolutionnext.com.au).
|
|
3
|
-
Uses cookies (Chrome export format) and configurable base URL.
|
|
4
|
-
"""
|
|
5
|
-
|
|
6
|
-
from datetime import datetime
|
|
7
|
-
from pathlib import Path
|
|
8
|
-
from typing import Optional
|
|
9
|
-
|
|
10
|
-
from revnext.common import create_session, run_report_flow
|
|
11
|
-
from revnext.config import get_revnext_base_url_from_env
|
|
12
|
-
|
|
13
|
-
SERVICE_OBJECT = "Revolution.Activity.IM.RPT.PartsByBinLocationPR"
|
|
14
|
-
ACTIVITY_TAB_ID = "Nce9eac79_528b_4fc4_a294_b055a6dde16b"
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
def _build_submit_body() -> dict:
|
|
18
|
-
"""Build the submitActivityTask request body. Use today's date for the trigger."""
|
|
19
|
-
tz = "+10:00"
|
|
20
|
-
now = datetime.now()
|
|
21
|
-
start_date = now.strftime("%Y-%m-%d")
|
|
22
|
-
start_time = f"{start_date}T{now.strftime('%H:%M')}:00.000{tz}"
|
|
23
|
-
return {
|
|
24
|
-
"_userContext_vg_coid": "03",
|
|
25
|
-
"_userContext_vg_divid": "1",
|
|
26
|
-
"_userContext_vg_dftdpt": "570",
|
|
27
|
-
"activityTabId": ACTIVITY_TAB_ID,
|
|
28
|
-
"dataSets": [
|
|
29
|
-
{
|
|
30
|
-
"name": "dsActivityTask",
|
|
31
|
-
"id": None,
|
|
32
|
-
"dataSet": {
|
|
33
|
-
"dsActivityTask": {
|
|
34
|
-
"prods:hasChanges": True,
|
|
35
|
-
"ttActivityTask": [
|
|
36
|
-
{
|
|
37
|
-
"prods:id": "ttActivityTask1827072",
|
|
38
|
-
"prods:rowState": "created",
|
|
39
|
-
"fldId": 1,
|
|
40
|
-
"taskID": "",
|
|
41
|
-
"loadRowidPassThrough": "dummy",
|
|
42
|
-
"executeActivityTaskNow": False,
|
|
43
|
-
"executedAt": None,
|
|
44
|
-
"logMessages": "",
|
|
45
|
-
"startTime": None,
|
|
46
|
-
"endTime": None,
|
|
47
|
-
}
|
|
48
|
-
],
|
|
49
|
-
"prods:before": {},
|
|
50
|
-
}
|
|
51
|
-
},
|
|
52
|
-
},
|
|
53
|
-
{
|
|
54
|
-
"name": "dsActivityTaskTriggers",
|
|
55
|
-
"id": None,
|
|
56
|
-
"dataSet": {
|
|
57
|
-
"dsActivityTaskTriggers": {
|
|
58
|
-
"prods:hasChanges": True,
|
|
59
|
-
"ttActivityTaskTrigger": [
|
|
60
|
-
{
|
|
61
|
-
"prods:id": "ttActivityTaskTrigger1972480",
|
|
62
|
-
"prods:rowState": "created",
|
|
63
|
-
"fldId": 1,
|
|
64
|
-
"mode": "O",
|
|
65
|
-
"startDateTime": start_time,
|
|
66
|
-
"startDate": f"{start_date}T00:00:00.000{tz}",
|
|
67
|
-
"startHour": now.hour,
|
|
68
|
-
"startMinute": now.minute,
|
|
69
|
-
"recurEvery": 1,
|
|
70
|
-
"recurEveryUOM": "days",
|
|
71
|
-
"weeklySun": False,
|
|
72
|
-
"weeklyMon": False,
|
|
73
|
-
"weeklyTue": False,
|
|
74
|
-
"weeklyWed": False,
|
|
75
|
-
"weeklyThu": False,
|
|
76
|
-
"weeklyFri": False,
|
|
77
|
-
"weeklySat": False,
|
|
78
|
-
"monthsList": "",
|
|
79
|
-
"monthlyMode": "",
|
|
80
|
-
"monthlyDaysList": "",
|
|
81
|
-
"monthlyOnWeekNumber": "",
|
|
82
|
-
"monthlyOnDayOfWeek": "",
|
|
83
|
-
"triggerDescription": "",
|
|
84
|
-
"triggerNextSchedule": None,
|
|
85
|
-
"windowTimeFrom": "",
|
|
86
|
-
"windowTimeTo": "",
|
|
87
|
-
"windowAllDay": False,
|
|
88
|
-
}
|
|
89
|
-
],
|
|
90
|
-
"prods:before": {},
|
|
91
|
-
}
|
|
92
|
-
},
|
|
93
|
-
},
|
|
94
|
-
{
|
|
95
|
-
"name": "dsParams",
|
|
96
|
-
"id": None,
|
|
97
|
-
"dataSet": {
|
|
98
|
-
"dsParams": {
|
|
99
|
-
"prods:hasChanges": True,
|
|
100
|
-
"tt_params": [
|
|
101
|
-
{
|
|
102
|
-
"prods:id": "tt_paramsFldId1",
|
|
103
|
-
"prods:rowState": "modified",
|
|
104
|
-
"fldid": 1,
|
|
105
|
-
"coid": "03",
|
|
106
|
-
"divid": "1",
|
|
107
|
-
"activityid": "IM.RPT.PartsByBinLocationPR",
|
|
108
|
-
"taskid": "",
|
|
109
|
-
"tasksts": None,
|
|
110
|
-
"rptid": "",
|
|
111
|
-
"pdf": "",
|
|
112
|
-
"formprt": False,
|
|
113
|
-
"csvout": True,
|
|
114
|
-
"emailopt": "n",
|
|
115
|
-
"emailme": False,
|
|
116
|
-
"useremail": "lwarneke@mikecarneytoyota.com.au",
|
|
117
|
-
"emailprinter": False,
|
|
118
|
-
"prtid": "",
|
|
119
|
-
"ddpflg": False,
|
|
120
|
-
"ddpquo": 0,
|
|
121
|
-
"submitopt": "p",
|
|
122
|
-
"email_staff": False,
|
|
123
|
-
"staff_email": "",
|
|
124
|
-
"email_other": False,
|
|
125
|
-
"other_email": "",
|
|
126
|
-
"subject": "Parts By Bin Location",
|
|
127
|
-
"attn": "",
|
|
128
|
-
"email_text": "",
|
|
129
|
-
"email_signature": "",
|
|
130
|
-
"email_sig_type": "D",
|
|
131
|
-
"frmdptid": "570",
|
|
132
|
-
"todptid": "570",
|
|
133
|
-
"frmfrnid": "",
|
|
134
|
-
"tofrnid": "",
|
|
135
|
-
"frmbinid": "",
|
|
136
|
-
"tobinid": "",
|
|
137
|
-
"frmmovecode": "",
|
|
138
|
-
"tomovecode": "",
|
|
139
|
-
"stktyp": "A",
|
|
140
|
-
"prntnotzero": False,
|
|
141
|
-
"prntzero": False,
|
|
142
|
-
"prntstkzero": False,
|
|
143
|
-
"noprimarybin": False,
|
|
144
|
-
"noalternatebin": False,
|
|
145
|
-
"hasalternateonly": False,
|
|
146
|
-
"bothprimaryalternate": False,
|
|
147
|
-
"lastsaledate": None,
|
|
148
|
-
"lastreceiptdate": None,
|
|
149
|
-
"prntavgcost": False,
|
|
150
|
-
"rptformat": "N",
|
|
151
|
-
"tasktype": "",
|
|
152
|
-
}
|
|
153
|
-
],
|
|
154
|
-
"prods:before": {
|
|
155
|
-
"tt_params": [
|
|
156
|
-
{
|
|
157
|
-
"prods:id": "tt_paramsFldId1",
|
|
158
|
-
"prods:rowState": "modified",
|
|
159
|
-
"fldid": 1,
|
|
160
|
-
"coid": "03",
|
|
161
|
-
"divid": "1",
|
|
162
|
-
"activityid": "",
|
|
163
|
-
"taskid": "",
|
|
164
|
-
"tasksts": None,
|
|
165
|
-
"rptid": "",
|
|
166
|
-
"pdf": "",
|
|
167
|
-
"formprt": False,
|
|
168
|
-
"csvout": False,
|
|
169
|
-
"emailopt": "",
|
|
170
|
-
"emailme": False,
|
|
171
|
-
"useremail": "",
|
|
172
|
-
"emailprinter": False,
|
|
173
|
-
"prtid": "",
|
|
174
|
-
"ddpflg": False,
|
|
175
|
-
"ddpquo": 0,
|
|
176
|
-
"submitopt": "",
|
|
177
|
-
"email_staff": False,
|
|
178
|
-
"staff_email": "",
|
|
179
|
-
"email_other": False,
|
|
180
|
-
"other_email": "",
|
|
181
|
-
"subject": "",
|
|
182
|
-
"attn": "",
|
|
183
|
-
"email_text": "",
|
|
184
|
-
"email_signature": "",
|
|
185
|
-
"email_sig_type": "",
|
|
186
|
-
"frmdptid": "130",
|
|
187
|
-
"todptid": "130",
|
|
188
|
-
"frmfrnid": "",
|
|
189
|
-
"tofrnid": "",
|
|
190
|
-
"frmbinid": "",
|
|
191
|
-
"tobinid": "",
|
|
192
|
-
"frmmovecode": "",
|
|
193
|
-
"tomovecode": "",
|
|
194
|
-
"stktyp": "P",
|
|
195
|
-
"prntnotzero": False,
|
|
196
|
-
"prntzero": False,
|
|
197
|
-
"prntstkzero": False,
|
|
198
|
-
"noprimarybin": False,
|
|
199
|
-
"noalternatebin": False,
|
|
200
|
-
"hasalternateonly": False,
|
|
201
|
-
"bothprimaryalternate": False,
|
|
202
|
-
"lastsaledate": None,
|
|
203
|
-
"lastreceiptdate": None,
|
|
204
|
-
"prntavgcost": False,
|
|
205
|
-
"rptformat": "",
|
|
206
|
-
"tasktype": "",
|
|
207
|
-
}
|
|
208
|
-
]
|
|
209
|
-
},
|
|
210
|
-
}
|
|
211
|
-
},
|
|
212
|
-
},
|
|
213
|
-
],
|
|
214
|
-
"stopOnWarning": True,
|
|
215
|
-
"validateOnly": False,
|
|
216
|
-
"uiType": "ISC",
|
|
217
|
-
}
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
def download_parts_by_bin_report(
|
|
221
|
-
cookies_path: Optional[Path | str] = None,
|
|
222
|
-
output_path: Optional[Path | str] = None,
|
|
223
|
-
base_url: Optional[str] = None,
|
|
224
|
-
) -> Path:
|
|
225
|
-
"""
|
|
226
|
-
Run the Parts By Bin Location report and save CSV to output_path.
|
|
227
|
-
Returns the path where the file was saved.
|
|
228
|
-
|
|
229
|
-
Args:
|
|
230
|
-
cookies_path: Path to cookies JSON (Chrome export). Defaults to REVOLUTIONNEXT_COOKIES_PATH or current dir.
|
|
231
|
-
output_path: Where to save the CSV. Defaults to current dir / Parts_By_Bin_Location.csv.
|
|
232
|
-
base_url: Revolution Next base URL. Defaults to env.
|
|
233
|
-
"""
|
|
234
|
-
base_url = base_url or get_revnext_base_url_from_env()
|
|
235
|
-
default_cookies = Path.cwd() / "revnext-cookies.json"
|
|
236
|
-
cookies_path = Path(cookies_path) if cookies_path is not None else default_cookies
|
|
237
|
-
output_path = Path(output_path) if output_path is not None else (Path.cwd() / "Parts_By_Bin_Location.csv")
|
|
238
|
-
session = create_session(cookies_path, SERVICE_OBJECT, base_url)
|
|
239
|
-
return run_report_flow(
|
|
240
|
-
session,
|
|
241
|
-
SERVICE_OBJECT,
|
|
242
|
-
ACTIVITY_TAB_ID,
|
|
243
|
-
_build_submit_body,
|
|
244
|
-
output_path,
|
|
245
|
-
base_url,
|
|
246
|
-
)
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
if __name__ == "__main__":
|
|
250
|
-
download_parts_by_bin_report()
|
|
1
|
+
"""
|
|
2
|
+
Download Parts By Bin Location CSV report from Revolution Next (*.revolutionnext.com.au).
|
|
3
|
+
Uses cookies (Chrome export format) and configurable base URL.
|
|
4
|
+
"""
|
|
5
|
+
|
|
6
|
+
from datetime import datetime
|
|
7
|
+
from pathlib import Path
|
|
8
|
+
from typing import Optional
|
|
9
|
+
|
|
10
|
+
from revnext.common import create_session, run_report_flow
|
|
11
|
+
from revnext.config import get_revnext_base_url_from_env
|
|
12
|
+
|
|
13
|
+
SERVICE_OBJECT = "Revolution.Activity.IM.RPT.PartsByBinLocationPR"
|
|
14
|
+
ACTIVITY_TAB_ID = "Nce9eac79_528b_4fc4_a294_b055a6dde16b"
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
def _build_submit_body() -> dict:
|
|
18
|
+
"""Build the submitActivityTask request body. Use today's date for the trigger."""
|
|
19
|
+
tz = "+10:00"
|
|
20
|
+
now = datetime.now()
|
|
21
|
+
start_date = now.strftime("%Y-%m-%d")
|
|
22
|
+
start_time = f"{start_date}T{now.strftime('%H:%M')}:00.000{tz}"
|
|
23
|
+
return {
|
|
24
|
+
"_userContext_vg_coid": "03",
|
|
25
|
+
"_userContext_vg_divid": "1",
|
|
26
|
+
"_userContext_vg_dftdpt": "570",
|
|
27
|
+
"activityTabId": ACTIVITY_TAB_ID,
|
|
28
|
+
"dataSets": [
|
|
29
|
+
{
|
|
30
|
+
"name": "dsActivityTask",
|
|
31
|
+
"id": None,
|
|
32
|
+
"dataSet": {
|
|
33
|
+
"dsActivityTask": {
|
|
34
|
+
"prods:hasChanges": True,
|
|
35
|
+
"ttActivityTask": [
|
|
36
|
+
{
|
|
37
|
+
"prods:id": "ttActivityTask1827072",
|
|
38
|
+
"prods:rowState": "created",
|
|
39
|
+
"fldId": 1,
|
|
40
|
+
"taskID": "",
|
|
41
|
+
"loadRowidPassThrough": "dummy",
|
|
42
|
+
"executeActivityTaskNow": False,
|
|
43
|
+
"executedAt": None,
|
|
44
|
+
"logMessages": "",
|
|
45
|
+
"startTime": None,
|
|
46
|
+
"endTime": None,
|
|
47
|
+
}
|
|
48
|
+
],
|
|
49
|
+
"prods:before": {},
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
"name": "dsActivityTaskTriggers",
|
|
55
|
+
"id": None,
|
|
56
|
+
"dataSet": {
|
|
57
|
+
"dsActivityTaskTriggers": {
|
|
58
|
+
"prods:hasChanges": True,
|
|
59
|
+
"ttActivityTaskTrigger": [
|
|
60
|
+
{
|
|
61
|
+
"prods:id": "ttActivityTaskTrigger1972480",
|
|
62
|
+
"prods:rowState": "created",
|
|
63
|
+
"fldId": 1,
|
|
64
|
+
"mode": "O",
|
|
65
|
+
"startDateTime": start_time,
|
|
66
|
+
"startDate": f"{start_date}T00:00:00.000{tz}",
|
|
67
|
+
"startHour": now.hour,
|
|
68
|
+
"startMinute": now.minute,
|
|
69
|
+
"recurEvery": 1,
|
|
70
|
+
"recurEveryUOM": "days",
|
|
71
|
+
"weeklySun": False,
|
|
72
|
+
"weeklyMon": False,
|
|
73
|
+
"weeklyTue": False,
|
|
74
|
+
"weeklyWed": False,
|
|
75
|
+
"weeklyThu": False,
|
|
76
|
+
"weeklyFri": False,
|
|
77
|
+
"weeklySat": False,
|
|
78
|
+
"monthsList": "",
|
|
79
|
+
"monthlyMode": "",
|
|
80
|
+
"monthlyDaysList": "",
|
|
81
|
+
"monthlyOnWeekNumber": "",
|
|
82
|
+
"monthlyOnDayOfWeek": "",
|
|
83
|
+
"triggerDescription": "",
|
|
84
|
+
"triggerNextSchedule": None,
|
|
85
|
+
"windowTimeFrom": "",
|
|
86
|
+
"windowTimeTo": "",
|
|
87
|
+
"windowAllDay": False,
|
|
88
|
+
}
|
|
89
|
+
],
|
|
90
|
+
"prods:before": {},
|
|
91
|
+
}
|
|
92
|
+
},
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
"name": "dsParams",
|
|
96
|
+
"id": None,
|
|
97
|
+
"dataSet": {
|
|
98
|
+
"dsParams": {
|
|
99
|
+
"prods:hasChanges": True,
|
|
100
|
+
"tt_params": [
|
|
101
|
+
{
|
|
102
|
+
"prods:id": "tt_paramsFldId1",
|
|
103
|
+
"prods:rowState": "modified",
|
|
104
|
+
"fldid": 1,
|
|
105
|
+
"coid": "03",
|
|
106
|
+
"divid": "1",
|
|
107
|
+
"activityid": "IM.RPT.PartsByBinLocationPR",
|
|
108
|
+
"taskid": "",
|
|
109
|
+
"tasksts": None,
|
|
110
|
+
"rptid": "",
|
|
111
|
+
"pdf": "",
|
|
112
|
+
"formprt": False,
|
|
113
|
+
"csvout": True,
|
|
114
|
+
"emailopt": "n",
|
|
115
|
+
"emailme": False,
|
|
116
|
+
"useremail": "lwarneke@mikecarneytoyota.com.au",
|
|
117
|
+
"emailprinter": False,
|
|
118
|
+
"prtid": "",
|
|
119
|
+
"ddpflg": False,
|
|
120
|
+
"ddpquo": 0,
|
|
121
|
+
"submitopt": "p",
|
|
122
|
+
"email_staff": False,
|
|
123
|
+
"staff_email": "",
|
|
124
|
+
"email_other": False,
|
|
125
|
+
"other_email": "",
|
|
126
|
+
"subject": "Parts By Bin Location",
|
|
127
|
+
"attn": "",
|
|
128
|
+
"email_text": "",
|
|
129
|
+
"email_signature": "",
|
|
130
|
+
"email_sig_type": "D",
|
|
131
|
+
"frmdptid": "570",
|
|
132
|
+
"todptid": "570",
|
|
133
|
+
"frmfrnid": "",
|
|
134
|
+
"tofrnid": "",
|
|
135
|
+
"frmbinid": "",
|
|
136
|
+
"tobinid": "",
|
|
137
|
+
"frmmovecode": "",
|
|
138
|
+
"tomovecode": "",
|
|
139
|
+
"stktyp": "A",
|
|
140
|
+
"prntnotzero": False,
|
|
141
|
+
"prntzero": False,
|
|
142
|
+
"prntstkzero": False,
|
|
143
|
+
"noprimarybin": False,
|
|
144
|
+
"noalternatebin": False,
|
|
145
|
+
"hasalternateonly": False,
|
|
146
|
+
"bothprimaryalternate": False,
|
|
147
|
+
"lastsaledate": None,
|
|
148
|
+
"lastreceiptdate": None,
|
|
149
|
+
"prntavgcost": False,
|
|
150
|
+
"rptformat": "N",
|
|
151
|
+
"tasktype": "",
|
|
152
|
+
}
|
|
153
|
+
],
|
|
154
|
+
"prods:before": {
|
|
155
|
+
"tt_params": [
|
|
156
|
+
{
|
|
157
|
+
"prods:id": "tt_paramsFldId1",
|
|
158
|
+
"prods:rowState": "modified",
|
|
159
|
+
"fldid": 1,
|
|
160
|
+
"coid": "03",
|
|
161
|
+
"divid": "1",
|
|
162
|
+
"activityid": "",
|
|
163
|
+
"taskid": "",
|
|
164
|
+
"tasksts": None,
|
|
165
|
+
"rptid": "",
|
|
166
|
+
"pdf": "",
|
|
167
|
+
"formprt": False,
|
|
168
|
+
"csvout": False,
|
|
169
|
+
"emailopt": "",
|
|
170
|
+
"emailme": False,
|
|
171
|
+
"useremail": "",
|
|
172
|
+
"emailprinter": False,
|
|
173
|
+
"prtid": "",
|
|
174
|
+
"ddpflg": False,
|
|
175
|
+
"ddpquo": 0,
|
|
176
|
+
"submitopt": "",
|
|
177
|
+
"email_staff": False,
|
|
178
|
+
"staff_email": "",
|
|
179
|
+
"email_other": False,
|
|
180
|
+
"other_email": "",
|
|
181
|
+
"subject": "",
|
|
182
|
+
"attn": "",
|
|
183
|
+
"email_text": "",
|
|
184
|
+
"email_signature": "",
|
|
185
|
+
"email_sig_type": "",
|
|
186
|
+
"frmdptid": "130",
|
|
187
|
+
"todptid": "130",
|
|
188
|
+
"frmfrnid": "",
|
|
189
|
+
"tofrnid": "",
|
|
190
|
+
"frmbinid": "",
|
|
191
|
+
"tobinid": "",
|
|
192
|
+
"frmmovecode": "",
|
|
193
|
+
"tomovecode": "",
|
|
194
|
+
"stktyp": "P",
|
|
195
|
+
"prntnotzero": False,
|
|
196
|
+
"prntzero": False,
|
|
197
|
+
"prntstkzero": False,
|
|
198
|
+
"noprimarybin": False,
|
|
199
|
+
"noalternatebin": False,
|
|
200
|
+
"hasalternateonly": False,
|
|
201
|
+
"bothprimaryalternate": False,
|
|
202
|
+
"lastsaledate": None,
|
|
203
|
+
"lastreceiptdate": None,
|
|
204
|
+
"prntavgcost": False,
|
|
205
|
+
"rptformat": "",
|
|
206
|
+
"tasktype": "",
|
|
207
|
+
}
|
|
208
|
+
]
|
|
209
|
+
},
|
|
210
|
+
}
|
|
211
|
+
},
|
|
212
|
+
},
|
|
213
|
+
],
|
|
214
|
+
"stopOnWarning": True,
|
|
215
|
+
"validateOnly": False,
|
|
216
|
+
"uiType": "ISC",
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
|
|
220
|
+
def download_parts_by_bin_report(
|
|
221
|
+
cookies_path: Optional[Path | str] = None,
|
|
222
|
+
output_path: Optional[Path | str] = None,
|
|
223
|
+
base_url: Optional[str] = None,
|
|
224
|
+
) -> Path:
|
|
225
|
+
"""
|
|
226
|
+
Run the Parts By Bin Location report and save CSV to output_path.
|
|
227
|
+
Returns the path where the file was saved.
|
|
228
|
+
|
|
229
|
+
Args:
|
|
230
|
+
cookies_path: Path to cookies JSON (Chrome export). Defaults to REVOLUTIONNEXT_COOKIES_PATH or current dir.
|
|
231
|
+
output_path: Where to save the CSV. Defaults to current dir / Parts_By_Bin_Location.csv.
|
|
232
|
+
base_url: Revolution Next base URL. Defaults to env.
|
|
233
|
+
"""
|
|
234
|
+
base_url = base_url or get_revnext_base_url_from_env()
|
|
235
|
+
default_cookies = Path.cwd() / "revnext-cookies.json"
|
|
236
|
+
cookies_path = Path(cookies_path) if cookies_path is not None else default_cookies
|
|
237
|
+
output_path = Path(output_path) if output_path is not None else (Path.cwd() / "Parts_By_Bin_Location.csv")
|
|
238
|
+
session = create_session(cookies_path, SERVICE_OBJECT, base_url)
|
|
239
|
+
return run_report_flow(
|
|
240
|
+
session,
|
|
241
|
+
SERVICE_OBJECT,
|
|
242
|
+
ACTIVITY_TAB_ID,
|
|
243
|
+
_build_submit_body,
|
|
244
|
+
output_path,
|
|
245
|
+
base_url,
|
|
246
|
+
)
|
|
247
|
+
|
|
248
|
+
|
|
249
|
+
if __name__ == "__main__":
|
|
250
|
+
download_parts_by_bin_report()
|