|
|
@@ -15,6 +15,10 @@ type
|
|
|
sdvLeafXmj: TsdDataView;
|
|
|
procedure sdvLeafXmjCurrentChanged(ARecord: TsdDataRecord);
|
|
|
procedure sddLeafXmjGLGetRecordClass(var ARecordClass: TsdRecordClass);
|
|
|
+ procedure sdvLeafXmjGLSetText(var Text: String; ARecord: TsdDataRecord;
|
|
|
+ AValue: TsdValue; AColumn: TsdViewColumn; var Allow: Boolean);
|
|
|
+ procedure sdvLeafXmjGLGetText(var Text: String; ARecord: TsdDataRecord;
|
|
|
+ AValue: TsdValue; AColumn: TsdViewColumn; DisplayText: Boolean);
|
|
|
private
|
|
|
FProjectData: TObject;
|
|
|
|
|
|
@@ -48,7 +52,7 @@ implementation
|
|
|
|
|
|
uses
|
|
|
ProjectData, BillsCompileDm, BillsTree, sdIDTree, GclBillsGatherModel,
|
|
|
- UtilMethods, PhaseData, StageLeafXmjGlDm, Variants;
|
|
|
+ UtilMethods, PhaseData, StageLeafXmjGlDm, Variants, DB;
|
|
|
|
|
|
{$R *.dfm}
|
|
|
|
|
|
@@ -339,4 +343,36 @@ begin
|
|
|
vGLs.Add(idx.Records[iRec]);
|
|
|
end;
|
|
|
|
|
|
+procedure TLeafXmjGlData.sdvLeafXmjGLSetText(var Text: String;
|
|
|
+ ARecord: TsdDataRecord; AValue: TsdValue; AColumn: TsdViewColumn;
|
|
|
+ var Allow: Boolean);
|
|
|
+begin
|
|
|
+ if SameText(AColumn.FieldName, 'UsedQuantity') then
|
|
|
+ begin
|
|
|
+ if (Text <> AValue.AsString) and (Text <> '') then
|
|
|
+ begin
|
|
|
+ with TProjectData(FProjectData).PhaseData.StageLeafXmjGlData do
|
|
|
+ Text := FloatToStr(Decimal.Quantity.RoundTo(StrToFloatDef(Text, 0)));
|
|
|
+ end;
|
|
|
+ end;
|
|
|
+end;
|
|
|
+
|
|
|
+procedure TLeafXmjGlData.sdvLeafXmjGLGetText(var Text: String;
|
|
|
+ ARecord: TsdDataRecord; AValue: TsdValue; AColumn: TsdViewColumn;
|
|
|
+ DisplayText: Boolean);
|
|
|
+
|
|
|
+ procedure GetDisplayText;
|
|
|
+ begin
|
|
|
+ if AValue.Field.DataType = ftFloat then
|
|
|
+ begin
|
|
|
+ if AValue.AsFloat = 0 then
|
|
|
+ Text := '';
|
|
|
+ end;
|
|
|
+ end;
|
|
|
+
|
|
|
+begin
|
|
|
+ if DisplayText then
|
|
|
+ GetDisplayText;
|
|
|
+end;
|
|
|
+
|
|
|
end.
|