Where did you make your customizations? Was it done in the database itself or a file?
What values were changed? Do you have a backup of your DB?
Which files are responsible for generating the actual PDF?
No changes have been made to the database and I do have backups. I changed the following files:
line 356 in public_html/invoice/include/classcron.php:
From: $email -> subject = $email->set_subject();
To: $email -> subject = date('F Y')." Invoice";
Line 306 in public_html/invoice/include/classcron.php:
From: $spc2us_pref = str_replace(" ", "_", $invoice['index_name']);
To: $spc2us_pref = str_replace(" ", "_", date('F Y'));
Line 213 in public_html/invoice/include/class/export.php:
From: $spc2us_pref = str_replace(" ", "_", $invoice['index_name']);
To: $spc2us_pref = str_replace(" ", "_", date('F Y'));
I also changed public_html/invoice/include/class/email/body.php to the following:
<?php<br />class email_body {
public function create()
{
switch ($this->email_type)
{
case "cron_payment":
{
$email_body = <<<EOT<br />Hi $this->customer_name,
Attached is a PDF copy of this month's invoice.
Thanks!
My Name
$this->biller_name
XXX-XXX-XXXX (office)
XXX-XXX-XXXX (cell)
EOT;
break;
}
case "cron_invoice_reprint":
{
$email_body = <<<EOT<br />Hi $this->customer_name,
Attached is a PDF copy of this month's invoice.
Thanks!
My Name
$this->biller_name
XXX-XXX-XXXX (office)
XXX-XXX-XXXX (cell)
EOT;
break;
}
case "cron_invoice":
default:
{
$email_body = <<<EOT<br />Hi $this->customer_name,
Attached is a PDF copy of this month's invoice.
Thanks!
My Name
$this->biller_name
XXX-XXX-XXXX (office)
XXX-XXX-XXXX (cell)
EOT;
}
}
return $email_body;
}
}
OK, I did some more testing after reinstalling from a fresh copy of the source files. It seems that when I change line 306 in public_html/invoice/include/class/cron.php:
From: $spc2us_pref = str_replace(" ", "_", $invoice['index_name']);
To: $spc2us_pref = str_replace(" ", "_", date('F Y'));
and:
Line 213 in public_html/invoice/include/class/export.php:
From: $spc2us_pref = str_replace(" ", "_", $invoice['index_name']);
To: $spc2us_pref = str_replace(" ", "_", date('F Y'));
...the problem occurs. How can I change my file names without breaking PDF generation?
That im unsure of cause of my lack of knowledge with this sort of thing. One thought is where is the index_name defined from and is the substitution you present understood in this case. It looks like the previous entry called a value that may have been addressed earlier or passed with an include. I do like your use for this as invoices with dates generated is kinda the norm and good for tracking purposes.
I fixed the problem...
per http://www.simpleinvoices.org/forum/discussion/comment/7239/#Comment_7239, I had to also modify public_html/modules/invoices/email.php with the exact same changes as made above. Once I did that my attachments started working correctly with the correct naming convention (date.pdf).
It looks like you're new here. If you want to get involved, click one of these buttons!