|
@@ -160,10 +160,21 @@ procedure TBillsGatherFrame.zgGclBillsCellGetColor(Sender: TObject;
|
|
|
Result := bHasSame and bHasDiffer;
|
|
|
end;
|
|
|
|
|
|
+ function CheckOverRangePercent(AQty, ACompareQty: Double): Boolean;
|
|
|
+ var
|
|
|
+ fCompare: Double;
|
|
|
+ begin
|
|
|
+ fCompare := TProjectData(FBillsGatherData.ProjectData).ProjProperties.DecimalManager.Common.Quantity.CompareValue;
|
|
|
+ if Abs(AQty) > fCompare then
|
|
|
+ Result := (ACompareQty / AQty * 100) > SupportManager.ConfigInfo.OverRangePercent
|
|
|
+ else
|
|
|
+ Result := Abs(ACompareQty) > fCompare;
|
|
|
+ end;
|
|
|
+
|
|
|
function CheckOverRange(ARecIndex: Integer): Boolean;
|
|
|
var
|
|
|
Rec: TsdDataRecord;
|
|
|
- fQuantity, fDealQuantity, fEndDealQuantity, fCompare: Double;
|
|
|
+ fQuantity, fDealQuantity, fEndDealQuantity: Double;
|
|
|
begin
|
|
|
Rec := saGclBills.DataView.Records[ARecIndex];
|
|
|
Result := False;
|
|
@@ -172,13 +183,19 @@ procedure TBillsGatherFrame.zgGclBillsCellGetColor(Sender: TObject;
|
|
|
fDealQuantity := Rec.ValueByName('DealQuantity').AsFloat;
|
|
|
fQuantity := Rec.ValueByName('Quantity').AsFloat;
|
|
|
fEndDealQuantity := Rec.ValueByName('EndDealQuantity').AsFloat;
|
|
|
- fCompare := TProjectData(FBillsGatherData.ProjectData).ProjProperties.DecimalManager.Common.Quantity.CompareValue;
|
|
|
+ case SupportManager.ConfigInfo.OverRangeType of
|
|
|
+ 0: Result := CheckOverRangePercent(fQuantity, fEndDealQuantity);
|
|
|
+ 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
|