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

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/mancredit.tt (-4 / +12 lines)
Lines 37-46 Link Here
37
37
38
<fieldset class="rows">
38
<fieldset class="rows">
39
<legend>Manual credit</legend><ol>
39
<legend>Manual credit</legend><ol>
40
	<li><label for="type">Credit type: </label><select name="type" id="type">
40
    <li>
41
<option value="credit">Credit</option>
41
        <label for="type">Credit type: </label>
42
<option value="forgiven">Forgiven</option>
42
        <select name="type" id="type">
43
</select></li>
43
            [% FOREACH credit_type IN credit_types %]
44
                <option value="[% credit_type.type_code %]">[% credit_type.description %]</option>
45
            [% END %]
46
        </select>
47
    </li>
44
	<li><label for="barcode">Barcode: </label><input type="text" name="barcode" id="barcode" /></li>
48
	<li><label for="barcode">Barcode: </label><input type="text" name="barcode" id="barcode" /></li>
45
	<li><label for="desc">Description: </label><input type="text" name="desc" size="50" id="desc" /></li>
49
	<li><label for="desc">Description: </label><input type="text" name="desc" size="50" id="desc" /></li>
46
    <li><label for="note">Note: </label><input type="text" name="note" size="50" id="note" /></li>
50
    <li><label for="note">Note: </label><input type="text" name="note" size="50" id="note" /></li>
Lines 69-74 Link Here
69
        $(document).ready(function(){
73
        $(document).ready(function(){
70
            $('#mancredit').preventDoubleFormSubmit();
74
            $('#mancredit').preventDoubleFormSubmit();
71
            $("fieldset.rows input, fieldset.rows select").addClass("noEnterSubmit");
75
            $("fieldset.rows input, fieldset.rows select").addClass("noEnterSubmit");
76
            $("#mancredit #desc").val($("#mancredit #type option:selected").text());
77
            $("#mancredit #type").change(function(){
78
                $("#mancredit #desc").val($(this).find("option:selected").text());
79
            });
72
        });
80
        });
73
    </script>
81
    </script>
74
[% END %]
82
[% END %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/maninvoice.tt (-13 / +16 lines)
Lines 43-64 Link Here
43
	<ol>
43
	<ol>
44
      <li>
44
      <li>
45
        <label for="type">Type: </label>
45
        <label for="type">Type: </label>
46
        <select name="type" id="invoice_type">
46
        <select name="type" id="type">
47
          <option value="L">Lost item</option>
47
          [% FOREACH debit_type IN debit_types %]
48
          <option value="F">Fine</option>
48
            <option value="[% debit_type.type_code %]">[% debit_type.description %]</option>
49
          <option value="A">Account management fee</option>
50
          <option value="N">New card</option>
51
          <option value="M">Sundry</option>
52
          [% FOREACH invoice_types_loo IN invoice_types_loop %]
53
            <option value="[% invoice_types_loo.authorised_value | html %]">[% invoice_types_loo.authorised_value | html %]</option>
54
          [% END %]
49
          [% END %]
55
        </select>
50
        </select>
56
      </li>
51
      </li>
57
	<li><label for="barcode">Barcode: </label><input type="text" name="barcode" id="barcode" /></li>
52
   	  <li><label for="barcode">Barcode: </label><input type="text" name="barcode" id="barcode" /></li>
58
	<li><label for="desc">Description: </label><input type="text" name="desc" id="desc" size="50" /></li>
53
      <li><label for="desc">Description: </label><input type="text" name="desc" id="desc" size="50" /></li>
59
    <li><label for="note">Note: </label><input type="text" name="note" size="50" id="note" /></li>
54
      <li><label for="note">Note: </label><input type="text" name="note" size="50" id="note" /></li>
60
    <li><label for="amount">Amount: </label><input type="number" name="amount" id="amount" required="required" value="" step="any" min="0" /> Example: 5.00</li>
55
      <li><label for="amount">Amount: </label><input type="number" name="amount" id="amount" required="required" value="" step="any" min="0" /> Example: 5.00</li>
61
	</ol></fieldset>
56
	</ol>
57
    </fieldset>
62
<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>
58
<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>
63
</form>
59
</form>
64
60
Lines 90-97 Link Here
90
                this.form.desc.value = this.options[this.selectedIndex].value;
86
                this.form.desc.value = this.options[this.selectedIndex].value;
91
                this.form.amount.value = type_fees[this.options[this.selectedIndex].value];
87
                this.form.amount.value = type_fees[this.options[this.selectedIndex].value];
92
            });
88
            });
89
            $("#maninvoice #desc").val($("#maninvoice #type option:selected").text());
90
            $("#maninvoice #amount").val(type_fees[$("#maninvoice #type option:selected").val()]);
91
            $("#maninvoice #type").change(function(){
92
              $("#maninvoice #desc").val($(this).find("option:selected").text());
93
              $("#maninvoice #amount").val(type_fees[$(this).val()]);
94
            });
93
        });
95
        });
94
    </script>
96
    </script>
95
[% END %]
97
[% END %]
96
98
99
97
[% INCLUDE 'intranet-bottom.inc' %]
100
[% INCLUDE 'intranet-bottom.inc' %]
(-)a/members/mancredit.pl (+2 lines)
Lines 37-42 use Koha::Items; Link Here
37
use Koha::Patrons;
37
use Koha::Patrons;
38
use Koha::Patron::Categories;
38
use Koha::Patron::Categories;
39
use Koha::Token;
39
use Koha::Token;
40
use Koha::Account::CreditTypes;
40
41
41
my $input=new CGI;
42
my $input=new CGI;
42
43
Lines 115-120 if ($add){ Link Here
115
        csrf_token => Koha::Token->new->generate_csrf(
116
        csrf_token => Koha::Token->new->generate_csrf(
116
            { session_id => scalar $input->cookie('CGISESSID') }
117
            { session_id => scalar $input->cookie('CGISESSID') }
117
        ),
118
        ),
119
        credit_types => \@credit_types,
118
    );
120
    );
119
    output_html_with_http_headers $input, $cookie, $template->output;
121
    output_html_with_http_headers $input, $cookie, $template->output;
120
}
122
}
(-)a/members/maninvoice.pl (-1 / +4 lines)
Lines 37-42 use Koha::Items; Link Here
37
use Koha::Patrons;
37
use Koha::Patrons;
38
38
39
use Koha::Patron::Categories;
39
use Koha::Patron::Categories;
40
use Koha::Account::DebitTypes;
40
41
41
my $input=new CGI;
42
my $input=new CGI;
42
my $flagsrequired = { borrowers => 'edit_borrowers' };
43
my $flagsrequired = { borrowers => 'edit_borrowers' };
Lines 121-126 if ($add){ Link Here
121
  }
122
  }
122
  $template->param( invoice_types_loop => \@invoice_types );
123
  $template->param( invoice_types_loop => \@invoice_types );
123
124
125
    my @debit_types = Koha::Account::DebitTypes->search({ can_be_added_manually => 1 });
126
    $template->param( debit_types => \@debit_types );
127
124
    if (C4::Context->preference('ExtendedPatronAttributes')) {
128
    if (C4::Context->preference('ExtendedPatronAttributes')) {
125
        my $attributes = GetBorrowerAttributes($borrowernumber);
129
        my $attributes = GetBorrowerAttributes($borrowernumber);
126
        $template->param(
130
        $template->param(
127
- 

Return to bug 17702