Fix asnad via root POST like Hamkar; show accounting code label.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -84,9 +84,9 @@ export class TahesabDocumentsService {
|
|||||||
);
|
);
|
||||||
const link = await this.requireLink(organizationId, personId, resolvedId);
|
const link = await this.requireLink(organizationId, personId, resolvedId);
|
||||||
const { api } = await this.connections.getApi(organizationId, resolvedId);
|
const { api } = await this.connections.getApi(organizationId, resolvedId);
|
||||||
// Count_Last = -1 مثل همکار (مانده ردیفبهردیف / همه در بازه)
|
// Count_Last مثل تستهای همکار (۲۰۰) — مقدار ۱- گاهی سمت تهحساب خطا/۵۰۲ میدهد
|
||||||
const raw = await api.doListAsnad(
|
const raw = await api.doListAsnad(
|
||||||
-1,
|
200,
|
||||||
link.moshtariCode,
|
link.moshtariCode,
|
||||||
fromNorm,
|
fromNorm,
|
||||||
toNorm,
|
toNorm,
|
||||||
|
|||||||
@@ -224,15 +224,37 @@ export class TahesabApi {
|
|||||||
fromShamsi: string,
|
fromShamsi: string,
|
||||||
toShamsi: string,
|
toShamsi: string,
|
||||||
) {
|
) {
|
||||||
// مثل همکار: فقط ۴ پارامتر (Count_Last, Code, از, تا) — پارامتر اضافه باعث خطای تهحساب میشود
|
// همکار: POST به baseUrl بدون path، با کلید body = DoListAsnad و ۴ آرگومان
|
||||||
return this.call(
|
const args = [countLast, moshtariCode, fromShamsi, toShamsi];
|
||||||
'DoListAsnad',
|
const empty = { emptyResultOnError: /رکوردی یافت نشد/i };
|
||||||
'DoListAsnad',
|
const timeoutMs = 55_000;
|
||||||
[countLast, moshtariCode, fromShamsi, toShamsi],
|
const rootCall = () =>
|
||||||
'POST',
|
this.http.call({
|
||||||
55_000,
|
...this.creds,
|
||||||
{ emptyResultOnError: /رکوردی یافت نشد/i },
|
path: '',
|
||||||
);
|
bodyKey: 'DoListAsnad',
|
||||||
|
args,
|
||||||
|
method: 'POST' as const,
|
||||||
|
timeoutMs,
|
||||||
|
...empty,
|
||||||
|
});
|
||||||
|
const pathCall = () =>
|
||||||
|
this.http.call({
|
||||||
|
...this.creds,
|
||||||
|
path: 'DoListAsnad',
|
||||||
|
bodyKey: 'DoListAsnad',
|
||||||
|
args,
|
||||||
|
method: 'POST' as const,
|
||||||
|
timeoutMs,
|
||||||
|
...empty,
|
||||||
|
});
|
||||||
|
return rootCall().catch(async (err) => {
|
||||||
|
try {
|
||||||
|
return await pathCall();
|
||||||
|
} catch {
|
||||||
|
throw err;
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
doListNameSekeh() {
|
doListNameSekeh() {
|
||||||
|
|||||||
@@ -584,9 +584,9 @@ watch(() => route.query.tab, readTab, { immediate: true });
|
|||||||
<div class="who">
|
<div class="who">
|
||||||
<h2>
|
<h2>
|
||||||
{{ fullName }}
|
{{ fullName }}
|
||||||
<span v-if="tahesabMoshtariCode != null" class="tahesab-code" dir="ltr">{{
|
<span v-if="tahesabMoshtariCode != null" class="tahesab-code" dir="rtl"
|
||||||
tahesabMoshtariCode
|
>کد حسابداری {{ toFaDigits(String(tahesabMoshtariCode)) }}</span
|
||||||
}}</span>
|
>
|
||||||
<span v-if="vip" class="vip-mark">VIP</span>
|
<span v-if="vip" class="vip-mark">VIP</span>
|
||||||
</h2>
|
</h2>
|
||||||
<p v-if="subtitle" class="sub">{{ subtitle }}</p>
|
<p v-if="subtitle" class="sub">{{ subtitle }}</p>
|
||||||
@@ -622,9 +622,9 @@ watch(() => route.query.tab, readTab, { immediate: true });
|
|||||||
<div class="who">
|
<div class="who">
|
||||||
<h2>
|
<h2>
|
||||||
{{ fullName }}
|
{{ fullName }}
|
||||||
<span v-if="tahesabMoshtariCode != null" class="tahesab-code" dir="ltr">{{
|
<span v-if="tahesabMoshtariCode != null" class="tahesab-code" dir="rtl"
|
||||||
tahesabMoshtariCode
|
>کد حسابداری {{ toFaDigits(String(tahesabMoshtariCode)) }}</span
|
||||||
}}</span>
|
>
|
||||||
</h2>
|
</h2>
|
||||||
<p v-if="subtitle" class="sub">{{ subtitle }}</p>
|
<p v-if="subtitle" class="sub">{{ subtitle }}</p>
|
||||||
</div>
|
</div>
|
||||||
@@ -1096,13 +1096,13 @@ watch(() => route.query.tab, readTab, { immediate: true });
|
|||||||
}
|
}
|
||||||
|
|
||||||
.tahesab-code {
|
.tahesab-code {
|
||||||
font-size: 0.85rem;
|
font-size: 0.78rem;
|
||||||
font-weight: 700;
|
font-weight: 700;
|
||||||
color: #0f766e;
|
color: #0f766e;
|
||||||
background: color-mix(in srgb, #0f766e 12%, transparent);
|
background: color-mix(in srgb, #0f766e 12%, transparent);
|
||||||
border-radius: 8px;
|
border-radius: 8px;
|
||||||
padding: 0.1rem 0.45rem;
|
padding: 0.12rem 0.5rem;
|
||||||
letter-spacing: 0.02em;
|
letter-spacing: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.sub {
|
.sub {
|
||||||
|
|||||||
Reference in New Issue
Block a user