Selaa lähdekoodia

1. 计量一期的数据后,再新增一期计量,材料调差--详细清单,本期价差未正确刷新。
原因:vNode.StageRec在1期完成后的新增计量期时,未正确刷新。
2. 计量台账界面,新增三列显示价差数据,快捷键控制显示

MaiXinRong 9 vuotta sitten
vanhempi
commit
3e19b5efc4

+ 23 - 1
DataModules/PriceMarginBillsDm.pas

@@ -40,6 +40,7 @@ type
     procedure AddDetailGLs(AGls: TList);
 
     procedure RefreshDetailBills(ABillsID: Integer);
+    procedure RefreshAllDetailBills;
 
     property ProjectData: TObject read FProjectData;
     property MainBillsTree: TBillsIDTree read GetMainBillsTree;
@@ -255,7 +256,9 @@ begin
 
   StageRec := TProjectData(FProjectData).PhaseData.StageData.StageRecord(ABillsID);
   if Assigned(StageRec) then
-    Rec.ValueByName('PM_TotalPrice').AsFloat := StageRec.PM_TotalPrice.AsFloat;
+    Rec.ValueByName('PM_TotalPrice').AsFloat := StageRec.PM_TotalPrice.AsFloat
+  else
+    Rec.ValueByName('PM_TotalPrice').AsFloat := 0;
 end;
 
 procedure TPriceMarginBillsData.sdvDetailGLAfterValueChanged(
@@ -346,4 +349,23 @@ begin
     GetDisplayText;
 end;
 
+procedure TPriceMarginBillsData.RefreshAllDetailBills;
+var
+  i: Integer;
+  Rec: TsdDataRecord;
+  StageRec: TStageRecord;
+begin
+  for i := 0 to sddDetailGclBills.RecordCount - 1 do
+  begin
+    Rec := sddDetailGclBills.Records[i];
+
+    with TProjectData(FProjectData).PhaseData.StageData do
+      StageRec := StageRecord(Rec.ValueByName('RelaBillsID').AsInteger);
+    if Assigned(StageRec) then
+      Rec.ValueByName('PM_TotalPrice').AsFloat := StageRec.PM_TotalPrice.AsFloat
+    else
+      Rec. ValueByName('PM_TotalPrice').AsFloat := 0;
+  end;
+end;
+
 end.

+ 1 - 0
DataModules/ProjectGLDm.pas

@@ -239,6 +239,7 @@ begin
     CalculatePM_Quantity(TProjectGLRecord(AValue.Owner));
     CalculatePM_TotalPrice(TProjectGLRecord(AValue.Owner));
     CalculateRelaBills(TProjectGLRecord(AValue.Owner));
+    TProjectData(FProjectData).PriceMarginBillsData.RefreshAllDetailBills;
   end;
 end;
 

+ 57 - 0
Frames/BillsMeasureFme.dfm

@@ -959,6 +959,63 @@ object BillsMeasureFrame: TBillsMeasureFrame
         Font.Style = []
         FieldName = 'MemoStr'
         ReadOnly = False
+      end
+      item
+        Title.Caption = #26448#26009#35843#24046'|'#25130#27490#19978#26399
+        Title.CaptionAcrossCols = '3'
+        Title.Font.Charset = GB2312_CHARSET
+        Title.Font.Color = clWindowText
+        Title.Font.Height = -12
+        Title.Font.Name = #23435#20307
+        Title.Font.Style = []
+        Alignment = taRightJustify
+        Font.Charset = GB2312_CHARSET
+        Font.Color = clWindowText
+        Font.Height = -12
+        Font.Name = #23435#20307
+        Font.Style = []
+        FieldName = 'PM_PreTotalPrice'
+        Width = 60
+        Visible = False
+        ReadOnly = True
+      end
+      item
+        Title.Caption = '|'#26412#26399
+        Title.CaptionAcrossCols = '1'
+        Title.Font.Charset = GB2312_CHARSET
+        Title.Font.Color = clWindowText
+        Title.Font.Height = -12
+        Title.Font.Name = #23435#20307
+        Title.Font.Style = []
+        Alignment = taRightJustify
+        Font.Charset = GB2312_CHARSET
+        Font.Color = clWindowText
+        Font.Height = -12
+        Font.Name = #23435#20307
+        Font.Style = []
+        FieldName = 'PM_TotalPrice'
+        Width = 60
+        Visible = False
+        ReadOnly = True
+      end
+      item
+        Title.Caption = '|'#32047#35745
+        Title.CaptionAcrossCols = '1'
+        Title.Font.Charset = GB2312_CHARSET
+        Title.Font.Color = clWindowText
+        Title.Font.Height = -12
+        Title.Font.Name = #23435#20307
+        Title.Font.Style = []
+        Alignment = taRightJustify
+        Font.Charset = GB2312_CHARSET
+        Font.Color = clWindowText
+        Font.Height = -12
+        Font.Name = #23435#20307
+        Font.Style = []
+        FieldName = 'PM_AddTotalPrice'
+        Width = 60
+        Visible = False
+        ReadOnly = True
       end>
     Grid = zgBillsMeasure
     ExtendRowCount = 3

+ 20 - 3
Frames/BillsMeasureFme.pas

@@ -56,13 +56,15 @@ type
     FShowBGLCode: Boolean;
     FShowDesignQuantity: Boolean;
     FShowAddField: Boolean; // For Inner Test
+    FShowPMField: Boolean; // For Inner Test
     FOnAfterSetBookmark: TBookmarkRefreshEvent;
     FShowAlias: Boolean;
 
     function CheckExprsColumn(ACol: Integer): Boolean;
 
     procedure SetColumnVisible(const AColumn: string; AVisible: Boolean);
-    procedure SetAddFieldVisiblie(AValue: Boolean);
+    procedure SetAddFieldVisible(AValue: Boolean);
+    procedure SetPMFieldVisible(AValue: Boolean);
 
     procedure LoadDealProperty(ARec: TsdDataRecord);
 
@@ -368,7 +370,7 @@ begin
   stdBillsMeasure.Column('AddDgnPrice').Visible := FShowDesignQuantity;
 end;
 
-procedure TBillsMeasureFrame.SetAddFieldVisiblie(AValue: Boolean);
+procedure TBillsMeasureFrame.SetAddFieldVisible(AValue: Boolean);
 begin
   FShowAddField := AValue;
   stdBillsMeasure.Column('AddDealQuantity').Visible := AValue;
@@ -388,7 +390,7 @@ begin
   if (ssCtrl in Shift) and (ssShift in Shift) and (ssAlt in Shift)
       and (Key in [65, 97]) // 'a', 'A'
       and (zgBillsMeasure.CurCol = 4) then
-    SetAddFieldVisiblie(not FShowAddField);
+    SetAddFieldVisible(not FShowAddField);
 
   if (ssCtrl in Shift) and (ssShift in Shift) and (ssAlt in Shift)
       and (Key in [80, 112]) // 'p', 'P' - Parent
@@ -399,6 +401,13 @@ begin
   end;
 
   if (ssCtrl in Shift) and (ssShift in Shift) and (ssAlt in Shift)
+      and (Key in [77, 109]) // 'm', 'M' - PriceMargin
+      and (zgBillsMeasure.CurCol = 5) then
+  begin
+    SetPMFieldVisible(not FShowPMField);
+  end;
+
+  if (ssCtrl in Shift) and (ssShift in Shift) and (ssAlt in Shift)
       and (Key in [67, 99]) then // 'c', 'C'
     actnCalculateAll.Execute;
 end;
@@ -621,4 +630,12 @@ begin
     stdBillsMeasure.Options := stdBillsMeasure.Options - [aoAllowInsert];
 end;
 
+procedure TBillsMeasureFrame.SetPMFieldVisible(AValue: Boolean);
+begin
+  FShowAddField := AValue;
+  stdBillsMeasure.Column('PM_PreTotalPrice').Visible := AValue;
+  stdBillsMeasure.Column('PM_TotalPrice').Visible := AValue;
+  stdBillsMeasure.Column('PM_AddTotalPrice').Visible := AValue;
+end;
+
 end.

+ 2 - 2
Frames/ProjectFme.pas

@@ -565,7 +565,7 @@ procedure TProjectFrame.dxsbViewControlItemClick(Sender: TObject;
     end;
   end;
 
-  procedure DispalyPriceMargin;
+  procedure DisplayPriceMargin;
   begin
     if ProjectData.ProjProperties.PhaseCount = 0 then
     begin
@@ -584,7 +584,7 @@ begin
 
   case Item.Tag of
     0..2: ChangeView;
-    3: DispalyPriceMargin;
+    3: DisplayPriceMargin;
     4: DisplayCompare;
     5: DisplayReports;
   end;

+ 1 - 0
Units/ProjectData.pas

@@ -1660,6 +1660,7 @@ begin
   PhaseData.CopyPreData;
   ProjectGLData.LoadCurPhaseInfoPrice;
   ProjectGLData.LoadStagePM_CalcData;
+  BillsMeasureData.ResetTreeNodeStageRec;
 end;
 
 function TProjectData.GetStageIndex: Integer;