fix(accounting): zarrin copy and sign notes match verified install
Zarrin v228 was tested on the real install (test account 953): negative balance = owes, and temporary documents move the balance at once. Update the admin copy and provider comments to match what was verified. پنل: متن راهنمای زرین بهروز شد: علامت مانده روی نصب واقعی بررسی شده است، و هشدار مربوط به ثبت سند موقت در «ثبت سفارش» اضافه شد. Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Haiku 5.5
parent
5b6207cd4f
commit
ea987b708f
@@ -32,9 +32,10 @@ import {
|
||||
* ACC-01: negative balance = owes; a «فاکتور موقت» moves the balance at once
|
||||
* (unlike Tahesab); listKarSakhte pages by 100 (pageNum); parvande opens with
|
||||
* a «مانده از قبل» row that is not a movement; goroohSakhte answers HTTP 400
|
||||
* with a good body; infogardeshsakhte answers malformed JSON. The writing
|
||||
* calls (addAccount, edithesab, foroushSakhte, hazfRadifSanad,
|
||||
* addFelezsakhteModel) are still unverified.
|
||||
* with a good body; infogardeshsakhte answers malformed JSON. Writes verified
|
||||
* the same day on test account 953 (addAccount, edithesab, foroushSakhte,
|
||||
* hazfRadifSanad); only addFelezsakhteModel is untested. Re-test with
|
||||
* scripts/test-accounting-zarrin.ts; the full list is in plan §13.
|
||||
*
|
||||
* Differences from Tahesab that shape the sync:
|
||||
* * No idempotency key on foroushSakhte. A timed-out document call cannot be
|
||||
@@ -270,7 +271,7 @@ function owesDelta(r: Record<string, unknown>) {
|
||||
}
|
||||
|
||||
function signed(s: ProviderSettings, v: Prisma.Decimal) {
|
||||
// Until checked on a real installation (plan §9) the sign is a setting.
|
||||
// v228: negative = owes (the default). Kept a setting in case another install differs.
|
||||
return (s.balanceOwesWhen ?? 'negative') === 'negative' ? v.negated() : v;
|
||||
}
|
||||
|
||||
@@ -375,7 +376,7 @@ export const zarrinProvider: AccountingProvider = {
|
||||
async getChanges(s, cursor) {
|
||||
// parLastTenRadif without an account is the newest rows of the whole
|
||||
// journal; each row names its account (idHesab) and has an ascending idRadif.
|
||||
// Not yet seen on a real install (ACC-01).
|
||||
// Seen working on v228 (plan §13).
|
||||
const rows = listOf(await call(s, 'parLastTenRadif', { limit: CHANGE_WINDOW }));
|
||||
let maxId = 0;
|
||||
for (const r of rows) maxId = Math.max(maxId, Number(r.idRadif) || 0);
|
||||
|
||||
Reference in New Issue
Block a user