Skip to content

Instantly share code, notes, and snippets.

@brian56
Created October 22, 2025 02:51
Show Gist options
  • Select an option

  • Save brian56/f95ffc713e8171e3b45d0905ad3c1e1a to your computer and use it in GitHub Desktop.

Select an option

Save brian56/f95ffc713e8171e3b45d0905ad3c1e1a to your computer and use it in GitHub Desktop.
1. Sơ Cấp bán hình thành trong tương lai: dự án chưa có ngày MOC
graph TD
    subgraph "Sơ cấp bán HTTTL (chưa MOC)"
        direction TB

        %% === INPUT CONTEXTS ===
        subgraph Inputs["Context Inputs"]
            A1["finance_base_price<br/>Giá gốc"]
            A2["discount_input<br/>Chiết khấu thêm"]
            A3["taxable_area<br/>DT tính thuế (m²)"]
            A4["land_unit_value<br/>Đơn giá đất/m²"]
            A5["tax_rate<br/>VAT (%)"]
            A6["maintenance_rate<br/>Phí bảo trì (%)"]
        end

        %% === STEPS ===
        subgraph Steps["MathJS Computation Steps"]
            B1["base_price = finance_base_price"]
            B2["discount_total = (discount_input ? discount_input : 0)"]
            B3["net_after_discount = base_price - discount_total"]
            B4["land_value = taxable_area * land_unit_value"]
            B5["vat = (net_after_discount - land_value) * (tax_rate / 100)"]
            B6["maintenance_fee = net_after_discount * (maintenance_rate / 100)"]
            B7["grand_total = net_after_discount + vat + maintenance_fee"]
        end

        %% === DEPENDENCIES ===
        A1 --> B1
        A2 --> B2
        B1 --> B3
        B2 --> B3
        A3 --> B4
        A4 --> B4
        B3 --> B5
        B4 --> B5
        A5 --> B5
        B3 --> B6
        A6 --> B6
        B3 --> B7
        B5 --> B7
        B6 --> B7

        %% === OUTPUT ===
        subgraph Output["Final Result"]
            Z1["💰 grand_total<br/>Tổng giá trị hợp đồng"]
        end

        B7 --> Z1
    end
Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment