Add 'ideal_margin' for Catapult export

This commit is contained in:
Lance Edgar 2020-03-30 00:06:01 -05:00
parent 3a956c444d
commit 06f40f350e

View file

@ -72,7 +72,7 @@ class InventoryItemImporter(FromCore, catapult_importing.model.InventoryItemImpo
'price_divider', 'price_divider',
'base_price', 'base_price',
# 'disc_mult', # 'disc_mult',
# 'ideal_margin', 'ideal_margin',
'bottle_deposit', 'bottle_deposit',
'pos_menu_group', 'pos_menu_group',
# 'scale_label', # 'scale_label',
@ -214,10 +214,10 @@ class InventoryItemImporter(FromCore, catapult_importing.model.InventoryItemImpo
'last_cost': product.cost, 'last_cost': product.cost,
'price_divider': product.quantity or 1, # TODO: is this right? 'price_divider': product.quantity or 1, # TODO: is this right?
'base_price': product.normal_price, 'base_price': product.normal_price,
'ideal_margin': department.margin * 100 if department.margin else None,
# TODO: does CORE have these? # TODO: does CORE have these?
# 'disc_mult': None, # 'disc_mult': None,
# 'ideal_margin': None,
'bottle_deposit': product.deposit or None, 'bottle_deposit': product.deposit or None,
'pos_menu_group': product.subdepartment.name if product.subdepartment else None, 'pos_menu_group': product.subdepartment.name if product.subdepartment else None,