From 2c42c0fec65327f0e512610459a63acf9a2ea056 Mon Sep 17 00:00:00 2001 From: Josef Moravec 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 @@
Manual credit
    -
  1. +
  2. + + +
  3. @@ -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()); + }); }); [% 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 @@
    1. - + [% FOREACH debit_type IN debit_types %] + [% END %]
    2. -
    3. -
    4. -
    5. -
    6. Example: 5.00
    7. -
+
  • +
  • +
  • +
  • Example: 5.00
  • + +
    Cancel
    @@ -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()]); + }); }); [% 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