Bugzilla – Attachment 31772 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 - Add new staff scripts for managing accounts
Bug-6427---Add-new-staff-scripts-for-managing-acco.patch (text/plain), 78.83 KB, created by
Kyle M Hall (khall)
on 2014-09-19 16:56:31 UTC
(
hide
)
Description:
Bug 6427 - Add new staff scripts for managing accounts
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2014-09-19 16:56:31 UTC
Size:
78.83 KB
patch
obsolete
>From c43b8ab9025efed3b2dfcda8a701534c5ca02d6a Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Tue, 15 Jul 2014 10:49:18 -0400 >Subject: [PATCH] Bug 6427 - Add new staff scripts for managing accounts > >--- > .../prog/en/modules/members/account.tt | 518 ++++++++++++++++++++ > .../prog/en/modules/members/account_credit.tt | 97 ++++ > .../prog/en/modules/members/account_debit.tt | 114 +++++ > .../prog/en/modules/members/account_payment.tt | 246 ++++++++++ > .../prog/en/modules/members/account_print.tt | 146 ++++++ > koha-tmpl/intranet-tmpl/prog/img/details_close.png | Bin 0 -> 841 bytes > koha-tmpl/intranet-tmpl/prog/img/details_open.png | Bin 0 -> 881 bytes > members/account.pl | 118 +++++ > members/account_credit.pl | 103 ++++ > members/account_credit_do.pl | 66 +++ > members/account_debit.pl | 104 ++++ > members/account_debit_do.pl | 69 +++ > members/account_payment.pl | 123 +++++ > members/account_payment_do.pl | 66 +++ > members/account_print.pl | 60 +++ > members/account_void.pl | 38 ++ > 16 files changed, 1868 insertions(+), 0 deletions(-) > create mode 100644 koha-tmpl/intranet-tmpl/prog/en/modules/members/account.tt > create mode 100644 koha-tmpl/intranet-tmpl/prog/en/modules/members/account_credit.tt > create mode 100644 koha-tmpl/intranet-tmpl/prog/en/modules/members/account_debit.tt > create mode 100644 koha-tmpl/intranet-tmpl/prog/en/modules/members/account_payment.tt > create mode 100644 koha-tmpl/intranet-tmpl/prog/en/modules/members/account_print.tt > create mode 100644 koha-tmpl/intranet-tmpl/prog/img/details_close.png > create mode 100644 koha-tmpl/intranet-tmpl/prog/img/details_open.png > create mode 100755 members/account.pl > create mode 100755 members/account_credit.pl > create mode 100755 members/account_credit_do.pl > create mode 100755 members/account_debit.pl > create mode 100755 members/account_debit_do.pl > create mode 100755 members/account_payment.pl > create mode 100755 members/account_payment_do.pl > create mode 100755 members/account_print.pl > create mode 100755 members/account_void.pl > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/account.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/account.tt >new file mode 100644 >index 0000000..d4d6a4e >--- /dev/null >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/account.tt >@@ -0,0 +1,518 @@ >+[% SET accounts_view = 1 %] >+[% USE KohaDates %] >+[% USE Currency %] >+[% INCLUDE 'doc-head-open.inc' %] >+<title>Koha › Patrons › Account for [% INCLUDE 'patron-title.inc' %]</title> >+[% INCLUDE 'doc-head-close.inc' %] >+ >+<link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/en/css/datatables.css" /> >+[% INCLUDE 'datatables.inc' %] >+[% INCLUDE 'browser-strings.inc' %] >+ >+<script type="text/javascript"> >+//<![CDATA[ >+$(document).ready(function() { >+ void_compare = "[% 0 FILTER $Currency highlight => highlight %]"; >+ >+ [% IF credit_id %] >+ accountPrint( 'credit', [% credit_id %] ); >+ [% ELSIF debit_id %] >+ accountPrint( 'debit', [% debit_id %] ); >+ [% END %] >+ >+ $('#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 %]/img/"; >+ >+ var debitsTable = $('#debits-table').dataTable( { >+ "sDom": "<'row-fluid'<'span6'T><'span6'>r>t<'row-fluid'><'top pager'ilpf>t<'bottom pager'ip>", >+ "oTableTools": { >+ "sSwfPath": "[% interface %]/lib/jquery/plugins/TableTools/media/swf/copy_csv_xls_pdf.swf", >+ "aButtons": [ >+ { >+ "sExtends": "print", >+ "sButtonText": "<i class='icon-print'></i> " + _("Print") >+ }, >+ { >+ "sExtends": "collection", >+ "sButtonText": "<i class='icon-download'></i> " + _("Download") + " <span class='caret' />", >+ "aButtons": [ >+ { >+ "sExtends": "csv", >+ "sButtonText": "<i class='icon-file'></i> " + _("CSV") >+ } >+ ] >+ } >+ ] >+ }, >+ "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] || 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 | replace('"', '\"') %]", >+ "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 %] >+ [% IF ao.credit %] >+ { >+ [% PROCESS format_data data=ao highlight='offset'%] >+ >+ "credit": { >+ [% PROCESS format_data data=ao.credit highlight='credit' %] >+ } >+ }, >+ [% END %] >+ [% 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( { >+ "sDom": "<'row-fluid'<'span6'T><'span6'>r>t<'row-fluid'><'top pager'ilpf>t<'bottom pager'ip>", >+ "oTableTools": { >+ "sSwfPath": "[% interface %]/lib/jquery/plugins/TableTools/media/swf/copy_csv_xls_pdf.swf", >+ "aButtons": [ >+ { >+ "sExtends": "print", >+ "sButtonText": "<i class='icon-print'></i> " + _("Print") >+ }, >+ { >+ "sExtends": "collection", >+ "sButtonText": "<i class='icon-download'></i> " + _("Download") + " <span class='caret' />", >+ "aButtons": [ >+ { >+ "sExtends": "csv", >+ "sButtonText": "<i class='icon-file'></i> " + _("CSV") >+ } >+ ] >+ } >+ ] >+ }, >+ "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] || val; >+ }, >+ }, >+ { >+ "mDataProp": "amount_paid", >+ "mRender": function ( data, type, full ) { >+ if ( full.amount_voided != void_compare ) { >+ return "<strike>" + full.amount_voided + "</strike>"; >+ } else { >+ return full.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 += "<a class='debit_print btn btn-small noprint' style='margin:5px;' onclick='accountPrint(\"debit\"," + oData.debit_id + ")'>" + >+ "<i class='icon-print'></i> " + _("Print receipt") + >+ "</a>"; >+ >+ sOut += "<ul>"; >+ if ( oData.title ) { >+ sOut += "<li>" + _("Title: "); >+ if ( oData.biblionumber ) { >+ sOut += "<a href='/cgi-bin/koha/catalogue/detail.pl?biblionumber=" + oData.biblionumber + "'>"; >+ } >+ >+ sOut += oData.title; >+ >+ if ( oData.biblionumber ) { >+ sOut += "</a>"; >+ } >+ >+ sOut += "</li>"; >+ } >+ >+ if ( oData.barcode ) { >+ sOut += "<li>" + _("Barcode: "); >+ if ( oData.itemnumber ) { >+ sOut += "<a href='/cgi-bin/koha/catalogue/moredetail.pl?itemnumber=11&biblionumber=" + oData.biblionumber + "&bi=" + oData.biblionumber + "#item" + oData.itemnumber + "" + oData.biblionumber + "'>"; >+ } >+ >+ sOut += oData.barcode; >+ >+ if ( oData.itemnumber ) { >+ sOut += "</a>"; >+ } >+ >+ sOut += "</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]; >+ credit_type = STRINGS["CreditTypes"][ao.credit.type] || ao.credit.type; >+ offset_type = STRINGS["OffsetTypes"][ao.type] || ao.type; >+ if ( offset_type ) offset_type = " (" + offset_type + ") "; >+ >+ var payment_or_void; >+ if ( ao.credit.amount_voided != void_compare ) { >+ payment_or_void = "<strike>" + ao.credit.amount_voided + "</strike>"; >+ } else { >+ payment_or_void = ao.credit.amount_paid; >+ } >+ >+ sOut += >+ "<tr>" + >+ "<td>" + ao.credit_id + "</td>" + >+ "<td>" + ao.created_on + "</td>" + >+ "<td>" + payment_or_void + "</td>" + >+ "<td>" + ao.amount + "</td>" + >+ "<td>" + credit_type + offset_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;'>"; >+ >+ sOut += "<button class='credit_print btn btn-small noprint' style='margin:5px;' onclick='accountPrint(\"credit\"," + oData.credit_id + ")'>" + >+ "<i class='icon-print'></i> " + _("Print receipt") + >+ "</button>"; >+ >+ if ( ! oData.amount_voided_original ) { >+ sOut += "<a class='credit_void btn btn-small noprint' style='margin:5px;' onclick='accountVoid(\"credit\"," + oData.credit_id + ")'>" + >+ "<i class='icon-remove-sign'></i> " + _("Void payment") + >+ "</a>"; >+ } >+ >+ 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>" + _("Amount applied") + "</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]; >+ debit_type = STRINGS["DebitTypes"][ao.debit.type] || ao.debit.type; >+ offset_type = STRINGS["OffsetTypes"][ao.type] || ao.type; >+ if ( offset_type ) offset_type = " (" + offset_type + ") "; >+ >+ sOut += >+ "<tr>" + >+ "<td>" + ao.debit.debit_id + "</td>" + >+ "<td>" + ao.debit.description + "</td>" + >+ "<td>" + debit_type + offset_type + "</td>" + >+ "<td>" + ao.debit.amount_original + "</td>" + >+ "<td>" + ao.amount + "</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; >+} >+ >+function accountPrint( type, id ) { >+ window.open( "/cgi-bin/koha/members/account_print.pl?type=" + type + "&id=" + id ); >+} >+ >+function accountVoid( type, id ) { >+ if ( confirm(_("Are you sure you want to void this transaction?")) ) { >+ window.location.href = "/cgi-bin/koha/members/account_void.pl?borrowernumber=" + [% borrowernumber %] + "&id=" + id; >+ } >+} >+//]]> >+</script> >+</head> >+<body> >+[% INCLUDE 'header.inc' %] >+[% INCLUDE 'patron-search.inc' %] >+ >+<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/members/members-home.pl">Patrons</a> › Account for [% INCLUDE 'patron-title.inc' %]</div> >+ >+<div id="doc3" class="yui-t2"> >+ <div id="bd"> >+ <div id="yui-main"> >+ <div class="yui-b"> >+ [% INCLUDE 'members-toolbar.inc' %] >+ >+ <div class="statictabs"> >+ <ul> >+ <li class="active"> >+ <a href="/cgi-bin/koha/members/account.pl?borrowernumber=[% borrowernumber %]">Account</a> >+ </li> >+ >+ <li> >+ <a href="/cgi-bin/koha/members/account_payment.pl?borrowernumber=[% borrowernumber %]" >Pay fines</a> >+ </li> >+ >+ <li> >+ <a href="/cgi-bin/koha/members/account_debit.pl?borrowernumber=[% borrowernumber %]" >Create manual invoice</a> >+ </li> >+ >+ <li> >+ <a href="/cgi-bin/koha/members/account_credit.pl?borrowernumber=[% borrowernumber %]" >Create manual credit</a> >+ </li> >+ </ul> >+ </div> >+ >+ <div class="tabs-container"> >+ >+ <p> >+ <h3>Account balance: [% borrower.account_balance | $Currency %]</h3> >+ </p> >+ >+ <div> >+ <div id="account-debits"> >+ <p><a id="account-debits-switcher" href="#" onclick="return false">View payments</a></p> >+ <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>Outstanding</th> >+ <th>Created on</th> >+ <th>Updated on</th> >+ </tr> >+ </thead> >+ <tbody></tbody> >+ </table> >+ </div> >+ >+ <div id="account-credits"> >+ <p><a id="account-credits-switcher" href="#" onclick="return false">View fees</a></p> >+ <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> >+ </div> >+ </div> >+ </div> >+ >+ <div class="yui-b"> >+ [% INCLUDE 'circ-menu.inc' %] >+ </div> >+</div> >+[% INCLUDE 'intranet-bottom.inc' %] >+ >+[% BLOCK format_data %] >+ [% FOREACH key IN data.result_source.columns %] >+ [% IF key.match('^amount') %] >+ "[% key %]_original": "[% data.$key %]", >+ "[% key %]": "[% data.$key FILTER $Currency highlight => highlight %]", >+ [% ELSIF key.match('_on$') %] >+ "[% key %]_original": "[% data.$key %]", >+ "[% key %]": "[% data.$key | $KohaDates %]", >+ [% ELSE %] >+ "[% key %]": "[% data.$key | replace('"', '\"') %]", >+ [% END %] >+ [% END %] >+[% END %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/account_credit.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/account_credit.tt >new file mode 100644 >index 0000000..98015be >--- /dev/null >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/account_credit.tt >@@ -0,0 +1,97 @@ >+[% SET accounts_view = 1 %] >+[% INCLUDE 'doc-head-open.inc' %] >+<title>Koha › Borrowers › Create manual credit</title> >+[% INCLUDE 'doc-head-close.inc' %] >+<script type="text/javascript"> >+//<![CDATA[ >+$(document).ready(function(){ >+ $('#account_credit').preventDoubleFormSubmit(); >+ $("fieldset.rows input").addClass("noEnterSubmit"); >+ >+ $("#amount").bind('keyup blur', function() { >+ // Allow only numbers in amount received >+ $(this).val($(this).val().replace(/[^\d.]/g, '')); >+ }); >+}); >+//]]> >+</script> >+</head> >+<body id="pat_account_credit" class="pat"> >+ [% INCLUDE 'header.inc' %] >+ [% INCLUDE 'patron-search.inc' %] >+ >+ <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/members/members-home.pl">Patrons</a> › Manual credit</div> >+ >+ <div id="doc3" class="yui-t2"> >+ <div id="bd"> >+ <div id="yui-main"> >+ <div class="yui-b"> >+ [% INCLUDE 'members-toolbar.inc' %] >+ >+ <div class="statictabs"> >+ <ul> >+ <li><a href="/cgi-bin/koha/members/account.pl?borrowernumber=[% borrowernumber %]">Account</a></li> >+ <li><a href="/cgi-bin/koha/members/account_payment.pl?borrowernumber=[% borrowernumber %]" >Pay fines</a></li> >+ <li><a href="/cgi-bin/koha/members/account_debit.pl?borrowernumber=[% borrowernumber %]" >Create manual invoice</a></li> >+ <li class="active"><a href="/cgi-bin/koha/members/account_credit.pl?borrowernumber=[% borrowernumber %]" >Create manual credit</a></li> >+ </ul> >+ >+ <div class="tabs-container"> >+ >+ <form action="/cgi-bin/koha/members/account_credit_do.pl" method="post" id="account_credit"> >+ <input type="hidden" name="borrowernumber" id="borrowernumber" value="[% borrowernumber %]" /> >+ >+ <fieldset class="rows"> >+ <legend>Manual credit</legend> >+ >+ <ol> >+ <li> >+ <label for="type">Credit Type: </label> >+ <select name="type" id="type"> >+ <option value="CREDIT">Credit</option> >+ <option value="FORGIVEN">Forgiven</option> >+ [% FOREACH c IN credit_types_loop %] >+ <option value="[% c.authorised_value %]">[% c.lib %]</option> >+ [% END %] >+ </select> >+ </li> >+ >+ <li> >+ <label for="barcode">Barcode: </label> >+ <input type="text" name="barcode" id="barcode" /> >+ </li> >+ >+ <li> >+ <label for="desc">Description: </label> >+ <input type="text" name="desc" size="50" id="desc" /> >+ </li> >+ >+ <li> >+ <label for="note">Note: </label> >+ <input type="text" name="note" size="50" id="note" /> >+ </li> >+ >+ <li> >+ <label for="amount">Amount: </label> >+ <input type="text" name="amount" id="amount" /> >+ Example: 5.00 >+ </li> >+ </ol> >+ >+ </fieldset> >+ >+ <fieldset class="action"> >+ <input type="submit" name="add" value="Add credit" /> >+ <a class="cancel" href="/cgi-bin/koha/members/account.pl?borrowernumber=[% borrowernumber %]">Cancel</a> >+ </fieldset> >+ </form> >+ >+ </div> >+ </div> >+ </div> >+ </div> >+ <div class="yui-b"> >+ [% INCLUDE 'circ-menu.inc' %] >+ </div> >+ </div> >+[% INCLUDE 'intranet-bottom.inc' %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/account_debit.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/account_debit.tt >new file mode 100644 >index 0000000..125179c >--- /dev/null >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/account_debit.tt >@@ -0,0 +1,114 @@ >+[% SET accounts_view = 1 %] >+[% INCLUDE 'doc-head-open.inc' %] >+<title>Koha › Borrowers › Create manual invoice</title> >+[% INCLUDE 'doc-head-close.inc' %] >+<script type="text/javascript"> >+//<![CDATA[ >+$(document).ready(function(){ >+ $('#maninvoice').preventDoubleFormSubmit(); >+ $("fieldset.rows input").addClass("noEnterSubmit"); >+ >+ var type_fees = new Array(); >+ type_fees['L'] = ''; >+ type_fees['F'] = ''; >+ type_fees['A'] = ''; >+ type_fees['N'] = ''; >+ type_fees['M'] = ''; >+ [% FOREACH invoice_types_loo IN invoice_types_loop %] >+ type_fees['[% invoice_types_loo.authorised_value %]'] = "[% invoice_types_loo.lib %]"; >+ [% END %] >+ >+ $("#amount").bind('keyup blur', function() { >+ // Allow only numbers in amount received >+ $(this).val($(this).val().replace(/[^\d.]/g, '')); >+ }); >+}); >+//]]> >+</script> >+</head> >+ >+<body> >+ [% INCLUDE 'header.inc' %] >+ [% INCLUDE 'patron-search.inc' %] >+ >+ <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/members/members-home.pl">Patrons</a> › Manual invoice</div> >+ >+ <div id="doc3" class="yui-t2"> >+ <div id="bd"> >+ <div id="yui-main"> >+ <div class="yui-b"> >+ [% INCLUDE 'members-toolbar.inc' %] >+ >+ <div class="statictabs"> >+ <ul> >+ <li><a href="/cgi-bin/koha/members/account.pl?borrowernumber=[% borrowernumber %]">Account</a></li> >+ <li><a href="/cgi-bin/koha/members/account_payment.pl?borrowernumber=[% borrowernumber %]" >Pay fines</a></li> >+ <li class="active"><a href="/cgi-bin/koha/members/account_debit.pl?borrowernumber=[% borrowernumber %]" >Create manual invoice</a></li> >+ <li><a href="/cgi-bin/koha/members/account_credit.pl?borrowernumber=[% borrowernumber %]" >Create manual credit</a></li> >+ </ul> >+ <div class="tabs-container"> >+ >+ <form action="/cgi-bin/koha/members/account_debit_do.pl" method="post" id="account_debit"> >+ <input type="hidden" name="borrowernumber" id="borrowernumber" value="[% borrowernumber %]" /> >+ >+ <fieldset class="rows"> >+ <legend>Manual Invoice</legend> >+ >+ <ol> >+ <li> >+ <label for="type">Type: </label> >+ <select name="type" id="type"> >+ <option value="LOST">Lost item</option> >+ <option value="FINE">Fine</option> >+ <option value="ACCOUNT_MANAGEMENT_FEE">Account management fee</option> >+ <option value="NEW_CARD">New card</option> >+ <option value="SUNDRY">Sundry</option> >+ >+ [% FOREACH invoice_types_loo IN invoice_types_loop %] >+ <option value="[% invoice_types_loo.authorised_value %]">[% invoice_types_loo.lib %]</option> >+ [% END %] >+ </select> >+ </li> >+ >+ <!-- TODO: Write ajax barcode validator that appends the itemnumber for this form in a hidden input --> >+ <li> >+ <label for="barcode">Barcode: </label> >+ <input type="text" name="barcode" id="barcode" /> >+ </li> >+ >+ <li> >+ <label for="description">Description: </label> >+ <input type="text" name="description" id="description" size="50" /> >+ </li> >+ >+ <li> >+ <label for="notes">Notes: </label> >+ <input type="text" name="notes" size="50" id="notes" /> >+ </li> >+ >+ <li> >+ <label for="amount">Amount: </label> >+ <input type="text" name="amount" id="amount" /> Example: 5.00 >+ </li> >+ >+ </ol> >+ </fieldset> >+ >+ <fieldset class="action"> >+ <input type="submit" name="add" value="Save" /> >+ <a class="cancel" href="/cgi-bin/koha/members/account.pl?borrowernumber=[% borrowernumber %]">Cancel</a> >+ </fieldset> >+ >+ </form> >+ >+ </div> >+ </div> >+ </div> >+ </div> >+ >+<div class="yui-b"> >+ [% INCLUDE 'circ-menu.inc' %] >+</div> >+ >+</div> >+[% INCLUDE 'intranet-bottom.inc' %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/account_payment.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/account_payment.tt >new file mode 100644 >index 0000000..3866773 >--- /dev/null >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/account_payment.tt >@@ -0,0 +1,246 @@ >+[% SET accounts_view = 1 %] >+[% USE Currency %] >+[% INCLUDE 'doc-head-open.inc' %] >+<title>Koha › Patrons › Pay Fines for [% borrower.firstname %] [% borrower.surname %]</title> >+[% INCLUDE 'doc-head-close.inc' %] >+[% INCLUDE 'browser-strings.inc' %] >+<script type= "text/javascript"> >+//<![CDATA[ >+$( document ).ready(function() { >+ $('#account-payment-form').preventDoubleFormSubmit(); >+ >+ // Convert codes to translated strings >+ $(".debit-type").each(function() { >+ $(this).html( STRINGS['DebitTypes'][ $(this).html() ] ); >+ }); >+ >+ // Show amount recieved only if the "Receive different amount" checkbox is checked >+ $("#amount-received-p").hide(); >+ $("#receive_different_amount").bind('click focus blur', function() { >+ if( $(this).is(':checked')) { >+ $("#amount-received-p").show(); >+ $("#amount_received").focus(); >+ $("#amount_received").keyup(); >+ } else { >+ $("#amount-received-p").hide(); >+ $("#amount_to_pay").keyup(); >+ } >+ }); >+ >+ $("#amount_received").bind('keyup blur', function() { >+ // Allow only numbers in amount received >+ $(this).val($(this).val().replace(/[^\d.]/g, '')); >+ >+ if ( $("#receive_different_amount").attr('checked') ) { >+ // Make sure the amount recieved is greater than the amount to pay if it is being used >+ amount_received = parseFloat( $("#amount_received").val() ) || 0; >+ amount_to_pay = parseFloat( $("#amount_to_pay").val() ) || 0; >+ if ( amount_received < amount_to_pay ) { >+ $("#process").attr('disabled','disabled'); >+ } else { >+ $("#process").removeAttr('disabled'); >+ } >+ } >+ }); >+ >+ // Allow only numbers in amount to pay >+ $("#amount_to_pay").bind('keyup blur', function() { >+ // Allow only numbers in amount received >+ $(this).val($(this).val().replace(/[^\d.]/g, '')); >+ >+ // Disallow over-payments >+ if ( parseFloat( $(this).val() ) > parseFloat( $("#total_due").val() ) ) { >+ $("#process").attr('disabled','disabled'); >+ } else { >+ $("#process").removeAttr('disabled'); >+ } >+ >+ $("#amount_received").keyup(); >+ }); >+ >+ // Enable the "Select all/Clear all" links >+ $('#CheckAll').click(function() { >+ $("input[name='debit_id']" ).prop('checked', true).trigger("change"); >+ }); >+ $('#ClearAll').click(function() { >+ $("input[name='debit_id']" ).prop('checked', false).trigger("change"); >+ }); >+ >+ // Update the "amount to pay" field whenever a fee checkbox is changed >+ // Note, this is just a payment suggestion and can be changed to any amount >+ $("input[name='debit_id']" ).change(function() { >+ var sum = 0; >+ $("input[name='debit_id']:checked" ).each(function(i,n){ >+ sum += parseFloat( $( "#amount_outstanding_" + $(this).val() ).val() ); >+ }); >+ $('#amount_to_pay').val( sum.toFixed(2) ); >+ }); >+}); >+ >+function checkForm(){ >+ // If using the "amount to receive" field, make sure the librarian is recieving at >+ // least enough to pay those fees. >+ if ( $('#amount_received').val() ) { >+ if ( parseFloat( $('#amount_received').val() ) < parseFloat( $('#amount_to_pay').val() ) ) { >+ alert( _("Cannot pay more than receieved!") ); >+ return false; >+ } >+ } >+ >+ return true; >+} >+//]]> >+</script> >+</head> >+<body id="pat_pay" class="pat"> >+ [% INCLUDE 'header.inc' %] >+ [% INCLUDE 'patron-search.inc' %] >+ >+ <div id="breadcrumbs"> >+ <a href="/cgi-bin/koha/mainpage.pl">Home</a> >+ › <a href="/cgi-bin/koha/members/members-home.pl">Patrons</a> >+ › Pay fines for [% borrower.firstname %] [% borrower.surname %] >+ </div> >+ >+ <div id="doc3" class="yui-t2"> >+ <div id="bd"> >+ <div id="yui-main"> >+ <div class="yui-b"> >+ [% INCLUDE 'members-toolbar.inc' borrowernumber=borrower.borrowernumber %] >+ >+ <div class="statictabs"> >+ <ul> >+ <li><a href="/cgi-bin/koha/members/account.pl?borrowernumber=[% borrower.borrowernumber %]">Account</a></li> >+ <li class="active"><a href="/cgi-bin/koha/members/account_payment.pl?borrowernumber=[% borrower.borrowernumber %]" >Pay fines</a></li> >+ <li><a href="/cgi-bin/koha/members/account_debit.pl?borrowernumber=[% borrower.borrowernumber %]" >Create manual invoice</a></li> >+ <li><a href="/cgi-bin/koha/members/account_credit.pl?borrowernumber=[% borrower.borrowernumber %]" >Create manual credit</a></li> >+ </ul> >+ >+ <div class="tabs-container"> >+ >+ [% IF ( debits ) %] >+ <form action="/cgi-bin/koha/members/account_payment_do.pl" method="post" id="account-payment-form" onsubmit="return checkForm()"> >+ >+ <input type="hidden" name="borrowernumber" id="borrowernumber" value="[% borrower.borrowernumber %]" /> >+ >+ <p> >+ <span class="checkall"> >+ <a id="CheckAll" href="#">Select all</a> >+ </span> >+ >+ | >+ >+ <span class="clearall"> >+ <a id="ClearAll" href="#">Clear all</a> >+ </span> >+ </p> >+ >+ <table id="finest"> >+ <thead> >+ <tr> >+ <th> </th> >+ <th>Description</th> >+ <th>Account type</th> >+ <th>Original amount</th> >+ <th>Amount outstanding</th> >+ </tr> >+ </thead> >+ >+ <tbody> >+ [% SET total_due = 0 %] >+ [% FOREACH d IN debits %] >+ [% SET total_due = total_due + d.amount_outstanding %] >+ <tr> >+ <td> >+ <input type="checkbox" checked="checked" name="debit_id" value="[% d.debit_id %]" /> >+ </td> >+ >+ <td> >+ [% d.description %] >+ >+ [% IF d.notes %] >+ ( <i>[% d.notes %]</i> ) >+ [% END %] >+ </td> >+ >+ <td> >+ <span class="debit-type">[% d.type %]</span> >+ </td> >+ >+ <td class="debit"> >+ [% d.amount_original | $Currency %] >+ <input type="hidden" id="amount_original_[% d.debit_id %]" value="[% Currency.format_without_symbol( d.amount_original ) %]" /> >+ </td> >+ >+ <td class="debit"> >+ [% d.amount_outstanding | $Currency %] >+ <input type="hidden" id="amount_outstanding_[% d.debit_id %]" value="[% Currency.format_without_symbol( d.amount_outstanding ) %]" /> >+ </td> >+ </tr> >+ [% END %] >+ </tbody> >+ >+ <tfoot> >+ <tr> >+ <td class="total" colspan="4">Total Due:</td> >+ <td>[% total_due | $Currency %]</td> >+ </tr> >+ </tfoot> >+ >+ </table> >+ >+ <fieldset> >+ <p> >+ <label for="amount_to_pay">Amount to pay: [% Currency.symbol() %]</label> >+ <input type="text" name="amount_to_pay" id="amount_to_pay" value="[% Currency.format_without_symbol( total_due ) %]" /> >+ <input type="hidden" name="total_due" id="total_due" value="[% total_due %]" /> >+ >+ <input type="checkbox" id="receive_different_amount" /> >+ <label for="receive_different_amount"><i>Receive different amount</i></label> >+ </p> >+ >+ <p id="amount-received-p"> >+ <label for="amount_received">Amount recieved: [% Currency.symbol() %]</label> >+ <input type="text" name="amount_received" id="amount_received" /> >+ </p> >+ >+ <p> >+ <label for="type">Type:</label> >+ <select id="type" name="type"> >+ <option value="PAYMENT">Payment</option> >+ <option value="WRITEOFF">Writeoff</option> >+ [% FOREACH c IN credit_types_loop %] >+ <option value="[% c.authorised_value %]">[% c.lib %]</option> >+ [% END %] >+ </select> >+ </p> >+ >+ <p> >+ <label for="notes">Payment notes:</label> >+ <input type="textbox" name="notes" id="notes" /> >+ <p> >+ </fieldset> >+ >+ <fieldset class="action"> >+ <input type="submit" id="process" value="Process" class="submit" /> >+ <a class="cancel" href="/cgi-bin/koha/members/account.pl?borrowernumber=[% borrower.borrowernumber %]">Cancel</a> >+ </fieldset> >+ >+ </form> >+ >+ [% ELSE %] >+ <p> >+ [% borrower.firstname %] [% borrower.surname %] has no outstanding fines. >+ </p> >+ [% END %] >+ >+ </div> >+ </div> >+ </div> >+ </div> >+ >+ <div class="yui-b"> >+ [% INCLUDE 'circ-menu.tt' %] >+ </div> >+ </div> >+[% INCLUDE 'intranet-bottom.inc' %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/account_print.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/account_print.tt >new file mode 100644 >index 0000000..6201585 >--- /dev/null >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/account_print.tt >@@ -0,0 +1,146 @@ >+[% USE KohaDates %] >+[% USE Currency %] >+[% USE EncodeUTF8 %] >+[% INCLUDE 'doc-head-open.inc' %] >+<title>Print Receipt for [% cardnumber %]</title> >+[% INCLUDE 'doc-head-close.inc' %] >+<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> >+<link rel="shortcut icon" href="[% IF ( IntranetFavicon ) %][% IntranetFavicon %][% ELSE %][% interface %]/[% theme %]/img/favicon.ico[% END %]" type="image/x-icon" /> >+<script type="text/javascript"> >+ function printThenClose() { >+ window.print(); >+ window.close(); >+ } >+</script> >+</head> >+ >+[% SET account = debit || credit %] >+[% SET borrower = account.borrower %] >+ >+<body id="account-print-body" onload="printThenClose();"> >+ >+ <table> >+ <thead> >+ <tr> >+ <th colspan="99"> >+ [% IF debit %] >+ Invoice >+ [% ELSIF credit %] >+ Payment receipt >+ [% END %] >+ </th> >+ </tr> >+ >+ <tr> >+ <th colspan="99"> >+ [% borrower.branch.branchname | $EncodeUTF8 %] >+ </th> >+ </tr> >+ >+ <tr> >+ <th>Name:</th> >+ <th colspan="99">[% borrower.firstname | $EncodeUTF8 %] [% borrower.surname | $EncodeUTF8 %]</th> >+ </tr> >+ >+ <tr> >+ <th>Card number:</th> >+ <th colspan="99">[% borrower.cardnumber %]</th> >+ </tr> >+ >+ <tr> >+ <th>Date:</th> >+ <th colspan="99">[% account.created_on | $KohaDates %]</th> >+ </tr> >+ >+ [% IF account.description %] >+ <tr> >+ <th>Description:</th> >+ <th colspan="99">[% account.description | $EncodeUTF8 %]</th> >+ </tr> >+ [% END %] >+ >+ [% IF credit %] >+ <tr> >+ <th>Amount paid:</th> >+ <th colspan="99">[% credit.amount_paid | $Currency highlight => type %]</th> >+ </tr> >+ [% IF credit.amount_received > 0 %] >+ <tr> >+ <th>Amount received:</th> >+ <th colspan="99">[% credit.amount_received | $Currency highlight => type %]</th> >+ </tr> >+ <tr> >+ <th>Change due:</th> >+ <th colspan="99">[% credit.amount_received - credit.amount_paid | $Currency highlight => type %]</th> >+ </tr> >+ [% END %] >+ <tr> >+ <th>Balance:</th> >+ <th colspan="99">[% credit.amount_remaining | $Currency highlight => type %]</th> >+ </tr> >+ [% IF credit.account_offsets %] >+ <tr> >+ <th colspan="99">Fees paid</th> >+ </tr> >+ <tr> >+ <th>Description</th> >+ <th>Type</th> >+ <th>Amount</th> >+ <th>Paid</th> >+ <th>Outstanding</th> >+ <th>Date</th> >+ </tr> >+ [% END %] >+ [% ELSIF debit %] >+ <tr> >+ <th>Amount:</th> >+ <th colspan="99">[% debit.amount_original | $Currency highlight => type %]</th> >+ </tr> >+ <tr> >+ <th>Outstanding:</th> >+ <th colspan="99">[% debit.amount_outstanding | $Currency highlight => type %]</th> >+ </tr> >+ [% IF debit.account_offsets %] >+ <tr> >+ <th colspan="99">Payments applied</th> >+ </tr> >+ <tr> >+ <th>Date</th> >+ <th>Type</th> >+ <th>Payment</th> >+ <th>Applied</th> >+ <th>Balance</th> >+ <th>Notes</th> >+ </tr> >+ [% END %] >+ [% END %] >+ </thead> >+ >+ <tbody> >+ [% IF credit.account_offsets %] >+ [% FOREACH ao IN credit.account_offsets %] >+ <tr> >+ <td>[% ao.debit.description %]</td> >+ <td>[% ao.debit.type %]</td> >+ <td>[% ao.debit.amount_original | $Currency highlight => 'debit' %]</td> >+ <td>[% ao.amount | $Currency highlight => 'offset' %]</td> >+ <td>[% ao.debit.amount_outstanding | $Currency highlight => 'debit' %]</td> >+ <td>[% ao.debit.created_on | $KohaDates %]</td> >+ </tr> >+ [% END %] >+ [% ELSIF debit.account_offsets %] >+ [% FOREACH ao IN debit.account_offsets %] >+ <tr> >+ <td>[% ao.credit.created_on | $KohaDates %]</td> >+ <td>[% ao.credit.type %]</td> >+ <td>[% ao.credit.amount_paid | $Currency highlight => 'credit' %]</td> >+ <td>[% ao.amount | $Currency highlight => 'offset' %]</td> >+ <td>[% ao.credit.amount_remaining | $Currency highlight => 'credit' %]</td> >+ <td>[% ao.credit.notes %]</td> >+ </tr> >+ [% END %] >+ [% END %] >+ </tbody> >+ </table> >+ >+[% INCLUDE 'intranet-bottom.inc' %] >diff --git a/koha-tmpl/intranet-tmpl/prog/img/details_close.png b/koha-tmpl/intranet-tmpl/prog/img/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/intranet-tmpl/prog/img/details_open.png b/koha-tmpl/intranet-tmpl/prog/img/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/members/account.pl b/members/account.pl >new file mode 100755 >index 0000000..af0186f >--- /dev/null >+++ b/members/account.pl >@@ -0,0 +1,118 @@ >+#!/usr/bin/perl >+ >+# Copyright 2000-2002 Katipo Communications >+# Copyright 2013 ByWater Solutions >+# >+# This file is part of Koha. >+# >+# Koha is free software; you can redistribute it and/or modify it under the >+# terms of the GNU General Public License as published by the Free Software >+# Foundation; either version 3 of the License, or (at your option) any later >+# version. >+# >+# Koha is distributed in the hope that it will be useful, but WITHOUT ANY >+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR >+# A PARTICULAR PURPOSE. See the GNU General Public License for more details. >+# >+# You should have received a copy of the GNU General Public License along >+# with Koha; if not, write to the Free Software Foundation, Inc., >+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. >+ >+use Modern::Perl; >+ >+use CGI; >+ >+use C4::Auth; >+use C4::Output; >+use C4::Dates qw/format_date/; >+use C4::Members; >+use C4::Branch; >+use C4::Members::Attributes qw(GetBorrowerAttributes); >+use Koha::Database; >+ >+my $cgi = new CGI; >+ >+my ( $template, $loggedinuser, $cookie ) = get_template_and_user( >+ { >+ template_name => "members/account.tt", >+ query => $cgi, >+ type => "intranet", >+ authnotrequired => 0, >+ flagsrequired => { borrowers => 1, updatecharges => 1 }, >+ debug => 1, >+ } >+); >+ >+my $borrowernumber = $cgi->param('borrowernumber'); >+ >+my $borrower = GetMember( 'borrowernumber' => $borrowernumber ); >+ >+my $schema = Koha::Database->new()->schema(); >+ >+my @debits = $schema->resultset('AccountDebit')->search( >+ { 'me.borrowernumber' => $borrowernumber }, >+ { prefetch => { account_offsets => 'credit' } } >+); >+ >+my @credits = $schema->resultset('AccountCredit')->search( >+ { 'me.borrowernumber' => $borrowernumber }, >+ { prefetch => { account_offsets => 'debit' } } >+); >+ >+$template->param( >+ debits => \@debits, >+ credits => \@credits, >+ borrower => $borrower, >+ >+ # IDs for automatic receipt printing >+ debit_id => $cgi->param('debit_id') || undef, >+ credit_id => $cgi->param('credit_id') || undef, >+); >+ >+# Standard /members/ borrower details data >+## FIXME: This code is in every /members/ script and should be unified >+ >+if ( $borrower->{'category_type'} eq 'C' ) { >+ my ( $catcodes, $labels ) = >+ GetborCatFromCatType( 'A', 'WHERE category_type = ?' ); >+ my $cnt = scalar(@$catcodes); >+ $template->param( 'CATCODE_MULTI' => 1 ) if $cnt > 1; >+ $template->param( 'catcode' => $catcodes->[0] ) if $cnt == 1; >+} >+ >+my ( $picture, $dberror ) = GetPatronImage( $borrower->{'borrowernumber'} ); >+$template->param( picture => 1 ) if $picture; >+ >+if ( C4::Context->preference('ExtendedPatronAttributes') ) { >+ my $attributes = GetBorrowerAttributes($borrowernumber); >+ $template->param( >+ ExtendedPatronAttributes => 1, >+ extendedattributes => $attributes >+ ); >+} >+ >+$template->param( >+ borrowernumber => $borrowernumber, >+ firstname => $borrower->{'firstname'}, >+ surname => $borrower->{'surname'}, >+ cardnumber => $borrower->{'cardnumber'}, >+ categorycode => $borrower->{'categorycode'}, >+ category_type => $borrower->{'category_type'}, >+ categoryname => $borrower->{'description'}, >+ address => $borrower->{'address'}, >+ address2 => $borrower->{'address2'}, >+ city => $borrower->{'city'}, >+ state => $borrower->{'state'}, >+ zipcode => $borrower->{'zipcode'}, >+ country => $borrower->{'country'}, >+ phone => $borrower->{'phone'}, >+ email => $borrower->{'email'}, >+ branchcode => $borrower->{'branchcode'}, >+ branchname => GetBranchName( $borrower->{'branchcode'} ), >+ is_child => ( $borrower->{'category_type'} eq 'C' ), >+ activeBorrowerRelationship => >+ ( C4::Context->preference('borrowerRelationship') ne '' ), >+ RoutingSerials => C4::Context->preference('RoutingSerials'), >+); >+ >+output_html_with_http_headers $cgi, $cookie, $template->output; >diff --git a/members/account_credit.pl b/members/account_credit.pl >new file mode 100755 >index 0000000..7e22a1c >--- /dev/null >+++ b/members/account_credit.pl >@@ -0,0 +1,103 @@ >+#!/usr/bin/perl >+ >+#written 11/1/2000 by chris@katipo.oc.nz >+#script to display borrowers account details >+ >+# Copyright 2000-2002 Katipo Communications >+# Copyright 2010 BibLibre >+# >+# This file is part of Koha. >+# >+# Koha is free software; you can redistribute it and/or modify it under the >+# terms of the GNU General Public License as published by the Free Software >+# Foundation; either version 3 of the License, or (at your option) any later >+# version. >+# >+# Koha is distributed in the hope that it will be useful, but WITHOUT ANY >+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR >+# A PARTICULAR PURPOSE. See the GNU General Public License for more details. >+# >+# You should have received a copy of the GNU General Public License along >+# with Koha; if not, write to the Free Software Foundation, Inc., >+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. >+ >+use strict; >+use warnings; >+ >+use C4::Auth; >+use C4::Output; >+use CGI; >+ >+use C4::Koha; >+use C4::Members; >+use C4::Branch; >+use C4::Items; >+use C4::Members::Attributes qw(GetBorrowerAttributes); >+use Koha::Database; >+ >+my $cgi = new CGI; >+ >+my $borrowernumber = $cgi->param('borrowernumber'); >+ >+my $borrower = GetMember( 'borrowernumber' => $borrowernumber ); >+ >+my ( $template, $loggedinuser, $cookie ) = get_template_and_user( >+ { >+ template_name => "members/account_credit.tt", >+ query => $cgi, >+ type => "intranet", >+ authnotrequired => 0, >+ flagsrequired => { borrowers => 1, updatecharges => 1 }, >+ debug => 1, >+ } >+); >+ >+$template->param( credit_types_loop => GetAuthorisedValues('MANUAL_CREDIT') ); >+ >+# Standard /members/ borrower details data >+## FIXME: This code is in every /members/ script and should be unified >+ >+if ( $borrower->{'category_type'} eq 'C' ) { >+ my ( $catcodes, $labels ) = >+ GetborCatFromCatType( 'A', 'WHERE category_type = ?' ); >+ my $cnt = scalar(@$catcodes); >+ $template->param( 'CATCODE_MULTI' => 1 ) if $cnt > 1; >+ $template->param( 'catcode' => $catcodes->[0] ) if $cnt == 1; >+} >+ >+my ( $picture, $dberror ) = GetPatronImage( $borrower->{'borrowernumber'} ); >+$template->param( picture => 1 ) if $picture; >+ >+if ( C4::Context->preference('ExtendedPatronAttributes') ) { >+ my $attributes = GetBorrowerAttributes($borrowernumber); >+ $template->param( >+ ExtendedPatronAttributes => 1, >+ extendedattributes => $attributes >+ ); >+} >+ >+$template->param( >+ borrowernumber => $borrowernumber, >+ firstname => $borrower->{'firstname'}, >+ surname => $borrower->{'surname'}, >+ cardnumber => $borrower->{'cardnumber'}, >+ categorycode => $borrower->{'categorycode'}, >+ category_type => $borrower->{'category_type'}, >+ categoryname => $borrower->{'description'}, >+ address => $borrower->{'address'}, >+ address2 => $borrower->{'address2'}, >+ city => $borrower->{'city'}, >+ state => $borrower->{'state'}, >+ zipcode => $borrower->{'zipcode'}, >+ country => $borrower->{'country'}, >+ phone => $borrower->{'phone'}, >+ email => $borrower->{'email'}, >+ branchcode => $borrower->{'branchcode'}, >+ branchname => GetBranchName( $borrower->{'branchcode'} ), >+ is_child => ( $borrower->{'category_type'} eq 'C' ), >+ activeBorrowerRelationship => >+ ( C4::Context->preference('borrowerRelationship') ne '' ), >+ RoutingSerials => C4::Context->preference('RoutingSerials'), >+); >+ >+output_html_with_http_headers $cgi, $cookie, $template->output; >diff --git a/members/account_credit_do.pl b/members/account_credit_do.pl >new file mode 100755 >index 0000000..b4d01c6 >--- /dev/null >+++ b/members/account_credit_do.pl >@@ -0,0 +1,66 @@ >+#!/usr/bin/perl >+ >+# Copyright 2013 ByWater Solutions >+# >+# This file is part of Koha. >+# >+# Koha is free software; you can redistribute it and/or modify it under the >+# terms of the GNU General Public License as published by the Free Software >+# Foundation; either version 3 of the License, or (at your option) any later >+# version. >+# >+# Koha is distributed in the hope that it will be useful, but WITHOUT ANY >+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR >+# A PARTICULAR PURPOSE. See the GNU General Public License for more details. >+# >+# You should have received a copy of the GNU General Public License along >+# with Koha; if not, write to the Free Software Foundation, Inc., >+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. >+ >+use Modern::Perl; >+ >+use CGI; >+ >+use C4::Auth; >+use C4::Output; >+use C4::Members; >+use C4::Items; >+use C4::Branch; >+use C4::Members::Attributes qw(GetBorrowerAttributes); >+use Koha::Accounts; >+use Koha::Database; >+ >+my $cgi = new CGI; >+ >+my $borrowernumber = $cgi->param('borrowernumber'); >+my $borrower = >+ Koha::Database->new()->schema->resultset('Borrower')->find($borrowernumber); >+ >+if ( checkauth( $cgi, 0, { borrowers => 1 }, 'intranet' ) ) { >+ >+ my $barcode = $cgi->param('barcode'); >+ my $itemnumber = $cgi->param('itemnumber'); >+ my $description = $cgi->param('description'); >+ my $amount = $cgi->param('amount'); >+ my $type = $cgi->param('type'); >+ my $notes = $cgi->param('notes'); >+ >+ if ( !$itemnumber && $barcode ) { >+ $itemnumber = GetItemnumberFromBarcode($barcode); >+ } >+ >+ my $debit = AddCredit( >+ { >+ borrower => $borrower, >+ amount => $amount, >+ type => $type, >+ itemnumber => $itemnumber, >+ description => $description, >+ notes => $notes, >+ >+ } >+ ); >+ >+ print $cgi->redirect( >+ "/cgi-bin/koha/members/account.pl?borrowernumber=$borrowernumber"); >+} >diff --git a/members/account_debit.pl b/members/account_debit.pl >new file mode 100755 >index 0000000..86061cf >--- /dev/null >+++ b/members/account_debit.pl >@@ -0,0 +1,104 @@ >+#!/usr/bin/perl >+ >+#written 11/1/2000 by chris@katipo.oc.nz >+#script to display borrowers account details >+ >+# Copyright 2000-2002 Katipo Communications >+# Copyright 2010 BibLibre >+# >+# This file is part of Koha. >+# >+# Koha is free software; you can redistribute it and/or modify it under the >+# terms of the GNU General Public License as published by the Free Software >+# Foundation; either version 3 of the License, or (at your option) any later >+# version. >+# >+# Koha is distributed in the hope that it will be useful, but WITHOUT ANY >+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR >+# A PARTICULAR PURPOSE. See the GNU General Public License for more details. >+# >+# You should have received a copy of the GNU General Public License along >+# with Koha; if not, write to the Free Software Foundation, Inc., >+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. >+ >+use strict; >+use warnings; >+ >+use CGI; >+ >+use C4::Auth; >+use C4::Output; >+use C4::Members; >+use C4::Items; >+use C4::Branch; >+use C4::Members::Attributes qw(GetBorrowerAttributes); >+use C4::Koha; >+use Koha::Accounts; >+use Koha::Database; >+ >+my $input = new CGI; >+ >+my $borrowernumber = $input->param('borrowernumber'); >+ >+my $borrower = GetMember( 'borrowernumber' => $borrowernumber ); >+ >+my ( $template, $loggedinuser, $cookie ) = get_template_and_user( >+ { >+ template_name => "members/account_debit.tt", >+ query => $input, >+ type => "intranet", >+ authnotrequired => 0, >+ flagsrequired => { borrowers => 1, updatecharges => 1 }, >+ debug => 1, >+ } >+); >+ >+$template->param( invoice_types_loop => GetAuthorisedValues('MANUAL_INV') ); >+ >+# Standard /members/ borrower details data >+## FIXME: This code is in every /members/ script and should be unified >+ >+if ( $borrower->{'category_type'} eq 'C' ) { >+ my ( $catcodes, $labels ) = >+ GetborCatFromCatType( 'A', 'WHERE category_type = ?' ); >+ my $cnt = scalar(@$catcodes); >+ $template->param( 'CATCODE_MULTI' => 1 ) if $cnt > 1; >+ $template->param( 'catcode' => $catcodes->[0] ) if $cnt == 1; >+} >+ >+my ( $picture, $dberror ) = GetPatronImage( $borrower->{'borrowernumber'} ); >+$template->param( picture => 1 ) if $picture; >+ >+if ( C4::Context->preference('ExtendedPatronAttributes') ) { >+ my $attributes = GetBorrowerAttributes($borrowernumber); >+ $template->param( >+ ExtendedPatronAttributes => 1, >+ extendedattributes => $attributes >+ ); >+} >+ >+$template->param( >+ borrowernumber => $borrowernumber, >+ firstname => $borrower->{'firstname'}, >+ surname => $borrower->{'surname'}, >+ cardnumber => $borrower->{'cardnumber'}, >+ categorycode => $borrower->{'categorycode'}, >+ category_type => $borrower->{'category_type'}, >+ categoryname => $borrower->{'description'}, >+ address => $borrower->{'address'}, >+ address2 => $borrower->{'address2'}, >+ city => $borrower->{'city'}, >+ state => $borrower->{'state'}, >+ zipcode => $borrower->{'zipcode'}, >+ country => $borrower->{'country'}, >+ phone => $borrower->{'phone'}, >+ email => $borrower->{'email'}, >+ branchcode => $borrower->{'branchcode'}, >+ branchname => GetBranchName( $borrower->{'branchcode'} ), >+ is_child => ( $borrower->{'category_type'} eq 'C' ), >+ activeBorrowerRelationship => >+ ( C4::Context->preference('borrowerRelationship') ne '' ), >+ RoutingSerials => C4::Context->preference('RoutingSerials'), >+); >+ >+output_html_with_http_headers $input, $cookie, $template->output; >diff --git a/members/account_debit_do.pl b/members/account_debit_do.pl >new file mode 100755 >index 0000000..dd5c8b5 >--- /dev/null >+++ b/members/account_debit_do.pl >@@ -0,0 +1,69 @@ >+#!/usr/bin/perl >+ >+# Copyright 2013 ByWater Solutions >+# >+# This file is part of Koha. >+# >+# Koha is free software; you can redistribute it and/or modify it under the >+# terms of the GNU General Public License as published by the Free Software >+# Foundation; either version 3 of the License, or (at your option) any later >+# version. >+# >+# Koha is distributed in the hope that it will be useful, but WITHOUT ANY >+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR >+# A PARTICULAR PURPOSE. See the GNU General Public License for more details. >+# >+# You should have received a copy of the GNU General Public License along >+# with Koha; if not, write to the Free Software Foundation, Inc., >+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. >+ >+use Modern::Perl; >+ >+use CGI; >+ >+use C4::Auth; >+use C4::Output; >+use C4::Members; >+use C4::Items; >+use C4::Branch; >+use C4::Members::Attributes qw(GetBorrowerAttributes); >+use Koha::Accounts; >+use Koha::Database; >+ >+my $cgi = new CGI; >+ >+my $borrowernumber = $cgi->param('borrowernumber'); >+my $borrower = >+ Koha::Database->new()->schema->resultset('Borrower')->find($borrowernumber); >+ >+if ( checkauth( $cgi, 0, { borrowers => 1 }, 'intranet' ) ) { >+ >+ # print $cgi->header; >+ my $barcode = $cgi->param('barcode'); >+ my $itemnumber = $cgi->param('itemnumber'); >+ my $description = $cgi->param('description'); >+ my $amount = $cgi->param('amount'); >+ my $type = $cgi->param('type'); >+ my $notes = $cgi->param('notes'); >+ >+ if ( !$itemnumber && $barcode ) { >+ $itemnumber = GetItemnumberFromBarcode($barcode); >+ } >+ >+ my $debit = AddDebit( >+ { >+ borrower => $borrower, >+ amount => $amount, >+ type => $type, >+ itemnumber => $itemnumber, >+ description => $description, >+ notes => $notes, >+ >+ } >+ ); >+ >+ my $debit_id = $debit->debit_id(); >+ >+ print $cgi->redirect( >+ "/cgi-bin/koha/members/account.pl?borrowernumber=$borrowernumber"); >+} >diff --git a/members/account_payment.pl b/members/account_payment.pl >new file mode 100755 >index 0000000..54b20e1 >--- /dev/null >+++ b/members/account_payment.pl >@@ -0,0 +1,123 @@ >+#!/usr/bin/perl >+ >+# Copyright 2000-2002 Katipo Communications >+# Copyright 2010 BibLibre >+# Copyright 2010,2011 PTFS-Europe Ltd >+# Copyright 2013 ByWater Solutions >+# >+# This file is part of Koha. >+# >+# Koha is free software; you can redistribute it and/or modify it under the >+# terms of the GNU General Public License as published by the Free Software >+# Foundation; either version 3 of the License, or (at your option) any later >+# version. >+# >+# Koha is distributed in the hope that it will be useful, but WITHOUT ANY >+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR >+# A PARTICULAR PURPOSE. See the GNU General Public License for more details. >+# >+# You should have received a copy of the GNU General Public License along >+# with Koha; if not, write to the Free Software Foundation, Inc., >+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. >+ >+=head1 account_payment.pl >+ >+ written 11/1/2000 by chris@katipo.oc.nz >+ part of the koha library system, script to facilitate paying off fines >+ >+=cut >+ >+use Modern::Perl; >+ >+use CGI; >+ >+use URI::Escape; >+ >+use C4::Context; >+use C4::Auth; >+use C4::Output; >+use C4::Members; >+use C4::Stats; >+use C4::Koha; >+use C4::Overdues; >+use C4::Branch; >+use C4::Members::Attributes qw(GetBorrowerAttributes); >+use Koha::Database; >+ >+our $cgi = CGI->new; >+ >+our ( $template, $loggedinuser, $cookie ) = get_template_and_user( >+ { >+ template_name => 'members/account_payment.tt', >+ query => $cgi, >+ type => 'intranet', >+ authnotrequired => 0, >+ flagsrequired => { borrowers => 1, updatecharges => 1 }, >+ debug => 1, >+ } >+); >+ >+my $borrowernumber = $cgi->param('borrowernumber'); >+ >+my $borrower = GetMember( borrowernumber => $borrowernumber ); >+ >+my @debits = Koha::Database->new()->schema->resultset('AccountDebit')->search( >+ { >+ 'me.borrowernumber' => $borrowernumber, >+ amount_outstanding => { '>' => 0 } >+ } >+); >+ >+$template->param( >+ debits => \@debits, >+ borrower => $borrower, >+ credit_types_loop => GetAuthorisedValues('MANUAL_CREDIT'), >+); >+ >+# Standard /members/ borrower details data >+## FIXME: This code is in every /members/ script and should be unified >+ >+if ( $borrower->{'category_type'} eq 'C' ) { >+ my ( $catcodes, $labels ) = >+ GetborCatFromCatType( 'A', 'WHERE category_type = ?' ); >+ my $cnt = scalar(@$catcodes); >+ $template->param( 'CATCODE_MULTI' => 1 ) if $cnt > 1; >+ $template->param( 'catcode' => $catcodes->[0] ) if $cnt == 1; >+} >+ >+my ( $picture, $dberror ) = GetPatronImage( $borrower->{'borrowernumber'} ); >+$template->param( picture => 1 ) if $picture; >+ >+if ( C4::Context->preference('ExtendedPatronAttributes') ) { >+ my $attributes = GetBorrowerAttributes($borrowernumber); >+ $template->param( >+ ExtendedPatronAttributes => 1, >+ extendedattributes => $attributes >+ ); >+} >+ >+$template->param( >+ borrowernumber => $borrowernumber, >+ firstname => $borrower->{'firstname'}, >+ surname => $borrower->{'surname'}, >+ cardnumber => $borrower->{'cardnumber'}, >+ categorycode => $borrower->{'categorycode'}, >+ category_type => $borrower->{'category_type'}, >+ categoryname => $borrower->{'description'}, >+ address => $borrower->{'address'}, >+ address2 => $borrower->{'address2'}, >+ city => $borrower->{'city'}, >+ state => $borrower->{'state'}, >+ zipcode => $borrower->{'zipcode'}, >+ country => $borrower->{'country'}, >+ phone => $borrower->{'phone'}, >+ email => $borrower->{'email'}, >+ branchcode => $borrower->{'branchcode'}, >+ branchname => GetBranchName( $borrower->{'branchcode'} ), >+ is_child => ( $borrower->{'category_type'} eq 'C' ), >+ activeBorrowerRelationship => >+ ( C4::Context->preference('borrowerRelationship') ne '' ), >+ RoutingSerials => C4::Context->preference('RoutingSerials'), >+); >+ >+output_html_with_http_headers $cgi, $cookie, $template->output; >diff --git a/members/account_payment_do.pl b/members/account_payment_do.pl >new file mode 100755 >index 0000000..9f0802f >--- /dev/null >+++ b/members/account_payment_do.pl >@@ -0,0 +1,66 @@ >+#!/usr/bin/perl >+ >+# Copyright 2013 ByWater Solutions >+# >+# This file is part of Koha. >+# >+# Koha is free software; you can redistribute it and/or modify it under the >+# terms of the GNU General Public License as published by the Free Software >+# Foundation; either version 3 of the License, or (at your option) any later >+# version. >+# >+# Koha is distributed in the hope that it will be useful, but WITHOUT ANY >+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR >+# A PARTICULAR PURPOSE. See the GNU General Public License for more details. >+# >+# You should have received a copy of the GNU General Public License along >+# with Koha; if not, write to the Free Software Foundation, Inc., >+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. >+ >+use Modern::Perl; >+ >+use CGI; >+ >+use C4::Auth; >+use C4::Members; >+use C4::Items; >+use C4::Branch; >+use C4::Members::Attributes qw(GetBorrowerAttributes); >+use Koha::Accounts; >+use Koha::Database; >+ >+my $cgi = new CGI; >+ >+if ( checkauth( $cgi, 0, { borrowers => 1 }, 'intranet' ) ) { >+ my $borrowernumber = $cgi->param('borrowernumber'); >+ >+ my $borrower = >+ Koha::Database->new()->schema->resultset('Borrower') >+ ->find($borrowernumber); >+ >+ my $amount_to_pay = $cgi->param('amount_to_pay'); >+ my $amount_received = $cgi->param('amount_received'); >+ my $type = $cgi->param('type'); >+ my $notes = $cgi->param('notes'); >+ my @debit_id = $cgi->param('debit_id'); >+ >+ $amount_received ||= $amount_to_pay >+ if $type eq Koha::Accounts::CreditTypes::Payment(); >+ >+ my $credit = AddCredit( >+ { >+ borrower => $borrower, >+ amount_received => $amount_received, >+ amount => $amount_to_pay, >+ type => $type, >+ notes => $notes, >+ debit_id => \@debit_id, >+ >+ } >+ ); >+ >+ my $credit_id = $credit->credit_id(); >+ >+ print $cgi->redirect( >+ "/cgi-bin/koha/members/account.pl?borrowernumber=$borrowernumber&credit_id=$credit_id"); >+} >diff --git a/members/account_print.pl b/members/account_print.pl >new file mode 100755 >index 0000000..3e1d302 >--- /dev/null >+++ b/members/account_print.pl >@@ -0,0 +1,60 @@ >+#!/usr/bin/perl >+ >+# Copyright 2013 ByWater Solutions >+# >+# This file is part of Koha. >+# >+# Koha is free software; you can redistribute it and/or modify it under the >+# terms of the GNU General Public License as published by the Free Software >+# Foundation; either version 3 of the License, or (at your option) any later >+# version. >+# >+# Koha is distributed in the hope that it will be useful, but WITHOUT ANY >+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR >+# A PARTICULAR PURPOSE. See the GNU General Public License for more details. >+# >+# You should have received a copy of the GNU General Public License along >+# with Koha; if not, write to the Free Software Foundation, Inc., >+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. >+ >+use Modern::Perl; >+ >+use CGI; >+ >+use C4::Auth; >+use C4::Output; >+use Koha::Database; >+ >+my $cgi = new CGI; >+ >+my ( $template, $loggedinuser, $cookie ) = get_template_and_user( >+ { >+ template_name => "members/account_print.tt", >+ query => $cgi, >+ type => "intranet", >+ authnotrequired => 0, >+ flagsrequired => { borrowers => 1, updatecharges => 1 }, >+ debug => 1, >+ } >+); >+ >+my $type = $cgi->param('type'); >+my $id = $cgi->param('id'); >+ >+warn "No type passed in!" unless $type; >+warn "No id passed in!" unless $id; >+ >+if ( $type eq 'debit' ) { >+ my $debit = >+ Koha::Database->new()->schema->resultset('AccountDebit')->find($id); >+ $template->param( debit => $debit ); >+} >+elsif ( $type eq 'credit' ) { >+ my $credit = >+ Koha::Database->new()->schema->resultset('AccountCredit')->find($id); >+ $template->param( credit => $credit ); >+} >+ >+$template->param( type => $type ); >+ >+output_html_with_http_headers $cgi, $cookie, $template->output; >diff --git a/members/account_void.pl b/members/account_void.pl >new file mode 100755 >index 0000000..fffc995 >--- /dev/null >+++ b/members/account_void.pl >@@ -0,0 +1,38 @@ >+#!/usr/bin/perl >+ >+# Copyright 2013 ByWater Solutions >+# >+# This file is part of Koha. >+# >+# Koha is free software; you can redistribute it and/or modify it under the >+# terms of the GNU General Public License as published by the Free Software >+# Foundation; either version 3 of the License, or (at your option) any later >+# version. >+# >+# Koha is distributed in the hope that it will be useful, but WITHOUT ANY >+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR >+# A PARTICULAR PURPOSE. See the GNU General Public License for more details. >+# >+# You should have received a copy of the GNU General Public License along >+# with Koha; if not, write to the Free Software Foundation, Inc., >+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. >+ >+use Modern::Perl; >+ >+use CGI; >+ >+use C4::Auth; >+use C4::Output; >+use Koha::Accounts; >+ >+my $cgi = new CGI; >+ >+my $id = $cgi->param('id'); >+my $borrowernumber = $cgi->param('borrowernumber'); >+ >+if ( checkauth( $cgi, 0, { borrowers => 1 }, 'intranet' ) ) { >+ VoidCredit( { id => $id } ); >+ >+ print $cgi->redirect( >+ "/cgi-bin/koha/members/account.pl?borrowernumber=$borrowernumber"); >+} >-- >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