Bugzilla – Attachment 85875 Details for
Bug 17702
Create configuration for account credit types
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 17702: Account types configuration - Manual invoice and credit
Bug-17702-Account-types-configuration---Manual-inv.patch (text/plain), 6.44 KB, created by
Martin Renvoize (ashimema)
on 2019-02-28 13:58:05 UTC
(
hide
)
Description:
Bug 17702: Account types configuration - Manual invoice and credit
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2019-02-28 13:58:05 UTC
Size:
6.44 KB
patch
obsolete
>From 2c42c0fec65327f0e512610459a63acf9a2ea056 Mon Sep 17 00:00:00 2001 >From: Josef Moravec <josef.moravec@gmail.com> >Date: Wed, 23 Nov 2016 14:15:58 +0000 >Subject: [PATCH] Bug 17702: Account types configuration - Manual invoice and > credit > >--- > .../prog/en/modules/members/mancredit.tt | 16 +++++++--- > .../prog/en/modules/members/maninvoice.tt | 29 ++++++++++--------- > members/mancredit.pl | 2 ++ > members/maninvoice.pl | 4 +++ > 4 files changed, 34 insertions(+), 17 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/mancredit.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/mancredit.tt >index 5a74f115a9..88dddb5b81 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/mancredit.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/mancredit.tt >@@ -37,10 +37,14 @@ > > <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> >-</select></li> >+ <li> >+ <label for="type">Credit type: </label> >+ <select name="type" id="type"> >+ [% FOREACH credit_type IN credit_types %] >+ <option value="[% credit_type.type_code %]">[% credit_type.description %]</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> >@@ -69,6 +73,10 @@ > $(document).ready(function(){ > $('#mancredit').preventDoubleFormSubmit(); > $("fieldset.rows input, fieldset.rows select").addClass("noEnterSubmit"); >+ $("#mancredit #desc").val($("#mancredit #type option:selected").text()); >+ $("#mancredit #type").change(function(){ >+ $("#mancredit #desc").val($(this).find("option:selected").text()); >+ }); > }); > </script> > [% END %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/maninvoice.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/maninvoice.tt >index 672c4cbd76..6367600a10 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/maninvoice.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/maninvoice.tt >@@ -43,22 +43,18 @@ > <ol> > <li> > <label for="type">Type: </label> >- <select name="type" id="invoice_type"> >- <option value="L">Lost item</option> >- <option value="F">Fine</option> >- <option value="A">Account management fee</option> >- <option value="N">New card</option> >- <option value="M">Sundry</option> >- [% FOREACH invoice_types_loo IN invoice_types_loop %] >- <option value="[% invoice_types_loo.authorised_value | html %]">[% invoice_types_loo.authorised_value | html %]</option> >+ <select name="type" id="type"> >+ [% FOREACH debit_type IN debit_types %] >+ <option value="[% debit_type.type_code %]">[% debit_type.description %]</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" id="desc" size="50" /></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="number" name="amount" id="amount" required="required" value="" step="any" min="0" /> Example: 5.00</li> >- </ol></fieldset> >+ <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" id="desc" size="50" /></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="number" name="amount" id="amount" required="required" value="" step="any" min="0" /> Example: 5.00</li> >+ </ol> >+ </fieldset> > <fieldset class="action"><input type="submit" name="add" value="Save" /> <a class="cancel" href="/cgi-bin/koha/members/boraccount.pl?borrowernumber=[% patron.borrowernumber | html %]">Cancel</a></fieldset> > </form> > >@@ -90,8 +86,15 @@ > this.form.desc.value = this.options[this.selectedIndex].value; > this.form.amount.value = type_fees[this.options[this.selectedIndex].value]; > }); >+ $("#maninvoice #desc").val($("#maninvoice #type option:selected").text()); >+ $("#maninvoice #amount").val(type_fees[$("#maninvoice #type option:selected").val()]); >+ $("#maninvoice #type").change(function(){ >+ $("#maninvoice #desc").val($(this).find("option:selected").text()); >+ $("#maninvoice #amount").val(type_fees[$(this).val()]); >+ }); > }); > </script> > [% END %] > >+ > [% INCLUDE 'intranet-bottom.inc' %] >diff --git a/members/mancredit.pl b/members/mancredit.pl >index 014d822486..f6de8964b9 100755 >--- a/members/mancredit.pl >+++ b/members/mancredit.pl >@@ -37,6 +37,7 @@ use Koha::Items; > use Koha::Patrons; > use Koha::Patron::Categories; > use Koha::Token; >+use Koha::Account::CreditTypes; > > my $input=new CGI; > >@@ -115,6 +116,7 @@ if ($add){ > csrf_token => Koha::Token->new->generate_csrf( > { session_id => scalar $input->cookie('CGISESSID') } > ), >+ credit_types => \@credit_types, > ); > output_html_with_http_headers $input, $cookie, $template->output; > } >diff --git a/members/maninvoice.pl b/members/maninvoice.pl >index 2d22666bd5..a8c80d57f7 100755 >--- a/members/maninvoice.pl >+++ b/members/maninvoice.pl >@@ -37,6 +37,7 @@ use Koha::Items; > use Koha::Patrons; > > use Koha::Patron::Categories; >+use Koha::Account::DebitTypes; > > my $input=new CGI; > my $flagsrequired = { borrowers => 'edit_borrowers' }; >@@ -121,6 +122,9 @@ if ($add){ > } > $template->param( invoice_types_loop => \@invoice_types ); > >+ my @debit_types = Koha::Account::DebitTypes->search({ can_be_added_manually => 1 }); >+ $template->param( debit_types => \@debit_types ); >+ > if (C4::Context->preference('ExtendedPatronAttributes')) { > my $attributes = GetBorrowerAttributes($borrowernumber); > $template->param( >-- >2.20.1
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 17702
:
57856
|
57857
|
57858
|
58066
|
85874
|
85875
|
85876
|
85877
|
98564
|
98659
|
98660
|
99306
|
99307
|
99322
|
99454