dingdanquanliucheng/backend/migrations/versions/20260530_0001_add_tax_fields.py
taiyi 46d56cb6d3 feat: 定价规则支持含税计算,审批详情展示税明细
定价规则新增 tax_rate(税率百分比)和 tax_inclusive(含税方式)字段,
报价引擎自动计算含税/不含税双价格,审批详情页利润计算过程展示税说明和明细行税额。

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-30 11:15:55 +08:00

26 lines
660 B
Python

"""add tax_rate and tax_inclusive to product_pricing_rule"""
from alembic import op
import sqlalchemy as sa
revision = "20260530_0001"
down_revision = "20260527_0001"
branch_labels = None
depends_on = None
def upgrade() -> None:
op.add_column(
"product_pricing_rule",
sa.Column("tax_rate", sa.Numeric(5, 2), nullable=False, server_default="0"),
)
op.add_column(
"product_pricing_rule",
sa.Column("tax_inclusive", sa.Integer(), nullable=False, server_default="0"),
)
def downgrade() -> None:
op.drop_column("product_pricing_rule", "tax_inclusive")
op.drop_column("product_pricing_rule", "tax_rate")