Sfoglia il codice sorgente

Bug #836 台账分解,勾去锁定列,应不报错

MaiXinRong 9 anni fa
parent
commit
a9c0c4db85
1 ha cambiato i file con 17 aggiunte e 1 eliminazioni
  1. 17 1
      DataModules/BillsCompileDm.pas

+ 17 - 1
DataModules/BillsCompileDm.pas

@@ -683,10 +683,26 @@ procedure TBillsCompileData.sdvBillsCompileSetText(var Text: String;
         SetTextErrorHint('该清单已经计量,不可修改清单编号');
   end;
 
+  function CheckValidData: Boolean;
+  begin
+    Result := (AValue.AsString = Text);
+    if SameText(AColumn.FieldName, 'OrgQuantity') or
+       SameText(AColumn.FieldName, 'OrgTotalPrice') or
+       SameText(AColumn.FieldName, 'MisQuantity') or
+       SameText(AColumn.FieldName, 'MisTotalPrice') or
+       SameText(AColumn.FieldName, 'OthQuantity') or
+       SameText(AColumn.FieldName, 'OthTotalPrice') or
+       SameText(AColumn.FieldName, 'Price') then
+    begin
+      if (AValue.AsFloat = 0) and (Text = '') then
+        Result := False;
+    end;
+  end;
+
 begin
   if not Assigned(AValue) then Exit;
   // 修改后数据与原数据相同则不提交
-  if (AValue.AsString = Text) or ((AValue.AsFloat = 0) and (Text = '')) then Exit;
+  if not CheckValidData then Exit;
 
   CheckLockedData;
   if not Allow then Exit;