Tekki/sql-ledger

txt printing problem (specific to Tekki version)

pjaouen opened this issue · 5 comments

I have a problem with a POS printer (see sql-ledger forum)
In fact, printing an invoice txt file pos_invoice.txt or invoice.txt on the POS printer or Laser Printer gives an Error!
| lpr -PPrinter : Permission denied (it is not a permission problem : both printers print correctly Postscript in sql-ledger and txt files with command)

The new fact : I have 2 test versions of sql-ledger (Tekki and DWS) on another new computer SuSE 15.2 : txt printing is OK on the DWS version and not on the Tekki (but Tekki works with Unicode utf8 !)

Tekki commented

Is this the same printer that you use for PDFs and it works with them, but with TXT is doesn't?

Yes on both POSprinter and Laserprinter : it is OK with pdf and not with txt (but OK with the DWS version!)

Tekki commented

I see, things are very wrong around Form.pm 772. But I have some difficulties to reproduce the complete error because I don't have a running CUPS installation anywhere. Can you do the following: Replace lines 771 - 778 in SL/Form.pm with

  if (my $out = $self->{OUT}) {
    my $mode = '>';
    if ($out =~ /^\|/) {
      $out =~ s/^\|\s*//;
      $mode = '|-';
    }
    open(OUT, "$mode:utf8", $out) or $self->error("$out : $!");
  } else {
    open(OUT, ">-") or $self->error("STDOUT : $!");

    $self->header;
  }

and then report back if this change allows printing of TXT files without affecting the PDFs?

Hello,
it is OK now ; no problem with different printings. Thanks

Another problem
Do you have an invoice.tex running with more than 1 copy ?

For a few years I have an error with latex in case of 2 or more copies;
but the usable files .dvi and .ps are in the user dir (with Tekki or DWS
versions)
my invoice.tex template was OK many years ago

Tekki commented

Thanks for the feedback, I'll publish a new version in the next days.

I'll take a note about printing of copies.