SQL-Ledger Homepage

SQL-Ledger User Forum

Forum index page

Log in | Register

Back to the forum
Board view  Mix view

Incorrect selling price sometimes shown on pdf parts report (General)

posted by joe(R), 04.02.2015, 16:16

The only change required is in sub gentex, line 1311

if ($self->{temp} && $hdr->{$_}{type} ne 'n') {
$self->format_string(temp) unless $hdr->{$_}{image};
}

amounts are formatted in the frontend otherwise the html report won't work.
For some reason number formatting also slipped into the gentex function
which is not correct.

Evidently you are looking at a version other than 3.0.6 (the line numbers don't match, and I find no prior definition/initialization of $hdr->{$_}{image} anywhere).

I presume the equivalent 3.0.6 change would be:


--- a/SL/Form.pm  2015-02-04 12:57:55.000000000 -0500
+++ b/SL/Form.pm  2015-02-04 14:46:25.000000000 -0500
@@ -1292,9 +1292,7 @@
     $line = "";
     for (@{$column}) {
       $self->{temp} = $self->{$_}[$i];
-      if ($hdr->{$_}{type} eq 'n') {
-       $self->{temp} = $self->format_amount($myconfig, $self->{temp}, $hdr->{$_}{precision});
-      } else {
+      if ($hdr->{$_}{type} ne 'n') {
        $self->format_string(temp);
       }
       $line .= qq|$self->{temp} \& |;



The problem with this alternative change is that it results in certain amounts never receiving any formatting. For example, a pdf of a parts report which includes a "weight" column ends up with weights like "1234" rather than "1,234". This was not a problem with the change as I suggested. Also, I have yet to observe any problems with the html version of the report. The sub generate_report in ic.pl makes its own calls to format_amount() when generating the html. Those calls are separate from the calls which I proposed for deletion.

If all formatting is to be done in the front end, then code must be added to ic.pl so that all amounts are properly formatted before gentex is called.

 

Complete thread:

Back to the forum
Board view  Mix view
976 Postings in 320 Threads, 326 registered users, 55 users online (0 registered, 55 guests)
SQL-Ledger User Forum | Admin contact
RSS-Feed
powered by my little forum