fix(cashier): My Vouchers filters, Fund Transfer GL support, and disbursement-list rename
my-work.component (My Vouchers): - The five summary tiles (Received/Payments/Journal/Entered/Approved) were bound directly to the server's day-total fields, so they stayed fixed at the combined "entered + approved" figure no matter what the Side/My part dropdowns were set to. They're now pinned to this user's own entered rows only (enteredRows), independent of both filters, so "how much did I personally put through today" reads correctly regardless of what the table below happens to be filtered to. The table and its dropdowns are unchanged and still default to showing everything. transaction-entry.component (Fund Transfer): - onSave()'s plain bank-transfer branch (SD/CA/CB only) was catching every 'Fund Transfer' row before the GL-aware Disbursement/Collection branch below it could see them, so a Fund Transfer against a GL account was always rejected with "Invalid Account Type" even though that branch already supports it under the same label. Fund Transfer rows that include a GL leg now skip the plain-transfer branch and fall through correctly. my-disbursement-requests.component (Disbursements & Transfer list): - getCreditEntries() only read the stored credit_entries JSON, which holds the full picture for Collection (its GL leg is one of the entries) but not for Disbursement/Fund Transfer, whose GL is the request's own top-level source (gl_account_no/dr_amount) and was never in that array. The DR/CR breakdown for those two types showed only the credit side, looking like half the entry was missing. The GL leg is now synthesised back in as the first row for those two types, matching what actually posted. - Renamed the clerk's "My Disbursements" / "My Disbursement Requests" screen to "Disbursements & Transfer" throughout (nav tab, dropdown menu, route title/breadcrumb, cashier counter link, page header) — the register covers Disbursement, Collection, Fund Transfer and Bank Transfer requests, and the old name read as disbursement-only. "My Requests" (Withdrawal Slip requests, a separate register) is renamed to "Withdrawal Request" for the same reason: neither name said what was actually inside.
This commit is contained in:
@@ -2763,7 +2763,7 @@ export class TransactionEntryComponent implements OnInit, OnDestroy {
|
||||
this.showAlert('success', 'Bank Transfer Submitted', [
|
||||
`Voucher No: ${res.voucherNo}`,
|
||||
`Total: ₹${totalDr.toLocaleString('en-IN', { minimumFractionDigits: 2 })} · DR: ${drRows.length} account(s) → CR: ${crRows.length} account(s)`,
|
||||
'Pending Manager approval. Track status in "My Disbursement Requests".'
|
||||
'Pending Manager approval. Track status in "Disbursements & Transfer".'
|
||||
]);
|
||||
this.rows = [];
|
||||
this.rowAccountIds = {};
|
||||
@@ -4365,10 +4365,20 @@ export class TransactionEntryComponent implements OnInit, OnDestroy {
|
||||
// is the same flow under a second TYPE label — onTypChange() already defaults it identically to
|
||||
// 'Enter Bank Transfer', so submission has to recognise both or a share redemption or bank
|
||||
// transfer raised under this label silently falls through to the wrong branch below.
|
||||
//
|
||||
// But 'Fund Transfer' rows that include a GL leg are NOT this flow — they are the
|
||||
// Disbursement/Collection double-entry shape (see the TYPE options comment), just under the
|
||||
// friendlier 'Fund Transfer' label so a non-loan GL movement doesn't have to be called a
|
||||
// "Disbursement". 'Enter Bank Transfer' never carries a GL leg, so it always stays in this
|
||||
// branch; only skip out to the Disbursement/Collection branch below when every row is 'Fund
|
||||
// Transfer' and at least one of them is GL.
|
||||
const fundTransferRowsHaveGl =
|
||||
this.rows.every((r) => r.typ === 'Fund Transfer') && this.rows.some((r) => r.acTyp === 'GL');
|
||||
if (
|
||||
this.isClerk &&
|
||||
this.rows.length >= 2 &&
|
||||
this.rows.every((r) => r.typ === 'Enter Bank Transfer' || r.typ === 'Fund Transfer')
|
||||
this.rows.every((r) => r.typ === 'Enter Bank Transfer' || r.typ === 'Fund Transfer') &&
|
||||
!fundTransferRowsHaveGl
|
||||
) {
|
||||
const drRows = this.rows.filter((r) => r.dbCr === 'Dr');
|
||||
const crRows = this.rows.filter((r) => r.dbCr === 'Cr');
|
||||
|
||||
Reference in New Issue
Block a user