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','DEBIG','Debit', 'Debit');
(-)a/installer/data/mysql/kohastructure.sql (+1 lines)
Lines 2703-2708 CREATE TABLE `accountlines` ( Link Here
2703
  `notify_level` int(2) NOT NULL default 0,
2703
  `notify_level` int(2) NOT NULL default 0,
2704
  `note` text NULL default NULL,
2704
  `note` text NULL default NULL,
2705
  `manager_id` int(11) NULL,
2705
  `manager_id` int(11) NULL,
2706
  `paymentmode` text COLLATE utf8_unicode_ci NOT NULL,
2706
  PRIMARY KEY (`accountlines_id`),
2707
  PRIMARY KEY (`accountlines_id`),
2707
  KEY `acctsborridx` (`borrowernumber`),
2708
  KEY `acctsborridx` (`borrowernumber`),
2708
  KEY `timeidx` (`timestamp`),
2709
  KEY `timeidx` (`timestamp`),
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt (+3 lines)
Lines 1-6 Link Here
1
[% USE Koha %]
1
[% USE Koha %]
2
[% USE KohaDates %]
2
[% USE KohaDates %]
3
[% USE ColumnsSettings %]
3
[% USE ColumnsSettings %]
4
[% USE AuthorisedValues %]
4
[% INCLUDE 'doc-head-open.inc' %]
5
[% INCLUDE 'doc-head-open.inc' %]
5
<title>Koha &rsaquo; Patrons &rsaquo; Account for [% INCLUDE 'patron-title.inc' %]</title>
6
<title>Koha &rsaquo; Patrons &rsaquo; Account for [% INCLUDE 'patron-title.inc' %]</title>
6
[% INCLUDE 'doc-head-close.inc' %]
7
[% INCLUDE 'doc-head-close.inc' %]
Lines 67-72 $(document).ready(function() { Link Here
67
          <th class="title-string">Date</th>
68
          <th class="title-string">Date</th>
68
          <th>Description of charges</th>
69
          <th>Description of charges</th>
69
          <th>Note</th>
70
          <th>Note</th>
71
          <th>Payment mode</th>
70
          <th>Amount</th>
72
          <th>Amount</th>
71
          <th>Outstanding</th>
73
          <th>Outstanding</th>
72
          [% IF ( reverse_col ) %]
74
          [% IF ( reverse_col ) %]
Lines 108-113 $(document).ready(function() { Link Here
108
        [%- IF account.description %], [% account.description %][% END %]
110
        [%- IF account.description %], [% account.description %][% END %]
109
        &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
        &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>
110
      <td>[% account.note | html_line_break %]</td>
112
      <td>[% account.note | html_line_break %]</td>
113
      <td>[% AuthorisedValues.GetByCode('PAYMODE',account.paymentmode) %]</td>
111
      [% IF ( account.amountcredit ) %]<td class="credit" style="text-align: right;">[% ELSE %]<td class="debit" style="text-align: right;">[% END %][% account.amount %]</td>
114
      [% IF ( account.amountcredit ) %]<td class="credit" style="text-align: right;">[% ELSE %]<td class="debit" style="text-align: right;">[% END %][% account.amount %]</td>
112
      [% IF ( account.amountoutstandingcredit ) %]<td class="credit" style="text-align: right;">[% ELSE %]<td class="debit" style="text-align: right;">[% END %][% account.amountoutstanding %]</td>
115
      [% IF ( account.amountoutstandingcredit ) %]<td class="credit" style="text-align: right;">[% ELSE %]<td class="debit" style="text-align: right;">[% END %][% account.amountoutstanding %]</td>
113
      <td class="actions">
116
      <td class="actions">
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/paycollect.tt (+19 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 148-153 function moneyFormat(textObj) { Link Here
148
            <!-- default to paying all -->
149
            <!-- default to paying all -->
149
        <input name="paid" id="paid" value="[% amountoutstanding | format('%.2f') %]" onchange="moneyFormat(document.payindivfine.paid)"/>
150
        <input name="paid" id="paid" value="[% amountoutstanding | format('%.2f') %]" onchange="moneyFormat(document.payindivfine.paid)"/>
150
    </li>
151
    </li>
152
    <li>
153
        <label for="paymentmode">Payment mode: </label>
154
        <select name="paymentmode" id="paymentmode">
155
            [% FOREACH paymentmode IN AuthorisedValues.GetAuthValueDropbox('PAYMODE') %]
156
                <option value="[% paymentmode.value %]">[% paymentmode.label %]</option>
157
            [% END %]
158
        </select>
159
    </li>
160
151
</ol>
161
</ol>
152
</fieldset>
162
</fieldset>
153
163
Lines 213-218 function moneyFormat(textObj) { Link Here
213
        <!-- default to paying all -->
223
        <!-- default to paying all -->
214
        <input name="paid" id="paid" value="[% total | format('%.2f') %]" onchange="moneyFormat(document.payfine.paid)"/>
224
        <input name="paid" id="paid" value="[% total | format('%.2f') %]" onchange="moneyFormat(document.payfine.paid)"/>
215
    </li>
225
    </li>
226
     <li>
227
         <label for="paymentmode">Payment mode: </label>
228
         <select name="paymentmode" id="paymentmode">
229
             [% FOREACH paymentmode IN AuthorisedValues.GetAuthValueDropbox('PAYMODE') %]
230
                 <option value="[% paymentmode.value %]">[% paymentmode.label %]</option>
231
             [% END %]
232
         </select>
233
     </li>
234
216
    <li>
235
    <li>
217
        <label for="selected_accts_notes">Note: </label>
236
        <label for="selected_accts_notes">Note: </label>
218
        <textarea name="selected_accts_notes" id="selected_accts_notes">[% selected_accts_notes %]</textarea>
237
        <textarea name="selected_accts_notes" id="selected_accts_notes">[% selected_accts_notes %]</textarea>
(-)a/members/paycollect.pl (-4 / +5 lines)
Lines 55-60 my $branch = C4::Context->userenv->{'branch'}; Link Here
55
55
56
my ( $total_due, $accts, $numaccts ) = GetMemberAccountRecords($borrowernumber);
56
my ( $total_due, $accts, $numaccts ) = GetMemberAccountRecords($borrowernumber);
57
my $total_paid = $input->param('paid');
57
my $total_paid = $input->param('paid');
58
my $paymentmode = $input->param('paymentmode');
58
59
59
my $individual   = $input->param('pay_individual');
60
my $individual   = $input->param('pay_individual');
60
my $writeoff     = $input->param('writeoff_individual');
61
my $writeoff     = $input->param('writeoff_individual');
Lines 117-123 if ( $total_paid and $total_paid ne '0.00' ) { Link Here
117
                    lines      => [$line],
118
                    lines      => [$line],
118
                    amount     => $total_paid,
119
                    amount     => $total_paid,
119
                    library_id => $branch,
120
                    library_id => $branch,
120
                    note       => $payment_note
121
                    note       => $payment_note,
122
                    paymentmode => $paymentmode,
121
                }
123
                }
122
            );
124
            );
123
            print $input->redirect(
125
            print $input->redirect(
Lines 129-135 if ( $total_paid and $total_paid ne '0.00' ) { Link Here
129
                }
131
                }
130
                my @acc = split /,/, $select;
132
                my @acc = split /,/, $select;
131
                my $note = $input->param('selected_accts_notes');
133
                my $note = $input->param('selected_accts_notes');
132
133
                my @lines = Koha::Account::Lines->search(
134
                my @lines = Koha::Account::Lines->search(
134
                    {
135
                    {
135
                        borrowernumber    => $borrowernumber,
136
                        borrowernumber    => $borrowernumber,
Lines 148-160 if ( $total_paid and $total_paid ne '0.00' ) { Link Here
148
                        amount => $total_paid,
149
                        amount => $total_paid,
149
                        lines  => \@lines,
150
                        lines  => \@lines,
150
                        note   => $note,
151
                        note   => $note,
152
                        paymentmode => $paymentmode,
151
                    }
153
                    }
152
                  );
154
                  );
153
            }
155
            }
154
            else {
156
            else {
155
                my $note = $input->param('selected_accts_notes');
157
                my $note = $input->param('selected_accts_notes');
156
                Koha::Account->new( { patron_id => $borrowernumber } )
158
                Koha::Account->new( { patron_id => $borrowernumber } )
157
                  ->pay( { amount => $total_paid, note => $note } );
159
                  ->pay( { amount => $total_paid, note => $note, paymentmode => $paymentmode } );
158
            }
160
            }
159
161
160
            print $input->redirect(
162
            print $input->redirect(
161
- 

Return to bug 5620