Forráskód Böngészése

Bug 增加金额模式后,将本期完成计量当做一般合同支付项计算

MaiXinRong 9 éve
szülő
commit
d39a039138
2 módosított fájl, 8 hozzáadás és 3 törlés
  1. 2 2
      DataModules/DealPaymentDm.pas
  2. 6 1
      DataModules/PhasePayDm.pas

+ 2 - 2
DataModules/DealPaymentDm.pas

@@ -463,9 +463,9 @@ procedure TDealPaymentData.sdvDealPaymentSetText(var Text: string;
       Rec.ValueByName('Formula').AsString := Text;
       AValue.Owner.ValueByName(sFField).AsString := Text;
       if ARecord.ValueByName('Pre' + AValue.FieldName).AsFloat = 0 then
-        fTotalPrice := FPayFormula.Calculate(Text, Rec.ValueByName('StartedPrice').AsFloat) - AValue.AsFloat
+        fTotalPrice := FPayFormula.Calculate(Text, Rec.ValueByName('StartedPrice').AsFloat)
       else
-        fTotalPrice := FPayFormula.Calculate(Text) - AValue.AsFloat;
+        fTotalPrice := FPayFormula.Calculate(Text);
     end;
     iID := ARecord.ValueByName('ID').AsInteger;
     if CheckStartedPrice(iID) then

+ 6 - 1
DataModules/PhasePayDm.pas

@@ -160,12 +160,17 @@ end;
 procedure TPhasePayData.CalculateAll;
 var
   iIndex: Integer;
+  Rec: TsdDataRecord;
 begin
   if TPhaseData(FPhaseData).StageDataReadOnly then Exit;
 
   RepairPhaseRecord;
   for iIndex := 0 to sddPhasePay.RecordCount - 1 do
-    Calculate(sddPhasePay.Records[iIndex].ValueByName('ID').AsInteger);
+  begin
+    Rec := sddPhasePay.Records[iIndex];
+    if GetCalcType(Rec.ValueByName('ID').AsInteger) = 0 then
+      Calculate(Rec.ValueByName('ID').AsInteger);
+  end;
   CalculateCurPay;
 end;