Fix invalid date in history; expand weekly report
- History: slice session_date to YYYY-MM-DD before Date parse (postgres returns date columns as ISO timestamps in JSON) - History: fix Edit/View navigate link passing full ISO string as date param - Weekly report: add daily status row, reconciliation variance (banked vs Newbook reported), sales with gross+net, debtors/creditors lazy-loaded Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
4caf307fd1
commit
e4ab137025
2 changed files with 219 additions and 48 deletions
|
|
@ -136,7 +136,7 @@ export function History() {
|
|||
</td>
|
||||
<td style={tdSt}>
|
||||
<span style={{ fontWeight: 600 }}>
|
||||
{new Date(row.session_date + 'T12:00:00').toLocaleDateString('en-GB', { weekday: 'short', day: '2-digit', month: 'short', year: 'numeric' })}
|
||||
{new Date(row.session_date.slice(0, 10) + 'T12:00:00').toLocaleDateString('en-GB', { weekday: 'short', day: '2-digit', month: 'short', year: 'numeric' })}
|
||||
</span>
|
||||
</td>
|
||||
<td style={tdSt}><StatusBadge status={row.status} /></td>
|
||||
|
|
@ -148,7 +148,7 @@ export function History() {
|
|||
</td>
|
||||
<td style={{ ...tdSt, display: 'flex', gap: '0.4rem', justifyContent: 'flex-end' }}>
|
||||
<Btn small variant="ghost"
|
||||
onClick={() => navigate(`/daily?date=${row.session_date}`)}>
|
||||
onClick={() => navigate(`/daily?date=${row.session_date.slice(0, 10)}`)}>
|
||||
{row.status === 'draft' ? 'Edit' : 'View'}
|
||||
</Btn>
|
||||
{row.status === 'draft' && (
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue