@@ -1,7 +1,9 @@
|
||||
import { controlClass } from '@/components/procurement';
|
||||
import { Button } from '@/components/ui/button';
|
||||
import { estimateMoney } from '@/lib/import-estimate-money';
|
||||
import { money } from '@/types/procurement';
|
||||
import {
|
||||
specificRateLabel,
|
||||
specificRateMoney,
|
||||
} from '@/lib/import-legal-specific-rate';
|
||||
|
||||
export type LegalCharge = {
|
||||
key: string;
|
||||
@@ -9,7 +11,7 @@ export type LegalCharge = {
|
||||
label: string;
|
||||
method: string;
|
||||
rate_percent: string | null;
|
||||
specific_minor: number | null;
|
||||
specific_minor: number | string | null;
|
||||
quantity_unit: string | null;
|
||||
basis_reference: string;
|
||||
};
|
||||
@@ -30,7 +32,7 @@ export const chargeDrafts = (charges: LegalCharge[]) =>
|
||||
label: charge.label,
|
||||
method: charge.method,
|
||||
rate_percent: charge.rate_percent ?? '',
|
||||
specific_amount: estimateMoney(charge.specific_minor),
|
||||
specific_amount: specificRateMoney(charge.specific_minor),
|
||||
quantity_unit: charge.quantity_unit ?? '',
|
||||
basis_reference: charge.basis_reference,
|
||||
}));
|
||||
@@ -55,7 +57,8 @@ export function LegalChargeSummary({ charges }: { charges: LegalCharge[] }) {
|
||||
)}
|
||||
{charge.specific_minor !== null && (
|
||||
<dd>
|
||||
Taxa específica: {money(charge.specific_minor)} por{' '}
|
||||
Taxa específica:{' '}
|
||||
{specificRateLabel(charge.specific_minor)} por{' '}
|
||||
{charge.quantity_unit}
|
||||
</dd>
|
||||
)}
|
||||
@@ -181,6 +184,11 @@ export default function LegalChargeFields({
|
||||
})
|
||||
}
|
||||
/>
|
||||
<span className="text-xs text-muted-foreground">
|
||||
Até oito casas decimais. A taxa é
|
||||
preservada; apenas o montante calculado é
|
||||
arredondado a cêntimos.
|
||||
</span>
|
||||
</label>
|
||||
<label className="grid gap-1">
|
||||
Unidade da taxa específica
|
||||
|
||||
Reference in New Issue
Block a user