Pman.Tab.XtupleStockHistory.bjs
authorEdward <edward@roojs.com>
Fri, 18 Jul 2014 08:16:27 +0000 (16:16 +0800)
committerEdward <edward@roojs.com>
Fri, 18 Jul 2014 08:16:27 +0000 (16:16 +0800)
Pman.Tab.XtupleStockHistory.js

Pman.Tab.XtupleStockHistory.bjs
Pman.Tab.XtupleStockHistory.js

index 808794f..bf48f68 100644 (file)
                             "header": "Fifo Landed Unitcost",
                             "width": 75,
                             "xtype": "ColumnModel",
-                            "|renderer": "function(v,x,r) { \n    \n    var cu = ((r.data.invfifo_cost_after*1 - r.data.invfifo_cost_before*1) / Math.abs(r.data.invdetail_qty)).toFixed(2);\n    var lu = (v*1).toFixed(2) ;\n    if (cu != lu) {\n        return '<span style=\"color:red\">' + lu +'/' +cu + '</span>';\n    }\n    return  lu;\n }",
+                            "|renderer": "function(v,x,r) { \n    \n    var cu = ((r.data.invfifo_cost_after*1 - r.data.invfifo_cost_before*1) / Math.abs(r.data.invdetail_qty)).toFixed(2);\n    var lu = (v*1).toFixed(2) ;\n    if (cu != lu) {\n        \n        if (r.data.invfifo_void > 0) { \n            return   '<s><span style=\"color:red\">' + + lu +'/' +cu + '</span></s>';\n        } \n        \n        return '<span style=\"color:red\">' + lu +'/' +cu + '</span>';\n    }\n    if (r.data.invfifo_void > 0) { \n        return   '<s>' + lu + '</s>';\n    } \n        \n    return  lu;\n }",
                             "|xns": "Roo.grid"
                         }
                     ]
index a93e9fd..bbe8d21 100644 (file)
@@ -1120,8 +1120,17 @@ Pman.Tab.XtupleStockHistory = new Roo.XComponent({
                             var cu = ((r.data.invfifo_cost_after*1 - r.data.invfifo_cost_before*1) / Math.abs(r.data.invdetail_qty)).toFixed(2);
                             var lu = (v*1).toFixed(2) ;
                             if (cu != lu) {
+                                
+                                if (r.data.invfifo_void > 0) { 
+                                    return   '<s><span style="color:red">' + + lu +'/' +cu + '</span></s>';
+                                } 
+                                
                                 return '<span style="color:red">' + lu +'/' +cu + '</span>';
                             }
+                            if (r.data.invfifo_void > 0) { 
+                                return   '<s>' + lu + '</s>';
+                            } 
+                                
                             return  lu;
                          }
                     }