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:
Ali 2026-06-16 16:40:56 +00:00
parent d4509b682d
commit 93c6f13325
2 changed files with 4 additions and 4 deletions

View File

@ -981,7 +981,7 @@ VATETaxes.import = {
return;
}
const maxCount = 50;
const maxCount = 200; // VAT find.outbox supports 200/page (4x fewer round-trips)
frappe.call({
method: 'invoice_az.vat_api.get_vat_operations',

View File

@ -74,7 +74,7 @@ def parse_operation_date(operation_date_str):
@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
@ -94,7 +94,7 @@ def get_vat_operations(token, date_from, date_to, max_count=50, offset=0):
max_count = int(max_count)
offset = int(offset)
except (ValueError, TypeError):
max_count = 50
max_count = 200
offset = 0
payload = {
@ -1060,7 +1060,7 @@ def import_vat_operations(operations_data, company=None, create_as_draft=0, auto
@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 (для фронтенда)