feat: redondeo en el pie de los documentos de ventas y compras (visible según OADM.RoundMthd) y endpoint /api/company/settings
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
6c2cb30d63
commit
e9e3ba03e5
19 files changed
+270
-17
No files matched your search
@@ -35,6 +35,8 @@ export interface DocTotals {
|
||||
/** Total antes de impuestos. */
|
||||
net: number;
|
||||
tax: number;
|
||||
/** Redondeo del documento, si está marcado. */
|
||||
rounding: number;
|
||||
total: number;
|
||||
}
|
||||
|
||||
@@ -52,6 +54,7 @@ export function computeTotals(
|
||||
rates: ReadonlyMap<string, number>,
|
||||
discountPercent: number,
|
||||
expenseRows: readonly ExpenseRow[] = [],
|
||||
rounding = 0,
|
||||
): DocTotals {
|
||||
const factor = 1 - discountPercent / 100;
|
||||
let subtotal = 0;
|
||||
@@ -74,7 +77,8 @@ export function computeTotals(
|
||||
net: round2(net),
|
||||
tax: round2(tax),
|
||||
expenses: round2(expenses),
|
||||
total: round2(net + tax + expenses),
|
||||
rounding: round2(rounding),
|
||||
total: round2(net + tax + expenses + rounding),
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user