@financica/pcmn 0.1.0 → 0.1.1

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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.1.1
4
+
5
+ - Rename the `otherOperatingCharges` / `otherOperatingIncome` categories to
6
+ `otherCharges` / `otherIncome` to match the suite's existing bucket names, so
7
+ aggregation is a direct category lookup with no adapter.
8
+
3
9
  ## 0.1.0
4
10
 
5
11
  Initial release. Belgian PCMN class taxonomy:
package/dist/index.cjs CHANGED
@@ -28,7 +28,7 @@ var PCMN_PL_CLASSES = {
28
28
  },
29
29
  "64": {
30
30
  code: "64",
31
- category: "otherOperatingCharges",
31
+ category: "otherCharges",
32
32
  side: "debit",
33
33
  label: "Autres charges d'exploitation"
34
34
  },
@@ -52,7 +52,7 @@ var PCMN_PL_CLASSES = {
52
52
  },
53
53
  "74": {
54
54
  code: "74",
55
- category: "otherOperatingIncome",
55
+ category: "otherIncome",
56
56
  side: "credit",
57
57
  label: "Autres produits d'exploitation"
58
58
  },
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/pl.ts","../src/assets.ts"],"names":[],"mappings":";;;AAwCO,IAAM,eAAA,GAAyD;AAAA,EACrE,IAAA,EAAM;AAAA,IACL,IAAA,EAAM,IAAA;AAAA,IACN,QAAA,EAAU,OAAA;AAAA,IACV,IAAA,EAAM,OAAA;AAAA,IACN,KAAA,EAAO;AAAA,GACR;AAAA,EACA,IAAA,EAAM;AAAA,IACL,IAAA,EAAM,IAAA;AAAA,IACN,QAAA,EAAU,UAAA;AAAA,IACV,IAAA,EAAM,OAAA;AAAA,IACN,KAAA,EAAO;AAAA,GACR;AAAA,EACA,IAAA,EAAM;AAAA,IACL,IAAA,EAAM,IAAA;AAAA,IACN,QAAA,EAAU,WAAA;AAAA,IACV,IAAA,EAAM,OAAA;AAAA,IACN,KAAA,EAAO;AAAA,GACR;AAAA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AAA;AAAA,IACP,KAAA,EAAO,0EAAA;AAAA,IACP,WAAA,EAAa;AAAA,GACd;AAAA,EACA,IAAA,EAAM;AAAA,IACL,IAAA,EAAM,IAAA;AAAA,IACN,KAAA,EAAO,UAAA;AAAA,IACP,KAAA,EAAO,oCAAA;AAAA,IACP,WAAA,EAAa;AAAA,GACd;AAAA,EACA,IAAA,EAAM;AAAA,IACL,IAAA,EAAM,IAAA;AAAA,IACN,KAAA,EAAO,UAAA;AAAA,IACP,KAAA,EAAO,4DAAA;AAAA,IACP,WAAA,EAAa;AAAA,GACd;AAAA,EACA,IAAA,EAAM;AAAA,IACL,IAAA,EAAM,IAAA;AAAA,IACN,KAAA,EAAO,WAAA;AAAA,IACP,KAAA,EAAO,gCAAA;AAAA,IACP,WAAA,EAAa;AAAA;AAEf;AAGO,SAAS,uBAAuB,IAAA,EAAsC;AAC5E,EAAA,OAAO,wBAAA,CAAyB,KAAK,IAAA,EAAK,CAAE,MAAM,CAAA,EAAG,CAAC,CAAC,CAAA,EAAG,KAAA,IAAS,IAAA;AACpE","file":"index.cjs","sourcesContent":["/**\n * Belgian PCMN (Plan Comptable Minimum Normalisé) profit-and-loss taxonomy: the\n * 2-digit account classes of the statutory income statement and the economic\n * categories the Financica suite groups them into. This is the single shared\n * definition: financica aggregates its real ledger through it, and\n * financica-plan projects the same categories, so a plan and its actuals\n * reconcile line for line.\n */\n\n/** Economic P&L buckets, aligned to the Belgian statutory income statement. */\nexport type PlCategory =\n\t| \"revenue\"\n\t| \"goods\"\n\t| \"services\"\n\t| \"personnel\"\n\t| \"depreciation\"\n\t| \"otherOperatingCharges\"\n\t| \"otherOperatingIncome\"\n\t| \"financialCharges\"\n\t| \"financialIncome\"\n\t| \"exceptionalCharges\"\n\t| \"exceptionalIncome\";\n\n/** Natural balance side: charges (6x) are debit, income (7x) is credit. */\nexport type PlSide = \"debit\" | \"credit\";\n\nexport interface PcmnPlClass {\n\t/** 2-digit PCMN class, e.g. \"60\". */\n\treadonly code: string;\n\treadonly category: PlCategory;\n\treadonly side: PlSide;\n\t/** French rubric of the Belgian income statement. */\n\treadonly label: string;\n}\n\n/**\n * The compared P&L classes (charges 60-66, income 70-76). Classes outside this\n * set (71 stock variation, 72 own work capitalised, 73 subsidies, ...) are not\n * mapped: both apps leave them out of the compared categories.\n */\nexport const PCMN_PL_CLASSES: Readonly<Record<string, PcmnPlClass>> = {\n\t\"60\": {\n\t\tcode: \"60\",\n\t\tcategory: \"goods\",\n\t\tside: \"debit\",\n\t\tlabel: \"Approvisionnements et marchandises\",\n\t},\n\t\"61\": {\n\t\tcode: \"61\",\n\t\tcategory: \"services\",\n\t\tside: \"debit\",\n\t\tlabel: \"Services et biens divers\",\n\t},\n\t\"62\": {\n\t\tcode: \"62\",\n\t\tcategory: \"personnel\",\n\t\tside: \"debit\",\n\t\tlabel: \"Rémunérations, charges sociales et pensions\",\n\t},\n\t\"63\": {\n\t\tcode: \"63\",\n\t\tcategory: \"depreciation\",\n\t\tside: \"debit\",\n\t\tlabel: \"Amortissements, réductions de valeur et provisions\",\n\t},\n\t\"64\": {\n\t\tcode: \"64\",\n\t\tcategory: \"otherOperatingCharges\",\n\t\tside: \"debit\",\n\t\tlabel: \"Autres charges d'exploitation\",\n\t},\n\t\"65\": {\n\t\tcode: \"65\",\n\t\tcategory: \"financialCharges\",\n\t\tside: \"debit\",\n\t\tlabel: \"Charges financières\",\n\t},\n\t\"66\": {\n\t\tcode: \"66\",\n\t\tcategory: \"exceptionalCharges\",\n\t\tside: \"debit\",\n\t\tlabel: \"Charges exceptionnelles\",\n\t},\n\t\"70\": {\n\t\tcode: \"70\",\n\t\tcategory: \"revenue\",\n\t\tside: \"credit\",\n\t\tlabel: \"Chiffre d'affaires\",\n\t},\n\t\"74\": {\n\t\tcode: \"74\",\n\t\tcategory: \"otherOperatingIncome\",\n\t\tside: \"credit\",\n\t\tlabel: \"Autres produits d'exploitation\",\n\t},\n\t\"75\": {\n\t\tcode: \"75\",\n\t\tcategory: \"financialIncome\",\n\t\tside: \"credit\",\n\t\tlabel: \"Produits financiers\",\n\t},\n\t\"76\": {\n\t\tcode: \"76\",\n\t\tcategory: \"exceptionalIncome\",\n\t\tside: \"credit\",\n\t\tlabel: \"Produits exceptionnels\",\n\t},\n};\n\n/**\n * PCMN 618 — remuneration and benefits of company directors/managers who are\n * NOT employed under a contract of employment (dirigeants d'entreprise\n * indépendants). It belongs to class 61 \"Services et biens divers\", NOT class\n * 62 \"Rémunérations\". This is the one PCMN subtlety that both apps must get\n * right so an owner's own pay reconciles between a plan and its actuals.\n */\nexport const DIRECTOR_REMUNERATION_ACCOUNT = \"618\";\n\n/**\n * The P&L category for a PCMN account code of any length (2-digit class up to a\n * full leaf code), or null when the code is not one of the compared P&L\n * classes. Applies the 618 rule explicitly before falling back to the class, so\n * self-employed director remuneration is never miscounted as personnel.\n */\nexport function plCategoryForCode(code: string): PlCategory | null {\n\tconst trimmed = code.trim();\n\tif (trimmed.startsWith(DIRECTOR_REMUNERATION_ACCOUNT)) return \"services\";\n\treturn PCMN_PL_CLASSES[trimmed.slice(0, 2)]?.category ?? null;\n}\n\n/**\n * PCMN liquidity classes (valeurs disponibles): 54 term deposits, 55 banks, 57\n * cash on hand. Their net movement is the treasury / cash position. (50-53\n * current investments and 56 are excluded, matching the suite's cash view.)\n */\nexport const CASH_CLASSES = [\"54\", \"55\", \"57\"] as const;\nexport type CashClass = (typeof CASH_CLASSES)[number];\n\n/** Whether an account code belongs to a liquidity (cash) class. */\nexport function isCashClass(code: string): boolean {\n\treturn (CASH_CLASSES as readonly string[]).includes(code.trim().slice(0, 2));\n}\n","/**\n * Belgian PCMN fixed-asset taxonomy (balance-sheet classes 20-28). Used by\n * financica-plan to model investments and their depreciation against the\n * statutory asset rubrics.\n */\n\n/** Statutory fixed-asset groups of the Belgian balance sheet. */\nexport type FixedAssetGroup =\n\t| \"formationExpenses\" // 20 frais d'établissement\n\t| \"intangible\" // 21 immobilisations incorporelles\n\t| \"tangible\" // 22-27 immobilisations corporelles\n\t| \"financial\"; // 28 immobilisations financières\n\nexport interface PcmnFixedAssetClass {\n\t/** 2-digit PCMN class, e.g. \"22\". */\n\treadonly code: string;\n\treadonly group: FixedAssetGroup;\n\t/** French rubric of the Belgian balance sheet. */\n\treadonly label: string;\n\t/**\n\t * Whether the class is depreciated at all. Financial assets (28) and\n\t * assets under construction (27) are not; land within 22 is not either,\n\t * but that split is finer than the class and left to the caller.\n\t */\n\treadonly depreciable: boolean;\n}\n\nexport const PCMN_FIXED_ASSET_CLASSES: Readonly<\n\tRecord<string, PcmnFixedAssetClass>\n> = {\n\t\"20\": {\n\t\tcode: \"20\",\n\t\tgroup: \"formationExpenses\",\n\t\tlabel: \"Frais d'établissement\",\n\t\tdepreciable: true,\n\t},\n\t\"21\": {\n\t\tcode: \"21\",\n\t\tgroup: \"intangible\",\n\t\tlabel: \"Immobilisations incorporelles\",\n\t\tdepreciable: true,\n\t},\n\t\"22\": {\n\t\tcode: \"22\",\n\t\tgroup: \"tangible\",\n\t\tlabel: \"Terrains et constructions\",\n\t\tdepreciable: true,\n\t},\n\t\"23\": {\n\t\tcode: \"23\",\n\t\tgroup: \"tangible\",\n\t\tlabel: \"Installations, machines et outillage\",\n\t\tdepreciable: true,\n\t},\n\t\"24\": {\n\t\tcode: \"24\",\n\t\tgroup: \"tangible\",\n\t\tlabel: \"Mobilier et matériel roulant\",\n\t\tdepreciable: true,\n\t},\n\t\"25\": {\n\t\tcode: \"25\",\n\t\tgroup: \"tangible\",\n\t\tlabel: \"Immobilisations détenues en location-financement et droits similaires\",\n\t\tdepreciable: true,\n\t},\n\t\"26\": {\n\t\tcode: \"26\",\n\t\tgroup: \"tangible\",\n\t\tlabel: \"Autres immobilisations corporelles\",\n\t\tdepreciable: true,\n\t},\n\t\"27\": {\n\t\tcode: \"27\",\n\t\tgroup: \"tangible\",\n\t\tlabel: \"Immobilisations corporelles en cours et acomptes versés\",\n\t\tdepreciable: false,\n\t},\n\t\"28\": {\n\t\tcode: \"28\",\n\t\tgroup: \"financial\",\n\t\tlabel: \"Immobilisations financières\",\n\t\tdepreciable: false,\n\t},\n};\n\n/** The fixed-asset group for a PCMN account code, or null if not classes 20-28. */\nexport function fixedAssetGroupForCode(code: string): FixedAssetGroup | null {\n\treturn PCMN_FIXED_ASSET_CLASSES[code.trim().slice(0, 2)]?.group ?? null;\n}\n"]}
1
+ {"version":3,"sources":["../src/pl.ts","../src/assets.ts"],"names":[],"mappings":";;;AAwCO,IAAM,eAAA,GAAyD;AAAA,EACrE,IAAA,EAAM;AAAA,IACL,IAAA,EAAM,IAAA;AAAA,IACN,QAAA,EAAU,OAAA;AAAA,IACV,IAAA,EAAM,OAAA;AAAA,IACN,KAAA,EAAO;AAAA,GACR;AAAA,EACA,IAAA,EAAM;AAAA,IACL,IAAA,EAAM,IAAA;AAAA,IACN,QAAA,EAAU,UAAA;AAAA,IACV,IAAA,EAAM,OAAA;AAAA,IACN,KAAA,EAAO;AAAA,GACR;AAAA,EACA,IAAA,EAAM;AAAA,IACL,IAAA,EAAM,IAAA;AAAA,IACN,QAAA,EAAU,WAAA;AAAA,IACV,IAAA,EAAM,OAAA;AAAA,IACN,KAAA,EAAO;AAAA,GACR;AAAA,EACA,IAAA,EAAM;AAAA,IACL,IAAA,EAAM,IAAA;AAAA,IACN,QAAA,EAAU,cAAA;AAAA,IACV,IAAA,EAAM,OAAA;AAAA,IACN,KAAA,EAAO;AAAA,GACR;AAAA,EACA,IAAA,EAAM;AAAA,IACL,IAAA,EAAM,IAAA;AAAA,IACN,QAAA,EAAU,cAAA;AAAA,IACV,IAAA,EAAM,OAAA;AAAA,IACN,KAAA,EAAO;AAAA,GACR;AAAA,EACA,IAAA,EAAM;AAAA,IACL,IAAA,EAAM,IAAA;AAAA,IACN,QAAA,EAAU,kBAAA;AAAA,IACV,IAAA,EAAM,OAAA;AAAA,IACN,KAAA,EAAO;AAAA,GACR;AAAA,EACA,IAAA,EAAM;AAAA,IACL,IAAA,EAAM,IAAA;AAAA,IACN,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AAAA;AAEf;AAGO,SAAS,uBAAuB,IAAA,EAAsC;AAC5E,EAAA,OAAO,wBAAA,CAAyB,KAAK,IAAA,EAAK,CAAE,MAAM,CAAA,EAAG,CAAC,CAAC,CAAA,EAAG,KAAA,IAAS,IAAA;AACpE","file":"index.cjs","sourcesContent":["/**\n * Belgian PCMN (Plan Comptable Minimum Normalisé) profit-and-loss taxonomy: the\n * 2-digit account classes of the statutory income statement and the economic\n * categories the Financica suite groups them into. This is the single shared\n * definition: financica aggregates its real ledger through it, and\n * financica-plan projects the same categories, so a plan and its actuals\n * reconcile line for line.\n */\n\n/** Economic P&L buckets, aligned to the Belgian statutory income statement. */\nexport type PlCategory =\n\t| \"revenue\"\n\t| \"goods\"\n\t| \"services\"\n\t| \"personnel\"\n\t| \"depreciation\"\n\t| \"otherCharges\"\n\t| \"otherIncome\"\n\t| \"financialCharges\"\n\t| \"financialIncome\"\n\t| \"exceptionalCharges\"\n\t| \"exceptionalIncome\";\n\n/** Natural balance side: charges (6x) are debit, income (7x) is credit. */\nexport type PlSide = \"debit\" | \"credit\";\n\nexport interface PcmnPlClass {\n\t/** 2-digit PCMN class, e.g. \"60\". */\n\treadonly code: string;\n\treadonly category: PlCategory;\n\treadonly side: PlSide;\n\t/** French rubric of the Belgian income statement. */\n\treadonly label: string;\n}\n\n/**\n * The compared P&L classes (charges 60-66, income 70-76). Classes outside this\n * set (71 stock variation, 72 own work capitalised, 73 subsidies, ...) are not\n * mapped: both apps leave them out of the compared categories.\n */\nexport const PCMN_PL_CLASSES: Readonly<Record<string, PcmnPlClass>> = {\n\t\"60\": {\n\t\tcode: \"60\",\n\t\tcategory: \"goods\",\n\t\tside: \"debit\",\n\t\tlabel: \"Approvisionnements et marchandises\",\n\t},\n\t\"61\": {\n\t\tcode: \"61\",\n\t\tcategory: \"services\",\n\t\tside: \"debit\",\n\t\tlabel: \"Services et biens divers\",\n\t},\n\t\"62\": {\n\t\tcode: \"62\",\n\t\tcategory: \"personnel\",\n\t\tside: \"debit\",\n\t\tlabel: \"Rémunérations, charges sociales et pensions\",\n\t},\n\t\"63\": {\n\t\tcode: \"63\",\n\t\tcategory: \"depreciation\",\n\t\tside: \"debit\",\n\t\tlabel: \"Amortissements, réductions de valeur et provisions\",\n\t},\n\t\"64\": {\n\t\tcode: \"64\",\n\t\tcategory: \"otherCharges\",\n\t\tside: \"debit\",\n\t\tlabel: \"Autres charges d'exploitation\",\n\t},\n\t\"65\": {\n\t\tcode: \"65\",\n\t\tcategory: \"financialCharges\",\n\t\tside: \"debit\",\n\t\tlabel: \"Charges financières\",\n\t},\n\t\"66\": {\n\t\tcode: \"66\",\n\t\tcategory: \"exceptionalCharges\",\n\t\tside: \"debit\",\n\t\tlabel: \"Charges exceptionnelles\",\n\t},\n\t\"70\": {\n\t\tcode: \"70\",\n\t\tcategory: \"revenue\",\n\t\tside: \"credit\",\n\t\tlabel: \"Chiffre d'affaires\",\n\t},\n\t\"74\": {\n\t\tcode: \"74\",\n\t\tcategory: \"otherIncome\",\n\t\tside: \"credit\",\n\t\tlabel: \"Autres produits d'exploitation\",\n\t},\n\t\"75\": {\n\t\tcode: \"75\",\n\t\tcategory: \"financialIncome\",\n\t\tside: \"credit\",\n\t\tlabel: \"Produits financiers\",\n\t},\n\t\"76\": {\n\t\tcode: \"76\",\n\t\tcategory: \"exceptionalIncome\",\n\t\tside: \"credit\",\n\t\tlabel: \"Produits exceptionnels\",\n\t},\n};\n\n/**\n * PCMN 618 — remuneration and benefits of company directors/managers who are\n * NOT employed under a contract of employment (dirigeants d'entreprise\n * indépendants). It belongs to class 61 \"Services et biens divers\", NOT class\n * 62 \"Rémunérations\". This is the one PCMN subtlety that both apps must get\n * right so an owner's own pay reconciles between a plan and its actuals.\n */\nexport const DIRECTOR_REMUNERATION_ACCOUNT = \"618\";\n\n/**\n * The P&L category for a PCMN account code of any length (2-digit class up to a\n * full leaf code), or null when the code is not one of the compared P&L\n * classes. Applies the 618 rule explicitly before falling back to the class, so\n * self-employed director remuneration is never miscounted as personnel.\n */\nexport function plCategoryForCode(code: string): PlCategory | null {\n\tconst trimmed = code.trim();\n\tif (trimmed.startsWith(DIRECTOR_REMUNERATION_ACCOUNT)) return \"services\";\n\treturn PCMN_PL_CLASSES[trimmed.slice(0, 2)]?.category ?? null;\n}\n\n/**\n * PCMN liquidity classes (valeurs disponibles): 54 term deposits, 55 banks, 57\n * cash on hand. Their net movement is the treasury / cash position. (50-53\n * current investments and 56 are excluded, matching the suite's cash view.)\n */\nexport const CASH_CLASSES = [\"54\", \"55\", \"57\"] as const;\nexport type CashClass = (typeof CASH_CLASSES)[number];\n\n/** Whether an account code belongs to a liquidity (cash) class. */\nexport function isCashClass(code: string): boolean {\n\treturn (CASH_CLASSES as readonly string[]).includes(code.trim().slice(0, 2));\n}\n","/**\n * Belgian PCMN fixed-asset taxonomy (balance-sheet classes 20-28). Used by\n * financica-plan to model investments and their depreciation against the\n * statutory asset rubrics.\n */\n\n/** Statutory fixed-asset groups of the Belgian balance sheet. */\nexport type FixedAssetGroup =\n\t| \"formationExpenses\" // 20 frais d'établissement\n\t| \"intangible\" // 21 immobilisations incorporelles\n\t| \"tangible\" // 22-27 immobilisations corporelles\n\t| \"financial\"; // 28 immobilisations financières\n\nexport interface PcmnFixedAssetClass {\n\t/** 2-digit PCMN class, e.g. \"22\". */\n\treadonly code: string;\n\treadonly group: FixedAssetGroup;\n\t/** French rubric of the Belgian balance sheet. */\n\treadonly label: string;\n\t/**\n\t * Whether the class is depreciated at all. Financial assets (28) and\n\t * assets under construction (27) are not; land within 22 is not either,\n\t * but that split is finer than the class and left to the caller.\n\t */\n\treadonly depreciable: boolean;\n}\n\nexport const PCMN_FIXED_ASSET_CLASSES: Readonly<\n\tRecord<string, PcmnFixedAssetClass>\n> = {\n\t\"20\": {\n\t\tcode: \"20\",\n\t\tgroup: \"formationExpenses\",\n\t\tlabel: \"Frais d'établissement\",\n\t\tdepreciable: true,\n\t},\n\t\"21\": {\n\t\tcode: \"21\",\n\t\tgroup: \"intangible\",\n\t\tlabel: \"Immobilisations incorporelles\",\n\t\tdepreciable: true,\n\t},\n\t\"22\": {\n\t\tcode: \"22\",\n\t\tgroup: \"tangible\",\n\t\tlabel: \"Terrains et constructions\",\n\t\tdepreciable: true,\n\t},\n\t\"23\": {\n\t\tcode: \"23\",\n\t\tgroup: \"tangible\",\n\t\tlabel: \"Installations, machines et outillage\",\n\t\tdepreciable: true,\n\t},\n\t\"24\": {\n\t\tcode: \"24\",\n\t\tgroup: \"tangible\",\n\t\tlabel: \"Mobilier et matériel roulant\",\n\t\tdepreciable: true,\n\t},\n\t\"25\": {\n\t\tcode: \"25\",\n\t\tgroup: \"tangible\",\n\t\tlabel: \"Immobilisations détenues en location-financement et droits similaires\",\n\t\tdepreciable: true,\n\t},\n\t\"26\": {\n\t\tcode: \"26\",\n\t\tgroup: \"tangible\",\n\t\tlabel: \"Autres immobilisations corporelles\",\n\t\tdepreciable: true,\n\t},\n\t\"27\": {\n\t\tcode: \"27\",\n\t\tgroup: \"tangible\",\n\t\tlabel: \"Immobilisations corporelles en cours et acomptes versés\",\n\t\tdepreciable: false,\n\t},\n\t\"28\": {\n\t\tcode: \"28\",\n\t\tgroup: \"financial\",\n\t\tlabel: \"Immobilisations financières\",\n\t\tdepreciable: false,\n\t},\n};\n\n/** The fixed-asset group for a PCMN account code, or null if not classes 20-28. */\nexport function fixedAssetGroupForCode(code: string): FixedAssetGroup | null {\n\treturn PCMN_FIXED_ASSET_CLASSES[code.trim().slice(0, 2)]?.group ?? null;\n}\n"]}
package/dist/index.d.cts CHANGED
@@ -7,7 +7,7 @@
7
7
  * reconcile line for line.
8
8
  */
9
9
  /** Economic P&L buckets, aligned to the Belgian statutory income statement. */
10
- type PlCategory = "revenue" | "goods" | "services" | "personnel" | "depreciation" | "otherOperatingCharges" | "otherOperatingIncome" | "financialCharges" | "financialIncome" | "exceptionalCharges" | "exceptionalIncome";
10
+ type PlCategory = "revenue" | "goods" | "services" | "personnel" | "depreciation" | "otherCharges" | "otherIncome" | "financialCharges" | "financialIncome" | "exceptionalCharges" | "exceptionalIncome";
11
11
  /** Natural balance side: charges (6x) are debit, income (7x) is credit. */
12
12
  type PlSide = "debit" | "credit";
13
13
  interface PcmnPlClass {
package/dist/index.d.ts CHANGED
@@ -7,7 +7,7 @@
7
7
  * reconcile line for line.
8
8
  */
9
9
  /** Economic P&L buckets, aligned to the Belgian statutory income statement. */
10
- type PlCategory = "revenue" | "goods" | "services" | "personnel" | "depreciation" | "otherOperatingCharges" | "otherOperatingIncome" | "financialCharges" | "financialIncome" | "exceptionalCharges" | "exceptionalIncome";
10
+ type PlCategory = "revenue" | "goods" | "services" | "personnel" | "depreciation" | "otherCharges" | "otherIncome" | "financialCharges" | "financialIncome" | "exceptionalCharges" | "exceptionalIncome";
11
11
  /** Natural balance side: charges (6x) are debit, income (7x) is credit. */
12
12
  type PlSide = "debit" | "credit";
13
13
  interface PcmnPlClass {
package/dist/index.js CHANGED
@@ -26,7 +26,7 @@ var PCMN_PL_CLASSES = {
26
26
  },
27
27
  "64": {
28
28
  code: "64",
29
- category: "otherOperatingCharges",
29
+ category: "otherCharges",
30
30
  side: "debit",
31
31
  label: "Autres charges d'exploitation"
32
32
  },
@@ -50,7 +50,7 @@ var PCMN_PL_CLASSES = {
50
50
  },
51
51
  "74": {
52
52
  code: "74",
53
- category: "otherOperatingIncome",
53
+ category: "otherIncome",
54
54
  side: "credit",
55
55
  label: "Autres produits d'exploitation"
56
56
  },
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/pl.ts","../src/assets.ts"],"names":[],"mappings":";AAwCO,IAAM,eAAA,GAAyD;AAAA,EACrE,IAAA,EAAM;AAAA,IACL,IAAA,EAAM,IAAA;AAAA,IACN,QAAA,EAAU,OAAA;AAAA,IACV,IAAA,EAAM,OAAA;AAAA,IACN,KAAA,EAAO;AAAA,GACR;AAAA,EACA,IAAA,EAAM;AAAA,IACL,IAAA,EAAM,IAAA;AAAA,IACN,QAAA,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d;AAAA,EACA,IAAA,EAAM;AAAA,IACL,IAAA,EAAM,IAAA;AAAA,IACN,KAAA,EAAO,UAAA;AAAA,IACP,KAAA,EAAO,iCAAA;AAAA,IACP,WAAA,EAAa;AAAA,GACd;AAAA,EACA,IAAA,EAAM;AAAA,IACL,IAAA,EAAM,IAAA;AAAA,IACN,KAAA,EAAO,UAAA;AAAA,IACP,KAAA,EAAO,0EAAA;AAAA,IACP,WAAA,EAAa;AAAA,GACd;AAAA,EACA,IAAA,EAAM;AAAA,IACL,IAAA,EAAM,IAAA;AAAA,IACN,KAAA,EAAO,UAAA;AAAA,IACP,KAAA,EAAO,oCAAA;AAAA,IACP,WAAA,EAAa;AAAA,GACd;AAAA,EACA,IAAA,EAAM;AAAA,IACL,IAAA,EAAM,IAAA;AAAA,IACN,KAAA,EAAO,UAAA;AAAA,IACP,KAAA,EAAO,4DAAA;AAAA,IACP,WAAA,EAAa;AAAA,GACd;AAAA,EACA,IAAA,EAAM;AAAA,IACL,IAAA,EAAM,IAAA;AAAA,IACN,KAAA,EAAO,WAAA;AAAA,IACP,KAAA,EAAO,gCAAA;AAAA,IACP,WAAA,EAAa;AAAA;AAEf;AAGO,SAAS,uBAAuB,IAAA,EAAsC;AAC5E,EAAA,OAAO,wBAAA,CAAyB,KAAK,IAAA,EAAK,CAAE,MAAM,CAAA,EAAG,CAAC,CAAC,CAAA,EAAG,KAAA,IAAS,IAAA;AACpE","file":"index.js","sourcesContent":["/**\n * Belgian PCMN (Plan Comptable Minimum Normalisé) profit-and-loss taxonomy: the\n * 2-digit account classes of the statutory income statement and the economic\n * categories the Financica suite groups them into. This is the single shared\n * definition: financica aggregates its real ledger through it, and\n * financica-plan projects the same categories, so a plan and its actuals\n * reconcile line for line.\n */\n\n/** Economic P&L buckets, aligned to the Belgian statutory income statement. */\nexport type PlCategory =\n\t| \"revenue\"\n\t| \"goods\"\n\t| \"services\"\n\t| \"personnel\"\n\t| \"depreciation\"\n\t| \"otherOperatingCharges\"\n\t| \"otherOperatingIncome\"\n\t| \"financialCharges\"\n\t| \"financialIncome\"\n\t| \"exceptionalCharges\"\n\t| \"exceptionalIncome\";\n\n/** Natural balance side: charges (6x) are debit, income (7x) is credit. */\nexport type PlSide = \"debit\" | \"credit\";\n\nexport interface PcmnPlClass {\n\t/** 2-digit PCMN class, e.g. \"60\". */\n\treadonly code: string;\n\treadonly category: PlCategory;\n\treadonly side: PlSide;\n\t/** French rubric of the Belgian income statement. */\n\treadonly label: string;\n}\n\n/**\n * The compared P&L classes (charges 60-66, income 70-76). Classes outside this\n * set (71 stock variation, 72 own work capitalised, 73 subsidies, ...) are not\n * mapped: both apps leave them out of the compared categories.\n */\nexport const PCMN_PL_CLASSES: Readonly<Record<string, PcmnPlClass>> = {\n\t\"60\": {\n\t\tcode: \"60\",\n\t\tcategory: \"goods\",\n\t\tside: \"debit\",\n\t\tlabel: \"Approvisionnements et marchandises\",\n\t},\n\t\"61\": {\n\t\tcode: \"61\",\n\t\tcategory: \"services\",\n\t\tside: \"debit\",\n\t\tlabel: \"Services et biens divers\",\n\t},\n\t\"62\": {\n\t\tcode: \"62\",\n\t\tcategory: \"personnel\",\n\t\tside: \"debit\",\n\t\tlabel: \"Rémunérations, charges sociales et pensions\",\n\t},\n\t\"63\": {\n\t\tcode: \"63\",\n\t\tcategory: \"depreciation\",\n\t\tside: \"debit\",\n\t\tlabel: \"Amortissements, réductions de valeur et provisions\",\n\t},\n\t\"64\": {\n\t\tcode: \"64\",\n\t\tcategory: \"otherOperatingCharges\",\n\t\tside: \"debit\",\n\t\tlabel: \"Autres charges d'exploitation\",\n\t},\n\t\"65\": {\n\t\tcode: \"65\",\n\t\tcategory: \"financialCharges\",\n\t\tside: \"debit\",\n\t\tlabel: \"Charges financières\",\n\t},\n\t\"66\": {\n\t\tcode: \"66\",\n\t\tcategory: \"exceptionalCharges\",\n\t\tside: \"debit\",\n\t\tlabel: \"Charges exceptionnelles\",\n\t},\n\t\"70\": {\n\t\tcode: \"70\",\n\t\tcategory: \"revenue\",\n\t\tside: \"credit\",\n\t\tlabel: \"Chiffre d'affaires\",\n\t},\n\t\"74\": {\n\t\tcode: \"74\",\n\t\tcategory: \"otherOperatingIncome\",\n\t\tside: \"credit\",\n\t\tlabel: \"Autres produits d'exploitation\",\n\t},\n\t\"75\": {\n\t\tcode: \"75\",\n\t\tcategory: \"financialIncome\",\n\t\tside: \"credit\",\n\t\tlabel: \"Produits financiers\",\n\t},\n\t\"76\": {\n\t\tcode: \"76\",\n\t\tcategory: \"exceptionalIncome\",\n\t\tside: \"credit\",\n\t\tlabel: \"Produits exceptionnels\",\n\t},\n};\n\n/**\n * PCMN 618 — remuneration and benefits of company directors/managers who are\n * NOT employed under a contract of employment (dirigeants d'entreprise\n * indépendants). It belongs to class 61 \"Services et biens divers\", NOT class\n * 62 \"Rémunérations\". This is the one PCMN subtlety that both apps must get\n * right so an owner's own pay reconciles between a plan and its actuals.\n */\nexport const DIRECTOR_REMUNERATION_ACCOUNT = \"618\";\n\n/**\n * The P&L category for a PCMN account code of any length (2-digit class up to a\n * full leaf code), or null when the code is not one of the compared P&L\n * classes. Applies the 618 rule explicitly before falling back to the class, so\n * self-employed director remuneration is never miscounted as personnel.\n */\nexport function plCategoryForCode(code: string): PlCategory | null {\n\tconst trimmed = code.trim();\n\tif (trimmed.startsWith(DIRECTOR_REMUNERATION_ACCOUNT)) return \"services\";\n\treturn PCMN_PL_CLASSES[trimmed.slice(0, 2)]?.category ?? null;\n}\n\n/**\n * PCMN liquidity classes (valeurs disponibles): 54 term deposits, 55 banks, 57\n * cash on hand. Their net movement is the treasury / cash position. (50-53\n * current investments and 56 are excluded, matching the suite's cash view.)\n */\nexport const CASH_CLASSES = [\"54\", \"55\", \"57\"] as const;\nexport type CashClass = (typeof CASH_CLASSES)[number];\n\n/** Whether an account code belongs to a liquidity (cash) class. */\nexport function isCashClass(code: string): boolean {\n\treturn (CASH_CLASSES as readonly string[]).includes(code.trim().slice(0, 2));\n}\n","/**\n * Belgian PCMN fixed-asset taxonomy (balance-sheet classes 20-28). Used by\n * financica-plan to model investments and their depreciation against the\n * statutory asset rubrics.\n */\n\n/** Statutory fixed-asset groups of the Belgian balance sheet. */\nexport type FixedAssetGroup =\n\t| \"formationExpenses\" // 20 frais d'établissement\n\t| \"intangible\" // 21 immobilisations incorporelles\n\t| \"tangible\" // 22-27 immobilisations corporelles\n\t| \"financial\"; // 28 immobilisations financières\n\nexport interface PcmnFixedAssetClass {\n\t/** 2-digit PCMN class, e.g. \"22\". */\n\treadonly code: string;\n\treadonly group: FixedAssetGroup;\n\t/** French rubric of the Belgian balance sheet. */\n\treadonly label: string;\n\t/**\n\t * Whether the class is depreciated at all. Financial assets (28) and\n\t * assets under construction (27) are not; land within 22 is not either,\n\t * but that split is finer than the class and left to the caller.\n\t */\n\treadonly depreciable: boolean;\n}\n\nexport const PCMN_FIXED_ASSET_CLASSES: Readonly<\n\tRecord<string, PcmnFixedAssetClass>\n> = {\n\t\"20\": {\n\t\tcode: \"20\",\n\t\tgroup: \"formationExpenses\",\n\t\tlabel: \"Frais d'établissement\",\n\t\tdepreciable: true,\n\t},\n\t\"21\": {\n\t\tcode: \"21\",\n\t\tgroup: \"intangible\",\n\t\tlabel: \"Immobilisations incorporelles\",\n\t\tdepreciable: true,\n\t},\n\t\"22\": {\n\t\tcode: \"22\",\n\t\tgroup: \"tangible\",\n\t\tlabel: \"Terrains et constructions\",\n\t\tdepreciable: true,\n\t},\n\t\"23\": {\n\t\tcode: \"23\",\n\t\tgroup: \"tangible\",\n\t\tlabel: \"Installations, machines et outillage\",\n\t\tdepreciable: true,\n\t},\n\t\"24\": {\n\t\tcode: \"24\",\n\t\tgroup: \"tangible\",\n\t\tlabel: \"Mobilier et matériel roulant\",\n\t\tdepreciable: true,\n\t},\n\t\"25\": {\n\t\tcode: \"25\",\n\t\tgroup: \"tangible\",\n\t\tlabel: \"Immobilisations détenues en location-financement et droits similaires\",\n\t\tdepreciable: true,\n\t},\n\t\"26\": {\n\t\tcode: \"26\",\n\t\tgroup: \"tangible\",\n\t\tlabel: \"Autres immobilisations corporelles\",\n\t\tdepreciable: true,\n\t},\n\t\"27\": {\n\t\tcode: \"27\",\n\t\tgroup: \"tangible\",\n\t\tlabel: \"Immobilisations corporelles en cours et acomptes versés\",\n\t\tdepreciable: false,\n\t},\n\t\"28\": {\n\t\tcode: \"28\",\n\t\tgroup: \"financial\",\n\t\tlabel: \"Immobilisations financières\",\n\t\tdepreciable: false,\n\t},\n};\n\n/** The fixed-asset group for a PCMN account code, or null if not classes 20-28. */\nexport function fixedAssetGroupForCode(code: string): FixedAssetGroup | null {\n\treturn PCMN_FIXED_ASSET_CLASSES[code.trim().slice(0, 2)]?.group ?? null;\n}\n"]}
1
+ {"version":3,"sources":["../src/pl.ts","../src/assets.ts"],"names":[],"mappings":";AAwCO,IAAM,eAAA,GAAyD;AAAA,EACrE,IAAA,EAAM;AAAA,IACL,IAAA,EAAM,IAAA;AAAA,IACN,QAAA,EAAU,OAAA;AAAA,IACV,IAAA,EAAM,OAAA;AAAA,IACN,KAAA,EAAO;AAAA,GACR;AAAA,EACA,IAAA,EAAM;AAAA,IACL,IAAA,EAAM,IAAA;AAAA,IACN,QAAA,EAAU,UAAA;AAAA,IACV,IAAA,EAAM,OAAA;AAAA,IACN,KAAA,EAAO;AAAA,GACR;AAAA,EACA,IAAA,EAAM;AAAA,IACL,IAAA,EAAM,IAAA;AAAA,IACN,QAAA,EAAU,WAAA;AAAA,IACV,IAAA,EAAM,OAAA;AAAA,IACN,KAAA,EAAO;AAAA,GACR;AAAA,EACA,IAAA,EAAM;AAAA,IACL,IAAA,EAAM,IAAA;AAAA,IACN,QAAA,EAAU,cAAA;AAAA,IACV,IAAA,EAAM,OAAA;AAAA,IACN,KAAA,EAAO;AAAA,GACR;AAAA,EACA,IAAA,EAAM;AAAA,IACL,IAAA,EAAM,IAAA;AAAA,IACN,QAAA,EAAU,cAAA;AAAA,IACV,IAAA,EAAM,OAAA;AAAA,IACN,KAAA,EAAO;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N,KAAA,EAAO,UAAA;AAAA,IACP,KAAA,EAAO,4DAAA;AAAA,IACP,WAAA,EAAa;AAAA,GACd;AAAA,EACA,IAAA,EAAM;AAAA,IACL,IAAA,EAAM,IAAA;AAAA,IACN,KAAA,EAAO,WAAA;AAAA,IACP,KAAA,EAAO,gCAAA;AAAA,IACP,WAAA,EAAa;AAAA;AAEf;AAGO,SAAS,uBAAuB,IAAA,EAAsC;AAC5E,EAAA,OAAO,wBAAA,CAAyB,KAAK,IAAA,EAAK,CAAE,MAAM,CAAA,EAAG,CAAC,CAAC,CAAA,EAAG,KAAA,IAAS,IAAA;AACpE","file":"index.js","sourcesContent":["/**\n * Belgian PCMN (Plan Comptable Minimum Normalisé) profit-and-loss taxonomy: the\n * 2-digit account classes of the statutory income statement and the economic\n * categories the Financica suite groups them into. This is the single shared\n * definition: financica aggregates its real ledger through it, and\n * financica-plan projects the same categories, so a plan and its actuals\n * reconcile line for line.\n */\n\n/** Economic P&L buckets, aligned to the Belgian statutory income statement. */\nexport type PlCategory =\n\t| \"revenue\"\n\t| \"goods\"\n\t| \"services\"\n\t| \"personnel\"\n\t| \"depreciation\"\n\t| \"otherCharges\"\n\t| \"otherIncome\"\n\t| \"financialCharges\"\n\t| \"financialIncome\"\n\t| \"exceptionalCharges\"\n\t| \"exceptionalIncome\";\n\n/** Natural balance side: charges (6x) are debit, income (7x) is credit. */\nexport type PlSide = \"debit\" | \"credit\";\n\nexport interface PcmnPlClass {\n\t/** 2-digit PCMN class, e.g. \"60\". */\n\treadonly code: string;\n\treadonly category: PlCategory;\n\treadonly side: PlSide;\n\t/** French rubric of the Belgian income statement. */\n\treadonly label: string;\n}\n\n/**\n * The compared P&L classes (charges 60-66, income 70-76). Classes outside this\n * set (71 stock variation, 72 own work capitalised, 73 subsidies, ...) are not\n * mapped: both apps leave them out of the compared categories.\n */\nexport const PCMN_PL_CLASSES: Readonly<Record<string, PcmnPlClass>> = {\n\t\"60\": {\n\t\tcode: \"60\",\n\t\tcategory: \"goods\",\n\t\tside: \"debit\",\n\t\tlabel: \"Approvisionnements et marchandises\",\n\t},\n\t\"61\": {\n\t\tcode: \"61\",\n\t\tcategory: \"services\",\n\t\tside: \"debit\",\n\t\tlabel: \"Services et biens divers\",\n\t},\n\t\"62\": {\n\t\tcode: \"62\",\n\t\tcategory: \"personnel\",\n\t\tside: \"debit\",\n\t\tlabel: \"Rémunérations, charges sociales et pensions\",\n\t},\n\t\"63\": {\n\t\tcode: \"63\",\n\t\tcategory: \"depreciation\",\n\t\tside: \"debit\",\n\t\tlabel: \"Amortissements, réductions de valeur et provisions\",\n\t},\n\t\"64\": {\n\t\tcode: \"64\",\n\t\tcategory: \"otherCharges\",\n\t\tside: \"debit\",\n\t\tlabel: \"Autres charges d'exploitation\",\n\t},\n\t\"65\": {\n\t\tcode: \"65\",\n\t\tcategory: \"financialCharges\",\n\t\tside: \"debit\",\n\t\tlabel: \"Charges financières\",\n\t},\n\t\"66\": {\n\t\tcode: \"66\",\n\t\tcategory: \"exceptionalCharges\",\n\t\tside: \"debit\",\n\t\tlabel: \"Charges exceptionnelles\",\n\t},\n\t\"70\": {\n\t\tcode: \"70\",\n\t\tcategory: \"revenue\",\n\t\tside: \"credit\",\n\t\tlabel: \"Chiffre d'affaires\",\n\t},\n\t\"74\": {\n\t\tcode: \"74\",\n\t\tcategory: \"otherIncome\",\n\t\tside: \"credit\",\n\t\tlabel: \"Autres produits d'exploitation\",\n\t},\n\t\"75\": {\n\t\tcode: \"75\",\n\t\tcategory: \"financialIncome\",\n\t\tside: \"credit\",\n\t\tlabel: \"Produits financiers\",\n\t},\n\t\"76\": {\n\t\tcode: \"76\",\n\t\tcategory: \"exceptionalIncome\",\n\t\tside: \"credit\",\n\t\tlabel: \"Produits exceptionnels\",\n\t},\n};\n\n/**\n * PCMN 618 — remuneration and benefits of company directors/managers who are\n * NOT employed under a contract of employment (dirigeants d'entreprise\n * indépendants). It belongs to class 61 \"Services et biens divers\", NOT class\n * 62 \"Rémunérations\". This is the one PCMN subtlety that both apps must get\n * right so an owner's own pay reconciles between a plan and its actuals.\n */\nexport const DIRECTOR_REMUNERATION_ACCOUNT = \"618\";\n\n/**\n * The P&L category for a PCMN account code of any length (2-digit class up to a\n * full leaf code), or null when the code is not one of the compared P&L\n * classes. Applies the 618 rule explicitly before falling back to the class, so\n * self-employed director remuneration is never miscounted as personnel.\n */\nexport function plCategoryForCode(code: string): PlCategory | null {\n\tconst trimmed = code.trim();\n\tif (trimmed.startsWith(DIRECTOR_REMUNERATION_ACCOUNT)) return \"services\";\n\treturn PCMN_PL_CLASSES[trimmed.slice(0, 2)]?.category ?? null;\n}\n\n/**\n * PCMN liquidity classes (valeurs disponibles): 54 term deposits, 55 banks, 57\n * cash on hand. Their net movement is the treasury / cash position. (50-53\n * current investments and 56 are excluded, matching the suite's cash view.)\n */\nexport const CASH_CLASSES = [\"54\", \"55\", \"57\"] as const;\nexport type CashClass = (typeof CASH_CLASSES)[number];\n\n/** Whether an account code belongs to a liquidity (cash) class. */\nexport function isCashClass(code: string): boolean {\n\treturn (CASH_CLASSES as readonly string[]).includes(code.trim().slice(0, 2));\n}\n","/**\n * Belgian PCMN fixed-asset taxonomy (balance-sheet classes 20-28). Used by\n * financica-plan to model investments and their depreciation against the\n * statutory asset rubrics.\n */\n\n/** Statutory fixed-asset groups of the Belgian balance sheet. */\nexport type FixedAssetGroup =\n\t| \"formationExpenses\" // 20 frais d'établissement\n\t| \"intangible\" // 21 immobilisations incorporelles\n\t| \"tangible\" // 22-27 immobilisations corporelles\n\t| \"financial\"; // 28 immobilisations financières\n\nexport interface PcmnFixedAssetClass {\n\t/** 2-digit PCMN class, e.g. \"22\". */\n\treadonly code: string;\n\treadonly group: FixedAssetGroup;\n\t/** French rubric of the Belgian balance sheet. */\n\treadonly label: string;\n\t/**\n\t * Whether the class is depreciated at all. Financial assets (28) and\n\t * assets under construction (27) are not; land within 22 is not either,\n\t * but that split is finer than the class and left to the caller.\n\t */\n\treadonly depreciable: boolean;\n}\n\nexport const PCMN_FIXED_ASSET_CLASSES: Readonly<\n\tRecord<string, PcmnFixedAssetClass>\n> = {\n\t\"20\": {\n\t\tcode: \"20\",\n\t\tgroup: \"formationExpenses\",\n\t\tlabel: \"Frais d'établissement\",\n\t\tdepreciable: true,\n\t},\n\t\"21\": {\n\t\tcode: \"21\",\n\t\tgroup: \"intangible\",\n\t\tlabel: \"Immobilisations incorporelles\",\n\t\tdepreciable: true,\n\t},\n\t\"22\": {\n\t\tcode: \"22\",\n\t\tgroup: \"tangible\",\n\t\tlabel: \"Terrains et constructions\",\n\t\tdepreciable: true,\n\t},\n\t\"23\": {\n\t\tcode: \"23\",\n\t\tgroup: \"tangible\",\n\t\tlabel: \"Installations, machines et outillage\",\n\t\tdepreciable: true,\n\t},\n\t\"24\": {\n\t\tcode: \"24\",\n\t\tgroup: \"tangible\",\n\t\tlabel: \"Mobilier et matériel roulant\",\n\t\tdepreciable: true,\n\t},\n\t\"25\": {\n\t\tcode: \"25\",\n\t\tgroup: \"tangible\",\n\t\tlabel: \"Immobilisations détenues en location-financement et droits similaires\",\n\t\tdepreciable: true,\n\t},\n\t\"26\": {\n\t\tcode: \"26\",\n\t\tgroup: \"tangible\",\n\t\tlabel: \"Autres immobilisations corporelles\",\n\t\tdepreciable: true,\n\t},\n\t\"27\": {\n\t\tcode: \"27\",\n\t\tgroup: \"tangible\",\n\t\tlabel: \"Immobilisations corporelles en cours et acomptes versés\",\n\t\tdepreciable: false,\n\t},\n\t\"28\": {\n\t\tcode: \"28\",\n\t\tgroup: \"financial\",\n\t\tlabel: \"Immobilisations financières\",\n\t\tdepreciable: false,\n\t},\n};\n\n/** The fixed-asset group for a PCMN account code, or null if not classes 20-28. */\nexport function fixedAssetGroupForCode(code: string): FixedAssetGroup | null {\n\treturn PCMN_FIXED_ASSET_CLASSES[code.trim().slice(0, 2)]?.group ?? null;\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@financica/pcmn",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Zero-dependency Belgian PCMN (Plan Comptable Minimum Normalisé) class taxonomy: maps income-statement and fixed-asset account classes to economic categories, with the statutory director-remuneration (618) rule.",
5
5
  "keywords": [
6
6
  "pcmn",
package/src/pl.ts CHANGED
@@ -14,8 +14,8 @@ export type PlCategory =
14
14
  | "services"
15
15
  | "personnel"
16
16
  | "depreciation"
17
- | "otherOperatingCharges"
18
- | "otherOperatingIncome"
17
+ | "otherCharges"
18
+ | "otherIncome"
19
19
  | "financialCharges"
20
20
  | "financialIncome"
21
21
  | "exceptionalCharges"
@@ -65,7 +65,7 @@ export const PCMN_PL_CLASSES: Readonly<Record<string, PcmnPlClass>> = {
65
65
  },
66
66
  "64": {
67
67
  code: "64",
68
- category: "otherOperatingCharges",
68
+ category: "otherCharges",
69
69
  side: "debit",
70
70
  label: "Autres charges d'exploitation",
71
71
  },
@@ -89,7 +89,7 @@ export const PCMN_PL_CLASSES: Readonly<Record<string, PcmnPlClass>> = {
89
89
  },
90
90
  "74": {
91
91
  code: "74",
92
- category: "otherOperatingIncome",
92
+ category: "otherIncome",
93
93
  side: "credit",
94
94
  label: "Autres produits d'exploitation",
95
95
  },