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

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/mancredit.tt (-1 / +1 lines)
Lines 83-89 Link Here
83
                                    <li><label for="barcode">Barcode: </label><input type="text" name="barcode" id="barcode" /></li>
83
                                    <li><label for="barcode">Barcode: </label><input type="text" name="barcode" id="barcode" /></li>
84
                                    <li><label for="desc">Description: </label><input type="text" name="desc" size="50" id="desc" /></li>
84
                                    <li><label for="desc">Description: </label><input type="text" name="desc" size="50" id="desc" /></li>
85
                                    <li><label for="note">Note: </label><input type="text" name="note" size="50" id="note" /></li>
85
                                    <li><label for="note">Note: </label><input type="text" name="note" size="50" id="note" /></li>
86
                                    <li><label for="amount" class="required">Amount: </label><input type="text" inputmode="decimal" pattern="^\d+(\.\d{2})?$" name="amount" id="amount" required="required" min="0" value=""/> Example: 5[% IF Koha.Preference("CurrencyFormat") == 'FR' %],[% ELSE %].[% END %]12</li>
86
                                    <li><label for="amount" class="required">Amount: </label><input type="text" inputmode="decimal" pattern=[% decimal_input_pattern %] name="amount" id="amount" required="required" value=""/> Example: 5[% decimal_delimiter | html %]12</li>
87
                                    [% INCLUDE 'transaction_types.inc' type="credit" %]
87
                                    [% INCLUDE 'transaction_types.inc' type="credit" %]
88
                                    [% IF Koha.Preference('UseCashRegisters') %]
88
                                    [% IF Koha.Preference('UseCashRegisters') %]
89
                                    <li>
89
                                    <li>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/maninvoice.tt (-31 / +3 lines)
Lines 16-50 Link Here
16
[% WRAPPER 'header.inc' %]
16
[% WRAPPER 'header.inc' %]
17
    [% INCLUDE 'patron-search-header.inc' %]
17
    [% INCLUDE 'patron-search-header.inc' %]
18
[% END %]
18
[% END %]
19
<<<<<<< HEAD
20
=======
21
[% ELSE %]
22
<form action="/cgi-bin/koha/members/maninvoice.pl" method="post" id="maninvoice"><input type="hidden" name="borrowernumber" id="borrowernumber" value="[% patron.borrowernumber | html %]" />
23
    <input type="hidden" name="csrf_token" value="[% csrf_token | html %]" />
24
	<fieldset class="rows">
25
	<legend>Manual invoice</legend>
26
	<ol>
27
      <li>
28
        <label for="type">Type: </label>
29
        <select name="type" id="invoice_type">
30
          <option value="L">Lost item</option>
31
          <option value="F">Fine</option>
32
          <option value="A">Account management fee</option>
33
          <option value="N">New card</option>
34
          <option value="M">Sundry</option>
35
          [% FOREACH invoice_types_loo IN invoice_types_loop %]
36
            <option value="[% invoice_types_loo.authorised_value | html %]">[% invoice_types_loo.authorised_value | html %]</option>
37
          [% END %]
38
        </select>
39
      </li>
40
	<li><label for="barcode">Barcode: </label><input type="text" name="barcode" id="barcode" /></li>
41
	<li><label for="desc">Description: </label><input type="text" name="desc" id="desc" size="50" /></li>
42
    <li><label for="note">Note: </label><input type="text" name="note" size="50" id="note" /></li>
43
    <li><label for="amount">Amount: </label><input name="amount" id="amount" value="" /> <span>Example:</span> 5[% IF Koha.Preference("CurrencyFormat") == 'FR' %],[% ELSE %].[% END %]12</li>
44
	</ol></fieldset>
45
<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>
46
</form>
47
>>>>>>> WIP Bug 21507 - Fix decimal separators issues in patrons payments/fines
48
19
49
[% WRAPPER 'sub-header.inc' %]
20
[% WRAPPER 'sub-header.inc' %]
50
<nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb">
21
<nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb">
Lines 124-130 Link Here
124
                            <li><label for="barcode">Barcode: </label><input type="text" name="barcode" id="barcode" value="[% barcode | html %]" /></li>
95
                            <li><label for="barcode">Barcode: </label><input type="text" name="barcode" id="barcode" value="[% barcode | html %]" /></li>
125
                            <li><label for="desc">Description: </label><input type="text" name="desc" id="desc" size="50" value="[% desc | html %]" /></li>
96
                            <li><label for="desc">Description: </label><input type="text" name="desc" id="desc" size="50" value="[% desc | html %]" /></li>
126
                            <li><label for="note">Note: </label><input type="text" name="note" size="50" id="note" value="[% note | html %]" /></li>
97
                            <li><label for="note">Note: </label><input type="text" name="note" size="50" id="note" value="[% note | html %]" /></li>
127
                            <li><label for="amount">Amount: </label><input type="text" inputmode="decimal" pattern="^\d+(\.\d{2})?$" name="amount" id="amount" required="required" min="0" value="[% amount | $Price on_editing => 1 %]" /> Example: 5[% IF Koha.Preference("CurrencyFormat") == 'FR' %],[% ELSE %].[% END %]12</li>
98
                            
99
                                <li><label for="amount">Amount: </label><input type="text" inputmode="decimal" pattern=[% decimal_input_pattern %] name="amount" id="amount" required="required" value="[% amount | $Price on_editing => 1 %]" /> 5[% decimal_delimiter | html %]12</li>
128
                        </ol>
100
                        </ol>
129
                    </fieldset>
101
                    </fieldset>
130
102
Lines 185-191 Link Here
185
            $("#maninvoice #type").change(function(){
157
            $("#maninvoice #type").change(function(){
186
                $("#maninvoice #desc").val($(this).find("option:selected").text());
158
                $("#maninvoice #desc").val($(this).find("option:selected").text());
187
                $("#maninvoice #amount").val(type_fees[$(this).val()]);
159
                $("#maninvoice #amount").val(type_fees[$(this).val()]);
188
160
            });
189
        });
161
        });
190
    </script>
162
    </script>
191
[% END %]
163
[% END %]
(-)a/members/mancredit.pl (+12 lines)
Lines 68-73 output_and_exit_if_error( Link Here
68
my $library_id =
68
my $library_id =
69
  C4::Context->userenv ? C4::Context->userenv->{'branch'} : undef;
69
  C4::Context->userenv ? C4::Context->userenv->{'branch'} : undef;
70
70
71
my $decimal_delimiter =
72
  C4::Context->preference('CurrencyFormat') eq 'FR' ? ',' : '.';
73
my $decimal_input_pattern =
74
  C4::Context->preference('CurrencyFormat') eq 'FR'
75
  ? '^\d+(\,\d{2})?$'
76
  : '^\d+(\.\d{2})?$';
77
$template->param(
78
    decimal_delimiter     => $decimal_delimiter,
79
    decimal_input_pattern => $decimal_input_pattern,
80
);
81
71
my $add = $input->param('add');
82
my $add = $input->param('add');
72
if ($add) {
83
if ($add) {
73
    output_and_exit( $input, $cookie, $template, 'wrong_csrf_token' )
84
    output_and_exit( $input, $cookie, $template, 'wrong_csrf_token' )
Lines 89-94 if ($add) { Link Here
89
    my $description      = $input->param('desc');
100
    my $description      = $input->param('desc');
90
    my $note             = $input->param('note');
101
    my $note             = $input->param('note');
91
    my $amount           = $input->param('amount') || 0;
102
    my $amount           = $input->param('amount') || 0;
103
    $amount              = Koha::Number::Price->new($amount)->unformat();
92
    my $type             = $input->param('type');
104
    my $type             = $input->param('type');
93
    my $credit_type      = $input->param('credit_type');
105
    my $credit_type      = $input->param('credit_type');
94
    my $cash_register_id = $input->param('cash_register');
106
    my $cash_register_id = $input->param('cash_register');
(-)a/members/maninvoice.pl (-12 / +22 lines)
Lines 43-48 use Koha::Patron::Categories; Link Here
43
use Koha::Account::DebitTypes;
43
use Koha::Account::DebitTypes;
44
use Koha::AdditionalFields;
44
use Koha::AdditionalFields;
45
use Koha::Number::Price;
45
use Koha::Number::Price;
46
use C4::Context;
46
47
47
my $input = CGI->new;
48
my $input = CGI->new;
48
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
49
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
Lines 82-95 my $amount = $input->param('amount'); Link Here
82
my $note       = $input->param('note');
83
my $note       = $input->param('note');
83
my $debit_type = $input->param('type');
84
my $debit_type = $input->param('type');
84
my $barcode    = $input->param('barcode');
85
my $barcode    = $input->param('barcode');
86
my $decimal_delimiter =
87
  C4::Context->preference('CurrencyFormat') eq 'FR' ? ',' : '.';
88
my $decimal_input_pattern =
89
  C4::Context->preference('CurrencyFormat') eq 'FR'
90
  ? '^\d+(\,\d{2})?$'
91
  : '^\d+(\.\d{2})?$';
85
$template->param(
92
$template->param(
86
    desc    => $desc,
93
    desc                  => $desc,
87
    amount  => $amount,
94
    amount                => $amount,
88
    note    => $note,
95
    note                  => $note,
89
    type    => $debit_type,
96
    type                  => $debit_type,
90
    barcode => $barcode
97
    barcode               => $barcode,
98
    decimal_delimiter     => $decimal_delimiter,
99
    decimal_input_pattern => $decimal_input_pattern,
91
);
100
);
92
101
102
93
my $add = $input->param('add');
103
my $add = $input->param('add');
94
if ($add) {
104
if ($add) {
95
    output_and_exit( $input, $cookie, $template, 'wrong_csrf_token' )
105
    output_and_exit( $input, $cookie, $template, 'wrong_csrf_token' )
Lines 102-112 if ($add) { Link Here
102
112
103
    # Note: If the logged in user is not allowed to see this patron an invoice can be forced
113
    # Note: If the logged in user is not allowed to see this patron an invoice can be forced
104
    # Here we are trusting librarians not to hack the system
114
    # Here we are trusting librarians not to hack the system
105
    my $desc       = $input->param('desc');
115
    my $desc        = $input->param('desc');
106
    my $amount     = $input->param('amount');
116
    my $amount      = $input->param('amount');
107
    $amount=Koha::Number::Price->new( $amount )->unformat();
117
    $amount         = Koha::Number::Price->new($amount)->unformat();
108
    my $note       = $input->param('note');
118
    my $note        = $input->param('note');
109
    my $debit_type = $input->param('type');
119
    my $debit_type  = $input->param('type');
120
110
121
111
    # If barcode is passed, attempt to find the associated item
122
    # If barcode is passed, attempt to find the associated item
112
    my $failed;
123
    my $failed;
Lines 164-170 if ($add) { Link Here
164
                    library_id  => $library_id,
175
                    library_id  => $library_id,
165
                    type        => $debit_type,
176
                    type        => $debit_type,
166
                    ( $olditem ? () : ( item_id => $item_id ) ),
177
                    ( $olditem ? () : ( item_id => $item_id ) ),
167
                    issue_id    => $issue_id
178
                    issue_id    => $issue_id,
168
                }
179
                }
169
            );
180
            );
170
181
171
- 

Return to bug 21507