fix: detect not work due to floating point
All checks were successful
Spell Check / Spell Check with Typos (push) Successful in 7s
All checks were successful
Spell Check / Spell Check with Typos (push) Successful in 7s
This commit is contained in:
parent
f88b25a52a
commit
5fc4bbab6e
1 changed files with 12 additions and 14 deletions
|
|
@ -851,20 +851,18 @@ export class QuotationController extends Controller {
|
||||||
finalPrice: 0,
|
finalPrice: 0,
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
const changed = list
|
const changed = list?.some((lhs) => {
|
||||||
? record.productServiceList.some(
|
const found = record.productServiceList.find((rhs) => {
|
||||||
(lhs) =>
|
return (
|
||||||
!list?.find((rhs) => {
|
lhs.serviceId === rhs.serviceId &&
|
||||||
return (
|
lhs.workId === rhs.workId &&
|
||||||
lhs.serviceId === rhs.serviceId &&
|
lhs.productId === rhs.productId &&
|
||||||
lhs.workId === rhs.workId &&
|
lhs.amount === rhs.amount &&
|
||||||
lhs.productId === rhs.productId &&
|
precisionRound(lhs.pricePerUnit, 6) === precisionRound(rhs.pricePerUnit, 6)
|
||||||
lhs.discount === rhs.discount &&
|
);
|
||||||
lhs.pricePerUnit === rhs.pricePerUnit
|
});
|
||||||
);
|
return !found;
|
||||||
}),
|
});
|
||||||
)
|
|
||||||
: false;
|
|
||||||
await Promise.all([
|
await Promise.all([
|
||||||
tx.service.updateMany({
|
tx.service.updateMany({
|
||||||
where: { id: { in: ids.service }, status: Status.CREATED },
|
where: { id: { in: ids.service }, status: Status.CREATED },
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue