procedure Tfrm_main.cxdbgrid4DBTableView1CustomDrawCell(Sender: TcxCustomGridTableView; ACanvas: TcxCanvas;<br> AViewInfo: TcxGridTableDataCellViewInfo; var ADone: Boolean);<br>var<br> n1,n2,n3,n4,n5,n6,n7,n8,n9,n10,n11,n12,n13,n14,n15,n16:double;<br>begin<br> if trim(VarAsType(AViewInfo.GridRecord.DisplayTexts[cxdbgrid4DBTableView1Column4.index], varString))=''<br> then n4:=0 else n4:=strtofloat(trim(VarAsType(AViewInfo.GridRecord.DisplayTexts[cxdbgrid4DBTableView1Column4.index], varString)));<br><br> if trim(VarAsType(AViewInfo.GridRecord.DisplayTexts[cxdbgrid4DBTableView1Column5.index], varString))=''<br> then n5:=0 else n5:=strtofloat(trim(VarAsType(AViewInfo.GridRecord.DisplayTexts[cxdbgrid4DBTableView1Column5.index], varString)));<br><br> if trim(VarAsType(AViewInfo.GridRecord.DisplayTexts[cxdbgrid4DBTableView1Column6.index], varString))=''<br> then n6:=0 else n6:=strtofloat(trim(VarAsType(AViewInfo.GridRecord.DisplayTexts[cxdbgrid4DBTableView1Column6.index], varString)));<br><br> if trim(VarAsType(AViewInfo.GridRecord.DisplayTexts[cxdbgrid4DBTableView1Column7.index], varString))=''<br> then n7:=0 else n7:=strtofloat(trim(VarAsType(AViewInfo.GridRecord.DisplayTexts[cxdbgrid4DBTableView1Column7.index], varString)));<br><br> if trim(VarAsType(AViewInfo.GridRecord.DisplayTexts[cxdbgrid4DBTableView1Column9.index], varString))=''<br> then n9:=0 else n9:=strtofloat(trim(VarAsType(AViewInfo.GridRecord.DisplayTexts[cxdbgrid4DBTableView1Column9.index], varString)));<br><br> if trim(VarAsType(AViewInfo.GridRecord.DisplayTexts[cxdbgrid4DBTableView1Column10.index], varString))=''<br> then n10:=0 else n10:=strtofloat(trim(VarAsType(AViewInfo.GridRecord.DisplayTexts[cxdbgrid4DBTableView1Column10.index], varString)));<br><br> if trim(VarAsType(AViewInfo.GridRecord.DisplayTexts[cxdbgrid4DBTableView1Column11.index], varString))=''<br> then n11:=0 else n11:=strtofloat(trim(VarAsType(AViewInfo.GridRecord.DisplayTexts[cxdbgrid4DBTableView1Column11.index], varString)));<br><br> if trim(VarAsType(AViewInfo.GridRecord.DisplayTexts[cxdbgrid4DBTableView1Column12.index], varString))=''<br> then n12:=0 else n12:=strtofloat(trim(VarAsType(AViewInfo.GridRecord.DisplayTexts[cxdbgrid4DBTableView1Column12.index], varString)));<br><br> if trim(VarAsType(AViewInfo.GridRecord.DisplayTexts[cxdbgrid4DBTableView1Column15.index], varString))=''<br> then n15:=0 else n15:=strtofloat(trim(VarAsType(AViewInfo.GridRecord.DisplayTexts[cxdbgrid4DBTableView1Column15.index], varString)));<br><br> if trim(VarAsType(AViewInfo.GridRecord.DisplayTexts[cxdbgrid4DBTableView1Column16.index], varString))=''<br> then n16:=0 else n16:=strtofloat(trim(VarAsType(AViewInfo.GridRecord.DisplayTexts[cxdbgrid4DBTableView1Column16.index], varString)));<br><br> // n4 生產數量 n5庫存數量 n6未過帳進貨驗收 n7JIT庫存 n8JIT未過帳進貨驗收 n9未過帳發料量<br> // n10未過帳退料量 n11未過帳內交入 n12未過帳費退量(內交) n13 n14 n15未過帳費領量 n16 總計<br><br> if (n5+n7-n9-n4-n15<0) and (n5+n7+n6+n8+n11+n10+n12-n15-n9-n4<0) then ACanvas.canvas.Font.Color := clred;<br> if (n5+n7-n9-n4-n15<0) and (n5+n7+n6+n8+n11+n10+n12-n15-n9-n4>=0) then ACanvas.canvas.Font.Color := clfuchsia;<br><br><br>end;