procedure RaporLoad;
Begin
End;

Function RaporFileName: String;
Begin
  Result:= '';
End;

Function RaporDefaultSQL: String;
Begin
  Result:= '';
End;

procedure Start;
Begin
End;

Procedure Finish;
Begin
End;

Function ReadFilter: String;
Begin
End;

Function ReadSQL(W: String): String;
Begin

End;

procedure AddChartSeries;
Var
  IDS, K: String;
  P: Integer;
Begin
  IDS:= SelectRecord('SELECT KARTNO, AD + '' '' + SOYAD AS PERSONEL FROM TBLPERSONEL WHERE DELETED = 0', 
     'PERSONEL', 
	 'Personel', 
	 'KARTNO', 
	 'Personel', 
	 'PERSONEL', 
	 True);
  if IDS <> '' Then
  Begin
    While True Do
	Begin
	  P:= Pos(',', IDS);
	  if P < 1 Then
	  Begin
	    K:= Trim(IDS);
		IDS:= '';
	  End
	  else
	  Begin
	    K:= Trim(Copy(IDS, 1, P - 1));
		Delete(IDS, 1, P + 1);
	  End;	  
	  if K = '' Then
	    break;

  	  AddSeries('Select AY, dbo.TRMONTHNAME(AY) AS AYADI, SUM(TUTARI) AS TUTARI, P.AD + '' '' + P.SOYAD AS PERSONEL ' + 
        ' From TBLURETIMSATFATBASLIK B ' +
	     ' LEFT OUTER JOIN TBLPERSONEL P ON P.KARTNO = B.PERSONELID ' +
	     ' WHERE B.DELETED = 0 AND P.KARTNO = ' + K +
	     ' GROUP BY AY, AD, SOYAD Order BY AY ',
	     'TUTARI',
	     'AYADI',
		 GetDBValue('Select AD + '' '' + SOYAD FROM TBLPERSONEL WHERE KARTNO = ' + K),
	     2,
		 True,
		 False);	  
	  if Trim(IDS) = '' Then 
	    break;
	End;
  End;
End;

procedure Execute;
Begin
  CreateChart('Personel Satış Grafiği');
  AddChartSeries;
End;

Begin
End.