mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-12-06 10:44:23 +00:00
feat(costs): enter a custom split in percent (#1709)
This commit is contained in:
@@ -1997,6 +1997,34 @@ describe('CostsPanel — split modes and guests', () => {
|
||||
expect(posted!.members).toEqual([{ user_id: 1, amount: null }, { user_id: 2, amount: null }])
|
||||
})
|
||||
|
||||
it('FE-W5COSTS-1709: a custom split typed in percent saves the matching amounts', async () => {
|
||||
const user = userEvent.setup()
|
||||
let posted: Record<string, unknown> | null = null
|
||||
server.use(http.post('/api/trips/1/budget', async ({ request }) => {
|
||||
posted = await request.json() as Record<string, unknown>
|
||||
return HttpResponse.json({ item: dinner() })
|
||||
}))
|
||||
mount([])
|
||||
|
||||
await user.click(await screen.findByRole('button', { name: 'Add expense' }))
|
||||
await user.type(screen.getByPlaceholderText('e.g. Dinner, souvenirs, gas…'), 'Bag storage')
|
||||
await user.type(screen.getAllByPlaceholderText('0,00')[0], '30')
|
||||
await user.click(screen.getByRole('button', { name: 'Custom' }))
|
||||
await user.click(screen.getByRole('button', { name: '%' }))
|
||||
|
||||
const [alice, bob] = screen.getAllByRole('textbox', { name: / %$/ })
|
||||
await user.type(alice, '60')
|
||||
expect(screen.getByText('60 % of 100 % assigned')).toBeInTheDocument()
|
||||
await user.type(bob, '40')
|
||||
expect(screen.getByText('Split matches total')).toBeInTheDocument()
|
||||
expect(screen.getByText('18,00 €')).toBeInTheDocument()
|
||||
|
||||
const submits = screen.getAllByRole('button', { name: 'Add expense' })
|
||||
await user.click(submits[submits.length - 1])
|
||||
await waitFor(() => expect(posted).toBeTruthy())
|
||||
expect(posted!.members).toEqual([{ user_id: 1, amount: 18 }, { user_id: 2, amount: 12 }])
|
||||
})
|
||||
|
||||
it('FE-W5COSTS-057: multi-payer on a payer-less expense seeds and collapses back to me', async () => {
|
||||
const user = userEvent.setup()
|
||||
let put: Record<string, unknown> | null = null
|
||||
|
||||
@@ -23,6 +23,7 @@ import { ReceiptScanModal } from './ReceiptScanModal'
|
||||
import { SYMBOLS, currenciesWith, SPLIT_COLORS } from './BudgetPanel.constants'
|
||||
import { amountPattern, calculateTicketShares, finalBudgetFor, finalBudgetSources, hasTicketSplit, NOTE_MAX, paidByUser, payersBalanced, readTicketItems, newExpenseSeed, readUserNote, rebalancePayers, settlementDate, splitEqualShares, writeTicketItems, type TicketItem } from './CostsPanel.helpers'
|
||||
import { COST_CATEGORY_LIST, catMeta } from './costsCategories'
|
||||
import { usePercentSplit, type CustomSplitUnit } from './usePercentSplit'
|
||||
import { ReceiptPreviewModal } from './ReceiptPreviewModal'
|
||||
import type { BudgetParticipantFinal, BudgetUnconverted, ReceiptLine } from '@trek/shared'
|
||||
import type { BudgetItem, BudgetItemReceipt } from '../../types'
|
||||
@@ -1480,6 +1481,10 @@ export function ExpenseModal({ tripId, base, people, me, editing, prefill, onClo
|
||||
return splitEqualShares(totalNum, [...participants].map(id => ({ user_id: id })), editing?.id || 0)
|
||||
}, [totalNum, participants, editing])
|
||||
|
||||
// The custom split typed as percentages instead of amounts (#1709).
|
||||
const pct = usePercentSplit({ total: totalNum, participants, customAmounts, setCustomAmounts, currency })
|
||||
const inPercent = splitMode === 'custom' && pct.unit === 'percent'
|
||||
|
||||
const placeholderShares = useMemo(() => {
|
||||
const emptyParts = [...participants].filter(id => !customAmounts[id])
|
||||
if (emptyParts.length === 0) return {}
|
||||
@@ -1801,7 +1806,20 @@ export function ExpenseModal({ tripId, base, people, me, editing, prefill, onClo
|
||||
/>
|
||||
)}
|
||||
>
|
||||
{modeHint(t(`costs.splitHint.${splitMode}`))}
|
||||
{splitMode === 'custom' ? (
|
||||
<div className="mb-2.5 flex items-start justify-between gap-3">
|
||||
<p className="m-0 min-w-0 text-content-faint" style={fs(12, 'body')}>{t(inPercent ? 'costs.splitHint.percent' : 'costs.splitHint.custom')}</p>
|
||||
<Segmented<CustomSplitUnit>
|
||||
label={t('costs.splitUnit')}
|
||||
value={pct.unit}
|
||||
onChange={pct.setUnit}
|
||||
options={[
|
||||
{ value: 'amount', label: sym(currency) },
|
||||
{ value: 'percent', label: '%' },
|
||||
]}
|
||||
/>
|
||||
</div>
|
||||
) : modeHint(t(`costs.splitHint.${splitMode}`))}
|
||||
{splitMode === 'ticket' ? (
|
||||
<div className="flex flex-col gap-3">
|
||||
<div className="flex flex-col gap-2">
|
||||
@@ -1887,6 +1905,16 @@ export function ExpenseModal({ tripId, base, people, me, editing, prefill, onClo
|
||||
</button>
|
||||
{!on ? excludedNote : splitMode === 'equally' ? (
|
||||
<span className="text-right">{badge(money(equalShares[p.id] || 0))}</span>
|
||||
) : inPercent ? (
|
||||
<div className="flex flex-col items-end gap-0.5">
|
||||
<div className={`${AMOUNT_BOX} w-full`}>
|
||||
<input type="text" inputMode="decimal" aria-label={`${nameOf(p)} %`} placeholder={pct.placeholderPercent} value={pct.percents[p.id] ?? ''}
|
||||
onChange={e => pct.onPercentChange(p.id, e.target.value)}
|
||||
className={AMOUNT_INPUT} style={fs(13.5, 'body')} />
|
||||
<span className="text-content-faint" style={fs(13, 'body')}>%</span>
|
||||
</div>
|
||||
{customAmounts[p.id] && <span className="font-geist tabular-nums text-content-faint" style={fs(10.5)}>{money(Number.parseFloat(customAmounts[p.id]) || 0)}</span>}
|
||||
</div>
|
||||
) : (
|
||||
<div className={AMOUNT_BOX}>
|
||||
<span className="text-content-faint" style={fs(13, 'body')}>{sym(currency)}</span>
|
||||
@@ -1907,6 +1935,8 @@ export function ExpenseModal({ tripId, base, people, me, editing, prefill, onClo
|
||||
</>
|
||||
) : customBalanced ? (
|
||||
badge(<><Check size={12} strokeWidth={3} />{t('costs.splitBalanced')}</>, 'success')
|
||||
) : inPercent ? (
|
||||
badge(<><AlertCircle size={12} strokeWidth={2.4} />{t('costs.splitPercentOff', { sum: String(Math.round(pct.percentSum * 100) / 100) })}</>, 'danger')
|
||||
) : (
|
||||
badge(<><AlertCircle size={12} strokeWidth={2.4} />{t(splitShortfall > 0 ? 'costs.splitSumUnder' : 'costs.splitSumOver', {
|
||||
sum: money(splitSum),
|
||||
|
||||
@@ -0,0 +1,66 @@
|
||||
// FE-BUDGET-PCT-001 to FE-BUDGET-PCT-006
|
||||
import { describe, it, expect } from 'vitest'
|
||||
import { useState } from 'react'
|
||||
import { act, renderHook } from '@testing-library/react'
|
||||
import { amountsToPercents, percentsToAmounts, percentString, usePercentSplit } from './usePercentSplit'
|
||||
|
||||
describe('percent split maths (#1709)', () => {
|
||||
it('FE-BUDGET-PCT-001: thirds add up to the total exactly', () => {
|
||||
const amounts = percentsToAmounts(100, { 1: '33.33', 2: '33.33', 3: '33.34' }, [1, 2, 3], 'EUR')
|
||||
expect(amounts).toEqual({ 1: 33.33, 2: 33.33, 3: 33.34 })
|
||||
const even = percentsToAmounts(10, { 1: '33.33', 2: '33.33', 3: '33.34' }, [1, 2, 3], 'EUR')
|
||||
expect(Object.values(even).reduce((s, v) => s + v, 0)).toBeCloseTo(10, 10)
|
||||
})
|
||||
|
||||
it('FE-BUDGET-PCT-002: a refund splits negative and still balances', () => {
|
||||
const amounts = percentsToAmounts(-10, { 1: '50', 2: '25', 3: '25' }, [1, 2, 3], 'EUR')
|
||||
expect(amounts).toEqual({ 1: -5, 2: -2.5, 3: -2.5 })
|
||||
const odd = percentsToAmounts(-0.05, { 1: '50', 2: '50' }, [1, 2], 'EUR')
|
||||
expect(Math.round((odd[1] + odd[2]) * 100)).toBe(-5)
|
||||
})
|
||||
|
||||
it('FE-BUDGET-PCT-003: zero-decimal currencies stay whole, and percentages short of 100 just round', () => {
|
||||
expect(percentsToAmounts(1000, { 1: '33.33', 2: '66.67' }, [1, 2], 'JPY')).toEqual({ 1: 333, 2: 667 })
|
||||
expect(percentsToAmounts(80, { 1: '25', 2: '' }, [1, 2], 'EUR')).toEqual({ 1: 20 })
|
||||
})
|
||||
|
||||
it('FE-BUDGET-PCT-004: amounts read back as percentages of the total', () => {
|
||||
expect(amountsToPercents(80, { 1: '20', 2: '60', 3: '' }, [1, 2, 3])).toEqual({ 1: '25', 2: '75' })
|
||||
expect(amountsToPercents(0, { 1: '20' }, [1])).toEqual({})
|
||||
expect(percentString(33.3333)).toBe('33.33')
|
||||
})
|
||||
})
|
||||
|
||||
describe('usePercentSplit (#1709)', () => {
|
||||
function setup(total = 90) {
|
||||
return renderHook(({ t }) => {
|
||||
const [amounts, setAmounts] = useState<Record<number, string>>({ 1: '30', 2: '60' })
|
||||
const pct = usePercentSplit({ total: t, participants: new Set([1, 2, 3]), customAmounts: amounts, setCustomAmounts: setAmounts, currency: 'EUR' })
|
||||
return { amounts, pct }
|
||||
}, { initialProps: { t: total } })
|
||||
}
|
||||
|
||||
it('FE-BUDGET-PCT-005: switching to % carries the typed amounts over, and typing writes amounts back', () => {
|
||||
const { result } = setup()
|
||||
act(() => result.current.pct.setUnit('percent'))
|
||||
expect(result.current.pct.percents).toEqual({ 1: '33.33', 2: '66.67' })
|
||||
act(() => result.current.pct.onPercentChange(1, '50'))
|
||||
act(() => result.current.pct.onPercentChange(2, '25'))
|
||||
act(() => result.current.pct.onPercentChange(3, '25'))
|
||||
expect(result.current.amounts).toEqual({ 1: '45.00', 2: '22.50', 3: '22.50' })
|
||||
expect(result.current.pct.percentSum).toBe(100)
|
||||
// Not a percentage: ignored.
|
||||
act(() => result.current.pct.onPercentChange(3, 'abc'))
|
||||
expect(result.current.pct.percents[3]).toBe('25')
|
||||
})
|
||||
|
||||
it('FE-BUDGET-PCT-006: a changed total moves the amounts, the placeholder offers the rest', () => {
|
||||
const { result, rerender } = setup()
|
||||
act(() => result.current.pct.setUnit('percent'))
|
||||
act(() => result.current.pct.onPercentChange(1, '50'))
|
||||
act(() => result.current.pct.onPercentChange(2, ''))
|
||||
expect(result.current.pct.placeholderPercent).toBe('25')
|
||||
rerender({ t: 200 })
|
||||
expect(result.current.amounts).toEqual({ 1: '100.00' })
|
||||
})
|
||||
})
|
||||
@@ -0,0 +1,110 @@
|
||||
import { useEffect, useState } from 'react'
|
||||
import { amountToInputString, currencyDecimals } from '../../utils/formatters'
|
||||
|
||||
export type CustomSplitUnit = 'amount' | 'percent'
|
||||
|
||||
const PERCENT_INPUT = /^\d{0,3}(\.\d{0,2})?$/
|
||||
|
||||
/** A percent as typed back into the field: at most two decimals, no trailing zeros. */
|
||||
export function percentString(value: number): string {
|
||||
return String(Math.round(value * 100) / 100)
|
||||
}
|
||||
|
||||
/**
|
||||
* Amounts from percentages of `total` (#1709), in whole minor units. When the
|
||||
* percentages add up to 100 the shares add up to the total exactly: the units a
|
||||
* plain rounding would lose go to the largest remainders, the same way
|
||||
* splitEqualShares hands out an indivisible cent. Ids without a percentage get
|
||||
* no amount.
|
||||
*/
|
||||
export function percentsToAmounts(total: number, percents: Record<number, string>, ids: number[], currency: string): Record<number, number> {
|
||||
const factor = 10 ** currencyDecimals(currency)
|
||||
const totalUnits = Math.round(total * factor)
|
||||
const entered = ids
|
||||
.map(id => ({ id, pct: Number.parseFloat(percents[id]) }))
|
||||
.filter(e => Number.isFinite(e.pct))
|
||||
const raw = entered.map(e => ({ id: e.id, exact: (totalUnits * e.pct) / 100 }))
|
||||
const out: Record<number, number> = {}
|
||||
const pctSum = entered.reduce((s, e) => s + e.pct, 0)
|
||||
if (Math.abs(pctSum - 100) < 1e-9) {
|
||||
const floors = raw.map(r => ({ id: r.id, units: Math.floor(r.exact), rest: r.exact - Math.floor(r.exact) }))
|
||||
let left = totalUnits - floors.reduce((s, f) => s + f.units, 0)
|
||||
// On a refund the total is negative, so the remainder runs the other way.
|
||||
const order = [...floors].sort((a, b) => (left >= 0 ? b.rest - a.rest : a.rest - b.rest) || a.id - b.id)
|
||||
for (const f of order) {
|
||||
if (left === 0) break
|
||||
f.units += Math.sign(left)
|
||||
left -= Math.sign(left)
|
||||
}
|
||||
for (const f of floors) out[f.id] = f.units / factor
|
||||
} else {
|
||||
for (const r of raw) out[r.id] = Math.round(r.exact) / factor
|
||||
}
|
||||
return out
|
||||
}
|
||||
|
||||
/** The percentages the typed amounts make of `total`; an empty or unparsable amount stays empty. */
|
||||
export function amountsToPercents(total: number, amounts: Record<number, string>, ids: number[]): Record<number, string> {
|
||||
const out: Record<number, string> = {}
|
||||
if (total === 0) return out
|
||||
for (const id of ids) {
|
||||
const amount = Number.parseFloat(amounts[id])
|
||||
if (Number.isFinite(amount)) out[id] = percentString((amount / total) * 100)
|
||||
}
|
||||
return out
|
||||
}
|
||||
|
||||
interface Args {
|
||||
total: number
|
||||
participants: Set<number>
|
||||
customAmounts: Record<number, string>
|
||||
/** Must be stable across renders (a state setter), it is an effect dependency. */
|
||||
setCustomAmounts: (next: Record<number, string>) => void
|
||||
currency: string
|
||||
initialUnit?: CustomSplitUnit
|
||||
}
|
||||
|
||||
/**
|
||||
* The "%" side of a custom split (#1709). Percentages are only an input aid:
|
||||
* every change is turned straight into the amounts the custom split already
|
||||
* keeps, so what is saved, validated and settled is unchanged.
|
||||
*/
|
||||
export function usePercentSplit({ total, participants, customAmounts, setCustomAmounts, currency, initialUnit = 'amount' }: Args) {
|
||||
const [unit, setUnitState] = useState<CustomSplitUnit>(initialUnit)
|
||||
const [percents, setPercents] = useState<Record<number, string>>({})
|
||||
const ids = [...participants]
|
||||
|
||||
const setUnit = (next: CustomSplitUnit) => {
|
||||
if (next === unit) return
|
||||
if (next === 'percent') setPercents(amountsToPercents(total, customAmounts, ids))
|
||||
setUnitState(next)
|
||||
}
|
||||
|
||||
const onPercentChange = (id: number, raw: string) => {
|
||||
const val = raw.replace(',', '.')
|
||||
if (val !== '' && !PERCENT_INPUT.test(val)) return
|
||||
setPercents(prev => {
|
||||
const next = { ...prev, [id]: val }
|
||||
if (val === '') delete next[id]
|
||||
return next
|
||||
})
|
||||
}
|
||||
|
||||
// The amounts follow the percentages: on every percentage typed, and when the
|
||||
// total changes or somebody leaves the split.
|
||||
const idsKey = ids.join(',')
|
||||
useEffect(() => {
|
||||
if (unit !== 'percent') return
|
||||
const idList = idsKey ? idsKey.split(',').map(Number) : []
|
||||
const amounts = percentsToAmounts(total, percents, idList, currency)
|
||||
const strings: Record<number, string> = {}
|
||||
for (const [id, amount] of Object.entries(amounts)) strings[Number(id)] = amountToInputString(amount, currency)
|
||||
setCustomAmounts(strings)
|
||||
}, [unit, percents, total, idsKey, currency, setCustomAmounts])
|
||||
|
||||
const percentSum = ids.reduce((s, id) => s + (Number.parseFloat(percents[id]) || 0), 0)
|
||||
const empty = ids.filter(id => !percents[id])
|
||||
const placeholderPercent = empty.length > 0 ? percentString(Math.max(0, 100 - percentSum) / empty.length) : '0'
|
||||
|
||||
return { unit, setUnit, percents, onPercentChange, percentSum, placeholderPercent }
|
||||
}
|
||||
@@ -158,6 +158,9 @@ const budget: TranslationStrings = {
|
||||
'costs.payersHint': 'حدّد من دفع واكتب المبلغ الذي دفعه كل منهم.',
|
||||
'costs.splitHint.equally': 'يدفع كل من حُدّد الحصة نفسها.',
|
||||
'costs.splitHint.custom': 'اكتب حصة كل شخص؛ ويجب أن يساوي مجموع الحصص المبلغ الإجمالي.',
|
||||
'costs.splitHint.percent': 'أدخل حصة كل شخص بالنسبة المئوية؛ يجب أن يكون مجموعها 100 %.',
|
||||
'costs.splitUnit': 'إدخال الحصص كـ',
|
||||
'costs.splitPercentOff': 'تم توزيع {sum} % من 100 %',
|
||||
'costs.splitHint.ticket': 'اكتب ما ورد في الإيصال وحدّد من أخذ كل عنصر.',
|
||||
'costs.filter.allCategories': 'كل الفئات',
|
||||
'costs.filter.allDays': 'كل الأيام',
|
||||
|
||||
@@ -149,6 +149,9 @@ const budget: TranslationStrings = {
|
||||
'costs.payersHint': 'Kimin ödədiyini işarələyin və hər birinin nə qədər ödədiyini yazın.',
|
||||
'costs.splitHint.equally': 'İşarələnən hər kəs bərabər pay ödəyir.',
|
||||
'costs.splitHint.custom': 'Hər şəxsin payını yazın; paylar birlikdə ümumi məbləği təşkil etməlidir.',
|
||||
'costs.splitHint.percent': 'Hər kəsin payını faizlə yazın; cəmi 100 % olmalıdır.',
|
||||
'costs.splitUnit': 'Payları belə daxil et',
|
||||
'costs.splitPercentOff': '100 %-dən {sum} % bölüşdürülüb',
|
||||
'costs.splitHint.ticket': 'Qəbzdə olanları sadalayın və hər elementi kimin götürdüyünü işarələyin.',
|
||||
'costs.pickSomeone': 'Bölüşdürmək üçün ən azı bir nəfər seçin.',
|
||||
'costs.splitSummary': '{count} nəfər arasında bölünüb · hərəsinə {amount}',
|
||||
|
||||
@@ -158,6 +158,9 @@ const budget: TranslationStrings = {
|
||||
'costs.payersHint': 'Marque quem pagou e digite quanto cada um pagou.',
|
||||
'costs.splitHint.equally': 'Todos os marcados pagam a mesma parte.',
|
||||
'costs.splitHint.custom': 'Digite a parte de cada pessoa; juntas, elas precisam dar o total.',
|
||||
'costs.splitHint.percent': 'Digite a parte de cada pessoa em porcentagem; juntas devem somar 100 %.',
|
||||
'costs.splitUnit': 'Inserir partes como',
|
||||
'costs.splitPercentOff': '{sum} % de 100 % distribuídos',
|
||||
'costs.splitHint.ticket': 'Liste o que estava no comprovante e marque quem consumiu cada item.',
|
||||
'costs.filter.allCategories': 'Todas as categorias',
|
||||
'costs.filter.allDays': 'Todos os dias',
|
||||
|
||||
@@ -126,6 +126,9 @@ const budget: TranslationStrings = {
|
||||
'costs.payersHint': 'Marca qui ha pagat i escriu quant hi ha posat cadascú.',
|
||||
'costs.splitHint.equally': 'Totes les persones marcades paguen la mateixa part.',
|
||||
'costs.splitHint.custom': 'Escriu la part de cada persona; entre totes han de sumar el total.',
|
||||
'costs.splitHint.percent': 'Escriu la part de cada persona en percentatge; juntes han de sumar el 100 %.',
|
||||
'costs.splitUnit': 'Introdueix les parts com a',
|
||||
'costs.splitPercentOff': '{sum} % de 100 % repartit',
|
||||
'costs.splitHint.ticket': 'Llista el que hi havia al rebut i marca qui ha pres cada article.',
|
||||
'costs.pickSomeone': 'Tria almenys una persona amb qui dividir-ho.',
|
||||
'costs.splitSummary': 'Dividit de {count} maneres · {amount} cadascú',
|
||||
|
||||
@@ -158,6 +158,9 @@ const budget: TranslationStrings = {
|
||||
'costs.payersHint': 'Zaškrtněte, kdo platil, a zadejte, kolik kdo zaplatil.',
|
||||
'costs.splitHint.equally': 'Všichni zaškrtnutí platí stejný podíl.',
|
||||
'costs.splitHint.custom': 'Zadejte podíl každé osoby; dohromady musí dát celkovou částku.',
|
||||
'costs.splitHint.percent': 'Zadejte podíl každé osoby v procentech; dohromady musí dát 100 %.',
|
||||
'costs.splitUnit': 'Zadávat podíly jako',
|
||||
'costs.splitPercentOff': 'Rozděleno {sum} % ze 100 %',
|
||||
'costs.splitHint.ticket': 'Vypište, co bylo na účtence, a zaškrtněte, kdo měl kterou položku.',
|
||||
'costs.filter.allCategories': 'Všechny kategorie',
|
||||
'costs.filter.allDays': 'Všechny dny',
|
||||
|
||||
@@ -161,6 +161,9 @@ const budget: TranslationStrings = {
|
||||
'costs.payersHint': 'Hak an, wer bezahlt hat, und trag ein, wie viel jede Person gezahlt hat.',
|
||||
'costs.splitHint.equally': 'Alle Angehakten zahlen den gleichen Anteil.',
|
||||
'costs.splitHint.custom': 'Trag für jede Person ihren Anteil ein; zusammen ergeben sie den Betrag.',
|
||||
'costs.splitHint.percent': 'Gib den Anteil jeder Person in Prozent ein; zusammen müssen es 100 % sein.',
|
||||
'costs.splitUnit': 'Anteile eingeben als',
|
||||
'costs.splitPercentOff': '{sum} % von 100 % verteilt',
|
||||
'costs.splitHint.ticket': 'Liste auf, was auf dem Beleg steht, und hak ab, wer was hatte.',
|
||||
'costs.ticketItemName': 'Artikelname',
|
||||
'costs.ticketSplitting': 'Aufteilen auf:',
|
||||
|
||||
@@ -134,6 +134,9 @@ const budget: TranslationStrings = {
|
||||
'costs.payersHint': 'Tick who paid and type how much each of them put in.',
|
||||
'costs.splitHint.equally': 'Everyone ticked pays the same share.',
|
||||
'costs.splitHint.custom': "Type each person's share; together they have to make the total.",
|
||||
'costs.splitHint.percent': "Type each person's share in percent; together they have to make 100 %.",
|
||||
'costs.splitUnit': 'Enter shares as',
|
||||
'costs.splitPercentOff': '{sum} % of 100 % assigned',
|
||||
'costs.splitHint.ticket': 'List what was on the receipt and tick who had each item.',
|
||||
'costs.pickSomeone': 'Pick at least one person to split with.',
|
||||
'costs.splitSummary': 'Split {count} ways · {amount} each',
|
||||
|
||||
@@ -158,6 +158,9 @@ const budget: TranslationStrings = {
|
||||
'costs.payersHint': 'Marca quién pagó y escribe cuánto puso cada uno.',
|
||||
'costs.splitHint.equally': 'Todos los marcados pagan la misma parte.',
|
||||
'costs.splitHint.custom': 'Escribe la parte de cada persona; entre todas tienen que sumar el total.',
|
||||
'costs.splitHint.percent': 'Escribe la parte de cada persona en porcentaje; juntas deben sumar el 100 %.',
|
||||
'costs.splitUnit': 'Introducir partes como',
|
||||
'costs.splitPercentOff': '{sum} % de 100 % asignado',
|
||||
'costs.splitHint.ticket': 'Enumera lo que había en el recibo y marca quién tomó cada artículo.',
|
||||
'costs.filter.allCategories': 'Todas las categorías',
|
||||
'costs.filter.allDays': 'Todos los días',
|
||||
|
||||
@@ -134,6 +134,9 @@ const budget: TranslationStrings = {
|
||||
'costs.payersHint': 'Märgi, kes maksis, ja sisesta, kui palju igaüks neist maksis.',
|
||||
'costs.splitHint.equally': 'Kõik märgitud maksavad võrdse osa.',
|
||||
'costs.splitHint.custom': 'Sisesta iga inimese osa; kokku peavad need andma kogusumma.',
|
||||
'costs.splitHint.percent': 'Sisesta iga inimese osa protsentides; kokku peab tulema 100 %.',
|
||||
'costs.splitUnit': 'Sisesta osad kui',
|
||||
'costs.splitPercentOff': 'Jaotatud {sum} % 100 %-st',
|
||||
'costs.splitHint.ticket': 'Loetle, mis tšekil oli, ja märgi iga kirje juurde, kellele see kuulus.',
|
||||
'costs.pickSomeone': 'Vali jagamiseks vähemalt üks inimene.',
|
||||
'costs.splitSummary': 'Jaotatud {count} osaks · igaühele {amount}',
|
||||
|
||||
@@ -159,6 +159,9 @@ const budget: TranslationStrings = {
|
||||
'costs.payersHint': 'Cochez qui a payé et saisissez combien chacun a versé.',
|
||||
'costs.splitHint.equally': 'Chaque personne cochée paie la même part.',
|
||||
'costs.splitHint.custom': 'Saisissez la part de chaque personne ; ensemble, elles doivent faire le total.',
|
||||
'costs.splitHint.percent': 'Saisissez la part de chacun en pourcentage ; ensemble elles doivent faire 100 %.',
|
||||
'costs.splitUnit': 'Saisir les parts en',
|
||||
'costs.splitPercentOff': '{sum} % sur 100 % répartis',
|
||||
'costs.splitHint.ticket': 'Listez ce qui figurait sur le reçu et cochez qui a pris chaque article.',
|
||||
'costs.filter.allCategories': 'Toutes les catégories',
|
||||
'costs.filter.allDays': 'Tous les jours',
|
||||
|
||||
@@ -159,6 +159,9 @@ const budget: TranslationStrings = {
|
||||
'costs.payersHint': 'Επιλέξτε ποιος πλήρωσε και γράψτε πόσα έβαλε ο καθένας.',
|
||||
'costs.splitHint.equally': 'Όλοι οι επιλεγμένοι πληρώνουν το ίδιο μερίδιο.',
|
||||
'costs.splitHint.custom': 'Γράψτε το μερίδιο κάθε ατόμου· μαζί πρέπει να φτάνουν το σύνολο.',
|
||||
'costs.splitHint.percent': 'Πληκτρολογήστε το μερίδιο κάθε ατόμου σε ποσοστό· μαζί πρέπει να κάνουν 100 %.',
|
||||
'costs.splitUnit': 'Εισαγωγή μεριδίων ως',
|
||||
'costs.splitPercentOff': 'Κατανεμήθηκε {sum} % από 100 %',
|
||||
'costs.splitHint.ticket': 'Καταγράψτε τι είχε η απόδειξη και σημειώστε ποιος πήρε κάθε είδος.',
|
||||
'costs.filter.allCategories': 'Όλες οι κατηγορίες',
|
||||
'costs.filter.allDays': 'Όλες οι ημέρες',
|
||||
|
||||
@@ -158,6 +158,9 @@ const budget: TranslationStrings = {
|
||||
'costs.payersHint': 'Jelöld be, ki fizetett, és írd be, mennyit adott bele mindegyikük.',
|
||||
'costs.splitHint.equally': 'Minden bejelölt ugyanakkora részt fizet.',
|
||||
'costs.splitHint.custom': 'Írd be mindenki részét; együtt ki kell adniuk a teljes összeget.',
|
||||
'costs.splitHint.percent': 'Add meg mindenki részét százalékban; együtt 100 %-ot kell kiadniuk.',
|
||||
'costs.splitUnit': 'Részek megadása mint',
|
||||
'costs.splitPercentOff': '100 %-ból {sum} % kiosztva',
|
||||
'costs.splitHint.ticket': 'Sorold fel, mi szerepelt a nyugtán, és minden tételnél jelöld be, kié volt.',
|
||||
'costs.filter.allCategories': 'Összes kategória',
|
||||
'costs.filter.allDays': 'Összes nap',
|
||||
|
||||
@@ -158,6 +158,9 @@ const budget: TranslationStrings = {
|
||||
'costs.payersHint': 'Centang siapa yang membayar dan ketik berapa yang dibayar masing-masing.',
|
||||
'costs.splitHint.equally': 'Semua yang dicentang membayar bagian yang sama.',
|
||||
'costs.splitHint.custom': 'Ketik bagian tiap orang; jika dijumlahkan, semuanya harus sama dengan total.',
|
||||
'costs.splitHint.percent': 'Ketik bagian tiap orang dalam persen; jumlahnya harus 100 %.',
|
||||
'costs.splitUnit': 'Masukkan bagian sebagai',
|
||||
'costs.splitPercentOff': '{sum} % dari 100 % terbagi',
|
||||
'costs.splitHint.ticket': 'Tuliskan isi kuitansi dan centang siapa yang mengambil tiap item.',
|
||||
'costs.filter.allCategories': 'Semua kategori',
|
||||
'costs.filter.allDays': 'Semua hari',
|
||||
|
||||
@@ -158,6 +158,9 @@ const budget: TranslationStrings = {
|
||||
'costs.payersHint': 'Spunta chi ha pagato e inserisci quanto ha versato ciascuno.',
|
||||
'costs.splitHint.equally': 'Tutti quelli spuntati pagano la stessa quota.',
|
||||
'costs.splitHint.custom': 'Inserisci la quota di ogni persona; insieme devono fare il totale.',
|
||||
'costs.splitHint.percent': 'Inserisci la quota di ciascuno in percentuale; insieme devono fare 100 %.',
|
||||
'costs.splitUnit': 'Inserisci le quote come',
|
||||
'costs.splitPercentOff': '{sum} % di 100 % assegnato',
|
||||
'costs.splitHint.ticket': "Elenca cosa c'era sulla ricevuta e spunta chi ha preso ciascun articolo.",
|
||||
'costs.filter.allCategories': 'Tutte le categorie',
|
||||
'costs.filter.allDays': 'Tutti i giorni',
|
||||
|
||||
@@ -158,6 +158,9 @@ const budget: TranslationStrings = {
|
||||
'costs.payersHint': '支払った人にチェックを入れ、それぞれが出した金額を入力します。',
|
||||
'costs.splitHint.equally': 'チェックを入れた全員が同じ額を負担します。',
|
||||
'costs.splitHint.custom': '各人の負担額を入力します。すべて足して合計金額になる必要があります。',
|
||||
'costs.splitHint.percent': '各人の負担をパーセントで入力してください。合計で 100 % になる必要があります。',
|
||||
'costs.splitUnit': '負担の入力方法',
|
||||
'costs.splitPercentOff': '100 % のうち {sum} % を割り当て済み',
|
||||
'costs.splitHint.ticket': 'レシートの品目を書き出し、それぞれ誰の分かにチェックを入れます。',
|
||||
'costs.filter.allCategories': 'すべてのカテゴリー',
|
||||
'costs.filter.allDays': 'すべての日',
|
||||
|
||||
@@ -158,6 +158,9 @@ const budget: TranslationStrings = {
|
||||
'costs.payersHint': '결제한 사람을 체크하고 각자 낸 금액을 입력하세요.',
|
||||
'costs.splitHint.equally': '체크한 모든 사람이 같은 몫을 냅니다.',
|
||||
'costs.splitHint.custom': '각자의 몫을 입력하세요. 모두 합쳐 총액이 되어야 합니다.',
|
||||
'costs.splitHint.percent': '각자의 몫을 퍼센트로 입력하세요. 합계가 100 %가 되어야 합니다.',
|
||||
'costs.splitUnit': '몫 입력 방식',
|
||||
'costs.splitPercentOff': '100 % 중 {sum} % 배분됨',
|
||||
'costs.splitHint.ticket': '영수증에 있던 항목을 적고, 항목마다 누구 몫인지 체크하세요.',
|
||||
'costs.filter.allCategories': '모든 카테고리',
|
||||
'costs.filter.allDays': '모든 날짜',
|
||||
|
||||
@@ -158,6 +158,9 @@ const budget: TranslationStrings = {
|
||||
'costs.payersHint': 'Vink aan wie heeft betaald en typ hoeveel ieder heeft bijgedragen.',
|
||||
'costs.splitHint.equally': 'Iedereen die is aangevinkt betaalt hetzelfde deel.',
|
||||
'costs.splitHint.custom': 'Typ het deel van elke persoon; samen moeten ze op het totaal uitkomen.',
|
||||
'costs.splitHint.percent': 'Vul ieders aandeel in procenten in; samen moet het 100 % zijn.',
|
||||
'costs.splitUnit': 'Aandelen invoeren als',
|
||||
'costs.splitPercentOff': '{sum} % van 100 % verdeeld',
|
||||
'costs.splitHint.ticket': 'Zet op een rij wat er op de bon stond en vink aan wie welk item had.',
|
||||
'costs.filter.allCategories': 'Alle categorieën',
|
||||
'costs.filter.allDays': 'Alle dagen',
|
||||
|
||||
@@ -158,6 +158,9 @@ const budget: TranslationStrings = {
|
||||
'costs.payersHint': 'Zaznacz, kto zapłacił, i wpisz, ile każda z tych osób wyłożyła.',
|
||||
'costs.splitHint.equally': 'Wszyscy zaznaczeni płacą taką samą część.',
|
||||
'costs.splitHint.custom': 'Wpisz udział każdej osoby; razem muszą dać całą kwotę.',
|
||||
'costs.splitHint.percent': 'Wpisz udział każdej osoby w procentach; razem musi to dać 100 %.',
|
||||
'costs.splitUnit': 'Wpisuj udziały jako',
|
||||
'costs.splitPercentOff': 'Przydzielono {sum} % ze 100 %',
|
||||
'costs.splitHint.ticket': 'Wypisz, co było na paragonie, i zaznacz, kto miał którą pozycję.',
|
||||
'costs.filter.allCategories': 'Wszystkie kategorie',
|
||||
'costs.filter.allDays': 'Wszystkie dni',
|
||||
|
||||
@@ -158,6 +158,9 @@ const budget: TranslationStrings = {
|
||||
'costs.payersHint': 'Отметьте, кто платил, и впишите, сколько внёс каждый.',
|
||||
'costs.splitHint.equally': 'Все отмеченные платят одинаковую долю.',
|
||||
'costs.splitHint.custom': 'Впишите долю каждого; вместе они должны составить всю сумму.',
|
||||
'costs.splitHint.percent': 'Введите долю каждого в процентах; вместе должно получиться 100 %.',
|
||||
'costs.splitUnit': 'Вводить доли как',
|
||||
'costs.splitPercentOff': 'Распределено {sum} % из 100 %',
|
||||
'costs.splitHint.ticket': 'Перечислите, что было в чеке, и отметьте, кто что брал.',
|
||||
'costs.filter.allCategories': 'Все категории',
|
||||
'costs.filter.allDays': 'Все дни',
|
||||
|
||||
@@ -134,6 +134,9 @@ const budget: TranslationStrings = {
|
||||
'costs.payersHint': 'Označte, kto platil, a zadajte, koľko ktorý z nich zaplatil.',
|
||||
'costs.splitHint.equally': 'Každý označený platí rovnaký podiel.',
|
||||
'costs.splitHint.custom': 'Zadajte podiel každej osoby; spolu musia dať celú sumu.',
|
||||
'costs.splitHint.percent': 'Zadajte podiel každej osoby v percentách; spolu musia dať 100 %.',
|
||||
'costs.splitUnit': 'Zadávať podiely ako',
|
||||
'costs.splitPercentOff': 'Rozdelené {sum} % zo 100 %',
|
||||
'costs.splitHint.ticket': 'Vypíšte, čo bolo na účtenke, a označte, kto mal ktorú položku.',
|
||||
'costs.pickSomeone': 'Vyberte aspoň jednu osobu na rozdelenie.',
|
||||
'costs.splitSummary': 'Rozdelené na {count} dielov · {amount} každý',
|
||||
|
||||
@@ -158,6 +158,9 @@ const budget: TranslationStrings = {
|
||||
'costs.payersHint': 'Bocka för vem som betalade och skriv in hur mycket var och en lade ut.',
|
||||
'costs.splitHint.equally': 'Alla som är ibockade betalar lika stor andel.',
|
||||
'costs.splitHint.custom': 'Skriv in varje persons andel; tillsammans måste de bli hela summan.',
|
||||
'costs.splitHint.percent': 'Skriv varje persons andel i procent; tillsammans ska det bli 100 %.',
|
||||
'costs.splitUnit': 'Ange andelar som',
|
||||
'costs.splitPercentOff': '{sum} % av 100 % fördelat',
|
||||
'costs.splitHint.ticket': 'Lista det som stod på kvittot och bocka för vem som hade varje artikel.',
|
||||
'costs.filter.allCategories': 'Alla kategorier',
|
||||
'costs.filter.allDays': 'Alla dagar',
|
||||
|
||||
@@ -130,6 +130,9 @@ const budget: TranslationStrings = {
|
||||
'costs.payersHint': 'ติ๊กเลือกคนที่จ่าย แล้วใส่จำนวนเงินที่แต่ละคนจ่ายไป',
|
||||
'costs.splitHint.equally': 'ทุกคนที่ติ๊กเลือกจ่ายส่วนแบ่งเท่ากัน',
|
||||
'costs.splitHint.custom': 'ใส่ส่วนแบ่งของแต่ละคน โดยรวมกันแล้วต้องเท่ากับยอดทั้งหมด',
|
||||
'costs.splitHint.percent': 'ใส่ส่วนแบ่งของแต่ละคนเป็นเปอร์เซ็นต์ รวมกันต้องได้ 100 %',
|
||||
'costs.splitUnit': 'ใส่ส่วนแบ่งเป็น',
|
||||
'costs.splitPercentOff': 'แบ่งแล้ว {sum} % จาก 100 %',
|
||||
'costs.splitHint.ticket': 'ใส่รายการที่อยู่ในใบเสร็จ แล้วติ๊กว่าใครสั่งรายการไหน',
|
||||
'costs.pickSomeone': 'เลือกอย่างน้อยหนึ่งคนที่จะแยกด้วย',
|
||||
'costs.splitSummary': 'แยก {count} วิธี · {amount} วิธีละ',
|
||||
|
||||
@@ -158,6 +158,9 @@ const budget: TranslationStrings = {
|
||||
'costs.payersHint': 'Kimin ödediğini işaretleyin ve her birinin ne kadar verdiğini yazın.',
|
||||
'costs.splitHint.equally': 'İşaretlenen herkes aynı payı öder.',
|
||||
'costs.splitHint.custom': 'Her kişinin payını yazın; hepsi birlikte toplam tutarı tutmalı.',
|
||||
'costs.splitHint.percent': 'Herkesin payını yüzde olarak yazın; toplam %100 olmalı.',
|
||||
'costs.splitUnit': 'Payları şu şekilde gir',
|
||||
'costs.splitPercentOff': "%100'ün %{sum} kadarı dağıtıldı",
|
||||
'costs.splitHint.ticket': 'Fişte neler olduğunu listeleyin ve her kalemi kimin aldığını işaretleyin.',
|
||||
'costs.filter.allCategories': 'Tüm kategoriler',
|
||||
'costs.filter.allDays': 'Tüm günler',
|
||||
|
||||
@@ -158,6 +158,9 @@ const budget: TranslationStrings = {
|
||||
'costs.payersHint': 'Позначте, хто платив, і впишіть, скільки вніс кожен.',
|
||||
'costs.splitHint.equally': 'Усі позначені платять однакову частку.',
|
||||
'costs.splitHint.custom': 'Впишіть частку кожної людини; разом вони мають скласти загальну суму.',
|
||||
'costs.splitHint.percent': 'Введіть частку кожного у відсотках; разом має бути 100 %.',
|
||||
'costs.splitUnit': 'Вводити частки як',
|
||||
'costs.splitPercentOff': 'Розподілено {sum} % зі 100 %',
|
||||
'costs.splitHint.ticket': 'Перелічіть, що було в чеку, і позначте, хто брав кожну позицію.',
|
||||
'costs.filter.allCategories': 'Усі категорії',
|
||||
'costs.filter.allDays': 'Усі дні',
|
||||
|
||||
@@ -158,6 +158,9 @@ const budget: TranslationStrings = {
|
||||
'costs.payersHint': 'Đánh dấu những người đã trả và nhập số tiền mỗi người đã bỏ ra.',
|
||||
'costs.splitHint.equally': 'Mọi người được đánh dấu trả phần bằng nhau.',
|
||||
'costs.splitHint.custom': 'Nhập phần của từng người; cộng lại phải bằng tổng số tiền.',
|
||||
'costs.splitHint.percent': 'Nhập phần của mỗi người theo phần trăm; tổng cộng phải là 100 %.',
|
||||
'costs.splitUnit': 'Nhập phần theo',
|
||||
'costs.splitPercentOff': 'Đã chia {sum} % trên 100 %',
|
||||
'costs.splitHint.ticket': 'Liệt kê các món trên hóa đơn và đánh dấu ai đã dùng từng món.',
|
||||
'costs.filter.allCategories': 'Tất cả danh mục',
|
||||
'costs.filter.allDays': 'Tất cả các ngày',
|
||||
|
||||
@@ -157,6 +157,9 @@ const budget: TranslationStrings = {
|
||||
'costs.payersHint': '勾選付款的人,並填入每個人各付了多少。',
|
||||
'costs.splitHint.equally': '每位勾選的人負擔相同的份額。',
|
||||
'costs.splitHint.custom': '填入每個人的份額;加總必須等於總額。',
|
||||
'costs.splitHint.percent': '以百分比輸入每個人的份額,合計必須為 100 %。',
|
||||
'costs.splitUnit': '份額輸入方式',
|
||||
'costs.splitPercentOff': '已分配 {sum} %(共 100 %)',
|
||||
'costs.splitHint.ticket': '列出收據上的項目,並勾選每一項是誰的。',
|
||||
'costs.filter.allCategories': '所有類別',
|
||||
'costs.filter.allDays': '所有日期',
|
||||
|
||||
@@ -157,6 +157,9 @@ const budget: TranslationStrings = {
|
||||
'costs.payersHint': '勾选付款的人,并填写每个人各付了多少。',
|
||||
'costs.splitHint.equally': '每位被勾选的人承担相同的份额。',
|
||||
'costs.splitHint.custom': '填写每个人的份额;合计必须等于总额。',
|
||||
'costs.splitHint.percent': '以百分比输入每个人的份额,合计必须为 100 %。',
|
||||
'costs.splitUnit': '份额输入方式',
|
||||
'costs.splitPercentOff': '已分配 {sum} %(共 100 %)',
|
||||
'costs.splitHint.ticket': '列出收据上的项目,并勾选每一项是谁的。',
|
||||
'costs.filter.allCategories': '所有类别',
|
||||
'costs.filter.allDays': '所有日期',
|
||||
|
||||
Reference in New Issue
Block a user