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
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!
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
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
Any fix yet to change filename of sent pdf?
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
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
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']);
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']);
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.
@jose
re 0 Kb
- does your custom PDF name still have accented characters in it?
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
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';
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