syncVatCodes
syncVatCodes(
db,positions,recipient):void
Syncs VAT codes for RMB positions based on itemVatRate and recipient. Selection rule:
- If exactly one match is found in the VAT code lookup, use it.
- If multiple matches exist, but exactly one default (vatcodeDefault === "1") is present, use that default.
- Otherwise, do not set a VAT code for the position. Uses a per-rate cache to minimize DB lookups and recalculates row amounts afterwards.
Parameters
db
DBConnection
positions
recipient
string
Returns
void
Description
Does not close the database connection