6919f997c6
后端返回字段是 totalPay,前端误用 grossPay(不存在的字段), 导致应发合计始终显示 0。 Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
25 lines
821 B
TypeScript
25 lines
821 B
TypeScript
import prisma from '../src/lib/prisma'
|
|
|
|
async function main() {
|
|
const payslips = await prisma.$queryRaw<any[]>`
|
|
SELECT month, status, "publishStatus", count(*)::int as cnt
|
|
FROM "Payslip" WHERE month='2026-08'
|
|
GROUP BY month, status, "publishStatus"
|
|
`
|
|
console.log('Payslip 2026-08:', JSON.stringify(payslips, null, 2))
|
|
|
|
const batches = await prisma.$queryRaw<any[]>`
|
|
SELECT id, name, month, status, "batchNo"::text as bn
|
|
FROM "PayrollBatch" WHERE month='2026-08' ORDER BY "batchNo"
|
|
`
|
|
console.log('Batches 2026-08:', JSON.stringify(batches, null, 2))
|
|
|
|
const totalPayslips = await prisma.$queryRaw<any[]>`
|
|
SELECT count(*)::int as cnt FROM "Payslip" WHERE month='2026-08'
|
|
`
|
|
console.log('Total payslips 2026-08:', JSON.stringify(totalPayslips))
|
|
|
|
await prisma.$disconnect()
|
|
}
|
|
main()
|