投資循環操作手冊
投資循環涵蓋企業內部組織績效管理與損益分析。本手冊說明如何透過 iDempiere ERP 行動 App 的「阿米巴組織儀表板」模組,即時掌握各組織的營收、費用與損益狀況,協助經營決策。
模組總覽
阿米巴組織儀表板
依 Fact_Acct(總帳分錄)資料來源,自動計算各組織的營收與費用,以圓餅圖與卡片呈現組織級損益。支援多組織鑽探(drill-down)與趨勢分析。
損益分析
透過會計科目類型(AccountType)自動分類營收(R 類)與費用(E 類),以月度折線圖追蹤損益變化趨勢,支援跨組織比較。
組織績效追蹤
追蹤各阿米巴組織的人均產值、營收佔比與費用結構,提供經營者組織層級的績效觀察工具。
一、阿米巴組織儀表板
1.1 資料來源架構
儀表板的營收與費用數據直接取自 iDempiere 的 Fact_Acct(總帳會計分錄),而非發票(C_Invoice)。這確保儀表板數字與 iDempiere 損益報表完全一致。
| 項目 | 舊方式(C_Invoice) | 新方式(Fact_Acct) |
|---|---|---|
| 資料範圍 | 僅含發票 | 所有已過帳文件(發票、日記帳、付款等) |
| 金額精度 | 文件總額(GrandTotal) | 科目層級借貸方(會計幣別) |
| 營收分類 | IsSOTrx = Y | C_ElementValue.AccountType = ‘R’ |
| 費用分類 | IsSOTrx = N | C_ElementValue.AccountType = ‘E’ |
| 多幣別 | 來源幣別金額 | 會計幣別(自動轉換) |
| 與損益報表一致 | 否 | 是 |
1.2 科目分類邏輯
系統透過 C_ElementValue(會計科目)的 AccountType 欄位,自動判斷每筆分錄屬於營收或費用:
| AccountType | 類別 | 計算公式 | 說明 |
|---|---|---|---|
R(Revenue) |
營收 | AmtAcctCr – AmtAcctDr | 營收科目通常貸方餘額較大 |
E(Expense) |
費用 | AmtAcctDr – AmtAcctCr | 費用科目通常借方餘額較大 |
1.3 資料處理流程
儀表板載入資料依下列順序執行:
- 取得 Org-0 Token:以組織 0(系統層級)登入,取得跨組織查詢權限。
- 平行查詢:
getOrgs()— 取得所有組織清單getAccountTypes()— 查詢 C_ElementValue,篩選 AccountType = ‘R’ 或 ‘E’ 的科目
- 查詢 Fact_Acct:以取得的營收/費用科目 ID,分批查詢最近 12 個月的會計分錄(每批 30 個科目 ID,避免 URL 過長)。
- 查詢使用者數:取得各組織的活躍使用者人數。
- 聚合計算:依組織 x 月份彙總營收與費用,產生 AmoebaState 狀態物件。
操作方式
- 從儀表板選單進入「阿米巴」分類。
- 點選「阿米巴組織儀表板」模組圖磚。
- 等待資料載入(首次約 2-3 秒),畫面自動顯示各組織營收/費用圓餅圖。
- 點擊特定組織卡片,展開該組織的月度趨勢圖與明細。
- 下拉刷新可重新載入最新資料。
1.4 API 查詢詳情
查詢科目類型
| 參數 | 值 |
|---|---|
| 端點 | GET /api/v1/models/C_ElementValue |
| $filter | AccountType eq 'R' or AccountType eq 'E' |
| $select | C_ElementValue_ID, AccountType |
| $top | 10000 |
注意:AccountType 為 List Reference 欄位,REST API 回傳格式為 Map({"id": "R", "identifier": "Revenue"}),程式同時處理 Map 與 String 兩種格式。
查詢會計分錄
| 參數 | 值 |
|---|---|
| 端點 | GET /api/v1/models/Fact_Acct |
| $filter | PostingType eq 'A' and DateAcct ge '{12個月前}' and (Account_ID eq X or Account_ID eq Y ...) |
| $select | AD_Org_ID, DateAcct, AmtAcctDr, AmtAcctCr, Account_ID |
| $expand | AD_Org_ID |
| $top | 50000(每批) |
科目 ID 分批查詢(每批 30 個),所有批次結果於客戶端合併計算。
查詢使用者數
| 參數 | 值 |
|---|---|
| 端點 | GET /api/v1/models/AD_User |
| $filter | IsActive eq true |
| $select | AD_Org_ID |
| $top | 10000 |
二、損益分析
2.1 月度損益追蹤
儀表板自動彙總最近 12 個月的營收與費用數據,以月為單位呈現:
- 營收趨勢:各月 R 類科目加總(AmtAcctCr – AmtAcctDr)
- 費用趨勢:各月 E 類科目加總(AmtAcctDr – AmtAcctCr)
- 損益:營收 – 費用 = 當月損益
2.2 組織損益卡片
每個組織以獨立卡片呈現,包含:
| 欄位 | 說明 |
|---|---|
| 組織名稱 | 自 AD_Org 取得 |
| 營收金額 | 最近 12 個月 R 類科目合計 |
| 費用金額 | 最近 12 個月 E 類科目合計 |
| 損益金額 | 營收 – 費用 |
| 使用者人數 | 該組織活躍 AD_User 數 |
| 人均產值 | 營收 / 使用者人數 |
操作方式
- 在阿米巴儀表板畫面,檢視各組織卡片的營收、費用與損益摘要。
- 營收以綠色標示,費用以紅色標示,損益正值為綠色、負值為紅色。
- 點擊任一組織卡片,展開該組織的月度趨勢圖。
- 圓餅圖顯示各組織營收佔比,可快速辨識主要營收貢獻單位。
三、組織績效追蹤
3.1 多組織鑽探
從總覽畫面點擊特定組織後,可進一步檢視:
- 月度營收/費用折線圖:顯示該組織 12 個月的營收與費用變化
- Top 發票清單:該組織金額最大的發票明細(仍使用 C_Invoice 查詢,以呈現個別發票資訊)
- 人均產值:營收除以該組織活躍使用者人數
3.2 績效指標
| 指標 | 計算方式 | 用途 |
|---|---|---|
| 營收佔比 | 組織營收 / 全公司營收 x 100% | 辨識營收貢獻度最高的組織 |
| 費用佔比 | 組織費用 / 全公司費用 x 100% | 辨識費用占比最高的組織 |
| 人均產值 | 組織營收 / 組織人數 | 衡量組織經營效率 |
| 損益率 | (營收 – 費用) / 營收 x 100% | 衡量組織獲利能力 |
四、前置條件與注意事項
Fact_Acct 資料僅在文件(發票、日記帳等)已過帳(Posted = Y)後才會產生。若儀表板顯示零值,請至 iDempiere 檢查文件的過帳狀態。
建議在 iDempiere 會計基模(Accounting Schema)啟用 AutoPosting = Y,確保文件完成(Complete)時自動過帳。或手動執行 System Admin → General Rules → Server → Post Document。
阿米巴儀表板需要以 Org=0(系統層級)Token 進行跨組織查詢。確保登入角色具有 Org-0 存取權限。
每批查詢上限 50,000 筆。若單批 30 個科目在 12 個月內產生超過 50,000 筆分錄,較早的記錄將被截斷。大型企業可能需要伺服器端彙總方案。
五、常見問題排除
| 問題 | 可能原因 | 解決方式 |
|---|---|---|
| 營收/費用顯示為 0 | 文件未過帳,Fact_Acct 無資料 | 至 iDempiere 執行 Post Document,或啟用 AutoPosting |
| 數字與損益報表不一致 | 查詢期間不同或有未過帳文件 | 確認查詢期間一致,並確保所有文件均已過帳 |
| 部分組織未顯示 | 該組織無 R/E 類科目分錄 | 確認該組織有實際營業活動且文件已過帳 |
| 載入速度較慢 | 科目數量多,需多批查詢 | 超過 300 個 R/E 科目會產生 10+ 次 API 呼叫,屬正常現象 |
| Top 發票區顯示但營收為 0 | Top 發票使用 C_Invoice,營收使用 Fact_Acct | 此為不同資料來源,確認發票已過帳即可 |
六、未來規劃
- 伺服器端彙總:建立 SQL View(
RV_Amoeba_Monthly),於伺服器端完成 Fact_Acct 與 C_ElementValue 的 JOIN 與 GROUP BY,減少 API 呼叫次數與客戶端運算量。 - 分頁機制:針對超大資料集加入 $skip/$top 分頁查詢。
- Token 快取:快取 Org-0 Token,避免每次刷新重新登入。
🌐 English Version
Investment Cycle Operation Manual
The Investment Cycle covers internal organizational performance management and profit/loss analysis. This manual explains how to use the “Amoeba Organization Dashboard” module in the iDempiere ERP Mobile App to monitor revenue, expenses, and P&L across organizations in real time.
Module Overview
Amoeba Organization Dashboard
Automatically calculates revenue and expenses for each organization using Fact_Acct (GL journal entries) data. Displays organizational P&L with pie charts and cards. Supports multi-org drill-down and trend analysis.
P&L Analysis
Automatically classifies revenue (R type) and expense (E type) through account types (AccountType). Tracks monthly P&L trends with line charts and supports cross-organization comparison.
Org Performance Tracking
Tracks per-capita output, revenue share, and expense structure for each amoeba organization, providing managers with organization-level performance visibility.
1. Amoeba Organization Dashboard
1.1 Data Source Architecture
Dashboard revenue and expense data comes directly from iDempiere’s Fact_Acct (GL journal entries), not from invoices (C_Invoice). This ensures dashboard figures match iDempiere’s P&L report exactly.
| Aspect | Old Method (C_Invoice) | New Method (Fact_Acct) |
|---|---|---|
| Scope | Invoices only | All posted documents (invoices, journals, payments, etc.) |
| Accuracy | Document total (GrandTotal) | Account-level debit/credit in accounting currency |
| Revenue classification | IsSOTrx = Y | C_ElementValue.AccountType = ‘R’ |
| Expense classification | IsSOTrx = N | C_ElementValue.AccountType = ‘E’ |
| Multi-currency | Source currency amounts | Accounting currency (converted) |
| Matches P&L report | No | Yes |
1.2 Account Classification Logic
The system uses the AccountType field from C_ElementValue (chart of accounts) to determine whether each journal entry is revenue or expense:
| AccountType | Category | Formula | Description |
|---|---|---|---|
R (Revenue) |
Revenue | AmtAcctCr – AmtAcctDr | Revenue accounts typically have larger credit balances |
E (Expense) |
Expense | AmtAcctDr – AmtAcctCr | Expense accounts typically have larger debit balances |
1.3 Data Processing Flow
How to Use
- Navigate to the “Amoeba” category from the dashboard menu.
- Tap the “Amoeba Organization Dashboard” module tile.
- Wait for data to load (~2-3 seconds for first load). The screen auto-displays revenue/expense pie charts per organization.
- Tap a specific organization card to drill down into monthly trends and details.
- Pull down to refresh and reload the latest data.
2. P&L Analysis
The dashboard aggregates the past 12 months of revenue and expense data on a monthly basis:
- Revenue trend: Monthly sum of R-type accounts (AmtAcctCr – AmtAcctDr)
- Expense trend: Monthly sum of E-type accounts (AmtAcctDr – AmtAcctCr)
- P&L: Revenue – Expense = Monthly profit/loss
3. Org Performance Tracking
| Metric | Formula | Purpose |
|---|---|---|
| Revenue Share | Org Revenue / Total Revenue x 100% | Identify top revenue-contributing organizations |
| Expense Share | Org Expense / Total Expense x 100% | Identify highest expense organizations |
| Per-Capita Output | Org Revenue / Headcount | Measure organizational efficiency |
| P&L Ratio | (Revenue – Expense) / Revenue x 100% | Measure organizational profitability |
4. Prerequisites
Fact_Acct data only exists after documents (invoices, journals, etc.) are posted (Posted = Y). If the dashboard shows zeros, check the posting status of documents in iDempiere.
Enable AutoPosting = Y in the Accounting Schema to ensure documents are automatically posted upon completion.
The Amoeba dashboard requires an Org=0 (system-level) token for cross-organization queries. Ensure the login role has Org-0 access permissions.
5. Troubleshooting
| Issue | Possible Cause | Solution |
|---|---|---|
| Revenue/Expense shows 0 | Documents not posted | Run Post Document in iDempiere, or enable AutoPosting |
| Numbers don’t match P&L report | Different periods or unposted documents | Verify periods match and all documents are posted |
| Some orgs not displayed | No R/E type entries for that org | Confirm the org has business activity with posted documents |
| Slow loading | Many accounts require multiple batches | 300+ R/E accounts will produce 10+ API calls; this is normal |
🇯🇵 日本語版
投資サイクル操作マニュアル
投資サイクルは、企業内部の組織業績管理と損益分析を対象としています。本マニュアルでは、iDempiere ERP モバイルアプリの「アメーバ組織ダッシュボード」モジュールを使用して、各組織の売上・経費・損益をリアルタイムに把握する方法を説明します。
モジュール概要
アメーバ組織ダッシュボード
Fact_Acct(GL 仕訳)データソースに基づき、各組織の売上と経費を自動計算。円グラフとカードで組織レベルの損益を表示。マルチ組織のドリルダウンとトレンド分析に対応。
損益分析
勘定科目タイプ(AccountType)により売上(R 型)と経費(E 型)を自動分類。折れ線グラフで月次損益トレンドを追跡し、組織間比較をサポート。
組織業績追跡
各アメーバ組織の一人当たり生産性、売上構成比、経費構造を追跡し、経営者に組織レベルの業績可視化ツールを提供。
1. アメーバ組織ダッシュボード
1.1 データソースアーキテクチャ
ダッシュボードの売上・経費データはiDempiere の Fact_Acct(GL 仕訳)から直接取得されます(C_Invoice ではありません)。これにより、ダッシュボードの数値が iDempiere の損益計算書と完全に一致します。
| 項目 | 旧方式(C_Invoice) | 新方式(Fact_Acct) |
|---|---|---|
| データ範囲 | 請求書のみ | 全転記済み伝票(請求書、仕訳帳、支払等) |
| 精度 | 伝票合計額 | 勘定科目レベルの借方/貸方(会計通貨) |
| 売上分類 | IsSOTrx = Y | C_ElementValue.AccountType = ‘R’ |
| 経費分類 | IsSOTrx = N | C_ElementValue.AccountType = ‘E’ |
| 多通貨 | 元通貨金額 | 会計通貨(自動換算) |
| 損益計算書と一致 | いいえ | はい |
1.2 勘定科目分類ロジック
| AccountType | 分類 | 計算式 | 説明 |
|---|---|---|---|
R(Revenue) |
売上 | AmtAcctCr – AmtAcctDr | 売上勘定は通常貸方残高が大きい |
E(Expense) |
経費 | AmtAcctDr – AmtAcctCr | 経費勘定は通常借方残高が大きい |
操作方法
- ダッシュボードメニューから「アメーバ」カテゴリに移動します。
- 「アメーバ組織ダッシュボード」モジュールタイルをタップします。
- データの読み込みを待ちます(初回は約 2-3 秒)。各組織の売上/経費円グラフが自動表示されます。
- 特定の組織カードをタップして、月次トレンドと詳細にドリルダウンします。
- 下にスワイプして最新データを更新できます。
2. 損益分析
ダッシュボードは過去 12 か月の売上・経費データを月次で集計します:
- 売上トレンド:R 型勘定の月次合計(AmtAcctCr – AmtAcctDr)
- 経費トレンド:E 型勘定の月次合計(AmtAcctDr – AmtAcctCr)
- 損益:売上 – 経費 = 月次損益
3. 組織業績追跡
| 指標 | 計算式 | 目的 |
|---|---|---|
| 売上構成比 | 組織売上 / 全社売上 x 100% | 売上貢献度の高い組織を特定 |
| 経費構成比 | 組織経費 / 全社経費 x 100% | 経費比率の高い組織を特定 |
| 一人当たり生産性 | 組織売上 / 組織人数 | 組織の経営効率を測定 |
| 損益率 | (売上 – 経費) / 売上 x 100% | 組織の収益性を測定 |
4. 前提条件
Fact_Acct データは伝票(請求書、仕訳帳等)が転記済み(Posted = Y)の場合のみ存在します。ダッシュボードがゼロを表示する場合は、iDempiere で伝票の転記状態を確認してください。
会計スキーマで AutoPosting = Y を有効にし、伝票完了時に自動転記されるようにすることを推奨します。
アメーバダッシュボードは Org=0(システムレベル)トークンによる組織横断クエリが必要です。ログインロールに Org-0 のアクセス権限があることを確認してください。
5. トラブルシューティング
| 問題 | 考えられる原因 | 解決策 |
|---|---|---|
| 売上/経費が 0 と表示 | 伝票が未転記 | iDempiere で Post Document を実行、または AutoPosting を有効化 |
| 数値が損益計算書と一致しない | 期間の相違や未転記伝票 | 期間を確認し、すべての伝票が転記済みであることを確認 |
| 一部の組織が表示されない | 該当組織に R/E 型仕訳なし | 該当組織に事業活動と転記済み伝票があることを確認 |
| 読み込みが遅い | 勘定科目数が多くバッチ数増加 | R/E 勘定が 300 以上の場合、10 回以上の API 呼び出しが発生(正常動作) |