|
@@ -136,7 +136,7 @@ type
|
|
|
constructor Create; override;
|
|
|
destructor Destroy; override;
|
|
|
|
|
|
- function FindNextSibling(AParent: TCacheNode; ACode: string): TstgGatherTreeNode;
|
|
|
+ function FindNextSibling(AParent: TCacheNode; ACode, AB_Code: string): TstgGatherTreeNode;
|
|
|
function FindNode(AParent: TCacheNode; AInfo: TBillsIDTreeNode): TstgGatherTreeNode; overload;
|
|
|
function FindNode(AID: Integer): TstgGatherTreeNode; overload;
|
|
|
|
|
@@ -388,9 +388,21 @@ begin
|
|
|
end;
|
|
|
|
|
|
function TstgGatherTree.FindNextSibling(AParent: TCacheNode;
|
|
|
- ACode: string): TstgGatherTreeNode;
|
|
|
+ ACode, AB_Code: string): TstgGatherTreeNode;
|
|
|
+var
|
|
|
+ vChild: TstgGatherTreeNode;
|
|
|
begin
|
|
|
-
|
|
|
+ Result := nil;
|
|
|
+ if Assigned(AParent) then
|
|
|
+ vChild := TstgGatherTreeNode(AParent.FirstChild)
|
|
|
+ else
|
|
|
+ vChild := TstgGatherTreeNode(Root.FirstChild);
|
|
|
+ while not Assigned(Result) and Assigned(vChild) do
|
|
|
+ begin
|
|
|
+ if (CompareCode(ACode, vChild.Code) < 0) or (CompareCode(AB_Code, vChild.B_Code) < 0) then
|
|
|
+ Result := vChild;
|
|
|
+ vChild := TstgGatherTreeNode(vChild.NextSibling);
|
|
|
+ end;
|
|
|
end;
|
|
|
|
|
|
function TstgGatherTree.FindNode(AID: Integer): TstgGatherTreeNode;
|
|
@@ -423,8 +435,8 @@ begin
|
|
|
|
|
|
while Assigned(vNode) and not Assigned(Result) do
|
|
|
begin
|
|
|
- if SameText(vNode.Code, AInfo.Rec.Code.AsString) and SameText(vNode.B_Code, AInfo.Rec.B_Code.AsString)
|
|
|
- and SameText(vNode.Name, AInfo.Rec.Name.AsString) and SameText(vNode.Units, AInfo.Rec.Units.AsString) then
|
|
|
+ if SameText(vNode.Code, Trim(AInfo.Rec.Code.AsString)) and SameText(vNode.B_Code, Trim(AInfo.Rec.B_Code.AsString))
|
|
|
+ and SameText(vNode.Name, Trim(AInfo.Rec.Name.AsString)) and SameText(vNode.Units, Trim(AInfo.Rec.Units.AsString)) then
|
|
|
Result := vNode;
|
|
|
vNode := TstgGatherTreeNode(vNode.NextSibling);
|
|
|
end;
|