상업용 청구 문서는 가장 작은 통화 분수 단위에 이르기까지 완벽한 수학적 정합성을 유지해야 합니다. 다음은 Utiliome 내 활성 인보이스 세션을 나타내는 실제 JSON 데이터 스키마입니다.
{
"meta": {
"invoiceNumber": "INV-2026-0891",
"issueDate": "2026-11-07",
"dueDate": "2026-12-07",
"currency": "USD",
"currencySymbol": "$"
},
"issuer": {
"name": "Apex Cloud Architecture LLC",
"address": "100 Montgomery St, Suite 1400",
"city": "San Francisco, CA 94104",
"taxId": "US-EIN-94-3829102"
},
"client": {
"name": "Nexus Global Logistics Inc",
"address": "450 Lexington Ave, 8th Floor",
"city": "New York, NY 10017",
"taxId": "US-EIN-13-8829104"
},
"items": [
{
"description": "Infrastructure Security Audit & Hardening",
"quantity": 40,
"unitRate": 225.00,
"amount": 9000.00
},
{
"description": "Zero-Trust Kubernetes Cluster Configuration",
"quantity": 1,
"unitRate": 4500.00,
"amount": 4500.00
}
],
"financials": {
"subtotal": 13500.00,
"discountPercent": 5.0,
"discountAmount": 675.00,
"taxPercent": 8.5,
"taxAmount": 1090.13,
"total": 13915.13
}
}
IEEE 754 부동소수점 연산 오차(예: 0.1 + 0.2 === 0.30000000000000004)를 방지하기 위해 모든 금액 계산은 최소 보조 통화 단위(센트 등)의 정수로 처리됩니다.
const subtotalCents = items.reduce((sum, item) => {
return sum + Math.round(item.quantity * item.unitRate * 100);
}, 0);
const discountCents = Math.round(subtotalCents * (discountPercent / 100));
const taxableCents = subtotalCents - discountCents;
const taxCents = Math.round(taxableCents * (taxPercent / 100));
const totalCents = taxableCents + taxCents;