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

(-)a/Koha/Account.pm (+4 lines)
Lines 68-73 sub pay { Link Here
68
    my $library_id      = $params->{library_id};
68
    my $library_id      = $params->{library_id};
69
    my $lines           = $params->{lines};
69
    my $lines           = $params->{lines};
70
    my $type            = $params->{type} || 'payment';
70
    my $type            = $params->{type} || 'payment';
71
    my $paymentmode     = $params->{paymentmode};
71
72
72
    my $userenv = C4::Context->userenv;
73
    my $userenv = C4::Context->userenv;
73
74
Lines 121-126 sub pay { Link Here
121
                        accountno             => $fine->accountno,
122
                        accountno             => $fine->accountno,
122
                        manager_id            => $manager_id,
123
                        manager_id            => $manager_id,
123
                        note                  => $note,
124
                        note                  => $note,
125
                        paymentmode           => $paymentmode,
124
                    }
126
                    }
125
                )
127
                )
126
            );
128
            );
Lines 164-169 sub pay { Link Here
164
                        accountno             => $fine->accountno,
166
                        accountno             => $fine->accountno,
165
                        manager_id            => $manager_id,
167
                        manager_id            => $manager_id,
166
                        note                  => $note,
168
                        note                  => $note,
169
                        paymentmode           => $paymentmode,
167
                    }
170
                    }
168
                )
171
                )
169
            );
172
            );
Lines 192-197 sub pay { Link Here
192
            amountoutstanding => 0 - $balance_remaining,
195
            amountoutstanding => 0 - $balance_remaining,
193
            manager_id        => $manager_id,
196
            manager_id        => $manager_id,
194
            note              => $note,
197
            note              => $note,
198
            paymentmode       => $paymentmode,
195
        }
199
        }
196
    )->store();
200
    )->store();
197
201
(-)a/Koha/Schema/Result/Accountline.pm (+2 lines)
Lines 169-174 __PACKAGE__->add_columns( Link Here
169
  { data_type => "text", is_nullable => 1 },
169
  { data_type => "text", is_nullable => 1 },
170
  "manager_id",
170
  "manager_id",
171
  { data_type => "integer", is_nullable => 1 },
171
  { data_type => "integer", is_nullable => 1 },
172
  "paymentmode",
173
  {data_type => "text", is_nullable => 0 },
172
);
174
);
173
175
174
=head1 PRIMARY KEY
176
=head1 PRIMARY KEY
(-)a/installer/data/mysql/atomicupdate/bug5620_Add_Mode_Of_Payment.sql (+6 lines)
Line 0 Link Here
1
ALTER table accountlines ADD COLUMN paymentmode TEXT NOT NULL;
2
INSERT INTO authorised_value_categories VALUES ('PAYMODE');
3
INSERT INTO  authorised_values (category, authorised_value, lib, lib_opac) VALUES
4
('PAYMODE','CASH', 'Cash', 'Cash'),
5
('PAYMODE','CC', 'Credit Card', 'Credit Card'),
6
('PAYMODE','DEBIT', 'Debit', 'Debit');
(-)a/installer/data/mysql/kohastructure.sql (+1 lines)
Lines 2726-2731 CREATE TABLE `accountlines` ( Link Here
2726
  `notify_level` int(2) NOT NULL default 0,
2726
  `notify_level` int(2) NOT NULL default 0,
2727
  `note` text NULL default NULL,
2727
  `note` text NULL default NULL,
2728
  `manager_id` int(11) NULL,
2728
  `manager_id` int(11) NULL,
2729
  `paymentmode` text COLLATE utf8_unicode_ci NOT NULL,
2729
  PRIMARY KEY (`accountlines_id`),
2730
  PRIMARY KEY (`accountlines_id`),
2730
  KEY `acctsborridx` (`borrowernumber`),
2731
  KEY `acctsborridx` (`borrowernumber`),
2731
  KEY `timeidx` (`timestamp`),
2732
  KEY `timeidx` (`timestamp`),
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt (+3 lines)
Lines 2-7 Link Here
2
[% USE KohaDates %]
2
[% USE KohaDates %]
3
[% USE ColumnsSettings %]
3
[% USE ColumnsSettings %]
4
[% USE Price %]
4
[% USE Price %]
5
[% USE AuthorisedValues %]
5
[% INCLUDE 'doc-head-open.inc' %]
6
[% INCLUDE 'doc-head-open.inc' %]
6
<title>Koha &rsaquo; Patrons &rsaquo; Account for [% INCLUDE 'patron-title.inc' %]</title>
7
<title>Koha &rsaquo; Patrons &rsaquo; Account for [% INCLUDE 'patron-title.inc' %]</title>
7
[% INCLUDE 'doc-head-close.inc' %]
8
[% INCLUDE 'doc-head-close.inc' %]
Lines 68-73 $(document).ready(function() { Link Here
68
          <th class="title-string">Date</th>
69
          <th class="title-string">Date</th>
69
          <th>Description of charges</th>
70
          <th>Description of charges</th>
70
          <th>Note</th>
71
          <th>Note</th>
72
          <th>Payment mode</th>
71
          <th>Amount</th>
73
          <th>Amount</th>
72
          <th>Outstanding</th>
74
          <th>Outstanding</th>
73
          [% IF ( reverse_col ) %]
75
          [% IF ( reverse_col ) %]
Lines 109-114 $(document).ready(function() { Link Here
109
        [%- IF account.description %], [% account.description %][% END %]
111
        [%- IF account.description %], [% account.description %][% END %]
110
        &nbsp;[% IF ( account.itemnumber ) %]<a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=[% account.biblionumber %]&amp;itemnumber=[% account.itemnumber %]">[% account.title |html %]</a>[% END %]</td>
112
        &nbsp;[% IF ( account.itemnumber ) %]<a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=[% account.biblionumber %]&amp;itemnumber=[% account.itemnumber %]">[% account.title |html %]</a>[% END %]</td>
111
      <td>[% account.note | html_line_break %]</td>
113
      <td>[% account.note | html_line_break %]</td>
114
      <td>[% AuthorisedValues.GetByCode('PAYMODE',account.paymentmode) %]</td>
112
      [% IF ( account.amountcredit ) %]<td class="credit" style="text-align: right;">[% ELSE %]<td class="debit" style="text-align: right;">[% END %][% account.amount | $Price %]</td>
115
      [% IF ( account.amountcredit ) %]<td class="credit" style="text-align: right;">[% ELSE %]<td class="debit" style="text-align: right;">[% END %][% account.amount | $Price %]</td>
113
      [% IF ( account.amountoutstandingcredit ) %]<td class="credit" style="text-align: right;">[% ELSE %]<td class="debit" style="text-align: right;">[% END %][% account.amountoutstanding | $Price %]</td>
116
      [% IF ( account.amountoutstandingcredit ) %]<td class="credit" style="text-align: right;">[% ELSE %]<td class="debit" style="text-align: right;">[% END %][% account.amountoutstanding | $Price %]</td>
114
      <td class="actions">
117
      <td class="actions">
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/paycollect.tt (-7 / +24 lines)
Lines 1-5 Link Here
1
[% USE Koha %]
1
[% USE Koha %]
2
[% USE Branches %]
2
[% USE Branches %]
3
[% USE AuthorisedValues %]
3
[% INCLUDE 'doc-head-open.inc' %]
4
[% INCLUDE 'doc-head-open.inc' %]
4
<title>Koha &rsaquo; Patrons &rsaquo; Collect fine payment for  [% borrower.firstname %] [% borrower.surname %]</title>
5
<title>Koha &rsaquo; Patrons &rsaquo; Collect fine payment for  [% borrower.firstname %] [% borrower.surname %]</title>
5
[% INCLUDE 'doc-head-close.inc' %]
6
[% INCLUDE 'doc-head-close.inc' %]
Lines 147-152 function moneyFormat(textObj) { Link Here
147
            <!-- default to paying all -->
148
            <!-- default to paying all -->
148
        <input name="paid" id="paid" value="[% amountoutstanding | format('%.2f') %]" />
149
        <input name="paid" id="paid" value="[% amountoutstanding | format('%.2f') %]" />
149
    </li>
150
    </li>
151
    <li>
152
        <label for="paymentmode">Payment mode: </label>
153
        <select name="paymentmode" id="paymentmode">
154
            [% FOREACH paymentmode IN AuthorisedValues.GetAuthValueDropbox('PAYMODE') %]
155
                <option value="[% paymentmode.authorised_value %]">[% paymentmode.lib %]</option>
156
            [% END %]
157
        </select>
158
    </li>
150
</ol>
159
</ol>
151
</fieldset>
160
</fieldset>
152
161
Lines 206-220 function moneyFormat(textObj) { Link Here
206
            <span class="label">Total amount outstanding: </span>
215
            <span class="label">Total amount outstanding: </span>
207
            <span class="debit">[% total | format('%.2f') %]</span>
216
            <span class="debit">[% total | format('%.2f') %]</span>
208
        </li>
217
        </li>
209
    <li>
218
        <li>
210
        <label for="paid">Collect from patron: </label>
219
            <label for="paid">Collect from patron: </label>
211
        <!-- default to paying all -->
220
            <!-- default to paying all -->
212
        <input name="paid" id="paid" value="[% total | format('%.2f') %]" />
221
            <input name="paid" id="paid" value="[% total | format('%.2f') %]" />
213
    </li>
222
        </li>
214
    <li>
223
        <li>
224
             <label for="paymentmode">Payment mode: </label>
225
             <select name="paymentmode" id="paymentmode">
226
                 [% FOREACH paymentmode IN AuthorisedValues.GetAuthValueDropbox('PAYMODE') %]
227
                    <option value="[% paymentmode.authorised_value %]">[% paymentmode.lib %]</option>
228
                 [% END %]
229
             </select>
230
         </li>
231
        <li>
215
        <label for="selected_accts_notes">Note: </label>
232
        <label for="selected_accts_notes">Note: </label>
216
        <textarea name="selected_accts_notes" id="selected_accts_notes">[% selected_accts_notes %]</textarea>
233
        <textarea name="selected_accts_notes" id="selected_accts_notes">[% selected_accts_notes %]</textarea>
217
    </li>
234
        </li>
218
    </ol>
235
    </ol>
219
    </fieldset>
236
    </fieldset>
220
    <div class="action"><input type="submit" name="submitbutton" value="Confirm" />
237
    <div class="action"><input type="submit" name="submitbutton" value="Confirm" />
(-)a/members/paycollect.pl (-4 / +5 lines)
Lines 64-69 my $branch = C4::Context->userenv->{'branch'}; Link Here
64
64
65
my ( $total_due, $accts, $numaccts ) = GetMemberAccountRecords($borrowernumber);
65
my ( $total_due, $accts, $numaccts ) = GetMemberAccountRecords($borrowernumber);
66
my $total_paid = $input->param('paid');
66
my $total_paid = $input->param('paid');
67
my $paymentmode = $input->param('paymentmode');
67
68
68
my $individual   = $input->param('pay_individual');
69
my $individual   = $input->param('pay_individual');
69
my $writeoff     = $input->param('writeoff_individual');
70
my $writeoff     = $input->param('writeoff_individual');
Lines 123-129 if ( $total_paid and $total_paid ne '0.00' ) { Link Here
123
                    lines      => [$line],
124
                    lines      => [$line],
124
                    amount     => $total_paid,
125
                    amount     => $total_paid,
125
                    library_id => $branch,
126
                    library_id => $branch,
126
                    note       => $payment_note
127
                    note       => $payment_note,
128
                    paymentmode => $paymentmode,
127
                }
129
                }
128
            );
130
            );
129
            print $input->redirect(
131
            print $input->redirect(
Lines 135-141 if ( $total_paid and $total_paid ne '0.00' ) { Link Here
135
                }
137
                }
136
                my @acc = split /,/, $select;
138
                my @acc = split /,/, $select;
137
                my $note = $input->param('selected_accts_notes');
139
                my $note = $input->param('selected_accts_notes');
138
139
                my @lines = Koha::Account::Lines->search(
140
                my @lines = Koha::Account::Lines->search(
140
                    {
141
                    {
141
                        borrowernumber    => $borrowernumber,
142
                        borrowernumber    => $borrowernumber,
Lines 154-166 if ( $total_paid and $total_paid ne '0.00' ) { Link Here
154
                        amount => $total_paid,
155
                        amount => $total_paid,
155
                        lines  => \@lines,
156
                        lines  => \@lines,
156
                        note   => $note,
157
                        note   => $note,
158
                        paymentmode => $paymentmode,
157
                    }
159
                    }
158
                  );
160
                  );
159
            }
161
            }
160
            else {
162
            else {
161
                my $note = $input->param('selected_accts_notes');
163
                my $note = $input->param('selected_accts_notes');
162
                Koha::Account->new( { patron_id => $borrowernumber } )
164
                Koha::Account->new( { patron_id => $borrowernumber } )
163
                  ->pay( { amount => $total_paid, note => $note } );
165
                  ->pay( { amount => $total_paid, note => $note, paymentmode => $paymentmode } );
164
            }
166
            }
165
167
166
            print $input->redirect(
168
            print $input->redirect(
167
- 

Return to bug 5620