Bugzilla – Attachment 23424 Details for
Bug 6427
Rewrite of the accounts system
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 6427 [Part 5] - Implement new accounting system in the opac
Bug-6427-Part-5---Implement-new-accounting-system-.patch (text/plain), 47.17 KB, created by
Kyle M Hall (khall)
on 2013-12-11 16:56:15 UTC
(
hide
)
Description:
Bug 6427 [Part 5] - Implement new accounting system in the opac
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2013-12-11 16:56:15 UTC
Size:
47.17 KB
patch
obsolete
>From 4675b6aad6a1b027886a604188395665f454bc6f Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Wed, 11 Dec 2013 10:56:56 -0500 >Subject: [PATCH] Bug 6427 [Part 5] - Implement new accounting system in the opac > >--- > .../bootstrap/en/includes/browser-strings.inc | 34 ++ > .../opac-tmpl/bootstrap/en/modules/opac-account.tt | 383 +++++++++++++++-- > .../opac-tmpl/bootstrap/images/details_close.png | Bin 0 -> 841 bytes > .../opac-tmpl/bootstrap/images/details_open.png | Bin 0 -> 881 bytes > .../opac-tmpl/prog/en/includes/browser-strings.inc | 34 ++ > .../opac-tmpl/prog/en/modules/opac-account.tt | 445 +++++++++++++++++--- > koha-tmpl/opac-tmpl/prog/images/details_close.png | Bin 0 -> 841 bytes > koha-tmpl/opac-tmpl/prog/images/details_open.png | Bin 0 -> 881 bytes > opac/opac-account.pl | 48 +-- > opac/opac-user.pl | 14 +- > 10 files changed, 814 insertions(+), 144 deletions(-) > create mode 100644 koha-tmpl/opac-tmpl/bootstrap/en/includes/browser-strings.inc > create mode 100644 koha-tmpl/opac-tmpl/bootstrap/images/details_close.png > create mode 100644 koha-tmpl/opac-tmpl/bootstrap/images/details_open.png > create mode 100644 koha-tmpl/opac-tmpl/prog/en/includes/browser-strings.inc > create mode 100644 koha-tmpl/opac-tmpl/prog/images/details_close.png > create mode 100644 koha-tmpl/opac-tmpl/prog/images/details_open.png > >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/browser-strings.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/browser-strings.inc >new file mode 100644 >index 0000000..f6c74f6 >--- /dev/null >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/browser-strings.inc >@@ -0,0 +1,34 @@ >+[% USE KohaAuthorisedValues %] >+<script type="text/javascript"> >+//<![CDATA[ >+ var BROWSER_RETURN_TO_SEARCH = _("Return to results"); >+ var BROWSER_PREVIOUS = _("Previous"); >+ var BROWSER_NEXT = _("Next"); >+ >+ var STRINGS = { >+ "DebitTypes": { >+ "FINE" : _("Fine"), >+ "ACCOUNT_MANAGEMENT_FEE" : _("Account management fee"), >+ "SUNDRY" : _("Sundry"), >+ "LOST" : _("Lost item"), >+ "HOLD" : _("Hold fee"), >+ "RENTAL" : _("Rental fee"), >+ "NEW_CARD" : _("New card"), >+ [% FOREACH a IN KohaAuthorisedValues.Get('MANUAL_INV') %] >+ "[% a.authorised_value %]" : "[% a.lib %]", >+ [% END %] >+ }, >+ >+ "CreditTypes": { >+ "CREDIT" : _("Credit"), >+ "PAYMENT" : _("Payment"), >+ "WRITEOFF" : _("Writeoff"), >+ "FOUND" : _("Lost item found"), >+ "FORGIVEN" : _("Forgiven"), >+ [% FOREACH a IN KohaAuthorisedValues.Get('MANUAL_CREDIT') %] >+ "[% a.authorised_value %]" : "[% a.lib %]", >+ [% END %] >+ } >+ } >+//]]> >+</script> >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-account.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-account.tt >index aa70431..a1e2487 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-account.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-account.tt >@@ -1,9 +1,12 @@ > [% USE Koha %] > [% USE KohaDates %] >+[% USE Currency %] > > [% INCLUDE 'doc-head-open.inc' %][% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %] catalog › Your fines and charges > [% INCLUDE 'doc-head-close.inc' %] > [% BLOCK cssinclude %][% END %] >+ >+ > </head> > <body id="opac-account" class="scrollto"> > [% INCLUDE 'masthead.inc' %] >@@ -11,7 +14,7 @@ > <div class="main"> > <ul class="breadcrumb"> > <li><a href="/cgi-bin/koha/opac-main.pl">Home</a> <span class="divider">›</span></li> >- <li>[% FOREACH BORROWER_INF IN BORROWER_INFO %]<a href="/cgi-bin/koha/opac-user.pl">[% BORROWER_INF.firstname %] [% BORROWER_INF.surname %]</a>[% END %] <span class="divider">›</span></li> >+ <li><a href="/cgi-bin/koha/opac-user.pl">[% borrower.firstname %] [% borrower.surname %]</a> <span class="divider">›</span></li> > <li><a href="#">Your fines and charges</a></li> > </ul> > >@@ -25,38 +28,57 @@ > <div class="span10"> > <div id="useraccount" class="maincontent"> > <h3>Fines and charges</h3> >+ [% IF credits || debits %] >+ >+ <p> >+ <h3>Account balance: [% borrower.account_balance | $Currency %]</h3> >+ </p> >+ >+ <div> >+ <div id="account-debits"> >+ <a id="account-debits-switcher" href="#" onclick="return false">View payments</a> >+ <table cellpadding="0" cellspacing="0" border="0" class="display" id="debits-table"> >+ <thead> >+ <tr> >+ <th colspan="99">Fees</th> >+ </tr> >+ <tr> >+ <th></th> >+ <th>ID</th> >+ <th>Description</th> >+ <th>Type</th> >+ <th>Amount</th> >+ <th>Outsanding</th> >+ <th>Created on</th> >+ <th>Updated on</th> >+ </tr> >+ </thead> >+ <tbody></tbody> >+ </table> >+ </div> > >- [% IF ( ACCOUNT_LINES ) %] >- <table class="table table-bordered table-striped"> >- <thead> >- <tr> >- <th>Date</th> >- <th>Description</th> >- <th>Fine amount</th> >- <th>Amount outstanding</th> >- </tr> >- </thead> >- >- <tfoot> >- <tr> >- <th class="sum" colspan="3">Total due</th> >- <td class="sum">[% total %]</td> >- </tr> >- </tfoot> >- >- <tbody> >- [% FOREACH ACCOUNT_LINE IN ACCOUNT_LINES %] >- [% IF ( ACCOUNT_LINE.odd ) %]<tr class="highlight">[% ELSE %]<tr>[% END %] >- <td>[% ACCOUNT_LINE.date | $KohaDates %]</td> >- <td>[% ACCOUNT_LINE.description %] >- [% IF ( ACCOUNT_LINE.title ) %][% ACCOUNT_LINE.title |html %][% END %]</td> >- [% IF ( ACCOUNT_LINE.amountcredit ) %]<td class="credit">[% ELSE %]<td class="debit">[% END %][% ACCOUNT_LINE.amount %]</td> >- [% IF ( ACCOUNT_LINE.amountoutstandingcredit ) %]<td class="credit">[% ELSE %]<td class="debit">[% END %][% ACCOUNT_LINE.amountoutstanding %]</td> >- </tr> >- [% END %] >- </tbody> >- >- </table> >+ <div id="account-credits"> >+ <a id="account-credits-switcher" href="#" onclick="return false">View fees</a> >+ <table cellpadding="0" cellspacing="0" border="0" class="display" id="credits-table"> >+ <thead> >+ <tr> >+ <th colspan="99">Payments</th> >+ </tr> >+ <tr> >+ <th></th> >+ <th>ID</th> >+ <th>Notes</th> >+ <th>Type</th> >+ <th>Amount</th> >+ <th>Remaining</th> >+ <th>Created on</th> >+ <th>Updated on</th> >+ </tr> >+ </thead> >+ <tbody></tbody> >+ </table> >+ </div> >+ </div> > [% ELSE %] > <h4>You have no fines or charges</h4> > [% END %] >@@ -67,4 +89,299 @@ > </div> <!-- / .main --> > > [% INCLUDE 'opac-bottom.inc' %] >-[% BLOCK jsinclude %][% END %] >\ No newline at end of file >+[% INCLUDE 'datatables.inc' %] >+ >+<script type="text/javascript"> >+//<![CDATA[ >+$(document).ready(function() { >+ $('#account-credits').hide(); >+ $('#account-debits-switcher').click(function() { >+ $('#account-debits').slideUp(); >+ $('#account-credits').slideDown(); >+ }); >+ $('#account-credits-switcher').click(function() { >+ $('#account-credits').slideUp(); >+ $('#account-debits').slideDown(); >+ }); >+ >+ var anOpen = []; >+ var sImageUrl = "[% interface %]/[% theme %]/images/"; >+ >+ var debitsTable = $('#debits-table').dataTable( { >+ "bProcessing": true, >+ "aoColumns": [ >+ { >+ "mDataProp": null, >+ "sClass": "control center", >+ "sDefaultContent": '<img src="'+sImageUrl+'details_open.png'+'">' >+ }, >+ { "mDataProp": "debit_id" }, >+ { "mDataProp": "description" }, >+ { "mDataProp": "type" }, >+ { "mDataProp": "amount_original" }, >+ { "mDataProp": "amount_outstanding" }, >+ { "mDataProp": "created_on" }, >+ { "mDataProp": "updated_on" } >+ ], >+ "aaData": [ >+ [% FOREACH d IN debits %] >+ { >+ [% PROCESS format_data data=d highlight='debit' %] >+ >+ // Data for related item if there is one linked >+ "title": "[% d.item.biblio.title || d.deleted_item.biblio.title || d.deleted_item.deleted_biblio.title %]", >+ "biblionumber": "[% d.item.biblio.biblionumber || d.deleted_item.biblio.biblionumber %]", >+ "barcode": "[% d.item.barcode || d.deleted_item.barcode %]", >+ "itemnumber": "[% d.item.itemnumber %]", //This way itemnumber will be undef if deleted >+ >+ >+ // Data for related issue if there is one linked >+ [% IF d.issue %] >+ [% SET table = 'issue' %] >+ [% ELSIF d.old_issue %] >+ [% SET table = 'old_issue' %] >+ [% END %] >+ >+ [% IF table %] >+ "issue": { >+ [% PROCESS format_data data=d.$table %] >+ }, >+ [% END %] >+ >+ >+ "account_offsets": [ >+ [% FOREACH ao IN d.account_offsets %] >+ { >+ [% PROCESS format_data data=ao highlight='offset'%] >+ >+ "credit": { >+ [% PROCESS format_data data=ao.credit highlight='credit' %] >+ } >+ }, >+ [% END %] >+ ] >+ >+ }, >+ [% END %] >+ ] >+ } ); >+ >+ $('#debits-table td.control').live( 'click', function () { >+ var nTr = this.parentNode; >+ var i = $.inArray( nTr, anOpen ); >+ >+ if ( i === -1 ) { >+ $('img', this).attr( 'src', sImageUrl+"details_close.png" ); >+ var nDetailsRow = debitsTable.fnOpen( nTr, fnFormatDebitDetails(debitsTable, nTr), 'details' ); >+ $('div.innerDetails', nDetailsRow).slideDown(); >+ anOpen.push( nTr ); >+ } >+ else { >+ $('img', this).attr( 'src', sImageUrl+"details_open.png" ); >+ $('div.innerDetails', $(nTr).next()[0]).slideUp( function () { >+ debitsTable.fnClose( nTr ); >+ anOpen.splice( i, 1 ); >+ } ); >+ } >+ } ); >+ >+ var creditsTable = $('#credits-table').dataTable( { >+ "bProcessing": true, >+ "aoColumns": [ >+ { >+ "mDataProp": null, >+ "sClass": "control center", >+ "sDefaultContent": '<img src="'+sImageUrl+'details_open.png'+'">' >+ }, >+ { "mDataProp": "credit_id" }, >+ { "mDataProp": "notes" }, >+ { "mDataProp": "type" }, >+ { "mDataProp": "amount_paid" }, >+ { "mDataProp": "amount_remaining" }, >+ { "mDataProp": "created_on" }, >+ { "mDataProp": "updated_on" } >+ ], >+ "aaData": [ >+ [% FOREACH c IN credits %] >+ { >+ [% PROCESS format_data data=c highlight='credit' %] >+ >+ "account_offsets": [ >+ [% FOREACH ao IN c.account_offsets %] >+ { >+ [% PROCESS format_data data=ao highlight='offset' %] >+ >+ "debit": { >+ [% PROCESS format_data data=ao.debit highlight='debit' %] >+ } >+ }, >+ [% END %] >+ ] >+ >+ }, >+ [% END %] >+ ] >+ } ); >+ >+ $('#credits-table td.control').live( 'click', function () { >+ var nTr = this.parentNode; >+ var i = $.inArray( nTr, anOpen ); >+ >+ if ( i === -1 ) { >+ $('img', this).attr( 'src', sImageUrl+"details_close.png" ); >+ var nDetailsRow = creditsTable.fnOpen( nTr, fnFormatCreditDetails(creditsTable, nTr), 'details' ); >+ $('div.innerDetails', nDetailsRow).slideDown(); >+ anOpen.push( nTr ); >+ } >+ else { >+ $('img', this).attr( 'src', sImageUrl+"details_open.png" ); >+ $('div.innerDetails', $(nTr).next()[0]).slideUp( function () { >+ creditsTable.fnClose( nTr ); >+ anOpen.splice( i, 1 ); >+ } ); >+ } >+ } ); >+ >+} ); >+ >+function fnFormatDebitDetails( debitsTable, nTr ) { >+ var oData = debitsTable.fnGetData( nTr ); >+ >+ var sOut = "<div class='innerDetails' style='display:none;'>"; >+ >+ var account_offsets = oData.account_offsets; >+ >+ sOut += "<ul>"; >+ if ( oData.title ) { >+ sOut += "<li>" + _("Title: "); >+ if ( oData.biblionumber ) { >+ sOut += "<a href='/cgi-bin/koha/opac-detail.pl?biblionumber=" + oData.biblionumber + "'>"; >+ } >+ >+ sOut += oData.title; >+ >+ if ( oData.biblionumber ) { >+ sOut += "</a>"; >+ } >+ >+ sOut += "</li>"; >+ } >+ >+ if ( oData.barcode ) { >+ sOut += "<li>" + _("Barcode: ") + oData.barcode + "</li>"; >+ } >+ >+ if ( oData.notes ) { >+ sOut += "<li>" + _("Notes: ") + oData.notes + "</li>"; >+ } >+ >+ sOut += "</ul>"; >+ >+ if ( account_offsets.length ) { >+ sOut += >+ "<div class='innerDetails'>" + >+ "<table cellpadding='5' cellspacing='0' border='0' style='margin:10px;'>" + >+ "<thead>" + >+ "<tr><th colspan='99'>" + _("Payments applied") + "</th></tr>" + >+ "<tr>" + >+ "<th>" + _("ID") + "</th>" + >+ "<th>" + _("Created on") + "</th>" + >+ "<th>" + _("Payment amount") + "</th>" + >+ "<th>" + _("Applied amount") + "</th>" + >+ "<th>" + _("Type") + "</th>" + >+ "<th>" + _("Notes") + "</th>" + >+ "</tr>" + >+ "</thead>" + >+ "<tbody>"; >+ >+ for ( var i = 0; i < account_offsets.length; i++ ) { >+ ao = account_offsets[i]; >+ sOut += >+ "<tr>" + >+ "<td>" + ao.credit_id + "</td>" + >+ "<td>" + ao.created_on + "</td>" + >+ "<td>" + ao.credit.amount_paid + "</td>" + >+ "<td>" + ao.amount + "</td>" + >+ "<td>" + ao.credit.type + "</td>" + >+ "<td>" + ao.credit.notes + "</td>" + >+ "</tr>"; >+ } >+ >+ sOut += >+ "</tbody>"+ >+ "</table>"; >+ } >+ >+ sOut += >+ "</div>"; >+ >+ return sOut; >+} >+ >+function fnFormatCreditDetails( creditsTable, nTr ) { >+ var oData = creditsTable.fnGetData( nTr ); >+ >+ var sOut = "<div class="innerDetails" style="display:none;">"; >+ >+ var account_offsets = oData.account_offsets; >+ >+ if ( account_offsets.length ) { >+ sOut += >+ "<table cellpadding='5' cellspacing='0' border='0' style='margin:10px;'>" + >+ "<thead>" + >+ "<tr><th colspan='99'>" + _("Fees paid") + "</th></tr>" + >+ "<tr>" + >+ "<th>" + _("ID") + "</th>" + >+ "<th>" + _("Description") + "</th>" + >+ "<th>" + _("Type") + "</th>" + >+ "<th>" + _("Amount") + "</th>" + >+ "<th>" + _("Remaining") + "</th>" + >+ "<th>" + _("Created on") + "</th>" + >+ "<th>" + _("Updated on") + "</th>" + >+ "<th>" + _("Notes") + "</th>" + >+ "</tr>" + >+ "</thead>" + >+ "<tbody>"; >+ >+ for ( var i = 0; i < account_offsets.length; i++ ) { >+ ao = account_offsets[i]; >+ sOut += >+ "<tr>" + >+ "<td>" + ao.debit.debit_id + "</td>" + >+ "<td>" + ao.debit.description + "</td>" + >+ "<td>" + ao.debit.type + "</td>" + >+ "<td>" + ao.debit.amount_original + "</td>" + >+ "<td>" + ao.debit.amount_outstanding + "</td>" + >+ "<td>" + ao.debit.created_on + "</td>" + >+ "<td>" + ao.debit.updated_on + "</td>" + >+ "<td>" + ao.debit.notes + "</td>" + >+ "</tr>"; >+ } >+ >+ sOut += >+ "</tbody>"+ >+ "</table>"; >+ } >+ >+ sOut += >+ "</div>"; >+ >+ return sOut; >+} >+ >+//]]> >+</script> >+ >+[% BLOCK jsinclude %][% END %] >+ >+[% BLOCK format_data %] >+ [% FOREACH key IN data.result_source.columns %] >+ [% IF key.match('^amount') %] >+ "[% key %]": "[% data.$key FILTER $Currency %]", >+ [% ELSIF key.match('_on$') %] >+ "[% key %]": "[% data.$key | $KohaDates %]", >+ [% ELSE %] >+ "[% key %]": "[% data.$key %]", >+ [% END %] >+ [% END %] >+[% END %] >diff --git a/koha-tmpl/opac-tmpl/bootstrap/images/details_close.png b/koha-tmpl/opac-tmpl/bootstrap/images/details_close.png >new file mode 100644 >index 0000000000000000000000000000000000000000..fcc23c63e22f9883bef72c9e3adae3d5ddfb35cc >GIT binary patch >literal 841 >zcmV-P1GfB$P)<h;3K|Lk000e1NJLTq000yK000yS1^@s6jfou%00004XF*Lt007q5 >z)K6G40000PbVXQnQ*UN;cVTj606}DLVr3vnZDD6+Qe|Oed2z{QJOBU!+et)0RCwB~ >zRZUD&K@grT6<e^<2BXxNUgYOsC0<Bt4}us23L()G;V2>DA_on|3pY;aiIaw_AzX~% >z0wEzG!5U~A62!y<6#_3!Y0@BA($@0c+jVBUFF+~kfo;CbzTKH`cV=g%b|^n=hzi67 >zM5UV3FcF6cUCnu^p}pjrsWm6Ug}98UR-~ZFvWN`g0Fg%+2vP1<MCL$TMcf(~7<d*A >zhi8+?q{cZn2{flQ+9MsM>rl3*$mmwr5rOIH=?}WDABr;u?U4@YDw`9eOu1C&^?L7Z >zY;1fZBc9KT-2A-Q9Uc}tJv}1T-7R)sycF4)8NstzNldzAgSOWc2V?31C|17Z<>j$J >zAke}0_aQSe0l9^R;<1c^#DEC_0!<vD5Y!9~LPc#YEG;d~hC-p&sI^UTwO-OQG&J;} >zzrX)Em?qnMGX}ZE&w!UeCJtN*B%>d$>Do3Jo15TlYl9m;-_3M7y&8+fG<qbPBCP4{ >z?R~-+v*p8K$cDcFH%$rC<VDG8ZmM+-xs??>bP>p=udnZ^^3rY*Ry8&@-XZS}=H{ef >zDUJ>}0_oCdYHA|eDvG0BC2ghK?XIQGd^|3d(Ko2a8<ZPAT3e+oY;8&Da=F}A0hA`T >zOnuWd;BUh;4Eaz@*NbU_ZXd4{Sx%WuX3yjCT&eJS;dde-pZ0t3u1YLb2*-r10&kuC >zM%$mNicFiT%iQ|<`l`Hsd%KE}aRfufjdK;xqP%p!T@uFQ@ipQgE{pKj<mBW>%4c^+ >z2RQuxqA|Bf6p=-Yhg8<rgXi%hN+UisHT6l=w|*kAqtWQwmX?->1x*8ObQBJv5%iB0 >zU9{XrXRDi=!8bAj&V~kvL?Uy+VDJ@gXo|Fa=^duiBKhvUSnKK%G5>85_4~!w&Q6gS >z9~Xt4ozl{)vr6y0nuGJKj&rJgrBbPcMMU#|wJ-Lc4fdkiFZ`>)vh)56_#?mow%h=n >ThIkt{00000NkvXXu0mjfW_^Rc > >literal 0 >HcmV?d00001 > >diff --git a/koha-tmpl/opac-tmpl/bootstrap/images/details_open.png b/koha-tmpl/opac-tmpl/bootstrap/images/details_open.png >new file mode 100644 >index 0000000000000000000000000000000000000000..6f034d0f2d5c7902dce190355b12defdc07d6c9a >GIT binary patch >literal 881 >zcmV-%1CIQOP)<h;3K|Lk000e1NJLTq000yK000yS1^@s6jfou%00004XF*Lt007q5 >z)K6G40000PbVXQnQ*UN;cVTj606}DLVr3vnZDD6+Qe|Oed2z{QJOBU#14%?dRCwB~ >zRozRIQ5b*Tx%`URmR7!^qREsHr4L~=rAQr;^QNxE%fy>P5xVIgh(4gM3Zjdy!n~2N >zjD^FnHQ1(tR(9cJl^-l~RyvtO-;dMt9M4;+6T9$?ALpFs<F|93kMl~9dYBMthy#dp >zv8JIRHV}$f>)Rcr6nirw3t>UzAPx#r5M&8N9I=W>B2)xRbt)puL>xs_c64-H@%#Or >zXf!&j>$*muHOWXvHo`VD#lg6MPE~+#^!N8aRTO1|?J`J5He@S&wvbBVO8K%ZpNm8y >zAIT}HC7Cxi$gY3tW-XzMtU1`kx+go?tM3CWp(Z#n*^&?X9upjrBoaWeDh>vNcO4E# >z)3UM*kH0>GH%mi2IAp}6%}CKyd$<m+mR^J0^gIXz0v@N+c>~2W6jvjYwyv(OhW7UM >zP7O5aPWUzq$A-}#e>#Hw16_xi<P1dCB5>hIJroxfm&IbSiP6!~SxS;g5FTo6ZM`H( >zlIh)&4}38nXc|&$DyX^!-nt?1)(-JKW(QQ%jr|ydxA>>z)7I8@S=`cW5N4N`m!G77 >zdZMpERgp|rK~d3JRsUp;<Xne@3X*%idAPiyqJn(0DUN1QwCPr>HJ6lA@hNmr@UjvF >zT!Ag6;H&rZ+37vY=g+HO_-wIQtVRQvx7QEFj83+*vi=TLQ+cY^m5t3Z!D|~jv(ZlR >zc>I^mX3LW^WSCo>=P5lkaGKBKE#utS*o(YFK~4deqwi1AMVd+U<ytr#o*<<w-^Js$ >z884M5z!-{%A)S!cjdCNGPft&OAPzDy2v>S~dit;|^yb25sIpdZA`Wys(O1dAvo2(I >ziyc~u+*C?>Z*T8&(cem%afeVS6nDGb_L8EKvNL%#5MBx6)#tX<qR#jZs%_P9tL7%i >z*)oibj0|FLKS7R|cq~%4-ePi*J(zsR8eY2C@n?2cia7tGp51$YpG6bV?X8z@wBCL_ >z4q3asI6I!Ng@uKAgNW99JzxL(z-9>j`d$yLwBMhA-vSH(T>k(8(cOU?00000NkvXX >Hu0mjf8E%<j > >literal 0 >HcmV?d00001 > >diff --git a/koha-tmpl/opac-tmpl/prog/en/includes/browser-strings.inc b/koha-tmpl/opac-tmpl/prog/en/includes/browser-strings.inc >new file mode 100644 >index 0000000..f6c74f6 >--- /dev/null >+++ b/koha-tmpl/opac-tmpl/prog/en/includes/browser-strings.inc >@@ -0,0 +1,34 @@ >+[% USE KohaAuthorisedValues %] >+<script type="text/javascript"> >+//<![CDATA[ >+ var BROWSER_RETURN_TO_SEARCH = _("Return to results"); >+ var BROWSER_PREVIOUS = _("Previous"); >+ var BROWSER_NEXT = _("Next"); >+ >+ var STRINGS = { >+ "DebitTypes": { >+ "FINE" : _("Fine"), >+ "ACCOUNT_MANAGEMENT_FEE" : _("Account management fee"), >+ "SUNDRY" : _("Sundry"), >+ "LOST" : _("Lost item"), >+ "HOLD" : _("Hold fee"), >+ "RENTAL" : _("Rental fee"), >+ "NEW_CARD" : _("New card"), >+ [% FOREACH a IN KohaAuthorisedValues.Get('MANUAL_INV') %] >+ "[% a.authorised_value %]" : "[% a.lib %]", >+ [% END %] >+ }, >+ >+ "CreditTypes": { >+ "CREDIT" : _("Credit"), >+ "PAYMENT" : _("Payment"), >+ "WRITEOFF" : _("Writeoff"), >+ "FOUND" : _("Lost item found"), >+ "FORGIVEN" : _("Forgiven"), >+ [% FOREACH a IN KohaAuthorisedValues.Get('MANUAL_CREDIT') %] >+ "[% a.authorised_value %]" : "[% a.lib %]", >+ [% END %] >+ } >+ } >+//]]> >+</script> >diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-account.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-account.tt >index 47169e8..1d693dc 100644 >--- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-account.tt >+++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-account.tt >@@ -1,76 +1,393 @@ >+[% SET accountview = 1 %] >+ > [% USE Koha %] > [% USE KohaDates %] >+[% USE Currency %] > > [% INCLUDE 'doc-head-open.inc' %][% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %] catalog › Your fines and charges > [% INCLUDE 'doc-head-close.inc' %] > </head> > <body id="opac-account"> > <div id="doc3" class="yui-t1"> >- <div id="bd"> >-[% INCLUDE 'masthead.inc' %] >- >+ <div id="bd"> >+ [% INCLUDE 'masthead.inc' %] > <div id="yui-main"> >- <div class="yui-b"><div class="yui-g"> >- <div id="useraccount" class="container"> >-<!--CONTENT--> >- [% FOREACH BORROWER_INF IN BORROWER_INFO %] >- <h3><a href="/cgi-bin/koha/opac-user.pl">[% BORROWER_INF.firstname %] [% BORROWER_INF.surname %]'s account</a> ⇢ Fines and charges</h3> >- [% END %] >+ <div class="yui-b"> >+ <div class="yui-g"> >+ <div id="useraccount" class="container"> >+ <h3><a href="/cgi-bin/koha/opac-user.pl">[% borrower.firstname %] [% borrower.surname %]'s account</a> ⇢ Fines and charges</h3> > >- [% IF ( ACCOUNT_LINES ) %] >- <table> >- <thead> >- <tr> >- <th>Date</th> >- <th>Description</th> >- <th>Fine amount</th> >- <th>Amount outstanding</th> >- </tr> >- </thead> >- >- <tfoot> >- <tr> >- <th class="sum" colspan="3">Total due</th> >- <td class="sum">[% total %]</td> >- </tr> >- </tfoot> >- >- <tbody> >- [% FOREACH ACCOUNT_LINE IN ACCOUNT_LINES %] >- [% IF ( ACCOUNT_LINE.odd ) %]<tr class="highlight">[% ELSE %]<tr>[% END %] >- <td>[% ACCOUNT_LINE.date | $KohaDates %]</td> >- <td> >- [% SWITCH ACCOUNT_LINE.accounttype %] >- [% CASE 'Pay' %]Payment,thanks >- [% CASE 'N' %]New Card >- [% CASE 'F' %]Fine >- [% CASE 'A' %]Account management fee >- [% CASE 'M' %]Sundry >- [% CASE 'L' %]Lost Item >- [% CASE 'W' %]Writeoff >- [% CASE %][% ACCOUNT_LINE.accounttype %] >- [%- END -%] >- [%- IF ACCOUNT_LINE.description %], [% ACCOUNT_LINE.description %][% END %] >- [% IF line.title %]([% line.title |html_entity %])[% END %] >- </td> >- [% IF ( ACCOUNT_LINE.amountcredit ) %]<td class="credit">[% ELSE %]<td class="debit">[% END %][% ACCOUNT_LINE.amount %]</td> >- [% IF ( ACCOUNT_LINE.amountoutstandingcredit ) %]<td class="credit">[% ELSE %]<td class="debit">[% END %][% ACCOUNT_LINE.amountoutstanding %]</td> >- </tr> >- [% END %] >- </tbody> >- >- </table> >- [% ELSE %] >- <h4>You have no fines or charges</h4> >- [% END %] >-</div> >-</div> >-</div> >-</div> >-<div class="yui-b"> >-<div id="leftmenus" class="container"> >-[% INCLUDE 'navigation.inc' IsPatronPage=1 %] >-</div> >-</div> >+ [% IF credits || debits %] >+ >+ <p> >+ <h3>Account balance: [% borrower.account_balance | $Currency %]</h3> >+ </p> >+ >+ <div> >+ <div id="account-debits"> >+ <a id="account-debits-switcher" href="#" onclick="return false">View payments</a> >+ <table cellpadding="0" cellspacing="0" border="0" class="display" id="debits-table"> >+ <thead> >+ <tr> >+ <th colspan="99">Fees</th> >+ </tr> >+ <tr> >+ <th></th> >+ <th>ID</th> >+ <th>Description</th> >+ <th>Type</th> >+ <th>Amount</th> >+ <th>Outsanding</th> >+ <th>Created on</th> >+ <th>Updated on</th> >+ </tr> >+ </thead> >+ <tbody></tbody> >+ </table> >+ </div> >+ >+ <div id="account-credits"> >+ <a id="account-credits-switcher" href="#" onclick="return false">View fees</a> >+ <table cellpadding="0" cellspacing="0" border="0" class="display" id="credits-table"> >+ <thead> >+ <tr> >+ <th colspan="99">Payments</th> >+ </tr> >+ <tr> >+ <th></th> >+ <th>ID</th> >+ <th>Notes</th> >+ <th>Type</th> >+ <th>Amount</th> >+ <th>Remaining</th> >+ <th>Created on</th> >+ <th>Updated on</th> >+ </tr> >+ </thead> >+ <tbody></tbody> >+ </table> >+ </div> >+ </div> >+ [% ELSE %] >+ <h4>You have no fines or charges</h4> >+ [% END %] >+ </div> >+ </div> >+ </div> >+ </div> >+ >+ <div class="yui-b"> >+ <div id="leftmenus" class="container"> >+ [% INCLUDE 'navigation.inc' IsPatronPage=1 %] >+ </div> >+ </div> > </div> > [% INCLUDE 'opac-bottom.inc' %] >+ >+[% INCLUDE 'datatables.inc' %] >+[% INCLUDE 'browser-strings.inc' %] >+ >+<script type="text/javascript"> >+//<![CDATA[ >+$(document).ready(function() { >+ $('#account-credits').hide(); >+ $('#account-debits-switcher').click(function() { >+ $('#account-debits').slideUp(); >+ $('#account-credits').slideDown(); >+ }); >+ $('#account-credits-switcher').click(function() { >+ $('#account-credits').slideUp(); >+ $('#account-debits').slideDown(); >+ }); >+ >+ var anOpen = []; >+ var sImageUrl = "[% interface %]/[% theme %]/images/"; >+ >+ var debitsTable = $('#debits-table').dataTable( { >+ "bProcessing": true, >+ "aoColumns": [ >+ { >+ "mDataProp": null, >+ "sClass": "control center", >+ "sDefaultContent": '<img src="'+sImageUrl+'details_open.png'+'">' >+ }, >+ { "mDataProp": "debit_id" }, >+ { "mDataProp": "description" }, >+ { >+ "mDataProp": "type", >+ "fnRender": function ( o, val ) { >+ return STRINGS['DebitTypes'][val]; >+ }, >+ }, >+ { "mDataProp": "amount_original" }, >+ { "mDataProp": "amount_outstanding" }, >+ { "mDataProp": "created_on" }, >+ { "mDataProp": "updated_on" } >+ ], >+ "aaData": [ >+ [% FOREACH d IN debits %] >+ { >+ [% PROCESS format_data data=d highlight='debit' %] >+ >+ // Data for related item if there is one linked >+ "title": "[% d.item.biblio.title || d.deleted_item.biblio.title || d.deleted_item.deleted_biblio.title %]", >+ "biblionumber": "[% d.item.biblio.biblionumber || d.deleted_item.biblio.biblionumber %]", >+ "barcode": "[% d.item.barcode || d.deleted_item.barcode %]", >+ "itemnumber": "[% d.item.itemnumber %]", //This way itemnumber will be undef if deleted >+ >+ >+ // Data for related issue if there is one linked >+ [% IF d.issue %] >+ [% SET table = 'issue' %] >+ [% ELSIF d.old_issue %] >+ [% SET table = 'old_issue' %] >+ [% END %] >+ >+ [% IF table %] >+ "issue": { >+ [% PROCESS format_data data=d.$table %] >+ }, >+ [% END %] >+ >+ >+ "account_offsets": [ >+ [% FOREACH ao IN d.account_offsets %] >+ { >+ [% PROCESS format_data data=ao highlight='offset'%] >+ >+ "credit": { >+ [% PROCESS format_data data=ao.credit highlight='credit' %] >+ } >+ }, >+ [% END %] >+ ] >+ >+ }, >+ [% END %] >+ ] >+ } ); >+ >+ $('#debits-table td.control').live( 'click', function () { >+ var nTr = this.parentNode; >+ var i = $.inArray( nTr, anOpen ); >+ >+ if ( i === -1 ) { >+ $('img', this).attr( 'src', sImageUrl+"details_close.png" ); >+ var nDetailsRow = debitsTable.fnOpen( nTr, fnFormatDebitDetails(debitsTable, nTr), 'details' ); >+ $('div.innerDetails', nDetailsRow).slideDown(); >+ anOpen.push( nTr ); >+ } >+ else { >+ $('img', this).attr( 'src', sImageUrl+"details_open.png" ); >+ $('div.innerDetails', $(nTr).next()[0]).slideUp( function () { >+ debitsTable.fnClose( nTr ); >+ anOpen.splice( i, 1 ); >+ } ); >+ } >+ } ); >+ >+ var creditsTable = $('#credits-table').dataTable( { >+ "bProcessing": true, >+ "aoColumns": [ >+ { >+ "mDataProp": null, >+ "sClass": "control center", >+ "sDefaultContent": '<img src="'+sImageUrl+'details_open.png'+'">' >+ }, >+ { "mDataProp": "credit_id" }, >+ { "mDataProp": "notes" }, >+ { >+ "mDataProp": "type", >+ "fnRender": function ( o, val ) { >+ return STRINGS['CreditTypes'][val]; >+ }, >+ }, >+ { "mDataProp": "amount_paid" }, >+ { "mDataProp": "amount_remaining" }, >+ { "mDataProp": "created_on" }, >+ { "mDataProp": "updated_on" } >+ ], >+ "aaData": [ >+ [% FOREACH c IN credits %] >+ { >+ [% PROCESS format_data data=c highlight='credit' %] >+ >+ "account_offsets": [ >+ [% FOREACH ao IN c.account_offsets %] >+ { >+ [% PROCESS format_data data=ao highlight='offset' %] >+ >+ "debit": { >+ [% PROCESS format_data data=ao.debit highlight='debit' %] >+ } >+ }, >+ [% END %] >+ ] >+ >+ }, >+ [% END %] >+ ] >+ } ); >+ >+ $('#credits-table td.control').live( 'click', function () { >+ var nTr = this.parentNode; >+ var i = $.inArray( nTr, anOpen ); >+ >+ if ( i === -1 ) { >+ $('img', this).attr( 'src', sImageUrl+"details_close.png" ); >+ var nDetailsRow = creditsTable.fnOpen( nTr, fnFormatCreditDetails(creditsTable, nTr), 'details' ); >+ $('div.innerDetails', nDetailsRow).slideDown(); >+ anOpen.push( nTr ); >+ } >+ else { >+ $('img', this).attr( 'src', sImageUrl+"details_open.png" ); >+ $('div.innerDetails', $(nTr).next()[0]).slideUp( function () { >+ creditsTable.fnClose( nTr ); >+ anOpen.splice( i, 1 ); >+ } ); >+ } >+ } ); >+ >+} ); >+ >+function fnFormatDebitDetails( debitsTable, nTr ) { >+ var oData = debitsTable.fnGetData( nTr ); >+ >+ var sOut = "<div class='innerDetails' style='display:none;'>"; >+ >+ var account_offsets = oData.account_offsets; >+ >+ sOut += "<ul>"; >+ if ( oData.title ) { >+ sOut += "<li>" + _("Title: "); >+ if ( oData.biblionumber ) { >+ sOut += "<a href='/cgi-bin/koha/opac-detail.pl?biblionumber=" + oData.biblionumber + "'>"; >+ } >+ >+ sOut += oData.title; >+ >+ if ( oData.biblionumber ) { >+ sOut += "</a>"; >+ } >+ >+ sOut += "</li>"; >+ } >+ >+ if ( oData.barcode ) { >+ sOut += "<li>" + _("Barcode: ") + oData.barcode + "</li>"; >+ } >+ >+ if ( oData.notes ) { >+ sOut += "<li>" + _("Notes: ") + oData.notes + "</li>"; >+ } >+ >+ sOut += "</ul>"; >+ >+ if ( account_offsets.length ) { >+ sOut += >+ "<div class='innerDetails'>" + >+ "<table cellpadding='5' cellspacing='0' border='0' style='margin:10px;'>" + >+ "<thead>" + >+ "<tr><th colspan='99'>" + _("Payments applied") + "</th></tr>" + >+ "<tr>" + >+ "<th>" + _("ID") + "</th>" + >+ "<th>" + _("Created on") + "</th>" + >+ "<th>" + _("Payment amount") + "</th>" + >+ "<th>" + _("Applied amount") + "</th>" + >+ "<th>" + _("Type") + "</th>" + >+ "<th>" + _("Notes") + "</th>" + >+ "</tr>" + >+ "</thead>" + >+ "<tbody>"; >+ >+ for ( var i = 0; i < account_offsets.length; i++ ) { >+ ao = account_offsets[i]; >+ sOut += >+ "<tr>" + >+ "<td>" + ao.credit_id + "</td>" + >+ "<td>" + ao.created_on + "</td>" + >+ "<td>" + ao.credit.amount_paid + "</td>" + >+ "<td>" + ao.amount + "</td>" + >+ "<td>" + ao.credit.type + "</td>" + >+ "<td>" + ao.credit.notes + "</td>" + >+ "</tr>"; >+ } >+ >+ sOut += >+ "</tbody>"+ >+ "</table>"; >+ } >+ >+ sOut += >+ "</div>"; >+ >+ return sOut; >+} >+ >+function fnFormatCreditDetails( creditsTable, nTr ) { >+ var oData = creditsTable.fnGetData( nTr ); >+ >+ var sOut = '<div class="innerDetails" style="display:none;">'; >+ >+ var account_offsets = oData.account_offsets; >+ >+ if ( account_offsets.length ) { >+ sOut += >+ "<table cellpadding='5' cellspacing='0' border='0' style='margin:10px;'>" + >+ "<thead>" + >+ "<tr><th colspan='99'>" + _("Fees paid") + "</th></tr>" + >+ "<tr>" + >+ "<th>" + _("ID") + "</th>" + >+ "<th>" + _("Description") + "</th>" + >+ "<th>" + _("Type") + "</th>" + >+ "<th>" + _("Amount") + "</th>" + >+ "<th>" + _("Remaining") + "</th>" + >+ "<th>" + _("Created on") + "</th>" + >+ "<th>" + _("Updated on") + "</th>" + >+ "<th>" + _("Notes") + "</th>" + >+ "</tr>" + >+ "</thead>" + >+ "<tbody>"; >+ >+ for ( var i = 0; i < account_offsets.length; i++ ) { >+ ao = account_offsets[i]; >+ sOut += >+ "<tr>" + >+ "<td>" + ao.debit.debit_id + "</td>" + >+ "<td>" + ao.debit.description + "</td>" + >+ "<td>" + ao.debit.type + "</td>" + >+ "<td>" + ao.debit.amount_original + "</td>" + >+ "<td>" + ao.debit.amount_outstanding + "</td>" + >+ "<td>" + ao.debit.created_on + "</td>" + >+ "<td>" + ao.debit.updated_on + "</td>" + >+ "<td>" + ao.debit.notes + "</td>" + >+ "</tr>"; >+ } >+ >+ sOut += >+ "</tbody>"+ >+ "</table>"; >+ } >+ >+ sOut += >+ "</div>"; >+ >+ return sOut; >+} >+ >+//]]> >+</script> >+ >+[% BLOCK jsinclude %][% END %] >+ >+[% BLOCK format_data %] >+ [% FOREACH key IN data.result_source.columns %] >+ [% IF key.match('^amount') %] >+ "[% key %]": "[% data.$key FILTER $Currency %]", >+ [% ELSIF key.match('_on$') %] >+ "[% key %]": "[% data.$key | $KohaDates %]", >+ [% ELSE %] >+ "[% key %]": "[% data.$key %]", >+ [% END %] >+ [% END %] >+[% END %] >diff --git a/koha-tmpl/opac-tmpl/prog/images/details_close.png b/koha-tmpl/opac-tmpl/prog/images/details_close.png >new file mode 100644 >index 0000000000000000000000000000000000000000..fcc23c63e22f9883bef72c9e3adae3d5ddfb35cc >GIT binary patch >literal 841 >zcmV-P1GfB$P)<h;3K|Lk000e1NJLTq000yK000yS1^@s6jfou%00004XF*Lt007q5 >z)K6G40000PbVXQnQ*UN;cVTj606}DLVr3vnZDD6+Qe|Oed2z{QJOBU!+et)0RCwB~ >zRZUD&K@grT6<e^<2BXxNUgYOsC0<Bt4}us23L()G;V2>DA_on|3pY;aiIaw_AzX~% >z0wEzG!5U~A62!y<6#_3!Y0@BA($@0c+jVBUFF+~kfo;CbzTKH`cV=g%b|^n=hzi67 >zM5UV3FcF6cUCnu^p}pjrsWm6Ug}98UR-~ZFvWN`g0Fg%+2vP1<MCL$TMcf(~7<d*A >zhi8+?q{cZn2{flQ+9MsM>rl3*$mmwr5rOIH=?}WDABr;u?U4@YDw`9eOu1C&^?L7Z >zY;1fZBc9KT-2A-Q9Uc}tJv}1T-7R)sycF4)8NstzNldzAgSOWc2V?31C|17Z<>j$J >zAke}0_aQSe0l9^R;<1c^#DEC_0!<vD5Y!9~LPc#YEG;d~hC-p&sI^UTwO-OQG&J;} >zzrX)Em?qnMGX}ZE&w!UeCJtN*B%>d$>Do3Jo15TlYl9m;-_3M7y&8+fG<qbPBCP4{ >z?R~-+v*p8K$cDcFH%$rC<VDG8ZmM+-xs??>bP>p=udnZ^^3rY*Ry8&@-XZS}=H{ef >zDUJ>}0_oCdYHA|eDvG0BC2ghK?XIQGd^|3d(Ko2a8<ZPAT3e+oY;8&Da=F}A0hA`T >zOnuWd;BUh;4Eaz@*NbU_ZXd4{Sx%WuX3yjCT&eJS;dde-pZ0t3u1YLb2*-r10&kuC >zM%$mNicFiT%iQ|<`l`Hsd%KE}aRfufjdK;xqP%p!T@uFQ@ipQgE{pKj<mBW>%4c^+ >z2RQuxqA|Bf6p=-Yhg8<rgXi%hN+UisHT6l=w|*kAqtWQwmX?->1x*8ObQBJv5%iB0 >zU9{XrXRDi=!8bAj&V~kvL?Uy+VDJ@gXo|Fa=^duiBKhvUSnKK%G5>85_4~!w&Q6gS >z9~Xt4ozl{)vr6y0nuGJKj&rJgrBbPcMMU#|wJ-Lc4fdkiFZ`>)vh)56_#?mow%h=n >ThIkt{00000NkvXXu0mjfW_^Rc > >literal 0 >HcmV?d00001 > >diff --git a/koha-tmpl/opac-tmpl/prog/images/details_open.png b/koha-tmpl/opac-tmpl/prog/images/details_open.png >new file mode 100644 >index 0000000000000000000000000000000000000000..6f034d0f2d5c7902dce190355b12defdc07d6c9a >GIT binary patch >literal 881 >zcmV-%1CIQOP)<h;3K|Lk000e1NJLTq000yK000yS1^@s6jfou%00004XF*Lt007q5 >z)K6G40000PbVXQnQ*UN;cVTj606}DLVr3vnZDD6+Qe|Oed2z{QJOBU#14%?dRCwB~ >zRozRIQ5b*Tx%`URmR7!^qREsHr4L~=rAQr;^QNxE%fy>P5xVIgh(4gM3Zjdy!n~2N >zjD^FnHQ1(tR(9cJl^-l~RyvtO-;dMt9M4;+6T9$?ALpFs<F|93kMl~9dYBMthy#dp >zv8JIRHV}$f>)Rcr6nirw3t>UzAPx#r5M&8N9I=W>B2)xRbt)puL>xs_c64-H@%#Or >zXf!&j>$*muHOWXvHo`VD#lg6MPE~+#^!N8aRTO1|?J`J5He@S&wvbBVO8K%ZpNm8y >zAIT}HC7Cxi$gY3tW-XzMtU1`kx+go?tM3CWp(Z#n*^&?X9upjrBoaWeDh>vNcO4E# >z)3UM*kH0>GH%mi2IAp}6%}CKyd$<m+mR^J0^gIXz0v@N+c>~2W6jvjYwyv(OhW7UM >zP7O5aPWUzq$A-}#e>#Hw16_xi<P1dCB5>hIJroxfm&IbSiP6!~SxS;g5FTo6ZM`H( >zlIh)&4}38nXc|&$DyX^!-nt?1)(-JKW(QQ%jr|ydxA>>z)7I8@S=`cW5N4N`m!G77 >zdZMpERgp|rK~d3JRsUp;<Xne@3X*%idAPiyqJn(0DUN1QwCPr>HJ6lA@hNmr@UjvF >zT!Ag6;H&rZ+37vY=g+HO_-wIQtVRQvx7QEFj83+*vi=TLQ+cY^m5t3Z!D|~jv(ZlR >zc>I^mX3LW^WSCo>=P5lkaGKBKE#utS*o(YFK~4deqwi1AMVd+U<ytr#o*<<w-^Js$ >z884M5z!-{%A)S!cjdCNGPft&OAPzDy2v>S~dit;|^yb25sIpdZA`Wys(O1dAvo2(I >ziyc~u+*C?>Z*T8&(cem%afeVS6nDGb_L8EKvNL%#5MBx6)#tX<qR#jZs%_P9tL7%i >z*)oibj0|FLKS7R|cq~%4-ePi*J(zsR8eY2C@n?2cia7tGp51$YpG6bV?X8z@wBCL_ >z4q3asI6I!Ng@uKAgNW99JzxL(z-9>j`d$yLwBMhA-vSH(T>k(8(cOU?00000NkvXX >Hu0mjf8E%<j > >literal 0 >HcmV?d00001 > >diff --git a/opac/opac-account.pl b/opac/opac-account.pl >index c3cb9b4..4ff1554 100755 >--- a/opac/opac-account.pl >+++ b/opac/opac-account.pl >@@ -18,7 +18,6 @@ > # with Koha; if not, write to the Free Software Foundation, Inc., > # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. > >- > use strict; > use CGI; > use C4::Members; >@@ -30,7 +29,7 @@ use warnings; > my $query = new CGI; > my ( $template, $borrowernumber, $cookie ) = get_template_and_user( > { >- template_name => "opac-account.tmpl", >+ template_name => "opac-account.tt", > query => $query, > type => "opac", > authnotrequired => 0, >@@ -39,40 +38,21 @@ my ( $template, $borrowernumber, $cookie ) = get_template_and_user( > } > ); > >-# get borrower information .... >-my $borr = GetMemberDetails( $borrowernumber ); >-my @bordat; >-$bordat[0] = $borr; >- >-$template->param( BORROWER_INFO => \@bordat ); >- >-#get account details >-my ( $total , $accts, $numaccts) = GetMemberAccountRecords( $borrowernumber ); >- >-for ( my $i = 0 ; $i < $numaccts ; $i++ ) { >- $accts->[$i]{'amount'} = sprintf( "%.2f", $accts->[$i]{'amount'} || '0.00'); >- if ( $accts->[$i]{'amount'} >= 0 ) { >- $accts->[$i]{'amountcredit'} = 1; >- } >- $accts->[$i]{'amountoutstanding'} = >- sprintf( "%.2f", $accts->[$i]{'amountoutstanding'} || '0.00' ); >- if ( $accts->[$i]{'amountoutstanding'} >= 0 ) { >- $accts->[$i]{'amountoutstandingcredit'} = 1; >- } >-} >+my @debits = Koha::Database->new()->schema->resultset('AccountDebit')->search( >+ { 'me.borrowernumber' => $borrowernumber }, >+ { prefetch => { account_offsets => 'credit' } } >+); > >-# add the row parity >-my $num = 0; >-foreach my $row (@$accts) { >- $row->{'even'} = 1 if $num % 2 == 0; >- $row->{'odd'} = 1 if $num % 2 == 1; >- $num++; >-} >+my @credits = Koha::Database->new()->schema->resultset('AccountCredit')->search( >+ { 'me.borrowernumber' => $borrowernumber }, >+ { prefetch => { account_offsets => 'debit' } } >+); > >-$template->param ( >- ACCOUNT_LINES => $accts, >- total => sprintf( "%.2f", $total ), >- accountview => 1 >+$template->param( >+ borrower => GetMemberDetails($borrowernumber), >+ debits => \@debits, >+ credits => \@credits, >+ accountview => 1 > ); > > output_html_with_http_headers $query, $cookie, $template->output; >diff --git a/opac/opac-user.pl b/opac/opac-user.pl >index 02002a3..3754dc9 100755 >--- a/opac/opac-user.pl >+++ b/opac/opac-user.pl >@@ -162,19 +162,7 @@ if ($issues){ > $issue->{'reserved'} = 1; > } > >- my ( $total , $accts, $numaccts) = GetMemberAccountRecords( $borrowernumber ); >- my $charges = 0; >- foreach my $ac (@$accts) { >- if ( $ac->{'itemnumber'} == $issue->{'itemnumber'} ) { >- $charges += $ac->{'amountoutstanding'} >- if $ac->{'accounttype'} eq 'F'; >- $charges += $ac->{'amountoutstanding'} >- if $ac->{'accounttype'} eq 'FU'; >- $charges += $ac->{'amountoutstanding'} >- if $ac->{'accounttype'} eq 'L'; >- } >- } >- $issue->{'charges'} = $charges; >+ $issue->{'charges'} = $borr->{account_balance}; > $issue->{'subtitle'} = GetRecordValue('subtitle', GetMarcBiblio($issue->{'biblionumber'}), GetFrameworkCode($issue->{'biblionumber'})); > # check if item is renewable > my ($status,$renewerror) = CanBookBeRenewed( $borrowernumber, $issue->{'itemnumber'} ); >-- >1.7.2.5
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 6427
:
21922
|
22704
|
22705
|
22708
|
22709
|
22710
|
22741
|
22870
|
22871
|
22872
|
22873
|
22874
|
22875
|
22876
|
22881
|
22889
|
22940
|
22948
|
22949
|
22995
|
23000
|
23137
|
23158
|
23161
|
23171
|
23186
|
23269
|
23275
|
23276
|
23391
|
23392
|
23400
|
23401
|
23402
|
23403
|
23404
|
23405
|
23406
|
23407
|
23408
|
23409
|
23410
|
23411
|
23412
|
23413
|
23420
|
23421
|
23422
|
23423
|
23424
|
23425
|
23426
|
23427
|
23428
|
23429
|
23430
|
23431
|
23432
|
23433
|
23440
|
23441
|
23442
|
23443
|
23444
|
23445
|
23446
|
23447
|
23448
|
23449
|
23450
|
23451
|
23452
|
23453
|
23454
|
23458
|
23459
|
23460
|
23461
|
23462
|
23463
|
23464
|
23465
|
23466
|
23467
|
23468
|
23469
|
23470
|
23471
|
23603
|
23643
|
23644
|
23645
|
23646
|
23647
|
23648
|
23649
|
23650
|
23651
|
23652
|
23653
|
23654
|
23655
|
23656
|
23657
|
23937
|
23938
|
23939
|
23940
|
23941
|
23942
|
23943
|
23944
|
23945
|
23946
|
23947
|
23948
|
23949
|
23950
|
23951
|
24612
|
24613
|
24614
|
24615
|
24616
|
24617
|
24618
|
24619
|
24620
|
24621
|
24622
|
24623
|
24624
|
24625
|
24626
|
24627
|
24628
|
24757
|
24758
|
24759
|
24760
|
24761
|
24762
|
24763
|
24764
|
24765
|
24766
|
24767
|
24768
|
24769
|
24770
|
24771
|
24772
|
24777
|
24792
|
24793
|
24794
|
24795
|
24796
|
24797
|
24798
|
24799
|
24800
|
24801
|
24802
|
24803
|
24804
|
24805
|
24806
|
24807
|
24808
|
24809
|
24810
|
24811
|
24812
|
24813
|
24814
|
24815
|
24816
|
24817
|
24818
|
24819
|
24820
|
24821
|
24822
|
24823
|
24824
|
24825
|
24826
|
24827
|
24828
|
24829
|
24830
|
24831
|
24832
|
24833
|
24834
|
24835
|
24836
|
24837
|
24838
|
24839
|
24840
|
24841
|
24842
|
24843
|
24844
|
25777
|
25778
|
25779
|
25780
|
25781
|
25782
|
25783
|
25784
|
25785
|
25786
|
25787
|
25788
|
25789
|
25790
|
25791
|
25792
|
25793
|
25794
|
25795
|
25796
|
25797
|
25798
|
25799
|
25800
|
25801
|
25802
|
25803
|
25804
|
25805
|
25806
|
25807
|
25808
|
25809
|
25810
|
25811
|
25812
|
25813
|
25814
|
25815
|
25816
|
25930
|
25932
|
25933
|
25934
|
26033
|
26034
|
26035
|
26036
|
26107
|
27167
|
27168
|
27169
|
27170
|
27171
|
27172
|
27173
|
27174
|
27175
|
27176
|
27177
|
27178
|
27179
|
27180
|
27181
|
27182
|
27183
|
27184
|
27185
|
27186
|
27187
|
27189
|
27190
|
27197
|
28067
|
28068
|
28069
|
28070
|
28071
|
28072
|
28073
|
28074
|
28075
|
28076
|
28077
|
28078
|
28079
|
28080
|
28081
|
28082
|
28083
|
28084
|
28085
|
28086
|
28087
|
28088
|
28089
|
28090
|
28091
|
28527
|
28528
|
28529
|
28530
|
28531
|
28532
|
28533
|
28534
|
28535
|
28536
|
28537
|
28538
|
28539
|
28540
|
28541
|
28542
|
28543
|
28544
|
28545
|
28546
|
28547
|
28548
|
28549
|
28550
|
28551
|
28552
|
28553
|
28555
|
28556
|
28561
|
28563
|
28564
|
28795
|
28796
|
28797
|
28798
|
28799
|
28800
|
28801
|
28802
|
28803
|
28804
|
28805
|
28806
|
28807
|
28808
|
28809
|
28810
|
28811
|
28812
|
28813
|
28814
|
28815
|
28816
|
28817
|
28818
|
28819
|
28820
|
28821
|
28822
|
28887
|
28888
|
28889
|
28890
|
28909
|
29176
|
29230
|
29231
|
29232
|
29233
|
29234
|
29235
|
29236
|
29237
|
29238
|
29239
|
29240
|
29241
|
29242
|
29243
|
29244
|
29245
|
29246
|
29247
|
29248
|
29249
|
29250
|
29251
|
29252
|
29253
|
29254
|
29255
|
29256
|
29257
|
29258
|
29259
|
29260
|
29261
|
29262
|
29263
|
29264
|
29265
|
29706
|
29707
|
29708
|
29709
|
29710
|
29711
|
29712
|
29713
|
29714
|
29715
|
29716
|
29717
|
29719
|
29720
|
29721
|
29722
|
29723
|
29724
|
29725
|
29726
|
29727
|
29728
|
29729
|
29730
|
30271
|
30272
|
30273
|
30274
|
30275
|
30276
|
30277
|
30278
|
30279
|
30280
|
30281
|
30282
|
30320
|
30321
|
30322
|
30323
|
30324
|
30325
|
30326
|
30327
|
30328
|
30329
|
30330
|
30331
|
30416
|
30417
|
30418
|
30419
|
30420
|
30421
|
30422
|
30423
|
30424
|
30425
|
30426
|
30427
|
31477
|
31478
|
31479
|
31480
|
31481
|
31482
|
31483
|
31484
|
31485
|
31486
|
31487
|
31488
|
31754
|
31755
|
31756
|
31757
|
31758
|
31759
|
31760
|
31761
|
31762
|
31763
|
31764
|
31765
|
31766
|
31767
|
31768
|
31769
|
31770
|
31771
|
31772
|
31773
|
31774
|
31775
|
31776
|
31777
|
32478
|
32479
|
32480
|
32481
|
32482
|
32483
|
32484
|
32485
|
32486
|
32487
|
32488
|
32489
|
32591
|
32592
|
32593
|
32594
|
32595
|
32596
|
32597
|
32598
|
32599
|
32600
|
32601
|
32602
|
32827
|
32828
|
32829
|
32830
|
32831
|
32832
|
32833
|
32834
|
32835
|
32836
|
32837
|
32838
|
33251
|
33252
|
33253
|
33254
|
33255
|
33256
|
33257
|
33258
|
33259
|
33260
|
33261
|
33262
|
34096
|
34097
|
34098
|
34099
|
34100
|
34101
|
34102
|
34103
|
34104
|
34105
|
34106
|
34107
|
34204
|
34205
|
34206
|
34207
|
34208
|
34209
|
34210
|
34211
|
34212
|
34213
|
34214
|
34215
|
35196
|
35197
|
35198
|
35199
|
35200
|
35201
|
35202
|
35203
|
35204
|
35205
|
35206
|
35207
|
35208
|
35302
|
36324
|
36326
|
36327
|
36328
|
36329
|
36330
|
36331
|
36332
|
36333
|
36334
|
36335
|
36337
|
36338
|
36340
|
36380
|
36391
|
36393
|
37127
|
37128
|
37129
|
37130
|
37131
|
37133
|
37134
|
37135
|
37136
|
37137
|
37138
|
37139
|
37140
|
37141
|
37142
|
37143
|
37147
|
37148
|
37149
|
37150
|
37151
|
37152
|
37153
|
37154
|
37155
|
37156
|
37157
|
37158
|
37159
|
37160
|
37161
|
37162
|
37229
|
37230
|
37231
|
37232
|
37233
|
37234
|
37235
|
37236
|
37237
|
37238
|
37239
|
37240
|
37241
|
37242
|
37243
|
37244
|
38247
|
38248
|
38249
|
38250
|
38251
|
38252
|
38253
|
38254
|
38255
|
38256
|
38257
|
38258
|
38259
|
38260
|
38261
|
38262
|
39063
|
39064
|
39065
|
39066
|
39067
|
39069
|
39070
|
39071
|
39072
|
39073
|
39074
|
39075
|
39076
|
39077
|
39078
|
39079
|
39671
|
39672
|
39673
|
39674
|
39675
|
39676
|
39677
|
39678
|
39679
|
39680
|
39681
|
39682
|
39683
|
39684
|
39685
|
39686