Pman.Dialog.XtupleJournalEntry.bjs
authorAlan Knowles <alan@roojs.com>
Mon, 23 Dec 2013 09:43:05 +0000 (17:43 +0800)
committerAlan Knowles <alan@roojs.com>
Mon, 23 Dec 2013 09:43:05 +0000 (17:43 +0800)
Pman.Dialog.XtupleJournalEntry.js

Pman.Dialog.XtupleJournalEntry.bjs
Pman.Dialog.XtupleJournalEntry.js

index 48eefe1..f3f9e29 100644 (file)
                                     "header": "Gltrans amount",
                                     "width": 100,
                                     "xtype": "ColumnModel",
-                                    "|renderer": "function(v) { return String.format('{0}', v); }",
+                                    "|renderer": "function(v) { \n\n    var vv = Roo.util.Format.number(v,2);\n    if (v < 0 ) {\n        return '<span color=\"red\">' + vv + '</span>';\n    }\n    return vv; \n}",
                                     "|xns": "Roo.grid"
                                 }
                             ]
index 0dda5e7..5ebb03a 100644 (file)
@@ -423,7 +423,14 @@ Pman.Dialog.XtupleJournalEntry = {
                                 dataIndex : 'gltrans_amount',
                                 header : 'Gltrans amount',
                                 width : 100,
-                                renderer : function(v) { return String.format('{0}', v); }
+                                renderer : function(v) { 
+                                
+                                    var vv = Roo.util.Format.number(v,2);
+                                    if (v < 0 ) {
+                                        return '<span color="red">' + vv + '</span>';
+                                    }
+                                    return vv; 
+                                }
                             }
                         ]
                     }