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

(-)a/C4/Accounts.pm (-5 / +7 lines)
Lines 135-141 sub recordpayment { Link Here
135
135
136
=head2 makepayment
136
=head2 makepayment
137
137
138
  &makepayment($borrowernumber, $acctnumber, $amount, $branchcode);
138
  &makepayment($borrowernumber, $acctnumber, $amount, $branchcode, $modeofpayment, $receiptno, $notes);
139
139
140
Records the fact that a patron has paid off the entire amount he or
140
Records the fact that a patron has paid off the entire amount he or
141
she owes.
141
she owes.
Lines 144-150 C<$borrowernumber> is the patron's borrower number. C<$acctnumber> is Link Here
144
the account that was credited. C<$amount> is the amount paid (this is
144
the account that was credited. C<$amount> is the amount paid (this is
145
only used to record the payment. It is assumed to be equal to the
145
only used to record the payment. It is assumed to be equal to the
146
amount owed). C<$branchcode> is the code of the branch where payment
146
amount owed). C<$branchcode> is the code of the branch where payment
147
was made.
147
was made. C<$modeofpayment> is the code to capture mode of payment via cash, cheque etc.
148
C<$receiptno> is the code to capture receiptnumber.
149
C<$notes> is the code to capture notes.
148
150
149
=cut
151
=cut
150
152
Lines 156-162 sub makepayment { Link Here
156
    #here we update both the accountoffsets and the account lines
158
    #here we update both the accountoffsets and the account lines
157
    #updated to check, if they are paying off a lost item, we return the item
159
    #updated to check, if they are paying off a lost item, we return the item
158
    # from their card, and put a note on the item record
160
    # from their card, and put a note on the item record
159
    my ( $borrowernumber, $accountno, $amount, $user, $branch ) = @_;
161
    my ( $borrowernumber, $accountno, $amount, $user, $branch, $modeofpayment, $receiptno, $notes) = @_;
160
    my $dbh = C4::Context->dbh;
162
    my $dbh = C4::Context->dbh;
161
163
162
    # begin transaction
164
    # begin transaction
Lines 190-198 sub makepayment { Link Here
190
    $dbh->do( "
192
    $dbh->do( "
191
        INSERT INTO     accountlines
193
        INSERT INTO     accountlines
192
                        (borrowernumber, accountno, date, amount,
194
                        (borrowernumber, accountno, date, amount,
193
                         description, accounttype, amountoutstanding)
195
                         description, accounttype, amountoutstanding, modeofpayment, receiptno, notes)
194
        VALUES          ($borrowernumber, $nextaccntno, now(), $payment,
196
        VALUES          ($borrowernumber, $nextaccntno, now(), $payment,
195
                        'Payment,thanks - $user', 'Pay', 0)
197
                        'Payment,thanks - $user', 'Pay', 0, '$modeofpayment', '$receiptno', '$notes')
196
        " );
198
        " );
197
199
198
    # FIXME - The second argument to &UpdateStats is supposed to be the
200
    # FIXME - The second argument to &UpdateStats is supposed to be the
(-)a/installer/data/mysql/kohastructure.sql (+3 lines)
Lines 2289-2294 CREATE TABLE `accountlines` ( Link Here
2289
  `timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
2289
  `timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
2290
  `notify_id` int(11) NOT NULL default 0,
2290
  `notify_id` int(11) NOT NULL default 0,
2291
  `notify_level` int(2) NOT NULL default 0,
2291
  `notify_level` int(2) NOT NULL default 0,
2292
  `modeofpayment`  varchar(5) default NULL,
2293
  `receiptno`  varchar(10) default NULL,
2294
  `notes`  varchar(100) default NULL,
2292
  KEY `acctsborridx` (`borrowernumber`),
2295
  KEY `acctsborridx` (`borrowernumber`),
2293
  KEY `timeidx` (`timestamp`),
2296
  KEY `timeidx` (`timestamp`),
2294
  KEY `itemnumber` (`itemnumber`),
2297
  KEY `itemnumber` (`itemnumber`),
(-)a/installer/data/mysql/updatedatabase.pl (+9 lines)
Lines 3937-3942 if (C4::Context->preference("Version") < TransformToNum($DBversion)) { Link Here
3937
   SetVersion ($DBversion);
3937
   SetVersion ($DBversion);
3938
}
3938
}
3939
3939
3940
$DBversion = '3.03.00.013';
3941
if ( C4::Context->preference('Version') < TransformToNum($DBversion) ) {
3942
    $dbh->do('ALTER TABLE accountlines ADD modeofpayment varchar(5) default NULL');
3943
    $dbh->do('ALTER TABLE accountlines ADD receiptno varchar(10) default NULL');
3944
    $dbh->do('ALTER TABLE accountlines ADD notes varchar(100) default NULL');
3945
    print "Upgrade to $DBversion done (updating 3 fields in accountlines table)\n";
3946
    SetVersion($DBversion);
3947
}
3948
3940
=head1 FUNCTIONS
3949
=head1 FUNCTIONS
3941
3950
3942
=head2 DropAllForeignKeys($table)
3951
=head2 DropAllForeignKeys($table)
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tmpl (-1 / +7 lines)
Lines 32-37 Link Here
32
    <th>Description of charges</th>
32
    <th>Description of charges</th>
33
    <th>Amount</th>
33
    <th>Amount</th>
34
    <th>Outstanding</th>
34
    <th>Outstanding</th>
35
    <th>Mode of Payment</th>
36
    <th>Receipt No.</th>
37
    <th>Notes</th>
35
    <!-- TMPL_IF NAME="reverse_col" -->
38
    <!-- TMPL_IF NAME="reverse_col" -->
36
    <th>&nbsp;</th>
39
    <th>&nbsp;</th>
37
    <!-- /TMPL_IF -->
40
    <!-- /TMPL_IF -->
Lines 46-51 Link Here
46
      <td><!-- TMPL_VAR NAME="description" -->&nbsp;<!-- TMPL_IF NAME="itemnumber" --><a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->&amp;itemnumber=<!-- TMPL_VAR NAME="itemnumber" -->">View item</a>&nbsp;<!-- /TMPL_IF --><!-- TMPL_IF NAME="printtitle" --> <!-- TMPL_VAR NAME="title" escape="html" --><!-- /TMPL_IF --></td>
49
      <td><!-- TMPL_VAR NAME="description" -->&nbsp;<!-- TMPL_IF NAME="itemnumber" --><a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->&amp;itemnumber=<!-- TMPL_VAR NAME="itemnumber" -->">View item</a>&nbsp;<!-- /TMPL_IF --><!-- TMPL_IF NAME="printtitle" --> <!-- TMPL_VAR NAME="title" escape="html" --><!-- /TMPL_IF --></td>
47
      <!-- TMPL_IF NAME="amountcredit" --><td class="credit"><!-- TMPL_ELSE --><td class="debit"><!-- /TMPL_IF --><!-- TMPL_VAR NAME="amount" --></td>
50
      <!-- TMPL_IF NAME="amountcredit" --><td class="credit"><!-- TMPL_ELSE --><td class="debit"><!-- /TMPL_IF --><!-- TMPL_VAR NAME="amount" --></td>
48
      <!-- TMPL_IF NAME="amountoutstandingcredit" --><td class="credit"><!-- TMPL_ELSE --><td class="debit"><!-- /TMPL_IF --><!-- TMPL_VAR NAME="amountoutstanding" --></td>
51
      <!-- TMPL_IF NAME="amountoutstandingcredit" --><td class="credit"><!-- TMPL_ELSE --><td class="debit"><!-- /TMPL_IF --><!-- TMPL_VAR NAME="amountoutstanding" --></td>
52
      <td><!-- TMPL_VAR NAME="modeofpayment" --></td>
53
      <td><!-- TMPL_VAR NAME="receiptno" --></td>
54
      <td><!-- TMPL_VAR NAME="notes" --></td>
49
    <!-- TMPL_IF NAME="reverse_col" -->
55
    <!-- TMPL_IF NAME="reverse_col" -->
50
      <td>
56
      <td>
51
	<!-- TMPL_IF NAME="payment" -->
57
	<!-- TMPL_IF NAME="payment" -->
Lines 67-73 Link Here
67
  <!-- /TMPL_LOOP -->
73
  <!-- /TMPL_LOOP -->
68
<tfoot>
74
<tfoot>
69
  <tr>
75
  <tr>
70
    <td colspan="4">Total due</td>
76
    <td colspan="7">Total due</td>
71
    <!-- TMPL_IF NAME="totalcredit" --><td colspan="2" class="credit"><!-- TMPL_ELSE --><td colspan="2" class="debit"><!-- /TMPL_IF --><!-- TMPL_VAR NAME="total" --></td>
77
    <!-- TMPL_IF NAME="totalcredit" --><td colspan="2" class="credit"><!-- TMPL_ELSE --><td colspan="2" class="debit"><!-- /TMPL_IF --><!-- TMPL_VAR NAME="total" --></td>
72
  </tr>
78
  </tr>
73
  </tfoot>
79
  </tfoot>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/pay.tmpl (-2 / +12 lines)
Lines 31-36 Link Here
31
<table>
31
<table>
32
<tr>
32
<tr>
33
	<th>Fines &amp; Charges</th>
33
	<th>Fines &amp; Charges</th>
34
	<th> Mode of Payment </th>
35
        <th> Receipt No </th>
36
        <th> Notes </th>
34
	<th>Description</th>
37
	<th>Description</th>
35
	<th>Account Type</th>
38
	<th>Account Type</th>
36
	<th>Notify id</th>
39
	<th>Notify id</th>
Lines 60-65 Link Here
60
	<input type="hidden" name="notify_level<!-- TMPL_VAR name="i" -->" value="<!-- TMPL_VAR name="notify_level" -->" />
63
	<input type="hidden" name="notify_level<!-- TMPL_VAR name="i" -->" value="<!-- TMPL_VAR name="notify_level" -->" />
61
	<input type="hidden" name="totals<!-- TMPL_VAR name="i" -->" value="<!-- TMPL_VAR name="totals" -->" />
64
	<input type="hidden" name="totals<!-- TMPL_VAR name="i" -->" value="<!-- TMPL_VAR name="totals" -->" />
62
	</td>
65
	</td>
66
	 <td>
67
        <select name="modeofpayment" id="modeofpayment<!-- TMPL_VAR name="i" -->">
68
 	<option value="Cash">Cash</option>
69
	<option value="Cheque">Cheque</option>
70
	</select></td>
71
        <td><input type="text" size=20 id="receiptno" name="receiptno<!-- TMPL_VAR name="i" -->"</td>
72
        <td><input type="text" size=20 name="notes<!-- TMPL_VAR name="i" -->" /></td>
63
	<td><!-- TMPL_VAR name="description" --> <!-- TMPL_VAR name="title" escape="html" --></td>
73
	<td><!-- TMPL_VAR name="description" --> <!-- TMPL_VAR name="title" escape="html" --></td>
64
	<td><!-- TMPL_VAR name="accounttype" --></td>
74
	<td><!-- TMPL_VAR name="accounttype" --></td>
65
	<td><!-- TMPL_VAR name="notify_id" --></td>
75
	<td><!-- TMPL_VAR name="notify_id" --></td>
Lines 71-83 Link Here
71
<!-- TMPL_IF  NAME="total"-->
81
<!-- TMPL_IF  NAME="total"-->
72
<tr>
82
<tr>
73
83
74
	<td colspan="6">Sub Total</td>
84
	<td colspan="9">Sub Total</td>
75
	<td><!-- TMPL_VAR name="total" --></td>
85
	<td><!-- TMPL_VAR name="total" --></td>
76
</tr>
86
</tr>
77
<!--/TMPL_IF-->
87
<!--/TMPL_IF-->
78
<!-- /TMPL_LOOP  -->
88
<!-- /TMPL_LOOP  -->
79
<tr>
89
<tr>
80
	<td colspan="6">Total Due</td>
90
	<td colspan="9">Total Due</td>
81
	<td><!-- TMPL_VAR name="total" --></td>
91
	<td><!-- TMPL_VAR name="total" --></td>
82
</tr>
92
</tr>
83
</table>
93
</table>
(-)a/kohaversion.pl (-1 / +1 lines)
Lines 16-22 the kohaversion is divided in 4 parts : Link Here
16
use strict;
16
use strict;
17
17
18
sub kohaversion {
18
sub kohaversion {
19
    our $VERSION = '3.03.00.012';
19
    our $VERSION = '3.03.00.013';
20
    # version needs to be set this way
20
    # version needs to be set this way
21
    # so that it can be picked up by Makefile.PL
21
    # so that it can be picked up by Makefile.PL
22
    # during install
22
    # during install
(-)a/members/pay.pl (-2 / +7 lines)
Lines 80-86 for ( my $i = 0 ; $i < @names ; $i++ ) { Link Here
80
        my $amount         = $input->param( $names[ $i + 4 ] );
80
        my $amount         = $input->param( $names[ $i + 4 ] );
81
        my $borrowernumber = $input->param( $names[ $i + 5 ] );
81
        my $borrowernumber = $input->param( $names[ $i + 5 ] );
82
        my $accountno      = $input->param( $names[ $i + 6 ] );
82
        my $accountno      = $input->param( $names[ $i + 6 ] );
83
        makepayment( $borrowernumber, $accountno, $amount, $user, $branch );
83
	my $modeofpayment  = $input->param( $names[ $i + 10 ] ); 
84
        my $receiptno      = $input->param( $names[ $i + 11 ] ); 
85
        my $notes          = $input->param( $names[ $i + 12 ] ); 
86
        makepayment( $borrowernumber, $accountno, $amount, $user, $branch, $modeofpayment, $receiptno, $notes);
84
        $check = 2;
87
        $check = 2;
85
    }
88
    }
86
}
89
}
Lines 118-123 if ( $check == 0 ) { Link Here
118
                $line{notify_id}      = $accts->[$i]{'notify_id'};
121
                $line{notify_id}      = $accts->[$i]{'notify_id'};
119
                $line{notify_level}   = $accts->[$i]{'notify_level'};
122
                $line{notify_level}   = $accts->[$i]{'notify_level'};
120
                $line{net_balance} = 1 if($accts->[$i]{'amountoutstanding'} > 0); # you can't pay a credit.
123
                $line{net_balance} = 1 if($accts->[$i]{'amountoutstanding'} > 0); # you can't pay a credit.
124
		$line{modeofpayment}  = $accts->[$i]{'modeofpayment'};
125
		$line{receiptno}  = $accts->[$i]{'receiptno'};
126
		$line{notes}  = $accts->[$i]{'notes'};
121
                push( @loop_pay, \%line );
127
                push( @loop_pay, \%line );
122
            }
128
            }
123
        }
129
        }
124
- 

Return to bug 5620