commit melhorias compras1
tests / ci (push) Waiting to run

This commit is contained in:
2026-11-21 21:04:40 +02:00
parent 976271f948
commit 12dd6df28a
108 changed files with 4391 additions and 408 deletions
+34 -10
View File
@@ -36,7 +36,11 @@ type Invoice = {
subtotal_minor: number;
tax_minor: number;
total_minor: number;
snapshot: { supplier: { name: string }; order_number: string };
snapshot: {
supplier: { name: string };
order_number: string;
currency?: string;
};
items: {
id: number;
quantity_milli: number;
@@ -57,7 +61,13 @@ export default function Invoices({
focusOrderId = null,
}: {
invoices: Page<Invoice>;
orders: { id: number; number: string; supplier: string; items: Source[] }[];
orders: {
id: number;
number: string;
currency?: string;
supplier: string;
items: Source[];
}[];
canManage: boolean;
focusInvoiceId?: number | null;
focusOrderId?: number | null;
@@ -342,10 +352,9 @@ export default function Invoices({
<label key={key}>
{
{
subtotal:
'Subtotal sem IVA (MZN)',
tax: 'IVA (MZN)',
total: 'Total (MZN)',
subtotal: `Subtotal sem IVA (${order?.currency ?? 'MZN'})`,
tax: `IVA (${order?.currency ?? 'MZN'})`,
total: `Total (${order?.currency ?? 'MZN'})`,
}[key]
}
<Input
@@ -386,9 +395,21 @@ export default function Invoices({
: 'Pendente de validação'}
</p>
<p>
Subtotal {money(invoice.subtotal_minor)} · IVA{' '}
{money(invoice.tax_minor)} · Total{' '}
{money(invoice.total_minor)}
Subtotal{' '}
{money(
invoice.subtotal_minor,
invoice.snapshot.currency,
)}{' '}
· IVA{' '}
{money(
invoice.tax_minor,
invoice.snapshot.currency,
)}{' '}
· Total{' '}
{money(
invoice.total_minor,
invoice.snapshot.currency,
)}
</p>
{payablesAvailable && (
<p className="my-3">
@@ -418,7 +439,10 @@ export default function Invoices({
{l.snapshot.description} ·{' '}
{l.quantity_milli / 1000}{' '}
{l.snapshot.unit} ·{' '}
{money(l.subtotal_minor + l.tax_minor)}
{money(
l.subtotal_minor + l.tax_minor,
invoice.snapshot.currency,
)}
</li>
))}
</ul>