|
@@ -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
|