-- Общие переменные -- xsl variable name Information select Most Eleme

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
<!-- Общие переменные -->
<xsl:variable name="Information" select="/Most/Element[@Name='Information']"/>
<xsl:variable name="Cookie" select="$Information/Cookie"/>
<xsl:variable name="claim" select="$Information/Input[@Name='Claim']"/>
<xsl:variable name="Params" select="$Information/Form"/>
<xsl:variable name="Now" select="$Information/Store[@Name='Now']/Date"/>
<xsl:variable name="Today"><xsl:value-of select="format-number($Now/@Day, '00')"/>.<xsl:value-of select="format-number($Now/@Month, '00')"/>.<xsl:value-of select="$Now/@Year"/></xsl:variable>
<!-- Cookies -->
<xsl:variable name="CookieDateFrom" select="$Cookie[@Name='DateFrom']"/>
<xsl:variable name="CookieDateTo" select="$Cookie[@Name='DateTo']"/>
<xsl:variable name="CookieIsDetailed" select="$Cookie[@Name='IsDetailed']"/>
<!-- /Cookies -->
<!-- Params -->
<xsl:variable name="All_Currencies" select="/Most/Element[@Name='All_Currencies']/Document"/>
<xsl:variable name="DateFrom">
<xsl:choose>
<xsl:when test="$Params[@Name='DateFrom']"><xsl:value-of select="$Params[@Name='DateFrom']"/></xsl:when>
<!-- <xsl:when test="$CookieDateFrom!=''"><xsl:value-of select="$CookieDateFrom"/></xsl:when>-->
<xsl:otherwise><xsl:value-of select="$Today"/></xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="DateTo">
<xsl:choose>
<xsl:when test="$Params[@Name='DateTo']"><xsl:value-of select="$Params[@Name='DateTo']"/></xsl:when>
<!-- <xsl:when test="$CookieDateTo!=''"><xsl:value-of select="$CookieDateTo"/></xsl:when>-->
<xsl:otherwise><xsl:value-of select="$Today"/></xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="IsDetailed">
<xsl:choose>
<xsl:when test="$Params[@Name='IsDetailed']"><xsl:value-of select="$Params[@Name='IsDetailed']"/></xsl:when>
<xsl:when test="$CookieIsDetailed!=''"><xsl:value-of select="$CookieIsDetailed"/></xsl:when>
</xsl:choose>
</xsl:variable>
<!-- /Params -->
<!-- Общая для отчётов (Макет) -->
<xsl:template match="/Most">
<html>
<head>
<title>anywayanyday. Отчёт по марже.</title>
<xsl:call-template name="common_head"/>
</head>
<xsl:call-template name="common_body"/>
</html>
</xsl:template>
<!-- /Общая для отчётов (Макет) -->
<!-- common_head -->
<xsl:template name="common_head">
<xsl:call-template name="common_head_css"/>
<xsl:call-template name="common_head_js"/>
</xsl:template>
<!-- /common_head -->
<!-- common_head_css -->
<xsl:template name="common_head_css">
<link rel="stylesheet" type="text/css" href="/css/calendar/calendar.css" media="all" />
<link rel="stylesheet" type="text/css" href="/css/reports/Reports.css" media="all" />
</xsl:template>
<!-- /common_head_css -->
<!-- common_head_js -->
<xsl:template name="common_head_js">
<script type="text/javascript" src="/js/jQuery/jquery.js"></script>
<!--<script type="text/javascript" src="/js/alerts/CheckDateTime_alerts_ru.js"></script>-->
<script type="text/javascript" src="/js/CheckDateTime.js"></script>
<!-- Calendar -->
<script type="text/javascript" src="/js/calendar/calendar-base.js"></script>
<script type="text/javascript" src="/js/calendar/calendar.js"></script>
<script type="text/javascript" src="/js/calendar/calendar-ru.js"></script>
<script type="text/javascript" src="/js/jquery/jquery.maskedinput.js"></script>
<!-- Control version -->
<script type="text/javascript" src="/js/flash/swfobject.js"></script>
<!-- Common Report -->
<script src="/js/reports/AJAX.js" type="text/javascript"></script>
<script src="/js/reports/CommonReport.js" type="text/javascript"></script>
<script>
function GetExcel() {
var objForm = document.getElementById('FilterForm');
$(objForm).attr('method','post');
var params = ParseForm(objForm);
params = params.replace('Async=True', 'Async=False');
var url = "excel.html?ReportMode=Excel&amp;" + params;
document.location = url;
}
</script>
<xsl:call-template name="common_report_DataGridParams"/>
</xsl:template>
<!-- /common_head_js -->
<!-- Параметры для таблицы-->
<xsl:template name="common_report_DataGridParams">
<script type="text/javascript">
<xsl:text disable-output-escaping="yes"><![CDATA[<!--
$(function(){
$(document.getElementById('DateFromInput')).mask("99.99.9999",{placeholder:"_"});
$(document.getElementById('DateToInput')).mask("99.99.9999",{placeholder:"_"});
var so = new SWFObject( "/flash/ReportGrid.swf","Report","100%","100%","8","#ffffff", "false", "low");
so.useExpressInstall('/flash/expressinstall.swf');
so.addParam("wmode", "transparent");
so.addParam("allowScriptAccess", "sameDomain");
so.write("Flash");
});
var sReportName = "Отчёт по марже";
function SetReportName() {
var sRN = sReportName;
var GDS = document.getElementById( "GDSProfileTag" );
if( GDS.value != 'All' )
sRN += ": " + GDS.value + ', ';
sRN += " [" + document.getElementById( "DateFromInput" ).value + "-" + document.getElementById( "DateToInput" ).value + "]";
GetReport().SetDisplayReportName( sRN );
}
<!-- Report settings. Invoke from Flex -->
var sReportSettings = '';
var AdditionalColumns = '';
function MakeGridParamsAfterDOMLoaded() {
sReportSettings =
'<Report SysName="MarginReport" DisplayName="' + sReportName + '" SearchBoxVisible="true" FooterVisible="true" WidthColumnSettings="250" ExcelVisible="true">' +
'<Columns OrderBy="Date">'+
'<Column DisplayName="Дата" SysName="Date" Format="DD.MM.YYYY" Type="datetime" Width="80"/>'+
'<Column DisplayName="№ заказа" SysName="Number" Type="string" Align="right" Width="80"/>'+
'<Column DisplayName="АК" SysName="AviaCompanyTicketNumberPart" Type="string" Width="30"/>'+
'<Column DisplayName="Номера билетов" SysName="TicketNumber" Type="string" Width="100"/>'+
'<Column DisplayName="Авиакомпания" SysName="AirCompany" Type="string" Width="100"/>'+
'<Column DisplayName="Маршрут" SysName="Route" Type="string" Width="200"/>'+
'<Column DisplayName="Валюта" SysName="Currency" Type="string" Width="60"/>'+
'<Column DisplayName="Итого за билет" SysName="TicketProfit" Type="number" Format="2" Align="right" Width="100"/>'+
'<Column DisplayName="Тариф" SysName="TicketFare" Type="number" Format="2" Align="right" Width="100"/>'+
'<Column DisplayName="Таксы" SysName="TicketTaxes" Type="number" Format="2" Align="right" Width="100"/>'+
'<Column DisplayName="ПС, Транзакции" SysName="Transaction" Type="number" Format="2" Align="right" Width="100"/>'+
'<Column DisplayName="ПС, Комиссия" SysName="PaySystemAmount" Type="number" Format="2" Align="right" Width="100"/>'+
'<Column DisplayName="Брокер" SysName="Broker" Type="number" Format="2" Align="right" Width="100"/>'+
'<Column DisplayName="Наценка, Zellen" SysName="Zellen" Type="number" Format="2" Align="right" Width="100"/>'+
'<Column DisplayName="Наценка, БукБилет" SysName="BookBilet" Type="number" Format="2" Align="right" Width="100"/>'+
'<Column DisplayName="Наценка, RUS E-Ticket SA" SysName="RUS" Type="number" Format="2" Align="right" Width="100"/>'+
'<Column DisplayName="Наценка, AWAD" SysName="AWAD" Type="number" Format="2" Align="right" Width="100"/>'+
'<Column DisplayName="Ком., Zellen" SysName="CommZellen" Type="number" Format="2" Align="right" Width="120"/>'+
'<Column DisplayName="Ком., БукБилет" SysName="CommBookBilet" Type="number" Format="2" Align="right" Width="100"/>'+
'<Column DisplayName="Ком., RUS E-Ticket SA" SysName="CommRUS" Type="number" Format="2" Align="right" Width="100"/>'+
'<Column DisplayName="Ком., AWAD" SysName="CommAWAD" Type="number" Format="2" Align="right" Width="100"/>'+
'<Column DisplayName="% АК" SysName="AgentPercent" Type="string" Align="right" Width="90"/>'+
'<Column DisplayName="Клиент" SysName="ClientType" Type="string" Width="100"/>'+
'<Column DisplayName="ПС" SysName="PaySystem" Type="string" Width="100"/>'+
'<Column DisplayName="ГДС" SysName="GDS" Type="string" Width="100"/>'+
'<Column DisplayName="Перелёт" SysName="FlightType" Type="string" Width="80"/>'+
'</Columns>'+
'</Report>';
}
<!-- Parse response. Invoke from CommonReports.js -->
function ParseRows( responseXML ) {
var arrMarginReportLine = responseXML.documentElement.getElementsByTagName( 'MarginReportLine' );
var iMarginReportLineLength = arrMarginReportLine.length;
var arrRows = new Array();
for( i = 0; i < iMarginReportLineLength; i ++ ) {
var MarginReportLine = arrMarginReportLine[ i ];
arrRows[ i ] = new Array();
arrRows[ i ][ 0 ] = GetData( MarginReportLine, 'Date', true );
arrRows[ i ][ 1 ] = GetData( MarginReportLine, 'OrderNumber', false );
arrRows[ i ][ 2 ] = GetData( MarginReportLine, 'AviaCompanyTicketNumberPart', false );
arrRows[ i ][ 3 ] = GetData( MarginReportLine, 'TicketNumber', false );
arrRows[ i ][ 4 ] = GetData( MarginReportLine, 'AviaCompany', false );
arrRows[ i ][ 5 ] = GetData( MarginReportLine, 'Route', false );
arrRows[ i ][ 6 ] = GetData( MarginReportLine, 'Currency', false );
arrRows[ i ][ 7 ] = GetData( MarginReportLine, 'TicketProfit', false );
arrRows[ i ][ 8 ] = GetData( MarginReportLine, 'TicketFare', false );
arrRows[ i ][ 9 ] = GetData( MarginReportLine, 'TicketTaxes', false );
TicketExpense = MarginReportLine.getElementsByTagName( 'TicketExpense' )[0].getElementsByTagName( 'TicketExpense' );
if( TicketExpense[0] != null ) arrRows[ i ][ 10 ] = GetData( TicketExpense[0], 'Amount', false ) else arrRows[ i ][ 10 ] = '<font color="#ff0000">!</color>';
if( TicketExpense[1] != null ) arrRows[ i ][ 11 ] = GetData( TicketExpense[1], 'Amount', false ) else arrRows[ i ][ 11 ] = '<font color="#ff0000">!</color>';
if( TicketExpense[2] != null ) arrRows[ i ][ 12 ] = GetData( TicketExpense[2], 'Amount', false ) else arrRows[ i ][ 12 ] = '<font color="#ff0000">!</color>';
MarginParts = MarginReportLine.getElementsByTagName( 'MarginParts' )[0].getElementsByTagName( 'MarginReportObligation' );
if( MarginParts[0] != null ) arrRows[ i ][ 13 ] = GetData( MarginParts[0], 'Amount', false ) else arrRows[ i ][ 13 ] = '<font color="#ff0000">!</color>';
if( MarginParts[1] != null ) arrRows[ i ][ 14 ] = GetData( MarginParts[1], 'Amount', false ) else arrRows[ i ][ 14 ] = '<font color="#ff0000">!</color>';
if( MarginParts[2] != null ) arrRows[ i ][ 15 ] = GetData( MarginParts[2], 'Amount', false ) else arrRows[ i ][ 15 ] = '<font color="#ff0000">!</color>';
if( MarginParts[3] != null ) arrRows[ i ][ 16 ] = GetData( MarginParts[3], 'Amount', false ) else arrRows[ i ][ 16 ] = '<font color="#ff0000">!</color>';
CommissionParts = MarginReportLine.getElementsByTagName( 'CommissionParts' )[0].getElementsByTagName( 'MarginReportObligation' );
if( CommissionParts[0] != null ) arrRows[ i ][ 17 ] = GetData( CommissionParts[0], 'Amount', false ) else arrRows[ i ][ 17 ] = '<font color="#ff0000">!</color>';
if( CommissionParts[1] != null ) arrRows[ i ][ 18 ] = GetData( CommissionParts[1], 'Amount', false ) else arrRows[ i ][ 18 ] = '<font color="#ff0000">!</color>';
if( CommissionParts[2] != null ) arrRows[ i ][ 19 ] = GetData( CommissionParts[2], 'Amount', false ) else arrRows[ i ][ 19 ] = '<font color="#ff0000">!</color>';
if( CommissionParts[3] != null ) arrRows[ i ][ 20 ] = GetData( CommissionParts[3], 'Amount', false ) else arrRows[ i ][ 20 ] = '<font color="#ff0000">!</color>';
arrRows[ i ][ 21 ] = GetData( MarginReportLine, 'AgentPercent', false );
arrRows[ i ][ 22 ] = GetData( MarginReportLine, 'ClientType', false );
arrRows[ i ][ 23 ] = GetData( MarginReportLine, 'PaySystem', false );
arrRows[ i ][ 24 ] = GetData( MarginReportLine, 'GDSProfileTag', false );
arrRows[ i ][ 25 ] = GetData( MarginReportLine, 'FlightType', false );
}
return arrRows;
}
function CheckForm( objForm ) {
if( objForm.DateFrom.value=='') {
alert('Введите дату');
objForm.DateFrom.select();
objForm.DateFrom.focus();
return false;
}
if( objForm.DateTo.value== '') {
alert('Введите дату');
objForm.DateTo.select();
objForm.DateTo.focus();
return false;
}
if( IsDateValid(objForm.DateFrom,1,0)==false) {
return false;
}
if( IsDateValid(objForm.DateTo,1,0)==false) {
return false;
}
if( IsDateValid(objForm.DateFrom,1,0)[2] > IsDateValid(objForm.DateTo,1,0)[2]) {
alert('Введите правильно даты.');
objForm.DateFrom.select();
objForm.DateFrom.focus();
return false;
}
SubmitFlexAjaxReport( objForm );
return false;
}
//-->]]></xsl:text>
var DateFrom = '<xsl:value-of select="$Params[@Name='DateFrom']"/>';
var DateTo = '<xsl:value-of select="$Params[@Name='DateTo']"/>';
var mbIsTransmited = false;
if( DateFrom != '' &amp;&amp; DateTo != '' ){
mbIsTransmited = true;
}
</script>
</xsl:template>
<xsl:template name="common_body">
<body>
<div id="layout">
<xsl:call-template name="common_filter"/>
<script type="text/javascript">
<xsl:text disable-output-escaping="yes"><![CDATA[<!--
MakeGridParamsAfterDOMLoaded();
//-->]]></xsl:text></script>
<div id="Flash">
<a href="http://www.adobe.com/go/getflashplayer">
<img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" border="0" />
</a>
</div>
</div>
</body>
</xsl:template>
<xsl:template name="common_filter">
<div id="Filter">
<form id="FilterForm" action="/_reports/" method="get" onsubmit="CheckForm( this ); return false;">
<input type="hidden" name="ReportName" value="MarginReport"/>
<input type="hidden" name="claim" id="claimInput" value="{$claim}"/>
<input type="hidden" name="Async" value="True"/>
<table class="Filter">
<tbody>
<tr>
<td></td>
<td style="align:right;"><div class="close"><a href="#" onclick="javascript:HideFilter()">закрыть</a></div></td>
</tr>
<tr>
<td class="label"><label for="DateFromInput">дата:</label></td>
<td>
<input type="text" name="DateFrom" id="DateFromInput" onblur="IsDateValid(this,0,0);" value="{$DateFrom}" class="text date" onclick="return showCalendar('DateFromInput');" />&mdash;<input type="text" name="DateTo" id="DateToInput" onblur="IsDateValid(this,0,0);" value="{$DateTo}" class="text date" onclick="return showCalendar('DateToInput');" />
</td>
</tr>
<tr>
<td class="label"><label for="CurrencyId">валюта:</label></td>
<td>
<select name="CurrencyId" id="CurrencyId">
<xsl:for-each select="$All_Currencies">
<xsl:sort select="@Name"/>
<option value="{@Id}">
<xsl:if test="StringCode = 'CHF'"><xsl:attribute name="selected">selected</xsl:attribute></xsl:if>
<xsl:value-of select="@Name"/>
</option>
</xsl:for-each>
</select>
</td>
</tr>
<tr>
<td class="label"><label for="GDSProfileTag">GDS:</label></td>
<td>
<select name="GDSProfileTag" id="GDSProfileTag">
<option value="All">Все</option>
<option value="Amadeus">Amadeus</option>
<option value="Galileo">GalileoRu</option>
<option value="GalileoSw">GalileoSw</option>
</select>
</td>
</tr>
<tr>
<td class="label"><label for="IsDetailed">побилетно:</label></td>
<td>
<input type="checkbox" name="IsDetailed" id="IsDetailed" value="true" checked="checked">
<!-- <xsl:if test="$IsDetailed='true'"><xsl:attribute name="checked">checked</xsl:attribute></xsl:if>-->
</input>
</td>
</tr>
</tbody>
<tbody>
<tr>
<td></td>
<td><button class="select" onclick="CheckForm( document.getElementById( 'FilterForm' ) ); return false;">Выбрать</button></td>
</tr>
</tbody>
</table>
</form>
</div>
</xsl:template>