<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://mediawiki.comfac.net/index.php?action=history&amp;feed=atom&amp;title=Architecture_and_Structure_Comfac_ERPN_Loc</id>
	<title>Architecture and Structure Comfac ERPN Loc - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://mediawiki.comfac.net/index.php?action=history&amp;feed=atom&amp;title=Architecture_and_Structure_Comfac_ERPN_Loc"/>
	<link rel="alternate" type="text/html" href="https://mediawiki.comfac.net/index.php?title=Architecture_and_Structure_Comfac_ERPN_Loc&amp;action=history"/>
	<updated>2026-06-05T11:00:52Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.45.1</generator>
	<entry>
		<id>https://mediawiki.comfac.net/index.php?title=Architecture_and_Structure_Comfac_ERPN_Loc&amp;diff=179&amp;oldid=prev</id>
		<title>Justinaquino: &quot;Add Comfac ERPNext Localization documentation from PHlocalization project&quot;</title>
		<link rel="alternate" type="text/html" href="https://mediawiki.comfac.net/index.php?title=Architecture_and_Structure_Comfac_ERPN_Loc&amp;diff=179&amp;oldid=prev"/>
		<updated>2026-03-09T10:49:56Z</updated>

		<summary type="html">&lt;p&gt;&amp;quot;Add Comfac ERPNext Localization documentation from PHlocalization project&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;= Architecture &amp;amp; Structure Reference — Comfac Philippine Localization =&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Comfac Philippine Localization (CPL)&amp;#039;&amp;#039;&amp;#039; is a Frappe/ERPNext custom app providing BIR (Bureau of Internal Revenue) statutory compliance for Philippine businesses. Built by Ambibuzz Technologies LLP as part of the BetterGov.ph Civic Tech Initiative.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Core principle:&amp;#039;&amp;#039;&amp;#039; Zero modifications to ERPNext core. All customizations use Frappe&amp;#039;s fixture, hooks, and JavaScript injection mechanisms — keeping the app upgrade-safe.&lt;br /&gt;
&lt;br /&gt;
== Directory Structure ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
phlocalization/&lt;br /&gt;
├── bureau_of_internal_revenue/              # Frappe app root (app_name)&lt;br /&gt;
│   ├── __init__.py&lt;br /&gt;
│   ├── hooks.py                             # Frappe hook definitions&lt;br /&gt;
│   ├── modules.txt                          # Declares module: &amp;quot;Bureau of Internal Revenue&amp;quot;&lt;br /&gt;
│   ├── patches.txt                          # Migration patches (pre/post model sync)&lt;br /&gt;
│   │&lt;br /&gt;
│   ├── bureau_of_internal_revenue/          # Module package (matches module name)&lt;br /&gt;
│   │   ├── __init__.py&lt;br /&gt;
│   │   └── report/&lt;br /&gt;
│   │       ├── balance_sheet_bir/           # Script Report: Balance Sheet BIR&lt;br /&gt;
│   │       │   ├── balance_sheet_bir.json   #   Report DocType definition&lt;br /&gt;
│   │       │   ├── balance_sheet_bir.py     #   Server-side report logic&lt;br /&gt;
│   │       │   ├── balance_sheet_bir.js     #   Client-side filters &amp;amp; formatting&lt;br /&gt;
│   │       │   ├── balance_sheet_bir.html   #   HTML template (includes ERPNext base)&lt;br /&gt;
│   │       │   └── test_balance_sheet_bir.py&lt;br /&gt;
│   │       └── balance_sheet_schedule_bir/  # Script Report: Schedule-grouped variant&lt;br /&gt;
│   │           ├── balance_sheet_schedule_bir.json&lt;br /&gt;
│   │           ├── balance_sheet_schedule_bir.py&lt;br /&gt;
│   │           ├── balance_sheet_schedule_bir.js&lt;br /&gt;
│   │           ├── balance_sheet_schedule_bir.html&lt;br /&gt;
│   │           └── test_balance_sheet_schedule_bir.py&lt;br /&gt;
│   │&lt;br /&gt;
│   ├── config/                              # App configuration (empty)&lt;br /&gt;
│   ├── fixtures/&lt;br /&gt;
│   │   └── custom_field.json                # Custom &amp;quot;Schedule&amp;quot; field on Account DocType&lt;br /&gt;
│   ├── public/&lt;br /&gt;
│   │   └── js/&lt;br /&gt;
│   │       └── account.js                   # Client script injected into Account form&lt;br /&gt;
│   └── templates/pages/                     # Web templates (empty)&lt;br /&gt;
│&lt;br /&gt;
├── docs/&lt;br /&gt;
│   ├── Project Requirements Document.md&lt;br /&gt;
│   └── Roadmap.md&lt;br /&gt;
├── pyproject.toml                           # Python packaging &amp;amp; Frappe dependency config&lt;br /&gt;
└── README.md&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Component Details ==&lt;br /&gt;
&lt;br /&gt;
=== 1. hooks.py — Frappe Integration Point ===&lt;br /&gt;
&lt;br /&gt;
The central configuration file that registers the app with Frappe.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Hook !! Value !! Purpose&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;app_name&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;bureau_of_internal_revenue&amp;quot;&amp;lt;/code&amp;gt; || Internal identifier; must match the top-level directory name&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;app_title&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;&amp;quot;Bureau of Internal Revenue&amp;quot;&amp;lt;/code&amp;gt; || Display name in Frappe desk&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;doctype_js&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;{&amp;quot;Account&amp;quot;: &amp;quot;public/js/account.js&amp;quot;}&amp;lt;/code&amp;gt; || Injects custom JS into the Account form&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;fixtures&amp;lt;/code&amp;gt; || Custom Field where module = &amp;quot;Bureau of Internal Revenue&amp;quot; || Auto-imports the Schedule field on &amp;lt;code&amp;gt;bench migrate&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Commented-out hooks available for future use:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;lt;code&amp;gt;before_install&amp;lt;/code&amp;gt; / &amp;lt;code&amp;gt;after_install&amp;lt;/code&amp;gt; — setup scripts&lt;br /&gt;
* &amp;lt;code&amp;gt;scheduler_events&amp;lt;/code&amp;gt; — cron-like scheduled tasks&lt;br /&gt;
* &amp;lt;code&amp;gt;doc_events&amp;lt;/code&amp;gt; — hooks on document save/cancel/trash&lt;br /&gt;
* &amp;lt;code&amp;gt;override_whitelisted_methods&amp;lt;/code&amp;gt; — replace API endpoints&lt;br /&gt;
* &amp;lt;code&amp;gt;permission_query_conditions&amp;lt;/code&amp;gt; / &amp;lt;code&amp;gt;has_permission&amp;lt;/code&amp;gt; — custom permissions&lt;br /&gt;
&lt;br /&gt;
=== 2. modules.txt ===&lt;br /&gt;
&lt;br /&gt;
Single line: &amp;lt;code&amp;gt;Bureau of Internal Revenue&amp;lt;/code&amp;gt;. Registers this as a Frappe module, which is required for reports, doctypes, and fixtures to be associated with the app.&lt;br /&gt;
&lt;br /&gt;
=== 3. patches.txt ===&lt;br /&gt;
&lt;br /&gt;
Contains &amp;lt;code&amp;gt;[pre_model_sync]&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;[post_model_sync]&amp;lt;/code&amp;gt; sections (currently empty). This is where database migration scripts are registered when schema changes are needed.&lt;br /&gt;
&lt;br /&gt;
=== 4. fixtures/custom_field.json — Schedule Field ===&lt;br /&gt;
&lt;br /&gt;
Adds a &amp;#039;&amp;#039;&amp;#039;&amp;quot;Schedule&amp;quot;&amp;#039;&amp;#039;&amp;#039; dropdown field to the standard &amp;#039;&amp;#039;&amp;#039;Account&amp;#039;&amp;#039;&amp;#039; DocType:&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Position:&amp;#039;&amp;#039;&amp;#039; After &amp;lt;code&amp;gt;parent_account&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Field type:&amp;#039;&amp;#039;&amp;#039; Select&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Options:&amp;#039;&amp;#039;&amp;#039; SCHED 1 through SCHED 23&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Visibility:&amp;#039;&amp;#039;&amp;#039; Controlled by &amp;lt;code&amp;gt;account.js&amp;lt;/code&amp;gt; — only shown when &amp;lt;code&amp;gt;is_group&amp;lt;/code&amp;gt; is checked&lt;br /&gt;
&lt;br /&gt;
This maps Chart of Accounts groups to BIR schedule categories, enabling schedule-based financial reporting without modifying the Account DocType source.&lt;br /&gt;
&lt;br /&gt;
=== 5. public/js/account.js — Client-Side Logic ===&lt;br /&gt;
&lt;br /&gt;
Injected into the Account form via &amp;lt;code&amp;gt;doctype_js&amp;lt;/code&amp;gt; hook:&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Shows&amp;#039;&amp;#039;&amp;#039; the Schedule field only when &amp;lt;code&amp;gt;is_group&amp;lt;/code&amp;gt; is true&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Clears&amp;#039;&amp;#039;&amp;#039; the schedule value when &amp;lt;code&amp;gt;is_group&amp;lt;/code&amp;gt; is unchecked&lt;br /&gt;
* Triggers on form &amp;lt;code&amp;gt;refresh&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;is_group&amp;lt;/code&amp;gt; field change&lt;br /&gt;
&lt;br /&gt;
=== 6. Balance Sheet BIR Report ===&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Type:&amp;#039;&amp;#039;&amp;#039; Frappe Script Report (ref doctype: GL Entry)&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Server (&amp;lt;code&amp;gt;.py&amp;lt;/code&amp;gt;):&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* Reuses ERPNext&amp;#039;s &amp;lt;code&amp;gt;erpnext.accounts.report.financial_statements&amp;lt;/code&amp;gt; functions (&amp;lt;code&amp;gt;get_period_list&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;get_data&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;get_columns&amp;lt;/code&amp;gt;)&lt;br /&gt;
* Renames standard labels to BIR terminology (e.g., &amp;quot;Total Asset (Debit)&amp;quot; → &amp;quot;Total Current Assets (Debit)&amp;quot;)&lt;br /&gt;
* Adds &amp;#039;&amp;#039;&amp;#039;level-based filtering&amp;#039;&amp;#039;&amp;#039; (show hierarchy levels 1–4 or All)&lt;br /&gt;
* Calculates provisional Profit/Loss row&lt;br /&gt;
* Checks for unclosed prior fiscal years&lt;br /&gt;
* Generates chart data (bar or line)&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Client (&amp;lt;code&amp;gt;.js&amp;lt;/code&amp;gt;):&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* Extends &amp;lt;code&amp;gt;erpnext.financial_statements&amp;lt;/code&amp;gt; report class&lt;br /&gt;
* Adds filters: &amp;lt;code&amp;gt;selected_view&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;accumulated_values&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;include_default_book_entries&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;level&amp;lt;/code&amp;gt;&lt;br /&gt;
* Custom formatter hides numeric values on indent-0 (top-level) rows&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Template (&amp;lt;code&amp;gt;.html&amp;lt;/code&amp;gt;):&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* Includes ERPNext&amp;#039;s &amp;lt;code&amp;gt;accounts/report/financial_statements.html&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== 7. Balance Sheet Schedule BIR Report ===&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Type:&amp;#039;&amp;#039;&amp;#039; Frappe Script Report (ref doctype: GL Entry)&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Key difference from Balance Sheet BIR:&amp;#039;&amp;#039;&amp;#039; Groups accounts by their assigned BIR Schedule (SCHED 1–23) and inserts subtotal rows per schedule.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Server (&amp;lt;code&amp;gt;.py&amp;lt;/code&amp;gt;):&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* Queries all Accounts that have a non-empty &amp;lt;code&amp;gt;schedule&amp;lt;/code&amp;gt; field&lt;br /&gt;
* Iterates through standard balance sheet data, grouping rows under their schedule&lt;br /&gt;
* Inserts &amp;quot;Total&amp;quot; subtotal rows at the end of each schedule group&lt;br /&gt;
* Adds a &amp;quot;Schedule&amp;quot; column at position 0&lt;br /&gt;
* Removes &amp;lt;code&amp;gt;cost_center&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;project&amp;lt;/code&amp;gt; filters (not relevant for BIR schedules)&lt;br /&gt;
* No chart generation&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Client (&amp;lt;code&amp;gt;.js&amp;lt;/code&amp;gt;):&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* Filters out &amp;lt;code&amp;gt;cost_center&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;project&amp;lt;/code&amp;gt; from the standard filter set&lt;br /&gt;
* Same indent-0 numeric hiding as the Balance Sheet BIR&lt;br /&gt;
&lt;br /&gt;
== Key Elements for Frappe Cloud / Frappe Instance Deployment ==&lt;br /&gt;
&lt;br /&gt;
These are the files and conventions that make this app installable on any Frappe/ERPNext instance (including Frappe Cloud):&lt;br /&gt;
&lt;br /&gt;
=== Required Files ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! File !! Role&lt;br /&gt;
|-&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;pyproject.toml&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; || Declares the Python package, build system (&amp;lt;code&amp;gt;flit_core&amp;lt;/code&amp;gt;), and &amp;lt;code&amp;gt;frappe~=15.95.0&amp;lt;/code&amp;gt; dependency. The &amp;lt;code&amp;gt;[tool.bench.frappe-dependencies]&amp;lt;/code&amp;gt; section tells Bench which Frappe version is required.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;bureau_of_internal_revenue/__init__.py&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; || Makes the top-level directory a Python package (required for &amp;lt;code&amp;gt;bench get-app&amp;lt;/code&amp;gt; / &amp;lt;code&amp;gt;pip install&amp;lt;/code&amp;gt;)&lt;br /&gt;
|-&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;bureau_of_internal_revenue/hooks.py&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; || &amp;#039;&amp;#039;&amp;#039;The single most critical file.&amp;#039;&amp;#039;&amp;#039; Frappe reads this to discover &amp;lt;code&amp;gt;app_name&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;app_title&amp;lt;/code&amp;gt;, fixtures, JS includes, and all integration hooks. Without this, Frappe doesn&amp;#039;t recognize the app.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;bureau_of_internal_revenue/modules.txt&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; || Registers the module name. Without this, reports and doctypes won&amp;#039;t be associated with the app.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;#039;&amp;#039;&amp;#039;&amp;lt;code&amp;gt;bureau_of_internal_revenue/patches.txt&amp;lt;/code&amp;gt;&amp;#039;&amp;#039;&amp;#039; || Required by Frappe&amp;#039;s migration system even if empty. Lists migration scripts to run during &amp;lt;code&amp;gt;bench migrate&amp;lt;/code&amp;gt;.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Deployment Mechanism ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# Standard Bench installation flow:&lt;br /&gt;
bench get-app https://github.com/xunema/phlocalization&lt;br /&gt;
bench --site &amp;amp;lt;site-name&amp;amp;gt; install-app bureau_of_internal_revenue&lt;br /&gt;
bench --site &amp;amp;lt;site-name&amp;amp;gt; migrate    # applies fixtures + patches&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;What happens on install/migrate:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
# Frappe reads &amp;lt;code&amp;gt;hooks.py&amp;lt;/code&amp;gt; to register the app&lt;br /&gt;
# &amp;lt;code&amp;gt;modules.txt&amp;lt;/code&amp;gt; creates the module record in the database&lt;br /&gt;
# &amp;lt;code&amp;gt;patches.txt&amp;lt;/code&amp;gt; runs any pending migrations&lt;br /&gt;
# &amp;lt;code&amp;gt;fixtures&amp;lt;/code&amp;gt; array in &amp;lt;code&amp;gt;hooks.py&amp;lt;/code&amp;gt; triggers import of &amp;lt;code&amp;gt;custom_field.json&amp;lt;/code&amp;gt;, creating the Schedule field on Account&lt;br /&gt;
# &amp;lt;code&amp;gt;doctype_js&amp;lt;/code&amp;gt; registers &amp;lt;code&amp;gt;account.js&amp;lt;/code&amp;gt; for injection into Account forms&lt;br /&gt;
# Report JSON files (&amp;lt;code&amp;gt;balance_sheet_bir.json&amp;lt;/code&amp;gt;, etc.) are loaded as Script Report records&lt;br /&gt;
&lt;br /&gt;
=== Frappe Cloud Specifics ===&lt;br /&gt;
&lt;br /&gt;
For &amp;#039;&amp;#039;&amp;#039;Frappe Cloud&amp;#039;&amp;#039;&amp;#039; deployment, the repo needs:&lt;br /&gt;
# A valid &amp;lt;code&amp;gt;pyproject.toml&amp;lt;/code&amp;gt; with &amp;lt;code&amp;gt;[tool.bench.frappe-dependencies]&amp;lt;/code&amp;gt; — &amp;#039;&amp;#039;&amp;#039;present&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
# The app directory name must match &amp;lt;code&amp;gt;app_name&amp;lt;/code&amp;gt; in &amp;lt;code&amp;gt;hooks.py&amp;lt;/code&amp;gt; — &amp;#039;&amp;#039;&amp;#039;matches&amp;#039;&amp;#039;&amp;#039; (&amp;lt;code&amp;gt;bureau_of_internal_revenue&amp;lt;/code&amp;gt;)&lt;br /&gt;
# The repo must be a valid Python package (has &amp;lt;code&amp;gt;__init__.py&amp;lt;/code&amp;gt;) — &amp;#039;&amp;#039;&amp;#039;present&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
# Dependencies on &amp;lt;code&amp;gt;frappe&amp;lt;/code&amp;gt; (and optionally &amp;lt;code&amp;gt;erpnext&amp;lt;/code&amp;gt;) declared — &amp;#039;&amp;#039;&amp;#039;declared&amp;#039;&amp;#039;&amp;#039; (&amp;lt;code&amp;gt;frappe~=15.95.0&amp;lt;/code&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Note:&amp;#039;&amp;#039;&amp;#039; The &amp;lt;code&amp;gt;pyproject.toml&amp;lt;/code&amp;gt; still has placeholder values (&amp;lt;code&amp;gt;name = &amp;quot;your_app_name&amp;quot;&amp;lt;/code&amp;gt;, generic author/description) that should be updated to match the actual app identity for proper Frappe Cloud listing.&lt;br /&gt;
&lt;br /&gt;
=== Fixture System ===&lt;br /&gt;
&lt;br /&gt;
The fixture in &amp;lt;code&amp;gt;hooks.py&amp;lt;/code&amp;gt;:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
fixtures = [&lt;br /&gt;
    {&lt;br /&gt;
        &amp;quot;doctype&amp;quot;: &amp;quot;Custom Field&amp;quot;,&lt;br /&gt;
        &amp;quot;filters&amp;quot;: [[&amp;quot;Custom Field&amp;quot;, &amp;quot;module&amp;quot;, &amp;quot;=&amp;quot;, &amp;quot;Bureau of Internal Revenue&amp;quot;]]&lt;br /&gt;
    }&lt;br /&gt;
]&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This means:&lt;br /&gt;
* &amp;lt;code&amp;gt;bench export-fixtures&amp;lt;/code&amp;gt; exports all Custom Fields belonging to this module → &amp;lt;code&amp;gt;fixtures/custom_field.json&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;bench migrate&amp;lt;/code&amp;gt; on a fresh site imports them back, creating the Schedule field automatically&lt;br /&gt;
* This is the upgrade-safe pattern for extending standard DocTypes without touching core&lt;br /&gt;
&lt;br /&gt;
== Data Flow Summary ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Account Form (Desk UI)&lt;br /&gt;
  ↓ hooks.py doctype_js&lt;br /&gt;
  ↓ account.js toggles Schedule field visibility&lt;br /&gt;
  ↓&lt;br /&gt;
Account DocType + Schedule custom field (from fixtures)&lt;br /&gt;
  ↓&lt;br /&gt;
GL Entry data (standard ERPNext)&lt;br /&gt;
  ↓&lt;br /&gt;
balance_sheet_bir.py          →  Standard BIR Balance Sheet (level-filtered)&lt;br /&gt;
balance_sheet_schedule_bir.py →  Schedule-grouped Balance Sheet (SCHED 1-23 subtotals)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Technology Stack ==&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Layer !! Technology&lt;br /&gt;
|-&lt;br /&gt;
| Framework || Frappe v15&lt;br /&gt;
|-&lt;br /&gt;
| ERP || ERPNext v15&lt;br /&gt;
|-&lt;br /&gt;
| Language || Python &amp;gt;= 3.10&lt;br /&gt;
|-&lt;br /&gt;
| Build || flit_core&lt;br /&gt;
|-&lt;br /&gt;
| Formatter || Black (99 chars), isort (Black-compatible)&lt;br /&gt;
|-&lt;br /&gt;
| License || MIT&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
[[Category:ERPNext]]&lt;br /&gt;
[[Category:Frappe]]&lt;br /&gt;
[[Category:Architecture]]&lt;br /&gt;
[[Category:BIR]]&lt;br /&gt;
[[Category:Comfac ERPN Loc]]&lt;/div&gt;</summary>
		<author><name>Justinaquino</name></author>
	</entry>
</feed>