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 129-138 Link Here
129
    <td colspan="12">Total due</td>
129
    <td colspan="12">Total due</td>
130
    [% IF ( totalcredit ) %]
130
    [% IF ( totalcredit ) %]
131
        <td class="credit" style="text-align: right;">[% total | $Price %]</td>
131
        <td class="credit" style="text-align: right;">[% total | $Price %]</td>
132
        <td>
133
          [% IF CAN_user_updatecharges_payout %]
134
          <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>
135
        [% END %]
136
        </td>
132
    [% ELSE %]
137
    [% ELSE %]
133
       <td class="debit"style="text-align: right;">[% total | $Price %]</td>
138
       <td class="debit"style="text-align: right;">[% total | $Price %]</td>
139
       <td></td>
134
    [% END %]
140
    [% END %]
135
    <td></td>
136
  </tr>
141
  </tr>
137
  </tfoot>
142
  </tfoot>
138
</table>
143
</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