Add an option not to export charges to ESI

This commit is contained in:
DarkPhoenix
2020-06-15 23:38:07 +03:00
parent c38f05902a
commit b558ae3810
5 changed files with 20 additions and 8 deletions

View File

@@ -56,7 +56,7 @@ INV_FLAG_DRONEBAY = 87
INV_FLAG_FIGHTER = 158
def exportESI(ofit, callback):
def exportESI(ofit, exportCharges, callback):
# A few notes:
# max fit name length is 50 characters
# Most keys are created simply because they are required, but bogus data is okay
@@ -99,7 +99,7 @@ def exportESI(ofit, callback):
item['type_id'] = module.item.ID
fit['items'].append(item)
if module.charge:
if module.charge and exportCharges:
if module.chargeID not in charges:
charges[module.chargeID] = 0
# `or 1` because some charges (ie scripts) are without qty

View File

@@ -314,8 +314,8 @@ class Port:
return importESI(string)
@staticmethod
def exportESI(fit, callback=None):
return exportESI(fit, callback=callback)
def exportESI(fit, exportCharges, callback=None):
return exportESI(fit, exportCharges, callback=callback)
# XML-related methods
@staticmethod