Explorar o código

Bug #844 无当前定位的详细清单,“新增调差工料”&“应用调差工料至相同清单”应灰选

MaiXinRong %!s(int64=9) %!d(string=hai) anos
pai
achega
1cca466c5c
Modificáronse 1 ficheiros con 3 adicións e 2 borrados
  1. 3 2
      Frames/PriceMarginBillsFme.pas

+ 3 - 2
Frames/PriceMarginBillsFme.pas

@@ -107,7 +107,7 @@ var
 begin
   iID := saDetailGclBills.DataView.Current.ValueByName('RelaBillsID').AsInteger;
   vNode := TBillsIDTreeNode(FPriceMarginBillsData.MainBillsTree.FindNode(iID));
-  AddDetailGLs
+  AddDetailGLs;
   {  ErrorMessage('当前清单已进行材料调差,不可再添加调差工料。');}
 end;
 
@@ -171,7 +171,8 @@ end;
 
 procedure TPriceMarginBillsFrame.actnAddDetailGLsUpdate(Sender: TObject);
 begin
-  TAction(Sender).Enabled := not TProjectData(FPriceMarginBillsData.ProjectData).PriceMarginReadOnly;
+  with TProjectData(FPriceMarginBillsData.ProjectData) do
+    TAction(Sender).Enabled := (not PriceMarginReadOnly) and Assigned(saDetailGclBills.DataView.Current);
 end;
 
 procedure TPriceMarginBillsFrame.ResetViewControl;