diff --git a/deep_sequencing_unit/source/Jython/create_QGF_Invoices_simplified.py b/deep_sequencing_unit/source/Jython/create_QGF_Invoices_simplified.py index 33e3b6d6545382e3c25ac506af35140ab995d914..019aa0892936b7456cef134e39d50ad095e83b94 100644 --- a/deep_sequencing_unit/source/Jython/create_QGF_Invoices_simplified.py +++ b/deep_sequencing_unit/source/Jython/create_QGF_Invoices_simplified.py @@ -383,7 +383,11 @@ def getFLowcellData(service, configMap, flowcell, logger): s[sampleCode.split("-")[-1]] = sampleProperties sampleDict[lane] = s pi = sanitizeString(sampleProperties[configMap["pIPropertyName"]]) - sentInvoice = {'true': True, 'false': False}.get((sampleProperties['INVOICE']).lower()) + invoiceProperty = sampleProperties['INVOICE'] + # if sample got created via Excel upload, the property could be not set, which is represented by None + if (invoiceProperty is None): + invoiceProperty = 'false' + sentInvoice = {'true': True, 'false': False}.get(invoiceProperty.lower()) logger.debug("PI for " + sampleCode + ": " + pi) logger.debug("Invoice sent for " + sampleCode + ": " + str(sentInvoice))