@12-apps/fiscal 0.0.0-stage → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +124 -2
- package/dist/chunk-7QVYU63E.js +7 -0
- package/dist/chunk-7QVYU63E.js.map +1 -0
- package/dist/engine/index.d.ts +361 -0
- package/dist/engine/index.js +591 -0
- package/dist/engine/index.js.map +1 -0
- package/dist/manifest/index.d.ts +83 -0
- package/dist/manifest/index.js +33 -0
- package/dist/manifest/index.js.map +1 -0
- package/package.json +68 -4
- package/src/engine/compare.ts +68 -0
- package/src/engine/compute.ts +40 -0
- package/src/engine/errors.ts +28 -0
- package/src/engine/index.ts +20 -0
- package/src/engine/oracle.ts +81 -0
- package/src/engine/plan.ts +268 -0
- package/src/engine/rounding.ts +81 -0
- package/src/engine/types.ts +270 -0
- package/src/engine/validate.ts +222 -0
- package/src/manifest/index.ts +37 -0
- package/src/manifest/permissions.ts +28 -0
- package/tables/ibs-cbs-2026-11-13.json +156 -0
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Input and table validation. Every check names the field it refused, and
|
|
3
|
+
* every shape is checked before it is read, so a malformed input — a missing
|
|
4
|
+
* object, an `undefined` where `null` is required, a `null` line — is a
|
|
5
|
+
* `FiscalEngineError`, never a TypeError and never a NaN on a document.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import { FiscalEngineError } from "./errors";
|
|
9
|
+
import type { FiscalEngineErrorCode } from "./errors";
|
|
10
|
+
import type { IsoDate, RatePeriod, RateTables, TaxClass, TaxClassCode, TaxInput, TaxLineInput, TaxRegime } from "./types";
|
|
11
|
+
|
|
12
|
+
const ISO_DATE = /^(\d{4})-(\d{2})-(\d{2})$/;
|
|
13
|
+
const IBGE_MUNICIPALITY = /^\d{7}$/;
|
|
14
|
+
const IBGE_UF = /^\d{2}$/;
|
|
15
|
+
const REGIMES: readonly TaxRegime[] = ["REGIME_REGULAR", "SIMPLES_IBS_CBS_REGULAR", "SIMPLES", "MEI", "NAO_CONTRIBUINTE"];
|
|
16
|
+
|
|
17
|
+
function refuse(code: FiscalEngineErrorCode, message: string): never {
|
|
18
|
+
throw new FiscalEngineError(code, message);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function isRecord(value: unknown): value is Record<string, unknown> {
|
|
22
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/** A real calendar day in `YYYY-MM-DD` — `2026-02-30` is not one. */
|
|
26
|
+
function isIsoDate(value: unknown): value is IsoDate {
|
|
27
|
+
if (typeof value !== "string") return false;
|
|
28
|
+
const match = ISO_DATE.exec(value);
|
|
29
|
+
if (!match) return false;
|
|
30
|
+
const [year, month, day] = [Number(match[1]), Number(match[2]), Number(match[3])];
|
|
31
|
+
const date = new Date(Date.UTC(year, month - 1, day));
|
|
32
|
+
return date.getUTCFullYear() === year && date.getUTCMonth() === month - 1 && date.getUTCDate() === day;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
function isCents(value: unknown): value is number {
|
|
36
|
+
return typeof value === "number" && Number.isSafeInteger(value) && value >= 0;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
function isBp(value: unknown): value is number {
|
|
40
|
+
return isCents(value) && value <= 10_000;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
function isCode(value: unknown): value is string {
|
|
44
|
+
return typeof value === "string" && value !== "";
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/** Positive, finite, and at most four decimals — what `qCom` can carry. */
|
|
48
|
+
function isQuantity(value: unknown): value is number {
|
|
49
|
+
if (typeof value !== "number" || !Number.isFinite(value) || value <= 0) return false;
|
|
50
|
+
const tenThousandths = Math.round(value * 10_000);
|
|
51
|
+
return tenThousandths > 0 && Number.isSafeInteger(tenThousandths) && Math.abs(tenThousandths / 10_000 - value) < 1e-9;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
function assertInput(ok: boolean, what: string): void {
|
|
55
|
+
if (!ok) refuse("INVALID_INPUT", what);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
function assertTable(ok: boolean, what: string): void {
|
|
59
|
+
if (!ok) refuse("INVALID_TABLES", what);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
function assertTaxClass(taxClass: unknown, where: string): asserts taxClass is TaxClass {
|
|
63
|
+
assertInput(isRecord(taxClass), `${where} must be an object`);
|
|
64
|
+
const value = taxClass as Record<string, unknown>;
|
|
65
|
+
assertInput(isCode(value.cClassTrib), `${where}.cClassTrib must be a code`);
|
|
66
|
+
assertInput(isCode(value.cstIbsCbs), `${where}.cstIbsCbs must be a code`);
|
|
67
|
+
assertInput(
|
|
68
|
+
value.regimeEspecifico === null || value.regimeEspecifico === "BARES_RESTAURANTES",
|
|
69
|
+
`${where}.regimeEspecifico must be "BARES_RESTAURANTES" or null`,
|
|
70
|
+
);
|
|
71
|
+
assertInput(isBp(value.reductionBp), `${where}.reductionBp must be integer basis points in 0..10000`);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
function assertLine(line: unknown, index: number): asserts line is TaxLineInput {
|
|
75
|
+
const where = `lines[${index}]`;
|
|
76
|
+
assertInput(isRecord(line), `${where} must be an object`);
|
|
77
|
+
const value = line as Record<string, unknown>;
|
|
78
|
+
assertInput(isCode(value.id), `${where}.id must be a non-empty string`);
|
|
79
|
+
assertInput(isCents(value.valueCents), `${where}.valueCents must be non-negative integer cents`);
|
|
80
|
+
assertInput(isQuantity(value.quantity), `${where}.quantity must be positive, with at most four decimals`);
|
|
81
|
+
assertInput(typeof value.foodAndDrink === "boolean", `${where}.foodAndDrink must be a boolean`);
|
|
82
|
+
assertTaxClass(value.taxClass, `${where}.taxClass`);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
function assertServiceCharge(charge: unknown): void {
|
|
86
|
+
if (charge === null) return;
|
|
87
|
+
assertInput(isRecord(charge), "exclusions.serviceCharge must be an object or null");
|
|
88
|
+
const value = charge as Record<string, unknown>;
|
|
89
|
+
assertInput(isCode(value.id), "exclusions.serviceCharge.id must be a non-empty string");
|
|
90
|
+
assertInput(isCents(value.amountCents), "exclusions.serviceCharge.amountCents must be non-negative integer cents");
|
|
91
|
+
assertInput(typeof value.passedToStaff === "boolean", "exclusions.serviceCharge.passedToStaff must be a boolean");
|
|
92
|
+
assertTaxClass(value.taxClass, "exclusions.serviceCharge.taxClass");
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
function assertIntermediation(retained: unknown): void {
|
|
96
|
+
if (retained === null) return;
|
|
97
|
+
assertInput(isRecord(retained), "exclusions.retainedIntermediation must be an object or null");
|
|
98
|
+
const value = retained as Record<string, unknown>;
|
|
99
|
+
assertInput(isCode(value.id), "exclusions.retainedIntermediation.id must be a non-empty string");
|
|
100
|
+
assertInput(isCents(value.amountCents), "exclusions.retainedIntermediation.amountCents must be non-negative integer cents");
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
function assertExclusions(exclusions: unknown): void {
|
|
104
|
+
assertInput(isRecord(exclusions), "exclusions must be an object");
|
|
105
|
+
const value = exclusions as Record<string, unknown>;
|
|
106
|
+
assertInput("serviceCharge" in value, "exclusions.serviceCharge must be given (null when there is none)");
|
|
107
|
+
assertInput("retainedIntermediation" in value, "exclusions.retainedIntermediation must be given (null when there is none)");
|
|
108
|
+
assertServiceCharge(value.serviceCharge);
|
|
109
|
+
assertIntermediation(value.retainedIntermediation);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
function assertUniqueIds(input: TaxInput): void {
|
|
113
|
+
const ids = input.lines.map((line) => line.id);
|
|
114
|
+
if (input.exclusions.serviceCharge) ids.push(input.exclusions.serviceCharge.id);
|
|
115
|
+
if (input.exclusions.retainedIntermediation) ids.push(input.exclusions.retainedIntermediation.id);
|
|
116
|
+
const seen = new Set<string>();
|
|
117
|
+
for (const id of ids) {
|
|
118
|
+
assertInput(!seen.has(id), `line id "${id}" is used twice`);
|
|
119
|
+
seen.add(id);
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
function assertSeller(seller: unknown): void {
|
|
124
|
+
assertInput(isRecord(seller), "seller must be an object");
|
|
125
|
+
const value = seller as Record<string, unknown>;
|
|
126
|
+
assertInput(REGIMES.includes(value.regime as TaxRegime), `seller.regime must be one of ${REGIMES.join(", ")}`);
|
|
127
|
+
assertInput(isIsoDate(value.regimeEffectiveFrom), "seller.regimeEffectiveFrom must be a YYYY-MM-DD day");
|
|
128
|
+
assertInput(typeof value.restaurantRegime === "boolean", "seller.restaurantRegime must be a boolean");
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
/** Refuse anything the engine cannot compute from. */
|
|
132
|
+
export function assertTaxInput(input: unknown): asserts input is TaxInput {
|
|
133
|
+
assertInput(isRecord(input), "the input must be an object");
|
|
134
|
+
const value = input as Record<string, unknown>;
|
|
135
|
+
assertInput(Array.isArray(value.lines) && value.lines.length > 0, "lines must hold at least one line");
|
|
136
|
+
(value.lines as unknown[]).forEach(assertLine);
|
|
137
|
+
assertSeller(value.seller);
|
|
138
|
+
assertInput(
|
|
139
|
+
typeof value.destinationIbge === "string" && IBGE_MUNICIPALITY.test(value.destinationIbge),
|
|
140
|
+
"destinationIbge must be a 7-digit IBGE municipality code",
|
|
141
|
+
);
|
|
142
|
+
assertExclusions(value.exclusions);
|
|
143
|
+
assertUniqueIds(input as TaxInput);
|
|
144
|
+
assertInput(isIsoDate(value.supplyDate), "supplyDate must be a YYYY-MM-DD day");
|
|
145
|
+
assertRateTables(value.tables);
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
function assertRateMap(map: unknown, keyShape: RegExp, where: string): void {
|
|
149
|
+
assertTable(isRecord(map), `${where} must be an object`);
|
|
150
|
+
for (const [key, bp] of Object.entries(map as Record<string, unknown>)) {
|
|
151
|
+
assertTable(keyShape.test(key), `${where} key "${key}" is not an IBGE code of the right length`);
|
|
152
|
+
assertTable(isBp(bp), `${where}["${key}"] must be integer basis points in 0..10000`);
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
function assertSphere(sphere: unknown, mapKey: "byUf" | "byMunicipality", keyShape: RegExp, where: string): void {
|
|
157
|
+
assertTable(isRecord(sphere), `${where} must be an object`);
|
|
158
|
+
const value = sphere as Record<string, unknown>;
|
|
159
|
+
assertTable(isBp(value.referenceBp), `${where}.referenceBp must be integer basis points in 0..10000`);
|
|
160
|
+
assertRateMap(value[mapKey], keyShape, `${where}.${mapKey}`);
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
function assertPeriodFlags(value: Record<string, unknown>, where: string): void {
|
|
164
|
+
assertTable(value.status === "LAW" || value.status === "ESTIMATE", `${where}.status must be LAW or ESTIMATE`);
|
|
165
|
+
for (const flag of ["informative", "appliesToSimplesNacional", "taxInsidePrice"] as const) {
|
|
166
|
+
assertTable(typeof value[flag] === "boolean", `${where}.${flag} must be a boolean`);
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
function assertPeriod(period: unknown, index: number): asserts period is RatePeriod {
|
|
171
|
+
const where = `periods[${index}]`;
|
|
172
|
+
assertTable(isRecord(period), `${where} must be an object`);
|
|
173
|
+
const value = period as Record<string, unknown>;
|
|
174
|
+
assertTable(isIsoDate(value.from), `${where}.from must be a YYYY-MM-DD day`);
|
|
175
|
+
assertTable(
|
|
176
|
+
value.to === null || (isIsoDate(value.to) && value.to >= (value.from as string)),
|
|
177
|
+
`${where}.to must be null or a day on or after from`,
|
|
178
|
+
);
|
|
179
|
+
assertPeriodFlags(value, where);
|
|
180
|
+
assertTable(isBp(value.cbsBp), `${where}.cbsBp must be integer basis points in 0..10000`);
|
|
181
|
+
assertSphere(value.ibsUf, "byUf", IBGE_UF, `${where}.ibsUf`);
|
|
182
|
+
assertSphere(value.ibsMun, "byMunicipality", IBGE_MUNICIPALITY, `${where}.ibsMun`);
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
function assertClassCode(code: unknown, where: string): asserts code is TaxClassCode {
|
|
186
|
+
assertTable(isRecord(code), `${where} must be an object`);
|
|
187
|
+
const value = code as Record<string, unknown>;
|
|
188
|
+
assertTable(isCode(value.cClassTrib) && isCode(value.cstIbsCbs), `${where} must carry cClassTrib and cstIbsCbs`);
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
function assertTableHeader(value: Record<string, unknown>): void {
|
|
192
|
+
assertTable(isCode(value.version), "version must be a non-empty string");
|
|
193
|
+
assertTable(isBp(value.gorjetaCapBp), "gorjetaCapBp must be integer basis points in 0..10000");
|
|
194
|
+
const special = value.specialRegimes as Record<string, Record<string, unknown> | undefined> | undefined;
|
|
195
|
+
assertTable(isRecord(special) && isRecord(special.BARES_RESTAURANTES), "specialRegimes.BARES_RESTAURANTES must be an object");
|
|
196
|
+
assertTable(isBp(special!.BARES_RESTAURANTES!.reductionBp), "specialRegimes.BARES_RESTAURANTES.reductionBp must be basis points");
|
|
197
|
+
assertTable(isRecord(value.exclusionClasses), "exclusionClasses must be an object");
|
|
198
|
+
const classes = value.exclusionClasses as Record<string, unknown>;
|
|
199
|
+
assertClassCode(classes.GORJETA, "exclusionClasses.GORJETA");
|
|
200
|
+
assertClassCode(classes.INTERMEDIATION, "exclusionClasses.INTERMEDIATION");
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
/** Refuse a table the engine cannot trust: bad rates, bad dates, overlapping periods. */
|
|
204
|
+
export function assertRateTables(tables: unknown): asserts tables is RateTables {
|
|
205
|
+
assertTable(isRecord(tables), "the rate table must be an object");
|
|
206
|
+
const value = tables as Record<string, unknown>;
|
|
207
|
+
assertTableHeader(value);
|
|
208
|
+
assertTable(Array.isArray(value.periods) && value.periods.length > 0, "periods must hold at least one period");
|
|
209
|
+
const periods = value.periods as unknown[];
|
|
210
|
+
periods.forEach(assertPeriod);
|
|
211
|
+
const sorted = [...(periods as RatePeriod[])].sort((a, b) => a.from.localeCompare(b.from));
|
|
212
|
+
for (let i = 1; i < sorted.length; i += 1) {
|
|
213
|
+
const previous = sorted[i - 1]!;
|
|
214
|
+
assertTable(previous.to !== null && previous.to < sorted[i]!.from, `periods starting ${previous.from} and ${sorted[i]!.from} overlap`);
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
/** The period covering `date`, or a refusal. */
|
|
219
|
+
export function periodAt(tables: RateTables, date: IsoDate): RatePeriod {
|
|
220
|
+
const period = tables.periods.find((p) => p.from <= date && (p.to === null || date <= p.to));
|
|
221
|
+
return period ?? refuse("NO_RATE_PERIOD", `table ${tables.version} has no period covering ${date}`);
|
|
222
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `@12-apps/fiscal/manifest` — the SHARED wiring manifest, a SKELETON.
|
|
3
|
+
*
|
|
4
|
+
* What it declares today is what exists today:
|
|
5
|
+
*
|
|
6
|
+
* - `permissions` — `fiscal:read`, `fiscal:manage`, `fiscal:issue`,
|
|
7
|
+
* `fiscal:cancel`: data, valid with no route or table behind them yet, and
|
|
8
|
+
* declared now so a host composes the catalog once.
|
|
9
|
+
*
|
|
10
|
+
* The first module, `./engine`, is a pure function a host calls; it has
|
|
11
|
+
* nothing to wire. The document module (FUT-2237) adds, in this manifest:
|
|
12
|
+
* `db` (the emitter profile, the fiscal document and its events, a number
|
|
13
|
+
* counter per issuing point and series), `server: ["http", "jobs"]` (profile,
|
|
14
|
+
* certificate upload, issue, cancel, look up; retry, contingency
|
|
15
|
+
* transmission, certificate-expiry warning), `notifications` (certificate
|
|
16
|
+
* expiring, document rejected) and `web: ["surface"]` (the fiscal settings
|
|
17
|
+
* screen and the documents list), with `observability: { namespace: "fiscal" }`
|
|
18
|
+
* once there is running code to log — declaring it now would only make every
|
|
19
|
+
* host bind a logger for a pure function that throws and never logs. Until then `.wiring-conformance.json`
|
|
20
|
+
* answers each of those with its reason.
|
|
21
|
+
*
|
|
22
|
+
* `@12-apps/wiring` is a TYPE-ONLY dependency: the manifest is a plain
|
|
23
|
+
* `satisfies`-checked value, and the producer's assertions run in this
|
|
24
|
+
* package's own test suite.
|
|
25
|
+
*/
|
|
26
|
+
|
|
27
|
+
import type { PackageManifest } from "@12-apps/wiring";
|
|
28
|
+
|
|
29
|
+
import { FISCAL_PERMISSIONS } from "./permissions";
|
|
30
|
+
|
|
31
|
+
export { FISCAL_CANCEL, FISCAL_ISSUE, FISCAL_MANAGE, FISCAL_PERMISSIONS, FISCAL_READ } from "./permissions";
|
|
32
|
+
|
|
33
|
+
export const fiscalManifest = {
|
|
34
|
+
name: "@12-apps/fiscal",
|
|
35
|
+
contract: 1,
|
|
36
|
+
permissions: FISCAL_PERMISSIONS,
|
|
37
|
+
} as const satisfies PackageManifest;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The package's permissions, declared HERE and nowhere else (the owner's
|
|
3
|
+
* decision on FUT-2237): a host composes them into its RBAC catalog and
|
|
4
|
+
* decides which roles hold them. The ids are mechanism; the words a picker
|
|
5
|
+
* shows are the host's, so no `labels` ship.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import type { WirePermissionsContribution } from "@12-apps/wiring";
|
|
9
|
+
|
|
10
|
+
/** See the fiscal settings and the documents issued. */
|
|
11
|
+
export const FISCAL_READ = "fiscal:read";
|
|
12
|
+
/** Edit the emitter profile and its certificate. */
|
|
13
|
+
export const FISCAL_MANAGE = "fiscal:manage";
|
|
14
|
+
/** Issue a fiscal document. */
|
|
15
|
+
export const FISCAL_ISSUE = "fiscal:issue";
|
|
16
|
+
/** Cancel an issued fiscal document. */
|
|
17
|
+
export const FISCAL_CANCEL = "fiscal:cancel";
|
|
18
|
+
|
|
19
|
+
export const FISCAL_PERMISSIONS = {
|
|
20
|
+
source: "@12-apps/fiscal",
|
|
21
|
+
ids: [FISCAL_READ, FISCAL_MANAGE, FISCAL_ISSUE, FISCAL_CANCEL],
|
|
22
|
+
permissions: {
|
|
23
|
+
[FISCAL_READ]: { kind: "class" },
|
|
24
|
+
[FISCAL_MANAGE]: { kind: "class" },
|
|
25
|
+
[FISCAL_ISSUE]: { kind: "class" },
|
|
26
|
+
[FISCAL_CANCEL]: { kind: "class" },
|
|
27
|
+
},
|
|
28
|
+
} as const satisfies WirePermissionsContribution;
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": "ibs-cbs/2026-11-13",
|
|
3
|
+
"notes": [
|
|
4
|
+
"IBS/CBS rates by period of the date of the supply, in basis points (1 bp = 0.01%).",
|
|
5
|
+
"status LAW: every figure of the period is fixed by statute. status ESTIMATE: at least one figure is not yet published (the CBS reference rate fixed by Senate resolution, the IBS reference rates of 2029 onward) and carries the government's announced estimate; a result computed on an ESTIMATE period is stamped provisional.",
|
|
6
|
+
"A new table is a new file with a new version, never an edit of this one: a result stamped with this version must reproduce from it.",
|
|
7
|
+
"taxInsidePrice: whether a line's value is the tax-inclusive price (the tax composes vProd, NT 2026.008) or the base itself (2026)."
|
|
8
|
+
],
|
|
9
|
+
"gorjetaCapBp": 1500,
|
|
10
|
+
"gorjetaCapSource": "LC 214/2025 art. 274 par. unico I",
|
|
11
|
+
"exclusionClasses": {
|
|
12
|
+
"GORJETA": {
|
|
13
|
+
"cClassTrib": "410019",
|
|
14
|
+
"cstIbsCbs": "410"
|
|
15
|
+
},
|
|
16
|
+
"INTERMEDIATION": {
|
|
17
|
+
"cClassTrib": "410020",
|
|
18
|
+
"cstIbsCbs": "410"
|
|
19
|
+
},
|
|
20
|
+
"source": "Informe Tecnico 2025.002 classes 410019 (gorjeta) and 410020 (intermediation), both 'Sem aliquota'; RCBS art. 399 par. 2 (segregated on the document)"
|
|
21
|
+
},
|
|
22
|
+
"specialRegimes": {
|
|
23
|
+
"BARES_RESTAURANTES": {
|
|
24
|
+
"reductionBp": 4000,
|
|
25
|
+
"source": "LC 214/2025 art. 275"
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
"periods": [
|
|
29
|
+
{
|
|
30
|
+
"from": "2026-01-01",
|
|
31
|
+
"to": "2026-12-31",
|
|
32
|
+
"status": "LAW",
|
|
33
|
+
"source": "LC 214/2025 arts. 343 (IBS 0.1% state), 346 (CBS 0.9%), 348 par. 1 (payment waived), 348 III c (not applied to Simples Nacional optants); tax not part of vProd in 2026",
|
|
34
|
+
"informative": true,
|
|
35
|
+
"appliesToSimplesNacional": false,
|
|
36
|
+
"taxInsidePrice": false,
|
|
37
|
+
"cbsBp": 90,
|
|
38
|
+
"ibsUf": {
|
|
39
|
+
"referenceBp": 10,
|
|
40
|
+
"byUf": {}
|
|
41
|
+
},
|
|
42
|
+
"ibsMun": {
|
|
43
|
+
"referenceBp": 0,
|
|
44
|
+
"byMunicipality": {}
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
"from": "2027-01-01",
|
|
49
|
+
"to": "2028-12-31",
|
|
50
|
+
"status": "ESTIMATE",
|
|
51
|
+
"source": "LC 214/2025 art. 344 (IBS 0.05% state + 0.05% municipal); CBS: Fazenda's estimated reference rate 8.8% less 0.1 point, pending the Senate resolution (arts. 349 I, 353-359); from 2027 IBS/CBS compose vProd and the net value goes in vProdLiq (NT 2026.008)",
|
|
52
|
+
"informative": false,
|
|
53
|
+
"appliesToSimplesNacional": true,
|
|
54
|
+
"taxInsidePrice": true,
|
|
55
|
+
"cbsBp": 870,
|
|
56
|
+
"ibsUf": {
|
|
57
|
+
"referenceBp": 5,
|
|
58
|
+
"byUf": {}
|
|
59
|
+
},
|
|
60
|
+
"ibsMun": {
|
|
61
|
+
"referenceBp": 5,
|
|
62
|
+
"byMunicipality": {}
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
"from": "2029-01-01",
|
|
67
|
+
"to": "2029-12-31",
|
|
68
|
+
"status": "ESTIMATE",
|
|
69
|
+
"source": "IBS at one tenth of the estimated reference (17.7%: 10.0% state + 7.7% municipal) as ICMS/ISS step down (LC 214/2025 art. 342; arts. 501, 508); CBS at the estimated reference 8.8%",
|
|
70
|
+
"informative": false,
|
|
71
|
+
"appliesToSimplesNacional": true,
|
|
72
|
+
"taxInsidePrice": true,
|
|
73
|
+
"cbsBp": 880,
|
|
74
|
+
"ibsUf": {
|
|
75
|
+
"referenceBp": 100,
|
|
76
|
+
"byUf": {}
|
|
77
|
+
},
|
|
78
|
+
"ibsMun": {
|
|
79
|
+
"referenceBp": 77,
|
|
80
|
+
"byMunicipality": {}
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
"from": "2030-01-01",
|
|
85
|
+
"to": "2030-12-31",
|
|
86
|
+
"status": "ESTIMATE",
|
|
87
|
+
"source": "IBS at two tenths of the estimated reference; CBS at the estimated reference",
|
|
88
|
+
"informative": false,
|
|
89
|
+
"appliesToSimplesNacional": true,
|
|
90
|
+
"taxInsidePrice": true,
|
|
91
|
+
"cbsBp": 880,
|
|
92
|
+
"ibsUf": {
|
|
93
|
+
"referenceBp": 200,
|
|
94
|
+
"byUf": {}
|
|
95
|
+
},
|
|
96
|
+
"ibsMun": {
|
|
97
|
+
"referenceBp": 154,
|
|
98
|
+
"byMunicipality": {}
|
|
99
|
+
}
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
"from": "2031-01-01",
|
|
103
|
+
"to": "2031-12-31",
|
|
104
|
+
"status": "ESTIMATE",
|
|
105
|
+
"source": "IBS at three tenths of the estimated reference; CBS at the estimated reference",
|
|
106
|
+
"informative": false,
|
|
107
|
+
"appliesToSimplesNacional": true,
|
|
108
|
+
"taxInsidePrice": true,
|
|
109
|
+
"cbsBp": 880,
|
|
110
|
+
"ibsUf": {
|
|
111
|
+
"referenceBp": 300,
|
|
112
|
+
"byUf": {}
|
|
113
|
+
},
|
|
114
|
+
"ibsMun": {
|
|
115
|
+
"referenceBp": 231,
|
|
116
|
+
"byMunicipality": {}
|
|
117
|
+
}
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
"from": "2032-01-01",
|
|
121
|
+
"to": "2032-12-31",
|
|
122
|
+
"status": "ESTIMATE",
|
|
123
|
+
"source": "IBS at four tenths of the estimated reference; CBS at the estimated reference",
|
|
124
|
+
"informative": false,
|
|
125
|
+
"appliesToSimplesNacional": true,
|
|
126
|
+
"taxInsidePrice": true,
|
|
127
|
+
"cbsBp": 880,
|
|
128
|
+
"ibsUf": {
|
|
129
|
+
"referenceBp": 400,
|
|
130
|
+
"byUf": {}
|
|
131
|
+
},
|
|
132
|
+
"ibsMun": {
|
|
133
|
+
"referenceBp": 308,
|
|
134
|
+
"byMunicipality": {}
|
|
135
|
+
}
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
"from": "2033-01-01",
|
|
139
|
+
"to": null,
|
|
140
|
+
"status": "ESTIMATE",
|
|
141
|
+
"source": "ICMS and ISS extinct; IBS and CBS at the estimated full reference rates (17.7% + 8.8%, inside the 26-28% band of the government's estimate)",
|
|
142
|
+
"informative": false,
|
|
143
|
+
"appliesToSimplesNacional": true,
|
|
144
|
+
"taxInsidePrice": true,
|
|
145
|
+
"cbsBp": 880,
|
|
146
|
+
"ibsUf": {
|
|
147
|
+
"referenceBp": 1000,
|
|
148
|
+
"byUf": {}
|
|
149
|
+
},
|
|
150
|
+
"ibsMun": {
|
|
151
|
+
"referenceBp": 770,
|
|
152
|
+
"byMunicipality": {}
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
]
|
|
156
|
+
}
|