mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-28 07:51:02 +00:00
An invoice is billed to one company profile, and that profile's eTrade licence is usually a different business from the one the company registered under — so the buyer's name alone does not say which business was billed. Both document paths gain a row: the shared invoice/receipt model reads it off the already-loaded `companyProfile` relation, and the warehouse fee invoice joins `company_profiles` through the booking. `sameCompanyName` suppresses the row when it merely repeats the buyer name, which is the common case. It compares loosely because eTrade spells one legal suffix three ways (PLC / P L C / PRIVATE LIMITED COMPANY) and pads names with double spaces; it decides whether a row is worth printing and nothing else. The EIMS buyer `LegalName` is deliberately untouched — a MoR filing carries the registered entity, same rule as the seller side.