@classmethod<EOL><INDENT>def create_from_item(cls, amount, item_description, **kwargs):<DEDENT>
submissionUser = kwargs.pop('<STR_LIT>', None)<EOL>collectedByUser = kwargs.pop('<STR_LIT>', None)<EOL>calculate_taxes = kwargs.pop('<STR_LIT>', False)<EOL>grossTotal = kwargs.pop('<STR_LIT>',None)<EOL>new_invoice = cls(<EOL>grossTotal=grossTotal or amount,<EOL>total=amount,<EOL>submissionUser=submissionUser,<EOL>collectedByUser=collectedByUser,<EOL>buyerPaysSalesTax=getConstant('<STR_LIT>'),<EOL>data=kwargs,<EOL>)<EOL>if calculate_taxes:<EOL><INDENT>new_invoice.calculateTaxes()<EOL><DEDENT>new_invoice.save()<EOL>InvoiceItem.objects.create(<EOL>invoice=new_invoice,<EOL>grossTotal=grossTotal or amount,<EOL>total=amount,<EOL>taxes=new_invoice.taxes,<EOL>description=item_description,<EOL>)<EOL>return new_invoice<EOL>
Creates an Invoice as well as a single associated InvoiceItem
with the passed description (for things like gift certificates)