so-doanh-thu-revenue

Manages revenue ledger imports, deduplication, and exchange rate logic for GMV reporting.

1|Updated May 23, 2026
One-click install
npx skills add https://github.com/palfish-t-i-u/palfish-t-i-u-h-th-ng-ver-2 --skill so-doanh-thu-revenue-palfish-t-i-u
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: so-doanh-thu-revenue
Source: https://github.com/palfish-t-i-u/palfish-t-i-u-h-th-ng-ver-2/tree/main/.claude/skills/so-doanh-thu-revenue
Command: npx skills add https://github.com/palfish-t-i-u/palfish-t-i-u-h-th-ng-ver-2 --skill so-doanh-thu-revenue-palfish-t-i-u

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? It prevents silent data corruption in the Sổ doanh thu revenue ledger — duplicate rows from GSheet imports, GMV figures inflated or shrunk 1000x by DingTalk locale bugs, and truncated BC01/BC02 reports — by documenting the exact import paths, dedup fingerprints, and exchange rate fallbacks. ## Core Features & Use Cases - Import Operations: Run Google Sheet and DingTalk xlsx imports with dry-run safety, dual-fingerprint deduplication, and consumption-based reconciliation. - Exchange Rate Management: Query and update per-date VND/RMB rates in the exchange_rates table, with awareness of the four hard-coded 3700 fallbacks. - Report Debugging: Diagnose BC01/BC02/BC03 discrepancies caused by the 50k analytics row cap, NON_VN_TEAMS filtering, or missing exchange_rates DDL. - Use Case: When a GMV report total looks wrong, use this Skill to check for duplicate import rows, verify the DingTalk locale auto-fix fired, and confirm the correct exchange rate was applied for the target date. ## Quick Start Ask the assistant to dry-run the GSheet revenue import and check the so_doanh_thu table for duplicate rows before applying any changes.

Frequently Asked Questions about so-doanh-thu-revenue

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I run a GSheet revenue import safely?▼

Run import_from_gsheet with dry_run=True first to preview rows without writing. The import reads the SM Hanoi and HCM REV tabs and applies dual-fingerprint dedup before inserting into the so_doanh_thu table.

How do I remove duplicate rows from the revenue ledger?▼

Run scripts/dedup_gsheet_ledger.py in dry-run mode first, then with --apply which creates a timestamped backup before deleting. Verify with a SQL query grouping by uid, day, and amount having count greater than one.

Why is my imported GMV figure 1000 times too small?▼

DingTalk uses periods as thousands separators, which Google Sheets misreads as decimals. The _gmv_from_vnd function auto-corrects ratios below 0.01 and logs warnings for the grey zone between 0.01 and 0.10.

How does the exchange rate lookup work for VND to RMB?▼

get_rate_for_date queries the exchange_rates table for the latest rate effective on or before the target date, falling back to DEFAULT_TY_GIA of 3700. Insert new periods into exchange_rates with an effective_from date.

Why does my BC01 report return incomplete data?▼

fetch_rows_capped in analytics_limits.py truncates results at 50000 rows, and current callers silently discard the truncated flag. Query the table directly to check whether the cap was hit for large date ranges.

When should I not use this revenue ledger skill?▼

Do not use it for CRM sync logic in crm_routes.py, mPOS or Payoo reconciliation, or Supabase migrations and secrets management. Those belong to separate dedicated skills.