feat: filter out if add new employee have no desired product
This commit is contained in:
parent
614da2e452
commit
f4bbfbbc08
1 changed files with 3 additions and 1 deletions
|
|
@ -958,7 +958,9 @@ export class QuotationActionController extends Controller {
|
|||
? {
|
||||
create: body
|
||||
.filter(
|
||||
(lhs) => !quotation.worker.find((rhs) => rhs.employeeId === lhs.workerId),
|
||||
(lhs) =>
|
||||
!quotation.worker.find((rhs) => rhs.employeeId === lhs.workerId) &&
|
||||
lhs.productServiceId.length > 0,
|
||||
)
|
||||
.map((v, i) => ({
|
||||
code: `TR${year}${month}${(lastRequest.value - quotation._count.worker + i + 1).toString().padStart(6, "0")}`,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue