ced49915ed
fix(crud): 3个json补alias对齐菜单URL目录名——discount_list/discount_marketing_list/discount_promo_code_list(xls2ui按alias>tblname命名目录,缺alias生成discount/等错名致菜单500);menu.ui同步改新目录名
2026-09-09 15:26:41 +08:00
55b4943170
feat(discount): 折扣率语义扩展——允许>1加价卖给客户+解析改专属优先/*兜底
...
用户决策(2026-09-06):
1. 折扣率允许大于1:平台可加价卖产品给客户(如存储缺省1.5);
也可小于1让利(如百炼模型0.9,供应商有折扣传导给客户)
2. 解析规则:确定客户→查客户专属折扣;查不到→'*'通配兜底;再无→1.0
旧实现bug:专属与通配OR混查取全局min——专属0.95+通配0.8返回0.8,
专属记录形同虚设
改动:
- init.py sor_get_min_product_discount: 两步查询(专属层min→通配层min)
- init.py add/update_discount_detail: 上限1→9.9999(DB double(5,4)约束)
- discount_setting/save_discount.dspy: 兜底记录识别'*'+NULL两种形态;
「客户折扣率不得高于通用折扣率」校验保留(加价语义下=单客户价不贵于通用价)
- marketing_discount_setting/save_discount.dspy: >1上限放开,保留<基准约束
- generate_qr.dspy: 同上放开
- index.ui: placeholder 0~1→'>1加价 <1折扣',dec_len 2→4
本地mock测试5场景全过:专属优先/通配兜底/无记录1.0/exact_match不兜底/层内min
2026-09-06 15:43:01 +08:00
ymq
a3d7077acc
fix(star_discount): SQL 去掉不存在的 d.discount 列
...
discount 表无 discount 字段(值在 discount_detail 表)。原 select d.id, d.discount
导致 reseller 级通用折扣(customerid=NULL)查询永远报 Unknown column 错误,
被上层 try/except 兜住后 fallback 到 1.0,通用折扣形同虚设。
2026-08-26 15:52:03 +08:00
f9408e12e2
simplify: 去掉params_mapping,id行数据本身已传
2026-08-05 19:15:40 +08:00
8a22ab961e
simplify: DSPY直接读id,params_mapping透传,不重命名
2026-08-05 19:14:22 +08:00
0144129ec1
fix: 参数名改用mkt_id避免与行数据marketing_id字段冲突,照抄产品明细params_mapping模式
2026-08-05 18:14:31 +08:00
e311a42e99
fix: script bind加诊断—若${id}$未替换则alert提示
2026-08-05 17:54:51 +08:00
9dbb44fbd9
fix: 生成促销码改用script+fetch POST传参,绕过urlwidget/PopupWindow参数传递问题
2026-08-05 17:53:59 +08:00
763e41b7eb
fix: 生成促销码绑点改用params_mapping传marketing_id,修复${id}$占位符未替换导致'Marketing not found'
2026-08-05 16:52:50 +08:00
1e771df6e5
feat: 营销方案CRUD添加「生成促销码」工具按钮 — 选中方案后一键生成该用户的促销码
2026-08-05 16:26:42 +08:00
7dbac3bfdb
fix: use env.get_module_dbname('sage') instead of hardcoded 'sage'
2026-07-15 14:02:25 +08:00
0d9054bc94
fix: gitignore精确到discount_promo_code_list避免误伤自定义页面
2026-07-14 17:36:01 +08:00
49cae8a64d
chore: 移除xls2ui生成文件,wwwroot子目录加入gitignore
2026-07-14 17:24:47 +08:00
3d1fac97b0
fix: load_path补充customer_sale_assign_form权限
2026-07-14 16:08:24 +08:00
c2b0b286a5
fix: load_path补充marketing_discount_setting权限注册
2026-07-14 16:07:18 +08:00
d05bd3ec6f
fix: free customer name empty when org missing; use LEFT JOIN + COALESCE fallback
2026-07-14 12:00:53 +08:00
5b789995a6
fix: get_reseller_sales统一按当前机构过滤销售列表
2026-07-14 11:39:34 +08:00
6c0f5a6572
fix: customerid改存orgid; init_free按机构去重; 查询回JOIN organization
2026-07-14 11:18:13 +08:00
5626e1b516
fix: 自由客户分配-客户名JOIN users; 销售下拉COALESCE username防NULL
2026-07-14 11:15:08 +08:00
bec3e8f583
fix: customerid显示机构名; sale_id显示username; editable嵌套修复
2026-07-14 11:10:49 +08:00
429cee6e9d
fix: owner (org=0) can see all customers and sales across orgs
2026-07-14 10:50:59 +08:00
1e0081862d
fix: use empty string instead of None for NOT NULL sale_id/promo_code_id
2026-07-14 10:45:07 +08:00
f6c29c8c38
fix: use get_module_dbname for discount db in init_free_customers
2026-07-14 10:44:23 +08:00
e4b746be5c
fix: init_free_customers allow owner org, use users.orgid as resellerid
2026-07-14 10:41:52 +08:00
9d3c4e0adf
feat: init_free_customers.dspy + button in free_customer_assign
2026-07-14 10:38:02 +08:00
1e99ad2cc8
fix: hide resellerid in customer_bind list, add menu entries for free_customer_assign + customer_reassign
2026-07-13 18:36:51 +08:00
029fd91d79
feat: customer assignment - free_customer_assign + customer_reassign pages, register hook bind_type=3, sales list filter
2026-07-13 17:56:05 +08:00
f801507961
feat: discount promo code marketing dropdown filter by current org
2026-07-13 16:39:04 +08:00
bc9dcb25f7
chore: remove vim swap file
2026-07-13 14:33:51 +08:00
bf975ca9a7
feat: created_by/sale_id显示username; 促销码logined_userid过滤只显自己创建的
2026-07-13 14:33:45 +08:00
a71c11ecf0
fix: new_data_url从editable提升到params顶层,xls2ddl模板不认嵌套editable
2026-07-13 13:38:29 +08:00
690e36d4ff
fix: 营销方案created_by/促销码sale_id为空 — ServerEnv()→request._run_ns
2026-07-13 11:54:24 +08:00
6c8d23b986
refactor: resellerid → auto from get_userorgid(), remove from codes
2026-07-09 13:39:10 +08:00
de1e873d91
feat: add get_min_supplier_discount and get_min_distributor_discount
...
- sor_get_min_product_discount now accepts exact_match param
- exact_match=True: no wildcard/NULL fallback (supplier/distributor)
- exact_match=False (default): includes '*' and NULL fallback (customer)
- Both new functions registered in load_discount()
2026-07-06 17:15:32 +08:00
8b054f01d1
fix: bind_customer env=ServerEnv()→request._run_ns
2026-07-06 15:11:34 +08:00
34a2fecc99
fix: from discount.init import bind_customer, 绕过dspy bare function 查找失败
2026-07-06 14:55:32 +08:00
9a8d7f10aa
fix: dspy缺少return result导致返回None
2026-07-06 14:49:10 +08:00
2bbe82fd23
fix: 用dspy原生bare function(get_user/entire_url/bind_customer),去掉env间接调用
2026-07-06 14:41:20 +08:00
79494622b9
fix: env = request._run_ns 替代 ServerEnv(),修复dspy中get_user返回None
2026-07-06 14:39:44 +08:00
5762e1c361
fix: 登录URL /rbac/user/login -> /rbac/user/login.ui
2026-07-06 14:34:22 +08:00
bb5cb57d89
refactor: keep get_min_product_discount in discount, move llm_id_to_product_id to product_management
2026-07-06 14:23:57 +08:00
10fe38b4e0
feat: add get_min_product_discount and llm_id_to_product_id
...
- get_min_product_discount: find minimum discount for a product across all
active discount records (customer-specific + NULL + '*' fallback)
- llm_id_to_product_id: convert llmage.llm.id to sage.product.id
- Both registered in load_discount() for use in pricing display
2026-07-06 14:19:12 +08:00
183263eabd
fix: generate_promo_code 用 request._run_ns 替代 ServerEnv()
...
env = request._run_ns 绑定 request 上下文,env.get_user() 正确返回 userid 字符串
2026-07-06 13:37:54 +08:00
9bb5c9e506
促销码扫码流程: dspy端点改为UI公开入口,登录后绑定并跳转主页
...
- 新建 promote/index.ui: 公开入口,未登录显示登录按钮,已登录自动跳dspy
- QR URL 改为 promote/index.ui (原 promote.dspy)
- load_path.py 注册 promote/index.ui 为 any 角色
- index.dspy 绑定成功后显示返回首页按钮跳转主页
- 修复 generate_promo_code sale_id: get_user() -> get_userid()
2026-07-06 13:34:25 +08:00
ceb997da09
fix: generate_promo_qr/discount_qrcode 用 request._run_ns 替代 ServerEnv() 修复 entire_url 为 None 的500错
2026-07-06 08:09:10 +08:00
e06339f95d
feat: 客户归属管理——列出机构客户+分配销售
2026-07-05 14:44:40 +08:00
62f07bc8bb
fix: before_insert hook自动填充sale_id+resellerid; sync generate_promo_qr到site-packages
2026-07-05 14:24:13 +08:00
ab9dc4f730
fix: promote.dspy最终版——去binds避免服务端script解析,用request._run_ns.params_kw
2026-07-05 11:09:33 +08:00
3797ae1686
fix: promote.dspy加回binds用request._run_ns
2026-07-05 11:08:41 +08:00
f50284df3e
fix: promote.dspy用request._run_ns.params_kw替代params_kw
2026-07-05 11:08:02 +08:00