|
@@ -226,8 +226,10 @@ procedure TBillsCompileData.sdvBillsCompileAfterValueChanged(
|
|
end;
|
|
end;
|
|
|
|
|
|
var
|
|
var
|
|
- stnNode: TsdIDTreeNode;
|
|
|
|
|
|
+ vNode: TBillsIDTreeNode;
|
|
begin
|
|
begin
|
|
|
|
+ vNode := TBillsIDTreeNode(BillsCompileTree.FindNode(AValue.Owner.ValueByName('ID').AsInteger));
|
|
|
|
+
|
|
if SameText(AValue.FieldName, 'OrgQuantity') or
|
|
if SameText(AValue.FieldName, 'OrgQuantity') or
|
|
SameText(AValue.FieldName, 'OrgTotalPrice') then
|
|
SameText(AValue.FieldName, 'OrgTotalPrice') then
|
|
CalculateOrg(AValue.Owner.ValueByName('ID').AsInteger)
|
|
CalculateOrg(AValue.Owner.ValueByName('ID').AsInteger)
|
|
@@ -237,15 +239,13 @@ begin
|
|
else if SameText(AValue.FieldName, 'OthQuantity') or
|
|
else if SameText(AValue.FieldName, 'OthQuantity') or
|
|
SameText(AValue.FieldName, 'OthTotalPrice') then
|
|
SameText(AValue.FieldName, 'OthTotalPrice') then
|
|
CalculateOth(AValue.Owner.ValueByName('ID').AsInteger)
|
|
CalculateOth(AValue.Owner.ValueByName('ID').AsInteger)
|
|
- else if SameText(AValue.FieldName, 'Price') or
|
|
|
|
- SameText(AValue.FieldName, 'DgnQuantity1') then
|
|
|
|
- CalculateTotal(AValue.Owner.ValueByName('ID').AsInteger);
|
|
|
|
|
|
+ else if SameText(AValue.FieldName, 'Price') then
|
|
|
|
+ CalculateTotal(AValue.Owner.ValueByName('ID').AsInteger)
|
|
|
|
+ else if SameText(AValue.FieldName, 'DgnQuantity1') then
|
|
|
|
+ CalculateDesignPrice(vNode);
|
|
|
|
|
|
if (AValue.FieldName = 'LockedInfo') then
|
|
if (AValue.FieldName = 'LockedInfo') then
|
|
- begin
|
|
|
|
- stnNode := BillsCompileTree.FindNode(AValue.Owner.ValueByName('ID').AsInteger);
|
|
|
|
- ResetChildrenLockedInfo(stnNode, AValue.AsBoolean);
|
|
|
|
- end;
|
|
|
|
|
|
+ ResetChildrenLockedInfo(vNode, AValue.AsBoolean);
|
|
|
|
|
|
if (AValue.FieldName = 'B_Code') then
|
|
if (AValue.FieldName = 'B_Code') then
|
|
begin
|
|
begin
|
|
@@ -556,7 +556,10 @@ procedure TBillsCompileData.sdvBillsCompileSetText(var Text: String;
|
|
begin
|
|
begin
|
|
sPre := StringReplace(AFieldName, 'Quantity', '', [rfIgnoreCase, rfReplaceAll]);
|
|
sPre := StringReplace(AFieldName, 'Quantity', '', [rfIgnoreCase, rfReplaceAll]);
|
|
if CheckStringNull(Text) or CheckNumeric(Text) then
|
|
if CheckStringNull(Text) or CheckNumeric(Text) then
|
|
- Text := FloatToStr(QuantityRoundTo(StrToFloatDef(Text, 0)))
|
|
|
|
|
|
+ begin
|
|
|
|
+ ARecord.ValueByName(sPre + 'Formula').AsString := '';
|
|
|
|
+ Text := FloatToStr(QuantityRoundTo(StrToFloatDef(Text, 0)));
|
|
|
|
+ end
|
|
else
|
|
else
|
|
begin
|
|
begin
|
|
ARecord.ValueByName(sPre + 'Formula').AsString := Text;
|
|
ARecord.ValueByName(sPre + 'Formula').AsString := Text;
|
|
@@ -571,7 +574,10 @@ procedure TBillsCompileData.sdvBillsCompileSetText(var Text: String;
|
|
begin
|
|
begin
|
|
sPre := StringReplace(AFieldName, 'TotalPrice', '', [rfIgnoreCase, rfReplaceAll]);
|
|
sPre := StringReplace(AFieldName, 'TotalPrice', '', [rfIgnoreCase, rfReplaceAll]);
|
|
if CheckStringNull(Text) or CheckNumeric(Text) then
|
|
if CheckStringNull(Text) or CheckNumeric(Text) then
|
|
- Text := FloatToStr(TotalPriceRoundTo(StrToFloatDef(Text, 0)))
|
|
|
|
|
|
+ begin
|
|
|
|
+ ARecord.ValueByName(sPre + 'Formula').AsString := '';
|
|
|
|
+ Text := FloatToStr(TotalPriceRoundTo(StrToFloatDef(Text, 0)));
|
|
|
|
+ end
|
|
else
|
|
else
|
|
begin
|
|
begin
|
|
ARecord.ValueByName(sPre + 'Formula').AsString := Text;
|
|
ARecord.ValueByName(sPre + 'Formula').AsString := Text;
|
|
@@ -885,6 +891,7 @@ begin
|
|
OrgQuantity.AsFloat + MisQuantity.AsFloat + OthQuantity.AsFloat);
|
|
OrgQuantity.AsFloat + MisQuantity.AsFloat + OthQuantity.AsFloat);
|
|
TotalPrice.AsFloat := TotalPriceRoundTo(
|
|
TotalPrice.AsFloat := TotalPriceRoundTo(
|
|
OrgTotalPrice.AsFloat + MisTotalPrice.AsFloat + OthTotalPrice.AsFloat);
|
|
OrgTotalPrice.AsFloat + MisTotalPrice.AsFloat + OthTotalPrice.AsFloat);
|
|
|
|
+ CacheMisTP := MisTotalPrice.AsFloat;
|
|
end;
|
|
end;
|
|
end;
|
|
end;
|
|
end;
|
|
end;
|
|
@@ -921,6 +928,7 @@ begin
|
|
OrgQuantity.AsFloat + MisQuantity.AsFloat + OthQuantity.AsFloat);
|
|
OrgQuantity.AsFloat + MisQuantity.AsFloat + OthQuantity.AsFloat);
|
|
TotalPrice.AsFloat := TotalPriceRoundTo(
|
|
TotalPrice.AsFloat := TotalPriceRoundTo(
|
|
OrgTotalPrice.AsFloat + MisTotalPrice.AsFloat + OthTotalPrice.AsFloat);
|
|
OrgTotalPrice.AsFloat + MisTotalPrice.AsFloat + OthTotalPrice.AsFloat);
|
|
|
|
+ CacheOrgTP := OrgTotalPrice.AsFloat;
|
|
end;
|
|
end;
|
|
end;
|
|
end;
|
|
end;
|
|
end;
|
|
@@ -957,6 +965,7 @@ begin
|
|
OrgQuantity.AsFloat + MisQuantity.AsFloat + OthQuantity.AsFloat);
|
|
OrgQuantity.AsFloat + MisQuantity.AsFloat + OthQuantity.AsFloat);
|
|
TotalPrice.AsFloat := TotalPriceRoundTo(
|
|
TotalPrice.AsFloat := TotalPriceRoundTo(
|
|
OrgTotalPrice.AsFloat + MisTotalPrice.AsFloat+ OthTotalPrice.AsFloat);
|
|
OrgTotalPrice.AsFloat + MisTotalPrice.AsFloat+ OthTotalPrice.AsFloat);
|
|
|
|
+ CacheOthTP := OthTotalPrice.AsFloat;
|
|
end;
|
|
end;
|
|
end;
|
|
end;
|
|
end;
|
|
end;
|