| 
					
				 | 
			
			
				@@ -134,7 +134,7 @@ type 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     function CheckBGLUsed(ABGID: Integer): Boolean; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     function LocateBGL(const ACode: string): Boolean; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-    function LocateBGBills(ABGID: Integer; const AB_Code: string): Boolean; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    function LocateBGBills(ABGID: Integer; const AB_Code, AName, AUnit: string; APrice: Double): Boolean; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     function GetTotalPrice: Double; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     function GetEndTotalPrice(AEndPhase: Integer): Double; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   public 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -391,7 +391,7 @@ var 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 begin 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   for I := 0 to ABGLInfo.Count - 1 do 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     if LocateBGL(ABGLInfo.Codes[I]) and 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        LocateBGBills(cdsBGLID.AsInteger, ABGLInfo.B_Code) then 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        LocateBGBills(cdsBGLID.AsInteger, ABGLInfo.B_Code, ABGLInfo.Name, ABGLInfo.Units, ABGLInfo.Price) then 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     begin 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       cdsBGBills.Edit; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       fNum := QuantityRoundTo(StrToFloatDef(ABGLInfo.Nums[I], 0)); 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -670,14 +670,17 @@ begin 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 end; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 function TBGLData.LocateBGBills(ABGID: Integer; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-  const AB_Code: string): Boolean; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+  const AB_Code, AName, AUnit: string; APrice: Double): Boolean; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 begin 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   Result := False; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   cdsBGBills.First; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   while (not cdsBGBills.Eof) do 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				   begin 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     if (cdsBGBillsBGID.AsInteger = ABGID) and 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-       SameText(cdsBGBillsB_Code.AsString, AB_Code) then 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+       SameText(cdsBGBillsB_Code.AsString, AB_Code) and 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+       SameText(cdsBGBillsName.AsString, AName) and 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+       SameText(cdsBGBillsUnits.AsString, AUnit) and 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+       (PriceRoundTo(cdsBGBillsPrice.AsFloat - APrice) = 0) then 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     begin 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       Result := True; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				       Break; 
			 |