changes 1
This commit is contained in:
@@ -8,7 +8,7 @@ import FormErrorBanner from '@/components/ui/FormErrorBanner.vue'
|
||||
import EmptyState from '@/components/ui/EmptyState.vue'
|
||||
import IconChevronBack from '@/components/icons/IconChevronBack.vue'
|
||||
import { formatCurrency, formatDate, formatNumber, toPersianDigits } from '@/utils/format'
|
||||
import { calculateCheckRass } from '@/utils/checkRass'
|
||||
import { calculateCheckRass, invoiceAnchorDate } from '@/utils/checkRass'
|
||||
import { confirm } from '@/composables/useConfirm'
|
||||
import { useRequirePricedOrder } from '@/composables/useRequirePricedOrder'
|
||||
import type { CheckData } from '@/types'
|
||||
@@ -58,8 +58,10 @@ const checks = computed<CheckData[]>(() => {
|
||||
})
|
||||
|
||||
const rass = computed(() => {
|
||||
if (orderStore.draftChecks.length > 0) return orderStore.getDraftRass()
|
||||
return calculateCheckRass(checks.value, new Date())
|
||||
const anchor = order.value ? invoiceAnchorDate(order.value) : undefined
|
||||
if (orderStore.draftChecks.length > 0) return orderStore.getDraftRass(anchor)
|
||||
if (!anchor) return calculateCheckRass([], new Date(0))
|
||||
return calculateCheckRass(checks.value, anchor)
|
||||
})
|
||||
|
||||
const invoiceAmount = computed(() => order.value?.finalAmount ?? 0)
|
||||
|
||||
Reference in New Issue
Block a user