feat: update invoice suffix code generation logic to ensure unique suffix for new invoices

This commit is contained in:
Astrian Zheng 2025-01-12 09:31:39 +11:00
parent cd1766db0f
commit 2905983bfd
Signed by: Astrian
SSH Key Fingerprint: SHA256:rVnhx3DAKjujCwWE13aDl7uV6+9U1MvydLkNRXJrBiA

View File

@ -111,6 +111,9 @@ class Invoice {
}
})
// 更新收据后缀
this.suffixCode = maxSuffix ? maxSuffix.invoice_suffix_code + 1 : 1
// 在数据库中创建新收据
const newInvoice = await prisma.invoice.create({
data: {