UNPKG

@accounter/server

Version:

14 lines 756 B
import { formatFinancialAmount } from '../../../shared/helpers/index.js'; export function calculateTotalAmount(charge, defaultLocalCurrency) { if (charge.type === 'PAYROLL' && charge.transactions_event_amount != null) { return formatFinancialAmount(charge.transactions_event_amount, defaultLocalCurrency); } if (charge.documents_event_amount != null && charge.documents_currency) { return formatFinancialAmount(charge.documents_event_amount, charge.documents_currency); } if (charge.transactions_event_amount != null && charge.transactions_currency) { return formatFinancialAmount(charge.transactions_event_amount, charge.transactions_currency); } return null; } //# sourceMappingURL=common.helper.js.map