浏览代码

客户项目超计显示不正确

MaiXinRong 5 年之前
父节点
当前提交
5a04b58fee
共有 1 个文件被更改,包括 8 次插入12 次删除
  1. 8 12
      Frames/BillsGatherFme.pas

+ 8 - 12
Frames/BillsGatherFme.pas

@@ -162,13 +162,17 @@ procedure TBillsGatherFrame.zgGclBillsCellGetColor(Sender: TObject;
 
   function CheckOverRangePercent(AQty, ACompareQty: Double): Boolean;
   var
+    vQtyDecimal: TDecimal;
     fCompare: Double;
   begin
-    fCompare := TProjectData(FBillsGatherData.ProjectData).ProjProperties.DecimalManager.Common.Quantity.CompareValue;
-    if Abs(AQty) > fCompare then
-      Result := (ACompareQty / AQty * 100) > SupportManager.ConfigInfo.OverRangePercent
+    vQtyDecimal := TProjectData(FBillsGatherData.ProjectData).ProjProperties.DecimalManager.Common.Quantity;
+    if Abs(AQty) > vQtyDecimal.CompareValue then
+    begin
+      fCompare := vQtyDecimal.RoundTo(AQty * SupportManager.ConfigInfo.OverRangePercent / 100);
+      Result := vQtyDecimal.RoundTo(ACompareQty - AQty) > vQtyDecimal.CompareValue;
+    end
     else
-      Result := Abs(ACompareQty) > fCompare;
+      Result := Abs(ACompareQty) > vQtyDecimal.CompareValue;
   end;
 
   function CheckOverRange(ARecIndex: Integer): Boolean;
@@ -188,14 +192,6 @@ procedure TBillsGatherFrame.zgGclBillsCellGetColor(Sender: TObject;
       1: Result := CheckOverRangePercent(fDealQuantity, fEndDealQuantity);
       2: Result := CheckOverRangePercent(fQuantity, fEndDealQuantity) or CheckOverRangePercent(fDealQuantity, fEndDealQuantity);
     end;
-    (*
-    case SupportManager.ConfigInfo.OverRangeType of
-      0: Result := QuantityRoundTo(fEndDealQuantity - fQuantity) > fCompare;
-      1: Result := QuantityRoundTo(fEndDealQuantity - fDealQuantity) > fCompare;
-      2: Result := (QuantityRoundTo(fEndDealQuantity - fQuantity) > fCompare)
-                or (QuantityRoundTo(fEndDealQuantity - fDealQuantity) > fCompare);
-    end;
-    *)
   end;
 
 var