perf(vat): fetch VAT operations 200/page instead of 50
The find.outbox endpoint accepts maxCount=200 (verified live: 50->50, 200->200), same as the invoice endpoints, but the VAT fetch was hardcoded to 50 — ~4x more round-trips than necessary. Bump the client page size and the backend defaults to 200; the pagination loop is size-agnostic so logic is unchanged. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
d4509b682d
commit
93c6f13325
|
|
@ -981,7 +981,7 @@ VATETaxes.import = {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const maxCount = 50;
|
const maxCount = 200; // VAT find.outbox supports 200/page (4x fewer round-trips)
|
||||||
|
|
||||||
frappe.call({
|
frappe.call({
|
||||||
method: 'invoice_az.vat_api.get_vat_operations',
|
method: 'invoice_az.vat_api.get_vat_operations',
|
||||||
|
|
|
||||||
|
|
@ -74,7 +74,7 @@ def parse_operation_date(operation_date_str):
|
||||||
|
|
||||||
|
|
||||||
@frappe.whitelist()
|
@frappe.whitelist()
|
||||||
def get_vat_operations(token, date_from, date_to, max_count=50, offset=0):
|
def get_vat_operations(token, date_from, date_to, max_count=200, offset=0):
|
||||||
"""
|
"""
|
||||||
Получение списка VAT Account операций из e-taxes
|
Получение списка VAT Account операций из e-taxes
|
||||||
|
|
||||||
|
|
@ -94,7 +94,7 @@ def get_vat_operations(token, date_from, date_to, max_count=50, offset=0):
|
||||||
max_count = int(max_count)
|
max_count = int(max_count)
|
||||||
offset = int(offset)
|
offset = int(offset)
|
||||||
except (ValueError, TypeError):
|
except (ValueError, TypeError):
|
||||||
max_count = 50
|
max_count = 200
|
||||||
offset = 0
|
offset = 0
|
||||||
|
|
||||||
payload = {
|
payload = {
|
||||||
|
|
@ -1060,7 +1060,7 @@ def import_vat_operations(operations_data, company=None, create_as_draft=0, auto
|
||||||
|
|
||||||
|
|
||||||
@frappe.whitelist()
|
@frappe.whitelist()
|
||||||
def load_vat_operations_from_etaxes(date_from, date_to, max_count=50, offset=0):
|
def load_vat_operations_from_etaxes(date_from, date_to, max_count=200, offset=0):
|
||||||
"""
|
"""
|
||||||
Загрузка VAT операций из e-taxes (для фронтенда)
|
Загрузка VAT операций из e-taxes (для фронтенда)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue