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

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt (-1 / +6 lines)
Lines 143-152 Link Here
143
    <td colspan="12">Total due</td>
143
    <td colspan="12">Total due</td>
144
    [% IF ( totalcredit ) %]
144
    [% IF ( totalcredit ) %]
145
        <td class="credit" style="text-align: right;">[% total | $Price %]</td>
145
        <td class="credit" style="text-align: right;">[% total | $Price %]</td>
146
        <td>
147
          [% IF CAN_user_updatecharges_payout %]
148
          <button type="button" data-toggle="modal" data-target="#issuePayoutModal" data-amount="[% total | $Price %]" class="btn btn-default btn-xs"><i class="fa fa-money"></i> Payout amount</button>
149
        [% END %]
150
        </td>
146
    [% ELSE %]
151
    [% ELSE %]
147
       <td class="debit"style="text-align: right;">[% total | $Price %]</td>
152
       <td class="debit"style="text-align: right;">[% total | $Price %]</td>
153
       <td></td>
148
    [% END %]
154
    [% END %]
149
    <td></td>
150
  </tr>
155
  </tr>
151
  </tfoot>
156
  </tfoot>
152
</table>
157
</table>
(-)a/members/boraccount.pl (-17 / +33 lines)
Lines 76-99 if ( $action eq 'void' ) { Link Here
76
}
76
}
77
77
78
if ( $action eq 'payout' ) {
78
if ( $action eq 'payout' ) {
79
    my $payment_id        = scalar $input->param('accountlines_id');
79
    my $payment_id       = scalar $input->param('accountlines_id');
80
    my $payment           = Koha::Account::Lines->find($payment_id);
81
    my $amount           = scalar $input->param('amount');
80
    my $amount           = scalar $input->param('amount');
82
    my $transaction_type = scalar $input->param('transaction_type');
81
    my $transaction_type = scalar $input->param('transaction_type');
83
    $schema->txn_do(
82
    if ( $payment_id eq "" ) {
84
        sub {
83
        $schema->txn_do(
85
            my $payout = $payment->payout(
84
            sub {
86
                {
85
                $patron->account->payout_amount(
87
                    payout_type   => $transaction_type,
86
                     {
88
                    branch        => $library_id,
87
                        payout_type   => $transaction_type,
89
                    staff_id      => $logged_in_user->id,
88
                        branch        => $library_id,
90
                    cash_register => $registerid,
89
                        staff_id      => $logged_in_user->id,
91
                    interface     => 'intranet',
90
                        cash_register => $registerid,
92
                    amount        => $amount
91
                        interface     => 'intranet',
93
                }
92
                        amount        => $amount
94
            );
93
                    }
95
        }
94
                );
96
    );
95
            }
96
        );
97
    } else {
98
        my $payment = Koha::Account::Lines->find($payment_id);
99
        $schema->txn_do(
100
            sub {
101
                my $payout = $payment->payout(
102
                    {
103
                        payout_type   => $transaction_type,
104
                        branch        => $library_id,
105
                        staff_id      => $logged_in_user->id,
106
                        cash_register => $registerid,
107
                        interface     => 'intranet',
108
                        amount        => $amount
109
                    }
110
                );
111
            }
112
        );
113
    }
97
}
114
}
98
115
99
if ( $action eq 'refund' ) {
116
if ( $action eq 'refund' ) {
100
- 

Return to bug 24300