Lines 12-17
Link Here
|
12 |
<script type="text/javascript"> |
12 |
<script type="text/javascript"> |
13 |
//<![CDATA[ |
13 |
//<![CDATA[ |
14 |
$(document).ready(function() { |
14 |
$(document).ready(function() { |
|
|
15 |
void_compare = "[% 0 FILTER $Currency highlight => highlight %]"; |
16 |
|
15 |
[% IF credit_id %] |
17 |
[% IF credit_id %] |
16 |
accountPrint( 'credit', [% credit_id %] ); |
18 |
accountPrint( 'credit', [% credit_id %] ); |
17 |
[% ELSIF debit_id %] |
19 |
[% ELSIF debit_id %] |
Lines 172-178
$(document).ready(function() {
Link Here
|
172 |
return STRINGS['CreditTypes'][val] || val; |
174 |
return STRINGS['CreditTypes'][val] || val; |
173 |
}, |
175 |
}, |
174 |
}, |
176 |
}, |
175 |
{ "mDataProp": "amount_paid" }, |
177 |
{ |
|
|
178 |
"mDataProp": "amount_paid", |
179 |
"mRender": function ( data, type, full ) { |
180 |
if ( full.amount_voided != void_compare ) { |
181 |
return "<strike>" + full.amount_voided + "</strike>"; |
182 |
} else { |
183 |
return full.amount_paid; |
184 |
} |
185 |
} |
186 |
}, |
176 |
{ "mDataProp": "amount_remaining" }, |
187 |
{ "mDataProp": "amount_remaining" }, |
177 |
{ "mDataProp": "created_on" }, |
188 |
{ "mDataProp": "created_on" }, |
178 |
{ "mDataProp": "updated_on" } |
189 |
{ "mDataProp": "updated_on" } |
Lines 288-300
function fnFormatDebitDetails( debitsTable, nTr ) {
Link Here
|
288 |
for ( var i = 0; i < account_offsets.length; i++ ) { |
299 |
for ( var i = 0; i < account_offsets.length; i++ ) { |
289 |
ao = account_offsets[i]; |
300 |
ao = account_offsets[i]; |
290 |
credit_type = STRINGS["CreditTypes"][ao.credit.type] || ao.credit.type; |
301 |
credit_type = STRINGS["CreditTypes"][ao.credit.type] || ao.credit.type; |
|
|
302 |
offset_type = STRINGS["OffsetTypes"][ao.type] || ao.type; |
303 |
if ( offset_type ) offset_type = " (" + offset_type + ") "; |
304 |
|
305 |
var payment_or_void; |
306 |
if ( ao.credit.amount_voided != void_compare ) { |
307 |
payment_or_void = "<strike>" + ao.credit.amount_voided + "</strike>"; |
308 |
} else { |
309 |
payment_or_void = ao.credit.amount_paid; |
310 |
} |
311 |
|
291 |
sOut += |
312 |
sOut += |
292 |
"<tr>" + |
313 |
"<tr>" + |
293 |
"<td>" + ao.credit_id + "</td>" + |
314 |
"<td>" + ao.credit_id + "</td>" + |
294 |
"<td>" + ao.created_on + "</td>" + |
315 |
"<td>" + ao.created_on + "</td>" + |
295 |
"<td>" + ao.credit.amount_paid + "</td>" + |
316 |
"<td>" + payment_or_void + "</td>" + |
296 |
"<td>" + ao.amount + "</td>" + |
317 |
"<td>" + ao.amount + "</td>" + |
297 |
"<td>" + credit_type + "</td>" + |
318 |
"<td>" + credit_type + offset_type + "</td>" + |
298 |
"<td>" + ao.credit.notes + "</td>" + |
319 |
"<td>" + ao.credit.notes + "</td>" + |
299 |
"</tr>"; |
320 |
"</tr>"; |
300 |
} |
321 |
} |
Lines 319-324
function fnFormatCreditDetails( creditsTable, nTr ) {
Link Here
|
319 |
"<i class='icon-print'></i> " + _("Print receipt") + |
340 |
"<i class='icon-print'></i> " + _("Print receipt") + |
320 |
"</button>"; |
341 |
"</button>"; |
321 |
|
342 |
|
|
|
343 |
if ( ! oData.amount_voided_original ) { |
344 |
sOut += "<a class='credit_void btn btn-small noprint' style='margin:5px;' onclick='accountVoid(\"credit\"," + oData.credit_id + ")'>" + |
345 |
"<i class='icon-remove-sign'></i> " + _("Void payment") + |
346 |
"</a>"; |
347 |
} |
348 |
|
322 |
var account_offsets = oData.account_offsets; |
349 |
var account_offsets = oData.account_offsets; |
323 |
|
350 |
|
324 |
if ( account_offsets.length ) { |
351 |
if ( account_offsets.length ) { |
Lines 331-336
function fnFormatCreditDetails( creditsTable, nTr ) {
Link Here
|
331 |
"<th>" + _("Description") + "</th>" + |
358 |
"<th>" + _("Description") + "</th>" + |
332 |
"<th>" + _("Type") + "</th>" + |
359 |
"<th>" + _("Type") + "</th>" + |
333 |
"<th>" + _("Amount") + "</th>" + |
360 |
"<th>" + _("Amount") + "</th>" + |
|
|
361 |
"<th>" + _("Amount applied") + "</th>" + |
334 |
"<th>" + _("Remaining") + "</th>" + |
362 |
"<th>" + _("Remaining") + "</th>" + |
335 |
"<th>" + _("Created on") + "</th>" + |
363 |
"<th>" + _("Created on") + "</th>" + |
336 |
"<th>" + _("Updated on") + "</th>" + |
364 |
"<th>" + _("Updated on") + "</th>" + |
Lines 342-353
function fnFormatCreditDetails( creditsTable, nTr ) {
Link Here
|
342 |
for ( var i = 0; i < account_offsets.length; i++ ) { |
370 |
for ( var i = 0; i < account_offsets.length; i++ ) { |
343 |
ao = account_offsets[i]; |
371 |
ao = account_offsets[i]; |
344 |
debit_type = STRINGS["DebitTypes"][ao.debit.type] || ao.debit.type; |
372 |
debit_type = STRINGS["DebitTypes"][ao.debit.type] || ao.debit.type; |
|
|
373 |
offset_type = STRINGS["OffsetTypes"][ao.type] || ao.type; |
374 |
if ( offset_type ) offset_type = " (" + offset_type + ") "; |
375 |
|
345 |
sOut += |
376 |
sOut += |
346 |
"<tr>" + |
377 |
"<tr>" + |
347 |
"<td>" + ao.debit.debit_id + "</td>" + |
378 |
"<td>" + ao.debit.debit_id + "</td>" + |
348 |
"<td>" + ao.debit.description + "</td>" + |
379 |
"<td>" + ao.debit.description + "</td>" + |
349 |
"<td>" + debit_type + "</td>" + |
380 |
"<td>" + debit_type + offset_type + "</td>" + |
350 |
"<td>" + ao.debit.amount_original + "</td>" + |
381 |
"<td>" + ao.debit.amount_original + "</td>" + |
|
|
382 |
"<td>" + ao.amount + "</td>" + |
351 |
"<td>" + ao.debit.amount_outstanding + "</td>" + |
383 |
"<td>" + ao.debit.amount_outstanding + "</td>" + |
352 |
"<td>" + ao.debit.created_on + "</td>" + |
384 |
"<td>" + ao.debit.created_on + "</td>" + |
353 |
"<td>" + ao.debit.updated_on + "</td>" + |
385 |
"<td>" + ao.debit.updated_on + "</td>" + |
Lines 369-374
function fnFormatCreditDetails( creditsTable, nTr ) {
Link Here
|
369 |
function accountPrint( type, id ) { |
401 |
function accountPrint( type, id ) { |
370 |
window.open( "/cgi-bin/koha/members/account_print.pl?type=" + type + "&id=" + id ); |
402 |
window.open( "/cgi-bin/koha/members/account_print.pl?type=" + type + "&id=" + id ); |
371 |
} |
403 |
} |
|
|
404 |
|
405 |
function accountVoid( type, id ) { |
406 |
if ( confirm(_("Are you sure you want to void this transaction?")) ) { |
407 |
window.location.href = "/cgi-bin/koha/members/account_void.pl?borrowernumber=" + [% borrowernumber %] + "&id=" + id; |
408 |
} |
409 |
} |
372 |
//]]> |
410 |
//]]> |
373 |
</script> |
411 |
</script> |
374 |
</head> |
412 |
</head> |
Lines 468-477
function accountPrint( type, id ) {
Link Here
|
468 |
[% BLOCK format_data %] |
506 |
[% BLOCK format_data %] |
469 |
[% FOREACH key IN data.result_source.columns %] |
507 |
[% FOREACH key IN data.result_source.columns %] |
470 |
[% IF key.match('^amount') %] |
508 |
[% IF key.match('^amount') %] |
|
|
509 |
"[% key %]_original": "[% data.$key %]", |
471 |
"[% key %]": "[% data.$key FILTER $Currency highlight => highlight %]", |
510 |
"[% key %]": "[% data.$key FILTER $Currency highlight => highlight %]", |
472 |
[% ELSIF key.match('_on$') %] |
511 |
[% ELSIF key.match('_on$') %] |
|
|
512 |
"[% key %]_original": "[% data.$key %]", |
473 |
"[% key %]": "[% data.$key | $KohaDates %]", |
513 |
"[% key %]": "[% data.$key | $KohaDates %]", |
474 |
[% ELSE %] |
514 |
[% ELSE %] |
|
|
515 |
"[% key %]_original": "[% data.$key %]", |
475 |
"[% key %]": "[% data.$key | replace('"', '\"') %]", |
516 |
"[% key %]": "[% data.$key | replace('"', '\"') %]", |
476 |
[% END %] |
517 |
[% END %] |
477 |
[% END %] |
518 |
[% END %] |