|
@@ -358,8 +358,10 @@ procedure TBillsMeasureData.sdvBillsMeasureSetText(var Text: String;
|
|
|
AValue.Owner.ValueByName(AField + 'Formula').AsString := Text;
|
|
|
Text := FloatToStr(QuantityRoundTo(EvaluateExprs(Text)));
|
|
|
end;
|
|
|
+
|
|
|
vNode := TBillsIDTreeNode(BillsMeasureTree.FindNode(GetBillsID));
|
|
|
- vNode.Rec.CalcType.AsInteger := 0;
|
|
|
+ if vNode.Rec.CalcType.AsInteger <> 0 then
|
|
|
+ vNode.Rec.CalcType.AsInteger := 0;
|
|
|
end;
|
|
|
|
|
|
procedure SetTotalPrice(const AField: string);
|
|
@@ -383,8 +385,10 @@ procedure TBillsMeasureData.sdvBillsMeasureSetText(var Text: String;
|
|
|
AValue.Owner.ValueByName(AField + 'Formula').AsString := Text;
|
|
|
Text := FloatToStr(TotalPriceRoundTo(EvaluateExprs(Text)));
|
|
|
end;
|
|
|
+
|
|
|
vNode := TBillsIDTreeNode(BillsMeasureTree.FindNode(GetBillsID));
|
|
|
- vNode.Rec.CalcType.AsInteger := 1;
|
|
|
+ if vNode.Rec.CalcType.AsInteger <> 1 then
|
|
|
+ vNode.Rec.CalcType.AsInteger := 1;
|
|
|
end;
|
|
|
|
|
|
procedure DoCurChanged;
|
|
@@ -409,9 +413,23 @@ procedure TBillsMeasureData.sdvBillsMeasureSetText(var Text: String;
|
|
|
Text := FloatToStr(PriceRoundTo(StrToFloatDef(Text, 0)));
|
|
|
end;
|
|
|
|
|
|
+ function CheckValidData: Boolean;
|
|
|
+ begin
|
|
|
+ Result := (AValue.AsString <> Text);
|
|
|
+ if (Pos('Quantity', AColumn.FieldName) > 0) or
|
|
|
+ (Pos('Price', AColumn.FieldName) > 0) then
|
|
|
+ begin
|
|
|
+ if (AValue.AsFloat = 0) and (Text = '') then
|
|
|
+ Result := False;
|
|
|
+ end;
|
|
|
+ end;
|
|
|
+
|
|
|
begin
|
|
|
if not Assigned(AValue) then Exit;
|
|
|
// 修改后数据与原数据相同则不提交
|
|
|
+ if not CheckValidData then
|
|
|
+ Allow := False;
|
|
|
+ if not Allow then Exit;
|
|
|
if (AValue.AsString = Text) or ((AValue.AsFloat = 0) and (Text = '')) then Exit;
|
|
|
|
|
|
CheckLockedData;
|