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

(-)a/C4/Accounts.pm (-4 / +4 lines)
Lines 789-795 will be credited to the next one. Link Here
789
=cut
789
=cut
790
790
791
sub recordpayment_selectaccts {
791
sub recordpayment_selectaccts {
792
    my ( $borrowernumber, $amount, $accts ) = @_;
792
    my ( $borrowernumber, $amount, $accts, $note ) = @_;
793
793
794
    my $dbh        = C4::Context->dbh;
794
    my $dbh        = C4::Context->dbh;
795
    my $newamtos   = 0;
795
    my $newamtos   = 0;
Lines 849-857 sub recordpayment_selectaccts { Link Here
849
849
850
    # create new line
850
    # create new line
851
    $sql = 'INSERT INTO accountlines ' .
851
    $sql = 'INSERT INTO accountlines ' .
852
    '(borrowernumber, accountno,date,amount,description,accounttype,amountoutstanding,manager_id) ' .
852
    '(borrowernumber, accountno,date,amount,description,accounttype,amountoutstanding,manager_id,note) ' .
853
    q|VALUES (?,?,now(),?,'Payment,thanks','Pay',?,?)|;
853
    q|VALUES (?,?,now(),?,'Payment,thanks','Pay',?,?,?)|;
854
    $dbh->do($sql,{},$borrowernumber, $nextaccntno, 0 - $amount, 0 - $amountleft, $manager_id );
854
    $dbh->do($sql,{},$borrowernumber, $nextaccntno, 0 - $amount, 0 - $amountleft, $manager_id, $note );
855
    UpdateStats( $branch, 'payment', $amount, '', '', '', $borrowernumber, $nextaccntno );
855
    UpdateStats( $branch, 'payment', $amount, '', '', '', $borrowernumber, $nextaccntno );
856
856
857
    if ( C4::Context->preference("FinesLog") ) {
857
    if ( C4::Context->preference("FinesLog") ) {
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt (-1 / +1 lines)
Lines 45-51 Link Here
45
   [% IF ( loop.odd ) %]<tr>[% ELSE %]<tr class="highlight">[% END %]
45
   [% IF ( loop.odd ) %]<tr>[% ELSE %]<tr class="highlight">[% END %]
46
      <td>[% account.date %]</td>
46
      <td>[% account.date %]</td>
47
      <td>[% account.description %]&nbsp;[% IF ( account.itemnumber ) %]<a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=[% account.biblionumber %]&amp;itemnumber=[% account.itemnumber %]">View item</a>&nbsp;[% END %][% account.title |html %]</td>
47
      <td>[% account.description %]&nbsp;[% IF ( account.itemnumber ) %]<a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=[% account.biblionumber %]&amp;itemnumber=[% account.itemnumber %]">View item</a>&nbsp;[% END %][% account.title |html %]</td>
48
      <td>[% account.note %]</td>
48
      <td>[% account.note | html_line_break %]</td>
49
      [% IF ( account.amountcredit ) %]<td class="credit">[% ELSE %]<td class="debit">[% END %][% account.amount %]</td>
49
      [% IF ( account.amountcredit ) %]<td class="credit">[% ELSE %]<td class="debit">[% END %][% account.amount %]</td>
50
      [% IF ( account.amountoutstandingcredit ) %]<td class="credit">[% ELSE %]<td class="debit">[% END %][% account.amountoutstanding %]</td>
50
      [% IF ( account.amountoutstandingcredit ) %]<td class="credit">[% ELSE %]<td class="debit">[% END %][% account.amountoutstanding %]</td>
51
    [% IF ( reverse_col ) %]
51
    [% IF ( reverse_col ) %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/pay.tt (-3 / +3 lines)
Lines 62-68 Link Here
62
</thead>
62
</thead>
63
<tfoot>
63
<tfoot>
64
<tr>
64
<tr>
65
    <td class="total" colspan="7">Total Due:</td>
65
    <td class="total" colspan="8">Total Due:</td>
66
    <td>[% total | format('%.2f') %]</td>
66
    <td>[% total | format('%.2f') %]</td>
67
</tr>
67
</tr>
68
</tfoot>
68
</tfoot>
Lines 93-99 Link Here
93
    <input type="hidden" name="totals[% line.accountno %]" value="[% line.totals %]" />
93
    <input type="hidden" name="totals[% line.accountno %]" value="[% line.totals %]" />
94
    </td>
94
    </td>
95
    <td>[% line.description %] ([% line.title |html_entity %])</td>
95
    <td>[% line.description %] ([% line.title |html_entity %])</td>
96
    <td><input type="text" name="payment_note_[% line.accountno %]"></input></td>
96
    <td><input type="text" name="payment_note_[% line.accountno %]" /></td>
97
    <td>[% line.accounttype %]</td>
97
    <td>[% line.accounttype %]</td>
98
    <td>[% line.notify_id %]</td>
98
    <td>[% line.notify_id %]</td>
99
    <td>[% line.notify_level %]</td>
99
    <td>[% line.notify_level %]</td>
Lines 104-110 Link Here
104
[% IF ( account_grp.total ) %]
104
[% IF ( account_grp.total ) %]
105
<tr>
105
<tr>
106
106
107
    <td class="total" colspan="7">Sub total:</td>
107
    <td class="total" colspan="8">Sub total:</td>
108
    <td>[% account_grp.total | format('%.2f') %]</td>
108
    <td>[% account_grp.total | format('%.2f') %]</td>
109
</tr>
109
</tr>
110
[% END %]
110
[% END %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/paycollect.tt (+4 lines)
Lines 211-216 function moneyFormat(textObj) { Link Here
211
        <!-- default to paying all -->
211
        <!-- default to paying all -->
212
        <input name="paid" id="paid" value="[% total | format('%.2f') %]" onchange="moneyFormat(document.payfine.paid)"/>
212
        <input name="paid" id="paid" value="[% total | format('%.2f') %]" onchange="moneyFormat(document.payfine.paid)"/>
213
    </li>
213
    </li>
214
    <li>
215
        <label for="selected_accts_notes">Note: </label>
216
        <textarea name="selected_accts_notes" id="selected_accts_notes">[% selected_accts_notes %]</textarea>
217
    </li>
214
    </ol>
218
    </ol>
215
    </fieldset>
219
    </fieldset>
216
    <div class="action"><input type="submit" name="submitbutton" value="Confirm" />
220
    <div class="action"><input type="submit" name="submitbutton" value="Confirm" />
(-)a/members/pay.pl (-1 / +3 lines)
Lines 246-255 sub payselected { Link Here
246
    }
246
    }
247
    $amt = '&amt=' . $amt;
247
    $amt = '&amt=' . $amt;
248
    my $sel = '&selected=' . join ',', @lines_to_pay;
248
    my $sel = '&selected=' . join ',', @lines_to_pay;
249
    my $notes = '&notes=' . join("%0A", map { $input->param("payment_note_$_") } @lines_to_pay );
249
    my $redirect =
250
    my $redirect =
250
        "/cgi-bin/koha/members/paycollect.pl?borrowernumber=$borrowernumber"
251
        "/cgi-bin/koha/members/paycollect.pl?borrowernumber=$borrowernumber"
251
      . $amt
252
      . $amt
252
      . $sel;
253
      . $sel
254
      . $notes;
253
255
254
    print $input->redirect($redirect);
256
    print $input->redirect($redirect);
255
    return;
257
    return;
(-)a/members/paycollect.pl (-4 / +4 lines)
Lines 93-99 if ( $individual || $writeoff ) { Link Here
93
    $total_due = $input->param('amt');
93
    $total_due = $input->param('amt');
94
    $template->param(
94
    $template->param(
95
        selected_accts => $select_lines,
95
        selected_accts => $select_lines,
96
        amt            => $total_due
96
        amt            => $total_due,
97
        selected_accts_notes => $input->param('notes'),
97
    );
98
    );
98
}
99
}
99
100
Lines 120-127 if ( $total_paid and $total_paid ne '0.00' ) { Link Here
120
                    $select = $1;    # ensure passing no junk
121
                    $select = $1;    # ensure passing no junk
121
                }
122
                }
122
                my @acc = split /,/, $select;
123
                my @acc = split /,/, $select;
123
                recordpayment_selectaccts( $borrowernumber, $total_paid,
124
                my $note = $input->param('selected_accts_notes');
124
                    \@acc );
125
                recordpayment_selectaccts( $borrowernumber, $total_paid, \@acc, $note );
125
            } else {
126
            } else {
126
                recordpayment( $borrowernumber, $total_paid );
127
                recordpayment( $borrowernumber, $total_paid );
127
            }
128
            }
128
- 

Return to bug 6413