Bugzilla – Attachment 57857 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.20 KB, created by
Josef Moravec
on 2016-12-01 12:54:26 UTC
(
hide
)
Description:
Bug 17702: Account types configuration - Manual invoice and credit
Filename:
MIME Type:
Creator:
Josef Moravec
Created:
2016-12-01 12:54:26 UTC
Size:
6.20 KB
patch
obsolete
>From 4b9400f6e1abf405a589e08f371967cbaf0a0507 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 | 13 +++++++-- > .../prog/en/modules/members/maninvoice.tt | 34 ++++++++++------------ > members/mancredit.pl | 5 ++++ > members/maninvoice.pl | 14 +++------ > 4 files changed, 34 insertions(+), 32 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 65a61a5..bab7e7d 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/mancredit.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/mancredit.tt >@@ -7,6 +7,11 @@ > $(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> >@@ -39,9 +44,11 @@ $(document).ready(function(){ > > <fieldset class="rows"> > <legend>Manual credit</legend><ol> >- <li><label for="type">Credit type: </label><select name="type" id="type"> >-<option value="C">Credit</option> >-<option value="FOR">Forgiven</option> >+ <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> >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 7d35c73..711214b 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/maninvoice.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/maninvoice.tt >@@ -7,6 +7,18 @@ > $(document).ready(function(){ > $('#maninvoice').preventDoubleFormSubmit(); > $("fieldset.rows input, fieldset.rows select").addClass("noEnterSubmit"); >+ var type_fees = new Array(); >+ [% FOREACH debit_type IN debit_types %] >+ type_fees['[% debit_type.type_code %]'] = "[% debit_type.default_amount %]"; >+ [% END %] >+ >+ $("#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> >@@ -44,26 +56,10 @@ $(document).ready(function(){ > <legend>Manual invoice</legend> > <ol> > <li> >-<script type="text/javascript"> >-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 %] >-</script> > <label for="type">Type: </label> >- <select name="type" id="type" onchange="this.form.desc.value=this.options[this.selectedIndex].value; this.form.amount.value=type_fees[this.options[this.selectedIndex].value];"> >- <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 %]">[% invoice_types_loo.authorised_value %]</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> >diff --git a/members/mancredit.pl b/members/mancredit.pl >index 76b3492..32904ed 100755 >--- a/members/mancredit.pl >+++ b/members/mancredit.pl >@@ -36,6 +36,7 @@ use C4::Members::Attributes qw(GetBorrowerAttributes); > use Koha::Patron::Images; > > use Koha::Patron::Categories; >+use Koha::Account::CreditTypes; > > my $input=new CGI; > my $flagsrequired = { borrowers => 1, updatecharges => 1 }; >@@ -92,6 +93,10 @@ if ($add){ > ); > } > >+ my @credit_types = Koha::Account::CreditTypes->search({ can_be_added_manually => 1 }); >+ >+ $template->param( credit_types => \@credit_types ); >+ > $template->param(%$data); > > $template->param( >diff --git a/members/maninvoice.pl b/members/maninvoice.pl >index 906e2fe..34bb58c 100755 >--- a/members/maninvoice.pl >+++ b/members/maninvoice.pl >@@ -35,6 +35,7 @@ use C4::Members::Attributes qw(GetBorrowerAttributes); > use Koha::Patron::Images; > > use Koha::Patron::Categories; >+use Koha::Account::DebitTypes; > > my $input=new CGI; > my $flagsrequired = { borrowers => 1 }; >@@ -89,16 +90,9 @@ if ($add){ > updatecharges => 'remaining_permissions' }, > debug => 1, > }); >- >- # get authorised values with type of MANUAL_INV >- my @invoice_types; >- my $dbh = C4::Context->dbh; >- my $sth = $dbh->prepare('SELECT * FROM authorised_values WHERE category = "MANUAL_INV"'); >- $sth->execute(); >- while ( my $row = $sth->fetchrow_hashref() ) { >- push @invoice_types, $row; >- } >- $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 ( $data->{'category_type'} eq 'C') { > my $patron_categories = Koha::Patron::Categories->search_limited({ category_type => 'A' }, {order_by => ['categorycode']}); >-- >2.1.4
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