Supabase CLI v3: local is the new default, and your CI needs --remote --yes
Supabase CLI v3 targets the local database by default and asks before touching your hosted project. What breaks in CI and how to migrate.
- supabase
- devops
- backend
Technical Note 2026.008 (net product value) goes live on Dec 14. What changes in the NF-e XML, rejections 1279, 1282 and 1283, and how to validate first.

Igor Calabraro
· 9 min read
On November 12, Brazil's IBS Steering Committee and the Federal Revenue Service posted a notice on the SVRS DF-e Portal that reshuffled the calendar for anyone issuing electronic invoices: the Technical Notes (NTs) scheduled to go live on 2026-11-16 were moved to 2026-12-14. One of them is NT 2026.008, "Net Product Value", which changes the XML of the NF-e (model 55) and the NFC-e (model 65). The stated reason is to give companies and tax authorities more time to test. My take: this delay is not slack, it is the window to build the validation into your own system, instead of letting the tax authority (Sefaz) find the error for you on go-live day.
If you run an e-commerce store, an ERP or any flow that issues invoices automatically, this post covers what changed in the layout, which new rejections show up, and a TypeScript validator you can run before transmitting.
The notice lists the NTs moving from Nov 16 to Dec 14 in production:
| Document | Technical Note | Subject |
|---|---|---|
| NF-e | NT 2026.005 v1.00 | Simples Nacional (small-business tax regime) |
| NF-e | NT 2026.006 v1.01 | Payment linking |
| NF-e / NFC-e | NT 2026.008 v1.00 and v1.01 | Net product value |
| CT-e, BP-e, NF3e, NFAg, NFCom, NFGas | NT 2026.004 v1.01 | Net product value |
Two remarks from the notice itself matter: NT 2026.001 v1.00 (NF-e ABI) was already set for Dec 14 and stays there, and NTs 2025.002 (v1.50, v1.52 and v1.53) and 2026.007 (v1.00 and v1.10) were not postponed, because they only fix errors. In other words, not everything slipped to December.
NT 2026.008 adds an optional sequence called I11a inside each item (group I01) and a new field in the totals (group W01):
| Field | ID | Where | Format | Description in the NT |
|---|---|---|---|---|
vUnComLiq | I11b | Sequence I11a, per item | 11v0-10 (up to 10 decimals) | Net unit value, without taxes |
vProdLiq | I11c | Sequence I11a, per item | 13v2 | Net product value, without taxes |
vProdLiqTot | W01a | Invoice totals | 13v2, occurrence 0-1 | Sum of the items' net values |
For now the I11a sequence is optional (occurrence 0-1), but the NT says it will become mandatory. When it is present, vUnComLiq and vProdLiq are required inside it.
The idea is to separate, explicitly, the product value before taxes from the item value with taxes. The NT's introduction defines vProdLiq as the value without any tax, vItem as the item's total value including all taxes, and vNFTot as the sum of the vItem values. With the new IBS and CBS taxes showing up on invoices, leaving that math implicit inside vProd no longer works.
There are four validation rules tied to net value, all for models 55 and 65:
| Code | Rule | When it fires |
|---|---|---|
| 1278 | I11c-10 | vProdLiq missing (marked as future implementation) |
| 1279 | I11c-20 | Regular invoice (finNFe=1) with vProdLiq different from vUnComLiq × qCom, with a tolerance of BRL 0.01 either way |
| 1282 | W01a-10 | Some item has vProdLiq, but the invoice has no vProdLiqTot |
| 1283 | W01a-20 | vProdLiqTot different from the sum of the items' vProdLiq |
Rule 1278 is the one that will make the group mandatory once it is switched on. The other three apply to anyone who starts filling in the fields: if you send the net value on one item, you must close the total and get the multiplication right.
The classic mistake here is doing money math with number. With vUnComLiq allowing up to 10 decimal places, multiplying it by a quantity with 4 decimals in floating point is an invitation to the one-cent difference that turns into a rejection. In my view, the safest route is to work with scaled integers (bigint) and only format at the end:
// valor-liquido.ts: computes and checks the NT 2026.008 fields
const SCALE = 10n; // vUnComLiq allows up to 10 decimal places (11v0-10)
/** Turns "12.3456" into an integer scaled by 10^places, never touching floats. */
function toScaled(value: string, places: bigint): bigint {
const [int = "0", frac = ""] = value.trim().split(".");
if (!/^\d+$/.test(int) || !/^\d*$/.test(frac) || BigInt(frac.length) > places) {
throw new Error(`Invalid value for ${places} decimals: ${value}`);
}
return BigInt(int + frac.padEnd(Number(places), "0"));
}
/** Formats cents as "123.45", the XML's 13v2 format. */
export function formatCents(cents: bigint): string {
const s = cents.toString().padStart(3, "0");
return `${s.slice(0, -2)}.${s.slice(-2)}`;
}
export interface ItemLiquido {
qCom: string; // commercial quantity, up to 4 decimals
vUnComLiq: string; // net unit value, up to 10 decimals
}
/** vProdLiq = vUnComLiq × qCom, rounded to 2 decimals (half up). */
export function calcularVProdLiq(item: ItemLiquido): bigint {
const unit = toScaled(item.vUnComLiq, SCALE);
const qtd = toScaled(item.qCom, 4n);
const divisor = 10n ** (SCALE + 4n - 2n); // from 10^14 down to cents
return (unit * qtd + divisor / 2n) / divisor;
}
export interface Rejeicao {
codigo: 1279 | 1282 | 1283;
mensagem: string;
}
/** Checks the invoice before transmitting, mirroring rules 1279, 1282 and 1283. */
export function conferirValorLiquido(
itens: Array<ItemLiquido & { vProdLiq?: string }>,
vProdLiqTot: string | undefined,
finNFe: number,
): Rejeicao[] {
const erros: Rejeicao[] = [];
let soma = 0n;
let algumInformado = false;
itens.forEach((item, i) => {
if (item.vProdLiq === undefined) return;
algumInformado = true;
const informado = toScaled(item.vProdLiq, 2n);
soma += informado;
const diferenca = informado - calcularVProdLiq(item);
// 1279: regular invoices only, with a BRL 0.01 tolerance either way
if (finNFe === 1 && (diferenca > 1n || diferenca < -1n)) {
erros.push({ codigo: 1279, mensagem: `Item ${i + 1}: vProdLiq differs from computed value` });
}
});
if (algumInformado && vProdLiqTot === undefined) {
erros.push({ codigo: 1282, mensagem: "vProdLiqTot missing" });
}
if (vProdLiqTot !== undefined && toScaled(vProdLiqTot, 2n) !== soma) {
erros.push({
codigo: 1283,
mensagem: `vProdLiqTot differs from the items' sum (${formatCents(soma)})`,
});
}
return erros;
}I kept the identifiers close to the official field names, since that is how they appear in the XML and in Brazilian tax docs. And here are the tests that prove the math holds, including the one-cent tolerance:
import assert from "node:assert";
import { calcularVProdLiq, conferirValorLiquido, formatCents } from "./valor-liquido.ts";
assert.equal(formatCents(calcularVProdLiq({ qCom: "3", vUnComLiq: "19.9" })), "59.70");
assert.equal(formatCents(calcularVProdLiq({ qCom: "0.3333", vUnComLiq: "10" })), "3.33");
const itens = [
{ qCom: "3", vUnComLiq: "19.9", vProdLiq: "59.70" },
{ qCom: "2", vUnComLiq: "5.255", vProdLiq: "10.51" },
];
assert.deepEqual(conferirValorLiquido(itens, "70.21", 1), []);
assert.deepEqual(conferirValorLiquido(itens, undefined, 1).map((e) => e.codigo), [1282]);
assert.deepEqual(conferirValorLiquido(itens, "70.00", 1).map((e) => e.codigo), [1283]);
const fora = [{ qCom: "3", vUnComLiq: "19.9", vProdLiq: "59.75" }];
assert.deepEqual(conferirValorLiquido(fora, "59.75", 1).map((e) => e.codigo), [1279]);
assert.deepEqual(conferirValorLiquido(fora, "59.75", 4), []); // 1279 only applies to finNFe=1You can run it with node --experimental-strip-types on Node 22, or straight in Vitest. The point is not the code itself but where it lives: in the same step that builds the XML, before signing and transmitting. In an automated flow, a Sefaz rejection usually turns into a reprocessing queue, a customer without an invoice and someone reading logs on Monday morning.
If an invoicing provider (an NF-e API) issues your invoices, the change may show up as a new field in the payload, and the question becomes: does it compute the net value for you, or does it expect you to send it? If your own system builds the XML, the change is in your code. Either way, I recommend three things:
finNFe other than 1).In the e-commerce platform for game servers, the decision was to put invoicing inside the sale flow so that doing it right is the default path. Same reasoning here: the net value check belongs in the automated flow, not in a manual checklist.
vUnComLiq, vProdLiq and vProdLiqTot, optional for now, with rejections 1279, 1282 and 1283 for anyone who fills them in, and 1278 planned to make the group mandatory.Want this level of care in your project?
Free 30-minute diagnosis: I look at your stack and tell you what needs attention.
Get my diagnosisOne email when a new post is out. No spam — unsubscribe in one click.
Supabase CLI v3 targets the local database by default and asks before touching your hosted project. What breaks in CI and how to migrate.
Two critical RCEs in Next.js and four high-severity Node.js CVEs in one week. What changed, who is affected and how to automate the check in CI.
The same care as the posts, applied to your product. Free 30-minute diagnosis, no strings attached.