The SimpleInvoices forum has moved to Google Plus - this forum is now read-only
Adjustable PDF filename
  • January 1970 Edit

    Hi there,

    PDF filename adjustable from the settings would be great. Now its fixed coded in the manage.php.

    Frank

  • justinjustin July 2007

    Hey Frank,

    interesting idea

    its always a fine line to walk between keeping something simple and adding useful features

    i'll keep this in mind

    Cheers

    Justin

    SmarterInvoices.com :: Simple Invoices hosting | Kelly.org.au :: Simple Invoices custom development | justin.kelly.org.au
  • FrankFrank July 2007

    I totally agree! Simple invoices needs to simple as it is now but it also needs to be (to my opninion) so flexible that the output (the invoices) can be visualy equal to the invoices a company has at the moment (within limits offcourse).

    That has worked for me at the moment, I've created a completely custom template design!! Except for the (auto) invoice numbering and the invoice filenames it is working perfectly!

  • justinjustin July 2007

    Hey Frank,

    if you could post an example of your custom invoice template it would be great

    all ways interesting to see how people use Simple Invoices

    Cheers

    Justin

    SmarterInvoices.com :: Simple Invoices hosting | Kelly.org.au :: Simple Invoices custom development | justin.kelly.org.au
  • FrankFrank September 2007

    herewith an example of my customized invoice. I'm not completely happy with the way the product text is shown but
    I'll update the soon.
    img src="http://fhs-ecommerce.nl/img/invoice.png' />

  • justinjustin September 2007

    Hey Frank

    awesome looking template!

    what font are your using?

    once your finished if you code post the code for a 'generic' version of the template it would be great

    Cheers

    Justin

    SmarterInvoices.com :: Simple Invoices hosting | Kelly.org.au :: Simple Invoices custom development | justin.kelly.org.au
  • FrankFrank September 2007

    Verdana I believe...

  • isourcemarketingisourcemarketing December 2007

    Any fix yet to change filename of sent pdf?

  • justinjustin December 2007

    Hey isourcemarketing,

    nothings been done just yet

    some work will be done in this area soon - to fix issue with PDF name with spaces in it
    - but adjustable filename is not something i've planned to look at just yet

    Cheers

    Justin

    SmarterInvoices.com :: Simple Invoices hosting | Kelly.org.au :: Simple Invoices custom development | justin.kelly.org.au
  • justinjustin December 2007

    also Frank

    any chance you can upload a copy of you template
    - it looks great - we could modify it for inclusion into Simple Invoices

    Cheers

    Justin

    SmarterInvoices.com :: Simple Invoices hosting | Kelly.org.au :: Simple Invoices custom development | justin.kelly.org.au
  • 2KLiX2KLiX December 2007

    Mooi werk Frank, het ziet er schoon uit.
    Zal leuk zijn als deze een basis template zal kunnen worden.

    Nice work Frank, it looks really clean.
    Would be really nice if this could become a basis template.

  • Where exactly is the code that generates the PDF filename, I would actually like to be able to create the PDF filename based on a custom field

  • Hi

    The filenames are assigned in the following class:

    include/class/export.php

    The filenames may also be assigned through other pages as well, but they are certainly handled by this class.

    Thanks

  • Thanks harvindersingh,

    This line is what changes the pdf export filename for me, I change index_name to a custom_field and it works for me.

    /include/class/export.php
    $spc2us_pref = str_replace(" ", "_", $invoice['index_name']);

  • jmruasjmruas June 2010

    Re geniusofthecrowd

    Please explain what you did. I made the change (may be not well) and the result is the same.

    Thanks.

  • This works for the PDF export filenam.

    basically I have a the custom_field1 under invoice set as a project name.
    so I changed it to this

    $spc2us_pref = str_replace(" ", "_", $invoice['custom_field1']);


    To change the email attachment filename.
    Go to /modules/invoices/email.php

    change the same line
    $spc2us_pref = str_replace(" ", "_", $invoice['index_name']);

  • jmruasjmruas June 2010

    Curious... for me with that line or without it, it's the same: email attached = 0 Kb. :(

  • does it change the filename attachment though? It won't solve the 0kb issue you are experiencing that problem, this is strictly to just change the filename.

  • justinjustin June 2010

    @jose
    re 0 Kb
    - does your custom PDF name still have accented characters in it?

    SmarterInvoices.com :: Simple Invoices hosting | Kelly.org.au :: Simple Invoices custom development | justin.kelly.org.au
  • jmruasjmruas June 2010

    @Justin

    If the name has accented characters:
    1) export fine
    2) email attached = 0 Kb but email subject and body are perfect with accented characters

    My custom name PDF is Nota de Honor

  • Hi

    I think the most easiest and quick solution for you to get rid of the accented characters from the name of the PDF. This way the email script will be able to attach the PDF correctly. This solution requires minimal changes and is very quick.

    Another solution would be to edit the emailing script to change the logic of attaching the PDF and apply some new adjustments to look for a different name of the file (without the accented characters). This solution is slightly more involved, and requires digging into the code further.

    I would suggest that you pick the first solution and get rid of the accented characters.

    Thanks
    Harvinder Singh

  • Lestat_beLestat_be January 2011

    Hi,

    I just changed export.php class like geniusofthecrowd said and it works fine thanks.

    BUT you must put exactly the same for the filename into email.php in modules/invoices or you will get a 0Kb attachment!
    It is what I put into both files (wanted Invoice_ in front of the filename and I use Invoice-customfield1 for order number):
    In export.php:
    $spc2us_pref = str_replace(" ", "Invoice_", $invoice['custom_field1']);
    $this->file_name = 'Invoice_' . $spc2us_pref;

    In email.php:
    $spc2us_pref = str_replace(" ", "_", $invoice['custom_field1']);
    $pdf_file_name = 'Invoice_' . $spc2us_pref . '.pdf';

  • dotjaydotjay May 2012

    To summarise things to check if you're getting 0kb attachments (some of which are mentioned or alluded to above):
    * Make sure that file names are being generated correctly. Despite checking this lots, this actually turned out to be my problem: email.php had my_custom_filename.pdf but I'd accidentally made export.php create files with two file extensions, i.e. my_custom_filename.pdf.pdf.
    * PDF file names cannot have spaces in them (for now).
    * PDF file names should avoid accented characters.

    @Lestat_be
    You probably figured it out, but the error is in your export.php code, which should be:

    $spc2us_pref = str_replace(" ", "_", $invoice['custom_field1']);
    $this->file_name = 'Invoice_' . $spc2us_pref

Categories