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

(-)a/C4/Accounts.pm (-21 / +4 lines)
Lines 145-151 sub recordpayment { Link Here
145
    my $usth = $dbh->prepare(
145
    my $usth = $dbh->prepare(
146
        "INSERT INTO accountlines
146
        "INSERT INTO accountlines
147
  (borrowernumber, accountno,date,amount,description,accounttype,amountoutstanding,manager_id)
147
  (borrowernumber, accountno,date,amount,description,accounttype,amountoutstanding,manager_id)
148
  VALUES (?,?,now(),?,'Payment,thanks','Pay',?,?)"
148
  VALUES (?,?,now(),?,'','Pay',?,?)"
149
    );
149
    );
150
    $usth->execute( $borrowernumber, $nextaccntno, 0 - $data, 0 - $amountleft, $manager_id );
150
    $usth->execute( $borrowernumber, $nextaccntno, 0 - $data, 0 - $amountleft, $manager_id );
151
151
Lines 207-213 sub makepayment { Link Here
207
        my $udp = 		
207
        my $udp = 		
208
            $dbh->prepare(
208
            $dbh->prepare(
209
                "UPDATE accountlines
209
                "UPDATE accountlines
210
                    SET amountoutstanding = 0, description = 'Payment,thanks'
210
                    SET amountoutstanding = 0
211
                    WHERE accountlines_id = ?
211
                    WHERE accountlines_id = ?
212
                "
212
                "
213
            );
213
            );
Lines 230-236 sub makepayment { Link Here
230
            $dbh->prepare( 
230
            $dbh->prepare( 
231
                "INSERT 
231
                "INSERT 
232
                    INTO accountlines (borrowernumber, accountno, date, amount, itemnumber, description, accounttype, amountoutstanding, manager_id, note)
232
                    INTO accountlines (borrowernumber, accountno, date, amount, itemnumber, description, accounttype, amountoutstanding, manager_id, note)
233
                    VALUES ( ?, ?, now(), ?, ?, 'Payment,thanks', 'Pay', 0, ?, ?)"
233
                    VALUES ( ?, ?, now(), ?, ?, '', 'Pay', 0, ?, ?)"
234
            );
234
            );
235
        $ins->execute($borrowernumber, $nextaccntno, $payment, $data->{'itemnumber'}, $manager_id, $payment_note);
235
        $ins->execute($borrowernumber, $nextaccntno, $payment, $data->{'itemnumber'}, $manager_id, $payment_note);
236
    }
236
    }
Lines 412-434 sub manualinvoice { Link Here
412
    my $accountno  = getnextacctno($borrowernumber);
412
    my $accountno  = getnextacctno($borrowernumber);
413
    my $amountleft = $amount;
413
    my $amountleft = $amount;
414
414
415
    if ( $type eq 'N' ) {
416
        $desc .= " New Card";
417
    }
418
    if ( $type eq 'F' ) {
419
        $desc .= " Fine";
420
    }
421
    if ( $type eq 'A' ) {
422
        $desc .= " Account Management fee";
423
    }
424
    if ( $type eq 'M' ) {
425
        $desc .= " Sundry";
426
    }
427
428
    if ( $type eq 'L' && $desc eq '' ) {
429
430
        $desc = " Lost Item";
431
    }
432
    if (   ( $type eq 'L' )
415
    if (   ( $type eq 'L' )
433
        or ( $type eq 'F' )
416
        or ( $type eq 'F' )
434
        or ( $type eq 'A' )
417
        or ( $type eq 'A' )
Lines 657-663 sub recordpayment_selectaccts { Link Here
657
    # create new line
640
    # create new line
658
    $sql = 'INSERT INTO accountlines ' .
641
    $sql = 'INSERT INTO accountlines ' .
659
    '(borrowernumber, accountno,date,amount,description,accounttype,amountoutstanding,manager_id,note) ' .
642
    '(borrowernumber, accountno,date,amount,description,accounttype,amountoutstanding,manager_id,note) ' .
660
    q|VALUES (?,?,now(),?,'Payment,thanks','Pay',?,?,?)|;
643
    q|VALUES (?,?,now(),?,'','Pay',?,?,?)|;
661
    $dbh->do($sql,{},$borrowernumber, $nextaccntno, 0 - $amount, 0 - $amountleft, $manager_id, $note );
644
    $dbh->do($sql,{},$borrowernumber, $nextaccntno, 0 - $amount, 0 - $amountleft, $manager_id, $note );
662
    UpdateStats( $branch, 'payment', $amount, '', '', '', $borrowernumber, $nextaccntno );
645
    UpdateStats( $branch, 'payment', $amount, '', '', '', $borrowernumber, $nextaccntno );
663
646
(-)a/installer/data/mysql/updatedatabase.pl (+19 lines)
Lines 7762-7767 if ( CheckVersion($DBversion) ) { Link Here
7762
    SetVersion ($DBversion);
7762
    SetVersion ($DBversion);
7763
}
7763
}
7764
7764
7765
$DBversion = "3.15.00.XXX";
7766
if ( CheckVersion($DBversion) ) {
7767
    $dbh->do(q{
7768
        UPDATE accountlines
7769
        SET description = ''
7770
        WHERE description IN (
7771
            ' New Card',
7772
            ' Fine',
7773
            ' Sundry',
7774
            'Writeoff',
7775
            ' Account Management fee',
7776
            'Payment,thanks', 'Payment,thanks - ',
7777
            ' Lost Item'
7778
        )
7779
    });
7780
    print "Upgrade to $DBversion done (Bug 2546: Update fine descriptions)\n";
7781
    SetVersion($DBversion);
7782
}
7783
7765
=head1 FUNCTIONS
7784
=head1 FUNCTIONS
7766
7785
7767
=head2 TableExists($table)
7786
=head2 TableExists($table)
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt (-1 / +13 lines)
Lines 44-50 Link Here
44
44
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>
48
        [% SWITCH account.accounttype %]
49
          [% CASE 'Pay' %]Payment,thanks
50
          [% CASE 'N' %]New Card
51
          [% CASE 'F' %]Fine
52
          [% CASE 'A' %]Account management fee
53
          [% CASE 'M' %]Sundry
54
          [% CASE 'L' %]Lost Item
55
          [% CASE 'W' %]Writeoff
56
          [% CASE %][% account.accounttype %]
57
        [%- END -%]
58
        [%- IF account.description %], [% account.description %][% END %]
59
        &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 | html_line_break %]</td>
60
      <td>[% account.note | html_line_break %]</td>
49
      [% IF ( account.amountcredit ) %]<td class="credit">[% ELSE %]<td class="debit">[% END %][% account.amount %]</td>
61
      [% 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>
62
      [% IF ( account.amountoutstandingcredit ) %]<td class="credit">[% ELSE %]<td class="debit">[% END %][% account.amountoutstanding %]</td>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/pay.tt (-1 / +14 lines)
Lines 112-118 function enableCheckboxActions(){ Link Here
112
    <input type="hidden" name="notify_level[% line.accountno %]" value="[% line.notify_level %]" />
112
    <input type="hidden" name="notify_level[% line.accountno %]" value="[% line.notify_level %]" />
113
    <input type="hidden" name="totals[% line.accountno %]" value="[% line.totals %]" />
113
    <input type="hidden" name="totals[% line.accountno %]" value="[% line.totals %]" />
114
    </td>
114
    </td>
115
    <td>[% line.description %] ([% line.title |html_entity %])</td>
115
    <td>
116
        [% SWITCH line.accounttype %]
117
          [% CASE 'Pay' %]Payment,thanks
118
          [% CASE 'N' %]New Card
119
          [% CASE 'F' %]Fine
120
          [% CASE 'A' %]Account management fee
121
          [% CASE 'M' %]Sundry
122
          [% CASE 'L' %]Lost Item
123
          [% CASE 'W' %]Writeoff
124
          [% CASE %][% line.accounttype %]
125
        [%- END -%]
126
        [%- IF line.description %], [% line.description %][% END %]
127
        [% IF line.title %]([% line.title |html_entity %])[% END %]
128
    </td>
116
    <td><input type="text" name="payment_note_[% line.accountno %]" /></td>
129
    <td><input type="text" name="payment_note_[% line.accountno %]" /></td>
117
    <td>[% line.accounttype %]</td>
130
    <td>[% line.accounttype %]</td>
118
    <td>[% line.notify_id %]</td>
131
    <td>[% line.notify_id %]</td>
(-)a/koha-tmpl/opac-tmpl/prog/en/modules/opac-account.tt (-3 / +14 lines)
Lines 39-46 Link Here
39
                [% FOREACH ACCOUNT_LINE IN ACCOUNT_LINES %]
39
                [% FOREACH ACCOUNT_LINE IN ACCOUNT_LINES %]
40
                    [% IF ( ACCOUNT_LINE.odd ) %]<tr class="highlight">[% ELSE %]<tr>[% END %]
40
                    [% IF ( ACCOUNT_LINE.odd ) %]<tr class="highlight">[% ELSE %]<tr>[% END %]
41
                        <td>[% ACCOUNT_LINE.date | $KohaDates %]</td>
41
                        <td>[% ACCOUNT_LINE.date | $KohaDates %]</td>
42
                        <td>[% ACCOUNT_LINE.description %]
42
                        <td>
43
                        [% IF ( ACCOUNT_LINE.title ) %][% ACCOUNT_LINE.title |html %][% END %]</td>
43
                          [% SWITCH ACCOUNT_LINE.accounttype %]
44
                            [% CASE 'Pay' %]Payment,thanks
45
                            [% CASE 'N' %]New Card
46
                            [% CASE 'F' %]Fine
47
                            [% CASE 'A' %]Account management fee
48
                            [% CASE 'M' %]Sundry
49
                            [% CASE 'L' %]Lost Item
50
                            [% CASE 'W' %]Writeoff
51
                            [% CASE %][% ACCOUNT_LINE.accounttype %]
52
                          [%- END -%]
53
                          [%- IF ACCOUNT_LINE.description %], [% ACCOUNT_LINE.description %][% END %]
54
                          [% IF line.title %]([% line.title |html_entity %])[% END %]
55
                        </td>
44
                        [% IF ( ACCOUNT_LINE.amountcredit ) %]<td class="credit">[% ELSE %]<td class="debit">[% END %][% ACCOUNT_LINE.amount %]</td>
56
                        [% IF ( ACCOUNT_LINE.amountcredit ) %]<td class="credit">[% ELSE %]<td class="debit">[% END %][% ACCOUNT_LINE.amount %]</td>
45
                        [% IF ( ACCOUNT_LINE.amountoutstandingcredit ) %]<td class="credit">[% ELSE %]<td class="debit">[% END %][% ACCOUNT_LINE.amountoutstanding %]</td>
57
                        [% IF ( ACCOUNT_LINE.amountoutstandingcredit ) %]<td class="credit">[% ELSE %]<td class="debit">[% END %][% ACCOUNT_LINE.amountoutstanding %]</td>
46
                    </tr>
58
                    </tr>
47
- 

Return to bug 2546