Topic: contact_email in sales_orders table

The contact_email on a sales order has NULL  and I tried to find out how it is supposed to be populated.  I looked at function add_sales_order(&$order) in sales_order_db.inc and didn't see contact_email so how is it being entered into the table?

One other quick question, where/in what file is the sales order pdf report file name created?
I read another thread that said something about the random naming was for security.  I was wondering how that makes what secure.

Thanks,

ed10

Re: contact_email in sales_orders table

The contact_email in the sales_order table is obsolete. It is no longer used.
Instead the contact emails are created in the Contact tab on the customer and or branch.
When you create the contact, remember to make the type of "Orders", or "Generel". If General it will also work for Invoices.

The reason for scrambling the reports is, that otherwise you can enter the following in the url:

https://frontaccounting.com/company/0/pdf_files/sales_order.pdf, if the report name was sales_order.pdf.

Someone can guess the report titles and access them directly this way.

/Joe

Re: contact_email in sales_orders table

Joe:  There are no pdf files in my dir:  /company/0/pdf_files/.  They are being written to my ~/Download dir (I am using Ubuntu).  My printing profile is set to browser printing support. 
Is it possible to just display a report to the computer screen rather than a pdf file? 
Where is the default dir defined for saving the pdf files? 
I am still interested in knowing where the file name is set. 
Is it possible to make the default dir where pdf file are set to be any where on the hard drive?

Thanks for your quick replies
ed10

Re: contact_email in sales_orders table

The pdf file names and path are defined in the End function in /reporting/includes/pdf_report.inc.

I am afraid that the path is hard core defined in the pdf_report.inc file.

/Joe

5 (edited by apmuthu 10/03/2012 02:07:08 am)

Re: contact_email in sales_orders table

Wikied it at:

ReportPaths

and placed a link in

TechInfo Resources

Re: contact_email in sales_orders table

apmuthu, the wiki will be helpful for folks, thanks.
joe:  Why is the permission of  pdf_files directory 777?  I wonder how it is that the pdf gets written to my ~/Download directory?  I see that the last couple of SO's I have printed are also in the pdr_files directory.  Over the last couple of weeks I have printed at least 25 (I am testing the zen_import) and there are only the 2 that I did today.

Re: contact_email in sales_orders table

You can always save a copy of your report with your own name from your pdf viewer.

I have no idea about why it saves to another directory. Maybe Janusz can throw some lights on that.

Re: contact_email in sales_orders table

pdf_files directory is temporary cache on server side, where pdf reports are created. This folder is automatically cleaned from files older than 3 minutes on every print atempt.

'~/Download folder (I guess) is download directory used by your browser to store downloaded files. In most cases pdf reports are sparse after printing, so you can even configure FA to directly send the report to the printer - in this case ~/Download folder will never be used. It is up to you what you do with the reports after downloading it - FA application does not store the generated reports.
Janusz

Re: contact_email in sales_orders table

joe, itronics:

Thanks, that helps me understand what is going on.  I guess it is the same action with all pdf reports?
My Download folder is where browser saves downloaded files.  Is it possible to have reports printed to the screen rather than sent to pdf file or a printer?

Thanks,
ed10

Re: contact_email in sales_orders table

Yes, all the pdf reports are printed in the same manner. You can configure your browser to display pdf files directly, but anyway they have to be cached somehow on client side. Most documents has also equivalent html viewers implemented e.g. you can display invoices in popup window instead of printing clicking on respective link in Customer Inquiry.
Janusz

Re: contact_email in sales_orders table

On reports, the PDF/Printer option shows a PDF page that can be printed on a local printer from the local OS. On Printers / print Profiles, despite setting the main server printer, nothing prints. An example of printer profile usage would be nice.

Re: contact_email in sales_orders table

Well, you have to configure your printers under Setup|Printers first. Examples you will find in en_US-demo.sql file. Currently printing system supports only two print destination types:
. lpd compatible network service (standard port 515);
. printing via client browser.

Lpd is standard service supported by probably all printing systems, also currently most popular CUPS have lpd implementation builtin. Using second method you can print reports to any browser connected to your client box, but this is far less handy when you use FA heavily at work.

The example setup provided in en_US-demo.sql is exactly the same as I use in my office. Fortunatelly works as expected from the beginning. While priniting via browser is excelent option when you want to see the report before printing, there is no big sense to use this destination on printing sales invoices. Sending them directly to print server saves your time.

Janusz

13 (edited by apmuthu 10/09/2012 01:19:06 pm)

Re: contact_email in sales_orders table

Now this thread has got hijacked into a different topic - Sorry.

The demo sql file has the LPD host name as server. Must it be merely a domain, ip or URI? The newer ipp (internet Printing Protocol) supports Port 631. Used to print from one Ubuntu 12.04 to another behind a NAT (opening TCP and UDP ports 2207/8 and 631) and uses http://ip/printers/[print-queue-name] and it does not work on FA.

Re: contact_email in sales_orders table

In my office server is host name on local network were main printer is connected (just put the name in /etc/hosts file if you  do not want to run dns service).

If you want to use network printer in configuration above and you have cups installed, just install cups-bsd package which provides old good lpd service. Or implement iip protocol in FA and send the code back to contributions mailbox wink.

Janusz

Re: contact_email in sales_orders table

Debian Squeeze cups-bsd package (1.4.4-7+squeeze1) can provide for lpd on the server only. In the scenario where FA is a hosted service and the Printer is in another location (office) behind a NAT, would this work without VPN-ing to reside on the same lan?

Also, lpd does not work (?) outside of the LAN.

As for ipp://, it is more of a URI and port (631 instead of 515 for lpd) difference.

16 (edited by apmuthu 10/10/2012 02:00:07 am)

Re: contact_email in sales_orders table

Tested - lpd works like a charm even outside LAN without VPN,

Wikied it.

Thanks!

Re: contact_email in sales_orders table

Just as final comment to the printers sub-thread. IIP and LPD protocols are not compatible, and unfortunatelly the difference does not boils out to default port number. Currently FrontAccounting does not support IPP protocol. For anybody who want to implement IIP protocol in FA RFC 2569 is must read document at start (contains also direct links to both ipp and lpd protocols).

Thanks again for forging the knowledge in Wiki.
Janusz