Skip to content

Commit

Permalink
Merge pull request #1061 from xzzy/master2
Browse files Browse the repository at this point in the history
PDF Invoice Fix
  • Loading branch information
xzzy authored Apr 30, 2024
2 parents d8fc20f + 818051d commit 4d26afd
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions ledger/payments/pdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -351,10 +351,11 @@ def _create_invoice(invoice_buffer, invoice):
def create_invoice_pdf_bytes(filename, invoice):
invoice_buffer = BytesIO()

if len(invoice.oracle_invoice_number) > 0 and invoice.oracle_invoice_file:
if invoice.oracle_invoice_file.upload:
with open(invoice.oracle_invoice_file.upload.path, "rb") as OracleInvoiceFile:
value = OracleInvoiceFile.read()
if invoice.oracle_invoice_number:
if len(invoice.oracle_invoice_number) > 0 and invoice.oracle_invoice_file:
if invoice.oracle_invoice_file.upload:
with open(invoice.oracle_invoice_file.upload.path, "rb") as OracleInvoiceFile:
value = OracleInvoiceFile.read()

#print (settings.LEDGER_PRIVATE_MEDIA_ROOT+':'+str(invoice.oracle_invoice_file.upload))

Expand Down

0 comments on commit 4d26afd

Please sign in to comment.