Add quote calculations support
Some checks failed
Build Docker Image / build (push) Failing after 23s

This commit is contained in:
Ruslan Bakiev
2026-02-06 19:07:20 +07:00
parent 1287ae9db7
commit 2939482fc3
4 changed files with 111 additions and 43 deletions

View File

@@ -4,7 +4,7 @@
<div class="flex-shrink-0 p-4 border-b border-white/10">
<div class="flex items-center justify-between">
<h3 class="font-semibold text-base text-white">{{ $t('catalog.headers.offers') }}</h3>
<span class="badge badge-neutral">{{ offers.length }}</span>
<span class="badge badge-neutral">{{ totalOffers }}</span>
</div>
</div>
@@ -119,6 +119,13 @@ const offersWithPrice = computed(() =>
(props.offers || []).filter(o => o?.pricePerUnit != null)
)
const totalOffers = computed(() => {
if (props.calculations?.length) {
return props.calculations.reduce((sum, calc) => sum + (calc.offers?.length || 0), 0)
}
return props.offers.length
})
const offerGroups = computed<OfferGroup[]>(() => {
if (props.calculations?.length) return props.calculations
return offersWithPrice.value.map(offer => ({