fix: PAY* leg resellerid=ownerid not providerid, stop treating provider as distributor

This commit is contained in:
yumoqing 2026-07-14 16:18:59 +08:00
parent 8e2c701e23
commit 66db401fcb

View File

@ -1456,7 +1456,7 @@ WHERE resource_ref_id = ${llm_id}$ AND product_type = 'llm_model' LIMIT 1"""
# PAY*: owner → supplier, amount = raw_cost * supplier_discount
supplier_amount = raw_cost * last_link_discount
accounting_items.append(DictObject(
action='PAY*', customerid=ownerid, resellerid=providerid,
action='PAY*', customerid=ownerid, resellerid=ownerid,
providerid=providerid, biz_date=biz_date, timestamp=timestamp,
productid=product_id, transamt=supplier_amount,
currency=prod_currency, base_amount=cost_base,
@ -1492,7 +1492,7 @@ WHERE resource_ref_id = ${llm_id}$ AND product_type = 'llm_model' LIMIT 1"""
# Final PAY*: top of chain → supplier
supplier_amount = raw_cost * last_link_discount
accounting_items.append(DictObject(
action='PAY*', customerid=chain[0], resellerid=providerid,
action='PAY*', customerid=chain[0], resellerid=chain[0],
providerid=providerid, biz_date=biz_date, timestamp=timestamp,
productid=product_id, transamt=supplier_amount,
currency=prod_currency, base_amount=cost_base,