瀏覽代碼

Merge branch '3.1.3.3'

Conflicts:
	Dprs/Pro/Measure.dof
	Dprs/Pro/Measure.dpr
	Dprs/Pro/Measure.res
	Dprs/Pro/Measure_Cloud.dof
	Dprs/Pro/Measure_Cloud.dpr
	Dprs/Pro/Measure_Cloud.res
	Dprs/Pro/Measure_GuangDong.dof
	Dprs/Pro/Measure_GuangDong.dpr
	Dprs/Pro/Measure_GuangDong.res
	Dprs/Pro/Measure_GuangDong_Cloud.dof
	Dprs/Pro/Measure_GuangDong_Cloud.dpr
	Dprs/Pro/Measure_GuangDong_Cloud.res
	Dprs/Pro/Measure_GuangDong_TZ.dof
	Dprs/Pro/Measure_GuangDong_TZ.dpr
	Dprs/Pro/Measure_GuangDong_TZ.res
	Dprs/Pro/Measure_TZ.dof
	Dprs/Pro/Measure_TZ.dpr
	Dprs/Pro/Measure_TZ.res
	Dprs/Trail/Measure.dof
	Dprs/Trail/Measure.dpr
	Dprs/Trail/Measure.res
	Dprs/Trail/Measure_GuangDong.dof
	Dprs/Trail/Measure_GuangDong.dpr
	Dprs/Trail/Measure_GuangDong.res
	Forms/MainFrm.dfm
	Forms/MainFrm.pas
	Units/DataBaseTables.pas
	Units/ProjectData.pas
MaiXinRong 9 年之前
父節點
當前提交
11222f3d49

+ 15 - 1
DataModules/DealPaymentDm.dfm

@@ -58,7 +58,21 @@ object DealPaymentData: TDealPaymentData
       4E65656450726F636573734E616D65090001044E616D65060D4C6F636B656446
       6F726D756C61094669656C644E616D65060D4C6F636B6564466F726D756C6108
       44617461547970650205084461746153697A6502010549734B6579080F4E6565
-      6450726F636573734E616D65090000}
+      6450726F636573734E616D65090001044E616D650608506C616E547970650946
+      69656C644E616D650608506C616E547970650844617461547970650203084461
+      746153697A6502040549734B6579080F4E65656450726F636573734E616D6509
+      0001044E616D65060B506C616E53756254797065094669656C644E616D65060B
+      506C616E537562547970650844617461547970650203084461746153697A6502
+      040549734B6579080F4E65656450726F636573734E616D65090001044E616D65
+      060C506C616E446561646C696E65094669656C644E616D65060C506C616E4465
+      61646C696E650844617461547970650206084461746153697A6502080549734B
+      6579080F4E65656450726F636573734E616D65080001044E616D650609504446
+      6F726D756C61094669656C644E616D6506095044466F726D756C610844617461
+      547970650218084461746153697A6502640549734B6579080F4E65656450726F
+      636573734E616D65090001044E616D65060C4C696E6B53657269616C4E6F0946
+      69656C644E616D65060C4C696E6B53657269616C4E6F08446174615479706502
+      03084461746153697A6502040549734B6579080F4E65656450726F636573734E
+      616D65090000}
   end
   object sdvDealPayment: TsdDataView
     Active = False

+ 96 - 1
DataModules/DealPaymentDm.pas

@@ -49,9 +49,14 @@ type
 
     // 扣款项是否已达起扣金额
     function CheckStartedPrice(AID: Integer): Boolean;
+    function CheckReachPlan(ARec: TsdDataRecord): Boolean;
     function GetAllowTotalPrice(AID: Integer; ATotalPrice: Double): Double;
     procedure UpdateTotalPrice(AID: Integer; ATotalPrice: Double);
 
+    function DealPayRecord(const AName: string): TsdDataRecord;
+
+    function PlanStr(ARec: TsdDataRecord): string;
+
     function GetStartedPrice(AID: Integer): Double;
 
     procedure CalcStarted_RangePrice;
@@ -59,6 +64,8 @@ type
     procedure ResetPhaseLink;
     procedure LockedData;
 
+    procedure UpdateLinkSerialNo;
+
     property ProjectData: TObject read FProjectData;
 
     // 扣款项,累计金额合计
@@ -67,6 +74,7 @@ type
     property AddTotalPrice: Double read GetAddTotalPrice;
     // 实付
     property PaidTotalPrice: Double read GetPaidTotalPrice;
+    property PayFormula: TPayFormula read FPayFormula;
   end;
 
 implementation
@@ -110,7 +118,10 @@ begin
   Rec := sddDealPayment.FindKey('idxID', AID);
   if Rec.ValueByName('RangePrice').AsFloat = 0 then Exit;
   fAllowPrice := Rec.ValueByName('RangePrice').AsFloat - Rec.ValueByName('TotalPrice').AsFloat;
-  Result := Min(fAllowPrice, ATotalPrice);
+  if not CheckReachPlan(Rec) then
+    Result := Min(fAllowPrice, ATotalPrice)
+  else
+    Result := fAllowPrice;
 end;
 
 function TDealPaymentData.GetNewID: Integer;
@@ -431,6 +442,12 @@ procedure TDealPaymentData.sdvDealPaymentSetText(var Text: string;
     begin
       Rec.ValueByName('Formula').AsString := '';
       AValue.Owner.ValueByName(sFField).AsString := '';
+      {AID := ARecord.ValueByName('ID').AsInteger;
+      fTotalPrice := StrToFloatDef(Text, 0) - AValue.AsFloat;
+      if CheckStartedPrice(AID) then
+        Text := FloatToStr(AValue.AsFloat + GetAllowTotalPrice(AID, fTotalPrice))
+      else
+        Text := '';}
     end
     else
     begin
@@ -637,4 +654,82 @@ begin
   Result := Rec.ValueByName('StartedPrice').AsFloat;
 end;
 
+function TDealPaymentData.CheckReachPlan(ARec: TsdDataRecord): Boolean;
+var
+  fCurValue, fDeadlineValue: Double;
+begin
+  Result := False;
+  if ARec.ValueByName('PlanType').AsInteger <> 0 then
+  begin
+    if ARec.ValueByName('PlanType').AsInteger = 1 then
+      fCurValue := TProjectData(FProjectData).ProjProperties.PhaseCount
+    else if ARec.ValueByName('PlanSubType').AsInteger = 0 then
+      fCurValue := TProjectData(FProjectData).BillsData.Settlement[4]
+    else if ARec.ValueByName('PlanSubType').AsInteger = 1 then
+      fCurValue := TProjectData(FProjectData).BillsData.Settlement[1]
+    else if ARec.ValueByName('PlanSubType').AsInteger = 2 then
+      fCurValue := TProjectData(FProjectData).BillsData.Settlement[2];
+    fDeadlineValue := ARec.ValueByName('PlanDeadline').AsFloat;
+    Result := fCurValue >= fDeadlineValue;
+  end;
+end;
+
+function TDealPaymentData.PlanStr(ARec: TsdDataRecord): string;
+begin
+  if ARec.ValueByName('PlanType').AsInteger = 0 then
+    Result := '无'
+  else if ARec.ValueByName('PlanType').AsInteger = 1 then
+    Result := Format('计量期数 >= %d', [ARec.ValueByName('PlanDeadline').AsInteger])
+  else if ARec.ValueByName('PlanSubType').AsInteger = 0 then
+    Result := Format('累计完成计量金额 >= %f', [ARec.ValueByName('PlanDeadline').AsFloat])
+  else if ARec.ValueByName('PlanSubType').AsInteger = 1 then
+    Result := Format('累计合同计量金额 >= %f', [ARec.ValueByName('PlanDeadline').AsFloat])
+  else if ARec.ValueByName('PlanSubType').AsInteger = 2 then
+    Result := Format('累计变更计量金额 >= %f', [ARec.ValueByName('PlanDeadline').AsFloat])
+end;
+
+procedure TDealPaymentData.UpdateLinkSerialNo;
+var
+  iPay, iCut, iIndex: Integer;
+  Rec: TsdDataRecord;
+begin
+  iPay := 1;
+  iCut := 1;
+  for iIndex := 0 to sdvDealPayment.RecordCount - 1 do
+  begin
+    Rec := sdvDealPayment.Records[iIndex];
+    if Rec.ValueByName('CalcType').AsInteger = 0 then
+    begin
+      if Rec.ValueByName('IsMinus').AsBoolean then
+      begin
+        Rec.ValueByName('LinkSerialNo').AsInteger := iCut;
+        Inc(iCut);
+      end
+      else
+      begin
+        Rec.ValueByName('LinkSerialNo').AsInteger := iPay;
+        Inc(iPay);
+      end;
+    end;
+  end;
+end;
+
+function TDealPaymentData.DealPayRecord(
+  const AName: string): TsdDataRecord;
+var
+  iRec: Integer;
+  Rec: TsdDataRecord;
+begin
+  Result := nil;
+  for iRec := 0 to sddDealPayment.RecordCount - 1 do
+  begin
+    Rec := sddDealPayment.Records[iRec];
+    if SameText(AName, Rec.ValueByName('Name').AsString) then
+    begin
+      Result := Rec;
+      Break;
+    end;
+  end;
+end;
+
 end.

+ 27 - 2
DataModules/ReportMemoryDm/rmBillsGatherDm.dfm

@@ -862,6 +862,19 @@ object rmBillsGatherData: TrmBillsGatherData
       item
         Name = 'ABDgnPrice'
         DataType = ftFloat
+      end
+      item
+        Name = 'FinalDgnQty'
+        DataType = ftString
+        Size = 20
+      end
+      item
+        Name = 'FinalDgnQty1'
+        DataType = ftFloat
+      end
+      item
+        Name = 'FinalDgnQty2'
+        DataType = ftFloat
       end>
     IndexDefs = <>
     Params = <>
@@ -869,7 +882,7 @@ object rmBillsGatherData: TrmBillsGatherData
     Left = 32
     Top = 80
     Data = {
-      B70600009619E0BD010000001800000041000000000003000000B70609586961
+      010700009619E0BD010000001800000044000000000003000000010709586961
       6E67436F64650100490000000100055749445448020002000A00064D75436F64
       650100490000000100055749445448020002000A00074A6965436F6465010049
       00000001000557494454480200020014000858694D75436F6465010049000000
@@ -922,7 +935,10 @@ object rmBillsGatherData: TrmBillsGatherData
       6E7469747932436F6D7061726533080004000000000006425F436F6465010049
       000000010005574944544802000200320005507269636508000400000000000A
       504444676E507269636508000400000000000B43444444676E50726963650800
-      0400000000000A414244676E507269636508000400000000000000}
+      0400000000000A414244676E507269636508000400000000000B46696E616C44
+      676E51747901004900000001000557494454480200020014000C46696E616C44
+      676E5174793108000400000000000C46696E616C44676E517479320800040000
+      0000000000}
     object cdsEstimateBillsXiangCode: TStringField
       FieldName = 'XiangCode'
       Size = 10
@@ -1125,6 +1141,15 @@ object rmBillsGatherData: TrmBillsGatherData
     object cdsEstimateBillsABDgnPrice: TFloatField
       FieldName = 'ABDgnPrice'
     end
+    object cdsEstimateBillsFinalDgnQty: TStringField
+      FieldName = 'FinalDgnQty'
+    end
+    object cdsEstimateBillsFinalDgnQty1: TFloatField
+      FieldName = 'FinalDgnQty1'
+    end
+    object cdsEstimateBillsFinalDgnQty2: TFloatField
+      FieldName = 'FinalDgnQty2'
+    end
   end
   object cdsProjectGclBills: TClientDataSet
     Active = True

+ 9 - 2
DataModules/ReportMemoryDm/rmBillsGatherDm.pas

@@ -175,6 +175,9 @@ type
     cdsEstimateBillsPDDgnPrice: TFloatField;
     cdsEstimateBillsCDDDgnPrice: TFloatField;
     cdsEstimateBillsABDgnPrice: TFloatField;
+    cdsEstimateBillsFinalDgnQty: TStringField;
+    cdsEstimateBillsFinalDgnQty1: TFloatField;
+    cdsEstimateBillsFinalDgnQty2: TFloatField;
     // žöË㲿°ä07, 11
     cdsProjectGclBills: TClientDataSet;
     cdsProjectGclBillsProjectID: TIntegerField;
@@ -1212,11 +1215,15 @@ begin
   cdsEstimateBillsCDgnQuantity.AsString :=
       GetDgnQuantity(cdsEstimateBillsCDgnQuantity1.AsFloat, cdsEstimateBillsCDgnQuantity2.AsFloat);
   cdsEstimateBillsGatherDgnQuantity1.AsFloat :=
-      cdsEstimateBillsDealDgnQuantity1.AsFloat + cdsEstimateBillsDealDgnQuantity1.AsFloat;
+      cdsEstimateBillsDealDgnQuantity1.AsFloat + cdsEstimateBillsCDgnQuantity1.AsFloat;
   cdsEstimateBillsGatherDgnQuantity2.AsFloat :=
-      cdsEstimateBillsDealDgnQuantity2.AsFloat + cdsEstimateBillsDealDgnQuantity2.AsFloat;;
+      cdsEstimateBillsDealDgnQuantity2.AsFloat + cdsEstimateBillsCDgnQuantity2.AsFloat;;
   cdsEstimateBillsGatherDgnQuantity.AsString :=
       GetDgnQuantity(cdsEstimateBillsGatherDgnQuantity1.AsFloat, cdsEstimateBillsGatherDgnQuantity2.AsFloat);
+  cdsEstimateBillsFinalDgnQty1.AsFloat := cdsEstimateBillsDgnQuantity1.AsFloat + cdsEstimateBillsCDgnQuantity1.AsFloat;
+  cdsEstimateBillsFinalDgnQty2.AsFloat := cdsEstimateBillsDgnQuantity2.AsFloat + cdsEstimateBillsCDgnQuantity2.AsFloat;
+  cdsEstimateBillsFinalDgnQty.AsString := GetDgnQuantity(
+      cdsEstimateBillsFinalDgnQty1.AsFloat, cdsEstimateBillsFinalDgnQty2.AsFloat);
 
   cdsEstimateBillsPDQuantity.AsFloat := ANode.PDQuantity;
   cdsEstimateBillsPDTotalPrice.AsFloat := ANode.PDTotalPrice;

+ 361 - 0
DataModules/ReportMemoryDm/rmHaBaiCustomizedDm.dfm

@@ -0,0 +1,361 @@
+object rmHaBaiCustomizedData: TrmHaBaiCustomizedData
+  OldCreateOrder = False
+  Left = 723
+  Top = 455
+  Height = 154
+  Width = 339
+  object cdsCustom2: TClientDataSet
+    Active = True
+    Aggregates = <>
+    Params = <>
+    Left = 32
+    Top = 48
+    Data = {
+      E20000009619E0BD010000001800000009000000000003000000E20007436861
+      707465720400010000000000044E616D6501004A000000010005574944544802
+      000200C8000A546F74616C507269636508000400000000000B43546F74616C50
+      7269636508000400000000000B47546F74616C50726963650800040000000000
+      13456E64476174686572546F74616C5072696365080004000000000013507265
+      476174686572546F74616C507269636508000400000000001343757247617468
+      6572546F74616C507269636508000400000000000750657263656E7408000400
+      000000000000}
+    object cdsCustom2Chapter: TIntegerField
+      FieldName = 'Chapter'
+    end
+    object cdsCustom2Name: TWideStringField
+      FieldName = 'Name'
+      Size = 100
+    end
+    object cdsCustom2TotalPrice: TFloatField
+      FieldName = 'TotalPrice'
+    end
+    object cdsCustom2CTotalPrice: TFloatField
+      FieldName = 'CTotalPrice'
+    end
+    object cdsCustom2GTotalPrice: TFloatField
+      FieldName = 'GTotalPrice'
+    end
+    object cdsCustom2EndGatherTotalPrice: TFloatField
+      FieldName = 'EndGatherTotalPrice'
+    end
+    object cdsCustom2PreGatherTotalPrice: TFloatField
+      FieldName = 'PreGatherTotalPrice'
+    end
+    object cdsCustom2CurGatherTotalPrice: TFloatField
+      FieldName = 'CurGatherTotalPrice'
+    end
+    object cdsCustom2Percent: TFloatField
+      FieldName = 'Percent'
+    end
+  end
+  object cdsCustom3: TClientDataSet
+    Active = True
+    Aggregates = <>
+    IndexFieldNames = 'ChapterID;InnerPartID;IndexCode'
+    Params = <>
+    Left = 104
+    Top = 48
+    Data = {
+      900100009619E0BD010000001800000010000000000003000000900109436861
+      70746572494404000100000000000B496E6E6572506172744944040001000000
+      000009496E646578436F64650100490000000100055749445448020002003200
+      06425F436F646501004A0000000100055749445448020002006400044E616D65
+      02004A000000010005574944544802000200900105556E69747301004A000000
+      0100055749445448020002002800055072696365080004000000000008517561
+      6E7469747908000400000000000A546F74616C50726963650800040000000000
+      115072654761746865725175616E746974790800040000000000135072654761
+      74686572546F74616C5072696365080004000000000011456E64476174686572
+      5175616E74697479080004000000000013456E64476174686572546F74616C50
+      726963650800040000000000114375724761746865725175616E746974790800
+      04000000000013437572476174686572546F74616C5072696365080004000000
+      00000750657263656E7408000400000000000000}
+    object cdsCustom3ChapterID: TIntegerField
+      FieldName = 'ChapterID'
+    end
+    object cdsCustom3InnerPartID: TIntegerField
+      FieldName = 'InnerPartID'
+    end
+    object cdsCustom3IndexCode: TStringField
+      FieldName = 'IndexCode'
+      Size = 50
+    end
+    object cdsCustom3B_Code: TWideStringField
+      FieldName = 'B_Code'
+      Size = 50
+    end
+    object cdsCustom3Name: TWideStringField
+      FieldName = 'Name'
+      Size = 200
+    end
+    object cdsCustom3Units: TWideStringField
+      FieldName = 'Units'
+    end
+    object cdsCustom3Price: TFloatField
+      FieldName = 'Price'
+    end
+    object cdsCustom3Quantity: TFloatField
+      FieldName = 'Quantity'
+    end
+    object cdsCustom3TotalPrice: TFloatField
+      FieldName = 'TotalPrice'
+    end
+    object cdsCustom3PreGatherQuantity: TFloatField
+      FieldName = 'PreGatherQuantity'
+    end
+    object cdsCustom3PreGatherTotalPrice: TFloatField
+      FieldName = 'PreGatherTotalPrice'
+    end
+    object cdsCustom3EndGatherQuantity: TFloatField
+      FieldName = 'EndGatherQuantity'
+    end
+    object cdsCustom3EndGatherTotalPrice: TFloatField
+      FieldName = 'EndGatherTotalPrice'
+    end
+    object cdsCustom3CurGatherQuantity: TFloatField
+      FieldName = 'CurGatherQuantity'
+    end
+    object cdsCustom3CurGatherTotalPrice: TFloatField
+      FieldName = 'CurGatherTotalPrice'
+    end
+    object cdsCustom3Percent: TFloatField
+      FieldName = 'Percent'
+    end
+  end
+  object cdsCustom14: TClientDataSet
+    Active = True
+    Aggregates = <>
+    IndexFieldNames = 'IndexCode'
+    Params = <>
+    Left = 176
+    Top = 48
+    Data = {
+      DC0000009619E0BD010000001800000008000000000003000000DC0009496E64
+      6578436F646501004A000000010005574944544802000200640006425F436F64
+      6501004A0000000100055749445448020002006400044E616D6502004A000000
+      010005574944544802000200900105556E69747301004A000000010005574944
+      54480200020028000550726963650800040000000000085175616E7469747908
+      000400000000000A546F74616C507269636508000400000000000F4365727469
+      666963617465436F646501004A00000001000557494454480200020064000000}
+    object cdsCustom14IndexCode: TWideStringField
+      FieldName = 'IndexCode'
+      Size = 50
+    end
+    object cdsCustom14B_Code: TWideStringField
+      FieldName = 'B_Code'
+      Size = 50
+    end
+    object cdsCustom14Name: TWideStringField
+      FieldName = 'Name'
+      Size = 200
+    end
+    object cdsCustom14Units: TWideStringField
+      FieldName = 'Units'
+    end
+    object cdsCustom14Price: TFloatField
+      FieldName = 'Price'
+    end
+    object cdsCustom14Quantity: TFloatField
+      FieldName = 'Quantity'
+    end
+    object cdsCustom14TotalPrice: TFloatField
+      FieldName = 'TotalPrice'
+    end
+    object cdsCustom14CertificateCode: TWideStringField
+      FieldName = 'CertificateCode'
+      Size = 50
+    end
+  end
+  object cdsCustomProj: TClientDataSet
+    Active = True
+    Aggregates = <>
+    FieldDefs = <
+      item
+        Name = 'ProjectID'
+        DataType = ftInteger
+      end
+      item
+        Name = 'ProjectName'
+        DataType = ftWideString
+        Size = 200
+      end
+      item
+        Name = 'ChapterID'
+        DataType = ftInteger
+      end
+      item
+        Name = 'InnerPartID'
+        DataType = ftInteger
+      end
+      item
+        Name = 'IndexCode'
+        DataType = ftWideString
+        Size = 50
+      end
+      item
+        Name = 'B_Code'
+        DataType = ftWideString
+        Size = 50
+      end
+      item
+        Name = 'Name'
+        DataType = ftWideString
+        Size = 200
+      end
+      item
+        Name = 'Units'
+        DataType = ftWideString
+        Size = 20
+      end
+      item
+        Name = 'Price'
+        DataType = ftFloat
+      end
+      item
+        Name = 'Quantity'
+        DataType = ftFloat
+      end
+      item
+        Name = 'TotalPrice'
+        DataType = ftFloat
+      end
+      item
+        Name = 'CurGatherQuantity'
+        DataType = ftFloat
+      end
+      item
+        Name = 'CurGatherTotalPrice'
+        DataType = ftFloat
+      end
+      item
+        Name = 'EndGatherQuantity'
+        DataType = ftFloat
+      end
+      item
+        Name = 'EndGatherTotalPrice'
+        DataType = ftFloat
+      end
+      item
+        Name = 'P_CurGatherQuantity'
+        DataType = ftFloat
+      end
+      item
+        Name = 'P_CurGatherTotalPrice'
+        DataType = ftFloat
+      end
+      item
+        Name = 'P_EndGatherQuantity'
+        DataType = ftFloat
+      end
+      item
+        Name = 'P_EndGatherTotalPrice'
+        DataType = ftFloat
+      end
+      item
+        Name = 'CurPercent'
+        DataType = ftFloat
+      end
+      item
+        Name = 'EndPercent'
+        DataType = ftFloat
+      end
+      item
+        Name = 'SerialNo'
+        DataType = ftInteger
+      end>
+    IndexDefs = <>
+    IndexFieldNames = 'ProjectID;ChapterID;InnerPartID;IndexCode'
+    Params = <>
+    StoreDefs = True
+    Left = 264
+    Top = 48
+    Data = {
+      270200009619E0BD01000000180000001600000000000300000027020950726F
+      6A656374494404000100000000000B50726F6A6563744E616D6502004A000000
+      0100055749445448020002009001094368617074657249440400010000000000
+      0B496E6E6572506172744944040001000000000009496E646578436F64650100
+      4A000000010005574944544802000200640006425F436F646501004A00000001
+      00055749445448020002006400044E616D6502004A0000000100055749445448
+      02000200900105556E69747301004A0000000100055749445448020002002800
+      0550726963650800040000000000085175616E7469747908000400000000000A
+      546F74616C50726963650800040000000000114375724761746865725175616E
+      74697479080004000000000013437572476174686572546F74616C5072696365
+      080004000000000011456E644761746865725175616E74697479080004000000
+      000013456E64476174686572546F74616C507269636508000400000000001350
+      5F4375724761746865725175616E74697479080004000000000015505F437572
+      476174686572546F74616C5072696365080004000000000013505F456E644761
+      746865725175616E74697479080004000000000015505F456E64476174686572
+      546F74616C507269636508000400000000000A43757250657263656E74080004
+      00000000000A456E6450657263656E7408000400000000000853657269616C4E
+      6F04000100000000000000}
+    object cdsCustomProjProjectID: TIntegerField
+      FieldName = 'ProjectID'
+    end
+    object cdsCustomProjProjectName: TWideStringField
+      FieldName = 'ProjectName'
+      Size = 200
+    end
+    object cdsCustomProjChapterID: TIntegerField
+      FieldName = 'ChapterID'
+    end
+    object cdsCustomProjInnerPartID: TIntegerField
+      FieldName = 'InnerPartID'
+    end
+    object cdsCustomProjIndexCode: TWideStringField
+      FieldName = 'IndexCode'
+      Size = 50
+    end
+    object cdsCustomProjB_Code: TWideStringField
+      FieldName = 'B_Code'
+      Size = 50
+    end
+    object cdsCustomProjName: TWideStringField
+      FieldName = 'Name'
+      Size = 200
+    end
+    object cdsCustomProjUnits: TWideStringField
+      FieldName = 'Units'
+    end
+    object cdsCustomProjPrice: TFloatField
+      FieldName = 'Price'
+    end
+    object cdsCustomProjQuantity: TFloatField
+      FieldName = 'Quantity'
+    end
+    object cdsCustomProjTotalPrice: TFloatField
+      FieldName = 'TotalPrice'
+    end
+    object cdsCustomProjCurGatherQuantity: TFloatField
+      FieldName = 'CurGatherQuantity'
+    end
+    object cdsCustomProjCurGatherTotalPrice: TFloatField
+      FieldName = 'CurGatherTotalPrice'
+    end
+    object cdsCustomProjEndGatherQuantity: TFloatField
+      FieldName = 'EndGatherQuantity'
+    end
+    object cdsCustomProjEndGatherTotalPrice: TFloatField
+      FieldName = 'EndGatherTotalPrice'
+    end
+    object cdsCustomProjP_CurGatherQuantity: TFloatField
+      FieldName = 'P_CurGatherQuantity'
+    end
+    object cdsCustomProjP_CurGatherTotalPrice: TFloatField
+      FieldName = 'P_CurGatherTotalPrice'
+    end
+    object cdsCustomProjP_EndGatherQuantity: TFloatField
+      FieldName = 'P_EndGatherQuantity'
+    end
+    object cdsCustomProjP_EndGatherTotalPrice: TFloatField
+      FieldName = 'P_EndGatherTotalPrice'
+    end
+    object cdsCustomProjCurPercent: TFloatField
+      FieldName = 'CurPercent'
+    end
+    object cdsCustomProjEndPercent: TFloatField
+      FieldName = 'EndPercent'
+    end
+    object cdsCustomProjSerialNo: TIntegerField
+      FieldName = 'SerialNo'
+    end
+  end
+end

File diff suppressed because it is too large
+ 1355 - 0
DataModules/ReportMemoryDm/rmHaBaiCustomizedDm.pas


+ 9 - 0
Dprs/Pro/Measure.dof

@@ -114,8 +114,13 @@ IncludeVerInfo=1
 AutoIncBuild=1
 MajorVer=3
 MinorVer=1
+<<<<<<< HEAD
 Release=5
 Build=109
+=======
+Release=3
+Build=2041
+>>>>>>> 3.1.3.3
 Debug=0
 PreRelease=0
 Special=0
@@ -126,7 +131,11 @@ CodePage=936
 [Version Info Keys]
 CompanyName=珠海纵横创新软件有限公司
 FileDescription=纵横结算决算计量一体化专业版
+<<<<<<< HEAD
 FileVersion=3.1.5.109
+=======
+FileVersion=3.1.3.2041
+>>>>>>> 3.1.3.3
 InternalName=Measure
 LegalCopyright=版权所有(C) 珠海纵横创新软件有限公司 2003-2014。保留所有权利。
 LegalTrademarks=Measure

+ 6 - 0
Dprs/Pro/Measure.dpr

@@ -136,9 +136,15 @@ uses
   rmGcl_XmjBillsDm in '..\..\DataModules\ReportMemoryDm\rmGcl_XmjBillsDm.pas' {rmGcl_XmjBillsData: TDataModule},
   rmCustomized2Dm in '..\..\DataModules\ReportMemoryDm\rmCustomized2Dm.pas' {rmCustomized2Data: TDataModule},
   CalcDecimal in '..\..\Units\CalcDecimal.pas',
+<<<<<<< HEAD
   BillsPasteSelectFrm in '..\..\Forms\BillsPasteSelectFrm.pas' {BillsPasteSelectForm},
   DetailExcelImport in '..\..\Units\DetailExcelImport.pas',
   mProgressProFrm in '..\..\Forms\mProgressProFrm.pas' {ProgressProForm};
+=======
+  rmHaBaiCustomizedDm in '..\..\DataModules\ReportMemoryDm\rmHaBaiCustomizedDm.pas' {rmHaBaiCustomizedData: TDataModule},
+  BillsPasteSelectFrm in '..\..\Forms\BillsPasteSelectFrm.pas' {BillsPasteSelectForm},
+  DealPayPlanFrm in '..\..\Forms\DealPayPlanFrm.pas' {DealPayPlanForm};
+>>>>>>> 3.1.3.3
 
 {$R *.res}
 

+ 9 - 0
Dprs/Pro/Measure_Cloud.dof

@@ -114,8 +114,13 @@ IncludeVerInfo=1
 AutoIncBuild=1
 MajorVer=3
 MinorVer=1
+<<<<<<< HEAD
 Release=5
 Build=109
+=======
+Release=3
+Build=2041
+>>>>>>> 3.1.3.3
 Debug=0
 PreRelease=0
 Special=0
@@ -126,7 +131,11 @@ CodePage=936
 [Version Info Keys]
 CompanyName=珠海纵横创新软件有限公司
 FileDescription=纵横结算决算计量一体化云版
+<<<<<<< HEAD
 FileVersion=3.1.5.109
+=======
+FileVersion=3.1.3.2041
+>>>>>>> 3.1.3.3
 InternalName=Measure
 LegalCopyright=版权所有(C) 珠海纵横创新软件有限公司 2003-2014。保留所有权利。
 LegalTrademarks=Measure

+ 6 - 0
Dprs/Pro/Measure_Cloud.dpr

@@ -140,9 +140,15 @@ uses
   rmGcl_XmjBillsDm in '..\..\DataModules\ReportMemoryDm\rmGcl_XmjBillsDm.pas' {rmGcl_XmjBillsData: TDataModule},
   rmCustomized2Dm in '..\..\DataModules\ReportMemoryDm\rmCustomized2Dm.pas' {rmCustomized2Data: TDataModule},
   CalcDecimal in '..\..\Units\CalcDecimal.pas',
+<<<<<<< HEAD
   BillsPasteSelectFrm in '..\..\Forms\BillsPasteSelectFrm.pas' {BillsPasteSelectForm},
   DetailExcelImport in '..\..\Units\DetailExcelImport.pas',
   mProgressProFrm in '..\..\Forms\mProgressProFrm.pas' {ProgressProForm};
+=======
+  rmHaBaiCustomizedDm in '..\..\DataModules\ReportMemoryDm\rmHaBaiCustomizedDm.pas' {rmHaBaiCustomizedData: TDataModule},
+  BillsPasteSelectFrm in '..\..\Forms\BillsPasteSelectFrm.pas' {BillsPasteSelectForm},
+  DealPayPlanFrm in '..\..\Forms\DealPayPlanFrm.pas' {DealPayPlanForm};
+>>>>>>> 3.1.3.3
 
 {$R *.res}
 

+ 9 - 0
Dprs/Pro/Measure_GuangDong.dof

@@ -114,8 +114,13 @@ IncludeVerInfo=1
 AutoIncBuild=1
 MajorVer=3
 MinorVer=1
+<<<<<<< HEAD
 Release=5
 Build=106
+=======
+Release=3
+Build=2041
+>>>>>>> 3.1.3.3
 Debug=0
 PreRelease=0
 Special=0
@@ -126,7 +131,11 @@ CodePage=936
 [Version Info Keys]
 CompanyName=珠海纵横创新软件有限公司
 FileDescription=纵横结算决算计量一体化广东专业版
+<<<<<<< HEAD
 FileVersion=3.1.5.106
+=======
+FileVersion=3.1.3.2041
+>>>>>>> 3.1.3.3
 InternalName=Measure
 LegalCopyright=版权所有(C) 珠海纵横创新软件有限公司 2003-2014。保留所有权利。
 LegalTrademarks=Measure

+ 6 - 0
Dprs/Pro/Measure_GuangDong.dpr

@@ -136,9 +136,15 @@ uses
   rmGcl_XmjBillsDm in '..\..\DataModules\ReportMemoryDm\rmGcl_XmjBillsDm.pas' {rmGcl_XmjBillsData: TDataModule},
   rmCustomized2Dm in '..\..\DataModules\ReportMemoryDm\rmCustomized2Dm.pas' {rmCustomized2Data: TDataModule},
   CalcDecimal in '..\..\Units\CalcDecimal.pas',
+<<<<<<< HEAD
   BillsPasteSelectFrm in '..\..\Forms\BillsPasteSelectFrm.pas' {BillsPasteSelectForm},
   DetailExcelImport in '..\..\Units\DetailExcelImport.pas',
   mProgressProFrm in '..\..\Forms\mProgressProFrm.pas' {ProgressProForm};
+=======
+  rmHaBaiCustomizedDm in '..\..\DataModules\ReportMemoryDm\rmHaBaiCustomizedDm.pas' {rmHaBaiCustomizedData: TDataModule},
+  BillsPasteSelectFrm in '..\..\Forms\BillsPasteSelectFrm.pas' {BillsPasteSelectForm},
+  DealPayPlanFrm in '..\..\Forms\DealPayPlanFrm.pas' {DealPayPlanForm};
+>>>>>>> 3.1.3.3
 
 {$R *.res}
 

+ 9 - 0
Dprs/Pro/Measure_GuangDong_Cloud.dof

@@ -114,8 +114,13 @@ IncludeVerInfo=1
 AutoIncBuild=1
 MajorVer=3
 MinorVer=1
+<<<<<<< HEAD
 Release=5
 Build=106
+=======
+Release=3
+Build=2041
+>>>>>>> 3.1.3.3
 Debug=0
 PreRelease=0
 Special=0
@@ -126,7 +131,11 @@ CodePage=936
 [Version Info Keys]
 CompanyName=珠海纵横创新软件有限公司
 FileDescription=纵横结算决算计量一体化广东云版
+<<<<<<< HEAD
 FileVersion=3.1.5.106
+=======
+FileVersion=3.1.3.2041
+>>>>>>> 3.1.3.3
 InternalName=Measure
 LegalCopyright=版权所有(C) 珠海纵横创新软件有限公司 2003-2014。保留所有权利。
 LegalTrademarks=Measure

+ 6 - 0
Dprs/Pro/Measure_GuangDong_Cloud.dpr

@@ -140,9 +140,15 @@ uses
   rmGcl_XmjBillsDm in '..\..\DataModules\ReportMemoryDm\rmGcl_XmjBillsDm.pas' {rmGcl_XmjBillsData: TDataModule},
   rmCustomized2Dm in '..\..\DataModules\ReportMemoryDm\rmCustomized2Dm.pas' {rmCustomized2Data: TDataModule},
   CalcDecimal in '..\..\Units\CalcDecimal.pas',
+<<<<<<< HEAD
   BillsPasteSelectFrm in '..\..\Forms\BillsPasteSelectFrm.pas' {BillsPasteSelectForm},
   DetailExcelImport in '..\..\Units\DetailExcelImport.pas',
   mProgressProFrm in '..\..\Forms\mProgressProFrm.pas' {ProgressProForm};
+=======
+  rmHaBaiCustomizedDm in '..\..\DataModules\ReportMemoryDm\rmHaBaiCustomizedDm.pas' {rmHaBaiCustomizedData: TDataModule},
+  BillsPasteSelectFrm in '..\..\Forms\BillsPasteSelectFrm.pas' {BillsPasteSelectForm},
+  DealPayPlanFrm in '..\..\Forms\DealPayPlanFrm.pas' {DealPayPlanForm};
+>>>>>>> 3.1.3.3
 
 {$R *.res}
 

+ 10 - 1
Dprs/Pro/Measure_GuangDong_TZ.dof

@@ -114,8 +114,13 @@ IncludeVerInfo=1
 AutoIncBuild=0
 MajorVer=3
 MinorVer=1
+<<<<<<< HEAD
 Release=5
 Build=105
+=======
+Release=3
+Build=2040
+>>>>>>> 3.1.3.3
 Debug=0
 PreRelease=0
 Special=0
@@ -124,9 +129,13 @@ DLL=0
 Locale=2052
 CodePage=936
 [Version Info Keys]
-CompanyName=
+CompanyName=珠海纵横创新软件有限公司
 FileDescription=
+<<<<<<< HEAD
 FileVersion=3.1.5.105
+=======
+FileVersion=3.1.3.2040
+>>>>>>> 3.1.3.3
 InternalName=
 LegalCopyright=
 LegalTrademarks=

+ 6 - 0
Dprs/Pro/Measure_GuangDong_TZ.dpr

@@ -136,9 +136,15 @@ uses
   rmGcl_XmjBillsDm in '..\..\DataModules\ReportMemoryDm\rmGcl_XmjBillsDm.pas' {rmGcl_XmjBillsData: TDataModule},
   rmCustomized2Dm in '..\..\DataModules\ReportMemoryDm\rmCustomized2Dm.pas' {rmCustomized2Data: TDataModule},
   CalcDecimal in '..\..\Units\CalcDecimal.pas',
+<<<<<<< HEAD
   BillsPasteSelectFrm in '..\..\Forms\BillsPasteSelectFrm.pas' {BillsPasteSelectForm},
   DetailExcelImport in '..\..\Units\DetailExcelImport.pas',
   mProgressProFrm in '..\..\Forms\mProgressProFrm.pas' {ProgressProForm};
+=======
+  rmHaBaiCustomizedDm in '..\..\DataModules\ReportMemoryDm\rmHaBaiCustomizedDm.pas' {rmHaBaiCustomizedData: TDataModule},
+  BillsPasteSelectFrm in '..\..\Forms\BillsPasteSelectFrm.pas' {BillsPasteSelectForm},
+  DealPayPlanFrm in '..\..\Forms\DealPayPlanFrm.pas' {DealPayPlanForm};
+>>>>>>> 3.1.3.3
 
 {$R *.res}
 

+ 9 - 0
Dprs/Pro/Measure_TZ.dof

@@ -114,8 +114,13 @@ IncludeVerInfo=1
 AutoIncBuild=1
 MajorVer=3
 MinorVer=1
+<<<<<<< HEAD
 Release=5
 Build=106
+=======
+Release=3
+Build=2041
+>>>>>>> 3.1.3.3
 Debug=0
 PreRelease=0
 Special=0
@@ -126,7 +131,11 @@ CodePage=936
 [Version Info Keys]
 CompanyName=珠海纵横创新软件有限公司
 FileDescription=纵横0号台账专业版
+<<<<<<< HEAD
 FileVersion=3.1.5.106
+=======
+FileVersion=3.1.3.2041
+>>>>>>> 3.1.3.3
 InternalName=Measure
 LegalCopyright=版权所有(C) 珠海纵横创新软件有限公司 2003-2014。保留所有权利。
 LegalTrademarks=Measure

+ 6 - 0
Dprs/Pro/Measure_TZ.dpr

@@ -136,9 +136,15 @@ uses
   rmGcl_XmjBillsDm in '..\..\DataModules\ReportMemoryDm\rmGcl_XmjBillsDm.pas' {rmGcl_XmjBillsData: TDataModule},
   rmCustomized2Dm in '..\..\DataModules\ReportMemoryDm\rmCustomized2Dm.pas' {rmCustomized2Data: TDataModule},
   CalcDecimal in '..\..\Units\CalcDecimal.pas',
+<<<<<<< HEAD
   BillsPasteSelectFrm in '..\..\Forms\BillsPasteSelectFrm.pas' {BillsPasteSelectForm},
   DetailExcelImport in '..\..\Units\DetailExcelImport.pas',
   mProgressProFrm in '..\..\Forms\mProgressProFrm.pas' {ProgressProForm};
+=======
+  rmHaBaiCustomizedDm in '..\..\DataModules\ReportMemoryDm\rmHaBaiCustomizedDm.pas' {rmHaBaiCustomizedData: TDataModule},
+  BillsPasteSelectFrm in '..\..\Forms\BillsPasteSelectFrm.pas' {BillsPasteSelectForm},
+  DealPayPlanFrm in '..\..\Forms\DealPayPlanFrm.pas' {DealPayPlanForm};
+>>>>>>> 3.1.3.3
 
 {$R *.res}
 

+ 9 - 0
Dprs/Trail/Measure.dof

@@ -114,8 +114,13 @@ IncludeVerInfo=1
 AutoIncBuild=1
 MajorVer=3
 MinorVer=1
+<<<<<<< HEAD
 Release=5
 Build=106
+=======
+Release=3
+Build=2041
+>>>>>>> 3.1.3.3
 Debug=0
 PreRelease=0
 Special=0
@@ -126,7 +131,11 @@ CodePage=936
 [Version Info Keys]
 CompanyName=珠海纵横创新软件有限公司
 FileDescription=纵横结算决算计量一体化专业版
+<<<<<<< HEAD
 FileVersion=3.1.5.106
+=======
+FileVersion=3.1.3.2041
+>>>>>>> 3.1.3.3
 InternalName=Measure
 LegalCopyright=版权所有(C) 珠海纵横创新软件有限公司 2003-2014。保留所有权利。
 LegalTrademarks=Measure

+ 6 - 0
Dprs/Trail/Measure.dpr

@@ -136,9 +136,15 @@ uses
   rmGcl_XmjBillsDm in '..\..\DataModules\ReportMemoryDm\rmGcl_XmjBillsDm.pas' {rmGcl_XmjBillsData: TDataModule},
   rmCustomized2Dm in '..\..\DataModules\ReportMemoryDm\rmCustomized2Dm.pas' {rmCustomized2Data: TDataModule},
   CalcDecimal in '..\..\Units\CalcDecimal.pas',
+<<<<<<< HEAD
   BillsPasteSelectFrm in '..\..\Forms\BillsPasteSelectFrm.pas' {BillsPasteSelectForm},
   DetailExcelImport in '..\..\Units\DetailExcelImport.pas',
   mProgressProFrm in '..\..\Forms\mProgressProFrm.pas' {ProgressProForm};
+=======
+  rmHaBaiCustomizedDm in '..\..\DataModules\ReportMemoryDm\rmHaBaiCustomizedDm.pas' {rmHaBaiCustomizedData: TDataModule},
+  BillsPasteSelectFrm in '..\..\Forms\BillsPasteSelectFrm.pas' {BillsPasteSelectForm},
+  DealPayPlanFrm in '..\..\Forms\DealPayPlanFrm.pas' {DealPayPlanForm};
+>>>>>>> 3.1.3.3
 
 {$R *.res}
 

+ 9 - 0
Dprs/Trail/Measure_GuangDong.dof

@@ -114,8 +114,13 @@ IncludeVerInfo=1
 AutoIncBuild=1
 MajorVer=3
 MinorVer=1
+<<<<<<< HEAD
 Release=5
 Build=106
+=======
+Release=3
+Build=2041
+>>>>>>> 3.1.3.3
 Debug=0
 PreRelease=0
 Special=0
@@ -126,7 +131,11 @@ CodePage=936
 [Version Info Keys]
 CompanyName=珠海纵横创新软件有限公司
 FileDescription=纵横结算决算计量一体化广东学习版
+<<<<<<< HEAD
 FileVersion=3.1.5.106
+=======
+FileVersion=3.1.3.2041
+>>>>>>> 3.1.3.3
 InternalName=Measure
 LegalCopyright=版权所有(C) 珠海纵横创新软件有限公司 2003-2014。保留所有权利。
 LegalTrademarks=Measure

+ 6 - 0
Dprs/Trail/Measure_GuangDong.dpr

@@ -136,9 +136,15 @@ uses
   rmGcl_XmjBillsDm in '..\..\DataModules\ReportMemoryDm\rmGcl_XmjBillsDm.pas' {rmGcl_XmjBillsData: TDataModule},
   rmCustomized2Dm in '..\..\DataModules\ReportMemoryDm\rmCustomized2Dm.pas' {rmCustomized2Data: TDataModule},
   CalcDecimal in '..\..\Units\CalcDecimal.pas',
+<<<<<<< HEAD
   BillsPasteSelectFrm in '..\..\Forms\BillsPasteSelectFrm.pas' {BillsPasteSelectForm},
   DetailExcelImport in '..\..\Units\DetailExcelImport.pas',
   mProgressProFrm in '..\..\Forms\mProgressProFrm.pas' {ProgressProForm};
+=======
+  rmHaBaiCustomizedDm in '..\..\DataModules\ReportMemoryDm\rmHaBaiCustomizedDm.pas' {rmHaBaiCustomizedData: TDataModule},
+  BillsPasteSelectFrm in '..\..\Forms\BillsPasteSelectFrm.pas' {BillsPasteSelectForm},
+  DealPayPlanFrm in '..\..\Forms\DealPayPlanFrm.pas' {DealPayPlanForm};
+>>>>>>> 3.1.3.3
 
 {$R *.res}
 

+ 252 - 0
Forms/DealPayPlanFrm.dfm

@@ -0,0 +1,252 @@
+object DealPayPlanForm: TDealPayPlanForm
+  Left = 593
+  Top = 331
+  Width = 411
+  Height = 290
+  Caption = #35774#32622#35745#25552#26399#38480
+  Color = clBtnFace
+  Font.Charset = ANSI_CHARSET
+  Font.Color = clWindowText
+  Font.Height = -12
+  Font.Name = #23435#20307
+  Font.Style = []
+  OldCreateOrder = False
+  DesignSize = (
+    403
+    256)
+  PixelsPerInch = 96
+  TextHeight = 12
+  object lblTitle: TLabel
+    Left = 10
+    Top = 9
+    Width = 96
+    Height = 12
+    Caption = #35831#35774#32622#20184'('#25187')'#27454#39033
+  end
+  object lblDealPayName: TLabel
+    Left = 112
+    Top = 8
+    Width = 18
+    Height = 12
+    Caption = 'XXX'
+    Font.Charset = ANSI_CHARSET
+    Font.Color = clBlue
+    Font.Height = -12
+    Font.Name = #23435#20307
+    Font.Style = []
+    ParentFont = False
+  end
+  object lblTitle2: TLabel
+    Left = 136
+    Top = 8
+    Width = 60
+    Height = 12
+    Caption = #30340#35745#25552#26399#38480
+  end
+  object lblPlanType: TLabel
+    Left = 12
+    Top = 30
+    Width = 72
+    Height = 12
+    Caption = #38480#21046#27169#24335#20026#65306
+  end
+  object lblResultPre: TLabel
+    Left = 11
+    Top = 175
+    Width = 48
+    Height = 12
+    Anchors = [akRight, akBottom]
+    Caption = #35774#32622#20026#65306
+  end
+  object lblResult: TLabel
+    Left = 35
+    Top = 192
+    Width = 78
+    Height = 12
+    Anchors = [akRight, akBottom]
+    Caption = 'XX>YY('#20844#24335')'#26102
+    Font.Charset = ANSI_CHARSET
+    Font.Color = clRed
+    Font.Height = -12
+    Font.Name = #23435#20307
+    Font.Style = []
+    ParentFont = False
+  end
+  object lblResultPost: TLabel
+    Left = 34
+    Top = 209
+    Width = 258
+    Height = 12
+    Anchors = [akRight, akBottom]
+    Caption = #24403#26399#37329#39069#30452#25509#35745#37327#33267'('#25187#27454#38480#39069' - '#25130#27490#19978#26399#37329#39069')'
+  end
+  object btnOk: TButton
+    Left = 248
+    Top = 229
+    Width = 70
+    Height = 21
+    Anchors = [akRight, akBottom]
+    Caption = #30830#23450
+    TabOrder = 5
+    OnClick = btnOkClick
+  end
+  object btnCancel: TButton
+    Left = 325
+    Top = 229
+    Width = 70
+    Height = 21
+    Anchors = [akRight, akBottom]
+    Caption = #21462#28040
+    ModalResult = 2
+    TabOrder = 6
+  end
+  object rbIsPlanPhase: TRadioButton
+    Tag = 1
+    Left = 127
+    Top = 28
+    Width = 73
+    Height = 17
+    Caption = #35745#37327#26399#25968
+    TabOrder = 1
+    OnClick = rbIsPlanNonClick
+  end
+  object rbIsPlanPrice: TRadioButton
+    Tag = 2
+    Left = 206
+    Top = 28
+    Width = 73
+    Height = 17
+    Caption = #35745#37327#37329#39069
+    TabOrder = 2
+    OnClick = rbIsPlanNonClick
+  end
+  object gbPhase: TGroupBox
+    Left = 9
+    Top = 48
+    Width = 385
+    Height = 47
+    Caption = #35745#37327#26399#25968#27169#24335
+    Enabled = False
+    Font.Charset = ANSI_CHARSET
+    Font.Color = clGray
+    Font.Height = -12
+    Font.Name = #23435#20307
+    Font.Style = []
+    ParentFont = False
+    TabOrder = 3
+    object leDeadlinePhase: TLabeledEdit
+      Left = 78
+      Top = 19
+      Width = 129
+      Height = 18
+      Ctl3D = False
+      EditLabel.Width = 66
+      EditLabel.Height = 12
+      EditLabel.Caption = #38480#21046#37329#39069#65306' '
+      LabelPosition = lpLeft
+      ParentCtl3D = False
+      TabOrder = 0
+      Text = '2'
+      OnChange = leDeadlinePhaseChange
+      OnKeyPress = leDeadlinePhaseKeyPress
+    end
+    object udDeadlinePhase: TUpDown
+      Left = 207
+      Top = 19
+      Width = 16
+      Height = 18
+      Associate = leDeadlinePhase
+      Min = 2
+      Max = 50
+      Position = 2
+      TabOrder = 1
+      OnClick = udDeadlinePhaseClick
+    end
+  end
+  object gbPrice: TGroupBox
+    Left = 10
+    Top = 103
+    Width = 385
+    Height = 65
+    Caption = #35745#37327#37329#39069#27169#24335
+    Enabled = False
+    Font.Charset = ANSI_CHARSET
+    Font.Color = clGray
+    Font.Height = -12
+    Font.Name = #23435#20307
+    Font.Style = []
+    ParentFont = False
+    TabOrder = 4
+    object lblEquar: TLabel
+      Left = 232
+      Top = 43
+      Width = 6
+      Height = 12
+      Caption = '='
+    end
+    object lblPriceDeadline: TLabel
+      Left = 244
+      Top = 43
+      Width = 6
+      Height = 12
+      Caption = '0'
+    end
+    object rbAddGatherTotalPrice: TRadioButton
+      Left = 8
+      Top = 18
+      Width = 118
+      Height = 17
+      Caption = #32047#35745#23436#25104#35745#37327#37329#39069
+      Checked = True
+      TabOrder = 0
+      TabStop = True
+      OnClick = rbAddGatherTotalPriceClick
+    end
+    object rbAddDealTotalPrice: TRadioButton
+      Tag = 1
+      Left = 136
+      Top = 18
+      Width = 118
+      Height = 17
+      Caption = #32047#35745#21512#21516#35745#37327#37329#39069
+      TabOrder = 1
+      OnClick = rbAddGatherTotalPriceClick
+    end
+    object rbAddQCTotalPrice: TRadioButton
+      Tag = 2
+      Left = 263
+      Top = 18
+      Width = 118
+      Height = 17
+      Caption = #32047#35745#21464#26356#35745#37327#37329#39069
+      TabOrder = 2
+      OnClick = rbAddGatherTotalPriceClick
+    end
+    object lePDFormula: TLabeledEdit
+      Left = 80
+      Top = 40
+      Width = 145
+      Height = 18
+      Ctl3D = False
+      EditLabel.Width = 66
+      EditLabel.Height = 12
+      EditLabel.Caption = #38480#21046#37329#39069#65306' '
+      LabelPosition = lpLeft
+      ParentCtl3D = False
+      TabOrder = 3
+      OnExit = lePDFormulaExit
+      OnKeyPress = leDeadlinePhaseKeyPress
+    end
+  end
+  object rbIsPlanNon: TRadioButton
+    Left = 86
+    Top = 28
+    Width = 40
+    Height = 17
+    Caption = #26080
+    Checked = True
+    TabOrder = 0
+    TabStop = True
+    OnClick = rbIsPlanNonClick
+  end
+end

+ 294 - 0
Forms/DealPayPlanFrm.pas

@@ -0,0 +1,294 @@
+unit DealPayPlanFrm;
+
+interface
+
+uses
+  sdDB,
+  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
+  Dialogs, StdCtrls, ExtCtrls, ComCtrls, JimPages;
+
+type
+  TDealPayPlanForm = class(TForm)
+    lblTitle: TLabel;
+    lblDealPayName: TLabel;
+    lblTitle2: TLabel;
+    btnOk: TButton;
+    btnCancel: TButton;
+    lblPlanType: TLabel;
+    rbIsPlanPhase: TRadioButton;
+    rbIsPlanPrice: TRadioButton;
+    lblResultPre: TLabel;
+    lblResult: TLabel;
+    lblResultPost: TLabel;
+    gbPhase: TGroupBox;
+    leDeadlinePhase: TLabeledEdit;
+    udDeadlinePhase: TUpDown;
+    gbPrice: TGroupBox;
+    rbAddGatherTotalPrice: TRadioButton;
+    rbAddDealTotalPrice: TRadioButton;
+    rbAddQCTotalPrice: TRadioButton;
+    lePDFormula: TLabeledEdit;
+    rbIsPlanNon: TRadioButton;
+    lblEquar: TLabel;
+    lblPriceDeadline: TLabel;
+    procedure btnOkClick(Sender: TObject);
+    procedure rbIsPlanNonClick(Sender: TObject);
+    procedure rbAddGatherTotalPriceClick(Sender: TObject);
+    procedure udDeadlinePhaseClick(Sender: TObject; Button: TUDBtnType);
+    procedure leDeadlinePhaseKeyPress(Sender: TObject; var Key: Char);
+    procedure leDeadlinePhaseChange(Sender: TObject);
+    procedure lePDFormulaExit(Sender: TObject);
+  private
+    FDealPayRec: TsdDataRecord;
+    FProjectData: TObject;
+
+    FPlanType: Integer;
+    FPlanSubType: Integer;
+
+    //FFormulaSet: t
+
+    procedure InitForm;
+
+    procedure AssignResult;
+
+    procedure SetPlanType(const Value: Integer);
+    procedure SetPlanSubType(const Value: Integer);
+    function GetPhaseDeadline: Integer;
+    procedure SetPhaseDeadline(const Value: Integer);
+    function GetPriceDeadline: Double;
+    procedure SetPriceDeadline(const Value: Double);
+    function GetPDFormula: string;
+    procedure SetPDFormula(const Value: string);
+    function GetLimitPrice: Double;
+    function GetPlanSubTypeName: string;
+  public
+    constructor Create(ADealPayRec: TsdDataRecord; AProjectData: TObject);
+    destructor Destroy; override;
+
+    procedure SavePlanInfos;
+
+    property PlanType: Integer read FPlanType write SetPlanType;
+    property PlanSubType: Integer read FPlanSubType write SetPlanSubType;
+    property PlanSubTypeName: string read GetPlanSubTypeName;
+    property PhaseDeadline: Integer read GetPhaseDeadline write SetPhaseDeadline;
+    property PriceDeadline: Double read GetPriceDeadline write SetPriceDeadline;
+    property PDFormula: string read GetPDFormula write SetPDFormula;
+    property LimitPrice: Double read GetLimitPrice;
+  end;
+
+implementation
+
+uses
+  UtilMethods, ProjectData, BillsDm, DealPaymentDm, ZhAPI;
+
+{$R *.dfm}
+
+{ TDealPayPlanForm }
+
+constructor TDealPayPlanForm.Create(ADealPayRec: TsdDataRecord; AProjectData: TObject);
+begin
+  inherited Create(nil);
+  FDealPayRec := ADealPayRec;
+  FProjectData := AProjectData;
+  InitForm;
+end;
+
+destructor TDealPayPlanForm.Destroy;
+begin
+  inherited;
+end;
+
+procedure TDealPayPlanForm.InitForm;
+begin
+  lblDealPayName.Caption := FDealPayRec.ValueByName('Name').AsString;
+  lblTitle2.Left := lblDealPayName.Left + lblDealPayName.Width + 6;
+  PlanType := FDealPayRec.ValueByName('PlanType').AsInteger;
+  if PlanType = 1 then
+    PhaseDeadline := FDealPayRec.ValueByName('PlanDeadline').AsInteger
+  else if PlanType = 2 then
+  begin
+    PlanSubType := FDealPayRec.ValueByName('PlanSubType').AsInteger;
+    PriceDeadline := FDealPayRec.ValueByName('PlanDeadline').AsFloat;
+    PDFormula := FDealPayRec.ValueByName('PDFormula').AsString;
+  end;
+end;
+
+procedure TDealPayPlanForm.SavePlanInfos;
+begin
+  FDealPayRec.ValueByName('PlanType').AsInteger := PlanType;
+  if PlanType = 0 then
+  begin
+    FDealPayRec.ValueByName('PlanSubType').AsInteger := 0;
+    FDealPayRec.ValueByName('PlanDeadline').AsFloat := 0;
+    FDealPayRec.ValueByName('PDFormula').AsString := '';
+  end
+  else if PlanType = 1 then
+  begin
+    FDealPayRec.ValueByName('PlanSubType').AsInteger := 0;
+    FDealPayRec.ValueByName('PlanDeadline').AsInteger := PhaseDeadline;
+    FDealPayRec.ValueByName('PDFormula').AsString := '';
+  end
+  else
+  begin
+    FDealPayRec.ValueByName('PlanSubType').AsInteger := PlanSubType;
+    FDealPayRec.ValueByName('PlanDeadline').AsFloat := PriceDeadline;
+    FDealPayRec.ValueByName('PDFormula').AsString := PDFormula;
+  end;
+end;
+
+procedure TDealPayPlanForm.SetPriceDeadline(const Value: Double);
+begin
+  lblPriceDeadline.Caption := FloatToStr(Value);
+end;
+
+procedure TDealPayPlanForm.SetPlanSubType(const Value: Integer);
+begin
+  FPlanSubType := Value;
+  rbAddGatherTotalPrice.Checked := FPlanSubType = 0;
+  rbAddDealTotalPrice.Checked := FPlanSubType = 1;
+  rbAddQCTotalPrice.Checked := FPlanSubType = 2;
+  AssignResult;
+end;
+
+procedure TDealPayPlanForm.SetPlanType(const Value: Integer);
+begin
+  FPlanType := Value;
+  rbIsPlanNon.Checked := FPlanType = 0;
+  rbIsPlanPhase.Checked := FPlanType = 1;
+  rbIsPlanPrice.Checked := FPlanType = 2;
+  gbPhase.Enabled := rbIsPlanPhase.Checked;
+  if gbPhase.Enabled then
+    gbPhase.Font.Color := clBlack
+  else
+    gbPhase.Font.Color := clGray;
+  gbPrice.Enabled := rbIsPlanPrice.Checked;
+  if gbPrice.Enabled then
+    gbPrice.Font.Color := clBlack
+  else
+    gbPrice.Font.Color := clGray;
+  AssignResult;
+end;
+
+procedure TDealPayPlanForm.SetPhaseDeadline(const Value: Integer);
+begin
+  udDeadlinePhase.Position := Value;
+end;
+
+procedure TDealPayPlanForm.btnOkClick(Sender: TObject);
+begin
+  if (PlanType = 2) and (PriceDeadline < LimitPrice) then
+    ErrorMessage(Format('当前“%s”已计量至%f,限制金额应大于该值!', [PlanSubTypeName, LimitPrice]))
+  else
+    ModalResult := mrOk;
+end;
+
+function TDealPayPlanForm.GetPhaseDeadline: Integer;
+begin
+  Result := udDeadlinePhase.Position;
+end;
+
+function TDealPayPlanForm.GetPriceDeadline: Double;
+begin
+  Result := StrToFloat(lblPriceDeadline.Caption);
+end;
+
+function TDealPayPlanForm.GetPDFormula: string;
+begin
+  Result := lePDFormula.Text;
+end;
+
+procedure TDealPayPlanForm.SetPDFormula(const Value: string);
+begin
+  lePDFormula.Text := Value;
+end;
+
+function TDealPayPlanForm.GetLimitPrice: Double;
+begin
+  with TProjectData(FProjectData).BillsData do
+  begin
+    case PlanSubType of
+      0: Result := Settlement[4];
+      1: Result := Settlement[1];
+      2: Result := Settlement[2] + Settlement[3];
+    end;
+  end;
+end;
+
+procedure TDealPayPlanForm.rbIsPlanNonClick(Sender: TObject);
+begin
+  if PlanType <> TRadioButton(Sender).Tag then
+    PlanType := TRadioButton(Sender).Tag;
+end;
+
+procedure TDealPayPlanForm.rbAddGatherTotalPriceClick(Sender: TObject);
+begin
+  if PlanSubType <> TRadioButton(Sender).Tag then
+    PlanSubType := TRadioButton(Sender).Tag;
+end;
+
+procedure TDealPayPlanForm.AssignResult;
+
+  procedure CalcPriceDeadline;
+  begin
+    if CheckStringNull(PDFormula) then
+      PriceDeadline := 0
+    else if CheckNumeric(PDFormula) then
+      PriceDeadline := StrToFloatDef(PDFormula, 0)
+    else if Pos('bqwc', PDFormula) > 0 then
+    begin
+      ErrorMessage('不可使用“本期完成计量”计算基数!');
+      PriceDeadline := 0;
+    end
+    else
+      PriceDeadline := TProjectData(FProjectData).DealPaymentData.PayFormula.Calculate(PDFormula);
+  end;
+
+  function GetResult: String;
+  begin
+    case PlanType of
+      0: Result := '无';
+      1: Result := Format('当 计量期数 > %d 时,', [PhaseDeadline]);
+      2: Result := Format('当 %s > %f 时', [PlanSubTypeName, PriceDeadline]);
+    end;
+  end;
+
+begin
+  if PlanType = 2 then
+    CalcPriceDeadline;
+  lblResult.Caption := GetResult;
+  lblResultPost.Visible := PlanType <> 0;
+end;
+
+function TDealPayPlanForm.GetPlanSubTypeName: string;
+begin
+  case PlanSubType of
+    0: Result := '累计完成计量金额';
+    1: Result := '累计合同计量金额';
+    2: Result := '累计变更计量金额';
+  end;
+end;
+
+procedure TDealPayPlanForm.udDeadlinePhaseClick(Sender: TObject;
+  Button: TUDBtnType);
+begin
+  AssignResult;
+end;
+
+procedure TDealPayPlanForm.leDeadlinePhaseKeyPress(Sender: TObject;
+  var Key: Char);
+begin
+  if Key = #13 then
+    btnOk.SetFocus;
+end;
+
+procedure TDealPayPlanForm.leDeadlinePhaseChange(Sender: TObject);
+begin
+  AssignResult;
+end;
+
+procedure TDealPayPlanForm.lePDFormulaExit(Sender: TObject);
+begin
+  AssignResult;
+end;
+
+end.

+ 7 - 0
Forms/MainFrm.dfm

@@ -956,10 +956,17 @@ object MainForm: TMainForm
       Hint = #23450#20301
       Visible = ivAlways
     end
+<<<<<<< HEAD
     object dxbtnImportPlaneFxBillsToXmj: TdxBarButton
       Caption = #23548#20837#21488#36134'('#24179#38754#32467#26500')'#33267#39033#30446#33410
       Category = 0
       Hint = #23548#20837#21488#36134'('#24179#38754#32467#26500')'#33267#39033#30446#33410
+=======
+    object dxbtnSetDealPayPlan: TdxBarButton
+      Caption = #35774#32622#35745#25552#26399#38480
+      Category = 0
+      Hint = #35774#32622#35745#25552#26399#38480
+>>>>>>> 3.1.3.3
       Visible = ivAlways
     end
   end

+ 4 - 0
Forms/MainFrm.pas

@@ -142,7 +142,11 @@ type
     dxbtnChangeDealBillsMode: TdxBarButton;
     dxsiExpandTo: TdxBarSubItem;
     dxbtnLocateBookmark: TdxBarButton;
+<<<<<<< HEAD
     dxbtnImportPlaneFxBillsToXmj: TdxBarButton;
+=======
+    dxbtnSetDealPayPlan: TdxBarButton;
+>>>>>>> 3.1.3.3
     procedure FormCreate(Sender: TObject);
     procedure FormDestroy(Sender: TObject);
     procedure jtsProjectsChange(Sender: TObject; NewTab: Integer;

+ 10 - 0
Frames/DealPaymentFme.dfm

@@ -119,6 +119,7 @@ object DealPaymentFrame: TDealPaymentFrame
       FrozenRow = 0
       OnCurrentChanged = zgDealPaymentCurrentChanged
       OnCanEditAcceptKey = zgDealPaymentCanEditAcceptKey
+      OnShowHint = zgDealPaymentShowHint
       OnCellGetColor = zgDealPaymentCellGetColor
       OnMouseDown = zgDealPaymentMouseDown
       Align = alClient
@@ -305,6 +306,10 @@ object DealPaymentFrame: TDealPaymentFrame
         BeginGroup = True
         Item = MainForm.dxbtnCalculatePhasePay
         Visible = True
+      end
+      item
+        Item = MainForm.dxbtnSetDealPayPlan
+        Visible = True
       end>
     UseOwnFont = False
     OnPopup = dxpmDealPaymentPopup
@@ -321,5 +326,10 @@ object DealPaymentFrame: TDealPaymentFrame
       OnExecute = actnCalculatePhasePayExecute
       OnUpdate = actnCalculatePhasePayUpdate
     end
+    object actnSetDealPayPlan: TAction
+      Caption = #35774#32622#35745#25552#26399#38480
+      Hint = #36798#21040#26465#20214#26102#65292#21363#21051#35745#37327#33267#20184'('#25187')'#27454#38480#39069
+      OnExecute = actnSetDealPayPlanExecute
+    end
   end
 end

+ 79 - 4
Frames/DealPaymentFme.pas

@@ -23,6 +23,7 @@ type
     dxpmDealPayment: TdxBarPopupMenu;
     actnDealPayment: TActionList;
     actnCalculatePhasePay: TAction;
+    actnSetDealPayPlan: TAction;
     procedure zgParameterCellCanEdit(Sender: TObject; const ACoord: TPoint;
       var Allow: Boolean);
     procedure imgHelpClick(Sender: TObject);
@@ -41,6 +42,9 @@ type
     procedure laEdtExprsKeyPress(Sender: TObject; var Key: Char);
     procedure zgDealPaymentCanEditAcceptKey(var AKey: Char;
       var Accept: Boolean);
+    procedure actnSetDealPayPlanExecute(Sender: TObject);
+    procedure zgDealPaymentShowHint(var HintStr: String;
+      var CanShow: Boolean; var HintInfo: THintInfo; const ACoord: TPoint);
   private
     FDealPaymentData: TDealPaymentData;
 
@@ -64,7 +68,7 @@ type
 implementation
 
 uses
-  MainFrm, UtilMethods, ProjectData, PhaseData;
+  MainFrm, UtilMethods, ProjectData, PhaseData, DealPayPlanFrm;
 
 {$R *.dfm}
 
@@ -138,7 +142,9 @@ procedure TDealPaymentFrame.laEdtExprsKeyDown(Sender: TObject;
   var Key: Word; Shift: TShiftState);
 begin
   if Key = VK_Return then
-    zgDealPayment.SetFocus;
+    zgDealPayment.SetFocus
+  else if (ssCtrl in Shift) and (Key in [67, 99]) then
+    laEdtExprs.CopyToClipboard;
 end;
 
 function TDealPaymentFrame.CheckColHasFormula(ACol: Integer): Boolean;
@@ -151,6 +157,7 @@ end;
 procedure TDealPaymentFrame.dxpmDealPaymentPopup(Sender: TObject);
 begin
   SetDxBtnAction(actnCalculatePhasePay, MainForm.dxbtnCalculatePhasePay);
+  SetDxBtnAction(actnSetDealPayPlan, MainForm.dxbtnSetDealPayPlan);
 end;
 
 procedure TDealPaymentFrame.actnCalculatePhasePayExecute(Sender: TObject);
@@ -230,12 +237,12 @@ procedure TDealPaymentFrame.laEdtExprsKeyPress(Sender: TObject;
 begin
   if CheckCurTotalPriceCol(zgDealPayment.CurCol) then
   begin
-    if not((Key in ArithmeticCharSet) or (Key in ExprsBaseCharSet) or (Key = #8)) then
+    if not((Key in ArithmeticCharSet) or (Key in ExprsBaseCharSet) or (Key in [#8, #17])) then
       Key := #0;
   end
   else if CheckLimitPriceCol(zgDealPayment.CurCol) then
   begin
-    if not((Key in ArithmeticCharSet) or (Key in ExprsExceptCharSet) or (Key = #8)) then
+    if not((Key in ArithmeticCharSet) or (Key in ExprsExceptCharSet) or (Key in [#8, #17])) then
       Key := #0;
   end
   else
@@ -297,4 +304,72 @@ begin
             (ACol - 1 = sdDealPayment.VisibleCol('RangePrice'));
 end;
 
+procedure TDealPaymentFrame.actnSetDealPayPlanExecute(Sender: TObject);
+
+  function CheckCanPlan(ARec: TsdDataRecord): Boolean;
+  begin
+    Result := True;
+    if ARec.ValueByName('CalcType').AsInteger <> 0 then
+    begin
+      ErrorMessage('本期应付,本期实付不可设置计提期限。');
+      Result := False;
+    end
+    else if ARec.ValueByName('RangePrice').AsFloat = 0 then
+    begin
+      ErrorMessage('计提期限用于达到条件时,即刻计量至付(扣)款限额,应先设置付(扣)款限额。');
+      Result := False;
+    end
+    else if ARec.ValueByName('Locked').AsBoolean then
+    begin
+      if ARec.ValueByName('PlanType').AsInteger = 0 then
+        ErrorMessage('该支付(扣款)项被锁定,不可修改!')
+      else
+        TipMessage(Format('该支付(扣款)项已设置计提期限为:%s', [FDealPaymentData.PlanStr(ARec)]) + #13#10 + '且该项已被锁定,不可修改!');
+      Result := False;
+    end;
+  end;
+
+var
+  Rec: TsdDataRecord;
+  PlanForm: TDealPayPlanForm;
+begin
+  Rec := sdDealPayment.DataView.Current;
+  if CheckCanPlan(Rec) then
+  begin
+    PlanForm := TDealPayPlanForm.Create(Rec, FDealPaymentData.ProjectData);
+    try
+      if PlanForm.ShowModal = mrOk then
+        PlanForm.SavePlanInfos;
+    finally
+      PlanForm.Free;
+    end;
+  end;
+end;
+
+procedure TDealPaymentFrame.zgDealPaymentShowHint(var HintStr: String;
+  var CanShow: Boolean; var HintInfo: THintInfo; const ACoord: TPoint);
+var
+  Rec: TsdDataRecord;
+begin
+  // 用户鼠标点击移动至本期金额时,提示是否含计提限额
+  if (ACoord.X = 3) and (ACoord.Y > 0) and (ACoord.Y <= zgDealPayment.RowCount - 3) then
+  begin  
+    Rec := sdDealPayment.DataView.Records[ACoord.Y - 1];
+    if Assigned(Rec) and (Rec.ValueByName('Formula').AsString <> '') then
+    begin
+      if (Rec.ValueByName('PlanType').AsInteger <> 0) then
+      begin
+        CanShow := True;
+        HintStr := Format('计提期限为(%s)', [FDealPaymentData.PlanStr(Rec)]);
+      end;
+      if (zgDealPayment.Cells[ACoord.X, ACoord.Y].Text <> '') and FDealPaymentData.CheckReachPlan(Rec) then
+      begin
+        CanShow := True;
+        HintStr := '已达到计提期限,使用公式计算的当期金额须一次性计提至限额' + #13#10 +
+            Format('计提期限为(%s)', [FDealPaymentData.PlanStr(Rec)]);
+      end;
+    end;
+  end;
+end;
+
 end.

+ 23 - 3
Units/DataBaseTables.pas

@@ -103,7 +103,11 @@ const
 
   {清单数据 -- 台账编辑界面}
   SBills = 'Bills';
+<<<<<<< HEAD
   tdBills: array [0..80] of TScFieldDef =(
+=======
+  tdBills: array [0..78] of TScFieldDef =(
+>>>>>>> 3.1.3.3
     (FieldName: 'ID'; FieldType: ftInteger; Size: 0; NotNull: True; PrimaryKey: True; ForceUpdate: False),
     (FieldName: 'ParentID'; FieldType: ftInteger; Size: 0; NotNull: True; PrimaryKey: False; ForceUpdate: False),
     (FieldName: 'NextSiblingID'; FieldType: ftInteger; Size: 0; NotNull: True; PrimaryKey: False; ForceUpdate: False),
@@ -270,12 +274,18 @@ const
     // 经济指标
     (FieldName: 'DgnPrice'; FieldType: ftDouble; Size: 0; NotNull: False; PrimaryKey: False; ForceUpdate: False),
     // 累计经济指标
-    (FieldName: 'AddDgnPrice'; FieldType: ftDouble; Size: 0; NotNull: False; PrimaryKey: False; ForceUpdate: False)
+    (FieldName: 'AddDgnPrice'; FieldType: ftDouble; Size: 0; NotNull: False; PrimaryKey: False; ForceUpdate: False),
+    {------------------- Begin reports -----------------------}
+    // 签约清单数量
+    (FieldName: 'GclDealQuantity'; FieldType: ftDouble; Size: 0; NotNull: False; PrimaryKey: False; ForceUpdate: False),
+    // 签约清单金额
+    (FieldName: 'GclDealTotalPrice'; FieldType: ftDouble; Size: 0; NotNull: False; PrimaryKey: False; ForceUpdate: False)
+    {------------------ End Reports --------------------------}
   );
 
   {合同支付}
   SDealPayment = 'DealPayment';
-  tdDealPayment: array [0..14] of TScFieldDef =(
+  tdDealPayment: array [0..19] of TScFieldDef =(
     (FieldName: 'ID'; FieldType: ftInteger; Size: 0; NotNull: True; PrimaryKey: True; ForceUpdate: False),
     (FieldName: 'Name'; FieldType: ftString; Size: 200; NotNull: False; PrimaryKey: False; ForceUpdate: False),
     // 计算类型
@@ -297,6 +307,14 @@ const
     (FieldName: 'RangePrice'; FieldType: ftDouble; Size: 0; NotNull: False; PrimaryKey: False; ForceUpdate: False),
     // 限额 -- 公式
     (FieldName: 'RFormula'; FieldType: ftString; Size: 100; NotNull: False; PrimaryKey: False; ForceUpdate: False),
+    // 计提期限 -- 方式 0:无 1:计量期数 2:计量金额
+    (FieldName: 'PlanType'; FieldType: ftInteger; Size: 0; NotNull: False; PrimaryKey: False; ForceUpdate: False),
+    // 计提期限 -- 子方式(计量金额)  0:累计完成计量金额 1: 累计合同计量金额 2: 累计变更计量金额
+    (FieldName: 'PlanSubType'; FieldType: ftInteger; Size: 0; NotNull: False; PrimaryKey: False; ForceUpdate: False),
+    // 计提期限 -- 截止限定
+    (FieldName: 'PlanDeadline'; FieldType: ftDouble; Size: 0; NotNull: False; PrimaryKey: False; ForceUpdate: False),
+    // 计提期限 -- 截止限定 -- 计算公式
+    (FieldName: 'PDFormula'; FieldType: ftString; Size: 100; NotNull: False; PrimaryKey: False; ForceUpdate: False),
     // 锁定
     (FieldName: 'Locked'; FieldType: ftBoolean; Size: 0; NotNull: False; PrimaryKey: False; ForceUpdate: False),
     // 创建期数
@@ -306,7 +324,9 @@ const
     // 预定义
     (FieldName: 'PreDefined'; FieldType: ftBoolean; Size: 0; NotNull: False; PrimaryKey: False; ForceUpdate: False),
     // 锁定公式
-    (FieldName: 'LockedFormula'; FieldType: ftBoolean; Size: 0; NotNull: False; PrimaryKey: False; ForceUpdate: False)
+    (FieldName: 'LockedFormula'; FieldType: ftBoolean; Size: 0; NotNull: False; PrimaryKey: False; ForceUpdate: False),
+    // 支付扣款项拼接ID -- 报表专用
+    (FieldName: 'LinkSerialNo'; FieldType: ftInteger; Size: 0; NotNull: False; PrimaryKey: False; ForceUpdate: False)
   );
 
   {变更令}

+ 15 - 1
Units/PhaseData.pas

@@ -56,6 +56,7 @@ type
     {½ö´ò¿ªÏîÄ¿ÊôÐÔ}
     procedure SimpleOpen(const AProjectName: string);
     procedure SimpleSave;
+    procedure SimpleOpen2(const AProjectName: string);
 
     procedure CreateNewAuditData;
     procedure CopyPreData;
@@ -191,8 +192,8 @@ begin
   FConnection.Open(AProjectName);
   UpdatePhaseDataBase;
   FPhaseProperty.Open;
-  FPhasePayData.Open(FConnection.Connection);
   CheckAuditCount;
+  FPhasePayData.Open(FConnection.Connection);
 end;
 
 procedure TPhaseData.SimpleSave;
@@ -318,4 +319,17 @@ begin
   end;
 end;
 
+procedure TPhaseData.SimpleOpen2(const AProjectName: string);
+begin
+  FConnection.Open(AProjectName);
+  UpdatePhaseDataBase;
+  FPhaseProperty.Open;
+  CheckAuditCount;
+  FStageIndex := FPhaseProperty.AuditCount;
+  FStageData.TableName := StageTableName[FStageIndex];
+  FStageData.Open(FConnection.Connection);
+  FPhasePayData.Open(FConnection.Connection);
+  FZJJLData.Open(FConnection.Connection);
+end;
+
 end.

+ 56 - 0
Units/ProjectData.pas

@@ -113,6 +113,8 @@ type
     procedure OpenForReport(const AFileName: string);
     {OpenForReport2: OpenForReport的基础上打开最后一期数据}
     procedure OpenForReport2(const AFileName: string);
+    {OpenForReport3: OpenForReport2的基础上打开最后一个审核人数据,打开BillsMeasureTree不打开BillsCompileTree,链接BillsMeasureTree跟StageData}
+    procedure OpenForReport3(const AFileName: string);
     //-----------------------  End ---后台打开 ------------------------
 
     procedure SaveLastestPhaseMainData;
@@ -937,11 +939,44 @@ procedure TProjectData.CopyPhaseData;
     ExecuteSql(sSql);
   end;
 
+  procedure UpdateBillsByDealBills;
+  const
+    sUpdateSql = 'Update Bills As B, DealBills As D' +
+                 '    Set B.GclDealQuantity = D.Quantity, B.GclDealTotalPrice = D.TotalPrice' +
+                 '  Where (B.B_Code = D.B_Code) and (B.Name = D.Name) and (B.Units = D.Units) and (B.Price = D.Price)';
+  begin
+    ExecuteSql(sUpdateSql);
+  end;
+
+  procedure FilterDealBillsByBills;
+  const
+    sFilterSql = 'Select D.*' +
+                 '  Into P_FilterDealBills' +
+                 '  From DealBills As D inner join' +
+                 '    (Select D.ID' +
+                 '       From DealBills As D Left join Bills As B' +
+                 '       On (D.B_Code = B.B_Code) and (D.Name = B.Name) and (D.Units = B.Units) and (D.Price = B.Price)' +
+                 '     where B.ID is Null) As R' +
+                 '  On (D.ID = R.ID)';
+  begin
+    ExecuteSql(sFilterSql);
+  end;
+
+  procedure CopyCacheReportsData;
+  begin
+    // DealBills的数量金额填至Bills中
+    UpdateBillsByDealBills;
+    // 过滤DealBills中在Bills中不存在的清单
+    FilterDealBillsByBills;
+  end;
+
 begin
   Save;
   DeletePhaseTable;
+  CopyCacheReportsData;
   if FPhaseIndex > 0 then
     CopyCurPhaseData;
+  FDealPaymentData.UpdateLinkSerialNo;
   //CopyHistoryCompleteData;
 end;
 
@@ -1494,12 +1529,33 @@ begin
   end;
 end;
 
+<<<<<<< HEAD
 function TProjectData.CheckDataBaseInfo(APhaseCount, AAuditStatus: Integer): Boolean;
 begin
   Result := (FProjProperties.PhaseCount = APhaseCount)
          and (FProjProperties.AuditStatus = AAuditStatus);
   if Result and (APhaseCount > 0) and (AAuditStatus <> -1) then
     Result := PhaseData.AuditCount = AAuditStatus;
+=======
+procedure TProjectData.OpenForReport3(const AFileName: string);
+begin
+  FProjectID := -1;
+  UnZipFile(AFileName, TempPath);
+  FConnection.Open(MainFileName);
+  UpdateProjectDataBase;
+  FProjProperties.Open(FConnection.Connection);
+  UpdateOldData;
+  FBillsData.Open(FConnection.Connection);
+  FBillsMeasureData.Open;
+  FDealPaymentData.Open(FConnection.Connection);
+  FBGLData.Open(FConnection.Connection);
+  if ProjProperties.PhaseCount > 0 then
+  begin
+    FPhaseIndex := ProjProperties.PhaseCount;
+    FPhaseData.SimpleOpen2(Format('%sPhase%d.dat', [TempPath, FPhaseIndex]));
+  end;
+  FBillsMeasureData.ResetTreeNodeStageRec;
+>>>>>>> 3.1.3.3
 end;
 
 end.

+ 13 - 3
Units/ReportManager.pas

@@ -7,7 +7,7 @@ uses
   rmBGLExecutionDm, rmGclBillsAddDm, rmFxBillsAddDm, rmBillsGatherDm,
   rmGclBillsAuditCompareDm, rmDealInfosDm, rmXmjBGLDetailDm,
   rmOtherReport1Dm, rmGcl_XmjBillsDm, rmGclBillsPlaneDm,
-  rmMentalCustomized1Dm, rmCustomized2Dm,
+  rmMentalCustomized1Dm, rmCustomized2Dm, rmHaBaiCustomizedDm,
   rmTestFrm,
   ReportInteractInfo,
   Classes, ScFileArchiver, IniFiles, Graphics, DB, ProjectData,
@@ -207,6 +207,7 @@ type
     FrmGclBillsPlaneData: TrmGclBillsPlaneData;
     FrmMentalCustomized1Data: TrmMentalCustomized1Data;
     FrmCustomized2Data: TrmCustomized2Data;
+    FrmHaBaiCustomizedData: TrmHaBaiCustomizedData;
 
     FMemoryQuery: TADOQuery;
 
@@ -598,6 +599,7 @@ begin
   FrmGclBillsPlaneData := TrmGclBillsPlaneData.Create(nil);
   FrmMentalCustomized1Data := TrmMentalCustomized1Data.Create(nil);
   FrmCustomized2Data := TrmCustomized2Data.Create(nil);
+  FrmHaBaiCustomizedData := TrmHaBaiCustomizedData.Create(nil);
 
   FMemoryQuery := TADOQuery.Create(nil);
 
@@ -623,6 +625,7 @@ begin
 
   FMemoryQuery.Free;
 
+  FrmHaBaiCustomizedData.Free;
   FrmCustomized2Data.Free;
   FrmMentalCustomized1Data.Free;
   FrmGclBillsPlaneData.Free;
@@ -665,7 +668,7 @@ end;
 function TMemoryReportManager.GetMemoryDataSet(
   ADataSetID: Integer; AProjectData: TProjectData): TDataSet;
 begin
-  //ADataSetID := 44;
+  //ADataSetID := 49;
   case ADataSetID of
     1: Result := FrmGridHeaderData.AssginData(AProjectData);   // 몹깊깊庫
     2: Result := FrmGclBillsBGData.AssignData(AProjectData, rmtPhaseGather, rmgtGather); // 묏넋좆헌데[굶퍅供냥]
@@ -680,8 +683,10 @@ begin
     // 엄炬04, 05, 05-2, 04-1, 02,
        20, 21, 22, 23, 24, 25, 26, 27, 28, 29,
        // 02/03꼬겻, 07꼬겻, 08꼬겻, 09꼬겻, 11꼬겻, 12꼬겻, 16꼬겻, 17꼬겻, 18꼬겻, 19꼬겻,
-       32, 33, 35, 36, 39, 40, 44:
+       32, 33, 35, 36, 39, 40, 44,
        // 讀엑9, 讀엑06-1, 讀엑04, 讀엑01, 묏넋좆헌데쏵똑[맵據멕밗애땍齡], [밤땜凉헤땍齡]셕좆삠悧깊
+       45, 46, 47, 48, 49:
+       // 코촁뮴벗겜땍齡깊(連깊2, 連깊3, 連깊14, 連깊3-1, 連깊4-1)
         Result := SelectProjectsAndAssignData(ADataSetID);
     14: Result := FrmGclBillsBGData.AssignData(AProjectData, rmtPhaseDeal, rmgtGather); // 묏넋좆헌데[굶퍅북谿]
     15: Result := FrmGclBillsBGData.AssignData(AProjectData, rmtPhaseQc, rmgtGather); // 묏넋좆헌데[굶퍅鑒좆긴뫘]
@@ -813,6 +818,11 @@ begin
       36: Result := FrmOtherReport1Data.AssignData(FTenders);
       39, 40: Result := FrmMentalCustomized1Data.AssignData(FTenders);
       44: Result := FrmCustomized2Data.AssignData(FTenders);
+      45: Result := FrmHaBaiCustomizedData.AssignData(FTenders, hbgt2);
+      46: Result := FrmHaBaiCustomizedData.AssignData(FTenders, hbgt3);
+      47: Result := FrmHaBaiCustomizedData.AssignData(FTenders, hbgt14);
+      48: Result := FrmHaBaiCustomizedData.AssignData(FTenders, hbgt3_1);
+      49: Result := FrmHaBaiCustomizedData.AssignData(FTenders, hbgt4_1);
       else Result := FrmBillsGatherData.AssignData(FTenders);
     end;
   end;