Problem printing decimals in Print Now View

Talk about Printing & Exporting Settings

Moderators: ne_moj, zewa

ScottL
Newbie
Newbie
Posts: 8
Joined: Jun 1st, '09, 18:03

Problem printing decimals in Print Now View

Postby ScottL » Jul 16th, '09, 18:15

Hi,

When I click the "Print Now" option money values are not having the decimal places come up like in the add/edit view for number that are entered without any cents. AS an example, I have a field that is Amount, I type in 10 to signify $10.00 In the add/edit view, since I told the column to display 2 decimal places it does and show up correctly as 10.00. In the print view mode it shows up as just "10" without the .00. Of course if I enter 10.50 it shows up just fine as 10.50.

Is there anything I can do to fix this?

Thanks,
-Scott

administrator
Site Admin
Site Admin
Posts: 5939
Joined: Jan 7th, '09, 23:18
Contact:

Re: Problem printing decimals in Print Now View

Postby administrator » Jul 18th, '09, 11:35

What version you use?
Also post here a definition of the field, that makes problems, so we could check it.

ScottL
Newbie
Newbie
Posts: 8
Joined: Jun 1st, '09, 18:03

Re: Problem printing decimals in Print Now View

Postby ScottL » Jul 20th, '09, 16:11

Hi

This is with the latest version 5.07 and the field definition is:

"amount"=>array("header"=>"Amount", "type"=>"money", "sign"=>"$","dec_separator"=>".","decimal_places"=>"2","align"=>"center", "width"=>"5%", "wrap"=>"nowrap", "text_length"=>"15", "tooltip"=>"false", "tooltip_type"=>"floating", "case"=>"normal", "summarize"=>"true", "sort_type"=>"string", "sort_by"=>"","sign_place"=>"before", "visible"=>"true", "on_js_event"=>""),

Thanks!
-Scott

administrator
Site Admin
Site Admin
Posts: 5939
Joined: Jan 7th, '09, 23:18
Contact:

Re: Problem printing decimals in Print Now View

Postby administrator » Jul 25th, '09, 13:50

Find this piece of code in GetFieldValueByType() method :

Code: Select all

                     
// -= ADD / EDIT / DETAILS MODE =- 
....
  case "money":
                            $field_property_money_sign = $this->GetFieldProperty($field_name, "sign", "view");
                            $money_sign_after          = $money_sign_before = "";
                            if($this->GetFieldProperty($field_name, "sign_place", "view") == "before"){
                                $money_sign_before = $field_property_money_sign;                           
                            }else{                                                       
                                $money_sign_after  = $field_property_money_sign;
                            }
                            return $field_property_pre_addition.$this->nbsp.$money_sign_before."<input class='".$this->cssClass."_dg_textbox' ".$field_width." type='text' title='".$this->GetFieldTitle($field_name)."' name='".$field_req_type.$field_name."' id='".$field_req_type.$field_name."' value='".trim($field_value)."' ".$field_maxlength." ".$readonly." ".$on_js_event." ".$autocomplete.">".$money_sign_after.$this->nbsp.$field_property_post_addition;
                            break;                     


and replace it with this one

Code: Select all

                        case "money":
                            $field_property_money_sign = $this->GetFieldProperty($field_name, "sign", "edit");
                            $money_sign_after          = $money_sign_before = "";
                            if($this->GetFieldProperty($field_name, "sign_place", "edit") == "before"){
                                $money_sign_before = $field_property_money_sign;                           
                            }else{                                                       
                                $money_sign_after  = $field_property_money_sign;
                            }
                            return $field_property_pre_addition.$this->nbsp.$money_sign_before."<input class='".$this->cssClass."_dg_textbox' ".$field_width." type='text' title='".$this->GetFieldTitle($field_name)."' name='".$field_req_type.$field_name."' id='".$field_req_type.$field_name."' value='".trim($field_value)."' ".$field_maxlength." ".$readonly." ".$on_js_event." ".$autocomplete.">".$money_sign_after.$this->nbsp.$field_property_post_addition;
                            break;                     


This issue will be fixed in next version.
Thanks.

medisoft01
Newbie
Newbie
Posts: 6
Joined: Nov 27th, '10, 13:50

Re: Problem printing decimals in Print Now View

Postby medisoft01 » Dec 18th, '10, 10:24

How Do I Add Print Now Option in My View Mode & As Well as Redirect my Print Now Link to my customised printing

administrator
Site Admin
Site Admin
Posts: 5939
Joined: Jan 7th, '09, 23:18
Contact:

Re: Problem printing decimals in Print Now View

Postby administrator » Dec 19th, '10, 10:25

Open datagrid.class.php and simple replace (Ctrl+F - find "print") original "Print" link with your own link.
Embedded "Print" feature is called by :
http://www.apphp.com/php-datagrid/index ... g_Settings.


Return to “Settings: Printing & Exporting”