فهرست منبع

Task #1291 合同支付,计算规则变更

MaiXinRong 10 سال پیش
والد
کامیت
ce3ab470fd
3فایلهای تغییر یافته به همراه20 افزوده شده و 11 حذف شده
  1. 6 6
      Frames/DealPaymentFme.dfm
  2. 3 0
      Frames/DealPaymentFme.pas
  3. 11 5
      Units/FormulaCalc.pas

+ 6 - 6
Frames/DealPaymentFme.dfm

@@ -97,7 +97,7 @@ object DealPaymentFrame: TDealPaymentFrame
     Left = 0
     Top = 41
     Width = 368
-    Height = 289
+    Height = 264
     Align = alClient
     BevelOuter = bvNone
     TabOrder = 0
@@ -105,7 +105,7 @@ object DealPaymentFrame: TDealPaymentFrame
       Left = 0
       Top = 0
       Width = 368
-      Height = 289
+      Height = 264
       Options = [goRangeSelect, goRowSizing, goColSizing, goCellNotMaintainData, goFixedRowShowNo, goFixedColShowNo, goAlwaysShowSelection]
       OptionsEx = []
       ColCount = 7
@@ -155,9 +155,9 @@ object DealPaymentFrame: TDealPaymentFrame
   end
   object pnlParameter: TPanel
     Left = 0
-    Top = 330
+    Top = 305
     Width = 368
-    Height = 125
+    Height = 150
     Align = alBottom
     BevelOuter = bvNone
     TabOrder = 3
@@ -165,10 +165,10 @@ object DealPaymentFrame: TDealPaymentFrame
       Left = 0
       Top = 0
       Width = 368
-      Height = 125
+      Height = 150
       OptionsEx = []
       ColCount = 3
-      RowCount = 6
+      RowCount = 7
       ShowGridLine = False
       DefaultColWidth = 73
       DefaultFixedColWidth = 25

+ 3 - 0
Frames/DealPaymentFme.pas

@@ -114,6 +114,9 @@ begin
   zgParameter.Cells[1, 5].Text := '100章本期完成计量';
   zgParameter.Cells[1, 5].Align := gaCenterLeft;
   zgParameter.Cells[2, 5].Text := 'ybbqwc';
+  zgParameter.Cells[1, 6].Text := '第一部分 本期完成计量';
+  zgParameter.Cells[1, 6].Align := gaCenterLeft;
+  zgParameter.Cells[2, 6].Text := 'fpbqwc';
 end;
 
 procedure TDealPaymentFrame.zgParameterCellCanEdit(Sender: TObject;

+ 11 - 5
Units/FormulaCalc.pas

@@ -7,7 +7,7 @@ uses
 
 const
   ArithmeticCharSet: set of Char = ['0'..'9', '.', '(','[','{', ')',']','}', '+','-','*','/','^', '%', '='];
-  ExprsBaseCharSet: set of Char = ['h', 't', 'j', 'b', 'q', 'w', 'c', 'k', 'g', 'y', 'f', 'l'];
+  ExprsBaseCharSet: set of Char = ['h', 't', 'j', 'b', 'q', 'w', 'c', 'k', 'g', 'y', 'f', 'l', 'p'];
   ExprsExceptCharSet: set of Char = ['h', 't', 'j', 'k', 'g', 'y', 'f', 'c', 'l'];
 
 type
@@ -276,17 +276,23 @@ end;
 
 function TPayFormula.FirstPartPrice: Double;
 begin
+  {
   with TProjectData(FProjectData).PhaseData do
     if Active then
     begin
-      // 初次达到起扣金额时,取累计完成计量-起扣金额
       if FStartedPrice = 0 then
         Result := StageData.FirstPart[1, 4]
       else
-        Result := StageData.FirstPart[2, 4] - FStartedPrice;
+        Result := StageData.FirstPart[2, 4] - FStartPrice;
     end
     else
       Result := 0;
+  }
+  with TProjectData(FProjectData).PhaseData do
+    if Active then
+      Result := StageData.FirstPart[1, 4]
+    else
+      Result := 0;
 end;
 
 function TPayFormula.GetCalcText: string;
@@ -295,8 +301,8 @@ begin
   Result := StringReplace(Result, 'kgyfk', FloatToStr(StartedSubsist), [rfReplaceAll, rfIgnoreCase]);
   Result := StringReplace(Result, 'clyfk', FloatToStr(MaterialSubsist), [rfReplaceAll, rfIgnoreCase]);
   Result := StringReplace(Result, 'ybbqwc', FloatToStr(ChapterStageGather(1)), [rfReplaceAll, rfIgnoreCase]);
-  // Task #1291 四川交投,本期完成计量应引用第一部分本期完成计量
-  Result := StringReplace(Result, 'bqwc', FloatToStr(FirstPartPrice), [rfReplaceAll, rfIgnoreCase]);
+  Result := StringReplace(Result, 'fpbqwc', FloatToStr(FirstPartPrice), [rfReplaceAll, rfIgnoreCase]);
+  Result := StringReplace(Result, 'bqwc', FloatToStr(StageSettlement), [rfReplaceAll, rfIgnoreCase]);
 end;
 
 function TPayFormula.GetValue: Double;