Rolf Stöckli
Thu, 20 Oct 2011 10:50:24 -0700

Am 20.10.2011 19:45, schrieb Jeff Roberts:

    Thanks Tekki

    I did this to line 571 - commented the line out and added a new line
    beneath it.

    # my $fileid = time;
    my $fileid = "JRElectronics";

    The result is a .pdf named 'JRElectronics_invoice_6475.pdf'

I feat SQL-Ledger needs this timestamp somewhere. A second place where it's 
more safe to change is here:

https://github.com/Tekki/sql-ledger/blob/master/SL/Form.pm#L950

- create new scalar from $self->{tmpfile}
- replace the numbers at the beginning with the text you like
- use this scalar instead of $self->{tmpfile} in the header

I wonder if there's a way to order an old mailing list post from mailman and then reply to it to keep the threading? No such über feature was visible in the admin interface :>

Anyway, about the subject, I also started thinking that saving pdfs with just as "invoice_02-02.pdf" is too little information. Maybe the customer wants to get an immediate understanding who the sender is and I myself also want to know who the customer is without having to open the file. Thanks for the discussion pointing me in the right direction, now the Print and E-mail buttons create a better file name for me with this patch:

diff --git a/bin/mozilla/io.pl b/bin/mozilla/io.pl
index 1ab9b78..f5f6153 100644
--- a/bin/mozilla/io.pl
+++ b/bin/mozilla/io.pl
@@ -1750,8 +1750,8 @@ sub print_form {

   }

-  $form->{fileid} = $form->{"${inv}number"};
-  $form->{fileid} =~ s/(\s|\W)+//g;
+ $form->{fileid} = $form->{"company"} . "_" . $form->{"name"} . "_" . $form->{"${inv}number"};
+  $form->{fileid} =~ s/(\s)+//g;

   $form->format_string(qw(email cc bcc));

1330003088_invoice_OÜDRInformationSystems_OÜMyClient_02-02.pdf

Timestamp is automatically cut off if you use the E-mail button instead of attaching it manually.

Notice having to cut off \W from filter regex to keep umlauts ÖÜÕÄ.

Gotta love FOSS.

--
Leho Kraav, M.Sc.

http://leho.kraav.com
_______________________________________________
SQL-Ledger mailing list
[email protected]
http://lists.ledger123.com/mailman/listinfo/sql-ledger

Reply via email to