jaz-cli 2.6.0 → 2.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/skills/api/SKILL.md +12 -2
- package/assets/skills/api/references/dependencies.md +3 -2
- package/assets/skills/api/references/endpoints.md +78 -0
- package/assets/skills/api/references/feature-glossary.md +4 -4
- package/assets/skills/api/references/field-map.md +17 -0
- package/assets/skills/api/references/full-api-surface.md +1 -1
- package/assets/skills/conversion/SKILL.md +1 -1
- package/assets/skills/jobs/SKILL.md +104 -0
- package/assets/skills/jobs/references/audit-prep.md +319 -0
- package/assets/skills/jobs/references/bank-recon.md +234 -0
- package/assets/skills/jobs/references/building-blocks.md +135 -0
- package/assets/skills/jobs/references/credit-control.md +273 -0
- package/assets/skills/jobs/references/fa-review.md +267 -0
- package/assets/skills/jobs/references/gst-vat-filing.md +250 -0
- package/assets/skills/jobs/references/month-end-close.md +308 -0
- package/assets/skills/jobs/references/payment-run.md +246 -0
- package/assets/skills/jobs/references/quarter-end-close.md +268 -0
- package/assets/skills/jobs/references/supplier-recon.md +330 -0
- package/assets/skills/jobs/references/year-end-close.md +341 -0
- package/assets/skills/transaction-recipes/SKILL.md +1 -1
- package/dist/__tests__/amortization.test.js +101 -0
- package/dist/__tests__/asset-disposal.test.js +249 -0
- package/dist/__tests__/blueprint.test.js +72 -0
- package/dist/__tests__/depreciation.test.js +125 -0
- package/dist/__tests__/ecl.test.js +134 -0
- package/dist/__tests__/fixed-deposit.test.js +214 -0
- package/dist/__tests__/fx-reval.test.js +115 -0
- package/dist/__tests__/jobs-audit-prep.test.js +125 -0
- package/dist/__tests__/jobs-bank-recon.test.js +108 -0
- package/dist/__tests__/jobs-credit-control.test.js +98 -0
- package/dist/__tests__/jobs-fa-review.test.js +104 -0
- package/dist/__tests__/jobs-gst-vat.test.js +113 -0
- package/dist/__tests__/jobs-month-end.test.js +162 -0
- package/dist/__tests__/jobs-payment-run.test.js +106 -0
- package/dist/__tests__/jobs-quarter-end.test.js +155 -0
- package/dist/__tests__/jobs-supplier-recon.test.js +115 -0
- package/dist/__tests__/jobs-validate.test.js +181 -0
- package/dist/__tests__/jobs-year-end.test.js +149 -0
- package/dist/__tests__/lease.test.js +96 -0
- package/dist/__tests__/loan.test.js +80 -0
- package/dist/__tests__/provision.test.js +141 -0
- package/dist/__tests__/validate.test.js +81 -0
- package/dist/calc/asset-disposal.js +17 -13
- package/dist/calc/fixed-deposit.js +26 -17
- package/dist/calc/lease.js +7 -3
- package/dist/commands/jobs.js +184 -0
- package/dist/index.js +2 -0
- package/dist/jobs/audit-prep.js +211 -0
- package/dist/jobs/bank-recon.js +163 -0
- package/dist/jobs/credit-control.js +126 -0
- package/dist/jobs/fa-review.js +121 -0
- package/dist/jobs/format.js +102 -0
- package/dist/jobs/gst-vat.js +187 -0
- package/dist/jobs/month-end.js +232 -0
- package/dist/jobs/payment-run.js +199 -0
- package/dist/jobs/quarter-end.js +135 -0
- package/dist/jobs/supplier-recon.js +132 -0
- package/dist/jobs/types.js +36 -0
- package/dist/jobs/validate.js +115 -0
- package/dist/jobs/year-end.js +153 -0
- package/dist/types/index.js +2 -1
- package/package.json +5 -2
|
@@ -0,0 +1,308 @@
|
|
|
1
|
+
# Month-End Close
|
|
2
|
+
|
|
3
|
+
The monthly close is the foundation of accurate books. For an SMB, this typically takes 1-3 days depending on transaction volume and complexity. Every quarter-end and year-end builds on this.
|
|
4
|
+
|
|
5
|
+
**CLI:** `jaz jobs month-end --period 2025-01 [--currency SGD] [--json]`
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Phase 1: Pre-Close Preparation
|
|
10
|
+
|
|
11
|
+
Before adjusting anything, ensure the raw data is complete. These are verification steps — you're checking, not creating.
|
|
12
|
+
|
|
13
|
+
### Step 1: Verify all sales invoices are entered
|
|
14
|
+
|
|
15
|
+
Confirm every invoice issued during the period is in Jaz.
|
|
16
|
+
|
|
17
|
+
```
|
|
18
|
+
POST /invoices/search
|
|
19
|
+
{
|
|
20
|
+
"filter": { "valueDate": { "between": ["2025-01-01", "2025-01-31"] } },
|
|
21
|
+
"sort": { "sortBy": ["valueDate"], "order": "ASC" },
|
|
22
|
+
"limit": 1000
|
|
23
|
+
}
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
**What to check:** Compare the count and total against your sales records or POS system. Missing invoices = understated revenue.
|
|
27
|
+
|
|
28
|
+
### Step 2: Verify all purchase bills are entered
|
|
29
|
+
|
|
30
|
+
Confirm every bill received during the period is in Jaz. For SMBs, this is the most common gap — bills arrive late or sit in someone's inbox.
|
|
31
|
+
|
|
32
|
+
```
|
|
33
|
+
POST /bills/search
|
|
34
|
+
{
|
|
35
|
+
"filter": { "valueDate": { "between": ["2025-01-01", "2025-01-31"] } },
|
|
36
|
+
"sort": { "sortBy": ["valueDate"], "order": "ASC" },
|
|
37
|
+
"limit": 1000
|
|
38
|
+
}
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
**What to check:** Cross-reference against email, supplier portals, and physical mail. Late bills → missed expenses → overstated profit.
|
|
42
|
+
|
|
43
|
+
**Tip:** If you have the bill document but haven't entered it yet, use **Jaz Magic** (`POST /magic/createBusinessTransactionFromAttachment`) — upload the PDF/JPG and let extraction & autofill handle it.
|
|
44
|
+
|
|
45
|
+
### Step 3: Complete bank reconciliation
|
|
46
|
+
|
|
47
|
+
This is the single most important pre-close step. Every bank account must be reconciled to its statement closing balance.
|
|
48
|
+
|
|
49
|
+
```
|
|
50
|
+
POST /bank-records/{accountResourceId}/search
|
|
51
|
+
{
|
|
52
|
+
"filter": { "status": { "eq": "UNRECONCILED" } },
|
|
53
|
+
"sort": { "sortBy": ["valueDate"], "order": "ASC" },
|
|
54
|
+
"limit": 1000
|
|
55
|
+
}
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
**What to check:**
|
|
59
|
+
- All unreconciled items are genuine timing differences (outstanding cheques, deposits in transit)
|
|
60
|
+
- No items older than 30 days (investigate and resolve)
|
|
61
|
+
- Book balance per Jaz matches bank statement closing balance
|
|
62
|
+
|
|
63
|
+
**See also:** `references/bank-recon.md` for the full bank reconciliation catch-up job.
|
|
64
|
+
|
|
65
|
+
### Step 4: Review AR aging
|
|
66
|
+
|
|
67
|
+
Identify overdue customer invoices. This feeds into credit control and bad debt assessment.
|
|
68
|
+
|
|
69
|
+
```
|
|
70
|
+
POST /generate-reports/ar-report
|
|
71
|
+
{ "endDate": "2025-01-31" }
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
**What to check:**
|
|
75
|
+
- Total AR ties to Accounts Receivable on trial balance
|
|
76
|
+
- Flag invoices overdue > 30/60/90 days
|
|
77
|
+
- Consider bad debt provision if material (→ Phase 3)
|
|
78
|
+
|
|
79
|
+
### Step 5: Review AP aging
|
|
80
|
+
|
|
81
|
+
Identify upcoming and overdue supplier payments. This feeds into payment planning.
|
|
82
|
+
|
|
83
|
+
```
|
|
84
|
+
POST /generate-reports/ap-report
|
|
85
|
+
{ "endDate": "2025-01-31" }
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
**What to check:**
|
|
89
|
+
- Total AP ties to Accounts Payable on trial balance
|
|
90
|
+
- Identify bills due in the next 7-14 days for the payment run
|
|
91
|
+
- Flag any disputed or held bills
|
|
92
|
+
|
|
93
|
+
---
|
|
94
|
+
|
|
95
|
+
## Phase 2: Accruals & Adjustments
|
|
96
|
+
|
|
97
|
+
Record transactions that belong to this period but aren't yet in the books. This is where recipes come in.
|
|
98
|
+
|
|
99
|
+
### Step 6: Record accrued expenses
|
|
100
|
+
|
|
101
|
+
Expenses incurred but not yet billed (utilities, professional services, cleaning, etc.). The most common month-end adjustment for SMBs.
|
|
102
|
+
|
|
103
|
+
**Recipe:** `accrued-expenses`
|
|
104
|
+
**Pattern:** DR Expense, CR Accrued Liabilities → reverse on Day 1 of next month
|
|
105
|
+
|
|
106
|
+
```
|
|
107
|
+
POST /journals
|
|
108
|
+
{
|
|
109
|
+
"valueDate": "2025-01-31",
|
|
110
|
+
"reference": "ME-ACCR-JAN25",
|
|
111
|
+
"journalEntries": [
|
|
112
|
+
{ "accountResourceId": "<expense-account>", "amount": 500.00, "type": "DEBIT", "name": "Electricity accrual — Jan 2025" },
|
|
113
|
+
{ "accountResourceId": "<accrued-liabilities>", "amount": 500.00, "type": "CREDIT", "name": "Electricity accrual — Jan 2025" }
|
|
114
|
+
]
|
|
115
|
+
}
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
**Conditional:** Only if there are expenses not yet billed for the period. Common examples: utilities, internet, cleaning, accounting fees.
|
|
119
|
+
|
|
120
|
+
### Step 7: Amortize prepaid expenses
|
|
121
|
+
|
|
122
|
+
If you've set up prepaid expense capsules with schedulers, verify the scheduler fired for this month. If not, post the amortization journal manually.
|
|
123
|
+
|
|
124
|
+
**Recipe:** `prepaid-amortization` | **Calculator:** `jaz calc prepaid-expense`
|
|
125
|
+
**Pattern:** DR Expense, CR Prepaid Asset
|
|
126
|
+
|
|
127
|
+
**Verification:** Search for journals in the prepaid capsule for this period:
|
|
128
|
+
```
|
|
129
|
+
POST /journals/search
|
|
130
|
+
{
|
|
131
|
+
"filter": {
|
|
132
|
+
"valueDate": { "between": ["2025-01-01", "2025-01-31"] }
|
|
133
|
+
},
|
|
134
|
+
"sort": { "sortBy": ["valueDate"], "order": "DESC" },
|
|
135
|
+
"limit": 100
|
|
136
|
+
}
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
Filter results by capsule name (e.g., "FY2025 Office Insurance") to confirm the entry exists.
|
|
140
|
+
|
|
141
|
+
### Step 8: Recognize deferred revenue
|
|
142
|
+
|
|
143
|
+
If you've received upfront payments that should be recognized over time, verify the scheduler fired or post manually.
|
|
144
|
+
|
|
145
|
+
**Recipe:** `deferred-revenue` | **Calculator:** `jaz calc deferred-revenue`
|
|
146
|
+
**Pattern:** DR Deferred Revenue (liability), CR Revenue
|
|
147
|
+
|
|
148
|
+
**Conditional:** Only if your business has subscription or prepaid revenue models.
|
|
149
|
+
|
|
150
|
+
### Step 9: Record depreciation
|
|
151
|
+
|
|
152
|
+
For fixed assets, record the monthly depreciation charge. Jaz supports straight-line natively via fixed assets. For declining balance or 150DB methods, use the calculator and post manual journals.
|
|
153
|
+
|
|
154
|
+
**Recipe:** `declining-balance` | **Calculator:** `jaz calc depreciation`
|
|
155
|
+
**Pattern:** DR Depreciation Expense, CR Accumulated Depreciation
|
|
156
|
+
|
|
157
|
+
**If using native Jaz FA depreciation:** Verify auto-calculated depreciation is running correctly via the FA register.
|
|
158
|
+
**If using non-standard methods:** Post manual journal from calculator output.
|
|
159
|
+
|
|
160
|
+
### Step 10: Accrue employee benefits
|
|
161
|
+
|
|
162
|
+
Record monthly leave accrual. If using a scheduler, verify it fired.
|
|
163
|
+
|
|
164
|
+
**Recipe:** `employee-accruals`
|
|
165
|
+
**Pattern:** DR Leave Expense, CR Leave Liability (monthly fixed amount from scheduler)
|
|
166
|
+
|
|
167
|
+
**Conditional:** Only if you track leave balances. Most SMBs with 5+ employees should.
|
|
168
|
+
|
|
169
|
+
### Step 11: Accrue loan interest
|
|
170
|
+
|
|
171
|
+
If you have bank loans, verify the interest portion of this month's payment is correctly recorded. If payments are embedded in bill/cash-out entries, this may already be handled.
|
|
172
|
+
|
|
173
|
+
**Recipe:** `bank-loan` | **Calculator:** `jaz calc loan`
|
|
174
|
+
**Pattern:** Interest splits from principal in each payment — verify the amortization table matches.
|
|
175
|
+
|
|
176
|
+
**Conditional:** Only if you have active loans. Skip if loan payments are already correctly coded.
|
|
177
|
+
|
|
178
|
+
---
|
|
179
|
+
|
|
180
|
+
## Phase 3: Period-End Valuations
|
|
181
|
+
|
|
182
|
+
Adjustments that depend on period-end rates or balances. These are less common for simple SMBs but critical for accuracy.
|
|
183
|
+
|
|
184
|
+
### Step 12: FX revaluation
|
|
185
|
+
|
|
186
|
+
If your org has foreign currency monetary items (bank accounts, receivables, payables in non-base currency), revalue them at period-end exchange rates.
|
|
187
|
+
|
|
188
|
+
**Recipe:** `fx-revaluation` | **Calculator:** `jaz calc fx-reval`
|
|
189
|
+
**Pattern:** DR/CR FX Unrealized Gain/Loss for the difference between book rate and closing rate. Post a Day 1 reversal.
|
|
190
|
+
|
|
191
|
+
```bash
|
|
192
|
+
jaz calc fx-reval --amount 50000 --book-rate 1.35 --closing-rate 1.38 --currency USD --base-currency SGD
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
**Conditional:** Only if multi-currency org with material foreign currency balances. Many SGD-only SMBs can skip this.
|
|
196
|
+
|
|
197
|
+
**Note:** Jaz auto-handles FX on AR/AP (invoices/bills in foreign currency). This step is for non-AR/AP items only (foreign currency bank accounts, deposits, intercompany balances).
|
|
198
|
+
|
|
199
|
+
### Step 13: Review bad debt provision (ECL)
|
|
200
|
+
|
|
201
|
+
Assess whether the bad debt provision needs adjusting based on the AR aging report from Step 4.
|
|
202
|
+
|
|
203
|
+
**Recipe:** `bad-debt-provision` | **Calculator:** `jaz calc ecl`
|
|
204
|
+
**Pattern:** DR Bad Debt Expense, CR Allowance for Doubtful Debts
|
|
205
|
+
|
|
206
|
+
```bash
|
|
207
|
+
jaz calc ecl --current 100000 --30d 50000 --60d 20000 --90d 10000 --120d 5000 --rates 0.5,2,5,10,50
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
**Conditional:** Review monthly, but typically adjust quarterly unless there's a significant change (e.g., major customer default). For most SMBs, a quick mental check is sufficient monthly — formal ECL review in quarter-end.
|
|
211
|
+
|
|
212
|
+
---
|
|
213
|
+
|
|
214
|
+
## Phase 4: Verification
|
|
215
|
+
|
|
216
|
+
Run the numbers. Everything should tie.
|
|
217
|
+
|
|
218
|
+
### Step 14: Review trial balance
|
|
219
|
+
|
|
220
|
+
The master check. Total debits must equal total credits.
|
|
221
|
+
|
|
222
|
+
```
|
|
223
|
+
POST /generate-reports/trial-balance
|
|
224
|
+
{ "startDate": "2025-01-01", "endDate": "2025-01-31" }
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
**What to check:**
|
|
228
|
+
- Debits = Credits (always — if not, something is seriously wrong)
|
|
229
|
+
- Cash/bank accounts match bank statements
|
|
230
|
+
- AR balance matches AR aging total from Step 4
|
|
231
|
+
- AP balance matches AP aging total from Step 5
|
|
232
|
+
- No unexpected balances (negative cash, credit balances in expense accounts)
|
|
233
|
+
|
|
234
|
+
### Step 15: Generate P&L
|
|
235
|
+
|
|
236
|
+
```
|
|
237
|
+
POST /generate-reports/profit-and-loss
|
|
238
|
+
{ "primarySnapshotDate": "2025-01-31", "secondarySnapshotDate": "2025-01-01" }
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
**What to check:**
|
|
242
|
+
- Revenue is in line with expectations
|
|
243
|
+
- Expenses make sense for the month
|
|
244
|
+
- Gross margin is reasonable
|
|
245
|
+
- Any large one-off items should be explainable (accruals, adjustments from Phase 2)
|
|
246
|
+
|
|
247
|
+
### Step 16: Generate balance sheet
|
|
248
|
+
|
|
249
|
+
```
|
|
250
|
+
POST /generate-reports/balance-sheet
|
|
251
|
+
{ "primarySnapshotDate": "2025-01-31" }
|
|
252
|
+
```
|
|
253
|
+
|
|
254
|
+
**What to check:**
|
|
255
|
+
- Assets = Liabilities + Equity (by definition — if not, the API has a bug)
|
|
256
|
+
- Cash position is reasonable
|
|
257
|
+
- Prepaid balances reduced by one month's amortization
|
|
258
|
+
- Accrued liabilities reflect the accruals from Phase 2
|
|
259
|
+
|
|
260
|
+
### Step 17: Compare to prior month
|
|
261
|
+
|
|
262
|
+
Run the same P&L for the prior month and compare. Significant variances should be explainable.
|
|
263
|
+
|
|
264
|
+
```
|
|
265
|
+
POST /generate-reports/profit-and-loss
|
|
266
|
+
{ "primarySnapshotDate": "2024-12-31", "secondarySnapshotDate": "2024-12-01" }
|
|
267
|
+
```
|
|
268
|
+
|
|
269
|
+
**Flag:** Revenue or expense lines that moved > 20% month-over-month without a clear reason.
|
|
270
|
+
|
|
271
|
+
---
|
|
272
|
+
|
|
273
|
+
## Phase 5: Close & Lock
|
|
274
|
+
|
|
275
|
+
Once everything checks out, lock the period to prevent accidental backdated entries.
|
|
276
|
+
|
|
277
|
+
### Step 18: Set lock date
|
|
278
|
+
|
|
279
|
+
Move the org lock date forward to the last day of the closed month.
|
|
280
|
+
|
|
281
|
+
**Best practice:** Lock date = last day of the closed period (e.g., `2025-01-31` after January close).
|
|
282
|
+
|
|
283
|
+
**Important:** Only move the lock date forward. Moving it backward reopens prior periods — do this only if you need to post corrections (and re-close afterward).
|
|
284
|
+
|
|
285
|
+
---
|
|
286
|
+
|
|
287
|
+
## Month-End Close Checklist (Quick Reference)
|
|
288
|
+
|
|
289
|
+
| # | Step | Phase | Conditional | Recipe/Calc |
|
|
290
|
+
|---|------|-------|-------------|-------------|
|
|
291
|
+
| 1 | Verify invoices entered | Pre-close | Always | — |
|
|
292
|
+
| 2 | Verify bills entered | Pre-close | Always | — |
|
|
293
|
+
| 3 | Complete bank reconciliation | Pre-close | Always | bank-recon job |
|
|
294
|
+
| 4 | Review AR aging | Pre-close | Always | — |
|
|
295
|
+
| 5 | Review AP aging | Pre-close | Always | — |
|
|
296
|
+
| 6 | Record accrued expenses | Accruals | If unbilled expenses exist | accrued-expenses |
|
|
297
|
+
| 7 | Amortize prepaid expenses | Accruals | If prepaid capsules exist | prepaid-amortization / `jaz calc prepaid-expense` |
|
|
298
|
+
| 8 | Recognize deferred revenue | Accruals | If deferred revenue exists | deferred-revenue / `jaz calc deferred-revenue` |
|
|
299
|
+
| 9 | Record depreciation | Accruals | If fixed assets exist | declining-balance / `jaz calc depreciation` |
|
|
300
|
+
| 10 | Accrue employee benefits | Accruals | If tracking leave | employee-accruals |
|
|
301
|
+
| 11 | Accrue loan interest | Accruals | If active loans | bank-loan / `jaz calc loan` |
|
|
302
|
+
| 12 | FX revaluation | Valuations | If multi-currency | fx-revaluation / `jaz calc fx-reval` |
|
|
303
|
+
| 13 | Review bad debt provision | Valuations | If material AR change | bad-debt-provision / `jaz calc ecl` |
|
|
304
|
+
| 14 | Review trial balance | Verification | Always | — |
|
|
305
|
+
| 15 | Generate P&L | Verification | Always | — |
|
|
306
|
+
| 16 | Generate balance sheet | Verification | Always | — |
|
|
307
|
+
| 17 | Compare to prior month | Verification | Always | — |
|
|
308
|
+
| 18 | Set lock date | Close | Always | — |
|
|
@@ -0,0 +1,246 @@
|
|
|
1
|
+
# Payment Run (Bulk Bill Payments)
|
|
2
|
+
|
|
3
|
+
Process outstanding supplier bills in a structured batch. A payment run typically happens weekly or fortnightly — you identify what's due, group by supplier, approve the batch, and record the payments. This keeps supplier relationships healthy and avoids late payment penalties.
|
|
4
|
+
|
|
5
|
+
**CLI:** `jaz jobs payment-run [--due-before 2025-02-28] [--json]`
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Phase 1: Identify Outstanding Bills
|
|
10
|
+
|
|
11
|
+
### Step 1: List all unpaid bills
|
|
12
|
+
|
|
13
|
+
Pull every posted bill with an outstanding balance:
|
|
14
|
+
|
|
15
|
+
```
|
|
16
|
+
POST /api/v1/bills/search
|
|
17
|
+
{
|
|
18
|
+
"filter": {
|
|
19
|
+
"status": { "eq": "POSTED" },
|
|
20
|
+
"balanceAmount": { "gt": 0 }
|
|
21
|
+
},
|
|
22
|
+
"sort": { "sortBy": ["dueDate"], "order": "ASC" },
|
|
23
|
+
"limit": 1000
|
|
24
|
+
}
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
**What you get:** All unpaid bills sorted by due date (earliest first). Each result includes `balanceAmount` (remaining unpaid), `totalAmount` (original), `dueDate`, and contact details.
|
|
28
|
+
|
|
29
|
+
### Step 2: Filter by due date
|
|
30
|
+
|
|
31
|
+
If `--due-before` is specified, narrow to bills due on or before that date:
|
|
32
|
+
|
|
33
|
+
```
|
|
34
|
+
POST /api/v1/bills/search
|
|
35
|
+
{
|
|
36
|
+
"filter": {
|
|
37
|
+
"status": { "eq": "POSTED" },
|
|
38
|
+
"balanceAmount": { "gt": 0 },
|
|
39
|
+
"dueDate": { "lte": "2025-02-28" }
|
|
40
|
+
},
|
|
41
|
+
"sort": { "sortBy": ["dueDate"], "order": "ASC" },
|
|
42
|
+
"limit": 1000
|
|
43
|
+
}
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
**Tip:** Include bills due in the next 7 days beyond your cutoff — paying a few days early is better than missing one because it was due the day after your run.
|
|
47
|
+
|
|
48
|
+
---
|
|
49
|
+
|
|
50
|
+
## Phase 2: Group and Summarize
|
|
51
|
+
|
|
52
|
+
### Step 3: Group by supplier
|
|
53
|
+
|
|
54
|
+
Organize the bills by `contactResourceId`. For each supplier, summarize:
|
|
55
|
+
|
|
56
|
+
- Number of bills
|
|
57
|
+
- Total amount due
|
|
58
|
+
- Earliest due date
|
|
59
|
+
- Currency (important for FX payments)
|
|
60
|
+
|
|
61
|
+
**Why group:** Suppliers prefer a single consolidated payment over multiple small ones. It also reduces bank transaction fees for the payer.
|
|
62
|
+
|
|
63
|
+
### Step 4: Generate AP aging for context
|
|
64
|
+
|
|
65
|
+
```
|
|
66
|
+
POST /api/v1/generate-reports/ap-report
|
|
67
|
+
{ "endDate": "2025-02-28" }
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
**What to check:**
|
|
71
|
+
- Total AP aging should match the sum of all unpaid bills from Step 1
|
|
72
|
+
- Identify any bills in the 60d+ aging buckets — these are overdue and may need priority payment or dispute resolution
|
|
73
|
+
- Flag disputed bills (do NOT include them in the payment run)
|
|
74
|
+
|
|
75
|
+
---
|
|
76
|
+
|
|
77
|
+
## Phase 3: Select and Approve
|
|
78
|
+
|
|
79
|
+
### Step 5: Build the payment batch
|
|
80
|
+
|
|
81
|
+
Select which bills to pay. Three common approaches:
|
|
82
|
+
|
|
83
|
+
**All-due:** Pay everything due on or before the cutoff date. Simplest, works for most SMBs.
|
|
84
|
+
|
|
85
|
+
**Priority-based:** Pay overdue first (60d+, then 30d+), then current. Useful when cash is tight.
|
|
86
|
+
|
|
87
|
+
**Supplier-based:** Pay strategic suppliers first (sole suppliers, key relationships), then others. Business judgment call.
|
|
88
|
+
|
|
89
|
+
**Before proceeding:** Confirm cash availability. Check the bank balance:
|
|
90
|
+
|
|
91
|
+
```
|
|
92
|
+
POST /api/v1/generate-reports/bank-balance-summary
|
|
93
|
+
{ "primarySnapshotDate": "2025-02-28" }
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
If total payments exceed available cash, prioritize and defer the rest to the next run.
|
|
97
|
+
|
|
98
|
+
---
|
|
99
|
+
|
|
100
|
+
## Phase 4: Record Payments
|
|
101
|
+
|
|
102
|
+
### Step 6: Record payment for each bill
|
|
103
|
+
|
|
104
|
+
For each bill in the approved batch, record the payment:
|
|
105
|
+
|
|
106
|
+
```
|
|
107
|
+
POST /api/v1/bills/{billResourceId}/payments
|
|
108
|
+
{
|
|
109
|
+
"payments": [{
|
|
110
|
+
"paymentAmount": 5350.00,
|
|
111
|
+
"transactionAmount": 5350.00,
|
|
112
|
+
"accountResourceId": "<bank-account-uuid>",
|
|
113
|
+
"paymentMethod": "BANK_TRANSFER",
|
|
114
|
+
"reference": "PAYRUN-2025-02-28-001",
|
|
115
|
+
"valueDate": "2025-02-28"
|
|
116
|
+
}]
|
|
117
|
+
}
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
**CRITICAL field notes:**
|
|
121
|
+
- `paymentAmount` — The amount leaving the bank account (bank currency)
|
|
122
|
+
- `transactionAmount` — The amount applied to the bill balance (bill currency). Same as `paymentAmount` for same-currency. Different for FX (see below).
|
|
123
|
+
- `accountResourceId` — The bank account UUID (NOT the expense account)
|
|
124
|
+
- `paymentMethod` — Use `"BANK_TRANSFER"` for electronic payments. Other options: `"CHEQUE"`, `"CASH"`, `"CREDIT_CARD"`, `"E_WALLET"`
|
|
125
|
+
- `reference` — Use a consistent naming convention (e.g., `PAYRUN-{date}-{seq}`)
|
|
126
|
+
- `valueDate` — The date the payment is made (YYYY-MM-DD format)
|
|
127
|
+
|
|
128
|
+
Always wrap in `{ "payments": [...] }` even for a single payment.
|
|
129
|
+
|
|
130
|
+
**Note:** There is no batch payment endpoint yet. Each bill requires an individual `POST /bills/{id}/payments` call. If you're paying 50 bills, that's 50 API calls. The batch endpoint is planned but not yet available.
|
|
131
|
+
|
|
132
|
+
### Step 7: Partial payments
|
|
133
|
+
|
|
134
|
+
If paying less than the full balance (e.g., cash constraints or instalment arrangement), set `paymentAmount` and `transactionAmount` to the partial amount. The bill remains in `POSTED` status with a reduced `balanceAmount`.
|
|
135
|
+
|
|
136
|
+
```
|
|
137
|
+
POST /api/v1/bills/{billResourceId}/payments
|
|
138
|
+
{
|
|
139
|
+
"payments": [{
|
|
140
|
+
"paymentAmount": 2000.00,
|
|
141
|
+
"transactionAmount": 2000.00,
|
|
142
|
+
"accountResourceId": "<bank-account-uuid>",
|
|
143
|
+
"paymentMethod": "BANK_TRANSFER",
|
|
144
|
+
"reference": "PAYRUN-2025-02-28-PARTIAL",
|
|
145
|
+
"valueDate": "2025-02-28"
|
|
146
|
+
}]
|
|
147
|
+
}
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
---
|
|
151
|
+
|
|
152
|
+
## Phase 5: FX Payments
|
|
153
|
+
|
|
154
|
+
**Conditional:** Only if paying bills in a non-base currency.
|
|
155
|
+
|
|
156
|
+
### Step 8: Record FX payment
|
|
157
|
+
|
|
158
|
+
When paying a foreign currency bill from a base currency bank account (e.g., paying a USD bill from an SGD account):
|
|
159
|
+
|
|
160
|
+
```
|
|
161
|
+
POST /api/v1/bills/{billResourceId}/payments
|
|
162
|
+
{
|
|
163
|
+
"payments": [{
|
|
164
|
+
"paymentAmount": 6750.00,
|
|
165
|
+
"transactionAmount": 5000.00,
|
|
166
|
+
"accountResourceId": "<sgd-bank-account-uuid>",
|
|
167
|
+
"paymentMethod": "BANK_TRANSFER",
|
|
168
|
+
"reference": "PAYRUN-2025-02-28-FX",
|
|
169
|
+
"valueDate": "2025-02-28"
|
|
170
|
+
}]
|
|
171
|
+
}
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
Here `paymentAmount` is 6,750 SGD (what left the bank) and `transactionAmount` is 5,000 USD (what was applied to the bill). The platform calculates the implied exchange rate and posts any FX gain/loss automatically.
|
|
175
|
+
|
|
176
|
+
**Tip:** Check the actual bank debit amount against your bank statement. Banks often add a spread to the exchange rate — the SGD amount debited may differ from what you'd calculate using the mid-market rate.
|
|
177
|
+
|
|
178
|
+
---
|
|
179
|
+
|
|
180
|
+
## Phase 6: Verification
|
|
181
|
+
|
|
182
|
+
### Step 9: Verify AP aging reflects the payments
|
|
183
|
+
|
|
184
|
+
```
|
|
185
|
+
POST /api/v1/generate-reports/ap-report
|
|
186
|
+
{ "endDate": "2025-02-28" }
|
|
187
|
+
```
|
|
188
|
+
|
|
189
|
+
**What to check:**
|
|
190
|
+
- Total AP should be reduced by the sum of all payments made
|
|
191
|
+
- Bills that were fully paid should no longer appear in the aging
|
|
192
|
+
- Partially paid bills should show the correct reduced balance
|
|
193
|
+
|
|
194
|
+
### Step 10: Verify bank balance
|
|
195
|
+
|
|
196
|
+
```
|
|
197
|
+
POST /api/v1/generate-reports/bank-balance-summary
|
|
198
|
+
{ "primarySnapshotDate": "2025-02-28" }
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
**What to check:**
|
|
202
|
+
- Bank balance should be reduced by the total payment amount
|
|
203
|
+
- Cross-reference to the actual bank statement to confirm all payments cleared
|
|
204
|
+
|
|
205
|
+
---
|
|
206
|
+
|
|
207
|
+
## Payment Run Checklist (Quick Reference)
|
|
208
|
+
|
|
209
|
+
| # | Step | Phase | Conditional |
|
|
210
|
+
|---|------|-------|-------------|
|
|
211
|
+
| 1 | List unpaid bills | Identify | Always |
|
|
212
|
+
| 2 | Filter by due date | Identify | If --due-before specified |
|
|
213
|
+
| 3 | Group by supplier | Summarize | Always |
|
|
214
|
+
| 4 | Generate AP aging | Summarize | Always |
|
|
215
|
+
| 5 | Build payment batch | Select | Always |
|
|
216
|
+
| 6 | Record each payment | Pay | Always |
|
|
217
|
+
| 7 | Partial payments | Pay | If cash constraints |
|
|
218
|
+
| 8 | FX payments | Pay | If multi-currency bills |
|
|
219
|
+
| 9 | Verify AP aging | Verify | Always |
|
|
220
|
+
| 10 | Verify bank balance | Verify | Always |
|
|
221
|
+
|
|
222
|
+
---
|
|
223
|
+
|
|
224
|
+
## Payment Method Options
|
|
225
|
+
|
|
226
|
+
| Method | When to Use | Code |
|
|
227
|
+
|--------|-------------|------|
|
|
228
|
+
| Bank transfer | Most common for SMBs — GIRO, FAST, wire | `BANK_TRANSFER` |
|
|
229
|
+
| Cheque | Decreasing usage but some suppliers still require it | `CHEQUE` |
|
|
230
|
+
| Cash | Petty cash payments, small amounts | `CASH` |
|
|
231
|
+
| Credit card | Corporate card payments | `CREDIT_CARD` |
|
|
232
|
+
| E-wallet | GrabPay, PayNow for business | `E_WALLET` |
|
|
233
|
+
|
|
234
|
+
---
|
|
235
|
+
|
|
236
|
+
## Tips for SMBs
|
|
237
|
+
|
|
238
|
+
**Run payments on a schedule.** Weekly (Friday) or fortnightly. Predictable payment cycles help with cash flow planning and reduce the "can you pay this urgently" interruptions.
|
|
239
|
+
|
|
240
|
+
**Use payment terms strategically.** If a supplier offers 2% 10 Net 30 (2% discount for paying within 10 days), that's equivalent to a 36% annualized return. Take early payment discounts when cash allows.
|
|
241
|
+
|
|
242
|
+
**Keep a buffer.** Don't pay everything that's due if it drains the account. Always maintain a cash buffer of at least 2 weeks of operating expenses.
|
|
243
|
+
|
|
244
|
+
**Payment reference convention:** Use a consistent format like `PAYRUN-YYYY-MM-DD-SEQ` so payments are easy to trace in both your books and the bank statement. This makes bank reconciliation much easier downstream.
|
|
245
|
+
|
|
246
|
+
**Approval workflow:** For SMBs with multiple signatories, build the payment list first, get approval, then execute. Don't record payments in Jaz until the actual bank transfer is initiated.
|