fix: wrong code
This commit is contained in:
parent
cf151951b8
commit
c8b8b58484
2 changed files with 2 additions and 2 deletions
|
|
@ -137,7 +137,7 @@ export class InvoiceController extends Controller {
|
||||||
return await tx.invoice.create({
|
return await tx.invoice.create({
|
||||||
data: {
|
data: {
|
||||||
quotationId: body.quotationId,
|
quotationId: body.quotationId,
|
||||||
code: `IV${year}${month}${last.toString().padStart(6, "0")}`,
|
code: `IV${year}${month}${last.value.toString().padStart(6, "0")}`,
|
||||||
amount: body.amount,
|
amount: body.amount,
|
||||||
installments: {
|
installments: {
|
||||||
connect: record.paySplit.map((v) => ({ id: v.id })),
|
connect: record.paySplit.map((v) => ({ id: v.id })),
|
||||||
|
|
|
||||||
|
|
@ -170,7 +170,7 @@ export class QuotationPayment extends Controller {
|
||||||
await tx.quotation.update({
|
await tx.quotation.update({
|
||||||
where: { id: quotation.id },
|
where: { id: quotation.id },
|
||||||
data: {
|
data: {
|
||||||
code: last ? `RE${year}${month}${last.toString().padStart(6, "0")}` : undefined,
|
code: last ? `RE${year}${month}${last.value.toString().padStart(6, "0")}` : undefined,
|
||||||
quotationStatus:
|
quotationStatus:
|
||||||
paymentSum._sum.amount || 0 >= quotation.finalPrice
|
paymentSum._sum.amount || 0 >= quotation.finalPrice
|
||||||
? "PaymentSuccess"
|
? "PaymentSuccess"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue