python-moloni-fix 0.3.16__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.
- moloni/__init__.py +0 -0
- moloni/__version__.py +1 -0
- moloni/api/__init__.py +701 -0
- moloni/api/bankaccounts_client.py +372 -0
- moloni/api/billsoflading_client.py +693 -0
- moloni/api/companies_client.py +322 -0
- moloni/api/countries_client.py +171 -0
- moloni/api/creditnotes_client.py +615 -0
- moloni/api/currencies_client.py +171 -0
- moloni/api/customeralternateaddresses_client.py +519 -0
- moloni/api/customerreturnnotes_client.py +701 -0
- moloni/api/customers_client.py +1413 -0
- moloni/api/debitnotes_client.py +597 -0
- moloni/api/deductions_client.py +435 -0
- moloni/api/deliverymethods_client.py +431 -0
- moloni/api/deliverynotes_client.py +714 -0
- moloni/api/documentmodels_client.py +171 -0
- moloni/api/documents_client.py +472 -0
- moloni/api/documentsets_client.py +447 -0
- moloni/api/estimates_client.py +663 -0
- moloni/api/fiscalzones_client.py +219 -0
- moloni/api/identificationtemplates_client.py +513 -0
- moloni/api/invoicereceipts_client.py +705 -0
- moloni/api/invoices_client.py +705 -0
- moloni/api/languages_client.py +171 -0
- moloni/api/maturitydates_client.py +441 -0
- moloni/api/measurementunits_client.py +437 -0
- moloni/api/ownassetsmovementguides_client.py +683 -0
- moloni/api/paymentmethods_client.py +429 -0
- moloni/api/productcategories_client.py +400 -0
- moloni/api/products_client.py +1252 -0
- moloni/api/receipts_client.py +591 -0
- moloni/api/salesmen_client.py +580 -0
- moloni/api/simplifiedinvoices_client.py +705 -0
- moloni/api/subscription_client.py +104 -0
- moloni/api/suppliers_client.py +1264 -0
- moloni/api/taxes_client.py +477 -0
- moloni/api/taxexemptions_client.py +171 -0
- moloni/api/users_client.py +104 -0
- moloni/api/vehicles_client.py +435 -0
- moloni/api/warehouses_client.py +506 -0
- moloni/api/waybills_client.py +699 -0
- moloni/base/__init__.py +24 -0
- moloni/base/client.py +164 -0
- moloni/base/config.py +6 -0
- moloni/base/helpers.py +150 -0
- moloni/base/logger_config.py +49 -0
- python_moloni_fix-0.3.16.dist-info/METADATA +231 -0
- python_moloni_fix-0.3.16.dist-info/RECORD +52 -0
- python_moloni_fix-0.3.16.dist-info/WHEEL +5 -0
- python_moloni_fix-0.3.16.dist-info/licenses/LICENSE +21 -0
- python_moloni_fix-0.3.16.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,705 @@
|
|
|
1
|
+
from pydantic import BaseModel, ValidationError
|
|
2
|
+
from typing import Union, Optional, List, Any
|
|
3
|
+
|
|
4
|
+
from moloni.base.client import MoloniBaseClient
|
|
5
|
+
from moloni.base.helpers import endpoint, fill_query_params, validate_data
|
|
6
|
+
from moloni.base import ApiResponse
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class ApiRequestModel(BaseModel):
|
|
10
|
+
_api_client: Any = None
|
|
11
|
+
|
|
12
|
+
def connect(self, *args, **kwargs):
|
|
13
|
+
self._api_client = InvoicesClient(*args, **kwargs)
|
|
14
|
+
return self
|
|
15
|
+
|
|
16
|
+
def __enter__(self):
|
|
17
|
+
return self.connect()
|
|
18
|
+
|
|
19
|
+
def __exit__(self, exc_type, exc_value, traceback):
|
|
20
|
+
pass
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
class Associated_documents(BaseModel):
|
|
24
|
+
associated_id: Optional[Any] = None
|
|
25
|
+
value: Optional[Any] = None
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
class Payments(BaseModel):
|
|
29
|
+
date: Optional[Any] = None
|
|
30
|
+
notes: Optional[Any] = None
|
|
31
|
+
payment_method_id: Optional[Any] = None
|
|
32
|
+
value: Optional[Any] = None
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
class Products(BaseModel):
|
|
36
|
+
discount: Optional[Any] = None
|
|
37
|
+
exemption_reason: Optional[Any] = None
|
|
38
|
+
name: Optional[Any] = None
|
|
39
|
+
order: Optional[Any] = None
|
|
40
|
+
price: Optional[Any] = None
|
|
41
|
+
product_id: Optional[Any] = None
|
|
42
|
+
qty: Optional[Any] = None
|
|
43
|
+
summary: Optional[Any] = None
|
|
44
|
+
taxes: Optional[Any] = None
|
|
45
|
+
warehouse_id: Optional[Any] = None
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
class InvoicesCountModel(ApiRequestModel):
|
|
49
|
+
company_id: Union[str, int]
|
|
50
|
+
customer_id: Optional[Union[str, int]] = None
|
|
51
|
+
date: Optional[str] = None
|
|
52
|
+
document_set_id: Optional[Union[str, int]] = None
|
|
53
|
+
expiration_date: Optional[str] = None
|
|
54
|
+
number: Optional[str] = None
|
|
55
|
+
our_reference: Optional[str] = None
|
|
56
|
+
salesman_id: Optional[Union[str, int]] = None
|
|
57
|
+
supplier_id: Optional[Union[str, int]] = None
|
|
58
|
+
year: Optional[str] = None
|
|
59
|
+
your_reference: Optional[str] = None
|
|
60
|
+
|
|
61
|
+
def request(self) -> ApiResponse:
|
|
62
|
+
"""
|
|
63
|
+
request(self) -> ApiResponse
|
|
64
|
+
|
|
65
|
+
Make an API request using the initialized client.
|
|
66
|
+
|
|
67
|
+
This method checks if the `_api_client` attribute is set (i.e., if the client has been initialized via the `connect` method).
|
|
68
|
+
If the client is initialized, it will make an API request using the provided method name and the model's data,
|
|
69
|
+
excluding the `_api_client` attribute itself from the request payload. If the client is not initialized, it will raise a `ValueError`.
|
|
70
|
+
|
|
71
|
+
Returns:
|
|
72
|
+
The response from the API.
|
|
73
|
+
|
|
74
|
+
Raises:
|
|
75
|
+
ValueError: If the client is not initialized via the `connect` method.
|
|
76
|
+
|
|
77
|
+
Example:
|
|
78
|
+
|
|
79
|
+
# Assuming you have a model instance `request_model` and an API client `api_client`
|
|
80
|
+
|
|
81
|
+
..code-block:: python
|
|
82
|
+
|
|
83
|
+
with request_model.connect(auth_config=auth_config) as api:
|
|
84
|
+
response = api.request()
|
|
85
|
+
|
|
86
|
+
# The above example assumes that the `connect` method has been used to initialize the client.
|
|
87
|
+
# The request method then sends the model's data to the API and returns the API's response.
|
|
88
|
+
|
|
89
|
+
"""
|
|
90
|
+
if hasattr(self, "_api_client"):
|
|
91
|
+
response = self._api_client.count(
|
|
92
|
+
self.model_dump(exclude={"_api_client"}, exclude_unset=True)
|
|
93
|
+
)
|
|
94
|
+
return response
|
|
95
|
+
else:
|
|
96
|
+
raise ValueError("Client not initialized. Use the 'connect' method.")
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
class InvoicesDeleteModel(ApiRequestModel):
|
|
100
|
+
company_id: Union[str, int]
|
|
101
|
+
document_id: Optional[Union[str, int]] = None
|
|
102
|
+
|
|
103
|
+
def request(self) -> ApiResponse:
|
|
104
|
+
"""
|
|
105
|
+
request(self) -> ApiResponse
|
|
106
|
+
|
|
107
|
+
Make an API request using the initialized client.
|
|
108
|
+
|
|
109
|
+
This method checks if the `_api_client` attribute is set (i.e., if the client has been initialized via the `connect` method).
|
|
110
|
+
If the client is initialized, it will make an API request using the provided method name and the model's data,
|
|
111
|
+
excluding the `_api_client` attribute itself from the request payload. If the client is not initialized, it will raise a `ValueError`.
|
|
112
|
+
|
|
113
|
+
Returns:
|
|
114
|
+
The response from the API.
|
|
115
|
+
|
|
116
|
+
Raises:
|
|
117
|
+
ValueError: If the client is not initialized via the `connect` method.
|
|
118
|
+
|
|
119
|
+
Example:
|
|
120
|
+
|
|
121
|
+
# Assuming you have a model instance `request_model` and an API client `api_client`
|
|
122
|
+
|
|
123
|
+
..code-block:: python
|
|
124
|
+
|
|
125
|
+
with request_model.connect(auth_config=auth_config) as api:
|
|
126
|
+
response = api.request()
|
|
127
|
+
|
|
128
|
+
# The above example assumes that the `connect` method has been used to initialize the client.
|
|
129
|
+
# The request method then sends the model's data to the API and returns the API's response.
|
|
130
|
+
|
|
131
|
+
"""
|
|
132
|
+
if hasattr(self, "_api_client"):
|
|
133
|
+
response = self._api_client.delete(
|
|
134
|
+
self.model_dump(exclude={"_api_client"}, exclude_unset=True)
|
|
135
|
+
)
|
|
136
|
+
return response
|
|
137
|
+
else:
|
|
138
|
+
raise ValueError("Client not initialized. Use the 'connect' method.")
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
class InvoicesGetAllModel(ApiRequestModel):
|
|
142
|
+
company_id: Union[str, int]
|
|
143
|
+
customer_id: Optional[Union[str, int]] = None
|
|
144
|
+
date: Optional[str] = None
|
|
145
|
+
document_set_id: Optional[Union[str, int]] = None
|
|
146
|
+
expiration_date: Optional[str] = None
|
|
147
|
+
number: Optional[str] = None
|
|
148
|
+
offset: Optional[Union[str, int]] = 0
|
|
149
|
+
our_reference: Optional[str] = None
|
|
150
|
+
qty: Optional[Union[str, int]] = 25
|
|
151
|
+
salesman_id: Optional[Union[str, int]] = None
|
|
152
|
+
supplier_id: Optional[Union[str, int]] = None
|
|
153
|
+
year: Optional[str] = None
|
|
154
|
+
your_reference: Optional[str] = None
|
|
155
|
+
|
|
156
|
+
def request(self) -> ApiResponse:
|
|
157
|
+
"""
|
|
158
|
+
request(self) -> ApiResponse
|
|
159
|
+
|
|
160
|
+
Make an API request using the initialized client.
|
|
161
|
+
|
|
162
|
+
This method checks if the `_api_client` attribute is set (i.e., if the client has been initialized via the `connect` method).
|
|
163
|
+
If the client is initialized, it will make an API request using the provided method name and the model's data,
|
|
164
|
+
excluding the `_api_client` attribute itself from the request payload. If the client is not initialized, it will raise a `ValueError`.
|
|
165
|
+
|
|
166
|
+
Returns:
|
|
167
|
+
The response from the API.
|
|
168
|
+
|
|
169
|
+
Raises:
|
|
170
|
+
ValueError: If the client is not initialized via the `connect` method.
|
|
171
|
+
|
|
172
|
+
Example:
|
|
173
|
+
|
|
174
|
+
# Assuming you have a model instance `request_model` and an API client `api_client`
|
|
175
|
+
|
|
176
|
+
..code-block:: python
|
|
177
|
+
|
|
178
|
+
with request_model.connect(auth_config=auth_config) as api:
|
|
179
|
+
response = api.request()
|
|
180
|
+
|
|
181
|
+
# The above example assumes that the `connect` method has been used to initialize the client.
|
|
182
|
+
# The request method then sends the model's data to the API and returns the API's response.
|
|
183
|
+
|
|
184
|
+
"""
|
|
185
|
+
if hasattr(self, "_api_client"):
|
|
186
|
+
response = self._api_client.get_all(
|
|
187
|
+
self.model_dump(exclude={"_api_client"}, exclude_unset=True)
|
|
188
|
+
)
|
|
189
|
+
return response
|
|
190
|
+
else:
|
|
191
|
+
raise ValueError("Client not initialized. Use the 'connect' method.")
|
|
192
|
+
|
|
193
|
+
|
|
194
|
+
class InvoicesGetOneModel(ApiRequestModel):
|
|
195
|
+
company_id: Union[str, int]
|
|
196
|
+
customer_id: Optional[Union[str, int]] = None
|
|
197
|
+
date: Optional[str] = None
|
|
198
|
+
document_id: Optional[Union[str, int]] = None
|
|
199
|
+
document_set_id: Optional[Union[str, int]] = None
|
|
200
|
+
expiration_date: Optional[str] = None
|
|
201
|
+
number: Optional[str] = None
|
|
202
|
+
our_reference: Optional[str] = None
|
|
203
|
+
salesman_id: Optional[Union[str, int]] = None
|
|
204
|
+
supplier_id: Optional[Union[str, int]] = None
|
|
205
|
+
year: Optional[str] = None
|
|
206
|
+
your_reference: Optional[str] = None
|
|
207
|
+
|
|
208
|
+
def request(self) -> ApiResponse:
|
|
209
|
+
"""
|
|
210
|
+
request(self) -> ApiResponse
|
|
211
|
+
|
|
212
|
+
Make an API request using the initialized client.
|
|
213
|
+
|
|
214
|
+
This method checks if the `_api_client` attribute is set (i.e., if the client has been initialized via the `connect` method).
|
|
215
|
+
If the client is initialized, it will make an API request using the provided method name and the model's data,
|
|
216
|
+
excluding the `_api_client` attribute itself from the request payload. If the client is not initialized, it will raise a `ValueError`.
|
|
217
|
+
|
|
218
|
+
Returns:
|
|
219
|
+
The response from the API.
|
|
220
|
+
|
|
221
|
+
Raises:
|
|
222
|
+
ValueError: If the client is not initialized via the `connect` method.
|
|
223
|
+
|
|
224
|
+
Example:
|
|
225
|
+
|
|
226
|
+
# Assuming you have a model instance `request_model` and an API client `api_client`
|
|
227
|
+
|
|
228
|
+
..code-block:: python
|
|
229
|
+
|
|
230
|
+
with request_model.connect(auth_config=auth_config) as api:
|
|
231
|
+
response = api.request()
|
|
232
|
+
|
|
233
|
+
# The above example assumes that the `connect` method has been used to initialize the client.
|
|
234
|
+
# The request method then sends the model's data to the API and returns the API's response.
|
|
235
|
+
|
|
236
|
+
"""
|
|
237
|
+
if hasattr(self, "_api_client"):
|
|
238
|
+
response = self._api_client.get_one(
|
|
239
|
+
self.model_dump(exclude={"_api_client"}, exclude_unset=True)
|
|
240
|
+
)
|
|
241
|
+
return response
|
|
242
|
+
else:
|
|
243
|
+
raise ValueError("Client not initialized. Use the 'connect' method.")
|
|
244
|
+
|
|
245
|
+
|
|
246
|
+
class InvoicesInsertModel(ApiRequestModel):
|
|
247
|
+
company_id: Union[str, int]
|
|
248
|
+
alternate_address_id: Optional[Union[str, int]] = None
|
|
249
|
+
associated_documents: Optional[List[Associated_documents]] = None
|
|
250
|
+
customer_id: Optional[Union[str, int]] = None
|
|
251
|
+
date: Optional[str] = None
|
|
252
|
+
deduction_id: Optional[Union[str, int]] = None
|
|
253
|
+
delivery_datetime: Optional[str] = None
|
|
254
|
+
delivery_departure_address: Optional[str] = None
|
|
255
|
+
delivery_departure_city: Optional[str] = None
|
|
256
|
+
delivery_departure_country: Optional[str] = None
|
|
257
|
+
delivery_departure_zip_code: Optional[str] = None
|
|
258
|
+
delivery_destination_address: Optional[str] = None
|
|
259
|
+
delivery_destination_city: Optional[str] = None
|
|
260
|
+
delivery_destination_country: Optional[str] = None
|
|
261
|
+
delivery_destination_zip_code: Optional[str] = None
|
|
262
|
+
delivery_method_id: Optional[Union[str, int]] = None
|
|
263
|
+
document_set_id: Optional[Union[str, int]] = None
|
|
264
|
+
expiration_date: Optional[str] = None
|
|
265
|
+
financial_discount: Optional[str] = None
|
|
266
|
+
notes: Optional[str] = None
|
|
267
|
+
our_reference: Optional[str] = None
|
|
268
|
+
products: Optional[List[Products]] = None
|
|
269
|
+
related_documents_notes: Optional[str] = None
|
|
270
|
+
salesman_commission: Optional[str] = None
|
|
271
|
+
salesman_id: Optional[Union[str, int]] = None
|
|
272
|
+
special_discount: Optional[str] = None
|
|
273
|
+
status: Optional[str] = None
|
|
274
|
+
vehicle_id: Optional[Union[str, int]] = None
|
|
275
|
+
your_reference: Optional[str] = None
|
|
276
|
+
|
|
277
|
+
def request(self) -> ApiResponse:
|
|
278
|
+
"""
|
|
279
|
+
request(self) -> ApiResponse
|
|
280
|
+
|
|
281
|
+
Make an API request using the initialized client.
|
|
282
|
+
|
|
283
|
+
This method checks if the `_api_client` attribute is set (i.e., if the client has been initialized via the `connect` method).
|
|
284
|
+
If the client is initialized, it will make an API request using the provided method name and the model's data,
|
|
285
|
+
excluding the `_api_client` attribute itself from the request payload. If the client is not initialized, it will raise a `ValueError`.
|
|
286
|
+
|
|
287
|
+
Returns:
|
|
288
|
+
The response from the API.
|
|
289
|
+
|
|
290
|
+
Raises:
|
|
291
|
+
ValueError: If the client is not initialized via the `connect` method.
|
|
292
|
+
|
|
293
|
+
Example:
|
|
294
|
+
|
|
295
|
+
# Assuming you have a model instance `request_model` and an API client `api_client`
|
|
296
|
+
|
|
297
|
+
..code-block:: python
|
|
298
|
+
|
|
299
|
+
with request_model.connect(auth_config=auth_config) as api:
|
|
300
|
+
response = api.request()
|
|
301
|
+
|
|
302
|
+
# The above example assumes that the `connect` method has been used to initialize the client.
|
|
303
|
+
# The request method then sends the model's data to the API and returns the API's response.
|
|
304
|
+
|
|
305
|
+
"""
|
|
306
|
+
if hasattr(self, "_api_client"):
|
|
307
|
+
response = self._api_client.insert(
|
|
308
|
+
self.model_dump(exclude={"_api_client"}, exclude_unset=True)
|
|
309
|
+
)
|
|
310
|
+
return response
|
|
311
|
+
else:
|
|
312
|
+
raise ValueError("Client not initialized. Use the 'connect' method.")
|
|
313
|
+
|
|
314
|
+
|
|
315
|
+
class InvoicesUpdateModel(ApiRequestModel):
|
|
316
|
+
company_id: Union[str, int]
|
|
317
|
+
alternate_address_id: Optional[Union[str, int]] = None
|
|
318
|
+
associated_documents: Optional[List[Associated_documents]] = None
|
|
319
|
+
customer_id: Optional[Union[str, int]] = None
|
|
320
|
+
date: Optional[str] = None
|
|
321
|
+
deduction_id: Optional[Union[str, int]] = None
|
|
322
|
+
delivery_datetime: Optional[str] = None
|
|
323
|
+
delivery_departure_address: Optional[str] = None
|
|
324
|
+
delivery_departure_city: Optional[str] = None
|
|
325
|
+
delivery_departure_country: Optional[str] = None
|
|
326
|
+
delivery_departure_zip_code: Optional[str] = None
|
|
327
|
+
delivery_destination_address: Optional[str] = None
|
|
328
|
+
delivery_destination_city: Optional[str] = None
|
|
329
|
+
delivery_destination_country: Optional[str] = None
|
|
330
|
+
delivery_destination_zip_code: Optional[str] = None
|
|
331
|
+
delivery_method_id: Optional[Union[str, int]] = None
|
|
332
|
+
document_id: Optional[Union[str, int]] = None
|
|
333
|
+
document_set_id: Optional[Union[str, int]] = None
|
|
334
|
+
expiration_date: Optional[str] = None
|
|
335
|
+
financial_discount: Optional[str] = None
|
|
336
|
+
notes: Optional[str] = None
|
|
337
|
+
our_reference: Optional[str] = None
|
|
338
|
+
products: Optional[List[Products]] = None
|
|
339
|
+
related_documents_notes: Optional[str] = None
|
|
340
|
+
salesman_commission: Optional[str] = None
|
|
341
|
+
salesman_id: Optional[Union[str, int]] = None
|
|
342
|
+
special_discount: Optional[str] = None
|
|
343
|
+
status: Optional[str] = None
|
|
344
|
+
vehicle_id: Optional[Union[str, int]] = None
|
|
345
|
+
your_reference: Optional[str] = None
|
|
346
|
+
|
|
347
|
+
def request(self) -> ApiResponse:
|
|
348
|
+
"""
|
|
349
|
+
request(self) -> ApiResponse
|
|
350
|
+
|
|
351
|
+
Make an API request using the initialized client.
|
|
352
|
+
|
|
353
|
+
This method checks if the `_api_client` attribute is set (i.e., if the client has been initialized via the `connect` method).
|
|
354
|
+
If the client is initialized, it will make an API request using the provided method name and the model's data,
|
|
355
|
+
excluding the `_api_client` attribute itself from the request payload. If the client is not initialized, it will raise a `ValueError`.
|
|
356
|
+
|
|
357
|
+
Returns:
|
|
358
|
+
The response from the API.
|
|
359
|
+
|
|
360
|
+
Raises:
|
|
361
|
+
ValueError: If the client is not initialized via the `connect` method.
|
|
362
|
+
|
|
363
|
+
Example:
|
|
364
|
+
|
|
365
|
+
# Assuming you have a model instance `request_model` and an API client `api_client`
|
|
366
|
+
|
|
367
|
+
..code-block:: python
|
|
368
|
+
|
|
369
|
+
with request_model.connect(auth_config=auth_config) as api:
|
|
370
|
+
response = api.request()
|
|
371
|
+
|
|
372
|
+
# The above example assumes that the `connect` method has been used to initialize the client.
|
|
373
|
+
# The request method then sends the model's data to the API and returns the API's response.
|
|
374
|
+
|
|
375
|
+
"""
|
|
376
|
+
if hasattr(self, "_api_client"):
|
|
377
|
+
response = self._api_client.update(
|
|
378
|
+
self.model_dump(exclude={"_api_client"}, exclude_unset=True)
|
|
379
|
+
)
|
|
380
|
+
return response
|
|
381
|
+
else:
|
|
382
|
+
raise ValueError("Client not initialized. Use the 'connect' method.")
|
|
383
|
+
|
|
384
|
+
|
|
385
|
+
class InvoicesClient(MoloniBaseClient):
|
|
386
|
+
|
|
387
|
+
@endpoint("/<version>/invoices/count/", method="post")
|
|
388
|
+
def count(self, data: Union[InvoicesCountModel, dict], **kwargs):
|
|
389
|
+
"""
|
|
390
|
+
count(self, data: Union[InvoicesCountModel, dict], **kwargs)
|
|
391
|
+
|
|
392
|
+
Args:
|
|
393
|
+
|
|
394
|
+
data (Union[InvoicesCountModel, dict]): A model instance or dictionary containing the following fields:
|
|
395
|
+
|
|
396
|
+
- company_id (Union[str, int]): company_id of the InvoicesCountModel.
|
|
397
|
+
|
|
398
|
+
- customer_id (Union[str, int]): customer_id of the InvoicesCountModel.
|
|
399
|
+
|
|
400
|
+
- date (str): date of the InvoicesCountModel.
|
|
401
|
+
|
|
402
|
+
- document_set_id (Union[str, int]): document_set_id of the InvoicesCountModel.
|
|
403
|
+
|
|
404
|
+
- expiration_date (str): expiration_date of the InvoicesCountModel.
|
|
405
|
+
|
|
406
|
+
- number (str): number of the InvoicesCountModel.
|
|
407
|
+
|
|
408
|
+
- our_reference (str): our_reference of the InvoicesCountModel.
|
|
409
|
+
|
|
410
|
+
- salesman_id (Union[str, int]): salesman_id of the InvoicesCountModel.
|
|
411
|
+
|
|
412
|
+
- supplier_id (Union[str, int]): supplier_id of the InvoicesCountModel.
|
|
413
|
+
|
|
414
|
+
- year (str): year of the InvoicesCountModel.
|
|
415
|
+
|
|
416
|
+
- your_reference (str): your_reference of the InvoicesCountModel.
|
|
417
|
+
|
|
418
|
+
|
|
419
|
+
|
|
420
|
+
Returns:
|
|
421
|
+
ApiResponse: The response from the API.
|
|
422
|
+
"""
|
|
423
|
+
|
|
424
|
+
data = validate_data(data, self.validate, InvoicesCountModel)
|
|
425
|
+
|
|
426
|
+
return self._request(
|
|
427
|
+
fill_query_params(kwargs.pop("path"), self.version), data={**data, **kwargs}
|
|
428
|
+
)
|
|
429
|
+
|
|
430
|
+
@endpoint("/<version>/invoices/delete/", method="post")
|
|
431
|
+
def delete(self, data: Union[InvoicesDeleteModel, dict], **kwargs):
|
|
432
|
+
"""
|
|
433
|
+
delete(self, data: Union[InvoicesDeleteModel, dict], **kwargs)
|
|
434
|
+
|
|
435
|
+
Args:
|
|
436
|
+
|
|
437
|
+
data (Union[InvoicesDeleteModel, dict]): A model instance or dictionary containing the following fields:
|
|
438
|
+
|
|
439
|
+
- company_id (Union[str, int]): company_id of the InvoicesDeleteModel.
|
|
440
|
+
|
|
441
|
+
- document_id (Union[str, int]): document_id of the InvoicesDeleteModel.
|
|
442
|
+
|
|
443
|
+
|
|
444
|
+
|
|
445
|
+
Returns:
|
|
446
|
+
ApiResponse: The response from the API.
|
|
447
|
+
"""
|
|
448
|
+
|
|
449
|
+
data = validate_data(data, self.validate, InvoicesDeleteModel)
|
|
450
|
+
|
|
451
|
+
return self._request(
|
|
452
|
+
fill_query_params(kwargs.pop("path"), self.version), data={**data, **kwargs}
|
|
453
|
+
)
|
|
454
|
+
|
|
455
|
+
@endpoint("/<version>/invoices/getAll/", method="post")
|
|
456
|
+
def get_all(self, data: Union[InvoicesGetAllModel, dict], **kwargs):
|
|
457
|
+
"""
|
|
458
|
+
get_all(self, data: Union[InvoicesGetAllModel, dict], **kwargs)
|
|
459
|
+
|
|
460
|
+
Args:
|
|
461
|
+
|
|
462
|
+
data (Union[InvoicesGetAllModel, dict]): A model instance or dictionary containing the following fields:
|
|
463
|
+
|
|
464
|
+
- company_id (Union[str, int]): company_id of the InvoicesGetAllModel.
|
|
465
|
+
|
|
466
|
+
- customer_id (Union[str, int]): customer_id of the InvoicesGetAllModel.
|
|
467
|
+
|
|
468
|
+
- date (str): date of the InvoicesGetAllModel.
|
|
469
|
+
|
|
470
|
+
- document_set_id (Union[str, int]): document_set_id of the InvoicesGetAllModel.
|
|
471
|
+
|
|
472
|
+
- expiration_date (str): expiration_date of the InvoicesGetAllModel.
|
|
473
|
+
|
|
474
|
+
- number (str): number of the InvoicesGetAllModel.
|
|
475
|
+
|
|
476
|
+
- offset (str): offset of the InvoicesGetAllModel.
|
|
477
|
+
|
|
478
|
+
- our_reference (str): our_reference of the InvoicesGetAllModel.
|
|
479
|
+
|
|
480
|
+
- qty (str): qty of the InvoicesGetAllModel.
|
|
481
|
+
|
|
482
|
+
- salesman_id (Union[str, int]): salesman_id of the InvoicesGetAllModel.
|
|
483
|
+
|
|
484
|
+
- supplier_id (Union[str, int]): supplier_id of the InvoicesGetAllModel.
|
|
485
|
+
|
|
486
|
+
- year (str): year of the InvoicesGetAllModel.
|
|
487
|
+
|
|
488
|
+
- your_reference (str): your_reference of the InvoicesGetAllModel.
|
|
489
|
+
|
|
490
|
+
|
|
491
|
+
|
|
492
|
+
Returns:
|
|
493
|
+
ApiResponse: The response from the API.
|
|
494
|
+
"""
|
|
495
|
+
|
|
496
|
+
data = validate_data(data, self.validate, InvoicesGetAllModel)
|
|
497
|
+
|
|
498
|
+
return self._request(
|
|
499
|
+
fill_query_params(kwargs.pop("path"), self.version), data={**data, **kwargs}
|
|
500
|
+
)
|
|
501
|
+
|
|
502
|
+
@endpoint("/<version>/invoices/getOne/", method="post")
|
|
503
|
+
def get_one(self, data: Union[InvoicesGetOneModel, dict], **kwargs):
|
|
504
|
+
"""
|
|
505
|
+
get_one(self, data: Union[InvoicesGetOneModel, dict], **kwargs)
|
|
506
|
+
|
|
507
|
+
Args:
|
|
508
|
+
|
|
509
|
+
data (Union[InvoicesGetOneModel, dict]): A model instance or dictionary containing the following fields:
|
|
510
|
+
|
|
511
|
+
- company_id (Union[str, int]): company_id of the InvoicesGetOneModel.
|
|
512
|
+
|
|
513
|
+
- customer_id (Union[str, int]): customer_id of the InvoicesGetOneModel.
|
|
514
|
+
|
|
515
|
+
- date (str): date of the InvoicesGetOneModel.
|
|
516
|
+
|
|
517
|
+
- document_id (Union[str, int]): document_id of the InvoicesGetOneModel.
|
|
518
|
+
|
|
519
|
+
- document_set_id (Union[str, int]): document_set_id of the InvoicesGetOneModel.
|
|
520
|
+
|
|
521
|
+
- expiration_date (str): expiration_date of the InvoicesGetOneModel.
|
|
522
|
+
|
|
523
|
+
- number (str): number of the InvoicesGetOneModel.
|
|
524
|
+
|
|
525
|
+
- our_reference (str): our_reference of the InvoicesGetOneModel.
|
|
526
|
+
|
|
527
|
+
- salesman_id (Union[str, int]): salesman_id of the InvoicesGetOneModel.
|
|
528
|
+
|
|
529
|
+
- supplier_id (Union[str, int]): supplier_id of the InvoicesGetOneModel.
|
|
530
|
+
|
|
531
|
+
- year (str): year of the InvoicesGetOneModel.
|
|
532
|
+
|
|
533
|
+
- your_reference (str): your_reference of the InvoicesGetOneModel.
|
|
534
|
+
|
|
535
|
+
|
|
536
|
+
|
|
537
|
+
Returns:
|
|
538
|
+
ApiResponse: The response from the API.
|
|
539
|
+
"""
|
|
540
|
+
|
|
541
|
+
data = validate_data(data, self.validate, InvoicesGetOneModel)
|
|
542
|
+
|
|
543
|
+
return self._request(
|
|
544
|
+
fill_query_params(kwargs.pop("path"), self.version), data={**data, **kwargs}
|
|
545
|
+
)
|
|
546
|
+
|
|
547
|
+
@endpoint("/<version>/invoices/insert/", method="post")
|
|
548
|
+
def insert(self, data: Union[InvoicesInsertModel, dict], **kwargs):
|
|
549
|
+
"""
|
|
550
|
+
insert(self, data: Union[InvoicesInsertModel, dict], **kwargs)
|
|
551
|
+
|
|
552
|
+
Args:
|
|
553
|
+
|
|
554
|
+
data (Union[InvoicesInsertModel, dict]): A model instance or dictionary containing the following fields:
|
|
555
|
+
|
|
556
|
+
- alternate_address_id (Union[str, int]): alternate_address_id of the InvoicesInsertModel.
|
|
557
|
+
|
|
558
|
+
- associated_documents (str): associated_documents of the InvoicesInsertModel.
|
|
559
|
+
|
|
560
|
+
- company_id (Union[str, int]): company_id of the InvoicesInsertModel.
|
|
561
|
+
|
|
562
|
+
- customer_id (Union[str, int]): customer_id of the InvoicesInsertModel.
|
|
563
|
+
|
|
564
|
+
- date (str): date of the InvoicesInsertModel.
|
|
565
|
+
|
|
566
|
+
- deduction_id (Union[str, int]): deduction_id of the InvoicesInsertModel.
|
|
567
|
+
|
|
568
|
+
- delivery_datetime (str): delivery_datetime of the InvoicesInsertModel.
|
|
569
|
+
|
|
570
|
+
- delivery_departure_address (str): delivery_departure_address of the InvoicesInsertModel.
|
|
571
|
+
|
|
572
|
+
- delivery_departure_city (str): delivery_departure_city of the InvoicesInsertModel.
|
|
573
|
+
|
|
574
|
+
- delivery_departure_country (str): delivery_departure_country of the InvoicesInsertModel.
|
|
575
|
+
|
|
576
|
+
- delivery_departure_zip_code (str): delivery_departure_zip_code of the InvoicesInsertModel.
|
|
577
|
+
|
|
578
|
+
- delivery_destination_address (str): delivery_destination_address of the InvoicesInsertModel.
|
|
579
|
+
|
|
580
|
+
- delivery_destination_city (str): delivery_destination_city of the InvoicesInsertModel.
|
|
581
|
+
|
|
582
|
+
- delivery_destination_country (str): delivery_destination_country of the InvoicesInsertModel.
|
|
583
|
+
|
|
584
|
+
- delivery_destination_zip_code (str): delivery_destination_zip_code of the InvoicesInsertModel.
|
|
585
|
+
|
|
586
|
+
- delivery_method_id (Union[str, int]): delivery_method_id of the InvoicesInsertModel.
|
|
587
|
+
|
|
588
|
+
- document_set_id (Union[str, int]): document_set_id of the InvoicesInsertModel.
|
|
589
|
+
|
|
590
|
+
- expiration_date (str): expiration_date of the InvoicesInsertModel.
|
|
591
|
+
|
|
592
|
+
- financial_discount (str): financial_discount of the InvoicesInsertModel.
|
|
593
|
+
|
|
594
|
+
- notes (str): notes of the InvoicesInsertModel.
|
|
595
|
+
|
|
596
|
+
- our_reference (str): our_reference of the InvoicesInsertModel.
|
|
597
|
+
|
|
598
|
+
- products (str): products of the InvoicesInsertModel.
|
|
599
|
+
|
|
600
|
+
- related_documents_notes (str): related_documents_notes of the InvoicesInsertModel.
|
|
601
|
+
|
|
602
|
+
- salesman_commission (str): salesman_commission of the InvoicesInsertModel.
|
|
603
|
+
|
|
604
|
+
- salesman_id (Union[str, int]): salesman_id of the InvoicesInsertModel.
|
|
605
|
+
|
|
606
|
+
- special_discount (str): special_discount of the InvoicesInsertModel.
|
|
607
|
+
|
|
608
|
+
- status (str): status of the InvoicesInsertModel.
|
|
609
|
+
|
|
610
|
+
- vehicle_id (Union[str, int]): vehicle_id of the InvoicesInsertModel.
|
|
611
|
+
|
|
612
|
+
- your_reference (str): your_reference of the InvoicesInsertModel.
|
|
613
|
+
|
|
614
|
+
|
|
615
|
+
|
|
616
|
+
Returns:
|
|
617
|
+
ApiResponse: The response from the API.
|
|
618
|
+
"""
|
|
619
|
+
|
|
620
|
+
data = validate_data(data, self.validate, InvoicesInsertModel)
|
|
621
|
+
|
|
622
|
+
return self._request(
|
|
623
|
+
fill_query_params(kwargs.pop("path"), self.version), data={**data, **kwargs}
|
|
624
|
+
)
|
|
625
|
+
|
|
626
|
+
@endpoint("/<version>/invoices/update/", method="post")
|
|
627
|
+
def update(self, data: Union[InvoicesUpdateModel, dict], **kwargs):
|
|
628
|
+
"""
|
|
629
|
+
update(self, data: Union[InvoicesUpdateModel, dict], **kwargs)
|
|
630
|
+
|
|
631
|
+
Args:
|
|
632
|
+
|
|
633
|
+
data (Union[InvoicesUpdateModel, dict]): A model instance or dictionary containing the following fields:
|
|
634
|
+
|
|
635
|
+
- alternate_address_id (Union[str, int]): alternate_address_id of the InvoicesUpdateModel.
|
|
636
|
+
|
|
637
|
+
- associated_documents (str): associated_documents of the InvoicesUpdateModel.
|
|
638
|
+
|
|
639
|
+
- company_id (Union[str, int]): company_id of the InvoicesUpdateModel.
|
|
640
|
+
|
|
641
|
+
- customer_id (Union[str, int]): customer_id of the InvoicesUpdateModel.
|
|
642
|
+
|
|
643
|
+
- date (str): date of the InvoicesUpdateModel.
|
|
644
|
+
|
|
645
|
+
- deduction_id (Union[str, int]): deduction_id of the InvoicesUpdateModel.
|
|
646
|
+
|
|
647
|
+
- delivery_datetime (str): delivery_datetime of the InvoicesUpdateModel.
|
|
648
|
+
|
|
649
|
+
- delivery_departure_address (str): delivery_departure_address of the InvoicesUpdateModel.
|
|
650
|
+
|
|
651
|
+
- delivery_departure_city (str): delivery_departure_city of the InvoicesUpdateModel.
|
|
652
|
+
|
|
653
|
+
- delivery_departure_country (str): delivery_departure_country of the InvoicesUpdateModel.
|
|
654
|
+
|
|
655
|
+
- delivery_departure_zip_code (str): delivery_departure_zip_code of the InvoicesUpdateModel.
|
|
656
|
+
|
|
657
|
+
- delivery_destination_address (str): delivery_destination_address of the InvoicesUpdateModel.
|
|
658
|
+
|
|
659
|
+
- delivery_destination_city (str): delivery_destination_city of the InvoicesUpdateModel.
|
|
660
|
+
|
|
661
|
+
- delivery_destination_country (str): delivery_destination_country of the InvoicesUpdateModel.
|
|
662
|
+
|
|
663
|
+
- delivery_destination_zip_code (str): delivery_destination_zip_code of the InvoicesUpdateModel.
|
|
664
|
+
|
|
665
|
+
- delivery_method_id (Union[str, int]): delivery_method_id of the InvoicesUpdateModel.
|
|
666
|
+
|
|
667
|
+
- document_id (Union[str, int]): document_id of the InvoicesUpdateModel.
|
|
668
|
+
|
|
669
|
+
- document_set_id (Union[str, int]): document_set_id of the InvoicesUpdateModel.
|
|
670
|
+
|
|
671
|
+
- expiration_date (str): expiration_date of the InvoicesUpdateModel.
|
|
672
|
+
|
|
673
|
+
- financial_discount (str): financial_discount of the InvoicesUpdateModel.
|
|
674
|
+
|
|
675
|
+
- notes (str): notes of the InvoicesUpdateModel.
|
|
676
|
+
|
|
677
|
+
- our_reference (str): our_reference of the InvoicesUpdateModel.
|
|
678
|
+
|
|
679
|
+
- products (str): products of the InvoicesUpdateModel.
|
|
680
|
+
|
|
681
|
+
- related_documents_notes (str): related_documents_notes of the InvoicesUpdateModel.
|
|
682
|
+
|
|
683
|
+
- salesman_commission (str): salesman_commission of the InvoicesUpdateModel.
|
|
684
|
+
|
|
685
|
+
- salesman_id (Union[str, int]): salesman_id of the InvoicesUpdateModel.
|
|
686
|
+
|
|
687
|
+
- special_discount (str): special_discount of the InvoicesUpdateModel.
|
|
688
|
+
|
|
689
|
+
- status (str): status of the InvoicesUpdateModel.
|
|
690
|
+
|
|
691
|
+
- vehicle_id (Union[str, int]): vehicle_id of the InvoicesUpdateModel.
|
|
692
|
+
|
|
693
|
+
- your_reference (str): your_reference of the InvoicesUpdateModel.
|
|
694
|
+
|
|
695
|
+
|
|
696
|
+
|
|
697
|
+
Returns:
|
|
698
|
+
ApiResponse: The response from the API.
|
|
699
|
+
"""
|
|
700
|
+
|
|
701
|
+
data = validate_data(data, self.validate, InvoicesUpdateModel)
|
|
702
|
+
|
|
703
|
+
return self._request(
|
|
704
|
+
fill_query_params(kwargs.pop("path"), self.version), data={**data, **kwargs}
|
|
705
|
+
)
|