diff --git a/src/controllers/05-payment-controller.ts b/src/controllers/05-payment-controller.ts index bb179ce..58fba4f 100644 --- a/src/controllers/05-payment-controller.ts +++ b/src/controllers/05-payment-controller.ts @@ -188,13 +188,13 @@ export class QuotationPayment extends Controller { }, create: { key: `REQUEST_${year}${month}`, - value: 1, + value: quotation.worker.length, }, - update: { value: { increment: 1 } }, + update: { value: { increment: quotation.worker.length } }, }); return { - create: quotation.worker.map((v) => ({ - code: `TR${year}${month}${lastRequest.value.toString().padStart(6, "0")}`, + create: quotation.worker.map((v, i) => ({ + code: `TR${year}${month}${(lastRequest.value - quotation.worker.length + i + 1).toString().padStart(6, "0")}`, employeeId: v.employeeId, requestWork: { create: quotation.productServiceList.flatMap((item) =>