From: Ashley J G. <sql...@pu...> - 2007-01-16 04:23:48
|
On Tuesday 16 January 2007 13:11, Jeff Roberts wrote: > Hello All > > When I print an invoice I would like one copy to come out of my inkjet > in full colour for the customer and two copies should come out of my > laser for filing. Currently I find myself having to print to the inkjet > then back up one page, select laser, change the amount to two and print > again. I know this is not a lot of work but If I print 1000 invoices > this year it's going to drive me nuts. Hi Jeff, You could create a shell script that reads from standard input (possibly putting it into a temporary file) then sends that data to two or more calls to lp. We run a thermal docket printer at our shop and I use a script that prepends control codes to print our logo, then send the print job, then sends more data to add newlines and fire the cashdrawer. I later modified the script to also keep logs of every docket, so now I have an automatic audit trail of every printed POS docket which has come in handy a number of times for balancing the till or finding other discrepancies. Essentially, all you'd need to do in your script is: ============================== #!/bin/sh #define a temporary file JOB=/tmp/sl-invprint.ps # capture the job into the temp file cat - > $JOB # Now print it however you like, however many times you like lp -d InkJet < $JOB lp -d Simplex -n 2 < $JOB # if you like, archive the print file: cat $JOB > /var/log/invoices/invoicelog-`date +%Y-$m-%d-%H%M.%S`.ps ============================== Then you just put the name of the script into the printer definition in sql-ledger.conf and away you go (eg, if you save that script as /usr/local/bin/invoiceprint then you just define your printer as 'Invoice Printsystem' => 'invoiceprint'). Doing this gives you a great deal of control over how you process printjobs - eg you could use a script that parsed the invoice for fax numbers and faxed a copy of the invoice to the client, or whatever else "behind the scenes" stuff you wanted to do. -- Regards, Ashley J Gittins web: http://www.purple.dropbear.id.au jabber: agi...@pu... |