Subversion Repositories SmartDukaan

Rev

Rev 7033 | Rev 7072 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 7033 Rev 7040
Line 4185... Line 4185...
4185
def get_document(docType, docSource):
4185
def get_document(docType, docSource):
4186
    document = DocumentStore.get_by(docType = docType, docSource = docSource)
4186
    document = DocumentStore.get_by(docType = docType, docSource = docSource)
4187
    if document:
4187
    if document:
4188
        return document.document
4188
        return document.document
4189
    else:
4189
    else:
4190
        return None
4190
        return bin(0)
4191
 
4191
 
4192
def retrieve_invoice(orderId):
4192
def retrieve_invoice(orderId):
4193
    strOrderId = '0'*(10-len(str(orderId)))+str(orderId)
4193
    strOrderId = '0'*(10-len(str(orderId)))+str(orderId)
4194
    filename = "/SaholicInvoices/" + strOrderId[0:2] + "/" + strOrderId[2:4] + ""/"" + strOrderId[4:6] + "/" + str(orderId) + ".pdf"  
4194
    filename = "/SaholicInvoices/" + strOrderId[0:2] + "/" + strOrderId[2:4] + ""/"" + strOrderId[4:6] + "/" + str(orderId) + ".pdf"  
4195
    file = open(filename, "rb")
4195
    file = open(filename, "rb")