|
@@ -367,20 +367,12 @@ procedure TDealPaymentData.sdvDealPaymentSetText(var Text: string;
|
|
|
ARecord: TsdDataRecord; AValue: TsdValue; AColumn: TsdViewColumn;
|
|
|
var Allow: Boolean);
|
|
|
|
|
|
- function GetRecord: TsdDataRecord;
|
|
|
- begin
|
|
|
- if Pos('TotalPrice', AValue.FieldName) > 0 then
|
|
|
- Result := sddDealPayment.FindKey('idxID', ARecord.ValueByName('ID').AsInteger)
|
|
|
- else
|
|
|
- Result := ARecord;
|
|
|
- end;
|
|
|
-
|
|
|
procedure CheckLockedData;
|
|
|
var
|
|
|
Rec: TsdDataRecord;
|
|
|
sFormula: string;
|
|
|
begin
|
|
|
- Rec := GetRecord;//sddDealPayment.FindKey('idxID', ARecord.ValueByName('ID').AsInteger);
|
|
|
+ Rec := ARecord;//sddDealPayment.FindKey('idxID', ARecord.ValueByName('ID').AsInteger);
|
|
|
if Rec.ValueByName('CalcType').AsInteger = 1 then
|
|
|
begin
|
|
|
if SameText(AValue.FieldName, 'Name') or
|
|
@@ -458,7 +450,7 @@ procedure TDealPaymentData.sdvDealPaymentSetText(var Text: string;
|
|
|
fTotalPrice, fAllow: Double;
|
|
|
Rec: TsdDataRecord;
|
|
|
begin
|
|
|
- Rec := GetRecord;//sddDealPayment.FindKey('idxID', ARecord.ValueByName('ID').AsInteger);
|
|
|
+ Rec := ARecord;//sddDealPayment.FindKey('idxID', ARecord.ValueByName('ID').AsInteger);
|
|
|
sFField := StringReplace(AValue.FieldName, 'TotalPrice', 'Formula', []);
|
|
|
if CheckStringNull(Text) or CheckNumeric(Text) then
|
|
|
begin
|
|
@@ -470,7 +462,7 @@ procedure TDealPaymentData.sdvDealPaymentSetText(var Text: string;
|
|
|
begin
|
|
|
Rec.ValueByName('Formula').AsString := Text;
|
|
|
AValue.Owner.ValueByName(sFField).AsString := Text;
|
|
|
- if ARecord.ValueByName('Pre' + AValue.FieldName).AsFloat = 0 then
|
|
|
+ if AValue.Owner.ValueByName('Pre' + AValue.FieldName).AsFloat = 0 then
|
|
|
fTotalPrice := FPayFormula.Calculate(Text, Rec.ValueByName('StartedPrice').AsFloat)
|
|
|
else
|
|
|
fTotalPrice := FPayFormula.Calculate(Text);
|
|
@@ -483,7 +475,7 @@ procedure TDealPaymentData.sdvDealPaymentSetText(var Text: string;
|
|
|
if CheckStartedPrice(iID) then
|
|
|
begin
|
|
|
sPreField := StringReplace(AValue.FieldName, 'TotalPrice', 'PreTotalPrice', []);
|
|
|
- fAllow := GetAllowTotalPrice(iID, fTotalPrice, ARecord.ValueByName(sPreField).AsFloat);
|
|
|
+ fAllow := GetAllowTotalPrice(iID, fTotalPrice, AValue.Owner.ValueByName(sPreField).AsFloat);
|
|
|
Text := FloatToStr(fAllow);
|
|
|
if fAllow < fTotalPrice then
|
|
|
TipMessage(Format('“%s”已达扣款限额,本期金额计%s。', [Rec.ValueByName('Name').AsString, Text]))
|