Minor changes to pay.pl and paycollect.tt to allow writing off a partial amount of a fine.
Test plan:
0) Go to the Fines tab of a test patron's profile
1) Create a fine if there are none (under the Manual invoice tab)
2) Go to the "Pay fines" tab
3) Press the write off button on the corresponding account line
Without patch, you'll be asked to confirm, but will not be able to edit the amount
With patch, you'll be able to edit the amount.
Followed test plan, patch worked as described. Also ran QA test tool and
modified files passed
Signed-off-by: Simon Pouchol <simon.pouchol@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
<li>
<label for="paid">Collect from patron: </label>
<!-- default to paying all -->
<li>
<label for="paid">Collect from patron: </label>
<!-- default to paying all -->
- <input name="paid" id="paid" value="[% amountoutstanding | format('%.2f') %]" />
+ <input name="paid" id="paid" value="[% amountoutstanding %]" />
<input type="hidden" name="description" id="description" value="[% description %]" />
<input type="hidden" name="accounttype" id="accounttype" value="[% accounttype %]" />
<input type="hidden" name="amount" id="amount" value="[% amount %]" />
<input type="hidden" name="description" id="description" value="[% description %]" />
<input type="hidden" name="accounttype" id="accounttype" value="[% accounttype %]" />
<input type="hidden" name="amount" id="amount" value="[% amount %]" />
- <input type="hidden" name="amountoutstanding" id="amountoutstanding" value="[% amountoutstanding %]" />
<input type="hidden" name="accountlines_id" id="accountlines_id" value="[% accountlines_id %]" />
<input type="hidden" name="title" id="title" value="[% title %]" />
<input type="hidden" name="payment_note" id="payment_note" value="[% payment_note %]" />
<input type="hidden" name="accountlines_id" id="accountlines_id" value="[% accountlines_id %]" />
<input type="hidden" name="title" id="title" value="[% title %]" />
<input type="hidden" name="payment_note" id="payment_note" value="[% payment_note %]" />
<th>Amount</th>
<th>Amount outstanding</th>
</tr></thead>
<th>Amount</th>
<th>Amount outstanding</th>
</tr></thead>
- <tfoot><td colspan="3">Total amount to be written off:</td><td>[% amountoutstanding | format('%.2f') %]</td></tfoot>
+ <tfoot><td colspan="3">Total amount outstanding:</td><td>[% amountoutstanding | format('%.2f') %]</td></tfoot>
<tbody><tr>
<td>[% description %] [% title %]</td>
<td>[% accounttype %]</td>
<tbody><tr>
<td>[% description %] [% title %]</td>
<td>[% accounttype %]</td>
<td class="debit">[% amountoutstanding | format('%.2f') %]</td>
</tr></tbody>
</table>
<td class="debit">[% amountoutstanding | format('%.2f') %]</td>
</tr></tbody>
</table>
- </fieldset>
- <div class="action"><input type="submit" name="confirm_writeoff" id="confirm_writeoff" value="Write off this charge" />
+
+ <ol>
+ <li>
+ <label for="paid">Writeoff amount: </label>
+ <!-- default to writing off all -->
+ <input name="amountwrittenoff" id="amountwrittenoff" value="[% amountoutstanding %]" />
+ </li>
+ </ol>
+ </fieldset>
+ <div class="action"><input type="submit" name="confirm_writeoff" id="confirm_writeoff" value="Write off this charge" />
<a class="cancel" href="/cgi-bin/koha/members/pay.pl?borrowernumber=[% borrower.borrowernumber %]">Cancel</a></div>
</form>
[% ELSE %]
<a class="cancel" href="/cgi-bin/koha/members/pay.pl?borrowernumber=[% borrower.borrowernumber %]">Cancel</a></div>
</form>
[% ELSE %]
writeoff_all(@names);
} elsif ($writeoff_item) {
my $accountlines_id = $input->param('accountlines_id');
writeoff_all(@names);
} elsif ($writeoff_item) {
my $accountlines_id = $input->param('accountlines_id');
- my $amount = $input->param('amountoutstanding');
+ my $amount = $input->param('amountwrittenoff');
my $payment_note = $input->param("payment_note");
Koha::Account->new( { patron_id => $borrowernumber } )->pay(
my $payment_note = $input->param("payment_note");
Koha::Account->new( { patron_id => $borrowernumber } )->pay(