Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Exclude deleted price lists and prices from pricing calculations #9015

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion packages/modules/pricing/src/repositories/pricing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,13 @@ export class PricingRepository
"case when price.price_list_id IS NULL then False else True end"
),
})
.where(knex.raw("price.deleted_at IS NULL"))
.leftJoin("price_rule as pr", "pr.price_id", "price.id")
.leftJoin("price_list as pl", function () {
this.on("pl.id", "price.price_list_id").andOn(
"pl.status",
knex.raw("?", [PriceListStatus.ACTIVE])
)
).andOn(knex.raw("pl.deleted_at IS NULL"))
panalgin marked this conversation as resolved.
Show resolved Hide resolved
})
.leftJoin("price_list_rule as plr", "plr.price_list_id", "pl.id")
.groupBy("price.id", "pl.id")
Expand Down
Loading