bugfix
This commit is contained in:
parent
54d3080a1b
commit
1c962dbd9b
@ -96,7 +96,7 @@ async def get_remote_pricing(sor, charge, data):
|
||||
async def pricing_program_charging(sor, pricing_program_id, data):
|
||||
env = ServerEnv()
|
||||
if not data.get('biz_date'):
|
||||
biz_date = await env.get_business_date(self.sor)
|
||||
biz_date = await env.get_business_date(sor)
|
||||
data['biz_date'] = biz_date
|
||||
debug(f'{pricing_program_id=}, {data=}')
|
||||
pp_items = await sor_get_program_items(sor, pricing_program_id, data['biz_date'])
|
||||
@ -119,13 +119,15 @@ async def pricing_program_charging(sor, pricing_program_id, data):
|
||||
cnt = data.get(spec.count_name, 1)
|
||||
if charge.pricing_unit is None or charge.pricing_unit < 1:
|
||||
charge.pricing_unit = 1
|
||||
cost_amount = charge.cost_amount or 0.00
|
||||
charge.amount = cnt * charge.pricing_amount / charge.pricing_unit
|
||||
charge.cost = cnt * cost_amount / charge.pricing_unit
|
||||
charges.append(charge)
|
||||
elif spec.pricing_spec_mode == 'remote_pricing':
|
||||
charge.amount = await get_remote_pricing(sor, charge, params=d)
|
||||
charges.append(charge)
|
||||
elif spec.pricing_spec_mode == 'spec_subtype':
|
||||
sub_charges = await pricing_program_chargeing(self.sor,
|
||||
sub_charges = await pricing_program_charging(sor,
|
||||
charge.subppid, d)
|
||||
charges += sub_charges
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user