Fixing the account balance entry error
This commit is contained in:
@@ -269,8 +269,8 @@ async function searchTahesab(mode: 'range' | 'filter') {
|
|||||||
const fromRaw = String(sync.fromCode ?? '').trim();
|
const fromRaw = String(sync.fromCode ?? '').trim();
|
||||||
const toRaw = String(sync.toCode ?? '').trim();
|
const toRaw = String(sync.toCode ?? '').trim();
|
||||||
if (!fromRaw && !toRaw) {
|
if (!fromRaw && !toRaw) {
|
||||||
body.fromCode = 1;
|
// API برای «همه» فلگ listAll دارد؛ ارسال ۱…۵۰۰۰ با سقف ۲۰۰۰ کد رد میشود
|
||||||
body.toCode = 5000;
|
body.listAll = true;
|
||||||
} else {
|
} else {
|
||||||
const fromCode = fromRaw ? Number(fromRaw) : 1;
|
const fromCode = fromRaw ? Number(fromRaw) : 1;
|
||||||
const toCode = toRaw ? Number(toRaw) : fromCode + 1999;
|
const toCode = toRaw ? Number(toRaw) : fromCode + 1999;
|
||||||
@@ -278,6 +278,10 @@ async function searchTahesab(mode: 'range' | 'filter') {
|
|||||||
error.value = 'بازه کد مشتری نامعتبر است.';
|
error.value = 'بازه کد مشتری نامعتبر است.';
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (toCode - fromCode > 2000) {
|
||||||
|
error.value = 'حداکثر طول بازه در هر درخواست ۲۰۰۰ کد است. برای همه، از و تا را خالی بگذارید.';
|
||||||
|
return;
|
||||||
|
}
|
||||||
body.fromCode = fromCode;
|
body.fromCode = fromCode;
|
||||||
body.toCode = toCode;
|
body.toCode = toCode;
|
||||||
}
|
}
|
||||||
@@ -294,7 +298,7 @@ async function searchTahesab(mode: 'range' | 'filter') {
|
|||||||
const { data } = await api.post<{ results: SyncResult[] }>(
|
const { data } = await api.post<{ results: SyncResult[] }>(
|
||||||
'/integrations/tahesab/sync/search',
|
'/integrations/tahesab/sync/search',
|
||||||
body,
|
body,
|
||||||
{ timeout: 60_000 },
|
{ timeout: body.listAll ? 180_000 : 60_000 },
|
||||||
);
|
);
|
||||||
syncResults.value = data.results ?? [];
|
syncResults.value = data.results ?? [];
|
||||||
if (!syncResults.value.length) {
|
if (!syncResults.value.length) {
|
||||||
@@ -360,13 +364,12 @@ async function importBulk(mode: 'results' | 'range') {
|
|||||||
if (!fromRaw && !toRaw) {
|
if (!fromRaw && !toRaw) {
|
||||||
if (
|
if (
|
||||||
!confirm(
|
!confirm(
|
||||||
`کل مشتریان از کد ۱ تا ۵۰۰۰ از تهحساب بهعنوان شخص وارد ${brand.nameFa} میشوند. ادامه؟`,
|
`کل مشتریان قابلخواندن از تهحساب بهعنوان شخص وارد ${brand.nameFa} میشوند. ادامه؟`,
|
||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
body.fromCode = 1;
|
body.listAll = true;
|
||||||
body.toCode = 5000;
|
|
||||||
} else {
|
} else {
|
||||||
const fromCode = fromRaw ? Number(fromRaw) : 1;
|
const fromCode = fromRaw ? Number(fromRaw) : 1;
|
||||||
const toCode = toRaw ? Number(toRaw) : fromCode + 1999;
|
const toCode = toRaw ? Number(toRaw) : fromCode + 1999;
|
||||||
@@ -665,7 +668,7 @@ onMounted(load);
|
|||||||
<div class="sync-sub-section">
|
<div class="sync-sub-section">
|
||||||
<h4 class="sync-subhead">۱) وارد کردن دستهای با بازه کد مشتری</h4>
|
<h4 class="sync-subhead">۱) وارد کردن دستهای با بازه کد مشتری</h4>
|
||||||
<p class="sync-sub-desc">
|
<p class="sync-sub-desc">
|
||||||
در صورت خالی بودن «از» و «تا»، مشتریان کد ۱ تا ۵۰۰۰ بررسی میشوند (حداکثر ۲۰۰۰ کد در هر درخواست).
|
بازهٔ دستی حداکثر ۲۰۰۰ کد است. اگر «از» و «تا» خالی باشد، همهٔ مشتریان خوانده میشوند.
|
||||||
</p>
|
</p>
|
||||||
<div class="crm-form-grid-2">
|
<div class="crm-form-grid-2">
|
||||||
<UiInput v-model="sync.fromCode" type="number" min="1" dir="ltr" placeholder="از کد (مثلاً ۱)" />
|
<UiInput v-model="sync.fromCode" type="number" min="1" dir="ltr" placeholder="از کد (مثلاً ۱)" />
|
||||||
|
|||||||
Reference in New Issue
Block a user