<DODocTemplateConfigRoot><DODocTemplateList><DODocTemplate STATE="0"><DODocTemplate2DeviceList/><DODocTemplateParamList><DODocTemplateParam STATE="0"><DocTemplateParamId>28</DocTemplateParamId><DocTemplateId>11</DocTemplateId><ParamName>PaymentId</ParamName><ParamType>3</ParamType><CntxPropertyType>34</CntxPropertyType><ParamValue></ParamValue><ParamCaption>PaymentId</ParamCaption></DODocTemplateParam></DODocTemplateParamList><DODocRepositoryList/><DODocTemplateParamValueList><DODocTemplateParamValue STATE="0"><DocTemplateParamValueId>30</DocTemplateParamValueId><DocTemplateParamId>28</DocTemplateParamId><DocTemplateId>11</DocTemplateId><CntxPropertyType>0</CntxPropertyType><ParamValue></ParamValue><ParamCaption>PaymentId</ParamCaption><ReadOnly>1</ReadOnly><NotNull>0</NotNull></DODocTemplateParamValue></DODocTemplateParamValueList><DocTemplateId>12</DocTemplateId><SystemId>0</SystemId><DocTemplateAk>F741EF7756914CA09F6194EFFFB56E4B</DocTemplateAk><DocCntxType>3</DocCntxType><DocTemplateType>1</DocTemplateType><DirectPrint>0</DirectPrint><DocTemplateName>Payment Card Receipt Datasource</DocTemplateName><Enabled>1</Enabled><DocDatasourceId>0</DocDatasourceId><PriorityOrder>0</PriorityOrder><DmgCategoryId>0</DmgCategoryId><SystemTemplate>1</SystemTemplate><DeleteFromConfig></DeleteFromConfig><DocTemplateGroup></DocTemplateGroup></DODocTemplate></DODocTemplateList><DODocTemplateDataList><DocTemplateData STATE="0"><DocTemplateAk>F741EF7756914CA09F6194EFFFB56E4B</DocTemplateAk><DocTemplateContent>&lt;root namespaceuri="otn.overview7.xmldata"&gt;&lt;queries&gt;&lt;query name="reportxmldata" context="3"&gt;&lt;params&gt;&lt;param name="PaymentId" datatype="3" contextproperty="34"/&gt;&lt;/params&gt;&lt;/query&gt;&lt;/queries&gt;&lt;datasets&gt;&lt;dataset name="Payment" donotgeneratelist="S"&gt;&lt;select&gt;&lt;db query="reportxmldata" type="*" commadtype="query"&gt;SELECT 
  CNF_Site.SiteCode,            
  CNF_OperatingArea.AreaCode,
  CNF_Workstation.WorkstationAK AS Station,
  DATA_Transaction.Serial AS TransactionNumber,  
  DATA_Transaction.TransactionAk,
  
  DATA_Payment.PaymentAmount,
  DATA_Payment.PaymentDate,
  DATA_PaymentCard.MerchantId,
  --DATA_PaymentCard.Status,
  LkCCStatus.Description AS AuthStatus,  
  DATA_PaymentCard.PaymentAmount CardAmount,
  DATA_PaymentCard.CardNumber,
  DATA_PaymentCard.StartValidity,
  DATA_PaymentCard.EndValidity,
  DATA_PaymentCard.AuthorizationCode,
  --DATA_PaymentCard.AuthorizationMode,
  LkCCAuthMode.Description AS AuthMode,
  --DATA_PaymentCard.InputType,
  LkCCInputType.Description AS InputType,
  DATA_PaymentCard.CardHolderName,
  DATA_PaymentCard.PaymentSubType,
  DATA_PaymentCard.CHVerificationMode,
  DATA_PaymentCard.SequenceNumber,
  DATA_PaymentCard.RetrivialReference,
  DATA_PaymentCard.DevResponseCode,
  DATA_PaymentCard.DevRespMessage,
  DATA_PaymentCard.CardName,

  CNF_Currency.Symbol as Currency,
  CNF_Currency.ISOCode,

  case 
    when DATA_Note.Note is not null then DATA_Note.Note
	else 
	  '              ' + Format(DATA_Payment.PaymentDate, 'd', 'en-US') + ' ' +
	                   + Format(DATA_Payment.PaymentDate, 'T', 'en-US') +CHAR(13)+CHAR(10)+
	  '      Amount: ' + Format(DATA_PaymentCard.PaymentAmount,  N'c', 'en-US') +CHAR(13)+CHAR(10)+
	  '   Card Type: ' + COALESCE(DATA_PaymentCard.CardName, '') +CHAR(13)+CHAR(10)+
	  ' Card Number: ' + COALESCE(DATA_PaymentCard.CardNumber, '') +CHAR(13)+CHAR(10)+  
	  '  Auth. Code: ' + COALESCE(LkCCAuthMode.Description, '') +CHAR(13)+CHAR(10)+  
	  'Auth. Result: ' + COALESCE(LkCCStatus.Description, '') +CHAR(13)+CHAR(10)+  
	  '  Auth. Mode: ' + COALESCE(LkCCInputType.Description, '') +CHAR(13)+CHAR(10)  
  end PaymentReceipt
 
           FROM DATA_Payment 
LEFT OUTER JOIN DATA_PaymentCard ON DATA_Payment.PaymentID = DATA_PaymentCard.PaymentId
LEFT OUTER JOIN CNF_Lookup LkCCStatus ON LkCCStatus.LookupTableId = 55 AND LkCCStatus.ItemId = DATA_PaymentCard.Status  
LEFT OUTER JOIN CNF_Lookup LkCCAuthMode ON LkCCAuthMode.LookupTableId = 58 AND LkCCAuthMode.ItemId = DATA_PaymentCard.Status  
LEFT OUTER JOIN CNF_Lookup LkCCInputType ON LkCCInputType.LookupTableId = 98 AND LkCCInputType.ItemId = DATA_PaymentCard.InputType  
LEFT OUTER JOIN CNF_Currency ON DATA_Payment.CurrencyID = CNF_Currency.CurrencyId 

INNER JOIN DATA_Transaction ON DATA_Transaction.TransactionId=DATA_Payment.TransactionId
LEFT OUTER JOIN CNF_Site ON CNF_Site.SiteId = DATA_Transaction.SiteId
LEFT OUTER JOIN CNF_Workstation ON CNF_Workstation.WorkStationId = DATA_Transaction.WorkStationId
LEFT OUTER JOIN CNF_OperatingArea ON CNF_OperatingArea.OperatingAreaId = CNF_Workstation.OperatingAreaId
LEFT OUTER JOIN DATA_Note on DATA_Note.NoteKey = DATA_Payment.PaymentId and DATA_Note.NoteType = 125

WHERE DATA_Payment.PaymentId = :PaymentId&lt;/db&gt;&lt;/select&gt;&lt;datasets/&gt;&lt;/dataset&gt;&lt;/datasets&gt;&lt;/root&gt;
</DocTemplateContent><ArchiveFileName>F741EF7756914CA09F6194EFFFB56E4B</ArchiveFileName></DocTemplateData></DODocTemplateDataList></DODocTemplateConfigRoot>