feat(cashier): offer DD in the cashier TYPE dropdown
The whole DD-against-cash path was already written and reachable only by a cashier -- isDdCashGlRow() gates on a cash payment type against a GL account, onSave() makes the cashier count Face Value + Charges + GST exactly and enforces the admin DD limit at intake, and buildDepositPayload() persists that breakdown so the Sponsor DD issuance screen reads it back after approval. None of it could be selected, because DD was missing from cashierTypOptions. Also adds the DD case to onTypChange, without which selecting DD set no defaults at all: it needs Cr (a draft is bought with cash, so money comes in), a cash payment type, and AC.TP = GL, which are the three things isDdCashGlRow() looks for. Missing any of them, the DD Charges & GST panel never appears and the row posts as an ordinary entry with the charges silently dropped. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1671,12 +1671,21 @@ export class TransactionEntryComponent implements OnInit, OnDestroy {
|
||||
{ value: 'DD', label: 'DD (Demand Draft)' }
|
||||
];
|
||||
|
||||
/** A cashier only ever takes cash in (Receipt) or pays cash out (Payment) — Cheque, DD,
|
||||
* Disbursement and Bank Transfer are clerk/back-office instruments with their own approval
|
||||
* flows and never appear at the cashier counter. */
|
||||
/**
|
||||
* A cashier takes cash in (Receipt), pays cash out (Payment), or collects the cash for a Demand
|
||||
* Draft (DD). Cheque, Disbursement and Bank Transfer stay clerk/back-office instruments with their
|
||||
* own approval flows and never appear at the cashier counter.
|
||||
*
|
||||
* DD belongs here because the whole DD-against-cash path is the cashier's: isDdCashGlRow() gates on
|
||||
* a cash payment type against a GL account, onSave() makes the cashier count Face Value + Charges
|
||||
* + GST exactly and enforces the admin DD limit at intake, and buildDepositPayload() persists that
|
||||
* breakdown so the Sponsor DD issuance screen can read it back after approval. All of that was
|
||||
* already written and reachable only by a cashier — it was just impossible to select.
|
||||
*/
|
||||
private readonly cashierTypOptions: { value: string; label: string }[] = [
|
||||
{ value: 'Receipt', label: 'Receipt' },
|
||||
{ value: 'Payment', label: 'Payment' }
|
||||
{ value: 'Payment', label: 'Payment' },
|
||||
{ value: 'DD', label: 'DD (Demand Draft)' }
|
||||
];
|
||||
|
||||
get typOptions(): { value: string; label: string }[] {
|
||||
@@ -2112,6 +2121,17 @@ export class TransactionEntryComponent implements OnInit, OnDestroy {
|
||||
row.chequeNo = '';
|
||||
row.cheqDate = '';
|
||||
break;
|
||||
// A DD is bought with cash: the customer hands over Face Value + Charges + GST, so it is money
|
||||
// coming IN (Cr) against the GL the draft is drawn on. All three of Cr, a cash payment type and
|
||||
// AC.TP = GL are what isDdCashGlRow() looks for -- without them the DD Charges & GST panel never
|
||||
// appears and the row would post as an ordinary entry with the charges silently dropped.
|
||||
case 'DD':
|
||||
row.dbCr = 'Cr';
|
||||
row.paymentTypeId = this.findCashPaymentTypeId();
|
||||
row.acTyp = 'GL';
|
||||
row.chequeNo = '';
|
||||
row.cheqDate = '';
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user