View | Details | Raw Unified | Return to bug 17702
Collapse All | Expand All

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/mancredit.tt (-3 / +10 lines)
Lines 7-12 Link Here
7
$(document).ready(function(){
7
$(document).ready(function(){
8
        $('#mancredit').preventDoubleFormSubmit();
8
        $('#mancredit').preventDoubleFormSubmit();
9
        $("fieldset.rows input, fieldset.rows select").addClass("noEnterSubmit");
9
        $("fieldset.rows input, fieldset.rows select").addClass("noEnterSubmit");
10
11
        $("#mancredit #desc").val($("#mancredit #type option:selected").text());
12
        $("#mancredit #type").change(function(){
13
            $("#mancredit #desc").val($(this).find("option:selected").text());
14
        });
10
});
15
});
11
//]]>
16
//]]>
12
</script>
17
</script>
Lines 39-47 $(document).ready(function(){ Link Here
39
44
40
<fieldset class="rows">
45
<fieldset class="rows">
41
<legend>Manual credit</legend><ol>
46
<legend>Manual credit</legend><ol>
42
	<li><label for="type">Credit type: </label><select name="type" id="type">
47
    <li><label for="type">Credit type: </label>
43
<option value="C">Credit</option>
48
    <select name="type" id="type">
44
<option value="FOR">Forgiven</option>
49
    [% FOREACH credit_type IN credit_types %]
50
        <option value="[% credit_type.type_code %]">[% credit_type.description %]</option>
51
    [% END %]
45
</select></li>
52
</select></li>
46
	<li><label for="barcode">Barcode: </label><input type="text" name="barcode" id="barcode" /></li>
53
	<li><label for="barcode">Barcode: </label><input type="text" name="barcode" id="barcode" /></li>
47
	<li><label for="desc">Description: </label><input type="text" name="desc" size="50" id="desc" /></li>
54
	<li><label for="desc">Description: </label><input type="text" name="desc" size="50" id="desc" /></li>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/maninvoice.tt (-19 / +15 lines)
Lines 7-12 Link Here
7
$(document).ready(function(){
7
$(document).ready(function(){
8
        $('#maninvoice').preventDoubleFormSubmit();
8
        $('#maninvoice').preventDoubleFormSubmit();
9
        $("fieldset.rows input, fieldset.rows select").addClass("noEnterSubmit");
9
        $("fieldset.rows input, fieldset.rows select").addClass("noEnterSubmit");
10
        var type_fees = new Array();
11
        [% FOREACH debit_type IN debit_types %]
12
            type_fees['[% debit_type.type_code %]'] = "[% debit_type.default_amount %]";
13
        [% END %]
14
15
        $("#maninvoice #desc").val($("#maninvoice #type option:selected").text());
16
        $("#maninvoice #amount").val(type_fees[$("#maninvoice #type option:selected").val()]);
17
18
        $("#maninvoice #type").change(function(){
19
            $("#maninvoice #desc").val($(this).find("option:selected").text());
20
            $("#maninvoice #amount").val(type_fees[$(this).val()]);
21
        });
10
});
22
});
11
//]]>
23
//]]>
12
</script>
24
</script>
Lines 44-69 $(document).ready(function(){ Link Here
44
	<legend>Manual invoice</legend>
56
	<legend>Manual invoice</legend>
45
	<ol>
57
	<ol>
46
      <li>
58
      <li>
47
<script type="text/javascript">
48
var type_fees = new Array();
49
type_fees['L'] = '';
50
type_fees['F'] = '';
51
type_fees['A'] = '';
52
type_fees['N'] = '';
53
type_fees['M'] = '';
54
[% FOREACH invoice_types_loo IN invoice_types_loop %]
55
type_fees['[% invoice_types_loo.authorised_value %]'] = "[% invoice_types_loo.lib %]";
56
[% END %]
57
</script>
58
        <label for="type">Type: </label>
59
        <label for="type">Type: </label>
59
        <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];">
60
        <select name="type" id="type">
60
          <option value="L">Lost item</option>
61
          [% FOREACH debit_type IN debit_types %]
61
          <option value="F">Fine</option>
62
            <option value="[% debit_type.type_code %]">[% debit_type.description %]</option>
62
          <option value="A">Account management fee</option>
63
          <option value="N">New card</option>
64
          <option value="M">Sundry</option>
65
          [% FOREACH invoice_types_loo IN invoice_types_loop %]
66
            <option value="[% invoice_types_loo.authorised_value %]">[% invoice_types_loo.authorised_value %]</option>
67
          [% END %]
63
          [% END %]
68
        </select>
64
        </select>
69
      </li>
65
      </li>
(-)a/members/mancredit.pl (+5 lines)
Lines 36-41 use C4::Members::Attributes qw(GetBorrowerAttributes); Link Here
36
use Koha::Patron::Images;
36
use Koha::Patron::Images;
37
37
38
use Koha::Patron::Categories;
38
use Koha::Patron::Categories;
39
use Koha::Account::CreditTypes;
39
40
40
my $input=new CGI;
41
my $input=new CGI;
41
my $flagsrequired = { borrowers => 1, updatecharges => 1 };
42
my $flagsrequired = { borrowers => 1, updatecharges => 1 };
Lines 92-97 if ($add){ Link Here
92
        );
93
        );
93
    }
94
    }
94
95
96
    my @credit_types = Koha::Account::CreditTypes->search({ can_be_added_manually => 1 });
97
98
    $template->param( credit_types => \@credit_types );
99
95
    $template->param(%$data);
100
    $template->param(%$data);
96
101
97
    $template->param(
102
    $template->param(
(-)a/members/maninvoice.pl (-11 / +4 lines)
Lines 35-40 use C4::Members::Attributes qw(GetBorrowerAttributes); Link Here
35
use Koha::Patron::Images;
35
use Koha::Patron::Images;
36
36
37
use Koha::Patron::Categories;
37
use Koha::Patron::Categories;
38
use Koha::Account::DebitTypes;
38
39
39
my $input=new CGI;
40
my $input=new CGI;
40
my $flagsrequired = { borrowers => 1 };
41
my $flagsrequired = { borrowers => 1 };
Lines 89-104 if ($add){ Link Here
89
                             updatecharges => 'remaining_permissions' },
90
                             updatecharges => 'remaining_permissions' },
90
        debug           => 1,
91
        debug           => 1,
91
    });
92
    });
92
					
93
93
  # get authorised values with type of MANUAL_INV
94
    my @debit_types = Koha::Account::DebitTypes->search({ can_be_added_manually => 1 });
94
  my @invoice_types;
95
    $template->param( debit_types => \@debit_types );
95
  my $dbh = C4::Context->dbh;
96
  my $sth = $dbh->prepare('SELECT * FROM authorised_values WHERE category = "MANUAL_INV"');
97
  $sth->execute();
98
  while ( my $row = $sth->fetchrow_hashref() ) {
99
    push @invoice_types, $row;
100
  }
101
  $template->param( invoice_types_loop => \@invoice_types );
102
96
103
    if ( $data->{'category_type'} eq 'C') {
97
    if ( $data->{'category_type'} eq 'C') {
104
        my $patron_categories = Koha::Patron::Categories->search_limited({ category_type => 'A' }, {order_by => ['categorycode']});
98
        my $patron_categories = Koha::Patron::Categories->search_limited({ category_type => 'A' }, {order_by => ['categorycode']});
105
- 

Return to bug 17702