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

(-)a/C4/Accounts.pm (-35 / +4 lines)
Lines 146-152 sub recordpayment { Link Here
146
    my $usth = $dbh->prepare(
146
    my $usth = $dbh->prepare(
147
        "INSERT INTO accountlines
147
        "INSERT INTO accountlines
148
  (borrowernumber, accountno,date,amount,description,accounttype,amountoutstanding,manager_id)
148
  (borrowernumber, accountno,date,amount,description,accounttype,amountoutstanding,manager_id)
149
  VALUES (?,?,now(),?,'Payment,thanks','Pay',?,?)"
149
  VALUES (?,?,now(),?,'','Pay',?,?)"
150
    );
150
    );
151
    $usth->execute( $borrowernumber, $nextaccntno, 0 - $data, 0 - $amountleft, $manager_id );
151
    $usth->execute( $borrowernumber, $nextaccntno, 0 - $data, 0 - $amountleft, $manager_id );
152
152
Lines 208-214 sub makepayment { Link Here
208
        my $udp = 		
208
        my $udp = 		
209
            $dbh->prepare(
209
            $dbh->prepare(
210
                "UPDATE accountlines
210
                "UPDATE accountlines
211
                    SET amountoutstanding = 0, description = 'Payment,thanks'
211
                    SET amountoutstanding = 0
212
                    WHERE accountlines_id = ?
212
                    WHERE accountlines_id = ?
213
                "
213
                "
214
            );
214
            );
Lines 231-237 sub makepayment { Link Here
231
            $dbh->prepare( 
231
            $dbh->prepare( 
232
                "INSERT 
232
                "INSERT 
233
                    INTO accountlines (borrowernumber, accountno, date, amount, itemnumber, description, accounttype, amountoutstanding, manager_id, note)
233
                    INTO accountlines (borrowernumber, accountno, date, amount, itemnumber, description, accounttype, amountoutstanding, manager_id, note)
234
                    VALUES ( ?, ?, now(), ?, ?, 'Payment,thanks', 'Pay', 0, ?, ?)"
234
                    VALUES ( ?, ?, now(), ?, ?, '', 'Pay', 0, ?, ?)"
235
            );
235
            );
236
        $ins->execute($borrowernumber, $nextaccntno, $payment, $data->{'itemnumber'}, $manager_id, $payment_note);
236
        $ins->execute($borrowernumber, $nextaccntno, $payment, $data->{'itemnumber'}, $manager_id, $payment_note);
237
    }
237
    }
Lines 413-449 sub manualinvoice { Link Here
413
    my $accountno  = getnextacctno($borrowernumber);
413
    my $accountno  = getnextacctno($borrowernumber);
414
    my $amountleft = $amount;
414
    my $amountleft = $amount;
415
415
416
#    if (   $type eq 'CS'
417
#        || $type eq 'CB'
418
#        || $type eq 'CW'
419
#        || $type eq 'CF'
420
#        || $type eq 'CL' )
421
#    {
422
#        my $amount2 = $amount * -1;    # FIXME - $amount2 = -$amount
423
#        $amountleft =
424
#          fixcredit( $borrowernumber, $amount2, $itemnum, $type, $user );
425
#    }
426
    if ( $type eq 'N' ) {
427
        $desc .= " New Card";
428
    }
429
    if ( $type eq 'F' ) {
430
        $desc .= " Fine";
431
    }
432
    if ( $type eq 'A' ) {
433
        $desc .= " Account Management fee";
434
    }
435
    if ( $type eq 'M' ) {
436
        $desc .= " Sundry";
437
    }
438
439
    if ( $type eq 'L' && $desc eq '' ) {
440
441
        $desc = " Lost Item";
442
    }
443
#    if ( $type eq 'REF' ) {
444
#        $desc .= " Cash Refund";
445
#        $amountleft = refund( '', $borrowernumber, $amount );
446
#    }
447
    if (   ( $type eq 'L' )
416
    if (   ( $type eq 'L' )
448
        or ( $type eq 'F' )
417
        or ( $type eq 'F' )
449
        or ( $type eq 'A' )
418
        or ( $type eq 'A' )
Lines 835-841 sub recordpayment_selectaccts { Link Here
835
    # create new line
804
    # create new line
836
    $sql = 'INSERT INTO accountlines ' .
805
    $sql = 'INSERT INTO accountlines ' .
837
    '(borrowernumber, accountno,date,amount,description,accounttype,amountoutstanding,manager_id,note) ' .
806
    '(borrowernumber, accountno,date,amount,description,accounttype,amountoutstanding,manager_id,note) ' .
838
    q|VALUES (?,?,now(),?,'Payment,thanks','Pay',?,?,?)|;
807
    q|VALUES (?,?,now(),?,'','Pay',?,?,?)|;
839
    $dbh->do($sql,{},$borrowernumber, $nextaccntno, 0 - $amount, 0 - $amountleft, $manager_id, $note );
808
    $dbh->do($sql,{},$borrowernumber, $nextaccntno, 0 - $amount, 0 - $amountleft, $manager_id, $note );
840
    UpdateStats( $branch, 'payment', $amount, '', '', '', $borrowernumber, $nextaccntno );
809
    UpdateStats( $branch, 'payment', $amount, '', '', '', $borrowernumber, $nextaccntno );
841
810
(-)a/installer/data/mysql/updatedatabase.pl (+20 lines)
Lines 7330-7335 if ( CheckVersion($DBversion) ) { Link Here
7330
    SetVersion($DBversion);
7330
    SetVersion($DBversion);
7331
}
7331
}
7332
7332
7333
7334
$DBversion = "3.13.00.XXX";
7335
if ( CheckVersion($DBversion) ) {
7336
    $dbh->do(q{
7337
        UPDATE accountlines
7338
        SET description = ''
7339
        WHERE description IN (
7340
            ' New Card',
7341
            ' Fine',
7342
            ' Sundry',
7343
            'Writeoff',
7344
            ' Account Management fee',
7345
            'Payment,thanks', 'Payment,thanks - ',
7346
            ' Lost Item'
7347
        )
7348
    });
7349
    print "Upgrade to $DBversion done (Bug 2546: Update fine descriptions)\n";
7350
    SetVersion($DBversion);
7351
}
7352
7333
=head1 FUNCTIONS
7353
=head1 FUNCTIONS
7334
7354
7335
=head2 TableExists($table)
7355
=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